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 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275
|
<!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>Miscellaneous (The GNU Troff Manual)</title>
<meta name="description" content="Miscellaneous (The GNU Troff Manual)">
<meta name="keywords" content="Miscellaneous (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="GNU-troff-Reference.html" rel="up" title="GNU troff Reference">
<link href="Gtroff-Internals.html" rel="next" title="Gtroff Internals">
<link href="Postprocessor-Access.html" rel="prev" title="Postprocessor Access">
<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.w-nolinebreak-text {white-space: nowrap}
span:hover a.copiable-link {visibility: visible}
strong.def-name {font-family: monospace; font-weight: bold; font-size: larger}
-->
</style>
</head>
<body lang="en">
<div class="section-level-extent" id="Miscellaneous">
<div class="nav-panel">
<p>
Next: <a href="Gtroff-Internals.html" accesskey="n" rel="next"><code class="code">gtroff</code> Internals</a>, Previous: <a href="Postprocessor-Access.html" accesskey="p" rel="prev">Postprocessor Access</a>, Up: <a href="GNU-troff-Reference.html" accesskey="u" rel="up">GNU <code class="code">troff</code> Reference</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>
<h3 class="section" id="Miscellaneous-1">5.35 Miscellaneous</h3>
<p>We document here GNU <code class="code">troff</code> features that fit poorly elsewhere.
</p>
<dl class="first-deffn">
<dt class="deffn" id="index-_002enm"><span class="category-def">Request: </span><span><strong class="def-name"><code class="t">.nm</code></strong> <var class="def-var-arguments">[<span class="r"><i class="slanted">start</i></span> [<span class="r"><i class="slanted">increment</i></span> [<span class="r"><i class="slanted">space</i></span> [<span class="r"><i class="slanted">indentation</i></span>]]]]</var><a class="copiable-link" href='#index-_002enm'> ¶</a></span></dt>
<dd><a class="index-entry-id" id="index-nm"></a>
</dd><dt class="deffnx def-cmd-deffn" id="index-_005cn_005bln_005d"><span class="category-def">Register: </span><span><strong class="def-name"><code class="t">\n[ln]</code></strong><a class="copiable-link" href='#index-_005cn_005bln_005d'> ¶</a></span></dt>
<dd><a class="index-entry-id" id="index-ln"></a>
</dd><dt class="deffnx def-cmd-deffn" id="index-_005cn_005b_002enm_005d"><span class="category-def">Register: </span><span><strong class="def-name"><code class="t">\n[.nm]</code></strong><a class="copiable-link" href='#index-_005cn_005b_002enm_005d'> ¶</a></span></dt>
<dd><a class="index-entry-id" id="index-_002enm-1"></a>
<a class="index-entry-id" id="index-printing-line-numbers-_0028nm_0029"></a>
<a class="index-entry-id" id="index-line-numbers_002c-printing-_0028nm_0029"></a>
<a class="index-entry-id" id="index-numbers_002c-line_002c-printing-_0028nm_0029"></a>
<p>Begin (or, with no arguments, cease) numbering output lines.
<var class="var">start</var> assigns the number of the <em class="emph">next</em> output line. Only
line numbers divisible by <var class="var">increment</var> are marked (default:
‘<samp class="samp">1</samp>’). <var class="var">space</var> configures the horizontal spacing between the
number and the text (default: ‘<samp class="samp">1</samp>’). Any given <var class="var">indentation</var> is
applied to the numbers (default: ‘<samp class="samp">0</samp>’). The third and fourth
arguments are reckoned in numeral widths (<code class="code">\0</code>). <var class="var">start</var> must
be non-negative and <var class="var">increment</var> positive.
</p>
<p>The formatter aligns the number to the right in a width of three numeral
spaces plus <var class="var">indentation</var>, then catenates <var class="var">space</var> and the output
line. The line length is <em class="emph">not</em> reduced. Depending on the value of
the page offset,<a class="footnote" id="DOCF117" href="groff.html_fot.html#FOOT117"><sup>117</sup></a> numbers wider than
the allocated space protrude into the left margin, or shift the output
line to the right.
</p>
<p>Line numbering parameters corresponding to missing arguments are not
altered. After numbering is disabled, ‘<samp class="samp">.nm +0</samp>’ resumes it using
the previously active parameters.
</p>
<p>The parameters of <code class="code">nm</code> are associated with the environment
(see <a class="pxref" href="Environments.html">Environments</a>).
</p>
<a class="index-entry-id" id="index-output-line-number-register-_0028ln_0029"></a>
<a class="index-entry-id" id="index-line-number_002c-output_002c-register-_0028ln_0029"></a>
<p>While numbering is enabled, the output line number register <code class="code">ln</code> is
updated as each line is output, even if no line number is formatted with
it because it is being skipped (it is not a multiple of <var class="var">increment</var>)
or because numbering is suppressed (see the <code class="code">nn</code> request below).
</p>
<p>The <code class="code">.nm</code> register tracks the enablement status of numbering.
Temporary suspension of numbering with the <code class="code">nn</code> request does
<em class="emph">not</em> alter its value.
</p>
<div class="example">
<div class="group"><pre class="example-preformatted">.po 5n
.ll 44n
Programming,
when stripped of all its circumstantial irrelevancies,
.nm 999 1 1 -4
boils down to no more and no less than
.nm +0 3
very effective thinking so as to avoid unmastered
.nn 2
complexity,
to very vigorous separation of your many
different concerns.
.br
\(em Edsger Dijkstra
.sp
.nm 1 1 1
This guy's arrogance takes your breath away.
.br
\(em John Backus
⇒ Programming, when stripped of all its cir-
⇒ 999 cumstantial irrelevancies, boils down to no
⇒ more and no less than very effective think-
⇒ ing so as to avoid unmastered complexity, to
⇒ very vigorous separation of your many dif-
⇒ ferent concerns.
⇒ 1002 -- Edsger Dijkstra
⇒
⇒ 1 This guy’s arrogance takes your breath away.
⇒ 2 -- John Backus
</pre></div></div>
</dd></dl>
<dl class="first-deffn">
<dt class="deffn" id="index-_002enn"><span class="category-def">Request: </span><span><strong class="def-name"><code class="t">.nn</code></strong> <var class="def-var-arguments">[<span class="r"><i class="slanted">skip</i></span>]</var><a class="copiable-link" href='#index-_002enn'> ¶</a></span></dt>
<dd><a class="index-entry-id" id="index-nn"></a>
</dd><dt class="deffnx def-cmd-deffn" id="index-_005cn_005b_002enn_005d"><span class="category-def">Register: </span><span><strong class="def-name"><code class="t">\n[.nn]</code></strong><a class="copiable-link" href='#index-_005cn_005b_002enn_005d'> ¶</a></span></dt>
<dd><a class="index-entry-id" id="index-_002enn-1"></a>
<p>Suppress numbering of the next <var class="var">skip</var> output lines that would
otherwise be numbered. The default is 1. <code class="code">nn</code> can be invoked
when line numbering is not active; suppression of numbering will take
effect for <var class="var">skip</var> lines once <code class="code">nm</code> enables it.
</p>
<p>The <code class="code">.nn</code> register stores the count of output lines still to have
their numbering suppressed.
</p>
<p>This count is associated with the environment (see <a class="pxref" href="Environments.html">Environments</a>).
</p></dd></dl>
<p>To test whether the current output line will be numbered, you must check
both the <code class="code">.nm</code> and <code class="code">.nn</code> registers.
</p>
<div class="example">
<div class="group"><pre class="example-preformatted"> .de is-numbered
. nop This line
. ie (\\n[.nm] & (1-\\n[.nn])) IS
. el ISN'T
. nop numbered.
. br
..
Test line numbering.
.is-numbered
.nm 1
.nn 1
.is-numbered
.is-numbered
.nm
.is-numbered
⇒ Test line numbering. This line ISN’T numbered.
⇒ This line ISN’T numbered.
⇒ 1 This line IS numbered.
⇒ This line ISN’T numbered.
</pre></div></div>
<dl class="first-deffn">
<dt class="deffn" id="index-_002emc"><span class="category-def">Request: </span><span><strong class="def-name"><code class="t">.mc</code></strong> <var class="def-var-arguments">[<span class="r"><i class="slanted">margin-character</i></span> [<span class="r"><i class="slanted">distance</i></span>]</var><a class="copiable-link" href='#index-_002emc'> ¶</a></span></dt>
<dd><a class="index-entry-id" id="index-mc"></a>
<a class="index-entry-id" id="index-margin-glyph-_0028mc_0029"></a>
<a class="index-entry-id" id="index-glyph_002c-for-margins-_0028mc_0029"></a>
<p>Begin (or, with no arguments, cease) writing a <em class="dfn">margin-character</em> to
the right of each output line. The <var class="var">distance</var> argument separates
<var class="var">margin-character</var> from the right margin. If absent, the most
recent value is used; the default is 10 points. If an output line
exceeds the line length, the margin character is appended to it.
<a class="index-entry-id" id="index-tl-request_002c-and-mc"></a>
No margin character is written on lines produced by the <code class="code">tl</code>
request.
</p>
<p>The margin character is a property of the output line; the margin
character last configured when the line is output controls. If the
margin character is disabled before an output line breaks, none is
output (but see below).
</p>
<p>The margin character is associated with the environment
(see <a class="pxref" href="Environments.html">Environments</a>).
</p>
<div class="example">
<div class="group"><pre class="example-preformatted">.ll 5i
.nf
.mc \[br]
This paragraph is marked with a margin character.
.sp
As seen above, vertical space isn't thus marked.
\&
An output line that is present, but empty, is.
⇒ This paragraph is marked with a margin character. |
⇒
⇒ As seen above, vertical space isn’t thus marked. |
⇒ |
⇒ An output line that is present, but empty, is. |
</pre></div></div>
</dd></dl>
<p>For compatibility with <abbr class="acronym">AT&T</abbr> <code class="code">troff</code>, a call to <code class="code">mc</code>
to set the margin character can’t be undone immediately; at least one
line gets a margin character.
</p>
<div class="example">
<div class="group"><pre class="example-preformatted">.ll 10n
.nf
.mc |
.mc *
.mc
foo
bar
⇒ foo *
⇒ bar
</pre></div></div>
<a class="index-entry-id" id="index-gdiffmk"></a>
<a class="index-entry-id" id="index-nrchbar"></a>
<a class="index-entry-id" id="index-changebar"></a>
<a class="index-entry-id" id="index-diffmk"></a>
<p>The margin character mechanism is commonly used to annotate changes in
documents. The <code class="code">groff</code> distribution ships a program,
<code class="command">gdiffmk</code>, to assist with this task.<a class="footnote" id="DOCF118" href="groff.html_fot.html#FOOT118"><sup>118</sup></a>
</p>
<dl class="first-deffn">
<dt class="deffn" id="index-_002epsbb"><span class="category-def">Request: </span><span><strong class="def-name"><code class="t">.psbb</code></strong> <var class="def-var-arguments">file</var><a class="copiable-link" href='#index-_002epsbb'> ¶</a></span></dt>
<dd><a class="index-entry-id" id="index-psbb"></a>
</dd><dt class="deffnx def-cmd-deffn" id="index-_005cn_005bllx_005d"><span class="category-def">Register: </span><span><strong class="def-name"><code class="t">\n[llx]</code></strong><a class="copiable-link" href='#index-_005cn_005bllx_005d'> ¶</a></span></dt>
<dd><a class="index-entry-id" id="index-llx"></a>
</dd><dt class="deffnx def-cmd-deffn" id="index-_005cn_005blly_005d"><span class="category-def">Register: </span><span><strong class="def-name"><code class="t">\n[lly]</code></strong><a class="copiable-link" href='#index-_005cn_005blly_005d'> ¶</a></span></dt>
<dd><a class="index-entry-id" id="index-lly"></a>
</dd><dt class="deffnx def-cmd-deffn" id="index-_005cn_005burx_005d"><span class="category-def">Register: </span><span><strong class="def-name"><code class="t">\n[urx]</code></strong><a class="copiable-link" href='#index-_005cn_005burx_005d'> ¶</a></span></dt>
<dd><a class="index-entry-id" id="index-urx"></a>
</dd><dt class="deffnx def-cmd-deffn" id="index-_005cn_005bury_005d"><span class="category-def">Register: </span><span><strong class="def-name"><code class="t">\n[ury]</code></strong><a class="copiable-link" href='#index-_005cn_005bury_005d'> ¶</a></span></dt>
<dd><a class="index-entry-id" id="index-ury"></a>
<a class="index-entry-id" id="index-PostScript_002c-bounding-box"></a>
<a class="index-entry-id" id="index-bounding-box"></a>
<p>Retrieve the bounding box of the PostScript image found in <var class="var">file</var>,
which must conform to Adobe’s <em class="dfn">Document Structuring Conventions</em>
(DSC), locate a <code class="code">%%BoundingBox</code> comment, and store the (upper-,
lower-, <span class="w-nolinebreak-text">-left</span><!-- /@w -->, <span class="w-nolinebreak-text">-right</span><!-- /@w -->) values into the registers <code class="code">llx</code>,
<code class="code">lly</code>, <code class="code">urx</code>, and <code class="code">ury</code>. If an error occurs (for
example, if no <code class="code">%%BoundingBox</code> comment is present), the formatter
sets these registers to 0.
</p>
<p>The search path for <var class="var">file</var> can be controlled with the <samp class="option">-I</samp>
command-line option.
</p></dd></dl>
</div>
<hr>
<div class="nav-panel">
<p>
Next: <a href="Gtroff-Internals.html"><code class="code">gtroff</code> Internals</a>, Previous: <a href="Postprocessor-Access.html">Postprocessor Access</a>, Up: <a href="GNU-troff-Reference.html">GNU <code class="code">troff</code> Reference</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>
|