Skip to content

Instantly share code, notes, and snippets.

@jason-s
Last active April 24, 2018 18:54
Show Gist options
  • Save jason-s/816b732498b9d356013ae4283bac6ffc to your computer and use it in GitHub Desktop.
Save jason-s/816b732498b9d356013ae4283bac6ffc to your computer and use it in GitHub Desktop.
Various examples for discussion in https://github.com/Khan/KaTeX/issues/695
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
\documentclass[tikz,14pt,border=10pt]{standalone}
%%%<
\usepackage{verbatim}
%%%>
\title{test1}
\begin{document}
test
$\frac{3}{2}$ is better than $\frac{2}{2}$;
$\frac{3}{2}$ is better than yours;
\vspace{2mm}
$\frac{3}{2}$ is better than $\frac{2}{2}$;
$\frac{3}{2}$ is better than yours.
\vspace{5mm}
\begin{tabular}{ |c|c| }
\hline
key & value \\
\hline
\tt{foo} & $\frac{3}{2}I^2R$ \\
\hline
\tt{bar} & $\sqrt{\frac{3}{2R}}$ \\
\hline
\tt{baz} & $ \displaystyle\frac{2}{\sqrt{\pi}}\int\limits_{-\infty}^{\infty}e^{-\frac{1}{2}x^2}\,dx $ \\
\hline
\end{tabular}
\vspace{5mm}
$-1234567890abcdefghijklmnopqrstuvwxyz\alpha\beta\gamma\delta\epsilon$
\vspace{2mm}
$e^{-1234567890abcdefghijklmnopqrstuvwxyz\alpha\beta\gamma\delta\epsilon}$
\end{document}
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.9.0/katex.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.9.0/katex.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.9.0/contrib/auto-render.min.js"></script>
<!-- KaTeX is faster and we only need it for basic math. If MathJax is needed, replace the two lines above with the lines below.
<script type="text/javascript"
src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
-->
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300,400' rel='stylesheet' type='text/css' />
<style type='text/css'>
body { font-family: 'Open Sans', Helvetica, Arial, sans-serif; }
code { font-family: Consolas, monospace; }
table td, table th { border: 1px solid black; padding: 0px 5px 0px 5px;}
table { border-collapse: collapse; }
</style>
</head>
<body>
<p>\(\frac{3}{2}\) is better than \(\frac{2}{2}\); \(\frac{3}{2}\) is better than yours;</p>
<p>\(\frac{3}{2}\) is better than \(\frac{2}{2}\); \(\frac{3}{2}\) is better than yours.</p>
<table>
<tr><th>Key</th><th>Value</th></tr>
<tr><td><code>foo</code></td><td>\(\frac{3}{2}I^2R\)</td></tr>
<tr><td><code>bar</code></td><td>\(\sqrt{\frac{3}{2R}}\)</td></tr>
<tr><td><code>bar</code></td><td>\[\frac{2}{\sqrt{\pi}}\int\limits_{-\infty}^{\infty}e^{-\frac{1}{2}x^2}\,dx\]</td></tr>
</table>
<p>\( -1234567890abcdefghijklmnopqrstuvwxyz\alpha\beta\gamma\delta\epsilon \)<p>
<p>\( e^{-1234567890abcdefghijklmnopqrstuvwxyz\alpha\beta\gamma\delta\epsilon} \)<p>
<script>
// this is for KaTeX only
renderMathInElement(document.body);
</script>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript"
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
<link href='https://fonts.googleapis.com/css?family=Open+Sans:300,400' rel='stylesheet' type='text/css' />
<style type='text/css'>
body { font-family: 'Open Sans', Helvetica, Arial, sans-serif; }
code { font-family: Consolas, monospace; }
table td, table th { border: 1px solid black; padding: 0px 5px 0px 5px;}
table { border-collapse: collapse; }
</style>
</head>
<body>
<p>\(\frac{3}{2}\) is better than \(\frac{2}{2}\); \(\frac{3}{2}\) is better than yours;</p>
<p>\(\frac{3}{2}\) is better than \(\frac{2}{2}\); \(\frac{3}{2}\) is better than yours.</p>
<table>
<tr><th>Key</th><th>Value</th></tr>
<tr><td><code>foo</code></td><td>\(\frac{3}{2}I^2R\)</td></tr>
<tr><td><code>bar</code></td><td>\(\sqrt{\frac{3}{2R}}\)</td></tr>
<tr><td><code>bar</code></td><td>\[\frac{2}{\sqrt{\pi}}\int\limits_{-\infty}^{\infty}e^{-\frac{1}{2}x^2}\,dx\]</td></tr>
</table>
<p>\( -1234567890abcdefghijklmnopqrstuvwxyz\alpha\beta\gamma\delta\epsilon \)<p>
<p>\( e^{-1234567890abcdefghijklmnopqrstuvwxyz\alpha\beta\gamma\delta\epsilon} \)<p>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment