What is Mathjax?
MathJax allows you to include mathematics in your web pages, either using LaTeX, MathML, or AsciiMath notation, and the mathematics will be processed using JavaScript to produce HTML, SVG or MathML equations for viewing in any modern browser.Installing MathJax on Your Website
The easiest way to install MathJax on your website is adding link of CDN(Content Distribution/Delivery Network) inside the head section of your website. You copy and paste following code just above closing head tag. You can place following code on body part of your website too. If you are using Blogger as your blogging platform you can add this code on your HTML post editor. It is not necessary to add this code for each post. You can add this code by adding HTML/JavaScript gadget for this script stored on CDN. I added this code along with the codes of contact button.
Let us Start MathJax
The support for TeX and LaTeX in MathJax consists of two parts: the tex2jax preprocessor, and the TeX input processor. The first of these looks for mathematics within your web page (indicated by math delimiters like $$...$$) and marks the mathematics for later processing by MathJax. The TeX input processor is what converts the TeX notation into MathJax’s internal format, where one of MathJax’s output processors then displays it in the web page.The default, the tex2jax preprocessor defines the LaTeX math delimiters are $$...$$ and \[...\] for displayed mathematics, and \(...\) for in-line mathematics. Note in particular that the $...$ in-line delimiters are not used by default. That is because dollar signs appear too often in non-mathematical settings, which could cause some text to be treated as mathematics unexpectedly. For example, with single-dollar delimiters, ”The Raspberry Pi3 is of $35 while Raspberry Pi Zero W costs only $5" would cause the phrase "35 while Raspberry Pi Zero W costs only" to be treated as mathematics since it falls between dollar signs.
If you don't know LaTeX commands, don't bother about that. There is an awesome tool called Detexify. You have to just draw your mathematical symbol on the Detexify. It will find out corresponding code. The Detexify has Android app on Google Play Store. An example for LaTeX command is give below. We will discuss more about those commands in next post.
The following MathJax code will give you result \(\frac12\).
\(\frac12\)
Comments
Post a Comment