MathJax Newlines in Hugo & Pandoc

Kia ora all,

I am writing some Markdown content which gets turned into two things:

  1. Some reveal.js slides using Pandoc
  2. A page in a Hugo site using Hugo

The problem is that I write my LaTeX equations like this:

\begin{align*}
    force &= mass\times acceleration \\
    F &= m \times a
\end{align*}

But the newlines are not rendered consistently. I have read about using \\\\\\ backslashes to get Hugo to output the correct newlines, but this creates completely incorrect Pandoc output.

Pandoc/reveal.js Output

Hugo Output

Is there a way to reconcile these two outputs?

Did you try \newline instead of \\? That should be the “official” way for MathJax and maybe Pandoc plays better with that.

Thanks! That worked a treat :slight_smile: Had to do a huge find/replace but everything is playing nice now.

Cheers!

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.