Splitting long formulas

9.3 Splitting long formulas

The multline environment is used to split one very long formula into several lines. The first line is set flush left, the last line is set flush right, and the middle lines are centered:

(4) (x 1 x 2 x 3 x 4 x 5 x 6 ) 2

+ (y 1 y 2 y 3 y 4 y 5 +y 1 y 3 y 4 y 5 y 6 +y 1 y 2 y 4 y 5 y 6 +y 1 y 2 y 3 y 5 y 6 ) 2 + (z 1 z 2 z 3 z 4 z 5 +z 1 z 3 z 4 z 5 z 6 +z 1 z 2 z 4 z 5 z 6 +z 1 z 2 z 3 z 5 z 6 ) 2 + (u 1 u 2 u 3 u 4 +u 1 u 2 u 3 u 5 +u 1 u 2 u 4 u 5 +u 1 u 3 u 4 u 5 ) 2

This formula is typed as \begin{multline}\label{E:mm2}

(x_{1} x_{2} x_{3} x_{4} x_{5} x_{6})^{2}\\ + (y_{1} y_{2} y_{3} y_{4} y_{5} + y_{1} y_{3} y_{4} y_{5} y_{6} + y_{1} y_{2} y_{4} y_{5} y_{6} + y_{1} y_{2} y_{3} y_{5} y_{6})^{2}\\ + (z_{1} z_{2} z_{3} z_{4} z_{5} + z_{1} z_{3} z_{4} z_{5} z_{6} + z_{1} z_{2} z_{4} z_{5} z_{6} + z_{1} z_{2} z_{3} z_{5} z_{6})^{2}\\ + (u_{1} u_{2} u_{3} u_{4} + u_{1} u_{2} u_{3} u_{5}

+ u_{1} u_{2} u_{4} u_{5} + u_{1} u_{3} u_{4} u_{5})^{2} \end{multline}

9.3 Splitting long formulas 213

Rule

multline environment

1. Lines are separated with \\. Do not type a \\ at the end of the last line!

2. The formula is numbered as a whole unless it is \tag-ged or the numbering is suppressed with \notag. (Alternatively, use the multline* environment.)

3. No blank lines are permitted within the environment.

4. Each line is a subformula (see Section 9.4.2).

If you are very observant, you may have noticed that we failed to type {}+ follow- ing the line separators of the formula. In Section 8.1.2, you were told that this omission would result in the second line being typeset as

4 y 5 +y 1 y 3 y 4 y 5 y 6 +y 1 y 2 y 4 y 5 y 6 +y 1 y 2 y 3 y 5 y 6 ) The multline environment, however, knows that a long formula is being broken and

+(y 1 y 2 y 3 y

so typesets + as a binary operation.

A common mistake is to write multiline for multline, resulting in the mes- sage:

! LaTeX Error: Environment multiline undefined. In the multline* environment, the formula is not numbered but can be \tag-ged.

The indentation of the first and last lines is controlled by the \multlinegap length command, with a default of 10 points, unless there is a tag on one of those lines. You can adjust the indentation by enclosing the multline environment in a setlength environment (see Section 15.5.2 ), as follows:

\begin{multline*} (x_{1} x_{2} x_{3} x_{4} x_{5} x_{6})^{2}\\ + (x_{1} x_{2} x_{3} x_{4} x_{5} + x_{1} x_{3} x_{4} x_{5} x_{6} + x_{1} x_{2} x_{4} x_{5} x_{6} + x_{1} x_{2} x_{3} x_{5} x_{6})^{2}\\ + (x_{1} x_{2} x_{3} x_{4} + x_{1} x_{2} x_{3} x_{5} + x_{1} x_{2} x_{4} x_{5} + x_{1} x_{3} x_{4})^{2}

\end{multline*} \begin{setlength}{\multlinegap}{0pt}

\begin{multline*} (x_{1} x_{2} x_{3} x_{4} x_{5} x_{6})^{2}\\ + (x_{1} x_{2} x_{3} x_{4} x_{5} + x_{1} x_{3} x_{4} x_{5} x_{6} + x_{1} x_{2} x_{4} x_{5} x_{6}

214 Chapter 9 Multiline math displays

+ x_{1} x_{2} x_{3} x_{5} x_{6})^{2}\\ + (x_{1} x_{2} x_{3} x_{4} + x_{1} x_{2} x_{3} x_{5} + x_{1} x_{2} x_{4} x_{5} + x_{1} x_{3} x_{4})^{2}

\end{multline*} \end{setlength}

which typesets as

Notice that the second variant is not indented. Any line of a multline environment can be typeset flush left or right by making

it the argument of a \shoveleft or \shoveright command, respectively (same with multline*). For instance, to typeset the second line of formula (4) flush left, as in

(x 1 x 2 x 3 x 4 x 5 x 6 ) 2

+ (x 1 x 2 x 3 x 4 x 5 +x 1 x 3 x 4 x 5 x 6 +x 1 x 2 x 4 x 5 x 6 +x 1 x 2 x 3 x 5 x 6 ) 2 + (x 1 x 2 x 3 x 4 +x 1 x 2 x 3 x 5 +x 1 x 2 x 4 x 5 +x 1 x 3 x 4 x 5 ) 2

type the formula as follows: \begin{multline*}

(x_{1} x_{2} x_{3} x_{4} x_{5} x_{6})^{2}\\ \shoveleft{+ (x_{1} x_{2} x_{3} x_{4} x_{5}

+ x_{1} x_{3} x_{4} x_{5} x_{6} + x_{1} x_{2} x_{4} x_{5} x_{6} + x_{1} x_{2} x_{3} x_{5} x_{6})^{2}}\\ + (x_{1} x_{2} x_{3} x_{4} + x_{1} x_{2} x_{3} x_{5} + x_{1} x_{2} x_{4} x_{5}

+ x_{1} x_{3} x_{4} x_{5})^{2} \end{multline*}

Observe that the entire line is the argument of the \shoveleft command, which is followed by \\ unless it is the last line of the environment.

9.4 Some general rules 215

Dokumen yang terkait

c. Bridging Teknik memanjat pada celah vertikal yang lebih besar (gullies). Caranya dengan menggunakan kedua tangan dan kaki sebagai pegangan pada kedua celah tersebut. Posisi badan mengangkang kaki sebagai tumpuan dibantu juga tangan sebagai penjaga kese

0 1 10

2. Marah: adalah kunci setiap kejahatan. Nabi saw. telah berpesan pada seseorang untuk menjauhi sikap marah dengan sabda beliau: "Janganlah engkau marah". Beliau mengulanginya berkali-kali. (H.R Bukhari). - Kebersihan Hati

2 5 14

Object Oriented Programming dengan Delphi (

1 4 75

E volusi dan aplikasi sistem informasi berbasis komputer

1 8 18

b. Data Manipulation Language (DML) : Digunakan untuk memanipulasi data dengan menggunakan perintah : select, - SISTEM BASIS DATA 1.rar (7,386Kb)

1 3 15

Hubungan Pola Asuh Orang Tua dan Kesiapan Psikologis Anak dengan Kebersihan Toilet Traning pada Anak Usia Prasekolah di Paud Ab-Arisalah Kota Lubuklinggau

0 1 8

Hubungan Pengetahuan dsn Sikap dengan Tindakan Hygiene Penjual makanan Jajanan di Lingkungan Sekolah Dasar Kaamatan Baturaja Timur Kabupaten Ogan Komering UIU Tahun 2013 A. Gani

1 3 14

Faktor faktor yang berhubungan dengan manfaatan Posyandu lansia oleh kelompok usia lanjut didesa Kemalara dalam wilayah kerja Puskesmas Kemalaraja OKU Tahun 2013. Saprianto, M.Kes

3 3 21

Korelasi umur, pekerjaan, dan keberadaan kontainer dengan kejadian penyakit malaria di desa simpang Martapura wilayah Kabupaten Ogan Komering Ulu Selatan tahun 2014 – A. Gani

0 0 18

Pengaruh Ekstrak Daun Jambu Biji (Psidiu Guajava Linn) dan Ekstrak daun Teh Hijau (Camelia Sinensis) terhadap Pertumbuhan Escherichia Coli In Vitro dan Perbandingannya dengan Kotrimoksazol

2 16 20