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've been looking around and I know that there are possibilities to mimic the multline environment within the gather or align environments, or by using multlined but not in a way that I like, I think.

If I understood well, the multline environment has two features (for a two line equation):

  • automatically put the upper part on the far left and the lower part on the far right
  • automatically number the second line only

Is it true that none of the features listed above are offered by one of the aligning solutions mentioned at the beginning of my message when two or more separate equations are involved?

What I need could be coded as follows:

\begin{align}
&\begin{multline}
 equation 1 part 1 \\ equation 1 part 2
 \end{multline}\\
&\begin{multline}
 equation 2 part 1 \\ equation 2 part 2
 \end{multline}
\end{align}
share|improve this question
    
You can also try the breqn package for automatic line splitting. –  Aditya Sep 28 '11 at 7:45
add comment

2 Answers

To answer the question, yes the gather, align do not automatically behave as multline does.

multline will left align the first row, the second and all the following ones except the last are centered, and the last line is right aligned. The last lines gets numbered for right equation numbers, and the first one is numbered for the case of left equation numbers.

The gather environment will center all equations and by default number each one, and the align environment has an {rlrl...} alignment and also numbers each equation unless otherwise instructed.

A comprehensive review of mathematics in LaTeX is available in the Mathmode document.

share|improve this answer
    
thanks but from what I could read, there is no satisfactory solution for a multline behaviour on two consecutive long equations. The last chance was to use split within align but split requires & in its {rlrl..} framework, that I do not want to use. What I need is more like a \hfill on the second (or last) part of a long equation so that it goes as far as possible on the right. –  pluton Sep 28 '11 at 1:45
    
Not sure I understand. Please add a MWE to illustrate what you want. –  Peter Grill Sep 28 '11 at 1:49
    
see my edits. Thanks –  pluton Sep 28 '11 at 1:54
    
Is the multlined what you are looking for (from the mathtools package? –  Peter Grill Sep 28 '11 at 2:03
    
Probably. I could find what is in my answer. Thanks. It is not fully automatic because the width of the equations have to be provided but it is almost there. –  pluton Sep 28 '11 at 2:46
add comment
up vote 1 down vote accepted

Based on Peter Grill's comments, what is below is a possibility that could potentially be improved.

\documentclass[fleqn]{book}
\usepackage{mathtools}
\begin{document}
text text text text text text text text text text text text text text text text text   text text text text text text text text text text text text text text text text text text text text text text text
\begin{align}
&\begin{multlined}[b][.87\textwidth]
\cos\pi\cos\pi\cos\pi\cos\pi\cos\pi\cos\pi\cos\pi\cos\pi\\=\cos\pi\cos\pi\cos\pi\cos\pi\cos\pi\cos\pi\cos\pi
\end{multlined}\\
&\begin{multlined}[b][.87\textwidth]
\cos\pi\cos\pi\cos\pi\cos\pi\cos\pi\cos\pi\cos\pi\cos\pi\cos\pi\cos\pi\cos\pi\cos\pi\\=\cos\pi\cos\pi\cos\pi\cos\pi\cos\pi\cos\pi\cos\pi\cos\pi\cos\pi\cos\pi\cos \pi
\end{multlined}
\end{align}
text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text
\end{document}

It seems that the coefficient 0.87 has to be adapted to the font used in the document

share|improve this answer
add comment

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.