current position:Home>Hexo shows latest solution to Latex formula

Hexo shows latest solution to Latex formula

2022-09-23 05:23:48Twilight Sparkle.





A puzzling error



    In moving this weekendHexoBlog and blog before repairbug,And continue to decorate a blog.The whole a weekend finally done.First put up a personal blog link here:issey的博客 - 愿无岁月可回首

    Summarize the most let me speechless and longest question.

    Latex数学公式+Formula can't break.

    First this is two questions,要先让hexo支持数学公式,Come back is not a newline problem.Find their own many tutorials,Has tortured the fast half a day,To find a more perfect solution.May be on most of this tutorial is too old,Version is not after iterative.


    This question actually与主题无关.At the beginning I have been focusing on the theme of different solution is different,Finally solved not find.





    This part I followed this article: Hexo如何显示latex公式_gorray的博客-CSDN博客_hexo latex公式

    In fact little steps to do:

    1.首先卸载hexo-math和hexo-renderer-marked.然而hexoThere should be no bringhexo-math的,So just need to unload the second.In case of one thousand can be executed directly:

npm un hexo-math
npm un hexo-renderer-marked


npm i hexo-renderer-pandoc

    好,到此为止,Need to iterative good bag.

    3.And then configure the topic configurationmathjax设置.我用的是butterfly,Then the corresponding path is:\themes\butterfly\ _config.yml

# MathJax
  enable: true
  per_page: true


    In theory to this step can be used for,General tutorial also for no reason.Even if you take the step plus,I learn that article mentioned,There should be toPandoc官网下载最新版本pandoc:Pandoc - About pandoc

    关于pandocDownload and install the tutorial you just need check,这里就不说明了.Then the environment configuration configurationpandoc路径,Until you can be incmdEnter the following command to see which version:

pandoc -v


pandoc 2.19.2
Compiled with pandoc-types, texmath, skylighting 0.13,
citeproc, ipynb 0.2, hslua 2.2.1
Scripting engine: Lua 5.4

    Some friends may find to this step wrong,不要慌,接下来才是重点.

A puzzling error

    先回到hexo目录,执行hexo -s,If you did not appear this error:

    pandoc exited  with code 9: pandoc: Unknown extension: smart

    那么恭喜你,Your question does not exist,可以选择跳过.But if you and I As to this mistake,May begin to have a headache.But I finally found the solution.

    First of all, I found this article is:配置hexo时遇到的问题 - diralpo - 博客园 (

    Learn from this article,The cause of the fault is thatpandoc版本过低 ,And not the general causes of version is too low,Because we have installed the latest version of the abovepandoc.But the latest version didn't work.于是我打开了everythingFind computers existpandoc.And then found inAnaconda\Scripts目录下还有pandoc,Real problem also out here.


    Don't believe you'd look for,那个pandoc居然是2017年的.In an article that,pandoc版本应该在2.0以上,但那个pandoc好像是1.9.The next is simple,The new download directly to thepandoc.exe替换Anaconda里的pandoc.exe.

    Then you in returnhexo -s,就没问题了.


    At the bottom of the screen to actually do it,Newline problem has solved then.But there still mention about the line.

    首先,想直接通过\ \And what do not add anybegin,endThis kind of writing is to do less than newline,I started is grappling with this,However, the writing was not standard,例如:A \ \ B Line breaks cannot be achieved.But in the plus specificationbegin和end就可以了.其次,Line feed formula should be written in inter-row formula and adb formula.

$A \\ B$  错误写法
\begin{split} A\\B \end{split} Written in the inline error,Write from row right.

     $$\ \begin{split} A\\B \end{split}\,$$

    This article is I dohexo公式测试:Latex公式测试 | issey的博客

    If not speed loading problem,So show should be:


copyright notice
author[Twilight Sparkle.],Please bring the original link to reprint, thank you.

Random recommended