The list environment

15.6.2 The list environment

Custom lists are created with the list environment, which is invoked as follows: \begin{list}{default_label }{declarations }

\item item1 \item item2 ...

\end{list} The arguments are

default label, the label for any items that do not specify their own, similar to the optional argument of the \item command

declarations, the vertical and horizontal length commands and any other required parameters for the list

Here is a very simple example:

Here are the most important L A TEX rules about spaces in text, sentences, and paragraphs:

♦ Rule 1: Two or more spaces in text are the same as one. ♦ Rule 2: A blank line (that is, two end-of-line characters sepa-

rated only by blanks and tabs) indicates the end of a paragraph. Rules 1 and 2 make typing and copying very convenient.

I have used the ♦ math symbol ($\diamondsuit$) as a default label, and I set the item box 0.5 inch from either margin. So this example is typed as follows:

\noindent Here are the most important \LaTeX\ rules about spaces in text, sentences, and paragraphs: \begin{list}{$\diamondsuit$}{\setlength{\leftmargin}%

{.5in}\setlength{\rightmargin}{.5in}}

\item \textbf{Rule 1:} Two or more spaces in text are the same as one. \item \textbf{Rule 2:} A blank line (that is, two end-of-line characters separated only by blanks and tabs) indicates the end of a paragraph. \end{list} Rules 1 and~2 make typing and copying very convenient.

Here is a second variant:

410 Chapter 15 Customizing L A TEX

Here are the most important L A TEX rules about spaces in text, sentences, and paragraphs:

Rule 1: Two or more consecutive spaces in text are the same as one. Rule 2:

A blank line (that is, two end-of-line characters separated only by blanks and tabs) indicates the end of a paragraph.

Rules 1 and 2 make typing and copying very convenient. In this example, I dropped the optional default label and typed Rule 1: and Rule 2:

as (optional) arguments of the \item commands: \noindent Here are the most important \LaTeX\ rules about

spaces in text, sentences, and paragraphs: \begin{list}{}{\setlength{\leftmargin}{.5in}%

\setlength{\rightmargin}{.5in}} \item[\textbf{Rule 1:}] Two or more consecutive spaces in text are the same as one. \item[\textbf{Rule 2:}] A blank line (that is, two end-of-line characters separated only by blanks and tabs) indicates the end of a paragraph. \end{list} Rules 1 and~2 make typing and copying very convenient.

For further simple examples, you can look at various document class files to see how standard environments such as verse, quote, and so on, are defined.

Using counters It is not very L A TEX-like to provide the numbers for the rules in the examples above.

It would be more logical for L A TEX to do the numbering. The following is a more L A TEX-like coding of the second example:

\noindent Here are the most important \LaTeX\ rules about spaces in text, sentences, and paragraphs: \newcounter{spacerule} \begin{list}{\textbf{Rule \arabic{spacerule}:}}

{\setlength{\leftmargin}{.5in} \setlength{\rightmargin}{.5in} \usecounter{spacerule}}

\item Two or more consecutive spaces in text are the same as one.\label{Li:Twoor} \item A blank line (that is, two end-of-line

15.6 Custom lists 411

characters separated only by blanks and tabs) indicates the end of a paragraph.\label{Li:blankline}

\end{list} Rules \ref{Li:Twoor} and~\ref{Li:blankline} make typing and copying very convenient.

Note that

1. I declared the counter before the list environment with the line \newcounter{spacerule}

2. I defined the default label as \textbf{Rule \arabic{spacerule}:} item In the declarations, I specified

that the list should use the spacerule counter with the command \usecounter{spacerule}

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