GNU 'troff'
1 Introduction
1.1 Background
1.2 What Is 'groff'?
1.3 GNU 'troff' Capabilities
1.4 Macro Packages
1.5 Preprocessors
1.6 Output Devices
1.7 Installation
1.8 Conventions Used in This Manual
1.9 Credits
2 Invoking 'groff'
2.1 Options
2.2 Environment
2.3 Macro Directories
2.4 Font Directories
2.5 Paper Format
2.6 Invocation Examples
3 Tutorial for Macro Package Users
3.1 Basics
3.2 Common Features
3.2.1 Paragraphs
3.2.2 Sections and Chapters
3.2.3 Headers and Footers
3.2.4 Page Layout
3.2.5 Displays and Keeps
3.2.6 Footnotes and Endnotes
3.2.7 Table of Contents
3.2.8 Indexing
3.2.9 Document Formats
3.2.10 Columnation
3.2.11 Font and Size Changes
3.2.12 Predefined Text
3.2.13 Preprocessor Support
3.2.14 Configuration and Customization
4 Macro Packages
4.1 'man'
4.1.1 Optional 'man' extensions
Custom headers and footers
Ultrix-specific man macros
Simple example
4.2 'mdoc'
4.3 'me'
4.4 'mm'
4.5 'mom'
4.6 'ms'
4.6.1 Introduction
4.6.1.1 Basic information
4.6.2 Document Structure
4.6.3 Document Control Settings
Margin settings
Titles (headers, footers)
Text settings
Paragraph settings
Heading settings
Footnote settings
Display settings
Other settings
4.6.4 Document Description Macros
4.6.5 Body Text
4.6.5.1 Text settings
4.6.5.2 Typographical symbols
4.6.5.3 Paragraphs
4.6.5.4 Headings
4.6.5.5 Typeface and decoration
4.6.5.6 Lists
4.6.5.7 Indented regions
4.6.5.8 Keeps, boxed keeps, and displays
4.6.5.9 Tables, figures, equations, and references
4.6.5.10 Footnotes
4.6.5.11 Language and localization
4.6.6 Page layout
4.6.6.1 Headers and footers
4.6.6.2 Tab stops
4.6.6.3 Margins
4.6.6.4 Multiple columns
4.6.6.5 Creating a table of contents
4.6.7 Differences from AT&T 'ms'
4.6.7.1 Unix Version 7 'ms' macros unimplemented by 'groff' 'ms'
4.6.8 Legacy Features
AT&T accent mark strings
Berkeley accent mark and glyph strings
4.6.9 Naming Conventions
5 GNU 'troff' Reference
5.1 Text
5.1.1 Filling
5.1.2 Sentences
5.1.3 Hyphenation
5.1.4 Breaking
5.1.5 Adjustment
5.1.6 Tabs and Leaders
5.1.7 Requests and Macros
5.1.8 Macro Packages
5.1.9 Input Format
5.1.10 Input Encodings
5.1.11 Input Conventions
5.2 Page Geometry
5.3 Measurements
5.3.1 Motion Quanta
5.3.2 Default Units
5.4 Numeric Expressions
5.5 Identifiers
5.6 Formatter Instructions
5.6.1 Control Characters
5.6.2 Invoking Requests
5.6.3 Calling Macros
5.6.4 Using Escape Sequences
5.6.5 Delimiters
5.7 Comments
5.8 Registers
5.8.1 Setting Registers
5.8.2 Interpolating Registers
5.8.3 Auto-increment
5.8.4 Assigning Register Formats
5.8.5 Built-in Registers
5.9 Manipulating Filling and Adjustment
5.10 Manipulating Hyphenation
5.11 Manipulating Spacing
5.12 Tabs and Fields
5.12.1 Leaders
5.12.2 Fields
5.13 Character Translations
5.14 'troff' and 'nroff' Modes
5.15 Line Layout
5.16 Line Continuation
5.17 Page Layout
5.18 Page Control
5.19 Using Fonts
5.19.1 Selecting Fonts
5.19.2 Font Families
5.19.3 Font Positions
5.19.4 Characters and Glyphs
5.19.5 Character Classes
5.19.6 Special Fonts
5.19.7 Artificial Fonts
5.19.8 Ligatures and Kerning
5.19.9 Italic Corrections
5.19.10 Dummy Characters
5.20 Manipulating Type Size and Vertical Spacing
5.20.1 Changing the Type Size
5.20.2 Changing the Vertical Spacing
5.20.3 Using Fractional Type Sizes
5.21 Colors
5.22 Strings
5.23 Conditionals and Loops
5.23.1 Operators in Conditionals
5.23.2 if-then
5.23.3 if-else
5.23.4 Conditional Blocks
5.23.5 while
5.24 Writing Macros
5.24.1 Parameters
5.24.2 Copy Mode
5.25 Page Motions
5.26 Output Line Annotation
5.27 Drawing Geometric Objects
5.28 Deferring Output
5.29 Traps
5.29.1 Vertical Position Traps
5.29.1.1 Page Location Traps
5.29.1.2 The Implicit Page Trap
5.29.1.3 Diversion Traps
5.29.2 Input Line Traps
5.29.3 Blank Line Traps
5.29.4 Leading Space Traps
5.29.5 End-of-input Traps
5.30 Diversions
5.31 Punning Names
5.32 Environments
5.33 Suppressing Output
5.34 Host System Service Access
5.35 Postprocessor Access
5.36 Miscellaneous
5.37 GNU 'troff' Internals
5.38 Debugging
5.38.1 Warnings
5.39 Implementation Differences
5.39.1 Safer Mode
5.39.2 Compatibility Mode
5.39.3 Other Differences
6 File Formats
6.1 Device and Font Description Files
6.1.1 'DESC' File Format
6.1.2 Font Description File Format
6.2 GNU 'troff' Output
6.2.1 Language Concepts
6.2.1.1 Syntax
6.2.1.2 Argument Units
6.2.1.3 Output Structure
6.2.2 Command Reference
6.2.2.1 Comment Command
6.2.2.2 Simple Commands
6.2.2.3 Graphics Commands
6.2.2.4 Device Control Commands
6.2.2.5 Legacy Compressed Encoding
6.2.3 GNU 'troff' Output Examples
6.2.4 Output Language Compatibility
Appendix A Copying This Manual
Appendix B Request Index
Appendix C Escape Sequence Index
Appendix D Operator Index
Appendix E Register Index
Appendix F Macro Index
Appendix G String Index
Appendix H File Keyword Index
Appendix I Program and File Index
Appendix J Concept Index
GNU 'troff'
***********
This manual documents GNU 'troff' version 1.24.1.
Copyright © 1994-2018 Free Software Foundation, Inc.
Copyright © 2018-2026 G. Branden Robinson
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".
1 Introduction
**************
GNU 'roff' (or 'groff') is a programming system for typesetting
documents. It is highly flexible and has been used extensively for over
thirty years.
1.1 Background
==============
M. Douglas McIlroy, formerly of AT&T Bell Laboratories and present at
the creation of the Unix operating system, offers an authoritative
historical summary.
The prime reason for Unix was the desire of Ken [Thompson], Dennis
[Ritchie], and Joe Ossanna to have a pleasant environment for
software development. The fig leaf that got the nod from ...
management was that an early use would be to develop a
"stand-alone" word-processing system for use in typing pools and
secretarial offices. Perhaps they had in mind "dedicated", as
distinct from "stand-alone"; that's what eventuated in various
cases, most notably in the legal/patent department and in the AT&T
CEO's office.
Both those systems were targets of opportunity, not foreseen from
the start. When Unix was up and running on the PDP-11, Joe got
wind of the legal department having installed a commercial word
processor. He went to pitch Unix as an alternative and clinched a
trial by promising to make 'roff' able to number lines by tomorrow
in order to fulfill a patent-office requirement that the commercial
system did not support.
Modems were installed so legal-department secretaries could try the
Research machine. They liked it and Joe's superb customer service.
Soon the legal department got a system of their own. Joe went on
to create 'nroff' and 'troff'. Document preparation became a
widespread use of Unix, but no stand-alone word-processing system
was ever undertaken.
A history relating 'groff' to its forerunners 'roff', 'nroff', and
'troff' is available in 'roff(7)'.
1.2 What Is 'groff'?
====================
'groff' (GNU 'roff') is a typesetting system that reads plain text input
that includes formatting commands to produce output in PostScript, PDF,
HTML, or other formats, or for display to a terminal. Formatting
commands can be low-level typesetting primitives, macros from a supplied
package, or user-defined macros. All three approaches can be combined.
A reimplementation and extension of 'troff' and other programs from
AT&T Unix, 'groff' is widely available on POSIX and other systems owing
to its long association with Unix manuals, including man pages. It and
its predecessor have produced several best-selling software engineering
texts. 'groff' can create typographically sophisticated documents while
consuming minimal system resources.
Like its predecessor "troff", the term "groff" affords two popular
pronunciations: as one syllable (like the surname), rhyming with
"trough", or as "jee-roff", in analogy to the Bell Labs pronunciation
"tee-roff". Little risk of confusion exists; use whichever suits you.
The architecture of the GNU 'roff' system follows that of other
device-independent 'roff' implementations, comprising preprocessors,
macro packages, output drivers (or "postprocessors"), and a suite of
utilities, with the formatter program 'troff' at its heart.
The front end programs available in the GNU 'roff' system make it
easier to use than traditional 'roff's that required the construction of
pipelines or use of temporary files to carry a source document from
maintainable form to device-ready output.
1.3 GNU 'troff' Capabilities
============================
GNU 'troff' is a typesetting document formatting program; it provides a
wide range of low-level text and page operations within the framework of
a programming language. These operations compose to generate footnotes,
tables of contents, mathematical equations, diagrams, multi-column text,
and other elements of typeset works. Here is a survey of formatter
features; all are under precise user control.
* text filling, breaking, alignment to the left or right margin;
centering
* adjustment of inter-word space size to justify text, and of
inter-sentence space size to suit local style conventions
* automatic and manual determination of hyphenation break points
* pagination
* selection of any font available to the output device
* adjustment of type size and vertical spacing (or "leading")
* configuration of line length and indentation amounts; columnation
* drawing of geometric primitives (lines, arcs, polygons, circles,
...)
* setup of stroke and fill colors (where supported by the output
device)
* embedding of hyperlinks, images, document metadata, and other
inclusions (where supported by the output device)
1.4 Macro Packages
==================
Elemental typesetting functions can be be laborious to use directly with
complex documents. A "macro" facility specifies how certain routine
operations, such as starting paragraphs, or printing headers and
footers, should be performed in terms of those low-level instructions.
One then calls the macro to make it perform its task. Macros can be
specific to one document or collected together into a "macro package"
for use by many. 'groff' supplies versions of the widely used macro
packages 'man', 'mdoc', 'me', 'mm', 'mom', and 'ms'.
1.5 Preprocessors
=================
An alternative approach to complexity management, particularly when
constructing tables, setting mathematics, or drawing diagrams, lies in
preprocessing. A "preprocessor" employs a domian-specific language to
ease the generation of tables, equations, and so forth in terms that are
convenient for human entry. Each preprocessor reads a document and
translates relevant portions of it into GNU 'troff' input. Command-line
options to 'groff' tell it which preprocessors to use.
'groff' provides preprocessors for laying out tables ('tbl'),
typesetting equations ('eqn'), drawing diagrams ('pic' and 'grn'),
inserting bibliographic references ('refer'), and drawing chemical
structures ('chem'). An associated program that is useful when dealing
with preprocessors is 'soelim'.
'groff' also supports 'grap', a preprocessor for drawing graphs. A
free implementation of it can be obtained separately.(1) (*note
Preprocessor Intro-Footnote-1::)
Unique to 'groff' is the 'preconv' preprocessor that enables GNU
'troff' to handle documents in a variety of input encodings, including
UTF-8. Unlike most preprocessors, 'preconv' operates on its entire
enput rather than transforming specially marked regions of a document.
Other preprocessors exist, but no free implementations are known. An
example is 'ideal', which draws diagrams using a mathematical constraint
language.
(1)
1.6 Output Devices
==================
GNU 'troff''s output is in a device-independent page description
language. An "output driver" translates this language into a file
format or byte stream that a piece of (possibly emulated) hardware
understands. 'groff' features output drivers for PostScript devices,
terminal emulators (and other simple typewriter-like machines), X11 (for
previewing), TeX DVI, HP LaserJet 4/PCL5 printers, Canon LBP
(CaPSL-using printers), HTML, XHTML, and PDF.
1.7 Installation
================
Locate installation instructions in the files 'INSTALL',
'INSTALL.extra', and 'INSTALL.REPO' in the 'groff' source distribution.
Being a GNU project, 'groff' supports the familiar './configure && make'
command sequence.
1.8 Conventions Used in This Manual
===================================
We apply the term "groff" to the language documented here, the GNU
implementation of the overall system, the project that develops that
system, and the command of that name. In the first sense, 'groff' is an
extended dialect of the 'roff' language, for which many similar
implementations exist. We say "the formatter" when speaking of behavior
that is generally true of 'troff' and 'nroff' programs.
A tradition has arisen that GNU programs' names bear a prefix 'g'
where necessary to distinguish them from other implementations on the
host system (*note Environment::). Thus, for example, 'geqn' is GNU
'eqn'. On operating systems that lack a 'troff' of different
provenance, this prefix is omitted; GNU 'troff' is the only 'troff'
available. Exceptionally, 'groff' always retains its leading 'g'.
We call non-GNU 'troff' systems AT&T 'troff' because that is the
common origin of almost all 'troff' implementations(1) (*note
Conventions Used in This Manual-Footnote-1::) (with more or less
compatible changes).
This manual employs Emacs names for non-graphic keycap engravings on
the alphabetic section of the keyboard. "" is Return or Enter, and
"" is the space bar.
The 'roff' language features several major syntactical categories
within which many items are predefined. Presentations of these items
comprise the name of the category followed by a colon and the form in
which the item is most commonly used.
-- Register: \n[example]
The register 'example' is one that that 'groff' _doesn't_
predefine. You can create it yourself, though; see *note Setting
Registers::.
To make this document useful as a reference and not merely amiable
bedtime reading, we tend to present these syntax items in exhaustive
detail when they arise. References to topics discussed later in the
text are frequent; skim material you haven't mastered yet.
We use Texinfo's "result" (=>) and error-> notations to present
output written to the standard output and standard error streams,
respectively. Diagnostic messages from the GNU 'troff' formatter and
other programs are examples of the latter, but the formatter can also be
directed to write user-specified messages to the standard error stream.
The notation then serves to identify the output stream and does not
necessarily mean that an error has occurred.(2) (*note Conventions Used
in This Manual-Footnote-2::)
$ echo "Twelve o'clock and" | groff -T ascii | sed '/^$/d'
=> Twelve o'clock and
$ echo '.tm all is well.' | groff > /dev/null
error-> all is well.
Sometimes we use => abstractly to represent formatted text that you
will need to use a PostScript or PDF viewer program (or a printer) to
observe. While arguably an abuse of notation, we think this preferable
to requiring the reader to understand the syntax of these page
description languages.
We also present diagnostic messages in an abbreviated form, often
omitting the name of the program issuing them, the input file name, and
line number or other positional information when such data do not serve
to illuminate the topic under discussion.
Most examples are of 'roff' language input that would be placed in a
text file. Occasionally, we start an example with a '$' character to
indicate a shell prompt, as seen above.
We encourage you to to try the examples yourself, and to alter them
to better learn 'groff''s behavior. Our examples sometimes need to
direct the formatter to set a line length (with '.ll') that fits within
the page margins of this manual. We mention this so that you know why
it is there before we discuss the 'll' request formally.(3) (*note
Conventions Used in This Manual-Footnote-3::)
We refer occasionally to man pages, in which aspects of the 'groff'
system or of its operating environment are further documented.(4)
(*note Conventions Used in This Manual-Footnote-4::) When you see a
citation like 'groff_man(7)', understand that you can type 'man
groff_man' at the command line to view it. The numbered category
distinguishes pages by their purpose. You can try 'man 'groff(1)'' and
'man 'groff(7)'' to observe this distinction.(5) (*note Conventions
Used in This Manual-Footnote-5::) Your system likely offers an
'intro(1)' page that will help you make the most of this resource.
(1) Besides 'groff', 'neatroff' is an exception.
(2) Unix and related operating systems distinguish standard output
and standard error streams _because_ of 'troff':
.
(3) *Note Line Layout::.
(4) 'roff' is the language of historical Unix manuals, and of man
pages to this day.
(5) POSIX has not standardized a mechanism for the 'man' command to
distinguish pages by numeric category. If 'man 'groff(7)'' produces an
error, attempt 'man 7 groff' or 'man -s 7 groff'.
1.9 Credits
===========
We adapted portions of this manual from existing documents. James
Clark's man pages were an invaluable foundation; we have updated them in
parallel with the development of this manual. We based the tutorial for
macro package users on Eric Allman's introduction to his 'me' macro
package (which we also provide, little altered from 4.4BSD). Larry
Kollar contributed much of the material on the 'ms' macro package.
2 Invoking 'groff'
******************
This chapter focuses on how to invoke the 'groff' front end, which
constructs a pipeline connecting desired preprocessors, the GNU 'troff'
formatter program, and a postprocessor.
2.1 Options
===========
'groff' runs the GNU 'troff' program and, normally, a postprocessor
appropriate to the selected device. The default device is 'ps', unless
changed at 'groff''s build-time configuration. 'groff' can preprocess
input with any of 'pic', 'eqn', 'tbl', 'grn', 'grap', 'chem', 'refer',
'soelim', or 'preconv'.
This section documents only options to the 'groff' front end. Since
it passes many of its arguments to GNU 'troff', we describe many of the
latter's options here. Arguments to preprocessors and output drivers
can be found in the man pages 'pic(1)', 'eqn(1)', 'tbl(1)', 'grn(1)',
'refer(1)', 'chem(1)', 'soelim(1)', 'preconv(1)', 'grotty(1)',
'grops(1)', 'gropdf(1)', 'grohtml(1)', 'grodvi(1)', 'grolj4(1)',
'grolbp(1)', and 'gxditview(1)'.
A summary of 'groff''s usage follows.
groff [-abcCeEgGijklNpRsStUVXzZ] [-d CS] [-d STRING=TEXT]
[-D FALLBACK-ENCODING] [-f FONT-FAMILY]
[-F FONT-DIRECTORY] [-I INCLUSION-DIRECTORY]
[-K INPUT-ENCODING] [-L SPOOLER-ARGUMENT]
[-m MACRO-PACKAGE] [-M MACRO-DIRECTORY]
[-n PAGE-NUMBER] [-o PAGE-LIST]
[-P POSTPROCESSOR-ARGUMENT] [-r CNUMERIC-EXPRESSION]
[-r REGISTER=NUMERIC-EXPRESSION] [-T OUTPUT-DEVICE]
[-w WARNING-CATEGORY] [-W WARNING-CATEGORY]
[FILE ...]
'troff' shares much of this interface; 'groff' passes relevant
options and operands to it.
troff [-abcCEiRSUz] [-f FONT-FAMILY] [-F FONT-DIRECTORY]
[-I INCLUSION-DIRECTORY] [-m MACRO-PACKAGE]
[-M MACRO-DIRECTORY] [-n PAGE-NUMBER] [-o PAGE-LIST]
[-r CNUMERIC-EXPRESSION]
[-r REGISTER=NUMERIC-EXPRESSION] [-T OUTPUT-DEVICE]
[-w WARNING-CATEGORY] [-W WARNING-CATEGORY]
[FILE ...]
Options that don't take arguments can be clustered after a
single '-'. A FILE operand of '-' denotes the standard input stream.
All 'groff' commands accept a '--help' option, which summarizes usage
similarly to the foregoing, and '--version', which discloses release
information. Both exit with a successful status after reporting.
The rest of 'groff''s command-line options are as follows.
'-a'
Generate a plain text approximation of the typeset output. The
read-only register '.A' is set to 1. *Note Built-in Registers::.
This option produces a sort of abstract preview of the formatted
output.
* Page breaks are marked by a phrase in angle brackets; for
example, ''.
* Lines are broken where they would be in formatted output.
* Vertical motion, apart from that implied by a break, is not
represented.
* A horizontal motion of any size is represented as one space.
Adjacent horizontal motions are not combined. Supplemental
inter-sentence space (configured by the second argument to the
'ss' request) is not represented.
* A special character is rendered as its identifier between
angle brackets; for example, a hyphen appears as ''.
The above description should not be considered a specification; the
details of '-a' output are subject to change.
'-b'
Write a backtrace reporting the state of 'troff''s input parser to
the standard error stream with each diagnostic message. The line
numbers given in the backtrace might not always be correct, because
'troff''s idea of line numbers can be confused by requests that
append to macros.
'-c'
Disable multi-color output and 'color' request's ability to enable
it.
'-C'
Enable AT&T 'troff' compatibility mode; implies '-c'. *Note
Implementation Differences::, for the list of incompatibilities
between 'groff' and AT&T 'troff'.
'-d CTEXT'
'-d STRING=TEXT'
Define 'roff' string C or STRING as TEXT. C must be one character;
STRING can be of arbitrary length. Such assignments happen before
any macro file is loaded, including the startup file. Due to
'getopt_long(3)' limitations, C cannot be, and STRING cannot
contain, an equals sign, even though that is a valid character in a
'roff' identifier. *Note Strings::.
'-D ENC'
Set fallback input encoding used by 'preconv' to ENC; implies '-k'.
'-e'
Run 'eqn' preprocessor.
'-E'
Inhibit 'troff' error messages. This option does _not_ suppress
messages sent to the standard error stream by documents or macro
packages using 'tm' or related requests.
'-f FAM'
Use FAM as the default font family. *Note Font Families::.
'-F DIR'
Search in directory 'DIR' for the selected output device's
directory of device and font description files. *Note Font
Directories::.
'-g'
Run 'grn' preprocessor.
'-G'
Run 'grap' preprocessor; implies '-p'.
'-h'
Display a usage message and exit.
'-i'
Read the standard input stream after all the named input files have
been processed.
'-I DIR'
Search the directory DIR for files named in several contexts;
implies '-g' and '-s'.
* 'soelim' replaces lines matching '.so FILE-NAME' with the
contents of FILE-NAME.
* 'troff' searches for files named as operands in its command
line and as arguments to 'psbb', 'so', and 'soquiet' requests.
* Output drivers may search for files; for instance, 'grops'
looks for files named in '\X'ps: import ...'', '\X'ps: file
...'', and '\X'pdf: pdfpic ...'' device extension escape
sequences.
This option may be specified more than once; the directories are
searched in the order specified. If you want to search the current
directory before others, add '-I .' at the desired place. The
current working directory is otherwise searched last. '-I' works
similarly to, and is named for, the "include" option of Unix C
compilers.
'groff' passes '-I' options and their arguments to 'soelim',
'troff', and output drivers; with the option letter changed to
'-M', it passes the same arguments to 'grn'.
'-j'
Run 'gchem' preprocessor. Implies '-p'.
'-k'
Run 'preconv' preprocessor. Refer to its man page for its behavior
if neither of 'groff''s '-K' or '-D' options is also specified.
'-K ENC'
Set input encoding used by 'preconv' to ENC; implies '-k'.
'-l'
Send the output to a spooler for printing. The 'print' directive
in the device description file specifies the default command to be
used; see *note Device and Font Description Files::. See options
'-L' and '-X'.
'-L ARG'
Pass ARG to the print spooler. If multiple ARGs are required, pass
each with a separate '-L' option. 'groff' does not prefix an
option dash to ARG before passing it to the spooler.
'-m MAC'
Search for the macro package 'MAC.tmac' and read it prior to any
input. If not found, 'tmac.MAC' is attempted. *Note Macro
Directories::. 'groff' passes '-m' options and their arguments to
'eqn', 'grap', and 'grn'.
'-M DIR'
Search directory 'DIR' for macro files. *Note Macro Directories::.
'groff' passes '-M' options and their arguments to 'eqn', 'grap',
and 'grn'.
'-n NUM'
Begin numbering pages at NUM. The default is '1'.
'-N'
Prohibit newlines between 'eqn' delimiters: pass '-N' to 'eqn'.
'-o LIST'
Output only pages in LIST, which is a comma-separated list of page
ranges; 'N' means page N, 'M-N' means every page between M and N,
'-N' means every page up to N, 'N-' means every page from N on.
'troff' stops processing and exits after formatting the last page
enumerated in LIST.
'-p'
Run 'pic' preprocessor.
'-P ARG'
Pass ARG to the postprocessor. If multiple ARGs are required, pass
each with a separate '-P' option. 'groff' does not prefix an
option dash to ARG before passing it to the postprocessor.
'-r CNUMERIC-EXPRESSION'
'-r REGISTER=NUMERIC-EXPRESSION'
Define 'roff' register C or REGISTER as NUMERIC-EXPRESSION (*note
Numeric Expressions::). C must be one character; REGISTER can be
of arbitrary length. Such assignments happen before any macro file
is loaded, including the startup file. Due to 'getopt_long(3)'
limitations, C cannot be, and REGISTER cannot contain, an equals
sign, even though that is a valid character in a 'roff' identifier.
*Note Registers::.
'-R'
Run 'refer' preprocessor. No mechanism is provided for passing
arguments to it; most 'refer' options have equivalent language
elements that can be specified within the document.
'troff' also accepts a '-R' option, which is not accessible via
'groff'. This option facilitates troubleshooting by preventing the
loading of the 'troffrc' and 'troffrc-end' files.
'-s'
Run 'soelim' preprocessor.
'-S'
Operate in "safer" mode; see '-U' below for its opposite. Safer
mode is enabled by default. Explicitly specifying '-S' causes
'troff' to ignore any subsequent '-U' option.
'-t'
Run 'tbl' preprocessor.
'-T DEV'
Prepare output for device DEV. 'groff' passes the '-T' option and
its argument to 'troff', then (unless the '-Z' option is used) runs
an output driver to convert 'troff''s output to a form appropriate
for DEV. The following output devices are available.
'ps'
For PostScript printers and previewers.
'pdf'
For PDF viewers or printers.
'dvi'
For TeX DVI format.
'X75'
For a 75dpi X11 previewer.
'X75-12'
For a 75dpi X11 previewer with a 12-point base font in the
document.
'X100'
For a 100dpi X11 previewer.
'X100-12'
For a 100dpi X11 previewer with a 12-point base font in the
document.
'ascii'
For typewriter-like devices using the (7-bit) ISO 646:1991 IRV
(US-ASCII) character set.
'latin1'
For typewriter-like devices that support the ISO Latin-1
(8859-1) character set.
'utf8'
For typewriter-like devices that use the ISO 10646 (Unicode)
character set with UTF-8 encoding.
'lj4'
For HP LaserJet4-compatible (or other PCL5-compatible)
printers.
'lbp'
For Canon CaPSL printers (LBP-4 and LBP-8 series laser
printers).
'html'
'xhtml'
To produce HTML and XHTML output, respectively. This driver
consists of two parts, a preprocessor ('pre-grohtml') and a
postprocessor ('post-grohtml').
The predefined GNU 'troff' string '.T' contains the name of the
output device; the read-only register '.T' is set to 1 if this
option is used (which is always true if 'groff' is used to run GNU
'troff'). *Note Built-in Registers::.
The postprocessor to be used for a device is specified by the
'postpro' command in the device description file. (*Note Device
and Font Description Files::.) This selection can be overridden
with the '-X' option.
'-U'
Operate in "unsafe mode", enabling the 'cf', 'open', 'opena', 'pi',
'pso', and 'sy' requests, which are disabled by default because
they allow an untrusted input document to run arbitrary commands,
put arbitrary content into 'troff' output, or write to arbitrary
file names.(1) (*note Groff Options-Footnote-1::) This option also
adds the current directory to the macro package search path; see
the '-m' and '-M' option above. 'groff' passes '-U' to 'pic' and
GNU 'troff'.
'-v'
Write version information for 'groff' and all programs run by it to
the standard output stream; that is, the given command line is
processed in the usual way, passing '-v' to the formatter and any
pre- or postprocessors invoked.
'-V'
Output the pipeline that 'groff' would run to the standard output
stream and exit. If given more than once, 'groff' both writes the
pipeline to the standard error stream and runs it.
'-w CAT'
'-W CAT'
Enable and inhibit, respectively, warnings in category CAT. *Note
Warnings::.
'-X'
Use 'gxditview' instead of the usual postprocessor to (pre)view a
document on an X11 display. Combining this option with '-T ps'
uses the font metrics of the PostScript device, whereas the '-T
X75', '-T X75-12', '-T X100', and '-T X100-12' options use the
metrics of X11 fonts.
'-z'
Suppress formatted output from 'troff'.
'-Z'
Disable postprocessing. 'troff' output appears on the standard
output stream (unless suppressed with '-z'); see *note GNU troff
Output:: for a description of this format.
(1) GNU 'troff' does not, however, accept newlines (line feeds) in
file names supplied as arguments to requests.
2.2 Environment
===============
Environment variables in the host system affect the behavior of programs
supplied by 'groff' as follows. Normally, the path separator in
environment variables ending with 'PATH' is the colon; this may vary
depending on the operating system. For example, Windows uses a
semicolon instead.
'GROFF_BIN_PATH'
Locate 'groff' commands in these directories, followed by those in
'PATH'. If not set, the installation directory of GNU 'roff'
executables, documented in 'groff(1)', is searched before 'PATH'.
'GROFF_COMMAND_PREFIX'
Apply a prefix to certain GNU 'roff' commands. 'groff' can be
configured at compile time to apply a prefix to the names of
programs it provides that had counterparts in AT&T 'troff', so that
name collisions are avoided at run time. The default prefix is
empty.
When used, this prefix is conventionally the letter 'g'. For
example, GNU 'troff' would be installed as 'troff'. Besides
'troff', the prefix applies to the formatter wrapper 'nroff'; the
preprocessors 'eqn', 'grn', 'pic', 'refer', 'tbl', and 'soelim';
and the utilities 'indxbib' and 'lookbib'.
'GROFF_ENCODING'
Specify the assumed character encoding of the input. 'groff'
passes its value as an argument to the 'preconv' preprocessor's
'-e' option. This variable's existence implies the 'groff' option
'-k'. If set but empty, 'groff' runs 'preconv' without an '-e'
option. 'groff''s '-K' option overrides 'GROFF_ENCODING'. See
'preconv(7)'.
'GROFF_FONT_PATH'
Seek the selected output device's directory of device and font
description files in this list of directories. *Note Font
Directories::, 'troff(1)', and 'groff_font(5)'.
'GROFF_TMAC_PATH'
Seek macro packages in this list of directories. *Note Macro
Directories::, 'troff(1)', and 'groff_tmac(5)'.
'GROFF_TMPDIR'
Create temporary files in this directory. If not set, but 'TMPDIR'
is, the latter is used instead. On Windows systems, if neither of
the foregoing are set, the environment variables 'TMP' and 'TEMP'
(in that order) are checked also. Otherwise, temporary files are
created in a system-dependent default directory (on Unix and
GNU/Linux systems, usually '/tmp'). The 'refer', 'grohtml', and
'grops' commands use temporary files.
'GROFF_TYPESETTER'
Set the default output device. The '-T DEV' option overrides it.
If empty or unset, a default configured at build time, and
documented in 'groff(1)', is used.
'SOURCE_DATE_EPOCH'
Declare a time stamp (expressed as seconds since the Unix epoch) to
use as the output creation time stamp in place of the current time.
The time is converted to human-readable form using 'gmtime(3)' and
'asctime(3)' when the formatter starts up and stored in registers
usable by documents and macro packages (*note Built-in
Registers::).
'TZ'
Declare the time zone to use when converting the current time to
human-readable form; see 'tzset(3)'. If 'SOURCE_DATE_EPOCH' is
used, it is always converted to human-readable form using UTC.
2.3 Macro Directories
=====================
A macro file must have a name in the form 'NAME.tmac' or 'tmac.NAME' and
be placed in a "tmac directory" to be found by the '-m MAC' command-line
option.(1) (*note Macro Directories-Footnote-1::) Such naming and
placement makes a macro file into a macro package; when requested, it is
sought in several directories. Together, these locations constitute the
"tmac path". Each directory is searched in the following order until
the desired package is found or the list is exhausted.
* Directories specified with the '-M' command-line option.
* Directories listed in the 'GROFF_TMAC_PATH' environment variable.
* The current working directory (only if in unsafe mode using the
'-U' command-line option).
* The user's home directory, found in the 'HOME' environment
variable.
* A site-local platform-dependent directory, a site-local
platform-independent directory, and a stock directory. Locations
corresponding to your installation are listed in section
"Environment" of 'troff(1)'. If not otherwise configured, they are
as follows.
/usr/local/lib/groff/site-tmac
/usr/local/share/groff/site-tmac
/usr/local/share/groff/1.23.0/tmac
The foregoing assumes that the version of 'groff' is 1.23.0, and
that the installation prefix was '/usr/local'. These locations can
be customized as part of the build-time configuration process.
(1) The 'mso' request loads a macro file of any name. *Note Host
System Service Access::.
2.4 Font Directories
====================
The GNU 'troff' formatter and 'groff''s output drivers read device and
font description files that detail the output device and the typefaces
available to it, including their glyph repertoires and the metrics
(dimensions) of each glyph. This information permits the formatter to
accurately place glyphs with respect to each other. The device
description file is always named 'DESC'; fonts are typically described
in files with short names like 'TR', 'CR', 'HBI', or 'S'.(1) (*note
Font Directories-Footnote-1::)
Device and font description files are kept in "font directories",
which together constitute the "font path". The search procedure always
appends the directory 'dev'NAME, where NAME is the name of the output
device. Assuming TeX DVI output, and '/foo/bar' as a font directory,
the description files for 'grodvi' must be in '/foo/bar/devdvi'. Each
directory in the font path is searched in the following order until the
desired description file is found or the list is exhausted.
* Directories specified with the '-f' command-line option. All
output drivers (and some preprocessors) support this option as
well, because they require information about glyphs to be rendered
in the document.
* Directories listed in the 'GROFF_FONT_PATH' environment variable.
* A site-local directory and a stock directory. Locations
corresponding to your installation are listed in section
"Environment" of 'troff(1)'. If not otherwise configured, they are
as follows.
/usr/local/share/groff/site-font
/usr/local/share/groff/1.23.0/font
The foregoing assumes that the version of 'groff' is 1.23.0, and
that the installation prefix was '/usr/local'. These locations can
be customized as part of the build-time configuration process.
(1) *Note Device and Font Description Files::.
2.5 Paper Format
================
The formatter reads the device description file 'DESC' for the selected
output device when it starts; page dimensions declared there are used if
present.
'groff''s build process configures a default page format and writes
it to typesetters' 'DESC' files. This installation defaults to
'letter'. If the 'DESC' file lacks this information, the formatter and
output driver use a page length of '11i' (eleven inches) for
compatibility with AT&T 'troff'.
In the formatter, the 'pl' request changes the page length, but macro
packages often do not support alteration of the paper format within a
document. One might, for instance, want to switch between portrait and
landscape orientations. Macro packages lack a consistent approach to
configuration of parameters dependent on the paper format; some, like
'ms', benefit from a preamble in the document prior to the first macro
call, while others, like 'mm', instead require the specification of
registers on the command line, or otherwise before its macro file is
interpreted, to configure page dimensions.
Output drivers for typesetters also recognize command-line options
'-p' to override the default page dimensions and '-l' to use landscape
orientation. The output driver's man page, such as 'grops(1)', may be
helpful.
'groff''s '-d paper' command-line option is a convenient means of
setting the paper format; see 'groff_tmac(5)'. Combine it with
appropriate '-P' options for the output driver, overriding its defaults.
The following command formats for PostScript on A4 paper in landscape
orientation.
$ groff -T ps -d paper=a4l -P -pa4 -P -l -m s my.ms >my.ps
2.6 Invocation Examples
=======================
'roff' systems are best known for formatting man pages. A 'man'
librarian program, having located a page, might render it with a 'groff'
command.
$ groff -t -m an -T utf8 /usr/share/man/man1/groff.1
The librarian may also pipe the output through a pager, which might
not interpret terminal escape sequences 'groff' emits for boldface,
underlining, italics, or hyperlinking; see the 'grotty(1)' man page for
a discussion.
To process a 'roff' input file using the preprocessors 'tbl' and
'pic' and the 'me' macro package in the way to which AT&T 'troff' users
were accustomed, one would type (or script) a pipeline.
$ pic foo.me | tbl | troff -m e -T utf8 | grotty
Shorten this pipeline to an equivalent command using 'groff'.
$ groff -p -t -m e -T utf8 foo.me
An even easier way to do this is to use 'grog' to guess the
preprocessor and macro options and execute the result by using the
command substitution feature of the shell.
$ $(grog -T utf8 foo.me)
Each command-line option to a postprocessor must be specified with
any required leading dashes '-' because 'groff' passes the arguments
as-is to the postprocessor, permitting transmission of arbitrary
arguments. For example, to pass a title to the 'gxditview'
postprocessor, the shell commands
$ groff -X -P -title -P 'trial run' mydoc.t
and
$ groff -X -Z mydoc.t | gxditview -title 'trial run' -
are equivalent.
3 Tutorial for Macro Package Users
**********************************
Most users of the 'roff' language employ a macro package to format their
documents. Successful macro packages ease the composition process;
their users need not master the full formatting language, nor understand
features like diversions, traps, and environments. This chapter aims to
familiarize you with basic concepts and mechanisms common to many macro
packages (like "displays"). If you prefer a meticulous and
comprehensive presentation of the language and its formatter, peruse
*note GNU troff Reference:: instead.
3.1 Basics
==========
Let us first survey some basic concepts necessary to use a macro package
fruitfully.(1) (*note Basics-Footnote-1::) References are made
throughout to more detailed information.
GNU 'troff' reads input prepared by the user and outputs a formatted
document suitable for publication or framing. The input consists of
text, or words to be printed, and embedded commands (requests and escape
sequences), which tell GNU 'troff' how to format the output. *Note
Formatter Instructions::.
The primary function of GNU 'troff' is to collect words from its
input, fill output lines with those words, break the line at or near the
right-hand margin (possibly by hyphenating a word), adjust the line to
reach that margin (if necessary) by widening spaces between words, and
output the result.
In fact, we know full well today that it is futile to
speak of liberty as long as economic slavery exists.
(Kropotkin)
=> In fact, we know full well today that it
=> is futile to speak of liberty as long as
=> economic slavery exists. (Kropotkin)
Sometimes a new output line should start even though the current line
is not yet full--for example, at the end of a paragraph. GNU 'troff'
will do this for us automatically at the end of input, but we often want
a break sooner, and more frequently. We wish to _instruct_ the
formatter.
To that end, not all input lines are text lines containing words to
be formatted. Control lines start with a dot ('.') or an apostrophe
(''') as the first character, and are followed by a request or macro
name that tells a macro package (or GNU 'troff' directly) how to format
the text.
We can command a break with the 'br' request. Some requests cause a
break automatically, as do (normally) blank input lines and input lines
beginning with a space or tab.
A macro bundles text and/or control lines into a named collection
that can be called like a request. A macro can also be called by a trap
that is set to "go off" automatically at certain places on the page.
Thus, while requests perform primitive operations, macros handle complex
ones, like arranging the output into columns, collecting and writing out
footnotes, or managing page headers and footers.
Many requests and macros accept arguments that influence their
behavior. A "plain" 'sp' request breaks and puts a blank line on the
output. But
.sp 4
spaces four lines instead. Spaces (but _not_ tabs) separate arguments
from the request or macro name and from each other.
Here are a few hints for preparing text for input to GNU 'troff'.
* First, keep the input lines short. Short input lines are easier to
edit, and, when filling, GNU 'troff' packs words onto longer lines
anyhow.
* Second, it is helpful to begin a new line after every sentence,
comma, semicolon, or colon, since common revisions are to add,
delete, or replace sentences, clauses, phrases, or members of
lists.
* If you _don't_ start a sentence on a new line, put two spaces after
the previous sentence. GNU 'troff' then recognizes punctuation
that ends a sentence, and inserts inter-sentence space accordingly.
We offer further advice in *note Input Conventions::.
Vertical spacing is the distance between lines of text; it is
expressed in the same units as the type size--the point. The default is
10-point type on 12-point spacing. To get double-spaced text you would
set the vertical spacing to 24 points. Some, but not all, macro
packages expose a macro or register to configure the vertical spacing.
A number of requests allow you to change the way the output is
arranged on the page, sometimes called its layout. Most macro packages
don't supply macros for performing these (at least not without
performing other actions besides), as they are such basic operations.
The macro packages for writing man pages, 'man' and 'mdoc', discourage
explicit use of these requests altogether.
Arguments to requests and macro calls can often be measurements
rather than simple integers. For instance,
.sp 1.5i
My thoughts on the subject
.sp
outputs one and a half inches of vertical space, followed by the line
"My thoughts on the subject", followed by a single blank line (more
measurement units are available; see *note Measurements::). Excess
vertical space is normally discarded at page or column breaks. If the
above example appears one inch from the bottom of the page, the half
inch of space "left over" does not appear at the top of the next.
If you desire precise spacing control when using a macro package, be
advised that it might not honor 'sp' requests as you expect; it can use
a formatter feature called no-space mode to prevent excess space from
accumulating. *Note Manipulating Spacing::. Use the facilities the
package offers to control spacing between paragraphs, before section
headings, and around displays (discussed below).
Text lines can be centered by using the 'ce' request. The line after
'ce' is centered (horizontally) on the page. To center more than one
line, use '.ce N' (where N is the number of lines to center), followed
by the N lines. To center many lines without counting them, try the
following technique.
.ce 1000
up to one thousand lines of input
.ce 0
The '.ce 0' request tells GNU 'troff' to center zero more text lines--in
other words, to stop centering.
GNU 'troff' also offers the 'rj' request for right-aligning text. It
works analogously to 'ce' and is convenient for setting epigraphs.
The 'bp' request starts a new page.
All of these requests cause a break, starting a new line. If you
invoke them with the apostrophe ''', the no-break control character, the
(initial) break they normally perform is suppressed. ''br' does
nothing.
(1) The remainder of this chapter is based on "Writing Papers with
NROFF using -me" by Eric P. Allman, which is distributed with 'groff' as
'meintro.me'.
3.2 Common Features
===================
GNU 'troff' provides low-level operations for formatting a document.
Many routine operations are undertaken in nearly all documents that
require a series of such primitive operations to be performed. These
common tasks are grouped into macros, which are then collected into a
macro package.
Some macro packages ("major" or "full-service") assume responsibility
for page layout and other critical functions; others ("supplemental" or
"auxiliary") do not.
We present several capabilities of full-service macro packages below.
Each package employs its own macro names to exercise them. For details,
consult the package's man page or, for 'ms', see *note ms::.
3.2.1 Paragraphs
----------------
Paragraphs can be formatted in various ways. Some indent their first
line. Block paragraphs like the following example omit this
indentation, and must be separated with vertical space for readability.
Separation can be configured for other paragraph types as well.
=> Some men look at constitutions with sanctimonious rev-
=> erence, and deem them like the ark of the covenant,
=> too sacred to be touched.
We also frequently encounter tagged paragraphs, which begin with a
label, or tag, at the left margin, and indent the remaining text.
=> one This is a tagged paragraph. Notice how the first
=> line of the resulting paragraph lines up with the
=> other lines in the paragraph.
If the tag is too wide for the indentation amount, the line is broken.
=> longlabel
=> The long tag does not align with subsequent
=> lines, but those lines align with each other.
A variation of the tagged paragraph is the itemized or enumerated
paragraph, which might use punctuation or a digit for a tag,
respectively. These are frequently used to construct lists.
=> * This list item starts with a bullet. If a bullet
=> glyph is unavailable, groff produces an asterisk
=> instead.
Often, use of the same macro without a tag continues such a discussion.
=> -xyz This option is recognized but ignored.
=>
=> It had a security hole that we don't discuss.
3.2.2 Sections and Chapters
---------------------------
A simple kind of section heading is unnumbered, set in a bold or italic
style, and occupies a line by itself. Others possess automatically
numbered multi-level headings and/or different typeface styles or sizes
at different levels. More sophisticated macro packages supply macros
for designating chapters and appendices, and permit "run-in headings",
where there is no break between the end of the heading text and the
start of the subsequent paragraph.
3.2.3 Headers and Footers
-------------------------
Headers and footers occupy the top and bottom of each page,
respectively, and contain data like the page number and the article or
chapter title. Their appearance is not affected by the running text.
Some packages allow for different titles on even- and odd-numbered pages
(for printed, bound material).
Headers and footers are together called titles, and comprise three
parts: left-aligned, centered, and right-aligned. A '%' character
appearing anywhere in a title is automatically replaced by the page
number. *Note Page Layout::.
3.2.4 Page Layout
-----------------
Most macro packages let the user specify the size of the page margins.
The top and bottom margins are typically handled differently than the
left and right margins; the latter are derived from the page offset,
indentation, and line length. *Note Line Layout::. Commonly, packages
support registers to tune these values.
3.2.5 Displays and Keeps
------------------------
Displays are sections of text set off from the surrounding material
(typically paragraphs), often differing in indentation and/or spacing.
Tables, block quotations, and figures are displayed. Equations and code
examples, when not much shorter than an output line, often are. Lists
may or may not be.
A keep is a group of output lines, often a display, that is formatted
on a single page if possible; it causes a page break to happen early if
necessary to not interrupt the kept material. Packages for setting man
pages support example displays but not keeps.
Floating keeps can move, or "float", relative to the text around them
in the input. They are useful for displays that are captioned and
referred to by name, as with "See figure 3". A floating keep might
appear at the bottom of the current page if it fits, and at the top of
the next otherwise. Alternatively, it might be deferred to the end of a
section. Use of a floating keep can prevent a large vertical space from
appearing before a tall keep of the ordinary sort when it won't fit on
the page.
3.2.6 Footnotes and Endnotes
----------------------------
Footnotes and endnotes are forms of delayed formatting. They are
recorded at their points of relevance in the input, but not formatted
there. Instead, a mark cues the reader to check the "foot", or bottom,
of the current page, or in the case of endnotes, an annotation list
later in the document. Macro packages that support these features also
supply a means of automatically numbering either type of annotation.
3.2.7 Table of Contents
-----------------------
A package may handle a table of contents by directing section heading
macros to save the heading's text and the page number where it occurs
for use in a later entry for a table of contents. It writes the
collected entries at the end of the document, once all are known, upon
request. A "leader", a row of dots, bridges the text on the left with
its location on the right. Other collections might work in this manner,
providing lists of figures or tables.
A table of contents is often found at the end of a GNU 'troff'
document because the formatter processes the document in a single pass.
The 'gropdf' output driver supports a PDF feature that relocates pages
at the time the document is rendered; see 'gropdf(1)'.
3.2.8 Indexing
--------------
An index is similar to a table of contents, in that entry labels and
locations must be collected, but poses a greater challenge because it
needs to be sorted before it is output. Here, processing the document
in multiple passes is inescapable, and tools like the 'makeindex(1)'
program become necessary.
3.2.9 Document Formats
----------------------
Some macro packages supply stock configurations of certain types of
documents, like business letters and memoranda. These often also have
provision for a cover sheet, which may be rigid in its format. With
these features, it is even more important to use the package's macros in
preference to the formatter requests presented earlier, where possible.
3.2.10 Columnation
------------------
Macro packages apart from 'man' and 'mdoc' for man page formatting offer
a facility for setting multiple text columns on the page.
3.2.11 Font and Size Changes
----------------------------
The formatter's requests and escape sequences for setting the typeface
and size are not always intuitive in their behavior, so all full-service
packages provide macros to simplify input of these operations. They can
also make mid-word font style changes more convenient, and can handle
italic corrections automatically. *Note Italic Corrections::.
3.2.12 Predefined Text
----------------------
Most macro packages supply predefined strings to set computed text like
the date, or to perform operations like super- and subscripting.
3.2.13 Preprocessor Support
---------------------------
All macro packages provide support for various preprocessors and may
extend their functionality by defining macros to caption their output
and/or set it in a display. Examples include 'TS' and 'TE' for 'tbl',
'EQ' and 'EN' for 'eqn', and 'PS' and 'PE' for 'pic'. Another
preprocessor, 'refer', facilitates the inclusion of bibliographic
citations in a consistent format.
3.2.14 Configuration and Customization
--------------------------------------
Each package provides means of customizing details of its behavior.
Often, this is achieved with register and string definitions. Such
parameters include the default type size and the appearance of section
headings.
4 Macro Packages
****************
This chapter surveys the "major" macro packages that come with 'groff'.
One, 'ms', is presented in detail.
Major macro packages are also sometimes described as "full-service"
due to the breadth of features they provide and because more than one
cannot be used by the same document; for example
groff -m man foo.man -m ms bar.doc
doesn't work. Option arguments are processed before non-option
arguments; the above (failing) sample is thus reordered to
groff -m man -m ms foo.man bar.doc
Many auxiliary, or supplemental, macro packages are also available.
They may in general be used with any full-service macro package and
handle a variety of tasks from character encoding selection, to language
localization, to inlining of raster images. See 'groff_tmac(5)' for a
list.
4.1 'man'
=========
The 'man' macro package is the most widely used and probably the most
important ever developed for 'troff'. It is easy to use, and a vast
majority of manual pages ("man pages") are written in it.
'groff''s implementation is documented in 'groff_man(7)'.
4.1.1 Optional 'man' extensions
-------------------------------
Use the file 'man.local' to configure its rendering parameters on a
persistent basis. With care, its macros can be redefined there (except
for 'TH', to which one should, at most, append with the 'am' family of
requests).
Custom headers and footers
..........................
In 'groff' versions 1.18.2 and later, you can specify custom headers and
footers by redefining the following macros in 'man.local'.
-- Macro: .PT
Control the content of the headers. Normally, the header prints
the command name and section number on either side, and the
optional fifth argument to 'TH' in the center.
-- Macro: .BT
Control the content of the footers. Normally, the footer prints
the page number and the third and fourth arguments to 'TH'.
Use the 'FT' register to specify the footer position. The default
is -0.5i.
Ultrix-specific man macros
..........................
The 'groff' source distribution includes a file named 'man.ultrix',
containing macros compatible with the Ultrix variant of 'man'. Copy
this file into 'man.local' (or use the 'mso' request to load it) to
enable the following macros.
-- Macro: .CT key
Print ''.
-- Macro: .CW
Print subsequent text using a "constant-width" (monospaced)
typeface (Courier roman).
-- Macro: .Ds
Begin a non-filled display.
-- Macro: .De
End a non-filled display started with 'Ds'.
-- Macro: .EX [indent]
Begin a non-filled display using a monospaced typeface (Courier
roman). Use the optional INDENT argument to indent the display.
-- Macro: .EE
End a non-filled display started with 'EX'.
-- Macro: .G [text]
Set TEXT in Helvetica. If no text is present on the line where the
macro is called, then the text of the next line appears in
Helvetica.
-- Macro: .GL [text]
Set TEXT in Helvetica oblique. If no text is present on the line
where the macro is called, then the text of the next line appears
in Helvetica Oblique.
-- Macro: .HB [text]
Set TEXT in Helvetica bold. If no text is present on the line
where the macro is called, then all text up to the next 'HB'
appears in Helvetica bold.
-- Macro: .TB [text]
Identical to 'HB'.
-- Macro: .MS title sect [punct]
Set a man page reference in Ultrix format. The TITLE is in Courier
instead of italic. Optional punctuation follows the section number
without an intervening space.
-- Macro: .NT ['C'] [title]
Begin a note. Print the optional title, or the word "Note",
centered on the page. Text following the macro makes up the body
of the note, and is indented on both sides. If the first argument
is 'C', the body of the note is printed centered (the second
argument replaces the word "Note" if specified).
-- Macro: .NE
End a note begun with 'NT'.
-- Macro: .PN path [punct]
Set the path name in a monospaced typeface (Courier roman),
followed by optional punctuation.
-- Macro: .Pn [punct] path [punct]
If called with two arguments, identical to 'PN'. If called with
three arguments, set the second argument in a monospaced typeface
(Courier roman), bracketed by the first and third arguments in the
current font.
-- Macro: .R
Switch to roman font and turn off any underlining in effect.
-- Macro: .RN
Print the string ''.
-- Macro: .VS ['4']
Start printing a change bar in the margin if the number '4' is
specified. Otherwise, this macro does nothing.
-- Macro: .VE
End printing the change bar begun by 'VS'.
Simple example
..............
The following example 'man.local' file alters the behavior of the 'SH'
macro.
.\" Make the heading font Helvetica bold.
.ds HF HB
.
.\" Add vertical space prior to headings on typesetters.
.rn SH SH-orig
.de SH
. if t .sp (u;\\n[PD]*2)
. SH-orig \\$*
..
4.2 'mdoc'
==========
'groff''s implementation of the BSD 'doc' package for man pages is
documented in 'groff_mdoc(7)'.
Use the file 'mdoc.local' to configure its rendering parameters on a
persistent basis. With care, its macros can be redefined there (except
for 'Dd', to which one should, at most, append with the 'am' family of
requests).
4.3 'me'
========
'groff''s implementation of the BSD 'me' macro package is documented
using itself. A tutorial, 'meintro.me', and reference, 'meref.me', are
available in 'groff''s documentation directory. 'groff_me(7)'
identifies the installation path for these documents.
A French translation of the tutorial is available as 'meintro_fr.me'
and installed parallel to the English version.
4.4 'mm'
========
'groff''s implementation of the AT&T memorandum macro package is
documented in 'groff_mm(7)'.
A Swedish localization of 'mm' is also available; see
'groff_mmse(7)'.
4.5 'mom'
=========
The 'mom' package's primary documentation is in HTML. Model documents
illustrating many features are offered in PDF. See the 'groff(1)' man
page, section "Installation Directories", for their location.
* 'toc.html' Entry point to the full mom manual.
* 'macrolist.html' Hyperlinked index of macros with brief
descriptions, arranged by category.
* 'mom-pdf.pdf' PDF features and usage.
The mom macros are in active development between 'groff' releases.
The most recent version, along with up-to-date documentation, is
available at .
The 'groff_mom(7)' man page (type 'man groff_mom' at the command
line) contains a partial list of available macros, however their usage
is best understood by consulting the HTML documentation.
4.6 'ms'
========
Use the 'ms' ("manuscript") package to compose letters, memoranda,
reports, and books. These 'groff' macros feature cover page and table
of contents generation, automatically numbered headings, several
paragraph styles, a variety of text styling options, footnotes, and
multi-column page layouts. 'ms' supports the 'tbl', 'eqn', 'pic', and
'refer' preprocessors for inclusion of tables, mathematical equations,
diagrams, and consistently formatted bibliographic citations. 'groff'
'ms' is mostly compatible with the documented interface and behavior of
AT&T Unix Version 7 'ms'. It recreates most extensions from 4.2BSD
(Berkeley) and Research Tenth Edition Unix.
4.6.1 Introduction
------------------
The 'ms' macros are the oldest surviving package for 'roff' systems.(1)
(*note ms Introduction-Footnote-1::) Whereas 'man' suits brief
references, 'ms' can handle long or complex works intended for printing
and possible publication.
Macro, register, and string descriptions frequently mention each
other; most references are to macros. Where a register or string is
referenced, we annotate its type. 'ms''s identifiers use only capital
letters, numerals, and '-'.
(1) While manual _pages_ are older, early ones used macros supplanted
by the 'man' package of Seventh Edition Unix (1979). 'ms' shipped with
Sixth Edition (1975) and was documented by Mike Lesk in a Bell Labs
internal memorandum.
4.6.1.1 Basic information
.........................
Prepare an 'ms' document with your preferred text editor. Call an 'ms'
macro early in the document to initialize the package. A "macro" is a
formatting instruction to 'ms'. Put a macro call on a line by itself
with a dot before its name. Use '.PP' if you want your paragraph's
first line indented, or '.LP' if you don't. Then type text normally.
It is a good practice to start each sentence on a new line, or to put
two spaces after sentence-ending punctuation, so that the formatter
knows where the sentence boundaries are. You can separate paragraphs
with further paragraphing macros, or with blank lines, and you can
indent with tabs. When you need one of the features mentioned earlier
(*note ms::), return to this subsection.
Format the document with the 'groff' command. 'nroff' can be useful
for previewing.
$ editor radical.ms # vim, emacs, nano, ...
$ nroff -ww -z -ms radical.ms # check for errors
$ nroff -ms radical.ms | less -R
$ groff -T ps -ms radical.ms > radical.ps
$ see radical.ps # or your favorite PDF viewer
Our 'radical.ms' document might look like this.
.LP
Radical novelties are so disturbing that they tend to be
suppressed or ignored, to the extent that even the
possibility of their existence in general is more often
denied than admitted.
->That's what Dijkstra said, anyway.
'ms' exposes many aspects of document layout to user control via
'groff''s "registers" and "strings", which store numbers and text,
respectively. Measurements in 'groff' are expressed with a suffix
called a "scaling unit".
'i'
inches
'c'
centimeters
'p'
points (1/72 inch)
'P'
picas (1/6 inch)
'v'
vees; current vertical spacing
'm'
ems; width of an "M" in the current font
'n'
ens; one-half em (same as 'm' on terminals)
Set registers with the 'nr' request and strings with the 'ds'
request. "Requests" are like macro calls; they go on lines by
themselves and start with the "control character", a dot ('.'). The
difference is that they directly instruct the formatter program, rather
than the macro package. We'll discuss a few as applicable. It is wise
to specify a scaling unit when setting any register that represents a
length, size, or distance.
.nr PS 10.5p \" Use 10.5-point type.
.ds FAM P \" Use Palatino font family.
In the foregoing, we see that '\"' begins a comment. This is an example
of an "escape sequence", the other kind of formatting instruction.
Escape sequences can appear almost anywhere. They begin with the escape
character ('\') and are followed by at least one more character. 'ms'
documents tend to use only a few of 'groff''s many requests and escape
sequences; see *note Request Index:: and *note Escape Sequence Index::
or the 'groff(7)' man page for complete lists.
'\"'
Begin comment; ignore remainder of line.
'\n[REG]'
Interpolate value of register REG.
'\nR'
abbreviation of '\n[R]'; the name R must be only one character
'\*[STR]'
Interpolate contents of string STR.
'\*S'
abbreviation of '\*[S]'; the name S must be only one character
'\[CHAR]'
Interpolate glyph of special character named CHAR.
'\&'
dummy character
'\~'
Insert an unbreakable space that is adjustable like a normal space.
'\|'
Move horizontally by one-sixth em ("thin space").
Prefix any words that start with a dot '.' or neutral apostrophe '''
with '\&' if they are at the beginning of an input line (or might become
that way in editing) to prevent them from being interpreted as macro
calls or requests. Suffix '.', '?', and '!' with '\&' when needed to
cancel end-of-sentence detection.
My exposure was \&.5 to \&.6 Sv of neutrons, said Dr.\&
Wallace after the criticality incident.
4.6.2 Document Structure
------------------------
The 'ms' macro package expects a certain amount of structure: a
well-formed document contains at least one paragraphing or heading macro
call. Organize longer documents as follows.
*Document type*
Calling the 'RP' macro at the beginning of your document puts the
document description (see below) on a cover page. Otherwise, 'ms'
places the information (if any) on the first page, followed
immediately by the body text. Some document types found in other
'ms' implementations are specific to AT&T or Berkeley, and are not
supported by 'groff' 'ms'.
*Format and layout*
By setting registers and strings, you can configure your document's
typeface, margins, spacing, headers and footers, and footnote
arrangement. *Note ms Document Control Settings::.
*Document description*
A document description consists of any of: a title, one or more
authors' names and affiliated institutions, an abstract, and a date
or other identifier. *Note ms Document Description Macros::.
*Body text*
The main matter of your document follows its description (if any).
'ms' supports highly structured text consisting of paragraphs
interspersed with multi-level headings (chapters, sections,
subsections, and so forth) and augmented by lists, footnotes,
tables, diagrams, and similar material. *Note ms Body Text::.
*Tables of contents*
Macros enable the collection of entries for a table of contents (or
index) as the material they discuss appears in the document. A
macro call at the end of the document emits the collected entries.
This material necessarily follows the rest of the text since
'troff' is a single-pass formatter; it cannot determine the page
number of a division of the text until it has been set and output.
Since 'ms' output was designed for the production of hard copy, the
traditional procedure was to manually relocate the pages containing
the table of contents between the cover page and the body text.
Today, page resequencing is more often done in the digital domain.
An index works similarly, but because it typically needs to be
sorted after collection, its preparation requires separate
processing.
4.6.3 Document Control Settings
-------------------------------
'ms' exposes many aspects of document layout to user control via 'groff'
requests. To use them, you must understand how to define registers and
strings.
-- Request: .nr reg value
Set register REG to VALUE.
-- Request: .ds name contents
Set string NAME to CONTENTS.
A list of document control registers and strings follows. For any
parameter whose default is unsatisfactory, define its register or string
before calling any 'ms' macro other than 'RP'.
Margin settings
...............
-- Register: \n[PO]
Defines the page offset (i.e., the left margin).
Effective: next page.
Default: Varies by output device and paper format; 1i is used for
typesetters using U.S. letter paper, and zero for terminals. *Note
Paper Format::.
-- Register: \n[LL]
Defines the line length (i.e., the width of the body text).
Effective: next paragraph.
Default: Varies by output device and paper format; 6.5i is used for
typesetters using U.S. letter paper (*note Paper Format::) and 65n
on terminals.
-- Register: \n[LT]
Defines the title line length (i.e., the header and footer width).
This is usually the same as 'LL', but need not be.
Effective: next paragraph.
Default: Varies by output device and paper format; 6.5i is used for
typesetters using U.S. letter paper (*note Paper Format::) and 65n
on terminals.
-- Register: \n[HM]
Defines the header margin height at the top of the page.
Effective: next page.
Default: 1i.
-- Register: \n[FM]
Defines the footer margin height at the bottom of the page.
Effective: next page.
Default: 1i.
Titles (headers, footers)
.........................
-- String: \*[LH]
Defines the text displayed in the left header position.
Effective: next header.
Default: empty.
-- String: \*[CH]
Defines the text displayed in the center header position.
Effective: next header.
Default: '-\n[%]-'.
-- String: \*[RH]
Defines the text displayed in the right header position.
Effective: next header.
Default: empty.
-- String: \*[LF]
Defines the text displayed in the left footer position.
Effective: next footer.
Default: empty.
-- String: \*[CF]
Defines the text displayed in the center footer position.
Effective: next footer.
Default: empty.
-- String: \*[RF]
Defines the text displayed in the right footer position.
Effective: next footer.
Default: empty.
Text settings
.............
-- Register: \n[PS]
Defines the type size of the body text.
Effective: next paragraph.
Default: 10p.
-- Register: \n[VS]
Defines the vertical spacing (type size plus leading).
Effective: next paragraph.
Default: 12p.
-- Register: \n[HY]
Defines the automatic hyphenation mode used with the 'hy' request.
Setting 'HY' to 0 disables automatic hyphenation. This is a
Research Tenth Edition Unix extension.
Effective: next paragraph.
Default: 6.
-- String: \*[FAM]
Defines the font family used to typeset the document. This is a
GNU extension.
Effective: next paragraph.
Default: defined by the output device; often 'T' (*note ms Body
Text::)
Paragraph settings
..................
-- Register: \n[PI]
Defines the indentation amount used by the 'PP', 'IP' (unless
overridden by an optional argument), 'XP', and 'RS' macros.
Effective: next paragraph.
Default: 5n.
-- Register: \n[PD]
Defines the space between paragraphs.
Effective: next paragraph.
Default: 0.3v (1v on low-resolution devices).
-- Register: \n[QI]
Defines the indentation amount used on both sides of a paragraph
set with the 'QP' or between the 'QS' and 'QE' macros.
Effective: next paragraph.
Default: 5n.
-- Register: \n[PORPHANS]
Defines the minimum number of initial lines of any paragraph that
must be kept together to avoid isolated lines at the bottom of a
page. If a new paragraph is started close to the bottom of a page,
and there is insufficient space to accommodate 'PORPHANS' 'groff'
'ms' forces a page break before formatting the paragraph. This is
a GNU extension.
Effective: next paragraph.
Default: 1.
Heading settings
................
-- Register: \n[PSINCR]
Defines an increment in type size to be applied to a heading at a
lesser depth than that specified in 'GROWPS'. The value of
'PSINCR' should be specified in points with the p scaling unit and
may include a fractional component; for example, '.nr PSINCR 1.5p'
sets a type size increment of 1.5p. This is a GNU extension.
Effective: next heading.
Default: 1p.
-- Register: \n[GROWPS]
Defines the heading depth above which the type size increment set
by 'PSINCR' becomes effective. For each heading depth less than
the value of 'GROWPS', the type size is increased by 'PSINCR'.
Setting 'GROWPS' to any value less than 2 disables the incremental
heading size feature. This is a GNU extension.
Effective: next heading.
Default: 0.
-- Register: \n[HORPHANS]
Defines the minimum number of lines of an immediately succeeding
paragraph that should be kept together with any heading introduced
by the 'NH' or 'SH' macros. If a heading is placed close to the
bottom of a page, and there is insufficient space to accommodate
both the heading and at least 'HORPHANS' lines of the following
paragraph, before an automatic page break, then the page break is
forced before the heading. This is a GNU extension.
Effective: next paragraph.
Default: 1.
-- String: \*[SN-STYLE]
Defines the style used to print numbered headings. *Note Headings
in ms::. This is a GNU extension.
Effective: next heading.
Default: alias of 'SN-DOT'
Footnote settings
.................
-- Register: \n[FI]
Defines the footnote indentation. This is a Berkeley extension.
Effective: next footnote.
Default: 2n.
-- Register: \n[FF]
Defines the format of automatically numbered footnotes, and those
for which the 'FS' request is given a MARK argument, at the bottom
of a column or page. This is a Berkeley extension.
'0'
Set an automatic number(1) (*note ms Document Control
Settings-Footnote-1::) as a superscript (on typesetters) or
surrounded by square brackets (on terminals). The footnote
paragraph is indented as with 'PP' if there is an 'FS'
argument or an automatic number, and as with 'LP' otherwise.
This is the default.
'1'
As '0', but set MARK as regular text, and follow an automatic
number with a period.
'2'
As '1', but without indentation (like 'LP').
'3'
As '1', but set the footnote paragraph with MARK hanging (like
'IP').
Effective: next footnote.
Default: 0.
-- Register: \n[FPS]
Defines the footnote type size.
Effective: next footnote.
Default: '\n[PS] - 2p'.
-- Register: \n[FVS]
Defines the footnote vertical spacing.
Effective: next footnote.
Default: '\n[FPS] + 2p'.
-- Register: \n[FPD]
Defines the footnote paragraph spacing. This is a GNU extension.
Effective: next footnote.
Default: '\n[PD] / 2'.
-- String: \*[FR]
Defines the ratio of the footnote line length to the current line
length. This is a GNU extension.
Effective: next footnote if single-column layout, next page
otherwise.
Default: '11/12'.
Display settings
................
-- Register: \n[DD]
Sets the display distance--the vertical spacing before and after a
display, a 'tbl' table, an 'eqn' equation, or a 'pic' image. This
is a Berkeley extension.
Effective: next display boundary.
Default: 0.5v (1v on low-resolution devices).
-- Register: \n[DI]
Sets the default amount by which to indent a display started with
'DS' and 'ID' without arguments, to '.DS I' without an indentation
argument, and to equations set with '.EQ I'. This is a GNU
extension.
Effective: next indented display.
Default: 0.5i.
Other settings
..............
-- Register: \n[MINGW]
Defines the default minimum width between columns in a multi-column
document. This is a GNU extension.
Effective: next page.
Default: 2n.
-- Register: \n[TC-MARGIN]
Defines the width of the field in which page numbers are set in a
table of contents entry; the right margin thus moves inboard by
this amount. This is a GNU extension.
Effective: next 'PX' call.
Default: '\w'000''
(1) defined in *note ms Footnotes::
4.6.4 Document Description Macros
---------------------------------
Only the simplest document lacks a title.(1) (*note ms Document
Description Macros-Footnote-1::) As its level of sophistication (or
complexity) increases, it tends to acquire a date of revision,
explicitly identified authors, sponsoring institutions for authors, and,
at the rarefied heights, an abstract of its content. Define these data
by calling the macros below in the order shown; 'DA' or 'ND' can be
called to set the document date (or other identifier) at any time before
(a) the abstract, if present, or (b) its information is required in a
header or footer. Use of these macros is optional, except that 'TL' is
mandatory if any of 'RP', 'AU', 'AI', or 'AB' is called, and 'AE' is
mandatory if 'AB' is called.
-- Macro: .RP ['no-repeat-info'] ['no-renumber']
Use the "report" (AT&T: "released paper") format for your document,
creating a separate cover page. The default arrangement is to
place most of the document description (title, author names and
institutions, and abstract, but not the date) at the top of the
first page. If the optional 'no-repeat-info' argument is given,
'ms' produces a cover page but does not repeat any of its
information subsequently (but see the 'DA' macro below regarding
the date). Normally, 'RP' sets the page number following the cover
page to 1. Specifying the optional 'no-renumber' argument
suppresses this alteration. Optional arguments can occur in any
order. 'ms' recognizes 'no' as a synonym of 'no-repeat-info' to
maintain AT&T compatibility. Options other than 'no' are GNU
extensions.
-- Macro: .TL
Specify the document title. 'ms' collects text on input lines
following this call into the title until reaching 'AU', 'AB', or a
heading or paragraphing macro call.
-- Macro: .AU
Specify an author's name. 'ms' collects text on input lines
following this call into the author's name until reaching 'AI',
'AB', another 'AU', or a heading or paragraphing macro call. Call
it repeatedly to specify multiple authors.
-- Macro: .AI
Specify the preceding author's institutional affiliation. An 'AU'
call is usefully followed by at most one 'AI' call; if there are
more, the last 'AI' call controls. 'ms' collects text on input
lines following this call into the author's institution until
reaching 'AU', 'AB', or a heading or paragraphing macro call.
-- Macro: .DA [x ...]
Typeset the current date, or any arguments X, in the center footer,
and, if 'RP' is also called, left-aligned at the end of the
description information on the cover page.
-- Macro: .ND [x ...]
Typeset the current date, or any arguments X, if 'RP' is also
called, left-aligned at the end of the document description on the
cover page. This is 'groff' 'ms''s default.
-- Macro: .AB ['no']
Begin the abstract. 'ms' collects text on input lines following
this call into the abstract until reaching an 'AE' call. By
default, 'ms' places the word "ABSTRACT" centered and in italics
above the text of the abstract. The optional argument 'no'
suppresses this heading.
-- Macro: .AE
End the abstract.
An example document description, using a cover page, follows.
.RP
.TL
The Inevitability of Code Bloat
in Commercial and Free Software
.AU
J.\& Random Luser
.AI
University of West Bumblefuzz
.AB
This report examines the long-term growth of the code
bases in two large,
popular software packages;
the free Emacs and the commercial Microsoft Word.
While differences appear in the type or order of
features added,
due to the different methodologies used,
the results are the same in the end.
.PP
The free software approach is shown to be superior in
that while free software can become as bloated as
commercial offerings,
free software tends to have fewer serious bugs and the
added features are more in line with user demand.
.AE
...the rest of the paper...
(1) Distinguish a document title from "titles", which are what 'roff'
systems call headers and footers collectively.
4.6.5 Body Text
---------------
A variety of macros, registers, and strings can be used to structure and
style the body of your document. They organize your text into
paragraphs, headings, footnotes, and inclusions of material such as
tables and figures.
4.6.5.1 Text settings
.....................
The 'FAM' string, a GNU extension, sets the font family for body text;
the default is 'T'. The 'PS' and 'VS' registers set the type size and
vertical spacing (distance between text baselines), respectively. The
font family and type size are ignored on terminals. Set these
parameters before the first call of a heading, paragraphing, or
(non-date) document description macro to apply them to headers, footers,
and (for 'FAM') footnotes.
Which font families are available depends on the output device; as a
convention, 'T' selects a serif family ("Times"), 'H' a sans-serif
family ("Helvetica"), and 'C' a monospaced family ("Courier"). The man
page for the output driver documents its font repertoire. Consult the
'groff(1)' man page for lists of available output devices and their
drivers.
The hyphenation mode (as used by the 'hy' request) is set from the
'HY' register. Setting 'HY' to '0' is equivalent to using the 'nh'
request. This is a Research Tenth Edition Unix extension.
4.6.5.2 Typographical symbols
.............................
'ms' provides a few strings to obtain typographical symbols not easily
entered with the keyboard. These and many others are available as
special character escape sequences--see the 'groff_char(7)' man page.
-- String: \*[-]
Interpolate an em dash.
-- String: \*[Q]
-- String: \*[U]
Interpolate typographer's quotation marks where available, and
neutral double quotes otherwise. '\*Q' is the left quote and '\*U'
the right.
4.6.5.3 Paragraphs
..................
Paragraphing macros "break", or terminate, any pending output line so
that a new paragraph can begin. Several paragraph types are available,
differing in how indentation applies to them: to left, right, or both
margins; to the first output line of the paragraph, all output lines, or
all but the first. These calls insert vertical space in the amount
stored in the 'PD' register, except at page or column breaks.
Alternatively, a blank input line breaks the output line and vertically
spaces by one vee.
-- Macro: .LP
Set a paragraph without any (additional) indentation.
-- Macro: .PP
Set a paragraph with a first-line left indentation in the amount
stored in the 'PI' register.
-- Macro: .IP [mark [width]]
Set a paragraph with a left indentation. The optional MARK is not
indented and is empty by default. It has several applications; see
*note Lists in ms::. WIDTH overrides the indentation amount stored
in the 'PI' register; its default unit is 'n'. Once specified,
WIDTH applies to further 'IP' calls until specified again or a
heading or different paragraphing macro is called.
-- Macro: .QP
Set a paragraph indented from both left and right margins by the
amount stored in the 'QI' register.
-- Macro: .QS
-- Macro: .QE
Begin ('QS') and end ('QE') a region where each paragraph is
indented from both margins by the amount stored in the 'QI'
register. The text between 'QS' and 'QE' can be structured further
by use of other paragraphing macros.
-- Macro: .XP
Set an "exdented" paragraph--one with a left indentation in the
amount stored in the 'PI' register on every line _except_ the first
(also known as a hanging indent). This is a Berkeley extension.
The following example illustrates the use of paragraphing macros.
.NH 2
Cases used in the 2001 study
.LP
Two software releases were considered for this report.
.PP
The first is commercial software;
the second is free.
.IP \[bu]
Microsoft Word for Windows,
starting with version 1.0 through the current version
(Word 2000).
.IP \[bu]
GNU Emacs,
from its first appearance as a standalone editor through
the current version (v20).
See [Bloggs 2002] for details.
.QP
Franklin's Law applied to software:
software expands to outgrow both RAM and disk space over
time.
.SH
Bibliography
.XP
Bloggs, Joseph R.,
.I "Everyone's a Critic" ,
Underground Press, March 2002.
A definitive work that answers all questions and
criticisms about the quality and usability of free
software.
4.6.5.4 Headings
................
Use headings to create a sequential or hierarchical structure for your
document. The 'ms' macros print headings in *bold* using the same font
family and, by default, type size as the body text. Headings are
available with and without automatic numbering. Text on input lines
following the macro call becomes the heading's title. Call a
paragraphing macro to end the heading text and start the section's
content.
-- Macro: .NH [depth]
-- Macro: .NH S heading-depth-index ...
Set an automatically numbered heading.
'ms' produces a numbered heading the form A.B.C..., to any depth
desired, with the numbering of each depth increasing automatically
and being reset to zero when a more significant level is increased.
"1" is the most significant or coarsest division of the document.
Only non-zero values are output. If DEPTH is omitted, 'ms' assumes
'1'.
If you specify DEPTH such that an ascending gap occurs relative to
the previous 'NH' call--that is, you "skip a depth", as by '.NH 1'
and then '.NH 3'--'groff' 'ms' emits a warning on the standard
error stream.
Alternatively, you can give 'NH' a first argument of 'S', followed
by integers to number the heading depths explicitly. Further
automatic numbering, if used, resumes using the specified indices
as their predecessors. This feature is a Berkeley extension.
An example may be illustrative.
.NH 1
Animalia
.NH 2
Arthropoda
.NH 3
Crustacea
.NH 2
Chordata
.NH S 6 6 6
Daimonia
.NH 1
Plantae
The above results in numbering as follows; the vertical space that
normally precedes each heading is omitted.
1. Animalia
1.1. Arthropoda
1.1.1. Crustacea
1.2. Chordata
6.6.6. Daimonia
7. Plantae
-- String: \*[SN-STYLE]
-- String: \*[SN-DOT]
-- String: \*[SN-NO-DOT]
-- String: \*[SN]
After 'NH' is called, the assigned number is made available in the
strings 'SN-DOT' (as it appears in a printed heading with default
formatting, followed by a terminating period) and 'SN-NO-DOT' (with
the terminating period omitted). These (and 'SN-STYLE') are GNU
extensions.
You can control the style used to print numbered headings by
defining an appropriate alias for the string 'SN-STYLE'. By
default, 'SN-STYLE' is aliased to 'SN-DOT'. If you prefer to omit
the terminating period from numbers appearing in numbered headings,
you may define the alias as follows.
.als SN-STYLE SN-NO-DOT
Any such change in numbering style becomes effective from the next
use of 'NH' following redefinition of the alias for 'SN-STYLE'.
The formatted number of the current heading is available in the
'SN' string (a feature first documented by Berkeley), which
facilitates its inclusion in, for example, table captions, equation
labels, and 'XS'/'XA'/'XE' table of contents entries.
-- Macro: .SH [depth]
Set an unnumbered heading.
The optional DEPTH argument is a GNU extension indicating the
heading depth corresponding to the DEPTH argument of 'NH'. It
matches the type size at which the heading is set to that of a
numbered heading at the same depth when the 'GROWPS' and 'PSINCR'
heading size adjustment mechanism is in effect.
If the 'GROWPS' register is set to a value greater than the LEVEL
argument to 'NH' or 'SH', the type size of a heading produced by these
macros increases by 'PSINCR' units over the size specified by 'PS'
multiplied by the difference of 'GROWPS' and LEVEL. The value stored in
'PSINCR' is interpreted in 'groff' basic units; the 'p' scaling unit
should be employed when assigning a value specified in points.
The input
.nr PS 10
.nr GROWPS 3
.nr PSINCR 1.5p
.NH 1
Carnivora
.NH 2
Felinae
.NH 3
Felis catus
.SH 2
Machairodontinae
causes "1. Carnivora" to be printed in 13-point type, followed by "1.1.
Felinae" in 11.5-point type, while "1.1.1. Felis catus" and all more
deeply nested heading levels remains in the 10-point type specified by
the 'PS' register. "Machairodontinae" is printed at 11.5 points, since
it corresponds to heading level 2.
In 'groff' 'ms', the 'NH' and 'SH' macros consult the 'HORPHANS'
register to prevent the output of isolated headings at the bottom of a
page; it specifies the minimum number of lines of an immediately
subsequent paragraph that must be kept on the same page as the heading.
If insufficient space remains on the current page to accommodate the
heading and this number of lines of paragraph text, 'groff' 'ms' forces
a page break before setting the heading. Any display macro call or
'tbl', 'pic', or 'eqn' region between the heading and the subsequent
paragraph suppresses this grouping. *Note ms keeps and displays:: and
*note ms Insertions::.
4.6.5.5 Typeface and decoration
...............................
The 'ms' macros provide a variety of ways to style text. Attend closely
to the ordering of arguments labeled PRE and POST, which is not
intuitive. Support for PRE arguments is a GNU extension.(1) (*note
Typeface and decoration-Footnote-1::)
-- Macro: .B [text [post [pre]]]
Style TEXT in bold, followed by POST in the previous font style
without intervening space, and preceded by PRE similarly. Without
arguments, 'ms' styles subsequent text in bold until the next
paragraphing, heading, or no-argument typeface macro call.
-- Macro: .R [text [post [pre]]]
As 'B', but use the roman style (upright text of normal weight)
instead of bold. Argument recognition is a GNU extension.
-- Macro: .I [text [post [pre]]]
As 'B', but use an italic or oblique style instead of bold.
-- Macro: .BI [text [post [pre]]]
As 'B', but use a bold italic or bold oblique style instead of
upright bold. This is a Research Tenth Edition Unix extension.
-- Macro: .CW [text [post [pre]]]
As 'B', but use a constant-width (monospaced) roman typeface
instead of bold. This is a Research Tenth Edition Unix extension.
-- Macro: .BX [text]
Typeset TEXT and draw a box around it. On terminals, reverse video
or another means of highlighting is used instead. If you want TEXT
to contain space, use unbreakable space or horizontal motion escape
sequences ('\~', '\', '\^', '\|', '\0' or '\h').
-- Macro: .UL [text [post]]
Typeset TEXT with an underline. On terminals, TEXT is bracketed
with underscores '_'. POST, if present, is set after TEXT with no
intervening space.
-- Macro: .LG
Set subsequent text in larger type (two points larger than the
current size) until the next type size, paragraphing, or heading
macro call. Call the macro multiple times to enlarge the type size
further.
-- Macro: .SM
Set subsequent text in smaller type (two points smaller than the
current size) until the next type size, paragraphing, or heading
macro call. Call the macro multiple times to reduce the type size
further.
-- Macro: .NL
Set subsequent text at the normal type size (the amount in register
'PS').
PRE and POST arguments are typically used to simplify the attachment
of punctuation to styled words. When PRE is used, a hyphenation control
escape sequence '\%' that would ordinarily start TEXT must start PRE
instead to have the desired effect.
The CS course's students found one C language keyword
.CW static ) \%(
most troublesome.
The foregoing example produces output as follows.
The CS course's students found one C language keyword (static)
most troublesome.
You can use the output line continuation escape sequence '\c' to
achieve the same result (*note Line Continuation::). It is also
portable to older 'ms' implementations.
The CS course's students found one C language keyword
\%(\c
.CW \%static )
most troublesome.
'groff' 'ms' also offers strings to begin and end super- and
subscripting. These are GNU extensions.
-- String: \*[{]
-- String: \*[}]
Begin and end superscripting, respectively.
-- String: \*[<]
-- String: \*[>]
Begin and end subscripting, respectively.
Rather than calling the 'CW' macro, in 'groff' 'ms' you might prefer
to change the font family to Courier by setting the 'FAM' string to 'C'.
You can then use all four style macros above, returning to the default
family (Times) with '.ds FAM T'. Because changes to 'FAM' take effect
only at the next paragraph, 'CW' remains useful to "inline" a change to
the font family, similarly to the practice of this document in noting
syntactical elements of 'ms' and 'groff'.
(1) This idiosyncrasy arose through feature accretion; for example,
the 'B' macro in Sixth Edition Unix 'ms' (1975) accepted only one
argument, the text to be set in boldface. By Version 7 (1979) it
recognized a second argument; in 1990, 'groff' 'ms' added a "pre"
argument, placing it third to avoid breaking support for older
documents.
4.6.5.6 Lists
.............
The MARK argument to the 'IP' macro can be employed to present a variety
of lists; for instance, you can use a bullet glyph ('\[bu]') for
unordered lists, a number (or auto-incrementing register) for numbered
lists, or a word or phrase for glossary-style or definition lists. If
you set the paragraph indentation register 'PI' before calling 'IP', you
can later reorder the items in the list without having to ensure that a
WIDTH argument remains affixed to the first call.
The following is an example of a bulleted list.
.nr PI 2n
A bulleted list:
.IP \[bu]
lawyers
.IP \[bu]
guns
.IP \[bu]
money
A bulleted list:
* lawyers
* guns
* money
The following is an example of a numbered list.
.nr step 0 1
.nr PI 3n
A numbered list:
.IP \n+[step]
lawyers
.IP \n+[step]
guns
.IP \n+[step]
money
A numbered list:
1. lawyers
2. guns
3. money
Here we have employed the 'nr' request to create a register of our
own, 'step'. We initialized it to zero and assigned it an
auto-increment of 1. Each time we use the escape sequence '\n+[step]'
(note the plus sign), the formatter applies the increment just before
interpolating the register's value. Preparing the 'PI' register as well
enables us to rearrange the list without the tedium of updating macro
calls.
The next example illustrates a glossary-style list.
A glossary-style list:
.IP lawyers 0.4i
Two or more attorneys.
.IP guns
Firearms,
preferably large-caliber.
.IP money
Gotta pay for those
lawyers and guns!
A glossary-style list:
lawyers
Two or more attorneys.
guns Firearms, preferably large-caliber.
money
Gotta pay for those lawyers and guns!
In the previous example, observe how the 'IP' macro places the
definition on the same line as the term if it has enough space. If this
is not what you want, there are a few workarounds we illustrate by
modifying the example. First, you can use a 'br' request to force a
break after printing the term or label.
.IP guns
.br
Firearms,
Second, you could apply the '\p' escape sequence to force a break.
The space following the escape sequence is important; if you omit it,
'groff' prints the first word of the paragraph text on the same line as
the term or label (if it fits) _then_ breaks the line.
.IP guns
\p Firearms,
Finally, you may append a horizontal motion to the mark with the '\h'
escape sequence; using the same amount as the indentation ensures that
the mark is too wide for 'groff' to treat it as "fitting" on the same
line as the paragraph text.
.IP guns\h'0.4i'
Firearms,
In each case, the result is the same.
A glossary-style list:
lawyers
Two or more attorneys.
guns
Firearms, preferably large-caliber.
money
Gotta pay for those lawyers and guns!
4.6.5.7 Indented regions
........................
You can indent a region of text while otherwise formatting it normally.
Such indented regions can be nested; change '\n[PI]' before each call to
vary the amount of inset.
-- Macro: .RS
Begin a region where headings, paragraphs, and displays are
indented (further) by the amount stored in the 'PI' register.
-- Macro: .RE
End the (next) most recent indented region.
This feature enables you to easily line up text under hanging and
indented paragraphs. For example, you may wish to structure lists
hierarchically.
.IP \[bu] 2
Lawyers:
.RS
.IP \[bu]
Dewey,
.IP \[bu]
Cheatham,
and
.IP \[bu]
Howe.
.RE
.IP \[bu]
Guns
* Lawyers:
* Dewey,
* Cheatham, and
* Howe.
* Guns
4.6.5.8 Keeps, boxed keeps, and displays
........................................
On occasion, you may want to "keep" several lines of text, or a region
of a document, together on a single page, preventing an automatic page
break within certain boundaries. This can cause a page break to occur
earlier than it normally would. For example, you may want to keep two
paragraphs together, or a paragraph that refers to a table, list, or
figure adjacent to the item it discusses. 'ms' provides the 'KS' and
'KE' macros for this purpose.
You can alternatively specify a "floating keep": if a keep cannot fit
on the current page, 'ms' holds it, allowing material following the keep
(in the source document) to fill the remainder of the current page.
When the page breaks by reaching its bottom or by 'bp' request, 'ms'
puts the floating keep at the beginning of the next page. Use floating
keeps to house large graphics or tables that do not need to appear
exactly where they occur in the source document.
-- Macro: .KS
-- Macro: .KF
-- Macro: .KE
'KS' begins a keep, 'KF' a floating keep, and 'KE' ends a keep of
either kind.
As an alternative to the keep mechanism, the 'ne' request forces a
page break if there is not at least the amount of vertical space
specified in its argument remaining on the page (*note Page Control::).
One application of 'ne' is to reserve space on the page for a figure or
illustration to be included later.
A "boxed keep" has a frame drawn around it.
-- Macro: .B1
-- Macro: .B2
'B1' begins a keep with a box drawn around it. 'B2' ends a boxed
keep.
Boxed keep macros cause breaks; to box words within a line, recall
'BX' in *note Typeface and decoration::. 'ms' draws box lines close to
the text they enclose so that they are usable within paragraphs. When
boxing entire paragraphs thus, you may improve their appearance by
calling 'B1' after the first paragraphing macro, and invoking the 'sp'
request before calling 'B2'.
.LP
.B1
.I Warning:
Happy Fun Ball may suddenly accelerate to dangerous
speeds.
.sp \n[PD]/2 \" space by half the inter-paragraph distance
.B2
If you want a boxed keep to float, enclose the 'B1' and 'B2' calls
within a pair of 'KF' and 'KE' calls.
"Displays" turn off filling; lines of verse or program code are shown
with their lines broken as in the source document without requiring 'br'
requests between lines. Displays can be kept on a single page or
allowed to break across pages. The 'DS' macro begins a kept display of
the layout specified in its first argument; non-kept displays are begun
with dedicated macros corresponding to their layout.
-- Macro: .DS L
-- Macro: .LD
Begin ('DS': kept) left-aligned display.
-- Macro: .DS [I [indent]]
-- Macro: .ID [indent]
Begin ('DS': kept) display indented by INDENT if specified, and by
the amount of the 'DI' register otherwise.
-- Macro: .DS B
-- Macro: .BD
Begin a ('DS': kept) a block display: the entire display is
left-aligned, but indented such that the longest line in the
display is centered on the page.
-- Macro: .DS C
-- Macro: .CD
Begin a ('DS': kept) centered display: each line in the display is
centered.
-- Macro: .DS R
-- Macro: .RD
Begin a ('DS': kept) right-aligned display. This is a GNU
extension.
-- Macro: .DE
End any display.
'groff' 'ms' inserts the distance stored in the 'DD' register before
and after each pair of display macros; this is a Berkeley extension.
This distance replaces any adjacent inter-paragraph distance or
subsequent spacing prior to a section heading. The 'DI' register is a
GNU extension; its value is an indentation applied to displays created
with '.DS' and '.ID' without arguments, to '.DS I' without an
indentation argument, and to indented equations set with '.EQ'. Changes
to either register take effect at the next display boundary.
The display distance applies even in footnotes (discussed below),
which may cause a footnote with a display at its end to "emptily" spill
to the next page. Consider the following tactic to compensate.
.FS
Recall the ideal gas law.
.nr DD-saved \n[DD] \" stash display distance
.nr DD 0 \" eliminate automatic space around display
.sp \n[DD-saved]u \" manually put space before it
.EQ
P V = n R T
.EN
.FE
.nr DD \n[DD-saved] \" restore previous setting
4.6.5.9 Tables, figures, equations, and references
..................................................
'ms' often sees use with the 'tbl', 'pic', 'eqn', and 'refer'
preprocessors. Mark text meant for preprocessors by enclosing it in
pairs of tokens as follows, with nothing between the dot and the macro
name. Preprocessors match these tokens only at the start of an input
line. The formatter interprets them as macro calls.
-- Macro: .TS ['H']
-- Macro: .TE
Demarcate a table to be processed by the 'tbl' preprocessor. The
optional argument 'H' to 'TS' instructs 'ms' to repeat table rows
(often column headings) at the top of each new page the table
spans, if applicable; calling the 'TH' macro marks the end of such
rows. The GNU 'tbl(1)' man page provides a comprehensive reference
to the preprocessor and offers examples of its use.
-- Macro: .PS H V
-- Macro: .PE
-- Macro: .PF
'PS' begins a picture to be processed by the 'pic' preprocessor;
either of 'PE' or 'PF' ends it, the latter with "flyback" to the
vertical position at its top. Create 'pic' input manually or with
a program such as 'xfig'. H and V are the horizontal and vertical
dimensions of the picture; 'pic' supplies them automatically.
-- Macro: .EQ [align [label]]
-- Macro: .EN
Demarcate an equation to be processed by the 'eqn' preprocessor.
The equation is centered by default; ALIGN can be 'C', 'L', or 'I'
to (explicitly) center, left-align, or indent it by the amount
stored in the 'DI' register, respectively. If specified, LABEL is
set right-aligned.
-- Macro: .[
-- Macro: .]
Demarcate a bibliographic citation to be processed by the 'refer'
preprocessor. 'refer(1)' provides a comprehensive reference to the
preprocessor and the format of its bibliographic database.
When 'refer' emits collected references (as might be done on a "Works
Cited" page), it interpolates the 'REFERENCES' string as an unnumbered
heading ('SH').
The following is an example of how to set up a table that may print
across two or more pages.
.TS H
allbox;
Cb | Cb .
Part->Description
_
.TH
.T&
GH-1978->Fribulating gonkulator
...the rest of the table follows...
.TE
Attempting to place a multi-page table inside a keep can lead to
unpleasant results, particularly if the 'tbl' 'allbox' option is used.
Mathematics can be typeset using the language of the 'eqn'
preprocessor.
.EQ C (\*[SN-NO-DOT]a)
p ~ = ~ q sqrt { ( 1 + ~ ( x / q sup 2 ) }
.EN
This input formats a labelled equation. We used the 'SN-NO-DOT' string
to base the equation label on the current heading number, giving us more
flexibility to reorganize the document.
Create diagrams with 'pic'.
.PS
circle "input";
arrow;
box width 1.5i "\f[CR]groff -Rept -ms\f[]";
arrow;
circle "output";
.PE
'groff' options run preprocessors on the input: '-e' for 'eqn', '-p'
for 'pic', '-R' for 'refer', and '-t' for 'tbl'.
4.6.5.10 Footnotes
..................
A footnote is typically anchored to a place in the text with a "mark",
which is a small integer, a symbol such as a dagger, or arbitrary
user-specified text.
-- String: \*[*]
Place an "automatic number", an automatically generated numeric
footnote mark, in the text. Each time this string is interpolated,
the number it produces increments by one. Automatic numbers start
at 1. This is a Berkeley extension.
Enclose the footnote text in 'FS' and 'FE' macro calls to set it at
the nearest available "foot", or bottom, of a text column or page.
-- Macro: .FS [mark]
-- Macro: .FE
Begin ('FS') and end ('FE') a footnote. 'FS' calls 'FS-MARK' with
any supplied MARK argument, which is then also placed at the
beginning of the footnote text. If MARK is omitted, the next
pending automatic number enqueued by interpolation of the '*'
string is used, and if none exists, nothing is prefixed.
You may not desire automatically numbered footnotes in spite of their
convenience. You can indicate a footnote with a symbol or other text by
specifying its mark at the appropriate place (for example, by using
'\[dg]' for the dagger glyph) _and_ as an argument to the 'FS' macro.
Such manual marks should be repeated as arguments to 'FS' or as part of
the footnote text to disambiguate their correspondence. You may wish to
use '\*{' and '\*}' to superscript the mark at the anchor point, in the
footnote text, or both.
'groff' 'ms' provides a hook macro, 'FS-MARK', for user-determined
operations to be performed when the 'FS' macro is called. It is passed
the same arguments as 'FS' itself. An application of 'FS-MARK' is
anchor placement for a hyperlink reference, so that a footnote can link
back to its referential context. By default, this macro has an empty
definition. 'FS-MARK' is a GNU extension.
Footnotes can be safely used within keeps and displays, but you
should avoid using automatically numbered footnotes within floating
keeps. You can place a second '\**' interpolation between a '\**' and
its corresponding 'FS' call as long as each 'FS' call occurs _after_ the
corresponding '\**' and occurrences of 'FS' are in the same order as
corresponding occurrences of '\**'.
Footnote text is formatted as paragraphs are, using analogous
parameters. The registers 'FI', 'FPD', 'FPS', and 'FVS' correspond to
'PI', 'PD', 'PS', and 'CS', respectively; 'FPD', 'FPS', and 'FVS' are
GNU extensions.
The 'FF' register controls the formatting of automatically numbered
footnote paragraphs, and those for which 'FS' is given a MARK argument,
*Note ms Document Control Settings::.
The default footnote line length is 11/12ths of the normal line
length for compatibility with the expectations of historical 'ms'
documents; you may wish to set the 'FR' string to '1' to align with
contemporary typesetting practices. In the past,(1) (*note ms
Footnotes-Footnote-1::) an 'FL' register was used for the line length in
footnotes; however, setting this register at document initialization
time had no effect on the footnote line length in multi-column
arrangements.(2) (*note ms Footnotes-Footnote-2::)
Prefer the 'FR' string over the 'FL' register in contemporary
documents. The footnote line length is effectively computed as
'column-width * \*[FR]'. If you require an absolute footnote line
length, recall that 'roff' formatters evaluate numeric expressions
strictly from left to right, without operator precedence (parentheses
are honored).
.ds FR 0+3i \" Set footnote line length to 3 inches.
(1) Unix Version 7 'ms', its descendants, and GNU 'ms' prior to
'groff' version 1.23.0
(2) You could reset it after each call to '1C', '2C', or 'MC'.
4.6.5.11 Language and localization
..................................
'groff' 'ms' provides several strings that you can customize for your
own purposes, or redefine to adapt the macro package to languages other
than English. It is already localized for Czech, German, Spanish,
French, Italian, Polish, Russian, and Swedish. Load the desired
localization macro package after 'ms'; see 'groff_tmac(5)'.
$ groff -ms -mfr bienvenue.ms
The following strings are available.
-- String: \*[REFERENCES]
Contains the string printed at the beginning of a references
(bibliography) page produced with GNU 'refer(1)'. The default is
'References'.
-- String: \*[ABSTRACT]
Contains the string printed at the beginning of the abstract. The
default is '\f[I]ABSTRACT\f[]'; it includes font selection escape
sequences to set the word in italics.
-- String: \*[TOC]
Contains the string printed at the beginning of the table of
contents. The default is 'Table of Contents'.
-- String: \*[MONTH1]
-- String: \*[MONTH2]
-- String: \*[MONTH3]
-- String: \*[MONTH4]
-- String: \*[MONTH5]
-- String: \*[MONTH6]
-- String: \*[MONTH7]
-- String: \*[MONTH8]
-- String: \*[MONTH9]
-- String: \*[MONTH10]
-- String: \*[MONTH11]
-- String: \*[MONTH12]
Contain the full names of the calendar months. The defaults are in
English: 'January', 'February', and so on.
4.6.6 Page layout
-----------------
'ms''s default page layout arranges text in a single column with the
page number between hyphens centered in a header on each page except the
first, and produces no footers. You can customize this arrangement.
4.6.6.1 Headers and footers
...........................
There are multiple ways to produce headers and footers. One is to
define the strings 'LH', 'CH', and 'RH' to set the left, center, and
right headers, respectively; and 'LF', 'CF', and 'RF' to set the left,
center, and right footers. This approach suffices for documents that do
not distinguish odd- and even-numbered pages.
Another method is to call macros that set headers or footers for odd-
or even-numbered pages. Each such macro takes a delimited argument
separating the left, center, and right header or footer texts from each
other. You can replace the neutral apostrophes (''') shown below with
any character not appearing in the header or footer text. These macros
are Berkeley extensions.
-- Macro: .OH '''left'''center'''right'''
-- Macro: .EH '''left'''center'''right'''
-- Macro: .OF '''left'''center'''right'''
-- Macro: .EF '''left'''center'''right'''
The 'OH' and 'EH' macros define headers for odd- (recto) and
even-numbered (verso) pages, respectively; the 'OF' and 'EF' macros
define footers for them.
With either method, a percent sign '%' in header or footer text is
replaced by the current page number. By default, 'ms' places no header
on a page numbered "1" (regardless of its number format).
-- Macro: .P1
Typeset the header even on page 1. To be effective, this macro
must be called before the header trap is sprung on any page
numbered "1"; in practice, unless your page numbering is unusual,
this means that you should call it early, before 'TL' or any
heading or paragraphing macro. This is a Berkeley extension.
For even greater flexibility, 'ms' is designed to permit the
redefinition of the macros that are called when formatter traps that
ordinarily cause the headers and footers to be output are sprung. 'PT'
("page trap") is called by 'ms' when the header is to be written, and
'BT' ("bottom trap") when the footer is to be. The 'groff' page
location trap that 'ms' sets up to format the header also calls the
(normally undefined) 'HD' macro after 'PT'; you can define 'HD' if you
need additional processing after setting the header (for example, to
draw a line below it). The 'HD' hook is a Berkeley extension. Any such
macros you (re)define must implement any desired specialization for
odd-, even-, or first numbered pages.
4.6.6.2 Tab stops
.................
Use the 'ta' request to define tab stops as needed. *Note Tabs and
Fields::.
-- Macro: .TA
Reset the tab stops to the 'ms' default (every 5 ens). Redefine
this macro to create a different set of default tab stops.
4.6.6.3 Margins
...............
Control margins using the registers summarized in "Margin settings" in
*note ms Document Control Settings:: above. There is no setting for the
right margin; the combination of page offset '\n[PO]' and line length
'\n[LL]' determines it.
4.6.6.4 Multiple columns
........................
'ms' can set text in as many columns as reasonably fit on the page. The
following macros force a page break if a multi-column layout is active
when they are called. The 'MINGW' register stores the default minimum
gutter width; it is a GNU extension. When multiple columns are in use,
keeps and the 'HORPHANS' and 'PORPHANS' registers work with respect to
column breaks instead of page breaks.
-- Macro: .1C
Arrange page text in a single column (the default).
-- Macro: .2C
Arrange page text in two columns.
-- Macro: .MC [column-width [gutter-width]]
Arrange page text in multiple columns. If you specify no
arguments, it is equivalent to the '2C' macro. Otherwise,
COLUMN-WIDTH is the width of each column and GUTTER-WIDTH is the
minimum distance between columns.
4.6.6.5 Creating a table of contents
....................................
Because 'roff' formatters process their input in a single pass, material
on page 50, for example, cannot influence what appears on page 1--this
poses a challenge for a table of contents at its traditional location in
front matter, if you wish to avoid manually maintaining it. 'ms'
enables the collection of material to be presented in the table of
contents as it appears, saving its page number along with it, and then
emitting the collected contents on demand toward the end of the
document. The table of contents can then be resequenced to its desired
location by physically rearranging the pages of a printed document, or
as part of post-processing--with a 'sed(1)' script to reorder the pages
in 'troff''s output, with 'pdfjam(1)', or with 'gropdf(1)''s
'pdfswitchtopage' macro, for example.
Define an entry to appear in the table of contents by bracketing its
text between calls to the 'XS' and 'XE' macros. A typical application
is to call them immediately after 'NH' or 'SH' and repeat the heading
text within them. The 'XA' macro, used within '.XS'/'.XE' pairs,
supplements an entry--for instance, when it requires multiple output
lines, whether because a heading is too long to fit or because style
dictates that page numbers not be repeated. You may wish to indent the
text thus wrapped to correspond to its heading depth; this can be done
in the entry text by prefixing it with tabs or horizontal motion escape
sequences, or by providing a second argument to the 'XA' macro. 'XS'
and 'XA' automatically associate the page number where they are called
with the text following them, but they accept arguments to override this
behavior. At the end of the document, call 'TC' or 'PX' to emit the
table of contents; 'TC' resets the page number to 'i' (Roman numeral
one), and then calls 'PX'. All of these macros are Berkeley extensions.
-- Macro: .XS [page-number]
-- Macro: .XA [page-number [indentation]]
-- Macro: .XE
Begin, supplement, and end a table of contents entry. Each entry
is associated with PAGE-NUMBER (otherwise the current page number);
a PAGE-NUMBER of 'no' prevents a leader and page number from being
emitted for that entry. Use of 'XA' within 'XS'/'XE' is optional;
it can be repeated. If INDENTATION is present, a supplemental
entry is indented by that amount; ens are assumed if no unit is
indicated. Text on input lines between 'XS' and 'XE' is stored for
later recall by 'PX'.
-- Macro: .PX ['no']
Switch to single-column layout. Unless 'no' is specified, center
and interpolate the 'TOC' string in bold and two points larger than
the body text. Emit the table of contents entries.
-- Macro: .TC ['no']
Set the page number to 1, the page number format to lowercase Roman
numerals, and call 'PX' (with a 'no' argument, if present).
Here's an example of typical 'ms' table of contents preparation. We
employ horizontal escape sequences '\h' to indent the entries by
sectioning depth.
.NH 1
Introduction
.XS
Introduction
.XE
...
.NH 2
Methodology
.XS
\h'2n'Methodology
.XA
\h'4n'Fassbinder's Approach
\h'4n'Kahiu's Approach
.XE
...
.NH 1
Findings
.XS
Findings
.XE
...
.TC
The remaining features in this subsubsection are GNU extensions.
'groff' 'ms' obviates the need to repeat heading text after 'XS' calls.
Call 'XN' and 'XH' after 'NH' and 'SH', respectively.
-- Macro: .XN heading-text
-- Macro: .XH depth heading-text
Format HEADING-TEXT and create a corresponding table of contents
entry. 'XN' computes the indentation from the depth of the
preceding 'NH' call; 'XH' requires a DEPTH argument to do so.
'groff' 'ms' encourages customization of table of contents entry
production.
-- Macro: .XN-REPLACEMENT heading-text
-- Macro: .XH-REPLACEMENT depth heading-text
These hook macros implement 'XN' and 'XH', respectively. They call
'XN-INIT' and pass their HEADING-TEXT arguments to 'XH-UPDATE-TOC'.
-- Macro: .XN-INIT
-- Macro: .XH-UPDATE-TOC depth heading-text
The 'XN-INIT' hook macro does nothing by default. 'XH-UPDATE-TOC'
brackets HEADING-TEXT with 'XS' and 'XE' calls, indenting it by 2
ens per level of DEPTH beyond the first.
We could therefore produce a table of contents similar to that in the
previous example with fewer macro calls. (The difference is that this
input follows the "Approach" entries with leaders and page numbers.)
.NH 1
.XN Introduction
...
.NH 2
.XN Methodology
.XH 3 "Fassbinder's Approach"
.XH 3 "Kahiu's Approach"
...
.NH 1
.XN Findings
...
To get the section number of the numbered headings into the table of
contents entries, we might define 'XN-REPLACEMENT' as follows. (We
obtain the heading depth from 'groff' 'ms''s internal register 'nh*hl'.)
.de XN-REPLACEMENT
.XN-INIT
.XH-UPDATE-TOC \\n[nh*hl] \\$@
\&\\*[SN] \\$*
..
You can change the style of the leader that bridges each table of
contents entry with its page number; define the 'TC-LEADER' special
character by using the 'char' request. A typical leader combines the
dot glyph '.' with a horizontal motion escape sequence to spread the
dots. The width of the page number field is stored in the 'TC-MARGIN'
register.
4.6.7 Differences from AT&T 'ms'
--------------------------------
The 'groff' 'ms' macros are an independent reimplementation, using no
AT&T code. Since they take advantage of the extended features of GNU
'troff', they cannot be used with AT&T 'troff'. 'groff' 'ms' supports
features described above as Berkeley and Research Tenth Edition Unix
extensions, and adds several of its own.
* The internals of 'groff' 'ms' differ from those of AT&T 'ms'.
Documents that depend upon implementation details of AT&T 'ms' may
not format properly with 'groff' 'ms'. Such details include macros
whose function was not documented in the AT&T 'ms' manual.(1)
(*note Differences from AT&T ms-Footnote-1::)
* The error-handling policy of 'groff' 'ms' is to detect and report
errors, rather than to ignore them silently.
* Research Tenth Edition Unix supported 'P1'/'P2' macros to bracket
code examples; 'groff' 'ms' does not.
* 'groff' 'ms' does not work in GNU 'troff''s AT&T compatibility
mode. If loaded when that mode is enabled, it aborts processing
with a diagnostic message.
* Multiple line spacing is not supported. Use a larger vertical
spacing instead.
* 'groff' 'ms' uses the same header and footer defaults in both
'nroff' and 'troff' modes as AT&T 'ms' does in 'troff' mode; AT&T's
default in 'nroff' mode is to put the date, in U.S. traditional
format (e.g., "January 1, 2021"), in the center footer (the 'CF'
string).
* Many 'groff' 'ms' macros, including those for paragraphs, headings,
and displays, cause a reset of paragraph rendering parameters, and
may change the indentation; they do so not by incrementing or
decrementing it, but by setting it absolutely. This can cause
problems for documents that define additional macros of their own
that manipulate indentation. Use the 'ms' 'RS' and 'RE' macros
instead of the 'in' request.
* AT&T 'ms' interpreted the values of the registers 'PS' and 'VS' in
points, and did not support the use of scaling units with them.
'groff' 'ms' interprets values of the registers 'PS', 'VS', 'FPS',
and 'FVS' equal to or larger than 1,000 (one thousand) as decimal
fractions multiplied by 1,000.(2) (*note Differences from AT&T
ms-Footnote-2::) This threshold makes use of a scaling unit with
these parameters practical for high-resolution devices while
preserving backward compatibility. It also permits expression of
non-integral type sizes. For example, 'groff -rPS=10.5p' at the
shell prompt is equivalent to placing '.nr PS 10.5p' at the
beginning of the document.
* AT&T 'ms''s 'AU' macro supported arguments whose values were used
with some non-'RP' document types; that of 'groff' 'ms' does not.
* Right-aligned displays are available. The AT&T 'ms' manual
observes that "it is tempting to assume that '.DS R' will right
adjust lines, but it doesn't work". In 'groff' 'ms', it does.
* To make 'groff' 'ms' use the default page offset (which also
specifies the left margin), the 'PO' register must stay undefined
until the first 'ms' macro is called.
This implies that '\n[PO]' should not be used early in the
document, unless it is changed also: accessing an undefined
register automatically defines it.
* 'groff' 'ms' supports the 'PN' register, but it is not necessary;
you can access the page number via the usual '%' register and
invoke the 'af' request to assign a different format to it if
desired.(3) (*note Differences from AT&T ms-Footnote-3::)
* The AT&T 'ms' manual documents registers 'CW' and 'GW' as setting
the default column width and "intercolumn gap", respectively, and
which applied when 'MC' was called with fewer than two arguments.
'groff' 'ms' instead treats 'MC' without arguments as synonymous
with '2C'; there is thus no occasion for a default column width
register. Further, the 'MINGW' register and the second argument to
'MC' specify a _minimum_ space between columns, not the fixed
gutter width of AT&T 'ms'.
* The AT&T 'ms' manual did not document the 'QI' register; Berkeley
and 'groff' 'ms' do.
-- Register: \n[GS]
'groff' 'ms' sets the register 'GS' to 1; AT&T 'ms' does not use
it. A document can test its value to determine whether it is being
formatted with 'groff' 'ms' or another implementation.
(1) "Typing Documents on the UNIX System: Using the -ms Macros with
Troff and Nroff", M. E. Lesk, Bell Laboratories, 1978
(2) Register values are converted to and stored as basic units.
*Note Measurements::.
(3) If you redefine the 'ms' 'PT' macro and desire special treatment
of certain page numbers (like '1'), you may need to handle a non-Arabic
page number format, as 'groff' 'ms''s 'PT' does; see the macro package
source. In 'groff' 'ms', the 'PN' and '%' registers are aliases.
4.6.7.1 Unix Version 7 'ms' macros unimplemented by 'groff' 'ms'
................................................................
Several macros described in the Unix Version 7 'ms' documentation are
unimplemented by 'groff' 'ms' because they are specific to the
requirements of documents produced internally by Bell Laboratories, some
of which also require a glyph for the Bell System logo that 'groff' does
not support. These macros implemented several document type formats
('EG', 'IM', 'MF', 'MR', 'TM', 'TR'), were meaningful only in
conjunction with the use of certain document types ('AT', 'CS', 'CT',
'OK', 'SG'), stored the postal addresses of Bell Labs sites ('HO', 'IH',
'MH', 'PY', 'WH'), or lacked a stable definition over time ('UX'). To
compatibly render historical 'ms' documents using these macros, we
advise your documents to invoke the 'rm' request to remove any such
macros it uses and then define replacements with an authentically
typeset original at hand.(1) (*note Missing Unix Version 7 ms
Macros-Footnote-1::) For informal purposes, a simple definition of 'UX'
should maintain the readability of the document's substance.
.rm UX
.ds UX Unix\"
(1) Removal beforehand is necessary because 'groff' 'ms' aliases
these macros with a diagnostic one; you want to reorient the aliased
name before (re-)populating the macro.
4.6.8 Legacy Features
---------------------
'groff' 'ms' retains some legacy features solely to support formatting
of historical documents; contemporary ones should not use them because
they can render poorly. See the 'groff_char(7)' man page.
AT&T accent mark strings
........................
AT&T 'ms' defined accent mark strings as follows.
-- String: \*[''']
Apply acute accent to subsequent glyph.
-- String: \*['`']
Apply grave accent to subsequent glyph.
-- String: \*[:]
Apply dieresis (umlaut) to subsequent glyph.
-- String: \*[^]
Apply circumflex accent to subsequent glyph.
-- String: \*[~]
Apply tilde accent to subsequent glyph.
-- String: \*[C]
Apply caron to subsequent glyph.
-- String: \*[,]
Apply cedilla to subsequent glyph.
Berkeley accent mark and glyph strings
......................................
Berkeley 'ms' offered an 'AM' macro; calling it redefined the AT&T
accent mark strings (except for '\*C'), applied them to the _preceding_
glyph, and defined additional strings, some for spacing glyphs.
-- Macro: .AM
Enable alternative accent mark and glyph-producing strings.
-- String: \*[''']
Apply acute accent to preceding glyph.
-- String: \*['`']
Apply grave accent to preceding glyph.
-- String: \*[:]
Apply dieresis (umlaut) to preceding glyph.
-- String: \*[^]
Apply circumflex accent to preceding glyph.
-- String: \*[~]
Apply tilde accent to preceding glyph.
-- String: \*[,]
Apply cedilla to preceding glyph.
-- String: \*[/]
Apply stroke (slash) to preceding glyph.
-- String: \*[v]
Apply caron to preceding glyph.
-- String: \*[_]
Apply macron to preceding glyph.
-- String: \*[.]
Apply underdot to preceding glyph.
-- String: \*[o]
Apply ring accent to preceding glyph.
-- String: \*[?]
Interpolate inverted question mark.
-- String: \*[!]
Interpolate inverted exclamation mark.
-- String: \*[8]
Interpolate small letter sharp s.
-- String: \*[q]
Interpolate small letter o with hook accent (ogonek).
-- String: \*[3]
Interpolate small letter yogh.
-- String: \*[d-]
Interpolate small letter eth.
-- String: \*[D-]
Interpolate capital letter eth.
-- String: \*[th]
Interpolate small letter thorn.
-- String: \*[Th]
Interpolate capital letter thorn.
-- String: \*[ae]
Interpolate small æ ligature.
-- String: \*[Ae]
Interpolate capital Æ ligature.
-- String: \*[oe]
Interpolate small oe ligature.
-- String: \*[OE]
Interpolate capital OE ligature.
4.6.9 Naming Conventions
------------------------
'groff' 'ms' uses the following conventions for names of macros,
strings, and registers. External names available to documents that use
the macros contain only uppercase letters and digits. The package
reserves the following identifiers for internal use.
* those containing the characters '*', '@', and ':'; and
* those containing only uppercase letters and digits.
When selecting a name for your document's own macros, registers,
macros, and strings, avoid those reserved by 'groff' 'ms' and those
defined by GNU 'troff'. See *note Register Index::, *note Macro
Index::, and *note String Index::, or 'groff(7)' for complete lists
thereof.
'groff' 'ms' organizes most of its internal names into modules. The
naming convenion is as follows.
* Names used only within one module are of the form MODULE'*'NAME.
* Names used outside the module in which they are defined are of the
form MODULE'@'NAME.
* Names associated with a particular environment are of the form
ENVIRONMENT':'NAME; these are used only within the 'par' module.
* NAME does not have a module prefix.
* Names constructed to implement arrays are of the form
ARRAY'!'INDEX.
5 GNU 'troff' Reference
***********************
This chapter covers _all_ of the facilities of the GNU 'troff'
formatting program. Users of macro packages may skip it if not
interested in details.
5.1 Text
========
AT&T 'troff' was designed to take input as it would be composed on a
typewriter, including the teletypewriters used as early computer
terminals, and relieve the user drafting a document of concern with
details like line length maintenance, hyphenation breaking, and
consistent paragraph indentation. Early in its development, the program
gained the ability to prepare output for a phototypesetter; a document
could then be prepared for output to a teletypewriter, a
phototypesetter, or both. GNU 'troff' continues this tradition of
permitting an author to compose a single master version of a document
which can then be rendered upon a variety of output formats or devices,
including PDF, HTML, laser printers, and terminal displays.
'roff' input contains text interspersed with instructions to control
the formatter. Even in the absence of such instructions, GNU 'troff'
still processes its input in several ways, by filling, hyphenating,
breaking, and adjusting it, and supplementing it with inter-sentence
space.
5.1.1 Filling
-------------
When GNU 'troff' starts up, it obtains information about the device for
which it is preparing output.(1) (*note Filling-Footnote-1::) An
essential property is the length of the output line, such as "6.5
inches".
GNU 'troff' interprets plain text files employing the Unix
line-ending convention. It reads input a character at a time,
collecting words as it goes, and fits as many words together on an
output line as it can--this is known as "filling". To GNU 'troff', a
"word" is any sequence of one or more characters that aren't spaces or
newlines. The exceptions separate words.(2) (*note
Filling-Footnote-2::) To disable filling, see *note Manipulating Filling
and Adjustment::.
It is a truth universally acknowledged
that a single man in possession of a
good fortune must be in want of a wife.
=> It is a truth universally acknowledged that a
=> single man in possession of a good fortune must
=> be in want of a wife.
(1) *Note Device and Font Description Files::.
(2) Tabs and leaders also separate words. Escape sequences can
function as word characters, word separators, or neither--the last
simply have no effect on GNU 'troff''s idea of whether an input
character is within a word. We'll discuss all of these in due course.
5.1.2 Sentences
---------------
A passionate debate has raged for decades among writers of the English
language over whether more space should appear between adjacent
sentences than between words within a sentence, and if so, how much, and
what other circumstances should influence this spacing.(1) (*note
Sentences-Footnote-1::) GNU 'troff' follows the example of AT&T 'troff';
it attempts to detect the boundaries between sentences, and supplements
them with inter-sentence space.
Hello, world!
Welcome to groff.
=> Hello, world! Welcome to groff.
GNU 'troff' flags certain characters (normally '!', '?', and '.') as
potentially ending a sentence. When GNU 'troff' encounters one of these
"end-of-sentence characters" at the end of an input line, or one of them
is followed by two (unescaped) spaces on the same input line, it appends
an inter-word space followed by an inter-sentence space in the output.
R. Harper subscribes to a maxim of P. T. Barnum.
=> R. Harper subscribes to a maxim of P. T. Barnum.
In the above example, inter-sentence space is not added after 'P.' or
'T.' because the periods do not occur at the end of an input line, nor
are they followed by two or more spaces. Let's imagine that we've heard
something about defamation from Mr. Harper's attorney, recast the
sentence, and reflowed it in our text editor.
I submit that R. Harper subscribes to a maxim of P. T.
Barnum.
=> I submit that R. Harper subscribes to a maxim of
=> P. T. Barnum.
"Barnum" doesn't begin a sentence! What to do? Let us meet our
first "escape sequence", a series of input characters that give
instructions to GNU 'troff' instead of being used to construct output
device glyphs.(2) (*note Sentences-Footnote-2::) An escape sequence
begins with the backslash character '\' by default, an uncommon
character in natural language text, and is _always_ followed by at least
one other character, hence the term "sequence".
The dummy character escape sequence '\&' can be used after an
end-of-sentence character to defeat end-of-sentence detection on a
per-instance basis. We can therefore rewrite our input more
defensively.
I submit that R.\& Harper subscribes to a maxim of P.\&
T.\& Barnum.
=> I submit that R. Harper subscribes to a maxim of
=> P. T. Barnum.
Adding text caused our input to wrap; now, we don't need '\&' after
'T.' but we do after 'P.'. Consistent use of the escape sequence
ensures that potential sentence boundaries are robust to editing
activities. Further advice along these lines follows in *note Input
Conventions::.
Normally, the occurrence of a visible non-end-of-sentence character
(as opposed to a space or tab) immediately after an end-of-sentence
character cancels detection of the end of a sentence. For example, it
would be incorrect for the formatter to infer the end of a sentence
after the dot in '3.14159'. However, it treats several characters
_transparently_ after the occurrence of an end-of-sentence character--it
does not cancel end-of-sentence status upon encountering them. Such
characters are often used as footnote marks or to close quotations and
parentheticals. The default set is '"', ''', ')', ']', '*', '\[dg]',
'\[dd]', '\[rq]', and '\[cq]'. The last four are examples of "special
characters", escape sequences whose purpose is to obtain glyphs that are
not easily typed at the keyboard, or which have special meaning to the
formatter (like '\' itself).(3) (*note Sentences-Footnote-3::)
\[lq]The idea that the poor should have leisure has always
been shocking to the rich.\[rq]
(Bertrand Russell, 1935)
=> "The idea that the poor should have
=> leisure has always been shocking to
=> the rich." (Bertrand Russell, 1935)
Configure the sets of characters that potentially end sentences or
are transparent to sentence endings with the 'cflags' request (*note
Characters and Glyphs::). Use the 'ss' request to change--or
eliminate--supplemental inter-sentence space (*note Manipulating Filling
and Adjustment::).
(1) A well-researched jeremiad appreciated by 'groff' contributors on
both sides of the sentence-spacing debate can be found at
.
(2) This statement oversimplifies; there are escape sequences whose
purpose is precisely to produce glyphs on the output device, and input
characters that _aren't_ part of escape sequences can undergo a great
deal of processing before getting to the output.
(3) The mnemonics for the special characters shown here are "dagger",
"double dagger", "right (double) quote", and "closing (single) quote".
See 'groff_char(7)'.
5.1.3 Hyphenation
-----------------
When an output line is nearly full, it is uncommon for the next word
collected from the input to exactly fill it--often, there is room left
over for only part of the next word. "Hyphenation" is the process of
splitting a word so that it appears partially on one line, followed by a
hyphen to indicate to the reader that the word has been broken, and that
its remainder lies on the next. Hyphenation break points can be
manually specified; GNU 'troff' also uses a hyphenation algorithm and
language-specific pattern files (based on TeX's) to decide which words
can be hyphenated and where.
Hyphenation does not always occur even when the hyphenation rules for
a word allow it; it can be disabled, and when not disabled there are
several parameters that can prevent it in certain circumstances. *Note
Manipulating Hyphenation::.
5.1.4 Breaking
--------------
Once an output line is full, the formatter places the next word (or
remainder of a hyphenated one) on a different output line; this is
called a "break". In this manual and in 'roff' discussions generally, a
"break" if not further qualified always refers to the termination of an
output line. When the formatter is filling text, it introduces breaks
automatically to keep output lines from exceeding the configured line
length. After an automatic break, the formatter adjusts the line if
applicable (see below), and then resumes collecting and filling text on
the next output line.
Sometimes, a line cannot be broken automatically. This usually does
not happen with natural language text unless the output line length has
been manipulated to be extremely short, but it can with specialized text
like program source code. We can use 'perl' at the shell prompt to
contrive an example of failure to break the line. We also employ the
'-z' option to suppress normal output.
$ perl -e 'print "#" x 80, "\n";' | nroff -z
error-> cannot adjust line; overset by 15n
The remedy for these cases is to tell GNU 'troff' where the line may
be broken without hyphens. This is done with the non-printing break
point escape sequence '\:'; see *note Manipulating Hyphenation::.
What if the document author wants to stop filling lines temporarily,
for instance to start a new paragraph? There are several solutions. A
blank input line not only causes a break, but by default it also outputs
a one-line vertical space (effectively a blank output line). This
behavior can be modified; see *note Blank Line Traps::. Macro packages
may discourage or disable the blank line method of paragraphing in favor
of their own macros.
A line that begins with one or more spaces causes a break. The
spaces are output at the beginning of the next line without being
_adjusted_ (see below); however, this behavior can be modified (*note
Leading Space Traps::). Again, macro packages may provide other methods
of producing indented paragraphs. Trailing spaces on text lines are
discarded.(1) (*note Breaking-Footnote-1::)
What if the file ends before enough words have been collected to fill
an output line? Or the output line is exactly full but not yet broken,
and there is no more input? The formatter breaks the pending output
line without adjustment upon encountering the end of input. Certain
requests also cause breaks, implicitly or explicitly. This is discussed
in *note Manipulating Filling and Adjustment::.
(1) *Note text lines::. AT&T 'troff' also cancels end-of-sentence
detection.
5.1.5 Adjustment
----------------
After performing an automatic break, the formatter may then "adjust" the
line, widening inter-word spaces until the text reaches the right
margin. Extra spaces between words are preserved. Leading and trailing
spaces are handled as noted above. You can align text to the left or
right margin only, or center it; see *note Manipulating Filling and
Adjustment::.
5.1.6 Tabs and Leaders
----------------------
The formatter translates input horizontal tab characters ("tabs") and
characters ("leaders") into movements to the next tab stop.
Tabs simply move to the next tab stop; leaders place enough periods to
fill the space. Tab stops are by default located every half inch
measured from the drawing position corresponding to the beginning of the
input line; see *note Page Geometry::. Tabs and leaders do not cause
breaks and therefore do not interrupt filling. Below, we use arrows ->
and bullets * to indicate input tabs and leaders, respectively.
A->B->C*D->*E
.br
1
->2->3*4
->*5
=> A B C.......D ........E
=> 1 2 3.......4 ........5
Tabs and leaders lend themselves to table construction.(1) (*note
Tabs and Leaders-Footnote-1::) The tab and leader fill characters can be
configured, and further facilities for sophisticated table composition
are available; see *note Tabs and Fields::. There are many details to
track when using such low-level features, so most users turn to the
'tbl(1)' preprocessor to lay out tables.
(1) "Tab" abbreviates "tabulation", suggesting a table arrangement
mechanism.
5.1.7 Requests and Macros
-------------------------
We have now encountered almost all of the syntax there is in the 'roff'
language, with an exception already noted in passing.(1) (*note
Requests and Macros-Footnote-1::) A "request" is an instruction to the
formatter that occurs after a "control character", which is recognized
at the beginning of an input line. The regular control character is a
dot ('.'). Its counterpart, the "no-break control character", a neutral
apostrophe ('''), suppresses the break that is implied by some requests.
These characters were chosen because it is uncommon for lines of text in
natural languages to begin with them. If you require a formatted period
or apostrophe (closing single quotation mark) where the formatter
expects a control character, prefix the dot or neutral apostrophe with
the dummy character escape sequence, '\&'.
An input line beginning with a control character is called a "control
line". Every line of input that is not a control line is a "text
line".(2) (*note Requests and Macros-Footnote-2::)
Requests often take "arguments", words (separated from the request
name and each other by spaces) that specify details of the action you
expect the formatter to perform. If a request is meaningless without
arguments, it is typically ignored.
Requests and escape sequences comprise the control language of the
formatter. Of key importance are the requests that define macros.
Macros are invoked like requests, enabling the request repertoire to be
extended or overridden.(3) (*note Requests and Macros-Footnote-3::)
A "macro" can be thought of as an abbreviation you can define for a
collection of control and text lines. When a document "calls" a macro
by placing its name after a control character, the formatter replaces
the control line with the macro's definition. The process of textual
replacement is known as "interpolation".(4) (*note Requests and
Macros-Footnote-4::) Interpolations are handled as soon as they are
recognized, and once performed, the formatter scans the replacement for
further requests, macro calls, and escape sequences.
In 'roff' systems, the 'de' request defines a macro.(5) (*note
Requests and Macros-Footnote-5::)
.de DATE
2020-11-14
..
The foregoing input produces no output by itself; all we have done is
store information in a macro named 'DATE'. Observe the pair of dots
that ends the macro definition. This is a default; you can specify your
own terminator for the macro definition as the second argument to the
'de' request.
.de NAME ENDNAME
Heywood Jabuzzoff
.ENDNAME
In fact, the ending mark is itself the name of a macro to be called,
or a request to be invoked, if it is defined at the time its control
line is read.
.de END
Big Rip
..
.de START END
Big Bang
.END
.START
=> Big Rip Big Bang
In the foregoing example, "Big Rip" printed before "Big Bang" because
its macro was _called_ first. Consider what would happen if we dropped
'END' from the '.de START' line and added '..' after '.END'. Would the
order change?
Let us consider a more elaborate example.
.de DATE
2020-10-05
..
.
.de BOSS
D.\& Kruger,
J.\& Peterman
..
.
.de NOTICE
Approved:
.DATE
by
.BOSS
..
.
Insert tedious regulatory compliance paragraph here.
.NOTICE
Insert tedious liability disclaimer paragraph here.
.NOTICE
=> Insert tedious regulatory compliance paragraph here.
=>
=> Approved: 2020-10-05 by D. Kruger, J. Peterman
=>
=> Insert tedious liability disclaimer paragraph here.
=>
=> Approved: 2020-10-05 by D. Kruger, J. Peterman
The above document started with a series of control lines. Three macros
were defined, with a 'de' request declaring each macro's name, and the
"body" of the macro starting on the next line and continuing until a
line with two dots ''..'' marked its end. The text proper began only
after the macros were defined; this is a common pattern. Only the
'NOTICE' macro was called "directly" by the document; 'DATE' and 'BOSS'
were called only by 'NOTICE' itself. Escape sequences were used in
'BOSS', two levels of macro interpolation deep.
The advantage in typing and maintenance economy may not be obvious
from such a short example, but imagine a much longer document with
dozens of such paragraphs, each requiring a notice of managerial
approval. Consider what must happen if you are in charge of generating
a new version of such a document with a different date, for a different
boss. With well-chosen macros, you only have to change each datum in
one place.
In practice, we would probably use strings (*note Strings::) instead
of macros for such simple interpolations; what is important here is to
glimpse the potential of macros and the power of recursive
interpolation.
We could have defined our 'DATE' and 'BOSS' macros in the opposite
order; perhaps less obviously, we could also have defined them _after_
'NOTICE'. Such "forward references" are well-defined because the body
of a macro definition is, for the most part, stored rather than
interpreted (*note Copy Mode::). While a macro is being defined (or
appended to), requests are not interpreted and macros not interpolated;
some commonly used escape sequences _are_ however interpreted. 'roff'
systems also support recursive macro calls, as long as you have a way to
break the recursion (*note Conditionals and Loops::). Maintainable
'roff' documents tend to arrange macro definitions to minimize forward
references.
(1) The backspace character is also meaningful; see *note Page
Motions::.
(2) The '\' escape sequence can alter how an input line is
classified; see *note Line Continuation::.
(3) Argument handling in macros is more flexible but also more
complex. *Note Calling Macros::.
(4) Some escape sequences undergo interpolation as well.
(5) GNU 'troff' offers additional ones. *Note Writing Macros::.
5.1.8 Macro Packages
--------------------
Macro definitions can be collected into "macro files", 'roff' input
files designed to produce no output themselves but instead ease the
preparation of other 'roff' documents. There is no syntactical
difference between a macro file and any other 'roff' document; only its
purpose distinguishes it. When a macro file is installed at a standard
location and suitable for use by a general audience, it is often termed
a "macro package".(1) (*note Macro Packages-Footnote-1::) Macro
packages can be loaded by supplying the '-m' option to GNU 'troff' or a
'groff' front end. Alternatively, a document requiring a macro package
can load it with the 'mso' ("macro source") request.
(1) Macro files and packages frequently define registers and strings
as well.
5.1.9 Input Format
------------------
Organize input to GNU 'troff' into lines separated by the Unix newline
character ('U+000A'), using the character encoding it recognizes:
ISO Latin-1 (8859-1). A document encoded in ISO 646:1991 IRV
(US-ASCII), or, equivalently, uses only code points from the "C0
Controls" and "Basic Latin" parts of the Unicode character set is also a
valid ISO Latin-1 document; the standards are interchangeable in their
first 128 code points.(1) (*note Input Format-Footnote-1::)
Some control characters (from the sets "C0 Controls" and "C1
Controls" as Unicode describes them) are invalid as input characters.
GNU 'troff' discards them upon reading.(2) (*note Input
Format-Footnote-2::) It processes a character sequence "foo", followed
by an invalid character and then "bar", as "foobar".
Invalid input characters comprise '0x00', '0x0B', '0x0D'-'0x1F', and
'0x80'-'0x9F'.(3) (*note Input Format-Footnote-3::) GNU 'troff' uses
some of these code points for internal purposes, making non-trivial the
extension of the program to accept UTF-8 or other encodings that use
characters from these ranges.
(1) The _semantics_ of certain punctuation code points have gotten
stricter with the successive standards, a cause of some frustration
among man page writers; see 'groff_char(7)'.
(2) It also emits a warning in category 'input'. *Note Warnings::.
(3) Historically, control characters like ASCII 'STX', 'ETX', and
'BEL' (, , and , respectively) have
been observed in 'roff' documents, particularly in macro packages
employing them as delimiters with the output comparison operator to try
to avoid collisions with the content of arbitrary user-supplied
parameters (*note Operators in Conditionals::). We discourage this
expedient; in GNU 'troff' it is unnecessary (outside of compatibility
mode) because the program parses delimited arguments at a different
input level than their surrounding context. *Note Implementation
Differences::.
5.1.10 Input Encodings
----------------------
Recall from *note Groff Options::, that the 'groff' command's '-k'
option runs the 'preconv' preprocessor to perform input character
encoding conversions to satisfy GNU 'troff''s requirement of a
single-byte encoding compatible with ISO 646:1991 IRV (US-ASCII).
Localization influences automatic hyphenation in two distinct but
related respects. A macro file specific to a character coding
identifies which character codes correspond to letters expected in the
language's hyphenation pattern files and sets up case equivalences for
those letters. A language's macro file determines which of these
letters are equivalent to other letters for hyphenation purposes.
For example, in English, the letter 'ñ' occurs in loan words. The
'latin1.tmac' and 'latin9.tmac' macro files define a hyphenation code
for 'ñ' and make 'Ñ' equivalent to it. The English localization file
'en.tmac' furthermore makes 'ñ' equivalent to 'n'. In Spanish
('es.tmac'), however, 'ñ' and 'n' are _not_ equivalent. The language
localization file (*note Manipulating Hyphenation::) loads an
appropriate encoding localization file; a document need not do so
directly.
'koi8-r'
To use KOI8-R, an encoding for the Russian language, either place
'.mso koi8-r.tmac' at the very beginning of your document or supply
'-m koi8-r' as a command-line argument to 'groff'. The 'ru.tmac'
localization file loads 'koi8-r.tmac' automatically.(1) (*note
Input Encodings-Footnote-1::)
'latin1'
ISO Latin-1 is an encoding for Western European languages. The
'de.tmac', 'en.tmac', 'it.tmac', and 'sv.tmac' localization files
load 'latin1.tmac' automatically.
'latin2'
To use ISO Latin-2, an encoding for Central and Eastern European
languages, invoke '.mso latin2.tmac' at the beginning of your
document or supply '-m latin2' as a command-line argument to
'groff'. The 'cs.tmac' and 'pl.tmac' localization files load
'latin2.tmac' automatically.
'latin5'
To use ISO Latin-5, an encoding for the Turkish language, invoke
'.mso latin5.tmac' at the beginning of your document or supply '-m
latin5' as a command-line argument to 'groff'.
'latin9'
ISO Latin-9 succeeds Latin-1; it includes a Euro sign and better
coverage for French. To use this encoding, invoke
'.mso latin9.tmac' at the beginning of your document or supply '-m
latin9' as a command-line argument to 'groff'. The 'es.tmac' and
'fr.tmac' localization files load 'latin9.tmac' automatically.
Some characters from an input encoding may not be available with a
particular output driver, or their glyphs may not have representation in
the font used. For terminal devices, fallbacks are defined, like 'EUR'
for the Euro sign and '(C)' for the copyright sign. For typesetter
devices, you may need to "mount" fonts that support glyphs required by
the document. *Note Font Positions::.
Because a Euro glyph was not historically defined in PostScript
fonts, 'groff' comes with a font called 'freeeuro.pfa' that provides the
Euro in several styles. Standard PostScript fonts contain the glyphs
from Latin-5 and Latin-9 that Latin-1 lacks, so these encodings are
supported for the 'ps' and 'pdf' output devices as 'groff' ships, while
Latin-2 is not.
Unicode supports characters from all other input encodings; the
'utf8' output driver for terminals therefore does as well. The DVI
output driver supports the Latin-2 and Latin-9 encodings if the
command-line option ''-m ec'' is used as well. (2) (*note Input
Encodings-Footnote-2::)
(1) KOI8-R code points in the range '0x80'-'0x9F' are not valid input
to GNU 'troff'; recall *note Input Format::. This restriction should be
no impediment to practical documents, as these KOI8-R code points do not
encode letters, but box-drawing symbols and characters that are better
obtained via special character escape sequences; see 'groff_char(7)'.
(2) The DVI output device defaults to using the Computer Modern (CM)
fonts; 'ec.tmac' loads the EC fonts instead, which provide Euro '\[Eu]'
and per mille '\[%0]' glyphs.
5.1.11 Input Conventions
------------------------
Since a 'roff' formatter fills text automatically, its experienced users
tend to avoid visual composition of text in input files: the esthetic
appeal of the formatted output is what matters. Therefore, 'roff' input
should be arranged such that it is easy for authors and maintainers to
compose and develop the document, understand the syntax of 'roff'
requests, macro calls, and preprocessor languages used, and predict the
behavior of the formatter. Several traditions have accrued in service
of these goals.
* Follow sentence endings in the input with newlines to ease their
recognition (*note Sentences::). It is frequently convenient to
end text lines after colons and semicolons as well, as these
typically precede independent clauses. Consider doing so after
commas; they often occur in lists that become easy to scan when
itemized by line, or constitute supplements to the sentence that
are added, deleted, or updated to clarify it. Parenthetical and
quoted phrases are also good candidates for placement on text lines
by themselves.
* Set your text editor's line length to 72 characters or fewer.(1)
(*note Input Conventions-Footnote-1::) This limit, combined with
the previous item of advice, makes it less common that an input
line will wrap in your text editor, and thus will help you perceive
excessively long constructions in your text. Recall that natural
languages originate in speech, not writing, and that punctuation is
correlated with pauses for breathing and changes in prosody.
* Use '\&' after '!', '?', and '.' if they are followed by space or
newline characters and don't end a sentence.
* In filled text lines, use '\&' before '.' and ''' if they are
preceded by space, so that revisions to the input don't turn them
into control lines.
* Do not use spaces to perform indentation or align columns of a
table. Leading spaces are reliable when text is not being filled.
(Exception: when laying out a table with GNU 'tbl', specifying the
'nospaces' region option causes the program to ignore spaces at the
boundaries of table cells.)
* Comment your document. It is never too soon to apply comments to
record information of use to future document maintainers (including
your future self). We thus introduce another escape sequence,
'\"', which causes the formatter to ignore the remainder of the
input line.
* Use the empty request--a control character followed immediately by
a newline--to visually manage separation of material in input
files. Many of the 'groff' project's own documents use an empty
request between sentences, after macro definitions, and where a
break is expected, and two empty requests between paragraphs or
other requests or macro calls that will introduce vertical space
into the document.
You can combine the empty request with the comment escape sequence
to include whole-line comments in your document, and even "comment
out" sections of it.
We conclude this section with an example sufficiently long to
illustrate most of the above suggestions in practice. For the purpose
of fitting the example between the margins of this manual with the font
used for its typeset version, we have shortened the input line length to
56 columns. As before, an arrow -> indicates a tab character.
.\" nroff this_file.roff | less
.\" groff -T ps this_file.roff > this_file.ps
->The theory of relativity is intimately connected with
the theory of space and time.
.
I shall therefore begin with a brief investigation of
the origin of our ideas of space and time,
although in doing so I know that I introduce a
controversial subject. \" remainder of paragraph elided
.
.
->The experiences of an individual appear to us arranged
in a series of events;
in this series the single events which we remember
appear to be ordered according to the criterion of
\[lq]earlier\[rq] and \[lq]later\[rq], \" punct swapped
which cannot be analysed further.
.
There exists,
therefore,
for the individual,
an I-time,
or subjective time.
.
This itself is not measurable.
.
I can,
indeed,
associate numbers with the events,
in such a way that the greater number is associated with
the later event than with an earlier one;
but the nature of this association may be quite
arbitrary.
.
This association I can define by means of a clock by
comparing the order of events furnished by the clock
with the order of a given series of events.
.
We understand by a clock something which provides a
series of events which can be counted,
and which has other properties of which we shall speak
later.
.\" Albert Einstein, _The Meaning of Relativity_, 1922
(1) Emacs: 'fill-column: 72'; Vim: 'textwidth=72'
5.2 Page Geometry
=================
'roff' systems format text under certain assumptions about the size of
the output medium, or page. For the formatter to correctly break a line
it is filling, it must know the line length, which it derives from the
page width (*note Line Layout::). For it to decide whether to write an
output line to the current page or wait until the next one, it must know
the page length (*note Page Layout::).
A device's "resolution" converts practical units like inches or
centimeters to "basic units", a convenient length measure for the output
device or file format. The formatter and output driver use basic units
to reckon page measurements. The device description file defines its
resolution and page dimensions (*note DESC File Format::).
A "page" is a two-dimensional structure upon which a 'roff' system
imposes a rectangular coordinate system with its origin near the upper
left corner. Coordinate values are in basic units and increase down and
to the right. Useful ones are typically positive and within numeric
ranges corresponding to the page boundaries.
Text is arranged on a one-dimensional lattice of text baselines from
the top to the bottom of the page. A "text baseline" is a (usually
invisible) line upon which the glyphs of a typeface are aligned.
"Vertical spacing" is the distance between adjacent text baselines.
Typographic tradition sets this quantity to 120% of the type size.
Typographers term this unit a vee.
While the formatter (and, later, output driver) is processing a page,
it keeps track of its "drawing position", which is the location at which
the next glyph will be written, from which the next motion will be
measured, or where a geometric object will commence rendering.
Notionally, glyphs are drawn from the text baseline upward and to the
right.(1) (*note Page Geometry-Footnote-1::) A glyph therefore "starts"
at its bottom-left corner. The formatter's origin is one vee below the
page top to prevent a glyph from lying partially or wholly off the page.
Further, it is conventional not to write or draw at the extreme edges
of the page. Typesetters configure a "page offset", a rightward shift
from the left edge that defines the zero point from which the formatter
reckons the line indentation and length.(2) (*note Page
Geometry-Footnote-2::)
Combining the foregoing facts results in an origin that lies at the
page offset in the horizontal dimension and at the text baseline (using
the default vertical spacing) in the vertical dimension. A document can
change these prior to its first written or drawn output; see *note Line
Layout:: and *note Manipulating Type Size and Vertical Spacing::.
Vertical spacing has an impact on page-breaking decisions.
Generally, when a break occurs, the formatter automatically moves the
drawing position to the next text baseline. If the formatter were
already writing to the last line that fits on the page, advancing by one
vee would place the next text baseline off the page. To avoid that,
'roff' formatters instruct the output driver to eject the page, start a
new one, and again place the drawing position at the page offset one vee
below the page top; this is a "page break".
When the last line of input text corresponds to the last output line
that fits on the page, the break caused by the end of input also breaks
the page, producing a useless blank one. Macro packages keep users from
having to confront this difficulty by setting "traps" (*note Traps::);
moreover, all but the simplest page layouts tend to have headers and
footers, or at least bear vertical margins of at least one vee.
(1) 'groff' does not yet support right-to-left scripts.
(2) 'groff''s terminal output devices have page offsets of zero.
5.3 Measurements
================
A 'roff' document sometimes requires the input of numeric parameters to
specify measurements. Express them as integers or decimal fractions
with an optional scaling unit suffixed. A "scaling unit" is a letter
that immediately follows the magnitude of a measurement. Digits after
the decimal point are optional. Examples of measurements include
'10.5p', '11i', '.5f', and '3.c'.
The formatter scales measurements by the specified scaling unit,
storing them internally (with any fractional part discarded) in basic
units. The device resolution can therefore be obtained by storing a
value of '1i' to a register, then reading the register.
'u'
Basic unit; it is at least as small as any other unit.
'i'
Inch; defined as 2.54 centimeters.
'c'
Centimeter; a centimeter is about 0.3937 inches.
'p'
Point; a typesetter's unit used for measuring type size. There are
72 points to an inch.
'P'
Pica; another typesetter's unit. There are 6 picas to an inch and
12 points to a pica.
's'
Scaled point; see *note Using Fractional Type Sizes::.
'z'
Typographical point; like 'p', but used only with type sizes, to
overcome a limitation of AT&T 'troff'; see *note Using Fractional
Type Sizes::.
'f'
GNU 'troff' defines this unit to scale decimal fractions in the
interval [0, 1] to 16-bit unsigned integers. It multiplies a
quantity by 65,536. *Note Colors::, for usage.
The magnitudes of other scaling units depend on the text formatting
parameters in effect. These are useful when specifying measurements
that need to scale with the typeface or vertical spacing.
'm'
Em; an em is equal to the current type size in points. It is named
thus because it is approximately the width of the letter 'M'.
'n'
En; on typesetters, an en is one-half em, but on terminals an en
equals an em, because they align all text to a grid of character
cells.
'v'
Vee; recall *note Page Geometry::.
'M'
Hundredth of an em.
5.3.1 Motion Quanta
-------------------
The basic unit 'u' is not necessarily an output device's smallest
addressable length; 'u' can be smaller to avoid integer rounding errors.
The minimum distances that a device can work with in the horizontal and
vertical directions are termed its "motion quanta". The formatter
rounds measurements to applicable motion quanta. Half-quantum fractions
round toward zero.
-- Register: \n[.H]
-- Register: \n[.V]
These read-only registers interpolate the horizontal and vertical
motion quantum, respectively, of the output device in basic units.
For example, we might draw short baseline rules on a terminal device
as follows. *Note Drawing Geometric Objects::.
.tm \n[.H]
error-> 24
.nf
\l'36u' 36u
\l'37u' 37u
=> _ 36u
=> __ 37u
5.3.2 Default Units
-------------------
A general-purpose register (one created or updated with the 'nr'
request(1) (*note Default Units-Footnote-1::)) is implicitly
dimensionless, or reckoned in basic units if interpreted in a
measurement context. But it is convenient for many requests and escape
sequences to infer a scaling unit for an argument if none is specified.
An explicit scaling unit (not after a closing parenthesis) can override
an undesirable default. Effectively, the default unit is suffixed to
the expression if a scaling unit is not already present. GNU 'troff''s
use of integer arithmetic should also be kept in mind.(2) (*note
Default Units-Footnote-2::)
The 'll' request interprets its argument in ems by default. Consider
several attempts to set a line length of 3.5 inches when the type size
is 10 points on a terminal device with a resolution of 240 basic units
and horizontal motion quantum of 24. Some expressions become zero; the
request clamps them to that quantum.
.ll 3.5i \" 3.5i (= 840u)
.ll 7/2 \" 7u/2u -> 3u -> 3m -> 0, clamped to 24u
.ll (7 / 2)u \" 7u/2u -> as above
.ll 7/2i \" 7u/2i -> 7u/480u -> 0 -> as above
.ll 7i/2 \" 7i/2u -> 1680u/2m -> 1680u/24u -> 35u
.ll 7i/2u \" 3.5i (= 840u)
The safest way to specify measurements is to attach a scaling unit. To
multiply or divide by a dimensionless quantity, use 'u' as its scaling
unit.
(1) *Note Registers::.
(2) *Note Numeric Expressions::.
5.4 Numeric Expressions
=======================
When evaluated, a "numeric expression" interpolates an integer: it can
be as simple as a literal '0' or it can be a complex sequence of
register and string interpolations interleaved with measurements and
operators.
GNU 'troff' provides a set of mathematical and logical operators
familiar to programmers--as well as some unusual ones--but supports only
integer arithmetic.(1) (*note Numeric Expressions-Footnote-1::) The
internal data type used for computing results depends on the host
machine but is at least a 32-bit signed integer, which suffices to
represent magnitudes within a range of ±2 billion.(2) (*note Numeric
Expressions-Footnote-2::) Arithmetic saturates.(3) (*note Numeric
Expressions-Footnote-3::)
Arithmetic infix operators perform a function on the numeric
expressions to their left and right; they are '+' (addition), '-'
(subtraction), '*' (multiplication), '/' (truncating division), and '%'
(modulus). "Truncating division" rounds to the integer nearer to zero,
no matter how large the fractional portion. Division and modulus by
zero are errors and abort evaluation of a numeric expression.
Arithmetic unary operators operate on the numeric expression to their
right; they are '-' (negation) and '+' (assertion--for completeness; it
does nothing). The unary minus must often be used with parentheses to
avoid confusion with the decrementation operator, discussed below.
Observe the rounding behavior and effect of negative operands on the
modulus and truncating division operators.
.nr T 199/100
.nr U 5/2
.nr V (-5)/2
.nr W 5/-2
.nr X 5%2
.nr Y (-5)%2
.nr Z 5%-2
T=\n[T] U=\n[U] V=\n[V] W=\n[W] X=\n[X] Y=\n[Y] Z=\n[Z]
=> T=1 U=2 V=-2 W=-2 X=1 Y=-1 Z=1
The sign of the modulus of operands of mixed signs is determined by the
sign of the first. Division and modulus operators satisfy the following
property: given a dividend A and a divisor B, a quotient Q formed by '(a
/ b)' and a remainder R by '(a % b)', then qb + r = a.
GNU 'troff''s scaling operator, used with parentheses as '(C;E)',
evaluates a numeric expression E using C as the default scaling unit.
If C is omitted, scaling units are ignored in the evaluation of E. This
operator can save typing by avoiding the attachment of scaling units to
every operand out of caution. Your macros can select a sensible default
unit in case the user neglects to supply one.
.\" Indent by amount given in first argument; assume ens.
.de Indent
. in (n;\\$1)
..
Without the scaling operator, the foregoing macro would, if called with
a unitless argument, cause indentation by the 'in' request's default
scaling unit (ems). The result would be twice as much indentation as
expected.
GNU 'troff' also provides a pair of operators to compute the extrema
of two operands: '>?' (maximum) and '' (minimum).
.nr slots 5
.nr candidates 3
.nr salaries (\n[slots] \n[candidates])
Looks like we'll end up paying \n[salaries] salaries.
=> Looks like we'll end up paying 3 salaries.
Comparison operators comprise '<' (less than), '>' (greater than),
'<=' (less than or equal), '>=' (greater than or equal), and '=' (equal,
with synonym '=='). When evaluating a comparison, the formatter
replaces it with '0' if it is false and '1' if true. In the 'roff'
language, positive values are true, others false.
We can operate on truth values with the logical operators '&'
(logical conjunction or "and") and ':' (logical disjunction or "or").
They evaluate as comparison operators do.
A logical complementation ("not") operator, '!', works only within
'if', 'ie', and 'while' requests. Furthermore, the formatter recognizes
'!' only at the beginning of a numeric expression not contained by
another numeric expression. In other words, '!' must be the "outermost"
operator. Its presence elsewhere causes the expression to evaluate
false.(4) (*note Numeric Expressions-Footnote-4::) This unfortunate
limitation maintains compatibility with AT&T 'troff'. Test a numeric
expression for falsity within a complex expression by comparing it to a
false value.(5) (*note Numeric Expressions-Footnote-5::)
.nr X 1
.nr Y 0
.\" This does not work as expected.
.if (\n[X])&(!\n[Y]) .nop A: X is true, Y is false
.
.\" Use this construct instead.
.if (\n[X])&(\n[Y]<=0) .nop B: X is true, Y is false
error-> warning: expected numeric expression, got '!'
=> B: X is true, Y is false
The 'roff' language has no operator precedence: expressions are
evaluated strictly from left to right, in contrast to schoolhouse
arithmetic. Use parentheses '(' ')' to impose a desired precedence upon
subexpressions.
.nr X 3+5*4
.nr Y (3+5)*4
.nr Z 3+(5*4)
X=\n[X] Y=\n[Y] Z=\n[Z]
=> X=32 Y=32 Z=23
For many requests and escape sequences that cause motion on the page,
the unary operators '+' and '-' work differently when leading a numeric
expression. They then indicate a motion relative to the drawing
position: positive is down in vertical contexts, right in horizontal
ones.
'+' and '-' are also treated differently by the following requests
and escape sequences: 'bp', 'in', 'll', 'lt', 'nm', 'nr', 'pl', 'pn',
'po', 'ps', 'pvs', 'rt', 'ti', '\H', '\R', and '\s'. Here, leading plus
and minus signs serve as incrementation and decrementation operators,
respectively. To negate an expression in these contexts, subtract it
from zero or include the unary minus in parentheses with its argument.
*Note Setting Registers::, for examples.
A leading '|' operator indicates a measurement relative not to the
drawing position but to a boundary. For horizontal motions, the
boundary is the drawing position corresponding to the beginning of the
_input_ line. By default, tab stops reckon movements in this way. Most
escape sequences do not; '|' tells them to do so.
Mind the \h'1.2i'gap.
.br
Mind the \h'|1.2i'gap.
.br
Mind the
\h'|1.2i'gap.
=> Mind the gap.
=> Mind the gap.
=> Mind the gap.
One use of this feature is to define macros whose scope is limited to
the output they format.
.\" underline word $1 with trailing punctuation $2
.de Underline
. nop \\$1\l'|0\[ul]'\\$2
..
Typographical emphasis is best used
.Underline sparingly .
In the above example, '|0' specifies a negative motion from the current
position (at the end of the argument just emitted, '\$1') to the
beginning of the input line. Thus, the '\l' escape sequence in this
case draws a line from right to left. A macro call occurs at the
beginning of an input line;(6) (*note Numeric Expressions-Footnote-6::)
if the '|' operator were omitted, then the underline would be drawn at
zero distance from the current position, producing device-dependent, and
likely undesirable, results. On the 'ps' output device, it underlines
the period.
For vertical motions, the '|' operator specifies a distance from the
first text baseline on the page or in the current diversion.(7) (*note
Numeric Expressions-Footnote-7::)
A
.br
B \Z'C'\v'|0'D
=> A D
=> B C
In the foregoing example, we've used the '\Z' escape sequence (*note
Page Motions::) to restore the drawing position after formatting 'C',
then moved vertically to the first text baseline on the page.
-- Escape sequence: \B'''input'''
Interpolate 1 if INPUT is a valid numeric expression, and 0
otherwise. The delimiter need not be a neutral apostrophe; see
*note Delimiters::.
You might use '\B' along with the 'if' request to filter out invalid
macro or string arguments. *Note Conditionals and Loops::.
.\" Indent by amount given in first argument; assume ens.
.de Indent
. if \B'\\$1' .in (n;\\$1)
. el .tm \\$0: invalid number '\\$1'
..
A register interpolated as an operand in a numeric expression must
have an Arabic format; luckily, this is the default. *Note Assigning
Register Formats::.
Because spaces separate arguments to requests, spaces are not allowed
in numeric expressions unless parentheses surround the (sub)expression
containing them. *Note Invoking Requests::, and *note Conditionals and
Loops::.
.nf
.nr a 1+2 + 2+1
\na
error-> expected numeric expression, got a space
=> 3
.nr a 1+(2 + 2)+1
\na
=> 6
The 'nr' request (*note Setting Registers::) expects its second and
optional third arguments to be numeric expressions; a bare '+' does not
qualify, so our first attempt elicited an error diagnostic.
(1) Provision is made for interpreting and reporting decimal
fractions in certain cases.
(2) If that's not enough, see the 'groff_tmac(5)' man page for the
'62bit.tmac' macro package.
(3) If overflow would occur, GNU 'troff' emits a warning in category
'range'. *Note Warnings::.
(4) GNU 'troff' emits a warning in category 'number'. *Note
Warnings::.
(5) *Note Conditionals and Loops::.
(6) Control structure syntax creates an exception to this rule, but
is designed to remain useful: recalling our example, '.if 1 .Underline
this' would underline only "this", precisely. *Note Conditionals and
Loops::.
(7) *Note Diversions::.
5.5 Identifiers
===============
An "identifier" labels a GNU 'troff' datum such as a register, name
(macro, string, or diversion), typeface (font, family, or style), color,
special character or character class, hyphenation language code,
environment, or stream. Valid identifiers consist of one or more
ordinary characters.(1) (*note Identifiers-Footnote-1::) An ordinary
character is any Unicode Basic Latin character that is not a space and
not the escape character; recall *note Input Format::. Thus, the
identifiers 'br', 'PP', 'end-list', 'ref*normal-print', '|', '@_', and
'!"#$%'()*+,-./' are all valid. Discretion should be exercised to
prevent confusion. Identifiers starting with '(' or '[' require care.
.nr x 9
.nr y 1
.nr (x 2
.nr [y 3
.nr sum1 (\n(x + \n[y])
error-> a space character is not allowed in an escape
error-> sequence parameter
A:2+3=\n[sum1]
.nr sum2 (\n((x + \n[[y])
B:2+3=\n[sum2]
.nr sum3 (\n[(x] + \n([y)
C:2+3=\n[sum3]
=> A:2+3=1 B:2+3=5 C:2+3=5
An identifier with a closing bracket (']') in its name can't be accessed
with bracket-form escape sequences that expect an identifier as a
parameter. For example, '\[foo]]' accesses the glyph 'foo', followed by
']' in whatever the surrounding context is, whereas '\C'foo]'' formats a
glyph named 'foo]'. Similarly, the identifier '(' can't be interpolated
_except_ with bracket forms.
Beginning a macro, string, or diversion name with the character '['
or ']' forecloses use of the 'refer' preprocessor, which recognizes
input lines starting with '.[' and '.]' as bibliographic reference
delimiters.
-- Escape sequence: \A'''input'''
Interpolate 1 if INPUT is a valid identifier, and 0 otherwise. The
delimiter need not be a neutral apostrophe; see *note Delimiters::.
Because GNU 'troff' ignores any input character with an invalid
code when reading it, invalid identifiers are empty or contain
spaces, tabs, newlines, or escape sequences that interpolate
something other than a sequence of ordinary characters.
You can employ '\A' to validate a macro argument before using it to
construct another escape sequence or identifier.
.\" usage: .init-coordinate-pair name val1 val2
.\" Create a coordinate pair where name!x=val1 and
.\" name!y=val2.
.de init-coordinate-pair
. if \A'\\$1' \{\
. if \B'\\$2' .nr \\$1!x \\$2
. if \B'\\$3' .nr \\$1!y \\$3
. \}
..
.init-coordinate-pair center 5 10
.init-coordinate-pair "poi->nt" trash garbage \" ignored
.init-coordinate-pair point waste rubbish \" ignored
The center is at (\n[center!x], \n[center!y]).
=> The center is at (5, 10).
In this example, we also validated the numeric arguments; the
registers 'point!x' and 'point!y' remain undefined. *Note Numeric
Expressions:: for the '\B' escape sequence.
The formatter's handling of undefined identifiers is
context-dependent. There is no way to invoke an undefined request; such
syntax is interpreted as a macro call instead. If the identifier is
interpreted as a string, macro, or diversion name, the formatter defines
it as empty and interpolates nothing.(2) (*note
Identifiers-Footnote-2::) Similarly, if the identifier is interpreted as
a register name, the formatter initializes it to zero and interpolates
that value.(3) (*note Identifiers-Footnote-3::) Attempting to use an
undefined typeface, special character or character class, color,
environment, hyphenation language code, or stream generally provokes an
error diagnostic.
Identifiers for requests, macros, strings, and diversions share one
name space; special characters and character classes another. No other
object types do.
.de xxx
. nop foo
..
.di xxx
bar
.br
.di
.
.xxx
=> bar
The foregoing example shows that GNU 'troff' reuses the identifier
'xxx', changing it from a macro to a diversion. No warning is emitted,
and the previous contents of 'xxx' are lost.
(1) Use of escape sequences in identifiers is not portable. For
example, DWB 3.3 'troff' accepts '\_'. Plan 9 'troff' does too, along
with '\'', '\`', and '\-'. Solaris 'troff' rejects all of these except
'\_', but accepts '\&', '\{', '\}', '\SPC', '\%', and '\c'. Heirloom
Doctools 'troff' rejects all of these, including '\_', but accepts '\!',
which the others reject. GNU 'troff' rejects all of the foregoing.
(2) GNU 'troff' emits a warning in category 'mac'. *Note Warnings::.
(3) GNU 'troff' emits a warning in category 'reg'. *Note Warnings::.
5.6 Formatter Instructions
==========================
To support documents that require more than filling, automatic line
breaking and hyphenation, adjustment, and supplemental inter-sentence
space, the 'roff' language offers two means of embedding instructions to
the formatter.
One is a "request", which begins with a control character and takes
up the remainder of the input line. Requests often perform relatively
large-scale operations such as setting the page length, breaking the
line, or starting a new page. They also conduct internal operations
like defining macros.
The other is an "escape sequence", which begins with the escape
character and can be embedded anywhere in the input, even in arguments
to requests and other escape sequences. Escape sequences interpolate
special characters, strings, or registers, and handle comparatively
minor formatting tasks like sub- and superscripting.
Some operations, such as font selection and type size alteration, are
available via both requests and escape sequences.
5.6.1 Control Characters
------------------------
The mechanism of using 'roff''s control characters to invoke requests
and call macros was introduced in *note Requests and Macros::. The
formatter recognizes a control character only at the beginning of an
input line, or at the beginning of a branch of a control structure
request; see *note Conditionals and Loops::.
A few requests cause a break implicitly; invoke them with the
no-break control character to prevent the break. Break suppression is
its sole behavioral distinction. Employing the no-break control
character to invoke requests that don't cause breaks is harmless but
poor style. *Note Manipulating Filling and Adjustment::.
The control '.' and no-break control ''' characters can each be
changed to any ordinary character(1) (*note Control
Characters-Footnote-1::) with the 'cc' and 'c2' requests, respectively.
-- Request: .cc [o]
Recognize the ordinary character O as the control character. If O
is absent or invalid, the default control character '.' is
selected. If O (or '.' if O is invalid) is already the escape or
no-break control character, an error is diagnosed and the request
ignored. The identity of the control character is associated with
the environment (*note Environments::).
-- Request: .c2 [o]
Recognize the ordinary character O as the no-break control
character. If O is absent or invalid, the default no-break control
character ''' is selected. If O (or ''' if O is invalid) is
already the escape or control character, an error is diagnosed and
the request ignored. The identity of the no-break control
character is associated with the environment (*note
Environments::).
When writing a macro, you might wish to know which control character
was used to call it.
-- Register: \n[.br]
This read-only register interpolates 1 if the currently executing
macro was called using the normal control character and 0
otherwise. If a macro is interpolated as a string, the '.br'
register's value is inherited from the context of the string
interpolation. *Note Strings::.
Use this register to reliably intercept requests that imply breaks.
.als bp*orig bp
.de bp
. ie \\n[.br] .bp*orig
. el 'bp*orig
..
Testing the '.br' register outside of a macro definition makes no
sense.
(1) Recall *note Identifiers::.
5.6.2 Invoking Requests
-----------------------
A control character is optionally followed by tabs and/or spaces and
then an identifier naming a request or macro. The invocation of an
unrecognized request is interpreted as a macro call. Defining a macro
with the same name as a request replaces the request. Deleting a
request name with the 'rm' request makes it unavailable. The 'als'
request can alias requests, permitting them to be wrapped or
non-destructively replaced. *Note Strings::.
There is no inherent limit on argument length or quantity. Most
requests take one or more arguments, and ignore any they do not expect.
A request may be separated from its arguments by tabs or spaces, but
only spaces can separate an argument from its successor. Only one
between arguments is necessary; any excess is ignored.(1) (*note
Invoking Requests-Footnote-1::) GNU 'troff' does not interpret tabs as
argument separators.(2) (*note Invoking Requests-Footnote-2::)
Generally, a space _within_ a request argument is not relevant, not
meaningful, or is supported by bespoke provisions, as with the 'tl'
request's delimiters (*note Page Layout::). Some requests, like 'ds',
interpret the remainder of the control line as a single argument. *Note
Strings::.
Spaces and tabs immediately after a control character are ignored.
Commonly, authors use them to indent the source of documents or macro
files.
.de center
. if \\n[.br] \
. br
. ce \\$1
..
.
.
.de right-align
.->if \\n[.br] \
.->->br
.->rj \\$1
..
If you assign an empty blank line trap, you can separate macro
definitions (or any input lines) with blank lines.
.de do-nothing
..
.blm do-nothing \" activate blank line trap
.de center
. if \\n[.br] \
. br
. ce \\$1
..
.de right-align
.->if \\n[.br] \
.->->br
.->rj \\$1
..
.blm \" deactivate blank line trap
*Note Blank Line Traps::.
(1) In compatibility mode, a space is not necessary after a request
or macro name of two characters' length.
(2) Plan 9 'troff' does.
5.6.3 Calling Macros
--------------------
If a macro of the desired name does not exist when called, the formatter
creates it and assigns it an empty definition.(1) (*note Calling
Macros-Footnote-1::) Calling an undefined macro _does_ end a macro
definition naming it as its end macro (*note Writing Macros::).
To embed spaces _within_ a macro argument, enclose the argument in
neutral double quotes '"'. Horizontal motion escape sequences are
sometimes a better choice for arguments to be formatted as text.
Consider calls to a hypothetical section heading macro 'uh'.
.uh The Mouse Problem
.uh "The Mouse Problem"
.uh The\~Mouse\~Problem
.uh The\ Mouse\ Problem
The first line calls 'uh' with three arguments: 'The', 'Mouse', and
'Problem'. The remainder call the 'uh' macro with one argument, 'The
Mouse Problem'. The last solution, using escaped spaces, can be found
in documents prepared for AT&T 'troff'. It can cause surprise when text
is adjusted, because '\' inserts a _fixed-width_, non-breaking
space. GNU 'troff''s '\~' escape sequence inserts an adjustable,
non-breaking space.(2) (*note Calling Macros-Footnote-2::)
The foregoing raises the question of how to embed neutral double
quotes or backslashes in macro arguments when _those_ characters are
desired as literals. In GNU 'troff', the special character escape
sequence '\[rs]' produces a backslash and '\[dq]' a neutral double
quote.
In GNU 'troff''s AT&T compatibility mode, these characters remain
available as '\(rs' and '\(dq', respectively. AT&T 'troff' did not
consistently define these special characters, but its descendants can be
made to support them. *Note Device and Font Description Files::.
If even that is not feasible, options remain. To obtain a literal
escape character in a macro argument, you can simply type it if you
change or disable the escape character first. *Note Using Escape
Sequences::. Otherwise, you must escape the escape character repeatedly
to a context-dependent extent. *Note Copy Mode::.
For the (neutral) double quote, you have recourse to an obscure
syntactical feature of AT&T 'troff'. Because a double quote can begin a
macro argument, the formatter keeps track of whether the current
argument was started thus, and doesn't require a space after the double
quote that ends it.(3) (*note Calling Macros-Footnote-3::) In the
argument list to a macro, a double quote that _isn't_ preceded by a
space _doesn't_ start a macro argument. If not preceded by a double
quote that began an argument, this double quote becomes part of the
argument. Furthermore, within a quoted argument, a pair of adjacent
double quotes becomes a literal double quote.
.de eq
. tm arg1:\\$1 arg2:\\$2 arg3:\\$3
. tm arg4:\\$4 arg5:\\$5 arg6:\\$6
.. \" 4 backslashes on the next line
.eq a" "b c" "de"f\\\\g" h""i "j""k"
error-> arg1:a" arg2:b c arg3:de
error-> arg4:f\g" arg5:h""i arg6:j"k
Apart from the complexity of the rules, this traditional solution has
the disadvantage that double quotes don't survive repeated argument
expansion in AT&T 'troff' or GNU 'troff''s compatibility mode. This can
frustrate efforts to pass such arguments intact through multiple macro
calls.
.cp 1
.de eq
. tm arg1:\\$1 arg2:\\$2 arg3:\\$3
. tm arg4:\\$4 arg5:\\$5 arg6:\\$6
..
.de xe
. eq \\$1 \\$2 \\$3 \\$4 \\$5 \\$6
.. \" 8 backslashes on the next line
.xe a" "b c" "de"f\\\\\\\\g" h""i "j""k"
error-> arg1:a" arg2:b arg3:c
error-> arg4:de arg5:f\g" arg6:h""i
Outside of compatibility mode, GNU 'troff' doesn't exhibit this
problem because it tracks the nesting depth of interpolations. *Note
Implementation Differences::.
(1) GNU 'troff' emits a warning in category 'mac'. *Note Warnings::.
(2) '\~' is fairly portable; see *note Other Differences::.
(3) Strictly, you can neglect to close the last quoted macro
argument, relying on the end of the control line to do so. We consider
this lethargic practice poor style.
5.6.4 Using Escape Sequences
----------------------------
Whereas requests must occur on control lines, escape sequences can occur
intermixed with text and may appear in arguments to requests, macros,
and other escape sequences. An escape sequence is introduced by the
escape character, a backslash '\' (but see the 'ec' request below). The
next character selects the escape's function.
Escape sequences vary in length. Some take an argument, and of
those, some have different syntactical forms for a one-character,
two-character, or arbitrary-length argument. Others accept _only_ an
arbitrary-length argument. In the former scheme, a one-character
argument follows the function character immediately, an opening
parenthesis '(' introduces a two-character argument (no closing
parenthesis is used), and an argument of arbitrary length is enclosed in
brackets '[]'. In the latter scheme, the user selects a delimiter
character. A few escape sequences are idiosyncratic, and support both
of the foregoing conventions ('\s'), designate their own termination
sequence ('\?'), consume input until the next newline ('\!', '\"',
'\#'), or support an additional modifier character ('\s' again, and
'\n'). In no case can an escape sequence parameter contain an unescaped
newline. As with requests, use of some escape sequences in source
documents may interact poorly with a macro package you use; consult its
documentation to learn of "safe" sequences or alternative facilities it
provides to achieve the desired result.
If the character that follows the escape character does not identify
a valid operation, the formatter ignores the escape character.(1)
(*note Using Escape Sequences-Footnote-1::)
$ groff -T ps -ww
.nr N 12
.ds co white
.ds animal elephant
I have \fI\nN \*(co \*[animal]s,\f[]
said \P.\&\~Pseudo Pachyderm.
error-> warning: ignoring escape character before 'P'
=> I have 12 white elephants, said P. Pseudo Pachyderm.
Escape sequence interpolation is of higher precedence than escape
sequence argument interpretation. This rule affords flexibility in
using escape sequences to construct parameters to other escape
sequences.
.ds family C\" Courier
.ds style I\" oblique
Choose a typeface \f(\*[family]\*[style]wisely.
=> Choose a typeface wisely.
In the above, the syntax form '\f(' accepts only two characters for an
argument; the example works because the subsequent escape sequences are
interpolated before the selection escape sequence argument is processed,
and strings 'family' and 'style' interpolate one character each.(2)
(*note Using Escape Sequences-Footnote-2::)
The escape character is nearly always interpreted when encountered;
it is therefore desirable to have a way to interpolate it, disable it,
or change it.
-- Escape sequence: \e
Interpolate the escape character. '\e' is interpreted even in copy
mode (*note Copy Mode::).
The '\[rs]' special character escape sequence formats a backslash
glyph. In macro and string definitions, the input sequences '\\' and
'\E' defer interpretation of escape sequences. *Note Copy Mode::.
-- Request: .eo
Disable the escape mechanism except in copy mode. Once this
request is invoked, no input character is recognized as starting an
escape sequence in interpretation mode.
-- Request: .ec [o]
Recognize the ordinary character O as the escape character. If O
is absent or invalid, the default escape character '\' is selected.
If O (or '\' if O is invalid) is already the control or no-break
control character, an error is diagnosed and the request ignored.
Switching escape sequence interpretation off to define a macro and
back on afterward can obviate the need to double the escape character
within the definition. *Note Writing Macros::. This technique is not
available if your macro needs to interpolate values at the time it is
_defined_--but many do not.
.\" simplified `BR` macro from the man(7) macro package
.eo
.de BR
. ds result \&
. while (\n[.$] >= 2) \{\
. as result \fB\$1\fR\$2\"
. shift 2
. \}
. if \n[.$] .as result \fB\$1\"
\*[result]
. rm result
. ft R
..
.ec
-- Request: .ecs
-- Request: .ecr
The 'ecs' request stores the escape character for recall with
'ecr'. 'ecr' sets the escape character to '\' if none has been
saved.
Use these requests together to temporarily change the escape
character.
Using a different escape character, or disabling it, when calling
macros not under your control will likely cause errors, since GNU
'troff' has no mechanism to "intern" macros--that is, to convert a macro
definition into a form independent of its representation.(3) (*note
Using Escape Sequences-Footnote-3::) When a macro is called, its
contents are interpreted literally.
(1) GNU 'troff' emits a warning in category 'escape'. *Note
Warnings::.
(2) The omission of spaces before the comment escape sequences is
necessary; see *note Strings::.
(3) TeX does have such a mechanism.
5.6.5 Delimiters
----------------
Some escape sequences that require parameters delimit them. The neutral
apostrophe ''' is a popular delimiter choice and shown in this document.
The neutral double quote '"' is also commonly seen. Punctuation
characters are the best choice (and most portable to other 'troff's),
except for those meaningful in numeric expressions; see below.
\l'1.5i\[bu]' \" draw 1.5 inches of bullet glyphs
The following escape sequences are not themselves delimited, and thus
are allowed as delimiters: '\', '\%', '\|', '\^', '\{', '\}', '\'',
'\`', '\-', '\_', '\!', '\?', '\)', '\/', '\,', '\&', '\:', '\~', '\0',
'\a', '\c', '\d', '\e', '\E', '\p', '\r', '\t', and '\u'. However, we
discourage using them this way; they can make the input confusing to
read.(1) (*note Delimiters-Footnote-1::) An invalid escape sequence is
valid as a delimiter if the character after the escape character would
be valid.
The escape sequences '\D', '\h', '\H', '\l', '\L', '\N', '\R', '\s',
'\S', '\v', and '\x' prohibit delimiters that are meaningful in numeric
expressions, because they accept numeric expressions as (or within)
their arguments. For consistency, GNU 'troff' prohibits the same
delimiters in the argument to the 'tl' request.(2) (*note
Delimiters-Footnote-2::) The 'if', 'ie', and 'while' requests each
interpret their first argument as a conditional expression;(3) (*note
Delimiters-Footnote-3::) only characters that are not meaningful as
operators in that context can be used as output comparison delimiters.
The following inputs are therefore invalid as delimiters in GNU 'troff'.
* the numerals '0'-'9' and the decimal point '.'
* the (single-character) operators '+-/*%<>=&:()|'
* the space and tab characters
* any escape sequences other than '\%', '\:', '\{', '\}', '\'', '\`',
'\-', '\_', '\!', '\/', '\c', '\e', and '\p'
Delimiter syntax is flexible (and laborious to describe) primarily
for historical reasons; the foregoing restrictions need be kept in mind
mainly when using GNU 'troff' in AT&T compatibility mode. Normally, GNU
'troff' 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 those
that result from interpolation. Typically, ''' works fine.(4) (*note
Delimiters-Footnote-4::)
$ groff -T ps
.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.
We see here that in compatibility mode, the part of the argument
after the ''' delimiter escapes, if you will, from its context and, if
nefariously crafted, influences the computation of the WD register's
value in a surprising way.
(1) The GNU 'eqn(1)' and 'tbl(1)' preprocessors use parameterized but
non-delimited special character escape sequences '\(' and '\[' to
bracket portions of their output.
(2) *Note Page Layout::.
(3) *Note Operators in Conditionals::.
(4) *Note Implementation Differences::.
5.7 Comments
============
One of the most common forms of escape sequence is the comment.(1)
(*note Comments-Footnote-1::)
-- Escape sequence: \"
Start a comment; read everything up to the next newline in copy
mode (*note Copy Mode::) and discard it. '\"' is interpreted even
in copy mode.
It can be tricky to keep the comments from interfering with the
appearance of the output. If the escape sequence is to the right
of some text or a request, that portion of the line is ignored, but
GNU 'troff' processes spaces preceding it normally. This affects
requests that read the remainder of the control line as a single
argument, including 'ds', 'as', 'tm', and 'char'; their variants;
as well as 'ab', 'device', 'length', 'output', 'pi', 'pso', 'rd',
'sy', 'write', and 'writec'.
One possibly irritating idiosyncrasy is that tabs should not be
used to vertically align comments in the source document. Tab
characters are not treated as separators between a request name and
its first argument, nor between arguments.
The formatter handles a '\"' comment on a line by itself as a blank
line, because after eliminating the comment, that is all that
remains.
apples bananas
\" cantaloupes
durians
=> apples bananas
=>
=> durians
To compensate, it is common to combine the empty request with the
comment escape sequence as '.\"', causing the input line to be
ignored.
Another commenting scheme sometimes seen is three consecutive
neutral apostrophes (''''') at the beginning of an input line.
This works,(2) (*note Comments-Footnote-2::) but GNU 'troff' emits
a warning diagnostic (if enabled) about an undefined macro (namely
'''').
-- Escape sequence: \#
Start a whole-line comment; read everything up to and including the
next newline in copy mode(3) (*note Comments-Footnote-3::) and
discard it. GNU 'troff' introduced this extension to avoid the
problems described above. ('\"' is still widely seen, and remains
useful for partial-line comments on control lines.) '\#' is
interpreted even in copy mode.
.nr in-indonesia 1
apples bananas \" common favorites
\# cantaloupes
.ie \n[in-indonesia] durians \" Borneo, Sumatra
.el elderberries \" England, France
=> apples bananas durians
If we change the comment escape sequence from '\"' to '\#' on the
line with the 'ie' request, we get the following undesired output.
=> apples bananas durians .el elderberries
-- Request: .ig [end]
Ignore input until, in the current conditional block (if any),(4)
(*note Comments-Footnote-4::) the macro END is called at the start
of a control line, or the control line '..' is encountered if END
is not specified. 'ig' is parsed as if it were a macro definition,
but its contents are discarded, not stored.(5) (*note
Comments-Footnote-5::)
.ll 45n
hand\c
.de TX
fasting
..
.ig TX
This is part of a large block of input that has been
temporarily(?) commented out.
.TX
shake
=> handfasting shake
Observe the result if we remove the 'ig' request and the call of
its end macro.
=> handThis is part of a large block of input
=> that has been temporarily(?) commented out.
=> shake
(1) This claim may be more aspirational than descriptive.
(2) except in copy mode on Plan 9 'troff'
(3) *Note Copy Mode::.
(4) *Note Conditional Blocks::.
(5) Exception: auto-incrementing registers defined outside the
ignored region _will_ be modified if interpolated with '\n±' inside it.
*Note Auto-increment::.
5.8 Registers
=============
In the 'roff' language, numbers and measurements can be stored in
"registers". Many built-in registers exist, supplying anything from
components of the date to details of formatting parameters; some of
these are read-only. You can also define your own. Recall *note
Identifiers::, regarding the construction of valid names for registers.
Each register (except read-only ones) can be assigned a "format",
causing its value to interpolate with leading zeroes, in Roman numerals,
or alphabetically. Some read-only registers are string-valued, meaning
that they interpolate text and lack a format.
5.8.1 Setting Registers
-----------------------
Define registers and update their values with the 'nr' request or the
'\R' escape sequence.
-- Request: .nr ident value
-- Escape sequence: \R'''ident value'''
Set register IDENT to VALUE. If IDENT doesn't exist, the formatter
creates it. In the '\R' escape sequence, the delimiter need not be
a neutral apostrophe; see *note Delimiters::.
.nr a (((17 + (3 * 4))) % 4)
\n[a]
.\R'a (((17 + (3 * 4))) % 4)'
\n[a]
=> 1 1
(Later, we will discuss additional forms of 'nr' and '\R' that can
change a register's value after it is dereferenced but before it is
interpolated. *Note Auto-increment::.)
GNU 'troff' does not tokenize '\R' when reading it; the escape
sequence updates only the formatter's register dictionary and does
not contribute (directly) to output. *Note GNU troff Internals::.
Further surprise can occur if you use registers like '.k',(1)
(*note Setting Registers-Footnote-1::) whose values are not
determined until they are interpolated.
.ll 1.6i
.
aaa bbb ccc ddd eee fff ggg hhh\R':k \n[.k]'
.tm :k == \n[:k]
=> :k == 126950
.
.br
.
aaa bbb ccc ddd eee fff ggg hhh\h'0'\R':k \n[.k]'
.tm :k == \n[:k]
=> :k == 15000
If you process this with the PostScript device ('-T ps'), there
will be a line break eventually after 'ggg' in both input lines.
However, after processing the space after 'ggg', the partially
collected line is not overfull yet, so GNU 'troff' continues to
collect input until it sees the space (or in this case, the
newline) after 'hhh'. At this point, the line is longer than the
line length, and the line gets broken.
In the first input line, since the '\R' escape sequence leaves no
traces, the check for the overfull line hasn't been done yet at the
point where '\R' gets handled, and you get a value for the '.k'
register that is even greater than the current line length.
In the second input line, the insertion of '\h'0'' to cause a
zero-width motion forces GNU 'troff' to check the line length,
which in turn causes the start of a new output line. Now '.k'
returns the expected value.
'nr' and '\R' each have two additional special forms to increment or
decrement a register.
-- Request: .nr ident +value
-- Request: .nr ident -value
-- Escape sequence: \R'''ident +value'''
-- Escape sequence: \R'''ident -value'''
Increment (decrement) register IDENT by VALUE. In the '\R' escape
sequence, the delimiter need not be a neutral apostrophe; see *note
Delimiters::.
.nr a 1
.nr a +1
\na
=> 2
A 'roff' formatter always interprets a leading minus sign in VALUE
as a decrementation operator, not an algebraic sign. To assign a
register a negative value or the negated value of another register,
you must force the formatter to interpret '-' as a negation or
minus, rather than decrementation, operator: enclose the '-' with
its operand in parentheses or subtract the expression of interest
from zero.
.nr a 7
.nr b 3
.nr a -\nb
\na
=> 4
.nr a (-\nb)
\na
=> -3
.nr a 0-\nb
\na
=> -3
If a register's prior value does not exist--the register was
undefined--an increment or decrement is applied as if to 0.
-- Request: .rr reg ...
Remove each register REG. If REG doesn't exist, the request is
ignored. Technically, only the name is removed; the register's
contents are still accessible under aliases created with 'aln', if
any.
This request is incorrectly documented in the AT&T 'troff' manual
as accepting only one argument.
-- Request: .rnn ident1 ident2
Rename register IDENT1 to IDENT2. If IDENT1 doesn't exist, the
request is ignored. Renaming a built-in register does not
otherwise alter its properties.
-- Request: .aln new-register old-register
Create alias (additional name) NEW-REGISTER of EXISTING-REGISTER,
causing the names to refer to the same stored object. If
EXISTING-REGISTER is undefined, the formatter ignores the
request.(2) (*note Setting Registers-Footnote-2::)
To remove a register alias, invoke 'rr' on its name. A register's
contents do not become inaccessible until it has no more names.
(1) *Note Page Motions::.
(2) GNU 'troff' emits a warning in category 'reg'. *Note Warnings::.
5.8.2 Interpolating Registers
-----------------------------
The '\n' escape sequence interpolates register contents.
-- Escape sequence: \ni
-- Escape sequence: \n(id
-- Escape sequence: \n[ident]
Interpolate register with name IDENT (one-character name I,
two-character name ID). If the register is undefined, the
formatter creates it and assigns it a value of '0', and
interpolates that value.(1) (*note Interpolating
Registers-Footnote-1::) '\n' is interpreted even in copy mode
(*note Copy Mode::).
.nr a 5
.nr as \na+\na
\n(as
=> 10
.nr a1 5
.nr ab 6
.ds str b
.ds num 1
\n[a\n[num]]
=> 5
\n[a\*[str]]
=> 6
(1) GNU 'troff' emits a warning in category 'reg'. *Note Warnings::.
5.8.3 Auto-increment
--------------------
User-defined registers can also be incremented or decremented by a
configured amount at the time they are interpolated. The value of the
increment is specified with a third argument to the 'nr' request, and a
special interpolation syntax alters and then retrieves the register's
value. Together, these features are called "auto-increment".(1) (*note
Auto-increment-Footnote-1::)
-- Request: .nr ident value incr
Set register IDENT to VALUE and its auto-incrementation amount to
INCR. The '\R' escape sequence doesn't support an INCR argument.
Auto-incrementation is not _completely_ automatic; the '\n' escape
sequence in its basic form never alters the value of a register. To
apply auto-incrementation to a register, interpolate it with '\n±'.
-- Escape sequence: \n+i
-- Escape sequence: \n-i
-- Escape sequence: \n+(id
-- Escape sequence: \n-(id
-- Escape sequence: \n+[ident]
-- Escape sequence: \n-[ident]
Increment or decrement IDENT (one-character name I, two-character
name ID) by the register's auto-incrementation value and then
interpolate the new register value. If IDENT has no
auto-incrementation value, GNU 'troff' interpolates its value
without alteration.
.nr a 0 1
.nr xx 0 5
.nr foo 0 -2
\n+a, \n+a, \n+a, \n+a, \n+a
.br
\n-(xx, \n-(xx, \n-(xx, \n-(xx, \n-(xx
.br
\n+[foo], \n+[foo], \n+[foo], \n+[foo], \n+[foo]
=> 1, 2, 3, 4, 5
=> -5, -10, -15, -20, -25
=> -2, -4, -6, -8, -10
To change the increment value without changing the value of a
register, assign the register's value to itself by interpolating it, and
specify the desired increment normally. Apply an increment of '0' to
disable auto-incrementation of the register.
(1) A negative auto-increment can be considered an "auto-decrement".
5.8.4 Assigning Register Formats
--------------------------------
A writable register's value can be interpolated in several number
formats. By default, conventional Arabic numerals are used. Other
formats see use in sectioning and outlining schemes and alternative page
numbering arrangements.
-- Request: .af reg fmt
Use number format FMT when interpolating register REG. Valid
number formats are as follows.
'0...'
Arabic numerals 0, 1, 2, and so on. Any decimal digit is
equivalent to '0'; the formatter merely counts the digits
specified. Multiple Arabic numerals in FMT cause
interpolations to be zero-padded on the left if necessary to
at least as many digits as specified (interpolations never
truncate a register value). A register with format '00'
interpolates values 1, 2, 3 as '01', '02', '03'. The default
format for all writable registers is '0'.
'I'
Uppercase Roman numerals: 0, I, II, III, IV, ...
'i'
Lowercase Roman numerals: 0, i, ii, iii, iv, ...
'A'
Uppercase letters: 0, A, B, C, ..., Z, AA, AB, ...
'a'
Lowercase letters: 0, a, b, c, ..., z, aa, ab, ...
Omitting FMT causes a warning in category 'missing'. *Note
Warnings::, regarding the enablement and suppression of warnings.
Specifying an unrecognized format is an error.
Zero values are interpolated as '0' in non-Arabic formats.
Negative quantities are prefixed with '-' irrespective of format.
In Arabic formats, the sign supplements the field width. If REG
doesn't exist, it is created with a zero value.
.nr a 10
.af a 0 \" the default format
\na,
.af a I
\na,
.af a 321
.nr a (-\na)
\na,
.af a a
\na
=> 10, X, -010, -j
The representable extrema in the 'i' and 'I' formats correspond to
Arabic ±39,999. GNU 'troff' uses 'w' and 'z' to represent 5,000
and 10,000 in Roman numerals, respectively, following the
convention of AT&T 'troff'--currently, the correct glyphs for Roman
numerals five thousand ('U+2181') and ten thousand ('U+2182') are
not used.
Assigning the format of a read-only register is an error. Instead,
copy the read-only register's value to, and assign the format of, a
writable register.
-- Escape sequence: \gr
-- Escape sequence: \g(rg
-- Escape sequence: \g[reg]
Interpolate the format of the register REG (one-character name R,
two-character name RG). Zeroes represent Arabic formats. If REG
is not defined, REG is not created and nothing is interpolated.
'\g' is interpreted even in copy mode (*note Copy Mode::).
GNU 'troff' interprets only Arabic numerals. The Roman numeral or
alphabetic formats cannot be used as operands to arithmetic operators in
expressions (*note Numeric Expressions::). For instance, it may be
desirable to test the page number independently of its format.
.af % i \" front matter
.de header-trap
. \" To test the page number, we need it in Arabic.
. ds saved-page-number-format \\g%\"
. af % 0
. nr page-number-in-decimal \\n%
. af % \\*[saved-page-number-format]
. ie \\n[page-number-in-decimal]=1 .do-first-page-stuff
. el \{\
. ie o .do-odd-numbered-page-stuff
. el .do-even-numbered-page-stuff
. \}
. rm saved-page-number-format
..
.wh 0 header-trap
5.8.5 Built-in Registers
------------------------
Predefined registers whose identifiers start with a dot are read-only.
Many are Boolean-valued, interpolating a true or false value testable
with the 'if', 'ie', or 'while' requests.
*Caution:* Built-in registers are subject to removal like others;
once removed, they can be recreated only as normal writable registers
and will not otherwise reflect the configuration of the formatter.
A register name is often associated with a request of the same name
(without the dot). A complete listing of all built-in registers can be
found in *note Register Index::.
We present here a few built-in registers that are not described
elsewhere in this manual; they have to do with invariant properties of
GNU 'troff', or obtain information about its command-line options or
processing progress.
'\n[.A]'
Approximate output is being formatted (Boolean-valued); see
'groff''s '-a' option (*note Groff Options::).
'\n[.c]'
'\n[c.]'
Input line number. 'c.' is a writable synonym, affecting
subsequent interpolations of both '.c' and 'c.'.
'\n[.F]'
Name of input file (string-valued).
'\n[.g]'
Always true in GNU 'troff' (Boolean-valued). Documents can use
this to ask the formatter if it claims 'groff' compatibility.
'\n[.P]'
Output page selection status (Boolean-valued); see 'groff''s '-o'
option (*note Groff Options::).
'\n[.R]'
Count of available unused registers; in GNU 'troff' this register
always interpolates the maximum representable integer.(1) (*note
Built-in Registers-Footnote-1::) Favor its use over numeric
literals with many zeroes or nines to indicate an arbitrary large
quantity.
'\n[.T]'
Indicator of output device selection (Boolean-valued); see
'groff''s '-T' option (*note Groff Options::).
'\n[.U]'
Unsafe mode enablement status (Boolean-valued); see 'groff''s '-U'
option (*note Groff Options::).
'\n[.x]'
Major version number of the running GNU 'troff' formatter. For
example, if the version number is 1.23.0, then '.x' contains '1'.
'\n[.y]'
Minor version number of the running GNU 'troff' formatter. For
example, if the version number is 1.23.0, then '.y' contains '23'.
'\n[.Y]'
Revision number of the running GNU 'troff' formatter. For example,
if the version number is 1.23.0, then '.Y' contains '0'.
(1) GNU 'troff' dynamically allocates memory for as many registers as
required.
5.9 Manipulating Filling and Adjustment
=======================================
When an output line is pending (see below), a break moves the drawing
position to the beginning of the next text baseline, interrupting
filling. Recall *note Breaking::. The 'br' request likewise causes a
break. Several other requests imply breaks: 'bp', 'brp', 'ce', 'cf',
'fi', 'fl', 'in', 'nf', 'rj', 'sp', 'ti', and 'trf'. If the no-break
control character is used with any of these requests, GNU 'troff'
suppresses the break; instead the requested operation takes effect at
the next break. ''br' and ''brp' do nothing.
.ll 55n
This line is normally filled and adjusted.
.br
A line's alignment is decided
'ce \" Center the next input line (with no initial break).
when it is output.
This line returns to normal filling and adjustment.
=> This line is normally filled and adjusted.
=> A line's alignment is decided when it is output.
=> This line returns to normal filling and adjustment.
Output line properties like page offset, indentation, adjustment, and
even the location of its text baseline, are not determined until the
line has been broken. An output line is said to be "pending" if some
input has been collected but an output line corresponding to it has not
yet been written; such an output line is also termed "partially
collected". If no output line is pending, it is as if a break has
already happened; additional breaks, whether explicit or implicit, have
no effect. If the vertical drawing position is negative--as it is when
the formatter starts up--a break starts a new page (even if no output
line is pending) unless an end-of-input macro is being interpreted.
*Note End-of-input Traps::.
-- Request: .br
Break the line: emit any pending output line without adjustment.
foo bar
.br
baz
'br
qux
=> foo bar
=> baz qux
You can prevent a break between words, as with a quantity and its
units.
-- Escape sequence: \~
Insert an adjustable, unbreakable space. As with ordinary spaces,
the formatter discards any sequence of these at the end of an
output line if a break occurs.
Set the output speed to\~1.
There are 1,024\~bytes in 1\~KiB.
J.\~F.\~Ossanna wrote the original CSTR\~#54.
By default, the formatter fills text and adjusts it to reach the
output line length. The 'nf' request disables filling; the 'fi' request
reënables it.
-- Request: .fi
-- Register: \n[.u]
Enable filling of output lines; a pending output line is broken.
The read-only register '.u' is set to 1. The filling enablement
status, sometimes called "fill mode", is associated with the
environment (*note Environments::). *Note Line Continuation::, for
interaction with the '\c' escape sequence.
-- Request: .nf
Disable filling of output lines: the output line length (*note Line
Layout::) is ignored and output lines are broken where the input
lines are. A pending output line is broken and adjustment is
suppressed. The read-only register '.u' is set to 0. The filling
enablement status is associated with the environment (*note
Environments::). See *note Line Continuation::, for interaction
with the '\c' escape sequence.
-- Request: .ad [mode]
-- Register: \n[.j]
Enable output line adjustment in MODE, taking effect when the
pending (or next) output line is broken. Adjustment is suppressed
when filling is. MODE can have one of the following values.
'b'
'n'
Adjust "normally": if the output line does not consume the
distance between the indentation and the configured output
line length, GNU 'troff' stretches adjustable spaces within
the line until that length is reached. When the indentation
is zero, this mode spreads the line to both the left and right
margins. This is the GNU 'troff' default.
'c'
Center filled text. Contrast with the 'ce' request, which
centers text _without_ filling it.
'l'
Align text to the left without adjusting it.
'r'
Align text to the right without adjusting it.
MODE can also be a value previously stored in the '.j' register.
Using 'ad' without an argument is the same as '.ad \n[.j]'; unless
filling is disabled, GNU 'troff' resumes adjusting lines in the
same way it did before adjustment was disabled by invocation of the
'na' request.
The adjustment mode and enablement status are encoded in the
read-only register '.j'. These parameters are associated with the
environment (*note Environments::).
The value of '.j' for any adjustment mode is an implementation
detail and should not be relied upon as a programmer's interface.
Do not write logic to interpret or perform arithmetic on it.
.ll 48n
.de AD
. br
. ad \\$1
..
.de NA
. br
. na
..
left
.AD r
.nr ad \n(.j
right
.AD c
center
.NA
left
.AD
center
.AD \n(ad
right
=> left
=> right
=> center
=> left
=> center
=> right
-- Request: .na
Disable output line adjustment, produciing the same output as
left-alignment, but altering the value of the adjustment mode
register '.j' differently. The adjustment mode and enablement
status are associated with the environment.(1) (*note Manipulating
Filling and Adjustment-Footnote-1::)
Normally, an explicit break implies non-adjustment of the pending
output line, as at the end of a paragraph.
-- Request: .brp
-- Escape sequence: \p
The 'brp' request commands a break as 'br' does, but also forces
adjustment of the output line per the current adjustment mode.
Like 'br', it does nothing if invoked with the no-break control
character.
'\p' schedules a break with adjustment at the next word boundary.
The escape sequence is itself neither a break nor a space of any
kind; it can thus be placed in the middle of a word to cause a
break at the end of that word.
'\p' is typically used for fine-tuning of typeset output late in
the document revision process. One of its applications is
prevention of a break after an explicit hyphen when this occurs in
an undesired place, such as at the end of a recto page, or before a
displayed figure. The hyphenation mode can be configured to
prevent breaks after _automatically_ placed hyphens, but not
explicit ones.(2) (*note Manipulating Filling and
Adjustment-Footnote-2::) What one can do in this scenario is place
'\p' at the end of the word _before_ the one that breaks
undesirably.
.ll 1.375i
The next data were out-of-band. \" breaks after "out-"
.br
The next data were\p out-of-band. \" breaks after "were"
Breaking with immediate adjustment can produce ugly results since
GNU 'troff' doesn't have a sophisticated paragraph-building
algorithm, as TeX has, for example. Instead, GNU 'troff' fills and
adjusts a paragraph line by line.
.ll 4.5i
This is an uninteresting sentence.
This is an uninteresting sentence.\p
This is an uninteresting sentence.
is formatted as follows.
This is an uninteresting sentence. This is
an uninteresting sentence.
This is an uninteresting sentence.
To clearly present the next couple of requests, we must introduce the
concept of "productive" input lines. A "productive input line" is one
that directly produces formatted output. Text lines produce output,(3)
(*note Manipulating Filling and Adjustment-Footnote-3::) as do control
lines containing requests like '.tl //Page %//' or escape sequences like
'\l'1i''. Macro calls are not themselves productive, but their
interpolations can be. Empty requests, and requests and escape
sequences that define registers or strings or alter the formatting
environment (as with changes to the size, face, height, slant, or color
of the type) are not productive.(4) (*note Manipulating Filling and
Adjustment-Footnote-4::) We will also preview the output line
continuation escape sequence, '\c', which "connects" two input lines
that would otherwise be counted separately. (5) (*note Manipulating
Filling and Adjustment-Footnote-5::)
.de hello
Hello, world!
..
.ce \" center output of next productive input line
.
.nr junk-reg 1
.ft I
Chorus: \c
.ft
.hello
Went the day well?
=> Chorus: Hello, world!
=> Went the day well?
-- Request: .ce [n]
-- Register: \n[.ce]
Break (unless the no-break control character is used), center the
output of the next N productive input lines with respect to the
line length and indentation without filling, then break again
regardless of the invoking control character. If the argument is
not positive, centering is disabled. Omitting the argument implies
an N of '1'. The count of input lines remaining to be centered is
stored in the read-only register '.ce' and is associated with the
environment (*note Environments::).
While the '.ad c' request also centers text, it fills the text as
well.
.de FR
This is a small text fragment that shows the differences
between the `.ce' and the `.ad c' requests.
..
.ll 4i
.ce \n(.R
.FR
.ce 0
.ad c
.FR
=> This is a small text fragment that shows
=> the differences
=> between the `.ce' and the `.ad c' requests.
=>
=> This is a small text fragment that shows
=> the differences between the `.ce' and
=> the `.ad c' requests.
The previous example illustrates a common idiom of turning
centering on for a quantity of lines far in excess of what is
required,(6) (*note Manipulating Filling and
Adjustment-Footnote-6::) and off again after the text to be
centered. This technique relieves humans of counting lines for
requests that take a count of input lines as an argument.
-- Request: .rj [n]
-- Register: \n[.rj]
Break (unless the no-break control character is used), align the
output of the next N productive input lines to the right margin
without filling, then break again regardless of the control
character. If the argument is not positive, right-alignment is
disabled. Omitting the argument implies an N of '1'. The count of
input lines remaining to be right-aligned is stored in the
read-only registeinput r '.rj' and is associated with the
environment (*note Environments::).
.ll 49n
.rj 3
At first I hoped that such a technically unsound
project would collapse but I soon realized it was
doomed to success. \[em] C. A. R. Hoare
=> At first I hoped that such a technically unsound
=> project would collapse but I soon realized it was
=> doomed to success. -- C. A. R. Hoare
-- Request: .ss word-space-size [additional-sentence-space-size]
-- Register: \n[.ss]
-- Register: \n[.sss]
Set the sizes of spaces between words and sentences(7) (*note
Manipulating Filling and Adjustment-Footnote-7::) in twelfths of
the space width of the currently selected font.(8) (*note
Manipulating Filling and Adjustment-Footnote-8::) (A "word space"
is typically one-fourth to one-third em for Western scripts.) The
default for both parameters is 12. Negative values are erroneous.
The first argument is a minimum; if an output line undergoes
adjustment, such spaces may increase in width. The optional second
argument sets the amount of additional space separating sentences
on the same output line. If omitted, this amount is set to
WORD-SPACE-SIZE. The request is ignored if there are no
parameters.
Additional inter-sentence space is used only if the output line is
not full when the end of a sentence occurs in the input. If a
sentence ends at the end of an input line, then both an inter-word
space and an inter-sentence space are added to the output; if two
spaces follow the end of a sentence in the middle of an input line,
then the second space becomes an inter-sentence space in the
output. Additional inter-sentence space is not adjusted, but the
inter-word space that always precedes it may be. Further input
spaces after the second, if present, are adjusted as normal.
The read-only registers '.ss' and '.sss' hold the minimum
inter-word space and supplemental inter-sentence space amounts,
respectively. These parameters are part of the environment (*note
Environments::).
The 'ss' request can insert discardable horizontal space; that is,
space that is discarded at a break. For example, some footnote
styles collect the notes into a single paragraph with large gaps
between each note.
.ll 48n
1.\~J. Fict. Ch. Soc. 6 (2020), 3\[en]14.
.ss 12 48 \" applies to next sentence ending
Reprints no longer available through FCS.
.ss 12 \" go back to normal
2.\~Better known for other work.
=> 1. J. Fict. Ch. Soc. 6 (2020), 3-14. Reprints
=> no longer available through FCS. 2. Better
=> known for other work.
If _undiscardable_ space is required, use the '\h' escape sequence
to put horizontal motion on the output.
(1) *Note Environments::.
(2) *Note Manipulating Hyphenation::.
(3) though not necessarily to the output device; see *note
Diversions::
(4) If you're not sure whether an input line has been productive, you
can use the 'pline' request before and after it to see whether it
produced any output nodes. *Note Debugging::.
(5) *Note Line Continuation::.
(6) The '.R' register interpolates the largest value that GNU 'troff'
can work with. Recall *note Built-in Registers::.
(7) Recall *note Filling:: and *note Sentences:: for the definitions
of word and sentence boundaries, respectively.
(8) *Note Font Description File Format::. This request is
incorrectly documented in the AT&T 'troff' manual as using units of 1/36
em.
5.10 Manipulating Hyphenation
=============================
When filling, GNU 'troff' hyphenates words as needed at user-specified
and automatically determined hyphenation points. The machine-driven
determination of hyphenation points in words requires algorithms and
data, and is susceptible to conventions and preferences. Before
tackling such "automatic hyphenation", let us consider how hyphenation
points can be set explicitly.
Explicitly hyphenated words such as "mother-in-law" are eligible for
breaking after each of their hyphens. Relatively few words in a
language offer such obvious break points, however, and automatic
detection of syllabic (or phonetic) boundaries for hyphenation is not
perfect,(1) (*note Manipulating Hyphenation-Footnote-1::) particularly
for unusual words found in technical literature. We can instruct GNU
'troff' how to hyphenate specific words if the need arises.
-- Request: .hw word ...
Define each argument WORD (comprising ordinary, special, or indexed
characters) as a "hyphenation exception word" such that each
occurrence of a hyphen-minus '-' in WORD indicates a hyphenation
point. For example, the request
.hw in-sa-lub-rious alpha
marks potential hyphenation points in "insalubrious", and prevents
"alpha" from being hyphenated at all.
Besides the space character, any character whose hyphenation code
is zero can be used to separate the arguments (see the 'hcode'
request below).
Hyphenation points specified with 'hw' are not subject to the
within-word placement restrictions imposed by the 'hy' request (see
below).
Hyphenation exception words are associated with the hyphenation
language (see the 'hla' request below); invoking the 'hw' request
in the absence of a hyphenation language is an error. Each
hyphenation language maintains an independent set of hyphenation
exception words.
The formatter ignores the request if it lacks arguments. (2)
(*note Manipulating Hyphenation-Footnote-2::)
Obtain a report of hyphenation exception words on the standard
error stream with the 'phw' request. *Note Debugging::.
These are known as hyphenation exception words in the expectation
that most users will avail themselves of automatic hyphenation; these
exceptions override any rules that would normally apply to a word
matching a hyphenation exception word defined with 'hw'.
Situations also arise when only a specific occurrence of a word needs
its hyphenation altered or suppressed, or when a URL or similar
specialized text needs to be breakable in sensible places without
hyphenation.
-- Escape sequence: \%
-- Escape sequence: \:
To tell GNU 'troff' how to hyphenate words as they occur in input,
use the '\%' escape sequence; it is the default "hyphenation
character". Each instance within a word indicates to GNU 'troff'
that the word may be hyphenated at that point, while prefixing a
word with this escape sequence prevents it from being otherwise
hyphenated. This mechanism affects only that occurrence of the
word; to change the hyphenation of a word for the remainder of
input processing, use the 'hw' request.
GNU 'troff' regards the escape sequences '\X' and '\Y' as starting
a word; that is, the '\%' escape sequence in, say,
'\X'...'\%foobar' or '\Y'...'\%foobar' no longer prevents
hyphenation of 'foobar' but inserts a hyphenation point just prior
to it; most likely this isn't what you want. *Note Postprocessor
Access::.
'\:' inserts a non-printing break point; that is, a word can break
there, but the soft hyphen glyph (see below) is not written to the
output if it does. The remainder of the word is subject to
hyphenation as normal.
You can combine '\:' and '\%' to control breaking of a file name or
URL, or to permit hyphenation only after certain explicit hyphens
within a word.
The \%Lethbridge-Stewart-\:\%Sackville-Baggins divorce
was, in retrospect, inevitable once the contents of
\%/var/log/\:\%httpd/\:\%access_log on the family web
server came to light, revealing visitors from Hogwarts.
-- Request: .hc [char]
Change the hyphenation character to CHAR. This character then
works as the '\%' escape sequence normally does, and thus no longer
appears in the output.(3) (*note Manipulating
Hyphenation-Footnote-3::) Without an argument, 'hc' resets the
hyphenation character to '\%' (the default). The hyphenation
character is associated with the environment (*note
Environments::).
-- Request: .shc [c]
Set the "soft hyphen character", inserted when a word is hyphenated
automatically or at a hyphenation character, to the ordinary or
special character C.(4) (*note Manipulating
Hyphenation-Footnote-4::) If the argument is omitted, the soft
hyphen character is set to the default, '\[hy]'. If no glyph for C
exists in the font in use at a potential hyphenation point, then
the line is not broken there. Neither character definitions
(specified with the 'char' and similar requests) nor translations
(specified with the 'tr' request) are applied to C.
Several requests influence automatic hyphenation. Because
conventions vary, a variety of hyphenation modes is available to the
'hy' request; these determine whether hyphenation will apply to a word
prior to breaking a line at the end of a page (more or less; see below
for details), and at which positions within that word automatically
determined hyphenation points are permissible. The places within a word
that are eligible for hyphenation are determined by language-specific
data and lettercase relationships. Furthermore, hyphenation of a word
might be suppressed due to a limit on consecutive hyphenated lines
('hlm'), a minimum line length threshold ('hym'), or because the line
can instead be adjusted with additional inter-word space ('hys').
-- Request: .hy [mode]
-- Register: \n[.hy]
Set automatic hyphenation mode to MODE, an integer encoding
conditions for hyphenation; if omitted, the configured hyphenation
mode default (see below) is implied. The hyphenation mode is
available in the read-only register '.hy'; it is associated with
the environment (*note Environments::). The hyphenation mode
default depends on the localization file loaded when GNU 'troff'
starts up; see the 'hpf' request below. If no localization file is
loaded, the default is '1'.
Typesetting practice generally does not avail itself of every
opportunity for hyphenation, but the details differ by language and
site mandates. The hyphenation modes of AT&T 'troff' were
implemented with English-language publishing practices of the 1970s
in mind, not a scrupulous enumeration of conceivable parameters.
GNU 'troff' extends those modes such that finer-grained control is
possible, favoring compatibility with older implementations over a
more intuitive arrangement. The means of hyphenation mode control
is a set of numbers that can be added up to encode the behavior
sought.(5) (*note Manipulating Hyphenation-Footnote-5::) The
entries in the following table are termed "values"; the sum of the
desired values is the "mode".
'0'
disables hyphenation.
'1'
enables hyphenation except after the first and before the last
character of a word.
The remaining values "imply" 1; that is, they enable hyphenation
under the same conditions as '.hy 1', and then apply or lift
restrictions relative to that basis.
'2'
disables hyphenation of the last word on a page or column,(6)
(*note Manipulating Hyphenation-Footnote-6::) even for
explicitly hyphenated words.
'4'
disables hyphenation before the last two characters of a word.
'8'
disables hyphenation after the first two characters of a word.
'16'
enables hyphenation before the last character of a word.
'32'
enables hyphenation after the first character of a word.
Apart from value 2, restrictions imposed by the hyphenation mode
are _not_ respected for words whose hyphenations have been
specified with the hyphenation character ('\%' by default) or the
'hw' request.
Nonzero values in the previous table are additive. For example,
mode 12 causes GNU 'troff' to hyphenate neither the last two nor
the first two characters of a word. Some values cannot be used
together because they contradict; for instance, values 4 and 16,
and values 8 and 32. As noted, it is superfluous to add 1 to any
non-zero even mode.
The automatic placement of hyphens in words is determined by
"pattern files", which are derived from TeX and available for
several languages. These files are named 'hyphen.XX' (for the
patterns) and 'hyphenex.XX' (for a list of exceptions in languages
that require them) where XX is an ISO 639 language code; see the
table below.
The number of characters at the beginning of a word after which the
first hyphenation point should be inserted is determined by the
patterns themselves; it can't be reduced further without
introducing additional, invalid hyphenation points (unfortunately,
this information is not part of a pattern file--you have to know it
in advance). The same is true for the number of characters at the
end of a word before the last hyphenation point should be inserted.
For example, you can supply the following input to 'echo $(nroff)'.
.ll 1
.hy 48
splitting
You will get
s- plit- t- in- g
instead of the correct 'split- ting'. English patterns as
distributed with GNU 'troff' need two characters at the beginning
and three characters at the end; this means that value 4 of 'hy' is
mandatory. Value 8 is possible as an additional restriction, but
values 16 and 32 should be avoided, as should mode 1. Modes 4
and 6 are typical.
A table of left and right minimum character counts for hyphenation
as needed by the patterns distributed with GNU 'troff' follows.(7)
(*note Manipulating Hyphenation-Footnote-7::)
language pattern name left min right min
-----------------------------------------------------------
Czech cs 2 2
English en 2 3
French fr 2 3
German traditional det 2 2
German reformed den 2 2
Italian it 2 2
Polish pl 2 2
Russian ru 2 2
Spanish es 2 2
Swedish sv 1 2
Hyphenation exceptions within pattern files (that is, the words
within a TeX '\hyphenation' group) obey hyphenation restrictions
imposed by 'hy'.
-- Request: .nh
Disable automatic hyphenation; i.e., set the hyphenation mode to 0
(see above). The hyphenation mode of the last call to 'hy' is not
remembered, but invoking 'hy' without an argument restores the
hyphenation mode default; 'groff''s localization macro files do so
for the languages listed above.
-- Request: .hydefault [mode]
-- Register: \n[.hydefault]
Set hyphenation mode default to MODE, configuring the value the
automatic hyphenation mode takes if 'hy' is invoked without an
argument. The hyphenation mode default is available in the
read-only register '.hydefault'; it is associated with the
environment.(8) (*note Manipulating Hyphenation-Footnote-8::)
-- Request: .hpf ['"']pattern-file
-- Request: .hpfa ['"']pattern-file
Read hyphenation patterns from PATTERN-FILE, which is sought in the
same way that macro files are with the 'mso' request or the '-m
MAC' command-line option to 'groff'. The PATTERN-FILE should have
the same format as (simple) TeX pattern files. More specifically,
the following scanning rules are implemented.
* A percent sign starts a comment (up to the end of the line)
even if preceded by a backslash.
* "Digraphs" like '\$' are not supported.
* '^^XX' (where each X is 0-9 or a-f) and '^^C' (character C in
the code point range 0-127 decimal) are recognized; other uses
of '^' cause an error.
* No macro expansion is performed.
* 'hpf' checks for the expression '\patterns{...}' (possibly
with whitespace before or after the braces). Everything
between the braces is taken as hyphenation patterns.
Consequently, '{' and '}' are not allowed in patterns.
* Similarly, '\hyphenation{...}' gives a list of hyphenation
exceptions.
* '\endinput' is recognized also.
* For backward compatibility, if '\patterns' is missing, the
whole file is treated as a list of hyphenation patterns
(except that the '%' character is recognized as the start of a
comment).
The 'hpfa' request appends a file of patterns to the current list.
GNU 'troff' ties the set of hyphenation patterns to the hyphenation
language code selected by the 'hla' request (see below). The 'hpf'
request is usually invoked by a localization file loaded by the
'troffrc' file.(9) (*note Manipulating Hyphenation-Footnote-9::)
A second call to 'hpf' (for the same language) replaces the
hyphenation patterns with the new ones. Invoking 'hpf' or 'hpfa'
causes an error if there is no hyphenation language. If no 'hpf'
request is specified (either in the document, in a file loaded at
startup, or in a macro package), GNU 'troff' won't automatically
hyphenate at all.
*Caution:* The 'hpf' and 'hpfa' requests interpret the remainder of
the input line as the file name argument, including any spaces, up
to a newline or comment escape sequence. Suffixing the file name
with a comment, even an empty one, prevents unwanted space from
creeping into it during source document maintenance.(10) (*note
Manipulating Hyphenation-Footnote-10::)
For automatic hyphenation to work, the formatter must know which
letters are equivalent. For example, the letter 'E' behaves like 'e';
only the latter typically appears in hyphenation pattern files. GNU
'troff' expects characters that participate in automatic hyphenation to
be assigned "hyphenation codes" that define these equivalence classes.
At startup, GNU 'troff' assigns hyphenation codes to the letters
'a'-'z', applies the same codes to 'A'-'Z' in one-to-one correspondence,
and assigns a code of zero to all other characters.
The 'hcode' request enables application of hyphenation codes to
characters outside the Unicode basic Latin set; without doing so, words
containing such letters won't hyphenate properly even if the
corresponding hyphenation patterns contain them. Localization files for
the input character set and language configure hyphenation codes; see
'groff_tmac(5)'.
-- Request: .hcode dst1 src1 [dst2 src2] ...
Set the hyphenation code of ordinary or special character DST1 to
that of SRC1, and so on. DST1 must be an ordinary character (other
than a numeral) or a special character, and SRC1 must be an
ordinary character (other than a numeral) or a special character to
which a hyphenation code has already been applied. Assigning the
code of an ordinary character to itself effectively creates a
unique hyphenation code (which can then be copied to others).
'hcode' ignores spaces between arguments. If any argument is
invalid, 'hcode' reports an error and stops reading them.
For example, the following 'hcode' requests are necessary to assign
hyphenation codes to the letters 'ÄäÖöÜüß', needed for German.
.hcode ä ä Ä ä
.hcode ö ö Ö ö
.hcode ü ü Ü ü
.hcode ß ß
Without these assignments, GNU 'troff' treats the German word
'Kindergärten' (the plural form of 'kindergarten') as two words
'kinderg' and 'rten' because the hyphenation code of the umlaut a
is zero by default, just like a space. There is a German
hyphenation pattern that covers 'kinder', so GNU 'troff' finds the
hyphenation 'kin-der'. The other two hyphenation points
('kin-der-gär-ten') are missed.
To remove a character's hyphenation code, copy the code of a
character with a hyphenation code value of zero to it. For
example, '.hcode ß $' removes the hyphenation code from 'ß' (unless
'$' has already been assigned a different one).
The 'pchar' request may be helpful to troubleshoot hyphenation code
assignments. *Note Debugging::.
-- Request: .hpfcode a b [c d] ...
*Caution:* This request will be withdrawn in a future 'groff'
release. Use 'hcode' instead.
The 'hpfcode' request defines mapping values for character codes in
pattern files. It is an older mechanism no longer used by GNU
'troff''s own macro files. 'hpf' or 'hpfa' apply the mapping after
reading the patterns but before replacing or appending to the
active list of patterns. Its arguments are pairs of character
codes--integers from 0 to 255. The request maps character code A
to code B, code C to code D, and so on. Character codes that would
otherwise be invalid in GNU 'troff' can be used.
-- Request: .hla [lang]
-- Register: \n[.hla]
Set the hyphenation language to LANG, or clear it if there is no
argument. Hyphenation exceptions specified with the 'hw' request
and hyphenation patterns and exceptions specified with the 'hpf'
and 'hpfa' requests are associated with the hyphenation language.
The 'hla' request is usually invoked by a localization file, which
is turn loaded by the 'troffrc' or 'troffrc-end' file; see the
'hpf' request above.
The hyphenation language is available in the read-only
string-valued register '.hla'; it is associated with the
environment (*note Environments::).
If no hyphenation language is set or no patterns are loaded, GNU
'troff' does not perform automatic hyphenation.
-- Request: .hlm [n]
-- Register: \n[.hlm]
-- Register: \n[.hlc]
Set the maximum quantity of consecutive hyphenated lines to N. If
N is negative, there is no maximum. If omitted, N is -1. This
value is associated with the environment (*note Environments::).
Only lines output from a given environment count toward the maximum
associated with that environment. Hyphens resulting from '\%' are
counted; explicit hyphens are not.
The '.hlm' read-only register stores this maximum. The count of
immediately preceding consecutive hyphenated lines is available in
the read-only register '.hlc'.
-- Request: .hym [length]
-- Register: \n[.hym]
Set the (right) hyphenation margin to LENGTH. If the adjustment
mode is not 'b' or 'n', the line is not hyphenated if it is shorter
than LENGTH. Without an argument, the hyphenation margin is reset
to its default value, 0. The default scaling unit is 'm'. The
hyphenation margin is associated with the environment (*note
Environments::).
A negative argument resets the hyphenation margin to zero. (11)
(*note Manipulating Hyphenation-Footnote-11::)
The hyphenation margin is available in the '.hym' read-only
register.
-- Request: .hys [hyphenation-space]
-- Register: \n[.hys]
Suppress hyphenation of the line in adjustment modes 'b' or 'n' if
that adjustment can be achieved by adding no more than
HYPHENATION-SPACE extra space to each inter-word space. Without an
argument, the hyphenation space adjustment threshold is set to its
default value, 0. The default scaling unit is 'm'. The
hyphenation space adjustment threshold is associated with the
environment (*note Environments::).
A negative argument resets the hyphenation space adjustment
threshold to zero. (12) (*note Manipulating
Hyphenation-Footnote-12::)
The hyphenation space adjustment threshold is available in the
'.hys' read-only register.
(1) Whether a perfect algorithm for this application is even possible
is an unsolved problem in computer science:
.
(2) GNU 'troff' emits a warning in category 'missing'. *Note
Warnings::.
(3) '\%' itself stops marking hyphenation points but still produces
no output glyph.
(4) "Soft" because it appears in output only where a hyphenation
break is performed; a "hard" hyphen, as in "long-term", always appears.
(5) The mode is a vector of Boolean values encoded as an integer. To
a programmer, this fact is easily deduced from the exclusive use of
powers of two for the configuration parameters; they are computationally
easy to "mask off" and compare to zero. To almost everyone else, the
arrangement seems recondite and unfriendly.
(6) The formatter prevents hyphenation if the next page location trap
is closer to the vertical drawing position than the next text baseline
would be. *Note Page Location Traps::. A macro package might also
employ value '2' to prevent hyphenation before a display; recall *note
Displays and Keeps::.
(7) See subsection "Localization packages" of 'groff_tmac(5)'.
(8) *Note Environments::.
(9) For more detail on localization, see 'groff_tmac(5)'.
(10) See the discussion of the 'ds' request in *note Strings::.
(11) GNU 'troff' also emits a warning in category 'range'. *Note
Warnings::.
(12) GNU 'troff' also emits a warning in category 'range'. *Note
Warnings::.
5.11 Manipulating Spacing
=========================
A break causes the formatter to update the vertical drawing position at
which the new text baseline is placed; you can alter this location.
-- Request: .sp [vertical-distance]
Break and move the next text baseline down by DISTANCE, or until
springing a page location trap.(1) (*note Manipulating
Spacing-Footnote-1::) If invoked with the no-break control
character, 'sp' moves the text baseline applicable to the entire
pending output line by VERTICAL-DISTANCE.(2) (*note Manipulating
Spacing-Footnote-2::) A negative VERTICAL-DISTANCE cannot reduce
the position of the text baseline below zero. Inside a diversion,
the formatter ignores any argument. The default scaling unit is
'v'. Omitting VERTICAL-DISTANCE implies '1v'.
.pl 5v \" Set page length to 5 vees.
.de xx
\-\-\-
. br
..
.wh 0 xx \" Set a trap at the top of the page.
foo on page \n%
.sp 2v
bar on page \n%
.sp 50v \" This will cause a page break.
baz on page \n%
.pl \n(nlu \" Truncate page to current position.
=> ---
=> foo on page 1
=>
=>
=> bar on page 1
=> ---
=> baz on page 2
The following macros place the next text baseline relative to the
page top or bottom. We subtract one line height ('\n[.v]') because
the '|' operator moves the drawing position relative to the first
baseline on the page (recall *note Numeric Expressions::).
.de y-from-top-down
. sp |\\$1-\\n[.v]u
..
.de y-from-bot-up
. sp |\\n[.p]u-\\$1-\\n[.v]u
..
The input '.y-from-bot-up 10c' sets the next text baseline 10 cm
from the bottom edge of the paper.
Applying the boundary-relative measurement operator '|' operator to
VERTICAL-DISTANCE, as in '|'N, moves to a position relative to the
page top for positive N, and the bottom if N is negative.
-- Request: .ls [count]
-- Register: \n[.L]
Set the line spacing; add COUNT-1 blank lines after each line of
text. With no argument, GNU 'troff' uses the previous value before
the last 'ls' call. The default is '1'.
The read-only register '.L' contains the current line spacing; it
is associated with the environment (*note Environments::).
The 'ls' request is a coarse mechanism. *Note Changing the Type
Size::, for the requests 'vs' and 'pvs' as alternatives to 'ls'.
.de SetNewLineSpacing
. if r *old-vs .ab cannot nest SetNewLineSpacing
. nr *old-vs \\n[.v]
. vs (\\n[.v] * \\$1)
..
.
.de RestoreOldLineSpacing
. vs \\n[*old-vs]
. rr *old-vs
..
-- Escape sequence: \x'''spacing'''
-- Register: \n[.a]
Sometimes, an output line requires additional vertical spacing, for
instance to allow room for a tall construct like an inline equation
with exponents or subscripts (particularly if they are iterated).
The '\x' escape sequence takes a delimited measurement (like
'\x'3p'') to increase the vertical spacing of the pending output
line. The default scaling unit is 'v'. If the measurement is
positive, extra vertical space is inserted below the current line;
a negative measurement adds space above. If '\x' is applied to the
pending output line multiple times, the maxima of the positive and
negative adjustments are separately applied. The delimiter need
not be a neutral apostrophe; see *note Delimiters::.
The '.a' read-only register contains the extra vertical spacing
_after_ the text baseline of the most recently emitted output line.
(In other words, it is the largest positive argument to '\x'
encountered on that line.) This quantity is exposed via a register
because if an output line requires this "extra post-vertical line
spacing", and the subsequent output line requires "extra
pre-vertical line spacing" (a negative argument to '\x'), then
applying both can lead to excessive spacing between the output
lines. Text that is piling high on line N might not require (as
much) extra pre-vertical line spacing if line N-1 carries extra
post-vertical line spacing.
Use of '\x' can be necessary in combination with the
bracket-building escape sequence '\b',(3) (*note Manipulating
Spacing-Footnote-3::) as the following example shows.
.nf
This is a test of \[rs]b (1).
This is a test of \[rs]b (2).
This is a test of \b'xyz'\x'-1m'\x'1m' (3).
This is a test of \[rs]b (4).
This is a test of \[rs]b (5).
=> This is a test of \b (1).
=> This is a test of \b (2).
=> x
=> This is a test of y (3).
=> z
=> This is a test of \b (4).
=> This is a test of \b (5).
Without '\x', the backslashes on the lines marked '(2)' and '(4)' would
be overprinted.
-- Request: .ns
-- Request: .rs
-- Register: \n[.ns]
Enable "no-space mode". Vertical spacing, whether by 'sp' requests
or blank input lines, is disabled. The 'bp' request to advance to
the next page is also disabled, unless it is accompanied by a page
number (*note Page Control::). No-space mode ends automatically
when text(4) (*note Manipulating Spacing-Footnote-4::) is formatted
for output (5) (*note Manipulating Spacing-Footnote-5::) or the
'rs' request is invoked, which ends no-space mode. The read-only
register '.ns' interpolates a Boolean value indicating the
enablement of no-space mode.
A paragraphing macro might ordinarily insert vertical space to
separate paragraphs. A section heading macro could invoke 'ns' to
suppress this spacing for the first paragraph in a section.
(1) *Note Page Location Traps::.
(2) To shift the text baseline for _part_ of an output line--to set
super- or subscripts, for instance-use the '\v' escape sequence. *Note
Page Motions::.
(3) *Note Drawing Geometric Objects::.
(4) or geometric objects; see *note Drawing Geometric Objects::
(5) to the top-level diversion; see *note Diversions::
5.12 Tabs and Fields
====================
A tab character (code point 9) causes a horizontal movement to the next
tab stop, if any.
-- Escape sequence: \t
Interpolate a tab in copy mode; see *note Copy Mode::.
-- Request: .ta [[n1 n2 ... nn ]T r1 r2 ... rn]
-- Register: \n[.tabs]
Set tab stop positions. This request takes a series of tab
specifiers as arguments (optionally divided into two groups with
the letter 'T') that indicate where each tab stop is to be,
overriding any previous settings. The default scaling unit is 'm'.
Invoking 'ta' without arguments removes all tab stops. GNU
'troff''s startup value is 'T 0.5i'.
Tab stops can be specified absolutely--as distances from the left
margin. The following example sets six tab stops, one every inch.
.ta 1i 2i 3i 4i 5i 6i
Tab stops can also be specified using a leading '+', which means
that the specified tab stop is set relative to the previous tab
stop. For example, the following is equivalent to the previous
example.
.ta 1i +1i +1i +1i +1i +1i
GNU 'troff' supports an extended syntax to specify repeating tab
stops. These stops appear after a 'T' argument. Their values are
always taken as distances relative to the previous tab stop. This
is the idiomatic way to specify tab stops at equal intervals in
'groff'. The following is, yet again, the same as the previous
examples. It does more, in fact, since it defines an infinite
number of tab stops at one-inch intervals.
.ta T 1i
Now we are ready to interpret the full syntax given above. The
'ta' request sets tabs at positions N1, N2, ..., NN, then at NN+R1,
NN+R2, ..., NN+RN, then at NN+RN+R1, NN+RN+R2, ..., NN+RN+RN, and
so on. For example, '4c +6c T 3c 5c 2c' is equivalent to '4c 10c
13c 18c 20c 23c 28c 30c ...'.
Text between two tab stops may be aligned to the right or left, or
centered. This alignment is determined by appending 'R', 'L', or
'C' to the tab specifier. The default is 'L'.
.ta 1i 2iC 3iR
The beginning of an output line is not a tab stop; the text that
begins an output line is placed according to the configured
alignment and indentation; see *note Manipulating Filling and
Adjustment:: and *note Line Layout::.
A tab stop becomes a non-breakable horizontal movement that cannot
be adjusted.
.ll 2i
.ta T 1i
a->b->c
error-> warning: cannot adjust line; overset by 1n
=> a b c
The above creates a single output line that is a bit longer than
two inches. Now consider the following.
.ll 2i
.ta T 1i
a->b c->d
error-> warning: cannot adjust line; underset by 9n
=> a b
=> c d
GNU 'troff' first converts the line's tab stops into unbreakable
horizontal movements, then breaks after 'b'. This usually isn't
what you want.
Superfluous tab characters--those that do not correspond to a tab
stop--are ignored except for the first, which delimits the
characters belonging to the last tab stop for right-alignment or
centering.
.nf
.ta 2i 4iR
\l'4i\&-'
foo->bar
foo->bar->baz
foo->bar->bazqux
foo->bar->baz->qux
=> ----------------------------------------
=> foo bar
=> foo bar baz
=> foo bar bazqux
=> foo bar bazqux
We see that "bar" is between the first and second tab stops, not
the second and (nonexistent) third. The first "baz" is
right-aligned within the second tab stop. The second is catenated
with "qux" and right-aligned within it. The third "baz" is aligned
like the first because the tab character after it determines the
right boundary of the tab stop.
Tab stops are associated with the environment (*note
Environments::).
The read-only register '.tabs' contains a string representation of
the current tab settings suitable for use as an argument to the
'ta' request.(1) (*note Tabs and Fields-Footnote-1::)
.ds tab-string \n[.tabs]
\*[tab-string]
=> T120u
-- Request: .tc [c]
Set the tab repetition character to the ordinary or special
character C; normally, no glyph is written when moving to a tab
stop (and some output devices may output space characters to
achieve this motion). A "tab repetition character" causes the
formatter to write as many instances of C as are necessary to
occupy the interval from the horizontal drawing position to the
next tab stop. With no argument, GNU 'troff' reverts to the
default behavior. The tab repetition character is associated with
the environment (*note Environments::). Only a single character of
C is recognized; any excess is ignored.
-- Request: .linetabs [b]
-- Register: \n[.linetabs]
Activate or deactivate line-tabs in the environment per Boolean
expression B. They are inactive by default, and activated if B is
omitted. When line-tabs are active, tab stops are computed
relative to the start of the pending output line instead of the
drawing position corresponding to the start of the input line.
.ta 1i 3i
a->\c
b->\c
c
.br
.linetabs
a->\c
b->\c
c
=> a b c
=> a b c
The read-only register '.linetabs' interpolates 1 if line-tabs are
active, and 0 otherwise.
(1) Plan 9 'troff' uses the register '.S' for this purpose.
5.12.1 Leaders
--------------
Sometimes it is desirable to fill a tab stop with a given glyph, but
also use tab stops normally on the same output line. An example is a
table of contents entry that uses dots to bridge the entry name with its
page number, which is itself aligned between tab stops. The 'roff'
language provides "leaders" for this purpose.(1) (*note
Leaders-Footnote-1::)
A leader character (code point 1, also known as SOH or "start of
heading"), behaves similarly to a tab character: it moves to the next
tab stop. The difference is that for this movement, the default fill
character is a period '.'.
-- Escape sequence: \a
Interpolate a leader in copy mode; see *note Copy Mode::.
-- Request: .lc [c]
Set the leader repetition character to the ordinary or special
character C. Recall *note Tabs and Leaders::: when encountering a
leader character in the input, the formatter writes as many dots
'.' as are necessary until reaching the next tab stop; this is the
"leader definition character". Omitting C unsets the leader
character. With no argument, GNU 'troff' treats leaders the same
as tabs. The leader repetition character is associated with the
environment (*note Environments::). Only a single C is recognized;
any excess is ignored.
A table of contents, for example, may define tab stops after a
section number, a title, and a gap to be filled with leader dots. The
page number follows the leader, after a right-aligned final tab stop
wide enough to house the largest page number occurring in the document.
.ds entry1 19.\tThe Prophet\a\t98
.ds entry2 20.\tAll Astir\a\t101
.ta .5i 4.5i +.5iR
.nf
\*[entry1]
\*[entry2]
=> 19. The Prophet............................. 98
=> 20. All Astir............................... 101
(1) Pronounce "leader" to rhyme with "feeder"; it refers to how the
glyphs "lead" the eye across the page to the corresponding page number
or other datum.
5.12.2 Fields
-------------
"Fields" are a more general way of laying out tabular data. A field is
defined as the data between a pair of "delimiting characters". It
contains substrings that are separated by "padding characters". The
width of a field is the distance on the _input_ line from the position
where the field starts to the next tab stop. A padding character
inserts an adjustable space similar to TeX's '\hss' command (thus it can
even be negative) to make the sum of all substring lengths plus the
adjustable space equal to the field width. If more than one padding
character is inserted, the available space is evenly distributed among
them.
-- Request: .fc [delim-char [padding-char]]
Define a delimiting and a padding character for fields. If the
latter is missing, the padding character defaults to a space
character. If there is no argument at all, the field mechanism is
disabled (which is the default). In contrast to, e.g., the tab
repetition character, delimiting and padding characters are _not_
associated with the environment (*note Environments::).
.fc # ^
.ta T 3i
#foo^bar^smurf#
.br
#foo^^bar^smurf#
=> foo bar smurf
=> foo bar smurf
5.13 Character Translations
===========================
A "translation" is a mapping of an input character to an output glyph.
The mapping occurs at output time, i.e., the input character gets
assigned the metric information of the mapped output character right
before tokens are converted to nodes (*note GNU troff Internals::, for
more on this process).
-- Request: .tr abcd...
-- Request: .trin abcd...
Translate character A to glyph B, character C to glyph D, and so
on. If there is an odd number of characters in the argument, the
last one is translated to a fixed-width space (the same one
obtained by the '\' escape sequence).
The 'trin' request works as does 'tr', except that 'asciify' (*note
Diversions::) ignores the translation when a diversion is
interpolated.
Some notes:
* Special characters ('\(XX', '\[XXX]', '\C'XXX'', '\'', '\`',
'\-', '\_'), glyphs defined with the 'char' request, and
numbered glyphs ('\N'XXX'') can be translated also.
* The '\e' escape can be translated also.
* Characters can be mapped onto the '\%' and '\~' escape
sequences (but '\%' and '\~' can't be mapped onto another
glyph).
* The following characters can't be translated: space (with one
exception, see below), backspace, newline, leader (and '\a'),
tab (and '\t').
* Translations are not considered for finding the soft hyphen
character set with the 'shc' request.
* The pair 'C\&' (an arbitrary character C followed by the dummy
character) maps this character to "nothing".
.tr a\&
foo bar
=> foo br
Even the space character can be mapped to the dummy character.
.tr aa \&
foo bar
=> foobar
As shown in the example, the space character can't be the
first character/glyph pair as an argument of 'tr'.
Additionally, it is not possible to map the space character to
any other glyph; requests like '.tr aa x' undo '.tr aa \&'
instead.
If adjustment is enabled, it occurs in spite of the 'empty'
space character; but no minimum distance--no minimum
inter-word space--separates words).
* After an output glyph has been constructed (this happens at
the moment immediately before the glyph is appended to an
output glyph list, either by direct output, in a macro,
diversion, or string), it is no longer affected by 'tr'.
* Translating character to glyphs where one of them or both are
undefined is possible also; 'tr' does not check whether the
elements of its argument exist.
*Note GNU troff Internals::.
* Without an argument, the 'tr' request is ignored.
-- Request: .trnt abcd...
'trnt' is the same as the 'tr' request except that the translations
do not apply to text that is transparently throughput into a
diversion with '\!'. *Note Diversions::.
For example,
.tr ab
.di x
\!.tm a
.di
.x
prints 'b' to the standard error stream; if 'trnt' is used instead
of 'tr' it prints 'a'.
5.14 'troff' and 'nroff' Modes
==============================
Historically, 'nroff' and 'troff' were two separate programs; the former
for terminal output, the latter for typesetters. GNU 'troff' merges
both functions into one executable(1) (*note troff and nroff
Modes-Footnote-1::) that sends its output to a device driver ('grotty'
for terminal devices, 'grops' for PostScript, and so on) that interprets
its output. When discussing AT&T 'troff', it makes sense to talk about
"'nroff' mode" and "'troff' mode" since the differences are hard-coded.
GNU 'troff' takes information from device and font description files
without handling requests specially if a terminal output device is used,
so such a strong distinction is unnecessary.
Usually, a macro package can be used with all output devices.
Nevertheless, it is sometimes necessary to make a distinction between
terminal and non-terminal devices: GNU 'troff' provides two built-in
conditions 'n' and 't' for the 'if', 'ie', and 'while' requests to
decide whether GNU 'troff' shall behave like 'nroff' or like 'troff'.(2)
(*note troff and nroff Modes-Footnote-2::)
-- Request: .troff
Make the 't' built-in condition true (and the 'n' built-in
condition false) for 'if', 'ie', and 'while' conditional requests.
This is the default if GNU 'troff' (_not_ 'groff') is started with
the '-R' switch to avoid loading of the startup files 'troffrc' and
'troffrc-end'. Without '-R', GNU 'troff' stays in 'troff' mode if
the output device is not a terminal (e.g., 'ps').
-- Request: .nroff
Make the 'n' built-in condition true (and the 't' built-in
condition false) for 'if', 'ie', and 'while' conditional requests.
This is the default if GNU 'troff' uses a terminal output device;
the code for switching to 'nroff' mode is in the file 'tty.tmac',
which is loaded by the startup file 'troffrc'.
(1) A GNU 'nroff' program is available for convenience; it runs GNU
'troff' to perform formatting; see 'nroff(1)'.
(2) *Note Conditionals and Loops::, for more on built-in conditions.
5.15 Line Layout
================
The following drawing shows the dimensions that GNU 'troff' uses to
arrange a line of output on the page. Each dimension is labeled with
the name of the request that configures it.
-->| in |<--
|<-----------ll------------>|
+----+----+----------------------+----+
| : : : |
+----+----+----------------------+----+
-->| po |<--
|<--------paper width---------------->|
The dimensions are defined as follows.
'po' The "page offset" is the leftmost position of running text.
'in' "Indentation" is the distance from the page offset at which text
is set.
'll' "Line length" is the maximum extent of unindented running text.
The page offset can be thought of as the "left margin". The right
margin is not explicitly configured; the combination of page offset and
line length provides the information necessary to derive it.
.ll 3i
This is text without indentation.
The line length has been set to 3\~inches.
.in +.5i
.ll -.5i
Now the left and right margins are both increased.
.in
.ll
Calling .in and .ll without parameters restores
the previous values.
=> This is text without indenta-
=> tion. The line length has
=> been set to 3 inches.
=> Now the left and
=> right margins are
=> both increased.
=> Calling .in and .ll without
=> parameters restores the previ-
=> ous values.
Requests exist to place line numbers and margin characters beyond the
page margins; *note Miscellaneous::.
-- Request: .po [offset]
-- Request: .po +offset
-- Request: .po -offset
-- Register: \n[.o]
Set page offset to OFFSET; if OFFSET is signed, adjust the page
offset by its value. The default scaling unit is 'm'. The default
offset is 1i on typesetters and zero on terminals.
If OFFSET is omitted, the page offset is reset to that before the
previous invocation of 'po'.
The page offset can be found in the read-only register '.o'. This
request is incorrectly documented in the AT&T 'troff' manual as
using a default scaling unit of 'v'.
.po 3i
\n[.o]
=> 720
.po -1i
\n[.o]
=> 480
.po
\n[.o]
=> 720
-- Request: .in [indent]
-- Request: .in +indent
-- Request: .in -indent
-- Register: \n[.i]
Set indentation to INDENT; if INDENT is signed, adjust the
indentation by its value. The default scaling unit is 'm'.
Initially, there is no indentation. This request causes a break.
If INDENT is omitted, the indentation is reset to that before the
previous invocation of 'in', and zero if there is none. If INDENT
is negative, GNU 'troff' emits a warning in category 'range' and
sets the indentation to zero; a temporary indentation (see below)
is reset to zero as well.
The formatter delays the effect of 'in' until it has emitted any
partially collected line. In other words, 'in' does not change a
pending output line's indentation.
The read-only register '.i' interpolates the indentation amount,
ignoring temporary indentation (see below). The indentation amount
is associated with the environment (*note Environments::).
-- Request: .ti offset
-- Request: .ti +offset
-- Request: .ti -offset
-- Register: \n[.in]
Temporarily indent the next output line by OFFSET; if OFFSET is
signed, adjust the temporary indentation relative to the value set
by the 'in' request. The default scaling unit is 'm'. This
request causes a break.
Omitting OFFSET causes a warning in category 'missing'.
The effect of 'ti' is delayed until a partially collected line (if
it exists) is output. In other words, it does not change a pending
output line's indentation.
The read-only register '.in' reports the indentation that applies
to the pending output line. The temporary indentation is
associated with the environment (*note Environments::).
-- Request: .ll [length]
-- Request: .ll +length
-- Request: .ll -length
-- Register: \n[.l]
-- Register: \n[.ll]
Change (increase or decrease) the line length per the numeric
expression LENGTH. The default scaling unit is 'm'. If not
otherwise configured (see *note Paper Format::), the default line
length is 6.5i. If LENGTH is invalid, GNU 'troff' emits a warning
in category 'number' and ignores the request. If LENGTH is
nonpositive, GNU 'troff' emits a warning in category 'range' and
sets the line length to the device's horizontal motion quantum;
recall *note Motion Quanta::. The line length is associated with
the environment (*note Environments::). If LENGTH is omitted, GNU
'troff' restores the environment's previous line length.
The effect of 'll' is delayed until a partially collected line (if
it exists) is output. In other words, it does not change a pending
output line's length.
The line length as set by 'll' can be found in the read-only
register '.l'. The read-only register '.ll' is the line length
that applies to the pending output line.
Similarly to '.i' and '.in', the difference between '.l' and '.ll'
is that the latter takes into account whether a partially collected
line still uses the previous length.
5.16 Line Continuation
======================
When filling is enabled, input and output line breaks generally do not
correspond. The 'roff' language therefore distinguishes input and
output line continuation.
-- Escape sequence: \
'\' (a backslash immediately followed by a newline) suppresses
the effects of that newline in the input. The next input line thus
retains the classification of its predecessor as a control or text
line. '\' is useful for managing line lengths in the input
during document maintenance; you can even break an input line in
the middle of a word, request invocation, macro call, or escape
sequence. Input line continuation is invisible to the formatter,
with two exceptions: the '|' operator recognizes the new input line
(*note Numeric Expressions::), and the input line counter register
'.c' increments. '\RET' is interpreted even in copy mode.(1)
(*note Line Continuation-Footnote-1::)
.ll 50n
.de I
. ft I
. nop \\$*
. ft
..
Our film class watched
.I The Effect of Gamma Rays on Man-in-the-Moon
Marigolds. \" whoops, the input line wrapped
.br
.I My own opus begins on line \n[.c] \
and ends on line \n[.c].
=> Our film class watched The Effect of Gamma Rays on
=> Man-in-the-Moon Marigolds.
=> My own opus begins on line 11 and ends on line 12.
-- Escape sequence: \c
-- Register: \n[.int]
'\c' continues an output line. Nothing after it on the input line
is formatted. In contrast to '\', a line after '\c' remains a
new input line, so a control character is recognized at its
beginning. The visual results depend on whether filling is
enabled; see *note Manipulating Filling and Adjustment::.
* If filling is enabled, a word interrupted with '\c' is
continued with the text on the next input text line, without
an intervening space.
This is a te\c
st.
=> This is a test.
* If filling is disabled, the next input text line after '\c' is
handled as a continuation of the same input text line.
.nf
This is a \c
test.
=> This is a test.
An intervening control line that causes a break overrides '\c',
flushing out the pending output line in the usual way.
The '.int' register interpolates a positive value only if the
pending output line has been continued with '\c'; this datum is
associated with the environment (*note Environments::).(2) (*note
Line Continuation-Footnote-2::)
(1) *Note Copy Mode::.
(2) Historically, the '\c' escape sequence has proven challenging to
characterize. Some sources say it "connects the next input text" (to
the input line on which it appears); others describe it as
"interrupting" text, on the grounds that a text line is interrupted
without breaking, perhaps to inject a request invocation or macro call.
5.17 Page Layout
================
The formatter permits configuration of the page length and page number.
-- Request: .pl [length]
-- Request: .pl +length
-- Request: .pl -length
-- Register: \n[.p]
Change (increase or decrease) the page length per the numeric
expression LENGTH. The default scaling unit is 'v'. If LENGTH is
invalid, GNU 'troff' emits a warning in category 'number'. If
LENGTH is absent or invalid, '11i' is assumed. If LENGTH is
nonpositive, GNU 'troff' emits a warning in category 'range' and
sets the page length to the device's vertical motion quantum;
recall *note Motion Quanta::.
The read-only register '.p' interpolates the current page length.
-- Request: .pn num
-- Request: .pn +num
-- Request: .pn -num
-- Register: \n[.pn]
Change (increase or decrease) the page number of the _next_ page
per the numeric expression NUM. If NUM is invalid, GNU 'troff'
emits a warning in category 'number' and ignores the request.
Without an argument, 'pn' is ignored.
The read-only register '.pn' interpolates NUM if set by 'pn' on the
current page, or the current page number plus 1.
The formatter offers special support for typesetting headers and
footers, collectively termed "titles". Titles have an independent line
length, and their placement on the page is not restricted.
-- Request: .tl '''left'''center'''right'''
Format an output line as a title consisting of LEFT, CENTER, and
RIGHT, each aligned accordingly. The delimiter need not be a
neutral apostrophe: 'tl' accepts the same delimiters as most escape
sequences; see *note Delimiters::. If not used as the delimiter,
any "page number character" character is replaced with the current
page number; the default is '%'; see the the 'pc' request below.
Without an argument, 'tl' is ignored. 'tl' writes the title line
immediately, ignoring any partially collected line.
It is not an error to omit delimiters after the first. For
example, '.tl /Thesis' is interpreted as '.tl /Thesis///': it sets
a title line comprising only the left-aligned word 'Thesis'.
-- Request: .lt [length]
-- Request: .lt +length
-- Request: .lt -length
-- Register: \n[.lt]
Change (increase or decrease) the line length used by titles per
the numeric expression LENGTH. The default scaling unit is 'm'.
The formatter's default title length is '6.5i'. If LENGTH is
invalid, GNU 'troff' emits a warning in category 'number' and
ignores the request. If LENGTH is nonpositive, GNU 'troff' emits a
warning in category 'range' and sets the title line length to the
device's horizontal motion quantum; recall *note Motion Quanta::.
The title length is is associated with the environment (*note
Environments::). If LENGTH is omitted, GNU 'troff' restores the
environment's previous title length.
The read-only register '.lt' interpolates the title line length.
-- Request: .pc [char]
Set the page number character to CHAR. With no argument, the page
number character is disabled. 'pc' does not affect the
register '%'.
The following example exercises title features.
.lt 50n
This is my partially collected
.tl 'Isomers 2023'%'Dextrose Edition'
line.
=> Isomers 2023 1 Dextrose Edition
=> This is my partially collected line.
We most often see titles used in page header and footer traps. *Note
Traps::.
5.18 Page Control
=================
Discretionary page breaks can prevent the unwanted separation of
content. A new page number takes effect during page ejection; see *note
The Implicit Page Trap::.
-- Request: .bp [page-number]
-- Request: .bp +page-number
-- Request: .bp -page-number
-- Register: \n[%]
Break the page and change (increase or decrease) the next page
number per the numeric expression PAGE-NUMBER. If PAGE-NUMBER is
invalid, GNU 'troff' emits a warning in category 'number' and
ignores the argument. This request causes a break. A page break
advances the vertical drawing position to the bottom of the page,
springing traps. *Note Page Location Traps::. 'bp' has effect
only if invoked within the top-level diversion.(1) (*note Page
Control-Footnote-1::) This request is incorrectly documented in the
AT&T 'troff' manual as having a default scaling unit of 'v'.
The register '%' interpolates the page number.
.de BP
' bp \" schedule page break once current line is output
..
*Caution:* Interpolations occur before formatting operations. The
process of filling, breaking, and adjusting a line can change the
page number. '%' is a register like any other, not a placeholder
that is rewritten after the line it appears on is formatted.
Consider, for example, an extremely long page number at the end of
the last line on the page; numbers aren't hyphenated, so the word
containing the page number might break the line and the page,
causing the reported page number to lag by one. This sequencing
also means that interpolating the '%' register inside a diversion
(such as a footnote) records the page number at the time the
diversion is populated, not when it is output.
-- Request: .ne [space]
Force a page break if insufficient vertical space is available (it
asserts "needed" space). 'ne' tests the distance to the next page
location trap; see *note Page Location Traps::, and breaks the page
if that amount is less than SPACE. The default scaling unit is
'v'. If SPACE is invalid, GNU 'troff' emits a warning in category
'number' and ignores the argument. If SPACE is not specified, '1v'
is assumed.
We can require space for at least the first two output lines of a
paragraph, preventing its first line from being isolated at the
page bottom.
.ne 2v
Considering how common illness is,
how tremendous the spiritual change that it brings,
how astonishing,
when the lights of health go down,
the undiscovered countries that are then disclosed,
what wastes and deserts of the soul a slight attack
of influenza brings to view,
what precipices and lawns sprinkled with bright flowers
a little rise of temperature reveals,
what ancient and obdurate oaks are uprooted in us
in the act of sickness,
how we go down into the pit of death
and feel the waters of annihilation
close above our heads.\|.\|.
.sp
Virgina Woolf, \[lq]On Being Ill\[rq], 1926
This method is reliable only if no output line is pending when 'ne'
is invoked. When macro packages are used, this is often not the
case: their paragraphing macros perform the break. You may need to
experiment with placing the 'ne' after the paragraphing macro, or
'br' and 'ne' before it.
'ne' is also useful to force grouping of section headings with
their subsequent paragraphs, or tables with their captions and/or
explanations. Macro packages often use 'ne' with diversions to
implement keeps and displays; see *note Diversions::. They may
also offer parameters for widow and orphan management.
-- Request: .sv [space]
-- Request: .os
'sv' requires vertical space as 'ne' does, but also saves it for
later output by the 'os' request. If SPACE is available before the
next page location trap, it is output immediately. Both requests
ignore a partially collected line, taking effect at the next break.
'sv' and 'os' ignore no-space mode (recall *note Manipulating
Spacing::). While the 'sv' request allows negative values for
SPACE, 'os' ignores them. The default scaling unit is 'v'. If
SPACE is not specified, '1v' is assumed.
-- Register: \n[nl]
'nl' interpolates the vertical drawing position as of the most
recently typeset output line. It does not necessarily (and often
does not) represent that of the pending output line, because the
formatter does not determine the position of its baseline until it
is output; recall *note Manipulating Spacing::. Assigning a value
to 'nl' sets the vertical drawing position in advance of further
modifications to baseline positioning arising from alterations to
type size, changes to vertical spacing, or application of extra
pre- or post-vertical spacing.
When the formatter starts, the transition to the first page has not
yet happened--'nl' is negative. If you plant a page location trap
at vertical position '0' (idiomatically to format a header), you
can assign a negative value to 'nl' to spring that trap even if the
page has already started (*note Page Location Traps::).
.de HD
. sp
. tl ''Goldbach Solution''
. sp
..
.
First page.
.bp
.wh 0 HD \" plant header trap at top of page
.nr nl (-1)
Second page.
=> First page.
=>
=> (blank lines elided)
=>
=> Goldbach Solution
=>
=> (blank lines elided)
=>
=> Second page.
Without resetting 'nl' to a negative value, the trap just planted
would be active beginning with the _next_ page, not the current
one.
*Note Diversions::, for a comparison of 'nl' with the '.h' and '.d'
registers.
(1) *Note Diversions::.
5.19 Using Fonts
================
In digital typography, a "font" is a collection of characters in a
specific typeface that a device can render as glyphs at a desired
size.(1) (*note Using Fonts-Footnote-1::) A 'roff' formatter can change
typefaces at any point in the text. The basic faces are a set of
"styles" combining upright and slanted (italic or oblique) shapes with
normal and heavy stroke weights: 'R', 'I', 'B', and 'BI'--these stand
for roman, italic, bold, and bold-italic. For linguistic text, GNU
'troff' groups typefaces into "families" containing each of these
styles.(2) (*note Using Fonts-Footnote-2::) A "text font" is thus often
a family combined with a style, but it need not be: consider the 'ps'
and 'pdf' devices' 'ZCMI' (Zapf Chancery Medium italic)--often, no other
style of Zapf Chancery Medium is provided. On typesetters, at least one
"special font" is available, comprising "unstyled" glyphs for
mathematical operators and other purposes.
Like the AT&T 'troff' formatter, GNU 'troff' does not itself load or
manipulate a digital font file;(3) (*note Using Fonts-Footnote-3::)
instead it works with a "font description file" that characterizes it,
including its glyph repertoire and the "metrics" (dimensions) of each
glyph.(4) (*note Using Fonts-Footnote-4::) This information permits the
formatter to accurately place glyphs with respect to each other. Before
using a font description, the formatter associates it with a "mounting
position", a place in an ordered list of available typefaces. So that a
document need not be strongly coupled to a specific font family, in GNU
'troff' an output device can associate a style in the abstract sense
with a mounting position. Thus the default family can be combined with
a style dynamically, producing a "resolved font name". A user-specified
font name that combines family and style, or refers to a font that is
not a member of a family, is already "resolved".
Fonts often have trademarked names, and even Free Software fonts can
require renaming upon modification. 'groff' maintains a convention that
a device's serif font family is given the name 'T' ("Times"), its
sans-serif family 'H' ("Helvetica"), and its monospaced family 'C'
("Courier"). Historical inertia has driven 'groff''s font identifiers
to short uppercase abbreviations of font names, as with 'TR', 'TI',
'TB', 'TBI', and a special font 'S'.
The default family used with abstract styles is initially 'T'.
Typically, abstract styles are arranged in the first four mounting
positions in the order shown above. The default mounting position, and
therefore style, is always '1' ('R'). By issuing appropriate formatter
instructions, you can override these defaults before your document
writes its first glyph.
Terminals cannot change font families and lack special fonts. They
support style changes by overstriking, or by altering ISO 6429/ECMA-48
"graphic renditions" (character cell attributes).
(1) Terminals and some typesetters have fonts that render at only one
or two sizes. As examples, take the 'groff' 'lj4' device's Lineprinter,
and 'lbp''s Courier and Elite faces.
(2) Font designers prepare families such that the styles share
esthetic properties.
(3) Historically, the fonts 'troff's dealt with were not Free
Software or, as with the Graphic Systems C/A/T, did not even exist in
the digital domain.
(4) *Note Font Description File Format::.
5.19.1 Selecting Fonts
----------------------
We use "font" to refer to any of several means of identifying a
typeface: by its mounting position ('3'), by its identifier ('TB'), or
by an abstract style ('B') to be combined with the default family.
-- Request: .ft [font]
-- Escape sequence: \ff
-- Escape sequence: \f(fn
-- Escape sequence: \f[font]
-- Register: \n[.fn]
The 'ft' request selects the typeface FONT. If the argument is
absent or 'P', it selects the previously used typeface; if there is
none, the formatter ignores the request. If FONT is an integer,
the formatter interprets it as a mounting position; the font
mounted there is selected. If that position refers to an abstract
style, GNU 'troff' combines it with the default family (see 'fam'
and '\F' below) to make a resolved font name. If FONT is 'DESC',
if the mounting position is not an abstract style and no font is
mounted there, or the mounting position is negative, GNU 'troff'
ignores the request.(1) (*note Selecting Fonts-Footnote-1::)
If FONT matches a style name, it is combined with the default
family to make a resolved font name. If not, FONT is assumed to be
resolved already.
The resolved font name is subject to translation (see request 'ftr'
below). Next, the (possibly translated) font name's mounting
position is looked up; if not mounted, FONT is sought on the file
system as a font description file and, if located, automatically
mounted at the next available position (see register '.fp' below).
If the font was mounted using an identifier different from its font
description file name (see request 'fp' below), that file name is
then sought. If a font description file for the resolved font name
is not found, GNU 'troff' emits a warning in category 'font' and
ignores the request.
The '\f' escape sequence is similar, accepting names or mounting
positions of one character F, two characters FN, or arbitrary
length FONT. '\f[]' selects the previous font. The syntax form
'\fP' is supported for backward compatibility, and '\f[P]' for
consistency.
eggs, bacon,
.ft I
spam,
.ft
and sausage.
.br
eggs, bacon, \fIspam,\fP and sausage.
=> eggs, bacon, spam, and sausage.
=> eggs, bacon, spam, and sausage.
The currently and previously selected fonts are properties of the
environment (*note Environments::).
The read-only string-valued register '.fn' contains the resolved
font name of the selected font. Copy its value to a string to save
it for later use.
.ds saved-font \n[.fn]
... text involving many font changes ...
.ft \*[saved-font]
GNU 'troff' does not tokenize '\f' when reading it; the escape
sequence updates the environment. It thus can be used in requests
that expect a single-character argument. We can assign a font to a
margin character as follows (*note Miscellaneous::).
.mc \f[I]x\f[]
-- Request: .ftr f [g]
Translate font name F to G. Where the '\f' escape sequence, the
'F' and 'S' conditional expression operators, and the 'ft', 'ul',
'bd', 'cs', 'tkf', 'special', 'fspecial', 'fp', or 'sty' requests
refer to F, GNU 'troff' uses G instead. Omit G or repeat F as G to
untranslate F. F and G need not be mounted fonts.
You can obtain a report of font translations defined by 'ftr' on
the standard error stream with the 'pftr' request. *Note
Debugging::.
-- Request: .fzoom font [zoom]
-- Register: \n[.zoom]
Set magnification of mounted FONT to factor ZOOM, a multiplier
applied to the type size in thousandths. ZOOM must be
non-negative. 'fzoom' applies to glyphs when they are formatted,
altering a font's apparent size in relation to others. A missing
or zero ZOOM is treated as '1000'--no magnification. FONT must be
a resolved font name, not an abstract style.
Font magnification is transparent to some aspects of GNU 'troff'.
A change of the zoom factor affects scaling of glyph sizes,
inter-word and inter-sentence spaces, and kerning adjustments on
the output device, but _not_ vertical spacing. It is not reflected
in registers that report the requested or current type size, or the
minimum inter-word and supplemental inter-sentence space sizes. It
_is_ reflected in measurements of formatted output: the horizontal
drawing position register 'hp', interpolation of the '\w' escape
sequence, and the registers updated by that escape sequence or the
formatting of a glyph in the environment. *Note Environments::.
'fzoom' can harmonize the apparent cap-heights of fonts from
different families when formatted on the same baseline at the same
type size.
.fzoom HR 900
.fzoom CR 1150
.fzoom PR 950
Times, \F[H]Helvetica\F[], \F[C]Courier\F[],
and \F[P]Palatino\F[].
.sp
M\F[H]M\F[C]M\F[P]M
The zoom factor of the currently selected font is available in the
read-only register '.zoom'. It interpolates zero if there is no
magnification.
(1) It also emits a warning in category 'font' or 'range', as
appropriate. *Note Warnings::.
5.19.2 Font Families
--------------------
To accommodate the wide variety of fonts available, GNU 'troff'
distinguishes "font families" and "font styles". A resolved font name
is the catenation of a font family and a style. Selecting an abstract
style causes GNU 'troff' to combine it with the default font family.
You can thus compose a document using abstract styles exclusively for
its body or running text--selecting a specific family only for titles or
examples, for instance--and change the default family on the command
line.
-- Request: .fam [family]
-- Register: \n[.fam]
-- Escape sequence: \Ff
-- Escape sequence: \F(fm
-- Escape sequence: \F[family]
Set the default font family, used in combination with abstract
styles to construct a resolved font name, to FAMILY (one-character
name F, two-character name FM). If no argument is given, GNU
'troff' selects the previous font family; if there are none, it
falls back to the device's default(1) (*note Font
Families-Footnote-1::) or its own ('T').
The '\F' escape sequence works similarly. In disanalogy to '\f',
'\FP' makes 'P' the default family. Use '\F[]' to select the
previous default family. The default font family is available in
the read-only string-valued register '.fam'; it is associated with
the environment (*note Environments::).
spam, \" startup defaults are T (Times) R (roman)
.fam H \" make Helvetica the default family
spam, \" family H + style R = HR
.ft B \" family H + style B = HB
spam,
.ft CR \" Courier roman (default family not changed)
spam,
.ft \" back to Helvetica bold
spam,
.fam T \" make Times the default family
spam, \" family T + style B = TB
.ft AR \" font AR (not a style)
baked beans,
.ft R \" family T + style R = TR
and spam.
GNU 'troff' does not tokenize '\F' when reading it; the escape
sequence updates the environment. It thus can be used in requests
that expect a single-character argument. We can assign a font
family to a margin character as follows (*note Miscellaneous::).
.mc \F[P]x\F[]
-- Request: .sty pos style
-- Register: \n[.sty]
Associate an abstract style STYLE with mounting position POS, which
must be a non-negative integer. Applying the requests 'cs', 'bd',
'tkf', 'uf', or 'fspecial' to an abstract style affects the member
of the default family corresponding to that style.
The default family can be set with the '-f' option (*note Groff
Options::). The 'styles' command in the 'DESC' file controls which
font positions (if any) are initially associated with abstract
styles rather than fonts.
*Caution:* The STYLE argument is not validated. Errors may occur
later, when the formatter attempts to construct a resolved font
name, or format a character for output.
.nr BarPos \n[.fp]
.sty \n[.fp] Bar
.fam Foo
.ft \n[BarPos]
.tm .f=\n[.f]
A
error-> error: no font family named 'Foo' exists
error-> .f=41
error-> error: cannot format glyph: no current font
When an abstract style has been selected, the read-only
string-valued register '.sty' interpolates its name; this datum is
associated with the environment (*note Environments::). Otherwise,
'.sty' interpolates nothing.
(1) *Note DESC File Format::.
5.19.3 Font Positions
---------------------
To support typeface indirection through abstract styles, and for
compatibility with AT&T 'troff', the formatter maintains a list of font
"positions" at which fonts required by a document are "mounted". An
output device's description file 'DESC' typically configures a set of
pre-mounted fonts; see *note Device and Font Description Files::. A
font need not be explicitly mounted before it is selected; GNU 'troff'
will search 'GROFF_FONT_PATH' for a file name matching the identifier
and mount it on demand.
-- Request: .fp pos id [font-description-file-name]
-- Register: \n[.f]
-- Register: \n[.fp]
Mount a font under the name ID at mounting position POS, a
non-negative integer. When the formatter starts up, it reads the
output device's description to mount an initial set of faces, and
selects font position 1. Position 0 is unused by default. Unless
the FONT-DESCRIPTION-FILE-NAME argument is given, ID should be the
name of a font description file stored in a directory corresponding
to the selected output device. GNU 'troff' does not traverse
directories to locate the font description file.
The optional third argument enables font names to be aliased, which
can be necessary in compatibility mode since AT&T 'troff' syntax
affords no means of identifying fonts with names longer than two
characters, like 'TBI' or 'ZCMI', in a font selection escape
sequence. *Note Compatibility Mode::. You can also alias fonts on
mounting for convenience or abstraction. (See below regarding the
'.fp' register.)
.fp \n[.fp] SC ZCMI
Send a \f(SChand-written\fP thank-you note.
.fp \n[.fp] Emph TI
.fp \n[.fp] Strong TB
Are \f[Emph]these names\f[] \f[Strong]comfortable\f[]?
'DESC', 'P', and non-negative integers are not usable as font
identifiers.
You can obtain a report of occupied font mounting positions
(whether configured by the 'DESC' file, the 'fp' request, or
automatic mounting) on the standard error stream with the 'pfp'
request. *Note Debugging::.
The position of the currently selected font (or abstract style) is
available in the read-only register '.f'. It is associated with
the environment (*note Environments::).
Copy the value of '.f' to another register to save it for later
use.
.nr sF \n(.f
... text involving many font changes ...
.ft \n(sF
The index of the next (non-zero) free font position is available in
the read-only register '.fp'. Fonts not listed in the 'DESC' file
are automatically mounted at position '\n[.fp]' when selected with
the 'ft' request or '\f' escape sequence. When mounting a font at
a position explicitly with the 'fp' request, this same practice
should be followed, although GNU 'troff' does not enforce this
strictly.
5.19.4 Characters and Glyphs
----------------------------
A glyph is a graphical representation of a character. Whereas a
"character" is an abstraction of semantic information, a "glyph" is an
intelligible mark visible on screen or paper. A character has many
possible representation forms; for example, the character 'A' can be
written in an upright or slanted typeface, producing distinct glyphs.
Sometimes, a sequence of characters map to a single glyph: this is a
"ligature"--the most common is 'fi'.
Space characters never become glyphs in GNU 'troff'. If not
discarded (as when trailing text lines), horizontal motions represent
them in the output.
In a 'troff' system, a font description file (recall *note Font
Directories::) lists all of the glyphs a particular font provides. If
the user requests a glyph not available in the currently selected font,
the formatter looks it up an ordered list of "special fonts". By
default, the 'ps' (PostScript) and 'pdf' output devices support the two
special fonts 'SS' (slanted symbol) and 'S' (symbol); and these devices'
'DESC' files arrange them such that the formatter searches the former
before the latter. Other output devices use different names for special
fonts. Fonts mounted with the 'fonts' keyword in the 'DESC' file are
globally available. GNU 'troff''s 'special' and 'fspecial' requests
alter the list of fonts treated as special on a general basis, or only
when a certain font is currently selected, respectively.
The formatter supports three kinds of character. An "ordinary
character" is the most commonly used, has no special syntax, and
typically represents itself.(1) (*note Characters and
Glyphs-Footnote-1::) Interpolate a "special character" with the '\[XXX]'
or '\C'XXX'' escape sequence syntax, where XXX is an identifier. An
"indexed character" bypasses most character-to-glyph resolution logic,
uses the '\N'I'' syntax, and selects a glyph from the currently selected
font by its integer-valued position I in the output device's
representation of that font.(2) (*note Characters and
Glyphs-Footnote-2::)
"User-defined characters" are similar to string definitions,(3)
(*note Characters and Glyphs-Footnote-3::) and permit extension of or
substitution within the character repertoire. Any ordinary, special, or
indexed character can be user-defined. The 'char', 'fchar', 'schar',
and 'fschar' requests create user-defined characters employed at various
stages of the character-to-glyph resolution process.
GNU 'troff' employs the following procedure to resolve an input
character into a glyph. User-defined characters make this resolution
process recursive. The first step that succeeds ends the resolution
procedure for the character being formatted, which may not be the last
in the sequence interpolated by a user-defined character.
* Interpolate the definition of any character defined by the 'char'
request and apply this procedure to each character in its
definition.
* Check the current font for a glyph corresponding to the character.
* Interpolate the definition of any user-defined character matching
defined by the 'fchar' request and apply this procedure to each
character in its definition.
* Check whether the current font has a font-specific list of special
fonts; if so, check the each font therein, in the order determined
by the last applicable 'fspecial' request, for a glyph
corresponding to the character.
* Interpolate the definition of any character defined by the 'fschar'
request for the currently selected font, and apply this procedure
to each character in its definition.
* Check each font in the list configured by the most recently issued
'special' request for a glyph corresponding to the character.
* Interpolate the definition of any character defined by the 'sschar'
request and apply this procedure to each character in its
definition.
* Finally, iterate through the list of mounted fonts by position;
recall *Note Font Positions::. For each mounted font, if that font
bears the 'special' directive,(4) (*note Characters and
Glyphs-Footnote-4::) check it for a glyph corresponding to the
character. This stage of the resolution process can sometimes lead
to surprising results since the 'fonts' directive in the 'DESC'
file often contains empty positions that are filled by a macro file
or document employing the 'fp' request after the formatter
initializes.
For example, consider the following:
fonts 3 0 0 FOO
This mounts font 'foo' at font position 3. We assume that 'FOO' is
a special font, containing glyph 'foo', and that no font has been
loaded yet. The line
.fspecial BAR BAZ
makes font 'BAZ' special only if font 'BAR' is active. We further
assume that 'BAZ' is really a special font, i.e., the font
description file contains the 'special' keyword, and that it also
contains glyph 'foo' with a special shape fitting to font 'BAR'.
After executing 'fspecial', font 'BAR' is loaded at font
position 1, and 'BAZ' at position 2.
We now switch to a new font 'XXX', trying to access glyph 'foo'
that is assumed to be missing. There are neither font-specific
special fonts for 'XXX' nor any other fonts made special with the
'special' request, so the formatter starts the search for special
fonts in the list of already mounted fonts, with increasing font
positions. Consequently, it finds 'BAZ' before 'FOO' even before
'XXX', which is not the intended behaviour.
*Note Device and Font Description Files::, and *note Special Fonts::,
for more details.
The 'groff_char(7)' man page houses a complete list of predefined
special character names, but the availability of any as a glyph is
device- and font-dependent. For example, say
man -T dvi groff_char > groff_char.dvi
to obtain those available with the DVI device and default font
configuration.(5) (*note Characters and Glyphs-Footnote-5::) If you
want to use an additional macro package to change the fonts used, you
must run 'groff' (or 'troff') directly.
groff -T dvi -m ec -m an groff_char.7 > groff_char.dvi
Special character names not listed in 'groff_char(7)' are derived
algorithmically, using a simplified version of the Adobe Glyph List
(AGL) algorithm, which is described in
. The (frozen) set of
names that can't be derived algorithmically is called the "'groff' glyph
list (GGL)".
* A glyph for Unicode character U+XXXX[X[X]], which is not a
composite character is named 'uXXXX[X[X]]'. X must be an uppercase
hexadecimal digit. Examples: 'u1234', 'u008E', 'u12DB8'. The
largest Unicode value is 0x10FFFF. There must be at least four 'X'
digits; if necessary, add leading zeroes (after the 'u'). No zero
padding is allowed for character codes greater than 0xFFFF.
Surrogates (i.e., Unicode values greater than 0xFFFF represented
with character codes from the surrogate area U+D800-U+DFFF) are not
allowed either.
* A glyph representing more than a single input character is named
'u' COMPONENT1 '_' COMPONENT2 '_' COMPONENT3 ...
Example: 'u0045_0302_0301'.
For simplicity, all Unicode characters that are composites must be
maximally decomposed to NFD;(6) (*note Characters and
Glyphs-Footnote-6::) for example, 'u00CA_0301' is not a valid glyph
name since U+00CA (LATIN CAPITAL LETTER E WITH CIRCUMFLEX) can be
further decomposed into U+0045 (LATIN CAPITAL LETTER E) and U+0302
(COMBINING CIRCUMFLEX ACCENT). 'u0045_0302_0301' is thus the glyph
name for U+1EBE, LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND ACUTE.
* groff maintains a table to decompose all algorithmically derived
glyph names that are composites itself. For example, 'u0100'
(LATIN LETTER A WITH MACRON) is automatically decomposed into
'u0041_0304'. Additionally, a glyph name of the GGL is preferred
to an algorithmically derived glyph name; 'groff' also
automatically does the mapping. Example: The glyph 'u0045_0302' is
mapped to '^E'.
* glyph names of the GGL can't be used in composite glyph names; for
example, '^E_u0301' is invalid.
-- Escape sequence: \(nm
-- Escape sequence: \[name]
-- Escape sequence: \[base-glyph combining-component ...]
Typeset a special character NAME (two-character name NM) or a
composite glyph consisting of BASE-GLYPH overlaid with one or more
COMBINING-COMPONENTs. For example, '\[A ho]' is a capital letter
"A" with a "hook accent" (ogonek).
There is no special syntax for one-character names--the analogous
form '\N' would collide with other escape sequences. However, the
four escape sequences '\'', '\-', '\_', and '\`', are translated on
input to the special character escape sequences '\[aa]', '\[-]',
'\[ul]', and '\[ga]', respectively.
A special character name of length one is not the same thing as an
ordinary character: that is, the character 'a' is not the same as
'\[a]'.
If NAME is undefined, a warning in category 'char' is produced and
the escape is ignored. *Note Warnings::, for information about the
enablement and suppression of warnings.
GNU 'troff' resolves '\[...]' with more than a single component as
follows:
* Any component that is found in the GGL is converted to the
'uXXXX' form.
* Any component 'uXXXX' that is found in the list of
decomposable glyphs is decomposed.
* The resulting elements are then catenated with '_' in between,
dropping the leading 'u' in all elements but the first.
No check for the existence of any component (similar to 'tr'
request) is done.
Examples:
'\[A ho]'
'A' maps to 'u0041', 'ho' maps to 'u02DB', thus the final
glyph name would be 'u0041_02DB'. This is not the expected
result: the ogonek glyph 'ho' is a spacing ogonek, but for a
proper composite a non-spacing ogonek (U+0328) is necessary.
Looking into the file 'composite.tmac', one can find
'.composite ho u0328', which changes the mapping of 'ho' while
a composite glyph name is constructed, causing the final glyph
name to be 'u0041_0328'.
'\[^E u0301]'
'\[^E aa]'
'\[E a^ aa]'
'\[E ^ ']'
'^E' maps to 'u0045_0302', thus the final glyph name is
'u0045_0302_0301' in all forms (assuming proper calls of the
'composite' request).
It is not possible to define glyphs with names like 'A ho' within a
'groff' font file. This is not really a limitation; instead, you
have to define 'u0041_0328'.
-- Escape sequence: \C'''xxx'''
Typeset the special character XXX. Normally, it is more convenient
to use '\[XXX]', but '\C' has some advantages: it is compatible
with AT&T device-independent 'troff' (and therefore available in
compatibility mode(7) (*note Characters and Glyphs-Footnote-7::))
and can interpolate special characters with ']' in their names.
The delimiter need not be a neutral apostrophe; recall *note
Delimiters::.
-- Request: .composite c1 c2
Map ordinary or special character name C1 to C2 when C1 is a
combining component in a composite character. See above for
examples. This is a strict rewriting of the special character
name; no check is performed for the existence of a glyph for
either. Typically, 'composite' is used to map a spacing character
to a combining one. A set of default mappings for many accents can
be found in the file 'composite.tmac', loaded by the default
'troffrc' at startup.
You can obtain a report of mappings defined by 'composite' on the
standard error stream with the 'pcomposite' request. *Note
Debugging::.
-- Escape sequence: \N'''n'''
Format indexed character numbered N in the current font ('n' is
_not_ the input character code). N can be any non-negative decimal
integer. Most devices number glyphs with codes between 0 and 255
only; the 'utf8' output device uses codes in the range 0-65535. If
the current font does not contain a glyph with that code, special
fonts are _not_ searched. The '\N' escape sequence can be
conveniently used in conjunction with the 'char' request.
.char \[phone] \f[ZD]\N'37'
The code of each glyph is given in the fourth column in the font
description file after the 'charset' command. It is possible to
include unnamed glyphs in the font description file by using a name
of '---'; the '\N' escape sequence is the only way to use these.
No kerning is applied to glyphs accessed with '\N'. The delimiter
need not be a neutral apostrophe; see *note Delimiters::.
A few escape sequences are also special characters.
-- Escape sequence: \'''
An escaped neutral apostrophe is a synonym for '\[aa]' (acute
accent).
-- Escape sequence: \'`'
An escaped grave accent is a synonym for '\[ga]' (grave accent).
-- Escape sequence: \-
An escaped hyphen-minus is a synonym for '\[-]' (minus sign).
-- Escape sequence: \_
An escaped underscore ("low line") is a synonym for '\[ul]'
(underrule). On typesetting devices, the underrule is
font-invariant and drawn lower than the underscore '_'.
-- Request: .cflags n c...
Assign properties encoded by non-negative integer N to each
character or class(8) (*note Characters and Glyphs-Footnote-8::).
C. Spaces need not separate C arguments.
Characters, whether ordinary, special, or indexed, have certain
associated properties. The first argument is the sum of the
desired flags and the remaining arguments are the characters to be
assigned those properties. arguments.
The non-negative integer N is the sum of any of the following.
Some combinations are nonsensical, such as '33' (1 + 32).
'1'
Recognize the character as ending a sentence if followed by a
newline or two spaces. Initially, characters '.?!' have this
property.
'2'
Enable breaks before the character. A line is not broken at a
character with this property unless the characters on each
side both have non-zero hyphenation codes. This exception can
be overridden by adding 64. Initially, no characters have
this property.
'4'
Enable breaks after the character. A line is not broken at a
character with this property unless the characters on each
side both have non-zero hyphenation codes. This exception can
be overridden by adding 64. Initially, characters
'\-\[hy]\[em]' have this property.
'8'
Mark the glyph associated with this character as overlapping
other instances of itself horizontally. Initially, characters
'\[ul]\[rn]\[ru]\[radicalex]\[sqrtex]' have this property.
'16'
Mark the glyph associated with this character as overlapping
other instances of itself vertically. Initially, the
character '\[br]' has this property.
'32'
Mark the character as transparent for the purpose of
end-of-sentence recognition. In other words, an
end-of-sentence character followed by any number of characters
with this property is treated as the end of a sentence if
followed by a newline or two spaces. This is the same as
having a zero space factor in TeX. Initially, characters
'"')]*\[dg]\[dd]\[rq]\[cq]' have this property.
'64'
Ignore hyphenation codes of the surrounding characters. Use
this in combination with values 2 and 4 (initially, no
characters have this property).
For example, if you need an automatic break point after the
en-dash in numeric ranges like "3000-5000", insert
.cflags 68 \[en]
into your document. However, this practice can lead to bad
layout if done thoughtlessly; in most situations, a better
solution instead of changing the 'cflags' value is to insert
'\:' right after the hyphen at the places that really need a
break point.
The remaining values were implemented for East Asian language
support; those who use alphabetic scripts exclusively can disregard
them.
'128'
Prohibit a line break before the character, but allow a line
break after the character. This works only in combination
with flags 256 and 512 and has no effect otherwise.
Initially, no characters have this property.
'256'
Prohibit a line break after the character, but allow a line
break before the character. This works only in combination
with flags 128 and 512 and has no effect otherwise.
Initially, no characters have this property.
'512'
Allow line break before or after the character. This works
only in combination with flags 128 and 256 and has no effect
otherwise. Initially, no characters have this property.
In contrast to values 2 and 4, the values 128, 256, and 512 work
pairwise. If, for example, the left character has value 512, and
the right character 128, no break will be automatically inserted
between them. If we use value 6 instead for the left character, a
break after the character can't be suppressed since the neighboring
character on the right doesn't get examined.
-- Request: .char c ['"'][contents]
-- Request: .fchar c ['"'][contents]
-- Request: .fschar f c ['"'][contents]
-- Request: .schar c ['"'][contents]
Define an ordinary, special, or indexed character C as CONTENTS.
Omitting CONTENTS gives C an empty definition.
GNU 'troff' removes a leading neutral double quote '"' from
CONTENTS, permitting initial embedded spaces in it, and reads it to
the end of the input line in copy mode. *Note Copy Mode::.
Defining (or redefining) a character C creates a formatter object
that GNU 'troff' recognizes like any other ordinary, special, or
indexed character on input, and produces CONTENTS on output. When
formatting C, GNU 'troff' processes CONTENTS in a temporary
environment and enscapsulates the result in a node;(9) (*note
Characters and Glyphs-Footnote-9::) disabling compatibility mode
and setting the escape character to '\' while interpreting
CONTENTS. Any emboldening, constant spacing, or track kerning
applies to this object rather than to individual glyphs resulting
from the formatting of CONTENTS.
A character defined by these requests can be used just like a glyph
provided by the output device. In particular, other characters can
be translated to it with the 'tr' and 'trin' requests; it can be
made the tab or leader fill character with the 'tc' and 'lc'
requests, respectively; sequences of it can be drawn with the '\l'
and '\L' escape sequences; and, if the 'hcode' request is used on
C, it is subject to automatic hyphenation.
However, a user-defined character C does not participate at its
boundaries in kerning adjustments or italic corrections.
The formatter prevents infinite recursion by treating an occurrence
of a character in its own definition as if it were undefined; when
interpolating such a character, GNU 'troff' emits a warning in
category 'char'.(10) (*note Characters and Glyphs-Footnote-10::)
The 'tr' and 'trin' requests take precedence if 'char' accesses the
same symbol.
.tr XY
X
=> Y
.char X Z
X
=> Y
.tr XX
X
=> Z
The 'fchar' request defines a fallback glyph: 'troff' checks for
glyphs defined with 'fchar' only if it cannot find the glyph in the
current font. 'troff' performs this test before checking special
fonts.
'fschar' defines a fallback glyph for font F: 'troff' checks for
glyphs defined with 'fschar' after the list of fonts declared as
font-specific special fonts with the 'fspecial' request, but before
the list of fonts declared as global special fonts with the
'special' request.
Finally, the 'schar' request defines a global fallback glyph:
'troff' checks for glyphs defined with 'schar' after the list of
fonts declared as global special fonts with the 'special' request,
but before the already mounted special fonts.
*Note Character Classes::.
*Caution:* These requests remove a leading neutral double quote '"'
and treat the remainder of the input line as their second argument,
including any spaces, up to a newline or comment escape sequence.
See the discussion of the 'ds' request in *note Strings::.
-- Request: .rchar c ...
-- Request: .rfschar f c ...
Remove definition of each ordinary, special, or indexed character
C, undoing the effect of a 'char', 'fchar', or 'schar' request.
Spaces need not separate C arguments. The character definition
removed (if any) is the first encountered in the resolution process
documented above. Glyphs, which are defined by font description
files, cannot be removed.
'rfschar' removes character definitions created by 'fschar' for
font F.
(1) Depending on the breadth of the output device's glyph repertoire,
the characters ''', '-', '^', '`', and '~' can be exceptions to this
rule. '"' and '\' are not exceptions, but because they are
syntactically meaningful to the formatter, access to their glyphs may
require use of special characters (or changing or disabling the escape
character). See 'groff_char(7)'.
(2) Fonts do not necessarily arrange their glyphs per a standard
character encoding.
(3) *Note Strings::.
(4) *Note Device and Font Description Files::.
(5) Not all versions of the 'man' program support the '-T' option;
use the subsequent example for an alternative.
(6) This is "Normalization Form D" as documented in Unicode Standard
Annex #15 ().
(7) *Note Compatibility Mode::.
(8) *Note Character Classes::.
(9) *Note GNU troff Internals::.
(10) Mutually recursive character definitions are handled similarly.
5.19.5 Character Classes
------------------------
GNU 'troff' can group characters into "classes", making manipulation of
their breaking and/or sentential properties convenient; recall the
'cflags' request in *note Characters and Glyphs::. Classes are
particularly useful for East Asian languages such as Chinese, Japanese,
and Korean, which have much larger character repertoires than the Latin,
Greek, Cyrillic, or Thai scripts. In such large character sets, many
characters share the same properties. Only 'class' and 'cflags'
requests can operate on character classes.
-- Request: .class ident c ...
Define a character class (or simply "class") IDENT comprising the
members C ..., where each C is an ordinary, special, or indexed
character; or a range expression. A class thus defined can then be
referred to in a 'cflags' request in lieu of listing all the
characters within it.
.class [quotes] ' \[aq] \[dq] \[oq] \[cq] \[lq] \[rq]
Since class and special character names share the same name space,
we recommend starting and ending the class name with '[' and ']',
respectively, to avoid collisions with existing special character
names defined by GNU 'troff' or the user (with 'char' and related
requests). This practice applies the presence of ']' in the class
name to prevent the use of the special character escape form
'\[...]', you must therefore access a class thus named via the '\C'
escape sequence.
An argument C can alternatively be a "range expression" consisting
of a start character followed by '-' and then an end character.
Internally, GNU 'troff' converts these two symbol names to Unicode
code points (according to the 'groff' glyph list [GGL]), which
determine the start and end values of the range. If that
conversion fails, GNU 'troff' skips the range expression and any
remaining arguments.
If you want to include '-' in a class, it must be the first
character in a C argument; otherwise GNU 'troff' interprets the
argument as a range expression.
5.19.6 Special Fonts
--------------------
Special fonts are those that the formatter searches, in mounting
position order, when it cannot find a requested glyph in the selected
font. Typically, they are declared as such in their description
files,(1) (*note Special Fonts-Footnote-1::) and contain unstyled
glyphs. The "Symbol" and "Zapf Dingbats" fonts of the PostScript and
PDF standards are examples. Ordinarily, only typesetters have special
fonts.
GNU 'troff''s 'special' and 'fspecial' requests permit a document to
supplement the set of fonts the device configures for glyph search
without having to use the 'fp' request to manipulate the list of
mounting positions, which can be tedious--by default, GNU 'troff' mounts
40 fonts at startup when using the 'ps' device.
-- Request: .special [s ...]
-- Request: .fspecial f [s ...]
'special' declares each font S as special, irrespective of its
description file, populating a list that GNU 'troff' searches, in
order, to find the glyph demanded. GNU 'troff' mounts each font S.
Invoking 'special' without arguments empties the list. A font is
not automatically unmounted if a subsequent 'special' request
removes it from the list. Initially, the list is empty.
'fspecial' is similar; it designates each font S as special only
when font F is selected. Initially, a font F's list of associated
special fonts is empty for all F.
Invoking 'special' (or 'fspecial', for a given font F) again
overwrites the previous list; if you invoke them without arguments,
GNU 'troff' empties the corresponding list.
(1) *Note Font Description File Format::.
5.19.7 Artificial Fonts
-----------------------
There are a number of requests and escape sequences for artificially
creating fonts. These are largely vestiges of the days when output
devices did not have a wide variety of fonts, and when 'nroff' and
'troff' were separate programs. Most of them are no longer necessary in
GNU 'troff'. Nevertheless, they are supported.
-- Escape sequence: \H'''height'''
-- Escape sequence: \H'''+height'''
-- Escape sequence: \H'''-height'''
-- Register: \n[.height]
Set (increment, decrement) the height of the current font, but not
its width. If HEIGHT is zero, the formatter uses the font's
inherent height for its type size. The default scaling unit is
'z'.
Changing the font height does not affect vertical spacing; dramatic
changes may be better accompanied by an '\x' escape sequence to add
extra pre-vertical space to the output line. Recall *note
Manipulating Spacing::.
The read-only register '.height' interpolates the font height.
As of this writing, only the 'ps' and 'pdf' output devices support
this feature.
The formatter does not tokenize '\H' when reading it; the escape
sequence updates the environment.(1) (*note Artificial
Fonts-Footnote-1::) It thus can be used in requests that expect a
single-character argument. We can alter the font height of a
margin character(2) (*note Artificial Fonts-Footnote-2::) as
follows.
.mc \H'+5z'x\H'0'
In compatibility mode, GNU 'troff' behaves differently: it applies
an increment or decrement to the current type size and not to the
previously selected font height.
.cp 1
\H'+5'test \H'+5'test
prints the word 'test' twice with the same font height--five points
larger than the current font size.
-- Escape sequence: \S'''slant'''
-- Register: \n[.slant]
Slant the glyphs of the currently selected font by SLANT degrees.
Positive values slant in the direction of text flow. Only integer
values are possible.
The read-only register '.slant' interpolates the font slant.
As of this writing, only the 'ps' and 'pdf' output devices support
this feature.
The formatter does not tokenize '\S' when reading it; the escape
sequence updates the environment.(3) (*note Artificial
Fonts-Footnote-3::) It thus can be used in requests that expect a
single-character argument. We can apply a slant to a margin
character(4) (*note Artificial Fonts-Footnote-4::) as follows.
.mc \S'20'x\S'0'
This escape sequence is incorrectly documented in the AT&T 'troff'
manual: the slant is only assigned, never incremented or
decremented.
-- Request: .ul [lines]
The 'ul' request normally underlines subsequent lines if a TTY
output device is used. Otherwise, the lines are printed in italics
(only the term 'underlined' is used in the following). The single
argument is the quantity of input lines to be underlined; with no
argument, the next line is underlined. If LINES is zero or
negative, stop the effects of 'ul' (if it was active). Requests
and empty lines do not count for computing the number of underlined
input lines, even if they produce some output like 'tl'. Lines
inserted by macros (e.g., invoked by a trap) do count.
At the beginning of 'ul', the current font is stored and the
underline font is activated. Within the span of a 'ul' request, it
is possible to change fonts, but after the last line affected by
'ul' the saved font is restored.
This number of lines still to be underlined is associated with the
environment (*note Environments::). The underline font can be
changed with the 'uf' request.
The 'ul' request does not underline spaces.
-- Request: .cu [lines]
The 'cu' request is similar to 'ul' but underlines spaces as well
(if a TTY output device is used).
-- Request: .uf font
Set the underline font (globally) used by 'ul' and 'cu'. By
default, this is the font at position 2. FONT can be either a
non-negative font position or the name of a font.
-- Request: .bd font [offset]
-- Request: .bd font1 font2 [offset]
-- Register: \n[.b]
Embolden FONT by overstriking its glyphs offset by OFFSET units
minus one.
Two syntax forms are available.
* Imitate a bold font unconditionally. The first argument
specifies the font to embolden, and the second is the number
of basic units, minus one, by which the two glyphs are offset.
If the second argument is missing, emboldening is turned off.
FONT can be either a non-negative font position or the name of
a font.
OFFSET is available in the '.b' read-only register if a
special font is active; in the 'bd' request, its default unit
is 'u'.
* Imitate a bold form conditionally. Embolden FONT1 by OFFSET
only if font FONT2 is the current font. This request can be
issued repeatedly to set up different emboldening values for
different current fonts. If the second argument is missing,
emboldening is turned off for this particular current font.
Because the emboldening is conditional, it applies only if the
glyph to be formatted is not available in the current font.
FONT1 must therefore be a special font, configured either with
the 'special' directive in its font description file or with
the 'fspecial' request).
-- Request: .cs font [width [em-size]]
Switch to and from "constant glyph spacing mode". If activated,
the width of every glyph is WIDTH/36 ems. The em size is given
absolutely by EM-SIZE; if this argument is missing, the em value is
taken from the current font size (as set with the 'ps' request)
when the font is effectively in use. Without second and third
argument, constant glyph spacing mode is deactivated.
Default scaling unit for EM-SIZE is 'z'; WIDTH is an integer.
(1) *Note Environments::.
(2) *Note Miscellaneous::.
(3) *Note Environments::.
(4) *Note Miscellaneous::.
5.19.8 Ligatures and Kerning
----------------------------
Proportional fonts commonly employ two techniques to improve the
esthetics of typeset text. "Ligatures" are sequences of glyphs that are
visually connected or "tied", overlapping them and slightly altering
their shapes. "Kerning" is the adjustment of horizontal spacing between
glyphs. Neither is employed on terminals.(1) (*note Ligatures and
Kerning-Footnote-1::)
Most typesetters support ligatures for the sequences 'fi', 'fl',
'ff', 'ffi', and 'ffl', and 'troff' does likewise. Some fonts may
include others, but GNU 'troff' does not (yet) support them.
The formatter checks only the current font for ligatures and kerning
adjustments; neither glyphs from special fonts nor special characters
defined with the 'char' request (and its siblings) are considered for
these processes.
-- Request: .lg [flag]
-- Register: \n[.lg]
Switch the ligature mechanism on or off; if the parameter is
non-zero or missing, ligatures are enabled, otherwise disabled.
Default is on. The current ligature mode can be found in the
read-only register '.lg' (set to 1 or 2 if ligatures are enabled,
0 otherwise).
Setting the ligature mode to 2 enables the two-character ligatures
(fi, fl, and ff) and disables the three-character ligatures (ffi
and ffl).
"Pairwise kerning" is another subtle typesetting mechanism that
modifies the distance between adjacent glyphs in a pair to improve
readability. In most cases (but not always) the distance is decreased.
Monospaced (typewriter-like) fonts and terminals don't use kerning.
-- Request: .kern [flag]
-- Register: \n[.kern]
Enable or disable pairwise kerning of glyphs in the environment per
B. It is enabled by default, and if B is omitted.
The read-only register '.kern' interpolates 1 if pairwise kerning
is enabled, 0 otherwise.
If the font description file contains pairwise kerning information,
glyphs from that font are kerned. Kerning between two glyphs can
be inhibited by placing '\&' between them: 'V\&A'.
*Note Font Description File Format::.
"Track kerning" expands or reduces the space between glyphs. This
can be handy, for example, if you need to squeeze a long word onto a
single line or spread some text to fill a narrow column. It must be
used with great care since it is usually considered bad typography if
the reader notices the effect.
-- Request: .tkf f s1 n1 s2 n2
Enable track kerning for font F. If the current font is F the
width of every glyph is increased by an amount between N1 and N2
(N1, N2 can be negative); if the current type size is less than or
equal to S1 the width is increased by N1; if it is greater than or
equal to S2 the width is increased by N2; if the type size is
greater than or equal to S1 and less than or equal to S2 the
increase in width is a linear function of the type size.
The default scaling unit is 'z' for S1 and S2, 'p' for N1 and N2.
The track kerning amount is added even to the rightmost glyph in a
line; for large values it is thus recommended to increase the line
length by the same amount to compensate.
(1) A monospaced font may possess glyphs for ligatures, but they
nevertheless seldom see use to set text.
5.19.9 Italic Corrections
-------------------------
When typesetting adjacent glyphs from typefaces of different slants, the
space between them may require adjustment.
-- Escape sequence: \/
Apply an "italic correction": modify the spacing of the preceding
glyph so that the distance between it and the following glyph is
correct if the latter is of upright shape. For example, if an
italic 'f' is followed immediately by a roman right parenthesis,
then in many fonts the top right portion of the 'f' overlaps the
top of the right parenthesis, which is ugly. Use '\/' whenever a
slanted glyph is followed immediately by an upright glyph without
any intervening space.
-- Escape sequence: \,
Apply a "left italic correction": modify the spacing of the
following glyph so that the distance between it and the preceding
glyph is correct if the latter is of upright shape. For example,
if a roman left parenthesis is immediately followed by an
italic 'f', then in many fonts the bottom left portion of the 'f'
overlaps the bottom of the left parenthesis, which is ugly. Use
'\,' whenever an upright glyph is followed immediately by a slanted
glyph without any intervening space.
5.19.10 Dummy Characters
------------------------
As discussed in *note Requests and Macros::, the first character on an
input line is treated specially. Further, formatting a glyph has many
consequences on formatter state (*note Environments::). Occasionally,
we want to escape this context or embrace some of those consequences
without actually rendering a glyph to the output.
-- Escape sequence: \&
Interpolate a dummy character, which is constitutive of output but
invisible.(1) (*note Dummy Characters-Footnote-1::) Its presence
alters the interpretation context of a subsequent input character,
and enjoys several applications.
* Prevent insertion of extra space after an end-of-sentence
character.
Test.
Test.
=> Test. Test.
Test.\&
Test.
=> Test. Test.
* Prevent recognition of a control character.
.Test
error-> warning: name 'Test' not defined
\&.Test
=> .Test
* Prevent kerning between two glyphs.
* Translate a character to "nothing".
.tr JIjiK\&k\&UVuv
Post universitum, alea jacta est, OK?
=> Post vniversitvm, alea iacta est, O?
* Stop the interpretation of a numerical expression.
\l'4i-'
error-> warning: expected numeric expression,
error-> got character "'"
\l'4i\&-'
=> ----------------------------------------
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.
.de HD \" typeset a simple bold heading
. sp
. ft B
\&\\$1 \" exercise: remove the \&
. ft
. sp
..
.HD .\|.\|.\|surprised?
One way to think about the dummy character is to imagine placing the
symbol '&' 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.
-- Escape sequence: \)
Interpolate a transparent dummy character--one that is transparent
to end-of-sentence detection. It behaves as '\&', except that '\&'
is treated as letters and numerals normally are after '.', '?' and
'!'; '\&' cancels end-of-sentence detection, and '\)' does not.
.de Suffix-&
. nop \&\\$1
..
.
.de Suffix-)
. nop \)\\$1
..
.
Here's a sentence.\c
.Suffix-& '
Another one.\c
.Suffix-) '
And a third.
=> Here's a sentence.' Another one.' And a third.
(1) Opinions of this escape sequence's best name abound. "Zero-width
space" is a popular misnomer: 'roff' formatters do not treat it like a
space; when filling, they do not break a line where '\&' appears.
Ossanna called it a "non-printing, zero-width character", but the
character causes _output_ even though it does not "print". If no output
line is pending, the dummy character starts one. Contrast an empty
input document with one containing only '\&'. The former produces no
output; the latter, a blank page.
5.20 Manipulating Type Size and Vertical Spacing
================================================
These concepts were introduced in *note Page Geometry::. The height of
a font's tallest glyph is one em, which is equal to the type size in
points.(1) (*note Manipulating Type Size and Vertical
Spacing-Footnote-1::) A vertical spacing of less than 120% of the type
size can make a document hard to read. Larger proportions can be useful
to spread the text for annotations or proofreader's marks. By default,
GNU 'troff' uses 10 point type on 12 point spacing. Typographers call
the difference between type size and vertical spacing "leading".(2)
(*note Manipulating Type Size and Vertical Spacing-Footnote-2::) Both
properties are associated with the environment; see *note
Environments::)
(1) In text fonts, parentheses are often the tallest glyphs, but a
font's glyphs may not match the nominal type size! In the standard
PostScript font families, 10-point Times sets better with 9-point
Helvetica and 11-point Courier than if all were used at 10 points.
Recall the 'fzoom' request in *note Selecting Fonts:: for a remedy.
(2) Rhyme with "sledding"; mechanical typography used lead metal
(Latin _plumbum_).
5.20.1 Changing the Type Size
-----------------------------
-- Request: .ps [size]
-- Request: .ps +size
-- Request: .ps -size
-- Register: \n[.s]
Set (increase, decrease) the type size to (by) SIZE points. 'ps'
with no argument restores the previous size. The 'ps' request's
default scaling unit is 'z'; recall *note Measurements:: and see
*note Using Fractional Type Sizes::). The formatter rounds the
requested size to the nearest valid size (with ties rounding down)
within the limits supported by the device, and if the requested
size is non-positive, treats it as 1u.
Type size alteration is incorrectly documented in the AT&T 'troff'
manual, which claims "if [the requested size] is invalid, the next
larger valid size will result, with a maximum of 36".(1) (*note
Changing the Type Size-Footnote-1::)
The read-only string-valued register '.s' interpolates the type
size in points as a decimal fraction. To obtain the type size in
scaled points, interpolate the '.ps' register instead (*note Using
Fractional Type Sizes::).
-- Escape sequence: \ssize
The '\s' escape sequence also determines the type size, but handles
a zero argument differently. It supports a variety of syntax
forms.
'\sN'
Set the type size to N typographical points. N must be a
single digit.(2) (*note Changing the Type Size-Footnote-2::)
If N is '0', restore the previous size.
'\s+N'
'\s-N'
Increase or decrease the type size by N typographical points.
N must be exactly one digit.
'\s(NN'
Set the type size to NN typographical points. NN must be
exactly two digits. If N is '00', restore the previous size.
'\s+(NN'
'\s-(NN'
'\s(+NN'
'\s(-NN'
Alter the type size in scaled points by the NN typographical
points. NN must be exactly two digits.
*Note Using Fractional Type Sizes::, for further syntactical forms
of the '\s' escape sequence that additionally accept decimal
fractions.
snap, snap,
.ps +2
grin, grin,
.ps +2
wink, wink, \s+2nudge, nudge,\s+8 say no more!
.ps 10
The formatter does not tokenize '\s' when reading its input; it
instead updates the environment. It thus can be used in requests that
expect a single-character argument. We might alter the type size when
writing a margin character as follows (*note Miscellaneous::).
.mc \s[20]x\s[0]
-- Request: .sizes s1 s2 ... sn [0]
The 'DESC' file specifies which type sizes are allowed by the
output device; see *note DESC File Format::. Use the 'sizes'
request to change this set of permissible sizes. Arguments are in
scaled points; see *note Using Fractional Type Sizes::. Each can
be a single type size (such as '12000'), or a range of sizes (such
as '4000-72000'). You can optionally end the list with a '0'.
(1) The claim appears to have been true of Ossanna 'troff' for the
C/A/T device; Kernighan made device-independent 'troff' more flexible.
(2) In compatibility mode only, a non-zero N must be in the range
4-39. *Note Compatibility Mode::.
5.20.2 Changing the Vertical Spacing
------------------------------------
-- Request: .vs [space]
-- Request: .vs +space
-- Request: .vs -space
-- Register: \n[.v]
Set the vertical spacing to, or alter it by, SPACE. The default
scaling unit is 'p'. If 'vs' is invoked without an argument, the
vertical spacing is reset to the previous value before the last
call to 'vs'. GNU 'troff' emits a warning in category 'range' if
SPACE is negative; the vertical spacing is then set to the smallest
possible positive value, the vertical motion quantum (as found in
the '.V' register).
'.vs 0' isn't saved in a diversion since it doesn't result in a
vertical motion. You must explicitly issue this request before
interpolating the diversion.
The read-only register '.v' contains the vertical spacing.
When a break occurs, GNU 'troff' performs the following procedure.
* Move the drawing position vertically by the "extra pre-vertical
line space", the minimum of all negative '\x' escape sequence
arguments in the pending output line.
* Move the drawing position vertically by the vertical line spacing.
* Write out the pending output line.
* Move the drawing position vertically by the "extra post-vertical
line space", the maximum of all positive '\x' escape sequence
arguments in the line that has just been output.
* Move the drawing position vertically by the "post-vertical line
spacing" (see below).
Prefer 'vs' or 'pvs' over 'ls' to produce double-spaced documents.
'vs' and 'pvs' have finer granularity than 'ls'; moreover, some
preprocessors assume single spacing. *Note Manipulating Spacing::,
regarding the '\x' escape sequence and the 'ls' request.
-- Request: .pvs [space]
-- Request: .pvs +space
-- Request: .pvs -space
-- Register: \n[.pvs]
Set the post-vertical spacing to, or alter it by, SPACE. The
default scaling unit is 'p'. If 'pvs' is invoked without an
argument, the post-vertical spacing is reset to the previous value
before the last call to 'pvs'. GNU 'troff' emits a warning in
category 'range' if SPACE is negative; the post-vertical spacing is
then set to zero.
The read-only register '.pvs' interpolates the post-vertical
spacing.
5.20.3 Using Fractional Type Sizes
----------------------------------
When configuring the type size, AT&T 'troff' ignored scaling units and
interpreted all measurements in points. Combined with integer
arithmetic, this design choice made it impossible to support, for
instance, ten-and-a-half-point type. In GNU 'troff', an output device
can select a scaling factor that subdivides a point into "scaled
points". A type size expressed in scaled points can thus represent a
non-integral size in points.
A "scaled point", scaling unit 's', is equal to 1/SIZESCALE points,
where the device description file, 'DESC', specifies SIZESCALE and
otherwise defaults to 1.(1) (*note Using Fractional Type
Sizes-Footnote-1::) GNU 'troff' also defines the "typographical point",
scaling unit 'z', which explicitly specifies a type size of potentially
non-integral measure. The program multiplies typographical points by
SIZESCALE and converts the value to an integer. Arguments GNU 'troff'
interprets in 'z' units by default comprise those to the escape
sequences '\H' and '\s', to the request 'ps', the third argument to the
'cs' request, and the second and fourth arguments to the 'tkf' request.
For example, if SIZESCALE is 1000, then a scaled point is one
thousandth of a point. The request '.ps 10.5' is synonymous with '.ps
10.5z'; both set the type size to 10,500 scaled points, or
10.5 typographical points.
-- Register: \n[.ps]
This read-only register interpolates the type size in scaled
points. '\n[.ps]s', '\n[.s]z', and '1m' are co-equal by
definition.
.tm device=\*[.T]
.tm A: .s=\n[.s]z, .ps=\n[.ps]s
.ps 10.5
.tm B: .s=\n[.s]z, .ps=\n[.ps]s
.ps 12.3p
.tm C: .s=\n[.s]z, .ps=\n[.ps]s
.ps 8.1z
.tm D: .s=\n[.s]z, .ps=\n[.ps]s
.ps 10500s
.tm E: .s=\n[.s]z, .ps=\n[.ps]s
=> device=ps
=> A: .s=10z, .ps=10000s
=> B: .s=10.5z, .ps=10500s
=> C: .s=12.3z, .ps=12300s
=> D: .s=8.1z, .ps=8100s
=> E: .s=10.5z, .ps=10500s
It makes no sense to use the 'z' scaling unit in a numeric expression
whose default scaling unit is neither 'u' nor 'z', so GNU 'troff'
disallows this. Similarly, it is nonsensical to use scaling units other
than 'p', 's', 'z', or 'u' in a numeric expression whose default scaling
unit is 'z', and so GNU 'troff' disallows those as well.
-- Register: \n[.psr]
-- Register: \n[.sr]
Output devices may be limited in the type sizes they can employ.
The '.s' and '.ps' registers represent the type size selected by
the formatter as it understands a device's capability. The last
_requested_ type size is interpolated in scaled points by the
read-only register '.psr' and in points as a decimal fraction by
the read-only string-valued register '.sr'.
For example, if a document requests a type size of 10.95 points,
and the nearest size permitted by a 'sizes' request (or by the
'sizes' or 'sizescale' directives in the device's 'DESC' file) is
11 points, 'groff' uses the latter value.
The '\s' escape sequence offers the following syntax forms that work
with fractional type sizes and accept scaling units. The delimited
forms need not use the neutral apostrophe; see *note Delimiters::.
'\s[N]'
'\s'N''
Set the type size to N typographical points; N is a numeric
expression with a default scaling unit of 'z'.
'\s[+N]'
'\s[-N]'
'\s+[N]'
'\s-[N]'
'\s'+N''
'\s'-N''
'\s+'N''
'\s-'N''
Increase or decrease the type size by N typographical points; N is
a numeric expression with a default scaling unit of 'z'. If N is
'0', restore the previous size.
(1) *Note Device and Font Description Files::.
5.21 Colors
===========
GNU 'troff' supports color output with a variety of color spaces and up
to 16 bits per channel. Some devices, particularly terminals, may be
more limited. When color support is enabled, two colors are current at
any given time: the "stroke color", with which glyphs, rules (lines),
and geometric objects like circles and polygons are drawn, and the "fill
color", which can be used to paint the interior of a closed geometric
figure.
-- Request: .color [b]
-- Register: \n[.color]
Enable or disable output of color-related device-independent output
commands per Boolean expression B. It is enabled by default, and
if B is omitted.
The read-only register '.color' interpolates 1 if color support is
enabled, 0 otherwise.
Color can also be disabled with the '-c' command-line option.
-- Request: .defcolor ident scheme color-component ...
Define a color named IDENT. SCHEME selects a color space and
determines the quantity of required COLOR-COMPONENTs; it must be
one of 'rgb' (three components), 'cmy' (three), 'cmyk' (four), or
'gray' (one). 'grey' is accepted as a synonym of 'gray'. The
color components can be encoded as a single hexadecimal value
starting with '#' or '##'. The former indicates that each
component is in the range 0-255 (0-FF), the latter the range
0-65,535 (0-FFFF).
.defcolor half gray #7f
.defcolor pink rgb #FFC0CB
.defcolor magenta rgb ##ffff0000ffff
Alternatively, each color component can be specified as a decimal
fraction in the range 0-1, interpreted using a default scaling unit
of 'f', which multiplies its value by 65,536 (but clamps it at
65,535).
.defcolor gray50 rgb 0.5 0.5 0.5
.defcolor darkgreen rgb 0.1f 0.5f 0.2f
You can obtain a report of colors defined by 'defcolor' on the
standard error stream with the 'pcolor' request. *Note
Debugging::.
Each output device has a color named 'default', which cannot be
redefined. A device's default stroke and fill colors are not
necessarily the same. For the 'dvi', 'html', 'pdf', 'ps', and 'xhtml'
output devices, GNU 'troff' automatically loads a macro file defining
many color names at startup. By the same mechanism, the devices
supported by 'grotty' recognize the eight standard ISO 6429/ECMA-48
color names.(1) (*note Colors-Footnote-1::)
-- Request: .gcolor [col]
-- Escape sequence: \mc
-- Escape sequence: \m(co
-- Escape sequence: \m[col]
-- Register: \n[.m]
Select COL as the stroke color for glyphs, rules, and objects drawn
with '\D'...'' escape sequences. The escape sequence '\M[]'
restores the previous stroke color, or the default if there is
none, as does a 'gcolor' request without an argument.
.gcolor red
The next words
.gcolor
\m[red]are in red\m[]
and these words are in the previous color.
The current environment's stroke color selection is available in
the read-only string-valued register '.m' (*note Environments::).
The default strike color is named 'default'.
GNU 'troff' does not tokenize '\m' when reading it; the escape
sequence updates the environment. It thus can be used in requests
that expect a single-character argument. We can assign a stroke
color to a margin character as follows (*note Miscellaneous::).
.mc \m[red]x\m[]
-- Request: .fcolor [col]
-- Escape sequence: \Mc
-- Escape sequence: \M(co
-- Escape sequence: \M[col]
-- Register: \n[.M]
Select COL as the fill color for objects drawn with '\D'...''
escape sequences. The escape sequence '\M[]' restores the previous
fill color, or the default if there is none, as does an 'fcolor'
request without an argument.
GNU 'troff' does not tokenize '\F' when reading it; the escape
sequence updates the environment. It thus can be used in requests
that expect a single-character argument. We can assign a fill
color to a margin character as follows (*note Miscellaneous::);
'grotty' interprets the fill color as a character cell background
color.
.mc \m[black]\M[green]x\M[]\m[]
The current environment's fill color selection is available in the
read-only string-valued register '.M' (*note Environments::). The
default fill color is named 'default'.
Create an ellipse with a red interior as follows.
\M[red]\h'0.5i'\D'E 2i 1i'\M[]
(1) These are known vulgarly as "ANSI" colors, after its X3.64
standard, now withdrawn.
5.22 Strings
============
GNU 'troff' supports strings primarily for user convenience.
Conventionally, if one would define a macro only to interpolate a small
amount of text, without invoking requests or calling any other macros,
one defines a string instead. Only one string is predefined by the
language.
-- String: \*[.T]
Contains the name of the output device (for example, 'utf8' or
'pdf').
The 'ds' request creates a string with a specified name and contents
and the '\*' escape sequence dereferences its name, interpolating its
contents. If the string named by the '\*' escape sequence does not
exist, it is defined as empty, nothing is interpolated, and a warning in
category 'mac' is emitted. *Note Warnings::, regarding the enablement
and suppression of warnings.
-- Request: .ds name [['"']contents]
-- Request: .ds1 name [['"']contents]
-- Escape sequence: \*n
-- Escape sequence: \*(nm
-- Escape sequence: \*[name [arg1 arg2 ...]]
Define a string called NAME with contents CONTENTS. If NAME
already exists as an alias, the target of the alias is redefined;
see 'als' and 'rm' below. If 'ds' is invoked with only one
argument, NAME is defined as an empty string. Otherwise, GNU
'troff' stores CONTENTS in copy mode. '\*' is itself interpreted
even in copy mode.(1) (*note Strings-Footnote-1::)
The '\*' escape sequence interpolates a previously defined string
NAME (one-character name N, two-character name NM). The bracketed
interpolation form accepts arguments that are handled as macro
arguments are; recall *note Calling Macros::. In contrast to macro
calls, however, if a closing bracket ']' occurs in a string
argument, that argument must be enclosed in double quotes. When
defining strings, argument interpolations must be escaped if they
are to reference parameters from the calling context; see *note
Parameters::.
.ds cite (\\$1, \\$2)
Gray codes are explored in \*[cite Morgan 1998].
=> Gray codes are explored in (Morgan, 1998).
*Caution:* After the formatter has read the space character that
ends the first argument, it treats the remainder of the input line
as the second argument, including any spaces, up to a newline or
comment escape sequence. Ending string definitions (and
appendments) with a comment, even an empty one, prevents unwanted
space from creeping into them during source document maintenance.
.ds Si silicon \" use chemical symbol
We observed a \*[Si]-based life form.
=> We observed a silicon -based life form.
Instead, place the comment on another line or put the comment
escape sequence immediately adjacent to the last character of the
string.
.ds Si silicon\" use chemical symbol
We observed a \*[Si]-based life form.
=> We observed a silicon-based life form.
Because the first space after the string name separates the
arguments, you can retain it while using a comment to document an
empty string.
.ds author Alice Pleasance Liddell\"
.ds friends \" empty; append to with .as
The formatter removes a leading neutral double quote '"' from
CONTENTS, permitting initial embedded spaces in it. It interprets
any other '"' literally, but the wise author uses the special
character escape sequence '\[dq]' instead if the string might be
interpolated as part of a macro argument; recall *note Calling
Macros::.
.ds salutation " Yours in a white wine sauce,\"
.ds c-var-defn " char mydate[]=\[dq]2020-07-29\[dq];\"
Strings are not limited to a single input line of text. '\'
works just as it does elsewhere. The resulting string is stored
_without_ the newlines. When filling is disabled, care is required
to avoid overrunning the line length when interpolating strings.
.ds foo This string contains \
text on multiple lines \
of input.
Conversely, when filling is enabled, it is not necessary to append
'\c' to a string interpolation to prevent a break afterward, as
might be required in a macro argument. Nor does a string require
use of the GNU 'troff' 'chop' request to excise a trailing newline
as is often done with diversions.
It is not possible to embed a newline in a string that will be
interpreted as such when the string is interpolated. To achieve
that effect, use '\*' to interpolate a macro instead; see *note
Punning Names::.
Because strings are similar to macros, they too can be defined so
as to suppress AT&T 'troff' compatibility mode when used; see *note
Writing Macros:: and *note Compatibility Mode::. The 'ds1' request
defines a string such that compatibility mode is off when the
string is later interpolated. To be more precise, GNU 'troff'
inserts a a "compatibility save" token at the beginning of
CONTENTS, and a "compatibility restore" token at the end.
.nr xxx 12345
.ds aa The value of xxx is \\n[xxx].
.ds1 bb The value of xxx is \\n[xxx].
.
.cp 1
.
\*(aa
error-> warning: register '[' not defined
=> The value of xxx is 0xxx].
\*(bb
=> The value of xxx is 12345.
-- Request: .as name [['"']contents]
-- Request: .as1 name [['"']contents]
The 'as' request is similar to 'ds' but appends CONTENTS to the
string stored as NAME instead of redefining it. If NAME doesn't
exist yet, it is created. If 'as' is invoked with only one
argument, no operation is performed (beyond dereferencing the
string).
.as salutation " with shallots, onions and garlic,\"
*Caution:* The formatter reads the second argument to the end of
the line in copy mode, omitting any leading neutral double quote
'"' character. See the discussion of the 'ds' request above.
The 'as1' request works as does 'as', but like 'ds1', it brackets
CONTENTS with compatibility save and restore tokens.
Several requests exist to perform rudimentary string operations.
Strings can be queried ('length') and modified ('chop', 'substring',
'stringup', 'stringdown'), and their names can be manipulated through
renaming, removal, and aliasing ('rn', 'rm', 'als').
-- Request: .length reg [['"']contents]
Compute the number of characters in CONTENTS and store the count in
the register REG. If REG doesn't exist, GNU 'troff' creates it.
GNU 'troff' removes a leading neutral double quote '"' from
CONTENTS, permitting initial embedded spaces in it, and reads it to
the end of the input line in copy mode. *Note Copy Mode::.
.ds xxx abcd\h'3i'efgh
.length yyy \*[xxx]
\n[yyy]
=> 14
*Caution:* The formatter reads the second argument to the end of
the line in copy mode, omitting any leading neutral double quote
'"' character. See the discussion of the 'ds' request above.
*Caution:* If you interpolate a macro or diversion in CONTENTS
(*note Punning Names::), the 'length' request counts characters (or
nodes) only up to the first newline, and leaves the rest on the
input stream. In conventional circumstances, that means the
remainder is interpreted, and may be formatted. To discover the
length of any string, macro, or diversion, use the 'pm' request.
*Note Debugging::.
-- Request: .chop object
Remove the last character from the macro, string, or diversion
named OBJECT. This is useful for removing the newline from the end
of a diversion that is to be interpolated as a string. This
request can be used repeatedly on the same OBJECT; see *note GNU
troff Internals::, for details on nodes inserted additionally by
GNU 'troff'.
-- Request: .substring str start [end]
Replace the string named STR with its substring bounded by the
indices START and END, inclusively. The first character in the
string has index 0. If END is omitted, it is implicitly set to the
largest valid value (the string length minus one). Negative
indices count backward from the end of the string: the last
character has index -1, the character before the last has index -2,
and so on.
.ds xxx abcdefgh
.substring xxx 1 -4
\*[xxx]
=> bcde
.substring xxx 2
\*[xxx]
=> de
-- Request: .stringdown str
-- Request: .stringup str
Alter the string named STR by replacing each of its bytes with its
lowercase ('stringdown') or uppercase ('stringup') version (if one
exists). Special characters in the string will often transform in
the expected way due to the regular naming convention for accented
characters. When they do not, use substrings and/or catenation.
.ds resume R\['e]sum\['e]\"
\*[resume]
.stringdown resume
\*[resume]
.stringup resume
\*[resume]
=> Résumé résumé RÉSUMÉ
-- Request: .rn old new
Rename the request, macro, diversion, or string OLD to NEW.
-- Request: .rm name ...
Remove each request, macro, diversion, or string NAME. GNU 'troff'
treats subsequent invocations as if the name had never been
defined.
This request is incorrectly documented in the AT&T 'troff' manual
as accepting only one argument.
-- Request: .als new-name existing-name
Create alias (additional name) NEW-NAME of request, string, macro,
or diversion EXISTING-NAME, causing the names to refer to the same
stored object. If EXISTING-NAME is undefined, the formatter
ignores the request.(2) (*note Strings-Footnote-2::) If NEW-NAME
already exists, its contents are lost unless already aliased.
To understand how the 'als' request works, consider two different
storage pools: one for objects (macros, strings, etc.), and another
for names. As soon as an object is defined, GNU 'troff' adds it to
the object pool, adds its name to the name pool, and creates a link
between them. When 'als' creates an alias, it adds a new name to
the name pool that gets linked to the same object as the old name.
Now consider this example.
.de foo
..
.
.als bar foo
.
.de bar
. foo
..
.
.bar
error-> input stack limit exceeded (probable infinite
error-> loop)
In the above, 'bar' remains an _alias_--another name for--the
object referred to by 'foo', which the second 'de' request
replaces. Alternatively, imagine that the 'de' request
_dereferences_ its argument before replacing it. Either way, the
result of calling 'bar' is a recursive loop that finally leads to
an error. *Note Writing Macros::.
To remove an alias, call 'rm' on its name. The object itself is
not destroyed until it has no more names.
When a request, macro, string, or diversion is aliased
redefinitions and appendments "write through" alias names. To
replace an alias with a separately defined object, remove its name
first.
(1) *Note Copy Mode::.
(2) GNU 'troff' emits a warning in category 'mac'. *Note Warnings::.
5.23 Conditionals and Loops
===========================
'groff' has 'if' and 'while' control structures like other languages.
However, the syntax for grouping multiple input lines in the branches or
bodies of these structures is unusual.
5.23.1 Operators in Conditionals
--------------------------------
The 'if', 'ie', and 'while' requests test the truth values of numeric
expressions. They also support several additional Boolean operators;
the members of this expanded class are termed "conditional expressions";
their truth values are as shown below.
'c CHR'
True if a character CHR is available; CHR is an ordinary, special
or indexed character, whether defined by a font description file or
a request.
'd NAME'
True if a string, macro, diversion, or request called NAME exists.
'e'
True if the current page is even-numbered.
'F FONT'
True if FONT exists. FONT is handled as if it were an argument to
the 'ft' request (that is, the default family is combined with an
abstract style and font translation is applied), but FONT cannot be
a mounting position, and no font is mounted.
'm COLOR'
True if COLOR is defined.
'n'
True if the document is being processed in 'nroff' mode.
'o'
True if the current page is odd-numbered.
'r REGISTER'
True if REGISTER exists.
'S STYLE'
True if STYLE is available for the current font family. Font
translation is applied.
't'
True if the document is being processed in 'troff' mode.
'v'
Always false. This condition exists for compatibility with certain
other 'troff' implementations.(1) (*note Operators in
Conditionals-Footnote-1::)
If the first argument to an 'if', 'ie', or 'while' request begins
with a non-alphanumeric character apart from '!' (see below) and is not
a numeric expression, the formatter performs an output comparison test.
(2) (*note Operators in Conditionals-Footnote-2::)
''XXX'YYY''
This "output comparison operator" interpolates a true value if
formatting the comparands XXX and YYY produces the same output
commands. The delimiter need not be a neutral apostrophe: the
output comparison operator accepts the same delimiters as most
escape sequences; see *note Delimiters::. 'troff' formats XXX and
YYY in separate scratch buffers; after comparison, it discards the
resulting data.
.ie "|"\fR|\fP" true
.el false
=> true
The resulting glyph properties, including font family, style, size,
and slant, must match, but not necessarily the requests and/or
escape sequences used to obtain them. In the previous example, '|'
and '\fR|\fP' result in '|' glyphs in the same typefaces at the
same positions, so the comparands are equal. If '.ft I' had been
added before the '.ie', they would differ: the first '|' would
produce an italic '|', not a roman one. Motions must match in
orientation and magnitude to within the applicable horizontal and
vertical motion quanta of the device, after rounding. '.if
"\u\d"\v'0'"' is false even though both comparands result in zero
net motion, because motions are not interpreted or optimized but
sent as-is to the output.(3) (*note Operators in
Conditionals-Footnote-3::) On the other hand, '.if "\d"\v'0.5m'"'
is true, because '\d' is defined as a downward motion of one-half
em.(4) (*note Operators in Conditionals-Footnote-4::)
Surround the comparands with '\?' to avoid formatting them; this
causes them to be compared character by character, as with string
comparisons in other programming languages.
.ie "\?|\?"\?\fR|\fP\?" true
.el false
=> false
Since GNU 'troff' reads comparands protected with '\?' in copy
mode,(5) (*note Operators in Conditionals-Footnote-5::) they need
not even be syntactically valid. The escape character is still
lexically recognized, however, and consumes the next character.
.ds a \[
.ds b \[
.if '\?\*a\?'\?\*b\?' a and b equivalent
.if '\?\\?'\?\\?' backslashes equivalent
.if '\?\P\?'\?P\?' backslash-P and P equivalent
=> a and b equivalent
The above operators can't be combined with most others, but a leading
'!', not followed immediately by spaces or tabs, complements an
expression.
.nr x 1
.ie !r x register x is not defined
.el register x is defined
=> register x is defined
Spaces and tabs are optional immediately after the 'c', 'd', 'F',
'm', 'r', and 'S' operators, but right after '!', they end the predicate
and the conditional evaluates true.(6) (*note Operators in
Conditionals-Footnote-6::)
.nr x 1
.ie ! r x register x is not defined
.el register x is defined
=> r x register x is not defined
The unexpected 'r x' in the output is a clue that our conditional was
not interpreted as we planned, but matters may not always be so obvious.
Conditional operators do not create 'roff' language objects as
interpolations with '\n' and '\*' escape sequences do.
(1) We refer to 'vtroff', which converted the C/A/T command stream
produced by early-vintage AT&T 'troff' to input suitable for Versatec
and Benson-Varian plotters.
(2) Strictly, letters not otherwise recognized _are_ treated as
output comparison delimiters. A portable document avoids using letters
not in the list above; for example, Plan 9 'troff' uses 'h' to test a
mode it calls 'htmlroff', and GNU 'troff' may provide additional
operators in the future.
(3) Because formatting of the comparands takes place in a dummy
environment, vertical motions within them cannot spring traps. *Note
Traps::.
(4) All of this is to say that the lists of nodes created by
formatting XXX and YYY must be identical. *Note GNU troff Internals::.
(5) *Note Copy Mode::.
(6) This bizarre behavior maintains compatibility with AT&T 'troff'.
5.23.2 if-then
--------------
-- Request: .if cond-expr input
Evaluate the conditional expression COND-EXPR, and if it evaluates
true (or to a positive value), interpret the remainder of the line
INPUT as if it were an input line. Recall from *note Invoking
Requests:: that any quantity of spaces between arguments to
requests serves only to separate them; leading spaces in INPUT are
thus not seen. INPUT effectively _cannot_ be omitted; if COND-EXPR
is true and INPUT is empty, the formatter interprets the newline at
the end of the control line as a blank input line (and therefore a
blank text line).
super\c
tanker
.nr force-word-break 1
super\c
.if ((\n[force-word-break] = 1) & \n[.int])
tanker
=> supertanker super tanker
-- Request: .nop [input]
Interpret INPUT as if it were an input line. 'nop' resembles '.if
1'; it puts a break on the output if INPUT is empty. Unlike 'if',
it cannot govern conditional blocks. Its application is to
maintain consistent indentation within macro definitions even when
formatting output.
.als real-MAC MAC
.de wrapped-MAC
. tm MAC: called with arguments \\$@
. nop \\*[real-MAC]\\
..
.als MAC wrapped-MAC
\# Later...
.als MAC real-MAC
In the above, we've used aliasing, 'nop', and the interpolation of
a macro as a string to interpose a wrapper around the macro 'MAC'
(perhaps to debug it).
5.23.3 if-else
--------------
-- Request: .ie cond-expr input
-- Request: .el input
Use the 'ie' and 'el' requests to write an if-then-else. The first
request is the "if" part and the latter is the "else" part.
Unusually among programming languages, any number of
non-conditional requests may be interposed between the 'ie' branch
and the 'el' branch.
.nr a 0
.ie \na a is non-zero.
.nr a +1
.el a was not positive but is now \na.
=> a was not positive but is now 1.
Another way in which 'el' is an ordinary request is that it does
not lexically "bind" more tightly to its 'ie' counterpart than it
does to any other request. This fact can surprise C programmers.
.nr a 1
.nr z 0
.ie \nz \
. ie \na a is true
. el a is false
.el z is false
=> a is false
To conveniently nest conditionals, keep reading.
5.23.4 Conditional Blocks
-------------------------
It is frequently desirable for a control structure to govern more than
one request, macro call, text line, or combination of the foregoing.
The opening and closing brace escape sequences '\{' and '\}' define such
groups. These "conditional blocks" can furthermore be nested.
-- Escape sequence: \{
-- Escape sequence: \}
'\{' begins a conditional block; it must appear (after optional
spaces and tabs) immediately subsequent to the conditional
expression of an 'if', 'ie', or 'while' request,(1) (*note
Conditional Blocks-Footnote-1::) or as the argument to an 'el'
request.
'\}' ends a conditional block and should appear on a line with
other occurrences of itself as necessary to match '\{' sequences.
It can be preceded by a control character, spaces, and tabs. Input
after any quantity of '\}' sequences on the same line is processed
only if all of the preceding conditions to which they correspond
are true. Furthermore, a '\}' closing the body of a 'while'
request must be the last such escape sequence on an input line.
Brace escape sequences outside of control structures have no
meaning and produce no output.
*Caution:* Input lines using '\{' often end with '\RET', especially
in macros that consist primarily of control lines. Forgetting to
use '\RET' on an input line after '\{' is a common source of error.
We might write the following in a page header macro. If we delete
'\RET', the header will carry an unwanted extra empty line (except on
page 1).
.if (\\n[%] != 1) \{\
. ie ((\\n[%] % 2) = 0) .tl \\*[even-numbered-page-title]
. el .tl \\*[odd-numbered-page-title]
.\}
Let us take a closer look at how conditional blocks nest.
A
.if 0 \{ B
C
D
\}E
F
=> A F
N
.if 1 \{ O
. if 0 \{ P
Q
R\} S\} T
U
=> N O U
The above behavior may challenge the intuition; it was implemented to
retain compatibility with AT&T 'troff'. For clarity, it is idiomatic to
end input lines with '\{' (followed by '\' if appropriate), and to
precede '\}' on an input line with nothing more than a control
character, spaces, tabs, and other instances of itself.
We can use 'ie', 'el', and conditional blocks to simulate the
multi-way "switch" or "case" control structures of other languages. The
following example is adapted from the 'groff' 'man' package.
Indentation is used to clarify the logic.
.\" Simulate switch/case in roff.
. ie '\\$2'1' .ds title General Commands\"
.el \{.ie '\\$2'2' .ds title System Calls\"
.el \{.ie '\\$2'3' .ds title Library Functions\"
.el \{.ie '\\$2'4' .ds title Kernel Interfaces\"
.el \{.ie '\\$2'5' .ds title File Formats\"
.el \{.ie '\\$2'6' .ds title Games\"
.el \{.ie '\\$2'7' .ds title Miscellaneous Information\"
.el \{.ie '\\$2'8' .ds title System Management\"
.el \{.ie '\\$2'9' .ds title Kernel Development\"
.el .ds title \" empty
.\}\}\}\}\}\}\}\}
(1) *Note while::.
5.23.5 while
------------
GNU 'troff' provides a looping construct: the 'while' request. Its
syntax matches the 'if' request.
-- Request: .while cond-expr input
Evaluate the conditional expression COND-EXPR, and repeatedly
execute INPUT unless and until COND-EXPR evaluates false. INPUT,
which is often a conditional block, is referred to as the 'while'
request's "body".
.nr a 0 1
.while (\na < 9) \{\
\n+a,
.\}
\n+a
=> 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
GNU 'troff' treats the body of a 'while' request similarly to that
of a 'de' request (albeit one not read in copy mode(1) (*note
while-Footnote-1::)), but stores it under an internal name and
deletes it when the loop finishes. The operation of a macro
containing a 'while' request can slow significantly if its body is
large. Each time GNU 'troff' interpolates the macro, it parses and
stores the 'while' body again.
.de xxx
. nr num 10
. while (\\n[num] > 0) \{\
. \" many lines of code
. nr num -1
. \}
..
An often better solution--and one that is more portable, since AT&T
'troff' lacked the 'while' request--is to instead write a recursive
macro, which is parsed only once.(2) (*note while-Footnote-2::)
.de yy
. if (\\n(nm > 0) \{\
. \" many lines of code
. nr nm -1
. yy
. \}
..
.
.de xx
. nr nm 10
. yy
..
To prevent infinite loops, GNU 'troff' limits the default number of
available recursion levels to 1,000 or somewhat less.(3) (*note
while-Footnote-3::) You can disable this protective measure, or
alter the limit, by setting the 'slimit' register. *Note
Debugging::.
As noted above, if a 'while' body begins with a conditional block,
its closing brace must end an input line.
.if 1 \{\
. nr a 0 1
. while (\n[a] < 10) \{\
. nop \n+[a]
.\}\}
error-> unbalanced brace escape sequences
-- Request: .break
Exit a 'while' loop. Do not confuse this request with a
typographical break or the 'br' request.
-- Request: .continue
Skip the remainder of a 'while' loop's body, immediately retesting
its conditional expression.
(1) *Note Copy Mode::.
(2) unless you redefine it
(3) "somewhat less" because things other than macro calls can be on
the input stack
5.24 Writing Macros
===================
A "macro" is a stored collection of text and control lines that can be
interpolated multiple times. Use macros to define common operations.
Macros are called in the same way that requests are invoked. While
requests exist for the purpose of creating macros, simply calling an
undefined macro, or interpolating it as a string, will cause it to be
defined as empty. *Note Identifiers::.
-- Request: .de name [end]
Define a macro NAME, replacing the definition of any existing
request, macro, string, or diversion called NAME. If NAME already
exists as an alias, the target of the alias is redefined; recall
*note Strings::. GNU 'troff' enters copy mode,(1) (*note Writing
Macros-Footnote-1::) storing subsequent input lines as the macro
definition. If the optional second argument is not specified, the
definition ends with the control line '..' (two dots).
Alternatively, END identifies a macro whose call syntax at the
start of a control line ends the definition of NAME; END is then
called normally. A macro definition must end in the same
conditional block (if any) in which it began (recall *note
Conditional Blocks::). Spaces or tabs are permitted after the
control character in the line containing this ending token (either
'.' or 'END'), but a tab immediately after the token prevents its
recognition as the end of a macro definition. The macro END can be
called with arguments.(2) (*note Writing Macros-Footnote-2::)
Here is a small example macro called 'P' that causes a break and
inserts some vertical space. It could be used to separate
paragraphs.
.de P
. br
. sp .8v
..
We can define one macro within another. Attempting to nest '..'
naïvely will end the outer definition because the inner definition
isn't interpreted as such until the outer macro is later
interpolated. We can use an end macro instead. Each level of
nesting should use a unique end macro.
An end macro need not be defined until it is called. This fact
enables a nested macro definition to begin inside one macro and end
inside another. Consider the following example.(3) (*note Writing
Macros-Footnote-3::)
.de m1
. de m2 m3
you
..
.de m3
Hello,
Joe.
..
.de m4
do
..
.m1
know?
. m3
What
.m4
.m2
=> Hello, Joe. What do you know?
A nested macro definition _can_ be terminated with '..' and nested
macros _can_ reuse end macros, but these control lines must be
escaped multiple times for each level of nesting. The necessity of
this escaping and the utility of nested macro definitions will
become clearer when we employ macro parameters and consider the
behavior of copy mode in detail.
'de' defines a macro that inherits the compatibility mode enablement
status of its context (*note Implementation Differences::). Often it is
desirable to make a macro that uses 'groff' features callable from
contexts where compatibility mode is on; for instance, when writing
extensions to a historical macro package. To achieve this,
compatibility mode needs to be switched off while such a macro is
interpreted--without disturbing that state when it is finished.
-- Request: .de1 name [end]
The 'de1' request defines a macro to be interpreted with
compatibility mode disabled. When NAME is called, compatibility
mode enablement status is saved; it is restored when the call
completes. Observe the extra backlash before the interpolation of
register 'xxx'; we'll explore this subject in *note Copy Mode::.
.nr xxx 12345
.de aa
The value of xxx is \\n[xxx].
. br
..
.de1 bb
The value of xxx is \\n[xxx].
..
.cp 1
.aa
error-> warning: register '[' not defined
=> The value of xxx is 0xxx].
.bb
=> The value of xxx is 12345.
-- Request: .dei name [end]
-- Request: .dei1 name [end]
The 'dei' request defines a macro with its name and end macro
indirected through strings. That is, it interpolates strings named
NAME and END before performing the definition.
The following examples are equivalent.
.ds xx aa
.ds yy bb
.dei xx yy
.de aa bb
The 'dei1' request bears the same relationship to 'dei' as 'de1'
does to 'de'; it temporarily turns compatibility mode off when NAME
is called.
-- Request: .am name [end]
-- Request: .am1 name [end]
-- Request: .ami name [end]
-- Request: .ami1 name [end]
'am' appends subsequent input lines to macro NAME, extending its
definition, and otherwise working as 'de' does.
To make the previously defined 'P' macro set indented instead of
block paragraphs, add the necessary code to the existing macro.
.am P
.ti +5n
..
The other requests are analogous to their 'de' counterparts. The
'am1' request turns off compatibility mode during interpretation of
the appendment. The 'ami' request appends indirectly, meaning that
strings NAME and END are interpolated with the resulting names used
before appending. The 'ami1' request is similar to 'ami',
disabling compatibility mode during interpretation of the appended
lines.
Using 'trace.tmac', you can trace calls to 'de', 'de1', 'am', and
'am1'. You can also use the 'backtrace' request at any point desired to
troubleshoot tricky spots (*note Debugging::).
*Note Strings::, for the 'als', 'rm', and 'rn' requests to create an
alias of, remove, and rename a macro, respectively.
Macro identifiers share their name space with requests, strings, and
diversions; see *note Identifiers::. The 'am', 'as', 'da', 'de', 'di',
and 'ds' requests (together with their variants) create a new object
only if the name of the macro, diversion, or string is currently
undefined or if it is defined as a request; normally, they modify the
value of an existing object. *Note the description of the 'als'
request: als, for pitfalls when redefining a macro that is aliased.
-- Request: .return [input]
Stop interpreting an interpolated macro, skipping to the end of its
definition. Do not confuse 'return' with 'rt'. If called with an
argument INPUT, GNU 'troff' performs the skip twice--once within
the macro being interpreted and once in an enclosing macro,
permitting a macro to wrap the request.(4) (*note Writing
Macros-Footnote-4::)
(1) *Note Copy Mode::.
(2) While it is possible to define and call a macro '.', you can't
use it as an end macro: during a macro definition, '..' is never handled
as calling '.', even if '.de NAME .' explicitly precedes it.
(3) Its structure is adapted from, and isomorphic to, part of a
solution by Tadziu Hoffman to the problem of reflowing text multiple
times to find an optimal configuration for it.
(4) as 'trace.tmac' does
5.24.1 Parameters
-----------------
Macro calls and string interpolations optionally accept a list of
arguments; recall *note Calling Macros::. At the time such an
interpolation takes place, these "parameters" can be examined using a
register and a variety of escape sequences starting with '\$'. All such
escape sequences are interpreted even in copy mode, a fact we shall
motivate and explain below (*note Copy Mode::).
-- Register: \n[.$]
The count of parameters available to a macro or string is kept in
this read-only register. The 'shift' request can change its value.
Any individual parameter can be accessed by its position in the list
of arguments to the macro call, numbered from left to right starting at
1, with one of the following escape sequences.
-- Escape sequence: \$n
-- Escape sequence: \$(nn
-- Escape sequence: \$[nnn]
Interpolate the Nth, NNth, or NNNth parameter. The first form
expects only a single digit (1<=N<=9)), the second two digits
(01<=NN<=99)), and the third any positive integer NNN. Macros and
strings accept an unlimited number of parameters. '\$' is
interpreted even in copy mode.(1) (*note Parameters-Footnote-1::)
-- Request: .shift [n]
Shift macro or string parameters N places (by 1 if N omitted):
argument I becomes argument I-N; arguments 1 to N become
unavailable. Shifting by a non-positive amount, or outside of a
macro or string definition, performs no operation. The register
'.$' adjusts its value accordingly.
In practice, parameter interpolations are usually seen prefixed with
an extra escape character. This is because the '\$' family of escape
sequences is interpreted even in copy mode.(2) (*note
Parameters-Footnote-2::)
-- Escape sequence: \$*
-- Escape sequence: \$@
-- Escape sequence: \$^
In some cases it is convenient to interpolate all of the parameters
at once (to pass them to a request, for instance). The '\$*'
escape catenates the parameters, separating them with spaces.
'\$@' is similar, surrounding each parameter with double quotes and
separating them with spaces. If not in compatibility mode, the
interpolation depth of double quotes is preserved (*note Calling
Macros::). '\$^' interpolates all parameters as if they were
arguments to the 'ds' request.
.de foo
. tm $1='\\$1'
. tm $2='\\$2'
. tm $*='\\$*'
. tm $@='\\$@'
. tm $^='\\$^'
..
.foo " This is a "test"
error-> $1=' This is a '
error-> $2='test"'
error-> $*=' This is a test"'
error-> $@='" This is a " "test""'
error-> $^='" This is a "test"'
'\$*' is useful when writing a macro that doesn't need to
distinguish its arguments, or even to not interpret them; examples
include macros that produce diagnostic messages by wrapping the
'tm' or 'ab' requests. Use '\$@' when writing a macro that may
need to shift its parameters and/or wrap a macro or request that
finds the count significant. If in doubt, prefer '\$@' to '\$*'.
An application of '\$^' is seen in 'trace.tmac', which redefines
some requests and macros for debugging purposes.
-- Escape sequence: \$0
Interpolate the name by which the macro being interpreted was
called. The 'als' request can cause a macro to have more than one
name. Applying string interpolation to a macro does not change
this name.
.de foo
. tm \\$0
..
.als bar foo
.
.de aaa
. foo
..
.de bbb
. bar
..
.de ccc
\\*[foo]\\
..
.de ddd
\\*[bar]\\
..
.
.aaa
error-> foo
.bbb
error-> bar
.ccc
error-> ccc
.ddd
error-> ddd
(1) *Note Copy Mode::.
(2) If they were not, parameter interpolations would be similar to
command-line parameters--fixed for the entire duration of a 'roff'
program's run. The advantage of interpolating '\$' escape sequences
even in copy mode is that they can interpolate different contents from
one call to the next, like function parameters in a procedural language.
The additional escape character is the price of this power.
5.24.2 Copy Mode
----------------
GNU 'troff' processes certain requests in "copy mode": it copies
ordinary, special, and indexed characters as-is; interpolates the escape
sequences '\n', '\g', '\$', '\*', '\V', and '\?' normally; discards
comments '\"' and '\#'; interpolates '\a', '\e', and '\t', as the
current leader, escape, or tab character, respectively; represents
'\RET', '\&', '\_', '\|', '\^', '\{', '\}', '\`', '\'', '\-', '\!',
'\c', '\%', '\SPC', '\E', '\)', '\~', and '\:' in an encoded form, and
copies other escape sequences as-is. The term "copy mode" reflects its
most visible application in requests that populate macros and strings,
but other requests also use it when interpreting arguments that can't
meaningfully represent typesetting operations. For example, a font
selection escape sequence has no meaning in a hyphenation pattern file
name ('hpf') or a diagnostic message written to the terminal ('tm').
The complement of copy mode--a 'roff' formatter's behavior when not
defining or appending to a macro, string, or diversion--where all macros
are interpolated, requests invoked, and valid escape sequences processed
immediately upon recognition, can be termed "interpretation mode".
-- Escape sequence: \\
The escape character ('\' by default) when used before itself
"quotes" an escape character for later interpretation in an
enclosing context. Escape character quotation enables you to
control whether the formatter interprets a given '\n', '\g', '\$',
'\*', '\V', or '\?' escape sequence at the time the macro
containing it is defined, or later when the macro is called.(1)
(*note Copy Mode-Footnote-1::)
.nr x 20
.de y
.nr x 10
\&\nx
\&\\nx
..
.y
=> 20 10
You can think of '\\' as a "delayed" backslash; it is the escape
character followed by a backslash from which the escape character
has removed its special meaning. Consequently, '\\' is not best
considered an escape sequence, but a quoted escape character. In
any escape sequence '\X' that GNU 'troff' does not recognize, the
formatter discards the escape character and outputs X. An
unrecognized escape sequence causes a warning in category 'escape',
with two exceptions--'\\' is the first.
-- Escape sequence: \.
'\.' quotes the control character. It is similar to '\\' in that
it isn't a true escape sequence. It is used to permit nested macro
definitions to end without a named macro call to conclude them.
Without a syntax for quoting the control character, this would not
be possible.
.de m1
foo
.
. de m2
bar
\\..
.
..
.m1
.m2
=> foo bar
The first backslash is consumed while the macro is read, and the
second is interpreted when macro 'm1' is called.
Outside of copy mode, 'roff' documents should not use the '\\' or
'\.' character sequences; they serve only to obfuscate the input. Use
'\e' to represent the escape character, '\[rs]' to obtain a backslash
glyph, and '\&' before '.' and ''' where GNU 'troff' expects them as
control characters if you mean to use them literally (recall *note
Requests and Macros::).
Macro definitions can be nested to arbitrary depth. The mechanics of
parsing the escape character have significant consequences for this
practice.
.de M1
\\$1
. de M2
\\\\$1
. de M3
\\\\\\\\$1
\\\\..
. M3 hand.
\\..
. M2 of
..
This understeer is getting
.M1 out
=> This understeer is getting out of hand.
As seen above, the formatter interprets each escape character in
multiple contexts; once, when populating the macro or string, where the
first '\' serves its quotation function\[em]thus only one '\' is stored
in the definition. (Verify this fact with the 'pm' request.) The
formatter interprets the second '\' as an escape character (assuming the
escape character hasn't been changed in the meantime) each time it
interpolates the macro or string definition. This fact leads to
exponential growth in the quantity of escape characters required to
quote and thereby delay interpolation of '\n', '\g', '\$', '\*', '\V',
and '\?' at each nesting level, which can be daunting. GNU 'troff'
offers a solution.
-- Escape sequence: \E
'\E' represents an escape character that is not interpreted in copy
mode. You can use it to ease the writing of nested macro
definitions.
.de M1
. nop \E$1
. de M2
. nop \E$1
. de M3
. nop \E$1
\\\\..
. M3 better.
\\..
. M2 bit
..
This vehicle handles
.M1 a
=> This vehicle handles a bit better.
Observe that because '\.' is not a true escape sequence, we can't
use '\E' to keep '..' from ending a macro definition prematurely.
If the multiplicity of backslashes complicates maintenance, use end
macros.
'\E' is also convenient to define strings containing escape
sequences that need to work when used in copy mode (for example, as
macro arguments), or which will be interpolated at varying macro
nesting depths. We might define strings to begin and end
superscripting as follows.(2) (*note Copy Mode-Footnote-2::)
.ds { \v'-.9m\s'\En[.s]*7u/10u'+.7m'
.ds } \v'-.7m\s0+.9m'
When the 'ec' request is used to redefine the escape character,
'\E' also makes it easier to distinguish the semantics of an escape
character from the other meaning(s) its character might have.
Consider the use of an unusual escape character, '-'.
.nr a 1
.ec -
.de xx
--na
..
.xx
=> -na
This result may surprise you; some people expect '1' to be output
since register 'a' has clearly been defined with that value. What
has happened? The robotic replacement of '\' with '-' has led us
astray. You might recognize the sequence '--' more readily with
the default escape character as '\-', the special character escape
sequence for the minus sign glyph.
.nr a 1
.ec -
.de xx
-Ena
..
.xx
=> 1
(1) Compare this to the '\def' and '\edef' commands in TeX.
(2) These are lightly adapted from the 'groff' implementation of the
'ms' macros.
5.25 Page Motions
=================
*Note Manipulating Spacing::, for a discussion of the most commonly used
request for vertical motion, 'sp'.
-- Request: .mk [reg]
-- Request: .rt [dist]
You can "mark" a location on a page for subsequent "return". 'mk'
takes an argument, a register name in which to store the current
page location. If given no argument, it stores the location in an
internal register. This location can be used later by the 'rt' or
the 'sp' requests (or the '\v' escape sequence).
The 'rt' request returns _upward_ to the location marked with the
last 'mk' request. If used with an argument, it returns to a
vertical position DIST from the top of the page (no previous call
to 'mk' is necessary in this case). The default scaling unit is
'v'.
If a page break occurs between a 'mk' request and its matching 'rt'
request, the 'rt' request is silently ignored.
A simple implementation of a macro to set text in two columns
follows. This example also defines a macro to be called when a
trap is sprung;(1) (*note Page Motions-Footnote-1::) this trap
macro performs the motion to the next column.
.nr column-length 1.5i
.nr column-gap 4m
.nr bottom-margin 1m
.
.de 2c
. br
. mk
. ll \\n[column-length]u
. wh -\\n[bottom-margin]u 2c-trap
. nr right-side 0
..
.
.de 2c-trap
. ie \\n[right-side] \{\
. nr right-side 0
. po -(\\n[column-length]u + \\n[column-gap]u)
. \" remove trap
. wh -\\n[bottom-margin]u
. \}
. el \{\
. \" switch to right side
. nr right-side 1
. po +(\\n[column-length]u + \\n[column-gap]u)
. rt
. \}
..
Now let us apply our two-column macro.
.pl 1.5i
.ll 4i
This is a small test that shows how the
rt request works in combination with mk.
.2c
Starting here, text is typeset in two columns.
Note that this implementation isn't robust
and thus not suited for a real two-column
macro.
=> This is a small test that shows how the
=> rt request works in combination with mk.
=>
=> Starting here, isn't robust
=> text is typeset and thus not
=> in two columns. suited for a
=> Note that this real two-column
=> implementation macro.
Several escape sequences enable fine control of movement about the
page.
-- Escape sequence: \v'''expr'''
Vertically move the drawing position. EXPR indicates the magnitude
of motion: positive is downward and and negative upward. The
default scaling unit is 'v'. The motion is relative to the current
drawing position unless EXPR begins with the boundary-relative
measurement operator '|'. *Note Numeric Expressions::.
Text processing continues at the new drawing position; usually,
vertical motions should be in balanced pairs to avoid a confusing
page layout.
'\v' does not spring a vertical position trap. This can be useful;
for example, consider a page bottom trap macro that prints a mark
in the margin to indicate continuation of a footnote. *Note
Traps::.
A few escape sequences that produce vertical motion are unusual.
They are thought to originate early in AT&T 'nroff' history to achieve
super- and subscripting by half-line motions on line printers and
teletypewriters before the phototypesetter made more precise positioning
available. They are reckoned in ems--not vees--to maintain continuity
with their original purpose of moving relative to the size of the type
rather than the distance between text baselines (vees).(2) (*note Page
Motions-Footnote-2::)
-- Escape sequence: \r
-- Escape sequence: \u
-- Escape sequence: \d
Move upward 1m, upward .5m, and downward .5m, respectively.
Let us see these escape sequences in use.
Obtain 100 cm\u3\d of \ka\d\092\h'|\nau'\r233\dU.
In the foregoing we have paired '\u' and '\d' to typeset a
superscript, and later a full em negative ("reverse") motion to place a
superscript above a subscript. A numeral-width horizontal motion escape
sequence aligns the proton and nucleon numbers, while '\k' marks a
horizontal position to which '\h' returns so that we could stack them.
(We shall discuss these horizontal motion escape sequences presently.)
In serious applications, we often want to alter the type size of the
-scripts and to fine-tune the vertical motions, as the 'groff' 'ms'
package does with its super- and subscripting string definitions.
-- Escape sequence: \h'''expr'''
Horizontally move the drawing position. EXPR indicates the
magnitude of motion: positive is rightward and negative leftward.
The default scaling unit is 'm'. The motion is relative to the
current drawing position unless EXPR begins with the
boundary-relative measurement operator '|'. *Note Numeric
Expressions::.
The following string definition sets the TeX logo. Recall *note
Strings:: regarding the trailing '\"'.
.ds TeX T\h'-.1667m'\v'.224m'E\v'-.224m'\h'-.125m'X\"
An input backspace becomes a negative horizontal motion of one word
space; recall *note Manipulating Filling and Adjustment::. This feature
persists for backward compatibility with early formatters that predate
'nroff' and even Unix itself, and which used it to facilitate
user-directed overstriking for character composition, boldfacing, and
underlining. GNU 'troff' has explicit features to support each of
these; use them instead.
Several escape sequences support special cases of horizontal motion.
-- Escape sequence: \
Move right one word space. (The input is a backslash followed by a
space.) This escape sequence can be thought of as a
non-adjustable, unbreakable space. Usually you want '\~' instead;
see *note Manipulating Filling and Adjustment::.
-- Escape sequence: \|
Move one-sixth em to the right on typesetting output devices. If a
glyph named '\|' is defined in the current font, its width is used
instead, even on terminal output devices.
-- Escape sequence: \^
Move one-twelfth em to the right on typesetting output devices. If
a glyph named '\^' is defined in the current font, its width is
used instead, even on terminal output devices.
-- Escape sequence: \0
Move right by the width of a numeral in the current font.
Horizontal motions are not discarded at the end of an output line as
word spaces are; recall *note Breaking::.
-- Escape sequence: \w'''input'''
-- Register: \n[st]
-- Register: \n[sb]
-- Register: \n[rst]
-- Register: \n[rsb]
-- Register: \n[ct]
-- Register: \n[ssc]
-- Register: \n[skw]
Interpolate the width of INPUT, as interpreted, in basic units.
This escape sequence allows several properties of formatted output
to be measured without writing it out.
The length of the string 'abc' is \w'abc'u.
=> The length of the string 'abc' is 72u.
The formatter processes INPUT in a dummy environment: this means
that font and type size changes, for example, may occur within it
without affecting subsequent output.
After each use, '\w' sets several registers.
'st'
'sb'
The maximum vertical displacements of the text baseline above
and below, respectively. The sign convention is opposite that
of relative vertical motions; that is, depth below the
(original) baseline is negative. These registers are
incorrectly documented in the AT&T 'troff' manual as "the
highest and lowest extent of [the argument to '\w'] relative
to the baseline".
'rst'
'rsb'
Like 'st' and 'sb', but taking account of the heights and
depths of glyphs. In other words, these registers store the
highest and lowest vertical positions attained by INPUT, doing
what AT&T 'troff' documented 'st' and 'sb' as doing.
'ct'
Characterizes the geometry of glyphs occurring in INPUT.
0
only short glyphs, no descenders or tall glyphs
1
at least one descender
2
at least one tall glyph
3
at least one each of a descender and a tall glyph
'ssc'
The amount of horizontal space (possibly negative) that should
be added to the last glyph before a subscript.
'skw'
How far to right of the center of the last glyph in the '\w'
argument, the center of an accent from a roman font should be
placed over that glyph.
-- Escape sequence: \kp
-- Escape sequence: \k(ps
-- Escape sequence: \k[position]
Store the horizontal drawing position, relative to that
corresponding to the start of the input line (ignoring page offset
and indentation), in a register with the name POSITION
(one-character name P, two-character name PS). Use this, for
example, to later move to the beginning of a word for highlighting
or other decoration.
-- Register: \n[hp]
The horizontal position relative to that at the start of the input
line.
-- Register: \n[.k]
A read-only register containing the current horizontal output
position (relative to the current indentation).
-- Escape sequence: \o'''abc...'''
Overstrike the glyphs of characters A, B, C, ...; the glyphs are
centered, written, and the drawing position advanced by the widest
of the glyphs.
-- Escape sequence: \zc
Format the character C with zero width; that is, without advancing
the drawing position. Use '\z' to overstrike glyphs aligned to
their left edges, in contrast to '\o''s centering.
-- Escape sequence: \Z'''input
Save the drawing position, format INPUT, then restore it. GNU
'troff' ignores tabs and leaders in INPUT with an error diagnostic.
We might implement a strike-through macro thus.
.de strikeout
.nr width \w'\\$1'
\Z@\v'-.25m'\l'\\n[width]u'@\\$1
..
.
This is
.strikeout "a test"
an actual emergency!
(1) *Note Page Location Traps::.
(2) At the 'grops' defaults of 10-point type on 12-point vertical
spacing, the difference between half a vee and half an em can be subtle:
large spacings like '.vs .5i' make it obvious.
5.26 Output Line Annotation
===========================
After an output line is broken (and adjusted, if applicable), it can be
annotated in the margins. You can indicate line numbers on the left,
and apply a margin character on the right.
-- Request: .nm [start [increment [space [indentation]]]]
-- Register: \n[ln]
-- Register: \n[.nm]
Begin (or, with no arguments, cease) numbering output lines. START
assigns the number of the _next_ output line. Only line numbers
divisible by INCREMENT (default: '1') bear marks. The formatter
reckons the third and fourth arguments in numeral widths ('\0'):
SPACE configures the horizontal spacing between the number and the
text (default: '1'). Any given INDENTATION applies to the numbers
(default: '0'). START must be non-negative and INCREMENT positive.
The formatter aligns the number to the right in a space of three
numeral widths plus INDENTATION, then catenates SPACE and the
output line. The line length is _not_ reduced. Depending on the
value of the page offset (recall *note Line Layout::) numbers wider
than the allocated space protrude into the left margin, or shift
the output line to the right.
Line numbering parameters corresponding to missing arguments are
not altered. After numbering is disabled, '.nm +0' resumes it
using the previously active parameters.
The parameters of 'nm' are associated with the environment (*note
Environments::).
While numbering is enabled, the output line number register 'ln' 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
INCREMENT) or because numbering is suppressed (see the 'nn' request
below).
The '.nm' register tracks the enablement status of numbering.
Temporary suspension of numbering with the 'nn' request does _not_
alter its value.
.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
-- Request: .nn [skip]
-- Register: \n[.nn]
Suppress numbering of the next SKIP output lines counted by the
'nm' request. If SKIP is '0', cancel suppression. The default
is 1. 'nn' can be invoked when line numbering is not active;
suppression of numbering takes effect for SKIP lines once 'nm'
enables it.
The '.nn' register stores the count of lines remaining in the
environment for which numbering is suppressed while output line
numbering is enabled.
This count is associated with the environment (*note
Environments::).
To test whether the current output line will be numbered, you must
check both the '.nm' and '.nn' registers.
.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.
-- Request: .mc [margin-character [distance]]
Begin (or, with no arguments, cease) writing a "margin-character"
to the right of each output line. The DISTANCE argument separates
MARGIN-CHARACTER 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. No margin
character is written on lines produced by the 'tl' request.
The margin character is a property of the output line. Only one
margin character is in effect at one time; the most recent 'mc'
call determines its value. If the margin character is disabled
before an output line breaks, none is output (but see below).
The margin character is associated with the environment (*note
Environments::).
.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. |
For compatibility with AT&T 'troff', a call to 'mc' to set the margin
character can't be undone immediately; at least one line gets a margin
character.
.ll 10n
.nf
.mc |
.mc *
.mc
foo
bar
=> foo *
=> bar
The margin character mechanism is commonly used to annotate changes
in documents. The 'groff' distribution ships a program, 'gdiffmk', to
assist with this task.(1) (*note Output Line Annotation-Footnote-1::)
(1) Historically, tools named 'nrchbar' and 'changebar' were
developed for marking changes with margin characters and could be found
in archives of the 'comp.sources.unix' Usenet group. Some proprietary
Unices also offer(ed) a 'diffmk' program.
5.27 Drawing Geometric Objects
==============================
A few of the formatter's escape sequences draw lines and other geometric
objects. Combined with each other and with page motion commands (*note
Page Motions::), a wide variety of figures is possible. For complex
drawings, these operations can be cumbersome: the preprocessors 'pic' or
'grn' are typically used instead.
The '\l' and '\L' escape sequences draw horizontal and vertical
sequences of glyphs, respectively. Even the simplest of output devices
supports them. They require an argument specifying the length of the
rule (line) to be drawn, optionally followed by a single ordinary or
special character with which to draw the rule if the default is not
desired. If the character is valid in a numerical expression, put '\&'
after L to disambiguate the input.
-- Escape sequence: \l'''l'''
-- Escape sequence: \l'''lc'''
Draw a horizontal line of length L from the drawing position.
Rightward motion is positive. Afterward, the drawing position is
at the right end of the line. The default scaling unit is 'm'.
The default glyph is the baseline rule special character, '\[ru]'.
\l'4i\&-'
=> ----------------------------------------
Let us see how to draw a box around a word using a macro.
.de textbox
\[br]\\$*\[br]\l'|0\[rn]'\l'|0\[ul]'
..
The foregoing outputs a box rule (a vertical line), the text
argument(s), and another box rule. We employ the boundary-relative
measurement operator '|'. Finally, the line-drawing escape
sequences draw a radical extender (a form of overline) and an
underline from the drawing position to the position corresponding
to beginning of the _input_ line. The formatter leaves the drawing
position at the right-hand box rule even though the line lengths
are negative, as noted above.
-- Escape sequence: \L'''l'''
-- Escape sequence: \L'''lc'''
Draw a vertical line of length L from the drawing position.
Downward motion is positive. The default scaling unit is 'v'. The
default glyph is the box rule, '\[br]'. As with vertical motion
escape sequences, text processing continues where the line ends.
$ nroff < This is a
=> |
=> |
=> |test.
When writing text, the drawing position is at the text baseline;
recall *note Page Geometry::.
The '\D' escape sequence provides "drawing commands" that direct the
output device to render geometrical objects rather than glyphs.
Specific devices may support only a subset, or may feature additional
ones; consult the man page for the output driver in use. Terminals in
particular implement almost none. *Note Graphics Commands::.
Rendering starts at the drawing position; when finished, the drawing
position is left at the rightmost point of the object, even for closed
figures, except where noted. GNU 'troff' draws stroked (outlined)
objects with the stroke color, and shades filled ones with the fill
color. *Note Colors::. Coordinates H and V are horizontal and vertical
motions relative to the drawing position or previous point in the
command. The default scaling unit for horizontal measurements (and
diameters of circles) is 'm'; for vertical ones, 'v'.
Circles, ellipses, and polygons can be drawn filled or stroked.
These are independent properties; if you want a filled, stroked figure,
you must draw the same figure twice using each drawing command. A
filled figure is always smaller than an outlined one because the former
is drawn only within its defined area, whereas strokes have a line
thickness (set with '\D't'').
\h'1i'\v'1i'\
\# increase line thickness
\Z'\D't 5p''\
\# draw stroked (unfilled) polygon
\Z'\D'p 3 3 -6 0''\
\# draw filled (solid) polygon
\Z'\D'P 3 3 -6 0''
-- Escape sequence: \D'''command argument ...'''
Drawing command escape sequence parameters begin with an ordinary
character, COMMAND, selecting the type of object to be drawn,
followed by ARGUMENTs whose meaning is determined by COMMAND.
'\D'~ H1 V1 ... HN VN''
Draw a B-spline to each point in sequence, leaving the drawing
position at (HN, VN).
'\D'a HC VC H V''
Draw a circular arc centered at (HC, VC) counterclockwise from
the drawing position to a point (H, V) relative to the center.
(1) (*note Drawing Geometric Objects-Footnote-1::)
'\D'c D''
Draw a circle of diameter D with its leftmost point at the
drawing position.
'\D'C D''
As '\D'C ...'', but the circle is filled.
'\D'e H V''
Draw an ellipse of width H and height V with its leftmost
point at the drawing position.
'\D'E X Y''
As '\D'e ...'', but the ellipse is filled.
'\D'l DX DY''
Draw line from the drawing position to (H, V).
The following is a macro for drawing a box around a text
argument; for simplicity, the box margin is a fixed at 0.2m.
.de TEXTBOX
. nr @wd \w'\\$1'
\h'.2m'\
\h'-.2m'\v'(.2m - \\n[rsb]u)'\
\D'l 0 -(\\n[rst]u - \\n[rsb]u + .4m)'\
\D'l (\\n[@wd]u + .4m) 0'\
\D'l 0 (\\n[rst]u - \\n[rsb]u + .4m)'\
\D'l -(\\n[@wd]u + .4m) 0'\
\h'.2m'\v'-(.2m - \\n[rsb]u)'\
\\$1\
\h'.2m'
..
The argument is measured with the '\w' escape sequence. Its
width is stored in register '@wd'. '\w' also sets the
registers 'rst' and 'rsb'; these contain its maximum vertical
extents of the argument. Then, four lines are drawn to form a
box, offset by the box margin.
'\D'p H1 V1 ... HN VN''
Draw polygon with vertices at the drawing position and each
point in sequence. GNU 'troff' closes the polygon by drawing
a line from (HN, VN) back to the initial drawing position.
Afterward, the drawing position is left at (HN, VN).
'\D'P DX1 DY1 DX2 DY2 ...''
As '\D'P ...'', but the polygon is filled. 'groff' does not
specify how the output device must fill concave or
self-intersecting polygons.
The following macro is like the '\D'l'' example, but shades
the box. We draw the box before writing the text because
colors in GNU 'troff' have no transparency; in the opposite
order, the filled polygon would occlude the text.
.de TEXTBOX
. nr @wd \w'\\$1'
\h'.2m'\
\h'-.2m'\v'(.2m - \\n[rsb]u)'\
\M[lightcyan]\
\D'P 0 -(\\n[rst]u - \\n[rsb]u + .4m) \
(\\n[@wd]u + .4m) 0 \
0 (\\n[rst]u - \\n[rsb]u + .4m) \
-(\\n[@wd]u + .4m) 0'\
\h'.2m'\v'-(.2m - \\n[rsb]u)'\
\M[]\
\\$1\
\h'.2m'
..
'\D't N''
Set the stroke thickness of geometric objects to N basic
units. A zero N selects the minimum supported thickness. A
negative N selects a thickness proportional to the type size;
this is the default.
In a hazy penumbra between text rendering and drawing commands we
locate the bracket-building escape sequence, '\b'. It can assemble
glyphs that appear large by vertically stacking ordinary ones.
-- Escape sequence: \b'''contents'''
Pile and center a sequence of glyphs vertically on the output line.
"Piling" stacks glyphs corresponding to each character in CONTENTS,
read from left to right, and placed from top to bottom. GNU
'troff' separates the glyphs vertically by 1m, and the pile itself
is centered 0.5m above the text baseline. The horizontal drawing
position is then advanced by the width of the widest glyph in the
pile.
This rather inflexible positioning algorithm doesn't work with the
'dvi' output device since its bracket pieces vary in height.
Instead, use the 'eqn' preprocessor.
*note Manipulating Spacing:: describes how to adjust the vertical
spacing of the output line with the '\x' escape sequence.
The application of '\b' that lends its name is construction of
brackets, braces, and parentheses when typesetting mathematics. We
might construct a large opening (left) brace as follows.
\b'\[lt]\[bv]\[lk]\[bv]\[lb]'
See 'groff_char(7)' for a list of special character identifiers.
(1) (HC, VC) is adjusted to the point nearest the perpendicular
bisector of the arc's chord.
5.28 Deferring Output
=====================
A few 'roff' language elements are generally not used in simple
documents, but arise as page layouts become more sophisticated and
demanding. "Environments" collect formatting parameters like line
length and typeface. A "diversion" stores formatted output for later
use. A "trap" is a condition on the input or output, tested
automatically by the formatter, that is associated with a macro:
fulfilling the condition "springs" the trap--calls the macro.
Footnote support often exercises all three of the foregoing features.
A simple implementation might work as follows. The author writes a pair
of macros: one starts a footnote and the other ends it. They further
set a trap a small distance above the page bottom, reserving a footnote
area. The author calls the first macro where a footnote mark is
desired. The macro establishes a diversion so that the footnote text is
collected at the place in the body text where its corresponding mark
appears. It further creates an environment for the footnote so that it
sets using a smaller typeface. The footnote text is formatted in the
diversion using that environment but it does not yet appear in the
output. The document author calls the footnote end macro, which returns
to the previous environment and ends the diversion. Later, after body
text nearly fills the page, the trap springs. The macro called by the
trap draws a line across the page and emits the stored diversion by
calling it like a macro. Thus, the footnote renders.
Diversions and traps make the text formatting process non-linear.
Let us imagine a set of text lines or paragraphs labelled 'A', 'B', and
so on. If we set up a trap that produces text 'T' (as a page footer,
say), and we also use a diversion to store the formatted text 'D', then
a document with input text in the order 'A B C D E F' might render as 'A
B C E T F'. The diversion 'D' is never output if we do not call it.
Environments of themselves are not a source of non-linearity in
document formatting: environment switches have immediate effect. One
could always write a macro to change as many formatting parameters as
desired with a single convenient call. But because diversions can be
nested and macros called by traps that are sprung by other trap-called
macros, they may be interpolated in varying contexts. For example,
consider a page header that is always to be set in Helvetica. A
document that uses Times for most of its body text, but Courier for
displayed code examples, poses a challenge if a page break occurs in the
middle of a code display; if the header trap assumes that the "previous
font" is always Times, the rest of the example will be formatted in the
wrong typeface. One could carefully save all formatting parameters upon
entering the trap and restore them upon leaving it, but this is verbose,
error-prone, and not future-proof as the 'groff' language develops.
Environments save us considerable effort.
5.29 Traps
==========
"Traps" are locations in the output, or conditions on the input that,
when reached or fulfilled, call a specified macro. These traps can
occur at a given location either on the page or in the current diversion
(together, these are known as vertical position traps), at a blank line,
at a line with leading space characters, after a quantity of input
lines, or at the end of input. Setting a trap is also called "planting"
one. It is said that a trap is "sprung" if its condition is fulfilled.
The formatter passes no arguments to macros called by traps.
5.29.1 Vertical Position Traps
------------------------------
A "vertical position trap" calls a macro when the formatter's vertical
drawing position reaches or passes, in the downward direction, a certain
location on the output page or in a diversion. Its applications include
setting page headers and footers, body text in multiple columns, and
footnotes.
-- Request: .vpt [b]
-- Register: \n[.vpt]
Enable or disable vertical position traps per Boolean expression B.
They are enabled by default, and if B is omitted. Vertical
position traps are those set by the 'wh' request or by 'dt' within
a diversion. Vertical position trap enablement is global. Its
status is stored in the '.vpt' read-only register.
A page can't be ejected if vertical position traps are disabled.(1)
(*note Vertical Position Traps-Footnote-1::)
(1) *Note The Implicit Page Trap::.
5.29.1.1 Page Location Traps
............................
A "page location trap" is a vertical position trap that applies to the
page; that is, to the top-level diversion. Many can be present; manage
them with the 'wh' and 'ch' requests.
-- Request: .wh dist [name]
Plant macro NAME as page location trap at DIST. The default
scaling unit is 'v'. Non-negative values for DIST set the trap
relative to the top of the page; negative values set the trap
relative to the bottom of the page. It is not possible to plant a
trap less than one basic unit from the page bottom: the formatter
interprets a DIST of '-0' as '0', the top of the page. 'wh'
removes any existing _visible_ trap (see below) at DIST is removed;
this is its sole function if NAME is missing.
A trap springs only if it is "visible", meaning that its location
is reachable on the page(1) (*note Page Location
Traps-Footnote-1::) and it is not hidden by another trap at the
same location already planted there.
A macro package might set headers and footers as follows; this
example configures vertical margins of one inch to the body text,
and one half-inch to the titles. Observe the use of the no-break
control character with the 'sp' and 'bp' requests to position our
text baselines and prevent a partially collected line from being
written outside the body text, and the page number character '%'
used with the 'tl' request.
.\" hdfo.roff
.de hd \" page header
' sp .5i
. tl '\\*(Ti''\\*(Da' \" title and date strings
' sp |1i
..
.de fo \" page footer
' sp .5i-1v
. tl ''%''
' bp
..
.wh 0 hd \" trap at top of the page
.wh -1i fo \" trap 1 inch from bottom
*Caution:* A word about measurements is in order. Recall that the
'sp' request vertically spaces such that the next text baseline (of
one vee in height by definition) sets with the amount of space
given to 'sp''s argument _above_ it. Thus in the example above,
when the 'hd' trap springs at vertical position '0', invoking 'sp
.5i', we get the desired half-inch of top margin. With the 'ft'
trap, we space after the body text by one half-inch _minus one vee_
to leave a half-inch bottom margin. The footer title, if taller
than a baseline rule, thus "encroaches" into the half-inch margin
between the body text and the bottom margin, just as the header
title symmetrically intrudes into the half-inch of space between
its own cap-height and that of the top of the body text.
To use these traps, copy the above (or load it from a file with the
'so' or 'mso' requests), then set up the strings it uses.
.so hdfo.roff
.ds Ti Final Report\"
.ds Da 21 May 2023\"
.ti
On 5 August of last year,
this committee tasked me with the investigation of the
CFIT (controlled flight into terrain) incident of
.\" ...and so on...
A trap above the top or at or below the bottom of the page can be
made visible by either moving it into the page area or increasing
the page length so that the trap is on the page. A negative trap
value always uses the _current_ page length; the formatter does not
convert it to an absolute vertical position. We can use the 'pwh'
request to dump page location traps to the standard error stream
(*note Debugging::). GNU 'troff' reports their positions in basic
units, and includes empty slots in the list, where a trap had been
planted but subsequently (re)moved, because they can affect the
visibility of subsequently planted traps. An 'nroff' device
example follows.
.pl 5i
.wh -1i xx
.pwh
error-> xx -240
.pl 100i
.pwh
error-> xx -240
It is possible to have more than one trap at the same location
(although only one at a time can be visible); to achieve this, the
traps must be defined at different locations, then moved to the
same place with the 'ch' request. In the following example, the
many empty lines caused by the 'bp' request are not shown in the
output.
.de a
. nop a
..
.de b
. nop b
..
.de c
. nop c
..
.
.wh 1i a
.wh 2i b
.wh 3i c
.bp
=> a b c
.ch b 1i
.ch c 1i
.bp
=> a
.ch a 0.5i
.bp
=> a b
-- Register: \n[.t]
The read-only register '.t' holds the distance to the next vertical
position trap. If no such traps exist between the drawing position
and the bottom of the page, it contains the distance to the page
bottom. Within a diversion, in the absence of a diversion trap,
this distance is the maximum possible vertical position supported
by the output device.
-- Request: .ch name [dist]
Change the location of a trap by moving macro NAME to new location
DIST, or by unplanting it altogether if DIST is absent. The
default scaling unit is 'v'. Parameters to 'ch' are specified in
the opposite order from 'wh'. If NAME is the earliest planted
macro of multiple traps at the same location, (re)moving it from
that location exposes the macro next least recently planted at the
same place.(2) (*note Page Location Traps-Footnote-2::)
Changing a trap's location is useful for building up footnotes in a
diversion to allow more space at the bottom of the page for them.
The same macro can be installed simultaneously at multiple locations;
however, only the earliest-planted instance--that has not yet been
deleted with 'wh'--will be moved by 'ch'. The following example (using
an 'nroff' device) illustrates this behavior. Blank lines have been
elided from the output.
.de T
Trap sprung at \\n(nlu.
.br
..
.wh 1i T
.wh 2i T
foo
.sp 11i
.bp
.ch T 4i
bar
.sp 11i
.bp
.ch T 5i
baz
.sp 11i
.bp
.wh 5i
.ch T 6i
qux
.sp 11i
=> foo
=> Trap sprung at 240u.
=> Trap sprung at 480u.
=> bar
=> Trap sprung at 480u.
=> Trap sprung at 960u.
=> baz
=> Trap sprung at 480u.
=> Trap sprung at 1200u.
=> qux
=> Trap sprung at 1440u.
-- Register: \n[.ne]
The read-only register '.ne' contains the amount of space that was
needed in the last 'ne' request that caused a trap to be sprung; it
is useful in conjunction with the '.trunc' register. *Note Page
Control::. Since the '.ne' register is set only by traps, it
doesn't make sense to interpolate it outside of macros called by
traps.
-- Register: \n[.trunc]
A read-only register containing the amount of vertical space
truncated from an 'sp' request by the most recently sprung vertical
position trap, or, if the trap was sprung by an 'ne' request, minus
the amount of vertical motion produced by the 'ne' request. In
other words, at the point a trap is sprung, it represents the
difference of what the vertical position would have been but for
the trap, and what the vertical position actually is. Since the
'.trunc' register is set only by traps, it doesn't make sense to
interpolate it outside of macros called by traps.
-- Register: \n[.trap]
This read-only, string-valued register interpolates the name of the
next vertical position trap that will be sprung.
-- Register: \n[.pe]
This Boolean-valued, read-only register interpolates 1 while a page
is being ejected, and 0 otherwise.
In the following example, we plant the same trap at the top and the
bottom of the page. We also make the trap report its name and the
vertical drawing position.
.de T
.tm \\$0: page \\n%, nl=\\n[nl] .pe=\\n[.pe]
..
.ll 46n
.wh 0 T
.wh -1v T
Those who can make you believe absurdities can make you
commit atrocities. \[em] Voltaire
error-> T: page 1, nl=0 .pe=0
error-> T: page 1, nl=2600 .pe=1
=> Those who can make you believe absurdities can
=> make you commit atrocities. -- Voltaire
When designing macros, keep in mind that diversions and traps do not
normally interact. For example, if a trap calls a header macro (while
outputting a diversion) that tries to change the font on the current
page, the effect is not visible before the diversion has completely been
printed (except for input protected with '\!' or '\?') since the data in
the diversion is already formatted. In most cases, this is not the
expected behaviour.
(1) A trap planted at '20i' or '-30i' cannot spring on a page of
length '11i'.
(2) It may help to think of each trap location as maintaining a
queue; 'wh' operates on the head of the queue, and 'ch' operates on its
tail. Only the trap at the head of the queue is visible.
5.29.1.2 The Implicit Page Trap
...............................
If, after starting GNU 'troff' without loading a macro package, you use
the 'pwh' request to dump a list of the active traps to the standard
error stream,(1) (*note The Implicit Page Trap-Footnote-1::) nothing is
reported. Yet the '.t' register will report a steadily decreasing value
with every output line your document produces, and once the value of
'.t' gets to within '.V' of zero, you will notice that something
trap-like happens--the page is ejected, a new one begins, and the value
of '.t' becomes large once more.
This "implicit page trap" always exists in the top-level
diversion;(2) (*note The Implicit Page Trap-Footnote-2::) its purpose is
to eject the current page and start the next one. It works like a trap
in some ways but not others. It has no name, so it cannot be moved or
deleted with 'wh' or 'ch' requests. You cannot hide it by placing
another trap at its location, and can move it only by redefining the
page length with 'pl'. Its operation is suppressed when vertical page
traps are disabled with GNU 'troff''s 'vpt' request.
(1) *Note Debugging::.
(2) *Note Diversions::.
5.29.1.3 Diversion Traps
........................
A diversion is not formatted in the context of a page, so it lacks page
location traps; instead it can have a "diversion trap". There can exist
at most one such vertical position trap per diversion.
-- Request: .dt [dist name]
Set a trap _within_ a diversion at location DIST, which is
interpreted relative to diversion rather than page boundaries. If
invoked with fewer than two arguments, any diversion trap in the
current diversion is removed. The register '.t' works within
diversions. It is an error to invoke 'dt' in the top-level
diversion. *Note Diversions::.
5.29.2 Input Line Traps
-----------------------
-- Request: .it [n name]
-- Request: .itc [n name]
-- Register: \n[.it]
-- Register: \n[.itc]
-- Register: \n[.itm]
Set an input line trap, calling macro NAME after processing the
next N productive input lines (recall *note Manipulating Filling
and Adjustment::). Any existing input line trap in the environment
is replaced. Without arguments, 'it' and 'itc' clear any input
line trap that has not yet sprung.
Consider a macro '.ST S N' which sets the next N input lines in the
font style S.
.de ST \" Use style $1 for next $2 text lines.
. it \\$2 ES
. ft \\$1
..
.de ES \" end ST
. ft R
..
.ST I 1
oblique
face
.ST I 1
oblique\c
face
=> oblique face obliqueface (second "face" upright)
Unlike the 'ce' and 'rj' requests, 'it' counts lines interrupted
with the '\c' escape sequence separately (*note Line
Continuation::); 'itc' does not. To see the difference, let's
change the previous example to use 'itc' instead.
...
. itc \\$2 ES
...
=> oblique face obliqueface (second "face" oblique)
You can think of the 'ce' and 'rj' requests as implicitly creating
an input line trap with 'itc' that schedules a break when the trap
is sprung.
.de BR
. br
. internal: disable centering-without-filling
..
.
.de ce
. if \\n[.br] .br
. itc \\$1 BR
. internal: enable centering-without-filling
..
The '.it', '.itc', and '.itm' registers report the number of input
lines remaining in a pending input trap, a Boolean indication of
whether that pending input trap honors output line continuation,
and the name of the macro associated with the pending input trap,
respectively. All are read-only; '.itm' is string-valued as well.
Let us consider in more detail the sorts of input lines that are or
are not "productive".
.de Trap
TRAP SPRUNG
..
.de Mac
.if r a \l'5n'
..
.it 2 Trap
.
foo
.Mac
bar
baz
.it 1 Trap
.sp \" moves, but does not write or draw
qux
.itc 1 Trap
\h'5n'\c \" moves, but does not write or draw
jat
When 'Trap' gets called depends on whether the 'a' register is
defined; the control line with the 'if' request may or may not
produce written output. We also see that the spacing request 'sp',
while certainly affecting the output, does not spring the input
line trap. Similarly, the horizontal motion escape sequence '\h'
also affected the output, but was not "written". Observe that we
had to follow it with '\c' and use 'itc' to prevent the newline at
the end of the text line from causing a word break, which, like an
ordinary space character, counts as written output.
$ groff -T ascii input-trap-example.groff
=> foo bar TRAP SPRUNG baz
=>
=> qux TRAP SPRUNG jat TRAP SPRUNG
$ groff -T ascii -r a1 input-trap-example.groff
=> foo _____ TRAP SPRUNG bar baz
=>
=> qux TRAP SPRUNG jat TRAP SPRUNG
Input line traps are associated with the environment (*note
Environments::); switching to another environment suspends the current
input line trap, and going back resumes it, restoring the count of
qualifying lines enumerated in that environment.
5.29.3 Blank Line Traps
-----------------------
-- Request: .blm [name]
Set a blank line trap, calling the macro NAME when GNU 'troff'
encounters a blank line in input, instead of the usual behavior
(*note Breaking::). A line consisting only of spaces is also
treated as blank and subject to this trap. If no argument is
supplied, the default blank line behavior is (re-)established.
5.29.4 Leading Space Traps
--------------------------
-- Request: .lsm [name]
-- Register: \n[lsn]
-- Register: \n[lss]
Set a leading space trap, calling the macro NAME when GNU 'troff'
encounters leading spaces on a text line; the implicit line break
that normally happens in this case is suppressed. The formatter
stores the count of leading spaces on the text line in register
'lsn', and the amount of corresponding horizontal motion in
register 'lss', irrespective of whether a leading space trap is
set. When it is, GNU 'troff' removes the leading spaces from the
input line and produces no motion before calling NAME.
If no argument is supplied, GNU 'troff' reëstablishes the default
handling of leading spaces on text lines (breaking the line when
filling, and formatting a horizontal motion of '\n[lsn]' word
spaces).
5.29.5 End-of-input Traps
-------------------------
-- Request: .em [name]
Set a trap at the end of input, calling macro NAME after the last
line of the last input file has been processed. If no argument is
given, any existing end-of-input trap is removed.
For example, if the document had to have a section at the bottom of
the last page for someone to approve it, the 'em' request could be
used.
.de approval
\c
. ne 3v
. sp (\\n[.t]u - 3v)
. in +4i
. lc _
. br
Approved:\t\a
. sp
Date:\t\t\a
..
.
.em approval
The '\c' in the above example needs explanation. For historical
reasons (compatibility with AT&T 'troff'), the end-of-input macro
exits as soon as it causes a page break if no partially collected
line remains.(1) (*note End-of-input Traps-Footnote-1::)
Let us assume that there is no '\c' in the above 'approval' macro,
that the page is full, and last output line has been broken with,
say, a 'br' request. Because there is no more room, a 'ne' request
at this point causes a page ejection, which in turn makes 'troff'
exit immediately as just described. In most situations, this is
not desired; people generally want to format the input after 'ne'.
To force processing of the whole end-of-input macro independently
of this behavior, it is thus advisable to (invisibly) ensure the
existence of a partially collected line ('\c') whenever there is a
chance that a page break can happen. In the above example,
invoking the 'ne' request ensures that there is room for the
subsequent formatted output on the same page, so we need insert
'\c' only once.
The next example shows how to append three lines, then start a new
page unconditionally. Since '.ne 1' doesn't give the desired
effect--there is always one line available or we are already at the
beginning of the next page--we temporarily increase the page length
by one line so that we can use '.ne 2'.
.de EM
.pl +1v
\c
.ne 2
line one
.br
\c
.ne 2
line two
.br
\c
.ne 2
line three
.br
.pl -1v
\c
'bp
..
.em EM
This specific feature affects only the first potential page break
caused by the end-of-input macro; further page breaks emitted by
the macro are handled normally.
Another possible use of the 'em' request is to make GNU 'troff'
emit a single large page instead of multiple pages. For example,
one may want to produce a long plain text file for reading in a
terminal or emulator without page footers and headers interrupting
the body of the document. One approach is to set the page length
at the beginning of the document to a very large value to hold all
the text and automatically adjust it to the exact height of the
document after the text has been output.
.de adjust-page-length
. br
. pl \\n[nl]u \" \n[nl]: current vertical position
..
.
.de single-page-mode
. pl \n[.R]u
. em adjust-page-length
..
.
.\" Activate the above code if configured.
.if \n[do-continuous-rendering] \
. single-page-mode
Since only one end-of-input trap exists and another macro package
may already use it, care must be taken not to break the mechanism.
A simple solution would be to append the above macro to the macro
package's end-of-input macro using the 'am' request.
(1) While processing an end-of-input macro, the formatter assumes
that the next page break must be the last; it goes into "sudden death
overtime".
5.30 Diversions
===============
In 'roff' systems it is possible to format text as if for output, but
instead of writing it immediately, one can "divert" the formatted text
into a named storage area. It is retrieved later by specifying its name
after a control character. The formatter uses the same name space for
such diversions as for strings and macros; recall *note Identifiers::.
Such text is sometimes said to be "stored in a macro", but this coinage
obscures the important distinction between macros and strings on one
hand and diversions on the other; the former store _unformatted_ input
text, and the latter capture _formatted_ output.(1) (*note
Diversions-Footnote-1::) Diversions also do not interpret arguments.
Applications of diversions include footnotes, tables of contents,
indices, and "keeps" (preventing a page break from occurring at an
inconvenient place by forcing a set of output lines to be set as a
group). For orthogonality it is said that GNU 'troff' populates the
"top-level diversion" if no diversion is active (that is, formatted
output is being "diverted" directly to the output device). The
top-level diversion has no name.
Dereferencing an undefined diversion creates an empty one of that
name.(2) (*note Diversions-Footnote-2::) A diversion does not exist for
the purpose of testing with the 'd' conditional expression operator
until its initial definition ends; recall *note Operators in
Conditionals::. The following requests create and alter diversions.
-- Request: .di [name]
-- Request: .da [name]
Start collecting formatted output in a diversion called NAME. The
'da' request appends to a diversion called NAME, creating it if
necessary. If NAME already exists as an alias, the target of the
alias is replaced or appended to; recall *note Strings::. The
pending output line is diverted as well. Switching to another
environment (with the 'ev' request) before invoking 'di' or 'da'
avoids including any pending output line in the diversion.(3)
(*note Diversions-Footnote-3::)
Invoking 'di' or 'da' without an argument stops diverting output to
the diversion named by the most recent corresponding request.
Invoking 'di' or 'da' without an argument when no diversion is
being populated does nothing.(4) (*note Diversions-Footnote-4::)
.ll 56n
Ahoy, me hearties,
I traveled unto a distant isle,
.br
.di HT
and thereupon I lay a vast treasure,
.br
.di
.HT
.br
which none o' ye shall ever see.
=> Ahoy, mateys, I traveled unto a distant isle,
=> and thereupon I lay a vast treasure,
=> which none o' ye shall ever see.
GNU 'troff' supports "box" requests to exclude a partially collected
line from a diversion, as this is often desirable.
-- Request: .box [name]
-- Request: .boxa [name]
Divert (or append) output to NAME, similarly to the 'di' and 'da'
requests, respectively. Any pending output line is _not_ included
in the diversion. Without an argument, stop diverting output; any
pending output line inside the diversion is discarded.
.ll 56n
Ahoy, mateys,
I traveled unto a distant isle,
.br
.box SECRET
and thereupon I lay a vast treasure,
.br
accurst wi' neutron activation,
.box
.SECRET
.br
which none o' ye shall ever see.
=> Ahoy, mateys, I traveled unto a distant isle,
=> and thereupon I lay a vast treasure,
=> which none o' ye shall ever see.
Apart from pending output line inclusion and the request names that
populate them, boxes are handled exactly as diversions are. All of the
following 'groff' language elements can be used with them
interchangeably.
-- Register: \n[.z]
-- Register: \n[.d]
Diversion requests may be nested. The read-only string-valued
register '.z' contains the name of the current diversion. The
read-only register '.d' contains the vertical drawing position in
the diversion. If the input text is not being diverted, '.d'
reports the same location as the register 'nl'.
.nf
.di A
alpha
.di B
beta
.di
gamma
\*B
.di
delta
\*A
epsilon
=> delta
=> alpha
=> gamma
=> beta
=>
=>
=> epsilon
-- Register: \n[.h]
The read-only register '.h' stores the "high-water mark" on the
current page or in the current diversion. It corresponds to the
text baseline of the lowest line on the page.(5) (*note
Diversions-Footnote-5::)
.tm .h==\n[.h], nl==\n[nl]
=> .h==0, nl==-1
This is a test.
.br
.sp 2
.tm .h==\n[.h], nl==\n[nl]
=> .h==40, nl==120
As implied by the example, vertical motion does not produce text
baselines and thus does not increase the value interpolated by
'\n[.h]'.
-- Register: \n[dn]
-- Register: \n[dl]
After output to a (named) diversion stops, the formatter stores its
vertical and horizontal sizes, to the writable registers 'dn' and
'dl', respectively. Only the lines just processed are counted: for
the computation of 'dn' and 'dl', the requests 'da' and 'boxa' are
handled as if 'di' and 'box' had been used, respectively--lines
that have been already stored in the diversion (box) are not taken
into account.
.\" Center text both horizontally and vertically.
.\" Macro .(c starts centering mode; .)c terminates it.
.
.\" Disable the escape character with .eo so that we
.\" don't have to double backslashes on the "\n"s.
.eo
.de (c
. br
. ev (c
. evc 0
. in 0
. nf
. di @c
..
.de )c
. br
. ev
. di
. nr @s (((\n[.t]u - \n[dn]u) / 2u) - 1v)
. sp \n[@s]u
. ce 1000
. @c
. ce 0
. sp \n[@s]u
. br
. fi
. rr @s
. rm @c
..
.ec
-- Escape sequence: \!character-sequence
-- Escape sequence: \?character-sequence\?
"Transparently" embed CHARACTER-SEQUENCE into the current
diversion, preventing the formatter from interpreting requests,
macro calls, and escape sequences when reading them into a
diversion. Doing so prevents them from taking effect until the
diverted text is actually output. The '\!' escape sequence
transparently embeds input up to and including the end of the line.
The '\?' escape sequence transparently embeds input, read in copy
mode, up to its own next occurrence on the input line. Use '\!' by
itself to embed newlines in a diversion. The two escape sequences
differ in that GNU 'troff' interprets '\?' even in copy mode;
recall *note Copy Mode::. Consequently, comparands protected with
'\?' need not be valid GNU 'troff' syntax.
.nr x 1
.nf
.di d
\?\\?\\\\?\\\\\\\\nx\\\\?\\?\?
.di
.nr x 2
.di e
.d
.di
.nr x 3
.di f
.e
.di
.nr x 4
.f
=> 4
Both escape sequences read the data in copy mode.
If '\!' is used in the top-level diversion, its argument is
embedded into GNU 'troff''s device-independent output. One of its
applications is control of a postprocessor that transforms the data
that are subsequently read by an output driver.
Using the '\?' escape sequence in the top-level diversion produces
no output at all; its argument is simply ignored.
-- Request: .output ['"']character-sequence
Emit CHARACTER-SEQUENCE directly to GNU 'troff''s output; this
usage is similar to that of '\!' when it occurs in the top-level
diversion.
GNU 'troff' removes a leading neutral double quote '"' from
CHARACTER-SEQUENCE, permitting initial embedded spaces in it, and
reads it to the end of the input line in copy mode. Recall *note
Copy Mode::.
*Caution:* Use of these features can put syntactically invalid
content into the formatter's output, which 'groff''s output drivers
then fail to process. One application of 'output' and of '\!' from
the top-level diversion is to pass instructions to a postprocessor
that interprets CHARACTER-SEQUENCE and filters it out before
sending it to the output driver.
-- Request: .asciify div
"Unformat" the diversion DIV in a way such that Unicode basic Latin
(US-ASCII) characters, characters translated with the 'trin'
request, space characters, and some escape sequences that were
formatted and diverted into DIV are treated like ordinary input
characters when DIV is interpolated. Doing so can be useful in
conjunction with the 'writem' request.
When transforming a glyph node back into an input sequence that
demands expression as a special character escape sequence, GNU
'troff' uses the default escape character.
'asciify' can be also used for gross hacks; for example, the
following sets register 'n' to 1.
.tr @.
.di x
@nr n 1
.br
.di
.tr @@
.asciify x
.x
'asciify' cannot return all nodes in a diversion to their source
equivalents: those produced by indexed characters ('\N'), for
example, remain nodes, so the result cannot be guaranteed to be a
character sequence as a macro or string is. Give the diversion
name as an argument to the 'pm' request to inspect its contents and
node list. Glyph parameters such as the type face and size are not
preserved; use 'unformat' to achieve that.
-- Request: .unformat div
Like 'asciify', unformat the diversion DIV. However, 'unformat'
handles only tabs and spaces between words, the latter usually
arising from spaces or newlines in the input. Tabs are treated as
tokens, and spaces become adjustable again. The vertical sizes of
lines are not preserved, but glyph information (font, type size,
space width, and so on) is retained.
(1) *Note GNU troff Internals::.
(2) GNU 'troff' emits a warning in category 'mac'. *Note Warnings::.
(3) *Note Environments::.
(4) GNU 'troff' emits a warning in category 'di'. *Note Warnings::.
(5) Thus, the "water" gets "higher" proceeding _down_ the page.
5.31 Punning Names
==================
Macros, strings, and diversions share a name space; recall *note
Identifiers::. Internally, the same mechanism is used to store them.
You can thus call a macro with string interpolation syntax and vice
versa.
.de subject
Typesetting
..
.de predicate
rewards attention to detail
..
\*[subject] \*[predicate].
Truly.
=> Typesetting
=> rewards attention to detail Truly.
What went wrong? Strings don't contain newlines, but macros do. String
interpolation placed a newline at the end of '\*[subject]', and the next
thing on the input was a space. Then when '\*[predicate]' was
interpolated, it was followed by the empty request '.' on a line by
itself. If we want to use macros as strings, we must take interpolation
behavior into account.
.de subject
Typesetting\\
..
.de predicate
rewards attention to detail\\
..
\*[subject] \*[predicate].
Truly.
=> Typesetting rewards attention to detail. Truly.
By ending each text line of the macros with an escaped , we get the
desired effect; recall *note Line Continuation::.(1) (*note Punning
Names-Footnote-1::) What would have happened if we had used only one
backslash in each case?
Interpolating a string does not hide existing macro arguments. We
can also place the escaped newline outside the string interpolation
instead of within the string definition. Thus, in a macro, a more
efficient way of doing
.xx \\$@
is
\\*[xx]\\
The latter calling syntax doesn't change the value of '\$0', which is
then inherited from the calling macro; recall *note Parameters::.
It is sometimes convenient to copy a single-line diversion to a
string, which can then be interpolated with '\*'.
.di xx
the
.ft I
interpolation system
.ft
.br
.di
.ds yy This is a test of \*(xx\c
\*(yy.
=> This is a test of the interpolation system.
In the foregoing, we see that formatted output can thus be stored in a
string. The '\c' escape sequence prevents the subsequent newline from
being interpreted as a break; again, recall *note Line Continuation::.
Copying multi-output-line diversions produces unexpected results.
.di xxx
a funny
.br
test
.br
.di
.ds yyy This is \*[xxx]\c
\*[yyy].
=> test This is a funny.
Usually, it is not predictable whether a diversion contains one or
more output lines, so this mechanism should be avoided. With AT&T
'troff', this was the only solution to strip off a final newline from a
diversion. Another disadvantage is that the spaces in the copied string
are already formatted, preventing their adjustment. This can cause ugly
results.
A clean solution to this problem is available in GNU 'troff', using
the requests 'chop' to remove the final newline of a diversion, and
'unformat' to make the horizontal spaces adjustable again.
.box xxx
a funny
.br
test
.br
.box
.chop xxx
.unformat xxx
This is \*[xxx].
=> This is a funny test.
*Note GNU troff Internals::.
(1) We must double the backslash. Recall *note Copy Mode::.
5.32 Environments
=================
As discussed in *note Deferring Output::, environments store most of the
parameters that determine the appearance of text. A default environment
named '0' (zero) exists when the formatter starts up; formatting-related
requests and escape sequences modify its properties.
You can create new environments and switch among them. Only one is
current at any given time. Active environments are managed using a
"stack", a data structure supporting "push" and "pop" operations. The
current environment is at the top of the stack. The same environment
name can be pushed onto the stack multiple times, possibly interleaved
with others. Popping the environment stack does not destroy the current
environment; it remains accessible by name and can be made current again
by pushing it at any time. Environments cannot be renamed or deleted,
and can only be modified when current. To inspect the environment
stack, use the 'pev' request.(1) (*note Environments-Footnote-1::)
Environments store the following information.
* a partially collected line, if any
* data about the most recently output glyph and line (registers
'.cdp', '.cht', '.csk', '.n', '.w')
* typeface parameters (size, family, style, height and slant,
inter-word and inter-sentence space sizes)
* page parameters (line length, title length, vertical spacing, line
spacing, indentation, line numbering, centering, right-alignment,
underlining, hyphenation parameters)
* filling enablement; adjustment enablement and mode
* tab stops; tab, leader, escape, control, no-break control,
hyphenation, and margin characters
* input line traps
* stroke and fill colors
-- Request: .ev [ident]
-- Register: \n[.ev]
Enter the environment IDENT, which is created if it does not
already exist, using the same parameters as for the default
environment used at startup. With no argument, GNU 'troff'
switches to the previous environment.
Invoking 'ev' with an argument puts environment IDENT onto the top
of the environment stack. (If it isn't already present in the
stack, this is a proper push.) Without an argument, 'ev' pops the
environment stack, making the previous environment current. It is
an error to pop the environment stack with no previous environment
available. The read-only string-valued register '.ev' contains the
name of the current environment--the one at the top of the stack.
.ev footnote-env
.fam N
.ps 6
.vs 8
.ll -.5i
.ev
...
.ev footnote-env
\[dg] Observe the smaller text and vertical spacing.
.ev
We can familiarize ourselves with stack behavior by wrapping the
'ev' request with a macro that reports the contents of the '.ev'
register to the standard error stream.
.de EV
. ev \\$1
. tm environment is now \\n[.ev]
..
.
.EV foo
.EV bar
.EV
.EV baz
.EV
.EV
.EV
error-> environment is now foo
error-> environment is now bar
error-> environment is now foo
error-> environment is now baz
error-> environment is now foo
error-> environment is now 0
error-> error: environment stack underflow
error-> environment is now 0
-- Request: .evc environment
Copy the properties of ENVIRONMENT to the current environment,
except for:
* a partially collected line, if present;
* the interruption status of the previous input line (due to use
of the '\c' escape sequence);
* the count of remaining lines to center, to right-justify, or
to underline (with or without underlined spaces)--these are
set to zero;
* the activation status of temporary indentation;
* input line traps and their associated data;
* the activation status of line numbering (which can be
reactivated with '.nm +0'); and
* the count of consecutive hyphenated lines (set to zero).
Copying an environment to itself discards the foregoing data.
-- Register: \n[.w]
-- Register: \n[.cht]
-- Register: \n[.cdp]
-- Register: \n[.csk]
The '\n[.w]' register contains the width of the last glyph
formatted in the environment.
The '\n[.cht]' register contains the height of the last glyph
formatted in the environment.
The '\n[.cdp]' register contains the depth of the last glyph
formatted in the environment. It is positive for glyphs extending
below the baseline.
The '\n[.csk]' register contains the "skew" (how far to the right
of the glyph's center that GNU 'troff' should place an accent) of
the last glyph formatted in the environment.
-- Register: \n[.n]
The '\n[.n]' register contains the length of the previous output
line emitted in the environment.
(1) *Note Debugging::.
5.33 Suppressing Output
=======================
-- Escape sequence: \O[num]
Suppress GNU 'troff' output of glyphs and geometric objects. The
sequences '\O2', '\O3', '\O4', and '\O5' are intended for internal
use by 'grohtml'.
'\O0'
Disable the emission of glyphs and geometric objects to the
output driver, provided that this sequence occurs at the
outermost suppression level (see '\O3' and '\04' below).
Horizontal motions corresponding to non-overstruck glyph
widths still occur.
'\O1'
Enable the emission of glyphs and geometric objects to the
output driver, provided that this sequence occurs at the
outermost suppression level.
'\O0' and '\O1' also reset the four registers 'opminx', 'opminy',
'opmaxx', and 'opmaxy' to -1. These four registers mark the top
left and bottom right hand corners of a box encompassing all
written or drawn output.
'\O2'
At the outermost suppression level, enable emission of glyphs
and geometric objects, and write to the standard error stream
the page number and values of the four aforementioned
registers encompassing glyphs written since the last
interpolation of a '\O' sequence, as well as the page offset,
line length, image file name (if any), horizontal and vertical
device motion quanta, and input file name. Numeric values are
in basic units.
'\O3'
Begin a nested suppression level. 'grohtml' uses this
mechanism to create images of output preprocessed with 'pic',
'eqn', and 'tbl'. At startup, GNU 'troff' is at the outermost
suppression level. 'pre-grohtml' generates these sequences
when processing the document, using GNU 'troff' with the 'ps'
output device, Ghostscript, and the PNM tools to produce
images in PNG format. They start a new page if the device is
not 'html' or 'xhtml', to reduce the number of images crossing
a page boundary.
'\O4'
End a nested suppression level.
'\O[5PFILE]'
At the outermost suppression level, write the name 'file' to
the standard error stream at position P, which must be one of
'l', 'r', 'c', or 'i', corresponding to left, right, centered,
and inline alignments within the document, respectively. FILE
is a name associated with the production of the next image.
-- Register: \n[.O]
Output suppression nesting level applied by '\O3' and '\O4' escape
sequences.
5.34 Host System Service Access
===============================
Occasionally a document wants to access the system clock, file storage,
or other services provided by the operating environment.
-- Register: \n[$$]
Process identifier (PID) of the GNU 'troff' program in its
operating environment.
Date- and time-related registers are set per the local time as
determined by 'localtime(3)' when the formatter launches. This
initialization can be influenced by the environment variable 'TZ' or
overridden by 'SOURCE_DATE_EPOCH'; see *note Environment::.
'\n[seconds]'
Count of seconds elapsed in the minute (0-60).
'\n[minutes]'
Count of minutes elapsed in the hour (0-59).
'\n[hours]'
Count of hours elapsed since midnight (0-23).
'\n[dw]'
Day of the week (1-7; 1 is Sunday).
'\n[dy]'
Day of the month (1-31).
'\n[mo]'
Month of the year (1-12).
'\n[year]'
Gregorian year.
'\n[yr]'
Gregorian year minus 1900. This register is incorrectly documented
in the AT&T 'troff' manual as storing the last two digits of the
current year. That claim stopped being true in 2000. Old 'troff'
input that looks like:
'\" The year number is a surprise after 1999.
This document was formatted in 19\n(yr.
can be corrected to:
This document was formatted in \n[year].
or, for portability across many 'roff' programs, to the following.
.nr y4 1900+\n(yr
This document was formatted in \n(y4.
If you wish to embed the date and/or time of a document's formatting
into its output, interpolate these registers into its text. Use the
'af' request to format their values for output.
.af year 0000
.af mo 00
.af dy 00
.af hours 00
.af minutes 00
.af seconds 00
ISO 8601 date stamp:
\n[year]-\n[mo]-\n[dy]T\n[hours]:\n[minutes]:\n[seconds]
=> ISO 8601 date stamp: 2025-12-07T02:17:54
'roff' formatters allow files to be read into the input stream.
Enabling GNU 'troff''s unsafe mode at the command line permits the
writing of files and execution of external commands, with or without
inclusion of their output in the document.
*Caution:* The requests discussed below that accept a file name or
system command as an argument treat the remainder of the input line as
that argument, including any spaces, up to a newline or comment escape
sequence. Suffixing the file name or command with a comment, even an
empty one, prevents unwanted space from creeping into it during source
document maintenance. GNU 'troff' removes a leading neutral double
quote '"' from such an argument, permitting initial embedded spaces in
it, and reads it to the end of the input line in copy mode. Recall
*note Copy Mode::.
-- Request: .so ['"']file
-- Request: .soquiet ['"']file
Replace the request's control line with the contents of FILE,
"sourcing" it. GNU 'troff' searches for FILE in any directories
specified by '-I' command-line options, followed by the current
working directory. If FILE does not exist, the formatter ignores
the request.(1) (*note Host System Service Access-Footnote-1::)
'so' can be useful for large documents, allowing each chapter of a
book, for example, to be maintained in a separate file. However,
files interpolated with 'so' are not preprocessed; to overcome this
limitation, see 'soelim(1)'.
*Caution:* Since the formatter replaces the entire control line
with the contents of a file, FILE must end with a newline, or the
formatter will continue reading the next input line of the 'roff'
file as if it were part of the last line of the sourced file.
Consider a file 'xxx' containing only the word 'foo' without a
trailing newline.
$ printf 'foo' > xxx
$ groff -T ascii < The situation is foobar.
'soquiet' works the same way, except that GNU 'troff' issues no
warning diagnostic if FILE does not exist.
-- Request: .pso ['"']command
Read the standard output from the specified COMMAND when passed to
'popen(3)' and include it in place of the 'pso' request.
It is an error to use this request in safer mode, which is the
default. Invoke GNU 'troff' or a front end with the '-U' option to
enable unsafe mode.
The cautionary note regarding a final newline in the stream read by
the 'so' request applies to 'pso' as well.
-- Request: .mso ['"']file
-- Request: .msoquiet ['"']file
As the 'so' and 'soquiet' requests, respectively, except that GNU
'troff' searches for the specified FILE in the same directories as
macro files; recall 'GROFF_TMAC_PATH' in *note Environment:: and
'-m' in *note Groff Options::.
-- Request: .trf ['"']file
-- Request: .cf ['"']file
Break and copy the contents of FILE as "throughput" to GNU
'troff''s output. Each line of FILE is output as if preceded by
'\!', but is not interpreted by the formatter. If FILE does not
end with a newline, 'trf' appends one. Both requests break the
line before reading FILE, unless invoked with the no-break control
character. If a diversion is in use, GNU 'troff' performs the copy
only when the diversion is emitted.
'cf' copies the contents of FILE completely unprocessed; it is
therefore an error to use this request in safer mode, which is the
default. Invoke GNU 'troff' or a front end with the '-U' option to
enable unsafe mode.
'trf' discards invalid input characters; recall *note Input
Format::.
For 'cf', within a diversion, "completely unprocessed" means that
each line of a file to be inserted is handled as if it were
preceded by '\!\\!'.
*Caution:* Use of these requests can put syntactically invalid
content into the formatter's output, which 'groff''s output drivers
then fail to process. One application is to pass instructions to a
postprocessor that interprets FILE's contents and filters it out
before sending it to the output driver.
To define a macro 'x' containing the contents of file 'f', use
.ev 1
.di x
.trf f
.di
.ev
The calls to 'ev' prevent the partially collected output line from
becoming part of the diversion; recall *note Diversions::.
In AT&T 'troff', 'cf' copies the contents of FILE to the output
immediately even if a diversion is active; this behavior is so
anomalous that it must be considered a bug.
-- Request: .nx [['"']file]
Stop processing the input file. If FILE is specified, read it;
otherwise, read the next pending input file, if any.
-- Request: .rd [prompt [arg1 arg2 ...]]
Read from standard input, and include what is read as though it
were part of the input file. Text is read until a blank line is
encountered.
If standard input is a TTY input device (keyboard), write PROMPT to
standard error, followed by a colon (or send BEL for a beep if no
argument is given).
Arguments after PROMPT are available for the input. For example,
the line
.rd data foo bar
with the input 'This is \$2.' prints
This is bar.
Using the 'nx' and 'rd' requests, it is easy to set up form letters.
The form letter template is constructed like this, putting the following
lines into a file called 'repeat.let':
.ce
\*(td
.sp 2
.nf
.rd
.sp
.rd
.fi
Body of letter.
.bp
.nx repeat.let
When this is run, a file containing the following lines should be
redirected in. Requests included in this file are executed as though
they were part of the form letter. The last block of input is the 'ex'
request, which tells GNU 'troff' to stop processing. If this were not
there, 'troff' would not know when to stop.
Trent A. Fisher
708 NW 19th Av., #202
Portland, OR 97209
Dear Trent,
Len Adollar
4315 Sierra Vista
San Diego, CA 92103
Dear Mr. Adollar,
.ex
-- Request: .pi ['"']command
Use the formatter's device-independent output as the input to the
commands specified in PIPE and emit their output to the standard
output stream instead of the formatter's usual output. The
formatter reads the remainder of the input line into COMMAND and
passes it to 'popen(3)'. The formatter does not capture output
produced by the command(s).
Multiple 'pi' requests construct a multi-stage pipeline in the same
order as the formatter encounters the requests.
.pi foo
.pi bar
is the same as '.pi foo | bar'.
'pi' must be invoked before GNU 'troff' writes any nodes to its
output.(2) (*note Host System Service Access-Footnote-2::) The
formatter reports an error and ignores the request if 'pi' is
invoked "too late". Roughly, this means you should set up your
'pi' pipeline early in a document, before anything but register,
string, and macro definitions (and/or sourcing of files that
comprise these exclusively).
Use of this request in safer mode (GNU 'troff''s default) is
erroneous. Invoke GNU 'troff' or a front end with the '-U' option
to enable unsafe mode.
*Caution:* Use of the 'pi' request can put syntactically invalid
content into the formatter's output, which 'groff''s output drivers
then fail to process. The pipeline you construct is responsible
for maintaining the validity of the input to the output driver.
-- Request: .sy ['"']command
-- Register: \n[systat]
Execute the specified shell command(s). The formatter reads the
remainder of the input line into a buffer and passes it to
'system(3)'. The formatter does not capture the output produced by
the command(s).
It is an error to use this request in safer mode; this is the
default. Give GNU 'troff' or a front end program the '-U'
command-line option to enable unsafe mode.
The writable register 'systat' contains the return value of the
'system(3)' function executed by the most recent 'sy' request.
Real-world (and non-malicious) applications of 'sy' are esoteric;
the request interpolates neither the standard output nor the
standard error streams of COMMAND into the document--worse, AT&T
'troff' afforded no means of verifying that COMMAND operated as
expected. We therefore offer a silly example of its use, making a
document refuse to format if the system user name running the
formatter is 'branden'.(3) (*note Host System Service
Access-Footnote-3::)
.ds user branden\"
.sy test "$(id -un)" = \*[user]
.if \n[systat]=0 .ab formatting refused for \*[user]
Hello, world!
-- Request: .open stream ['"']file
-- Request: .opena stream ['"']file
Open FILE for writing and associate a stream named IDENT with it,
making it available for 'write' requests.
The 'opena' request is like 'open', but appends to FILE if it
already exists instead of overwriting it.
It is an error to use these requests in safer mode; this is the
default. Give GNU 'troff' or a front end program the '-U'
command-line option to enable unsafe mode.
The 'pstream' request dumps the list of open streams to the
standard error stream.(4) (*note Host System Service
Access-Footnote-4::)
-- Request: .write stream ['"']contents
-- Request: .writec stream ['"']contents
Write CONTENTS to STREAM, which must previously have been the
subject of an 'open' (or 'opena') request. GNU 'troff' flushes the
stream after writing to it.
The 'writec' request is like 'write', but only 'write' appends a
newline to CONTENTS.
-- Request: .writem stream name
Write the contents of the macro or string NAME to STREAM, which
must previously have been the subject of an 'open' (or 'opena')
request. GNU 'troff' reads the contents of NAME in copy mode.
That is, it ignores already formatted elements (nodes).
Consequently, diversions must be unformatted with the 'asciify'
request before calling 'writem'. Usually, this means a loss of
information.
-- Request: .close stream
Close the specified STREAM; the stream is no longer an acceptable
argument to the 'write' request.
Here a simple macro to write an index entry.
.open idx test.idx
.
.de IX
. write idx \\n[%] \\$*
..
.
.IX test entry
.
.close idx
-- Escape sequence: \Ve
-- Escape sequence: \V(ev
-- Escape sequence: \V[env]
Interpolate the contents of the system environment variable ENV
(one-character name E, two-character name EV) as returned by
'getenv(3)'. '\V' is interpreted even in copy mode; recall *note
Copy Mode::.
(1) GNU 'troff' emits a warning in category 'file'. *Note
Warnings::.
(2) *Note GNU troff Internals::.
(3) POSIX command environments and 'roff' formatters employ different
integer-to-Boolean interpretation conventions; a POSIX command exits
with a zero status if it succeeds and a positive one if it fails,
whereas a 'roff' register tests "true" if it has a positive value.
(4) *Note Debugging::.
5.35 Postprocessor Access
=========================
Beyond the 'cf' and 'trf' requests (recall *note Host System Service
Access::), two escape sequences and two requests enable documents to
pass information directly to a postprocessor. These are useful for
exercising device-specific capabilities that the 'groff' language does
not abstract or generalize; examples include the embedding of hyperlinks
and image files. Device-specific functions are documented in each
output driver's man page, such as 'gropdf(1)', 'grops(1)', or
'grotty(1)'.
-- Request: .device ['"']character-sequence
-- Escape sequence: \X'''contents ...'''
Embed CHARACTER-SEQUENCE into GNU 'troff' output as parameters to
an 'x X' device extension command.(1) (*note Postprocessor
Access-Footnote-1::) The output driver or other postprocessor
interprets CHARACTER-SEQUENCE as it sees fit.
GNU 'troff' removes a leading neutral double quote '"' from
CONTENTS, permitting initial embedded spaces in it, and reads it to
the end of the input line in copy mode. Recall *note Copy Mode::.
The 'groff' special character repertoire is unknown to output
drivers outside of glyphs named in a device's fonts, and even then
they may not possess complete coverage of the names documented in
the 'groff_char(7)' man page. Further, escape sequences that
produce horizontal or vertical motions, hyphenation breaks, or that
are dummy characters may appear in strings or be converted to
nodes, particularly in diversions.(2) (*note Postprocessor
Access-Footnote-2::) These are not representable when interpolated
directly into device-independent output, as might be done when
writing out tag names for PDF bookmarks, which can appear in a
viewer's navigation pane.
So that documents or macro packages do not have to laboriously
"sanitize" strings destined for interpolation in device extension
commands, the '\X' escape sequence performs certain transformations
on its argument. For these transformations, character translations
and definitions are ignored.
GNU 'troff' converts several ordinary characters that typeset as
non-basic Latin code points to code points outside that range so
that they are used consistently whether they are formatted as
glyphs or used in a device extension command argument. These
ordinary characters are ''', '-', '^', '`', and '~'; others are
written as-is.
Special characters that typeset as Unicode basic Latin characters
are translated to basic Latin characters accordingly. So that any
Unicode code point can be represented in device extension commands,
for example in an author's name in document metadata or as a
usefully named bookmark or hyperlink anchor, GNU 'troff' maps other
special characters to Unicode special character notation. Recall
*note Characters and Glyphs::.
GNU 'troff' does not write special characters without a Unicode
representation and escape sequences that do not interpolate a
sequence of ordinary and/or special characters as arguments to
device extension commands.(3) (*note Postprocessor
Access-Footnote-3::)
GNU 'troff' also permits the interpolation of macro or string
contents as a device extension command.
-- Request: .devicem name
-- Escape sequence: \Yn
-- Escape sequence: \Y(nm
-- Escape sequence: \Y[name]
The 'devicem' request and '\Y' escape sequence correspond to
'.device \*[NAME]' and '\X'\*[NAME]'' (one-character name N,
two-character name NM), respectively. They differ from their
counterparts in that GNU 'troff' does not interpret the contents of
the string or macro NAME; further, NAME may be a macro and thus
contain newlines. (There is no way to embed a newline in the
arguments to 'device' or '\X'.) The inclusion of newlines requires
an extension to the AT&T 'troff' device-independent page
description language, and their presence confuses drivers that do
not know about it.(4) (*note Postprocessor Access-Footnote-4::)
Use of device extension commands early in a document (before the
first text is formatted) can interfere with processing of page location
traps. If you experience problems when placing them early, precede the
first with a dummy character escape sequence '\&'; recall *note Dummy
Characters::.
-- Request: .tag name
-- Request: .taga name
Reserved for internal use.
(1) *Note GNU troff Output::.
(2) *Note GNU troff Internals::.
(3) When encountered, these produce warnings in category 'char'.
*Note Warnings::.
(4) *Note Device Control Commands::.
5.36 Miscellaneous
==================
We document here GNU 'troff' features that fit poorly elsewhere.
-- Request: .psbb file
-- Register: \n[llx]
-- Register: \n[lly]
-- Register: \n[urx]
-- Register: \n[ury]
Retrieve the bounding box of the PostScript image found in FILE,
which must conform to Adobe's "Document Structuring Conventions"
(DSC), locate a '%%BoundingBox' comment, and store the (upper-,
lower-, -left, -right) values into the registers 'llx', 'lly',
'urx', and 'ury'. If an error occurs (for example, if no
'%%BoundingBox' comment is present), the formatter sets these
registers to 0.
Control the search path for FILE with the '-I' command-line option.
5.37 GNU 'troff' Internals
==========================
GNU 'troff' processes input in three steps. It gathers one or more
input characters into a "token",(1) (*note GNU troff
Internals-Footnote-1::) the smallest meaningful unit of 'troff' input.
The process of formatting translates tokens into nodes that populate a
pending output line (recall *note Manipulating Filling and
Adjustment::). A "node" is a data structure representing any object
that may ultimately appear in the output, like a glyph or motion on the
page. When the pending output line breaks, the formatter applies any
relevant adjustment, line number, and margin character, and finally
appends it to the current diversion. Periodically, the formatter
"flushes" accumulated output line(s) to the output device, a process
that translates each node into a device-independent output language
representation understood by all output drivers. Copy mode tokenizes
but does not format; diversions (apart from that at the top level)
format but do not write output.
For example, GNU 'troff' converts the input 'Gi\[:u]\%seppe' into a
character token for 'g', a character token for 'i', a special character
token for ':u' (representing 'u' with an umlaut), a token encoding a
hyphenation break point,(2) (*note GNU troff Internals-Footnote-2::) and
further character tokens. You can observe this process by storing the
foregoing input into a string--which, because its contents are read in
copy mode, is only tokenized, not formatted--and dumping it with the
'pm' request.(3) (*note GNU troff Internals-Footnote-3::) (Using
'printf(1)' requires us to double the '\' and '%' characters.)
$ printf '.ds str Gi\\[:u]\\%%seppe\n.pm str\n' \
| groff 2>&1 | jq
Similarly, we can observe the details of the formatting process by
interpolating the string, or supplying its contents directly as input,
and invoking the 'pline' request.
$ printf 'Gi\\[:u]\\%%seppe\n.pline\n' | groff -z 2>&1 | jq
We now see a list of nodes, including an output line start node,
several glyph nodes, a discretionary break node containing a glyph node
for the special character ':u' _and_ a glyph node for the special
character 'hy' (hyphen), and a word space node at the end corresponding
to the newline at the end of input.(4) (*note GNU troff
Internals-Footnote-4::)
If we change 'G' to 'f', we see that the first two glyph nodes, for
'f' and 'i', become contained by a ligature node (provided the current
font has a glyph for this ligature). All output glyph nodes are
"processed", which means that they are associated with a given font,
type size, advance width, and so forth.
Macros, diversions, and strings collect elements in two chained
lists: a list of tokens that have been passed unprocessed, and a list of
nodes. Consider the following diversion.
.di xxx
a
\!b
c
.br
.di
It contains these elements.
node list token list element number
line start node -- 1
glyph node 'a' -- 2
word space node -- 3
-- 'b' 4
-- '\n' 5
glyph node 'c' -- 6
vertical size node -- 7
vertical size node -- 8
-- '\n' 9
'troff' inserts elements 1, 7, and 8; the latter two (which are always
present) specify the vertical extent of the last line, possibly modified
by '\x'. The 'br' request finishes the pending output line, inserting a
newline token, which is subsequently converted to a space when the
diversion is interpolated. Note that the word space node has a fixed
width that isn't adjustable anymore. To convert horizontal space nodes
back into tokens, use the 'unformat' request.
Macros only contain elements in the token list (and the node list is
empty); diversions and strings can contain elements in both lists.
The 'chop' request simply reduces the number of elements in a macro,
string, or diversion by one. Exceptions are "compatibility save" and
"compatibility ignore" tokens, which are ignored. The 'substring'
request also ignores those tokens.
Some requests like 'tr' or 'cflags' work on glyph identifiers only;
this means that the associated glyph can be changed without destroying
this association. This can be very helpful for substituting glyphs. In
the following example, we assume that glyph 'foo' isn't available by
default, so we provide a substitution using the 'fchar' request and map
it to input character 'x'.
.fchar \[foo] foo
.tr x \[foo]
Now let us assume that we install an additional special font 'bar' that
has glyph 'foo'.
.special bar
.rchar \[foo]
Since glyphs defined with 'fchar' are searched before glyphs in special
fonts, we must call 'rchar' to remove the definition of the fallback
glyph. Anyway, the translation is still active; 'x' now maps to the
real glyph 'foo'.
Macro and request arguments preserve compatibility mode enablement.
.cp 1 \" switch to compatibility mode
.de xx
\\$1
..
.cp 0 \" switch compatibility mode off
.xx caf\['e]
=> café
Since compatibility mode is enabled while 'de' is invoked, the macro
'xx' enables compatibility mode when it is called. Argument '$1' can
still be handled properly because it inherits the compatibility mode
enablement status that was active at the point where 'xx' was called.
After interpolation of the parameters, the compatibility save and
restore tokens are removed.
(1) When not in copy mode, the formatter does not tokenize the escape
sequences '\f', '\F', '\H', '\m', '\M', '\R', '\s', and '\S', but
instead updates the environment.
(2) GNU 'troff' encodes tokens that aren't Unicode Basic Latin
characters as code points in the C0 and C1 control ranges; we plan to
move them to the Unicode Private Use Area (PUA) or to code points
outside the Unicode encoding space in a future release.
(3) Because GNU 'troff''s internals are subject to revision, we do
not show the output of these examples. The names and structures of node
types may change over time. The JSON interpreter 'jq(1)' is not
essential, but can be helpful in understanding the topology of the node
trees populating output lines and diversions in particular.
(4) You may wonder why a glyph node for 'hy' exists when this example
doesn't produce one on the output. That's because the break is
_discretionary_; at the time a word is formatted into nodes, GNU 'troff'
doesn't know where the output line will break. Later, when processesing
a pending output line, GNU 'troff' has that knowledge, and iterates
through the output line's node list, using its discretion to discard
these hyphen glyph nodes everywhere except when hyphenating a word at
the end of the line.
5.38 Debugging
==============
Standard troff voodoo, just put a power of two backslashes in
front of it until it works and if you still have problems add a \c.
-- Ron Natalie
The 'roff' language family is not the easiest to debug, in part
thanks to its design features of recursive interpolation and the use of
multi-stage pipeline processing in the surrounding system. Nevertheless
there exist several features useful for troubleshooting.
Preprocessors use the 'lf' request to preserve the identity of the
line numbers and names of input files. GNU 'troff' emits a variety of
error diagnostics and supports several categories of warning; the output
of each category can be selectively enabled or suppressed. A trace of
the formatter's input processing stack can be emitted when errors or
warnings occur by means of GNU 'troff''s '-b' option, or produced on
demand with the 'backtrace' request. The 'tm' and related requests can
be used to emit customized diagnostic messages or for instrumentation
while troubleshooting. The 'ex' and 'ab' requests cause early
termination with successful and error exit codes respectively, to halt
further processing when continuing would be fruitless. Examine the
state of the formatter with requests that write lists of defined
names--macros, strings, and diversions--colors, composite character
mappings, environments, occupied font mounting positions, font
translations, automatic hyphenation codes and exceptions, registers,
open streams, and page location traps. Requests can also disclose to
the standard error stream the internal properties and representations of
characters and classes, macros (and strings and diversions), and the
list of output nodes corresponding to the pending output line. Recall
*note GNU troff Internals::.
-- Request: .lf input-line-number [['"']file-identifier]
Set the input line number (and, optionally, the file name) the
formatter uses when reporting diagnostics. The argument becomes
the input line number of the _next_ line the formatter reads.
FILE-IDENTIFIER is a sequence of ordinary characters and/or spaces.
GNU 'troff' removes a leading neutral double quote '"' from
FILE-IDENTIFIER, permitting initial embedded spaces in it, and
reads it to the end of the input line in copy mode. Recall *note
Copy Mode::.
'lf''s primary purpose is to aid the debugging of documents that
undergo preprocessing. Programs like 'tbl' that transform input in
their own languages into 'roff' requests use it so that any
diagnostic messages emitted by a subsequent preprocessor or by
'troff' correspond to the source document.
-- Request: .tm terminal-message
-- Request: .tm1 ['"']message
-- Request: .tmc ['"']message
Send TERMINAL-MESSAGE to the standard error stream. The formatter
reads the argument to the end of the input line in copy mode
(recall *note Copy Mode::), but does _not_ remove a leading double
quote; contrast 'tm1'.
'tm1' removes a leading neutral double quote '"' from MESSAGE,
permitting initial embedded spaces in it.
'tmc' works as 'tm1', but does not append a newline.
-- Request: .ab [terminal-message]
Write any TERMINAL-MESSAGE to the standard error stream (like 'tm')
and then abort the formatter; that is, stop processing and
terminate with a failure status. Aborting does not flush a
partially collected line, a potentially significant fact if you're
using 'ab' to "bisect" a troublesome document or macro definition;
see the 'fl' request below.
-- Request: .ex
Exit the formatter; that is, stop processing and terminate
successfully. To stop processing only the current file, use the
'nx' request; recall *note Host System Service Access::.
When doing something complicated, it is useful to leave the debugging
statements in the code and have them turned on by a command-line flag.
.if \n[DB] .tm debugging output
To activate such statements, use the '-r' option to set the register.
groff -rDB=1 file
If you know in advance that there are many errors and no useful
output, or are interested _only_ in diagnostic output, you can suppress
GNU 'troff''s formatted output with its '-z' option.
-- Request: .pchar c ...
Report, to the standard error stream, information about each
character (be it ordinary, special, or indexed) or character class
C. A character defined by a request ('char', 'fchar', 'fschar',
or 'schar') reports its contents as a JSON-encoded string, but the
output is not otherwise in JSON format.
-- Request: .pcolor [col ...]
Report, to the standard error stream, each defined color named COL,
its color space identifier, and channel value assignments, or,
without arguments, those of all defined colors. A device's default
stroke and/or fill colors, "default", are not listed since they are
immutable and their details unknown to the formatter.
-- Request: .pcomposite
Report, to the standard error stream, the list of configured
composite character mappings. Recall the 'composite' request
description in *note Characters and Glyphs::. The "from" code
point is listed first, followed by its "to" mapping.
-- Request: .pev
Report the state of the current environment followed by that of all
other environments to the standard error stream.
-- Request: .pfp
Report, to the standard error stream, the list of occupied font
mounting positions. Recall the 'fp' request description in *note
Selecting Fonts::. Occupied mounting positions are listed, one per
line, in increasing order, followed by the typeface name; if the
name corresponds to an abstract style, the entry ends there.
Otherwise, the name of the font description file and the font's
"internal name" datum, the meaning of which varies by output
device, follow.
-- Request: .pftr
Report, to the standard error stream, the list of font
translations. Recall the 'ftr' request description in *note
Selecting Fonts::. The "from" font identifier is listed first,
followed by its "to" translation.
-- Request: .phw
Report, to the standard error stream, the list of hyphenation
exception words associated with the hyphenation language selected
by the 'hla' request; recall *note Manipulating Hyphenation::. A
'-' marks each hyphenation point. A word prefixed with '-' is not
hyphenated at all. The report suffixes words to which automatic
hyphenation applies (meaning those defined in a hyphenation pattern
file rather than with the 'hw' request) with a tab and asterisk
('*').
-- Request: .pline
Report, in JSON syntax to the standard error stream, the list of
output nodes corresponding to the pending output line. In JSON, a
pair of empty brackets '[ ]' represents an empty list. A _pending_
output line has not yet undergone adjustment, and lacks a line
number and margin character (all as applicable).
-- Request: .pm [name ...]
Report, to the standard error stream, the JSON-encoded name and
contents of each macro, string, or diversion NAME, or, without
arguments, the names of all defined macros, strings, and diversions
and their lengths in characters or nodes.
-- Request: .pnr [reg ...]
Report the name and value and, if its type is numeric, the
autoincrement amount and assigned format of each register REG, or,
without arguments, those of all defined registers, to the standard
error stream.
-- Request: .pstream
Report, in JSON syntax to the standard error stream, the list of
open streams, including the name of each open stream, the name of
the file backing it, and its mode (writing or appending). In JSON,
a pair of empty brackets '[ ]' represents an empty list.
-- Request: .pwh
Report the names and positions of all page location traps to the
standard error stream. GNU 'troff' reports empty slots in the
list, where a trap had been planted but subsequently (re)moved,
because they can affect the visibility of subsequently planted
traps.
-- Request: .fl
Break the line and flush any pending output line immediately. The
effect is the same as the 'br' request unless the no-break control
character is used; ''br' does nothing, whereas ''fl' writes the
pending output line without further updating the drawing position.
However, the _reported_ horizontal drawing position is still
reckoned from the start of the input line.
foo \n(hp
bar \c
'fl
\n(hp baz \n(hp
=> foo 96 bar 0 baz 144
Flush timing is most easily perceived in device-independent output.
Use of ''fl' may be desirable immediately prior to an 'ab' request
when troubleshooting a document or macro definition line by line,
because a significant number of formatting operations can
accumulate on a partially collected output line, misleading you
about "where" the abort "really" took place.
Historically, 'fl' was used with 'rd' to produce interactive
'nroff' documents. GNU 'troff' does not easily support that mode
of operation, because its output for terminals is first prepared in
device-independent format, which 'grotty' renders a page at a time.
-- Request: .backtrace
Write the state of the input stack to the standard error stream.
Consider the following in a file 'test'.
.de xxx
. backtrace
..
.de yyy
. xxx
..
.
.yyy
error-> troff: backtrace: 'test':2: macro 'xxx'
error-> troff: backtrace: 'test':5: macro 'yyy'
error-> troff: backtrace: file 'test':8
The '-b' option of GNU 'troff' causes a backtrace to be generated
on each error or warning. Some warnings have to be enabled; see
*note Warnings::.
-- Register: \n[slimit]
If greater than 0, sets the maximum quantity of objects on GNU
'troff''s internal input stack. If less than or equal to 0, there
is no limit: recursion can continue until program memory is
exhausted. The default is 1,000.
-- Request: .warnscale scaling-unit
Set the scaling unit used in certain warnings (one of 'u', 'i',
'c', 'p', and 'P'; default: 'i'). Ignored on 'nroff'-mode output
devices, for which these diagnostics report the vertical page
location in lines, and the horizontal page location in ens.
-- Request: .spreadwarn [limit]
Emit a 'break' warning if the additional space inserted for each
space between words in an output line adjusted to both margins with
'.ad b' is larger than or equal to LIMIT. A negative value is
treated as zero; an absent argument toggles the warning on and off
without changing LIMIT. The default scaling unit is 'm'. At
startup, 'spreadwarn' is inactive and LIMIT is 3m.
For example,
.spreadwarn 0.2m
causes a warning if 'break' warnings are not suppressed and GNU
'troff' must add 0.2m or more for each inter-word space in a line.
*Note Warnings::.
-- Request: .warn [n]
-- Register: \n[.warn]
Select categories of warnings to be reported. N is the sum of the
numeric codes associated with each warning category that is to be
enabled; all other categories are disabled. The categories and
their associated codes are listed in *note Warnings::. For
example, '.warn 0' disables all warnings, and '.warn 1' disables
all warnings except those about missing glyphs. If no argument is
given, all warning categories are enabled.
The read-only register '.warn' contains the sum of the numeric
codes of enabled warning categories.
GNU 'troff' has command-line options for reporting warnings ('-w'),
suppressing them ('-W'), and issuing backtraces ('-b') when a warning or
an error occurs.
5.38.1 Warnings
---------------
GNU 'troff' divides its warning diagnostics into named, numbered
categories. The '-w' and '-W' options use the associated names. A
power of two characterizes each category; the 'warn' request and the
'.warn' register respectively set and report the sum of enabled category
codes. Warnings of each category are produced under the following
circumstances.
'char'
'1'
No user-defined character of the requested name or index exists and
no mounted font defines a glyph for it, or input could not be
encoded for device-independent output. This category is enabled by
default.
'break'
'4'
A filled output line could not be broken such that its length was
less than or equal to, or adjusted such that its length was exactly
equal to, the output line length '\n[.l]'. GNU 'troff' reports the
amount of overset or underset in the scaling unit configured by the
'warnscale' request in 'troff' mode, and in ens ('n'; character
cells) in 'nroff' mode. *Note troff and nroff Modes::. This
category is enabled by default.
'delim'
'8'
The selected delimiter character was ambiguous because it is also
meaningful when beginning a numeric expression, or the closing
delimiter in an escape sequence was missing or mismatched.
A future 'groff' release may reject ambiguous delimiters. In
compatibility mode, ambiguous delimiters are accepted without
warning.
'scale'
'32'
A scaling unit inappropriate to its context was used in a numeric
expression.
'range'
'64'
A numeric expression was out of range for its context.
'syntax'
'128'
A self-contradictory hyphenation mode or character flags were
requested; an empty or incomplete numeric expression was
encountered; an operand to a numeric operator was missing; an
attempt was made to format characters or spaces on an input line
after an output line continuation escape sequence; a recognized but
inapposite escape sequence or unprintable character code was used
in a device extension command; an attempt was made to define a
recursive, empty, or nonsensical character class; or a 'groff'
extension escape sequence or conditional expression operator was
used while in compatibility mode.
'di'
'256'
A 'di', 'da', 'box', or 'boxa' request was invoked without an
argument when there was no current diversion.
'mac'
'512'
An undefined string, macro, or diversion was used. When such an
object is dereferenced, an empty one of that name is automatically
created. So, unless it is later deleted, GNU 'troff' issues at
most one warning for each.
GNU 'troff' also uses this category to warn of an attempt to move
an unplanted trap macro; recall *note Page Location Traps::. In
such cases, the unplanted macro is _not_ dereferenced, so it is not
created if it does not exist.
'reg'
'1024'
An undefined register was used. When an undefined register is
dereferenced, the formatter automatically defines it with a value
of 0. So, unless it is later deleted, GNU 'troff' issues at most
one warning for each.
'tab'
'2048'
A tab character appeared in a parameterized escape sequence, in an
unquoted macro argument, or where a request expected a numeric
expression argument.
'missing'
'8192'
A request was invoked with a mandatory argument absent.
'input'
'16384'
An invalid character occurred on the input stream.
'escape'
'32768'
An unsupported escape sequence was encountered.
'space'
'65536'
A space was missing between a request or macro and its argument.
This warning is produced when an undefined name longer than two
characters is encountered and the first two characters of the name
constitute a defined name. No request is invoked, no macro called,
and an empty macro is not defined. This category is enabled by
default. It never occurs in compatibility mode.
'font'
'131072'
A non-existent font was selected. This category is enabled by
default.
'ig'
'262144'
An invalid escape sequence occurred in input ignored using the 'ig'
request. This warning category diagnoses a condition that is an
error when it occurs in non-ignored input.
'color'
'524288'
An undefined color was selected, an attempt was made to define a
color using an unrecognized color space, an invalid channel value
in a color definition was encountered, or an attempt was made to
redefine a default color.
'file'
'1048576'
An attempt was made to read a file that does not exist, or a stream
remained open at formatter exit. This category is enabled by
default.
Two warning names group other warning categories for convenience.
'all'
All warning categories except 'di', 'mac' and 'reg'. This
shorthand is intended to produce all warnings that are useful with
macro packages written for AT&T 'troff' and its descendants, which
have less fastidious diagnostics than GNU 'troff'.
'w'
All warning categories. Authors of documents and macro packages
targeting 'groff' are encouraged to use this setting.
5.39 Implementation Differences
===============================
GNU 'troff' has a number of features that cause incompatibilities with
documents written for other versions of 'troff'. Some GNU extensions to
'troff' have become supported by other implementations.
5.39.1 Safer Mode
-----------------
GNU 'troff' operates in "safer mode" by default; to mitigate risks from
untrusted input documents, it disables the 'cf', 'pi', and 'sy'
requests. GNU 'troff''s '-U' option enables "unsafe mode", restoring
their function and enabling additional extension requests, 'open',
'opena', and 'pso'. Recall *note Host System Service Access::.
5.39.2 Compatibility Mode
-------------------------
Some syntactical and behavioral differences between GNU and AT&T
'troff's are thought too important to neglect; GNU 'troff' therefore
makes available a "compatibility mode" in an effort to keep documents
prepared for AT&T 'troff' rendering well.
Identifiers of arbitrary length may be GNU 'troff''s most obvious
innovation. AT&T 'troff' interprets '.dsabcd' as defining a string 'ab'
with contents 'cd'. Normally, GNU 'troff' interprets this input as
calling a macro named 'dsabcd'. AT&T 'troff' also interprets '\*[' and
'\n[' as interpolating a string or register, respectively, named '['.
GNU 'troff', however, normally interprets '[' as bracketing a long name
(with ']' at the distal end). In compatibility mode, GNU 'troff'
interprets names in the traditional way; they thus can be two characters
long at most.
-- Request: .cp [b]
-- Register: \n[.C]
Enable or disable AT&T 'troff' compatibility mode per Boolean
expression B. It is disabled by default, and enabled if B is
omitted. In compatibility mode, long names are not recognized, and
the incompatibilities they cause do not arise.
The read-only register '.C' interpolates 1 if compatibility mode is
enabled, 0 otherwise.
GNU 'troff''s '-C' command-line option causes it to start up in
compatibility mode.
-- Request: .do name [argument ...]
-- Register: \n[.cp]
Interpret the string, request, diversion, or macro NAME (along with
any further arguments) with compatibility mode disabled.
Compatibility mode is restored (only if it was active) when the
interpolation of NAME is interpreted; that is, the restored
compatibility state applies to the request or contents of the
macro, string, or diversion NAME, its arguments, and data read from
files or pipes if NAME is the 'so', 'soquiet', 'mso', 'msoquiet',
or 'pso' request.
The following example illustrates several aspects of 'do' behavior.
.de mac1
FOO
..
.de1 mac2
groff
.mac1
..
.de mac3
compatibility
.mac1
..
.de ma
\\$1
..
.cp 1
.do mac1
.do mac2 \" mac2, defined with .de1, calls "mac1"
.do mac3 \" mac3 calls "ma" with argument "c1"
.do mac3 \[ti] \" groff syntax accepted in .do arguments
=> FOO groff FOO compatibility c1 ~
The read-only register '.cp', meaningful only when dereferenced
from a 'do' request, is 1 if compatibility mode was on when the
'do' request was encountered, and 0 if it was not. This register
is specialized and may require a statement of rationale.
When writing macro packages or documents that use GNU 'troff'
features and which may be mixed with other packages or documents
that do not--common scenarios include serial processing of man
pages or use of the 'so' or 'mso' requests--you may desire correct
operation regardless of compatibility mode enablement in the
surrounding context. It may occur to you to save the existing
value of '\n(.C' into a register, say, '_C', at the beginning of
your file, turn compatibility mode off with '.cp 0', then restore
it from that register at the end with '.cp \n(_C'. At the same
time, a modular design of a document or macro package may lead you
to multiple layers of inclusion. You cannot use the same register
name everywhere lest you "clobber" the value from a preceding or
enclosing context. The two-character register name space of AT&T
'troff' is confining, but employing GNU 'troff''s more capacious
one, as with '.nr _my_saved_C \n(.C', does not work in
compatibility mode; the register name is too long. Employing the
'do' request is no help: '.do nr _my_saved_C \n(.C' always saves
zero to the register, because 'do' turns compatibility mode _off_
while it interprets its argument list.
To robustly save compatibility mode before switching it off, use
.do nr _my_saved_C \n[.cp]
.cp 0
at the beginning of your file, followed by
.cp \n[_my_saved_C]
.do rr _my_saved_C
at the end. As the C language exposes application programs'
symbols to those defined by libraries, 'roff' documents share a
name space with macro packages; choose a register name that is
unlikely to collide with other uses.
Normally, GNU 'troff' tracks the nesting depth of interpolations. In
compatibility mode, it does not.
.ds xx '
\w'abc\*(xxdef'
=> 168 (not in compatibility mode on a terminal device)
=> 72def' (compatibility mode on a terminal device)
The escape sequences '\f', '\H', '\m', '\M', '\R', '\s', and '\S' are
transparent to control character recognition at the beginning of a line,
or after the conditional expression of an 'if' or 'ie' request, only in
compatibility mode. That is, upon interpreting them, GNU 'troff'
normally no longer recognizes a control character on the input line; but
in compatibility mode, it does, just like AT&T 'troff'. Thus the next
example produces bold output in both modes, but the text differs.
.de xx
Hello!
..
\fB.xx\fP
=> .xx (not in compatibility mode)
=> Hello! (in compatibility mode)
Normally, the syntax form '\s'N accepts only a single character (a
digit) for N, consistently with other forms that originated in AT&T
'troff', like '\*', '\f', '\g', '\k', '\n', and '\z'. In compatibility
mode only, a non-zero N must be in the range 4-39. Legacy documents
relying upon this quirk of parsing(1) (*note Compatibility
Mode-Footnote-1::) should migrate to another '\s' form.
In compatibility mode, the 'de', 'am', 'ds', and 'as' requests behave
as 'de1', 'am1', 'ds1', and 'as1', respectively: GNU 'troff' inserts a
compatibility save token at the beginning of the macro, string, or
appendment thereto as applicable and a compatibility restore token at
its end, enabling compatibility mode during its interpolation.(2)
(*note Compatibility Mode-Footnote-2::) Thus they work as expected even
if the interpolation context disables compatibility mode.
AT&T 'troff' recognized slightly varying sets of delimiters when
expecting numerical expressions (as with the '\h' escape sequence),
string expressions (as with the '\w' escape sequence and 'tl' request),
and output comparisons (as in '.if #foo#bar# .tm match'). GNU 'troff',
when not in compatibility mode, recognizes a single consistent set of
delimiters. Compatibility mode emulates AT&T 'troff' only up to a
point. GNU 'troff' accepts leaders and tabs as delimiters, as well as
(EOT or EOF), (BS or backspace), and
(FF or form feed), all of which, when used as delimiters, cause AT&T
'troff' to behave in ways difficult to predict.
(1) The Graphic Systems C/A/T phototypesetter (the original device
target for AT&T 'troff') supported only a few discrete type sizes in the
range 6-36 points, so Ossanna contrived a special case in the parser to
do what the user must have meant. Kernighan warned of this in the 1992
revision of CSTR #54 (§2.3), and more recently, McIlroy referred to it
as a "living fossil".
(2) Recall *note Strings::.
5.39.3 Other Differences
------------------------
GNU 'troff' does not emit output if it has nothing to format. For
example, it treats an input document consisting solely of 'nr' and 'tm'
requests as empty, and produces nothing on its standard output stream.
AT&T 'troff' does, creating a blank page.
Use of C0 control characters in identifiers is not portable; Solaris,
Plan 9, and Heirloom Doctools 'troff's accept , ,
, , and (only); DWB 3.3 'troff' does
not. GNU 'troff' rejects C0 controls in identifiers with an error
diagnostic.
Formatters that don't implement GNU 'troff' extension request names
tend to ignore them, and if they don't support a GNU 'troff' extension
escape sequence, they are liable to format its function selector
character as text. For example, the adjustable, non-breaking space
escape sequence '\~' is also supported by Heirloom Doctools 'troff'
050915 (September 2005), 'mandoc' 1.9.5 (2009-09-21), 'neatroff' (commit
1c6ab0f6e, 2016-09-13), and Plan 9 from User Space 'troff' (commit
93f8143600, 2022-08-12), but not by Solaris or Documenter's Workbench
'troff's, which both render it as '~'. Recall *note Manipulating
Filling and Adjustment::. GNU 'troff''s features sometimes cause
incompatibilities with documents written assuming old implementations of
'troff'.
AT&T 'troff' discards trailing spaces from input lines, like GNU
'troff', but when it does so, AT&T 'troff' also cancels end-of-sentence
detection. Use of the dummy character escape sequence '\&' is more
portable.
When adjusting output lines to both margins, AT&T 'troff' at first
adjusts spaces starting from the right; GNU 'troff' begins from the
left. Both implementations adjust spaces from opposite ends on
alternating output lines in this adjustment mode to prevent "rivers" in
the text.
GNU 'troff' does not always hyphenate words as AT&T 'troff' does.
The AT&T implementation uses a set of hard-coded rules specific to U.S.
English, while GNU 'troff' uses language-specific hyphenation pattern
files derived from TeX. Some versions of 'troff' reserved meager
storage for hyphenation exception words (arguments to the 'hw' request);
GNU 'troff' has no such restriction. When the 'hy' request is invoked
without an argument, GNU 'troff' sets the automatic hyphenation mode to
the value of the '.hydefault' register; the AT&T implementation sets it
to '1', which is not suitable in GNU 'troff' for some languages,
including English.
Unlike GNU 'troff', AT&T 'troff' does not recognize an occurrence of
'\%' at the beginning of a word as suppressing its hyphenation; instead,
it (uselessly) marks the start of the word as a potential hyphenation
point, permitting output lines to end with hyphens that are not interior
to a word.
GNU 'troff' handles the dummy character '\&' differently from AT&T
'troff' when it is followed by the hyphenation control escape sequence
'\%' at the beginning of a word. GNU 'troff' does not regard the dummy
character as "starting" the word; AT&T 'troff' does. Further, Heirloom
Doctools 'troff' does not honor an explicit hyphenation point marked
with '\%' after a word-initial one.(1) (*note Other
Differences-Footnote-1::)
GNU 'troff' interprets request arguments representing file names and
system commands in the same way it does the CONTENTS argument to the
'ds' and 'as' requests: it removes a leading neutral double quote '"'
from the argument to the 'cf', 'nx', 'pi', 'so', and 'sy' requests, and
the second argument (if present) to the 'lf' request, permitting initial
embedded spaces in it, and reads it to the end of the input line in copy
mode. Recall *note Copy Mode::. This difference permits the formatter
to handle files with spaces in their names, but requires more care with
trailing comments, and doubling of an initial neutral double quote '"'
if the file name has one.
The existence of the '.T' string is a common feature of
device-independent 'troff's--DWB 3.3, Solaris, Heirloom Doctools, and
Plan 9 'troff's all support it--but valid values are specific to each
implementation.
The (read-only) register '.T' interpolates 1 if GNU 'troff' is run
with the '-T' option, and 0 otherwise. In contrast, AT&T 'troff'
interpolated 1 only if 'nroff' was the formatter and was run with '-T'.
AT&T 'troff' ignored attempts to remove read-only registers; GNU
'troff' honors such requests. Recall *note Built-in Registers::.
The 'lf' request sets the number of the _current_ input line in AT&T
'troff' and the _next_ in GNU 'troff'.
AT&T 'troff' had only environments named '0', '1', and '2'. In GNU
'troff', any number of environments may exist, using any valid
identifiers for their names. Recall *note Identifiers::.
As noted in *note Using Fractional Type Sizes::, AT&T 'troff''s 'ps'
request ignores scaling units and thus '.ps 10u' sets the type size to
10 points, whereas in GNU 'troff' it sets the type size to 10 _scaled_
points, possibly a much smaller measurement. AT&T's behavior also means
that '.ps 10p' and '.ps 10z' are portable.
The 'ab' request differs from AT&T 'troff': GNU 'troff' writes no
message to the standard error stream if no arguments are given, and it
exits with a failure status instead of a successful one.
The 'bp' request differs from AT&T 'troff': GNU 'troff' does not
accept a scaling unit on the argument, a page number; the former does
(uselessly).
In AT&T 'troff', the 'pm' request reports macro, string, and
diversion sizes in units of 128-byte blocks, and an argument reduces the
report to a sum of the above in the same units. GNU 'troff' reports
their lengths in characters or nodes if given no arguments, and
otherwise dumps the JSON-encoded name, contents, and other properties of
each named argument.
AT&T 'troff' ignores the 'ss' request if the output is a terminal
device; GNU 'troff' rounds down the values of minimum inter-word and
additional inter-sentence space each to the nearest multiple of 12.
GNU 'troff' distinguishes characters from glyphs. Characters can be
ordinary, special, or indexed, and populate strings and macros.
Characters _per se_ have not (yet) been formatted. Glyphs represent
graphemes (supplied by the output device) and populate diversions
(recall *note Diversions::). Formatting converts characters into
(sequences of) glyphs. GNU 'troff' stores properties of the environment
that affect how a glyph is rendered with the glyph node's data. Thus,
subsequent formatting operations do not affect it, including 'bd', 'cs',
'tkf', 'tr', and 'fp' requests. Normally, a macro or string contains
only a list of characters and a diversion contains only a list of nodes.
However, applying the 'asciify' or 'unformat' requests to a diversion
converts some of its nodes back into characters. Where the formatter
cannot recover the character representation of a node, it stores a null
character in the character list corresponding to a single node in the
node list.
Consequently, a glyph node does not behave as a character does in
macro interpolation: it does not inherit special properties that the
character from which it was constructed might have had. For example,
the input
.di x
\\\\
.br
.di
.x
produces '\\' in GNU 'troff'. Each pair of backslashes becomes one
backslash _glyph_; the resulting backslashes are thus not interpreted as
escape _characters_ when they are interpolated as the diversion is
output. AT&T 'troff' _would_ interpret them as escape characters when
interpolating them and end up printing one '\'.
One correct way to obtain a printable backslash in most documents is
to use the '\e' escape sequence; this always prints a single instance of
the current escape character,(2) (*note Other Differences-Footnote-2::)
regardless of whether it is used in a diversion; it also works in both
GNU 'troff' and AT&T 'troff'.
The other correct way, appropriate in contexts independent of the
backslash's common use as a 'roff' escape character--perhaps in
discussion of character sets or other programming languages--is the
special character escape sequence '\(rs' or '\[rs]', for "reverse
solidus", from its name in the ECMA-6 and ISO 10646 standards.(3)
(*note Other Differences-Footnote-3::)
To store in a diversion an escape sequence that is interpreted when
the diversion is interpolated, either use the traditional '\!'
transparent output facility, or, if this is unsuitable, the new '\?'
escape sequence. Recall *note Diversions:: and *note GNU troff
Internals::.
Like AT&T 'troff', GNU 'troff' maintains a buffer of
device-independent output commands,(4) (*note Other
Differences-Footnote-4::) populating the buffer as formatted output
accumulates. GNU 'troff' always flushes this buffer when processing a
break; AT&T 'troff' does so according to no obvious schedule. (Perhaps,
if the buffer is of fixed size, the formatter performs the flush when
the buffer runs out of room.)
In the somewhat pathological case where a diversion exists containing
a partially collected line and a partially collected line at the
top-level diversion has never existed, AT&T 'troff' outputs a partially
collected but otherwise empty line (as if '\c' were in the top-level
diversion) at the end of input; GNU 'troff' does not.
(1) Thus,
.ll 10n
\%antidisestablishmen\%tarianism
.br
\&\%antidisestablishmen\%tarianism
.pl \n(nlu
produces different results with each of the three formatters.
(2) Naturally, if you've changed the escape character, you need to
prefix the 'e' with whatever it is--and you'll likely get something
other than a backslash in the output.
(3) AT&T 'troff''s font description files did not define the 'rs'
special character, but those of its descendant Heirloom Doctools 'troff'
do, as of its 060716 release (July 2006).
(4) In GNU 'troff', node objects produce these commands; recall *note
GNU troff Internals::.
6 File Formats
**************
All files that GNU 'troff' reads and writes are text files.(1) (*note
File Formats-Footnote-1::) The next two sections describe their format.
(1) GNU 'troff' also reads files that don't satisfy the strict POSIX
definition of a text file--for example, those lacking a final newline
character--and the 'cf' and 'trf' requests read arbitrary files. Recall
*note Host System Service Access::.
6.1 Device and Font Description Files
=====================================
The 'groff' font and output device description formats are slight
extensions of those used by AT&T device-independent 'troff'. In
distinction to the AT&T implementation, 'groff' lacks a binary format;
all files are text files.(1) (*note Device and Font Description
Files-Footnote-1::) The device and font description files for a device
NAME are stored in a 'devNAME' directory. The device description file
is called 'DESC', and, for each font supported by the device, a font
description file is called 'F', where F is usually an abbreviation of a
font's name and/or style. For example, the 'ps' (PostScript) device has
'groff' font description files for Times roman ('TR') and Zapf Chancery
Medium italic ('ZCMI'), among many others, while the 'utf8' device (for
terminals) has font descriptions for the roman, italic, bold, and
bold-italic styles ('R', 'I', 'B', and 'BI', respectively).
Device and font description files are read both by the formatter, GNU
'troff', and by output drivers. The programs delegate these files'
processing to an internal library, 'libgroff', ensuring their consistent
interpretation.
(1) Plan 9 'troff' has also abandoned the binary format.
6.1.1 'DESC' File Format
------------------------
The 'DESC' file contains a series of directives; each begins a line.
Their order is not important, with two exceptions: (1) the 'res'
directive must precede any 'papersize' directive; and (2) the 'charset'
directive must come last (if at all). If a directive name is repeated,
later entries in the file override previous ones (except that the paper
dimensions are computed based on the 'res' directive last seen when
'papersize' is encountered). Spaces and/or tabs separate words and are
ignored at line boundaries. Comments start with the '#' character and
extend to the end of a line. Empty lines are ignored.
'family FAM'
The default font family is FAM.
'fonts N F1 ... FN'
Fonts F1, ..., FN are mounted at font positions M+1, ..., M+N where
M is the number of 'styles' (see below). This directive may extend
over more than one line. A font name of '0' causes no font to be
mounted at the corresponding position.
'hor N'
The horizontal motion quantum is N basic units. Horizontal
measurements round to multiples of N.
'image_generator PROGRAM'
Use PROGRAM to generate PNG images from PostScript input. Under
GNU/Linux, this is usually 'gs', but under other systems (notably
Cygwin) it might be set to another name. The 'grohtml' driver uses
this directive.
'paperlength N'
The vertical dimension of the output medium is N basic units
(deprecated: use 'papersize' instead).
'papersize FORMAT-OR-DIMENSION-PAIR-OR-FILE-NAME ...'
The dimensions of the output medium are as according to the
argument, which is either a standard paper format, a pair of
dimensions, or the name of a plain text file containing either of
the foregoing.
Recognized paper formats are the ISO and DIN formats 'A0'-'A7',
'B0'-'B7', 'C0'-'C7', 'D0'-'D7'; the U.S. paper types 'letter',
'legal', 'tabloid', 'ledger', 'statement', and 'executive'; and the
envelope formats 'com10', 'monarch', and 'DL'. Matching is
performed without regard for lettercase.
Alternatively, the argument can be a custom paper format in the
format 'LENGTH,WIDTH' (with no spaces before or after the comma).
Both LENGTH and WIDTH must have a unit appended; valid units are
'i' for inches, 'c' for centimeters, 'p' for points, and 'P' for
picas. Example: '12c,235p'. An argument that starts with a digit
is always treated as a custom paper format.
Finally, the argument can be a file name (e.g., '/etc/papersize');
if the file can be opened, the first line is read and a match
attempted against each of the other forms. No comment syntax is
supported.
More than one argument can be specified; each is scanned in turn
and the first valid paper specification used.
'paperwidth N'
The horizontal dimension of the output medium is N basic units
(deprecated: use 'papersize' instead).
'pass_filenames'
Direct GNU 'troff' to emit the name of the source file being
processed. This is achieved with the intermediate output command
'x F', which 'grohtml' interprets.
'postpro PROGRAM'
Use PROGRAM as the postprocessor.
'prepro PROGRAM'
Use PROGRAM as a preprocessor. The 'html' and 'xhtml' output
devices use this directive.
'print PROGRAM'
Use PROGRAM as a spooler program for printing. If omitted, the
'-l' and '-L' options of 'groff' are ignored.
'res N'
The device resolution is N basic units per inch.
'sizes S1 ... SN 0'
The device has fonts at S1, ..., SN scaled points (see below). The
list of sizes must be terminated by '0'. Each SI can also be a
range of sizes M-N. The list can extend over more than one line.
'sizescale N'
A typographical point is subdivided into N scaled points. The
default is '1'. *Note Using Fractional Type Sizes::.
'styles S1 ... SM'
The first M mounting positions are associated with styles S1, ...,
SM.
'tcommand'
The postprocessor can handle the 't' and 'u' intermediate output
commands.
'unicode'
The output device supports the complete Unicode repertoire. This
directive is useful only for devices that produce character
entities instead of glyphs.
If 'unicode' is present, no 'charset' section is required in the
font description files since the Unicode handling built into
'groff' is used. However, if there are entries in a font
description file's 'charset' section, they either override the
default mappings for those particular characters or add new
mappings (normally for composite characters).
The 'utf8', 'html', and 'xhtml' output devices use this directive.
'unitwidth N'
Arbitrary basis with respect to which font metrics are
proportionally scaled when rendering glyphs at a type size of one
point.
'unscaled_charwidths'
Make the font handling module always return unscaled character
widths. The 'grohtml' driver uses this directive.
'use_charnames_in_special'
GNU 'troff' should encode special characters in arguments to device
extension commands; see *note Postprocessor Access::. The
'grohtml' driver uses this directive.
'vert N'
The vertical motion quantum is N basic units. Vertical
measurements round to multiples of N.
'charset'
This line and everything following it in the file are ignored. It
is recognized for compatibility with other 'troff' implementations.
In GNU 'troff', character set repertoire is described on a per-font
basis.
GNU 'troff' recognizes but ignores the directives 'spare1', 'spare2',
and 'biggestfont'.
The 'res', 'unitwidth', 'fonts', and 'sizes' lines are mandatory.
Directives not listed above are ignored by GNU 'troff' but may be used
by postprocessors to obtain further information about the device.
6.1.2 Font Description File Format
----------------------------------
On typesetting output devices, each font is typically available at
multiple sizes. While paper measurements in the device description file
are in absolute units, measurements applicable to fonts must be
proportional to the type size. The font's unit width establishes a
numerical basis that permits all of its metrics to be expressed as
integers if rendered at one point. When the formatter configures a type
size, it scales the metrics linearly relative to that basis. The unit
width has no inherent relationship to the device resolution, and the
same division procedure applies to all font metrics. Observe that
whatever unit might one select for the unit width, the division
operation implied by scaling cancels it out, leaving a dimensionless
quantity.
For instance, 'groff''s 'lbp' device uses a 'unitwidth' directive
with an argument of 800. Its Times roman font 'TR' has a 'spacewidth'
of 833; this is also the width of its comma, period, centered period,
and mathematical asterisk, while its 'M' has a width of 2,963. Thus, an
'M' on the 'lbp' device is 2,963 ÷ 800 times the unit width, or
approximately 3.7. At a type size of 10 points, a Times roman 'M' is
therefore 37 units wide.
$ groff -T lbp
.ps 10
.nr Mw \w'M'
.tm width of 'M' at 10 points=\n(Mw
error-> width of 'M' at 10 points=37
A font description file has two sections. The first is a sequence of
directives, and is parsed similarly to the 'DESC' file described above.
Except for the directive names that begin the second section, their
ordering is immaterial. Later directives of the same name override
earlier ones, spaces and tabs are handled in the same way, and the same
comment syntax is supported. Empty lines are ignored throughout.
'name F'
The name of the font is F. 'DESC' is an invalid font name. Simple
integers are valid, but their use is discouraged.(1) (*note Font
Description File Format-Footnote-1::)
'spacewidth N'
The width of an unadjusted inter-word space is N, relative to the
device's unit width.
The directives above must appear in the first section; those below
are optional.
'slant N'
The font's glyphs have a slant of N degrees; a positive N slants in
the direction of text flow.
'ligatures LIG1 ... LIGN [0]'
Glyphs LIG1, ..., LIGN are ligatures; possible ligatures are 'ff',
'fi', 'fl', 'ffi' and 'ffl'. For compatibility with other 'troff'
implementations, the list of ligatures may be terminated with
a '0'. The list of ligatures must not extend over more than one
line.
'special'
The font is "special": when the document attempts to format a glyph
that is not present in the formatter's currently selected font, the
glyph is sought in any mounted fonts that bear this property.
Often, such fonts are "unstyled", having no heavy (bold) or slanted
(italic or oblique) variants.
Other directives in this section are ignored by GNU 'troff', but may
be used by postprocessors to obtain further information about the font.
The second section contains one to three subsections, which can
appear in any order, and any of which starts the second section. Each
starts with a directive on a line by itself. A 'charset' subsection is
mandatory unless the associated 'DESC' file contains the 'unicode'
directive. Another subsection, 'kernpairs', is optional.
The directive 'charset' starts the character set subsection.(2)
(*note Font Description File Format-Footnote-2::) It precedes a series
of glyph descriptions, one per line. Each such glyph description
comprises a set of fields separated by spaces or tabs and organized as
follows.
NAME METRICS TYPE INDEX [ENTITY-NAME] ['--' COMMENT]
NAME identifies the glyph: if NAME is a printable character C, it
corresponds to the 'troff' ordinary character C. If NAME is a
multi-character sequence not beginning with '\', it corresponds to the
GNU 'troff' special character escape sequence '\[NAME]'. A name
consisting of three minus signs, '---', is special and indicates that
the glyph is unnamed: such glyphs can be accessed only by the '\N'
escape sequence in 'troff'. A special character named '---' can still
be defined using 'char' and similar requests. The NAME '\-' defines the
minus sign glyph. Finally, NAME can be the unbreakable one-sixth and
one-twelfth space escape sequences, '\|' and '\^' ("thin" and "hair"
spaces, respectively), in which case only the width metric described
below is interpreted; a font can thus customize the widths of these
spaces.
The form of the METRICS field is as follows.
WIDTH[','[HEIGHT[','[DEPTH[','[ITALIC-CORRECTION
[','[LEFT-ITALIC-CORRECTION[','[SUBSCRIPT-CORRECTION]]]]]]]]]]
Spaces, tabs, and newlines are prohibited between these "subfields",
which are expressed as decimal integers (and have been split here into
two lines only for better legibility). The unit of measure is that
established by the 'unitwidth' directive and scaled to the type size.
Unspecified subfields default to '0'. Since there is no associated
binary format, these values are not required to fit into the C language
data type 'char' as they are in AT&T device-independent 'troff'.
The WIDTH subfield gives the width of the glyph. The HEIGHT subfield
gives the height of the glyph (upward is positive); if a glyph does not
extend above the baseline, give it a zero height, not a negative height.
The DEPTH subfield gives the depth of the glyph--that is, the distance
below the baseline to which the glyph extends (downward is positive); if
a glyph does not extend below the baseline, give it a zero depth, not a
negative depth. Italic corrections apply when upright and slanted
(italic or oblique) styles are typeset adjacently. The
ITALIC-CORRECTION is the amount of space to add after a slanted glyph to
be followed immediately by an upright glyph. The LEFT-ITALIC-CORRECTION
is the amount of space to add before a slanted glyph to be preceded
immediately by an upright glyph. The SUBSCRIPT-CORRECTION is the amount
of space to add after a slanted glyph to be followed by a subscript; it
should be less than the italic correction.
For fonts used with typesetters, the TYPE field gives a featural
description of the glyph: it is a bit mask recording whether the glyph
is an ascender, descender, both, or neither. When a '\w' escape
sequence is interpolated, these values are bitwise or-ed together for
each glyph and stored in the 'nr' register. In font descriptions for
terminals, all glyphs might have a type of zero, regardless of their
appearance.
'0'
means the glyph lies entirely between the baseline and a horizontal
line at the "x-height" of the font; typical examples are 'a', 'c',
and 'x';
'1'
means the glyph descends below the baseline, like 'p';
'2'
means the glyph ascends above the font's x-height, like 'A' or 'b';
and
'3'
means the glyph is both an ascender and a descender--this is true
of parentheses in some fonts.
The INDEX field is an integer that uniquely identifies a glyph within
the font; any integer is accepted as input,(3) (*note Font Description
File Format-Footnote-3::) but no practical font employs all possible
values. An INDEX is limited to the range of the system's C language
data type 'int'. In a 'troff' document, use the indexed character
escape sequence '\N' to specify a glyph by index.
The ENTITY-NAME field defines an identifier for the glyph that the
postprocessor uses to print the GNU 'troff' glyph NAME. This field is
optional; it was introduced so that the 'grohtml' output driver could
encode its character set. For example, the glyph '\[Po]' is represented
by '£' in HTML 4.0. For efficiency, these data are now compiled
directly into 'grohtml'. 'grops' uses the field to build sub-encoding
arrays for PostScript fonts containing more than 256 glyphs. Anything
on the line after the ENTITY-NAME field or '--' is ignored.
A line in the 'charset' section can also have the form
NAME "
identifying NAME as another name for the glyph mentioned in the
preceding line. Such aliases can be chained.
A 'charset-range' subsection works like the 'charset' directive
except that the glyph descriptions use a NAME of the form
'u'AAAA'..u'FFFF, where AAAA and FFFF are hexadecimal digit sequences;
the specified metrics then apply identically to all glyphs in the
designated range.
The directive 'kernpairs' starts a list of kerning adjustments to be
made to adjacent glyph pairs from this font. It contains a sequence of
lines formatted as follows.
G1 G2 N
The foregoing means that when glyph G1 is typeset immediately before G2,
the space between them should be increased by N. The unit of measure is
that established by the 'unitwidth' directive and scaled to the type
size. Most kerning pairs should have a negative value for N.
(1) 'groff' requests and escape sequences interpret non-negative
integers as mounting positions instead. Further, a font named '0'
cannot be automatically mounted by the 'fonts' directive of a 'DESC'
file.
(2) On typesetters, this directive is misnamed since it starts a list
of glyphs, not characters.
(3) that is, any integer parsable by the C standard library's
'strtol(3)' function
6.2 GNU 'troff' Output
======================
We now describe the 'groff' device-independent page description language
produced by GNU 'troff'.
As 'groff' is a wrapper program around GNU 'troff' and automatically
runs an output driver, users seldom encounter this format under normal
circumstances. 'groff' offers the option '-Z' to inhibit postprocessing
such that GNU 'troff''s output is sent to the standard output stream
just as it is when running GNU 'troff' directly.
The purpose of device-independent output is to facilitate the
development of postprocessors by providing a common programming
interface to all devices. It is a distinct, and much simpler, language
from that of the formatter, 'troff'. The device-independent output can
be thought of as a "page description language".
In the following discussion, the term "troff output" describes what
is output by GNU 'troff', while "page description" denotes the language
accepted by the parser that interprets this output for the output
drivers. This parser handles whitespace more flexibly than AT&T
'troff''s implementation, recognizes a GNU extension to the language,
and supports a legacy compressed encoding of a subset of commands for
compatibility; otherwise, the formats are the same.(1) (*note GNU troff
Output-Footnote-1::)
When Brian Kernighan designed AT&T 'troff''s device-independent page
description language circa 1980, he had to balance readability and
maintainability against severe constraints on file size and transmission
speed to the output device.(2) (*note GNU troff Output-Footnote-2::) A
decade later, when James Clark wrote 'groff', these constraints were no
longer as tight.
(1) The parser for device-independent output can be found in the file
'GROFF-SOURCE-DIR/src/libs/libdriver/input.cpp'.
(2) See "A Typesetter-independent TROFF", Bell Labs CSTR #97, 1982.
6.2.1 Language Concepts
-----------------------
The fundamental operation of the GNU 'troff' formatter is the
translation of the 'groff' input language into a series of instructions
concerned primarily with placing glyphs or geometric objects at specific
positions on a rectangular page. In the following discussion, the term
"command" always refers to this device-independent output language, and
never to the language intended for direct use by document authors.
Device-independent output commands comprise several categories: glyph
output; font, color, and text size selection; motion of the drawing
position; page advancement; drawing of geometric objects; and device
control commands, a catch-all for other operations. The last includes
directives to start and stop output, identify the intended output
device, and embed URL hyperlinks in supported output formats.
6.2.1.1 Syntax
..............
'roff''s page description language is a sequence of "tokens":
single-letter commands or their arguments. Some commands accept a
subcommand as a first argument, followed by one or more further
arguments.
AT&T device-independent 'troff' used whitespace minimally when
producing output. GNU 'troff', in contrast, attempts to make its output
more human-readable. The whitespace characters--tab, space, and
newline--are always meaningful. They are never used to represent
spacing in the document; that is done with horizontal ('h', 'H') and
vertical ('v', 'V') positioning commands. Any sequence of space and/or
tab characters is equivalent to a single space, separating commands from
arguments and arguments from each other. Space is required only where
omitting it would cause ambiguity. A line break separates commands.
The comment character is a pound/hash sign ('#'), and marks the
remainder of the line as a comment. A line comprising only whitespace
after comment removal does nothing but separate input tokens.
The positioning commands noted above, and the command to write one
glyph ('c'), each take a single argument; the former a signed integer,
and the latter a printable ISO 646/"ASCII" character. A series of such
commands could validly occur without spaces on an input line, but GNU
'troff' follows each with a newline.
Some commands have a more complex syntax; the GNU 'troff' extension
command for writing glyph sequences ('t') accepts a variable number of
arguments. Those that draw geometric objects ('D') or control the
device ('x') furthermore recognize subcommand arguments. Such commands
thus must end with a newline. In GNU 'troff', the device extension
(sub)command 'x X' uniquely supports a line continuation syntax; a
single input line contains any other.
6.2.1.2 Argument Units
......................
Some commands take integer arguments that are assumed to represent
values in a measurement unit, but the letter for the corresponding
scaling unit is not written with the output command arguments. Most
commands assume the scaling unit 'u', the basic unit of the device, some
use 'z', the scaled point unit of the device, while others, such as the
color commands, expect plain integers.
Single characters can have the eighth bit set, as can the names of
fonts and special characters. The names of characters and fonts can be
of arbitrary length. A character that is to be printed is always in the
current font.
A string argument is always terminated by the next whitespace
character (space, tab, or newline); an embedded '#' character is
regarded as part of the argument, not as the beginning of a comment
command. An integer argument is already terminated by the next
non-digit character, which then is regarded as the first character of
the next argument or command.
6.2.1.3 Output Structure
........................
Device-independent 'troff' output is organized into three parts: a
header, a body, and a trailer.
The task of the header is to set general device parameters. GNU
'troff' guarantees that its header consists of the following three
lines:
x T DEVICE
x res N H V
x init
with the parameters N, H, and V set as outlined in *note Device Control
Commands::. The parser for the device-independent page description
language format is able to interpret additional whitespace and comments
as well even in the header.
The body contains the document's visible content. Once an output
driver interprets 'x init', it prepares to handle commands in general.
Processing terminates when a 'x stop' command is encountered; the last
line of any GNU 'troff' page description output always contains such a
command.
Semantically, the body is page-oriented. The 'p' command starts a
new page. Positioning, writing, and drawing commands are performed
within a page, so they cannot occur before the first 'p' command. The
output driver reckons absolute positioning (by the 'H' and 'V' commands)
with respect to the current page's origin at the top left corner, and
all other positioning relative to the drawing position on the page.
The trailer advances the drawing position to the bottom of the page
and informs the device that the document (or "job") has ended.
6.2.2 Command Reference
-----------------------
This subsection describes all page description output commands, both
from AT&T 'troff' as well as extension commands issued by GNU 'troff'.
6.2.2.1 Comment Command
.......................
'#ANYTHING'
Apply comment annotation. Ignore any characters from the
'#' character up to the next newline.
Each comment can be preceded by arbitrary syntactical space, and
every command can be terminated by a comment.
6.2.2.2 Simple Commands
.......................
The commands in this subsection have a command code consisting of a
single character, taking a fixed number of arguments. Most of them are
commands for positioning and text writing. These commands are tolerant
of whitespace. Optionally, syntactical space can be inserted before,
after, and between the command letter and its arguments. All of these
commands are stackable; i.e., they can be preceded by other simple
commands or followed by arbitrary other commands on the same line. A
separating syntactical space is necessary only when two integer
arguments would clash or if the preceding argument ends with a string
argument.
'C ID'
Typeset the glyph of the special character ID. Trailing
syntactical space is necessary to allow special character names of
arbitrary length. The drawing position is not advanced.
'c G'
Typeset the glyph of the ordinary character C. The drawing
position is not advanced.
'f N'
Select the font mounted at position N. N cannot be negative.
'H N'
Horizontally move the drawing position to N basic units from the
left edge of the page. N cannot be negative.
'h N'
Move the drawing position right N basic units. AT&T 'troff'
allowed negative N; GNU 'troff' does not produce such values, but
'groff''s output driver library handles them.
'm COLOR-SCHEME [COMPONENT ...]'
Select the stroke color using the COMPONENTs in the color space
SCHEME. Each COMPONENT is an integer between 0 and 65535. The
quantity of components and their meanings vary with each SCHEME.
This command is a 'groff' extension.
'mc CYAN MAGENTA YELLOW'
Use the CMY color scheme with components cyan, magenta, and
yellow.
'md'
Use the default color (no components; black in most cases).
'mg GRAY'
Use a grayscale color scheme with a component ranging between
0 (black) and 65535 (white).
'mk CYAN MAGENTA YELLOW BLACK'
Use the CMYK color scheme with components cyan, magenta,
yellow, and black.
'mr RED GREEN BLUE'
Use the RGB color scheme with components red, green, and blue.
'N N'
Typeset the glyph with index N in the current font. N is normally
a non-negative integer. The drawing position is not advanced. The
'html' and 'xhtml' devices use this command with negative N to
produce unbreakable space; the absolute value of N is taken and
interpreted in basic units.
'n B A'
Indicate a break. No action is performed; the command is present
to make the output more easily parsed. The integers B and A
describe the vertical space amounts before and after the break,
respectively. GNU 'troff' issues this command but 'groff''s output
driver library ignores it. See 'v' and 'V' below.
'p N'
Begin a new page, setting its number to N. Each page is
independent, even from those using the same number. The vertical
drawing position is set to 0. All positioning, writing, and
drawing commands are interpreted in the context of a page, so a
'p' command must precede them.
's N'
Set type size to N scaled points (unit 'z' in GNU 'troff'. AT&T
'troff' used unscaled points 'p' instead; see *note Output Language
Compatibility::.
't XYZ'
't XYZ DUMMY-ARG'
Typeset a word XYZ; that is, set a sequence of ordinary glyphs
named X, Y, Z, ..., terminated by a space character or a line
break; an optional second integer argument is ignored (this allows
the formatter to generate an even number of arguments). Each glyph
is set at the current drawing position, and the position is then
advanced horizontally by the glyph's width. A glyph's width is
read from its metrics in the font description file, scaled to the
current type size, and rounded to a multiple of the horizontal
motion quantum. Use the 'C' command to emplace glyphs of special
characters. The 't' command is a 'groff' extension and is output
only for devices whose 'DESC' file contains the 'tcommand'
directive; see *note DESC File Format::.
'u N XYZ'
Typeset word XYZ with track kerning. As 't', but after placing
each glyph, the drawing position is further advanced horizontally
by N basic units ('u'). The 'u' command is a 'groff' extension and
is output only for devices whose 'DESC' file contains the
'tcommand' directive; see *note DESC File Format::.
'V N'
Vertically move the drawing position to N basic units from the top
edge of the page. N cannot be negative.
'v N'
Move the drawing position down N basic units. AT&T 'troff' allowed
negative N; GNU 'troff' does not produce such values, but 'groff''s
output driver library handles them.
'w'
Indicate an inter-word space. No action is performed; the command
is present to make the output more easily parsed. Only inter-word
spaces on an output line (be they breakable or not) are thus
described; those resulting from horizontal motion escape sequences
are not. GNU 'troff' issues this command but 'groff''s output
driver library ignores it. See 'h' and 'H' above.
6.2.2.3 Graphics Commands
.........................
Each graphics or drawing command in the page description language starts
with the letter 'D', followed by one or two characters that specify a
subcommand; this is followed by a fixed or variable number of integer
arguments that are separated by a single space character. A 'D' command
may not be followed by another command on the same line (apart from a
comment), so each 'D' command is terminated by a syntactical line break.
GNU 'troff' output follows AT&T 'troff''s output conventions (no
space between command and subcommand, all arguments are preceded by a
single space character), but 'groff''s parser allows optional space
between the command letters and makes the space before the first
argument optional. As usual, each space can be any sequence of tab and
space characters.
Some graphics commands can take a variable number of arguments. In
this case, they are integers representing a size measured in basic units
'u'. The arguments called H1, H2, ..., HN stand for horizontal
distances where positive means right, negative left. The arguments
called V1, V2, ..., VN stand for vertical distances where positive means
down, negative up. All these distances are offsets relative to the
current location.
Each graphics command directly corresponds to a 'troff' '\D' escape
sequence. *Note Drawing Geometric Objects::.
Unknown 'D' commands are assumed to be device-specific. Its
arguments are parsed as strings; the whole information is then sent to
the postprocessor.
In the following command reference, the syntax element
means a syntactical line break as defined above.
'D~ H1 V1 H2 V2 ... HN VN'
Draw B-spline from current position to offset (H1,V1), then to
offset (H2,V2), if given, etc., up to (HN,VN). This command takes
a variable number of argument pairs; the current position is moved
to the terminal point of the drawn curve.
'Da H1 V1 H2 V2'
Draw arc from current position to (H1,V1)+(H2,V2) with center at
(H1,V1); then move the current position to the final point of the
arc.
'DC D'
'DC D DUMMY-ARG'
Draw a solid circle using the current fill color with diameter D
(integer in basic units 'u') with leftmost point at the current
position; then move the current position to the rightmost point of
the circle. An optional second integer argument is ignored (this
allows the formatter to generate an even number of arguments).
This command is a GNU extension.
'Dc D'
Draw circle line with diameter D (integer in basic units 'u') with
leftmost point at the current position; then move the current
position to the rightmost point of the circle.
'DE H V'
Draw a solid ellipse in the current fill color with a horizontal
diameter of H and a vertical diameter of V (both integers in basic
units 'u') with the leftmost point at the current position; then
move to the rightmost point of the ellipse. This command is a GNU
extension.
'De H V'
Draw an outlined ellipse with a horizontal diameter of H and a
vertical diameter of V (both integers in basic units 'u') with the
leftmost point at current position; then move to the rightmost
point of the ellipse.
'DF COLOR-SCHEME [COMPONENT ...]'
Set fill color for solid drawing objects using different color
schemes; the analogous command for setting the color of text, line
graphics, and the outline of graphic objects is 'm'. The color
components are specified as integer arguments between 0 and 65535.
The number of color components and their meaning vary for the
different color schemes. These commands are generated by GNU
'troff''s escape sequences '\D'F ...'' and '\M' (with no other
corresponding graphics commands). No position changing. This
command is a GNU extension.
'DFc CYAN MAGENTA YELLOW'
Set fill color for solid drawing objects using the CMY color
scheme, having the 3 color components CYAN, MAGENTA, and
YELLOW.
'DFd'
Set fill color for solid drawing objects to the default fill
color value (black in most cases). No component arguments.
'DFg GRAY'
Set fill color for solid drawing objects to the shade of gray
given by the argument, an integer between 0 (black) and 65535
(white).
'DFk CYAN MAGENTA YELLOW BLACK'
Set fill color for solid drawing objects using the CMYK color
scheme, having the 4 color components CYAN, MAGENTA, YELLOW,
and BLACK.
'DFr RED GREEN BLUE'
Set fill color for solid drawing objects using the RGB color
scheme, having the 3 color components RED, GREEN, and BLUE.
'Df N'
The argument N must be an integer in the range -32767 to 32767.
0 <= N <= 1000
Set the color for filling solid drawing objects to a shade of
gray, where 0 corresponds to solid white, 1000 (the default)
to solid black, and values in between to intermediate shades
of gray; this command is superseded by 'DFg'.
N < 0 or N > 1000
Set the filling color to the color that is currently being
used for the text and the outline, see command 'm'. For
example, the command sequence
mg 0 0 65535
Df -1
sets all colors to blue.
No position changing. This command is a GNU extension.
'Dl H V'
Draw line from current position to offset (H,V) (integers in basic
units 'u'); then set current position to the end of the drawn line.
'Dp H1 V1 H2 V2 ... HN VN'
Draw a polygon line from current position to offset (H1,V1), from
there to offset (H2,V2), etc., up to offset (HN,VN), and from there
back to the starting position. For historical reasons, the
position is changed by adding the sum of all arguments with odd
index to the actual horizontal position and the even ones to the
vertical position. Although this doesn't make sense it is kept for
compatibility. This command is a GNU extension.
'DP H1 V1 H2 V2 ... HN VN'
Draw a solid polygon in the current fill color rather than an
outlined polygon, using the same arguments and positioning as the
corresponding 'Dp' command. This command is a GNU extension.
'Dt N'
Set the current line thickness to N (an integer in basic units 'u')
if N>0; if N=0 select the smallest available line thickness; if N<0
set the line thickness proportional to the type size (this is the
default before the first 'Dt' command was specified). For
historical reasons, the horizontal position is changed by adding
the argument to the actual horizontal position, while the vertical
position is not changed. Although this doesn't make sense it is
kept for compatibility. This command is a GNU extension.
6.2.2.4 Device Control Commands
...............................
Each device control command starts with the letter 'x', followed by a
space character (optional or arbitrary space or tab in GNU 'troff') and
a subcommand letter or word; each argument (if any) must be preceded by
a syntactical space. All 'x' commands are terminated by a syntactical
line break; no device control command can be followed by another command
on the same line (except a comment).
The subcommand is basically a single letter, but to increase
readability, it can be written as a word, i.e., an arbitrary sequence of
characters terminated by the next tab, space, or newline character. All
characters of the subcommand word but the first are simply ignored. For
example, GNU 'troff' outputs the initialization command 'x i' as
'x init' and the resolution command 'x r' as 'x res'.
In the following, the syntax element means a syntactical
line break (*note Syntax::).
'xF NAME'
The 'F' stands for FILENAME.
Use NAME as the intended name for the current file in error
reports. This is useful for remembering the original file name
when 'groff' uses its internal piping mechanism. The input file is
not changed by this command. This command is a GNU extension.
'xf N S'
The 'f' stands for FONT.
Mount font position N (a non-negative integer) with font named S (a
text word). *Note Font Positions::.
'xH N'
The 'H' stands for HEIGHT.
Set glyph height to N (a positive integer in scaled points 'z').
AT&T 'troff' uses the unit points ('p') instead. *Note Output
Language Compatibility::.
'xi'
The 'i' stands for INIT.
Initialize device. This is the third command of the header.
'xp'
The 'p' stands for PAUSE.
Parsed but ignored. The AT&T 'troff' manual documents this command
as
pause device, can be restarted
but GNU 'troff' output drivers do nothing with this command.
'xr N H V'
The 'r' stands for RESOLUTION.
Resolution is N, while H is the minimum horizontal motion, and V
the minimum vertical motion possible with this device; all
arguments are positive integers in basic units 'u' per inch. This
is the second command of the header.
'xS N'
The 'S' stands for SLANT.
Set slant to N (an integer in basic units 'u').
'xs'
The 's' stands for STOP.
Terminates the processing of the current file; issued as the last
command of device-independent 'troff' output.
'xt'
The 't' stands for TRAILER.
Generate trailer information, if any. In GNU 'troff', this is
ignored.
'xT XXX'
The 'T' stands for TYPESETTER.
Set the name of the output driver to XXX, a sequence of
non-whitespace characters terminated by whitespace. The possible
names correspond to those of 'groff''s '-T' option. This is the
first command of the header.
'xu N'
The 'u' stands for UNDERLINE.
Configure underlining of spaces. If N is 1, start underlining of
spaces; if N is 0, stop underlining of spaces. This is needed for
the 'cu' request in 'nroff' mode and is ignored otherwise. This
command is a GNU extension.
'xX ANYTHING'
The 'x' stands for X-ESCAPE.
Send string ANYTHING uninterpreted to the device. If the line
following this command starts with a '+' character this line is
interpreted as a continuation line in the following sense. The '+'
is ignored, but a newline character is sent instead to the device,
the rest of the line is sent uninterpreted. The same applies to
all following lines until the first character of a line is not a
'+' character. This command is generated by the escape sequence
'\X'. Line continuation is a GNU extension.
6.2.2.5 Legacy Compressed Encoding
..................................
AT&T 'troff' primarily emitted glyphs by writing two digits (a motion)
followed by a single character corresponding to a glyph. This syntax is
less a command itself than a compressed encoding of the 'c' and 'h'
commands.
DDG
Move right DD (exactly two decimal digits) basic units 'u', then
print glyph G (represented as a single character).
In GNU 'troff', arbitrary syntactical space around and within this
command is allowed. Only when a preceding command on the same line
ends with an argument of variable length is a separating space
obligatory. In AT&T 'troff', large clusters of these and other
commands are used, mostly without spaces; this made such output
almost unreadable.
For modern high-resolution devices, this command is impractical
because the widths of the glyphs have a greater magnitude in basic units
than two decimal digits can represent. In GNU 'troff', this
optimization is used only for the devices 'X75', 'X75-12', 'X100', and
'X100-12'. For other devices, the commands 't' and 'u' produce more
readable output.
6.2.3 GNU 'troff' Output Examples
---------------------------------
This section presents the output GNU 'troff' generates from the same
input formatted for three different devices. The input is the phrase
'hell world' piped to GNU 'troff' on the command line.
High-resolution device 'ps'
We depict the standard output stream of GNU 'troff' in its default
build configuration and in the absence of an explicit '-T' option.
shell> echo "hell world" | groff -Z -T ps
x T ps
x res 72000 1 1
x init
p1
x font 5 TR
f5
s10000
V12000
H72000
thell
wh2500
tw
H96620
torld
n12000 0
x trailer
V792000
x stop
This output can be placed onto the standard input stream of 'grops'
to produce its representation as a PostScript file.
Low-resolution device 'latin1'
This is similar to the high-resolution device except that the
positioning is done at a minor scale. Some comments (lines
starting with '#') were added for clarification; they were not
generated by the formatter.
shell> echo "hell world" | groff -Z -T latin1
# header
x T latin1
x res 240 24 40
x init
# begin a new page
p1
# font setup
x font 1 R
f1
s10
# initial positioning on the page
V40
H0
# write text 'hell'
thell
# inform about space, and issue a horizontal jump
wh24
# write text 'world'
tworld
# announce line break, but do nothing because...
n40 0
# ...the end of the document has been reached
x trailer
V2640
x stop
This output can be placed onto the standard input stream of
'grotty' to produce its representation as text file.
AT&T 'troff' output
Since a video display has lower resolution than modern printers,
GNU 'troff''s output for X11 devices can use the legacy compressed
encoding.
shell> echo "hell world" | groff -Z -T X100
x T X100
x res 100 1 1
x init
p1
x font 5 TR
f5
s10
V16
H100
# write text in legacy compressed encoding
ch07e07l03lw06w11o07r05l03dh7
n16 0
x trailer
V1100
x stop
Place the foregoing into the standard input stream of 'xditview' or
'gxditview' to display it in an X11 window.
The legacy compressed encoding makes the content of formatted text
in AT&T 'troff' output almost incomprehenible.
6.2.4 Output Language Compatibility
-----------------------------------
The page description language of AT&T 'troff' was first documented in "A
Typesetter-independent TROFF", by Brian Kernighan, and by 1992 the AT&T
'troff' manual was updated to incorporate a description of it.
'groff''s page description language is compatible with this
specification except in the following aspects.
* AT&T device-independent 'troff''s quasi-device independence is not
yet implemented.
* The printing hardware of the early 1980s differed from today's.
'groff''s output device names also differ from those of AT&T
'troff'. For example, the PostScript device in AT&T 'troff',
'post' (implemented by the driver command 'dpost'), has a
resolution of only 720 units per inch, suitable for printers of
decades past. 'groff''s 'ps' device has a resolution of 72000
units per inch. In principle, by implementing a rescaling
mechanism, 'groff' could come to emulate AT&T's 'post' device.
* While the B-spline command 'D~' is reliably interpreted by
'groff''s page description language parser, some output drivers
don't implement drawing routines for it.
* In GNU 'troff', the argument to the commands 's' and 'x H' uses an
implicit unit of scaled points 'z' whereas AT&T 'troff' uses
spacing points 'p'. This isn't an incompatibility, but a
compatible extension, for both units coincide for any device
without a 'sizescale' directive in its 'DESC' file, including all
postprocessors from AT&T and 'groff''s text ('nroff'-mode) devices.
'groff' devices that use 'sizescale' either do not exist for AT&T
'troff', have a different name, or seem to have a different
resolution. So conflicts are very unlikely.
* The drawing position after the commands 'Dp', 'DP', and 'Dt' are
processed is illogical. Since old versions of GNU 'troff' had this
wart, we've retained it for compatibility, but may change it in the
future. Wrap these drawing commands with the '\Z' escape sequence
to both overcome the illogical positioning and keep your input
working consistently regardless of the wart's presence in the
implementation.
Appendix A Copying This Manual
******************************
Version 1.3, 3 November 2008
Copyright © 2000-2018 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
0. PREAMBLE
The purpose of this License is to make a manual, textbook, or other
functional and useful document "free" in the sense of freedom: to
assure everyone the effective freedom to copy and redistribute it,
with or without modifying it, either commercially or
noncommercially. Secondarily, this License preserves for the
author and publisher a way to get credit for their work, while not
being considered responsible for modifications made by others.
This License is a kind of "copyleft", which means that derivative
works of the document must themselves be free in the same sense.
It complements the GNU General Public License, which is a copyleft
license designed for free software.
We have designed this License in order to use it for manuals for
free software, because free software needs free documentation: a
free program should come with manuals providing the same freedoms
that the software does. But this License is not limited to
software manuals; it can be used for any textual work, regardless
of subject matter or whether it is published as a printed book. We
recommend this License principally for works whose purpose is
instruction or reference.
1. APPLICABILITY AND DEFINITIONS
This License applies to any manual or other work, in any medium,
that contains a notice placed by the copyright holder saying it can
be distributed under the terms of this License. Such a notice
grants a world-wide, royalty-free license, unlimited in duration,
to use that work under the conditions stated herein. The
"Document", below, refers to any such manual or work. Any member
of the public is a licensee, and is addressed as "you". You accept
the license if you copy, modify or distribute the work in a way
requiring permission under copyright law.
A "Modified Version" of the Document means any work containing the
Document or a portion of it, either copied verbatim, or with
modifications and/or translated into another language.
A "Secondary Section" is a named appendix or a front-matter section
of the Document that deals exclusively with the relationship of the
publishers or authors of the Document to the Document's overall
subject (or to related matters) and contains nothing that could
fall directly within that overall subject. (Thus, if the Document
is in part a textbook of mathematics, a Secondary Section may not
explain any mathematics.) The relationship could be a matter of
historical connection with the subject or with related matters, or
of legal, commercial, philosophical, ethical or political position
regarding them.
The "Invariant Sections" are certain Secondary Sections whose
titles are designated, as being those of Invariant Sections, in the
notice that says that the Document is released under this License.
If a section does not fit the above definition of Secondary then it
is not allowed to be designated as Invariant. The Document may
contain zero Invariant Sections. If the Document does not identify
any Invariant Sections then there are none.
The "Cover Texts" are certain short passages of text that are
listed, as Front-Cover Texts or Back-Cover Texts, in the notice
that says that the Document is released under this License. A
Front-Cover Text may be at most 5 words, and a Back-Cover Text may
be at most 25 words.
A "Transparent" copy of the Document means a machine-readable copy,
represented in a format whose specification is available to the
general public, that is suitable for revising the document
straightforwardly with generic text editors or (for images composed
of pixels) generic paint programs or (for drawings) some widely
available drawing editor, and that is suitable for input to text
formatters or for automatic translation to a variety of formats
suitable for input to text formatters. A copy made in an otherwise
Transparent file format whose markup, or absence of markup, has
been arranged to thwart or discourage subsequent modification by
readers is not Transparent. An image format is not Transparent if
used for any substantial amount of text. A copy that is not
"Transparent" is called "Opaque".
Examples of suitable formats for Transparent copies include plain
ASCII without markup, Texinfo input format, LaTeX input format,
SGML or XML using a publicly available DTD, and standard-conforming
simple HTML, PostScript or PDF designed for human modification.
Examples of transparent image formats include PNG, XCF and JPG.
Opaque formats include proprietary formats that can be read and
edited only by proprietary word processors, SGML or XML for which
the DTD and/or processing tools are not generally available, and
the machine-generated HTML, PostScript or PDF produced by some word
processors for output purposes only.
The "Title Page" means, for a printed book, the title page itself,
plus such following pages as are needed to hold, legibly, the
material this License requires to appear in the title page. For
works in formats which do not have any title page as such, "Title
Page" means the text near the most prominent appearance of the
work's title, preceding the beginning of the body of the text.
The "publisher" means any person or entity that distributes copies
of the Document to the public.
A section "Entitled XYZ" means a named subunit of the Document
whose title either is precisely XYZ or contains XYZ in parentheses
following text that translates XYZ in another language. (Here XYZ
stands for a specific section name mentioned below, such as
"Acknowledgements", "Dedications", "Endorsements", or "History".)
To "Preserve the Title" of such a section when you modify the
Document means that it remains a section "Entitled XYZ" according
to this definition.
The Document may include Warranty Disclaimers next to the notice
which states that this License applies to the Document. These
Warranty Disclaimers are considered to be included by reference in
this License, but only as regards disclaiming warranties: any other
implication that these Warranty Disclaimers may have is void and
has no effect on the meaning of this License.
2. VERBATIM COPYING
You may copy and distribute the Document in any medium, either
commercially or noncommercially, provided that this License, the
copyright notices, and the license notice saying this License
applies to the Document are reproduced in all copies, and that you
add no other conditions whatsoever to those of this License. You
may not use technical measures to obstruct or control the reading
or further copying of the copies you make or distribute. However,
you may accept compensation in exchange for copies. If you
distribute a large enough number of copies you must also follow the
conditions in section 3.
You may also lend copies, under the same conditions stated above,
and you may publicly display copies.
3. COPYING IN QUANTITY
If you publish printed copies (or copies in media that commonly
have printed covers) of the Document, numbering more than 100, and
the Document's license notice requires Cover Texts, you must
enclose the copies in covers that carry, clearly and legibly, all
these Cover Texts: Front-Cover Texts on the front cover, and
Back-Cover Texts on the back cover. Both covers must also clearly
and legibly identify you as the publisher of these copies. The
front cover must present the full title with all words of the title
equally prominent and visible. You may add other material on the
covers in addition. Copying with changes limited to the covers, as
long as they preserve the title of the Document and satisfy these
conditions, can be treated as verbatim copying in other respects.
If the required texts for either cover are too voluminous to fit
legibly, you should put the first ones listed (as many as fit
reasonably) on the actual cover, and continue the rest onto
adjacent pages.
If you publish or distribute Opaque copies of the Document
numbering more than 100, you must either include a machine-readable
Transparent copy along with each Opaque copy, or state in or with
each Opaque copy a computer-network location from which the general
network-using public has access to download using public-standard
network protocols a complete Transparent copy of the Document, free
of added material. If you use the latter option, you must take
reasonably prudent steps, when you begin distribution of Opaque
copies in quantity, to ensure that this Transparent copy will
remain thus accessible at the stated location until at least one
year after the last time you distribute an Opaque copy (directly or
through your agents or retailers) of that edition to the public.
It is requested, but not required, that you contact the authors of
the Document well before redistributing any large number of copies,
to give them a chance to provide you with an updated version of the
Document.
4. MODIFICATIONS
You may copy and distribute a Modified Version of the Document
under the conditions of sections 2 and 3 above, provided that you
release the Modified Version under precisely this License, with the
Modified Version filling the role of the Document, thus licensing
distribution and modification of the Modified Version to whoever
possesses a copy of it. In addition, you must do these things in
the Modified Version:
A. Use in the Title Page (and on the covers, if any) a title
distinct from that of the Document, and from those of previous
versions (which should, if there were any, be listed in the
History section of the Document). You may use the same title
as a previous version if the original publisher of that
version gives permission.
B. List on the Title Page, as authors, one or more persons or
entities responsible for authorship of the modifications in
the Modified Version, together with at least five of the
principal authors of the Document (all of its principal
authors, if it has fewer than five), unless they release you
from this requirement.
C. State on the Title page the name of the publisher of the
Modified Version, as the publisher.
D. Preserve all the copyright notices of the Document.
E. Add an appropriate copyright notice for your modifications
adjacent to the other copyright notices.
F. Include, immediately after the copyright notices, a license
notice giving the public permission to use the Modified
Version under the terms of this License, in the form shown in
the Addendum below.
G. Preserve in that license notice the full lists of Invariant
Sections and required Cover Texts given in the Document's
license notice.
H. Include an unaltered copy of this License.
I. Preserve the section Entitled "History", Preserve its Title,
and add to it an item stating at least the title, year, new
authors, and publisher of the Modified Version as given on the
Title Page. If there is no section Entitled "History" in the
Document, create one stating the title, year, authors, and
publisher of the Document as given on its Title Page, then add
an item describing the Modified Version as stated in the
previous sentence.
J. Preserve the network location, if any, given in the Document
for public access to a Transparent copy of the Document, and
likewise the network locations given in the Document for
previous versions it was based on. These may be placed in the
"History" section. You may omit a network location for a work
that was published at least four years before the Document
itself, or if the original publisher of the version it refers
to gives permission.
K. For any section Entitled "Acknowledgements" or "Dedications",
Preserve the Title of the section, and preserve in the section
all the substance and tone of each of the contributor
acknowledgements and/or dedications given therein.
L. Preserve all the Invariant Sections of the Document, unaltered
in their text and in their titles. Section numbers or the
equivalent are not considered part of the section titles.
M. Delete any section Entitled "Endorsements". Such a section
may not be included in the Modified Version.
N. Do not retitle any existing section to be Entitled
"Endorsements" or to conflict in title with any Invariant
Section.
O. Preserve any Warranty Disclaimers.
If the Modified Version includes new front-matter sections or
appendices that qualify as Secondary Sections and contain no
material copied from the Document, you may at your option designate
some or all of these sections as invariant. To do this, add their
titles to the list of Invariant Sections in the Modified Version's
license notice. These titles must be distinct from any other
section titles.
You may add a section Entitled "Endorsements", provided it contains
nothing but endorsements of your Modified Version by various
parties--for example, statements of peer review or that the text
has been approved by an organization as the authoritative
definition of a standard.
You may add a passage of up to five words as a Front-Cover Text,
and a passage of up to 25 words as a Back-Cover Text, to the end of
the list of Cover Texts in the Modified Version. Only one passage
of Front-Cover Text and one of Back-Cover Text may be added by (or
through arrangements made by) any one entity. If the Document
already includes a cover text for the same cover, previously added
by you or by arrangement made by the same entity you are acting on
behalf of, you may not add another; but you may replace the old
one, on explicit permission from the previous publisher that added
the old one.
The author(s) and publisher(s) of the Document do not by this
License give permission to use their names for publicity for or to
assert or imply endorsement of any Modified Version.
5. COMBINING DOCUMENTS
You may combine the Document with other documents released under
this License, under the terms defined in section 4 above for
modified versions, provided that you include in the combination all
of the Invariant Sections of all of the original documents,
unmodified, and list them all as Invariant Sections of your
combined work in its license notice, and that you preserve all
their Warranty Disclaimers.
The combined work need only contain one copy of this License, and
multiple identical Invariant Sections may be replaced with a single
copy. If there are multiple Invariant Sections with the same name
but different contents, make the title of each such section unique
by adding at the end of it, in parentheses, the name of the
original author or publisher of that section if known, or else a
unique number. Make the same adjustment to the section titles in
the list of Invariant Sections in the license notice of the
combined work.
In the combination, you must combine any sections Entitled
"History" in the various original documents, forming one section
Entitled "History"; likewise combine any sections Entitled
"Acknowledgements", and any sections Entitled "Dedications". You
must delete all sections Entitled "Endorsements."
6. COLLECTIONS OF DOCUMENTS
You may make a collection consisting of the Document and other
documents released under this License, and replace the individual
copies of this License in the various documents with a single copy
that is included in the collection, provided that you follow the
rules of this License for verbatim copying of each of the documents
in all other respects.
You may extract a single document from such a collection, and
distribute it individually under this License, provided you insert
a copy of this License into the extracted document, and follow this
License in all other respects regarding verbatim copying of that
document.
7. AGGREGATION WITH INDEPENDENT WORKS
A compilation of the Document or its derivatives with other
separate and independent documents or works, in or on a volume of a
storage or distribution medium, is called an "aggregate" if the
copyright resulting from the compilation is not used to limit the
legal rights of the compilation's users beyond what the individual
works permit. When the Document is included in an aggregate, this
License does not apply to the other works in the aggregate which
are not themselves derivative works of the Document.
If the Cover Text requirement of section 3 is applicable to these
copies of the Document, then if the Document is less than one half
of the entire aggregate, the Document's Cover Texts may be placed
on covers that bracket the Document within the aggregate, or the
electronic equivalent of covers if the Document is in electronic
form. Otherwise they must appear on printed covers that bracket
the whole aggregate.
8. TRANSLATION
Translation is considered a kind of modification, so you may
distribute translations of the Document under the terms of section
4. Replacing Invariant Sections with translations requires special
permission from their copyright holders, but you may include
translations of some or all Invariant Sections in addition to the
original versions of these Invariant Sections. You may include a
translation of this License, and all the license notices in the
Document, and any Warranty Disclaimers, provided that you also
include the original English version of this License and the
original versions of those notices and disclaimers. In case of a
disagreement between the translation and the original version of
this License or a notice or disclaimer, the original version will
prevail.
If a section in the Document is Entitled "Acknowledgements",
"Dedications", or "History", the requirement (section 4) to
Preserve its Title (section 1) will typically require changing the
actual title.
9. TERMINATION
You may not copy, modify, sublicense, or distribute the Document
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense, or distribute it is void,
and will automatically terminate your rights under this License.
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the
copyright holder fails to notify you of the violation by some
reasonable means prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from
that copyright holder, and you cure the violation prior to 30 days
after your receipt of the notice.
Termination of your rights under this section does not terminate
the licenses of parties who have received copies or rights from you
under this License. If your rights have been terminated and not
permanently reinstated, receipt of a copy of some or all of the
same material does not give you any rights to use it.
10. FUTURE REVISIONS OF THIS LICENSE
The Free Software Foundation may publish new, revised versions of
the GNU Free Documentation License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns. See
.
Each version of the License is given a distinguishing version
number. If the Document specifies that a particular numbered
version of this License "or any later version" applies to it, you
have the option of following the terms and conditions either of
that specified version or of any later version that has been
published (not as a draft) by the Free Software Foundation. If the
Document does not specify a version number of this License, you may
choose any version ever published (not as a draft) by the Free
Software Foundation. If the Document specifies that a proxy can
decide which future versions of this License can be used, that
proxy's public statement of acceptance of a version permanently
authorizes you to choose that version for the Document.
11. RELICENSING
"Massive Multiauthor Collaboration Site" (or "MMC Site") means any
World Wide Web server that publishes copyrightable works and also
provides prominent facilities for anybody to edit those works. A
public wiki that anybody can edit is an example of such a server.
A "Massive Multiauthor Collaboration" (or "MMC") contained in the
site means any set of copyrightable works thus published on the MMC
site.
"CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0
license published by Creative Commons Corporation, a not-for-profit
corporation with a principal place of business in San Francisco,
California, as well as future copyleft versions of that license
published by that same organization.
"Incorporate" means to publish or republish a Document, in whole or
in part, as part of another Document.
An MMC is "eligible for relicensing" if it is licensed under this
License, and if all works that were first published under this
License somewhere other than this MMC, and subsequently
incorporated in whole or in part into the MMC, (1) had no cover
texts or invariant sections, and (2) were thus incorporated prior
to November 1, 2008.
The operator of an MMC Site may republish an MMC contained in the
site under CC-BY-SA on the same site at any time before August 1,
2009, provided the MMC is eligible for relicensing.
ADDENDUM: How to use this License for your documents
====================================================
To use this License in a document you have written, include a copy of
the License in the document and put the following copyright and license
notices just after the title page:
Copyright (C) YEAR YOUR NAME.
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''.
If you have Invariant Sections, Front-Cover Texts and Back-Cover
Texts, replace the "with...Texts." line with this:
with the Invariant Sections being LIST THEIR TITLES, with
the Front-Cover Texts being LIST, and with the Back-Cover Texts
being LIST.
If you have Invariant Sections without Cover Texts, or some other
combination of the three, merge those two alternatives to suit the
situation.
If your document contains nontrivial examples of program code, we
recommend releasing these examples in parallel under your choice of free
software license, such as the GNU General Public License, to permit
their use in free software.
Appendix B Request Index
************************
Request names appear without a leading control character; the defaults
are '.' for the regular control character and ''' for the no-break
control character. *Note Invoking Requests::.
* Menu:
* ab: Debugging. (line 12979)
* ad: Manipulating Filling and Adjustment.
(line 5889)
* af: Assigning Register Formats.
(line 5653)
* aln: Setting Registers. (line 5552)
* als: Strings. (line 9491)
* am: Writing Macros. (line 10058)
* am1: Writing Macros. (line 10059)
* ami: Writing Macros. (line 10060)
* ami1: Writing Macros. (line 10061)
* as: Strings. (line 9391)
* as1: Strings. (line 9392)
* asciify: Diversions. (line 11909)
* backtrace: Debugging. (line 13115)
* bd: Artificial Fonts. (line 8644)
* blm: Blank Line Traps. (line 11539)
* box: Diversions. (line 11735)
* boxa: Diversions. (line 11736)
* bp: Page Control. (line 7488)
* br: Manipulating Filling and Adjustment.
(line 5845)
* break: while. (line 9921)
* brp: Manipulating Filling and Adjustment.
(line 5966)
* c2: Control Characters.
(line 4917)
* cc: Control Characters.
(line 4909)
* ce: Manipulating Filling and Adjustment.
(line 6039)
* cf: Host System Service Access.
(line 12409)
* cflags: Characters and Glyphs.
(line 8253)
* ch: Page Location Traps.
(line 11276)
* char: Characters and Glyphs.
(line 8348)
* chop: Strings. (line 9438)
* class: Character Classes. (line 8476)
* close: Host System Service Access.
(line 12604)
* color: Colors. (line 9165)
* composite: Characters and Glyphs.
(line 8203)
* continue: while. (line 9925)
* cp: Compatibility Mode.
(line 13364)
* cs: Artificial Fonts. (line 8676)
* cu: Artificial Fonts. (line 8634)
* da: Diversions. (line 11702)
* de: Writing Macros. (line 9946)
* de1: Writing Macros. (line 10018)
* defcolor: Colors. (line 9177)
* dei: Writing Macros. (line 10040)
* dei1: Writing Macros. (line 10041)
* device: Postprocessor Access.
(line 12652)
* devicem: Postprocessor Access.
(line 12706)
* di: Diversions. (line 11701)
* do: Compatibility Mode.
(line 13378)
* ds: ms Document Control Settings.
(line 1858)
* ds <1>: Strings. (line 9289)
* ds1: Strings. (line 9290)
* dt: Diversion Traps. (line 11418)
* ec: Using Escape Sequences.
(line 5188)
* ecr: Using Escape Sequences.
(line 5216)
* ecs: Using Escape Sequences.
(line 5215)
* el: if-else. (line 9741)
* em: End-of-input Traps.
(line 11569)
* eo: Using Escape Sequences.
(line 5183)
* ev: Environments. (line 12113)
* evc: Environments. (line 12167)
* ex: Debugging. (line 12987)
* fam: Font Families. (line 7822)
* fc: Fields. (line 7026)
* fchar: Characters and Glyphs.
(line 8349)
* fcolor: Colors. (line 9239)
* fi: Manipulating Filling and Adjustment.
(line 5872)
* fl: Debugging. (line 13088)
* fp: Font Positions. (line 7909)
* fschar: Characters and Glyphs.
(line 8350)
* fspecial: Special Fonts. (line 8524)
* ft: Selecting Fonts. (line 7694)
* ftr: Selecting Fonts. (line 7759)
* fzoom: Selecting Fonts. (line 7770)
* gcolor: Colors. (line 9212)
* hc: Manipulating Hyphenation.
(line 6263)
* hcode: Manipulating Hyphenation.
(line 6501)
* hla: Manipulating Hyphenation.
(line 6554)
* hlm: Manipulating Hyphenation.
(line 6571)
* hpf: Manipulating Hyphenation.
(line 6430)
* hpfa: Manipulating Hyphenation.
(line 6431)
* hpfcode: Manipulating Hyphenation.
(line 6539)
* hw: Manipulating Hyphenation.
(line 6189)
* hy: Manipulating Hyphenation.
(line 6295)
* hydefault: Manipulating Hyphenation.
(line 6422)
* hym: Manipulating Hyphenation.
(line 6585)
* hys: Manipulating Hyphenation.
(line 6600)
* ie: if-else. (line 9740)
* if: if-then. (line 9698)
* ig: Comments. (line 5386)
* in: Line Layout. (line 7251)
* it: Input Line Traps. (line 11429)
* kern: Ligatures and Kerning.
(line 8731)
* lc: Leaders. (line 6983)
* length: Strings. (line 9413)
* lf: Debugging. (line 12950)
* lg: Ligatures and Kerning.
(line 8713)
* linetabs: Tabs and Fields. (line 6940)
* ll: Line Layout. (line 7292)
* ls: Manipulating Spacing.
(line 6712)
* lsm: Leading Space Traps.
(line 11549)
* lt: Page Layout. (line 7447)
* mc: Output Line Annotation.
(line 10800)
* mk: Page Motions. (line 10415)
* mso: Host System Service Access.
(line 12401)
* msoquiet: Host System Service Access.
(line 12402)
* na: Manipulating Filling and Adjustment.
(line 5956)
* ne: Page Control. (line 7520)
* nf: Manipulating Filling and Adjustment.
(line 5880)
* nh: Manipulating Hyphenation.
(line 6415)
* nm: Output Line Annotation.
(line 10697)
* nn: Output Line Annotation.
(line 10762)
* nop: if-then. (line 9717)
* nr: ms Document Control Settings.
(line 1855)
* nr <1>: Setting Registers. (line 5445)
* nr <2>: Setting Registers. (line 5502)
* nr <3>: Auto-increment. (line 5606)
* nroff: troff and nroff Modes.
(line 7162)
* ns: Manipulating Spacing.
(line 6782)
* nx: Host System Service Access.
(line 12451)
* open: Host System Service Access.
(line 12570)
* opena: Host System Service Access.
(line 12571)
* os: Page Control. (line 7564)
* output: Diversions. (line 11892)
* pc: Page Layout. (line 7464)
* pchar: Debugging. (line 13005)
* pcolor: Debugging. (line 13013)
* pcomposite: Debugging. (line 13020)
* pev: Debugging. (line 13026)
* pfp: Debugging. (line 13030)
* pftr: Debugging. (line 13040)
* phw: Debugging. (line 13046)
* pi: Host System Service Access.
(line 12509)
* pl: Page Layout. (line 7401)
* pline: Debugging. (line 13056)
* pm: Debugging. (line 13063)
* pn: Page Layout. (line 7415)
* pnr: Debugging. (line 13069)
* po: Line Layout. (line 7226)
* ps: Changing the Type Size.
(line 8922)
* ps <1>: Changing the Type Size.
(line 8924)
* psbb: Miscellaneous. (line 12745)
* pso: Host System Service Access.
(line 12390)
* pstream: Debugging. (line 13075)
* pvs: Changing the Vertical Spacing.
(line 9046)
* pwh: Debugging. (line 13081)
* rchar: Characters and Glyphs.
(line 8423)
* rd: Host System Service Access.
(line 12455)
* return: Writing Macros. (line 10095)
* rfschar: Characters and Glyphs.
(line 8424)
* rj: Manipulating Filling and Adjustment.
(line 6079)
* rm: Strings. (line 9483)
* rn: Strings. (line 9480)
* rnn: Setting Registers. (line 5547)
* rr: Setting Registers. (line 5538)
* rs: Manipulating Spacing.
(line 6783)
* rt: Page Motions. (line 10416)
* schar: Characters and Glyphs.
(line 8351)
* shc: Manipulating Hyphenation.
(line 6272)
* shift: Parameters. (line 10143)
* sizes: Changing the Type Size.
(line 8989)
* so: Host System Service Access.
(line 12359)
* soquiet: Host System Service Access.
(line 12360)
* sp: Manipulating Spacing.
(line 6662)
* special: Special Fonts. (line 8523)
* spreadwarn: Debugging. (line 13148)
* ss: Manipulating Filling and Adjustment.
(line 6099)
* stringdown: Strings. (line 9464)
* stringup: Strings. (line 9465)
* sty: Font Families. (line 7864)
* substring: Strings. (line 9446)
* sv: Page Control. (line 7563)
* sy: Host System Service Access.
(line 12542)
* ta: Tabs and Fields. (line 6820)
* tag: Postprocessor Access.
(line 12727)
* taga: Postprocessor Access.
(line 12728)
* tc: Tabs and Fields. (line 6928)
* ti: Line Layout. (line 7273)
* tkf: Ligatures and Kerning.
(line 8752)
* tl: Page Layout. (line 7432)
* tm: Debugging. (line 12966)
* tm1: Debugging. (line 12967)
* tmc: Debugging. (line 12968)
* tr: Character Translations.
(line 7051)
* trf: Host System Service Access.
(line 12408)
* trin: Character Translations.
(line 7052)
* trnt: Character Translations.
(line 7117)
* troff: troff and nroff Modes.
(line 7154)
* uf: Artificial Fonts. (line 8638)
* ul: Artificial Fonts. (line 8612)
* unformat: Diversions. (line 11942)
* vpt: Vertical Position Traps.
(line 11136)
* vs: Changing the Vertical Spacing.
(line 9006)
* warn: Debugging. (line 13166)
* warnscale: Debugging. (line 13142)
* wh: Page Location Traps.
(line 11156)
* while: while. (line 9859)
* write: Host System Service Access.
(line 12586)
* writec: Host System Service Access.
(line 12587)
* writem: Host System Service Access.
(line 12595)
Appendix C Escape Sequence Index
********************************
The escape character, '\' by default, is always followed by at least one
more input character, making an escape _sequence_. Any token '\X' with
X not in the list below emits a warning and interpolates character X.
Note the entries for '\.', which may be obscured by the leader dots, and
for '\' and '\', which are sorted alphabetically, not by code
point order. *Note Using Escape Sequences::.
* Menu:
* \: Using Escape Sequences.
(line 5119)
* \ <1>: Characters and Glyphs.
(line 8133)
* \!: Diversions. (line 11850)
* \": Comments. (line 5326)
* \#: Comments. (line 5366)
* \$: Parameters. (line 10134)
* \$*: Parameters. (line 10156)
* \$0: Parameters. (line 10191)
* \$@: Parameters. (line 10157)
* \$^: Parameters. (line 10158)
* \%: Manipulating Hyphenation.
(line 6230)
* \&: Dummy Characters. (line 8807)
* \': Characters and Glyphs.
(line 8238)
* \(: Characters and Glyphs.
(line 8135)
* \): Dummy Characters. (line 8865)
* \*: Strings. (line 9291)
* \,: Italic Corrections.
(line 8788)
* \-: Characters and Glyphs.
(line 8245)
* \.: Copy Mode. (line 10282)
* \/: Italic Corrections.
(line 8776)
* \0: Page Motions. (line 10572)
* \:: Manipulating Hyphenation.
(line 6231)
* \?: Diversions. (line 11851)
* \A: Identifiers. (line 4795)
* \a: Leaders. (line 6980)
* \B: Numeric Expressions.
(line 4698)
* \b: Drawing Geometric Objects.
(line 11038)
* \c: Line Continuation. (line 7356)
* \C: Characters and Glyphs.
(line 8194)
* \d: Page Motions. (line 10516)
* \D: Drawing Geometric Objects.
(line 10944)
* \e: Using Escape Sequences.
(line 5175)
* \E: Copy Mode. (line 10342)
* \f: Selecting Fonts. (line 7695)
* \F: Font Families. (line 7824)
* \g: Assigning Register Formats.
(line 5711)
* \H: Artificial Fonts. (line 8551)
* \h: Page Motions. (line 10533)
* \k: Page Motions. (line 10640)
* \l: Drawing Geometric Objects.
(line 10871)
* \L: Drawing Geometric Objects.
(line 10896)
* \m: Colors. (line 9213)
* \M: Colors. (line 9240)
* \n: Interpolating Registers.
(line 5570)
* \n <1>: Auto-increment. (line 5614)
* \N: Characters and Glyphs.
(line 8217)
* \newline: Line Continuation. (line 7327)
* \o: Page Motions. (line 10659)
* \O: Suppressing Output.
(line 12219)
* \p: Manipulating Filling and Adjustment.
(line 5967)
* \R: Setting Registers. (line 5446)
* \R <1>: Setting Registers. (line 5504)
* \r: Page Motions. (line 10514)
* \: Line Continuation. (line 7327)
* \S: Artificial Fonts. (line 8589)
* \s: Changing the Type Size.
(line 8944)
* \space: Page Motions. (line 10556)
* \: Page Motions. (line 10556)
* \t: Tabs and Fields. (line 6817)
* \u: Page Motions. (line 10515)
* \v: Page Motions. (line 10489)
* \V: Host System Service Access.
(line 12620)
* \w: Page Motions. (line 10578)
* \x: Manipulating Spacing.
(line 6735)
* \X: Postprocessor Access.
(line 12653)
* \Y: Postprocessor Access.
(line 12707)
* \z: Page Motions. (line 10664)
* \Z: Page Motions. (line 10669)
* \[: Characters and Glyphs.
(line 8135)
* \\: Copy Mode. (line 10255)
* \^: Page Motions. (line 10567)
* \_: Characters and Glyphs.
(line 8248)
* \`: Characters and Glyphs.
(line 8242)
* \{: Conditional Blocks.
(line 9776)
* \{ <1>: Conditional Blocks.
(line 9777)
* \|: Page Motions. (line 10562)
* \}: Conditional Blocks.
(line 9777)
* \~: Manipulating Filling and Adjustment.
(line 5859)
Appendix D Operator Index
*************************
*Note Numeric Expressions::.
* Menu:
* !: Numeric Expressions.
(line 4602)
* %: Numeric Expressions.
(line 4535)
* &: Numeric Expressions.
(line 4598)
* (: Numeric Expressions.
(line 4622)
* ): Numeric Expressions.
(line 4622)
* *: Numeric Expressions.
(line 4535)
* +: Numeric Expressions.
(line 4535)
* + <1>: Numeric Expressions.
(line 4542)
* + (unary): Numeric Expressions.
(line 4633)
* -: Numeric Expressions.
(line 4535)
* - <1>: Numeric Expressions.
(line 4542)
* - (unary): Numeric Expressions.
(line 4633)
* /: Numeric Expressions.
(line 4535)
* ;: Numeric Expressions.
(line 4565)
* <: Numeric Expressions.
(line 4592)
* <=: Numeric Expressions.
(line 4592)
* : Numeric Expressions.
(line 4598)
* =: Numeric Expressions.
(line 4592)
* ==: Numeric Expressions.
(line 4592)
* >: Numeric Expressions.
(line 4592)
* >=: Numeric Expressions.
(line 4592)
* >?: Numeric Expressions.
(line 4583)
* |: Numeric Expressions.
(line 4647)
Appendix E Register Index
*************************
Where not used by the formatter itself, a register's associated macro
package or program appears in brackets after the register's name.
Interpolate a register name of exactly one character 'x' with '\nx';
of exactly two characters 'xx' with '\n(xx'; or of any length 'xxx' with
'\n[xxx]'. *Note Registers::.
* Menu:
* $$: Host System Service Access.
(line 12282)
* $$ <1>: Host System Service Access.
(line 12282)
* %: Page Layout. (line 7464)
* % <1>: Page Control. (line 7491)
* .$: Parameters. (line 10126)
* .A: Built-in Registers.
(line 5760)
* .a: Manipulating Spacing.
(line 6736)
* .b: Artificial Fonts. (line 8646)
* .br: Control Characters.
(line 4930)
* .c: Built-in Registers.
(line 5764)
* .C: Compatibility Mode.
(line 13365)
* .cdp: Environments. (line 12194)
* .ce: Manipulating Filling and Adjustment.
(line 6040)
* .cht: Environments. (line 12193)
* .color: Colors. (line 9166)
* .cp: Compatibility Mode.
(line 13379)
* .csk: Environments. (line 12195)
* .d: Diversions. (line 11764)
* .ev: Environments. (line 12114)
* .F: Built-in Registers.
(line 5769)
* .f: Font Positions. (line 7910)
* .fam: Font Families. (line 7823)
* .fn: Selecting Fonts. (line 7698)
* .fp: Font Positions. (line 7911)
* .g: Built-in Registers.
(line 5772)
* .H: Motion Quanta. (line 4466)
* .h: Diversions. (line 11791)
* .height: Artificial Fonts. (line 8554)
* .hla: Manipulating Hyphenation.
(line 6555)
* .hlc: Manipulating Hyphenation.
(line 6573)
* .hlm: Manipulating Hyphenation.
(line 6572)
* .hy: Manipulating Hyphenation.
(line 6296)
* .hydefault: Manipulating Hyphenation.
(line 6423)
* .hym: Manipulating Hyphenation.
(line 6586)
* .hys: Manipulating Hyphenation.
(line 6601)
* .i: Line Layout. (line 7254)
* .in: Line Layout. (line 7276)
* .int: Line Continuation. (line 7357)
* .itm: Input Line Traps. (line 11433)
* .j: Manipulating Filling and Adjustment.
(line 5890)
* .k: Page Motions. (line 10655)
* .kern: Ligatures and Kerning.
(line 8732)
* .L: Manipulating Spacing.
(line 6713)
* .l: Line Layout. (line 7295)
* .lg: Ligatures and Kerning.
(line 8714)
* .linetabs: Tabs and Fields. (line 6941)
* .ll: Line Layout. (line 7296)
* .lt: Page Layout. (line 7450)
* .m: Colors. (line 9216)
* .M: Colors. (line 9243)
* .n: Environments. (line 12210)
* .ne: Page Location Traps.
(line 11327)
* .nm: Output Line Annotation.
(line 10699)
* .nn: Output Line Annotation.
(line 10763)
* .ns: Manipulating Spacing.
(line 6784)
* .o: Line Layout. (line 7229)
* .O: Suppressing Output.
(line 12272)
* .P: Built-in Registers.
(line 5776)
* .p: Page Layout. (line 7404)
* .pe: Page Location Traps.
(line 11350)
* .pn: Page Layout. (line 7418)
* .ps: Using Fractional Type Sizes.
(line 9088)
* .psr: Using Fractional Type Sizes.
(line 9116)
* .pvs: Changing the Vertical Spacing.
(line 9049)
* .R: Built-in Registers.
(line 5780)
* .rj: Manipulating Filling and Adjustment.
(line 6080)
* .s: Changing the Type Size.
(line 8925)
* .slant: Artificial Fonts. (line 8590)
* .sr: Using Fractional Type Sizes.
(line 9117)
* .ss: Manipulating Filling and Adjustment.
(line 6100)
* .sss: Manipulating Filling and Adjustment.
(line 6101)
* .sty: Font Families. (line 7865)
* .T: Built-in Registers.
(line 5787)
* .t: Page Location Traps.
(line 11268)
* .tabs: Tabs and Fields. (line 6821)
* .trap: Page Location Traps.
(line 11346)
* .trunc: Page Location Traps.
(line 11335)
* .U: Built-in Registers.
(line 5791)
* .u: Manipulating Filling and Adjustment.
(line 5873)
* .V: Motion Quanta. (line 4467)
* .v: Changing the Vertical Spacing.
(line 9009)
* .vpt: Vertical Position Traps.
(line 11137)
* .w: Environments. (line 12192)
* .warn: Debugging. (line 13167)
* .x: Built-in Registers.
(line 5795)
* .y: Built-in Registers.
(line 5799)
* .Y: Built-in Registers.
(line 5803)
* .z: Diversions. (line 11763)
* .zoom: Selecting Fonts. (line 7771)
* c.: Built-in Registers.
(line 5765)
* ct: Page Motions. (line 10583)
* DD [ms]: ms Document Control Settings.
(line 2145)
* DI [ms]: ms Document Control Settings.
(line 2154)
* dl: Diversions. (line 11810)
* dn: Diversions. (line 11809)
* dw: Host System Service Access.
(line 12300)
* dy: Host System Service Access.
(line 12303)
* FF [ms]: ms Document Control Settings.
(line 2085)
* FI [ms]: ms Document Control Settings.
(line 2078)
* FM [ms]: ms Document Control Settings.
(line 1903)
* FPD [ms]: ms Document Control Settings.
(line 2126)
* FPS [ms]: ms Document Control Settings.
(line 2112)
* FVS [ms]: ms Document Control Settings.
(line 2119)
* GROWPS [ms]: ms Document Control Settings.
(line 2043)
* GS [ms]: Differences from AT&T ms.
(line 3443)
* HM [ms]: ms Document Control Settings.
(line 1896)
* HORPHANS [ms]: ms Document Control Settings.
(line 2054)
* hours: Host System Service Access.
(line 12297)
* hp: Page Motions. (line 10651)
* HY [ms]: ms Document Control Settings.
(line 1972)
* LL [ms]: ms Document Control Settings.
(line 1877)
* llx: Miscellaneous. (line 12746)
* lly: Miscellaneous. (line 12747)
* ln: Output Line Annotation.
(line 10698)
* lsn: Leading Space Traps.
(line 11550)
* lss: Leading Space Traps.
(line 11551)
* LT [ms]: ms Document Control Settings.
(line 1886)
* MINGW [ms]: ms Document Control Settings.
(line 2167)
* minutes: Host System Service Access.
(line 12294)
* mo: Host System Service Access.
(line 12306)
* nl: Page Control. (line 7574)
* opmaxx: Suppressing Output.
(line 12235)
* opmaxy: Suppressing Output.
(line 12235)
* opminx: Suppressing Output.
(line 12235)
* opminy: Suppressing Output.
(line 12235)
* PD [ms]: ms Document Control Settings.
(line 2001)
* PI [ms]: ms Document Control Settings.
(line 1993)
* PO [ms]: ms Document Control Settings.
(line 1868)
* PORPHANS [ms]: ms Document Control Settings.
(line 2016)
* PS [ms]: ms Document Control Settings.
(line 1958)
* PSINCR [ms]: ms Document Control Settings.
(line 2031)
* QI [ms]: ms Document Control Settings.
(line 2008)
* rsb: Page Motions. (line 10582)
* rst: Page Motions. (line 10581)
* sb: Page Motions. (line 10580)
* seconds: Host System Service Access.
(line 12291)
* skw: Page Motions. (line 10585)
* slimit: Debugging. (line 13136)
* ssc: Page Motions. (line 10584)
* st: Page Motions. (line 10579)
* systat: Host System Service Access.
(line 12543)
* TC-MARGIN [ms]: ms Document Control Settings.
(line 2175)
* urx: Miscellaneous. (line 12748)
* ury: Miscellaneous. (line 12749)
* VS [ms]: ms Document Control Settings.
(line 1965)
* year: Host System Service Access.
(line 12309)
* yr: Host System Service Access.
(line 12312)
Appendix F Macro Index
**********************
The package or program with which a macro is associated appears in
brackets after the macro's name. They appear without a leading control
character (normally '.'). *Note Calling Macros::.
* Menu:
* 1C [ms]: ms Multiple Columns.
(line 3208)
* 2C [ms]: ms Multiple Columns.
(line 3211)
* [ [ms]: ms Insertions. (line 2954)
* ] [ms]: ms Insertions. (line 2955)
* AB [ms]: ms Document Description Macros.
(line 2244)
* AE [ms]: ms Document Description Macros.
(line 2251)
* AI [ms]: ms Document Description Macros.
(line 2227)
* AM [ms]: ms Legacy Features. (line 3526)
* AU [ms]: ms Document Description Macros.
(line 2221)
* B [ms]: Typeface and decoration.
(line 2545)
* B1 [ms]: ms keeps and displays.
(line 2836)
* B2 [ms]: ms keeps and displays.
(line 2837)
* BD [ms]: ms keeps and displays.
(line 2876)
* BI [ms]: Typeface and decoration.
(line 2558)
* BT [man]: Optional man extensions.
(line 1493)
* BX [ms]: Typeface and decoration.
(line 2566)
* CD [ms]: ms keeps and displays.
(line 2882)
* CT [man]: Optional man extensions.
(line 1508)
* CW [man]: Optional man extensions.
(line 1511)
* CW [ms]: Typeface and decoration.
(line 2562)
* DA [ms]: ms Document Description Macros.
(line 2234)
* De [man]: Optional man extensions.
(line 1518)
* DE [ms]: ms keeps and displays.
(line 2891)
* Ds [man]: Optional man extensions.
(line 1515)
* DS [ms]: ms keeps and displays.
(line 2866)
* DS [ms] <1>: ms keeps and displays.
(line 2870)
* DS [ms] <2>: ms keeps and displays.
(line 2875)
* DS [ms] <3>: ms keeps and displays.
(line 2881)
* DS [ms] <4>: ms keeps and displays.
(line 2886)
* EE [man]: Optional man extensions.
(line 1525)
* EF [ms]: ms Headers and Footers.
(line 3152)
* EH [ms]: ms Headers and Footers.
(line 3150)
* EN [ms]: ms Insertions. (line 2947)
* EQ [ms]: ms Insertions. (line 2946)
* EX [man]: Optional man extensions.
(line 1521)
* FE [ms]: ms Footnotes. (line 3022)
* FS [ms]: ms Footnotes. (line 3021)
* G [man]: Optional man extensions.
(line 1528)
* GL [man]: Optional man extensions.
(line 1533)
* HB [man]: Optional man extensions.
(line 1538)
* I [ms]: Typeface and decoration.
(line 2555)
* ID [ms]: ms keeps and displays.
(line 2871)
* IP [ms]: Paragraphs in ms. (line 2350)
* KE [ms]: ms keeps and displays.
(line 2824)
* KF [ms]: ms keeps and displays.
(line 2823)
* KS [ms]: ms keeps and displays.
(line 2822)
* LD [ms]: ms keeps and displays.
(line 2867)
* LG [ms]: Typeface and decoration.
(line 2577)
* LP [ms]: Paragraphs in ms. (line 2343)
* MC [ms]: ms Multiple Columns.
(line 3214)
* MS [man]: Optional man extensions.
(line 1546)
* ND [ms]: ms Document Description Macros.
(line 2239)
* NE [man]: Optional man extensions.
(line 1558)
* NH [ms]: Headings in ms. (line 2417)
* NL [ms]: Typeface and decoration.
(line 2589)
* NT [man]: Optional man extensions.
(line 1551)
* OF [ms]: ms Headers and Footers.
(line 3151)
* OH [ms]: ms Headers and Footers.
(line 3149)
* P1 [ms]: ms Headers and Footers.
(line 3161)
* PE [ms]: ms Insertions. (line 2938)
* PF [ms]: ms Insertions. (line 2939)
* PN [man]: Optional man extensions.
(line 1561)
* Pn [man]: Optional man extensions.
(line 1565)
* PP [ms]: Paragraphs in ms. (line 2346)
* PS [ms]: ms Insertions. (line 2937)
* PT [man]: Optional man extensions.
(line 1488)
* PX [ms]: ms TOC. (line 3264)
* QE [ms]: Paragraphs in ms. (line 2363)
* QP [ms]: Paragraphs in ms. (line 2358)
* QS [ms]: Paragraphs in ms. (line 2362)
* R [man]: Optional man extensions.
(line 1571)
* R [ms]: Typeface and decoration.
(line 2551)
* RD [ms]: ms keeps and displays.
(line 2887)
* RE [ms]: Indented regions in ms.
(line 2772)
* RN [man]: Optional man extensions.
(line 1574)
* RP [ms]: ms Document Description Macros.
(line 2201)
* RS [ms]: Indented regions in ms.
(line 2768)
* SH [ms]: Headings in ms. (line 2489)
* SM [ms]: Typeface and decoration.
(line 2583)
* TA [ms]: Tab Stops in ms. (line 3186)
* TB [man]: Optional man extensions.
(line 1543)
* TC [ms]: ms TOC. (line 3269)
* TE [ms]: ms Insertions. (line 2928)
* TL [ms]: ms Document Description Macros.
(line 2216)
* TS [ms]: ms Insertions. (line 2927)
* UL [ms]: Typeface and decoration.
(line 2572)
* VE [man]: Optional man extensions.
(line 1581)
* VS [man]: Optional man extensions.
(line 1577)
* XA [ms]: ms TOC. (line 3253)
* XE [ms]: ms TOC. (line 3254)
* XH [ms]: ms TOC. (line 3305)
* XH-REPLACEMENT [ms]: ms TOC. (line 3314)
* XH-UPDATE-TOC [ms]: ms TOC. (line 3319)
* XN [ms]: ms TOC. (line 3304)
* XN-INIT [ms]: ms TOC. (line 3318)
* XN-REPLACEMENT [ms]: ms TOC. (line 3313)
* XP [ms]: Paragraphs in ms. (line 2369)
* XS [ms]: ms TOC. (line 3252)
Appendix G String Index
***********************
The macro package or program with which a string is associated appears
in brackets after the string's name. The formatter itself defines only
one string, '.T'.
Interpolate a string name of exactly one character 'x' with '\*x'; of
exactly two characters 'xx' with '\*(xx'; or of any length 'xxx' with
'\*[xxx]'. *Note Strings::.
* Menu:
* ! [ms]: ms Legacy Features. (line 3565)
* ' [ms]: ms Legacy Features. (line 3498)
* ' [ms] <1>: ms Legacy Features. (line 3529)
* * [ms]: ms Footnotes. (line 3012)
* , [ms]: ms Legacy Features. (line 3516)
* , [ms] <1>: ms Legacy Features. (line 3544)
* - [ms]: Typographical symbols in ms.
(line 2322)
* . [ms]: ms Legacy Features. (line 3556)
* .T: Strings. (line 9278)
* .T <1>: Strings. (line 9278)
* / [ms]: ms Legacy Features. (line 3547)
* 3 [ms]: ms Legacy Features. (line 3574)
* 8 [ms]: ms Legacy Features. (line 3568)
* : [ms]: ms Legacy Features. (line 3504)
* : [ms] <1>: ms Legacy Features. (line 3535)
* < [ms]: Typeface and decoration.
(line 2623)
* > [ms]: Typeface and decoration.
(line 2624)
* ? [ms]: ms Legacy Features. (line 3562)
* ^ [ms]: ms Legacy Features. (line 3507)
* ^ [ms] <1>: ms Legacy Features. (line 3538)
* _ [ms]: ms Legacy Features. (line 3553)
* ` [ms]: ms Legacy Features. (line 3501)
* ` [ms] <1>: ms Legacy Features. (line 3532)
* { [ms]: Typeface and decoration.
(line 2619)
* } [ms]: Typeface and decoration.
(line 2620)
* ~ [ms]: ms Legacy Features. (line 3510)
* ~ [ms] <1>: ms Legacy Features. (line 3541)
* ABSTRACT [ms]: ms language and localization.
(line 3102)
* ae [ms]: ms Legacy Features. (line 3589)
* Ae [ms]: ms Legacy Features. (line 3592)
* C [ms]: ms Legacy Features. (line 3513)
* CF [ms]: ms Document Control Settings.
(line 1941)
* CH [ms]: ms Document Control Settings.
(line 1920)
* d- [ms]: ms Legacy Features. (line 3577)
* D- [ms]: ms Legacy Features. (line 3580)
* FAM [ms]: ms Document Control Settings.
(line 1981)
* FR [ms]: ms Document Control Settings.
(line 2133)
* LF [ms]: ms Document Control Settings.
(line 1934)
* LH [ms]: ms Document Control Settings.
(line 1913)
* MONTH1 [ms]: ms language and localization.
(line 3111)
* MONTH10 [ms]: ms language and localization.
(line 3120)
* MONTH11 [ms]: ms language and localization.
(line 3121)
* MONTH12 [ms]: ms language and localization.
(line 3122)
* MONTH2 [ms]: ms language and localization.
(line 3112)
* MONTH3 [ms]: ms language and localization.
(line 3113)
* MONTH4 [ms]: ms language and localization.
(line 3114)
* MONTH5 [ms]: ms language and localization.
(line 3115)
* MONTH6 [ms]: ms language and localization.
(line 3116)
* MONTH7 [ms]: ms language and localization.
(line 3117)
* MONTH8 [ms]: ms language and localization.
(line 3118)
* MONTH9 [ms]: ms language and localization.
(line 3119)
* o [ms]: ms Legacy Features. (line 3559)
* oe [ms]: ms Legacy Features. (line 3595)
* OE [ms]: ms Legacy Features. (line 3598)
* Q [ms]: Typographical symbols in ms.
(line 2325)
* q [ms]: ms Legacy Features. (line 3571)
* REFERENCES [ms]: ms language and localization.
(line 3097)
* RF [ms]: ms Document Control Settings.
(line 1948)
* RH [ms]: ms Document Control Settings.
(line 1927)
* SN [ms]: Headings in ms. (line 2467)
* SN-DOT [ms]: Headings in ms. (line 2465)
* SN-NO-DOT [ms]: Headings in ms. (line 2466)
* SN-STYLE [ms]: ms Document Control Settings.
(line 2067)
* SN-STYLE [ms] <1>: Headings in ms. (line 2464)
* th [ms]: ms Legacy Features. (line 3583)
* Th [ms]: ms Legacy Features. (line 3586)
* TOC [ms]: ms language and localization.
(line 3107)
* U [ms]: Typographical symbols in ms.
(line 2326)
* v [ms]: ms Legacy Features. (line 3550)
Appendix H File Keyword Index
*****************************
*Note Device and Font Description Files::.
* Menu:
* #: DESC File Format. (line 13761)
* # <1>: Font Description File Format.
(line 13938)
* ---: Font Description File Format.
(line 13988)
* biggestfont: DESC File Format. (line 13896)
* charset: DESC File Format. (line 13891)
* charset <1>: Font Description File Format.
(line 13980)
* charset-range: Font Description File Format.
(line 14077)
* family: Selecting Fonts. (line 7698)
* family <1>: DESC File Format. (line 13765)
* fonts: Characters and Glyphs.
(line 7976)
* fonts <1>: Special Fonts. (line 8524)
* fonts <2>: DESC File Format. (line 13768)
* hor: DESC File Format. (line 13774)
* image_generator: DESC File Format. (line 13779)
* kernpairs: Font Description File Format.
(line 14083)
* ligatures: Font Description File Format.
(line 13958)
* name: Font Description File Format.
(line 13942)
* paperlength: DESC File Format. (line 13785)
* papersize: DESC File Format. (line 13789)
* paperwidth: DESC File Format. (line 13816)
* pass_filenames: DESC File Format. (line 13820)
* postpro: DESC File Format. (line 13825)
* prepro: DESC File Format. (line 13828)
* print: DESC File Format. (line 13832)
* res: DESC File Format. (line 13836)
* sizes: DESC File Format. (line 13839)
* sizescale: DESC File Format. (line 13845)
* slant: Font Description File Format.
(line 13954)
* spacewidth: Font Description File Format.
(line 13947)
* spare1: DESC File Format. (line 13896)
* spare2: DESC File Format. (line 13896)
* special: Artificial Fonts. (line 8663)
* special <1>: Font Description File Format.
(line 13965)
* styles: Selecting Fonts. (line 7698)
* styles <1>: Font Families. (line 7870)
* styles <2>: DESC File Format. (line 13850)
* tcommand: DESC File Format. (line 13854)
* unicode: DESC File Format. (line 13858)
* unitwidth: DESC File Format. (line 13872)
* unscaled_charwidths: DESC File Format. (line 13877)
* use_charnames_in_special: DESC File Format. (line 13881)
* vert: DESC File Format. (line 13886)
Appendix I Program and File Index
*********************************
* Menu:
* an.tmac: man. (line 1467)
* changebar: Output Line Annotation.
(line 10844)
* chem: Groff Options. (line 516)
* composite.tmac: Characters and Glyphs.
(line 8203)
* cs.tmac: Manipulating Hyphenation.
(line 6465)
* de.tmac: Manipulating Hyphenation.
(line 6465)
* DESC: Selecting Fonts. (line 7698)
* DESC <1>: Font Families. (line 7870)
* DESC <2>: Characters and Glyphs.
(line 7976)
* DESC <3>: Characters and Glyphs.
(line 8227)
* DESC <4>: Special Fonts. (line 8524)
* diffmk: Output Line Annotation.
(line 10844)
* ec.tmac: Input Encodings. (line 4179)
* en.tmac: Manipulating Hyphenation.
(line 6465)
* eqn: Groff Options. (line 516)
* eqn <1>: ms Insertions. (line 2921)
* es.tmac: Manipulating Hyphenation.
(line 6465)
* fr.tmac: Manipulating Hyphenation.
(line 6465)
* freeeuro.pfa: Input Encodings. (line 4179)
* gdiffmk: Output Line Annotation.
(line 10844)
* grn: Groff Options. (line 516)
* groff: Groff Options. (line 516)
* hyphen.cs: Manipulating Hyphenation.
(line 6361)
* hyphen.den: Manipulating Hyphenation.
(line 6361)
* hyphen.det: Manipulating Hyphenation.
(line 6361)
* hyphen.en: Manipulating Hyphenation.
(line 6361)
* hyphen.es: Manipulating Hyphenation.
(line 6361)
* hyphen.fr: Manipulating Hyphenation.
(line 6361)
* hyphen.it: Manipulating Hyphenation.
(line 6361)
* hyphen.pl: Manipulating Hyphenation.
(line 6361)
* hyphen.ru: Manipulating Hyphenation.
(line 6361)
* hyphen.sv: Manipulating Hyphenation.
(line 6361)
* hyphenex.cs: Manipulating Hyphenation.
(line 6361)
* hyphenex.en: Manipulating Hyphenation.
(line 6361)
* hyphenex.pl: Manipulating Hyphenation.
(line 6361)
* it.tmac: Manipulating Hyphenation.
(line 6465)
* ja.tmac: Manipulating Hyphenation.
(line 6465)
* koi8-r.tmac: Input Encodings. (line 4140)
* latin1.tmac: Input Encodings. (line 4147)
* latin2.tmac: Input Encodings. (line 4152)
* latin5.tmac: Input Encodings. (line 4160)
* latin9.tmac: Input Encodings. (line 4165)
* makeindex: Indexing. (line 1387)
* man.local: Optional man extensions.
(line 1476)
* man.tmac: man. (line 1467)
* man.ultrix: Optional man extensions.
(line 1502)
* nrchbar: Output Line Annotation.
(line 10844)
* pic: Groff Options. (line 516)
* pic <1>: ms Insertions. (line 2921)
* pl.tmac: Manipulating Hyphenation.
(line 6465)
* post-grohtml: Groff Options. (line 804)
* pre-grohtml: Groff Options. (line 804)
* preconv: Groff Options. (line 516)
* rap: Groff Options. (line 516)
* refer: Groff Options. (line 516)
* refer <1>: ms Insertions. (line 2921)
* ru.tmac: Manipulating Hyphenation.
(line 6465)
* soelim: Groff Options. (line 516)
* soelim <1>: Debugging. (line 12950)
* sv.tmac: Manipulating Hyphenation.
(line 6465)
* tbl: Groff Options. (line 516)
* tbl <1>: ms Insertions. (line 2921)
* trace.tmac: Writing Macros. (line 10079)
* troff: Groff Options. (line 516)
* troffrc: Groff Options. (line 739)
* troffrc <1>: Manipulating Hyphenation.
(line 6465)
* troffrc <2>: Manipulating Hyphenation.
(line 6555)
* troffrc <3>: troff and nroff Modes.
(line 7154)
* troffrc-end: Groff Options. (line 739)
* troffrc-end <1>: Manipulating Hyphenation.
(line 6555)
* troffrc-end <2>: troff and nroff Modes.
(line 7154)
* tty.tmac: troff and nroff Modes.
(line 7162)
* tty.tmac <1>: Line Layout. (line 7229)
* vtroff: Operators in Conditionals.
(line 9589)
* zh.tmac: Manipulating Hyphenation.
(line 6465)
Appendix J Concept Index
************************
* Menu:
* ", as delimiter: Delimiters. (line 5241)
* ", at end of sentence: Sentences. (line 3752)
* ", at end of sentence <1>: Characters and Glyphs.
(line 8295)
* ", at the start of a request argument: Host System Service Access.
(line 12348)
* ", embedding in a macro argument: Calling Macros. (line 5048)
* %, as delimiter: Delimiters. (line 5271)
* &, as delimiter: Delimiters. (line 5271)
* ', as a comment: Comments. (line 5359)
* ', as delimiter: Delimiters. (line 5241)
* ', at end of sentence: Sentences. (line 3752)
* ', at end of sentence <1>: Characters and Glyphs.
(line 8295)
* (, as delimiter: Delimiters. (line 5271)
* ), as delimiter: Delimiters. (line 5271)
* ), at end of sentence: Sentences. (line 3752)
* ), at end of sentence <1>: Characters and Glyphs.
(line 8295)
* *, as delimiter: Delimiters. (line 5271)
* *, at end of sentence: Sentences. (line 3752)
* *, at end of sentence <1>: Characters and Glyphs.
(line 8295)
* +, and page motion: Numeric Expressions.
(line 4633)
* +, as delimiter: Delimiters. (line 5271)
* -, and page motion: Numeric Expressions.
(line 4633)
* -, as delimiter: Delimiters. (line 5271)
* ., as delimiter: Delimiters. (line 5269)
* .h register, difference from nl: Diversions. (line 11804)
* .ps register, compared to .psr: Using Fractional Type Sizes.
(line 9117)
* .s register, compared to .sr: Using Fractional Type Sizes.
(line 9117)
* .S register, Plan 9 name for .tabs: Tabs and Fields. (line 6919)
* .t register, and diversions: Diversion Traps. (line 11418)
* .tabs register, Plan 9 name for (.S): Tabs and Fields. (line 6919)
* .V register, and vs: Changing the Vertical Spacing.
(line 9012)
* /, as delimiter: Delimiters. (line 5271)
* <, as delimiter: Delimiters. (line 5271)
* , as delimiter: Delimiters. (line 5271)
* =, as delimiter: Delimiters. (line 5271)
* >, as delimiter: Delimiters. (line 5271)
* [, macro names starting with, and refer: Identifiers. (line 4789)
* \!, and copy mode: Diversions. (line 11858)
* \!, and output request: Diversions. (line 11891)
* \!, and trnt: Character Translations.
(line 7117)
* \!, as delimiter: Delimiters. (line 5249)
* \!, as delimiter <1>: Delimiters. (line 5275)
* \!, in top-level diversion: Diversions. (line 11883)
* \!, incompatibilities with AT&T troff: Other Differences. (line 13663)
* \", interpretation in copy mode: Comments. (line 5327)
* \#, interpretation in copy mode: Comments. (line 5370)
* \$, interpretation in copy mode: Parameters. (line 10139)
* \%, and translations: Character Translations.
(line 7069)
* \%, as delimiter: Delimiters. (line 5249)
* \%, as delimiter <1>: Delimiters. (line 5275)
* \%, following \X or \Y: Manipulating Hyphenation.
(line 6240)
* \%, in device extension commands: Postprocessor Access.
(line 12663)
* \&, and glyph definitions: Characters and Glyphs.
(line 8351)
* \&, and translations: Character Translations.
(line 7080)
* \&, as delimiter: Delimiters. (line 5249)
* \&, at end of sentence: Sentences. (line 3736)
* \&, in device extension commands: Postprocessor Access.
(line 12663)
* \', and translations: Character Translations.
(line 7063)
* \', as delimiter: Delimiters. (line 5249)
* \', as delimiter <1>: Delimiters. (line 5275)
* \(, and translations: Character Translations.
(line 7063)
* \), as delimiter: Delimiters. (line 5249)
* \), in device extension commands: Postprocessor Access.
(line 12663)
* \*, and warnings: Warnings. (line 13248)
* \*, incompatibilities with AT&T troff: Compatibility Mode.
(line 13353)
* \*, interpretation in copy mode: Strings. (line 9297)
* \, disabling (eo): Using Escape Sequences.
(line 5183)
* \, embedding in a macro argument: Calling Macros. (line 5048)
* \,, as delimiter: Delimiters. (line 5249)
* \- glyph, and cflags: Characters and Glyphs.
(line 8278)
* \-, and translations: Character Translations.
(line 7063)
* \-, as delimiter: Delimiters. (line 5249)
* \-, as delimiter <1>: Delimiters. (line 5275)
* \., interpretation in copy mode: Copy Mode. (line 10281)
* \/, as delimiter: Delimiters. (line 5249)
* \/, as delimiter <1>: Delimiters. (line 5275)
* \0, as delimiter: Delimiters. (line 5249)
* \:, as delimiter: Delimiters. (line 5249)
* \:, as delimiter <1>: Delimiters. (line 5275)
* \, in device extension commands: Postprocessor Access.
(line 12663)
* \?, and copy mode: Operators in Conditionals.
(line 9636)
* \?, and copy mode <1>: Diversions. (line 11858)
* \?, as delimiter: Delimiters. (line 5249)
* \?, in top-level diversion: Diversions. (line 11888)
* \?, incompatibilities with AT&T troff: Other Differences. (line 13663)
* \?, interpretation in copy mode: Diversions. (line 11859)
* \a, and copy mode: Leaders. (line 6980)
* \a, and translations: Character Translations.
(line 7073)
* \a, as delimiter: Delimiters. (line 5249)
* \b, limitations of: Drawing Geometric Objects.
(line 11046)
* \C, and translations: Character Translations.
(line 7063)
* \c, as delimiter: Delimiters. (line 5249)
* \c, as delimiter <1>: Delimiters. (line 5275)
* \c, when filling disabled: Line Continuation. (line 7371)
* \c, when filling enabled: Line Continuation. (line 7363)
* \d, as delimiter: Delimiters. (line 5249)
* \D, delimiters allowed by: Delimiters. (line 5258)
* \e, and glyph definitions: Characters and Glyphs.
(line 8351)
* \e, and translations: Character Translations.
(line 7067)
* \e, as delimiter: Delimiters. (line 5249)
* \E, as delimiter: Delimiters. (line 5249)
* \e, as delimiter <1>: Delimiters. (line 5275)
* \e, incompatibilities with AT&T troff: Other Differences. (line 13663)
* \e, interpretation in copy mode: Using Escape Sequences.
(line 5175)
* \f escape sequence, untokenized on input: Selecting Fonts.
(line 7751)
* \F escape sequence, untokenized on input: Font Families. (line 7856)
* \F, and changing fonts: Selecting Fonts. (line 7698)
* \f, and font translations: Selecting Fonts. (line 7759)
* \f, incompatibilities with AT&T troff: Compatibility Mode.
(line 13459)
* \g, interpretation in copy mode: Assigning Register Formats.
(line 5715)
* \H escape sequence, untokenized on input: Artificial Fonts.
(line 8569)
* \h, delimiters allowed by: Delimiters. (line 5258)
* \H, delimiters allowed by: Delimiters. (line 5258)
* \H, incompatibilities with AT&T troff: Compatibility Mode.
(line 13459)
* \H, using + and - with: Numeric Expressions.
(line 4639)
* \H, with fractional type sizes: Using Fractional Type Sizes.
(line 9070)
* \l, and glyph definitions: Characters and Glyphs.
(line 8351)
* \L, and glyph definitions: Characters and Glyphs.
(line 8351)
* \l, delimiters allowed by: Delimiters. (line 5258)
* \L, delimiters allowed by: Delimiters. (line 5258)
* \m escape sequence, untokenized on input: Colors. (line 9231)
* \M escape sequence, untokenized on input: Colors. (line 9248)
* \N, and translations: Character Translations.
(line 7063)
* \n, and warnings: Warnings. (line 13260)
* \N, delimiters allowed by: Delimiters. (line 5258)
* \n, incompatibilities with AT&T troff: Compatibility Mode.
(line 13353)
* \n, interpretation in copy mode: Interpolating Registers.
(line 5576)
* \p, as delimiter: Delimiters. (line 5249)
* \p, as delimiter <1>: Delimiters. (line 5275)
* \R escape sequence, untokenized on input: Setting Registers.
(line 5460)
* \R, and warnings: Warnings. (line 13260)
* \r, as delimiter: Delimiters. (line 5249)
* \R, delimiters allowed by: Delimiters. (line 5258)
* \R, difference from nr: Auto-increment. (line 5606)
* \R, using + and - with: Numeric Expressions.
(line 4639)
* \, interpretation in copy mode: Line Continuation. (line 7336)
* \S escape sequence, untokenized on input: Artificial Fonts.
(line 8599)
* \s escape sequence, untokenized on input: Changing the Type Size.
(line 8981)
* \s, delimiters allowed by: Delimiters. (line 5258)
* \S, delimiters allowed by: Delimiters. (line 5258)
* \s, incompatibilities with AT&T troff: Compatibility Mode.
(line 13459)
* \S, incompatibilities with AT&T troff: Compatibility Mode.
(line 13459)
* \s, incompatibilities with AT&T troff <1>: Compatibility Mode.
(line 13474)
* \s, using + and - with: Numeric Expressions.
(line 4639)
* \s, with fractional type sizes: Using Fractional Type Sizes.
(line 9070)
* \, as delimiter: Delimiters. (line 5249)
* \, difference from \~: Calling Macros. (line 5040)
* \t, and copy mode: Tabs and Fields. (line 6817)
* \t, and translations: Character Translations.
(line 7073)
* \t, and warnings: Warnings. (line 13268)
* \t, as delimiter: Delimiters. (line 5249)
* \u, as delimiter: Delimiters. (line 5249)
* \V, and copy mode: Host System Service Access.
(line 12622)
* \v, delimiters allowed by: Delimiters. (line 5258)
* \v, internal representation: GNU troff Internals.
(line 12837)
* \V, interpretation in copy mode: Host System Service Access.
(line 12624)
* \x, delimiters allowed by: Delimiters. (line 5258)
* \X, followed by \%: Manipulating Hyphenation.
(line 6240)
* \Y, followed by \%: Manipulating Hyphenation.
(line 6240)
* \[, and translations: Character Translations.
(line 7063)
* \\, as quotation character: Copy Mode. (line 10255)
* \\, interpretation in copy mode: Copy Mode. (line 10255)
* \^, as delimiter: Delimiters. (line 5249)
* \_, and translations: Character Translations.
(line 7063)
* \_, as delimiter: Delimiters. (line 5249)
* \_, as delimiter <1>: Delimiters. (line 5275)
* \`, and translations: Character Translations.
(line 7063)
* \`, as delimiter: Delimiters. (line 5249)
* \`, as delimiter <1>: Delimiters. (line 5275)
* \{, as delimiter: Delimiters. (line 5249)
* \{, as delimiter <1>: Delimiters. (line 5275)
* \|, as delimiter: Delimiters. (line 5249)
* \}, as delimiter: Delimiters. (line 5249)
* \}, as delimiter <1>: Delimiters. (line 5275)
* \~, and translations: Character Translations.
(line 7069)
* \~, as delimiter: Delimiters. (line 5249)
* \~, difference from \: Calling Macros. (line 5040)
* \~, incompatibilities with AT&T troff: Other Differences. (line 13526)
* ], as part of an identifier: Identifiers. (line 4782)
* ], at end of sentence: Sentences. (line 3752)
* ], at end of sentence <1>: Characters and Glyphs.
(line 8295)
* ], macro names starting with, and refer: Identifiers. (line 4789)
* |) operator, use with sp request: Manipulating Spacing.
(line 6707)
* |, and page motion: Numeric Expressions.
(line 4647)
* |, as delimiter: Delimiters. (line 5271)
* ab request, incompatibilities with AT&T troff: Other Differences.
(line 13611)
* abort (ab): Debugging. (line 12979)
* absolute (sic) position operator (|): Numeric Expressions.
(line 4647)
* abstract font style: Using Fonts. (line 7645)
* abstract font style, setting up (sty): Font Families. (line 7865)
* accent marks [ms]: ms Legacy Features.
(line 3488)
* access to postprocessor: Postprocessor Access.
(line 12642)
* accessing unnamed glyphs with \N: Font Description File Format.
(line 13988)
* activating kerning (kern): Ligatures and Kerning.
(line 8732)
* activating ligatures (lg): Ligatures and Kerning.
(line 8714)
* activating track kerning (tkf): Ligatures and Kerning.
(line 8752)
* ad request, and hyphenation margin: Manipulating Hyphenation.
(line 6586)
* ad request, and hyphenation space: Manipulating Hyphenation.
(line 6601)
* addition: Numeric Expressions.
(line 4535)
* additional inter-sentence space: Manipulating Filling and Adjustment.
(line 6108)
* adjustment (introduction): Basics. (line 1119)
* adjustment and filling, manipulating: Manipulating Filling and Adjustment.
(line 5812)
* adjustment mode register (.j): Manipulating Filling and Adjustment.
(line 5919)
* adjustment to both margins, difference from AT&T troff: Other Differences.
(line 13541)
* adjustment, and break warnings: Warnings. (line 13201)
* Adobe Glyph List (AGL): Characters and Glyphs.
(line 8090)
* alias, diversion, creating (als): Strings. (line 9491)
* alias, diversion, removing (rm): Strings. (line 9526)
* alias, macro, creating (als): Strings. (line 9491)
* alias, macro, removing (rm): Strings. (line 9526)
* alias, register, creating (aln): Setting Registers. (line 5552)
* alias, register, removing (rr): Setting Registers. (line 5557)
* alias, string, creating (als): Strings. (line 9491)
* alias, string, removing (rm): Strings. (line 9526)
* aliasing fonts with third argument to fp request: Font Positions.
(line 7920)
* als request, and \$0: Parameters. (line 10191)
* am, am1, ami requests, and warnings: Warnings. (line 13248)
* annotation, output line: Output Line Annotation.
(line 10692)
* appending to a diversion (da, boxa): Diversions. (line 11702)
* appending to a file (opena): Host System Service Access.
(line 12571)
* appending to a macro (am): Writing Macros. (line 10061)
* appending to a string (as): Strings. (line 9392)
* approximation output register (.A): Built-in Registers.
(line 5760)
* arc, drawing (\D'a ...'): Drawing Geometric Objects.
(line 10953)
* argument: Requests and Macros.
(line 3922)
* arguments to macros: Calling Macros. (line 5024)
* arguments to macros, and tabs: Invoking Requests. (line 4961)
* arguments to requests: Invoking Requests. (line 4961)
* arguments to requests, and tabs: Invoking Requests. (line 4961)
* arguments, and compatibility mode: GNU troff Internals.
(line 12874)
* arguments, file name, to requests, in other implementations: Other Differences.
(line 13572)
* arguments, to escape sequences, delimiting: Delimiters. (line 5241)
* arguments, to strings: Strings. (line 9293)
* arithmetic operators: Numeric Expressions.
(line 4535)
* artificial fonts: Artificial Fonts. (line 8544)
* as and as1 requests, arguments starting with double quote ", and comments: Strings.
(line 9400)
* as request, and comments: Strings. (line 9314)
* as, as1 requests, and warnings: Warnings. (line 13248)
* as1 request, and comments: Strings. (line 9314)
* ASCII output encoding: Groff Options. (line 784)
* asciify request, and writem: Host System Service Access.
(line 12595)
* assertion (arithmetic operator): Numeric Expressions.
(line 4542)
* assign input line number request (lf): Debugging. (line 12950)
* assign number format to register (af): Assigning Register Formats.
(line 5647)
* assignments, indirect: Interpolating Registers.
(line 5572)
* assignments, nested: Interpolating Registers.
(line 5572)
* AT&T ms, macro package differences: Differences from AT&T ms.
(line 3359)
* AT&T troff bug, in cf request: Host System Service Access.
(line 12446)
* AT&T troff bugs: Host System Service Access.
(line 12446)
* attributes, character cell: Using Fonts. (line 7668)
* auto-incrementation of a register: Auto-increment. (line 5598)
* automatic font mounting: Selecting Fonts. (line 7713)
* automatic hyphenation: Manipulating Hyphenation.
(line 6173)
* automatic hyphenation parameters: Manipulating Hyphenation.
(line 6282)
* auxiliary macro package: Major Macro Packages.
(line 1458)
* available glyphs, list of (groff_char(7) man page): Characters and Glyphs.
(line 8077)
* available registers, number of, register (.R): Built-in Registers.
(line 5780)
* background: Background. (line 232)
* background color name register (.M): Colors. (line 9257)
* backslash glyph, formatting (\[rs]): Using Escape Sequences.
(line 5178)
* backslash, embedding in a macro argument: Calling Macros. (line 5048)
* backslash, printing (\\, \e, \E, \[rs]): Other Differences.
(line 13663)
* backspace character: Page Motions. (line 10545)
* backspace character, and translations: Character Translations.
(line 7073)
* backtrace of input stack (backtrace): Debugging. (line 13115)
* baseline rule special character(\[ru]): Drawing Geometric Objects.
(line 10872)
* baseline, text: Page Geometry. (line 4342)
* baseline, text <1>: Manipulating Type Size and Vertical Spacing.
(line 8897)
* basic scaling unit (u): Measurements. (line 4404)
* basic units: Page Geometry. (line 4329)
* basic units, conversion to: Measurements. (line 4399)
* basics of macro package usage: Basics. (line 1109)
* bd request, and font styles: Font Families. (line 7865)
* bd request, and font translations: Selecting Fonts. (line 7759)
* bd request, incompatibilities with AT&T troff: Other Differences.
(line 13630)
* beginning diversion (di, box): Diversions. (line 11702)
* beginning of conditional block (\{): Conditional Blocks.
(line 9777)
* blank line: Breaking. (line 3837)
* blank line macro (blm): Breaking. (line 3837)
* blank line macro (blm) <1>: Invoking Requests. (line 4992)
* blank line macro (blm) <2>: Blank Line Traps. (line 11539)
* blank line trap (blm): Invoking Requests. (line 4992)
* blank line traps: Blank Line Traps. (line 11538)
* blank lines, disabling: Manipulating Spacing.
(line 6784)
* block paragraphs: Paragraphs. (line 1264)
* block, conditional, beginning (\{): Conditional Blocks.
(line 9777)
* block, conditional, end (\}): Conditional Blocks.
(line 9777)
* blocks, conditional: Conditional Blocks.
(line 9770)
* body, of a while request: while. (line 9858)
* boldface, imitating (bd): Artificial Fonts. (line 8646)
* bottom margin: Page Location Traps.
(line 11170)
* boundary-relative measurement operator (|): Numeric Expressions.
(line 4647)
* boundary-relative measurement operator (|), use with sp request: Manipulating Spacing.
(line 6707)
* bounding box: Miscellaneous. (line 12749)
* box (diversion operation): Diversions. (line 11731)
* box request, and warnings: Warnings. (line 13243)
* box rule special character (\[br]): Drawing Geometric Objects.
(line 10897)
* box, boxa requests, and warnings: Warnings. (line 13248)
* boxa request, and dn (dl): Diversions. (line 11810)
* boxa request, and warnings: Warnings. (line 13243)
* boxes [ms]: ms keeps and displays.
(line 2833)
* bp request, and top-level diversion: Page Control. (line 7496)
* bp request, and traps (.pe): Page Location Traps.
(line 11350)
* bp request, causing implicit break: Manipulating Filling and Adjustment.
(line 5812)
* bp request, incompatibilities with AT&T troff: Other Differences.
(line 13615)
* bp request, using + and - with: Numeric Expressions.
(line 4639)
* br glyph, and cflags: Characters and Glyphs.
(line 8290)
* br request, nilpotence with no-break control character: Manipulating Filling and Adjustment.
(line 5819)
* brace escape sequences (\{, \}): Conditional Blocks.
(line 9777)
* break: Breaking. (line 3813)
* break <1>: Manipulating Filling and Adjustment.
(line 5812)
* break (introduction): Basics. (line 1119)
* break (introduction) <1>: Basics. (line 1132)
* break request, in a while loop: while. (line 9921)
* break, page: Page Geometry. (line 4369)
* break, page <1>: Page Control. (line 7483)
* break, page <2>: The Implicit Page Trap.
(line 11388)
* break, page (introduction): Basics. (line 1232)
* break, page, final: End-of-input Traps.
(line 11596)
* break, page, prevented by vpt: Vertical Position Traps.
(line 11143)
* breaking file names (\:): Manipulating Hyphenation.
(line 6248)
* breaking URLs (\:): Manipulating Hyphenation.
(line 6248)
* breaking without hyphens (\:): Manipulating Hyphenation.
(line 6248)
* brp request, nilpotence with no-break control character: Manipulating Filling and Adjustment.
(line 5819)
* bug, in AT&T troff cf request: Host System Service Access.
(line 12446)
* built-in register, removing: Built-in Registers.
(line 5746)
* built-in registers: Built-in Registers.
(line 5742)
* bulleted list, example markup [ms]: Lists in ms. (line 2652)
* c scaling unit: Measurements. (line 4411)
* calling macros: Calling Macros. (line 5024)
* calling macros (introduction): Requests and Macros.
(line 3932)
* capabilities of GNU troff: GNU troff Capabilities.
(line 298)
* case-transforming a string (stringdown, stringup): Strings.
(line 9465)
* categories, warning: Warnings. (line 13192)
* ce request, causing implicit break: Manipulating Filling and Adjustment.
(line 5812)
* ce request, difference from .ad c: Manipulating Filling and Adjustment.
(line 6049)
* cell, character, attributes: Using Fonts. (line 7668)
* centered text (filled): Manipulating Filling and Adjustment.
(line 5904)
* centered text (unfilled): Manipulating Filling and Adjustment.
(line 6040)
* centering lines (ce): Manipulating Filling and Adjustment.
(line 6040)
* centering lines (introduction): Basics. (line 1215)
* centimeter scaling unit (c): Measurements. (line 4411)
* cf request, and copy mode: Host System Service Access.
(line 12409)
* cf request, arguments starting with double quote ", and comments: Host System Service Access.
(line 12348)
* cf request, causing implicit break: Manipulating Filling and Adjustment.
(line 5812)
* cf request, incompatibilities with AT&T troff: Other Differences.
(line 13572)
* changing control characters: Control Characters.
(line 4892)
* changing font family (fam, \F): Font Families. (line 7826)
* changing fonts (ft, \f): Selecting Fonts. (line 7698)
* changing format, and read-only registers: Assigning Register Formats.
(line 5706)
* changing the font height (\H): Artificial Fonts. (line 8554)
* changing the font slant (\S): Artificial Fonts. (line 8590)
* changing the page number character (pc): Page Layout. (line 7464)
* changing trap location (ch): Page Location Traps.
(line 11276)
* changing type sizes (ps, \s): Changing the Type Size.
(line 8925)
* changing type sizes (ps, \s) <1>: Using Fractional Type Sizes.
(line 9130)
* changing vertical line spacing (vs): Changing the Vertical Spacing.
(line 9009)
* char request, and comments: Characters and Glyphs.
(line 8347)
* char request, and soft hyphen character: Manipulating Hyphenation.
(line 6272)
* char request, and translations: Character Translations.
(line 7063)
* char request, used with \N: Characters and Glyphs.
(line 8217)
* character: Characters and Glyphs.
(line 7964)
* character cell attributes: Using Fonts. (line 7668)
* character class (class): Character Classes. (line 8476)
* character class name space, shared with special characters: Identifiers.
(line 4836)
* character classes: Character Classes. (line 8466)
* character mappings, composite, dumping (pcomposite): Debugging.
(line 13020)
* character properties (cflags): Characters and Glyphs.
(line 8253)
* character translations: Character Translations.
(line 7044)
* character, backspace: Page Motions. (line 10545)
* character, backspace, and translations: Character Translations.
(line 7073)
* character, control (.): Requests and Macros.
(line 3907)
* character, control, changing (cc): Control Characters.
(line 4904)
* character, defining (char): Characters and Glyphs.
(line 8351)
* character, defining fallback (fchar, fschar, schar): Characters and Glyphs.
(line 8351)
* character, distinguished from glyph: Characters and Glyphs.
(line 7964)
* character, dummy (\&): Dummy Characters. (line 8807)
* character, dummy (\&), as control character suppressor: Requests and Macros.
(line 3913)
* character, dummy (\&), effect on kerning: Ligatures and Kerning.
(line 8739)
* character, dummy (\&), effect on \l escape sequence: Drawing Geometric Objects.
(line 10867)
* character, escape, changing (ec): Using Escape Sequences.
(line 5188)
* character, escape, while defining glyph: Characters and Glyphs.
(line 8351)
* character, field delimiting (fc): Fields. (line 7014)
* character, field padding (fc): Fields. (line 7014)
* character, horizontal tab: Tabs and Leaders. (line 3875)
* character, hyphenation (\%): Manipulating Hyphenation.
(line 6231)
* character, indexed, formatting (\N): Characters and Glyphs.
(line 8217)
* character, leader: Tabs and Leaders. (line 3875)
* character, leader repetition (lc): Leaders. (line 6983)
* character, leader, and translations: Character Translations.
(line 7073)
* character, leader, non-interpreted (\a): Leaders. (line 6980)
* character, margins (mc): Output Line Annotation.
(line 10800)
* character, named (\C): Characters and Glyphs.
(line 8194)
* character, newline, and translations: Character Translations.
(line 7073)
* character, no-break control ('): Requests and Macros.
(line 3907)
* character, no-break control, changing (c2): Control Characters.
(line 4904)
* character, ordinary: Identifiers. (line 4761)
* character, removing definition (rchar, rfschar): Characters and Glyphs.
(line 8424)
* character, soft hyphen, setting (shc): Manipulating Hyphenation.
(line 6272)
* character, special: Character Translations.
(line 7063)
* character, tab repetition (tc): Tabs and Fields. (line 6928)
* character, tab, and translations: Character Translations.
(line 7073)
* character, tab, non-interpreted (\t): Tabs and Fields. (line 6817)
* character, transparent: Characters and Glyphs.
(line 8295)
* character, transparent dummy (\)): Dummy Characters. (line 8865)
* characters, end-of-sentence: Characters and Glyphs.
(line 8266)
* characters, end-of-sentence transparent: Sentences. (line 3752)
* characters, hyphenation: Characters and Glyphs.
(line 8271)
* characters, input, and output glyphs, compatibility with AT&T troff: Other Differences.
(line 13630)
* characters, invalid for trf request: Host System Service Access.
(line 12417)
* characters, invalid input: Input Format. (line 4085)
* characters, overlapping: Characters and Glyphs.
(line 8285)
* characters, special: Sentences. (line 3752)
* characters, special, list of (groff_char(7) man page): Characters and Glyphs.
(line 8077)
* characters, unnamed, accessing with \N: Font Description File Format.
(line 13988)
* circle, filled, drawing (\D'C ...'): Drawing Geometric Objects.
(line 10962)
* circle, outlined, drawing (\D'c ...'): Drawing Geometric Objects.
(line 10958)
* circle, solid, drawing (\D'C ...'): Drawing Geometric Objects.
(line 10962)
* circle, stroked, drawing (\D'c ...'): Drawing Geometric Objects.
(line 10958)
* class of characters (class): Character Classes. (line 8476)
* classes, character: Character Classes. (line 8466)
* clearing input line trap (it, itc): Input Line Traps. (line 11433)
* closing brace escape sequence (\}): Conditional Blocks.
(line 9777)
* closing file (close): Host System Service Access.
(line 12604)
* code, hyphenation (hcode): Manipulating Hyphenation.
(line 6501)
* color name, background, register (.M): Colors. (line 9257)
* color name, fill, register (.M): Colors. (line 9257)
* color name, stroke, register (.m): Colors. (line 9227)
* color, default: Colors. (line 9203)
* color, fill: Colors. (line 9156)
* color, stroke: Colors. (line 9156)
* colors: Colors. (line 9156)
* colors, defined, dumping (pcolor): Debugging. (line 13013)
* command prefix: Environment. (line 879)
* command-line options: Groff Options. (line 563)
* comments: Comments. (line 5322)
* comments in device description files: DESC File Format. (line 13761)
* comments in font description files: Font Description File Format.
(line 13938)
* comments, after character definitions: Characters and Glyphs.
(line 8347)
* comments, after file name arguments: Manipulating Hyphenation.
(line 6477)
* comments, after file name or system command arguments: Host System Service Access.
(line 12348)
* comments, lining up with tabs: Comments. (line 5339)
* comments, with string definitions and appendments: Strings.
(line 9314)
* comments, with string length measurements: Strings. (line 9412)
* common features: Common Features. (line 1247)
* common name space of macros, diversions, and strings: Identifiers.
(line 4836)
* common name space of special characters and character classes: Identifiers.
(line 4836)
* comparison of strings: Operators in Conditionals.
(line 9628)
* comparison operators: Numeric Expressions.
(line 4592)
* compatibility mode: Warnings. (line 13286)
* compatibility mode <1>: Compatibility Mode.
(line 13348)
* compatibility mode, and parameters: GNU troff Internals.
(line 12874)
* complementation, logical: Numeric Expressions.
(line 4602)
* composite characters mappings, dumping (pcomposite): Debugging.
(line 13020)
* composite glyph names: Characters and Glyphs.
(line 8090)
* conditional block, beginning (\{): Conditional Blocks.
(line 9777)
* conditional block, end (\}): Conditional Blocks.
(line 9777)
* conditional blocks: Conditional Blocks.
(line 9770)
* conditional expressions: Operators in Conditionals.
(line 9548)
* conditional output for terminal (TTY): Operators in Conditionals.
(line 9574)
* conditional page break (ne): Page Control. (line 7520)
* conditionals and loops: Conditionals and Loops.
(line 9541)
* configuring control characters: Control Characters.
(line 4892)
* configuring the page length (pl): Page Layout. (line 7404)
* consecutive hyphenated lines (hlm): Manipulating Hyphenation.
(line 6573)
* constant glyph spacing mode (cs): Artificial Fonts. (line 8676)
* contents, table of: Table of Contents. (line 1371)
* contents, table of <1>: Leaders. (line 6993)
* continuation, input line (\): Line Continuation. (line 7327)
* continuation, output line (\c): Line Continuation. (line 7357)
* continue request, in a while loop: while. (line 9921)
* continued output line register (.int): Line Continuation. (line 7382)
* continuous underlining (cu): Artificial Fonts. (line 8634)
* control character (.): Requests and Macros.
(line 3907)
* control character, changing (cc): Control Characters.
(line 4904)
* control character, no-break ('): Requests and Macros.
(line 3907)
* control character, no-break, changing (c2): Control Characters.
(line 4904)
* control characters: Control Characters.
(line 4892)
* control line: Requests and Macros.
(line 3918)
* control, line: Line Continuation. (line 7322)
* control, page: Page Control. (line 7483)
* conventions for input: Input Conventions. (line 4208)
* conversion to basic units: Measurements. (line 4399)
* copy mode: Copy Mode. (line 10235)
* copy mode <1>: Copy Mode. (line 10235)
* copy mode, and cf request: Host System Service Access.
(line 12409)
* copy mode, and device request: Postprocessor Access.
(line 12659)
* copy mode, and length request: Strings. (line 9413)
* copy mode, and macro parameters: Parameters. (line 10150)
* copy mode, and output request: Diversions. (line 11891)
* copy mode, and trf request: Host System Service Access.
(line 12409)
* copy mode, and write request: Host System Service Access.
(line 12587)
* copy mode, and writec request: Host System Service Access.
(line 12587)
* copy mode, and writem request: Host System Service Access.
(line 12597)
* copy mode, and \!: Diversions. (line 11858)
* copy mode, and \?: Operators in Conditionals.
(line 9636)
* copy mode, and \? <1>: Diversions. (line 11858)
* copy mode, and \a: Leaders. (line 6980)
* copy mode, and \t: Tabs and Fields. (line 6817)
* copy mode, and \V: Host System Service Access.
(line 12622)
* copying environment (evc): Environments. (line 12167)
* correction between upright and slanted glyph (\/, \,): Italic Corrections.
(line 8788)
* correction, italic (\/): Italic Corrections.
(line 8776)
* correction, left italic (\,): Italic Corrections.
(line 8788)
* corrections between slanted and upright glyphs (\/, \,): Italic Corrections.
(line 8776)
* cover page in [ms], example markup: ms Document Description Macros.
(line 2253)
* cp request, and glyph definitions: Characters and Glyphs.
(line 8351)
* cq glyph, at end of sentence: Sentences. (line 3752)
* cq glyph, at end of sentence <1>: Characters and Glyphs.
(line 8295)
* creating alias of register (aln): Setting Registers. (line 5552)
* creating alias, for diversion (als): Strings. (line 9491)
* creating alias, for macro (als): Strings. (line 9491)
* creating alias, for string (als): Strings. (line 9491)
* creating new characters (char): Characters and Glyphs.
(line 8351)
* credits: Credits. (line 499)
* cs request, and font styles: Font Families. (line 7865)
* cs request, and font translations: Selecting Fonts. (line 7759)
* cs request, incompatibilities with AT&T troff: Other Differences.
(line 13630)
* cs request, with fractional type sizes: Using Fractional Type Sizes.
(line 9070)
* CSTR #54 errata: Setting Registers. (line 5537)
* CSTR #54 errata <1>: Manipulating Filling and Adjustment.
(line 6101)
* CSTR #54 errata <2>: Line Layout. (line 7236)
* CSTR #54 errata <3>: Page Control. (line 7498)
* CSTR #54 errata <4>: Artificial Fonts. (line 8607)
* CSTR #54 errata <5>: Changing the Type Size.
(line 8933)
* CSTR #54 errata <6>: Strings. (line 9482)
* CSTR #54 errata <7>: Page Motions. (line 10598)
* CSTR #54 errata <8>: Host System Service Access.
(line 12311)
* CSTR #54 erratum, bp request: Page Control. (line 7498)
* CSTR #54 erratum, po request: Line Layout. (line 7236)
* CSTR #54 erratum, ps request: Changing the Type Size.
(line 8933)
* CSTR #54 erratum, rm request: Strings. (line 9482)
* CSTR #54 erratum, rr request: Setting Registers. (line 5537)
* CSTR #54 erratum, sb register: Page Motions. (line 10598)
* CSTR #54 erratum, ss request: Manipulating Filling and Adjustment.
(line 6101)
* CSTR #54 erratum, st register: Page Motions. (line 10598)
* CSTR #54 erratum, yr register: Host System Service Access.
(line 12311)
* CSTR #54 erratum, \S escape: Artificial Fonts. (line 8607)
* CSTR #54 erratum, \s escape sequence: Changing the Type Size.
(line 8933)
* current directory: Macro Directories. (line 950)
* current input file name register (.F): Built-in Registers.
(line 5769)
* current page number (%): Page Control. (line 7501)
* current time, hours (hours): Host System Service Access.
(line 12297)
* current time, minutes (minutes): Host System Service Access.
(line 12294)
* current time, seconds (seconds): Host System Service Access.
(line 12291)
* customizing man package: Optional man extensions.
(line 1472)
* customizing mdoc package: mdoc. (line 1605)
* da request, and dn (dl): Diversions. (line 11810)
* da request, and warnings: Warnings. (line 13243)
* da request, and warnings <1>: Warnings. (line 13248)
* date, day of the month register (dy): Host System Service Access.
(line 12303)
* date, day of the week register (dw): Host System Service Access.
(line 12300)
* date, month of the year register (mo): Host System Service Access.
(line 12306)
* date, year register (year, yr): Host System Service Access.
(line 12309)
* day of the month register (dy): Host System Service Access.
(line 12303)
* day of the week register (dw): Host System Service Access.
(line 12300)
* dd glyph, at end of sentence: Sentences. (line 3752)
* dd glyph, at end of sentence <1>: Characters and Glyphs.
(line 8295)
* de request, and while: while. (line 9871)
* de, de1, dei requests, and warnings: Warnings. (line 13248)
* debugging: Debugging. (line 12919)
* debugging page location traps: Page Location Traps.
(line 11221)
* decimal point, as delimiter: Delimiters. (line 5269)
* decrementation, automatic, of a register: Auto-increment. (line 5598)
* default color: Colors. (line 9203)
* default tab stops: Tabs and Fields. (line 6825)
* default units: Default Units. (line 4484)
* deferred output: Deferring Output. (line 11067)
* defined colors, dumping (pcolor): Debugging. (line 13013)
* defining character (char): Characters and Glyphs.
(line 8351)
* defining character class (class): Character Classes. (line 8476)
* defining fallback character (fchar, fschar, schar): Characters and Glyphs.
(line 8351)
* defining glyph (char): Characters and Glyphs.
(line 8351)
* defining symbol (char): Characters and Glyphs.
(line 8351)
* delimiters, for escape sequence arguments: Delimiters. (line 5241)
* delimiting character, for fields (fc): Fields. (line 7014)
* delimiting escape sequence arguments: Delimiters. (line 5241)
* depth, interpolation: Calling Macros. (line 5102)
* depth, interpolation <1>: Delimiters. (line 5278)
* depth, interpolation <2>: Compatibility Mode.
(line 13451)
* depth, nesting, of escape sequences in macro definitions: Copy Mode.
(line 10310)
* depth, nesting, of interpolations: Calling Macros. (line 5102)
* depth, nesting, of interpolations <1>: Delimiters. (line 5278)
* depth, nesting, of interpolations <2>: Compatibility Mode.
(line 13451)
* depth, nesting, of macro definitions: Writing Macros. (line 9972)
* depth, of last glyph (.cdp): Environments. (line 12195)
* DESC file format: DESC File Format. (line 13754)
* DESC file, and font mounting: Font Positions. (line 7954)
* description file, device, introduced: Font Directories. (line 976)
* description file, font: Using Fonts. (line 7638)
* description file, font, introduced: Font Directories. (line 976)
* device description file, introduced: Font Directories. (line 976)
* device description files, comments: DESC File Format. (line 13761)
* device request, and copy mode: Postprocessor Access.
(line 12659)
* device request, arguments starting with double quote ", and comments: Postprocessor Access.
(line 12659)
* device resolution: Page Geometry. (line 4329)
* device resolution <1>: DESC File Format. (line 13836)
* device resolution, obtaining in the formatter: Measurements.
(line 4401)
* devices for output: Output Device Intro.
(line 377)
* dg glyph, at end of sentence: Sentences. (line 3752)
* dg glyph, at end of sentence <1>: Characters and Glyphs.
(line 8295)
* di request, and warnings: Warnings. (line 13243)
* di request, and warnings <1>: Warnings. (line 13248)
* differences in implementation: Implementation Differences.
(line 13332)
* digit-width space (\0): Page Motions. (line 10572)
* digits, as delimiters: Delimiters. (line 5269)
* dimensions, line: Line Layout. (line 7176)
* directories for macro packages: Macro Directories. (line 938)
* directory, current: Macro Directories. (line 950)
* directory, device and font description: Font Directories. (line 985)
* directory, for tmac files: Macro Directories. (line 940)
* directory, home: Macro Directories. (line 953)
* directory, platform-specific: Macro Directories. (line 956)
* directory, site-local: Macro Directories. (line 956)
* directory, site-local <1>: Font Directories. (line 1000)
* disabling hyphenation (\%): Manipulating Hyphenation.
(line 6231)
* disabling \ (eo): Using Escape Sequences.
(line 5183)
* discardable horizontal space: Manipulating Filling and Adjustment.
(line 6129)
* displays: Displays and Keeps.
(line 1337)
* displays [ms]: ms keeps and displays.
(line 2858)
* displays, and footnotes [ms]: ms Footnotes. (line 3044)
* distance to next vertical position trap register (.t): Page Location Traps.
(line 11268)
* diversion: Deferring Output. (line 11067)
* diversion name register (.z): Diversions. (line 11764)
* diversion name space, shared with macros and strings: Identifiers.
(line 4836)
* diversion trap, setting (dt): Diversion Traps. (line 11418)
* diversion traps: Diversion Traps. (line 11413)
* diversion, appending to (da, boxa): Diversions. (line 11702)
* diversion, beginning (di, box): Diversions. (line 11702)
* diversion, creating alias of (als): Strings. (line 9491)
* diversion, dumping (pm): Debugging. (line 13063)
* diversion, ending (di, box): Diversions. (line 11702)
* diversion, nested: Diversions. (line 11764)
* diversion, removing (rm): Strings. (line 9483)
* diversion, removing alias of (rm): Strings. (line 9526)
* diversion, renaming (rn): Strings. (line 9480)
* diversion, stripping final newline: Punning Names. (line 12051)
* diversion, top-level: Diversions. (line 11689)
* diversion, top-level, and bp: Page Control. (line 7496)
* diversion, top-level, and \!: Diversions. (line 11883)
* diversion, top-level, and \?: Diversions. (line 11888)
* diversion, unformatting (asciify): Diversions. (line 11909)
* diversion, vertical position in, register (.d): Diversions.
(line 11764)
* diversions: Diversions. (line 11676)
* diversions <1>: Punning Names. (line 11962)
* diversions, and traps: Page Location Traps.
(line 11370)
* division by zero: Numeric Expressions.
(line 4539)
* division, truncating: Numeric Expressions.
(line 4535)
* dl register, and da (boxa): Diversions. (line 11810)
* dn register, and da (boxa): Diversions. (line 11810)
* document description macros, [ms]: ms Document Description Macros.
(line 2188)
* document formats: Document Formats. (line 1396)
* documents, multi-file: Debugging. (line 12950)
* documents, structuring the source of: Invoking Requests. (line 4975)
* dot, as delimiter: Delimiters. (line 5269)
* double quote, at the start of a request argument: Host System Service Access.
(line 12348)
* double quote, embedding in a macro argument: Calling Macros.
(line 5048)
* double-spacing (ls): Manipulating Spacing.
(line 6713)
* double-spacing (vs, pvs): Changing the Vertical Spacing.
(line 9040)
* down-casing a string (stringdown): Strings. (line 9465)
* drawing a filled circle (\D'C ...'): Drawing Geometric Objects.
(line 10962)
* drawing a filled ellipse (\D'E ...'): Drawing Geometric Objects.
(line 10969)
* drawing a filled polygon (\D'P ...'): Drawing Geometric Objects.
(line 11003)
* drawing a line (\D'l ...'): Drawing Geometric Objects.
(line 10972)
* drawing a solid circle (\D'C ...'): Drawing Geometric Objects.
(line 10962)
* drawing a solid ellipse (\D'E ...'): Drawing Geometric Objects.
(line 10969)
* drawing a solid polygon (\D'P ...'): Drawing Geometric Objects.
(line 11003)
* drawing a spline (\D'~ ...'): Drawing Geometric Objects.
(line 10949)
* drawing a stroked circle (\D'c ...'): Drawing Geometric Objects.
(line 10958)
* drawing a stroked ellipse (\D'e ...'): Drawing Geometric Objects.
(line 10965)
* drawing a stroked polygon (\D'p ...'): Drawing Geometric Objects.
(line 10997)
* drawing an arc (\D'a ...'): Drawing Geometric Objects.
(line 10953)
* drawing an outlined circle (\D'c ...'): Drawing Geometric Objects.
(line 10958)
* drawing an outlined ellipse (\D'e ...'): Drawing Geometric Objects.
(line 10965)
* drawing an outlined polygon (\D'p ...'): Drawing Geometric Objects.
(line 10997)
* drawing horizontal lines (\l): Drawing Geometric Objects.
(line 10872)
* drawing position: Page Geometry. (line 4348)
* drawing position, initial: Page Geometry. (line 4363)
* drawing position, vertical (nl): Page Control. (line 7574)
* drawing requests: Drawing Geometric Objects.
(line 10856)
* drawing vertical lines (\L): Drawing Geometric Objects.
(line 10897)
* ds and ds1 request, and leading spaces: Strings. (line 9340)
* ds and ds1 requests, arguments starting with double quote ", and comments: Strings.
(line 9340)
* ds request, and comments: Strings. (line 9314)
* ds, ds1 requests, and warnings: Warnings. (line 13248)
* ds1 request, and comments: Strings. (line 9314)
* dummy character (\&): Dummy Characters. (line 8807)
* dummy character (\&), as control character suppressor: Requests and Macros.
(line 3913)
* dummy character (\&), effect on kerning: Ligatures and Kerning.
(line 8739)
* dummy character (\&), effect on \l escape sequence: Drawing Geometric Objects.
(line 10867)
* dummy character, transparent (\)): Dummy Characters. (line 8865)
* dummy environment, used by \w escape sequence: Page Motions.
(line 10592)
* dumping composite character mappings (pcomposite): Debugging.
(line 13020)
* dumping defined colors (pcolor): Debugging. (line 13013)
* dumping environments (pev): Debugging. (line 13026)
* dumping font translations (pftr): Debugging. (line 13040)
* dumping hyphenation exception words (phw): Debugging. (line 13046)
* dumping macros, strings, or diversions (pm): Debugging. (line 13063)
* dumping occupied font mounting positions (pfp): Debugging.
(line 13030)
* dumping open streams (pstream): Debugging. (line 13075)
* dumping page location traps (pwh): Debugging. (line 13081)
* dumping pending output line node list (pline): Debugging. (line 13056)
* dumping registers (pnr): Debugging. (line 13069)
* dumping symbol table (pm): Debugging. (line 13063)
* ejection, page: Page Geometry. (line 4369)
* ejection, page <1>: Page Control. (line 7483)
* ejection, page <2>: The Implicit Page Trap.
(line 11388)
* ejection, page, of final page: End-of-input Traps.
(line 11596)
* ejection, page, prevented by vpt: Vertical Position Traps.
(line 11143)
* ellipse, filled, drawing (\D'E ...'): Drawing Geometric Objects.
(line 10969)
* ellipse, outlined, drawing (\D'e ...'): Drawing Geometric Objects.
(line 10965)
* ellipse, solid, drawing (\D'E ...'): Drawing Geometric Objects.
(line 10969)
* ellipse, stroked, drawing (\D'e ...'): Drawing Geometric Objects.
(line 10965)
* em glyph, and cflags: Characters and Glyphs.
(line 8278)
* em scaling unit (m): Measurements. (line 4441)
* embolding of special fonts: Artificial Fonts. (line 8663)
* empty line: Breaking. (line 3837)
* en scaling unit (n): Measurements. (line 4445)
* enabling vertical position traps (vpt): Vertical Position Traps.
(line 11137)
* encoding, input, ISO Latin-1 (8859-1): Input Encodings. (line 4147)
* encoding, input, ISO Latin-2 (8859-2): Input Encodings. (line 4152)
* encoding, input, ISO Latin-5 (8859-9): Input Encodings. (line 4160)
* encoding, input, ISO Latin-9 (8859-15): Input Encodings. (line 4165)
* encoding, input, KOI8-R: Input Encodings. (line 4140)
* encoding, output, ASCII: Groff Options. (line 784)
* encoding, output, ISO 646: Groff Options. (line 784)
* encoding, output, ISO Latin-1 (8859-1): Groff Options. (line 788)
* encoding, output, UTF-8: Groff Options. (line 792)
* end of conditional block (\}): Conditional Blocks.
(line 9777)
* end-of-input macro (em): End-of-input Traps.
(line 11569)
* end-of-input trap, setting (em): End-of-input Traps.
(line 11569)
* end-of-input traps: End-of-input Traps.
(line 11568)
* end-of-sentence characters: Sentences. (line 3708)
* end-of-sentence characters <1>: Characters and Glyphs.
(line 8266)
* end-of-sentence detection, cancellation, on AT&T troff: Other Differences.
(line 13536)
* end-of-sentence transparent characters: Sentences. (line 3752)
* ending diversion (di, box): Diversions. (line 11702)
* endnotes: Footnotes and Endnotes.
(line 1361)
* environment: Deferring Output. (line 11067)
* environment availability and naming, incompatibilities with: Other Differences.
(line 13600)
* environment number/name register (.ev): Environments. (line 12114)
* environment variables: Environment. (line 867)
* environment, copying (evc): Environments. (line 12167)
* environment, dimensions of last glyph (.w, .cht, .cdp, .csk): Environments.
(line 12195)
* environment, dummy, used by \w escape sequence: Page Motions.
(line 10592)
* environment, previous line length (.n): Environments. (line 12210)
* environment, switching (ev): Environments. (line 12114)
* environments: Environments. (line 12073)
* environments, dumping (pev): Debugging. (line 13026)
* equality operator: Numeric Expressions.
(line 4592)
* equation example [ms]: ms Insertions. (line 2980)
* equations [ms]: ms Insertions. (line 2920)
* escape character, changing (ec): Using Escape Sequences.
(line 5188)
* escape character, formatting (\e): Using Escape Sequences.
(line 5174)
* escape character, while defining glyph: Characters and Glyphs.
(line 8351)
* escape sequence: Formatter Instructions.
(line 4880)
* escape sequence argument delimiters: Delimiters. (line 5241)
* escape sequences: Using Escape Sequences.
(line 5117)
* escape sequences, brace (\{, \}): Conditional Blocks.
(line 9777)
* escaping newline characters, in strings: Strings. (line 9350)
* ex request, use in debugging: Debugging. (line 12987)
* ex request, used with nx and rd: Host System Service Access.
(line 12488)
* example markup, bulleted list [ms]: Lists in ms. (line 2652)
* example markup, cover page in [ms]: ms Document Description Macros.
(line 2253)
* example markup, glossary-style list [ms]: Lists in ms. (line 2699)
* example markup, numbered list [ms]: Lists in ms. (line 2671)
* examples of invocation: Invocation Examples.
(line 1053)
* exception words, hyphenation, dumping (phw): Debugging. (line 13046)
* exiting (ex): Debugging. (line 12987)
* expansion of strings (\*): Strings. (line 9293)
* explicit hyphen (\%): Manipulating Hyphenation.
(line 6573)
* explicit hyphenation: Manipulating Hyphenation.
(line 6180)
* expression, limitation of logical not in: Numeric Expressions.
(line 4602)
* expression, order of evaluation: Numeric Expressions.
(line 4622)
* expressions, and register format: Assigning Register Formats.
(line 5718)
* expressions, and space characters: Numeric Expressions.
(line 4715)
* expressions, conditional: Operators in Conditionals.
(line 9548)
* expressions, numeric: Numeric Expressions.
(line 4521)
* extra post-vertical line space (\x): Changing the Vertical Spacing.
(line 9033)
* extra post-vertical line space register (.a): Manipulating Spacing.
(line 6748)
* extra pre-vertical line space (\x): Changing the Vertical Spacing.
(line 9025)
* extra spaces between words: Adjustment. (line 3865)
* extreme values representable with Roman numerals: Assigning Register Formats.
(line 5699)
* extremum operators (>?, ): Numeric Expressions.
(line 4583)
* f scaling unit: Colors. (line 9190)
* factor, zoom, of a font (fzoom): Selecting Fonts. (line 7771)
* fallback character, defining (fchar, fschar, schar): Characters and Glyphs.
(line 8351)
* fallback character, removing definition of (rchar, rfschar): Characters and Glyphs.
(line 8424)
* fam request, and changing fonts: Selecting Fonts. (line 7698)
* families, font: Font Families. (line 7811)
* family, font: Using Fonts. (line 7623)
* fchar request, and comments: Characters and Glyphs.
(line 8347)
* features, common: Common Features. (line 1247)
* fi request, causing implicit break: Manipulating Filling and Adjustment.
(line 5812)
* field delimiting character (fc): Fields. (line 7014)
* field padding character (fc): Fields. (line 7014)
* fields: Fields. (line 7014)
* fields, and tabs: Tabs and Fields. (line 6813)
* figure space (\0): Page Motions. (line 10572)
* figures [ms]: ms Insertions. (line 2920)
* file formats: File Formats. (line 13718)
* file name arguments to requests, in other implementations: Other Differences.
(line 13572)
* file names, breaking (\:): Manipulating Hyphenation.
(line 6248)
* file stream, writing to (write, writec): Host System Service Access.
(line 12587)
* file, appending to (opena): Host System Service Access.
(line 12571)
* file, closing (close): Host System Service Access.
(line 12604)
* file, device description, introduced: Font Directories. (line 976)
* file, font description: Using Fonts. (line 7638)
* file, font description, introduced: Font Directories. (line 976)
* file, inclusion (so): Host System Service Access.
(line 12360)
* file, macro, search path: Macro Directories. (line 940)
* file, next, read (nx): Host System Service Access.
(line 12451)
* file, opening (open): Host System Service Access.
(line 12571)
* files, font: Device and Font Description Files.
(line 13729)
* fill color: Colors. (line 9156)
* fill color name register (.M): Colors. (line 9257)
* fill mode, and \c: Line Continuation. (line 7363)
* fill mode, disabling, request (nf): Manipulating Filling and Adjustment.
(line 5880)
* fill mode, enabling, request (fi): Manipulating Filling and Adjustment.
(line 5873)
* filled circle, drawing (\D'C ...'): Drawing Geometric Objects.
(line 10962)
* filled ellipse, drawing (\D'E ...'): Drawing Geometric Objects.
(line 10969)
* filled polygon, drawing (\D'P ...'): Drawing Geometric Objects.
(line 11003)
* filling: Filling. (line 3670)
* filling (introduction): Basics. (line 1119)
* filling and adjustment, manipulating: Manipulating Filling and Adjustment.
(line 5812)
* filling of output, disabling request (nf): Manipulating Filling and Adjustment.
(line 5880)
* filling of output, enabling request (fi): Manipulating Filling and Adjustment.
(line 5873)
* filling, and break warnings: Warnings. (line 13201)
* filling, and inter-sentence space: Manipulating Filling and Adjustment.
(line 6114)
* final newline, stripping in diversions: Punning Names. (line 12051)
* fl request, causing implicit break: Manipulating Filling and Adjustment.
(line 5812)
* floating keep: Displays and Keeps.
(line 1348)
* flush pending output line (fl): Debugging. (line 13088)
* flushing of output, timing of, incompatibilities with AT&T troff: Other Differences.
(line 13682)
* flushing, of an output line: GNU troff Internals.
(line 12764)
* font: Using Fonts. (line 7623)
* font aliasing with third argument to fp request: Font Positions.
(line 7920)
* font description file: Using Fonts. (line 7638)
* font description file format: DESC File Format. (line 13754)
* font description file, format: Font Description File Format.
(line 13906)
* font description file, introduced: Font Directories. (line 976)
* font description files, comments: Font Description File Format.
(line 13938)
* font directory: Font Directories. (line 985)
* font families: Font Families. (line 7811)
* font family: Using Fonts. (line 7623)
* font family, changing (fam, \F): Font Families. (line 7826)
* font file, format: Font Description File Format.
(line 13906)
* font files: Device and Font Description Files.
(line 13729)
* font for underlining (uf): Artificial Fonts. (line 8638)
* font height, changing (\H): Artificial Fonts. (line 8554)
* font magnification request(fzoom): Selecting Fonts. (line 7771)
* font metrics: Using Fonts. (line 7638)
* font mounting positions, occupied, dumping (pfp): Debugging.
(line 13030)
* font mounting, automatic: Selecting Fonts. (line 7713)
* font path: Font Directories. (line 985)
* font position register (.f): Font Positions. (line 7942)
* font positions: Font Positions. (line 7899)
* font slant, changing (\S): Artificial Fonts. (line 8590)
* font style: Using Fonts. (line 7623)
* font style, abstract: Using Fonts. (line 7645)
* font style, abstract, setting up (sty): Font Families. (line 7865)
* font styles: Font Families. (line 7811)
* font translation (ftr): Selecting Fonts. (line 7759)
* font translations, dumping (pftr): Debugging. (line 13040)
* font, mounting (fp): Font Positions. (line 7911)
* font, optical size, setting (fzoom): Selecting Fonts. (line 7771)
* font, previous, selecting (ft): Selecting Fonts. (line 7698)
* font, previous, selecting (\f[], \fP): Selecting Fonts. (line 7726)
* font, selection: Selecting Fonts. (line 7689)
* font, special: Using Fonts. (line 7623)
* font, text: Using Fonts. (line 7623)
* font, unstyled: Using Fonts. (line 7623)
* font, zoom factor (fzoom): Selecting Fonts. (line 7771)
* fonts, artificial: Artificial Fonts. (line 8544)
* fonts, changing (ft, \f): Selecting Fonts. (line 7698)
* fonts, searching for: Font Directories. (line 985)
* fonts, special: Special Fonts. (line 8508)
* footers: Page Layout. (line 7427)
* footers <1>: Page Location Traps.
(line 11170)
* footers [ms]: ms Headers and Footers.
(line 3135)
* footnote mark [ms]: ms Footnotes. (line 3007)
* footnotes: Footnotes and Endnotes.
(line 1361)
* footnotes [ms]: ms Footnotes. (line 3007)
* footnotes, and displays [ms]: ms Footnotes. (line 3044)
* footnotes, and keeps [ms]: ms Footnotes. (line 3044)
* form letters: Host System Service Access.
(line 12472)
* format of font description file: DESC File Format. (line 13754)
* format of font description files: Font Description File Format.
(line 13906)
* format of font files: Font Description File Format.
(line 13906)
* format of register (\g): Assigning Register Formats.
(line 5713)
* format, paper: Paper Format. (line 1017)
* format, register: Registers. (line 5433)
* format, troff output: GNU troff Output. (line 14123)
* formats, file: File Formats. (line 13718)
* formatter instructions: Formatter Instructions.
(line 4869)
* formatting a backslash glyph (\[rs]): Using Escape Sequences.
(line 5178)
* formatting a title line (tl): Page Layout. (line 7432)
* formatting the escape character (\e): Using Escape Sequences.
(line 5174)
* fp request, and font translations: Selecting Fonts. (line 7759)
* fp request, incompatibilities with AT&T troff: Other Differences.
(line 13630)
* fractional point sizes: Using Fractional Type Sizes.
(line 9062)
* fractional point sizes <1>: Other Differences. (line 13604)
* fractional type sizes: Using Fractional Type Sizes.
(line 9062)
* fractional type sizes <1>: Other Differences. (line 13604)
* fractional type sizes in ms macros: Differences from AT&T ms.
(line 3398)
* French spacing: Sentences. (line 3708)
* fschar request, and comments: Characters and Glyphs.
(line 8347)
* fspecial request, and font styles: Font Families. (line 7865)
* fspecial request, and font translations: Selecting Fonts. (line 7759)
* fspecial request, and glyph search order: Characters and Glyphs.
(line 7976)
* fspecial request, and imitating bold: Artificial Fonts. (line 8663)
* ft request, and font translations: Selecting Fonts. (line 7759)
* full-service macro package: Major Macro Packages.
(line 1447)
* geometry, page: Page Geometry. (line 4322)
* GGL (groff glyph list): Characters and Glyphs.
(line 8090)
* GGL (groff glyph list) <1>: Character Classes. (line 8493)
* glossary-style list, example markup [ms]: Lists in ms. (line 2699)
* glyph: Characters and Glyphs.
(line 7964)
* glyph mode, constant spacing (cs): Artificial Fonts. (line 8676)
* glyph names, composite: Characters and Glyphs.
(line 8090)
* glyph pile (\b): Drawing Geometric Objects.
(line 11038)
* glyph properties (cflags): Characters and Glyphs.
(line 8253)
* glyph, defining (char): Characters and Glyphs.
(line 8351)
* glyph, distinguished from character: Characters and Glyphs.
(line 7964)
* glyph, last, dimensions (.w, .cht, .cdp, .csk): Environments.
(line 12195)
* glyph, leader repetition (lc): Leaders. (line 6983)
* glyph, numbered (\N): Character Translations.
(line 7063)
* glyph, numbered, accessing (\N): Characters and Glyphs.
(line 8217)
* glyph, removing definition (rchar, rfschar): Characters and Glyphs.
(line 8424)
* glyph, soft hyphen (hy): Manipulating Hyphenation.
(line 6272)
* glyph, tab repetition (tc): Tabs and Fields. (line 6928)
* glyphs, available, list of (groff_char(7) man page): Characters and Glyphs.
(line 8077)
* glyphs, output, and input characters, compatibility with AT&T troff: Other Differences.
(line 13630)
* glyphs, overstriking (\o): Page Motions. (line 10659)
* glyphs, unnamed: Characters and Glyphs.
(line 8227)
* glyphs, unnamed, accessing with \N: Font Description File Format.
(line 13988)
* GNU troff capabilities: GNU troff Capabilities.
(line 298)
* GNU troff, identification register (.g): Built-in Registers.
(line 5772)
* GNU troff, PID register ($$): Host System Service Access.
(line 12282)
* GNU troff, process ID register ($$): Host System Service Access.
(line 12282)
* GNU-specific register (.g): Built-in Registers.
(line 5772)
* graphic renditions: Using Fonts. (line 7668)
* greater than (or equal to) operator: Numeric Expressions.
(line 4592)
* groff glyph list (GGL): Characters and Glyphs.
(line 8090)
* groff glyph list (GGL) <1>: Character Classes. (line 8493)
* groff invocation: Invoking groff. (line 509)
* groff--what is it?: What Is groff?. (line 267)
* GROFF_BIN_PATH, environment variable: Environment. (line 874)
* GROFF_COMMAND_PREFIX, environment variable: Environment. (line 879)
* GROFF_ENCODING, environment variable: Environment. (line 892)
* GROFF_FONT_PATH, environment variable: Environment. (line 900)
* GROFF_FONT_PATH, environment variable <1>: Font Directories.
(line 998)
* GROFF_TMAC_PATH, environment variable: Environment. (line 905)
* GROFF_TMAC_PATH, environment variable <1>: Macro Directories.
(line 948)
* GROFF_TMPDIR, environment variable: Environment. (line 909)
* GROFF_TYPESETTER, environment variable: Environment. (line 918)
* grohtml, the program: Groff Options. (line 804)
* hair space (\^): Page Motions. (line 10566)
* hcode request, and glyph definitions: Characters and Glyphs.
(line 8351)
* headers: Page Layout. (line 7427)
* headers <1>: Page Location Traps.
(line 11170)
* headers [ms]: ms Headers and Footers.
(line 3135)
* headings, run-in: Sections and Chapters.
(line 1307)
* heavy (font stroke weight): Using Fonts. (line 7623)
* height, font, changing (\H): Artificial Fonts. (line 8554)
* height, of last glyph (.cht): Environments. (line 12195)
* high-water mark register (.h): Diversions. (line 11791)
* home directory: Macro Directories. (line 953)
* horizontal discardable space: Manipulating Filling and Adjustment.
(line 6129)
* horizontal input line position register (hp): Page Motions.
(line 10651)
* horizontal input line position, saving (\k): Page Motions.
(line 10642)
* horizontal line, drawing (\l): Drawing Geometric Objects.
(line 10872)
* horizontal motion (\h): Page Motions. (line 10533)
* horizontal motion quantum: DESC File Format. (line 13774)
* horizontal motion quantum register (.H): Motion Quanta. (line 4465)
* horizontal output line position register (.k): Page Motions.
(line 10655)
* horizontal resolution: DESC File Format. (line 13774)
* horizontal resolution register (.H): Motion Quanta. (line 4465)
* horizontal space (\h): Page Motions. (line 10533)
* horizontal space, unformatting: Punning Names. (line 12051)
* horizontal tab character: Tabs and Leaders. (line 3875)
* Host System Service Access: Host System Service Access.
(line 12278)
* hours, current time (hours): Host System Service Access.
(line 12297)
* hpf request, and comments: Manipulating Hyphenation.
(line 6477)
* hpf request, and hyphenation language: Manipulating Hyphenation.
(line 6555)
* hpfa request, and comments: Manipulating Hyphenation.
(line 6477)
* hw request, and hy restrictions: Manipulating Hyphenation.
(line 6203)
* hw request, and hyphenation language: Manipulating Hyphenation.
(line 6555)
* hy glyph, and cflags: Characters and Glyphs.
(line 8278)
* hyphen, explicit (\%): Manipulating Hyphenation.
(line 6573)
* hyphenated lines, consecutive (hlm): Manipulating Hyphenation.
(line 6573)
* hyphenating characters: Characters and Glyphs.
(line 8271)
* hyphenation: Hyphenation. (line 3795)
* hyphenation character (\%): Manipulating Hyphenation.
(line 6231)
* hyphenation code (hcode): Manipulating Hyphenation.
(line 6501)
* hyphenation consecutive line count register (.hlc): Manipulating Hyphenation.
(line 6580)
* hyphenation consecutive line limit register (.hlm): Manipulating Hyphenation.
(line 6580)
* hyphenation exception words: Manipulating Hyphenation.
(line 6188)
* hyphenation exception words, dumping (phw): Debugging. (line 13046)
* hyphenation language register (.hla): Manipulating Hyphenation.
(line 6563)
* hyphenation margin (hym): Manipulating Hyphenation.
(line 6586)
* hyphenation margin register (.hym): Manipulating Hyphenation.
(line 6596)
* hyphenation mode default register (.hydefault): Manipulating Hyphenation.
(line 6421)
* hyphenation mode register (.hy): Manipulating Hyphenation.
(line 6294)
* hyphenation parameters, automatic: Manipulating Hyphenation.
(line 6282)
* hyphenation pattern files: Manipulating Hyphenation.
(line 6361)
* hyphenation patterns (hpf): Manipulating Hyphenation.
(line 6431)
* hyphenation space (hys): Manipulating Hyphenation.
(line 6601)
* hyphenation space adjustment threshold: Manipulating Hyphenation.
(line 6601)
* hyphenation space adjustment threshold register (.hys): Manipulating Hyphenation.
(line 6613)
* hyphenation, automatic: Manipulating Hyphenation.
(line 6173)
* hyphenation, disabling (\%): Manipulating Hyphenation.
(line 6231)
* hyphenation, explicit: Manipulating Hyphenation.
(line 6180)
* hyphenation, incompatibilities with AT&T troff: Other Differences.
(line 13547)
* hyphenation, manipulating: Manipulating Hyphenation.
(line 6173)
* hyphenation, manual: Manipulating Hyphenation.
(line 6180)
* i scaling unit: Measurements. (line 4408)
* identifiers: Identifiers. (line 4757)
* identifiers, undefined: Identifiers. (line 4824)
* ie request, and font translations: Selecting Fonts. (line 7759)
* ie request, operators to use with: Operators in Conditionals.
(line 9548)
* if request, and font translations: Selecting Fonts. (line 7759)
* if request, and the ! operator: Numeric Expressions.
(line 4542)
* if request, operators to use with: Operators in Conditionals.
(line 9548)
* if-else: if-else. (line 9739)
* if-then: if-then. (line 9697)
* imitating boldface (bd): Artificial Fonts. (line 8646)
* implementation differences: Implementation Differences.
(line 13332)
* implicit line break: Breaking. (line 3813)
* implicit trap: The Implicit Page Trap.
(line 11388)
* in request, causing implicit break: Manipulating Filling and Adjustment.
(line 5812)
* in request, using + and - with: Numeric Expressions.
(line 4639)
* inch scaling unit (i): Measurements. (line 4408)
* including a file (so): Host System Service Access.
(line 12360)
* incompatibilities with AT&T troff: Implementation Differences.
(line 13332)
* increment value without changing the register: Auto-increment.
(line 5637)
* incrementation, automatic, of a register: Auto-increment. (line 5598)
* indentation (in): Line Layout. (line 7193)
* indentation, of roff source code: Invoking Requests. (line 4975)
* indented paragraphs: Paragraphs. (line 1264)
* index, in macro package: Indexing. (line 1387)
* indexed character, formatting (\N): Characters and Glyphs.
(line 8217)
* indicator, scaling: Measurements. (line 4392)
* indirect assignments: Interpolating Registers.
(line 5572)
* initial drawing position: Page Geometry. (line 4363)
* input and output requests: Host System Service Access.
(line 12278)
* input characters and output glyphs, compatibility with AT&T troff: Other Differences.
(line 13630)
* input characters, invalid: Input Format. (line 4085)
* input conventions: Input Conventions. (line 4208)
* input encoding, ISO Latin-1 (8859-1): Input Encodings. (line 4147)
* input encoding, ISO Latin-2 (8859-2): Input Encodings. (line 4152)
* input encoding, ISO Latin-5 (8859-9): Input Encodings. (line 4160)
* input encoding, ISO Latin-9 (8859-15): Input Encodings. (line 4165)
* input encoding, KOI8-R: Input Encodings. (line 4140)
* input file name, current, register (.F): Built-in Registers.
(line 5769)
* input level: Calling Macros. (line 5102)
* input level <1>: Delimiters. (line 5278)
* input level <2>: Compatibility Mode.
(line 13451)
* input line continuation (\): Line Continuation. (line 7327)
* input line number register (.c, c.): Built-in Registers.
(line 5765)
* input line number, assignment, request (lf): Debugging. (line 12950)
* input line position, horizontal, saving (\k): Page Motions.
(line 10642)
* input line trap, clearing (it, itc): Input Line Traps. (line 11433)
* input line trap, setting (it, itc): Input Line Traps. (line 11433)
* input line traps: Input Line Traps. (line 11428)
* input line traps and interrupted lines (itc): Input Line Traps.
(line 11458)
* input line, horizontal position, register (hp): Page Motions.
(line 10651)
* input line, productive: Manipulating Filling and Adjustment.
(line 6009)
* input stack, backtrace (backtrace): Debugging. (line 13115)
* input stack, setting limit: Debugging. (line 13136)
* input stream, standard, interpolate from (rd): Host System Service Access.
(line 12455)
* input token: GNU troff Internals.
(line 12764)
* inserting horizontal space (\h): Page Motions. (line 10533)
* installation: Installation. (line 388)
* instructing the formatter: Formatter Instructions.
(line 4869)
* inter-sentence space: Sentences. (line 3708)
* inter-sentence space size register (.sss): Manipulating Filling and Adjustment.
(line 6101)
* inter-sentence space, additional: Manipulating Filling and Adjustment.
(line 6108)
* inter-word spacing, minimum: Manipulating Filling and Adjustment.
(line 6106)
* interactive use of GNU troff: Debugging. (line 13088)
* intercepting requests: Control Characters.
(line 4937)
* intermediate output: GNU troff Output. (line 14123)
* interpolating registers (\n): Interpolating Registers.
(line 5567)
* interpolation: Requests and Macros.
(line 3932)
* interpolation depth: Calling Macros. (line 5102)
* interpolation depth <1>: Delimiters. (line 5278)
* interpolation depth <2>: Compatibility Mode.
(line 13451)
* interpolation of strings (\*): Strings. (line 9293)
* interpretation mode: Copy Mode. (line 10249)
* interrupted line: Line Continuation. (line 7357)
* interrupted line register (.int): Line Continuation. (line 7382)
* interrupted lines and input line traps (itc): Input Line Traps.
(line 11458)
* introduction: Introduction. (line 225)
* invalid characters for trf request: Host System Service Access.
(line 12417)
* invalid input characters: Input Format. (line 4085)
* invocation examples: Invocation Examples.
(line 1053)
* invoking groff: Invoking groff. (line 509)
* invoking requests: Invoking Requests. (line 4953)
* ISO 646 output encoding: Groff Options. (line 784)
* ISO Latin-1 (8859-1) input encoding: Input Encodings. (line 4147)
* ISO Latin-1 (8859-1) output encoding: Groff Options. (line 788)
* ISO Latin-2 (8859-2) input encoding: Input Encodings. (line 4152)
* ISO Latin-5 (8859-9) input encoding: Input Encodings. (line 4160)
* ISO Latin-9 (8859-15) input encoding: Input Encodings. (line 4165)
* italic correction (\/): Italic Corrections.
(line 8776)
* justifying text: Manipulating Filling and Adjustment.
(line 5812)
* keep, floating: Displays and Keeps.
(line 1348)
* keeps (introduction): Displays and Keeps.
(line 1343)
* keeps [ms]: ms keeps and displays.
(line 2805)
* keeps, and footnotes [ms]: ms Footnotes. (line 3044)
* kerning and ligatures: Ligatures and Kerning.
(line 8696)
* kerning enabled register (.kern): Ligatures and Kerning.
(line 8732)
* kerning, activating (kern): Ligatures and Kerning.
(line 8732)
* kerning, track: Ligatures and Kerning.
(line 8745)
* KOI8-R, input encoding: Input Encodings. (line 4140)
* landscape page orientation: Paper Format. (line 1017)
* language [ms]: ms language and localization.
(line 3086)
* language, troff page description: GNU troff Output. (line 14123)
* last glyph, dimensions (.w, .cht, .cdp, .csk): Environments.
(line 12195)
* last-requested point size registers (.psr, .sr): Using Fractional Type Sizes.
(line 9117)
* last-requested type size registers (.psr, .sr): Using Fractional Type Sizes.
(line 9117)
* Latin-1 (ISO 8859-1) input encoding: Input Encodings. (line 4147)
* Latin-1 (ISO 8859-1) output encoding: Groff Options. (line 788)
* Latin-2 (ISO 8859-2) input encoding: Input Encodings. (line 4152)
* Latin-5 (ISO 8859-9) input encoding: Input Encodings. (line 4160)
* Latin-9 (ISO 8859-15) input encoding: Input Encodings. (line 4165)
* layout, line: Line Layout. (line 7176)
* layout, page: Page Layout. (line 7398)
* lc request, and glyph definitions: Characters and Glyphs.
(line 8351)
* leader: Table of Contents. (line 1375)
* leader character: Tabs and Leaders. (line 3875)
* leader character <1>: Leaders. (line 6974)
* leader character, and translations: Character Translations.
(line 7073)
* leader character, non-interpreted (\a): Leaders. (line 6980)
* leader repetition character (lc): Leaders. (line 6983)
* leaders: Leaders. (line 6967)
* leading: Manipulating Type Size and Vertical Spacing.
(line 8903)
* leading space macro (lsm): Breaking. (line 3845)
* leading space traps: Leading Space Traps.
(line 11548)
* leading spaces: Breaking. (line 3845)
* leading spaces in ds and ds1 argument: Strings. (line 9340)
* leading spaces macro (lsm): Leading Space Traps.
(line 11551)
* left italic correction (\,): Italic Corrections.
(line 8788)
* left margin (po): Line Layout. (line 7197)
* length of a string (length): Strings. (line 9413)
* length of line (ll): Line Layout. (line 7196)
* length of previous line (.n): Environments. (line 12210)
* length of the page, configuring (pl): Page Layout. (line 7404)
* length of title line, configuring (lt): Page Layout. (line 7450)
* length request, and comments: Strings. (line 9412)
* length request, and copy mode: Strings. (line 9413)
* length request, arguments starting with double quote ", and comments: Strings.
(line 9425)
* less than (or equal to) operator: Numeric Expressions.
(line 4592)
* letters, form: Host System Service Access.
(line 12472)
* level, input: Calling Macros. (line 5102)
* level, input <1>: Delimiters. (line 5278)
* level, input <2>: Compatibility Mode.
(line 13451)
* level, suppression nesting, register (.O): Suppressing Output.
(line 12272)
* lf request, arguments starting with double quote ", and comments: Debugging.
(line 12950)
* lf request, incompatibilities with AT&T troff: Other Differences.
(line 13572)
* lf request, incompatibilities with AT&T troff <1>: Other Differences.
(line 13597)
* ligature: Characters and Glyphs.
(line 7964)
* ligatures and kerning: Ligatures and Kerning.
(line 8696)
* ligatures enabled register (.lg): Ligatures and Kerning.
(line 8714)
* ligatures, activating (lg): Ligatures and Kerning.
(line 8714)
* limitations of \b escape sequence: Drawing Geometric Objects.
(line 11046)
* line annotation, output: Output Line Annotation.
(line 10692)
* line break: Manipulating Filling and Adjustment.
(line 5812)
* line break (introduction): Basics. (line 1119)
* line break, output: Breaking. (line 3813)
* line break, output (introduction): Basics. (line 1132)
* line control: Line Continuation. (line 7322)
* line dimensions: Line Layout. (line 7176)
* line indentation (in): Line Layout. (line 7193)
* line layout: Line Layout. (line 7176)
* line length (ll): Line Layout. (line 7196)
* line length register (.l): Line Layout. (line 7311)
* line length, previous (.n): Environments. (line 12210)
* line number, input, register (.c, c.): Built-in Registers.
(line 5765)
* line number, output, register (ln): Output Line Annotation.
(line 10721)
* line numbers, printing (nm): Output Line Annotation.
(line 10699)
* line space, extra post-vertical (\x): Changing the Vertical Spacing.
(line 9033)
* line space, extra pre-vertical (\x): Changing the Vertical Spacing.
(line 9025)
* line spacing register (.L): Manipulating Spacing.
(line 6717)
* line spacing, post-vertical (pvs): Changing the Vertical Spacing.
(line 9037)
* line thickness (\D't ...'): Drawing Geometric Objects.
(line 11028)
* line, blank: Breaking. (line 3837)
* line, drawing (\D'l ...'): Drawing Geometric Objects.
(line 10972)
* line, horizontal, drawing (\l): Drawing Geometric Objects.
(line 10872)
* line, input, continuation (\): Line Continuation. (line 7327)
* line, input, horizontal position, register (hp): Page Motions.
(line 10651)
* line, input, horizontal position, saving (\k): Page Motions.
(line 10642)
* line, interrupted: Line Continuation. (line 7357)
* line, output, continuation (\c): Line Continuation. (line 7357)
* line, output, horizontal position, register (.k): Page Motions.
(line 10655)
* line, productive input: Manipulating Filling and Adjustment.
(line 6009)
* line, vertical, drawing (\L): Drawing Geometric Objects.
(line 10897)
* line-tabs mode: Tabs and Fields. (line 6941)
* lines, blank, disabling: Manipulating Spacing.
(line 6784)
* lines, centering (ce): Manipulating Filling and Adjustment.
(line 6040)
* lines, centering (introduction): Basics. (line 1215)
* lines, consecutive hyphenated (hlm): Manipulating Hyphenation.
(line 6573)
* lines, interrupted, and input line traps (itc): Input Line Traps.
(line 11458)
* lines, right-aligning (introduction): Basics. (line 1229)
* list of special characters (groff_char(7) man page): Characters and Glyphs.
(line 8077)
* listing page location traps (pwh): Debugging. (line 13081)
* lists: Paragraphs. (line 1273)
* ll request, using + and - with: Numeric Expressions.
(line 4639)
* localization: Manipulating Hyphenation.
(line 6465)
* localization [ms]: ms language and localization.
(line 3086)
* locating macro files: Macro Directories. (line 940)
* locating macro packages: Macro Directories. (line 940)
* location, vertical, page, marking (mk): Page Motions. (line 10416)
* location, vertical, page, returning to marked (rt): Page Motions.
(line 10416)
* logical "and" operator: Numeric Expressions.
(line 4598)
* logical "or" operator: Numeric Expressions.
(line 4598)
* logical complementation operator: Numeric Expressions.
(line 4602)
* logical conjunction operator: Numeric Expressions.
(line 4598)
* logical disjunction operator: Numeric Expressions.
(line 4598)
* logical not, limitation in expression: Numeric Expressions.
(line 4602)
* logical operators: Numeric Expressions.
(line 4598)
* long names: Compatibility Mode.
(line 13353)
* loops and conditionals: Conditionals and Loops.
(line 9541)
* lowercasing a string (stringdown): Strings. (line 9465)
* ls request, alternative to (pvs): Changing the Vertical Spacing.
(line 9049)
* lt request, using + and - with: Numeric Expressions.
(line 4639)
* m scaling unit: Measurements. (line 4441)
* M scaling unit: Measurements. (line 4453)
* machine units: Page Geometry. (line 4329)
* macro: Requests and Macros.
(line 3932)
* macro arguments: Calling Macros. (line 5024)
* macro arguments, and compatibility mode: GNU troff Internals.
(line 12874)
* macro arguments, and tabs: Invoking Requests. (line 4961)
* macro file search path: Macro Directories. (line 940)
* macro name register (\$0): Parameters. (line 10191)
* macro name space, shared with strings and diversions: Identifiers.
(line 4836)
* macro names, starting with [ or ], and refer: Identifiers.
(line 4789)
* macro package: Macro Packages. (line 4059)
* macro package directories: Macro Directories. (line 938)
* macro package search path: Macro Directories. (line 940)
* macro package usage, basics of: Basics. (line 1109)
* macro package, auxiliary: Major Macro Packages.
(line 1458)
* macro package, full-service: Major Macro Packages.
(line 1447)
* macro package, introduction: Macro Package Intro.
(line 333)
* macro package, major: Major Macro Packages.
(line 1444)
* macro package, minor: Major Macro Packages.
(line 1458)
* macro package, structuring the source of: Invoking Requests.
(line 4975)
* macro packages, search procedure for: Macro Directories. (line 938)
* macro, appending to (am): Writing Macros. (line 10061)
* macro, creating alias of (als): Strings. (line 9491)
* macro, dumping (pm): Debugging. (line 13063)
* macro, end-of-input (em): End-of-input Traps.
(line 11569)
* macro, parameters (\$): Parameters. (line 10150)
* macro, removing (rm): Strings. (line 9483)
* macro, removing alias of (rm): Strings. (line 9526)
* macro, renaming (rn): Strings. (line 9480)
* macros packages, tutorial for users of: Tutorial for Macro Package Users.
(line 1097)
* macros, recursive: while. (line 9887)
* macros, writing: Writing Macros. (line 9938)
* magnification, font, request (fzoom): Selecting Fonts. (line 7771)
* major macro package: Major Macro Packages.
(line 1444)
* major version number register (.x): Built-in Registers.
(line 5795)
* man macro package: man. (line 1467)
* man macros, customizing headers and footers of: Optional man extensions.
(line 1484)
* man macros, Ultrix-specific: Optional man extensions.
(line 1502)
* man pages: Conventions Used in This Manual.
(line 470)
* manipulating filling and adjustment: Manipulating Filling and Adjustment.
(line 5812)
* manipulating hyphenation: Manipulating Hyphenation.
(line 6173)
* manipulating spacing: Manipulating Spacing.
(line 6658)
* manipulating type size and vertical spacing: Manipulating Type Size and Vertical Spacing.
(line 8897)
* manual hyphenation: Manipulating Hyphenation.
(line 6180)
* manual pages ("man pages"): Conventions Used in This Manual.
(line 470)
* margin character (mc): Output Line Annotation.
(line 10800)
* margin, bottom: Page Location Traps.
(line 11170)
* margin, hyphenation (hym): Manipulating Hyphenation.
(line 6586)
* margin, left (po): Line Layout. (line 7197)
* margin, right: Line Layout. (line 7197)
* margin, top: Page Location Traps.
(line 11170)
* mark, footnote [ms]: ms Footnotes. (line 3007)
* mark, high-water, register (.h): Diversions. (line 11791)
* marking vertical page location (mk): Page Motions. (line 10416)
* maximum operator: Numeric Expressions.
(line 4583)
* maximum value representable with Roman numerals: Assigning Register Formats.
(line 5699)
* mdoc macro package: mdoc. (line 1602)
* me macro package: me. (line 1613)
* measurements: Measurements. (line 4392)
* measurements, specifying safely: Default Units. (line 4510)
* metrics, font: Using Fonts. (line 7638)
* minimum inter-word spacing: Manipulating Filling and Adjustment.
(line 6106)
* minimum operator: Numeric Expressions.
(line 4583)
* minimum value representable with Roman numerals: Assigning Register Formats.
(line 5699)
* minor macro package: Major Macro Packages.
(line 1458)
* minor version number register (.y): Built-in Registers.
(line 5799)
* minutes, current time (minutes): Host System Service Access.
(line 12294)
* mm macro package: mm. (line 1624)
* mode, compatibility: Compatibility Mode.
(line 13348)
* mode, compatibility, and parameters: GNU troff Internals.
(line 12874)
* mode, constant glyph spacing (cs): Artificial Fonts. (line 8676)
* mode, copy: Copy Mode. (line 10235)
* mode, copy <1>: Copy Mode. (line 10235)
* mode, copy, and cf request: Host System Service Access.
(line 12409)
* mode, copy, and device request: Postprocessor Access.
(line 12659)
* mode, copy, and length request: Strings. (line 9413)
* mode, copy, and macro parameters: Parameters. (line 10150)
* mode, copy, and output request: Diversions. (line 11891)
* mode, copy, and trf request: Host System Service Access.
(line 12409)
* mode, copy, and write request: Host System Service Access.
(line 12587)
* mode, copy, and writec request: Host System Service Access.
(line 12587)
* mode, copy, and writem request: Host System Service Access.
(line 12597)
* mode, copy, and \!: Diversions. (line 11858)
* mode, copy, and \?: Operators in Conditionals.
(line 9636)
* mode, copy, and \? <1>: Diversions. (line 11858)
* mode, copy, and \a: Leaders. (line 6980)
* mode, copy, and \t: Tabs and Fields. (line 6817)
* mode, copy, and \V: Host System Service Access.
(line 12622)
* mode, fill, and break warnings: Warnings. (line 13201)
* mode, fill, and inter-sentence space: Manipulating Filling and Adjustment.
(line 6114)
* mode, fill, and \c: Line Continuation. (line 7363)
* mode, fill, disabling, request (nf): Manipulating Filling and Adjustment.
(line 5880)
* mode, fill, enabling, request (fi): Manipulating Filling and Adjustment.
(line 5873)
* mode, interpretation: Copy Mode. (line 10249)
* mode, line-tabs: Tabs and Fields. (line 6941)
* mode, no-fill request (nf): Manipulating Filling and Adjustment.
(line 5880)
* mode, no-fill, and \c: Line Continuation. (line 7371)
* mode, no-space, enabling, request (ns): Manipulating Spacing.
(line 6784)
* mode, nroff: troff and nroff Modes.
(line 7135)
* mode, safer: Groff Options. (line 747)
* mode, safer <1>: Macro Directories. (line 950)
* mode, safer <2>: Built-in Registers.
(line 5791)
* mode, safer <3>: Host System Service Access.
(line 12393)
* mode, safer <4>: Host System Service Access.
(line 12532)
* mode, safer <5>: Host System Service Access.
(line 12548)
* mode, safer <6>: Host System Service Access.
(line 12577)
* mode, safer <7>: Safer Mode. (line 13339)
* mode, troff: troff and nroff Modes.
(line 7135)
* mode, unsafe: Groff Options. (line 821)
* mode, unsafe <1>: Macro Directories. (line 950)
* mode, unsafe <2>: Built-in Registers.
(line 5791)
* mode, unsafe <3>: Host System Service Access.
(line 12393)
* mode, unsafe <4>: Host System Service Access.
(line 12532)
* mode, unsafe <5>: Host System Service Access.
(line 12548)
* mode, unsafe <6>: Host System Service Access.
(line 12577)
* modifying requests: Control Characters.
(line 4937)
* modulus by zero: Numeric Expressions.
(line 4539)
* modulus operator: Numeric Expressions.
(line 4535)
* mom macro package: mom. (line 1633)
* month of the year register (mo): Host System Service Access.
(line 12306)
* motion operators: Numeric Expressions.
(line 4633)
* motion quanta: Motion Quanta. (line 4458)
* motion quantum, horizontal: DESC File Format. (line 13774)
* motion quantum, horizontal, register (.H): Motion Quanta. (line 4465)
* motion quantum, vertical: DESC File Format. (line 13886)
* motion quantum, vertical, register (.V): Motion Quanta. (line 4465)
* motion, horizontal (\h): Page Motions. (line 10533)
* motion, vertical (\v): Page Motions. (line 10489)
* motions, page: Page Motions. (line 10411)
* mounting a font (fp): Font Positions. (line 7911)
* mounting position: Using Fonts. (line 7638)
* mounting position <1>: Using Fonts. (line 7638)
* mounting positions, occupied by fonts, dumping (pfp): Debugging.
(line 13030)
* mounting, font, automatic: Selecting Fonts. (line 7713)
* ms document structure: ms Document Structure.
(line 1803)
* ms macro package: ms. (line 1655)
* ms macros, accent marks: ms Legacy Features.
(line 3488)
* ms macros, body text: ms Body Text. (line 2287)
* ms macros, creating table of contents: ms TOC. (line 3222)
* ms macros, displays: ms keeps and displays.
(line 2805)
* ms macros, document control settings: ms Document Control Settings.
(line 1850)
* ms macros, document description: ms Document Description Macros.
(line 2188)
* ms macros, equations: ms Insertions. (line 2920)
* ms macros, figures: ms Insertions. (line 2920)
* ms macros, footers: ms Headers and Footers.
(line 3135)
* ms macros, footnotes: ms Footnotes. (line 3007)
* ms macros, fractional type sizes in: Differences from AT&T ms.
(line 3398)
* ms macros, groff differences from AT&T: Differences from AT&T ms.
(line 3359)
* ms macros, headers: ms Headers and Footers.
(line 3135)
* ms macros, headings: Headings in ms. (line 2408)
* ms macros, keeps: ms keeps and displays.
(line 2805)
* ms macros, language: ms language and localization.
(line 3086)
* ms macros, lists: Lists in ms. (line 2644)
* ms macros, localization: ms language and localization.
(line 3086)
* ms macros, margins: ms Margins. (line 3192)
* ms macros, multiple columns: ms Multiple Columns.
(line 3200)
* ms macros, naming conventions: ms Naming Conventions.
(line 3603)
* ms macros, nested lists: Indented regions in ms.
(line 2775)
* ms macros, obtaining typographical symbols: Typographical symbols in ms.
(line 2317)
* ms macros, page layout: ms Page Layout. (line 3128)
* ms macros, paragraph handling: Paragraphs in ms. (line 2333)
* ms macros, references: ms Insertions. (line 2920)
* ms macros, special characters: ms Legacy Features.
(line 3488)
* ms macros, strings: ms Legacy Features.
(line 3488)
* ms macros, tables: ms Insertions. (line 2920)
* ms macros, text settings: Text settings in ms.
(line 2295)
* mso request, arguments starting with double quote ", and comments: Host System Service Access.
(line 12348)
* msoquiet request, arguments starting with double quote ", and comments: Host System Service Access.
(line 12348)
* multi-file documents: Debugging. (line 12950)
* multi-line strings: Strings. (line 9350)
* multi-page table example [ms]: ms Insertions. (line 2963)
* multiple columns [ms]: ms Multiple Columns.
(line 3200)
* multiplication: Numeric Expressions.
(line 4535)
* n scaling unit: Measurements. (line 4445)
* name space, common, of macros, diversions, and strings: Identifiers.
(line 4836)
* name space, common, of special characters and character classes: Identifiers.
(line 4836)
* name, background color, register (.M): Colors. (line 9257)
* name, fill color, register (.M): Colors. (line 9257)
* name, stroke color, register (.m): Colors. (line 9227)
* named character (\C): Characters and Glyphs.
(line 8194)
* names, long: Compatibility Mode.
(line 13353)
* naming conventions, ms macros: ms Naming Conventions.
(line 3603)
* ne request, and the .trunc register: Page Location Traps.
(line 11335)
* ne request, comparison with sv: Page Control. (line 7564)
* need vertical space request (ne): Page Control. (line 7520)
* negating register values: Setting Registers. (line 5514)
* negation: Numeric Expressions.
(line 4542)
* nested assignments: Interpolating Registers.
(line 5572)
* nested diversions: Diversions. (line 11764)
* nested lists [ms]: Indented regions in ms.
(line 2775)
* nesting depth, of escape sequences in macro definitions: Copy Mode.
(line 10310)
* nesting depth, of interpolations: Calling Macros. (line 5102)
* nesting depth, of interpolations <1>: Delimiters. (line 5278)
* nesting depth, of interpolations <2>: Compatibility Mode.
(line 13451)
* nesting depth, of macro definitions: Writing Macros. (line 9972)
* nesting level, suppression, register (.O): Suppressing Output.
(line 12272)
* new page request (bp): Page Control. (line 7491)
* newline character, and translations: Character Translations.
(line 7073)
* newline character, in strings, escaping: Strings. (line 9350)
* newline, final, stripping in diversions: Punning Names. (line 12051)
* next file, read (nx): Host System Service Access.
(line 12451)
* next free font position register (.fp): Font Positions. (line 7953)
* next page number register (.pn): Page Layout. (line 7423)
* next page number, assignment request (pn): Page Layout. (line 7418)
* next trap name register (.trap): Page Location Traps.
(line 11346)
* nf request, causing implicit break: Manipulating Filling and Adjustment.
(line 5812)
* nl register, and .d: Diversions. (line 11764)
* nl register, difference from .h: Diversions. (line 11804)
* nm request, using + and - with: Numeric Expressions.
(line 4639)
* no-break control character ('): Requests and Macros.
(line 3907)
* no-break control character, changing (c2): Control Characters.
(line 4904)
* no-fill mode request (nf): Manipulating Filling and Adjustment.
(line 5880)
* no-fill mode, and \c: Line Continuation. (line 7371)
* no-space mode, enabling, request (ns): Manipulating Spacing.
(line 6784)
* node: GNU troff Internals.
(line 12764)
* node list, of pending output line, dumping (pline): Debugging.
(line 13056)
* nodes, in device extension commands: Postprocessor Access.
(line 12663)
* non-printing break point (\:): Manipulating Hyphenation.
(line 6248)
* normal (font stroke weight): Using Fonts. (line 7623)
* nr request, and warnings: Warnings. (line 13260)
* nr request, using + and - with: Numeric Expressions.
(line 4639)
* nroff mode: troff and nroff Modes.
(line 7135)
* number format, assigning to register (af): Assigning Register Formats.
(line 5647)
* number of available registers register (.R): Built-in Registers.
(line 5780)
* number, input line, assignment request (lf): Debugging. (line 12950)
* number, next page assignment request (pn): Page Layout. (line 7418)
* number, next page, register (.pn): Page Layout. (line 7423)
* numbered glyph (\N): Character Translations.
(line 7063)
* numbered glyph, accessing (\N): Characters and Glyphs.
(line 8217)
* numbered list, example markup [ms]: Lists in ms. (line 2671)
* numbers, line, printing (nm): Output Line Annotation.
(line 10699)
* numeral-width space (\0): Page Motions. (line 10572)
* numerals, as delimiters: Delimiters. (line 5269)
* numerals, Roman: Assigning Register Formats.
(line 5667)
* numeric expression, valid: Numeric Expressions.
(line 4698)
* numeric expressions: Numeric Expressions.
(line 4521)
* nx request, arguments starting with double quote ", and comments: Host System Service Access.
(line 12348)
* nx request, incompatibilities with AT&T troff: Other Differences.
(line 13572)
* object creation: Writing Macros. (line 10086)
* oblique (font shape): Using Fonts. (line 7623)
* occupied font mounting positions, dumping (pfp): Debugging.
(line 13030)
* offset, page: Page Geometry. (line 4357)
* offset, page (po): Line Layout. (line 7191)
* open request, and safer mode: Groff Options. (line 747)
* open request, arguments starting with double quote ", and comments: Host System Service Access.
(line 12348)
* open streams, dumping (pstream): Debugging. (line 13075)
* opena request, and safer mode: Groff Options. (line 747)
* opena request, arguments starting with double quote ", and comments: Host System Service Access.
(line 12348)
* opening brace escape sequence (\}): Conditional Blocks.
(line 9777)
* opening file (open): Host System Service Access.
(line 12571)
* operator, scaling: Numeric Expressions.
(line 4565)
* operators, arithmetic: Numeric Expressions.
(line 4535)
* operators, as delimiters: Delimiters. (line 5271)
* operators, comparison: Numeric Expressions.
(line 4592)
* operators, extremum (>?, ): Numeric Expressions.
(line 4583)
* operators, logical: Numeric Expressions.
(line 4598)
* operators, motion: Numeric Expressions.
(line 4633)
* operators, unary arithmetic: Numeric Expressions.
(line 4542)
* optical size of a font, setting the (fzoom): Selecting Fonts.
(line 7771)
* options: Groff Options. (line 516)
* order of evaluation in expressions: Numeric Expressions.
(line 4622)
* ordinary character: Identifiers. (line 4761)
* orientation, landscape: Paper Format. (line 1017)
* origin: Page Geometry. (line 4363)
* orphan: Page Control. (line 7556)
* orphan lines, preventing with ne: Page Control. (line 7520)
* os request, and no-space mode: Page Control. (line 7568)
* outlined circle, drawing (\D'c ...'): Drawing Geometric Objects.
(line 10958)
* outlined ellipse, drawing (\D'e ...'): Drawing Geometric Objects.
(line 10965)
* outlined polygon, drawing (\D'p ...'): Drawing Geometric Objects.
(line 10997)
* output and input requests: Host System Service Access.
(line 12278)
* output comparison operator: Operators in Conditionals.
(line 9599)
* output device name string (.T): Groff Options. (line 810)
* output device name string (.T) <1>: Strings. (line 9278)
* output device name string (.T), in other implementations: Other Differences.
(line 13583)
* output device usage register (.T): Groff Options. (line 810)
* output device usage register (.T), incompatibility with AT&T troff: Other Differences.
(line 13589)
* output devices: Output Device Intro.
(line 377)
* output encoding, ASCII: Groff Options. (line 784)
* output encoding, ISO 646: Groff Options. (line 784)
* output encoding, ISO Latin-1 (8859-1): Groff Options. (line 788)
* output encoding, UTF-8: Groff Options. (line 792)
* output flushes, timing of, incompatibilities with AT&T troff: Other Differences.
(line 13682)
* output format, troff: GNU troff Output. (line 14123)
* output glyphs, and input characters, compatibility with AT&T troff: Other Differences.
(line 13630)
* output line annotation: Output Line Annotation.
(line 10692)
* output line break: Breaking. (line 3813)
* output line break (introduction): Basics. (line 1132)
* output line number register (ln): Output Line Annotation.
(line 10721)
* output line properties: Manipulating Filling and Adjustment.
(line 5832)
* output line, continuation (\c): Line Continuation. (line 7357)
* output line, flush pending (fl): Debugging. (line 13088)
* output line, horizontal position, register (.k): Page Motions.
(line 10655)
* output line, node list of pending, dumping (pline): Debugging.
(line 13056)
* output node: GNU troff Internals.
(line 12764)
* output request, and copy mode: Diversions. (line 11891)
* output request, and \!: Diversions. (line 11891)
* output, filling, disabling request (nf): Manipulating Filling and Adjustment.
(line 5880)
* output, filling, enabling request (fi): Manipulating Filling and Adjustment.
(line 5873)
* output, intermediate: GNU troff Output. (line 14123)
* output, suppressing (\O): Suppressing Output.
(line 12219)
* output, transparent (cf, trf): Host System Service Access.
(line 12409)
* output, transparent (\!, \?): Diversions. (line 11851)
* output, transparent, incompatibilities with AT&T troff: Other Differences.
(line 13663)
* output, troff: GNU troff Output. (line 14108)
* overlapping characters: Characters and Glyphs.
(line 8285)
* overstriking glyphs (\o): Page Motions. (line 10659)
* p scaling unit: Measurements. (line 4414)
* P scaling unit: Measurements. (line 4419)
* package, macro: Macro Packages. (line 4059)
* package, macro, auxiliary: Major Macro Packages.
(line 1458)
* package, macro, full-service: Major Macro Packages.
(line 1447)
* package, macro, introduction: Macro Package Intro.
(line 333)
* package, macro, major: Major Macro Packages.
(line 1444)
* package, macro, minor: Major Macro Packages.
(line 1458)
* package, macro, search path: Macro Directories. (line 940)
* package, package, structuring the source of: Invoking Requests.
(line 4975)
* packages, macro, tutorial for users of: Tutorial for Macro Package Users.
(line 1097)
* padding character, for fields (fc): Fields. (line 7014)
* page: Page Geometry. (line 4335)
* page break: Page Geometry. (line 4369)
* page break <1>: Page Control. (line 7483)
* page break <2>: The Implicit Page Trap.
(line 11388)
* page break (introduction): Basics. (line 1232)
* page break, conditional (ne): Page Control. (line 7520)
* page break, final: End-of-input Traps.
(line 11596)
* page break, prevented by vpt: Vertical Position Traps.
(line 11143)
* page control: Page Control. (line 7483)
* page description language, troff: GNU troff Output. (line 14123)
* page ejection: Page Geometry. (line 4369)
* page ejection <1>: Page Control. (line 7483)
* page ejection <2>: The Implicit Page Trap.
(line 11388)
* page ejection status register (.pe): Page Location Traps.
(line 11350)
* page ejection, of final page: End-of-input Traps.
(line 11596)
* page ejection, prevented by vpt: Vertical Position Traps.
(line 11143)
* page footers: Page Location Traps.
(line 11170)
* page headers: Page Location Traps.
(line 11170)
* page layout: Page Layout. (line 7398)
* page layout [ms]: ms Page Layout. (line 3128)
* page length register (.p): Page Layout. (line 7412)
* page length, configuring (pl): Page Layout. (line 7404)
* page location traps: Page Location Traps.
(line 11151)
* page location traps, debugging: Page Location Traps.
(line 11221)
* page location, vertical, marking (mk): Page Motions. (line 10416)
* page location, vertical, returning to marked (rt): Page Motions.
(line 10416)
* page motions: Page Motions. (line 10411)
* page number character (%): Page Layout. (line 7432)
* page number character, changing (pc): Page Layout. (line 7464)
* page number register (%): Page Control. (line 7501)
* page number, next, assignment request (pn): Page Layout. (line 7418)
* page number, next, register (.pn): Page Layout. (line 7423)
* page offset: Page Geometry. (line 4357)
* page offset (po): Line Layout. (line 7191)
* page orientation, landscape: Paper Format. (line 1017)
* page, geometry of: Page Geometry. (line 4322)
* page, new request (bp): Page Control. (line 7491)
* paper format: Paper Format. (line 1017)
* paper size: Paper Format. (line 1017)
* paragraphs: Paragraphs. (line 1264)
* parameter count register (.$): Parameters. (line 10126)
* parameters: Parameters. (line 10118)
* parameters, and compatibility mode: GNU troff Internals.
(line 12874)
* parameters, macro (\$): Parameters. (line 10150)
* parentheses: Numeric Expressions.
(line 4622)
* partially collected line: Manipulating Filling and Adjustment.
(line 5832)
* path, for font files: Font Directories. (line 985)
* path, for tmac files: Macro Directories. (line 940)
* pattern files, for hyphenation: Manipulating Hyphenation.
(line 6361)
* patterns for hyphenation (hpf): Manipulating Hyphenation.
(line 6431)
* pending node list of output line, dumping (pline): Debugging.
(line 13056)
* pending output line: Manipulating Filling and Adjustment.
(line 5832)
* pending output line, flush (fl): Debugging. (line 13088)
* pi request, and safer mode: Groff Options. (line 747)
* pi request, arguments starting with double quote ", and comments: Host System Service Access.
(line 12348)
* pi request, disabled by default: Safer Mode. (line 13339)
* pi request, incompatibilities with AT&T troff: Other Differences.
(line 13572)
* pica scaling unit (P): Measurements. (line 4419)
* PID of GNU troff register ($$): Host System Service Access.
(line 12282)
* pile, glyph (\b): Drawing Geometric Objects.
(line 11038)
* pl request, using + and - with: Numeric Expressions.
(line 4639)
* plain text approximation output register (.A): Groff Options.
(line 564)
* plain text approximation output register (.A) <1>: Built-in Registers.
(line 5760)
* planting a trap: Traps. (line 11122)
* platform-specific directory: Macro Directories. (line 956)
* pm request, incompatibilities with AT&T troff: Other Differences.
(line 13619)
* pn request, using + and - with: Numeric Expressions.
(line 4639)
* PNG image generation from PostScript: DESC File Format. (line 13779)
* po request, using + and - with: Numeric Expressions.
(line 4639)
* point scaling unit (p): Measurements. (line 4414)
* point size registers (.s, .ps): Changing the Type Size.
(line 8938)
* point size registers, last-requested (.psr, .sr): Using Fractional Type Sizes.
(line 9117)
* point sizes, changing (ps, \s): Changing the Type Size.
(line 8925)
* point sizes, changing (ps, \s) <1>: Using Fractional Type Sizes.
(line 9130)
* point sizes, fractional: Using Fractional Type Sizes.
(line 9062)
* point sizes, fractional <1>: Other Differences. (line 13604)
* point, scaled, scaling unit (s): Measurements. (line 4424)
* point, scaled, scaling unit (s) <1>: Using Fractional Type Sizes.
(line 9070)
* point, typographical, scaling unit (z): Measurements. (line 4427)
* point, typographical, scaling unit (z) <1>: Using Fractional Type Sizes.
(line 9070)
* polygon, filled, drawing (\D'P ...'): Drawing Geometric Objects.
(line 11003)
* polygon, outlined, drawing (\D'p ...'): Drawing Geometric Objects.
(line 10997)
* polygon, solid, drawing (\D'P ...'): Drawing Geometric Objects.
(line 11003)
* polygon, stroked, drawing (\D'p ...'): Drawing Geometric Objects.
(line 10997)
* position of lowest text line (.h): Diversions. (line 11791)
* position, absolute (sic) operator (|): Numeric Expressions.
(line 4647)
* position, drawing: Page Geometry. (line 4348)
* position, horizontal input line, saving (\k): Page Motions.
(line 10642)
* position, horizontal, in input line, register (hp): Page Motions.
(line 10651)
* position, horizontal, in output line, register (.k): Page Motions.
(line 10655)
* position, mounting: Using Fonts. (line 7638)
* position, vertical, in diversion, register (.d): Diversions.
(line 11764)
* positions, font: Font Positions. (line 7899)
* positions, font mounting, occupied, dumping (pfp): Debugging.
(line 13030)
* post-vertical line spacing: Changing the Vertical Spacing.
(line 9037)
* post-vertical line spacing register (.pvs): Changing the Vertical Spacing.
(line 9049)
* post-vertical line spacing, changing (pvs): Changing the Vertical Spacing.
(line 9049)
* postprocessor access: Postprocessor Access.
(line 12642)
* postprocessors: Output Device Intro.
(line 377)
* PostScript, bounding box: Miscellaneous. (line 12749)
* PostScript, PNG image generation: DESC File Format. (line 13779)
* prefix, for commands: Environment. (line 879)
* preprocessors: Preprocessor Intro.
(line 345)
* previous font, selecting (ft): Selecting Fonts. (line 7698)
* previous font, selecting (\f[], \fP): Selecting Fonts. (line 7726)
* previous line length (.n): Environments. (line 12210)
* print current page register (.P): Groff Options. (line 710)
* print to the standard error stream (tm, tm1, tmc): Debugging.
(line 12968)
* printing backslash (\\, \e, \E, \[rs]): Other Differences.
(line 13663)
* printing line numbers (nm): Output Line Annotation.
(line 10699)
* printing, zero-width (\z, \Z): Page Motions. (line 10664)
* printing, zero-width (\z, \Z) <1>: Page Motions. (line 10669)
* process ID of GNU troff register ($$): Host System Service Access.
(line 12282)
* productive input line: Manipulating Filling and Adjustment.
(line 6009)
* properties of characters (cflags): Characters and Glyphs.
(line 8253)
* properties of glyphs (cflags): Characters and Glyphs.
(line 8253)
* properties of output lines: Manipulating Filling and Adjustment.
(line 5832)
* ps request, and constant glyph spacing mode: Artificial Fonts.
(line 8676)
* ps request, incompatibilities with AT&T troff: Other Differences.
(line 13604)
* ps request, using + and - with: Numeric Expressions.
(line 4639)
* ps request, with fractional type sizes: Using Fractional Type Sizes.
(line 9070)
* pso request, and safer mode: Groff Options. (line 747)
* pvs request, using + and - with: Numeric Expressions.
(line 4639)
* quanta, motion: Motion Quanta. (line 4458)
* quantum, horizontal motion: DESC File Format. (line 13774)
* quantum, vertical motion: DESC File Format. (line 13886)
* quoting the control character with \\: Copy Mode. (line 10255)
* quoting the escape character with \\: Copy Mode. (line 10255)
* radicalex glyph, and cflags: Characters and Glyphs.
(line 8285)
* ragged-left text: Manipulating Filling and Adjustment.
(line 5911)
* ragged-right text: Manipulating Filling and Adjustment.
(line 5908)
* rc request, and glyph definitions: Characters and Glyphs.
(line 8351)
* read (interpolate) from standard input stream (rd): Host System Service Access.
(line 12455)
* read next file (nx): Host System Service Access.
(line 12451)
* read-only register removal, incompatibility with AT&T troff: Other Differences.
(line 13594)
* read-only register, changing format: Assigning Register Formats.
(line 5706)
* recursive macros: while. (line 9887)
* refer, and macro names starting with [ or ]: Identifiers. (line 4789)
* reference, troff: GNU troff Reference.
(line 3637)
* references [ms]: ms Insertions. (line 2920)
* register format: Registers. (line 5433)
* register format, in expressions: Assigning Register Formats.
(line 5718)
* register, assigning number format to (af): Assigning Register Formats.
(line 5647)
* register, built-in, removing: Built-in Registers.
(line 5746)
* register, creating alias of (aln): Setting Registers. (line 5552)
* register, format (\g): Assigning Register Formats.
(line 5713)
* register, read-only, removal, incompatibility with AT&T troff: Other Differences.
(line 13594)
* register, removing (rr): Setting Registers. (line 5538)
* register, removing alias of (rr): Setting Registers. (line 5557)
* register, renaming (rnn): Setting Registers. (line 5547)
* registers: Registers. (line 5427)
* registers, available number of, register (.R): Built-in Registers.
(line 5780)
* registers, built-in: Built-in Registers.
(line 5742)
* registers, dumping (pnr): Debugging. (line 13069)
* registers, interpolating (\n): Interpolating Registers.
(line 5567)
* registers, setting (nr, \R): Setting Registers. (line 5441)
* removal of read-only registers, incompatibility with AT&T troff: Other Differences.
(line 13594)
* removing a built-in register: Built-in Registers.
(line 5746)
* removing a register (rr): Setting Registers. (line 5538)
* removing alias of register (rr): Setting Registers. (line 5557)
* removing alias, for diversion (rm): Strings. (line 9526)
* removing alias, for macro (rm): Strings. (line 9526)
* removing alias, for string (rm): Strings. (line 9526)
* removing character definition (rchar, rfschar): Characters and Glyphs.
(line 8424)
* removing diversion (rm): Strings. (line 9483)
* removing macro (rm): Strings. (line 9483)
* removing request (rm): Strings. (line 9483)
* removing string (rm): Strings. (line 9483)
* renaming a register (rnn): Setting Registers. (line 5547)
* renaming diversion (rn): Strings. (line 9480)
* renaming macro (rn): Strings. (line 9480)
* renaming request (rn): Strings. (line 9480)
* renaming string (rn): Strings. (line 9480)
* renditions, graphic: Using Fonts. (line 7668)
* request: Requests and Macros.
(line 3907)
* request <1>: Formatter Instructions.
(line 4874)
* request arguments: Invoking Requests. (line 4961)
* request arguments, and compatibility mode: GNU troff Internals.
(line 12874)
* request arguments, and tabs: Invoking Requests. (line 4961)
* request, removing (rm): Strings. (line 9483)
* request, renaming (rn): Strings. (line 9480)
* request, undefined: Comments. (line 5344)
* requests for drawing: Drawing Geometric Objects.
(line 10856)
* requests for input and output: Host System Service Access.
(line 12278)
* requests handling file name arguments, in other implementations: Other Differences.
(line 13572)
* requests, intercepting: Control Characters.
(line 4937)
* requests, invoking: Invoking Requests. (line 4953)
* requests, modifying: Control Characters.
(line 4937)
* resolution, device: Page Geometry. (line 4329)
* resolution, device <1>: DESC File Format. (line 13836)
* resolution, device, obtaining in the formatter: Measurements.
(line 4401)
* resolution, horizontal: DESC File Format. (line 13774)
* resolution, horizontal, register (.H): Motion Quanta. (line 4465)
* resolution, vertical: DESC File Format. (line 13886)
* resolution, vertical, register (.V): Motion Quanta. (line 4465)
* (keycap notation): Conventions Used in This Manual.
(line 415)
* returning to marked vertical page location (rt): Page Motions.
(line 10416)
* revision number register (.Y): Built-in Registers.
(line 5803)
* right margin: Line Layout. (line 7197)
* right-aligning lines (introduction): Basics. (line 1229)
* right-aligning text (rj): Manipulating Filling and Adjustment.
(line 6080)
* rivers: Other Differences. (line 13541)
* rj request, causing implicit break: Manipulating Filling and Adjustment.
(line 5812)
* rn glyph, and cflags: Characters and Glyphs.
(line 8285)
* roman glyph, correction after slanted glyph (\/): Italic Corrections.
(line 8776)
* roman glyph, correction before slanted glyph (\,): Italic Corrections.
(line 8788)
* Roman numerals: Assigning Register Formats.
(line 5667)
* Roman numerals, extrema (maximum and minimum): Assigning Register Formats.
(line 5699)
* rq glyph, at end of sentence: Sentences. (line 3752)
* rq glyph, at end of sentence <1>: Characters and Glyphs.
(line 8295)
* rt request, using + and - with: Numeric Expressions.
(line 4639)
* ru glyph, and cflags: Characters and Glyphs.
(line 8285)
* run-in headings: Sections and Chapters.
(line 1307)
* running system commands: Host System Service Access.
(line 12541)
* s scaling unit: Measurements. (line 4424)
* s scaling unit <1>: Using Fractional Type Sizes.
(line 9070)
* safer mode: Groff Options. (line 747)
* safer mode <1>: Macro Directories. (line 950)
* safer mode <2>: Built-in Registers.
(line 5791)
* safer mode <3>: Host System Service Access.
(line 12393)
* safer mode <4>: Host System Service Access.
(line 12532)
* safer mode <5>: Host System Service Access.
(line 12548)
* safer mode <6>: Host System Service Access.
(line 12577)
* safer mode <7>: Safer Mode. (line 13339)
* saturating arithmetic: Numeric Expressions.
(line 4532)
* saving horizontal input line position (\k): Page Motions. (line 10642)
* scaled point scaling unit (s): Measurements. (line 4424)
* scaled point scaling unit (s) <1>: Using Fractional Type Sizes.
(line 9070)
* scaling indicator: Measurements. (line 4392)
* scaling operator: Numeric Expressions.
(line 4565)
* scaling unit c: Measurements. (line 4411)
* scaling unit f: Colors. (line 9190)
* scaling unit i: Measurements. (line 4408)
* scaling unit m: Measurements. (line 4441)
* scaling unit M: Measurements. (line 4453)
* scaling unit n: Measurements. (line 4445)
* scaling unit p: Measurements. (line 4414)
* scaling unit P: Measurements. (line 4419)
* scaling unit s: Measurements. (line 4424)
* scaling unit s <1>: Using Fractional Type Sizes.
(line 9070)
* scaling unit u: Measurements. (line 4404)
* scaling unit v: Measurements. (line 4450)
* scaling unit z: Measurements. (line 4427)
* scaling unit z <1>: Using Fractional Type Sizes.
(line 9070)
* schar request, and comments: Characters and Glyphs.
(line 8347)
* search path, font: Font Directories. (line 985)
* search procedure for macro packages: Macro Directories. (line 938)
* seconds, current time (seconds): Host System Service Access.
(line 12291)
* selecting the previous font (ft): Selecting Fonts. (line 7698)
* sentence space size register (.sss): Manipulating Filling and Adjustment.
(line 6101)
* sentence, cancelling detection of end of, on AT&T troff: Other Differences.
(line 13536)
* sentence-ending punctuation: Sentences. (line 3708)
* sentences: Sentences. (line 3696)
* sequence, escape: Formatter Instructions.
(line 4880)
* setting diversion trap (dt): Diversion Traps. (line 11418)
* setting end-of-input trap (em): End-of-input Traps.
(line 11569)
* setting input line trap (it, itc): Input Line Traps. (line 11433)
* setting registers (nr, \R): Setting Registers. (line 5441)
* setting the page length (pl): Page Layout. (line 7404)
* setting up an abstract font style (sty): Font Families. (line 7865)
* shc request, and translations: Character Translations.
(line 7077)
* site-local directory: Macro Directories. (line 956)
* site-local directory <1>: Font Directories. (line 1000)
* size of sentence space register (.sss): Manipulating Filling and Adjustment.
(line 6101)
* size of word space register (.ss): Manipulating Filling and Adjustment.
(line 6101)
* size, optical, of a font, setting (fzoom): Selecting Fonts.
(line 7771)
* size, paper: Paper Format. (line 1017)
* size, size: Manipulating Type Size and Vertical Spacing.
(line 8897)
* sizes, fractional: Other Differences. (line 13604)
* sizes, fractional type: Using Fractional Type Sizes.
(line 9062)
* skew, of last glyph (.csk): Environments. (line 12195)
* slant, font, changing (\S): Artificial Fonts. (line 8590)
* slanted (font shape): Using Fonts. (line 7623)
* so request, arguments starting with double quote ", and comments: Host System Service Access.
(line 12348)
* so request, incompatibilities with AT&T troff: Other Differences.
(line 13572)
* soft hyphen character, setting (shc): Manipulating Hyphenation.
(line 6272)
* soft hyphen glyph (hy): Manipulating Hyphenation.
(line 6272)
* solid circle, drawing (\D'C ...'): Drawing Geometric Objects.
(line 10962)
* solid ellipse, drawing (\D'E ...'): Drawing Geometric Objects.
(line 10969)
* solid polygon, drawing (\D'P ...'): Drawing Geometric Objects.
(line 11003)
* soquiet request, arguments starting with double quote ", and comments: Host System Service Access.
(line 12348)
* SOURCE_DATE_EPOCH, environment variable: Environment. (line 923)
* sp request, and no-space mode: Manipulating Spacing.
(line 6784)
* sp request, causing implicit break: Manipulating Filling and Adjustment.
(line 5812)
* space between sentences: Sentences. (line 3708)
* space between sentences register (.sss): Manipulating Filling and Adjustment.
(line 6101)
* space between words register (.ss): Manipulating Filling and Adjustment.
(line 6101)
* space character, as delimiter: Delimiters. (line 5273)
* space characters, in expressions: Numeric Expressions.
(line 4715)
* space, between sentences: Manipulating Filling and Adjustment.
(line 6108)
* space, between words: Manipulating Filling and Adjustment.
(line 6106)
* space, discardable, horizontal: Manipulating Filling and Adjustment.
(line 6129)
* space, hair (\^): Page Motions. (line 10566)
* space, horizontal (\h): Page Motions. (line 10533)
* space, horizontal, unformatting: Punning Names. (line 12051)
* space, thin (\|): Page Motions. (line 10561)
* space, trailing, on input lines, difference from AT&T troff: Other Differences.
(line 13536)
* space, unbreakable (\~): Manipulating Filling and Adjustment.
(line 5859)
* space, unbreakable and unadjustable (\): Page Motions.
(line 10556)
* space, vertical, unit (v): Measurements. (line 4450)
* space, width of a digit (numeral) (\0): Page Motions. (line 10572)
* space, word: Manipulating Filling and Adjustment.
(line 6101)
* spaces in character definitions: Characters and Glyphs.
(line 8347)
* spaces in ds and ds1 argument, leading: Strings. (line 9340)
* spaces in file name arguments: Manipulating Hyphenation.
(line 6477)
* spaces in file name or system command arguments: Host System Service Access.
(line 12348)
* spaces in string definitions and appendments: Strings. (line 9314)
* spaces in string length measurement: Strings. (line 9412)
* spaces, in a macro argument: Calling Macros. (line 5029)
* spaces, leading and trailing: Breaking. (line 3845)
* spacing (introduction): Basics. (line 1194)
* spacing, manipulating: Manipulating Spacing.
(line 6658)
* spacing, vertical: Page Geometry. (line 4343)
* spacing, vertical <1>: Manipulating Type Size and Vertical Spacing.
(line 8897)
* spacing, vertical (introduction): Basics. (line 1181)
* (keycap notation): Conventions Used in This Manual.
(line 415)
* special character name space, shared with character classes: Identifiers.
(line 4836)
* special characters: Sentences. (line 3752)
* special characters <1>: Character Translations.
(line 7063)
* special characters [ms]: ms Legacy Features.
(line 3488)
* special characters, in device extension commands: Postprocessor Access.
(line 12663)
* special characters, list of (groff_char(7) man page): Characters and Glyphs.
(line 8077)
* special font: Using Fonts. (line 7623)
* special fonts: Characters and Glyphs.
(line 7976)
* special fonts <1>: Special Fonts. (line 8508)
* special fonts <2>: Font Description File Format.
(line 13965)
* special fonts, emboldening: Artificial Fonts. (line 8663)
* special request, and font translations: Selecting Fonts. (line 7759)
* special request, and glyph search order: Characters and Glyphs.
(line 7976)
* spline, drawing (\D'~ ...'): Drawing Geometric Objects.
(line 10949)
* springing a trap: Traps. (line 11123)
* sqrtex glyph, and cflags: Characters and Glyphs.
(line 8285)
* ss request, incompatibilities with AT&T troff: Other Differences.
(line 13626)
* stack: Environments. (line 12078)
* stacking glyphs (\b): Drawing Geometric Objects.
(line 11038)
* standard error stream, write to (tm, tm1, tmc): Debugging.
(line 12968)
* standard input stream, interpolate from (rd): Host System Service Access.
(line 12455)
* stops, tab: Tabs and Leaders. (line 3875)
* stream, standard error, write to (tm, tm1, tmc): Debugging.
(line 12968)
* streams, open, dumping (pstream): Debugging. (line 13075)
* string arguments: Strings. (line 9293)
* string comparison: Operators in Conditionals.
(line 9628)
* string expansion (\*): Strings. (line 9293)
* string interpolation (\*): Strings. (line 9293)
* string name space, shared with macros and diversions: Identifiers.
(line 4836)
* string, appending (as): Strings. (line 9392)
* string, creating alias of (als): Strings. (line 9491)
* string, dumping (pm): Debugging. (line 13063)
* string, length of (length): Strings. (line 9413)
* string, removing (rm): Strings. (line 9483)
* string, removing alias of (rm): Strings. (line 9526)
* string, renaming (rn): Strings. (line 9480)
* strings: Strings. (line 9271)
* strings [ms]: ms Legacy Features.
(line 3488)
* strings, multi-line: Strings. (line 9350)
* stripping final newline in diversions: Punning Names. (line 12051)
* stroke color: Colors. (line 9156)
* stroke color name register (.m): Colors. (line 9227)
* stroked circle, drawing (\D'c ...'): Drawing Geometric Objects.
(line 10958)
* stroked ellipse, drawing (\D'e ...'): Drawing Geometric Objects.
(line 10965)
* stroked polygon, drawing (\D'p ...'): Drawing Geometric Objects.
(line 10997)
* structuring source code of documents or macro packages: Invoking Requests.
(line 4975)
* sty request, and changing fonts: Selecting Fonts. (line 7698)
* sty request, and font translations: Selecting Fonts. (line 7759)
* style, font: Using Fonts. (line 7623)
* style, font, abstract: Using Fonts. (line 7645)
* style, font, abstract, setting up (sty): Font Families. (line 7865)
* styles, font: Font Families. (line 7811)
* substring (substring): Strings. (line 9446)
* subtraction: Numeric Expressions.
(line 4535)
* supplemental inter-sentence space: Manipulating Filling and Adjustment.
(line 6108)
* suppressing output (\O): Suppressing Output.
(line 12219)
* suppression nesting level register (.O): Suppressing Output.
(line 12272)
* sv request, and no-space mode: Page Control. (line 7568)
* switching environments (ev): Environments. (line 12114)
* sy request, and safer mode: Groff Options. (line 747)
* sy request, arguments starting with double quote ", and comments: Host System Service Access.
(line 12348)
* sy request, disabled by default: Safer Mode. (line 13339)
* sy request, incompatibilities with AT&T troff: Other Differences.
(line 13572)
* symbol: Characters and Glyphs.
(line 7976)
* symbol table, dumping (pm): Debugging. (line 13063)
* symbol, defining (char): Characters and Glyphs.
(line 8351)
* symbols (characters and glyphs), using: Characters and Glyphs.
(line 7964)
* system commands, running: Host System Service Access.
(line 12541)
* system() return value register (systat): Host System Service Access.
(line 12552)
* tab character: Tabs and Leaders. (line 3875)
* tab character encoding: Tabs and Fields. (line 6813)
* tab character, and translations: Character Translations.
(line 7073)
* tab character, as delimiter: Delimiters. (line 5273)
* tab character, non-interpreted (\t): Tabs and Fields. (line 6817)
* tab repetition character (tc): Tabs and Fields. (line 6928)
* tab stop settings register (.tabs): Tabs and Fields. (line 6919)
* tab stops: Tabs and Leaders. (line 3875)
* tab stops, default: Tabs and Fields. (line 6825)
* tab, line-tabs mode: Tabs and Fields. (line 6941)
* table of contents: Table of Contents. (line 1371)
* table of contents <1>: Leaders. (line 6993)
* table of contents, creating [ms]: ms TOC. (line 3222)
* table, multi-page, example [ms]: ms Insertions. (line 2963)
* tables [ms]: ms Insertions. (line 2920)
* tabs, and fields: Tabs and Fields. (line 6813)
* tabs, and macro arguments: Invoking Requests. (line 4961)
* tabs, and request arguments: Invoking Requests. (line 4961)
* tabs, before comments: Comments. (line 5339)
* tagged paragraphs: Paragraphs. (line 1273)
* tags, paragraph: Paragraphs. (line 1273)
* terminal, conditional output for: Operators in Conditionals.
(line 9574)
* text baseline: Page Geometry. (line 4342)
* text baseline <1>: Manipulating Type Size and Vertical Spacing.
(line 8897)
* text font: Using Fonts. (line 7623)
* text line: Requests and Macros.
(line 3919)
* text line, position of lowest (.h): Diversions. (line 11791)
* text, GNU troff processing of: Text. (line 3644)
* text, justifying: Manipulating Filling and Adjustment.
(line 5812)
* text, right-aligning (rj): Manipulating Filling and Adjustment.
(line 6080)
* thickness of lines (\D't ...'): Drawing Geometric Objects.
(line 11028)
* thin space (\|): Page Motions. (line 10561)
* three-part title (tl): Page Layout. (line 7432)
* ti request, causing implicit break: Manipulating Filling and Adjustment.
(line 5812)
* ti request, using + and - with: Numeric Expressions.
(line 4639)
* time, current, hours (hours): Host System Service Access.
(line 12297)
* time, current, minutes (minutes): Host System Service Access.
(line 12294)
* time, current, seconds (seconds): Host System Service Access.
(line 12291)
* timing of output flushes, incompatibilities with AT&T troff: Other Differences.
(line 13682)
* title length, configuring (lt): Page Layout. (line 7450)
* title line length register (.lt): Page Layout. (line 7461)
* title line, formatting (tl): Page Layout. (line 7432)
* titles: Page Layout. (line 7427)
* tkf request, and font styles: Font Families. (line 7865)
* tkf request, and font translations: Selecting Fonts. (line 7759)
* tkf request, with fractional type sizes: Using Fractional Type Sizes.
(line 9070)
* tl request, and mc: Output Line Annotation.
(line 10805)
* tmac, directory: Macro Directories. (line 940)
* tmac, path: Macro Directories. (line 940)
* TMPDIR, environment variable: Environment. (line 909)
* token: GNU troff Internals.
(line 12764)
* top margin: Page Location Traps.
(line 11170)
* top-level diversion: Diversions. (line 11689)
* top-level diversion, and bp: Page Control. (line 7496)
* top-level diversion, and \!: Diversions. (line 11883)
* top-level diversion, and \?: Diversions. (line 11888)
* tr request, and glyph definitions: Characters and Glyphs.
(line 8351)
* tr request, and soft hyphen character: Manipulating Hyphenation.
(line 6272)
* tr request, incompatibilities with AT&T troff: Other Differences.
(line 13630)
* track kerning: Ligatures and Kerning.
(line 8745)
* track kerning, activating (tkf): Ligatures and Kerning.
(line 8752)
* trailing space, on input lines, difference from AT&T troff: Other Differences.
(line 13536)
* trailing spaces on text lines: Breaking. (line 3845)
* translations of characters: Character Translations.
(line 7044)
* translations, font, dumping (pftr): Debugging. (line 13040)
* transparent characters: Characters and Glyphs.
(line 8295)
* transparent dummy character (\)): Dummy Characters. (line 8865)
* transparent output (cf, trf): Host System Service Access.
(line 12409)
* transparent output (\!, \?): Diversions. (line 11851)
* transparent output, incompatibilities with AT&T troff: Other Differences.
(line 13663)
* trap: Deferring Output. (line 11067)
* trap name, next, register (.trap): Page Location Traps.
(line 11346)
* trap, changing location (ch): Page Location Traps.
(line 11276)
* trap, distance to next vertical position, register (.t): Page Location Traps.
(line 11268)
* trap, diversion, setting (dt): Diversion Traps. (line 11418)
* trap, end-of-input, setting (em): End-of-input Traps.
(line 11569)
* trap, implicit: The Implicit Page Trap.
(line 11388)
* trap, input line, clearing (it, itc): Input Line Traps. (line 11433)
* trap, input line, setting (it, itc): Input Line Traps. (line 11433)
* trap, planting: Traps. (line 11122)
* trap, springing: Traps. (line 11123)
* traps: Traps. (line 11117)
* traps, and diversions: Page Location Traps.
(line 11370)
* traps, blank line: Blank Line Traps. (line 11538)
* traps, diversion: Diversion Traps. (line 11413)
* traps, end-of-input: End-of-input Traps.
(line 11568)
* traps, input line: Input Line Traps. (line 11428)
* traps, input line, and interrupted lines (itc): Input Line Traps.
(line 11458)
* traps, leading space: Leading Space Traps.
(line 11548)
* traps, page location: Page Location Traps.
(line 11151)
* traps, page location, dumping (pwh): Debugging. (line 13081)
* traps, page location, listing (pwh): Debugging. (line 13081)
* traps, sprung by bp request (.pe): Page Location Traps.
(line 11350)
* traps, vertical position: Vertical Position Traps.
(line 11129)
* trf request, and copy mode: Host System Service Access.
(line 12409)
* trf request, and invalid characters: Host System Service Access.
(line 12417)
* trf request, arguments starting with double quote ", and comments: Host System Service Access.
(line 12348)
* trf request, causing implicit break: Manipulating Filling and Adjustment.
(line 5812)
* trin request, and asciify: Diversions. (line 11909)
* troff mode: troff and nroff Modes.
(line 7135)
* troff output format: GNU troff Output. (line 14123)
* troff page description language: GNU troff Output. (line 14123)
* troff, GNU, interactive use of: Debugging. (line 13088)
* troff, GNU, reference: GNU troff Reference.
(line 3637)
* troff, interactive use of: Debugging. (line 13088)
* troff, output: GNU troff Output. (line 14108)
* troff, reference: GNU troff Reference.
(line 3637)
* truncated vertical space register (.trunc): Page Location Traps.
(line 11335)
* truncating division: Numeric Expressions.
(line 4535)
* TTY, conditional output for: Operators in Conditionals.
(line 9574)
* tutorial for macro package users: Tutorial for Macro Package Users.
(line 1097)
* type size: Manipulating Type Size and Vertical Spacing.
(line 8897)
* type size registers (.s, .ps): Changing the Type Size.
(line 8938)
* type size registers, last-requested (.psr, .sr): Using Fractional Type Sizes.
(line 9117)
* type sizes, changing (ps, \s): Changing the Type Size.
(line 8925)
* type sizes, changing (ps, \s) <1>: Using Fractional Type Sizes.
(line 9130)
* type sizes, fractional: Using Fractional Type Sizes.
(line 9062)
* type sizes, fractional <1>: Other Differences. (line 13604)
* typeface: Using Fonts. (line 7623)
* typographical point scaling unit (z): Measurements. (line 4427)
* typographical point scaling unit (z) <1>: Using Fractional Type Sizes.
(line 9070)
* TZ, environment variable: Environment. (line 931)
* u scaling unit: Measurements. (line 4404)
* uf request, and font styles: Font Families. (line 7865)
* ul glyph, and cflags: Characters and Glyphs.
(line 8285)
* ul request, and font translations: Selecting Fonts. (line 7759)
* Ultrix-specific man macros: Optional man extensions.
(line 1502)
* unadjustable and unbreakable space (\): Page Motions.
(line 10556)
* unary arithmetic operators: Numeric Expressions.
(line 4542)
* unbreakable and unadjustable space (\): Page Motions.
(line 10556)
* unbreakable space (\~): Manipulating Filling and Adjustment.
(line 5859)
* undefined identifiers: Identifiers. (line 4824)
* undefined request: Comments. (line 5344)
* underline font (uf): Artificial Fonts. (line 8638)
* underlining (ul): Artificial Fonts. (line 8612)
* underlining, continuous (cu): Artificial Fonts. (line 8634)
* unformatting diversions (asciify): Diversions. (line 11909)
* unformatting horizontal space: Punning Names. (line 12051)
* Unicode: Input Format. (line 4076)
* Unicode <1>: Characters and Glyphs.
(line 8217)
* unit, scaling, c: Measurements. (line 4411)
* unit, scaling, f: Colors. (line 9190)
* unit, scaling, i: Measurements. (line 4408)
* unit, scaling, m: Measurements. (line 4441)
* unit, scaling, M: Measurements. (line 4453)
* unit, scaling, n: Measurements. (line 4445)
* unit, scaling, p: Measurements. (line 4414)
* unit, scaling, P: Measurements. (line 4419)
* unit, scaling, s: Measurements. (line 4424)
* unit, scaling, s <1>: Using Fractional Type Sizes.
(line 9070)
* unit, scaling, u: Measurements. (line 4404)
* unit, scaling, v: Measurements. (line 4450)
* unit, scaling, z: Measurements. (line 4427)
* unit, scaling, z <1>: Using Fractional Type Sizes.
(line 9070)
* units of measurement: Measurements. (line 4392)
* units, basic: Page Geometry. (line 4329)
* units, basic, conversion to: Measurements. (line 4399)
* units, default: Default Units. (line 4484)
* units, machine: Page Geometry. (line 4329)
* unnamed glyphs: Characters and Glyphs.
(line 8227)
* unnamed glyphs, accessing with \N: Font Description File Format.
(line 13988)
* unsafe mode: Groff Options. (line 821)
* unsafe mode <1>: Macro Directories. (line 950)
* unsafe mode <2>: Built-in Registers.
(line 5791)
* unsafe mode <3>: Host System Service Access.
(line 12393)
* unsafe mode <4>: Host System Service Access.
(line 12532)
* unsafe mode <5>: Host System Service Access.
(line 12548)
* unsafe mode <6>: Host System Service Access.
(line 12577)
* unstyled font: Using Fonts. (line 7623)
* untokenized escape sequence, \f: Selecting Fonts. (line 7751)
* untokenized escape sequence, \F: Font Families. (line 7856)
* untokenized escape sequence, \H: Artificial Fonts. (line 8569)
* untokenized escape sequence, \m: Colors. (line 9231)
* untokenized escape sequence, \M: Colors. (line 9248)
* untokenized escape sequence, \R: Setting Registers. (line 5460)
* untokenized escape sequence, \S: Artificial Fonts. (line 8599)
* untokenized escape sequence, \s: Changing the Type Size.
(line 8981)
* uppercasing a string (stringup): Strings. (line 9465)
* upright (font shape): Using Fonts. (line 7623)
* upright glyph, correction after slanted glyph (\/): Italic Corrections.
(line 8776)
* upright glyph, correction before slanted glyph (\,): Italic Corrections.
(line 8788)
* URLs, breaking (\:): Manipulating Hyphenation.
(line 6248)
* user's tutorial: Tutorial for Macro Package Users.
(line 1097)
* using escape sequences: Using Escape Sequences.
(line 5117)
* using symbols (characters and glyphs): Characters and Glyphs.
(line 7964)
* UTF-8 output encoding: Groff Options. (line 792)
* v scaling unit: Measurements. (line 4450)
* valid numeric expression: Numeric Expressions.
(line 4698)
* value, incrementing without changing the register: Auto-increment.
(line 5637)
* variables in environment: Environment. (line 867)
* vee: Page Geometry. (line 4343)
* vee scaling unit (v): Measurements. (line 4450)
* version number, major, register (.x): Built-in Registers.
(line 5795)
* version number, minor, register (.y): Built-in Registers.
(line 5799)
* vertical drawing position (nl): Page Control. (line 7574)
* vertical line drawing (\L): Drawing Geometric Objects.
(line 10897)
* vertical line spacing register (.v): Changing the Vertical Spacing.
(line 9009)
* vertical line spacing, changing (vs): Changing the Vertical Spacing.
(line 9009)
* vertical line spacing, effective value: Changing the Vertical Spacing.
(line 9023)
* vertical motion (\v): Page Motions. (line 10489)
* vertical motion quantum: DESC File Format. (line 13886)
* vertical motion quantum register (.V): Motion Quanta. (line 4465)
* vertical page location, marking (mk): Page Motions. (line 10416)
* vertical page location, returning to marked (rt): Page Motions.
(line 10416)
* vertical position in diversion register (.d): Diversions. (line 11764)
* vertical position trap enable register (.vpt): Vertical Position Traps.
(line 11137)
* vertical position traps: Vertical Position Traps.
(line 11129)
* vertical position traps, enabling (vpt): Vertical Position Traps.
(line 11137)
* vertical position, drawing (nl): Page Control. (line 7574)
* vertical resolution: DESC File Format. (line 13886)
* vertical resolution register (.V): Motion Quanta. (line 4465)
* vertical space unit (v): Measurements. (line 4450)
* vertical spacing: Page Geometry. (line 4343)
* vertical spacing <1>: Manipulating Type Size and Vertical Spacing.
(line 8897)
* vertical spacing (introduction): Basics. (line 1181)
* warning categories: Warnings. (line 13192)
* warning level (warn): Debugging. (line 13167)
* warnings: Debugging. (line 13178)
* warnings <1>: Warnings. (line 13185)
* what is groff?: What Is groff?. (line 267)
* while request: while. (line 9855)
* while request, and font translations: Selecting Fonts. (line 7759)
* while request, and the ! operator: Numeric Expressions.
(line 4542)
* while request, confusing with br: while. (line 9921)
* while request, operators to use with: Operators in Conditionals.
(line 9548)
* widow: Page Control. (line 7556)
* width computation escape sequence (\w): Page Motions. (line 10585)
* width, of last glyph (.w): Environments. (line 12195)
* word space: Manipulating Filling and Adjustment.
(line 6101)
* word space size register (.ss): Manipulating Filling and Adjustment.
(line 6101)
* word, definition of: Filling. (line 3670)
* write request, and copy mode: Host System Service Access.
(line 12587)
* writec request, and copy mode: Host System Service Access.
(line 12587)
* writem request, and copy mode: Host System Service Access.
(line 12597)
* writing macros: Writing Macros. (line 9938)
* year, current, register (year, yr): Host System Service Access.
(line 12309)
* z scaling unit: Measurements. (line 4427)
* z scaling unit <1>: Using Fractional Type Sizes.
(line 9070)
* zero, division and modulus by: Numeric Expressions.
(line 4539)
* zero-width printing (\z, \Z): Page Motions. (line 10664)
* zero-width printing (\z, \Z) <1>: Page Motions. (line 10669)
* zoom factor of a font (fzoom): Selecting Fonts. (line 7771)