analogdevicesinc / doctools

Central repository to host tooling for automated documentation builds
Eclipse Public License 2.0
4 stars 3 forks source link

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

Open gastmaier opened 1 month ago

gastmaier commented 1 month ago

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 commented 2 days ago

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 commented 1 day ago

Partialy solved with a007904e50fe9df72cbe067143fce4eea68f942d 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:

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