Writing a Mathematical Equation on Your Blog

In fact it is quite rare for a blog writer to put some mathematical models on the blog unless it is an article related to some very professional courses. However, low propability can hardly mean never happen. Taking myself for example, I would like to post some of my notes on econometrics and my feeling of research proposal with the blog readers, though I can write them with a Latex system and then compile it to a PDF document, providing it as an attachment for download. While I don’t think most readers would prefer such behavior. Reading that directly can be a much more pleasant experience, especially when there is not many complicated equations.

Thanks to the flexibility of the WordPress system and its countless expanded plug-ins, the solution for this can be quite simple. The only thing you are willing to do is to be familiar with the LaTex syntax, which, under most occasions, would not be a big problem for most users who are willing to do so. Even though you are unlikely to type the raw code, Mathtype can help you transfer the equation. The only work thus left for you is copy and paste.

Taking a search at WordPress.org, with the keyword of ‘latex’, you are likely to find the following plug-ins.

  1. Some Plug-ins for WordPress

    Among the plug-ins that are available, I made an attempt for the following ones on my blog. Here is a summary about each of them. For details, you can refer to their websites.

    1. WP Latex

      This is an official plug-ins for Latex from WordPress.com, with its default service based on wordpress.com. No cache is needed. You can freely change its style through the css file in settings. The only problem is that its original server ‘s.wordpress.com’ is forbidden in China, you have to change it to ‘wordpress.com’ to make it work. Besides, you can also set up your own service, but I wonder if it can violate the regulation from the host.

    2. Easy Latex

      Comparing to the official plug-ins, this one offer more flexible features. Besides the colors, you can also freely change its size directly through its GUI. Cache option is provided so that the readers can stil read the equations on your blog even when the latex service is out of work.

    3. Youngwhan’s Simple Latex

      This is the simplest plug-ins for use among the three. No other option is presented besides the address of the latex service. The service for this plugin, unlike WP Latex and Easy Latex, is provided by some open source project. Though it is convenient to set up, its flexibility is a question.

  2. My Choice

    I finally choose the official plug-ins with the consideration of the limitation of file numbers on my server. And there is no free CGI support. Which means, I can hardly construct my own system and can hardly bear too many cache files. For those whose server can support CGI, a self-constructed system should be preferred considering its stability.

  3. An Example

    As a final, I shall present an example. This is a measurement of likelihood that is common to see in econometrics.

    [latex size=2]{{R}^{2}}=\frac{SSE}{SST}=\frac{{{\left( \sum\limits_{i=1}^{n}{\left( {{y}_{i}}-\bar{y} \right)\left( {{{\hat{y}}}_{i}}-\bar{\hat{y}} \right)} \right)}^{2}}}{\left( \sum\limits_{i=1}^{n}{{{\left( {{y}_{i}}-\bar{y} \right)}^{2}}} \right)\left( \sum\limits_{i=1}^{n}{{{\left( {{{\hat{y}}}_{i}}-\bar{\hat{y}} \right)}^{2}}} \right)}[/latex]

    Where [latex]y[/latex] stands for the real value and [latex]\hat{y}[/latex] stands for the estimated value from a regression model like:

    [latex]y=\alpha_0+\alpha_1*x_1+\alpha_2*x_2+\alpha_3*x_3+\cdots+\alpha_n*x_n, n\in {{Z}^{+}}[/latex]

    The only problem left here is: how to adjust the alignments? I want them to be centered, but not left-aligned.

2 thoughts on “Writing a Mathematical Equation on Your Blog”

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.