HugoBlox / hugo-blox-builder

🚨 GROW YOUR AUDIENCE WITH HUGOBLOX! 🚀 HugoBlox is an easy, fast no-code website builder for researchers, entrepreneurs, data scientists, and developers. Build stunning sites in minutes. 适合研究人员、企业家、数据科学家和开发者的简单快速无代码网站构建器。用拖放功能、可定制模板和内置SEO工具快速创建精美网站!
https://hugoblox.com/templates/
MIT License
8.2k stars 2.9k forks source link

Multiple lines Mathjax formulas flattened to one line #291

Closed Framartin closed 7 years ago

Framartin commented 7 years ago

I'm trying to write a two lines formula using using the academic theme. The formula is printed in one line in academic, while correctly printed by Mathjax outside academic.

Let's consider, for example, the following LaTeX formula:

$$\begin{eqnarray} 
y &=& 1+1   \\
&=& 2
\end{eqnarray}$$

On the MathJax Live Demo the formula is correctly generated: mathjax_demo

But on my hugo website with academic, the formula is generated like this: academic

I'm not sure what's the source of the problem. Thanks a lot for your time.

gcushen commented 7 years ago

It's an issue with how Hugo's Markdown parser works. The workaround is to use 6 backslashes for a Mathjax linebreak:

$$\begin{eqnarray} 
y &=& 1+1   \\\\\\
&=& 2
\end{eqnarray}$$
Framartin commented 7 years ago

Thanks a lot for your help. That's very useful :+1: I tried with 2 to 4 backslashes, but I didn't thought about 6.

I made a PR to add this solution to the documentation, thinking of future new users (and to reduce the number of issues related to this problem).

jazzbuck commented 4 years ago

This could really be in the documentation on Hugo too - unfortunately that seems to be dead.

dsryu0822 commented 3 years ago

\\\ (3 backslashes) works for me.