<linkrel=iconhref=https://adityatelange.github.io/hugo-PaperMod/favicon.ico><linkrel=icontype=image/pngsizes=16x16href=https://adityatelange.github.io/hugo-PaperMod/favicon-16x16.png><linkrel=icontype=image/pngsizes=32x32href=https://adityatelange.github.io/hugo-PaperMod/favicon-32x32.png><linkrel=apple-touch-iconhref=https://adityatelange.github.io/hugo-PaperMod/apple-touch-icon.png><linkrel=mask-iconhref=https://adityatelange.github.io/hugo-PaperMod/safari-pinned-tab.svg><metaname=theme-colorcontent="#2e2e33"><metaname=msapplication-TileColorcontent="#2e2e33"><linkrel=alternatehreflang=enhref=https://adityatelange.github.io/hugo-PaperMod/posts/math-typesetting/><noscript><style>#theme-toggle,.top-link{display:none}</style><style>@media(prefers-color-scheme:dark){:root{--theme:rgb(29,30,32);--entry:rgb(46,46,51);--primary:rgb(218,218,219);--secondary:rgb(155,156,157);--tertiary:rgb(65,66,68);--content:rgb(196,196,197);--hljs-bg:rgb(46,46,51);--code-bg:rgb(55,56,62);--border:rgb(51,51,51)}.list{background:var(--theme)}.list:not(.dark)::-webkit-scrollbar-track{background:00}.list:not(.dark)::-webkit-scrollbar-thumb{border-color:var(--theme)}}</style></noscript><metaproperty="og:title"content="Math Typesetting"><metaproperty="og:description"content="A brief guide to setup KaTeX"><metaproperty="og:type"content="article"><metaproperty="og:url"content="https://adityatelange.github.io/hugo-PaperMod/posts/math-typesetting/"><metaproperty="og:image"content="https://adityatelange.github.io/hugo-PaperMod/papermod-cover.png"><metaproperty="article:section"content="posts"><metaproperty="article:published_time"content="2019-03-08T00:00:00+00:00"><metaproperty="article:modified_time"content="2019-03-08T00:00:00+00:00"><metaname=twitter:cardcontent="summary_large_image"><metaname=twitter:imagecontent="https://adityatelange.github.io/hugo-PaperMod/papermod-cover.png"><metaname=twitter:titlecontent="Math Typesetting"><metaname=twitter:descriptioncontent="A brief guide to setup KaTeX"><scripttype=application/ld+json>{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Posts","item":"https://adityatelange.github.io/hugo-PaperMod/posts/"},{"@type":"ListItem","position":2,"name":"Math Typesetting","item":"https://adityatelange.github.io/hugo-PaperMod/posts/math-typesetting/"}]}</script><scripttype=application/ld+json>{"@context":"https://schema.org","@type":"BlogPosting","headline":"Math Typesetting","name":"Math Typesetting","description":"A brief guide to setup KaTeX","keywords":[],"articleBody":"Mathematical notation in a Hugo project can be enabled by using third party JavaScript libraries.\nIn this example we will be using KaTeX\n Create a partial under /layouts/partials/math.html Within this partial reference the Auto-render Extension or host these scripts locally. Include the partial in your templates (extend_head.html) like so: refer ISSUE #236 {{ if or .Params.math .Site.Params.math }} {{ partial \"math.html\" . }} {{ end }} To enable KaTex globally set the parameter math to true in a project’s configuration To enable KaTex on a per page basis include the parameter math: true in content files Note: Use the online reference of Supported TeX Functions\n Examples Inline math: \\(\\varphi = \\dfrac{1+\\sqrt5}{2}= 1.6180339887…\\) Block math:\n$$ \\varphi = 1+\\frac{1} {1+\\frac{1} {1+\\frac{1} {1+\\cdots} } } $$\n","wordCount":"124","inLanguage":"en","datePublished":"2019-03-08T00:00:00Z","dateModified":"2019-03-08T00:00:00Z","author":{"@type":"Person","name":"Hugo Authors"},"mainEntityOfPage":{"@type":"WebPage","@id":"https://adityatelange.github.io/hugo-PaperMod/posts/math-typesetting/"},"publisher":{"@type":"Organization","name":"PaperMod","logo":{"@type":"ImageObject","url":"https://adityatelange.github.io/hugo-PaperMod/favicon.ico"}}}</script></head><bodyid=top><script>localStorage.getItem("pref-theme")==="dark"?document.body.classList.add("dark"):localStorage.getItem("pref-theme")==="light"?
</span></span><spanclass=line><spanclass=cl><spanclass=o>{{</span> end <spanclass=o>}}</span>
</span></span></code></pre></div><ul><li>To enable KaTex globally set the parameter <code>math</code> to <code>true</code> in a project’s configuration</li><li>To enable KaTex on a per page basis include the parameter <code>math: true</code> in content files</li></ul><p><strong>Note:</strong> Use the online reference of <ahref=https://katex.org/docs/supported.html>Supported TeX Functions</a></p><linkrel=stylesheethref=https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/katex.min.cssintegrity=sha384-zB1R0rpPzHqg7Kpt0Aljp8JPLqbXI3bhnPWROx27a9N0Ll6ZP/+DiW/UqRcLbRjqcrossorigin=anonymous><scriptdefersrc=https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/katex.min.jsintegrity=sha384-y23I5Q6l+B6vatafAwxRu/0oK/79VlbSz7Q9aiSZUvyWYIYsd+qj+o24G5ZU2zJzcrossorigin=anonymous></script>