Skip to main content

Convert a Python expression to a LaTeX formula

Project description

pytexit

Convert a Python expression to a LaTeX formula

PyPI

Tests

Coverage

Documentation

https://pytexit.readthedocs.io

Documentation Status

Install

pytexit is on PyPi:

pip install pytexit

Use

pytexit features the py2tex, for2tex for2py functions.

In a Terminal, use py2tex:

py2tex 'x = 2*sqrt(2*pi*k*T_e/m_e)*(DeltaE/(k*T_e))**2*a_0**2'

In a Python console, use py2tex:

from pytexit import py2tex
py2tex('x = 2*sqrt(2*pi*k*T_e/m_e)*(DeltaE/(k*T_e))**2*a_0**2')

returns the corresponding LaTeX formula (to re-use in papers):

$$x=2\\sqrt{\\frac{2\\pi k T_e}{m_e}} \\left(\\frac{\\Delta E}{k T_e}\\right)^2 a_0^2$$

and (in ipython console only) prints the equation:

image

References

Initial work from Geoff Reedy on StackOverflow: https://stackoverflow.com/a/3874621/5622825 . Kudos.

Similar projects:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pytexit, version 0.3.4
Filename, size File type Python version Upload date Hashes
Filename, size pytexit-0.3.4-py2.py3-none-any.whl (24.5 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size pytexit-0.3.4.tar.gz (25.3 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page