A rule and combinations

6.2.4 A rule and combinations

There is only one rule you must remember.

Rule

List environments An \item command must immediately follow \begin{enumerate}, \begin{itemize}, or \begin{description}.

Of course, spaces and line breaks can separate them. If you break this rule, you get an error message. For instance,

\begin{description} This is wrong!

\item[Chopped lattice] a reduced lattice; gives the error message

! LaTeX Error: Something’s wrong--perhaps a missing \item. l.105

\item[Chopped lattice]

a reduced lattice;

6.2 List environments 121

If you see this error message, remember the rule for list environments and check for text preceding the first \item.

You can nest up to four list environments; for instance,

which is typed as \begin{enumerate}

\item First item of Level 1. \begin{enumerate}

\item First item of Level 2. \begin{enumerate}

\item First item of Level 3. \begin{enumerate}

\item First item of Level 4. \item Second item of Level 4.\label{level4}

\end{enumerate} \item Second item of Level 3.

\end{enumerate} \item Second item of Level 2.

\end{enumerate} \item Second item of Level 1.

\end{enumerate} Referencing the second item of Level 4: \ref{level4}

Note that the label level4 collected all four of the counters (see Section 10.4.2).

You can also mix list environments:

122 Chapter 6 Text environments

which is typed as \begin{enumerate}

\item First item of Level 1. \begin{itemize}

\item First item of Level 2. \begin{enumerate}

\item First item of Level 3. \begin{itemize}

\item First item of Level 4. \item Second item of Level 4.\label{enums}

\end{itemize} \item Second item of Level 3.

\end{enumerate} \item Second item of Level 2.

\end{itemize} \item Second item of Level 1.

\end{enumerate} Referencing the second item of Level 4: \ref{enums}

Now the label enums collects only the two enumerate counters (see Section 10.4.2). The indentations are, of course, not needed. I use them to keep track of the level of nesting. In all three types of list environment, the \item command may be followed by an optional argument, which is displayed at the beginning of the typeset item:

\item[label ] Note that for enumerate and itemize the resulting typography may leave something

to be desired.

6.3 Style and size environments 123

Tip If the text following an \item command starts with an opening square bracket, [, then L A TEX thinks that \item has an optional argument. To prevent this problem from occurring, type [ as {[}. Similarly, a closing square bracket, ], inside the optional argument should be typed as {]}.

Tip You may want to use a list environment solely for the way the items are displayed, without any labels. You can achieve this effect by using \item[].

You can change the style of the numbers in an enumerate environment by re- defining the counter as suggested in Section 15.5.1:

\renewcommand{\labelenumi}{{\normalfont (\roman{enumi})}} The labels then are displayed as (i), (ii), and so on. This modification only works if you

do not want to reference these items. If you want the \ref command to work properly, use David Carlisle’s enumerate package (see Section 12.3.1). For an example of how to use Carlisle’s environment, see Section 15.2.1.

Section 3.3 of The L A TEX Companion, 2nd edition [46] explains how to customize the three list environments and discusses Bernd Schandl’s paralist package, which provides a number of new list environments and makes customizing the three legacy list environments much easier. For custom lists, see Section 15.6.

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