Wednesday, 30 September 2020

Very obscure bug in Google Blogger

I use Google Blogger for this blog. I also use MathJax for displaying equations which are in a code called Latex. Google recently introduced major changes to Blogger and it screwed up the equation display. I prepare text for a post in MS-Word so we might have something like this (but replace all £ signs by $ signs)
££\chi_\nu\nabla_\mu\chi_\sigma+\chi_\sigma\nabla_\nu\chi_\mu+\chi_\mu\nabla_\sigma\chi_\nu=0
££
and it should come out like this$$
\chi_\nu\nabla_\mu\chi_\sigma+\chi_\sigma\nabla_\nu\chi_\mu+\chi_\mu\nabla_\sigma\chi_\nu=0
$$but sadly it now comes out like this
$$
\chi_\nu\nabla_\mu\chi_\sigma+\chi_\sigma\nabla_\nu\chi_\mu+\chi_\mu\nabla_\sigma\chi_\nu=0
$$
which is not what is wanted!

To move the Latex code from MS-Word was simply a matter of copying it and pasting it as plane text (Ctrl+Shift+V).

In the old version of Blogger linefeeds produced HTML <br/>, in the new version they produce </div><div>, which screws up Mathjax. The old version and the new version of the HTML are shown below (once again, replace all £ signs by $ signs)

££ <br/>\chi_\nu\nabla_\mu\chi_\sigma+\chi_\sigma\nabla_\nu\chi_\mu+\chi_\mu\nabla_\sigma\chi_\nu=0<br/>££

££ 
</div><div>\chi_\nu\nabla_\mu\chi_\sigma+\chi_\sigma\nabla_\nu\chi_\mu+\chi_\mu\nabla_\sigma\chi_\nu=0 </div><div>££

Solution

  1. To begin with I just edited the latex removing linefeeds and reinstating with shift-enter. That replaces  </div><div> by <br/>. You also have to make sure that the text style is Normal not Paragraph. The editor sometimes seems to start in the latter mode.
  2. Then I discovered Search replace in HTML editing view. So now I just replace all </div><div> by <br/>.
It's still rather tedious. I wish the lovely people at Google would fix it.

No comments:

Post a comment