TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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:

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

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
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
Your code compiles for me. Perhaps you omitted something from your example? – TH. Dec 4 '10 at 22:54
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
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
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


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.