# \begin{align*} … \end{align*} is not working

I am getting an error in the following code on my LaTeX template. But the same code is running on MathJax.

\begin{align*}
1. {\log_{a}a} = 1\  \mbox{log of a number to the same base is 1}

\end{align*}


• You shouldn't have an empty line in align* and you need to load amsmath (with \usepackage{amsmath} or another package that loads it) to be able to use it. Remember: MathJax is not LaTeX. – moewe Jan 10 at 11:09
• To make this code compile, remove the blank line. – Bernard Jan 10 at 11:09
• Why is \log_{a}a encased in curly braces? – Mico Jan 10 at 11:14
• MathJax is forgiving about blank lines, LaTeX isn't. – egreg Jan 10 at 11:54

The error is due to the blank line, but also do not use align or align* for 1-line equations with no alignment, the vertical spacing will be wrong. If the 1. is not mathematics but part of an enumerated list then perhaps
\begin{enumerate}
\item $\log_{a}a = 1$ log of a number to the same base is $1$