summaryrefslogtreecommitdiffstats
path: root/doc/groff.html.node/Dummy-Characters.html
blob: 769574d0348ee4162ee8ffe187704665a14b6921 (plain)
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
<!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>Dummy Characters (The GNU Troff Manual)</title>

<meta name="description" content="Dummy Characters (The GNU Troff Manual)">
<meta name="keywords" content="Dummy Characters (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="Using-Fonts.html" rel="up" title="Using Fonts">
<link href="Italic-Corrections.html" rel="prev" title="Italic Corrections">
<style type="text/css">
<!--
a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em}
div.example {margin-left: 3.2em}
span.r {font-family: initial; font-weight: normal; font-style: normal}
span:hover a.copiable-link {visibility: visible}
strong.def-name {font-family: monospace; font-weight: bold; font-size: larger}
ul.mark-bullet {list-style-type: disc}
-->
</style>


</head>

<body lang="en">
<div class="subsection-level-extent" id="Dummy-Characters">
<div class="nav-panel">
<p>
Previous: <a href="Italic-Corrections.html" accesskey="p" rel="prev">Italic Corrections</a>, Up: <a href="Using-Fonts.html" accesskey="u" rel="up">Using Fonts</a> &nbsp; [<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="Dummy-Characters-1">5.19.10 Dummy Characters</h4>

<p>As discussed in <a class="ref" href="Requests-and-Macros.html">Requests and Macros</a>, the first character on an
input line is treated specially.  Further, formatting a glyph has many
consequences on formatter state (see <a class="pxref" href="Environments.html">Environments</a>).  Occasionally,
we want to escape this context or embrace some of those consequences
without actually rendering a glyph to the output.
</p>
<dl class="first-deffn">
<dt class="deffn" id="index-_005c_0026-1"><span class="category-def">Escape&nbsp;sequence: </span><span><strong class="def-name"><code class="t">\&amp;</code><span class="r"><i class="slanted"></i></span><code class="t"></code></strong><a class="copiable-link" href='#index-_005c_0026-1'> &para;</a></span></dt>
<dd><a class="index-entry-id" id="index-_005c_0026"></a>
<a class="index-entry-id" id="index-dummy-character-_0028_005c_0026_0029"></a>
<a class="index-entry-id" id="index-character_002c-dummy-_0028_005c_0026_0029"></a>
<p>Interpolate a dummy character, which is constitutive of output but
invisible.<a class="footnote" id="DOCF81" href="groff.html_fot.html#FOOT81"><sup>81</sup></a>  Its presence alters the interpretation context of a
subsequent input character, and enjoys several applications.
</p>
<ul class="itemize mark-bullet">
<li>Prevent insertion of extra space after an end-of-sentence character.

<div class="example">
<div class="group"><pre class="example-preformatted">Test.
Test.
    &rArr; Test.  Test.
Test.\&amp;
Test.
    &rArr; Test. Test.
</pre></div></div>

</li><li>Prevent recognition of a control character.

<div class="example">
<div class="group"><pre class="example-preformatted">.Test
    error&rarr; warning: macro 'Test' not defined
\&amp;.Test
    &rArr; .Test
</pre></div></div>

</li><li>Prevent kerning between two glyphs.


</li><li>Translate a character to &ldquo;nothing&rdquo;.

<div class="example">
<div class="group"><pre class="example-preformatted">.tr JIjiK\&amp;k\&amp;UVuv
Post universitum, alea jacta est, OK?
    &rArr; Post vniversitvm, alea iacta est, O?
</pre></div></div>
</li></ul>

<p>The dummy character escape sequence sees use in macro definitions as a
means of ensuring that arguments are treated as text even if they begin
with spaces or control characters.
</p>
<div class="example">
<div class="group"><pre class="example-preformatted">.de HD \&quot; typeset a simple bold heading
.  sp
.  ft B
\&amp;\\$1 \&quot; exercise: remove the \&amp;
.  ft
.  sp
..
.HD .\|.\|.\|surprised?
</pre></div></div>
</dd></dl>

<p>One way to think about the dummy character is to imagine placing the
symbol &lsquo;<samp class="samp">&amp;</samp>&rsquo; in the input at a certain location; if doing so has all
the side effects on formatting that you desire except for sticking an
ugly ampersand in the midst of your text, the dummy character is what
you want in its place.
</p>
<dl class="first-deffn">
<dt class="deffn" id="index-_005c_0029-1"><span class="category-def">Escape&nbsp;sequence: </span><span><strong class="def-name"><code class="t">\)</code><span class="r"><i class="slanted"></i></span><code class="t"></code></strong><a class="copiable-link" href='#index-_005c_0029-1'> &para;</a></span></dt>
<dd><a class="index-entry-id" id="index-_005c_0029"></a>
<a class="index-entry-id" id="index-transparent-dummy-character-_0028_005c_0029_0029"></a>
<a class="index-entry-id" id="index-character_002c-transparent-dummy-_0028_005c_0029_0029"></a>
<a class="index-entry-id" id="index-dummy-character_002c-transparent-_0028_005c_0029_0029"></a>
<p>Interpolate a <i class="slanted">transparent</i> dummy character&mdash;one that is
transparent to end-of-sentence detection.  It behaves as <code class="code">\&amp;</code>,
except that <code class="code">\&amp;</code> is treated as letters and numerals normally are
after &lsquo;<samp class="samp">.</samp>&rsquo;, &lsquo;<samp class="samp">?</samp>&rsquo; and &lsquo;<samp class="samp">!</samp>&rsquo;; <code class="code">\&amp;</code> cancels end-of-sentence
detection, and <code class="code">\)</code> does not.
</p>
<div class="example">
<div class="group"><pre class="example-preformatted">.de Suffix-&amp;
.  nop \&amp;\\$1
..
.
.de Suffix-)
.  nop \)\\$1
..
.
Here's a sentence.\c
.Suffix-&amp; '
Another one.\c
.Suffix-) '
And a third.
    &rArr; Here's a sentence.' Another one.'  And a third.
</pre></div></div>
</dd></dl>




</div>
<hr>
<div class="nav-panel">
<p>
Previous: <a href="Italic-Corrections.html">Italic Corrections</a>, Up: <a href="Using-Fonts.html">Using Fonts</a> &nbsp; [<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>