Updated Readme and replaced MathJax with Katex

This commit is contained in:
Francesco 2024-04-28 23:17:39 +02:00
parent c1ee2febb5
commit 67500ef5d3
2 changed files with 20 additions and 15 deletions

View File

@ -39,7 +39,7 @@ To receive updates, add the theme as a submodule:
git submodule add git@github.com:tomfran/typo.git themes/typo git submodule add git@github.com:tomfran/typo.git themes/typo
``` ```
Otherwise you can clone the repo and copy it manually to your theme folder. Otherwise, you can clone the repo and copy it manually to your theme folder.
You can find a repo using this theme [here](https://github.com/tomfran/blog). You can find a repo using this theme [here](https://github.com/tomfran/blog).
@ -47,8 +47,7 @@ You can find a repo using this theme [here](https://github.com/tomfran/blog).
### 2.1 Header autonumbering ### 2.1 Header autonumbering
You can add auto-numbering to the pages by setting the following parameter in You can add auto-numbering to the pages by setting the following parameter in the header of your MD files. The numbering is currently supported by level 3 subheadings.
the header of your md files. The numbering is currently supported to level 3 subheadings.
``` ```
autonumber: true autonumber: true
@ -64,10 +63,9 @@ theme = "light | dark | auto"
### 2.3 Dark and light mode images ### 2.3 Dark and light mode images
You can tags to decide if images are displayed in dark or light mode, as Github id doing for readmes. You can tags to decide if images are displayed in dark or light mode, as GitHub is doing for readmes.
Let's say you have two different versions Let's say you have two different versions of an image, setting `#dark` or `#light` does the trick.
of an image, setting #dark or #light do the trick.
```md ```md
![skiplist](skiplist-light.png#light) ![skiplist](skiplist-light.png#light)
@ -75,7 +73,7 @@ of an image, setting #dark or #light do the trick.
``` ```
You can of course remove the final tag You can of course remove the final tag
to alway show the same image on light and to always show the same image in light and
dark mode. dark mode.
### 2.4 Fonts ### 2.4 Fonts
@ -161,7 +159,7 @@ url = "/posts"
name = "resume" name = "resume"
url = "/resume" url = "/resume"
# Syntax highligth on code blocks, all styles: # Syntax highlight on code blocks, all styles:
# https://xyproto.github.io/splash/docs/all.html # https://xyproto.github.io/splash/docs/all.html
# I suggest algol # I suggest algol
[markup] [markup]

View File

@ -1,9 +1,16 @@
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js"></script> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.0/dist/katex.min.css">
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.0/dist/katex.min.js"></script>
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.0/dist/contrib/auto-render.min.js"
onload="renderMathInElement(document.body);"></script>
<script> <script>
MathJax = { document.addEventListener("DOMContentLoaded", function () {
tex: { renderMathInElement(document.body, {
displayMath: [['\\[', '\\]'], ['$$', '$$']], delimiters: [
inlineMath: [['\\[', '\\]'], ['$', '$']] { left: "$$", right: "$$", display: true },
} { left: "$", right: "$", display: false }
}; ]
});
});
</script> </script>