joouha/euporie

Latex printing from sympy shows `\displaystyle` and doesn't print using graphics

IndianBoy42 opened this issue · 2 comments

pipx install euporie
pipx inject euporie timg cairosvg mtable flatlatex ipython                      
euporie console
from sympy import init_sessions
x*x
\displaystylex² 

Hi,

This appears to be because sympy uses the \displaystyle latex command in it's latex output, and flatlatex (the default latex renderer used in euporie) does not support this command.

I've made a few changes in the dev branch which hopefully help with this issue:

  1. I configure flatlatex to strip various latex style commands from the output (added here)
  2. I've added utftex as a terminal latex renderer - this produces much more advanced output than flatlatex:
    image
  3. Other terminal latex renderers will now take priority over flatlatex if installed (you can now install utftex or pylatexenc and they will be used instead.

Also, if your terminal supports terminal graphics, and you have a latex distribution with dvipng, or matplotlib, installed, then euporie will render and display latex graphically:

image

The changes I've mentioned will be included in the next releases - I hope this helps!