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
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
|
<!DOCTYPE html>
<html>
<!-- Created by GNU Texinfo 7.0.3, https://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!-- This manual documents GNU troff version 1.23.0.
Copyright � 1994-2023 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with no
Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A
copy of the license is included in the section entitled "GNU Free
Documentation License". -->
<title>Delimiters (The GNU Troff Manual)</title>
<meta name="description" content="Delimiters (The GNU Troff Manual)">
<meta name="keywords" content="Delimiters (The GNU Troff Manual)">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link href="index.html" rel="start" title="Top">
<link href="Request-Index.html" rel="index" title="Request Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Formatter-Instructions.html" rel="up" title="Formatter Instructions">
<link href="Using-Escape-Sequences.html" rel="prev" title="Using Escape Sequences">
<style type="text/css">
<!--
div.example {margin-left: 3.2em}
kbd.key {font-style: normal}
ul.mark-bullet {list-style-type: disc}
-->
</style>
</head>
<body lang="en">
<div class="subsection-level-extent" id="Delimiters">
<div class="nav-panel">
<p>
Previous: <a href="Using-Escape-Sequences.html" accesskey="p" rel="prev">Using Escape Sequences</a>, Up: <a href="Formatter-Instructions.html" accesskey="u" rel="up">Formatter Instructions</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Request-Index.html" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<h4 class="subsection" id="Delimiters-1">5.6.5 Delimiters</h4>
<a class="index-entry-id" id="index-delimiting-escape-sequence-arguments"></a>
<a class="index-entry-id" id="index-escape-sequence-argument-delimiters"></a>
<a class="index-entry-id" id="index-delimiters_002c-for-escape-sequence-arguments"></a>
<a class="index-entry-id" id="index-arguments_002c-to-escape-sequences_002c-delimiting"></a>
<a class="index-entry-id" id="index-_0027_002c-as-delimiter"></a>
<a class="index-entry-id" id="index-_0022_002c-as-delimiter"></a>
<p>Some escape sequences that require parameters use delimiters. The
neutral apostrophe <code class="code">'</code> is a popular choice and shown in this
document. The neutral double quote <code class="code">"</code> is also commonly seen.
Letters, numerals, and leaders can be used. Punctuation characters
are likely better choices, except for those defined as infix operators
in numeric expressions; see below.
</p>
<div class="example">
<div class="group"><pre class="example-preformatted">\l'1.5i\[bu]' \" draw 1.5 inches of bullet glyphs
</pre></div></div>
<a class="index-entry-id" id="index-_005c_0025_002c-as-delimiter"></a>
<a class="index-entry-id" id="index-_005cSP_002c-as-delimiter"></a>
<a class="index-entry-id" id="index-_005c_007c_002c-as-delimiter"></a>
<a class="index-entry-id" id="index-_005c_005e_002c-as-delimiter"></a>
<a class="index-entry-id" id="index-_005c_007b_002c-as-delimiter"></a>
<a class="index-entry-id" id="index-_005c_007d_002c-as-delimiter"></a>
<a class="index-entry-id" id="index-_005c_0027_002c-as-delimiter"></a>
<a class="index-entry-id" id="index-_005c_0060_002c-as-delimiter"></a>
<a class="index-entry-id" id="index-_005c_002d_002c-as-delimiter"></a>
<a class="index-entry-id" id="index-_005c_005f_002c-as-delimiter"></a>
<a class="index-entry-id" id="index-_005c_0021_002c-as-delimiter"></a>
<a class="index-entry-id" id="index-_005c_003f_002c-as-delimiter"></a>
<a class="index-entry-id" id="index-_005c_0029_002c-as-delimiter"></a>
<a class="index-entry-id" id="index-_005c_002f_002c-as-delimiter"></a>
<a class="index-entry-id" id="index-_005c_002c_002c-as-delimiter"></a>
<a class="index-entry-id" id="index-_005c_0026_002c-as-delimiter"></a>
<a class="index-entry-id" id="index-_005c_003a_002c-as-delimiter"></a>
<a class="index-entry-id" id="index-_005c_007e_002c-as-delimiter"></a>
<a class="index-entry-id" id="index-_005c0_002c-as-delimiter"></a>
<a class="index-entry-id" id="index-_005ca_002c-as-delimiter"></a>
<a class="index-entry-id" id="index-_005cc_002c-as-delimiter"></a>
<a class="index-entry-id" id="index-_005cd_002c-as-delimiter"></a>
<a class="index-entry-id" id="index-_005ce_002c-as-delimiter"></a>
<a class="index-entry-id" id="index-_005cE_002c-as-delimiter"></a>
<a class="index-entry-id" id="index-_005cp_002c-as-delimiter"></a>
<a class="index-entry-id" id="index-_005cr_002c-as-delimiter"></a>
<a class="index-entry-id" id="index-_005ct_002c-as-delimiter"></a>
<a class="index-entry-id" id="index-_005cu_002c-as-delimiter"></a>
<p>The following escape sequences don’t take arguments and thus are allowed
as delimiters:
<code class="code">\<kbd class="key">SP</kbd></code>, <code class="code">\%</code>, <code class="code">\|</code>, <code class="code">\^</code>, <code class="code">\{</code>,
<code class="code">\}</code>, <code class="code">\'</code>, <code class="code">\`</code>, <code class="code">\-</code>, <code class="code">\_</code>, <code class="code">\!</code>,
<code class="code">\?</code>, <code class="code">\)</code>, <code class="code">\/</code>, <code class="code">\,</code>, <code class="code">\&</code>, <code class="code">\:</code>,
<code class="code">\~</code>, <code class="code">\0</code>, <code class="code">\a</code>, <code class="code">\c</code>, <code class="code">\d</code>, <code class="code">\e</code>,
<code class="code">\E</code>, <code class="code">\p</code>, <code class="code">\r</code>, <code class="code">\t</code>, and <code class="code">\u</code>. However,
using them this way is discouraged; they can make the input confusing to
read.
</p>
<a class="index-entry-id" id="index-_005cA_002c-delimiters-allowed-by"></a>
<a class="index-entry-id" id="index-_005cb_002c-delimiters-allowed-by"></a>
<a class="index-entry-id" id="index-_005co_002c-delimiters-allowed-by"></a>
<a class="index-entry-id" id="index-_005cw_002c-delimiters-allowed-by"></a>
<a class="index-entry-id" id="index-_005cX_002c-delimiters-allowed-by"></a>
<a class="index-entry-id" id="index-_005cZ_002c-delimiters-allowed-by"></a>
<a class="index-entry-id" id="index-newline_002c-as-delimiter"></a>
<p>A few escape sequences,
<code class="code">\A</code>,
<code class="code">\b</code>,
<code class="code">\o</code>,
<code class="code">\w</code>,
<code class="code">\X</code>,
and <code class="code">\Z</code>, accept a newline as a delimiter. Newlines that serve
as delimiters continue to be recognized as input line terminators.
</p>
<div class="example">
<div class="group"><pre class="example-preformatted">A caf\o
e\(aa
in Paris
⇒ A caf� in Paris
</pre></div></div>
<p>Use of newlines as delimiters in escape sequences is also discouraged.
</p>
<a class="index-entry-id" id="index-_005cD_002c-delimiters-allowed-by"></a>
<a class="index-entry-id" id="index-_005ch_002c-delimiters-allowed-by"></a>
<a class="index-entry-id" id="index-_005cH_002c-delimiters-allowed-by"></a>
<a class="index-entry-id" id="index-_005cl_002c-delimiters-allowed-by"></a>
<a class="index-entry-id" id="index-_005cL_002c-delimiters-allowed-by"></a>
<a class="index-entry-id" id="index-_005cN_002c-delimiters-allowed-by"></a>
<a class="index-entry-id" id="index-_005cR_002c-delimiters-allowed-by"></a>
<a class="index-entry-id" id="index-_005cs_002c-delimiters-allowed-by"></a>
<a class="index-entry-id" id="index-_005cS_002c-delimiters-allowed-by"></a>
<a class="index-entry-id" id="index-_005cv_002c-delimiters-allowed-by"></a>
<a class="index-entry-id" id="index-_005cx_002c-delimiters-allowed-by"></a>
<p>Finally, the escape sequences <code class="code">\D</code>, <code class="code">\h</code>, <code class="code">\H</code>,
<code class="code">\l</code>, <code class="code">\L</code>, <code class="code">\N</code>, <code class="code">\R</code>, <code class="code">\s</code>, <code class="code">\S</code>,
<code class="code">\v</code>, and <code class="code">\x</code> prohibit many delimiters.
</p>
<ul class="itemize mark-bullet">
<li><a class="index-entry-id" id="index-numerals_002c-as-delimiters"></a>
<a class="index-entry-id" id="index-digits_002c-as-delimiters"></a>
<a class="index-entry-id" id="index-_002e_002c-as-delimiter"></a>
<a class="index-entry-id" id="index-decimal-point_002c-as-delimiter"></a>
<a class="index-entry-id" id="index-dot_002c-as-delimiter"></a>
the numerals <code class="code">0</code>-<code class="code">9</code> and the decimal point <code class="code">.</code>
</li><li><a class="index-entry-id" id="index-operators_002c-as-delimiters"></a>
<a class="index-entry-id" id="index-_002b_002c-as-delimiter"></a>
<a class="index-entry-id" id="index-_002d_002c-as-delimiter"></a>
<a class="index-entry-id" id="index-_002f_002c-as-delimiter"></a>
<a class="index-entry-id" id="index-_002a_002c-as-delimiter"></a>
<a class="index-entry-id" id="index-_0025_002c-as-delimiter"></a>
<a class="index-entry-id" id="index-_003c_002c-as-delimiter"></a>
<a class="index-entry-id" id="index-_003e_002c-as-delimiter"></a>
<a class="index-entry-id" id="index-_003d_002c-as-delimiter"></a>
<a class="index-entry-id" id="index-_0026_002c-as-delimiter"></a>
<a class="index-entry-id" id="index-_003a_002c-as-delimiter"></a>
<a class="index-entry-id" id="index-_0028_002c-as-delimiter"></a>
<a class="index-entry-id" id="index-_0029_002c-as-delimiter"></a>
the (single-character) operators ‘<samp class="samp">+-/*%<>=&:()</samp>’
</li><li><a class="index-entry-id" id="index-space-character_002c-as-delimiter"></a>
<a class="index-entry-id" id="index-tab-character_002c-as-delimiter"></a>
the space and tab characters
</li><li><a class="index-entry-id" id="index-_005c_0025_002c-as-delimiter-1"></a>
<a class="index-entry-id" id="index-_005c_003a_002c-as-delimiter-1"></a>
<a class="index-entry-id" id="index-_005c_007b_002c-as-delimiter-1"></a>
<a class="index-entry-id" id="index-_005c_007d_002c-as-delimiter-1"></a>
<a class="index-entry-id" id="index-_005c_0027_002c-as-delimiter-1"></a>
<a class="index-entry-id" id="index-_005c_0060_002c-as-delimiter-1"></a>
<a class="index-entry-id" id="index-_005c_002d_002c-as-delimiter-1"></a>
<a class="index-entry-id" id="index-_005c_005f_002c-as-delimiter-1"></a>
<a class="index-entry-id" id="index-_005c_0021_002c-as-delimiter-1"></a>
<a class="index-entry-id" id="index-_005c_002f_002c-as-delimiter-1"></a>
<a class="index-entry-id" id="index-_005cc_002c-as-delimiter-1"></a>
<a class="index-entry-id" id="index-_005ce_002c-as-delimiter-1"></a>
<a class="index-entry-id" id="index-_005cp_002c-as-delimiter-1"></a>
any escape sequences other than <code class="code">\%</code>, <code class="code">\:</code>, <code class="code">\{</code>,
<code class="code">\}</code>, <code class="code">\'</code>, <code class="code">\`</code>, <code class="code">\-</code>, <code class="code">\_</code>, <code class="code">\!</code>,
<code class="code">\/</code>, <code class="code">\c</code>, <code class="code">\e</code>, and <code class="code">\p</code>
</li></ul>
<p>Delimiter syntax is complex and flexible primarily for historical
reasons; the foregoing restrictions need be kept in mind mainly when
using <code class="code">groff</code> in <abbr class="acronym">AT&T</abbr> compatibility mode. GNU
<code class="code">troff</code> keeps track of the nesting depth of escape sequence
interpolations, so the only characters you need to avoid using as
delimiters are those that appear in the arguments you input, not any
that result from interpolation. Typically, <code class="code">'</code> works fine.
See <a class="xref" href="Implementation-Differences.html">Implementation Differences</a>.
</p>
<div class="example">
<div class="group"><pre class="example-preformatted">$ groff -Tps
.de Mw
. nr wd \w'\\$1'
. tm "\\$1" is \\n(wd units wide.
..
.Mw Wet'suwet'en
.Mw Wet+200i
.cp 1 \" turn on compatibility mode
.Mw Wet'suwet'en
.Mw Wet'
.Mw Wet+200i
error→ "Wet'suwet'en" is 54740 units wide.
error→ "Wet'+200i" is 42610 units wide.
error→ "Wet'suwet'en" is 15860 units wide.
error→ "Wet'" is 15860 units wide.
error→ "Wet'+200i" is 14415860 units wide.
</pre></div></div>
<p>We see here that in compatibility mode, the part of the argument after
the <code class="code">'</code> delimiter escapes from its context and, if nefariously
crafted, influences the computation of the <var class="var">wd</var> register’s value in
a surprising way.
</p>
</div>
<hr>
<div class="nav-panel">
<p>
Previous: <a href="Using-Escape-Sequences.html">Using Escape Sequences</a>, Up: <a href="Formatter-Instructions.html">Formatter Instructions</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Request-Index.html" title="Index" rel="index">Index</a>]</p>
</div>
</body>
</html>
|