Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Math equations do not render #1185

Open
awmp1 opened this issue Jan 6, 2024 · 2 comments
Open

Math equations do not render #1185

awmp1 opened this issue Jan 6, 2024 · 2 comments

Comments

@awmp1
Copy link

awmp1 commented Jan 6, 2024

Description of problem
Using math, it appears that there is a problem with the way that the string is processed within the function math_flowable.py.
I haven't been able to work out what the issue is (my Python isn't that great) but it has to do with the $ sign as far as I can tell.

ParseException: Expected end of text, found '$' (at char 0), (line:1, col:1)
[ERROR] math_flowable.py:109 Math error:
$\frac{q}{\sqrt{g H_{m 0}^{3}}}=0.011\left(\frac{H_{m 0}}{h

Have tried several math equations but none seem to render. They do render if they are marked for in-line.

🖥 Versions
0.101

python -V3.11.6

@awmp1 awmp1 changed the title Math formular that are not inline do not render Math equations do not render Jan 6, 2024
@lornajane
Copy link
Contributor

Thanks @awmp1 for the bug report. Can you give an example of a simple source file that produces this problem? The math support is far from perfect but we can take a look.

@RadeKornjaca
Copy link

Hi @awmp1, I was looking for a similar issue with the equations not rendering in the newer versions of rst2pdf, but then I realized that I when I upgraded Python version recently, I didn't install matplotlib. Make sure you have it by running

pip install matplotlib

Also, when writing LaTeX equations in ReStructured Text, they do not start with the dollar sign, for example:

.. class:: center

.. math::
   P = \sqrt {s * (s - a) * (s - b) * (s - c)}

I add the center class for my equations to be centered. If that's not what you want, you can ignore the first line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants