bastibe / org-static-blog

A static site generator using org-mode
BSD 3-Clause "New" or "Revised" License
341 stars 74 forks source link

Mathjax? #72

Open gypsydave5 opened 4 years ago

gypsydave5 commented 4 years ago

Hey - I was expecting the default org export behaviour of adding a script tag to import mathjax and some settings when latex support is needed on a page, but I notice that this doesn't happen with the static blog?

Is this deliberate? Can/should it be fixed?

bastibe commented 4 years ago

You need to add it yourself in org-static-blog-page-header.

hellwolf commented 2 years ago

I added these to the org-static-blog-page-header and it worked for me:

<script type=\"text/javascript\"
             src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML\">
           </script>
           <script type=\"text/x-mathjax-config\">
             MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$'],['\\\\(','\\\\)']]}});
           </script>"
bastibe commented 2 years ago

By the way, you may want to consider using https://katex.org/ instead of Mathjax, which is mostly compatible but much faster.