aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpanda-z <panda.hust@gmail.com>2018-04-15 23:43:31 +0800
committerolOwOlo <26087907+olOwOlo@users.noreply.github.com>2018-04-15 23:43:31 +0800
commitaf22a4822ce64cc9eb10d05d5490de72ecc415d9 (patch)
treeac9a21c5b4dc3a58c5b4f1625dce69c203cf81b4
parent5f8b79f942f94da8954d8c28c8704aa5af045a54 (diff)
feat: add auto number for mathjax (#53)
-rw-r--r--archetypes/default.md1
-rw-r--r--exampleSite/config.toml1
-rw-r--r--layouts/partials/scripts.html3
3 files changed, 5 insertions, 0 deletions
diff --git a/archetypes/default.md b/archetypes/default.md
index 21255a1..4e385b5 100644
--- a/archetypes/default.md
+++ b/archetypes/default.md
@@ -21,6 +21,7 @@ contentCopyright: false
reward: false
mathjax: false
mathjaxEnableSingleDollar: false
+mathjaxEnableAutoNumber: false
flowchartDiagrams:
enable: false
diff --git a/exampleSite/config.toml b/exampleSite/config.toml
index cefeead..3b0bb13 100644
--- a/exampleSite/config.toml
+++ b/exampleSite/config.toml
@@ -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文件时有效)
diff --git a/layouts/partials/scripts.html b/layouts/partials/scripts.html
index abd76f6..b087982 100644
--- a/layouts/partials/scripts.html
+++ b/layouts/partials/scripts.html
@@ -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'
};