Displaying Mathematical Equations

When I wrote on implementing Standard Error formula using LAMBDA, I used CodeCogs Equation Editor webservice. Since then I have been trying a few other solutions.

I put together this table for comparison.

Renderer Engine Input Output Format Strong Points
CodeCogs WebService LaTeXImage WYSIWYG Equation Editor
Katex JavaScript MathML,
TeX, and
AsciiMath
HTML+CSS,
SVG, or MathML
Fast rendering unlike MathJax and AsciiMath
MathJax JavaScript MathML,
TeX, and
AsciiMath
HTML+CSS,
SVG, or MathML
Widest browser compatibility
AsciiMath JavaScript AsciiMath HTML+CSS,
SVG, or MathML
Easy to write equations, format like Excel equations.

Here are some examples of a Quadratic Equation

Renderer Quadratic Equation Example
CodeCogs

Katex

\[x = {-b \pm \sqrt{b^2-4ac} \over 2a}\]

MathJax

$$x = {-b \pm \sqrt{b^2-4ac} \over 2a}$$

AsciiMath

`x=(-b+-sqrt(b^2-4ac))/(2a)`

CodeCogs Equation Editor provides an interface to select your structures. This is very helpful if you cannot remember the correct syntax. But all the solutions mentioned above have a demo page for rendering the equation as you type in the input box. No reloading of page required.

Both Katex and MathJax accepts TeX input format. So you can interchangeably switch between the two. Both Katex and MathJax can render AsciiMath input, but not the other way round. You should consider Katex or MathJax, if you use a lot of mathematical equations on your blog.

AsciiMath uses MathJax libraries. It meets my needs as I am unlikely to write complex mathematical equations. Adding the libraries is simpler (2 HTML lines only) and forming AsciiMath equations is very much like how it is read out.

Choose the solution that fits your needs and stick to it. Mixing different implementation within the same blog may only confuse yourself. This however is only a rule of thumb. If you find an equation too difficult to implement, feel free to switch to a different solution.

If you are using a different math equation renderer, please share the reason for your preference in the comments below.

Happy writing mathematical equations in your DC-DEN!

Comments