1.在 functions.php 文件中的全站评论开关前增加以下内容

$JMathJax = new Typecho_Widget_Helper_Form_Element_Select(
    'JMathJax',
    array(
        'on' => '开启(默认)',
        'off' => '关闭'
    ),
    'on',
    '开启或关闭全站 MathJax 支持',
    '介绍:开启后,全站支持 MathJax 公式渲染 

     说明:MathJax 是一个 JavaScript 库,用于在网页上显示数学公式 

     其他:MathJax 官网 www.mathjax.org'
);
$JMathJax->setAttribute('class', 'joe_content joe_global');
$form->addInput($JMathJax->multiMode());

2.在 post.php 文件的head标签中添加以下内容

options->JMathJax !== 'off') : ?>
    
        window.MathJax = {
            tex: {
                inlineMath: [ ["$", "$"]],
                displayMath: [ ["$$","$$"]],
                processEscapes: true,
                processEnvironments: true
            },
            options: {
                skipHtmlTags: ['script', 'noscript', 'style', 'textarea', 'pre'],
                ignoreHtmlClass: 'tex2jax_ignore',
                processHtmlClass: 'tex2jax_process'
            }
        };

公众号

新开了个公众号,叫《不语技栈》主要用于分享学习笔记,资源等。
有兴趣的可以扫描下方二维码关注公众号喔。
JOE主题MathJax公式支持