• Tidak ada hasil yang ditemukan

To typeset a math expression as ‘displayed math’ (centered between paragraphs), enclose it in the commands \[ and \].12



\[\bar nˆ*_j(s)=\frac{\left\{s\sum_{i=1}ˆk n_i(0)pˆ*{i,k+1}(s)+Mˆ*(s)\right\}\sum_{i=1}ˆk p_{0i}pˆ*{ij}(s)}{1-s\sum_{i=1}ˆkp_{0i}pˆ*_{i, k+1}(s)}+\sum_{i=1}ˆkn_i(0)pˆ*_{ij}(s)[j=

1,2,\dots,k].\]

¯nj(s) = {ski=1ni(0)pi,k+1(s)+M(s)}ki=1p0ipi j(s) 1−ski=1p0ipi,k+1(s) +

ki=1ni(0)pi j(s)[j=1,2,. . . ,k]

Displayed equations can be auto-numbered with the equation environment instead of the \[ and \] commands.

11Bear in mind that the degree symbol is a non-ASCII character, so you must specify what input encoding you are using if you want to type it: see the example of the inputenc package in § 2.7. If you don’t want to use non-ASCII characters (or if you are using a system which cannot generate them), you can use the command \textdegree to get the degree sign.

12You will also see dollar signs used for math mode. This is quite common but deprecated: it’s what plain TEX used in the days before LATEX, and the habit got ingrained in many mathematicians. It still works as a convenient shorthand like $x=y$, as do double-dollars for display-mode math like $$E=mcˆ2$$, but they are only mentioned here to warn readers seeing them in other authors’ work that \(…\) and \[…\] are the proper LATEX commands.

3

Basic document structures

LATEX’s approach to formatting is to aim for consistency. This means that as long as you identify each element of your document correctly, it will be typeset in the same way as all the other elements like it, so that you achieve a consistent finish with minimum effort. Consistency helps make documents easier to read and understand.

Elements are the component parts of a document, all the pieces which make up the whole. Almost everyone who reads books, newspapers, magazines, reports, articles, and other classes of documents will be familiar with the popular structure of chapters, sections, subsections, subsubsections, paragraphs, lists, tables, figures, and so on, even if they don’t consciously think about it.

Consistency is also what publishers look for. They have a house style, and often a reputation to keep, so they rightly insist that if you do something a certain way once, you should do it the same way each time.

To help achieve this consistency, every LATEX document starts by declaring what document class it belongs to.

Formatting information 

 43

3.1 The Document Class Declaration

To tell LATEX what class of document you are going to create, you type a special first line into your file which identifies it.1 To start a report, for example, you would type the \documentclass command like this as your first line:



\documentclass{report}

There are four built-in classes provided, and many others that you can download (some may already be installed for you):

report for business, technical, legal, academic, or scientific re-ports;

article for white papers, magazine or journal articles, reviews, conference papers, or research notes;

book for books and theses;

letter for letters.2

The article class in particular can be used (some would say

‘abused’) for almost any short piece of typesetting by simply omitting the titling and layout (see below).

The built-in classes are intended as starting-points, especially for drafts and for compatibility when exchanging documents with other LATEX users, as they come with every copy of LATEX and are therefore guaranteed to format identically everywhere.

They arenot intended as final-format publication-quality layouts. For most other purposes, especially for publication, you use add-in packages (§ 5.1) to extend these classes to do what you need:

1Readers familiar with SGML, HTML, or XML will recognize the concept as similar to the Document Type Declaration.

2The built-in letter class is rather idiosyncratic: there are much better ones you can download, such as the memoir and komascript packages.

3.1. THE DOCUMENT CLASS DECLARATION

( The memoir and komascript packages contain more sophisti-cated replacements for all the built-in classes;

( Many academic and scientific publishers provide their own special class files for articles and books (often on their Web sites for download);

( Conference organisers may also provide class files for au-thors to write papers for presentation;

( Many universities provide their own thesis document class files in order to ensure exact fulfillment of their formatting requirements;

( Businesses and other organizations can provide their users with corporate classes on a central server and configure LATEX installations to look there first for packages, fonts, etc.

Books and journals are not usually printed on office-size paper.

Although LATEX’s layouts are designed to fit on standard A4 or Letter stationery for draft purposes, it makes them look odd:

the margins are too wide, or the positioning is unusual, or the font size is too small, because the finished job will normally be trimmed to a different size entirely — try trimming the margins of the PDF version of this book to 185mm by 235mm (the same as The LATEX Companion3 series) and you’ll be amazed at how it changes the appearance!

3.1.1 Document class options

The default layouts are designed to fit as drafts on US Letter size paper.4 To create documents with the correct proportions

3Mittelbach et al. (2004)

4Letter size is 8½00×1100, which is the trimmed size of the old Demi Quarto, still in use in North America. The other common US office size is ‘Legal’, which is 8½00×1400, a bastard cutting close to the old Foolscap (8¼00×13¼00).

ISO standard ‘A’, ‘B’, and ‘C’ paper sizes are still virtually unknown in many parts of North America.

Formatting information 

 45

for standard A4 paper, you need to specify the paper size in an optional argument in square brackets before the document class name, e.g.



\documentclass[a4paper]{report}

The two most common options are a4paper and letterpaper.

However, many European distributions of TEX now come preset for A4, not Letter, and this is also true of all distributions of pdfLATEX.

The other default settings are for: a) 10pt type (all document classes); b) two-sided printing (books and reports) or one-sided (articles and letters); and c) separate title page (books and reports only). These can be modified with the following document class options which you can add in the same set of square brackets, separated by commas:

11pt to specify 11pt type (headings, footnotes, etc. get scaled up or down in proportion);

12pt to specify 12pt type (again, headings scale);

oneside to format one-sided printing for books and reports;

twoside to format articles for two-sided printing;

titlepage to force articles to have a separate title page;

draft makes LATEX indicate hyphenation and justification prob-lems with a small square in the right-hand margin of the problem line so they can be located quickly by a human.

If you were using pdfLATEX for a report to be in 12pt type on Letter paper, but printed one-sided in draft mode, you would use:



\documentclass[12pt,letterpaper,oneside,draft]{report}