erwanp / pytexit

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

Display with dark themes #36

Open maillardj opened 3 years ago

maillardj commented 3 years ago

Hello! Thank you for the package!

In Dark Themes IPython the display output is hardly readable because the text colour is black.

image

Does anyone know :

sambiddledev commented 3 years ago

Looking into this. Has something to do with the IPython.core.display. Can you share the steps to recreate this issue? Were you just using Ipython in the console? My console is not showing any LaTex output with IPython.

erwanp commented 3 years ago

I also have it here. I simply run it from the IPython 7.20.0 embedded in Spyder 4.2.1, and I get the LaTeX output.

erwanp commented 3 years ago

If you manage to find out why it's not happening in your own iPython, it would be nice if we can set it by default : it's very convenient to check the equations in your code

sambiddledev commented 3 years ago

Awesome. Thanks for sharing that. I'm going to look into it a bit more closely. Tried to reproduce using Jupyter notebook with a theme and it looked fine, so we may need to get it to ignore the theme in certain cases: Jupyter Notebook Dark Mode Success

sambiddledev commented 3 years ago

@erwanp no equation displays when I use the IPython interpreter straight from my zsh terminal window on a mac. I'll look into that a bit more. Could be worthy of an issue as well?

sambiddledev commented 3 years ago

VS code seems to work without issue, also. So it appears to be interpreter specific. See example from Jupyter notebook embedded in vs code: VScode Dark Mode

erwanp commented 3 years ago

Nice! So we have so far :

@maillardj was it also in a Spyder IPython? Does it work in a IPython spawned from the console?

maillardj commented 3 years ago

Hello! Yes, it was in a spyder IPython. From gitbash console it doesn't print the equation!

erwanp commented 3 years ago

Extra search systematically pointed me to Jupyter Notebooks to render equations (which works well, as you showed @sambiddledev ) . IPython simply inherits the limitations of the console/terminal, which wasn't developed to show images.

I think we won't fix it !

sambiddledev commented 3 years ago

That makes sense. I wonder if some helper text just to indicate that if you want to see the equation we recommend viewing in xyz might be helpful. Just to provide a cue to the user

On Apr 12, 2021, at 10:24 AM, Erwan Pannier @.***> wrote:

 Extra search systematically pointed me to Jupyter Notebooks to render equations (which works well, as you showed @sambiddledev ) . IPython simply inherits the limitations of the console/terminal, which wasn't developed to show images.

I think we won't fix it !

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

erwanp commented 3 years ago

Good idea, but the message shouldn't appear on a JupyterNotebook. Hard to know how which environment the line is executed.

Possible hack : what about subclassing the IPython.core.display.Latex name, which is shown here :

image

to something like pytexit.use_a_jupyter_notebook_to_view_latex_rendering