Forum Samples, Tips and Tricks

From Pandoc Markdown over XHTML to Prince PDF with MathJax formulas.

emperor
This is to inform the Prince community that math2svg is now available as an officially Pandoc adopted Lua filter: https://github.com/pandoc/lua-filters/tree/master/math2svg

This Lua filter for Pandoc converts LaTeX math to MathJax generated scalable vector graphics (SVG) for insertion into the output document in a standalone manner. SVG output is in any of the available MathJax fonts.

This is useful when a CSS paged media engine (such as Prince XML) cannot process complex JavaScript as required by MathJax.

No Internet connection is required when generating or viewing SVG formulas, resulting in both absolute privacy and offline, standalone robustness.

Personally, I have been using it for quite some time to generate PDFs with MathJax generated formulas in an unattended typesetting workflow using Prince XML.

Here is a brief sample document:
https://hamwaves.com/zc.measuring/en/zc.measuring.letter.pdf

More intricate documents with Markdown source, makefile and CSS are available from the same web site.

Kind regards,
Serge Y. Stroobandt
  1. zc.measuring.a4.pdf130.4 kB
    Prince PDF with MathJax formulas
mikeday
Thanks, Serge!
wangp
You may wish to switch off the 'blacker' option in MathJax:
https://www.princexml.com/forum/topic/4116/svg-output-differs-between-browser-and-prince
emperor
@wangp Great suggestion! I was not aware about this new option.
For others, here is the documentation.

Unfortunately, this option is not yet exposed in tex2svg upon which my filter depends, but we will shake the coconut tree!