Apr 6, 2020

Add $\LaTeX$ Functionality to Blogger

I was looking for a way to enable $\LaTeX$ in blogger posts and comments. Many tutorials were available online, but none worked for me. I guess it's due to a change in blogger themes. Finally, I figured you need to go to Layout > Add Gadget and choose HTML/JavaScript. Then, insert the following code and save it. Voila! Now you have $\LaTeX$ on your blog.

The code is from https://www.airinaa.com/2018/04/add-mathjax-beautiful-mathematic.html, however the method is different.

<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    tex2jax: {
      inlineMath: [ ['$','$'], ["\\(","\\)"] ],
      displayMath: [ ['$$','$$'], ["\\[","\\]"] ],
      processEscapes: true
    },
    "HTML-CSS": { availableFonts: ["TeX"] }
  });
</script>
<script async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript">
</script>

No comments:

Post a Comment