Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/de-souza/hugo-flex.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'post/math-typesetting/index.html')
-rw-r--r--post/math-typesetting/index.html8
1 files changed, 8 insertions, 0 deletions
diff --git a/post/math-typesetting/index.html b/post/math-typesetting/index.html
new file mode 100644
index 0000000..833e501
--- /dev/null
+++ b/post/math-typesetting/index.html
@@ -0,0 +1,8 @@
+<!doctype html><html lang=en><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><meta name=description content="A brief guide to setup KaTeX"><meta name=generator content="Hugo 0.104.3"><title>Math Typesetting | Hugo Themes</title><link rel=canonical href=/hugo-flex/post/math-typesetting/><link rel=stylesheet href=/hugo-flex/css/base.min.23cd48cee155498cf8a6f89152dd9fda2bd56047a4845068f7927636fd0c454f.css integrity="sha256-I81IzuFVSYz4pviRUt2f2ivVYEekhFBo95J2Nv0MRU8=" crossorigin=anonymous></head><body><nav class=u-background><div class=u-wrapper><ul class=Banner><li class="Banner-item Banner-item--title"><a class="Banner-link u-clickable" href=/hugo-flex/>Hugo Themes</a></li><li class=Banner-item><a class="Banner-link u-clickable" href=/hugo-flex/about/>About</a></li><li class=Banner-item><a class="Banner-link u-clickable" href=/hugo-flex/post/>Posts</a></li><li class=Banner-item><a class="Banner-link u-clickable" href=/hugo-flex/tags/>Tags</a></li><li class=Banner-item><a class="Banner-link u-clickable" href=/hugo-flex/categories/>Categories</a></li><li class=Banner-item><a class="Banner-link u-clickable" href=/hugo-flex/index.xml>RSS</a></li></ul></div></nav><main><div class=u-wrapper><div class=u-padding><article><header class=Heading><h2 class=Heading-title><a class="Heading-link u-clickable" href=/hugo-flex/post/math-typesetting/ rel=bookmark>Math Typesetting</a></h2><time datetime=2019-03-08T00:00:00Z>8 March, 2019</time></header><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 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-bash data-lang=bash><span style=display:flex><span><span style=color:#f92672>{{</span> <span style=color:#66d9ef>if</span> or .Params.math .Site.Params.math <span style=color:#f92672>}}</span>
+</span></span><span style=display:flex><span><span style=color:#f92672>{{</span> partial <span style=color:#e6db74>&#34;math.html&#34;</span> . <span style=color:#f92672>}}</span>
+</span></span><span style=display:flex><span><span style=color:#f92672>{{</span> end <span style=color:#f92672>}}</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&rsquo;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 <a href=https://katex.org/docs/supported.html>Supported TeX Functions</a></p><link rel=stylesheet href=https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/katex.min.css integrity=sha384-zB1R0rpPzHqg7Kpt0Aljp8JPLqbXI3bhnPWROx27a9N0Ll6ZP/+DiW/UqRcLbRjq crossorigin=anonymous><script defer src=https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/katex.min.js integrity=sha384-y23I5Q6l+B6vatafAwxRu/0oK/79VlbSz7Q9aiSZUvyWYIYsd+qj+o24G5ZU2zJz crossorigin=anonymous></script>
+<script defer src=https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/contrib/auto-render.min.js integrity=sha384-kWPLUVMOks5AQFrykwIup5lo0m3iMkkHrD0uJ4H5cjeGihAutqP0yW0J6dpFiVkI crossorigin=anonymous onload=renderMathInElement(document.body)></script><h3 id=examples>Examples</h3><p>Inline math: \(\varphi = \dfrac{1+\sqrt5}{2}= 1.6180339887…\)</p><p>Block math:
+$$
+\varphi = 1+\frac{1} {1+\frac{1} {1+\frac{1} {1+\cdots} } }
+$$</p></article></div></div></main><footer class=Footer><div class=u-wrapper><div class=u-padding>Except where otherwise noted, content on this site is licensed under a <a href=http://creativecommons.org/licenses/by/4.0/ rel=license>Creative Commons Attribution 4.0 International License</a>.</div></div></footer></body></html> \ No newline at end of file