Sign in

what is the best way to post math formula with publii ?

  • This topic has 2 replies, 2 voices, and was last updated 3 months ago by .
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #2229
    noapmtl

    I’ve got some markdown text containing latex formula. Mardown seems to work well with the last pre release of Publii, but I’m still having issues with latex formula. Does anyone found a way to display math formula correctly when you make a post ? I’m thinking to convert them to jpeg, but it’s not the ideal.

     

    Thanks for your help !

    #2231
    noapmtl

    I actually found a working solution for anyone having the same need with using MathJax :

    In publii app, you click on “Tools” -> “Custom HTML”, in “head”, you add the following :

    <script type="text/javascript" id="MathJax-script" async
      src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js">
    </script>

    It will then render your latex formula. If you have a factorisation, you need to put spaces before and after a *, if not, it won’t render the formula.
    Ex :

    $$V_{min}=V_{init}*k= V_{init}*\frac{1}{1-n}$$

    will not work while

    $$V_{min}=V_{init} * k= V_{init} * \frac{1}{1-n}$$

    will render correctly.

     

    Hope it’ll work for you !

     

     

    #2370
    Tomasz DziudaTomasz Dziuda
    Moderator

    I have moved this topic to useful resources for these who wants to use latex too 🙂

    --
    Do you appreciate the support you've received today? If so, consider donating to the Publii team by clicking here; we'll be sure to use your donation to make Publii even better!

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.