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.

Possible Duplicate:
Multiline equation with LHS alone on first line?

I want to put down an equation of the form A=B. Both expressions A and B are long. What I'd like is for A to be aligned at the left, drop down a line and have =B a little right of left aligned. Bonus points if you can have it so an expression A is left aligned, drop down a line and have =B a little right of left aligned, drop down a line and have =C, but have =B and =C line up.

share|improve this question
    
this is very like the question multiline-equation-with-lhs-alone-on-first-line. –  barbara beeton Jun 21 '12 at 15:38
add comment

marked as duplicate by barbara beeton, egreg, Ian Thompson, lockstep, Marco Daniel Jun 21 '12 at 18:19

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

3 Answers

up vote 1 down vote accepted

Here is an option to get you started using a regular array environment:

enter image description here

\documentclass{article}
\begin{document}
\[
  \begin{array}​​​​​​{l@{}l@{}r}
    ax^2 + bx + c \\
    {}+ dx^{-1} + ex^{-2} + fx^{-3} & {}= gy + hy^2 & {}= iz^{-1} + jz^{-2} + kz^{-3} \\
    & & {}+ lz^{-4} + mz^{-5}
  \end{array}
\]
\end{document}​​​​​

The use of {}+ and {}= is to ensure that the relations/operators are considered "binary"; that is, with an operand on either side (otherwise the spacing would be off). Also, @{} removes any inter-column spacing, allowing for managing the spacing of the operators much more easily.

share|improve this answer
add comment

Here are two solutions with amsmath (for the align and flalign environments) and mathtools (for the \mathrlap command):

\documentclass[a5paper]{article}
\usepackage{amsmath,mathtools}

\begin{document}

\begin{align}
\mathrlap{\text{a long expression}}
\hphantom{\qquad} & \\
&= \text{another long expression} \\
&= \text{yet another one}
\end{align}

\begin{flalign}
\mathrlap{\text{a long expression}} \\
&& &= \text{another long expression} \\
&& &= \text{yet another one}
\end{flalign}

\end{document}

enter image description here

In the first block, with \hphantom you can indent the 2nd and 3rd lines as much as you like, and the whole thing is roughly centered.

In the second block, the first line is flush left, the others are flush right (and the = signs are aligned). In this sample the \mathrlap is not needed, but it will when the expressions are longer.

share|improve this answer
add comment

Using @Werner's example code as my starting point, here's a version that uses the multline environment of the amsmath package:

enter image description here

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{multline*}
    ax^2 + bx + c \\
    {}+ dx^{-1} + ex^{-2} + fx^{-3} = gy + hy^2 = iz^{-1} + jz^{-2} + kz^{-3} \\
    {}+ lz^{-4} + mz^{-5}
\end{multline*}
\end{document}​​​​​
share|improve this answer
add comment

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