Latex in the Blog!
And God said…
\[ \nabla\cdot\mathbf{E}=\frac{\rho}{\epsilon_0}\] \[ \nabla\cdot\mathbf{B}=0\] \[ \nabla\times\mathbf{E}=-\frac{\partial\mathbf{B}}{\partial t}\] \[ \nabla\times\mathbf{B}=\mu_0\mathbf{J}+\mu_0\epsilon_0\frac{\partial\mathbf{E}}{\partial t}\]
… and there was LaTeX in the blog!
Apparently in 2016 it’s disappointedly easy to setup a webpage to display math properly. The problem has nowadays been simplified to add a single line in the head
of HTML document that calls an external script. Then, you just have to type LaTeX code in the body of the document. You only have to note that the code has to be surrounded by the escaped brackets: \[
and \]
for displayed equations; and \(
and \)
for in-line ones. That’s all, the rest is done “magically” and the result is fast, clean and even consistent with the fonts of your page. What else can you ask for! By the way, if you are using Jekyll, such as I do, it’s important to scape the slash \
by prepending a second one, like \\[
.
I don’t fully get what’s going on under the hood, but somehow this trick uses the resource provided by Mathjax. The webpage of the project explains very clearly what I have just summarised in the paragraph above, so if you feel like using this resource and need a comprehensive reference, just go there and have fun.
Categories: Computation
subscribe via atom