sphinx-simplepdf icon indicating copy to clipboard operation
sphinx-simplepdf copied to clipboard

Math Not Rendering Correctly in PDF Output

Open sachin-suresh-rapyuta opened this issue 9 months ago • 0 comments

I am experiencing issues with LaTeX math rendering in the PDF output generated using sphinx-simplepdf. The HTML output is correct, but the PDF output shows LaTeX notation as raw text, e.g., (2^{31} -1).

What I have tried:

  1. Installed sphinx-mathjax-offline via pip (link: https://pypi.org/project/sphinx-mathjax-offline/)
  2. Configured conf.py
extensions = [
    'sphinx.ext.mathjax',
    'sphinx-mathjax-offline',
]
mathjax2_config = {
    'tex2jax': {
        'inlineMath': [['$', '$'], ['\\(', '\\)']],
        'displayMath': [['$$', '$$'], ['\\[', '\\]']],
        'processEscapes': True,
    }
}

RST content:

1 to :math:`2^{31} - 1`

Result: HTML output renders math correctly: image

But PDF output displays raw LaTeX text: image

Expected Behavior: Math expressions should be rendered correctly in both HTML and PDF outputs.

sachin-suresh-rapyuta avatar May 15 '24 11:05 sachin-suresh-rapyuta