Thursday 2 February 2017

Using LaTeX in Blogger

$$x=\frac{-b \pm \sqrt{b^2 - 4ac}}{2a} $$I've posted to my other, more educationally oriented blog Pedogogical Posturing about how to create mathematical expressions in Blogger but I've more to add on this mathematics specific blog. Above is the quadratic formula and below are the Greeks letters rendered using LaTeX:
  • Alpha: A and \(\alpha \)
  • Beta: B and \(\beta\)
  • Gamma: \(\Gamma\) and \(\gamma\)
  • Delta \(\Delta\) and \(\delta\)
  • Epsilon: E and \(\epsilon\) and \(\varepsilon\)
  • Zeta: Z and \(\zeta\)
  • Eta: H and \(\eta\)
  • Theta: \(\Theta\) and \(\theta\) and \(\vartheta\)
  • Iota: I and \(\iota\)
  • Kappa: K and \(\kappa\) and \(\varkappa\)
  • Lambda: \(\Lambda\) and \(\lambda\)
  • Mu: M and \(\mu\)
  • Nu: N and \(\nu\)
  • Xi: \(\Xi\) and \(\xi\)
  • O: O and o
  • Pi: \(\Pi\) and \(\pi\) and \(\varpi\)
  • Rho: P and \(\rho\) and \(\varrho\)
  • Sigma: \(\Sigma\) and \(\sigma\) and \(\varsigma\)
  • Tau: T and \(\tau\)
  • Upsilon: \(\Upsilon\) and \(\upsilon\)
  • Phi: \(\Phi\) and \(\phi\) and \(\varphi\)
  • Chi: X and \(\chi\)
  • Psi: \(\Psi\) and \(\psi\)
  • Omega: \(\Omega\) and \(\omega\)
The following fraction is nicely rendered as a continued fraction using LaTeX: \[\begin{equation} \frac{13}{8} = 1 + \cfrac{1}{1 + \cfrac{1}{1 + \cfrac{1}{1 + \cfrac{1}{2} } } } \end{equation}\] I'll certainly be making more use of LaTeX in future posts. Of course, mathematical symbols can be generated using the UTF-8 character set, the default character encoding for HTML-5. Characters are generated using a decimal code prefixed by &# or a hexadecimal code prefixed by &#x e.g. &#8723 or &#x2213 should generate ∓ when inserted into HTML. However, this doesn't work in Blogger and instead one has to go to "Insert special characters" which is odd. 

A final observation is that the LaTeX is slow to be rendered when first opening the blog post. One can see the underlying code before the page is properly rendered. This is because the required javascript code is being fetched from:


Click on the link and you can see the code. It's also possible to download the code and inject it into your webpage or blog (if that's allowable), thus speeding up the rendering process.

No comments:

Post a Comment