Aligned formulas

3.4.2 Aligned formulas

L A TEX has many ways to typeset multiline formulas. We discuss three constructs in this section: simple alignment, annotated alignment, and cases. See Chapter 9 for many others.

For simple and annotated alignment we use the align environment. Each line in the align environment is a separate equation, which L A TEX automatically numbers.

Simple alignment Simple alignment is used to align two or more formulas. To obtain the formulas (2)

type the following, using \\ as the line separator and & as the alignment point: \begin{align}

r^{2} &= s^{2} + t^{2}, \label{E:Pyth}\\ 2u + 1 &= v + w^{\alpha},

\label{E:alpha}\\ x &= \frac{y + z}{\sqrt{s + 2u}};\label{E:frac} \end{align}

Note that you should not have a \\ to terminate the last line. Figure 3.1 displays the source and the typeset versions of formulas (2)–(4), em- phasizing the alignment points of the source and the typeset formula. Of course, in the source, the alignment points do not have to line up.

These formulas are numbered (2), (3), and (4) because they are preceded by one numbered equation earlier in this section. The align environment can also be used to break a long formula into two or more parts. Since numbering both lines in such a case would be undesirable, you can prevent the numbering of the second line by using the \notag command in the second part of the formula.

For example,

1 + f (x)g(x) (5)

f (x) + g(x)

h(x) =

− 2) is typed as follows: \begin{align}

1 + g(x)

h(x) &= \int \left( \frac{f(x) + g(x)}{1+ f^{2}(x)}

3.4 Displayed formulas

r^{2} &= s^{2} + t^{2}, \label{E:Pyth}\\ 2u + 1 &= v + w^{\alpha},

\label{E:alpha}\\ x &= \frac{y + z}{\sqrt{s + 2u}}; \label{E:frac}

alignment points of formulas

Figure 3.1: Simple alignment: source and typeset.

+ \frac{1+ f(x)g(x)}{\sqrt{1 - \sin x}} \right) \, dx\label{E:longInt}\\

&= \int \frac{1 + f(x)}{1 + g(x) } \, dx

- 2 \tan^{-1}(x-2)\notag \end{align}

The rules for simple alignment are easy to remember.

Rule

Simple alignments

Use the align environment. Separate the lines with \\. In each line, indicate the alignment point with &, one & per line. If the alignment

point is adjacent to an =, +, and so on, place it before to ensure proper spacing. Place a \notag command in each line that you do not wish numbered. If no line should be numbered, use the align* environment. Place a \label command in each numbered line you may want to reference with

\ref, \eqref, or \pageref.

32 Chapter 3 Typing math

annotation x &= x \wedge (y \vee z)

aligned formulas

& &\text{(by distributivity)}\\ &= (x \wedge y) \vee (x \wedge z)

& &\text{(by condition (M))}\\ &= y \vee z.

alignment points alignment points of formulas

of annotations

annotation x=x ∧ (y ∨ z)

aligned formulas

(by distributivity) = (x ∧ y) ∨ (x ∧ z)

(by condition (M)) =y ∨ z.

alignment points alignment points of formulas

of annotations

Figure 3.2: Annotated alignment: source and typeset.

Annotated alignment Annotated alignment allows you to align formulas and their annotations, that is, ex-

planatory text, separately (see Figure 3.2): (6)

x=x ∧ (y ∨ z)

(by distributivity)

= (x ∧ y) ∨ (x ∧ z)

(by condition (M))

=y ∨ z.

This example is typed as \begin{align}

x &= x \wedge (y \vee z)

&&\text{(by distributivity)}\label{E:DoAlign}\\ &= (x \wedge y) \vee (x \wedge z) &&\text{(by condition (M))} \notag\\ &= y \vee z. \notag \end{align}

The rules for annotated alignment are similar to the rules of simple alignment. In each line, in addition to the alignment point marked by &, there is also a mark for the start of the annotation: &&.

3.4 Displayed formulas

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