Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add auto number for mathjax #53

Merged
merged 1 commit into from Apr 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions archetypes/default.md
Expand Up @@ -21,6 +21,7 @@ contentCopyright: false
reward: false
mathjax: false
mathjaxEnableSingleDollar: false
mathjaxEnableAutoNumber: false

flowchartDiagrams:
enable: false
Expand Down
1 change: 1 addition & 0 deletions exampleSite/config.toml
Expand Up @@ -68,6 +68,7 @@ copyright = "" # default: author.name ↓ # 默认为下面配
fancybox = true # see https://github.com/fancyapps/fancybox # 是否启用fancybox(图片可点击)
mathjax = false # see https://www.mathjax.org/ # 是否使用mathjax(数学公式)
mathjaxEnableSingleDollar = false # 是否使用 $...$ 即可進行inline latex渲染
mathjaxEnableAutoNumber = false # 是否使用公式自动编号

postMetaInFooter = true # contain author, lastMod, markdown link, license # 包含作者,上次修改时间,markdown链接,许可信息
linkToMarkDown = false # Only effective when hugo will output .md files. # 链接到markdown原始文件(仅当允许hugo生成markdown文件时有效)
Expand Down
3 changes: 3 additions & 0 deletions layouts/partials/scripts.html
Expand Up @@ -46,6 +46,9 @@
{{ if or .Params.mathjaxEnableSingleDollar (and .Site.Params.mathjaxEnableSingleDollar (ne .Params.mathjaxEnableSingleDollar false)) -}}
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]},
{{ end -}}
{{ if or .Params.mathjaxEnableAutoNumber (and .Site.Params.mathjaxEnableAutoNumber (ne .Params.mathjaxEnableAutoNumber false)) -}}
TeX: {equationNumbers: {autoNumber: "AMS"}},
{{ end -}}
showProcessingMessages: false,
messageStyle: 'none'
};
Expand Down