77

I'm trying to use LaTeX on my blog, but I could not figure out how. Has anyone done it before? Any feedback or related information would be greatly appreciated.

doncherry
  • 54,637
roxrook
  • 9,907

1 Answers1

85

I would say use MathJax. It's a AJAX engine for LaTeX syntax that now is distributed by a CDN so you don't have to upload a single file to your blogspot account.

To enable MathJax, just drop in

<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/latest/MathJax.js">
MathJax.Hub.Config({
 extensions: ["tex2jax.js","TeX/AMSmath.js","TeX/AMSsymbols.js"],
 jax: ["input/TeX", "output/HTML-CSS"],
 tex2jax: {
     inlineMath: [ ['$','$'], ["\\(","\\)"] ],
     displayMath: [ ['$$','$$'], ["\\[","\\]"] ],
 },
 "HTML-CSS": { availableFonts: ["TeX"] }
});
</script>

after the header (<head>) in the Blogger template (Design→Edit HTML→Edit Template).

Googling "install mathjax blogspot" led me to a page on the Web Applications StackExchange: MathJax on Blogger.

See the MathJax pages for more information about configuring and using it.

Matthew Leingang
  • 44,937
  • 14
  • 131
  • 195
  • @Chan: did you end up doing it this way? Did it work? If so, you can click the green check and we'll merge the older question into this one. – Matthew Leingang Mar 22 '11 at 11:41
  • This helped me get $\LaTeX$ on my blog, thank you. What more, the same trick works for comments as well, provided they appear on the same page as the post! – gphilip May 17 '11 at 02:37
  • 2
    The page of instruction pointed is now unavailable: "El blog se ha eliminado. Lo sentimos, el blog de mnnttl.blogspot.com se ha eliminado. Esta dirección no está disponible para blogs nuevos." – J..y B..y Jul 06 '11 at 13:22
  • @Jeremy: updated the link. There's now a page on StackExchange to refer to. – Matthew Leingang Dec 17 '12 at 17:16
  • @MatthewLeingang Thanks! Although... "The server at www.mathjax.org is taking too long to respond."... – J..y B..y Dec 19 '12 at 07:29
  • FYI I tried using the above solution with blogspot's dynamic views and had trouble rendering the equations. When I switched to a standard template for the blog, the equations rendered. – Will Oct 16 '14 at 14:38
  • @MatthewLeingang If I want every mathematical expression in blue, what should I add? – Say OL Jun 16 '15 at 03:26
  • 1
    @OLSAY: That's a question to ask the MathJax folks. – Matthew Leingang Jun 16 '15 at 15:11
  • $\LaTeX$ worked perfect on my page http://www.molympiad.ml/2017/08/mathematics-and-youth-magazine-problems-456.html – Muniain Aug 11 '17 at 21:25
  • 1
    For those who are looking for a similar configuration but with the latest MathJax (version 3): https://webapps.stackexchange.com/a/153527/196564 – raf Apr 14 '21 at 07:41
  • 1
    @raf: Thank you for updating my 10-year-old answer! – Matthew Leingang Apr 14 '21 at 18:44
  • @MatthewLeingang It's my pleasure! I personally felt the necessity of adding an updated answer. As I said in the answer: "People like me prefer getting a solution directly than reading the long documentations and end up coming here through Google search." Btw, it would be a great help if you kindly check my config and give feedback: https://chat.stackexchange.com/transcript/message/57650810#57650810 – raf Apr 14 '21 at 18:57