add latex support; activate when latex: true is set in markdown file

This commit is contained in:
liz2020
2020-11-20 15:38:34 -05:00
parent 28dcf728cb
commit 8f4225ea8f
4 changed files with 23 additions and 2 deletions

View File

@@ -56,7 +56,7 @@ summary: "The summary content"
---
```
### Approch 2: use <!--more-->
### Approch 2: use `<!--more-->`
Use `<!--more-->` 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