You are on page 1of 116

The Not So Short

Introduction to LATEX 2

LATEX 2
102 LATEX 2

by Tobias Oetiker
Hubert Partl, Irene Hyna and Elisabeth Schlegl
Version 3.20, 09 August, 2001

, , ,
, ,

3.20-kr, 2002 3 31

ii
c
Copyright 2000
Tobias Oetiker and all the Contributers to LShort. All rights
reserved.
This document is free; you can redistribute it and/or modify it under the terms
of the GNU General Public License as published by the Free Software Foundation;
either version 2 of the License, or (at your option) any later version.
This document is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
License for more details.
You should have received a copy of the GNU General Public License along with
this document; if not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA.
(free). (FSF) GNU
GPL( ) 2
.
.
.
. GNU GPL .
GNU GPL . Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
.

GNU GPL .


LATEX 2.09
. .
Hubert Partl <partl@mail.boku.ac.at>
Zentraler Informatikdienst der Universit
at f
ur Bodenkultur Wien

Irene Hyna <Irene.Hyna@bmwf.ac.at>


Bundesministerium f
ur Wissenschaft und Forschung Wien

Elisabeth Schlegl <no email>


in Graz

, Jorg Knappen LATEX 2


.
CTAN:/tex-archive/info/lshort/german

, comp.text.tex
. , ,
.
.
. ,
.
.

iv


Rosemary Bailey, Friedemann Brauer, Jan Busa, Markus Br
uhwiler,
David Carlisle, Jose Carlos Santos, Mike Chapman,
Christopher Chin, Carl Cerecke, Chris McCormack, Wim van Dam,
Jan Dittberner, Michael John Downes, David Dureisseix, Elliot,
David Frey, Robin Fairbairns, Jorg Fischer, Erik Frisk, Frank,
Kasper B. Graversen, Alexandre Guimond, Cyril Goutte,
Greg Gamble, Neil Hammond, Rasmus Borup Hansen,
Joseph Hilferty, Bjorn Hvittfeldt, Martien Hulsen, Werner Icking,
Jakob, Eric Jacoboni, Alan Jeffrey, Byron Jones, David Jones,
Johannes-Maria Kaltenbach, Michael Koundouros, Andrzej Kawalec,
Alain Kessi, Christian Kern, Jorg Knappen, Kjetil Kjernsmo,
Maik Lehradt, Alexander Mai, Martin Maechler,
Aleksandar S Milosevic, Claus Malten, Kevin Van Maren,
Lenimar Nunes de Andrade, Hubert Partl, John Refling,
Mike Ressler, Brian Ripley, Young U. Ryu, Bernd Rosenlecher,
Chris Rowley, Hanspeter Schmid, Craig Schlenter,
Christopher Sawtell, Geoffrey Swindale, Josef Tkadlec, Didier Verna,
Fabian Wernli, Carl-Gustav Werner, David Woodhouse, Chris York,
Fritz Zaucker, Rick Zaccone, and Mikhail Zotov.


LATEX [1]
.
. LATEX
TEX [2] .
LATEX 2 . LATEX
. LATEX
[1, 3] .
LATEX PC, Mac, UNIX, VMS
. LATEX
.
LATEX Local
Guide [4] . LATEX
. LATEX
, LATEX
.
.
1 LATEX 2 . LATEX
. LATEX
,
LATEX
.

2 . LATEX
.
.
3 LATEX . ,
LATEX
. LATEX
.

vi

4 , EPS ,
.
5 LATEX ,
. , LATEX
.
.
. .
.
LATEX Comprehensive TEX Archive Network(CTAN) . http://www.
ctan.org. LATEX ftp://www.ctan.org ftp
.
, ftp://ctan.tug.org (), ftp://ftp.dante.de (), ftp://ftp.
tex.ac.uk () .
.
CTAN .

CTAN , url CTAN:
CTAN .
LATEX
CTAN:/tex-archive/systems .

, ,
() . LATEX ,
,
.
Tobias Oetiker <oetiker@ee.ethz.ch>
Department of Electrical Engineering,
Swiss Federal Institute of Technology

CTAN:/tex-archive/info/lshort .

iii

1
1.1 ? . . . . .
1.1.1 TEX . . . . . . . . . . .
1.1.2 LATEX . . . . . . . . . .
1.2 . . . . . . . . . . . .
1.2.1 , ,
1.2.2 . . . .
1.2.3 . . . . . . .
1.3 LATEX . . . . . . . .
1.3.1 . . . . . . . . . . .
1.3.2 . . . . . . . .
1.3.3 LATEX . . . . . . .
1.3.4 . . . . . . . . . . .
1.4 . . . . . . . .
1.5 .
1.6 . . . . . . . .
1.6.1 . . . . . . .
1.6.2 . . . . . . . . . .
1.6.3 . . . . . . . . .
1.7
1.8 . . . . . . . .

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

1
1
1
1
3
3
3
4
5
5
6
6
7
8
8
10
10
10
11
14
15

2
2.1
2.2 . .
2.2.1 . . .
2.2.2 . . . . .

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

17
17
20
20
21

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

viii
2.3
2.4

2.5

2.6
2.7
2.8
2.9
2.10
2.11

2.12
2.13

. . . . . . . . . . . . . .
. . . . . . . . . . . . .
2.4.1 . . . . . . . . . . . . . . . . . .
2.4.2 . . . . . . . . . . . . .
2.4.3 () . . . . . . . . . . . . . . . .
2.4.4 () () . . . . . . . . . . . . .
2.4.5 ( . . . ) . . . . . . . . . . . . .
2.4.6 (ligature) . . . . . . . . . . . . . .
2.4.7 . . . . . . . . .
. . . . . . . . . . . . . . . . .
2.5.1 . . . . . . . . . . . . . . .
2.5.2 . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . .
, . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . .
2.11.1 Itemize, Enumerate, Description
2.11.2 Flushleft, Flushright, Center . .
2.11.3 Quote, Quotation, Verse . . . . .
2.11.4 (Verbatim ) . . . .
2.11.5 Tabular . . . . . . . . . . . . . .
. . . . . . . . . . . . . .
. . . . . . . .

3
3.1 . . . . . . . . . . . .
3.2 . .
3.3
3.4 . . . . .
3.5 . . . . .
3.6 (Phantom) . .
3.7 . . . . .
3.8 (theorem), , . . . .
3.9 . . . . . .
3.10 . . . . . .

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

22
22
22
23
23
23
24
24
24
25
27
27
29
29
31
32
33
34
34
34
35
36
37
39
42

.
.
.
.
.
.
.
.
.
.

43
43
45
45
49
50
52
53
54
55
56

ix
4
4.1 EPS . . . . . . . .
4.2 . . . . . . . . . . . . .
4.3 . . . . . . . . . . . . .
4.4 (Fancy Headers) .
4.5 Verbatim . . . . . . . . .
4.6 LATEX

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

63
63
65
66
68
69
69

5 LATEX
5.1 , , . . .
5.1.1 . . . . . . .
5.1.2 . . . . . . .
5.1.3 . . . . .
5.2 . . . . . . . . . . .
5.2.1 . . . .
5.2.2 , . . . . . . . .
5.2.3 . . . . . . . . . . .
5.3 . . . . . . . . . . . . . . .
5.3.1 . . . . . . . . .
5.3.2 . . . . . . .
5.3.3 . . . . . . . .
5.3.4 . . . . . . . .
5.4 . . . . . . . .
5.5 , . . . . .
5.6 . . . . . . . . . . . . . . .
5.7 . . . . . . . . . . . .

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

71
71
72
73
73
74
74
77
78
78
78
78
79
80
80
83
83
86

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

87

99


1.1
1.2
1.3

TEX System . . . . . . . . . . . . . . . . . . . . . . .
LATEX . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .

2
8
9

4.1

fancyhdr . . . . . . . . . . . . . . . . . . . . . . . .

68

5.1
5.2

. . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . .

74
81


1.1
1.2
1.3
1.4

. . . . . . . . . . . . . .
. . . . . . . . . . .
LATEX
LATEX . . . . .

.
.
.
.

11
12
13
14

2.1
2.2
2.3

. . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . .

25
27
39

3.1
3.2
3.3
3.4
3.5
3.6
3.7
3.8
3.9
3.10
3.11
3.12
3.13
3.14
3.15
3.16
3.17
3.18
3.19

. .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . .
. . . . .
. . .
. . . . . . . . . . . .
. . . . . . . .
AMS .
AMS . .
AMS . . . . . .
AMS . . . . . . . . . . . . .
AMS
AMS . . . . . . . . .
AMS . . . . . . . . .
. . . . . . . . . . . .

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

56
56
56
57
57
58
58
58
58
59
59
59
59
60
61
61
62
62
62

4.1
4.2

graphicx key . . . . . . . . . . . . . . . . . . .
Index Key . . . . . . . . . . . . . . . . . . . . . . .

65
67

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

xiv
5.1
5.2
5.3
5.4
5.5

. . . . . . . . . . . . . . .
. . . . . . . . . . . .

. . . . . . . . . . .
TEX . . . . . . . .

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

75
75
76
76
80


LATEX 2 ,
LATEX . LATEX
.
,
.

1.1
1.1.1

?
TEX

TEX Donald E. Knuth [2] ,


. Knuth
1977,
,

. TEX 1982
. 1989 8
. TEX ,
, (virtually bug-free)
. TEX () ,
3.14159 .
TEX ( Ach Loch ch)
.1 (ASCII) TEX TeX .

1.1.2

LATEX

LATEX TEX .
1

. .[]

copy

...

editor

ispell
emacs

.mf

METAfont

.tex

...

- .tfm
- TEX

AMS-Package
LATEX 2
Plain

- .log

.pk

.dvi

- driver
PostScript

Fonts

. .
xdvi
dvips

- printer
screen

Typesetting

1.1: TEX System


()
. LATEX Leslie Lamport [1] . TEX (typesetting engine) .
1994 LATEX Frank Mittelbach LATEX3
.
LATEX 2.09
. LATEX 2
. LATEX 2 .
LATEX (Lay-Tech) (Lah-Tech) .
LaTeX . LATEX 2 (Lay-Tech Two
e) LaTeX2e .
1.1 TEX LATEX 2 .
Kees van der Laan wots.tex .

1.2

1.2
1.2.1

, ,

,
. (:
, , . . . ) .
.
.

, , ,
, .
LATEX , LATEX . TEX
. LATEX ,
( )
.
, LATEX
.
WYSIWYG2 , MS Word
3
. WYSIWYG ,
. ,
.
LATEX
. LATEX ()
.
,
.

1.2.2

.
,
. ?
? ,
.
. .
/
2
3

What you see is what you get. .


Corel Word-Perfect[]

4
.

,
.
WYSIWYG
.
LATEX
.
LATEX .

1.2.3

WYSIWYG LATEX
LATEX ,

. .
,
. . .
. LATEX
:
.
.
.

.
.4
, , ,
.
LATEX
. PostScript

. The LATEX
Companion [3] .
LATEX . LATEX
.
4

, .[]

1.3 LATEX

LATEX 2 TEX , .
TEX .
LATEX .
,
. ;-)
LATEX . . .

,
.5
.
, (Logical Markup)
.

1.3

LATEX

LATEX (plain ASCII text).6


() .
, LATEX
.

1.3.1

(whitespace characters), (blank), (tab) LATEX


.
.
(: linebreak) .
(paragraph) .
. .
.
It does not matter whether you
enter one or several
spaces
after a word.
An empty line starts a new
paragraph.
5

It does not matter whether you enter one or


several spaces after a word.
An empty line starts a new paragraph.

LATEX3 .
ASCII . plain text
. []
6

1.3.2

LATEX
.
LATEX
.
#

&

, (\)
.
\# \$ \% \^{} \& \_ \{ \} \~{}

#$%&

{}

, ,
. \
(\\) . ()
.7

1.3.3

LATEX

LATEX
:
\ .
.
.
LATEX .
{}
. {} LATEX (
) .
I read that Knuth divides the
people working with \TeX{} into
\TeX{}nicians and \TeX perts.\\
Today is \today.

I read that Knuth divides the people working


with TEX into TEXnicians and TEXperts.
Today is 2002 3 31.

(parameter) .
{ } . (optional parameters)
7

\ $\backslash$ .

1.4 LATEX

, (square bracket) [ ]
. LATEX
. . .
You can \textsl{lean} on me!

You can lean on me!

Please, start a new line


right here!\newline
Thank you!

Please, start a new line right here!


Thank you!

1.3.4

LATEX % ()
.
.

.
This is an % stupid
% Better: instructive <---example: Supercal%
ifragilist%
icexpialidocious

This is an example: Supercalifragilisticexpialidocious

%
.
verbatim comment
. , (preamble) \usepackage{verbatim}
comment .
This is another
\begin{comment}
rather stupid,
but helpful
\end{comment}
example for embedding
comments in your document.

This is another example for embedding comments in your document.

8
\documentclass{article}
\begin{document}
Small is beautiful.
\end{document}

1.2: LATEX

1.4

LATEX
. .
\documentclass{...}
.
()
LATEX .
.
\usepackage{...}
,8 .
.
\begin{document}
LATEX .

\end{document}
. LATEX
. .
1.2 LATEX .
1.3 .

1.5

8 LATEX
? . LATEX GUI
8

\documentclass \begin{document} (preamble)


.

1.5
\documentclass[a4paper,11pt]{article}
% define the title
\author{H.~Partl}
\title{Minimalism}
\begin{document}
% generates the title
\maketitle
% insert the table of contents
\tableofcontents
\section{Start}
Well, and here begins my lovely article.
\section{End}
\ldots{} and here it ends.
\end{document}

1.3:
.
. LATEX
GUI (front end)
. ,
. LATEX
. LATEX
.
1. LATEX . plain
. Unix
.
ASCII plain text .
.tex .
2. LATEX .
.dvi .
latex foo.tex
3. DVI .
xdvi foo.dvi
PS .

10
dvips -Pcmz foo.dvi -o foo.ps

xdvi dvips .dvi .


xdvi X11 .dvi , dvips
PostScript . Unix
.dvi .9

1.6
1.6.1

LATEX
(type). \documentclass
.
\documentclass[options]{class}

class . 1.1
. LATEX 2
. option
.
.
1.2 .
: LATEX ,
\documentclass[11pt,twoside,a4paper]{article}
LATEX article 11
, A4
.

1.6.2

, LATEX
. , ,
, LATEX
9

dvips . xdvi TEX windvi


yap .[]

1.6

11

. .
.
\usepackage[options]{package}

package, , options
. LATEX 2
. ( 1.3 .)
.
Local Guide [4] . LATEX
The LATEX Companion [3] .
LATEX 2
.

1.6.3

LATEX / ( (page style)


.) .
\pagestyle{style}

style . 1.4
.

1.1:
article , , , ,

report , ,

book .
slides .
. FoilTEXa .
a

CTAN:/tex-archive/macros/latex/contrib/supported/foiltex

12

1.2:
10pt, 11pt, 12pt .
10pt .
a4paper, letterpaper, . . .
.
letterpaper. , a5paper, b5paper, executivepaper, legalpaper ..
fleqn

leqno

titlepage, notitlepage
. article
. report book
.
twocolumn

LATEX 2 .

twoside, oneside
. article report , book
. .
, twoside
.
openright, openany
/
. (chapter) article
. report
book
.

1.6

1.3: LATEX
doc LATEX .
doc.dtxa The LATEX Companion [3] .
exscale
.
ltexscale.dtx .
fontenc LATEX .
ltoutenc.dtx .
ifthen .
if. . . then do. . . otherwise do. . . .
ifthen.dtx The LATEX Companion [3] .
latexsym LATEX ()
latexsym . latexsym.dtx The
LATEX Companion [3] .
makeidx (index) . 4.3
The LATEX Companion [3] .
syntonly () .
inputenc .
, ASCII, ISO Latin-1, ISO Latin-2, 437/850 IBM
, , , ANSI-,
. inputenc.dtx .
a

. *.dtx dvi
latex doc.dtx
. .

13

14

.
\thispagestyle{style}

The LATEX Companion [3] , 68 4.4 .

1.7

LATEX ,
. . TEX
.
.
.
.tex LATEX TEX . latex .
.sty LATEX . \usepackage LATEX
.
.dtx TEX(Documented TEX) . LATEX
. .dtx , .dtx LATEX
.
.ins .dtx
. LATEX ,
.dtx .ins . .ins
LATEX .dtx
.
.cls . \documentclass
.
1.4: LATEX
plain . .
headings
. ( .)
empty / .

1.8
LATEX .
.dvi (device independent) . LATEX
. DVI
dvips
.
.log
.
.toc / .
.
.lof .toc .
.lot , .
.aux
. , .aux
.
.idx , LATEX
. makeindex
. 66 4.3 .
.ind .idx makeindex ,
.
.ilg makeindex .

1.8


. LATEX .
\include{filename}

filename.tex
. LATEX filename
.

15

16

(preamble) .
\include
LATEX .
\includeonly{filename,filename,. . . }

\include
.
.
\include
. \includeonly
. include
.

\input{filename}

.

.
syntonly .
, (DVI)
. LATEX
. :
\usepackage{syntonly}
\syntaxonly
, (
% ) .


LATEX 2
.
.

2.1

( 1 )
() , .
()
. ()
.
LATEX ,
. LATEX

() .
LATEX, (typography)
(paragraph). ,

. . ,
\\ ,
. ,
.
. ,
.
.
1

DAAC(Different At All Cost). UVA(Ums Verrecken Anders)


.

18


.

.
. LATEX ,
.
. ,
( ) . (

,
.)
% Example 1
\ldots when Einstein introduced his formula
\begin{equation}
e = m \cdot c^2 \; ,
\end{equation}
which is at the same time the most widely known
and the least well understood physical formula.

% Example 2
\ldots from which follows Kirchoffs current law:
\begin{equation}
\sum_{k=1}^{n} I_k = 0 \; .
\end{equation}
Kirchhoffs voltage law can be derived \ldots

% Example 3
\ldots which has several advantages.
\begin{equation}
I_D = I_F - I_R
\end{equation}
is the core of a very different transistor model. \ldots
( )
.
.

2.2

1
\ldots ,
\begin{equation}
e = m \cdot c^2 \;
\end{equation}

.
2
\ldots .
\begin{equation}
\sum_{k=1}^{n} I_k = 0 \; .
\end{equation}
\ldots

(sentence).

. LATEX
. LATEX ,
LATEX .
.
, .
. ,
,
.
,
, .
, .
(stop) ,
.
,
. , (chapter), (section), (subsection)
.
. ,
\section{The Structure of Text and Language}
.

19

20

2.2
2.2.1

. LATEX

.
. .
, ,
. 5.3.2
.
LATEX
.

.
\\ or \newline

.
\\*

.
\newpage

.
\linebreak[n], \nolinebreak[n], \pagebreak[n], \nopagebreak[n]

( , ,
, ). n
. n 0 4
. n 4 , LATEX
. break new
.2 break , LATEX
( ).
,
. !
2

, linebreak , newline ,
.[]

2.2
LATEX . LATEX
,
. LATEX
(overfull hbox) .
LATEX
.3 \sloppy LATEX .

.
. (underfull hbox) . ,
. \fussy LATEX
.

2.2.2

LATEX .
,
TEX .
\hyphenation{word list}

-
.
.
.
, (
) .
\begin{document} babel
, babel
.
, hyphenation Hyphenation , FORTRAN Fortran, fortran
. ( )
.
:
\hyphenation{FORTRAN Hy-phen-a-tion}
\- .
.
3 A
LT

EX (Overfull hbox)
, . \documentclass draft
.

21

22

( , )
. LATEX
.
I think this is: su\-per\-cal\-%
i\-frag\-i\-lis\-tic\-ex\-pi\-%
al\-i\-do\-cious

I think this is: supercalifragilisticexpialidocious

.
\mbox{text}

.
My phone number will change soon.
It will be \mbox{0116 291 2319}.
The parameter
\mbox{\emph{filename}} should
contain the name of the file.

My phone number will change soon. It will


be 0116 291 2319.
The parameter filename should contain the
name of the file.

\fbox \mbox , .

2.3

,
LATEX .

\today
\TeX
\LaTeX
\LaTeXe

2.4
2.4.1

2002 3 31
TEX
LATEX
LATEX 2




LATEX

" .
,
. LATEX (grace accent)
(apostrophe) .
.

2.4

Please press the x key.

2.4.2

23

Please press the x key.

LATEX .
. .
(minus) .
daughter-in-law, X-rated\\
pages 13--67\\
yes---or no? \\
$0$, $1$ and $-1$

daughter-in-law, X-rated
pages 1367
yesor no?
0, 1 and 1

.4 - , ,
.

2.4.3

()

Web . LATEX
\~ .
. .5
http://www.rich.edu/\~{}bush \\
http://www.clever.edu/$\sim$demo

2.4.4

http://www.rich.edu/bush
http://www.clever.edu/demo

() ()

, () LATEX ?6
Its $-30\,^{\circ}\mathrm{C}$,
I will soon start to
super-conduct.
4

Its 30 C, I will soon start to super-conduct.

. ,
. 102
.[]
5
url .
.[]
6
textcomp . \textdegree
\textcelsius .[]

24

2.4.5

( . . . )

.
.
.
.
\ldots

.
Not like this ... but like this:\\
New York, Tokyo, Budapest, \ldots

2.4.6

Not like this ... but like this:


New York, Tokyo, Budapest, . . .

(ligature)

(ligature)

.
.
: ff fi fl ffi . . .
: ff fi fl ffi . . .
\mbox{}
.
.
Not shelfful\\
but shelf\mbox{}ful

2.4.7

Not shelfful
but shelfful

LATEX . o
2.1 .
.
i j .
\i, \j .

2.5

25

H\^otel, na\"\i ve, \el\eve,\\


sm\o rrebr\o d, !Se\~norita!,\\
Sch\"onbrunner Schlo\ss{}
Stra\ss e

Hotel, nave, el`eve,


smrrebrd, Se
norita!,
Schonbrunner Schlo Strae

2.1:

2.5

o`
o

\o
\=o

o
o

\o
\.o

o
o

\^o
\"o

o
c

\~o
\c c

o
o.

\u o
\d o

\v o
\b o

o
o o

\H o
\t oo

\c o

\oe
\aa

o
o

\OE
\AA

\ae

\AE

\o
\i

\O
\j

\l
!

\L
?

,
LATEX .
1. 7
. Johannes Braams babel
.
2. LATEX . LATEX
,

. Local Guide [4]
.
, \documentclass
babel .
\usepackage[language]{babel}

, language Local Guide


7

, , . . . .

26

. Babel
. LATEX
babel .
,
.
babel
. , (a
ou
)
. babel , \"o "o
o
.

. LATEX . 1994 12 LATEX 2
, LATEX 2
. inputenc .
\usepackage[encoding]{inputenc}

,
.
. ,
a
PC 132 , ISO-LATIN 1
Unix 228 . ,
.
.

Mac
Unix
Windows
OS/2

applemac
latin1
ansinew
cp850

. TEX
. (Computer Modern) TEX 7 128
. , TEX
.

.
, TEX EC
. Computer Modern ,

.

2.5

27

. EC
(preamble) fontenc .
\usepackage[T1]{fontenc}

2.5.1

LATEX .
LATEX .
\usepackage[german]{babel}

LATEX ,
. .
Chapter() Kapitel .
.
2.2 .
2.2:
"a
"

2.5.2

"<

\dq

"s

"

">

LATEX .
1. .
plain text ASCII
KSX1001()
.
8

Tobias Oetiker 2.5.1


. LATEX

. .

28

, Windows Windows

.
2. LATEX .
HLATEX,
hLATEXp, Werner Lemberg CJK
. HLATEX hLATEXp

, . CJK
UTF-8
, //
, .9
3. .
. HLATEX
UHC (type 1) (truetype)
, HLATEX CJK .
cyberbit truetype CJK
, ttf2tfm
HLATEX CJK . TTF
LATEX .
HLATEX ,
.
\usepackage{hangul}

, , , ,
. ,
,
\usepackage{hfont}

. , .
LATEX HLATEX ,
A
HL TEX Guide . , TEX
(http://www.ktug.or.kr/) .
9

:
EX : CTAN:/tex-archive/language/korean/HLaTeX/
CJK : CTAN:/tex-archive/language/korean/CJK/
hLATEXp : http://knot.kaist.ac.kr/htex/
HLAT

2.7

29

Truetype HLATEX CJK


.

2.6

, LATEX
.
. LATEX
, .

.
LATEX
.
. (tilde) ~
. \@
.
Mr.~Smith was happy to see her\\
cf.~Fig.~5\\
I like BASIC\@. What about you?

Mr. Smith was happy to see her


cf. Fig. 5
I like BASIC. What about you?


.
\frenchspacing

LATEX
.
. \frenchspacing \@
.

2.7

, (chapter)
(section), (subsection) . LATEX

. .
article / :

30
\section{...}
\subsection{...}
\subsubsection{...}

\paragraph{...}
\subparagraph{...}

report book /
.
\part{...}

\chapter{...}

article , article book


(chapter) . , ,
LATEX .
/ .
\part .
\appendix .
.10
LATEX /
.
.
\tableofcontents

(LATEX )
. . LATEX
.
/ .
* .
/
. \section{Help}
\section*{Help} .
/ .

.
.
\chapter[Title for the table of contents]{A long
and especially boring title, shown in the text}
10

article .

2.8

31

(title) .
\maketitle

.
\title{...}, \author{...} \date{...}

\author , \and
.
9 1.3
.
/ , LATEX 2 book
. ()
. /
.
\frontmatter \begin{document}
. ( , \chapter*{Preface})
LATEX .
\mainmatter .

.
\appendix .
(chapter)
.
\backmatter
. .

2.8

, , () ,
(cross-reference) . LATEX
.
\label{marker }, \ref{marker }, \pageref{marker }

marker . LATEX \ref


, \label ,

32

\ref . \pageref \label


.11 / ,
.
A reference to this subsection
\label{sec:this} looks like:
see section~\ref{sec:this} on
page~\pageref{sec:this}.

2.9

A reference to this subsection looks like: see


section 22 on page 32.

.
\footnote{footnote text}

.
12 . ,
.13

Footnotes\footnote{This is
a footnote.} are often used
by people using \LaTeX.

Footnotesa are often used by people using


LATEX.
a

This is a footnote.

[ ]
.
.
13 (footnotemark) ,
14 ,
\footnote \footnote .
\footnotemark .
\footnotetext . \footnotemark
\footnotetext
11

.
.
12
.
13
, .
. ,
.14
14
. :-) (
.[])

2.11

33

.
.

2.10

.
\underline{text}


.15 LATEX .
\emph{text}

.
\emph \emph
.
\emph{If you use
emphasizing inside a piece
of emphasized text, then
\LaTeX{} uses the
\emph{normal} font for
emphasizing.}

If you use emphasizing inside a piece of emphasized text, then LATEX uses the normal
font for emphasizing.

, LATEX
.
\textit{You can also
\emph{emphasize} text if
it is set in italics,}
\textsf{in a
\emph{sans-serif} font,}
\texttt{or in
\emph{typewriter} style.}

15

You can also emphasize text if it is set in italics, in a sans-serif font, or in typewriter
style.

.[

34

2.11

\begin{environment} text

\end{environment}

name . ,
.
\begin{aaa}...\begin{bbb}...\end{bbb}...\end{aaa}
.

2.11.1

Itemize, Enumerate, Description

itemize , enumerate , description



.
\flushleft
\begin{enumerate}
\item You can mix the list
environments to your taste:
\begin{itemize}
\item But it might start to
look silly.
\item[-] With a dash.
\end{itemize}
\item Therefore remember:
\begin{description}
\item[Stupid] things will not
become smart because they are
in a list.
\item[Smart] things, though, can be
presented beautifully in a list.
\end{description}
\end{enumerate}

2.11.2

1. You can mix the list environments to


your taste:
But it might start to look silly.
- With a dash.
2. Therefore remember:
Stupid things will not become smart
because they are in a list.
Smart things, though, can be
presented beautifully in a list.

Flushleft, Flushright, Center

flushleft flushright
. center . \\
LATEX .

2.11
\begin{flushleft}
This text is\\ left-aligned.
\LaTeX{} is not trying to make
each line the same length.
\end{flushleft}

35

This text is
left-aligned. LATEX is not trying to make
each line the same length.

\begin{flushright}
This text is right-\\aligned.
\LaTeX{} is not trying to make
each line the same length.
\end{flushright}

aligned.

This text is rightEX is not trying to make each


line the same length.

LAT

\begin{center}
At the centre\\of the earth
\end{center}

2.11.3

At the centre
of the earth

Quote, Quotation, Verse

quote .
A typographical rule of thumb
for the line length is:
\begin{quote}
On average, no line should
be longer than 66 characters.
\end{quote}
This is why \LaTeX{} pages have
such large borders by default and
also why multicolumn print is
used in newspapers.

A typographical rule of thumb for the line


length is:
On average, no line should be
longer than 66 characters.
This is why LATEX pages have such large borders by default and also why multicolumn
print is used in newspapers.

. quotation verse
, quotation
. verse ()
. \\ (verse)
.

36
I know only one English poem by
heart. It is about Humpty Dumpty.
\begin{flushleft}
\begin{verse}
Humpty Dumpty sat on a wall:\\
Humpty Dumpty had a great fall.\\
All the Kings horses and all
the Kings men\\
Couldnt put Humpty together
again.
\end{verse}
\end{flushleft}

2.11.4

I know only one English poem by heart. It is


about Humpty Dumpty.
Humpty Dumpty sat on a wall:
Humpty Dumpty had a great
fall.
All the Kings horses and all
the Kings men
Couldnt put Humpty together
again.

(Verbatim )

\begin{verbatim} \end{verbatim}
, LATEX
.
, .
\verb+text+

+ . *
+ . LATEX
.
The \verb|\ldots| command \ldots
The \ldots command . . .
\begin{verbatim}
10 PRINT "HELLO WORLD ";
20 GOTO 10
\end{verbatim}

10 PRINT "HELLO WORLD ";


20 GOTO 10

\begin{verbatim*}
the starred version of
the
verbatim
environment emphasizes
the spaces
in the text
\end{verbatim*}

thestarredversionof
theverbatim
environmentemphasizes
thespacesinthetext

\verb , .
\verb*|like

this :-) |

likethis:-)

2.11

37

verbatim \verb
.

2.11.5

Tabular

tabular .
. LATEX (column) .
\begin{tabular}{table spec}

, table spec . l (column)


, r . c .
p{width}
. | .
tabular , & , \\ ,
\hline . \cline{j-i}
. i j .
\begin{tabular}{|r|l|}
\hline
7C0 & hexadecimal \\
3700 & octal \\ \cline{2-2}
11111000000 & binary \\
\hline \hline
1984 & decimal \\
\hline
\end{tabular}

\begin{tabular}{|p{4.7cm}|}
\hline
Welcome to Boxys paragraph.
We sincerely hope youll
all enjoy the show.\\
\hline
\end{tabular}

7C0
3700
11111000000
1984

hexadecimal
octal
binary
decimal

Welcome to Boxys paragraph.


We sincerely hope youll all enjoy the show.

@{}. @{...} .
( )
.
, .
, . @{}
.

38
\begin{tabular}{@{} l @{}}
\hline
no leading space\\
\hline
\end{tabular}

\begin{tabular}{l}
\hline
leading space left and right\\
\hline
\end{tabular}

no leading space

leading space left and right

LATEX
,16 . ,

.
\begin{tabular} @{.} .
, . (&)
!
, \multicolumn
( ) .
\begin{tabular}{c r @{.} l}
Pi expression
&
\multicolumn{2}{c}{Value} \\
\hline
$\pi$
& 3&1416 \\
$\pi^{\pi}$
& 36&46
\\
$(\pi^{\pi})^{\pi}$ & 80662&7 \\
\end{tabular}

Pi expression

( )

\begin{tabular}{|c|c|}
\hline
\multicolumn{2}{|c|}{Ene} \\
\hline
Mene & Muh! \\
\hline
\end{tabular}

Ene
Mene Muh!

Value
3.1416
36.46
80662.7

tabular
. supertabular
16

tools , dcolumn
.

2.12
longtabular .

2.12

.
. .

.

.
,
. LATEX
. ,
. LATEX
.
, LATEX
.
, LATEX .
figure table
. (placement specifier )
.
\begin{figure}[placement specifier ] \begin{table}[placement specifier ]

LATEX
. placement specifier
. 2.3 .
2.3:

h
t
b
p
!
a

. . .
here . .
.
top . .
bottom . .
page . .
a .

39

40

Note: 0pt 1.05em TEX . 80 5.5


.
.
\begin{table}[!hbp]
[!hbp] LATEX (h), (b)
(p) ,
(!) . [tbp]
.
LATEX
. , (queue)17
. , LATEX

. ,
. LATEX
(h )
.
. LATEX
.
. ,
LATEX
,
.
LATEX (single-location placement specifier)
, .
,
. [h]
. LATEX
[h] [ht] .
,
.
\caption{caption text}

, () .
Figure() Table() LATEX
17

(fifo first in first out) (queue).

2.12
.
\listoffigures and \listoftables

\tableofcontents ,
.
. ,
. \caption
.
\caption[Short]{LLLLLoooooonnnnnggggg}
\label \ref .
, .

.
Figure~\ref{white} is an example of Pop-Art.
\begin{figure}[!hbp]
\makebox[\textwidth]{\framebox[5cm]{\rule{0pt}{5cm}}}
\caption{Five by Five in Centimetres.} \label{white}
\end{figure}
, LATEX (h)18 (!)
. , (b)
.
, LATEX ( )
.
19 LATEX

.
.
\clearpage \cleardoublepage

LATEX
. \cleardoublepage
.
18



\floatpagefraction .
LATEX 0.5 , \renewcommand
.[]
19

41

42

LATEX 2 PostScript
.

2.13

\caption \section
.
. \section
, .
\footnote, \phantom .

( ). \protect
.
\protect
. \protect
.
\section{I am considerate
\protect\footnote{and protect my footnotes}}


, TEX .
. .

.
. AMS-LATEX1
.

3.1

LATEX .
\( \), $ $ \begin{math} \end{math}
.
Add $a$ squared and $b$ squared
to get $c$ squared. Or, using
a more mathematical approach:
$c^{2}=a^{2}+b^{2}$

\TeX{} is pronounced as
$\tau\epsilon\chi$.\\[6pt]
100~m$^{3}$ of water\\[6pt]
This comes from my $\heartsuit$

Add a squared and b squared to get c squared.


Or, using a more mathematical approach:
c2 = a2 + b2

TEX is pronounced as .
100 m3 of water
This comes from my

$
(display) , \[ \]
1

CTAN:/tex-archive/macros/latex/required/amslatex

44

\begin{displaymath} \end{displaymath} .
.
equation .
Add $a$ squared and $b$ squared
to get $c$ squared. Or, using
a more mathematical approach:
\begin{displaymath}
c^{2}=a^{2}+b^{2}
\end{displaymath}
And just one more line.

Add a squared and b squared to get c squared.


Or, using a more mathematical approach:
c2 = a2 + b2
And just one more line.

\label \ref .
\begin{equation} \label{eq:eps}
\epsilon > 0
\end{equation}
From (\ref{eq:eps}), we gather
\ldots

>0

(3.1)

From (3.1), we gather . . .

(displaymath)
.
$\lim_{n \to \infty}
\sum_{k=1}^n \frac{1}{k^2}
= \frac{\pi^2}{6}$

\begin{displaymath}
\lim_{n \to \infty}
\sum_{k=1}^n \frac{1}{k^2}
= \frac{\pi^2}{6}
\end{displaymath}

limn

Pn

1
k=1 k2

2
6

n
X
2
1
=
n
k2
6

lim

k=1

.
,
1. .

, \,, \quad \qquad
.
2. .
.

3.3

45

3. .

, (
)
\textrm{...} .
\begin{equation}
\forall x \in \mathbf{R}:
\qquad x^{2} \geq 0
\end{equation}

\begin{equation}
x^{2} \geq 0\qquad
\textrm{for all }x\in\mathbf{R}
\end{equation}

x R :

x2 0

x2 0

for all x R

(3.2)

(3.3)

() .
amsfonts amssymb \mathbb
(blackboard bold)
. ,
\begin{displaymath}
x^{2} \geq 0\qquad
\textrm{for all }x\in\mathbb{R}
\end{displaymath}

3.2

x2 0

for all x R


. {...}
.
\begin{equation}
a^x+y \neq a^{x+y}
\end{equation}

3.3

ax + y 6= ax+y


. 56 3.10
.

(3.4)

46

\alpha, \beta, \gamma, . . . ,


\Gamma, \Delta, . . . 2 .
$\lambda,\xi,\pi,\mu,\Phi,\Omega$

, , , , ,

^ _ .
$a_{1}$ \qquad $x^{2}$ \qquad
$e^{-\alpha t}$ \qquad
$a^{3}_{ij}$\\
$e^{x^2} \neq {e^x}^2$

a1
x2
2
ex 6= ex 2

et

a3ij

\sqrt , n-(nth root) \sqrt[n]


. LATEX .
\surd .
$\sqrt{x}$ \qquad
$\sqrt{ x^{2}+\sqrt{y} }$
\qquad $\sqrt[3]{2}$\\[3pt]
$\surd[x^2 + y^2]$

x2 + y

x
2

[x + y ]

\overline, \underline
.
$\overline{m+n}$

m+n

\overbrace, \underbrace
(horizontal braces) .

$\underbrace{ a+b+\cdots+z }_{26}$

a + b + + z
|
{z
}
26

(tilde) ,
56 3.1 .
\widetilde \widehat .
(prime) .
\begin{displaymath}
y=x^{2}\qquad y=2x\qquad y=2
\end{displaymath}
2

y = x2

y 0 = 2x

y 00 = 2

(Alpha) A LATEX 2
. .

3.3

47

,
\vec . \overrightarrow \overleftarrow
A B .
\begin{displaymath}
\vec a\quad\overrightarrow{AB}
\end{displaymath}

~a AB

.

. \cdot .
\begin{displaymath}
v = {\sigma}_1 \cdot {\sigma}_2
{\tau}_1 \cdot {\tau}_2
\end{displaymath}

v = 1 2 1 2

, log
() . LATEX
.
\arccos \cos
\csc \exp
\ker
\limsup \min
\arcsin \cosh \deg \gcd
\lg
\ln
\Pr
\arctan \cot
\det \hom
\lim
\log
\sec
\arg
\coth \dim \inf
\liminf \max
\sin
\sinh
\sup
\tan \tanh
\[\lim_{x \rightarrow 0}
\frac{\sin x}{x}=1\]

sin x
=1
x0 x
lim

(modulo) . a mod
b \bmod , x a (mod b)
\pmod .
\frac{...}{...}
. 1/2
,
.
$1\frac{1}{2}$~hours
\begin{displaymath}
\frac{ x^{2} }{ k+1 }\qquad
x^{ \frac{2}{k+1} }\qquad
x^{ 1/2 }
\end{displaymath}

1 21 hours
x2
k+1

x k+1

x1/2

48

{... \choose ...} {... \atop ...}


.
.3
\begin{displaymath}
{n \choose k}\qquad {x \atop y+2}
\end{displaymath}


n
k

x
y+2

(binary relations)
. \stackrel
.
\begin{displaymath}
\int f_N(x) \stackrel{!}{=} 1
\end{displaymath}

fN (x) = 1

\int ,
P
\sum .
^ _ . 4
\begin{displaymath}
\sum_{i=1}^{n} \qquad
\int_{0}^{\frac{\pi}{2}} \qquad
\prod_\epsilon
\end{displaymath}

n
X
i=1

TEX
.(, [ h k l). () ()
. \{ .
.(. \updownarrow). 58
3.8 .
\begin{displaymath}
{a,b,c}\neq\{a,b,c\}
\end{displaymath}

a, b, c 6= {a, b, c}

, \left
\right , TEX
3

amsmath
. \bimon \genfrac . \genfrac
, . \atop
.
\newcommand{\newatop}[2]{\genfrac{}{}{0pt}{1}{#1}{#2}}.
4
AMS-LATEX / .

3.4

49

. \left \right
,
.
\right. .
\begin{displaymath}
1 + \left( \frac{1}{ 1-x^{2} }
\right) ^3
\end{displaymath}

1+

1
1 x2


. \big, \Big, \bigg, \Bigg
.5
$\Big( (x+1) (x-1) \Big) ^{2}$\\
$\big(\Big(\bigg(\Bigg($\quad
$\big\}\Big\}\bigg\}\Bigg\}$\quad
$\big\|\Big\|\bigg\|\Bigg\|$

2
(x + 1)(x 1)

. \ldots
() ,6 \cdots .
\vdots ,
\ddots . 3.5
.
\begin{displaymath}
x_{1},\ldots,x_{n} \qquad
x_{1}+\cdots+x_{n}
\end{displaymath}

3.4

x1 , . . . , xn

x1 + + xn

TEX
3
4
. 18
quad ( ) \, , 18
quad ( )
5
\:, 18 quad ( ) \; . (\)
, \quad ( ) \qquad (
)
. \quad M . \!
5

. 11pt,
12pt .
exscale amsmath .
6
(baseline) , 102 .[]

50

3
quad ) (negative space).
18
.

\newcommand{\ud}{\mathrm{d}}
\begin{displaymath}
\int\!\!\!\int_{D} g(x,y)
\, \ud x\, \ud y
\end{displaymath}
instead of
\begin{displaymath}
\int\int_{D} g(x,y)\ud x \ud y
\end{displaymath}

ZZ
g(x, y) dx dy
D

instead of
Z Z
g(x, y)dxdy
D

d .7
AMS-LATEX \iint, \iiint, \iiiint, \idotsint
,
. amsmath
.
\newcommand{\ud}{\mathrm{d}}
\begin{displaymath}
\iint_{D} \, \ud x \, \ud y
\end{displaymath}

ZZ
dx dy
D

AMS-LATEX testmath.tex The LaTeX Companion 8


.

3.5

array . array tabular


. \\ .
\begin{displaymath}
\mathbf{X} =
\left( \begin{array}{ccc}
x_{11} & x_{12} & \ldots \\
x_{21} & x_{22} & \ldots \\
\vdots & \vdots & \ddots
\end{array} \right)
\end{displaymath}
7

x11
x21
X=
..
.

x12
x22
..
.

...
...

..
.

d
.[]

3.5

51

array .
,
.
\begin{displaymath}
y = \left\{ \begin{array}{ll}
a & \textrm{if $d>c$}\\
b+x & \textrm{in the morning}\\
l & \textrm{all day long}
\end{array} \right.
\end{displaymath}

if d > c
a
y=
b + x in the morning

l
all day long

tabular array .
:
\begin{displaymath}
\left(\begin{array}{c|c}
1 & 2 \\
\hline
3 & 4
\end{array}\right)
\end{displaymath}

1 2
3 4

, equation
eqnarray eqnarray* . eqnarray
. eqnarray*
.
eqnarray eqnarray* {rcl} (column)
.
. .
\\ .
\begin{eqnarray}
f(x) & = & \cos x
\\
f(x) & = & -\sin x
\\
\int_{0}^{x} f(y)dy &
= & \sin x
\end{eqnarray}

f (x) =
0

f (x) =

cos x

(3.5)

sin x

(3.6)

f (y)dy

= sin x

.
, \setlength\arraycolsep{2pt}
.

(3.7)

52


.
.
{\setlength\arraycolsep{2pt}
\begin{eqnarray}
\sin x & = & x -\frac{x^{3}}{3!}
+\frac{x^{5}}{5!}-{}
\nonumber\\
& & {}-\frac{x^{7}}{7!}+{}\cdots
\end{eqnarray}}

\begin{eqnarray}
\lefteqn{ \cos x = 1
-\frac{x^{2}}{2!} +{} }
\nonumber\\
& & {}+\frac{x^{4}}{4!}
-\frac{x^{6}}{6!}+{}\cdots
\end{eqnarray}

x3
x5
+

3!
5!
x7

+
7!

sin x = x

x2
+
2!
6
4
x
x

+
+
4!
6!

(3.8)

cos x = 1

(3.9)

\nonumber .

. amsmath . (split
align .)

3.6

(Phantom)


. LATEX . phantom

.
^ _
LATEX
. \phantom
.
.
\begin{displaymath}
{}^{12}_{\phantom{1}6}\textrm{C}
\qquad \textrm{versus} \qquad
{}^{12}_{6}\textrm{C}
\end{displaymath}

12
6C

versus

12
6 C

3.7
\begin{displaymath}
\Gamma_{ij}^{\phantom{ij}k}
\qquad \textrm{versus} \qquad
\Gamma_{ij}^{k}
\end{displaymath}

3.7

53

ij k

kij

versus

TEX
. .
, \textrm
.
. \textrm .
\mathrm
, . \mathrm
. ,
.8
\begin{equation}
2^{\textrm{nd}} \quad
2^{\mathrm{nd}}
\end{equation}

2nd

2nd

(3.10)

TEX , LATEX
. ,
.
\displaystyle (123), \textstyle (123), \scriptstyle (123) and
\scriptscriptstyle (123).
.
\begin{displaymath}
\mathop{\mathrm{corr}}(X,Y)=
\frac{\displaystyle
\sum_{i=1}^n(x_i-\overline x)
(y_i-\overline y)}
{\displaystyle\biggl[
\sum_{i=1}^n(x_i-\overline x)^2
\sum_{i=1}^n(y_i-\overline y)^2
\biggr]^{1/2}}
\end{displaymath}
8

n
X

corr(X, Y ) = n
X
i=1

(xi x)(yi y)

i=1

(xi x)2

1/2
n
X
(yi y)2
i=1

The AMS-LATEX \textrm .

54
\left[
) .

3.8

\right] (

(theorem), , . . .

, (Lemmas), (Definitions),
(Axiom) . LATEX
.
\newtheorem{name}[counter ]{text}[section]

name (theorem)
(). text (theorem)
.
. (theorem)
. counter (theorem)
name .
. section
(section) .
\newtheorem TEX ,
.
\begin{name}[text]
This is my interesting theorem
\end{name}
.
\newtheorem
.
% definitions for the document
% preamble
\newtheorem{law}{Law}
\newtheorem{jury}[law]{Jury}
%in the document
\begin{law} \label{law:box}
Dont hide in the witness box
\end{law}
\begin{jury}[The Twelve]
It could be you! So beware and
see law~\ref{law:box}\end{jury}
\begin{law}No, No, No\end{law}

Law 1 Dont hide in the witness box


Jury 2 (The Twelve) It could be you! So
beware and see law 1
Law 3 No, No, No

3.9

55

Jury Law .
Law . ()
.
\flushleft
\newtheorem{mur}{Murphy}[section]
\begin{mur}
If there are two or more
ways to do something, and
one of those ways can result
in a catastrophe, then
someone will do it.\end{mur}

Murphy 3.8.1 If there are two or more


ways to do something, and one of those
ways can result in a catastrophe, then
someone will do it.

Murphy (section) .
, (chapter) (subsection)
.

3.9

LATEX ( ) .

. \mathbf ,
( ) .
() . \boldmath ,
. .
\begin{displaymath}
\mu, M \qquad \mathbf{M} \qquad
\mbox{\boldmath $\mu, M$}
\end{displaymath}

, M

, M

() .
.
amsmath amsbsy tools
bm ,
\boldsymbol .
\begin{displaymath}
\mu, M \qquad
\boldsymbol{\mu}, \boldsymbol{M}
\end{displaymath}

, M

, M

56

3.10

()
.
3.123.169 () amssymb
, AMS
. AMS ,
CTAN:/tex-archive/macros/latex/required/amslatex .
3.1:
a

\hat{a}

\check{a}

\tilde{a}

\acute{a}

a
`

\grave{a}

\dot{a}

\ddot{a}

\bar{a}

~a

\vec{a}

e
A

\breve{a}

b
A

\widehat{A}

\widetilde{A}

3.2:

\alpha

\theta

\upsilon

\beta

\vartheta

\pi

\phi

\gamma

\iota

\varpi

\varphi

\delta

\kappa

\rho

\chi

\epsilon

\lambda

\varrho

\psi

\varepsilon

\mu

\sigma

\omega

\zeta

\nu

\varsigma

\eta

\xi

\tau

3.3:

\Gamma

\Lambda

\Sigma

\Psi

\Delta

\Xi

\Upsilon

\Omega

\Theta

\Pi

\Phi

David Carlisle Josef Tkadlec


symbols.tex .

3.10

57

3.4:
\not .
<

<

>

>

\leq or \le

\geq or \ge

\equiv

\ll

\gg

.
=

\prec

\succ

\sim

\preceq

\succeq

'

\simeq

\subset

\supset

\approx

\subseteq

\supseteq

=
a

\Join

\doteq

\cong

<

\sqsubset

\sqsupset

\sqsubseteq

\sqsupseteq

./

\bowtie

\in

\ni , \owns

\propto

\vdash

\dashv

|=

\models

\mid

\parallel

\perp

\smile

\frown

\asymp

\notin

6=

\neq or \ne

^
:
a

latexsym .

3.5:
+

\pm

\mp

\triangleleft

\cdot

\div

\triangleright

\times

\setminus

\star

\cup

\cap

\ast

\sqcup

\sqcap

\circ

\vee , \lor

\wedge , \land

\bullet

\oplus

\ominus

\diamond

\odot

\oslash

\uplus

\otimes

\bigcirc

\amalg

\bigtriangleup

\bigtriangledown

\dagger

\lhd

\rhd

\ddagger

\wr

\unlhd

\unrhd

58

P
Q
`
R

3.6:
W
\bigcup
\bigvee
V
\bigcap
\bigwedge

\sum

\prod

F
H

\coprod
\int

\bigsqcup

\bigoplus

\bigotimes

\bigodot

\oint

\biguplus

3.7:

\leftarrow or \gets

\longleftarrow

\uparrow

\rightarrow or \to

\longrightarrow

\downarrow

\leftrightarrow

\longleftrightarrow

\updownarrow

\Leftarrow

\Longleftarrow

\Uparrow

\Rightarrow

\Longrightarrow

\Downarrow

\Leftrightarrow

\Longleftrightarrow

\Updownarrow

\mapsto

\longmapsto

\nearrow

\hookleftarrow

\hookrightarrow

&

\searrow

\leftharpoonup

\rightharpoonup

\swarrow

\leftharpoondown

\rightharpoondown

\nwarrow

\rightleftharpoons

\iff (bigger spaces)

\leadsto

latexsym .

3.8:
(

\uparrow

\Uparrow

[ or \lbrack

] or \rbrack

\downarrow

\Downarrow

\{ or \lbrace

\} or \rbrace

\updownarrow

\Updownarrow

\langle

\rangle

| or \vert

\| or \Vert

\lfloor

\rfloor

\lceil

\rceil

\backslash

3.9:

\rgroup
\lgroup
w
\arrowvert w \Arrowvert

. (dual. empty)

\lmoustache

\bracevert

\rmoustache

3.10

59

3.10:
...

\dots

\cdots

..
.

\vdots

..

\hbar

\imath

\jmath

\ell

<

\Re

\Im

\aleph

\wp

\partial

\infty

\Diamond

\forall

\exists

\mho

\prime

\emptyset
a

\ddots

\nabla

\triangle

\Box

\bot

>

\top

\angle

\diamondsuit

\heartsuit

\clubsuit

\spadesuit

\neg or \lnot

\flat

\natural

\sharp

\surd

latexsym .

3.11:
.

\dag

\S

\copyright

\ddag

\P

\pounds

3.12: AMS
p

\ulcorner

\urcorner

\llcorner

\lrcorner

\lvert

\rvert

\lVert

\rVert

3.13: AMS
z

\digamma

\varkappa

\beth

\daleth

\gimel

60

3.14: AMS
l

\lessdot

\gtrdot

\doteqdot or \Doteq

\leqslant

>

\geqslant

\risingdotseq

\eqslantless

\eqslantgtr

\fallingdotseq

\leqq

\geqq

\eqcirc

\lll or \llless

\ggg or \gggtr

\circeq

\lesssim

&

\gtrsim

\triangleq

\lessapprox

'

\gtrapprox

\bumpeq

\lessgtr

\gtrless

\Bumpeq

\lesseqgtr

\gtreqless

\thicksim

\lesseqqgtr

\gtreqqless

\thickapprox

\preccurlyeq

<

\succcurlyeq

\approxeq

\curlyeqprec

\curlyeqsucc

\backsim

\precsim

\succsim

\backsimeq

\precapprox

\succapprox

\vDash

\subseteqq

\supseteqq

\Vdash

\Subset

\Supset

\Vvdash

<

\sqsubset

\sqsupset

\backepsilon

\therefore

\because

\varpropto

\shortmid

\shortparallel

\between

\smallsmile

\smallfrown

\pitchfork

\vartriangleleft

\vartriangleright

\blacktriangleleft

\trianglelefteq

\trianglerighteq

\blacktriangleright

3.10

61

3.15: AMS
L99

\dashleftarrow

99K

\dashrightarrow

\multimap

\leftleftarrows

\rightrightarrows

\upuparrows

\leftrightarrows

\rightleftarrows

\downdownarrows

\Lleftarrow

\Rrightarrow

\upharpoonleft

\twoheadleftarrow

\twoheadrightarrow

\upharpoonright

\leftarrowtail

\rightarrowtail

\downharpoonleft

\leftrightharpoons

\rightleftharpoons

\downharpoonright

\Lsh

\Rsh

\rightsquigarrow

"

\looparrowleft

\looparrowright

\leftrightsquigarrow

\curvearrowleft

\curvearrowright

\circlearrowleft

\circlearrowright

3.16: AMS

\nless

\ngtr

&

\varsubsetneqq

\lneq

\gneq

'

\varsupsetneqq

\nleq

\ngeq

"

\nsubseteqq

\nleqslant

\ngeqslant

\nsupseteqq

\lneqq

\gneqq

\nmid

\lvertneqq

\gvertneqq

\nparallel

\nleqq

\ngeqq

\nshortmid

\lnsim

\gnsim

\nshortparallel

\lnapprox

\gnapprox

\nsim

\nprec

\nsucc

\ncong

\npreceq

\nsucceq

\nvdash

\precneqq

\succneqq

\nvDash

\precnsim

\succnsim

\nVdash

\precnapprox

\succnapprox

\nVDash

\subsetneq

\supsetneq

\ntriangleleft

\varsubsetneq

\varsupsetneq

\ntriangleright

\nsubseteq

\nsupseteq

\ntrianglelefteq

\subsetneqq

\supsetneqq

\ntrianglerighteq

\nleftarrow

\nrightarrow

\nleftrightarrow

\nLeftarrow

\nRightarrow

<

\nLeftrightarrow

62

3.17: AMS
u

\dotplus

\centerdot

\intercal

\ltimes

\rtimes

>

\divideontimes

\Cup or \doublecup

\Cap or \doublecap

\smallsetminus

\veebar

\barwedge

\doublebarwedge

\boxplus

\boxminus

\circleddash

\boxtimes

\boxdot

\circledcirc

\leftthreetimes

\rightthreetimes

\circledast

\curlyvee

\curlywedge

3.18: AMS
~

\hbar

\hslash

\Bbbk

\square

\blacksquare

\circledS

\vartriangle

\blacktriangle

\complement

\triangledown

\blacktriangledown

\Game

\lozenge

\blacklozenge

\bigstar

\angle

\measuredangle

\sphericalangle

\diagup

\diagdown

\backprime

\nexists

\Finv

\varnothing

\eth

\mho

3.19:

ABCdef

\mathrm{ABCdef}

ABCdef

\mathit{ABCdef}

ABCdef

\mathnormal{ABCdef}

ABC

\mathcal{ABC}

A BC

\mathcal{ABC}

mathrsfs

ABC

\mathcal{ABC}

eucal mathcal

\mathscr{ABC}

eucal mathscr

ABCdef

\mathfrak{ABCdef}

eufrak

ABC

\mathbb{ABC}

amsfonts amssymb


LATEX ,
. LATEX
LATEX Manual [1] The LATEX Companion [3]
.

4.1

EPS

LATEX figure table ,


.
LATEX LATEX
. ,
. .
The LATEX Companion [3] LATEX
Manual [1] .
,
1 , LATEX
. LATEX .
Encapsulated
PostScript(EPS) . EPS
2 .
D. P. Carlisle graphicx .
graphics3 (package bundle)4 .
1

XFig, CorelDraw!, Freehand, Gnuplot, . . . .


PS GhostScript
CTAN:/tex-archive/support/ghostscript . (Windows)
GSview .
3
CTAN:/tex-archive/macros/latex/required/graphics
4 A
L TEX $TEXINPUTS$/latex/required/
2

64

PostScript graphicx
,
.
1. EPS .5
2. (preamble) graphicx
.
\usepackage[driver ]{graphicx}

driver dvi postscript


. dvips. TEX
driver . graphicx
driver
.dvi , .eps
.
3. file .
\includegraphics[key=value, . . . ]{file}

key value ()
. key ,
, . 4.1 key .
.
\begin{figure}
\begin{center}
\includegraphics[angle=90, width=0.5\textwidth]{test}
\end{center}
\end{figure}
(graphics, tools, amslatex, psnfss, . . . ) $TEXINPUTS$/latex/contrib/
.
. []
5
EPS
. Apple LaserWriter
, . EPS
. , EPS .
EPS .

4.2

65

4.1: graphicx key


width
height
angle
scale

test.eps .
90 , , 0.5
.
.
. 80 5.5
. [8] [11] .

4.2

thebibliography .

\bibitem{marker }

. , marker
.
\cite{marker }

. \begin{thebibliography}
.
{99} 99
( ) LATEX .6
6

widest-label . widest-label
, \bibitem
. \cite
.[]

66

Partl [1] has proposed that . . .

Partl~\cite{pa} has
proposed that \ldots
\begin{thebibliography}{99}
\bibitem{pa} H.~Partl:
\emph{German \TeX},
TUGboat Volume~9, Issue~1 (1988)
\end{thebibliography}

Bibliography
[1] H. Partl: German TEX, TUGboat Volume 9, Issue 1 (1988)

BibTEX .
TEX BibTEX . BibTEX
,
. BibTEX
() (style sheets)
,
.

4.3

. LATEX LATEX
makeindex7 .
.
The LATEX Companion [3] .
LATEX , (preamble) makeidx
\usepackage{makeidx}

,
\makeindex

(preamble) .
7

8 makeidx .

4.3

67

4.2: Index Key

\index{hello}
\index{hello!Peter}
\index{Sam@\textsl{Sam}}
\index{Lin@\textbf{Lin}}
\index{Jenny|textbf}
\index{Joe|textit}


hello, 1
Peter, 3
Sam, 2
Lin, 7
Jenny, 3
Joe, 5


hello



\index{key}

, key .
\index . 4.2 key
.
LATEX \index
, LATEX
.idx . .idx makeindex
.

makeindex filename

makeindex ,
.ind . LATEX ,

\printindex

.
LATEX 2 showidx
. .

68

4.4

(Fancy Headers)

Piet van Oostrum fancyhdr 8


.
.
\documentclass{book}
\usepackage{fancyhdr}
\pagestyle{fancy}
% with this we ensure that the chapter and section
% headings are in lowercase.
\renewcommand{\chaptermark}[1]{\markboth{#1}{}}
\renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}}
\fancyhf{} % delete current setting for header and footer
\fancyhead[LE,RO]{\bfseries\thepage}
\fancyhead[LO]{\bfseries\rightmark}
\fancyhead[RE]{\bfseries\leftmark}
\renewcommand{\headrulewidth}{0.5pt}
\renewcommand{\footrulewidth}{0pt}
\addtolength{\headheight}{0.5pt} % make space for the rule
\fancypagestyle{plain}{%
\fancyhead{} % get rid of headers on plain pages
\renewcommand{\headrulewidth}{0pt} % and the line
}

4.1: fancyhdr

. ,
LATEX 2 .
\rightmark
\leftmark . chapter section
.
, \chapter \rightmark,
\leftmark . \chaptermark, \sectionmark
\subsectionmark , \rightmark \markleft
.
8

CTAN:/tex-archive/macros/latex/contrib/supported/fancyhdr/

4.6 Verbatim
, chapter , \chaptermark
(renew) .
fancyhdr 4.1
. 8
.

4.5

Verbatim

verbatim . verbatim
. verbatim verbatim
verbatim
. , verbatim
,
. verbatim , ,
\verbatiminput{filename}

. verbatim
.
verbatim tools ,
.
[9] .

4.6

LATEX

LATEX
. .
CTAN(http://www.ctan.org/)
.
geometry, hyphenat
. .ins .dtx
. readme.txt
. .
. (a) TEX
, (b)
. .
1. LATEX .ins . .sty
.

69

70

2. .sty TEX
. .../localtexmf /tex/latex
. ( OS/2
.)
3. . LATEX
. teTeX, fpTeX texhash
web2c mktexlsr. MiKTeX initexmf -update-fndb
GUI .
.dtx .
1. .dtx LATEX . .dvi
. LATEX
.
2. LATEX .idx .

5 .
3. .
makeindex -s gind.ist name
(name
.)
4. .dtx LATEX .
5. . .ps .pdf
.
.glo(glossary) .
4 5 .
makeindex -s gglo.ist -o name.gls name.glo
5 .dtx LATEX
.

LATEX
, .
,
.
LATEX
,
.
, LATEX , LATEX

.

5.1

, ,


. LATEX
.
.
\begin{lscommand}
\ci{dum}
\end{lscommand}

\dum

lscommand .

. \ci ,
.
(index) \dum \dum
.

LATEX

72

lscommand
.
,
,
.

5.1.1

.
\newcommand{name}[num]{definition}

.
name, definition.
num ,
9 .
0. , .
.
\tnss . The Not So
Short Introduction to LATEX 2 .
.
\newcommand{\tnss}{The not
so Short Introduction to
\LaTeXe}
This is \tnss \ldots{}
\tnss

This is The not so Short Introduction to


LATEX 2 . . . The not so Short Introduction to LATEX 2

num . #1
.
, #2 .
\newcommand{\txsit}[1]
{This is the \emph{#1} Short
Introduction to \LaTeXe}
% in the document body:
\begin{itemize}
\item \txsit{not so}
\item \txsit{very}
\end{itemize}

This is the not so Short Introduction


to LATEX 2
This is the very Short Introduction to
LATEX 2

,
EX . \renewcommand

LAT

5.1 , ,

73

. \renewcommand
\newcommand .
, \providecommand . \newcommand
, LATEX 2
.
LATEX . 6
.

5.1.2

\newcommand , \newenvironment
. .
\newenvironment{name}[num]{before}{after }

\newcommand , newenvironment num


. before
. after \end{name}
.
\newenvironment .
\newenvironment{king}
{\rule{1ex}{1ex}%
\hspace{\stretch{1}}}
{\hspace{\stretch{1}}%
\rule{1ex}{1ex}}

My humble subjects . . .

\begin{king}
My humble subjects \ldots
\end{king}

num \newcommand . LATEX


,
, \renewenvironment .
\newenvironment .
\rule 86 , \stretch
79 . \hspace 79
.

5.1.3

,
. , LATEX

LATEX

74

. , \usepackage
.
% Demo Package by Tobias Oetiker
\ProvidesPackage{demopack}
\newcommand{\tnss}{The not so Short Introduction to \LaTeXe}
\newcommand{\txsit}[1]{The \emph{#1} Short
Introduction to \LaTeXe}
\newenvironment{king}{\begin{quote}}{\end{quote}}

5.1:

. .sty .
,
\ProvidesPackage{package name}

. \ProvidesPackage
LATEX ,
. 5.1
.

5.2
5.2.1

LATEX (/, . . . )
. ,
. 5.1 5.2 .
.
.
5.3 .
{\small The small and
\textbf{bold} Romans ruled}
{\Large all of great big
\textit{Italy}.}

The small and bold Romans ruled

great big Italy.

all of

LATEX 2
. , ()/()
.

5.2

75

,
.
. 5.4
.
({) .
. LATEX
.
He likes {\LARGE large and
{\small small} letters}.

He likes

large and

small

letters.

.
(\par \\) .
} .
\par 1 .
1

\par .

5.1:
\textrm{...}
\texttt{...}

roman
typewriter

\textsf{...}

sans serif

\textmd{...}

medium

\textbf{...}

bold face

\textup{...}
\textsl{...}

upright
slanted

\textit{...}
\textsc{...}

italic
small caps

\emph{...}

emphasized

\textnormal{...}

document font

5.2:
\tiny
\scriptsize
\footnotesize
\small
\normalsize
\large

tiny font

very small font

quite small font

small font

\Large

larger font

\LARGE

very large font

\huge

huge

\Huge

largest

normal font

large font

LATEX

76

5.3:
size
\tiny
\scriptsize
\footnotesize
\small
\normalsize
\large
\Large
\LARGE
\huge
\Huge

10pt (default)
5pt
7pt
8pt
9pt
10pt
12pt
14pt
17pt
20pt
25pt

11pt option
6pt
8pt
9pt
10pt
11pt
12pt
14pt
17pt
20pt
25pt

12pt option
6pt
8pt
10pt
11pt
12pt
14pt
17pt
20pt
25pt
25pt

5.4:
Command

Example

Output

\mathcal{...}
\mathrm{...}
\mathbf{...}
\mathsf{...}
\mathtt{...}
\mathnormal{...}
\mathit{...}

$\mathcal{B}=c$
$\mathrm{K}_2$
$\sum x=\mathbf{v}$
$\mathsf{G\times R}$
$\mathtt{L}(b,c)$
$\mathnormal{R_{19}}\neq R_{19}$
$\mathit{ffi}\neq ffi$

B=c
K2
P
x=v
GR
L(b, c)
R 6= R19
ffi 6= f f i

5.2

77

{\Large Dont read this! It is not


true. You can believe me!\par}

Dont read this! It is not true.


You can believe me!

{\Large This is not true either.


But remember I am a liar.}\par

This is not true either. But remember I am a liar.

,
, (environment)
.
\begin{Large}
This is not true.
But then again, what is these
days \ldots
\end{Large}

This is not true. But then again,


what is these days . . .

5.2.2

,
. LATEX
. LATEX
.

\newcommand
.
\newcommand{\oops}[1]{\textbf{#1}}
Do not \oops{enter} this room,
its occupied by a \oops{machine}
of unknown origin and purpose.

Do not enter this room, its occupied by a


machine of unknown origin and purpose.

. ()
, \textbf
. \textbf
()
. \oops
.

LATEX

78

5.2.3

.2

you

Remember The MO RE fonts


use in a document, the
more readable and beautiful it become .

5.3
5.3.1

, .
\linespread{factor }

.
\linespread{1.3} , (
double space) \linespread{1.6} . factor
1.

5.3.2

LATEX () .
.
\setlength{\parindent}{0pt}
\setlength{\parskip}{1ex plus 0.5ex minus 0.2ex}
.
0 .
plus minus TEX

.

.3
. ,
2

. ( .
.
.
.)
3
.
(\parindent=1em) LaTeX
.[]

5.3

79

\tableofcontents .
,
.

.4
\indent

\parindent 0
.

.
\noindent

\section
.

5.3.3

LATEX . (
) .
\hspace{length}

\hspace ( ) \hspace*
. length
, 5.5 .
This\hspace{1.5cm}is a space
of 1.5 cm.

This

is a space of 1.5 cm.

.
\stretch{n}

\hspace{\stretch{n}} stretch
n .
x\hspace{\stretch{1}}
x\hspace{\stretch{3}}x
4

() indentfirst .
tools .

LATEX

80

5.5: TEX
mm
cm
in
pt
em
ex

5.3.4

millimetre 1/25 inch


centimetre = 10 mm
inch = 25.4 mm
point 1/72 inch 13 mm
M
x

(paragraph), (section), (subsection) LATEX


.
.
\vspace{length}

.

\vspace \vspace* .
\stretch \pagebreak
.
Some text \ldots
\vspace{\stretch{1}}
This goes onto the last line of the page.\pagebreak


\\[length]

.
\bigskip \smallskip
.

5.4

LATEX \documentclass .

5.4

81

6
i

?
6

?
?
6

Margin
Notes

?Header
6

Body

- 9i

i 10

i-

?
1i-

1
3
5
7
9
11

6
i
11

one inch + \hoffset


\evensidemargin = 70pt
\headheight = 13pt
\textheight = 595pt
\marginparsep = 7pt
\footskip = 27pt
\hoffset = 0pt
\paperwidth = 597pt

?
Footer

2
4
6
8
10

one inch + \voffset


\topmargin = 22pt
\headsep = 19pt
\textwidth = 360pt
\marginparwidth = 106pt
\marginparpush = 5pt (not shown)
\voffset = 0pt
\paperheight = 845pt

5.2:

LATEX

82

.
.
, . 5.2
. tools layout
.5
! . . .
. . LATEX
,
.
MS , LATEX
. 6 .
? 66() . LATEX
. 66
.
.
.
.
, ,
. , . . .
LATEX .
.
.
\setlength{parameter }{length}

.
\addtolength{parameter }{length}

\setlength
. , 1
.
\addtolength{\hoffset}{-0.5cm}
\addtolength{\textwidth}{1cm}
calc . \setlength
.

.
5
6

CTAN:/tex-archive/macros/latex/required/tools
.

5.6 ,

5.5

83

LATEX .
( )
.
\textwidth .
3 (text) , , command .7
\settoheight{command }{text}
\settodepth{command }{text}
\settowidth{command }{text}

.
\flushleft
\newenvironment{vardesc}[1]{%
\settowidth{\parindent}{#1:\ }
\makebox[0pt][r]{#1:\ }}{}
\begin{displaymath}
a^2+b^2=c^2
\end{displaymath}
\begin{vardesc}{Where}$a$,
$b$ -- are adjunct to the right
angle of a right-angled triangle.
$c$ -- is the hypotenuse of
the triangle and feels lonely.

a2 + b2 = c2
Where: a, b are adjunct to the right angle
of a right-angled triangle.
c is the hypotenuse of the triangle
and feels lonely.
d finally does not show up here at
all. Isnt that puzzling?

$d$ -- finally does not show up


here at all. Isnt that puzzling?
\end{vardesc}

5.6

LATEX .
,
. .
7

, , 102 .[]

LATEX

84

,
.
, TEX
. .
.
. LATEX .
,
. , tabular \includegraphics
. ,
.
(textwidth) .
.
,
\parbox[pos]{width}{text}

.
\begin{minipage}[pos]{width} text \end{minipage}

pos c, t b
. width . minipage
parbox , parbox
, minipage
.
\parbox .
.
\mbox ,
. \mbox
. ,
.
\makebox[width][pos]{text}

width .8
\width, \height, \depth, \totalheight
. text
. pos c, l, r, s ,
8

, . 0pt
, .

5.7

85

center(), left flush( ), right flush( ),


spread( ) .
\framebox \makebox ,
.
\makebox \framebox
.
\makebox[\textwidth]{%
c e n t r a l}\par
\makebox[\textwidth][s]{%
s p r e a d}\par
\framebox[1.1\width]{Guess Im
framed now!} \par
\framebox[0.8\width][r]{Bummer,
I am too wide} \par
\framebox[1cm][l]{never
mind, so am I}
Can you read this?

central
s

Guess Im framed now!


Bummer, I am too wide
never mind,
Can you
so am
readI this?

(horizontal) .
(vertical) .9 LATEX
.
\raisebox{lift}[depth][height]{text}

.
, \width, \height, \depth, \totalheight text
.
\raisebox{0pt}[0pt][0pt]{\Large%
\textbf{Aaaa\raisebox{-0.3ex}{a}%
\raisebox{-0.7ex}{aa}%
\raisebox{-1.2ex}{r}%
\raisebox{-2.2ex}{g}%
\raisebox{-4.5ex}{h}}}
he shouted but not even the next
one in line noticed that something
terrible had happened to him.

Aaaaaaa
he shouted but not even
r
the next one ingline noticed that something
terrible had happened
h to him.

, .

LATEX

86

5.7

.
\rule[lift]{width}{height}

.
\rule{3mm}{.1pt}%
\rule[-1mm]{5mm}{1cm}%
\rule{3mm}{.1pt}%
\rule[1mm]{1cm}{5mm}%
\rule{3mm}{.1pt}

.
\rule .
(\rule{0pt}{height})
. strut .
. tabular (row)
.
\begin{tabular}{|c|}
\hline
\rule{1pt}{4ex}Pitprop \ldots\\
\hline
\rule{0pt}{4ex}Strut\\
\hline
\end{tabular}

Pitprop . . .
Strut


[1] Leslie Lamport. LATEX: A Document Preparation System. AddisonWesley, Reading, Massachusetts, second edition, 1994, ISBN 0-20152983-1.
[2] Donald E. Knuth. The TEXbook, Volume A of Computers and Typesetting, Addison-Wesley, Reading, Massachusetts, second edition, 1984,
ISBN 0-201-13448-9.
[3] Michel Goossens, Frank Mittelbach and Alexander Samarin. The LATEX
Companion. Addison-Wesley, Reading, Massachusetts, 1994, ISBN 0201-54199-8.
[4] LATEX , LATEX Local Guide
, .
local.tex .
, LATEX
(LATEX guru) .
[5] LATEX3 Project Team. LATEX 2 for authors. usrguide.tex
LATEX 2 .
[6] LATEX3 Project Team. LATEX 2 for Class and Package writers.
clsguide.tex LATEX 2
.
[7] LATEX3 Project Team. LATEX 2 Font selection. fntguide.tex
LATEX 2 .
[8] D. P. Carlisle. Packages in the graphics bundle. grfguide.tex
graphics LATEX
.
[9] Rainer Schopf, Bernd Raichle, Chris Rowley. A New Implementation
of LATEXs verbatim Environments. verbatim.dtx tools

88
. LATEX
.
[10] Graham Williams. The TeX Catalogue TEX LATEX
.
CTAN:/help/Catalogue/catalogue.html .
[11] Keith Reckdahl. Using EPS Graphics in LATEX 2 Documents,
EPS LATEX
. CTAN:/info/epslatex.ps
.


\!, 49
", 22
$, 43
\(, 43
\), 43
\,, 44, 49
-, 23
, 23
\-, 21
, 23
, 23
., space after, 29
. . . , 24
.aux, 15
.cls, 14
.dtx, 14
.dvi, 15
.idx, 15
.ilg, 15
.ind, 15
.ins, 14
.lof, 15
.log, 15
.lot, 15
.sty, 14
.tex, 14
.toc, 15
\:, 49
\;, 49
\@, 29
\[, 43
\\, 20, 34, 35, 37, 80

\\*, 20
LATEX , 4
\], 43
~, 29
2, 12
acute, 25
\addtolength, 82
, 25
amsbsy, 55
amsfonts, 45, 62
amsmath, 4850, 52, 55
amssymb, 45, 56
\and, 31
\appendix, 30, 31
\arccos, 47
\arcsin, 47
\arctan, 47
\arg, 47
array, 50, 51
article , 11
\atop, 48
\author, 31
babel, 21, 25
\backmatter, 31
\backslash, 6
\begin, 34
\bibitem, 65
\Big, 49
\big, 49
\Bigg, 49
\bigg, 49

90
\bigskip, 80
\bimon, 48
bm, 55
\bmod, 47
bold face, 75
\boldmath, 55
\boldsymbol, 55
book , 11
calc, 82
\caption, 40, 42
\cdot, 47
\cdots, 49
center, 34
\chapter, 30
\chaptermark, 68, 69
\choose, 48
\ci, 71
\cite, 65
CJK , 28
\cleardoublepage, 41
\clearpage, 41
\cline, 37
comment, 7
\cos, 47
\cosh, 47
\cot, 47
\coth, 47
\csc, 47
\date, 31
dcolumn, 38
\ddots, 49
\deg, 47
\depth, 84, 85
description, 34
\det, 47
\dim, 47
displaymath, 44
\displaystyle, 53

doc, 13
\documentclass, 10, 14, 21
dotless and , 25
\dq, 27
\dum, 71
dvips, 10
\emph, 33, 75
empty, 11
Encapsulated PostScript, 63
\end, 34
enumerate, 34
eqnarray, 51
equation, 44
eucal, 62
eufrak, 62
\exp, 47
exscale, 13, 49
fancyhdr, 68, 69
\fbox, 22
figure, 39
\floatpagefraction, 41
flushleft, 34
flushright, 34
foiltex, 11
fontenc, 13, 27
\footnote, 32, 42
\footnotemark, 32
\footnotesize, 75
\footnotetext, 32
\frac, 47
\framebox, 85
\frenchspacing, 29
\frontmatter, 31
\fussy, 21
\gcd, 47
\genfrac, 48
geometry, 69
GhostScript, 63

91
graphicx, 63
grave, 25
HLATEX, 28
hLATEXp, 28
textttheadings, 11
\height, 84, 85
\hline, 37
\hom, 47
\hspace, 73, 79
\Huge, 75
\huge, 75
hyphenat, 69
\hyphenation, 21
\idotsint, 50
ifthen, 13
\iiiint, 50
\iiint, 50
\iint, 50
\include, 15, 16
\includegraphics, 64, 84
\includeonly, 16
\indent, 79
indentfirst, 79
\index, 67
\inf, 47
\input, 16
inputenc, 13, 26
\int, 48
italic, 75
itemize, 34
\ker, 47
Knuth, Donald E., 1
\label, 31, 44
Lamport, Leslie, 2
\LARGE, 75
\Large, 75
\large, 75

\LaTeX, 22
LATEX 2.09, 2
LATEX 2 , 2
LATEX3, 2, 5
\LaTeXe, 22
latexsym, 13
layout, 82
\ldots, 24, 49
\left, 48, 49
\leftmark, 68
\lg, 47
\lim, 47
\liminf, 47
\limsup, 47
\linebreak, 20
\linespread, 78
\listoffigures, 41
\listoftables, 41
\ln, 47
\log, 47
longtabular, 39
lscommand, 71
\mainmatter, 31
\makebox, 84, 85
makeidx, 13, 66
\makeindex, 66
\maketitle, 31
\markleft, 68
math, 43
\mathbb, 45
\mathbf, 76
\mathcal, 76
\mathit, 76
\mathnormal, 76
\mathrm, 53, 76
mathrsfs, 62
\mathsf, 76
\mathtt, 76
\max, 47

92
\mbox, 22, 24, 84
\min, 47
minipage, 84
Mittelbach, Frank, 2
\multicolumn, 38
\newcommand, 72, 73
\newenvironment, 73
\newline, 20
\newpage, 20
\newtheorem, 54
\noindent, 79
\nolinebreak, 20
\nonumber, 52
\nopagebreak, 20
\normalsize, 75
, 25
option, 10
\overbrace, 46
overfull hbox, 21
\overleftarrow, 47
\overline, 46
\overrightarrow, 47
\pagebreak, 20
\pageref, 31
\pagestyle, 11
\par, 75
\paragraph, 30
\parbox, 84
parbox, 84
\parindent, 78
\parskip, 78
\part, 30
\phantom, 42, 52
\pmod, 47
\Pr, 47
prime, 46
\printindex, 67
\protect, 42

\providecommand, 73
\ProvidesPackage, 74
\qquad, 44, 49
\quad, 44, 49
quotation, 35
quote, 35
\raisebox, 85
\ref, 31, 44
\renewcommand, 41, 72, 73
\renewenvironment, 73
report , 11
\right, 48, 49
\right., 49
\rightmark, 68
roman, 75
\rule, 73, 86
sans serif, 75
\scriptscriptstyle, 53
\scriptsize, 75
\scriptstyle, 53
\sec, 47
\section, 30, 42
\sectionmark, 68, 69
\setlength, 78, 82
\settodepth, 83
\settoheight, 83
\settowidth, 83
showidx, 67
\sin, 47
\sinh, 47
slanted, 75
slides , 11
\sloppy, 21
\small, 75
small caps, 75
\smallskip, 80
\sqrt, 46
\stackrel, 48

93
\stretch, 73, 79
strut, 86
\subparagraph, 30
\subsection, 30
\subsectionmark, 68, 69
\subsubsection, 30
\sum, 48
\sup, 47
supertabular, 38
syntonly, 13, 16
table, 39
\tableofcontents, 30
tabular, 37, 84
\tan, 47
\tanh, 47
\TeX, 22
\textbf, 75
textcomp, 23
\textit, 75
\textmd, 75
\textnormal, 75
\textrm, 53, 75
\textsc, 75
\textsf, 75
\textsl, 75
\textstyle, 53
\texttt, 75
\textup, 75
thebibliography, 65
\thispagestyle, 14
tilde, 23
tilde ( ~), 29
\tiny, 75
\title, 31
\tnss, 72
\today, 22
\totalheight, 84, 85
\underbrace, 46

underfull hbox, 21
\underline, 33, 46
upright, 75
URL, 23
\usepackage, 11, 14, 2527, 74
UTF-8 , 28
\vdots, 49
\vec, 47
\verb, 36
verbatim, 7, 69
verbatim, 36, 69
\verbatiminput, 69
verse, 35
\vspace, 80
\widehat, 46
\widetilde, 46
\width, 84, 85
www, 23
WYSIWYG, 3, 4
xdvi, 10
(square bracket), 7
, 5
, 6
, 5
, 48
, 8
, 55
, 46
, 46
, 10, 63
, 40
, 74
, 13
, 74, 75
, 12
, 23

94
(modulo), 47
, 12
, 79, 80
, 49
, 23
() , 23
, 26, 27
, 22
, 39
, 24
, 24
, 6
\!, 49
\(, 43
\), 43
\,, 44, 49
\-, 21
\:, 49
\;, 49
\@, 29
\[, 43
\\, 20, 34, 35, 37, 80
\\*, 20
\], 43
\addtolength, 82
\and, 31
\appendix, 30, 31
\arccos, 47
\arcsin, 47
\arctan, 47
\arg, 47
\atop, 48
\author, 31
\backmatter, 31
\backslash, 6
\begin, 34
\bibitem, 65

\Big, 49
\big, 49
\Bigg, 49
\bigg, 49
\bigskip, 80
\bimon, 48
\bmod, 47
\boldmath, 55
\boldsymbol, 55
\caption, 40, 42
\cdot, 47
\cdots, 49
\chapter, 30
\chaptermark, 68, 69
\choose, 48
\ci, 71
\cite, 65
\cleardoublepage, 41
\clearpage, 41
\cline, 37
\cos, 47
\cosh, 47
\cot, 47
\coth, 47
\csc, 47
\date, 31
\ddots, 49
\deg, 47
\depth, 84, 85
\det, 47
\dim, 47
\displaystyle, 53
\documentclass, 10, 14, 21
\dq, 27
\dum, 71
\emph, 33, 75
\end, 34
\exp, 47
\fbox, 22
\floatpagefraction, 41

95
\footnote, 32, 42
\footnotemark, 32
\footnotesize, 75
\footnotetext, 32
\frac, 47
\framebox, 85
\frenchspacing, 29
\frontmatter, 31
\fussy, 21
\gcd, 47
\genfrac, 48
\height, 84, 85
\hline, 37
\hom, 47
\hspace, 73, 79
\Huge, 75
\huge, 75
\hyphenation, 21
\idotsint, 50
\iiiint, 50
\iiint, 50
\iint, 50
\include, 15, 16
\includegraphics, 64, 84
\includeonly, 16
\indent, 79
\index, 67
\inf, 47
\input, 16
\int, 48
\ker, 47
\label, 31, 44
\LARGE, 75
\Large, 75
\large, 75
\LaTeX, 22
\LaTeXe, 22
\ldots, 24, 49
\left, 48, 49
\leftmark, 68

\lg, 47
\lim, 47
\liminf, 47
\limsup, 47
\linebreak, 20
\linespread, 78
\listoffigures, 41
\listoftables, 41
\ln, 47
\log, 47
\mainmatter, 31
\makebox, 84, 85
\makeindex, 66
\maketitle, 31
\markleft, 68
\mathbb, 45
\mathbf, 76
\mathcal, 76
\mathit, 76
\mathnormal, 76
\mathrm, 53, 76
\mathsf, 76
\mathtt, 76
\max, 47
\mbox, 22, 24, 84
\min, 47
\multicolumn, 38
\newcommand, 72, 73
\newenvironment, 73
\newline, 20
\newpage, 20
\newtheorem, 54
\noindent, 79
\nolinebreak, 20
\nonumber, 52
\nopagebreak, 20
\normalsize, 75
\overbrace, 46
\overleftarrow, 47
\overline, 46

96
\overrightarrow, 47
\pagebreak, 20
\pageref, 31
\pagestyle, 11
\par, 75
\paragraph, 30
\parbox, 84
\parindent, 78
\parskip, 78
\part, 30
\phantom, 42, 52
\pmod, 47
\Pr, 47
\printindex, 67
\protect, 42
\providecommand, 73
\ProvidesPackage, 74
\qquad, 44, 49
\quad, 44, 49
\raisebox, 85
\ref, 31, 44
\renewcommand, 41, 72, 73
\renewenvironment, 73
\right, 48, 49
\right., 49
\rightmark, 68
\rule, 73, 86
\scriptscriptstyle, 53
\scriptsize, 75
\scriptstyle, 53
\sec, 47
\section, 30, 42
\sectionmark, 68, 69
\setlength, 78, 82
\settodepth, 83
\settoheight, 83
\settowidth, 83
\sin, 47
\sinh, 47
\sloppy, 21

\small, 75
\smallskip, 80
\sqrt, 46
\stackrel, 48
\stretch, 73, 79
\subparagraph, 30
\subsection, 30
\subsectionmark, 68, 69
\subsubsection, 30
\sum, 48
\sup, 47
\tableofcontents, 30
\tan, 47
\tanh, 47
\TeX, 22
\textbf, 75
\textit, 75
\textmd, 75
\textnormal, 75
\textrm, 53, 75
\textsc, 75
\textsf, 75
\textsl, 75
\textstyle, 53
\texttt, 75
\textup, 75
\thispagestyle, 14
\tiny, 75
\title, 31
\tnss, 72
\today, 22
\totalheight, 84, 85
\underbrace, 46
\underline, 33, 46
\usepackage, 11, 14, 2527,
74
\vdots, 49
\vec, 47
\verb, 36
\verbatiminput, 69

97
\vspace, 80
\widehat, 46
\widetilde, 46
\width, 84, 85
, 17
, 10
(tilde), 46
, 6
, 47
, 45
, 23
, 31
, 6
, 49
, 49
, 38
, 43
, 51
, 80

, 79
, 49
, 46
, 46

, 49
, 51
, 23
, 47
, 53
, 46
, 49
, 47
, 24
, 25
, 5
, 48

, 46
, 12
, 24
, 25
, 25
, 27
, 34

A4 paper, 12
A5 paper, 12
B5 paper, 12
executive paper, 12
legal paper, 12
letter paper, 12
, 12
, 25
, 46
, 6
(parameter), 6
, 8
, 48
, 8
, 46
, 7
, 78
, 78
, 20
, 46
, 11
empty, 11
headings, 11
, 11
, 11
, 30
, 66
, 10

98
, 12
, 24
, 14
, 8, 10, 71
amsbsy, 55
amsfonts, 45, 62
amsmath, 4850, 52, 55
amssymb, 45, 56
babel, 21, 25
bm, 55
calc, 82
dcolumn, 38
doc, 13
eucal, 62
eufrak, 62
exscale, 13, 49
fancyhdr, 68, 69
fontenc, 13, 27
geometry, 69
graphicx, 63
hyphenat, 69
ifthen, 13
indentfirst, 79
inputenc, 13, 26
latexsym, 13
layout, 82
longtabular, 39
makeidx, 66
makeidx, 13, 66
mathrsfs, 62
showidx, 67
supertabular, 38
syntonly, 13, 16
textcomp, 23
verbatim, 7, 69
, 80
, 11
, 63
, 37, 40

, 12
, 42

makeindex, 66
, 23
, 27
, 28
UHC , 28
, 28
, 27
, 48
, 14

array, 50, 51
center, 34
comment, 7
description, 34
displaymath, 44
enumerate, 34
eqnarray, 51
equation, 44
figure, 39
flushleft, 34
flushright, 34
itemize, 34
lscommand, 71
math, 43
minipage, 84
parbox, 84
quotation, 35
quote, 35
table, 39
tabular, 37, 84
thebibliography, 65
verbatim, 36, 69
verse, 35
, 40
, 37, 40


LATEX .
( 100 ),

.
,
. , lshort
(
,
.), lshort
,
,
.
, 1
.
, , LATEX
.
,
, 3.01 .
,
lshort (!) .
3.07 , LATEX
. .
LATEX
.
3.07 .
, CTAN .
KTUG( TeX ) ,

.
1

http://www.doeun.pe.kr

100

3.07 .
1 (berise) , 2
(3.19) ,
. 3.07
.
LATEX .
TEX ,
.
.
. , LATEX 2
LATEX .
, LATEX 2
LATEX ,
. LATEX
. ,
TEX .
LATEX
.
.
.
3.07 .
, LATEX
.
.
( 2.5.2 ) .
Tobias Oetiker ( 2.5.1 )
,
.
.
PDF KTUG TTF
, hyperlink
.
lshort .
. 3.07
, ,
. ,

101
, , KTUG
ChoF . LATEX
. LATEX .
.
.
3.07 : (karnes@doeun.pe.kr), (pear@postech.ac.kr),
(webmaster@texworld.pe.kr), (dbunix@kitinet.co.kr)
3.20 : (karnes@doeun.pe.kr), , ,
...
karnes@doeun.pe.kr

102


83
(width), (height), (depth)
.2
6

height
total height
reference point

?
6

baseline

depth
?

width

23
,
V. []
1. ()
.
(1) .
[]
.
(2) .
[] , .
,
.
2. (-)
(1) , ,
.
(2) .

You might also like