\begin{aligned} not being rendered
See original GitHub issueFor some reason, \begin{aligned} statements like the following aren’t being rendered in my markdown documents using Hugo:
$$
\begin{aligned}
\bar{u} - \bar{v} &= \bar{u} - (2\mu - \bar{u}) \\
&= \bar{u} - 2\mu + \bar{u} \\
&= 2\bar{u} - 2\mu \\
&= 2(\bar{u} - \mu)
\end{aligned}
$$
Everything else renders just fine.
I have the following config:
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/katex.min.css" integrity="sha384-zB1R0rpPzHqg7Kpt0Aljp8JPLqbXI3bhnPWROx27a9N0Ll6ZP/+DiW/UqRcLbRjq" crossorigin="anonymous">
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/katex.min.js" integrity="sha384-y23I5Q6l+B6vatafAwxRu/0oK/79VlbSz7Q9aiSZUvyWYIYsd+qj+o24G5ZU2zJz" crossorigin="anonymous"></script>
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/contrib/auto-render.min.js" integrity="sha384-kWPLUVMOks5AQFrykwIup5lo0m3iMkkHrD0uJ4H5cjeGihAutqP0yW0J6dpFiVkI" crossorigin="anonymous"></script>
<script>
document.addEventListener("DOMContentLoaded", function() {
renderMathInElement(document.body,
{
delimiters: [
{left: "$$", right: "$$", display:true},
{left: "$", right: "$", display:false},
{left: "\\(", right: "\\)", display: false},
{left: "\\[", right: "\\]", display: true}
],
macros: {
"\\R": "\\mathbb{R}",
"\\B": "\\mathbb{B}",
"\\summation": "\\sum\\nolimits_{#1}^{#2}",
"\\product": "\\prod\\limits_{#1}^{#2}",
"\\E": "\\text{E}",
"\\bias": "\\text{bias}",
"\\var": "\\text{var}",
"\\step": "\\text{step}",
"\\span": "\\text{span}",
"\\P": "\\text{P}",
"\\pmf": "\\text{pmf}",
"\\T": "\\text{T}",
"\\infinity": "\\infty",
"\\then": "\\implies",
"\\cross": "\\times",
"\\approaches": "\\rightarrow",
"\\yhat": "\\hat{y}"
}
});
});
</script>
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Github page fails to render \begin{align} environment #2274
It appears that the problem has to do with the way the html is formatted for AcademicPages. There are no line breaks in...
Read more >math mode - \begin{align} not working as expected - TeX
In this small snippet of code, I'm doing quick derivation to arrive at an equation to be used later ...
Read more >How to change alignment of displayed equations in IPython ...
Use \begin{align} and \end{align} . This does not exactly answer the question but it has the desired effect. For example try:
Read more >LaTeX Tutorial-Math Mode
If we use the align environment and insert an & on every line where we wish the equations to be aligned (usually at...
Read more >LaTeX/Advanced Mathematics - Wikibooks, open books for an ...
eqnarray and eqnarray*, Similar to align and align*, Not recommended because spacing is inconsistent ; multline and multline* · First line left aligned,...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I think this is really just a problem with how Hugo renders markdown into HTML. I haven’t been able to figure it out, so switching back to MathJax for now. But I’ll be closing this issue since the bug is not with Katex.
Even with four backslashes like you suggested:
I still get this result: