-
Notifications
You must be signed in to change notification settings - Fork 4
/
part2-1-5.xml
187 lines (187 loc) · 6.1 KB
/
part2-1-5.xml
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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
<?xml version="1.0" encoding="UTF-8"?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/xml; charset=utf-8"/>
<title>Punctuation</title>
<link rel="stylesheet" href="css/book.css" type="text/css"/>
</head>
<body>
<h3 id="punctuation">
Punctuation
</h3>
<p>
The <span class="lang">mdoc</span> language, in descending from the type-setting language <a class="lang term"
href="glossary.xml#roff">roff</a>, has significant type-setting capabilities. Punctuation is treated
specially in all <span class="lang">mdoc</span> documents, both in terms of macro and text lines.
</p>
<p>
The following characters are considered punctuation:
</p>
<table id="punctuation_table" class="tbl">
<col style="width: 5em;" />
<col />
<tbody>
<tr>
<td><span class="screen">!</span></td>
<td>ending sentence</td>
</tr>
<tr>
<td><span class="screen">"</span></td>
<td>ending enclosure</td>
</tr>
<tr>
<td><span class="screen">(</span></td>
<td>opening enclosure</td>
</tr>
<tr>
<td><span class="screen">)</span></td>
<td>ending enclosure</td>
</tr>
<tr>
<td><span class="screen">,</span></td>
<td>ending</td>
</tr>
<tr>
<td><span class="screen">.</span></td>
<td>ending sentence</td>
</tr>
<tr>
<td><span class="screen">:</span></td>
<td>ending</td>
</tr>
<tr>
<td><span class="screen">;</span></td>
<td>ending</td>
</tr>
<tr>
<td><span class="screen">?</span></td>
<td>ending sentence</td>
</tr>
<tr>
<td><span class="screen">[</span></td>
<td>opening enclosure</td>
</tr>
<tr>
<td><span class="screen">]</span></td>
<td>ending enclosure</td>
</tr>
<tr>
<td><span class="screen">|</span></td>
<td>intervening</td>
</tr>
</tbody>
</table>
<p>
These are treated specially by the formatter when used in macro lines and at the end of text lines.
</p>
<h4 id="sentential_punctuation">
Sentential Punctuation
</h4>
<blockquote>
<p>
End of Sentence, End of Line.
</p>
</blockquote>
<p>
The end of a sentence should always be at the end of a line. This way, the formatter can recognise a sentence by the
punctuation used and insert the correct amount of spaces. If supported by the output media (<a class="term"
href="glossary.xml#html">HTML</a>, for example, does not), all modern <span class="lang">mdoc</span>
formatters use <a class="term" href="glossary.xml#english_spacing">English spacing</a> to mark sentence boundaries.
The <q>ending sentence</q> punctuation in the <a href="#punctuation_table">punctuation table</a> marks an end of sentence.
</p>
<p>
In <a href="part2-1-1.xml#text_line">text lines</a>, sentence punctuation should always occur at the end of the line.
</p>
<div class="mdocin">
End of sentence.
<br />
End of line.
<br />
("Even with nested sentences.")
</div>
<p>
Note, in the last sentence, that the formatter will recognise sentence punctuation even when followed by <q>ending
enclosure</q> punctuation as noted in the <a href="#punctuation_table">punctuation table</a>.
</p>
<p>
However, take care that non-sentence punctuation, such as for abbreviations, does not happen to fall at
the line boundary.
</p>
<div class="mdocin">
Paging Dr.
<br />
Freud.
</div>
<p>
In this case, the formatter will interpret <span class="screen">Dr.</span> as ending a sentence. In this event, you can
either restructure your line or add a zero-width escape following the period.
</p>
<div class="mdocin">
Paging Dr.\&
<br />
Freud.
</div>
<p>
<a href="part2-1-1.xml#macro_line">Macro lines</a> are slightly more complicated. The same rules apply, but
punctuation marks must be separated by spaces. The formatter will understand the role of the punctuation and remove the
spaces accordingly, or reorder sentence and closing punctuation.
</p>
<div class="mdocin">
Text (parenthesised
<br />
.Em text ) .
<br />
.Qq Properly period-closed quotation .
</div>
<p>
The punctuation may be escaped by either a trailing escape, as in the text case, or a preceding escape. In this case it
is not considered punctuation, but regular text. Note that this will also cause an intervening space to be printed.
</p>
<div class="mdocin">
.Em End of sentence .
<br />
.Em Not end of sentence \&.
<br />
.Em Not end of sentence .\&
</div>
<h4>
Regular Punctuation
</h4>
<p>
Non-sentential text line punctuation — commas, parenthesis, quotes, etc.— is a matter of literal printing.
</p>
<div class="mdocin">
Some text (punctuation), another "clause".
</div>
<p>
The rules for macro lines are the same but for <a href="part2-1-4.xml#inline_macros">in-line macros</a>, which might
decorate individual terms with text. In this case, punctuation as a standalone argument is specially treated in that it
is not decorated, and whitespace removed according to the punctuation type (opening, closing).
</p>
<div class="mdocin">
.Em ( Nicely spaced and decorated . )
<br />
.Em (All text decorated, no end-of-sentence.)
<br />
.Em ( Text alright , excepting the period \&. )
</div>
<p>
In the second example, <span class="screen">(All</span> and <span class="screen">end-of-sentence.)</span> are considered
arguments, and thus not accommodated for in terms of punctuation. In the third, the period is escaped and thus
considered regular text.
</p>
<table class="nav">
<tbody>
<tr>
<td class="nav-contents"><a href="toc.xml">Contents</a></td>
<td class="nav-next"><a href="part2-1-6.xml">Next</a></td>
<td class="nav-home"><a href="http://manpages.bsd.lv/index.html">Home</a></td>
<td class="nav-history"><a href="http://manpages.bsd.lv/cgi-bin/cvsweb/part2-1-5.xml?cvsroot=manpages">History</a></td>
</tr>
</tbody>
</table>
<p class="edits">
Last edited by $Author$ on $Date$. Copyright © 2011, Kristaps Dzonsons. CC BY-SA.
</p>
</body>
</html>