{"id":841,"date":"2023-03-04T20:36:54","date_gmt":"2023-03-04T12:36:54","guid":{"rendered":"https:\/\/www.appblog.cn\/?p=841"},"modified":"2023-04-29T16:48:02","modified_gmt":"2023-04-29T08:48:02","slug":"add-mathjax-mathematical-formula-support-to-hexo-blog","status":"publish","type":"post","link":"https:\/\/www.appblog.cn\/index.php\/2023\/03\/04\/add-mathjax-mathematical-formula-support-to-hexo-blog\/","title":{"rendered":"\u7ed9Hexo\u535a\u5ba2\u6dfb\u52a0Mathjax\u6570\u5b66\u516c\u5f0f\u652f\u6301"},"content":{"rendered":"<p>Hexo \u8f93\u5165\u6570\u5b66\u516c\u5f0f\u4e3b\u8981\u901a\u8fc7MathJax \u6e32\u67d3LaTeX \u516c\u5f0f\u5b9e\u73b0\u7684\uff0c\u5b98\u7f51\uff1a<a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/www.mathjax.org\/\">https:\/\/www.mathjax.org\/<\/a> \u3002\u5177\u4f53\u5f00\u542f\u6b65\u9aa4\u4ee5\u53ca\u7b80\u8981\u8bed\u6cd5\u4ecb\u7ecd\u5982\u4e0b\u3002<\/p>\n<h2>\u5b89\u88c5\u914d\u7f6e<\/h2>\n<p><!-- more --><\/p>\n<p>\u5728Hexo\u4e3b\u9898\u914d\u7f6e\u6587\u4ef6_config.yaml \u4e2d\u627e\u5230\u6216\u6dfb\u52a0 MathJax \u9009\u9879\uff0c\u5c06enable \u6539\u6210 true \u5373\u53ef\uff1a<\/p>\n<pre><code class=\"language-yml\"># MathJax Support\nmathjax:\n    enable: true\n    per_page: false\n    cdn: \/\/cdn.mathjax.org\/mathjax\/latest\/MathJax.js?config=TeX-AMS-MML_HTMLorMML<\/code><\/pre>\n<h2>\u9875\u9762\u63d2\u5165<\/h2>\n<p>\uff081\uff09\u9875\u9762\u63d2\u5165\u516c\u5f0f\u6709\u4e24\u79cd\u5f62\u5f0f\uff0c\u4e00\u662f\u884c\u5185\u63d2\u5165\u516c\u5f0f\u4e0d\u5c45\u4e2d\u663e\u793a\uff1a<\/p>\n<pre><code>$\u516c\u5f0f$\n\n\u4f8b\u5982\uff1a\n$E=mc^2$<\/code><\/pre>\n<p>\u7231\u56e0\u65af\u5766\u8d28\u80fd\u65b9\u7a0b\uff1a$E=mc^2$<\/p>\n<p>\uff082\uff09\u7b2c\u4e8c\u79cd\u662f\u884c\u95f4\u63d2\u5165\u516c\u5f0f\uff0c\u5c45\u4e2d\u663e\u793a\uff1a<\/p>\n<pre><code>$$\u516c\u5f0f$$\n\n\u4f8b\u5982\uff1a\n$$S=\\pi*r^2$$<\/code><\/pre>\n<p>$$S=\\pi*r^2$$<\/p>\n<h2>\u8bed\u6cd5\u516c\u5f0f<\/h2>\n<p>\u5173\u4e8e\u516c\u5f0f\u7684\u8bed\u6cd5\u683c\u5f0f\uff0c\u4e3b\u8981\u6709\u4ee5\u4e0b\u5e38\u7528\uff1a<\/p>\n<p>\uff081\uff09\u4e0a\u4e0b\u6807<\/p>\n<p>^ \u8868\u793a\u4e0a\u6807\uff0c_ \u8868\u793a\u4e0b\u6807\u3002<\/p>\n<pre><code>$$a_{1} x^{2}$$\n$$e^{-\\alpha t}$$\n$$a^{i}_{ij}$$\n$$e^{x^2} \\neq {e^x}^2$$\n$$a_{1}$$\n\n$$x^{2}$$\n$$e^{-\\alpha t}$$\n$$a^{i}_{ij}$$\n$$e{x2} \\neq {ex}2$$<\/code><\/pre>\n<p>$$a_{1} x^{2}$$<\/p>\n<p>$$e^{-\\alpha t}$$<\/p>\n<p>$$a^{i}_{ij}$$<\/p>\n<p>$$e^{x^2} \\neq {e^x}^2$$<\/p>\n<p>$$a_{1}$$<\/p>\n<p>$$x^{2}$$<\/p>\n<p>$$e^{-\\alpha t}$$<\/p>\n<p>$$a^{i}_{ij}$$<\/p>\n<p>$$e{x2} \\neq {ex}2$$<\/p>\n<p>\uff082\uff09\u6b64\u5916\uff0c\u5982\u679c\u5de6\u53f3\u4e24\u8fb9\u90fd\u6709\u4e0a\u4e0b\u6807\uff0c\u5219\u4f7f\u7528 <code>\\sideset<\/code> \u547d\u4ee4\uff0c\u6548\u679c\u5982\u4e0b\uff1a<\/p>\n<pre><code>$$\\sideset{^xy}{^xy}\\bigotimes$$\n$$\\sideset{xy}{xy}\\bigotimes$$<\/code><\/pre>\n<p>$$\\sideset{^xy}{^xy}\\bigotimes$$<\/p>\n<p>$$\\sideset{xy}{xy}\\bigotimes$$<\/p>\n<h2>\u5e73\u65b9\u6839<\/h2>\n<p>\u5e73\u65b9\u6839\u8f93\u5165\u547d\u4ee4\u4e3a <code>\\sqrt<\/code>\uff0cn\u6b21\u65b9\u6839\u547d\u4ee4\u4e3a <code>\\sqrt[n]<\/code>\uff0c\u5176\u7b26\u53f7\u5927\u5c0f\u7531LaTeX \u81ea\u52a8\u7ed9\u5b9a\uff1a<\/p>\n<pre><code>$$\\sqrt{x}$$\n$$\\sqrt{x^2+\\sqrt{y}$$\n$$\\sqrt[3]{2}$$<\/code><\/pre>\n<p>$$\\sqrt{x}$$<\/p>\n<p>$$ \\sqrt{x^2+\\sqrt{y}}$$<\/p>\n<p>$$\\sqrt[3]{2}$$<\/p>\n<h2>\u6c34\u5e73\u7ebf<\/h2>\n<p>\u4f7f\u7528 <code>\\overline<\/code> \u548c <code>\\underline<\/code> \u5206\u522b\u5728\u8868\u8fbe\u5f0f\u4e0a\u4e0b\u65b9\u753b\u51fa\u6c34\u5e73\u7ebf\uff1a<\/p>\n<pre><code>$$\\overline{m + n}$$\n$$\\underline{m + n}$$<\/code><\/pre>\n<p>$$\\overline{m + n}$$<\/p>\n<p>$$\\underline{m + n}$$<\/p>\n<h2>\u6c34\u5e73\u5927\u62ec\u53f7<\/h2>\n<p>\u547d\u4ee4 <code>\\overbrace<\/code> \u548c <code>\\underrace<\/code>\uff0c\u6548\u679c\u5982\u4e0b\uff1a<\/p>\n<pre><code>$$\\overbrace{a+b+\\cdots+z}$$\n$$\\underbrace{a+b+\\cdots+z}$$<\/code><\/pre>\n<p>$$\\overbrace{a+b+\\cdots+z}$$<\/p>\n<p>$$\\underbrace{a+b+\\cdots+z}$$<\/p>\n<h2>\u77e2\u91cf<\/h2>\n<p>\u77e2\u91cf\u7684\u547d\u4ee4\u662f <code>\\vec<\/code>\uff0c\u7528\u4e8e\u5355\u4e2a\u5b57\u6bcd\u7684\u5411\u91cf\u8868\u793a\u3002<code>\\overrightarrow<\/code> \u548c <code>\\overleftarrow<\/code> \u5206\u522b\u8868\u793a\u5411\u53f3\u548c\u5411\u5de6\u7684\u5411\u91cf\u7bad\u5934\uff1a<\/p>\n<pre><code>$$\\vec{a}$$\n$$\\overrightarrow{AB}$$\n$$\\overleftarrow{BA}$$<\/code><\/pre>\n<p>$$\\vec{a}$$<\/p>\n<p>$$\\overrightarrow{AB}$$<\/p>\n<p>$$\\overleftarrow{BA}$$<\/p>\n<h2>\u5206\u6570<\/h2>\n<p>\u5206\u6570\u4f7f\u7528 <code>\\frac{...}{...}<\/code> \u8fdb\u884c\u6392\u7248\uff1a<\/p>\n<pre><code>$$1\\frac{1}{2}$$\n$$\\frac{x^2}{k+1}$$\n$$x^{1\/2}$$<\/code><\/pre>\n<p>$$1\\frac{1}{2}$$<\/p>\n<p>$$\\frac{x^2}{k+1}$$<\/p>\n<p>$$x^{1\/2}$$<\/p>\n<h2>\u79ef\u5206\u8fd0\u7b97\u7b26<\/h2>\n<p>\u79ef\u5206\u8fd0\u7b97\u7b26\u4f7f\u7528 <code>\\int<\/code> \u751f\u6210\u3002\u6c42\u548c\u8fd0\u7b97\u7b26\u4f7f\u7528 <code>\\sum<\/code> \u751f\u6210\u3002\u4e58\u79ef\u8fd0\u7b97\u7b26\u4f7f\u7528 <code>\\prod<\/code> \u751f\u6210\u3002\u4e0a\u4e0b\u9650\u4f7f\u7528<code>^<\/code> \u548c<code>_<\/code> \u547d\u4ee4\uff0c\u7c7b\u4f3c \u4e0a\u4e0b\u6807\uff1a<\/p>\n<pre><code>$$\\sum_{i=1}^{n}$$\n$$\\int_{0}^{\\frac{\\pi}{2}}$$\n$$\\prod_\\epsilon$$<\/code><\/pre>\n<p>$$\\sum_{i=1}^{n}$$<\/p>\n<p>$$\\int_{0}^{\\frac{\\pi}{2}}$$<\/p>\n<p>$$\\prod_\\epsilon$$<\/p>\n<h2>\u77e9\u9635<\/h2>\n<p>\u53ef\u4ee5\u7528 <code>$$\\begin{matrix}\u2026\\end{matrix}$$<\/code> \u6765\u8868\u793a\u77e9\u9635\u3002\u5c06\u77e9\u9635\u5143\u7d20\u653e\u5728 <code>\\begin<\/code> \u548c <code>\\end<\/code> \u4e4b\u95f4\u5373\u53ef\u3002 \u7528 <code>\\\\<\/code> \u6765\u5206\u5272\u884c\uff0c\u7528 <code>&amp;<\/code> \u6765\u5206\u5272\u540c\u4e00\u884c\u7684\u77e9\u9635\u5143\u7d20\u3002\u5982\uff1a<\/p>\n<p>\u76f4\u63a5\u7528matrix\u3001pmatrix\u3001bmatrix\u3001Bmatrix\u3001vmatrix\u6216\u8005Vmatrix\u73af\u5883<\/p>\n<pre><code>$$\n\\begin{matrix}\n  1 &amp; x &amp; x^2 \\\\\n  1 &amp; y &amp; y^2 \\\\\n  1 &amp; z &amp; z^2 \\\\\n\\end{matrix}\n\\quad\n\\begin{pmatrix} 0 &amp; -i \\\\ i &amp; 0 \\end{pmatrix}\n\\quad\n\\begin{bmatrix} 0 &amp; -1 \\\\ 1 &amp; 0 \\end{bmatrix}\n\\quad\n\\begin{Bmatrix} 1 &amp; 0 \\\\ 0 &amp; -1 \\end{Bmatrix}\n\\quad\n\\begin{vmatrix} a &amp; b \\\\ c &amp; d \\end{vmatrix}\n\\quad\n\\begin{Vmatrix} i &amp; 0 \\\\ 0 &amp; -i \\end{Vmatrix}\n$$<\/code><\/pre>\n<p>$$<br \/>\n\\begin{matrix}<br \/>\n1 &amp; x &amp; x^2 \\<br \/>\n1 &amp; y &amp; y^2 \\<br \/>\n1 &amp; z &amp; z^2 \\<br \/>\n\\end{matrix}<br \/>\n\\quad<br \/>\n\\begin{pmatrix} 0 &amp; -i \\ i &amp; 0 \\end{pmatrix}<br \/>\n\\quad<br \/>\n\\begin{bmatrix} 0 &amp; -1 \\ 1 &amp; 0 \\end{bmatrix}<br \/>\n\\quad<br \/>\n\\begin{Bmatrix} 1 &amp; 0 \\ 0 &amp; -1 \\end{Bmatrix}<br \/>\n\\quad<br \/>\n\\begin{vmatrix} a &amp; b \\ c &amp; d \\end{vmatrix}<br \/>\n\\quad<br \/>\n\\begin{Vmatrix} i &amp; 0 \\ 0 &amp; -i \\end{Vmatrix}<br \/>\n$$<\/p>\n<h2>\u5e0c\u814a\u5b57\u6bcd<\/h2>\n<pre><code>$\\alpha$ $\\beta$ $\\gamma$ $\\delta$ $\\epsilon$<\/code><\/pre>\n<p>$\\alpha$ $\\beta$ $\\gamma$ $\\delta$ $\\epsilon$<\/p>\n<h2>\u5b57\u4f53\u8f6c\u6362<\/h2>\n<p>\u8981\u5bf9\u516c\u5f0f\u7684\u67d0\u4e00\u90e8\u5206\u5b57\u7b26\u8fdb\u884c\u5b57\u4f53\u8f6c\u6362\uff0c\u53ef\u4ee5\u7528 <code class=\"mathjax-inline language-mathjax\">{\\rm\u9700\u8f6c\u6362\u7684\u90e8\u5206\u5b57\u7b26}<\/code> \u547d\u4ee4\uff0c\u5176\u4e2d<code>\\rm<\/code>\u53ef\u4ee5\u53c2\u7167\u4e0b\u8868\u9009\u62e9\u5408\u9002\u7684\u5b57\u4f53\u3002<br \/>\n\u4e00\u822c\u60c5\u51b5\u4e0b\uff0c\u516c\u5f0f\u9ed8\u8ba4\u4e3a\u610f\u5927\u5229\u4f53\u3002<\/p>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: center;\">\u4ee3\u7801<\/th>\n<th style=\"text-align: center;\">\u5b57\u4f53<\/th>\n<th style=\"text-align: center;\">\u6548\u679c<\/th>\n<th style=\"text-align: center;\">\u4ee3\u7801<\/th>\n<th style=\"text-align: center;\">\u5b57\u4f53<\/th>\n<th style=\"text-align: center;\">\u6548\u679c<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: center;\">\\rm<\/td>\n<td style=\"text-align: center;\">\u7f57\u9a6c\u4f53<\/td>\n<td style=\"text-align: center;\">${\\rm test}$<\/td>\n<td style=\"text-align: center;\">\\it<\/td>\n<td style=\"text-align: center;\">\u610f\u5927\u5229\u4f53<\/td>\n<td style=\"text-align: center;\">${\\it test}$<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">\\bf<\/td>\n<td style=\"text-align: center;\">\u9ed1\u4f53<\/td>\n<td style=\"text-align: center;\">${\\bf test}$<\/td>\n<td style=\"text-align: center;\">\\cal<\/td>\n<td style=\"text-align: center;\">\u82b1\u4f53<\/td>\n<td style=\"text-align: center;\">${\\cal test}$<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">\\sl<\/td>\n<td style=\"text-align: center;\">\u503e\u659c\u4f53<\/td>\n<td style=\"text-align: center;\">${\\sl test}$<\/td>\n<td style=\"text-align: center;\">\\sf<\/td>\n<td style=\"text-align: center;\">\u7b49\u7ebf\u4f53<\/td>\n<td style=\"text-align: center;\">${\\sf test}$<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">\\mit<\/td>\n<td style=\"text-align: center;\">\u6570\u5b66\u659c\u4f53<\/td>\n<td style=\"text-align: center;\">${\\mit test}$<\/td>\n<td style=\"text-align: center;\">\\tt<\/td>\n<td style=\"text-align: center;\">\u6253\u5b57\u673a\u5b57\u4f53<\/td>\n<td style=\"text-align: center;\">${\\tt test}$<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">\\sc<\/td>\n<td style=\"text-align: center;\">\u5c0f\u4f53\u5927\u5199\u5b57\u6bcd<\/td>\n<td style=\"text-align: center;\">${\\sc test}$<\/td>\n<td style=\"text-align: center;\"><\/td>\n<td style=\"text-align: center;\"><\/td>\n<td style=\"text-align: center;\"><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>\u53c2\u8003<\/h2>\n<p>wikibooks\uff1a<a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/zh.wikibooks.org\/zh-sg\/LaTeX\/\u6570\u5b66\u516c\u5f0f\">https:\/\/zh.wikibooks.org\/zh-sg\/LaTeX\/\u6570\u5b66\u516c\u5f0f<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hexo \u8f93\u5165\u6570\u5b66\u516c\u5f0f\u4e3b\u8981\u901a\u8fc7MathJax \u6e32\u67d3LaTeX \u516c\u5f0f\u5b9e\u73b0\u7684\uff0c\u5b98\u7f51\uff1ahttps:\/\/www.mat [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[97],"tags":[155,241,240],"class_list":["post-841","post","type-post","status-publish","format-standard","hentry","category-tools-skills","tag-hexo","tag-latex","tag-mathjax"],"_links":{"self":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/841","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/comments?post=841"}],"version-history":[{"count":0,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/841\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/media?parent=841"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/categories?post=841"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/tags?post=841"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}