Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@hagenw
Last active November 24, 2017 14:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hagenw/1260f21203b4095a061ac3da6b01b5e4 to your computer and use it in GitHub Desktop.
Save hagenw/1260f21203b4095a061ac3da6b01b5e4 to your computer and use it in GitHub Desktop.
Highlighting a problem with the aligned environment in KaTeX (https://github.com/Khan/KaTeX/issues/985)
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.9.0-alpha1/katex.min.css" type="text/css" />
</head>
<body role="document">
<h1>KaTeX aligned environment</h1>
<div class="section">
Non-working example:
<div class="math">
\[\begin{aligned}a&=b+c\\&=e+f\end{aligned}\]
</div>
Working example:
<div class="math">
\[\begin{aligned}a&=b+c\\&=e+f\\\end{aligned}\]
</div>
</div>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.9.0-alpha1/katex.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.9.0-alpha1/contrib/auto-render.min.js"></script>
<script>renderMathInElement(document.body);</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment