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

- This topic has 3 replies, 3 voices, and was last updated 7 months ago by .

- AuthorPosts
- March 26, 2020 at 9:38 pm #2229noapmtl
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 !

March 26, 2020 at 10:04 pm #2231noapmtlI 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 !

April 9, 2020 at 2:50 pm #2370Tomasz DziudaI 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!March 24, 2021 at 9:27 am #5459yamkoppHello,

in order to render the inline math,

This is a formula $V_{min}=V_{init} * k= V_{init} * \frac{1}{1-n}$

The code shoud be:

<span class="p"><</span><span class="nt">script</span><span class="p">></span> <span class="nx">MathJax</span> <span class="o">=</span> <span class="p">{</span> <span class="nx">tex</span><span class="o">:</span> <span class="p">{</span> <span class="nx">inlineMath</span><span class="o">:</span> <span class="p">[[</span><span class="s1">'$'</span><span class="p">,</span> <span class="s1">'$'</span><span class="p">],</span> <span class="p">[</span><span class="s1">'\\('</span><span class="p">,</span> <span class="s1">'\\)'</span><span class="p">]]</span> <span class="p">}</span> <span class="p">};</span> <span class="p"></</span><span class="nt">script</span><span class="p">></span> <span class="p"><</span><span class="nt">script</span> <span class="na">id</span><span class="o">=</span><span class="s">"MathJax-script"</span> <span class="na">async</span> <span class="na">src</span><span class="o">=</span><span class="s">"https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js"</span><span class="p">></span> <span class="p"></</span><span class="nt">script</span><span class="p">></span>

- AuthorPosts

- You must be logged in to reply to this topic.