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 wrote a matrix using the pmatrix environment. The content is very long and LaTeX produces an output of the kind (the "a" line extending beyond \textwidth):

( aaa aaa aaa aaa aaa aaa + aaa aaa aaa )
( bb bb bb bb bb bb bb bb               )
( cccccccccccccccccc                    )

I would like to get:

( aaa aaa aaa aaa aaa aaa )
(           + aaa aaa aaa ) [aligned right]
( bb bb bb bb bb bb bb bb )
( cccccccccccccccccc      ) 

Can someone please help me? Here is a minimal example:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
$\begin{pmatrix}
    aaa aaa aaa aaa aaa aaa + aaa aaa aaa \\
    bb bb bb bb bb bb bb bb\\
    cccccccccccccccccc
\end{pmatrix}$
\end{document}
share|improve this question
    
Welcome to TeX.SE! I doubt if any matrix environment is adequate for your expression, which appears to have 9 entries in the first row, 8 in the second, and only 1 in the third. (Usually, matrices are rectangular arrays with an equal number of entries in each row.) –  Mico Sep 8 '12 at 18:22

1 Answer 1

The only problem with simply adding an extra line break is the alignment, which you can fix by adding a \hfill.

\documentclass{article}
\usepackage{amsmath}
\begin{document}
$\begin{pmatrix}
    aaa aaa aaa aaa aaa aaa \\
   \hfill + aaa aaa aaa \\
    bb bb bb bb bb bb bb bb\\
    cccccccccccccccccc
\end{pmatrix}$
\end{document}
share|improve this answer
2  
I'd add {} in front of + in order to get correct spacing. –  egreg Sep 8 '12 at 19:16
    
Thank you Ian! It works like a charm. –  Mathieu Sep 10 '12 at 7:15

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.