The preamble

10.2 The preamble

You were introduced to the preamble of a document in Section 4.1. Recall that the preamble contains the crucial \documentclass line, specifying the document class and the options that modify its behavior. For instance,

\documentclass[draft,reqno]{amsart} loads the document class amsart with the draft option, which paints a slug in the

margin indicating lines that are too wide (see Section 5.7.1), and the reqno option, which places the equation numbers on the right (see Section 11.5).

article is the most popular legacy document class (see Section 12.1). The com- mand

\documentclass[titlepage,twoside]{article} loads the document class article with the titlepage option, which creates a sep-

arate title page and places the abstract on a separate page, and the twoside option, which formats the typeset article for printing on both sides of the paper.

The \documentclass command is usually followed by the \usepackage com- mands, which load L A TEX enhancements called packages. For instance,

\usepackage{latexsym} loads a package that defines some additional L A TEX symbol names (see Section 12.3),

whereas

250 Chapter 10 L A TEX documents \usepackage[demo]{graphicx}

loads the graphicx package (see Section 10.4.3) with the demo option that inserts rectangles in place of the illustrations. Document class options are also passed on to

the packages as possible options, so \documentclass[demo]{amsart}

\usepackage{graphicx} would also load the graphicx package with the demo option unless it is invoked with \usepackage[final]{graphicx} Any document class options that are not relevant for a package are ignored.

\usepackage commands can also be combined: \usepackage{amssymb,latexsym} is the same as \usepackage{amssymb}

\usepackage{latexsym} Document class files have a cls extension, whereas package files are designated

by the sty extension. The document class amsart is defined in the amsart.cls file, the graphicx package is defined in the graphicx.sty file. You may define your own packages, such as the newlattice package described in Section 15.3.

The preamble normally contains any user-defined commands (see Chapter 15) and the proclamation definitions (see Section 6.4). Some commands can only be in the preamble. \DeclareMathOperator is such a command (see Section 7.6.2) and so is \numberwithin (see Section 7.3). If you put such a command in the body, for example, \DeclareMathOperator, you get an error message:

! LaTeX Error: Can be used only in preamble. l.103 \DeclareMathOperator

There is one command that may only be placed before the \documentclass{...} line: \NeedsTeXFormat{LaTeX2e}[2005/12/01]

This command checks the version of L A TEX being used to typeset the document and issues a warning if it is older than December 1, 2005 or whatever date you specified. Use this optional date argument if your document contains a feature that was introduced on or after the date specified or if an earlier version had a bug that would materially affect the typesetting of your document.

10.3 Top matter 251

For instance, if you use the \textsubscript command, introduced in the De- cember 1, 2005 release (see page 311), then you may use the \NeedsTeXFormat line shown above. L A TEX now hardly changes from year to year, so this command is rarely used except in document class files or package files. See, however, the discussion on page 311.

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