Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm trying to typeset two matrices side by side, somewhat like:

A = (matrix)    B = (matrix)

I tried to next the matrices inside an align environment:

\begin{align*}
  A &= \begin{pmatrix} ... \end{pmatrix} &
  B &= \begin{pmatrix} ... \end{pmatrix}
\end{align*}

but I get when compiling:

Package amsmath Error: Erroneous nesting of equation structures

Presumably the way I'm trying to do it isn't the right way; how should I be doing this?

share|improve this question
3  
I tried something presumably just like this and did not get an error. Could you post a complete, minimal example that has this problem? –  Ryan Reich Dec 4 '10 at 22:53
1  
Your code compiles for me. Perhaps you omitted something from your example? –  TH. Dec 4 '10 at 22:54
2  
Oh, excuse me! I accidentally put the align* environment inside equation mode, when it should stand alone. Thanks for checking that for me (and sorry for my stupidity!). –  Ben Alpert Dec 4 '10 at 23:09
10  
it would be nice if you would put that solution into an answer and mark this answer as accepted. In this way the question does not appear to be unsolved any more. –  Stefan Kottwitz Dec 4 '10 at 23:29

1 Answer 1

up vote 4 down vote accepted

The error has been caused by accidentally nesting align* and equation, as Ben informed.

Displayed math environments cannot be nested. However, there are environments such as aligned and split which work inside an equation environment.

This answer has been posted and marked as community wiki, in the hope that after an upvote this question isn't marked as "unanswered" by the site any more.

share|improve this answer
    
Sorry, I should've posted this myself as an answer earlier. –  Ben Alpert Dec 31 '10 at 18:23

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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