{"id":5097,"date":"2021-01-07T21:13:44","date_gmt":"2021-01-07T13:13:44","guid":{"rendered":"https:\/\/www.highflybird.com\/blog\/?p=5097"},"modified":"2021-01-09T11:15:18","modified_gmt":"2021-01-09T03:15:18","slug":"%e7%94%a8mathjax%e5%86%99%e6%95%b0%e5%ad%a6%e5%85%ac%e5%bc%8f","status":"publish","type":"post","link":"https:\/\/www.highflybird.com\/blog\/?p=5097","title":{"rendered":"\u7528mathjax\u5199\u6570\u5b66\u516c\u5f0f"},"content":{"rendered":"<p>\u4ee5\u4e0b\u4e3a\u6d4b\u8bd5mathjax\uff1a<\/p>\n<h3>\u5982\u4f55\u4f7f\u7528\uff1f<\/h3>\n<p>\u5728\u7f16\u8f91\u6587\u7ae0\u65f6\u63d2\u5165\u516c\u5f0f\uff0c\u6837\u5f0f\u5982\u4e0b\uff1a<br \/>\n<!--more--><br \/>\n\u5728\u6587\u4e2d\u63d2\u5165\uff1a<\/p>\n<pre class=\"pure-highlightjs line-numbers\"><code class=\"language-none\">\\(\u60f3\u63d2\u5165\u7684\u516c\u5f0f\\)<\/code><\/pre>\n<p>\u6548\u679c\uff1a\u7231\u56e0\u65af\u5766\u7684\u8d28\u80fd\u65b9\u7a0b\u4e3a\\(E=mc^2\\)\u3002<\/p>\n<hr class=\"wp-block-separator\">\n<p>\u516c\u5f0f\u5355\u72ec\u6210\u4e00\u884c\uff1a<\/p>\n<pre class=\"pure-highlightjs line-numbers\"><code class=\"language-none\">$\u60f3\u63d2\u5165\u7684\u516c\u5f0f$<\/code><\/pre>\n<p>\u6548\u679c\uff1a\u7231\u56e0\u65af\u5766\u7684\u8d28\u80fd\u65b9\u7a0b\u4e3a$$E=mc^2$$<\/p>\n<hr class=\"wp-block-separator\">\n<p>\u4e0a\u9762\u7684\u65b9\u6cd5\u5728\u6d4f\u89c8\u5668\u4e2d\u90fd\u662f\u76f4\u63a5\u901a\u8fc7HTML\u6e32\u67d3\u7684\uff0c\u63a8\u8350\u7528\u8fd9\u6837\u7684\u65b9\u6cd5<\/p>\n<p>\u4ece2014\u5e74\u4e0b\u534a\u5e74\u5f00\u59cb MathJax CDN \u5728\u56fd\u5185\u8bbf\u95ee\u8d8a\u6765\u8d8a\u4e0d\u987a\u7545\uff0c\u56e0\u6b64\u6211\u6539\u4e3a\u5c06 MathJax \u76f4\u63a5\u90e8\u7f72\u5728\u670d\u52a1\u5668\u4e0a\u800c\u4e0d\u518d\u8fde\u63a5\u5176 CDN\uff0c\u8fd9\u6837\u5bf9\u8bbf\u95ee\u901f\u5ea6\u548c\u6e32\u67d3\u901f\u5ea6\u90fd\u6709\u660e\u663e\u7684\u63d0\u5347\u3002\u5177\u4f53\u505a\u6cd5\u8bf7\u8bbf\u95ee<a rel=\"noreferrer noopener\" href=\"http:\/\/docs.mathjax.org\/en\/latest\/\" target=\"_blank\">\u5b98\u7f51<\/a>\u3002<\/p>\n<p>\u6253\u7b97\u8fc7\u51e0\u5929\u5199\u4e00\u7bc7\u5b66\u672f\u6027\u4e00\u70b9\u7684\u6587\u7ae0\uff0c\u56e0\u6b64\u53ef\u80fd\u4f1a\u7528\u5230\u4e0d\u5c11\u7684\u516c\u5f0f\u3002\u641c\u4e86\u4e00\u4e0b WordPress \u4e0b\u516c\u5f0f\u8f93\u51fa\u7684\u89e3\u51b3\u65b9\u6848\uff0c\u53d1\u73b0\u4e86\u8fd9\u4e2a MathJax\u3002\u5176\u5b9e\u5982\u679c\u53ea\u662f\u5076\u5c14\u7528\u5230\u51e0\u4e2a\u516c\u5f0f\u9700\u8981\u663e\u793a\u7684\u8bdd\uff0c\u56fe\u7701\u4e8b\u5b8c\u5168\u53ef\u4ee5\u7528\u56fe\u7247\u6765\u89e3\u51b3\uff0c\u4e0d\u8fc7\u5982\u679c\u7528\u5230\u7684\u516c\u5f0f\u6570\u91cf\u6bd4\u8f83\u591a\u7684\u8bdd\uff0c\u4e00\u5f20\u5f20\u56fe\u7247\u7c98\u8d34\u5c31\u663e\u5f97\u592a\u5f31\u4e86\uff0c\u800c\u4e14\u5982\u679c\u65e5\u540e\u9700\u8981\u4fee\u6539\u7684\u8bdd\u4e5f\u662f\u4e00\u4ef6\u5f88\u9ebb\u70e6\u7684\u4e8b\u3002<\/p>\n<p>MathJax \u8ddf\u5176\u4ed6\u57fa\u4e8e LaTeX \u7684\u8bb8\u591a\u663e\u793a\u65b9\u6848\u4e00\u6837\uff0c<strong>\u4e0d\u9700\u8981<\/strong>\u7f51\u9875\u6d4f\u89c8\u8005\u5b89\u88c5\u4efb\u4f55\u63d2\u4ef6\u6216\u8005\u811a\u672c\uff0c\u800c\u4e14\u4e0d\u7ba1\u662f IE6+\uff0cFirefox3.0+\uff0cchrome\uff0cSafari\uff0c\u8fd8\u662f\u5176\u4ed6\u4efb\u4f55\u5343\u5947\u767e\u602a\u7684\u6d4f\u89c8\u5668\uff0c\u90fd\u80fd\u591f\u5f88\u597d\u5730\u6e32\u67d3\u516c\u5f0f\u6837\u5f0f\u3002\u800c\u4e14\u6211\u89c9\u5f97 MathJax \u7b97\u662f\u5b57\u4f53\u8f83\u4e3a\u7f8e\u89c2\u7684\u4e00\u4e2a\u4e86\u3002\u5173\u4e8e MathJax \u7684\u4f7f\u7528\uff0c\u8981\u5f97\u76ca\u4e8e Maxfan \u7684\u8010\u5fc3\u6307\u5bfc\u3002\u672c\u6765\u6211\u4ee5\u4e3a\u90e8\u7f72 MathJax \u662f\u4e00\u4ef6\u5f88\u590d\u6742\u7684\u4e8b\uff0c\u540e\u6765\u624d\u53d1\u73b0\u5982\u6b64\u7b80\u5355\u2026<\/p>\n<p>\u4e0b\u9762\u4e00\u6bb5\u8bdd\u4ece\u522b\u5904\u590d\u5236\u7684\uff1a<\/p>\n<div class=\"note-block\">MathJax \u662f\u4e00\u4e2a\u5f00\u6e90\u7684\u57fa\u4e8e Ajax \u7684\u6570\u5b66\u516c\u5f0f\u663e\u793a\u7684\u89e3\u51b3\u65b9\u6848\uff0c\u5176\u6700\u5927\u7684\u4f18\u52bf\u5728\u4e8e\u53ef\u4ee5\u4ee5\u57fa\u4e8e\u6587\u672c\u7684\u65b9\u5f0f\u663e\u793a\u9875\u9762\u4e2d\u7684\u6570\u5b66\u516c\u5f0f\u3002\u7ed3\u5408\u591a\u79cd\u5148\u8fdb\u7684 Web \u6280\u672f\uff0c\u652f\u6301\u51e0\u4e4e\u6240\u6709\u7684\u4e3b\u6d41\u6d4f\u89c8\u5668\u3002MathJax \u53ef\u4ee5\u5728 HTML \u9875\u9762\u4e2d\uff0c\u4e3a LaTex \u6570\u636e\u548c MathML \u6570\u5b66\u516c\u5f0f\u63d0\u4f9b\u4e86\u4e00\u4e2a\u5207\u5b9e\u53ef\u884c\u7684\u7684\u89e3\u51b3\u65b9\u6848\uff0c\u652f\u6301 Tex \u548c LaTex\u3001MathML\u3001ASCIIMathML \u8bed\u8a00\uff0c\u62e5\u6709\u4e30\u5bcc\u7684API\u63a5\u53e3\u3002\u6839\u636e\u9875\u9762\u4e2d\u5b9a\u4e49\u7684 LaTex \u6570\u636e\uff0c\u4fbf\u53ef\u751f\u6210\u5bf9\u5e94\u7684\u6570\u5b66\u516c\u5f0f\u3002<\/div>\n<p>MathJax \u7684\u5b98\u7f51\u5728<a href=\"http:\/\/www.mathjax.org\/\" target=\"_blank\" rel=\"noopener noreferrer\">\u8fd9\u91cc<\/a>\uff0c\u5982\u679c\u9700\u8981\u9605\u8bfb\u76f8\u5173\u5f00\u53d1\u6587\u6863\u7684\u8bdd\u6233<a href=\"http:\/\/docs.mathjax.org\/en\/latest\/\" target=\"_blank\" rel=\"noopener noreferrer\">\u8fd9\u91cc\uff08\u82f1\u6587\uff09<\/a>\u4ee5\u53ca<a href=\"https:\/\/media.readthedocs.org\/pdf\/mathjax\/v2.2-latest\/mathjax.pdf\" target=\"_blank\" rel=\"noopener noreferrer\">\u8fd9\u91cc\uff08PDF\uff09<\/a>\u3002\u76ee\u524d MathJax \u597d\u50cf\u53ea\u63d0\u4f9b\u4e09\u79cd\u4f7f\u7528\u9014\u5f84\uff0c\u4e00\u4e2a\u662f\u5b98\u65b9\u63a8\u8350\u7684\u76f4\u63a5\u4f7f\u7528 MathJax \u7684 CDN ( \u5185\u5bb9\u5206\u53d1\u7f51\u7edc ) \u8fdb\u884c\u8c03\u7528\uff0c\u53e6\u4e00\u4e2a\u662f\u4f7f\u7528\u9488\u5bf9\u4e0d\u540c\u5e73\u53f0\u5f00\u53d1\u7684 MathJax \u63d2\u4ef6\uff0c\u518d\u4e00\u79cd\u662f\u672c\u5730\u5b89\u88c5 MathJax \u7684\u5185\u5bb9\u7136\u540e\u8c03\u7528\u3002\u6211\u89c9\u5f97\u5427\uff0c\u9664\u975e\u5904\u4e8e\u6ca1\u6709\u7f51\u7edc\u8fde\u63a5\u7684\u72b6\u51b5\u4e0b\uff0c\u5426\u5219\u5b8c\u5168\u6ca1\u5fc5\u8981\u4f7f\u7528\u7b2c\u4e09\u79cd\u65b9\u6cd5\u3002\u76f4\u63a5\u7528 CDN \u662f\u6700\u7701\u4e8b\u7684\u529e\u6cd5\uff0c\u64cd\u4f5c\u7b80\u5355\uff0c\u4e0d\u5f80 WordPress \u6587\u4ef6\u5939\u4e0b\u52a0\u5165\u4efb\u4f55\u5185\u5bb9\uff0c\u4e0d\u5360\u672c\u5730\u5b58\u50a8\u7a7a\u95f4\u3002\u5176\u5b9e\u4e0d\u5149\u5728 WordPress \u4e0b\u9002\u7528\uff0c\u7406\u8bba\u4e0a\u4efb\u4f55\u5e73\u53f0\u90fd\u5141\u8bb8\u8c03\u7528 MathJax \u7684\u4ee3\u7801\uff0c\u6700\u8fd1\u77e5\u4e4e\u597d\u50cf\u4e5f\u652f\u6301\u516c\u5f0f\u76f4\u63a5\u8f93\u51fa\u4e86\u3002<a href=\"http:\/\/docs.mathjax.org\/en\/v1.1-latest\/platforms\/wordpress.html\" target=\"_blank\" rel=\"noopener noreferrer\">\u4ee5 WordPress \u4e3a\u4f8b<\/a>\uff0c\u53ea\u9700\u8981\u5728\u4e3b\u9898\u7684 header.php \u6587\u4ef6\u4e2d\u7684 <code>&lt;head&gt;<\/code> \u4e0e <code>&lt;\/head&gt;<\/code> \u4e4b\u95f4\u52a0\u5165\u4ee3\u7801<\/p>\n<pre><code class=\"php\">&lt;script type=\"text\/javascript\" \nsrc=\"http:\/\/cdn.mathjax.org\/mathjax\/latest\/MathJax.js?config=TeX-AMS-MML_HTMLorMML\"&gt;\n&lt;\/script&gt;<\/code><\/pre>\n<p>\u7136\u540e\u5728\u540e\u53f0\u7f16\u8f91\u5668\u76f4\u63a5\u8f93\u5165 LaTeX \u516c\u5f0f\uff0c\u524d\u53f0\u5c31\u80fd\u663e\u793a\u4e86\u3002\u8d85\u7ea7\u7b80\u5355\u7684\u6709\u6ca1\u6709\u3002\u6765\u8bd5\u8bd5\u4e24\u4e2a\u516c\u5f0f ( \u5982\u679c\u662f\u663e\u793a\u4ee3\u7801\u7684\u8bdd\u7a0d\u7b49\u4e00\u4e0b\uff0c\u6d4f\u89c8\u5668\u6e32\u67d3\u9700\u8981\u4e00\u4e9b\u65f6\u95f4 ):<\/p>\n<p>\\[{a_n} = \\frac{1}{\\pi }\\int_{ \u2013 \\pi }^\\pi {f(x)} \\cos nx \\mathrm{d} x\\]<\/p>\n<p>\u4ee5\u53ca<\/p>\n<p>\\[\\left\\{ \\begin{array}{l}\\nabla \\cdot B = 0\\\\ \\nabla \\cdot D = \\rho \\\\ \\nabla \\times H = \u2013 \\frac{{\\partial D}}{{\\partial t}} + j\\\\ \\nabla \\times E = \u2013 \\frac{{\\partial B}}{{\\partial t}} \\end{array} \\right.\\]<\/p>\n<p>\u518d\u6765\u8bd5\u8bd5\u884c\u5185\u516c\u5f0f\uff1a$\\underset{D_{1}}{\\iint}\\left (\\frac{{\\partial Q}}{{\\partial x}} \u2013 \\frac{{\\partial P}}{{\\partial y}} \\right )dxdy = \\oint_{AB} {Pdx + Qdy}$ \u6211\u662f\u683c\u6797\u516c\u5f0f~ \u663e\u793a\u6548\u679c\u8fd8\u662f\u633a\u68d2\u7684\uff0c\u800c\u4e14\u5728 Firefox \u4e0b\u5f88\u660e\u663e\u8981\u6bd4 chrome \u66f4\u6e05\u6670\u66f4\u5706\u6da6\uff0c\u4e0d\u77e5\u9053\u4e3a\u4ec0\u4e48\u3002\u5982\u679c\u50cf\u6211\u8fd9\u79cd\u4e4b\u524d\u6ca1\u7528\u8fc7 LaTeX \u8bed\u6cd5\u7684\u4eba\uff0c\u53ea\u80fd\u6c42\u52a9\u4e8e MathType \u4e4b\u7c7b\u7684\u516c\u5f0f\u7f16\u8f91\u5668\u4e86\u2026\u2026\u4e0d\u8fc7\u8f93\u5165\u6548\u7387\u5927\u5927\u964d\u4f4e\u4e86\u3002MathType \u53ef\u4ee5\u8bbe\u7f6e\u4e3a\u590d\u5236\u516c\u5f0f\u76f4\u63a5\u8f6c\u6362\u4e3a LaTeX \u8bed\u8a00\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4ee5\u4e0b\u4e3a\u6d4b\u8bd5mathjax\uff1a \u5982\u4f55\u4f7f\u7528\uff1f \u5728\u7f16\u8f91\u6587\u7ae0\u65f6\u63d2\u5165\u516c\u5f0f\uff0c\u6837\u5f0f\u5982\u4e0b\uff1a<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"footnotes":""},"categories":[76],"tags":[],"class_list":["post-5097","post","type-post","status-publish","format-standard","hentry","category-experience"],"_links":{"self":[{"href":"https:\/\/www.highflybird.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/5097","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.highflybird.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.highflybird.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.highflybird.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.highflybird.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5097"}],"version-history":[{"count":0,"href":"https:\/\/www.highflybird.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/5097\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.highflybird.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5097"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.highflybird.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5097"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.highflybird.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5097"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}