next-theme / hexo-filter-mathjax

💯 Server side MathJax renderer plugin for Hexo.
https://www.npmjs.com/package/hexo-filter-mathjax
MIT License
104 stars 6 forks source link

如何避免不必要的inline渲染 #12

Closed leonfancy closed 4 years ago

leonfancy commented 4 years ago

假如我有一句话是

这支笔价格是$2.4,那把直尺价格是$3.5。 

两个$...$之间的内容也会被当成公式渲染。请问有办法避免这种情况吗?

stevenjoezhang commented 4 years ago
mathjax:
  single_dollars: false # enable single dollar signs as in-line math delimiters

single_dollars 设置为 false

leonfancy commented 4 years ago

有没有办法即能让$...$渲染公式,又可以避免上面那种错误。比如不需要渲染的地方,使用\$来转义。

stevenjoezhang commented 4 years ago

我不确定,你可以试一下。或者这样写

这支笔价格是`$2.4`,那把直尺价格是`$3.5`。 

$符号放到代码块里

stevenjoezhang commented 4 years ago

这更多的是 MathJax 甚至 LaTeX 本身的局限性,恐怕我无法解决。