Math & ScienceMultline in matrix cells

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
mrchemist
Posts: 3
Joined: Tue Mar 16, 2010 1:10 pm

Multline in matrix cells

Post by mrchemist »

I have a rotation matrix with some particularly lengthy elements (lots of sin and cos terms). What I'd ideally like to do is to break these terms into two parts so that it's more compact, much like the multline environment. Of course, this environment can't be used if you're already in math mode. I'm currently using the ams-math bmatrix environment to lay out my matrix. Is there any way of breaking the matrix element over two lines?
Last edited by mrchemist on Wed Mar 17, 2010 12:59 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX books
User avatar
Stefan Kottwitz
Site Admin
Posts: 10308
Joined: Mon Mar 10, 2008 9:44 pm

Multline in matrix cells

Post by Stefan Kottwitz »

Hi,

you could use \parbox inside the matrix, inside a \parbox you can use multiline math environments.

Stefan
LaTeX.org admin
mrchemist
Posts: 3
Joined: Tue Mar 16, 2010 1:10 pm

Re: Multline in matrix cells

Post by mrchemist »

Thanks for the hint. It gets close to what I want, however inserting another math environment screws up the numbering of the equations. I'll have a play and see if I can get it working...
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Multline in matrix cells

Post by frabjous »

mrchemist wrote:Thanks for the hint. It gets close to what I want, however inserting another math environment screws up the numbering of the equations.
Even with the starred versions?
mrchemist
Posts: 3
Joined: Tue Mar 16, 2010 1:10 pm

Multline in matrix cells

Post by mrchemist »

The starred versions take the numbering off the 'parent' equation.

In the end, I hacked together a macro using \raisebox and \makebox commands... it's not pretty, but it works:

Code: Select all

Code, edit and compile here:
\newcommand{\MatrixSplitEqn}[2]
{\makebox{\raisebox{\height}{\makebox[0.4\width][l]{$#1$}}
\raisebox{-\height}{\makebox{$#2$}}}\vspace{5pt}}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Post Reply