4

I'm trying to get

\begin{align*}
    \cos(A) &= \cos(SDS^{-1}) \\
    &= \sum\limits_{n=0}^\infty \frac{[SDS^{-1}]^n}{n!} \\
    &= I-\frac{\left(SDS^{-1}       \right)^2}{2!}+\frac{(SDS^{-1})^4}{4!}-... 
\end{align*}

to work properly, but I keep getting errors such as "misplaced alignment tab character" and enviornment align undefined.

5
  • Welcome to TeX.SX! Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That makes it a lot easier for people to understand your question and provide answers which are actually helpful to you. Note that you can format code as code by indenting 4 spaces (easy way: highlight and press '{}' button).
    – cfr
    Commented Nov 9, 2014 at 21:01
  • @Mico Why does the system count the question as being edited twice despite the fact that your edit made no changes to either content or tags? (I must have been ever so slightly faster doing precisely the same things.)
    – cfr
    Commented Nov 9, 2014 at 21:03
  • 3
    Did you remember to load the amsmath package (or the mathtools package) in the preamble of your document? The amsmath package defines the align* environment; if you don't load it, you'll get the error messages you report.
    – Mico
    Commented Nov 9, 2014 at 21:05
  • @cfr - Indeed, we must have been to make the exact same edits, with you being a few seconds quicker than me... :-)
    – Mico
    Commented Nov 9, 2014 at 21:06
  • @Mico Your description of the edit was better than mine, though ;).
    – cfr
    Commented Nov 9, 2014 at 21:10

1 Answer 1

3

(Too long for a comment, hence posted as an answer.)

The following, slightly expanded form of your posting compiles just fine:

\documentclass{article}
\usepackage{amsmath} 
\begin{document}
\begin{align*}
    \cos(A) &= \cos(SDS^{-1}) \\
    &= \sum\limits_{n=0}^\infty \frac{[SDS^{-1}]^n}{n!} \\
    &= I-\frac{(SDS^{-1})^2}{2!}+\frac{(SDS^{-1})^4}{4!}-\dots
\end{align*}
\end{document}

However, if I leave off the instruction \usepackage{amsmath}, I get the following error message:

LaTeX Error: Environment align* undefined.

This appears to be the error message (or one of the error messages) you report encountering.

In short: Did you remember to load the amsmath package, either directly, as in the example above, or indirectly, via a statement such as \usepackage{mathtools}?

You must log in to answer this question.

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