2013-11-06
Experiments in Math Formatting

I’m really excited to be able to easily integrate $\LaTeX$ code into web pages. The Hugo system combined with Markdown is really working out well.

Here is my first test. I’m going to just try a simple superscript experiment. I’m having problems with the superscripts getting truncated at their tops.

Here is the inline expression using dollar signs and MathJax syntax: $x ^{( y^2 + z^{x ^{( y^2 + z^3)}})}$

Here is the same expression that is formatted blocked with double dollar delimiters: $$x ^{( y^2 + z^{x ^{( y^2 + z^3)}})}$$.

Here is the same expression that is formatted inline with dollar delimiters and backquotes: \$x ^{( y^2 + z^{x ^{( y^2 + z^3)}})}\$.

Here is the same expression that is formatted inline within a blockquote:

$x ^{( y^2 + z^{x ^{( y^2 + z^3)}})}$

Here is the same expression that is formatted blocked within a blockquote:

$$x ^{( y^2 + z^{x ^{( y^2 + z^3)}})}$$

And here is the double-dollar math block within a <div> block. The use of <div> appears to be necessary to use the $\LaTeX$ align constructs. When using align (and perhaps any \begin constructs), the use of  is not necessary.

\begin{align*} & \phi(x,y) = \phi \left(\sum_{i=1}^n x_ie_i, \sum_{j=1}^n y_je_j \right) = \sum_{i=1}^n \sum_{j=1}^n x_i y_j \phi(e_i, e_j) = \\ & (x_1, \ldots, x_n) \left( \begin{array}{ccc} \phi(e_1, e_1) & \cdots & \phi(e_1, e_n) \\ \vdots & \ddots & \vdots \\ \phi(e_n, e_1) & \cdots & \phi(e_n, e_n) \end{array} \right) \left( \begin{array}{c} y_1 \\ \vdots \\ y_n \end{array} \right) \end{align*}

Here is some $\LaTeX$ code without double-dollar delimiters around a \begin-delimited block.

\begin{aligned} \nabla \times \vec{\mathbf{B}} -\, \frac1c\, \frac{\partial\vec{\mathbf{E}}}{\partial t} & = \frac{4\pi}{c}\vec{\mathbf{j}} \ \nabla \cdot \vec{\mathbf{E}} & = 4 \pi \rho
\end{aligned}

\begin{aligned} \nabla \times \vec{\mathbf{E}}\, +\, \frac1c\, \frac{\partial\vec{\mathbf{B}}}{\partial t} & = \vec{\mathbf{0}}
\end{aligned}

\begin{aligned} \nabla \cdot \vec{\mathbf{B}} & = 0 \end{aligned}