My First LaTeX Equation in Blogger
\sin^2 \theta + \cos^2 \theta = 1
How did I do it? Well, after a couple of tries based on various Youtube posts and other blogs...I found this post from Computer Revolution:
It was really easy...and it worked. But I'll summarize here:
1. Copy this header code:
<script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js"
type="text/javascript"> 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>
2. Paste into your Theme's HTML
I use Blogger.com for my posts, but I would expect this would work for any blogging platform that lets you edit the HTML code directly. So, for example, in Blogger, click on Theme, click the options icon and select Edit HTML.
Find the <head> in the code (it should be close to the top of the page). Paste the header code directly under <head>.
What does this do? Well, it simply loads the necessary Javascript extension. This will then apply to your entire website with this theme. Keep in mind, this does seem to break the preview of the theme in the Themes selection page, but that should be ok.
3. Create your equations with impunity
Using the same syntax as standard Latex, single-dollar signs $...$ for inline equations like:
$\pi$
to get: \pi; double-dollar signs for newline and centered, like $$x=\alpha$$
to get: x=\alpha or \begin{equation}...\end{equation}
(with the backslashes), to get something like:
\begin{equation}
\sum \dot{m}_i - \sum \dot{m}_o = \frac{dM}{dt}
\end{equation}
[Sidenote: Something I need to figure out is how to display the dollar signs without them getting interpreted as Latex equation code. 😕 Anyone know how?)
Update!!! I got it! It's probably not the right way to do it, but I surrounded the Latex code with:
<code>...
</code>.
You'll have to do this in the HTML Editor though, but that works for me.] 😁Like this:
Hope this helps everyone...it was certainly a worthwhile exercise for me. Cheers!