1

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

1 Answer 1

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}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .