hexo-theme-Chic
hexo-theme-Chic copied to clipboard
关于数学公式
您好,我这边好像出现了一个问题,您这边方便帮我看一下吗?谢谢。 我这边启用了mathjax 然后用了LaTeX公式
\left\{\begin{matrix} x' = x + \frac{b}{gcd}*K
\\
y' = y - \frac{a}{gcd}*K
\end{}\right.`
想要有一下效果:
发现不能被渲染,我查询了以前的issue,发现是Markdwon本身的特殊符号与Latex中的符号会出现冲突,于是我将所有的\改为\,发现还是不能被渲染,想请问我这个该怎么解决?谢谢。
你好,你的issue中tex代码写法明显有问题。
请你在提问时确认一下你写的公式是否正确,这样可以节省调试时间。
我先写一下这个公式的正常Tex代码:
\left \{
\begin{array}{c}
x'=x+\frac{b}{gcd}*K \\
y'=y-\frac{a}{gcd}*K
\end{array}
\right.
在HTML中,乘号也就是*
会被转义、左侧大括号反斜杠\{
会被转义、换行符双反斜杠\\
会被转义。因此在主题中,你粘贴以下代码可以直接生效
$$\left \\{
\begin{array}{c}
x'=x+\frac{b}{gcd}\*K \\\\
y'=y+\frac{b}{gcd}\*K
\end{array}
\right.$$
粘贴完成就是这个效果
为了符合html的规则去改变markdown的规则是种坏的科学😂
确实 我也这么认为……然而我还没研究出解析公式的同时跳过markdown转换html的办法。。
---原始邮件--- 发件人: "Baileys"<[email protected]> 发送时间: 2021年1月12日(周二) 下午5:35 收件人: "Siricee/hexo-theme-Chic"<[email protected]>; 抄送: "State change"<[email protected]>;"Liu Zijian"<[email protected]>; 主题: Re: [Siricee/hexo-theme-Chic] 关于数学公式 (#79)
为了符合html的规则去改变markdown的规则是种坏的科学😂
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or unsubscribe.
确实 我也这么认为……然而我还没研究出解析公式的同时跳过markdown转换html的办法。。 … ---原始邮件--- 发件人: "Baileys"<[email protected]> 发送时间: 2021年1月12日(周二) 下午5:35 收件人: "Siricee/hexo-theme-Chic"<[email protected]>; 抄送: "State change"<[email protected]>;"Liu Zijian"<[email protected]>; 主题: Re: [Siricee/hexo-theme-Chic] 关于数学公式 (#79) 为了符合html的规则去改变markdown的规则是种坏的科学😂 — You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or unsubscribe.
虽然宁(我也)比较鄙视直接改node_modules里的文件的行为,but it works. 我把这个文件改了以后直接放在外部,用travis自动替换,这里 然后公式没问题了,比如这篇博客 最后的公式没有再乱码辽
我的公式会重复显示,这是为什么
有网址吗 我看下
---原始邮件--- 发件人: @.> 发送时间: 2021年5月25日(周二) 中午12:34 收件人: @.>; 抄送: "Liu @.>;"State @.>; 主题: Re: [Siricee/hexo-theme-Chic] 关于数学公式 (#79)
我的公式会重复显示,这是为什么
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or unsubscribe.
https://arost01.github.io/2021/05/25/1009-Product-of-Polynomials/
有网址吗 我看下 … ---原始邮件--- 发件人: @.> 发送时间: 2021年5月25日(周二) 中午12:34 收件人: @.>; 抄送: "Liu @.>;"State @.>; 主题: Re: [Siricee/hexo-theme-Chic] 关于数学公式 (#79) 我的公式会重复显示,这是为什么 — You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or unsubscribe.
https://arost01.github.io/2021/05/25/1009-Product-of-Polynomials/
可以通过math: true这种方式吗显示吗
大佬,公式这个还能解决吗
我找到问题所在了,我这边公式重复显示是因为,我换成了另一个主题的渲染器
自带的渲染器会出现乱码的原因我也找到了,公式内部不能屏蔽 * 字符,会被识别为加粗。要想避免这种情况,必须每次在公式内部把 * 符号前后空出一格。 修改成功后
-
Hexo + Chic内LaTeX的显示问题,复杂公式的显示问题,公式重复显示问题,解决方案见Hexo + Chic如何支持数学公式,特别是复杂LaTeX公式,公式会重复显示、LaTeX公式本地预览可以显示deploy上去无法显示解决办法
为啥不集成katex? mathjax似乎比较慢,每次渲染都要一两秒
在head.ejs
中添加了
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css" integrity="sha384-Xi8rHCmBmhbuyyhbI88391ZKP2dmfnOl4rT9ZfRI7mLTdk1wblIUnrIq35nqwEvC" crossorigin="anonymous">
<!-- The loading of KaTeX is deferred to speed up page rendering -->
<script defer src="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.js" integrity="sha384-X/XCfMm41VSsqRNQgDerQczD69XqmjOOOwYQvr/uuC+j4OPoNhVgjdGFwhvN02Ja" crossorigin="anonymous"></script>
<!-- To automatically render math in text elements, include the auto-render extension: -->
<script defer src="https://cdn.jsdelivr.net/npm/[email protected]/dist/contrib/auto-render.min.js" integrity="sha384-+XBljXPPiv+OzfbB3cVmLHf4hdUFHlWNZN5spNQ7rmHTXpd7WvJum6fIACpNNfIR" crossorigin="anonymous"
onload="renderMathInElement(document.body);"></script>
就可以了
为啥不集成katex? mathjax似乎比较慢,每次渲染都要一两秒
在
head.ejs
中添加了<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css" integrity="sha384-Xi8rHCmBmhbuyyhbI88391ZKP2dmfnOl4rT9ZfRI7mLTdk1wblIUnrIq35nqwEvC" crossorigin="anonymous"> <!-- The loading of KaTeX is deferred to speed up page rendering --> <script defer src="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.js" integrity="sha384-X/XCfMm41VSsqRNQgDerQczD69XqmjOOOwYQvr/uuC+j4OPoNhVgjdGFwhvN02Ja" crossorigin="anonymous"></script> <!-- To automatically render math in text elements, include the auto-render extension: --> <script defer src="https://cdn.jsdelivr.net/npm/[email protected]/dist/contrib/auto-render.min.js" integrity="sha384-+XBljXPPiv+OzfbB3cVmLHf4hdUFHlWNZN5spNQ7rmHTXpd7WvJum6fIACpNNfIR" crossorigin="anonymous" onload="renderMathInElement(document.body);"></script>
就可以了
因为我不会用KaTeX,一直用LaTeX也没去学,你需要KaTeX的话自行添加就好了
想问一下想要支持行内数学公式应该怎么做呢? 写了这样一个内容:设(X,$$\rho$$)为距离空间 显示的结果是:
行内公式用单$符包围 $$fomula$$ -> $fomula$