diff --git a/README.md b/README.md index 4226ae9..7e0c112 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ summary: "The summary content" --- ``` -### Approch 2: use +### Approch 2: use `` Use `` to seperate content that will display in the posts page as abstraction and the rest of the content. This is different from summary, as summary will not appear in the post. ``` --- @@ -69,6 +69,21 @@ abstraction show in the post page other content ``` +## Support LaTex +In you post add `katex:true` to [front matter](https://gohugo.io/content-management/front-matter/) +``` +--- +katex: true +--- +``` +Then the [katex script](https://katex.org/docs/autorender.html) will auto render the string enclosed be delimiters. +``` +# replace ... with latex formula +display inline \\( ... \\) +display block $$ ... $$ +``` +![latex example](images/latex_example.png) + ## config.toml example ```toml diff --git a/images/latex_example.png b/images/latex_example.png new file mode 100644 index 0000000..05aca77 Binary files /dev/null and b/images/latex_example.png differ diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 42931b9..f626fa2 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -23,5 +23,7 @@ - +{{ if .Params.katex }} + {{ partial "katex.html" . }} +{{ end }} {{ partial "script.html" . }} diff --git a/layouts/partials/katex.html b/layouts/partials/katex.html new file mode 100644 index 0000000..57d7430 --- /dev/null +++ b/layouts/partials/katex.html @@ -0,0 +1,4 @@ + + + \ No newline at end of file