comwes / mkpdfs-mkdocs-plugin

Converts your mkdocs documentation in PDF, to be shared with users
https://comwes.github.io/mkpdfs-mkdocs-plugin
GNU General Public License v3.0
103 stars 36 forks source link

Mathjax integration #13

Closed NilsWinter closed 3 years ago

NilsWinter commented 4 years ago

Hi there, I'm using arithmatex to render Latex equations on my doc website (I'm using the Material theme with PyMdown Extensions). Does anybody know if it is possible to have it render Latex in the exported PDF as well? As far as I understand, the equations are rendered through mathjax using javascript and I guess this is the reason it's not being rendered for the PDF?

Thanks a lot, Nils

comwes commented 3 years ago

@NilsWinter I don't think this feature will be integrated for now. But it a good one, I'll think on planning this as to me it's important. I'm tagging this as feature request, Any suggestion of how to integrate this is welcome

comwes commented 3 years ago

@NilsWinter I've found out a solution for your issue.

If you install markdown-katex with this pip3 install markdown-katex You can add the following configuration to your mkdocs.yml by adding a markdown extension.

markdown_extensions:
  - markdown_katex:
      no_inline_svg: True
      insert_fonts_css: True
  - admonition
  - footnotes

This parameter no_inline_svg: True is important to prevent the use of javascript to render latex data.

You can also check markdown-katex for a more complete documentation.

I hope this helps. KR, Gerry N.