Skip to main content
Mathjax can help you to embed LaTeX style math formula in you web content.

To get MathJax to work in Blogger, just go to your Blogger account, click "Design" (top right of the page), and then "Edit HTML". After the first <head> you see, paste
    
<script src='http://cdn.mathjax.org/mathjax/latest/MathJax.js' type='text/javascript'>    
    MathJax.Hub.Config({
        HTML: ["input/TeX","output/HTML-CSS"],
        TeX:extensions: ["AMSmath.js","AMSsymbols.js"], 
               equationNumbers: { autoNumber: "AMS" } },
        extensions: ["tex2jax.js"],
        jax: ["input/TeX","output/HTML-CSS"],
        tex2jax: { inlineMath: [ ['$','$'], ["\\(","\\)"] ],
                   displayMath: [ ['$$','$$'], ["\\[","\\]"] ],
                   processEscapes: true },
        "HTML-CSS": { availableFonts: ["TeX"],
                      linebreaks: { automatic: true } }
    });
</script>

The information comes from http://mathjaxtest.blogspot.ca/.

You can now use the usual $...$ or \(...\) for inline equations, and $$...$$ or
\[...\] for equations that are centered in their own line.
Some examples:

A Cross Product Formula

$$\mathbf{V}_1 \times \mathbf{V}_2 =  \begin{vmatrix}
\mathbf{i} & \mathbf{j} & \mathbf{k} \\
\frac{\partial X}{\partial u} &  \frac{\partial Y}{\partial u} & 0 \\
\frac{\partial X}{\partial v} &  \frac{\partial Y}{\partial v} & 0
\end{vmatrix}$$

An inline example: $P(E) = {n \choose k} p^k (1-p)^{n-k}$

Note:I tried to let Mathjax to ignore some blocks to present the code of formula, but doesn't work. Finally, I use the configuration as below:

     <script src='http://cdn.mathjax.org/mathjax/latest/MathJax.js' type='text/javascript'>
            MathJax.Hub.Config({
                HTML: ["input/TeX","output/HTML-CSS"],
                TeX: { extensions: ["AMSmath.js","AMSsymbols.js"],
                equationNumbers: { autoNumber: "AMS" } },
                extensions: ["tex2jax.js"],
                jax: ["input/TeX","output/HTML-CSS"],
                tex2jax: { inlineMath: [ ['$','$'], ["\\(","\\)"] ],
                    displayMath: [ ['$$','$$'], ["\\[","\\]"] ],
                    skipTags: ["script","noscript","style","textarea","pre","code"],
                    processClass: "mathjax",
                    ignoreClass: "tex2jax_ignore|nomath",
                    processEnvironments: false,
                    processEscapes: true},
                    "HTML-CSS": { availableFonts: ["TeX"],
                    linebreaks: { automatic: true } }
        });
    </script>

Comments

Popular posts from this blog

Resource in Static Library using Qt

If you will use resources in a static library, you have to initialize it first, like following:  http://qt-project.org/doc/qt-4.8/resources.html   int main(int argc, char *argv[])   {       QApplication app(argc, argv);        Q_INIT_RESOURCE(graphlib);       ...        return app.exec();    }