erwanp / pytexit

Convert a Python expression to a LaTeX formula
https://pytexit.readthedocs.io/
Other
114 stars 31 forks source link

printing parameters #52

Closed jon-durand closed 1 year ago

jon-durand commented 2 years ago

Hi I was playing with this package and was trying to set the printing parameters globally like this:

py2tex.print_formula = False

But it had no effect within my Jupyter Notebook (specifically Google Colab). It only worked when done for each function call like this:

py2tex('x = 2*sqrt(2*pi*T_e/m_e)*(DeltaE/(T_e))**2*a_0**2 * k',print_latex=False, print_formula=True)

Is it possible to do it once at the start of a notebook and not have to add "print_latex=False, print_formula=True" on each function call?

erwanp commented 2 years ago

Hello, we could easily define a global variable ; I'm marking this as "Good First Issue"

OfirSiboni commented 2 years ago

Hey, took care of it - I've created 2 PRINT_FORMULA and PRINT_LATEX global variables. creating a pull request.

jon-durand commented 1 year ago

Sorry for the late reply. But thank you both!