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

Add Math LaTeX to PDF output (rst2pdf, WeasyPrint) #21

Open
gastmaier opened this issue Oct 25, 2024 · 2 comments
Open

Add Math LaTeX to PDF output (rst2pdf, WeasyPrint) #21

gastmaier opened this issue Oct 25, 2024 · 2 comments

Comments

@gastmaier
Copy link
Contributor

gastmaier commented Oct 25, 2024

rst2pdf uses matplotlib optionally to do that, replicate with weasyprint[1]?
https://sourceforge.net/projects/matplotlib/
https://rst2pdf.org/static/manual.html#mathematics
Or figure out styling in rst2pdf?

[1] But it does seems matplotlib just calls latex https://matplotlib.org/stable/gallery/text_labels_and_annotations/tex_demo.html

@gastmaier
Copy link
Contributor Author

Matplot lib contains a lightweight subset that should be good enough:
https://matplotlib.org/stable/users/explain/text/mathtext.html#mathtext
https://matplotlib.org/stable/api/mathtext_api.html

@gastmaier
Copy link
Contributor Author

gastmaier commented Dec 2, 2024

Partialy solved with a007904
Approach can be extended for WaveDrom + whatever other JavaScript backed renderer.
I'm growing in favor to not embedding third-party JavaScript renders in the doc, since:

  • Slow down the doc loading
  • Require the user to have JS enabled
  • Require patching involving finding a non-JS replacement (or straight-up require node.js installed? (oh god no))

Note: wavedrom seems to have a Python port: https://pypi.org/project/wavedrom/

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

1 participant