2

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*}

Please help.

  • 4
    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
  • 3
    To make this code compile, remove the blank line. – Bernard Jan 10 at 11:09
  • 2
    Why is \log_{a}a encased in curly braces? – Mico Jan 10 at 11:14
  • 2
    MathJax is forgiving about blank lines, LaTeX isn't. – egreg Jan 10 at 11:54
2

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$
\end{enumerate}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.