A Sample L
A
T
E
X Document
Schlo
.
n oogen, L ars
July 14, 1992
IMPORTANT STUFF
IMPORTANT STUFF
IMPORTANT STUFF
This is a document produced by the L
A
T
E
Xsoftware, and generated by the source le [Link].
Compare the source text le (left-hand sides) with the document it produces using L
A
T
E
X(right-
hand sides).
1 Ordinary Text
1.1 Spacing in the source text
The ends of words and sentences are marked by spaces. It doesnt matter how many spaces you
type; one is as good as 100. The end of a line counts as a space.
One or more blank lines denote the end of a paragraph.
Since any number of consecutive spaces are treated like a single one, the formatting of the
input le makes no dierence to T
E
X, but it makes a dierence to you. When you use L
A
T
E
X,
making your input le as easy to read as possible will be a great help as you write your document
and when you change it. Keep typed lines short in length, and use % comments.
Because printing is dierent from typewriting, there are a number of things that you have
to do dierently when preparing an input le than if you were just typing the document directly.
Quotation marks like this have to be handled specially.
1.2 Special characters
Dashes come in three sizes: an intra-word dash, a medium dash for number ranges like 12, and
a punctuation dashlike this.
T
E
X interprets some common characters as commands, so you must type special commands
to generate them. These characters include the following: $ & % # and .
1
1.3 Fonts
In printing, text is emphasized by using an italic type style. A long segment of text can also be
emphasized in this way. Text within such a segment given additional emphasis with Roman type.
Italic type loses its ability to emphasize and become simply distracting when used excessively.
Other font types are available:
Bold face type,
typewriter style type,
sans-serif type,
slanted type,
all caps type.
Formulae and other mathematical expressions are given their own math mode font.
2 Spacing
A sentence-ending space should be larger than the space between words within a sentence. You
sometimes have to type special commands in conjunction with punctuation characters to get this
right, as in the following sentence. Gnats, gnus, etc. all begin with G. Generating an ellipsis . . .
with the right spacing around the periods requires a special command.
It is sometimes necessary to prevent T
E
X from breaking a line where it might otherwise do so.
This may be at a space, as between the Mr. and Jones in Mr. Jones, or within a word
especially when the word is a symbol like itemnum that makes little sense when hyphenated across
lines.
In math mode, T
E
X ignores the spaces you type and formats the formula the way it thinks is
best. Some authors feel that T
E
X cramps formulae, and they want to add more space; however,
T
E
X knows more about typesetting formulae than do many authors. Adding extra space usually
makes a formula prettier but harder to read, because it visually fractures the formula into separate
units.
Though ddling with the spacing is dangerous, you sometimes have to do it to make a formula
look just right. One reason is that T
E
X may not understand the formulas logical structure,
interpreting (for example) y dx as the product of three quantities rather than as y times the
dierential dx, so that it doesnt add the little extra space after the y. You can dene your own
commands to take care of such cases, or use these special spacing commands:
\, thin space (any mode)
\: medium space (math mode only)
\; thick space (math mode only)
\! thin backspace (math mode only)
A most precise spacing command can be used in either math or paragraph modes; the \kern
command. Use it with the unit em, which is the width of a capital M. Example: to print R
over an I you might use the command I\kern-0.27emR to produce IR.
2
3 Displayed Text
Text is displayed by indenting it from the left margin. Quotations are commonly displayed. There
are short quotations
This is a short a quotation. It consists of a single paragraph of text. There is no
paragraph indentation.
and longer ones.
This is a longer quotation. It consists of two paragraphs of text. The beginning of
each paragraph is indicated by an extra indentation.
This is the second paragraph of the quotation. It is just as dull as the rst para-
graph.
Footnotes
1
pose no problem. Likewise, bibliographic references [1] are handled with ease.
T
E
X can g`enerate almost all the accents and spe cial symbols used in Western [2] languages!
Likewise, its arsenal of mathematical symols, introduced below, is formidable.
Another frequently-displayed structure is a list. The following is an example of an itemized
list.
This is the rst item of an itemized list. Each item in the list is marked with a tick. The
document style determines what kind of tick mark is used.
This is the second item of the list. Need there be more?
4 Mathematical Formulae
T
E
X is good at typesetting mathematical formulas like x 3y = 7 or y
i+1
= x
2n
i
5x
n
i
+ 1.
Remember that a letter like x is a formula when it denotes a mathematical symbol, and should
be treated as one.
Mathematical formulas may also be displayed. A displayed formula is one-line long; multiline
formulas require special formatting instructions. The following formulae demonstrate many con-
structions you might nd useful. Refer to equation (1), which is probably true, while equations
(2-4) are silly. Note that the equation and eqnarray environments number the equations, but
eqnarray* doesnt.
x
i+1
= N
i+1
(x
0
) = N(x
i
) = x
i
f(x
i
)
f
(x
i
)
u
t
+
4
u +
2
u +
1
2
[u[
2
= c
2
1
This is an example of a footnote.
3
a
p
+ b
p
,= c
p
for p > 2 (see proof in margin) (1)
lim
n
x
n
x O such that [y x[ < y O
=
d
d
3
1
2
2
1
/2
0 1 0
2
0
3
1
1 0
0
e
x
2
dx = e
(
0
xdx)
2
(2)
= e
(bogus) (3)
= 0.38 1.7i (not!) (4)
k
n=1
1
n
ln k +
= (ln 10)(log
10
k) +
2.3026 log
10
k + 0.57772
k x
k
1
x
k
2
x
k
3
0 -0.30000000 0.60000000 0.70000000
1 0.47102965 0.04883157 -0.53345964
2 0.49988691 0.00228830 -0.52246185
3 0.49999976 0.00005380 -0.52365600
4 0.50000000 0.00000307 -0.52359743
5 0.50000000 0.00000007 -0.52359885
6 0.50000000 0.00000000 -0.52359877
7 0.50000000 0.00000000 -0.52359878
Unary operators plus and minus just use exponentiation:
+
0.168 or
1.168
| |
2
2
C
f(z)dz
v,
7
V
W
4
References
[1] Lamport, Leslie. L
A
T
E
X: A Document Preparation System.
Copyright c _1986, Addison-Wesley [Link].,Inc.
[2] Schlo
.
n oogen, L ars. Silly Typography.
Journal of Linguistic Horseplay 19D (1977), 23-37.
5