This commit is contained in:
clente 2023-09-29 23:56:39 +00:00
parent c49f64b929
commit 761efdcda9
24 changed files with 34 additions and 34 deletions

View file

@ -2,7 +2,7 @@
<a href=/hugo-bearcub class=title><h1>Bear Cub</h1></a><nav><a href=/hugo-bearcub/>Home</a>
<a href=/hugo-bearcub/blog/>Blog</a>
<a href='mailto:me@example.com?subject=Reply%20to%20"Math%20Typesetting"'>Email</a>
<a href=/blog/index.xml>RSS</a>
<a href=/hugo-bearcub/blog/index.xml>RSS</a>
<a class=disabled role=link aria-disabled=true>pt-BR 🇧🇷</a></nav></header><main id=main-content><h1>Math Typesetting</h1><p><i><time datetime=2019-03-08 pubdate>2019-03-08</time></i></p><content><p>Mathematical notation in a Hugo project can be enabled by using third party JavaScript libraries.</p><p>In this example we will be using <a href=https://katex.org/>KaTeX</a></p><ul><li>Create a partial under <code>/layouts/partials/math.html</code></li><li>Within this partial reference the <a href=https://katex.org/docs/autorender.html>Auto-render Extension</a> or host these scripts locally.</li><li>Include the partial in your templates like so:</li></ul><div class=highlight><pre tabindex=0 class=chroma><code class=language-bash data-lang=bash><span class=line><span class=ln>1</span><span class=cl><span class=o>{{</span> <span class=k>if</span> or .Params.math .Site.Params.math <span class=o>}}</span>
</span></span><span class=line><span class=ln>2</span><span class=cl><span class=o>{{</span> partial <span class=s2>&#34;math.html&#34;</span> . <span class=o>}}</span>
</span></span><span class=line><span class=ln>3</span><span class=cl><span class=o>{{</span> end <span class=o>}}</span>