Debian Codegraph @

texmf-dist/doc/pdftex/tests/38-interword-space-at-font-switch/sample2e.tex

raw
1 % This is a sample LaTeX input file. (Version of 12 August 2004.)
2 %
3 % A '%' character causes TeX to ignore all remaining text on the line,
4 % and is used for comments like this one.
5
6 \documentclass{article} % Specifies the document class
7
8 % The preamble begins here.
9 \title{An Example Document} % Declares the document's title.
10 \author{Leslie Lamport} % Declares the author's name.
11 \date{January 21, 1994} % Deleting this command produces today's date.
12
13 \newcommand{\ip}[2]{(#1, #2)}
14 % Defines \ip{arg1}{arg2} to mean
15 % (arg1, arg2).
16
17 %\newcommand{\ip}[2]{\langle #1 | #2\rangle}
18 % This is an alternative definition of
19 % \ip that is commented out.
20
21 \usepackage{microtype}
22 \begin{document}
23 \pdfcompresslevel=0
24 \pdfobjcompresslevel=0
25 \pdfinterwordspaceon
26
27 \maketitle % Produces the title.
28
29 This is an example input file. Comparing it with
30 the output it generates can show you how to
31 produce a simple document of your own.
32
33 \section{Ordinary Text} % Produces section heading. Lower-level
34 % sections are begun with similar
35 % \subsection and \subsubsection commands.
36
37 The ends of words and sentences are marked
38 by spaces. It doesn't matter how many
39 spaces you type; one is as good as 100. The
40 end of a line counts as a space.
41
42 One or more blank lines denote the end
43 of a paragraph.
44
45 Since any number of consecutive spaces are treated
46 like a single one, the formatting of the input
47 file makes no difference to
48 \LaTeX, % The \LaTeX command generates the LaTeX logo.
49 but it makes a difference to you. When you use
50 \LaTeX, making your input file as easy to read
51 as possible will be a great help as you write
52 your document and when you change it. This sample
53 file shows how you can add comments to your own input
54 file.
55
56 Because printing is different from typewriting,
57 there are a number of things that you have to do
58 differently when preparing an input file than if
59 you were just typing the document directly.
60 Quotation marks like
61 ``this''
62 have to be handled specially, as do quotes within
63 quotes:
64 ``\,`this' % \, separates the double and single quote.
65 is what I just
66 wrote, not `that'\,''.
67
68 Dashes come in three sizes: an
69 intra-word
70 dash, a medium dash for number ranges like
71 1--2,
72 and a punctuation
73 dash---like
74 this.
75
76 A sentence-ending space should be larger than the
77 space between words within a sentence. You
78 sometimes have to type special commands in
79 conjunction with punctuation characters to get
80 this right, as in the following sentence.
81 Gnats, gnus, etc.\ all % `\ ' makes an inter-word space.
82 begin with G\@. % \@ marks end-of-sentence punctuation.
83 You should check the spaces after periods when
84 reading your output to make sure you haven't
85 forgotten any special cases. Generating an
86 ellipsis
87 \ldots\ % `\ ' is needed after `\ldots' because TeX
88 % ignores spaces after command names like \ldots
89 % made from \ + letters.
90 %
91 % Note how a `%' character causes TeX to ignore
92 % the end of the input line, so these blank lines
93 % do not start a new paragraph.
94 %
95 with the right spacing around the periods requires
96 a special command.
97
98 \LaTeX\ interprets some common characters as
99 commands, so you must type special commands to
100 generate them. These characters include the
101 following:
102 \$ \& \% \# \{ and \}.
103
104 In printing, text is usually emphasized with an
105 \emph{italic}
106 type style.
107
108 \begin{em}
109 A long segment of text can also be emphasized
110 in this way. Text within such a segment can be
111 given \emph{additional} emphasis.
112 \end{em}
113
114 It is sometimes necessary to prevent \LaTeX\ from
115 breaking a line where it might otherwise do so.
116 This may be at a space, as between the ``Mr.''\ and
117 ``Jones'' in
118 ``Mr.~Jones'', % ~ produces an unbreakable interword space.
119 or within a word---especially when the word is a
120 symbol like
121 \mbox{\emph{itemnum}}
122 that makes little sense when hyphenated across
123 lines.
124
125 Footnotes\footnote{This is an example of a footnote.}
126 pose no problem.
127
128 \LaTeX\ is good at typesetting mathematical formulas
129 like
130 \( x-3y + z = 7 \)
131 or
132 \( a_{1} > x^{2n} + y^{2n} > x' \)
133 or
134 \( \ip{A}{B} = \sum_{i} a_{i} b_{i} \).
135 The spaces you type in a formula are
136 ignored. Remember that a letter like
137 $x$ % $ ... $ and \( ... \) are equivalent
138 is a formula when it denotes a mathematical
139 symbol, and it should be typed as one.
140
141 \section{Displayed Text}
142
143 Text is displayed by indenting it from the left
144 margin. Quotations are commonly displayed. There
145 are short quotations
146 \begin{quote}
147 This is a short quotation. It consists of a
148 single paragraph of text. See how it is formatted.
149 \end{quote}
150 and longer ones.
151 \begin{quotation}
152 This is a longer quotation. It consists of two
153 paragraphs of text, neither of which are
154 particularly interesting.
155
156 This is the second paragraph of the quotation. It
157 is just as dull as the first paragraph.
158 \end{quotation}
159 Another frequently-displayed structure is a list.
160 The following is an example of an \emph{itemized}
161 list.
162 \begin{itemize}
163 \item This is the first item of an itemized list.
164 Each item in the list is marked with a ``tick''.
165 You don't have to worry about what kind of tick
166 mark is used.
167
168 \item This is the second item of the list. It
169 contains another list nested inside it. The inner
170 list is an \emph{enumerated} list.
171 \begin{enumerate}
172 \item This is the first item of an enumerated
173 list that is nested within the itemized list.
174
175 \item This is the second item of the inner list.
176 \LaTeX\ allows you to nest lists deeper than
177 you really should.
178 \end{enumerate}
179 This is the rest of the second item of the outer
180 list. It is no more interesting than any other
181 part of the item.
182 \item This is the third item of the list.
183 \end{itemize}
184 You can even display poetry.
185 \begin{verse}
186 There is an environment
187 for verse \\ % The \\ command separates lines
188 Whose features some poets % within a stanza.
189 will curse.
190
191 % One or more blank lines separate stanzas.
192
193 For instead of making\\
194 Them do \emph{all} line breaking, \\
195 It allows them to put too many words on a line when they'd rather be
196 forced to be terse.
197 \end{verse}
198
199 Mathematical formulas may also be displayed. A
200 displayed formula
201 is
202 one-line long; multiline
203 formulas require special formatting instructions.
204 \[ \ip{\Gamma}{\psi'} = x'' + y^{2} + z_{i}^{n}\]
205 Don't start a paragraph with a displayed equation,
206 nor make one a paragraph by itself.
207
208 \end{document} % End of document.