# MathJax Newlines in Hugo & Pandoc

**URL:** <https://discourse.gohugo.io/t/mathjax-newlines-in-hugo-pandoc/28233>\
**Category:** support\
**Tags:** typesetting\
**Created:** [September 16, 2020, 10:50pm UTC](https://discourse.gohugo.io/t/mathjax-newlines-in-hugo-pandoc/28233 "2020-09-16T22:50:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![finnlesueur](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/finnlesueur/32/12786_2.png) [@finnlesueur](https://discourse.gohugo.io/u/finnlesueur)\
**Post date:** [September 16, 2020, 10:50pm UTC](https://discourse.gohugo.io/t/mathjax-newlines-in-hugo-pandoc/28233/1 "2020-09-16T22:50:55Z")

</div>

Kia ora all,

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

1. Some [reveal.js](https://revealjs.com) slides using [Pandoc](https://pandoc.org)
2. A page in a Hugo site using `Hugo`

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

```auto
\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

 ![Screen Shot 2020-09-17 at 10.49.10 AM](https://canada1.discourse-cdn.com/flex036/uploads/gohugo/original/2X/c/c6a1883dd7b917242a5b4701c58a4a3415fd9fa0.jpeg)

## Hugo Output

 ![Screen Shot 2020-09-17 at 10.48.46 AM](https://canada1.discourse-cdn.com/flex036/uploads/gohugo/original/2X/c/c9a72fa4e3c55a2c6bce5ca187eb9815b0274425.png)

Is there a way to reconcile these two outputs?

---

<div class="post-metadata">

**Author:** ![davidsneighbour](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/davidsneighbour/32/24507_2.png) [@davidsneighbour](https://discourse.gohugo.io/u/davidsneighbour)\
**Post date:** [September 18, 2020, 10:25am UTC](https://discourse.gohugo.io/t/mathjax-newlines-in-hugo-pandoc/28233/2 "2020-09-18T10:25:19Z")

</div>

> [@finnlesueur](#):
>
> \\\\\\

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

---

<div class="post-metadata">

**Author:** ![finnlesueur](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/finnlesueur/32/12786_2.png) [@finnlesueur](https://discourse.gohugo.io/u/finnlesueur)\
**Post date:** [October 21, 2020, 11:10pm UTC](https://discourse.gohugo.io/t/mathjax-newlines-in-hugo-pandoc/28233/3 "2020-10-21T23:10:53Z")

</div>

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

Cheers!

---

<div class="post-metadata">

**Author:** ![system](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/system/32/1_2.png) [@system](https://discourse.gohugo.io/u/system)\
**Post date:** [October 23, 2020, 11:11pm UTC](https://discourse.gohugo.io/t/mathjax-newlines-in-hugo-pandoc/28233/4 "2020-10-23T23:11:02Z")

</div>

Closed on October 23, 2020, 11:11pm UTC

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