{"id":855,"date":"2023-03-05T10:11:50","date_gmt":"2023-03-05T02:11:50","guid":{"rendered":"https:\/\/www.appblog.cn\/?p=855"},"modified":"2023-04-29T16:46:43","modified_gmt":"2023-04-29T08:46:43","slug":"escape-problem-of-mathjax-under-hexo","status":"publish","type":"post","link":"https:\/\/www.appblog.cn\/index.php\/2023\/03\/05\/escape-problem-of-mathjax-under-hexo\/","title":{"rendered":"Hexo\u4e0bMathjax\u7684\u8f6c\u4e49\u95ee\u9898"},"content":{"rendered":"<h2>\u95ee\u9898<\/h2>\n<p>\u6211\u4eec\u5e73\u65f6\u4f7f\u7528markdown\u5199\u6587\u6863\u7684\u65f6\u5019\uff0c\u514d\u4e0d\u4e86\u4f1a\u78b0\u5230\u6570\u5b66\u516c\u5f0f\uff0c\u597d\u5728\u6709\u5f3a\u5927\u7684<a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/www.mathjax.org\/\" title=\"Mathjax\">Mathjax<\/a>\uff0c\u53ef\u4ee5\u89e3\u6790\u7f51\u9875\u4e0a\u7684\u6570\u5b66\u516c\u5f0f\uff0c\u4e0ehexo\u7684\u7ed3\u5408\u4e5f\u5f88\u7b80\u5355\uff0c\u53ef\u4ee5\u624b\u52a8\u52a0\u5165js\uff0c\u6216\u8005\u76f4\u63a5\u4f7f\u7528<a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/github.com\/akfish\/hexo-math\" title=\"hexo-math\">hexo-math<\/a>\u63d2\u4ef6\u3002\u5927\u90e8\u5206\u60c5\u51b5\u4e0b\u90fd\u662f\u53ef\u4ee5\u7684\uff0c\u4f46\u662fMarkdwon\u672c\u8eab\u7684\u7279\u6b8a\u7b26\u53f7\u4e0eLatex\u4e2d\u7684\u7b26\u53f7\u4f1a\u51fa\u73b0\u51b2\u7a81\u7684\u65f6\u5019\uff1a<\/p>\n<p><!-- more --><\/p>\n<p><code>\u2014<\/code>\u7684\u8f6c\u4e49\uff0c\u5728markdown\u4e2d\uff0c<code>_<\/code>\u662f\u659c\u4f53\uff0c\u4f46\u662f\u5728latex\u4e2d\uff0c\u5374\u6709\u4e0b\u6807\u7684\u610f\u601d\uff0c\u5c31\u4f1a\u51fa\u73b0\u95ee\u9898\uff1b<br \/>\n<code>\\\\<\/code>\u7684\u6362\u884c\uff0c\u5728markdown\u4e2d\uff0c<code>\\\\<\/code>\u4f1a\u88ab\u8f6c\u4e49\u4e3a<code>\\<\/code>\uff0c\u8fd9\u6837\u4e5f\u4f1a\u5f71\u54cd\u5f71\u54cdmathjax\u5bf9\u516c\u5f0f\u4e2d\u7684<code>\\\\<\/code>\u8fdb\u884c\u6e32\u67d3\u3002<\/p>\n<h2>\u539f\u56e0<\/h2>\n<p>Hexo\u9ed8\u8ba4\u4f7f\u7528<code>marked.js<\/code>\u53bb\u89e3\u6790markdown\uff0c\u6bd4\u5982\u4e00\u4e9b\u7b26\u53f7\uff0c<code>_<\/code>\u4ee3\u8868\u659c\u4f53\uff0c\u4f1a\u88ab\u5904\u7406\u4e3a<em>\u6807\u7b7e\uff0c\u6bd4\u5982<code>x_i<\/code>\u5728\u5f00\u59cb\u88ab\u6e32\u67d3\u65f6\uff0c\u5904\u7406\u4e3a<code>x&lt;em&gt;i&lt;\/em&gt;<\/code>\uff0c\u6b64\u65f6Mathjax\u5c31\u65e0\u6cd5\u6e32\u67d3\u6210\u4e0b\u6807\u4e86\u3002\u5f88\u591a\u7b26\u53f7\u90fd\u6709\u8fd9\u4e2a\u95ee\u9898\uff0c\u6bd4\u5982\u7c97\u4f53<code>*<\/code>\uff0c\u4e5f\u662f\u65e0\u6cd5\u5728Mathjax\u6e32\u67d3\u51fa\u6765\u7684\uff0c\u5305\u62ec<code>\\\\<\/code>\u540c\u7406\u3002\u6240\u4ee5\u8bf4\u5230\u5e95\uff0c\u662fHexo\u4f7f\u7528\u7684markdown\u5f15\u64ce\u7684\u9505\uff0c\u56e0\u4e3a\u5f88\u591a\u5176\u5b83\u5f15\u64ce\u5728\u8fd9\u65b9\u9762\u5904\u7406\u7684\u5f88\u597d\u3002<\/p>\n<h2>\u89e3\u51b3\u65b9\u6cd5<\/h2>\n<h3>\u624b\u52a8escape<\/h3>\n<p>\u8fd9\u4e2a\u65b9\u6cd5\u6700\u76f4\u63a5\uff0c\u6dfb\u52a0\u8f6c\u4e49\u5373\u53ef\u3002\u6bd4\u5982\u9700\u8981\u5728\u516c\u5f0f\u4e2d\u5199\u4e0b\u6807\u7b26\u53f7\uff0c\u90a3\u5c31\u4fee\u6539\u5199\u6cd5\u5199\u4e3a: <code class=\"mathjax-inline language-mathjax\">x\\_i<\/code>\uff1b\u9700\u8981\u6362\u884c\u5c31\u4f7f\u7528<code>\\\\\\\\<\/code>\u3002<br \/>\n\u5f88\u660e\u663e\uff0c\u8fd9\u79cd\u65b9\u5f0f\u901a\u7528\u6027\u5f88\u5dee\uff0c\u6bd4\u5982\u8fc1\u79fb\u5230\u5176\u5b83\u5730\u65b9\uff0c\u5c31\u65e0\u6cd5\u8bc6\u522b\uff0c\u56e0\u4e3a\u5927\u90e8\u5206\u7684markdown\u5f15\u64ce\u662f\u6ca1\u6709\u8fd9\u4e2a\u95ee\u9898\u7684\u3002<\/p>\n<h3>\u4fee\u6539Hexo\u6e32\u67d3\u6e90\u7801<\/h3>\n<p>\u76f8\u5bf9\u6765\u8bf4\uff0c\u901a\u7528\u6027\u8f83\u9ad8\u7684\u4e00\u79cd\u65b9\u5f0f\u3002\u601d\u8def\u5c31\u662f\u4fee\u6539Hexo\u7684markdown\u6e32\u67d3\u6e90\u7801: <code>node_modules\/marked\/lib\/marked.js<\/code><\/p>\n<p>\uff081\uff09\u53bb\u6389<code>\\\\<\/code>\u7684\u989d\u5916\u8f6c\u4e49<br \/>\n\uff082\uff09\u5c06em\u6807\u7b7e\u5bf9\u5e94\u7684\u7b26\u53f7\u4e2d\uff0c\u53bb\u6389<code>_<\/code>\uff0c\u56e0\u4e3amarkdown\u4e2d\u6709<code>*<\/code>\u53ef\u4ee5\u8868\u793a\u659c\u4f53\uff0c<code>\u2014<\/code>\u4fbf\u53ef\u53bb\u6389<\/p>\n<pre><code># vim node_modules\/marked\/lib\/marked.js<\/code><\/pre>\n<p>\u7b2c\u4e00\u6b65\uff1a\u627e\u5230\u4e0b\u9762\u7684\u4ee3\u7801<\/p>\n<pre><code>escape: \/^\\\\([\\\\`*{}\\[\\]()# +\\-.!_&gt;])\/,<\/code><\/pre>\n<p>\u6539\u4e3a<\/p>\n<pre><code>escape: \/^\\\\([`*{}\\[\\]()# +\\-.!_&gt;])\/,<\/code><\/pre>\n<p>\u5373\u53ef\u53bb\u6389<code>\\\\<\/code>\u7684\u8f6c\u4e49<\/p>\n<p>\u7b2c\u4e8c\u6b65\uff1a\u627e\u5230em\u7684\u7b26\u53f7<\/p>\n<pre><code>em: \/^\\b_((?:[^_]|__)+?)_\\b|^\\*((?:\\*\\*|[\\s\\S])+?)\\*(?!\\*)\/,<\/code><\/pre>\n<p>\u6539\u4e3a<\/p>\n<pre><code>em:\/^\\*((?:\\*\\*|[\\s\\S])+?)\\*(?!\\*)\/,<\/code><\/pre>\n<p>\u5373\u53ef\u53bb\u6389<code>_<\/code>\u7684\u659c\u4f53\u542b\u4e49<\/p>\n<h2>\u91cd\u542fHexo<\/h2>\n<pre><code># hexo server<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u95ee\u9898 \u6211\u4eec\u5e73\u65f6\u4f7f\u7528markdown\u5199\u6587\u6863\u7684\u65f6\u5019\uff0c\u514d\u4e0d\u4e86\u4f1a\u78b0\u5230\u6570\u5b66\u516c\u5f0f\uff0c\u597d\u5728\u6709\u5f3a\u5927\u7684Mathjax\uff0c\u53ef\u4ee5\u89e3\u6790\u7f51\u9875 [&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,240],"class_list":["post-855","post","type-post","status-publish","format-standard","hentry","category-tools-skills","tag-hexo","tag-mathjax"],"_links":{"self":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/855","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=855"}],"version-history":[{"count":0,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/855\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/media?parent=855"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/categories?post=855"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/tags?post=855"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}