Fix choice katex/mathjax switch

Fixes #29
This commit is contained in:
slashformotion 2021-08-21 15:56:16 +02:00
parent 4432cb953b
commit 6bc21de118
6 changed files with 5 additions and 20 deletions

View file

@ -13,7 +13,7 @@ title = "Hugo-tufte Theme Example Site"
math = true
# (If math is enabled)
## if "katex" is set to true katex will be used to render LaTex, if not MathJax will be used instead
katex = false
katex = true
[params]
# Subtitle of the website

View file

@ -0,0 +1 @@
/* Nothing here yet, (This file is waiting your customizations) */

View file

@ -1,2 +0,0 @@
This file is the last hugo-tufte related css file
loaded by the theme, and so personal customization can go here.

View file

@ -15,12 +15,10 @@
<!-- Font Awesome -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.14.0/css/all.css">
<script defer src="{{ "/js/main.js" | relURL }}"></script>
{{ $htoptions := (dict "targetPath" "/css/hugo-tufte.min.css" "outputStyle" "compressed" "enableSourceMap" true) }}
{{ $htstyle := resources.Get "scss/hugo-tufte.scss"| resources.ExecuteAsTemplate "main.scss" . | resources.ToCSS $htoptions }}
<link rel="stylesheet" href="{{ $htstyle.Permalink | relURL }}">
<link rel="stylesheet" href="{{ "/css/hugo-tufte-override.css" | relURL }}">
<link rel="stylesheet" href="{{ "/css/hugo-tufte-override.css" | relURL }}">

View file

@ -2,7 +2,7 @@
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/katex.min.css">
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/katex.min.js"></script>
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/contrib/auto-render.min.js"></script>
<script>
<script defer>
renderMathInElement(
document.body,
{
@ -19,7 +19,7 @@
{{ else }}
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
<script>
<script defer>
window.MathJax = {
tex: {
inlineMath: [['$', '$'], ['\\(', '\\)']]

View file

@ -1,12 +0,0 @@
renderMathInElement(
document.body,
{
delimiters: [
{ left: "$$", right: "$$", display: true },
{ left: "\\[", right: "\\]", display: true },
{ left: "$", right: "$", display: false },
{ left: "\\(", right: "\\)", display: false }
],
displayMode: true
}
);