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?

  • 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!). – Sophie 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

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.

  • Sorry, I should've posted this myself as an answer earlier. – Sophie Alpert Dec 31 '10 at 18:23

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.