[Tex/LaTex] Equations in normal LaTeX to MathJax formatting

formattingmath-modemathjax

To use the align environment in a document one does something like:

\begin{align*}
x &= \sqrt{4^2-1^2} \\
  &= \sqrt{15}.
\end{align*}put 

However, to achieve the same desired output on a webpage which uses MathJax to render math, as math.se does:

\[
  \begin{align*}
x &= \sqrt{4^2-1^2} \\
  &= \sqrt{15}.
  \end{align*}
\]

must be done.

I want to save in some tex files the contents of some possible post for webpages which use MathJax, so the post would be whatever is between \begin{document} and \end{document}. But also, I want these documents to be compilable using pdflatex.

In order to achieve that, either the \[ \] or the align (and the like) environment must be redefined.

How to do so?

Best Answer

You do not need the \[ and \] for MathJax to recognize this. You have not given your MathJax configuration, but as long as processEnvironments is true in the tex2jax section of your configuration, then it should pick up the \begin directly. See the tex2jax section of the configuration documentation.

Related Question