Skip to content

Instantly share code, notes, and snippets.

@cu39
Created February 9, 2014 10:37
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 cu39/8897363 to your computer and use it in GitHub Desktop.
Save cu39/8897363 to your computer and use it in GitHub Desktop.
Enable TeX and AsciiMath syntaxes with MathJax.
MathJax.Hub.Config({
config: [ "MMLorHTML.js" ],
jax: [ "input/AsciiMath", "input/TeX", "output/HTML-CSS", "output/NativeMML" ],
extensions: [ "asciimath2jax.js", "tex2jax.js", "mml2jax.js", "MathMenu.js", "MathZoom.js" ],
TeX: {
extensions: [ "AMSmath.js", "AMSsymbols.js", "noErrors.js", "noUndefined.js" ]
}
});
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>MathJax</title>
<style>
#canvas1 { border: 1px solid #ddd; }
</style>
</head>
<body>
<dl>
<dt>TeX syntax (B&eacute;zier curve)</dt>
<dd>\[ \mathbf{P}(t) = \sum_{i=0}^{N-1} \mathbf{B}_i J_{(N-1)i}(t) \]</dd>
<dt>AsciiMath</dt>
<dd>`(x+a)(x+b)=x^2+bx+ax+ab=x^2+(a+b)x+ab`</dd>
</dl>
<script src="http://cdn.mathjax.org/mathjax/2.3-latest/MathJax.js"></script>
<script src="config.js"></script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment