-
Notifications
You must be signed in to change notification settings - Fork 5
/
punctuation.tex
157 lines (143 loc) · 5.23 KB
/
punctuation.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
\chapter{Punctuation}
\label{punctuation}
You would rather encounter a panda that eats
shoots and leaves than one that eats, shoots,
and leaves.\punckern\endnote{Lynne Truss,
\textit{Eats, Shoots \& Leaves} (New York, 2003)}
Punctuation is a vital part of writing,
and there's more to it than your keyboard suggests.
\section{Quotation marks}
\LaTeX{} doesn't automatically convert \texttt{"}straight\texttt{"} quotes
into correctly-facing ``curly'' ones:
\begin{leftfigure}
\begin{lstlisting}
"This isn't right."
\end{lstlisting}
\end{leftfigure}
will get you
\begin{leftfigure}
\lm%
"This isn't right."
\end{leftfigure}
Instead, use \texttt{\bfseries `} for opening quotes and \texttt{\bfseries '} for closing
quotes.\punckern\footnote{If your keyboard happens to have keys for
``curly'' quotes (\,\texttt{“}\,\texttt{”}\,), feel free to use those instead!
And don't use \texttt{"} for closing double quotes.
Not only does \texttt{``example"} look a bit unbalanced,
but \texttt{"} is used as a formatting command for some languages,
like German.
(See \chapref{i18n} for more on international typesetting.)}
\begin{leftfigure}
\begin{lstlisting}
``It depends on what the meaning of the word `is' is.''
\end{lstlisting}
\end{leftfigure}
quotes a former \acronym{us} president as,
\begin{leftfigure}
\lm%
``It depends on what the meaning of the word `is' is.''
\end{leftfigure}
\section{Hyphens and dashes}
Though they look similar,
hyphens (\,-\,), en dashes (\,--\,),
em dashes (\,---\,), and minus signs (\,$-$\,)
serve different purposes.
\begin{description}
\item[Hyphens] have a few applications:\endnote{Matthew Butterick,
``Hyphens and dashes''\quotekern,
\textit{Practical Typography},
\https{practicaltypography.com/hyphens-and-dashes.html}}
\begin{itemize}[leftmargin=*]
\item They allow words to be split across the end of one line and the
start of the next.
\LaTeX{} does this automatically.
\item Compound words like \emph{long-range} and \emph{field-effect}
use hyphens.
\item They are used in phrasal adjectives.
If I ask for ``five dollar bills''\quotekern,
do I want five \$1 bills, or several \$5 bills?
\emph{Five-dollar bills} makes it clearer that I want the latter.
\end{itemize}
Unsurprisingly, you get one by typing the hyphen character (\,\texttt{-}\,).
\item[En dashes] are for ranges such as ``pages 4--12''\quotekern,
and connected words, like ``the \mbox{US--Canada} border''\quotekern.
\LaTeX{} places one wherever you enter two adjacent hyphens
(\,\texttt{--}\,).
\item[Em dashes] separate clauses of a sentence.
Other punctuation---like parenthesis and commas---play a similar
role.
Em dashes are typeset with three hyphens (\,\texttt{---}\,).
\item[Minus signs] are for negative quantities and
mathematical expressions.
They are similar in length to an en dash,
but sit at a different height.
Minus signs are set with \verb|\textminus|,
or with the hyphen character
when in a math environment (see \chapref{math}).
\end{description}
\section{Ellipses}
A set of three dots which indicate a pause or omission is called an
\introduce{ellipsis}.
It is set with \verb|\dots|.
\begin{leftfigure}
\begin{lstlisting}
I'm\dots{} not sure.
\end{lstlisting}
\end{leftfigure}
becomes
\begin{leftfigure}
\lm%
I'm\dots{} not sure.
\end{leftfigure}
Ellipses have different spacing than consecutive periods.
Don't use the latter as a poor substitute for the former.
\section{Spacing}
As we discovered in \chapref{hello},
\LaTeX{} inserts additional space between periods and whatever
follows them---presumably the start of the next sentence.
This isn't always what we want!
Consider honorifics like Mr.\ and Ms., for example.
In these situations, we also need to prevent \LaTeX{} from starting a
new line after the period.
This calls for a \introduce{non-breaking space}, which we set with a tilde.
\begin{leftfigure}
\begin{lstlisting}
Please call Ms.~Shrdlu.
\end{lstlisting}
\end{leftfigure}
produces proper spacing:
\begin{leftfigure}
\lm%
Please call Ms.~Shrdlu.
\end{leftfigure}
In other occasions, like when we abbreviate units of
measurement,\punckern\footnote{There are also dedicated packages for doing so,
like \texttt{siunitx}.}
we want thinner spaces than our usual inter-word ones.
For these, we use \verb|\,|\,:
\begin{leftfigure}
\begin{lstlisting}
Launch in 2\,h 10\,m.
\end{lstlisting}
\end{leftfigure}
announces
\begin{leftfigure}
\lm%
Launch in 2\,h 10\,m.
\end{leftfigure}
\exercises{}
\begin{itemize}
\item Learn more commands for spacing, such as \verb|\:|, \verb|\;|,
\verb|\enspace|, and \verb|\quad|.
\item Nest quotations, e.g.,
\enquote{She exclaimed, \enquote{I can't believe it!}}
more easily with \texttt{csquotes} package's \verb|\enquote| command.
\item Discover the typographical origins of terms like \introduce{en},
\introduce{em}, and \introduce{quad}.
\item Familiarize yourself with the difference between \texttt{/} and
\verb|\slash|.
\item Add hyphenations for uncommon words using \verb|\hyphenate|
or \verb|\-|\,.\punckern\footnote{\LaTeX{} usually does a great
job of automatically hyphenating words, based on a dictionary of patterns
stored for each language. You should rarely need these commands.}
\end{itemize}