After installing mlabtex, 01_tex.py did not run successfully. There is a long error message (below) that in part
refers to \displaystyle. If \displaystyle is removed from 01_tex.py and rerun the program runs to completion with the
following figure output (size and orientation adjusted for clarity):
This looks very different from the one distributed with the package where " is rendered correctly and the fonts are
different (looks like a Helvetica for the text and a Computer Modern for the math):
The OS is Windows 10 and the Anaconda IDE is being used with Python 3.7.7, Sympy 1.6.1, Matplotlib 3.2.2, and Mayavi 4.7.1.
Would appreciate any help in getting this to work, hopefully it's something simple. Thanks.
---------------------------------- Error Message -----------------------------------------------------------------------
runfile('C:/Users/hl3-home/Dropbox/Python/01_tex.py', wdir='C:/Users/hl3-home/Dropbox/Python')
Traceback (most recent call last):
File "C:\Users\hl3-home\Anaconda3\envs\Python37\lib\site-packages\mlabtex\core.py", line 236, in render_latex
render_latex_sympy(text, path, color, dpi, output)
File "C:\Users\hl3-home\Anaconda3\envs\Python37\lib\site-packages\mlabtex\core.py", line 195, in render_latex_sympy
"Transparent",
File "C:\Users\hl3-home\Anaconda3\envs\Python37\lib\site-packages\sympy\printing\preview.py", line 149, in preview
raise SystemError("Unrecognized viewer: %s" % viewer)
SystemError: Unrecognized viewer: file
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\hl3-home\Anaconda3\envs\Python37\lib\site-packages\matplotlib\mathtext.py", line 2581, in parse
result = self._expression.parseString(s)
File "C:\Users\hl3-home\Anaconda3\envs\Python37\lib\site-packages\pyparsing.py", line 1955, in parseString
raise exc
File "C:\Users\hl3-home\Anaconda3\envs\Python37\lib\site-packages\matplotlib\mathtext.py", line 2752, in unknown_symbol
raise ParseFatalException(s, loc, "Unknown symbol: %s" % c)
ParseFatalException: Unknown symbol: \displaystyle
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\hl3-home\Anaconda3\envs\Python37\lib\site-packages\mlabtex\core.py", line 239, in render_latex
render_latex_mpl(text, path, color, dpi, output)
File "C:\Users\hl3-home\Anaconda3\envs\Python37\lib\site-packages\mlabtex\core.py", line 110, in render_latex_mpl
width, height, depth, _, _ = parser.parse(text, dpi=72, prop=prop)
File "C:\Users\hl3-home\Anaconda3\envs\Python37\lib\site-packages\matplotlib\mathtext.py", line 3354, in parse
box = self._parser.parse(s, font_output, fontsize, dpi)
File "C:\Users\hl3-home\Anaconda3\envs\Python37\lib\site-packages\matplotlib\mathtext.py", line 2586, in parse
str(err)]))
ValueError:
f(x)=\displaystyle\sum_{n=0}^\infty f^{(n)}(x_0)\cdot\frac{(x-x_0)^n}{n!}
^
Unknown symbol: \displaystyle, found '' (at char 5), (line:1, col:6)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\hl3-home\Dropbox\Python\01_tex.py", line 18, in
dpi=1200
File "C:\Users\hl3-home\Anaconda3\envs\Python37\lib\site-packages\mlabtex\core.py", line 431, in mlabtex
render_latex(text, path=pngfile.name, color=color, dpi=dpi)
File "C:\Users\hl3-home\Anaconda3\envs\Python37\lib\site-packages\mlabtex\core.py", line 247, in render_latex
+ os.linesep
RenderError: Mlabtex: Could not render the latex-code...
Unrecognized viewer: file
f(x)=\displaystyle\sum_{n=0}^\infty f^{(n)}(x_0)\cdot\frac{(x-x_0)^n}{n!}
^
Unknown symbol: \displaystyle, found '' (at char 5), (line:1, col:6)