• 网页引入mathjax,latex


    Mathjax:2.x

    整理一

    <script type="text/x-mathjax-config">
    MathJax.Hub.Config({
        showProcessingMessages: false,
        messageStyle: "none",
        extensions: ["tex2jax.js"],
        jax: ["input/TeX", "output/HTML-CSS"],
        tex2jax: {
            inlineMath:  [ ["$", "$"] ],
            displayMath: [ ["$$","$$"] ],
            skipTags: ['script', 'noscript', 'style', 'textarea', 'pre','code','a'],
            ignoreClass:"comment-content"
        },
        "HTML-CSS": {
            availableFonts: ["STIX","TeX"],
            showMathMenu: false
        }
    });
    MathJax.Hub.Queue(["Typeset",MathJax.Hub]);
    </script>
    <script src="//cdn.bootcss.com/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>

    整理二

    <script type="text/x-mathjax-config">
    var mathId = document.getElementById("post-content");
    MathJax.Hub.Config({
        showProcessingMessages: false,
        messageStyle: "none",
        extensions: ["tex2jax.js"],
        jax: ["input/TeX", "output/HTML-CSS"],
        tex2jax: {
            inlineMath:  [ ["$", "$"] ],
            displayMath: [ ["$$","$$"] ],
            skipTags: ['script', 'noscript', 'style', 'textarea', 'pre','code','a'],
            ignoreClass:"comment-content"
        },
        "HTML-CSS": {
            availableFonts: ["STIX","TeX"],
            showMathMenu: false
        }
    });
    MathJax.Hub.Queue(["Typeset",MathJax.Hub,mathId]);
    </script>
    <script src="//www.bsck.org cdn.bootcss.com/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>

    修复与Instantclick的冲突

    代码如下

    适用于整理一的代码

    <script data-no-instant>
    InstantClick.on('change', function(isInitialLoad){
        if (isInitialLoad === false) {
            if (typeof MathJax !== 'undefined'){
                MathJax.Hub.Queue(["Typeset",MathJax.Hub]);
            }
        }
    });
    InstantClick.init();
    </script>

    适用于整理二的代码

     
    <script data-no-instant>
    InstantClick.on('change', function(isInitialLoad){
        if (isInitialLoad === false) {
            if (typeof MathJax !== 'undefined'){
                var mathId = document.getElementById("post-content");
                MathJax.Hub.Queue(["Typeset",MathJax.Hub,mathId]);
            }
        }
    });
    InstantClick.init();
    </script>
  • 相关阅读:
    hdu 4123 树形dp+rmq
    POJ 2761 Feed the dogs 求区间第k大 划分树
    hdu 4585 shaolin 平衡树
    *hdu 4616 Game 树形DP
    hdu 5379 Mahjong tree 树形DP入门
    CF 581F Contest Page 树形DP
    hdu 2778 LCR 模拟题
    hdu 2896 病毒侵袭 AC自动机
    hdu 2222 Keywords Search AC自动机模板题
    透过c的编程原则,来规范自己现在的一些编程习惯
  • 原文地址:https://www.cnblogs.com/Dean0731/p/12881872.html
Copyright © 2020-2023  润新知