diff options
author | wlemb <wlemb> | 2001-03-19 16:16:57 +0000 |
---|---|---|
committer | wlemb <wlemb> | 2001-03-19 16:16:57 +0000 |
commit | c20daf491a3bb0683485149363d81c495eedac1d (patch) | |
tree | 036c47aa53c4b28cb3c7cdcbf1effc11ee85ad3d | |
parent | e5a0b23b819595fefde823ccdbe168a70e26f6c6 (diff) | |
download | groff-c20daf491a3bb0683485149363d81c495eedac1d.tar.gz |
* doc/groff.texinfo: Added two new indices: `es' (for escapes) and
`rq' for requests. `fn' is no longer used.
Added macros @Defreq(x), @Defreg(x), and @Defesc(x).
Removed @Deffn(x).
* doc/groff.texinfo: Complete revision. Added many @Deffn to gain
consistency.
-rw-r--r-- | ChangeLog | 12 | ||||
-rw-r--r-- | doc/groff.texinfo | 3151 |
2 files changed, 1747 insertions, 1416 deletions
@@ -1,5 +1,17 @@ 2001-03-19 Werner LEMBERG <wl@gnu.org> + * doc/groff.texinfo: Added two new indices: `es' (for escapes) and + `rq' for requests. `fn' is no longer used. + Added macros @Defreq(x), @Defreg(x), and @Defesc(x). + Removed @Deffn(x). + +2001-03-19 Larry Kollar <kollar@alltel.net> + + * doc/groff.texinfo: Complete revision. Added many @Deffn to gain + consistency. + +2001-03-19 Werner LEMBERG <wl@gnu.org> + * man/groff_font.man: Document `prepro', `postpro', and `print'. * src/roff/groff/groff.man: Improve documentation of `-l' and `-L'. * src/devices/grohtml/grohtml.man: Fixing typos. diff --git a/doc/groff.texinfo b/doc/groff.texinfo index 5283e757..a73ce85f 100644 --- a/doc/groff.texinfo +++ b/doc/groff.texinfo @@ -16,7 +16,8 @@ @c We use the following indices: @c @c cindex: concepts -@c findex: requests, escapes, and functions +@c rqindex: requests +@c esindex: escapes @c vindex: registers @c kindex: commands in font files @c pindex: programs and files @@ -27,42 +28,79 @@ @c @c tindex and cindex are merged. +@defcodeindex rq +@defcodeindex es @defcodeindex ma @defcodeindex gl @defcodeindex op @syncodeindex tp cp -@macro Deffn{category, name, arg} -@deffn \category\ @t{\name\} \arg\ +@c definition of requests + +@macro Defreq{name, arg} +@rqindex \name\ +@deffn Request @t{\name\} \arg\ +@end macro + +@macro Defreqx{name, arg} +@rqindex \name\ +@deffnx Request @t{\name\} \arg\ @end macro -@macro end_Deffn +@macro end_Defreq @end deffn @end macro -@macro Deffnx{category, name, arg} -@deffnx \category\ @t{\name\} \arg\ + +@c definition of escapes + +@macro Defesc{name, arg} +@esindex \name\ +@deffn Escape @t{\name\} \arg\ @end macro -@macro end_Deffnx -@end deffnx +@macro Defescx{name, arg} +@esindex \name\ +@deffnx Escape @t{\name\} \arg\ @end macro -@macro Defmac{name, arg} -@defmac @t{\name\} \arg\ +@macro end_Defesc +@end deffn @end macro -@macro end_Defmac -@end defmac + +@c definition of registers + +@macro Defreg{name} +@vindex \name\ +@deffn Register @t{\name\} +@end macro + +@macro Defregx{name} +@vindex \name\ +@deffnx Register @t{\name\} +@end macro + +@macro end_Defreg +@end deffn +@end macro + + +@c definition of macros + +@macro Defmac{name, arg} +@maindex \name\ +@defmac @t{\name\} \arg\ @end macro @macro Defmacx{name, arg} +@maindex \name\ @defmacx @t{\name\} \arg\ @end macro -@macro end_Defmacx -@end defmacx +@macro end_Defmac +@end defmac @end macro @@ -185,24 +223,25 @@ contributions are welcome. Send them to bug-groff@@gnu.org. @end ifinfo @menu -* Copying:: -* Introduction:: -* Invoking groff:: -* Tutorial for Macro Users:: -* Macro Packages:: -* Programming Tutorial:: -* Preprocessors:: -* Output Devices:: -* File formats:: -* Installation:: -* Request and Escape Index:: -* Operator Index:: -* Register Index:: -* Macro and String Index:: -* Glyph Name Index:: -* Font File Keyword Index:: -* Program and File Index:: -* Concept Index:: +* Copying:: +* Introduction:: +* Invoking groff:: +* Tutorial for Macro Users:: +* Macro Packages:: +* Programming Tutorial:: +* Preprocessors:: +* Output Devices:: +* File formats:: +* Installation:: +* Request Index:: +* Escape Index:: +* Operator Index:: +* Register Index:: +* Macro and String Index:: +* Glyph Name Index:: +* Font File Keyword Index:: +* Program and File Index:: +* Concept Index:: @end menu @@ -616,13 +655,13 @@ use) for about 3@w{ }decades. It is quite widespread and firmly entrenched in the @acronym{UNIX} community. @menu -* What Is groff?:: -* History:: -* groff Capabilities:: -* Macro Package Intro:: -* Preprocessor Intro:: -* Output device intro:: -* Credits:: +* What Is groff?:: +* History:: +* groff Capabilities:: +* Macro Package Intro:: +* Preprocessor Intro:: +* Output device intro:: +* Credits:: @end menu @@ -643,17 +682,16 @@ then be processed by @code{groff} to produce a typeset document on a variety of devices. Likewise, @code{groff} should not be confused with a @dfn{word -processor}, since that term connotes an integrated system which includes +processor}, since that term connotes an integrated system that includes an editor and a text formatter. Also, many word processors follow the -@acronym{WYSIWYG} paradigm which was discussed earlier. +@acronym{WYSIWYG} paradigm discussed earlier. Although @acronym{WYSIWYG} systems may be easier to use, they have a number of disadvantages compared to @code{troff}: @itemize @bullet @item -They must be used on a graphics display to do any operations on a -document. +They must be used on a graphics display to work on a document. @item Most of the @acronym{WYSIWYG} systems are either non-free or are not @@ -690,10 +728,10 @@ impossible to accomplish complex actions.'' --Doug Gwyn (22/Jun/91 in operating system in the mid-sixties. This name came from the common phrase of the time ``I'll run off a document.'' Bob Morris ported it to the 635 architecture and called the program @code{roff} (an abbreviation -of @code{runoff}). It has then been rewritten as @code{rf} for the -PDP-7 (before having @acronym{UNIX}), and at the same time (1969), Doug -McIllroy rewrote an extended and simplified version of @code{roff} in -the @acronym{BCPL} programming language. +of @code{runoff}). It was rewritten as @code{rf} for the PDP-7 (before +having @acronym{UNIX}), and at the same time (1969), Doug McIllroy +rewrote an extended and simplified version of @code{roff} in the +@acronym{BCPL} programming language. @cindex @code{roff} The first version of @acronym{UNIX} was developed on a PDP-7 which was @@ -709,7 +747,7 @@ When they needed a more flexible language, a new version of @code{roff} called @code{nroff} (``Newer @code{roff}'') was written. It had a much more complicated syntax, but provided the basis for all future versions. When they got a Graphic Systems CAT Phototypesetter, Ossanna wrote a -version of @code{nroff} which would drive it. It was dubbed +version of @code{nroff} that would drive it. It was dubbed @code{troff}, for ``typesetter @code{roff}'', although many people have speculated that it actually means ``Times @code{roff}'' because of the use of the Times font family in @code{troff} by default. As such, the @@ -791,8 +829,8 @@ version@w{ }1.04 around November@w{ }1991. Beginning in@w{ }1999, @code{groff} has new maintainers (the package was an orphan for a few years). As a result, new features and programs like -@code{grn}, a preprocessor for gremlin images, and @code{grohtml}, an -output device to produce @acronym{HTML} output, have been added. +@code{grn}, a preprocessor for gremlin images, and an output device to +produce @acronym{HTML} output have been added. @c ===================================================================== @@ -929,7 +967,7 @@ mathematical pictures (@code{ideal}) and chemical structures @cindex devices for output @code{groff} actually produces device independent code which may be fed -into a postprocessor which will produce output for a particular device. +into a postprocessor to produce output for a particular device. Currently, @code{groff} has postprocessors for @acronym{PostScript} devices, character terminals, X@w{ }Windows (for previewing), @TeX{} DVI format, HP LaserJet@w{ }4 and Canon LBP printers (which use @@ -974,9 +1012,9 @@ prefix is omitted since GNU @code{troff} is the only used incarnation of @code{troff}. Exception: @code{groff} is never replaced by @code{roff}. @menu -* Groff Options:: -* Environment:: -* Invocation Examples:: +* Groff Options:: +* Environment:: +* Invocation Examples:: @end menu @@ -1084,12 +1122,11 @@ Make programs run by @code{groff} print out their version number. Print the pipeline on @code{stdout} instead of executing it. @item -z -Suppress output from @code{gtroff}. Only error messages will be -printed. +Suppress output from @code{gtroff}. Only error messages are printed. @item -Z Do not postprocess the output of @code{gtroff}. Normally @code{groff} -will automatically run the appropriate postprocessor. +automatically runs the appropriate postprocessor. @item -P@var{arg} Pass @var{arg} to the postprocessor. Each argument should be passed @@ -1097,13 +1134,17 @@ with a separate @option{-P} option. Note that @code{groff} does not prepend @samp{-} to @var{arg} before passing it to the postprocessor. @item -l -Send the output to a printer. The command used for this is specified by -the print command in the device description file. +Send the output to a spooler for printing. The command used for this +is specified by the @code{print} command in the device description file +(see @ref{Font Files}, for more info). If not present, @option{-l} is +ignored. @item -L@var{arg} Pass @var{arg} to the spooler. Each argument should be passed with a separate @option{-L} option. Note that @code{groff} does not prepend a -@samp{-} to @var{arg} before passing it to the postprocessor. +@samp{-} to @var{arg} before passing it to the postprocessor. If the +@code{print} keyword in the device description file is missing, +@option{-L} is ignored. @item -T@var{dev} Prepare output for device @var{dev}. The default device is @samp{ps}, @@ -1148,8 +1189,13 @@ For an HP LaserJet4-compatible (or other PCL5-compatible) printer. For Canon @acronym{CAPSL} printers (@w{LBP-4} and @w{LBP-8} series laser printers). +@pindex pre-grohtml +@pindex post-grohtml +@cindex @code{grohtml} @item html -To produce @acronym{HTML} output. +To produce @acronym{HTML} output. Note that the @acronym{HTML} driver +consists of two parts, a preprocessor (@code{pre-grohtml}) and a +postprocessor (@code{post-grohtml}). @end table @vindex .T @@ -1170,8 +1216,8 @@ This is unlikely to produce good results except with @option{-Tps}. Note that this is not the same as using @option{-TX75} or @option{-TX100} to view a document with @code{gxditview}: The former -will use the metrics of the specified device, whereas the latter will -use X-specific fonts and metrics. +uses the metrics of the specified device, whereas the latter uses +X-specific fonts and metrics. @item -N Don't allow newlines with @code{eqn} delimiters. This is the same as @@ -1221,7 +1267,7 @@ Inhibit all error messages. @item -C Enable compatibility mode. @xref{Implementation Differences}, for the -list of incompatibilites between @code{groff} and traditional Unix +list of incompatibilities between @code{groff} and traditional Unix @code{troff}. @item -d@var{cs} @@ -1233,10 +1279,9 @@ one-letter name; @var{name} can be of arbitrary length. Use @var{fam} as the default font family. @item -m@var{name} -Read in the file @file{@var{name}.tmac}. Normally this will be searched -for in the macro directories of @code{groff}. If it isn't found, -@file{tmac.@var{name}} will be tried (and searched in the same -directories). +Read in the file @file{@var{name}.tmac}. Normally @code{groff} searches +for this in its macro directories. If it isn't found, it tries +@file{tmac.@var{name}} (and searches in the same directories). @c XXX document local and system macro dirs @@ -1249,12 +1294,16 @@ Output only pages in @var{list}, which is a comma-separated list of page ranges; @samp{@var{n}} means print page @var{n}, @samp{@var{m}-@var{n}} means print every page between @var{m} and @var{n}, @samp{-@var{n}} means print every page up to @var{n}, @samp{@var{n}-} means print every -page beginning with @var{n}. @code{gtroff} will exit after printing the +page beginning with @var{n}. @code{gtroff} exits after printing the last page in the list. All the ranges are inclusive on both ends. Within @code{gtroff}, this information can be extracted with the @samp{.P} register. @xref{Built-in Registers}. +If your document restarts page numbering at the beginning of each +chapter, then @code{gtroff} prints the specified page range for each +chapter. + @item -r@var{cn} @itemx -r@var{name}=@var{n} Set number register @var{c} or @var{name} to the value @var{n}. @var{c} @@ -1264,11 +1313,11 @@ must be a one-letter name; @var{name} can be of arbitrary length. @item -F@var{dir} Search @file{@var{dir}} for subdirectories @file{dev@var{name}} (@var{name} is the name of the device), for the @file{DESC} file, and -for font files before looking in the standard directory. +for font files before looking in the standard directories. @item -M@var{dir} Search directory @file{@var{dir}} for macro files before the standard -directory. +directories. @item -I@var{dir} This option is as described in @ref{gsoelim}. It implies the @@ -1289,11 +1338,11 @@ not within @code{gtroff}) which can modify the behavior of @code{groff}. @table @code @item GROFF_COMMAND_PREFIX @tindex GROFF_COMMAND_PREFIX, environment variable -If this is set to @var{X}, then @code{groff} will run -@code{@var{X}troff} instead of @code{gtroff}. This also applies to -@code{tbl}, @code{pic}, @code{eqn}, @code{grn}, @code{refer}, and -@code{soelim}. It does not apply to @code{grops}, @code{grodvi}, -@code{grotty}, @code{grohtml}, @code{grolj4}, and @code{gxditview}. +If this is set to @var{X}, then @code{groff} runs @code{@var{X}troff} +instead of @code{gtroff}. This also applies to @code{tbl}, @code{pic}, +@code{eqn}, @code{grn}, @code{refer}, and @code{soelim}. It does not +apply to @code{grops}, @code{grodvi}, @code{grotty}, @code{pre-grohtml}, +@code{post-grohtml}, @code{grolj4}, and @code{gxditview}. @c XXX document default values @@ -1322,12 +1371,12 @@ by @code{groff}. @item GROFF_TMPDIR @tindex GROFF_TMPDIR, environment variable @tindex TMPDIR, environment variable -The directory in which temporary files will be created. If this is not -set and @env{TMPDIR} is set, temporary files will be created in that -directory. Otherwise temporary files will be created in a -system-dependent default directory (on Unix and GNU/Linux systems, this -is usually @file{/tmp}). The @code{grops} and @code{grefer} commands -can create temporary files in this directory. +The directory in which @code{groff} creates temporary files. If this is +not set and @env{TMPDIR} is set, temporary files are created in that +directory. Otherwise temporary files are created in a system-dependent +default directory (on Unix and GNU/Linux systems, this is usually +@file{/tmp}). @code{grops}, @code{grefer}, @code{pre-grohtml}, and +@code{post-grohtml} can create temporary files in this directory. @end table Note that MS-DOS and MS-Windows ports of @code{groff} use semi-colons, @@ -1342,8 +1391,8 @@ above. @cindex invocation examples @cindex examples of invocation -This section will list several common uses of @code{groff} and the -command line which will accomplish it. +This section lists several common uses of @code{groff} and the +corresponding command lines. @example groff file @@ -1359,12 +1408,12 @@ groff -t -mandoc -Tascii file | less @end example @noindent -This is basically what a call to the @code{man} program does. The -manual page @file{file} is processed with the @file{mandoc} macros -(which in turn either calls the @file{man} or the @file{mdoc} macro -package), using the @code{tbl} preprocessor and the @acronym{ASCII} -output device. Finally, the result is displayed with the @code{less} -pager. +This is basically what a call to the @code{man} program does. +@code{gtroff} processes the manual page @file{file} with the +@file{mandoc} macro file (which in turn either calls the @file{man} or +the @file{mdoc} macro package), using the @code{tbl} preprocessor and +the @acronym{ASCII} output device. Finally, the @code{less} pager +displays the result. @example groff -X -m me file @@ -1392,7 +1441,7 @@ double-sided printing -- don't produce any output. @c --------------------------------------------------------------------- @menu -* grog:: +* grog:: @end menu @node grog, , Invocation Examples, Invocation Examples @@ -1402,16 +1451,16 @@ double-sided printing -- don't produce any output. @code{grog} reads files, guesses which of the @code{groff} preprocessors and/or macro packages are required for formatting them, and prints the @code{groff} command including those options on the standard output. -The options generated are one of @option{-e}, @option{-man}, +It generates one or more of the options @option{-e}, @option{-man}, @option{-me}, @option{-mm}, @option{-ms}, @option{-mdoc}, @option{-mdoc-old}, @option{-p}, @option{-R}, @option{-g}, @option{-G}, @option{-s}, and @option{-t}. -A special file name @file{-} is taken to refer to the standard input. -If no files are specified the standard input will be read. Any -specified options will be included in the printed command. No space is -allowed between options and their arguments. The only options recognized -are @option{-C} (which is also passed on) to enable compatibility mode, and +A special file name @file{-} refers to the standard input. Specifying +no files also means to read the standard input. Any specified options +are included in the printed command. No space is allowed between +options and their arguments. The only options recognized are +@option{-C} (which is also passed on) to enable compatibility mode, and @option{-v} (if it is the only parameter) to print the version number. For example, @@ -1421,10 +1470,10 @@ grog -Tdvi paper.ms @end example @noindent -will guess the appropriate command to print @file{paper.ms} and then -print it to the command line after adding the @option{-Tdvi} option. -For direct execution, enclose the call to @code{grog} in backquotes at -the @acronym{UNIX} shell prompt: +guesses the appropriate command to print @file{paper.ms} and then prints +it to the command line after adding the @option{-Tdvi} option. For +direct execution, enclose the call to @code{grog} in backquotes at the +@acronym{UNIX} shell prompt: @example `grog -Tdvi paper.ms` > paper.dvi @@ -1453,8 +1502,8 @@ people. This chapter covers the material needed to efficiently use a macro package. @menu -* Basics:: -* Common Features:: +* Basics:: +* Common Features:: @end menu @@ -1513,7 +1562,7 @@ years ago,... @end example @noindent -will be read, packed onto output lines, and justified to produce: +is read, packed onto output lines, and justified to produce: @quotation Now is the time for all good men to come to the aid of their party. @@ -1528,33 +1577,46 @@ this it is possible to cause a @dfn{break}, which starts a new output line. Some requests cause a break automatically, as do blank input lines and input lines beginning with a space. -Not all input lines are text to be formatted. Some of the input lines -are requests which describe how to format the text. Requests always -have a period (@samp{.}) or an apostrophe (@samp{'}) as the first -character of the input line. +Not all input lines are text to be formatted. Some input lines are +requests which describe how to format the text. Requests always have a +period (@samp{.}) or an apostrophe (@samp{'}) as the first character of +the input line. The text formatter also does more complex things, such as automatically numbering pages, skipping over page boundaries, putting footnotes in the correct place, and so forth. Here are a few hints for preparing text for input to @code{gtroff}. + +@itemize @bullet +@item First, keep the input lines short. Short input lines are easier to -edit, and @code{gtroff} will pack words onto longer lines anyhow. In -keeping with this, it is helpful to begin a new line after every period, -comma, or phrase, since common corrections are to add or delete -sentences or phrases. Secondly, do not hyphenate words at the end of -lines -- @code{gtroff} is smart enough to hyphenate words for the user -as needed, but is not smart enough to take hyphens out and join a word -back together. Also, words such as ``mother-in-law'' should not be -broken over a line, since then a space can occur where not wanted, such -as ``@w{mother- in}-law''. - -@findex ls +edit, and @code{gtroff} packs words onto longer lines anyhow. + +@item +In keeping with this, it is helpful to begin a new line after every +comma or phrase, since common corrections are to add or delete sentences +or phrases. + +@item +End each sentence with two spaces -- or better, start each sentence on a +new line. @code{gtroff} recognizes characters that usually end a +sentence, and inserts sentence space accordingly. + +@item +Do not hyphenate words at the end of lines -- @code{gtroff} is smart +enough to hyphenate words as needed, but is not smart enough to take +hyphens out and join a word back together. Also, words such as +``mother-in-law'' should not be broken over a line, since then a space +can occur where not wanted, such as ``@w{mother- in}-law''. +@end itemize + +@rqindex ls @cindex double spacing @cindex spacing -@code{gtroff} will double space output text automatically if you use the -request @w{@samp{.ls 2}}. Single spaced mode can be reactivated by -typing @w{@samp{.ls 1}}. +@code{gtroff} double spaces output text automatically if you use the +request @w{@samp{.ls 2}}. Reactivate single spaced mode by typing +@w{@samp{.ls 1}}. A number of requests allow to change the way the output looks, sometimes called the @dfn{layout} of the output page. Most of these requests @@ -1581,7 +1643,7 @@ My thoughts on the subject leaves one and a half inches of space, followed by the line ``My thoughts on the subject'', followed by a single blank line. -@findex ce +@rqindex ce @cindex centering lines @cindex lines, centering Text lines can be centered by using the @code{ce} request. The line @@ -1600,7 +1662,7 @@ lines to center The @w{@samp{.ce 0}} request tells @code{groff} to center zero more lines, in other words, stop centering. -@findex br +@rqindex br @cindex line break @cindex break All of these requests cause a break; that is, they always start a new @@ -1626,20 +1688,20 @@ the following categories. @c --------------------------------------------------------------------- @menu -* Paragraphs:: -* Sections and Chapters:: -* Headers and Footers:: -* Page Layout Adjustment:: -* Displays:: -* Footnotes and Annotations:: -* Table of Contents:: -* Indices:: -* Paper Formats:: -* Multiple Columns:: -* Font and Size Changes:: -* Predefined Strings:: -* Preprocessor Support:: -* Configuration and Customization:: +* Paragraphs:: +* Sections and Chapters:: +* Headers and Footers:: +* Page Layout Adjustment:: +* Displays:: +* Footnotes and Annotations:: +* Table of Contents:: +* Indices:: +* Paper Formats:: +* Multiple Columns:: +* Font and Size Changes:: +* Predefined Strings:: +* Preprocessor Support:: +* Configuration and Customization:: @end menu @node Paragraphs, Sections and Chapters, Common Features, Common Features @@ -1669,9 +1731,9 @@ one This is the first paragraph. Notice how the first other lines in the paragraph. longlabel This paragraph had a long label. The first - character of text on the first line will not line up + character of text on the first line does not line up with the text on second and subsequent lines, - although they will line up with each other. + although they line up with each other. @end example A variation of this is a bulleted list. @@ -1695,7 +1757,7 @@ supply macros for starting chapters and appendices. @subsection Headers and Footers Every macro package gives some way to manipulate the headers and -footers (or @dfn{titles}) on each page. Some packages will allow for +footers (or @dfn{titles}) on each page. Some packages allow for different ones on the even and odd pages (for material printed in a book form). @@ -1737,15 +1799,15 @@ used in this paper. A @dfn{keep} is a display of lines which are kept on a single page if possible. An example for a keep might be a diagram. Keeps differ from lists in that lists may be broken over a page boundary whereas keeps -will not. +are not. @cindex keep, floating @cindex floating keep Floating keeps move relative to the text. Hence, they are good for -things which will be referred to by name, such as ``See figure@w{ }3''. -A floating keep will appear at the bottom of the current page if it will -fit; otherwise, it will appear at the top of the next page. Meanwhile, -the surrounding text will `flow' around the keep, thus leaving now blank +things which are referred to by name, such as ``See figure@w{ }3''. +A floating keep appears at the bottom of the current page if it +fits; otherwise, it appears at the top of the next page. Meanwhile, +the surrounding text `flows' around the keep, thus leaving no blank areas. @c --------------------------------------------------------------------- @@ -1778,9 +1840,9 @@ of automatically numbering either type of annotation. @dfn{Tables of contents} are a type of delayed text having a tag (usually the page number) attached to each entry after a row of dots. The table accumulates throughout the paper until printed, usually after -the paper has ended. Many macro packages will provide the ability to -have several tables of contents (i.e.@: one standard one, one for -tables, etc). +the paper has ended. Many macro packages provide the ability to have +several tables of contents (e.g.@: a standard table of contents, +a list of tables, etc). @c --------------------------------------------------------------------- @@ -1788,7 +1850,7 @@ tables, etc). @subsection Indices @cindex index, in macro package -While some macro packages will use the term @dfn{index}, none actually +While some macro packages use the term @dfn{index}, none actually provide that functionality. The facilities they call indices are actually more appropriate for tables of contents. @@ -1833,7 +1895,14 @@ various special characters. @node Preprocessor Support, Configuration and Customization, Predefined Strings, Common Features @subsection Preprocessor Support -All macro packages provide support for the various preprocessors. +All macro packages provide support for the various preprocessors and +may extend their functionality. + +For example, all macro packages mark tables (which are processed +with @code{gtbl}) by placing them between @code{.TS} and @code{.TE} +macros. The @file{ms} macro package has an option, @code{.TS@w{}H}, +that prints a caption at the top of a new page (when the table is +too long to fit on a single page). @c --------------------------------------------------------------------- @@ -1858,11 +1927,11 @@ This chapter documents the main macro packages that come with @code{groff}. @menu -* man:: -* mdoc:: -* ms:: -* me:: -* mm:: +* man:: +* mdoc:: +* ms:: +* me:: +* mm:: @end menu @@ -1881,10 +1950,10 @@ of @code{groff}. It is easy to use, and a vast majority of manual pages are based on it. @menu -* Man options:: -* Man usage:: -* Man font macros:: -* Miscellaneous man stuff:: +* Man options:: +* Man usage:: +* Man font macros:: +* Miscellaneous man stuff:: @end menu @c --------------------------------------------------------------------- @@ -1897,15 +1966,15 @@ The command line format for using the @file{man} macros with @example groff -m man [ -rcR=1 ] [ -rC1 ] [ -rD1 ] [ -rP@var{nnn} ] - [ -rS@var{xx} ] [ -rX@var{nnn} ] [ @var{files}@dots{} ] + [ -rS@var{xx} ] [ -rX@var{nnn} ] [ @var{files}@dots{} ] @end example It is possible to use @samp{-man} instead of @w{@samp{-m man}}. @table @code @item -rcR=1 -This option (the default in nroff mode) will create a single, very long -page instead of multiple pages. Say @code{-rcR=0} to disable it. +This option (the default in nroff mode) creates a single, very long +page instead of multiple pages. Use @code{-rcR=0} to disable it. @item -rC1 If more than one manual page is given on the command line, number the @@ -1916,7 +1985,7 @@ Double-sided printing. Footers for even and odd pages are formatted differently. @item -rP@var{nnn} -Enumeration of pages will start with @var{nnn} rather than with@w{ }1. +Page numbering starts with @var{nnn} rather than with@w{ }1. @item -rS@var{xx} Use @var{xx} (which can be 10, 11, or@w{ }12@dmn{pt}) as the base @@ -1924,7 +1993,7 @@ document font size instead of the default value of@w{ }10@dmn{pt}. @item -rX@var{nnn} After page @var{nnn}, number pages as @var{nnn}a, @var{nnn}b, -@var{nnn}c, etc. For example, the option @option{-rX2} will produce the +@var{nnn}c, etc. For example, the option @option{-rX2} produces the following page numbers: 1, 2, 2a, 2b, 2c, etc. @end table @@ -1938,7 +2007,7 @@ following page numbers: 1, 2, 2a, 2b, 2c, etc. @pindex man.local This section describes the available macros for manual pages. For further customization, put additional macros and requests into the file -@file{man.local} which will be loaded immediately after the @file{man} +@file{man.local} which is loaded immediately after the @file{man} package. @maindex TH @@ -1950,9 +2019,9 @@ indicate a specific subsection of the man pages. Both @var{title} and @var{section} are positioned at the left and right in the header line (with @var{section} in parentheses immediately -appended to @var{title}. @var{extra1} will be positioned in the middle -of the footer line. @var{extra2} will be positioned at the left in the -footer line (resp.@: at the left on even pages and at the right on odd +appended to @var{title}. @var{extra1} is positioned in the middle +of the footer line. @var{extra2} is positioned at the left in the +footer line (or at the left on even pages and at the right on odd pages if double-sided printing is active). @var{extra3} is centered in the header line. @@ -1968,7 +2037,7 @@ beginning of the file. @maindex SH @Defmac{SH, [@var{heading}]} Sets up an unnumbered section heading sticking out to the left. Prints -out all the text following @code{SH} up to the end of the line (resp.@: +out all the text following @code{SH} up to the end of the line (or the text in the next line if there is no argument to @code{SH}) in bold face, one size larger than the base document size. Additionally, the left margin for the following text is reset to its default value. @@ -1977,7 +2046,7 @@ left margin for the following text is reset to its default value. @maindex SS @Defmac{SS, [@var{heading}]} Sets up an unnumbered section heading. Prints out all the text -following @code{SS} up to the end of the line (resp.@: the text in the +following @code{SS} up to the end of the line (or the text in the next line if there is no argument to @code{SS}) in bold face, at the same size as the base document size. Additionally, the left margin for the following text is reset to its default value. @@ -1998,7 +2067,7 @@ at the same line (but indented), continuing on the following lines. If the label is wider than the indentation, then the descriptive part of the paragraph begins on the line following the label, entirely indented. Note that neither font shape nor font size of the label is set to a -default value; on the other hand, the rest of the text will have default +default value; on the other hand, the rest of the text has default font settings. @end_Defmac @@ -2011,7 +2080,7 @@ font settings. These macros are mutual aliases. Any of them causes a line break at the current position, followed by a vertical space downwards by the amount specified by the @code{PD} macro. The font size and shape are reset to -the default value (10@dmn{pt} resp.@: Roman). Finally, the current left +the default value (10@dmn{pt} Roman). Finally, the current left margin is restored. @end_Defmac @@ -2087,64 +2156,58 @@ The standard font is Roman; the default text size is 10@w{ }point. @maindex SM @Defmac{SM, [@var{text}]} -Causes the text on the same line or the text on the next line to appear +Sets the text on the same line or the text on the next line in a font that is one point size smaller than the default font. @end_Defmac @maindex SB @cindex boldface, in manual pages @Defmac{SB, [@var{text}]} -Causes the text on the same line or the text on the next line to appear +Sets the text on the same line or the text on the next line in boldface font, one point size smaller than the default font. @end_Defmac @maindex BI @Defmac{BI, text} -Causes text on the same line to appear alternately in bold face and -italic. The text must be on the same line as the macro call. Thus, +Sets its arguments alternately in bold face and italic. Thus, @example .BI this "word and" that @end example @noindent -would cause ``this'' and ``that'' to appear in bold face, while ``word -and'' appears in italics. +would set ``this'' and ``that'' in bold face, and ``word +and'' in italics. @end_Defmac @maindex IB @Defmac{IB, text} -Causes text to appear alternately in italic and bold face. The text -must be on the same line as the macro call. +Sets its arguments alternately in italic and bold face. @end_Defmac @maindex RI @Defmac{RI, text} -Causes text on the same line to appear alternately in roman and italic. -The text must be on the same line as the macro call. +Sets its arguments alternately in roman and italic. @end_Defmac @maindex IR @Defmac{IR, text} -Causes text on the same line to appear alternately in italic and roman. -The text must be on the same line as the macro call. +Sets its arguments alternately in italic and roman. @end_Defmac @maindex BR @Defmac{BR, text} -Causes text on the same line to appear alternately in bold face and -roman. The text must be on the same line as the macro call. +Sets its arguments alternately in bold face and roman. @end_Defmac @maindex RB @Defmac{RB, text} -Causes text on the same line to appear alternately in roman and bold -face. The text must be on the same line as the macro call. +Sets its arguments alternately in roman and bold face. @end_Defmac @maindex R @Defmac{R, [@var{text}]} -Causes @var{text} to appear in roman font. If no text is present on the +Sets @var{text} in roman font. If no text is present on the line where the macro is called, then the text of the next line appears in roman. This is the default font to which text is returned at the end of processing of the other macros. @@ -2152,7 +2215,7 @@ of processing of the other macros. @maindex B @Defmac{B, [@var{text}]} -Causes @var{text} to appear in bold face. If no text is present on the +Sets @var{text} in bold face. If no text is present on the line where the macro is called, then the text of the next line appears in bold face. @end_Defmac @@ -2160,7 +2223,7 @@ in bold face. @maindex I @cindex italic, in manual pages @Defmac{I, [@var{text}]} -Causes @var{text} to appear in italic. If no text is present on the +Sets @var{text} in italic. If no text is present on the line where the macro is called, then the text of the next line appears in italic. @end_Defmac @@ -2188,7 +2251,7 @@ positions have been changed. @maindex PD @cindex empty space before a paragraph, in manual pages @Defmac{PD, [@var{nnn}]} -Adjusts the empty space before a new paragraph (resp.@: section). The +Adjusts the empty space before a new paragraph (or section). The optional argument gives the amount of space (default units are @samp{v}); without parameter, the value is reset to its default value (1@w{ }line for tty devices, 0.4@dmn{v}@w{ }otherwise). @@ -2203,7 +2266,7 @@ optional argument gives the amount of space (default units are @maindex IP @maindex HP This affects the macros @code{SH}, @code{SS}, @code{TP}, @code{LP} -(resp.@: @code{PP} and @code{P}), @code{IP}, and @code{HP}. +(as well as @code{PP} and @code{P}), @code{IP}, and @code{HP}. The following strings are defined: @@ -2303,39 +2366,39 @@ Users of macro packages may skip it if not interested in details. @menu -* Text:: -* Input Conventions:: -* Measurements:: -* Expressions:: -* Identifiers:: -* Embedded Commands:: -* Registers:: -* Manipulating Filling and Adjusting:: -* Manipulating Hyphenation:: -* Manipulating Spacing:: -* Tabs and Fields:: -* Character Translations:: -* Troff and Nroff Mode:: -* Line Layout:: -* Page Layout:: -* Page Control:: -* Fonts:: -* Sizes:: -* Strings:: -* Conditionals and Loops:: -* Writing Macros:: -* Page Motions:: -* Drawing Requests:: -* Traps:: -* Diversions:: -* Environments:: +* Text:: +* Input Conventions:: +* Measurements:: +* Expressions:: +* Identifiers:: +* Embedded Commands:: +* Registers:: +* Manipulating Filling and Adjusting:: +* Manipulating Hyphenation:: +* Manipulating Spacing:: +* Tabs and Fields:: +* Character Translations:: +* Troff and Nroff Mode:: +* Line Layout:: +* Page Layout:: +* Page Control:: +* Fonts:: +* Sizes:: +* Strings:: +* Conditionals and Loops:: +* Writing Macros:: +* Page Motions:: +* Drawing Requests:: +* Traps:: +* Diversions:: +* Environments:: * Suppressing output:: -* I/O:: -* Postprocessor Access:: -* Miscellaneous:: -* Debugging:: -* Implementation Differences:: -* Summary:: +* I/O:: +* Postprocessor Access:: +* Miscellaneous:: +* Debugging:: +* Implementation Differences:: +* Summary:: @end menu @@ -2347,16 +2410,28 @@ Users of macro packages may skip it if not interested in details. @code{gtroff} input files contain text with control commands interspersed throughout. But, even without control codes, @code{gtroff} -will still do several things with the input text: filling and adjusting, -adding additional space after sentences, hyphenating and inserting -implicit line breaks. +still does several things with the input text: + +@itemize @bullet +@item +filling and adjusting + +@item +adding additional space after sentences + +@item +hyphenating + +@item +inserting implicit line breaks +@end itemize @menu -* Filling and Adjusting:: -* Hyphenation:: -* Sentences:: -* Tab Stops:: -* Implicit Line Breaks:: +* Filling and Adjusting:: +* Hyphenation:: +* Sentences:: +* Tab Stops:: +* Implicit Line Breaks:: @end menu @c --------------------------------------------------------------------- @@ -2366,7 +2441,7 @@ implicit line breaks. @cindex filling @cindex adjusting -When @code{gtroff} reads in text it collects words from input and fits +When @code{gtroff} reads text, it collects words from the input and fits as many of them together on one output line as it can. This is known as @dfn{filling}. @@ -2374,11 +2449,11 @@ as many of them together on one output line as it can. This is known as @cindex spaces, leading and trailing @cindex extra spaces @cindex trailing spaces -Once @code{gtroff} has a @dfn{filled} line it will try to @dfn{adjust} -it. This means it will widen the spacing between words until the text +Once @code{gtroff} has a @dfn{filled} line, it tries to @dfn{adjust} +it. This means it widens the spacing between words until the text reaches the right margin (in the default adjustment mode). Extra spaces between words are preserved, but spaces at the end of lines are ignored. -Spaces at the front of a line will cause a @dfn{break} (breaks will be +Spaces at the front of a line cause a @dfn{break} (breaks are explained in @ref{Implicit Line Breaks}) @xref{Manipulating Filling and Adjusting}. @@ -2390,14 +2465,14 @@ explained in @ref{Implicit Line Breaks}) @cindex hyphenation Since the odds are not great for finding a set of words, for every -output line, which will fit nicely on a line without inserting excessive -amounts of space between words, @code{gtroff} will hyphenate words so -that lines can be justified without there being too much space between +output line, which fit nicely on a line without inserting excessive +amounts of space between words, @code{gtroff} hyphenates words so +that it can justify lines without inserting too much space between words. It uses an internal hyphenation algorithm (a simplified version of the algorithm used within @TeX{}) to indicate which words can be -hyphenated and how to do so. When a word is hyphenated the first part -of the word will be added to the current filled line being output (with -an attached hyphen), and the other portion will be added to the next +hyphenated and how to do so. When a word is hyphenated, the first part +of the word is added to the current filled line being output (with +an attached hyphen), and the other portion is added to the next line to be filled. @xref{Manipulating Hyphenation}. @@ -2422,7 +2497,7 @@ a comma or a period as part of an abbreviation. @code{gtroff} does this by flagging certain characters (normally @samp{!}, @samp{?} and @samp{.}) as @dfn{end of sentence} characters. When @code{gtroff} encounters one of these characters at the end of a -line it will append two @dfn{sentence spaces} in the formatted output. +line, it appends two @dfn{sentence spaces} in the formatted output. (This justifies one of the conventions mentioned in @ref{Input Conventions}.) @@ -2435,13 +2510,13 @@ Conventions}.) @cindex ) @cindex ] @cindex * -In addition, the following characters resp.@: glyphs are treated +In addition, the following characters or glyphs are treated transparently while handling end of sentence characters: @samp{"}, @samp{'}, @samp{)}, @samp{]}, @samp{*}, @code{dg}, and @code{rq}. See the @code{cflags} request in @ref{Using Symbols}, for more details. -@findex \& +@esindex \& To prevent the insertion of extra space after an end of sentence character (at the end of a line), append @code{\&}. @@ -2456,15 +2531,15 @@ character (at the end of a line), append @code{\&}. @cindex @acronym{EBCDIC} encoding @code{gtroff} translates @dfn{tabulator characters}, also called -@dfn{tabs} (normally code point @acronym{ASCII} @code{0x09} resp.@: +@dfn{tabs} (normally code point @acronym{ASCII} @code{0x09} or @acronym{EBCDIC} @code{0x05}), in the input into movements to the next tabulator stop. These tab stops are initially located every half inch -across the page. Using this, simple tables can easily be made. +across the page. Using this, simple tables can be made easily. However, it can often be deceptive as the appearance (and width) of the text on a terminal and the results from @code{gtroff} can vary greatly. Also, a possible sticking point is that lines beginning with tab -characters will still be filled, again producing unexpected results. +characters are still filled, again producing unexpected results. For example, the following input @multitable {12345678} {12345678} {12345678} {12345678} @@ -2475,7 +2550,7 @@ For example, the following input @end multitable @noindent -will produce +produces @multitable {12345678} {12345678} {12345678} {12345678} {12345678} {12345678} {12345678} @item @@ -2495,28 +2570,28 @@ will produce @cindex line break An important concept in @code{gtroff} is the @dfn{break}. When a break -occurs, @code{gtroff} will output the partially filled line -(unjustified), and resume collecting and filling text on the next output +occurs, @code{gtroff} outputs the partially filled line +(unjustified), and resumes collecting and filling text on the next output line. @cindex blank line @cindex empty line @cindex line, blank There are several ways to cause a break in @code{gtroff}. A blank line -will not only cause a break, but it will also cause a one line vertical -space (effectively a blank line) to be output. +not only causes a break, but it also outputs a one line vertical +space (effectively a blank line). @cindex fill mode @cindex mode, fill -A line which begins with a space will cause a break and the space will -be output at the beginning of the next line. Note that this space isn't +A line that begins with a space causes a break and the space is +output at the beginning of the next line. Note that this space isn't adjusted, even in fill mode. -The end of file will also cause a break -- otherwise the last line of +The end of file also causes a break -- otherwise the last line of the document may vanish! -Certain requests also cause breaks, implicitly or explicitly. This will -be discussed in @ref{Manipulating Filling and Adjusting}. +Certain requests also cause breaks, implicitly or explicitly. This is +discussed in @ref{Manipulating Filling and Adjusting}. @c ===================================================================== @@ -2533,7 +2608,7 @@ paragraphs. These are some conventions commonly used when typing @itemize @bullet @item -Break lines after punctuation, particularly at the end of a sentence, +Break lines after punctuation, particularly at the end of a sentence and in other logical places. Keep separate phrases on lines by themselves, as entire phrases are often added or deleted when editing. @@ -2543,7 +2618,7 @@ inserting more text. @item Do not try to do any formatting in a @acronym{WYSIWYG} manner (i.e., -don't try and use spaces to get proper indentation). +don't try using spaces to get proper indentation). @end itemize @@ -2559,7 +2634,7 @@ don't try and use spaces to get proper indentation). @cindex measurement units @cindex @code{u} unit @cindex unit, @code{u} -@code{gtroff} (like any other programs) requires numeric parameters to +@code{gtroff} (like many other programs) requires numeric parameters to specify various measurements. Most numeric parameters@footnote{those that specify vertical or horizontal motion or a type size} may have a @dfn{measurement unit} attached. These units are specified as a single @@ -2581,7 +2656,8 @@ current settings (e.g.@: type size) of @code{gtroff}. @cindex @code{i} unit @cindex unit, @code{i} Inches. An antiquated measurement unit still in use in certain -backwards countries. One inch is equal to@w{ }2.54@dmn{cm}. +backwards countries with incredibly low-cost computer equipment. One +inch is equal to@w{ }2.54@dmn{cm}. @item c @cindex centimeter @@ -2612,7 +2688,7 @@ Pica. Another typesetting measurement. 6@w{ }Picas to an inch (and @xref{Fractional Type Sizes}, for a discussion of these units. @end table -The other measurements understood by @code{gtroff} are dependent on +The other measurements understood by @code{gtroff} depend on settings currently in effect in @code{gtroff}. These are very useful for specifying measurements which should look proper with any size of text. @@ -2647,7 +2723,7 @@ Vertical space. This is equivalent to the current line spacing. @end table @menu -* Default Units:: +* Default Units:: @end menu @c --------------------------------------------------------------------- @@ -2671,14 +2747,14 @@ line length of 3.5@w{ }inches and their results: @end example @noindent -Everything will be converted to basic units first. In the above example +Everything is converted to basic units first. In the above example it is assumed that 1@dmn{i} equals@w{ }240@dmn{u}, and 1@dmn{m} equals@w{ }10@dmn{p} (thus 1@dmn{m} equals@w{ }33@dmn{u}). The value -7i/2 will be first handled as 7i/2m, then converted to 1680u/66u which +7i/2 is first handled as 7i/2m, then converted to 1680u/66u which is 25@dmn{u}, and this is approximately 0.1@dmn{i}. @cindex measurements, specifying safely -As a conclusion, the safest way to specify measurements is to always +Thus, the safest way to specify measurements is to always attach a scaling indicator. If you want to multiply or divide by a certain scalar value, use @samp{u} as the unit for that value. @@ -2689,7 +2765,7 @@ certain scalar value, use @samp{u} as the unit for that value. @section Expressions @cindex expressions -@code{gtroff} has most of operators common to other languages: +@code{gtroff} has most arithmetic operators common to other languages: @c XXX more details; examples @@ -2735,8 +2811,10 @@ Logical: @samp{&} (logical and), @samp{:} (logical or). @opindex - @opindex + @opindex ! -@findex if@r{, and the @samp{!} operator} -@findex while@r{, and the @samp{!} operator} +@rqindex if +@rqindex while +@cindex @code{if}, and the @samp{!} operator +@cindex @code{while}, and the @samp{!} operator Unary operators: @samp{-} (negating, i.e.@: changing the sign), @samp{+} (just for completeness; does nothing in expressions), @samp{!} (logical not; this works only within @code{if} and @code{while} requests). See @@ -2768,7 +2846,7 @@ indicators in the evaluation of @var{e}. Parentheses may be used as in any other language. However, in @code{gtroff} they are necessary to ensure order of evaluation. @code{gtroff} has no operator precedence; expressions are evaluated left -to right. This means that @samp{3+5*4} is evaluated as if it were +to right. This means that @code{gtroff} evaluates @samp{3+5*4} as if it were parenthesized like @samp{(3+5)*4}, not as @samp{3+(5*4)}, as might be expected. @@ -2787,7 +2865,7 @@ input line. requests and escapes: @code{bp}, @code{in}, @code{ll}, @code{lt}, @code{nm}, @code{nr}, @code{pl}, @code{pn}, @code{po}, @code{ps}, @code{rt}, @code{ti}, @code{\R}, and @code{\s}. Here the plus and minus -signs indicate increments resp.@: decrements. +signs indicate increments and decrements. @c XXX add more xref @xref{Setting Registers}. @@ -2822,7 +2900,7 @@ Whitespace characters (space, tabs, and newlines). @cindex character, backspace @cindex backspace character @cindex @acronym{EBCDIC} encoding of backspace -Backspace (@acronym{ASCII}@w{ }@code{0x08} resp.@: @acronym{EBCDIC}@w{ +Backspace (@acronym{ASCII}@w{ }@code{0x08} or @acronym{EBCDIC}@w{ }@code{0x16}) and character code @code{0x01}. @item @@ -2830,7 +2908,7 @@ Backspace (@acronym{ASCII}@w{ }@code{0x08} resp.@: @acronym{EBCDIC}@w{ @cindex input characters, invalid @cindex characters, invalid input @cindex unicode -The following input characters are invalid and will be ignored if +The following input characters are invalid and are ignored if @code{groff} runs on a machine based on @acronym{ASCII}, causing a warning message of type @samp{input} (see @ref{Debugging}, for more details): @code{0x00}, @code{0x0B}, @code{0x0D}-@code{0x1F}, @@ -2843,11 +2921,11 @@ And here are the invalid input characters if @code{groff} runs on an Currently, some of these reserved codepoints are used internally, thus making it non-trivial to extend @code{gtroff} to cover Unicode or other -character sets resp.@: encodings which use characters of these ranges. +character sets and encodings which use characters of these ranges. -Note that invalid characters will be removed before parsing; an +Note that invalid characters are removed before parsing; an identifier @code{foo}, followed by an invalid character, followed by -@code{bar} will be treated as @code{foobar}. +@code{bar} is treated as @code{foobar}. @end itemize For example, any of the following is valid. @@ -2860,21 +2938,22 @@ end-list @@_ @end example -@findex ] +@rqindex ] Note that identifiers longer than two characters with a closing bracket (@samp{]}) in its name can't be accessed with escape sequences which -expect an identifier as a parameter. For example, @samp{\[foo]]} will -access the glyph @samp{foo}, followed by @samp{]}, whereas +expect an identifier as a parameter. For example, @samp{\[foo]]} +accesses the glyph @samp{foo}, followed by @samp{]}, whereas @samp{\C'foo]'} really asks for glyph @samp{foo]}. @c XXX xref -@Deffn{Escape, \\A, ident} -Whether an identifier @var{ident} is valid in @code{gtroff} can be -tested with the @code{\A} escape. It expands to the character@w{ }1 +@Defesc{\\A, ident} +Use the @code{\A} escape to test +whether an identifier @var{ident} is valid in @code{gtroff}. +It expands to the character@w{ }1 or@w{ }0 according to whether its argument (usually delimited by quotes) is or is not acceptable as the name of a string, macro, diversion, -number register, environment, or font. It will return@w{ }0 if no +number register, environment, or font. It returns@w{ }0 if no argument is given. This is useful for looking up user input in some sort of associative table. @@ -2882,7 +2961,7 @@ sort of associative table. \A'end-list' @result{} 1 @end example -@end_Deffn +@end_Defesc @xref{Escapes}, for details on parameter delimiting characters. @@ -2892,9 +2971,9 @@ Identifiers in @code{gtroff} can be any length, but, in some contexts, @code{gtroff} needs to be told where identifiers end and text begins (and in different ways depending on their length): -@findex ( -@findex [ -@findex ] +@rqindex ( +@rqindex [ +@rqindex ] @itemize @bullet @item Single character. @@ -2912,8 +2991,20 @@ in brackets. @cindex indentifiers, undefined Unlike many other programming languages, undefined identifiers are silently ignored or expanded to nothing. +When @code{gtroff} finds an undefined identifier, it emits a +warning then: -@c XXX add info about -ww command line option. +@itemize @bullet +@item +If the identifier is a string, macro, or diversion, +@code{gtroff} defines it as empty. + +@item +If the identifier is a number register, @code{gtroff} +defines it with a value of 0. +@end itemize + +@xref{Warnings}. @c XXX info about common identifier pool for strings and macros. @@ -2941,9 +3032,9 @@ Escapes generally do more minor operations like sub- and superscripts, print a symbol, etc. @menu -* Requests:: -* Macros:: -* Escapes:: +* Requests:: +* Macros:: +* Escapes:: @end menu @c --------------------------------------------------------------------- @@ -2957,8 +3048,8 @@ print a symbol, etc. @cindex no-break control character @cindex character, no-break control @cindex control character, no-break -@findex ' -@findex . +@rqindex ' +@rqindex . A request line begins with a control character, which is either a single quote (@samp{'}, the @dfn{no-break control character}) or a period (@samp{.}, the normal @dfn{control character}). These can be changed; @@ -2970,17 +3061,18 @@ arguments. @cindex zero width space character @cindex character, zero width space @cindex space character, zero width -@findex \&@r{, escaping control characters} +@esindex \& +@cindex @code{\&}, escaping control characters To begin a line with a control character without it being interpreted, precede it with @code{\&}. This represents a zero width space, which -means it will not affect the output. +means it does not affect the output. In most cases the period is used as a control character. Several -requests will cause a break implicitly; using the single quote control -character will prevent this. +requests cause a break implicitly; using the single quote control +character prevents this. @menu -* Request Arguments:: +* Request Arguments:: @end menu @node Request Arguments, , Requests, Requests @@ -3001,12 +3093,12 @@ Here are a few examples: .uh The\ Mouse\ Problem @end example -@findex \~ -@findex \@key{SP} +@esindex \~ +@esindex \@key{SP} @noindent The first line is the @code{uh} macro being called with 3 arguments, @samp{The}, @samp{Mouse}, and @samp{Problem}. The latter two have the -same effect or calling the @code{uh} macro with one argument, @samp{The +same effect of calling the @code{uh} macro with one argument, @samp{The Mouse Problem}.@footnote{The last solution, i.e., using escaped spaces, is ``classical'' in the sense that it can be found in most @code{troff} documents. Nevertheless, it is not optimal in all situations, since @@ -3014,7 +3106,7 @@ documents. Nevertheless, it is not optimal in all situations, since can't stretch. @code{gtroff} provides a different command @code{\~} to insert a stretchable, non-breaking space.} -@findex ds +@rqindex ds Note, however, that the @code{ds} request works differently. @xref{Strings}, for more details. @@ -3041,9 +3133,9 @@ begin with a backslash and are followed by a single character which indicates the function to be performed. The escape character can be changed; see @ref{Character Translations}. -@findex ( -@findex [ -@findex ] +@rqindex ( +@rqindex [ +@rqindex ] Escape sequences which require an identifier as a parameter accept three possible syntax forms. @@ -3070,7 +3162,7 @@ Examples: \*[TeX] @end example -@findex ' +@rqindex ' @cindex argument delimiting characters @cindex characters, argument delimiting @cindex delimiting characters for arguments @@ -3084,9 +3176,9 @@ escape expects. Example: \l'1.5i\(bu' @end example -@findex \o -@findex \b -@findex \X +@esindex \o +@esindex \b +@esindex \X Note that the quote character can be replaced with any other character which does not occur in the argument (even a newline or a space character) in the following escapes: @code{\o}, @code{\b}, and @@ -3105,34 +3197,34 @@ in Paris @noindent possible, but it is better not to use this feature to avoid confusion. -@findex \% -@findex \@key{SP} -@findex \| -@findex \^ -@findex \@{ -@findex \@} -@findex \' -@findex \` -@findex \- -@findex \_ -@findex \! -@findex \? -@findex \@@ -@findex \) -@findex \/ -@findex \, -@findex \& -@findex \~ -@findex \0 -@findex \a -@findex \c -@findex \d -@findex \e -@findex \E -@findex \p -@findex \r -@findex \t -@findex \u +@esindex \% +@esindex \@key{SP} +@esindex \| +@esindex \^ +@esindex \@{ +@esindex \@} +@esindex \' +@esindex \` +@esindex \- +@esindex \_ +@esindex \! +@esindex \? +@esindex \@@ +@esindex \) +@esindex \/ +@esindex \, +@esindex \& +@esindex \~ +@esindex \0 +@esindex \a +@esindex \c +@esindex \d +@esindex \e +@esindex \E +@esindex \p +@esindex \r +@esindex \t +@esindex \u The following escapes sequences (which are handled similarly to characters since they don't take a parameter) are also allowed as delimiters: @code{\%}, @w{@samp{\ }}, @code{\|}, @code{\^}, @code{\@{}, @@ -3142,24 +3234,24 @@ delimiters: @code{\%}, @w{@samp{\ }}, @code{\|}, @code{\^}, @code{\@{}, @code{\E}, @code{\p}, @code{\r}, @code{\t}, and @code{\u}. Again, don't use these if possible. -@findex \A -@findex \Z -@findex \C -@findex \w +@esindex \A +@esindex \Z +@esindex \C +@esindex \w No newline characters as delimiters are allowed in the following escapes: @code{\A}, @code{\Z}, @code{\C}, and @code{\w}. -@findex \D -@findex \h -@findex \H -@findex \l -@findex \L -@findex \N -@findex \R -@findex \s -@findex \S -@findex \v -@findex \x +@esindex \D +@esindex \h +@esindex \H +@esindex \l +@esindex \L +@esindex \N +@esindex \R +@esindex \s +@esindex \S +@esindex \v +@esindex \x Finally, the escapes @code{\D}, @code{\h}, @code{\H}, @code{\l}, @code{\L}, @code{\N}, @code{\R}, @code{\s}, @code{\S}, @code{\v}, and @code{\x} can't use the following characters as delimiters: @@ -3197,28 +3289,28 @@ The (single-character) operators @samp{+-/*%<>=&:().}. The space, tab, and newline characters. @item -@findex \% -@findex \@{ -@findex \@} -@findex \' -@findex \` -@findex \- -@findex \_ -@findex \! -@findex \@@ -@findex \/ -@findex \c -@findex \e -@findex \p +@esindex \% +@esindex \@{ +@esindex \@} +@esindex \' +@esindex \` +@esindex \- +@esindex \_ +@esindex \! +@esindex \@@ +@esindex \/ +@esindex \c +@esindex \e +@esindex \p All escape sequences except @code{\%}, @code{\@{}, @code{\@}}, @code{\'}, @code{\`}, @code{\-}, @code{\_}, @code{\!}, @code{\@@}, @code{\/}, @code{\c}, @code{\e}, and @code{\p}. @end itemize -@findex \\ -@findex \e -@findex \E -To have a backslash (resp.@: the current escape character) appear in the +@esindex \\ +@esindex \e +@esindex \E +To have a backslash (actually, the current escape character) appear in the output several escapes are defined: @code{\\}, @code{\e} or @code{\E}. These are very similar, and only differ with respect to being used in macros or diversions. @xref{Copy-in Mode}, and @ref{Diversions}, for @@ -3229,7 +3321,7 @@ more information. @xref{Identifiers}, and @ref{Character Translations}. @menu -* Comments:: +* Comments:: @end menu @node Comments, , Escapes, Escapes @@ -3240,15 +3332,15 @@ Probably one of the most@footnote{Unfortunately, this is a lie. But hopefully future @code{gtroff} hackers will believe it @code{:-)}} common forms of escapes is the comment. -@Deffn{Escape, \\"} +@Defesc{\\", } Start a comment. Everything to the end of the input line is ignored. This may sound simple, but it can be tricky to keep the comments from interfering with the appearance of the final output. -@findex ds +@rqindex ds If the escape is to the right of some text or a request, that portion of -the line will be ignored, but the space leading up to it will be noticed +the line is ignored, but the space leading up to it is noticed by @code{gtroff}. This only affects the @code{.ds} request. @c XXX (any others?) @@ -3260,7 +3352,7 @@ request and macro arguments. @cindex undefined request @cindex request, undefined -A comment on a line by itself will be treated as a blank line, because +A comment on a line by itself is treated as a blank line, because after eliminating the comment, that is all that remains: @example @@ -3270,7 +3362,7 @@ Test @end example @noindent -will produce +produces @example Test @@ -3278,18 +3370,18 @@ Test Test @end example -As a consequence, it is common to start the line with @code{.\"} which -will cause the line to be treated as an undefined request and thus +Thus, it is common to start the line with @code{.\"} which +causes the line to be treated as an undefined request and thus ignored completely. -@findex ' +@rqindex ' Another commenting scheme seen sometimes is three consecutive single quotes (@code{'''}) at the beginning of a line. This works, but -@code{gtroff} will give a warning about an undefined macro (namely +@code{gtroff} gives a warning about an undefined macro (namely @code{''}), which is harmless, but irritating. -@end_Deffn +@end_Defesc -@Deffn{Escape, \\#} +@Defesc{\\#, } To avoid all this, @code{gtroff} has a new comment mechanism using the @code{\#} escape. This escape works the same as @code{\"} except that the newline is also ignored: @@ -3301,7 +3393,7 @@ Test @end example @noindent -will produce +produces @example Test Test @@ -3309,15 +3401,40 @@ Test Test @noindent as expected. -@end_Deffn +@end_Defesc + +@Defreq{ig, yy} +Ignores all input until @code{gtroff} encounters the macro named +@code{.}@var{yy} on a line by itself (or @code{..} if @var{yy} +is not specified). This is useful for commenting out large +blocks of text: + +@example +text text text... +.ig +This is part of a large block +of text that has been +temporarily(?) commented out. + +We can restore it simply by removing +the .ig request and the ".." at the +end of the block. +.. +More text text text... +@end example -@findex ig -For commenting away large blocks of text, the @code{ig} request may be -useful. +produces + +@example +text text text@dots{} More text text text@dots{} +@end example -@c XXX definition of .ig +Note that the commented-out block of text does not +cause a break. -@xref{Strings}. +The input is read in copy-mode; auto-incremented registers @emph{are} +affected (@pxref{Auto-increment}). +@end_Defreq @c ===================================================================== @@ -3333,11 +3450,11 @@ details of formatting parameters. @xref{Identifiers}, for details on register identifiers. @menu -* Setting Registers:: -* Interpolating Registers:: -* Auto-increment:: -* Assigning Formats:: -* Built-in Registers:: +* Setting Registers:: +* Interpolating Registers:: +* Auto-increment:: +* Assigning Formats:: +* Built-in Registers:: @end menu @c --------------------------------------------------------------------- @@ -3347,17 +3464,17 @@ details of formatting parameters. @cindex setting registers @cindex registers, setting -Registers are defined resp.@: set via the @code{nr} request or the +Define or set registers using the @code{nr} request or the @code{\R} escape. -@Deffn{Request, nr, ident value} -@Deffnx{Escape, \\R, ident value} +@Defreq{nr, ident value} +@Defescx{\\R, ident value} Set number register @var{ident} to @var{value}. If @var{ident} doesn't -exist, it will be created. +exist, @code{gtroff} creates it. -The argument to @code{\R} has to be enclosed in quotes usually. +The argument to @code{\R} usually has to be enclosed in quotes. @xref{Escapes}, for details on parameter delimiting characters. -@end_Deffn +@end_Defreq For example, the following two lines are equivalent: @@ -3367,12 +3484,12 @@ For example, the following two lines are equivalent: @end example Both @code{nr} and @code{\R} have two additional special forms to -increment resp.@: decrement a register. +increment or decrement a register. -@Deffn{Request, nr, ident +value} -@Deffnx{Request, nr, ident -value} -@Deffnx{Escape, \\R, ident +value} -@Deffnx{Escape, \\R, ident -value} +@Defreq{nr, ident +value} +@Defreqx{nr, ident -value} +@Defescx{\\R, ident +value} +@Defescx{\\R, ident -value} Increment (decrement) register @var{ident} by @var{value}. @example @@ -3412,25 +3529,25 @@ with a @samp{0}: \na @result{} -3 @end example -@end_Deffn +@end_Defreq -@Deffn{Request, rr, ident} +@Defreq{rr, ident} Remove number register @var{ident}. If @var{ident} doesn't exist, the request is ignored. -@end_Deffn +@end_Defreq -@Deffn{Request, rnn, ident1 ident2} +@Defreq{rnn, ident1 ident2} Rename number register @var{ident1} to @var{ident2}. If either @var{ident1} or @var{ident2} doesn't exist, the request is ignored. -@end_Deffn +@end_Defreq -@Deffn{Request, aln, ident1 ident2} +@Defreq{aln, ident1 ident2} This request creates an alias @var{ident1} for a number register -@var{ident2}. The new name and the old name will be exactly equivalent. -If @var{ident1} is undefined, a warning of type @samp{reg} will be -generated, and the request will be ignored. @xref{Debugging}, for +@var{ident2}. The new name and the old name are exactly equivalent. +If @var{ident1} is undefined, a warning of type @samp{reg} is +generated, and the request is ignored. @xref{Debugging}, for information about warnings. -@end_Deffn +@end_Defreq @c --------------------------------------------------------------------- @@ -3441,7 +3558,7 @@ information about warnings. Numeric registers can be accessed via the @code{\n} escape. -@Deffn{Escape, \\n, ident} +@Defesc{\\n, ident} @c XXX is the following correct? Interpolate number register @var{ident}. This means that the value of the register is expanded in-place while @code{gtroff} is parsing the @@ -3453,7 +3570,7 @@ input line. \n(as @result{} 10 @end example -@end_Deffn +@end_Defesc @c --------------------------------------------------------------------- @@ -3463,26 +3580,26 @@ input line. @cindex increment, automatic Number registers can also be auto-incremented and auto-decremented. The -increment resp.@: decrement factor can be specified with a third +increment or decrement factor can be specified with a third argument to the @code{nr} request or @code{\R} escape. -@findex \R -@Deffn{Request, nr, ident value incr} +@esindex \R +@Defreq{nr, ident value incr} Set number register @var{ident} to @var{value}; the increment for auto-incrementing is set to @var{incr}. Note that the @code{\R} escape doesn't support this notation. -@end_Deffn +@end_Defreq To activate auto-incrementing, the escape @code{\n} has a special syntax form. -@Deffn{Escape, \\n, +ident} -@Deffnx{Escape, \\n, -ident} -Before interpolating, increment resp.@: decrement @var{ident} by the +@Defesc{\\n, +ident} +@Defescx{\\n, -ident} +Before interpolating, increment or decrement @var{ident} by the auto-increment value as specified with the @code{nr} request (or the @code{\R} escape). If no auto-increment value has been specified, both syntax forms are identical to @code{\n}. -@end_Deffn +@end_Defesc For example, @@ -3527,7 +3644,7 @@ representation of that number. This output format can be changed to a variety of formats (numbers, Roman numerals, etc.). This is done using the @code{af} request. -@Deffn{Request, af, ident format} +@Defreq{af, ident format} Change the output format of a number register. The first argument @var{ident} is the name of the number register to be changed, and the second argument @var{format} is the output format. The following output @@ -3562,11 +3679,11 @@ Upper-case letters: A, B, C, @dots{},@w{ }Z, AA, AB,@w{ }@enddots{} Lower-case letters: a, b, c, @dots{},@w{ }z, aa, ab,@w{ }@enddots{} @end table -Omitting the number register format will cause a warning of type +Omitting the number register format causes a warning of type @samp{missing}. @xref{Debugging}, for more details. Specifying a nonexistent format causes an error. -The following example will produce @samp{10, X, j, 010}: +The following example produces @samp{10, X, j, 010}: @example .nr a 10 @@ -3584,29 +3701,29 @@ The following example will produce @samp{10, X, j, 010}: @cindex maximum values of Roman numerals @cindex minimum values of Roman numerals The largest number representable for the @samp{i} and @samp{I} formats -is 39999 (resp.@: -39999); @acronym{UNIX} @code{troff} uses @samp{z} and +is 39999 (or -39999); @acronym{UNIX} @code{troff} uses @samp{z} and @samp{w} to represent 10000 and 5000 in Roman numerals, and so does @code{gtroff}. Currently, the correct glyphs of Roman numeral five thousand and Roman numeral ten thousand (Unicode code points @code{U+2182} and @code{U+2181}, respectively) are not available. -If @var{ident} doesn't exist, it will be created. +If @var{ident} doesn't exist, it is created. @cindex read-only register, changing format @cindex changing format, read-only register Changing the output format of a read-only register causes an error. It is necessary to first copy the register's value to a writeable register, then apply the @code{af} request to this other register. -@end_Deffn +@end_Defreq @cindex format of register @cindex register, format -@Deffn{Escape, \\g, ident} +@Defesc{\\g, ident} Return the current format of the specified register @var{ident}. For example, @samp{\ga} after the previous example would produce the string @samp{000}. If the register hasn't been defined yet, nothing is returned. -@end_Deffn +@end_Defesc @c --------------------------------------------------------------------- @@ -3697,27 +3814,27 @@ affecting both @samp{.c} and @samp{c.}. @item ln @vindex ln -@findex nm +@rqindex nm @cindex output line number register @cindex line number, output, register The current @emph{output} line number after a call to the @code{nm} request to activate line numbering. -@c XXX xref nm request +@xref{Miscellaneous}, for more information about line numbering. @item .x @vindex .x @cindex major version number register @cindex version number, major, register The major version number. For example, if the version number is@w{ -}1.03 then @code{.x} will contain@w{ }@samp{1}. +}1.03 then @code{.x} contains@w{ }@samp{1}. @item .y @vindex .y @cindex minor version number register @cindex version number, minor, register The minor version number. For example, if the version number is@w{ -}1.03 then @code{.y} will contain@w{ }@samp{03}. +}1.03 then @code{.y} contains@w{ }@samp{03}. @item .Y @vindex .Y @@ -3771,28 +3888,29 @@ example, @samp{latin1} or @samp{ps}). @cindex break @cindex line break -@findex bp -@findex ce -@findex cf -@findex fi -@findex fl -@findex in -@findex nf -@findex rj -@findex sp -@findex ti -@findex trf +@rqindex bp +@rqindex ce +@rqindex cf +@rqindex fi +@rqindex fl +@rqindex in +@rqindex nf +@rqindex rj +@rqindex sp +@rqindex ti +@rqindex trf Various ways of causing @dfn{breaks} were given in @ref{Implicit Line -Breaks}. The @code{br} request will likewise cause a break. Several -other requests will also cause breaks, but implicitly. These are +Breaks}. The @code{br} request likewise causes a break. Several +other requests also cause breaks, but implicitly. These are @code{bp}, @code{ce}, @code{cf}, @code{fi}, @code{fl}, @code{in}, @code{nf}, @code{rj}, @code{sp}, @code{ti}, and @code{trf}. -@Deffn{Request, br, } -Break the current line, i.e., the input collected so far will be emitted +@Defreq{br, } +Break the current line, i.e., the input collected so far is emitted without adjustment. -If the no-break control character is used, no break will happen: +If the no-break control character is used, @code{gtroff} suppresses +the break: @example a @@ -3800,41 +3918,42 @@ a b @result{} a b @end example -@end_Deffn +@end_Defreq -Initially, @code{gtroff} will fill and adjust text to both margins. +Initially, @code{gtroff} fills and adjusts text to both margins. Filling can be disabled via the @code{nf} request and re-enabled with the @code{fi} request. @cindex fill mode @cindex mode, fill -@vindex .u -@Deffn{Request, fi, } +@Defreq{fi, } +@Defregx{.u} Activate fill mode (which is the default). This request implicitly -enables adjusting; it will also cause a break in the text currently +enables adjusting; it also inserts a break in the text currently being filled. The number register @code{.u} is set to@w{ }1. The fill mode status is associated with the current environment (@pxref{Environments}). -@end_Deffn +@end_Defreq @cindex no-fill mode @cindex mode, no-fill -@Deffn{Request, nf, } +@Defreq{nf, } Activate no-fill mode. Input lines are output as-is, retaining line -breaks. The current line length will be ignored. This command +breaks. The current line length is ignored. This command implicitly disables adjusting; it also causes a break. The number -register @code{.u} will be set to@w{ }0. +register @code{.u} is set to@w{ }0. The fill mode status is associated with the current environment (@pxref{Environments}). -@end_Deffn +@end_Defreq -@Deffn{Request, ad, [@var{mode}]} +@Defreq{ad, [@var{mode}]} +@Defregx{.j} Set adjusting mode. -Activation and deactivation of adjusting will be implicitly done with -calls to the @code{fi} resp.@: @code{nf} requests. +Activation and deactivation of adjusting is done implicitly with +calls to the @code{fi} or @code{nf} requests. @var{mode} can have one of the following values: @@ -3850,7 +3969,7 @@ Adjust text to the right margin, producing ragged-left text. @item c @cindex centered text -@findex ce +@rqindex ce Center filled text. This is different to the @code{ce} request which only centers text without filling. @@ -3859,8 +3978,8 @@ only centers text without filling. Justify to both margins. This is the default used by @code{gtroff}. @end table -With no argument, @code{gtroff} will adjust lines in the same way it did -before adjusting has been deactivated (with a call to @code{na}, for +With no argument, @code{gtroff} adjusts lines in the same way it did +before adjusting was deactivated (with a call to @code{na}, for example). @example @@ -3875,28 +3994,27 @@ text text @end example -@vindex .j @cindex current adjustment mode register The current adjustment mode is available in the number register @code{.j}; it can be stored and subsequently used to set adjustment. The adjustment mode status is associated with the current environment (@pxref{Environments}). -@end_Deffn +@end_Defreq -@Deffn{Request, na, } +@Defreq{na, } Disable adjusting. This request won't change the current adjustment -mode: A call to @code{ad} afterwards will use the previous adjustment +mode: A subsequent call to @code{ad} uses the previous adjustment setting. The adjustment mode status is associated with the current environment (@pxref{Environments}). -@end_Deffn +@end_Defreq -@Deffn{Escape, \\p, } +@Defesc{\\p, } Adjust the current line and cause a break. -In most cases this will produce very ugly results, since @code{gtroff} +In most cases this produces very ugly results, since @code{gtroff} doesn't have a sophisticated paragraph building algorithm (as @TeX{} does, for example); instead, @code{gtroff} fills and adjusts a paragraph line by line: @@ -3914,7 +4032,7 @@ is formatted as uninteresting sentence. This is an uninteresting sentence. @end example -@end_Deffn +@end_Defesc @cindex word space size @cindex size of word space @@ -3922,7 +4040,9 @@ is formatted as @cindex sentence space size @cindex size of sentence space @cindex space between sentences -@Deffn{Request, ss, word_space_size [@var{sentence_space_size}]} +@Defreq{ss, word_space_size [@var{sentence_space_size}]} +@Defregx{.ss} +@Defregx{.sss} Change the minimum size of a space between filled words. It takes its units as one twelfth of the space width parameter for the current font. Initially both the @var{word_space_size} and @var{sentence_space_size} @@ -3932,19 +4052,17 @@ are@w{ }12. @cindex mode, fill If two arguments are given to the @code{ss} request, the second argument sets the sentence space size. If the second argument is not given, -sentence space size will be set to @var{word_space_size}. The sentence +sentence space size is set to @var{word_space_size}. The sentence space size is used in two circumstances: if the end of a sentence occurs at the end of a line in fill mode, then both an inter-word space and a -sentence space will be added; if two spaces follow the end of a sentence -in the middle of a line, then the second space will be a sentence space. -Note that the behaviour of @acronym{UNIX} @code{troff} will be exactly -that exhibited by GNU @code{troff} if a second argument is never given -to the @code{ss} request. In GNU @code{troff}, as in @acronym{UNIX} +sentence space are added; if two spaces follow the end of a sentence +in the middle of a line, then the second space is a sentence space. +If a second argument is never given to the @code{ss} request, +the behaviour of @acronym{UNIX} @code{troff} is the same as +that exhibited by GNU @code{troff}. In GNU @code{troff}, as in @acronym{UNIX} @code{troff}, a sentence should always be followed by either a newline or two spaces. -@vindex .ss -@vindex .sss The number registers @code{.ss} and @code{.sss} hold the values of the parameters set by the first and second arguments of the @code{ss} request. @@ -3957,22 +4075,23 @@ ignored in nroff mode; the given values are then rounded down to a multiple of@w{ }12. The request is ignored if there is no parameter. -@end_Deffn +@end_Defreq @cindex centering lines @cindex lines, centering -@Deffn{Request, ce, [@var{nnn}]} -Center text. While the @w{@samp{.ad c}} request will also center text, -it has the side effect of filling the text. @code{ce} will not fill the +@Defreq{ce, [@var{nnn}]} +@Defregx{.ce} +Center text. While the @w{@samp{.ad c}} request also centers text, +it fills the text as well. @code{ce} does not fill the text it affects. This request causes a break. -With no arguments, @code{ce} will center the next line of text. +With no arguments, @code{ce} centers the next line of text. @var{nnn} specifies the number of lines to be centered. If the argument is zero or negative, centering is disabled. -@findex ll -@findex in -@findex ti +@rqindex ll +@rqindex in +@rqindex ti The basic length for centering text is the line length (as set with the @code{ll} request) minus the indentation (as set with the @code{in} request). Temporary indentation is ignored. @@ -3991,21 +4110,20 @@ more interesting .ce 0 @end example -@vindex .ce The @code{.ce} number register contains the number of lines remaining to be centered, as set by the @code{ce} request. -@end_Deffn +@end_Defreq @cindex justifying text @cindex text, justifying @cindex right-justifying -@vindex .rj -@Deffn{Request, rj, [@var{nnn}]} +@Defreq{rj, [@var{nnn}]} +@Defregx{.rj} Justify unfilled text to the right margin. Arguments are identical to the @code{ce} request. The @code{.rj} number register is the number of lines to be right-justified as set by the @code{rj} request. This -request causes a line break. -@end_Deffn +request causes a break. +@end_Defreq @c ===================================================================== @@ -4015,10 +4133,11 @@ request causes a line break. @cindex manipulating hyphenation @cindex hyphenation, manipulating -As discussed in @ref{Hyphenation}, @code{gtroff} will hyphenate words. +As discussed in @ref{Hyphenation}, @code{gtroff} hyphenates words. There are a number of ways to influence hyphenation. -@Deffn{Request, hy, [@var{mode}]} +@Defreq{hy, [@var{mode}]} +@Defregx{.hy} Enable hyphenation. The request has an optional numeric argument, @var{mode}, to restrict hyphenation if necessary: @@ -4041,32 +4160,31 @@ Values in the previous table are additive. For example, the value@w{ }12 causes @code{gtroff} to neither hyphenate the last two nor the first two characters of a word. -@vindex .hy @cindex hyphenation restrictions register The current hyphenation restrictions can be found in the number register @samp{.hy}. The hyphenation mode is associated with the current environment (@pxref{Environments}). -@end_Deffn +@end_Defreq -@Deffn{Request, nh, } +@Defreq{nh, } Disable hyphenation (i.e., set the hyphenation mode to zero). Note that the hyphenation mode of the last call to @code{hy} is not remembered. The hyphenation mode is associated with the current environment (@pxref{Environments}). -@end_Deffn +@end_Defreq -@vindex .hlc -@vindex .hlm -@findex \% +@esindex \% @cindex explicit hyphens @cindex hyphen, explicit @cindex consecutive hyphenated lines @cindex lines, consecutive hyphenated @cindex hyphenated lines, consecutive -@Deffn{Request, hlm, [@var{nnn}]} +@Defreq{hlm, [@var{nnn}]} +@Defregx{.hlm} +@Defregx{.hlc} Set the maximum number of consecutive hyphenated lines to @var{nnn}. If this number is negative, there is no maximum. The default value is@w{ }-1 if @var{nnn} is omitted. This value is associated with the current @@ -4077,9 +4195,9 @@ Hyphens resulting from @code{\%} are counted; explicit hyphens are not. The current setting of @code{hlm} is available in the @code{.hlm} register. Also the number of immediately preceding consecutive hyphenated lines are available in the number register @samp{.hlc}. -@end_Deffn +@end_Defreq -@Deffn{Request, hw, word1 word2 @dots{}} +@Defreq{hw, word1 word2 @dots{}} Define how @var{word1}, @var{word2}, etc.@: are to be hyphenated. The words must be given with hyphens at the hyphenation points. For example: @@ -4095,7 +4213,7 @@ documentation for the @code{hcode} request below for more information). In addition, this request can be used more than once. Hyphenation exceptions specified with the @code{hw} request are -associated with the current hyphenation language; it will cause an error +associated with the current hyphenation language; it causes an error if there is no current hyphenation language. This request is ignored if there is no parameter. @@ -4103,37 +4221,37 @@ This request is ignored if there is no parameter. In old versions of @code{troff} there was a limited amount of space to store such information; fortunately, with @code{gtroff}, this is no longer a restriction. -@end_Deffn +@end_Defreq @cindex hyphenation character @cindex character, hyphenation @cindex disabling hyphenation @cindex hyphenation, disabling -@Deffn{Escape, \\%, } -To tell @code{gtroff} how to hyphenate words on the fly, the @code{\%} -escape, also known as the @dfn{hyphenation character}, can be used. -Preceding a word with this character will prevent it from being -hyphenated, putting it in a word will indicate to @code{gtroff} that the -word may be hyphenated at that point. Note that this mechanism will -only affect that one occurrence of the word; to change the hyphenation +@Defesc{\\%, } +To tell @code{gtroff} how to hyphenate words on the fly, use the @code{\%} +escape, also known as the @dfn{hyphenation character}. +Preceding a word with this character prevents it from being +hyphenated; putting it inside a word indicates to @code{gtroff} that the +word may be hyphenated at that point. Note that this mechanism +only affects that one occurrence of the word; to change the hyphenation of a word for the entire document, use the @code{hw} request. -@end_Deffn +@end_Defesc -@Deffn{Request, hc, [@var{char}]} -Change the hyphenation character to @var{char}. This character will -then work the same as the @code{\%} escape, and thus, no longer appear -in the output. Without an argument, @code{hc} will reset the +@Defreq{hc, [@var{char}]} +Change the hyphenation character to @var{char}. This character +then works the same as the @code{\%} escape, and thus, no longer appears +in the output. Without an argument, @code{hc} resets the hyphenation character to be @code{\%} (the default) only. The hyphenation character is associated with the current environment (@pxref{Environments}). -@end_Deffn +@end_Defreq @cindex hyphenation patterns @cindex patterns for hyphenation -@Deffn{Request, hpf, pattern_file} -Read in a file of hyphenation patterns. This file will be searched for -in the same way as @file{@var{name}.tmac} (resp.@: +@Defreq{hpf, pattern_file} +Read in a file of hyphenation patterns. This file is searched for +in the same way as @file{@var{name}.tmac} (or @file{tmac.@var{name}}) is searched for if the @option{-m@var{name}} option is specified. @@ -4146,7 +4264,7 @@ continues to the end of the line. If no @code{hpf} request is specified (either in the document or in a macro package), @code{gtroff} won't hyphenate at all. -@findex hla +@rqindex hla @pindex troffrc @pindex troffrc-end @pindex hyphen.us @@ -4156,13 +4274,13 @@ invoked by the @file{troffrc} or @file{troffrc-end} file; by default, @file{troffrc} loads hyphenation patterns for American English (in file @file{hyphen.us}). -@code{hpf} will cause an error if there is no current hyphenation +Invoking @code{hpf} causes an error if there is no current hyphenation language. -@end_Deffn +@end_Defreq @cindex hyphenation code @cindex code, hyphenation -@Deffn{Request, hcode, c1 code1 c2 code2 @dots{}} +@Defreq{hcode, c1 code1 c2 code2 @dots{}} Sets the hyphenation code of character @var{c1} to @var{code1}, that of @var{c2} to @var{code2}, etc. A hyphenation code must be a single input character (not a special character) other than a digit or a space. @@ -4170,32 +4288,33 @@ Initially each lower-case letter (@samp{a}-@samp{z}) has its hyphenation set to itself, and each upper-case letter (@samp{A}-@samp{Z}) has a hyphenation code which is the lower-case version of itself. -This request will be ignored if it has no parameter. -@end_Deffn +This request is ignored if it has no parameter. +@end_Defreq @cindex hyphenation margin @cindex margin for hyphenation -@findex ad -@Deffn{Request, hym, [@var{length}]} +@rqindex ad +@Defreq{hym, [@var{length}]} +@Defregx{.hym} Set the (right) hyphenation margin to @var{length}. If the current -adjustment mode is not@w{ }@samp{b}, the line will not be hyphenated if -it is shorter than @var{length}. Without argument, the hyphenation -margin will be reset to its default value, which is@w{ }0. The default +adjustment mode is not@w{ }@samp{b}, the line is not hyphenated if +it is shorter than @var{length}. Without an argument, the hyphenation +margin is reset to its default value, which is@w{ }0. The default scaling indicator for this request is@w{ }@code{m}. The hyphenation margin is associated with the current environment (@pxref{Environments}). -A negative argument will reset the hyphenation margin to zero, emitting +A negative argument resets the hyphenation margin to zero, emitting a warning of type @samp{range}. -@vindex .hym @cindex current hyphenation margin register The current hyphenation margin is available in the @code{.hym} register. -@end_Deffn +@end_Defreq @cindex hyphenation space -@findex ad -@Deffn{Request, hys, [@var{hyphenation_space}]} +@rqindex ad +@Defreq{hys, [@var{hyphenation_space}]} +@Defregx{.hys} Set the hyphenation space to @var{hyphenation_space}. If the current adjustment mode is@w{ }@samp{b}, don't hyphenate the line if it can be justified by adding no more than @var{hyphenation_space} extra @@ -4204,37 +4323,37 @@ set to its default value, which is@w{ }0. The default scaling indicator for this request is@w{ }@code{m}. The hyphenation space is associated with the current environment (@pxref{Environments}). -A negative argument will reset the hyphenation space to zero, emitting a +A negative argument resets the hyphenation space to zero, emitting a warning of type @samp{range}. -@vindex .hys @cindex current hyphenation space register The current hyphenation space is available in the @code{.hys} register. -@end_Deffn +@end_Defreq @cindex soft hyphen character @cindex character, soft hyphen @glindex hy -@findex char -@findex tr -@Deffn{Request, shc, [@var{char}]} +@rqindex char +@rqindex tr +@Defreq{shc, [@var{char}]} Set the soft hyphen character to @var{char}. If the argument is -omitted, the soft hyphen character will be set to the default character +omitted, the soft hyphen character is set to the default character @code{\(hy} (this is the start-up value of @code{gtroff} also). The -soft hyphen character is the character which will be inserted when a +soft hyphen character is the character that is inserted when a word is hyphenated at a line break. If the soft hyphen character does not exist in the font of the character immediately preceding a potential -break point, then the line will not be broken at that point. Neither +break point, then the line is not broken at that point. Neither definitions (specified with the @code{char} request) nor translations (specified with the @code{tr} request) are considered when finding the soft hyphen character. -@end_Deffn +@end_Defreq -@findex hpf -@findex hw +@rqindex hpf +@rqindex hw @pindex troffrc @pindex troffrc-end -@Deffn{Request, hla, language} +@Defreq{hla, language} +@Defregx{.hla} Set the current hyphenation language to the string @var{language}. Hyphenation exceptions specified with the @code{hw} request and hyphenation patterns specified with the @code{hpf} request are both @@ -4243,7 +4362,6 @@ request is usually invoked by the @file{troffrc} or the @file{troffrc-end} files; @file{troffrc} sets the default language to @samp{us}. -@vindex .hla @cindex current hyphenation language register The current hyphenation language is available as a string in the read-only number register @samp{.hla}. @@ -4253,7 +4371,7 @@ read-only number register @samp{.hla}. \*[curr_language] @result{} us @end example -@end_Deffn +@end_Defreq @c ===================================================================== @@ -4263,19 +4381,20 @@ read-only number register @samp{.hla}. @cindex manipulating spacing @cindex spacing, manipulating -@Deffn{Request, sp, [@var{distance}]} -Space downwards @var{distance}. With no argument it will advance 1@w{ -}line. A negative argument will cause @code{gtroff} to move up the page +@Defreq{sp, [@var{distance}]} +Space downwards @var{distance}. With no argument it advances 1@w{ +}line. A negative argument causes @code{gtroff} to move up the page the specified distance. If the argument is preceded by a @samp{|} -@code{gtroff} will move that distance from the top of the page. This +then @code{gtroff} moves that distance from the top of the page. This request causes a line break. The default scaling indicator is@w{ }@code{v}. -@end_Deffn +@end_Defreq @cindex double-spacing -@Deffn{Request, ls, [@var{nnn}]} +@Defreq{ls, [@var{nnn}]} +@Defregx{.L} Output @w{@var{nnn}-1} blank lines after each line of text. With no -argument @code{gtroff} will use the previous value before the last +argument, @code{gtroff} uses the previous value before the last @code{ls} call. @example @@ -4287,24 +4406,23 @@ argument @code{gtroff} will use the previous value before the last The line spacing is associated with the current environment (@pxref{Environments}). -@vindex .L @cindex current line spacing register The number register @code{.L} contains the current line spacing setting. -@end_Deffn +@end_Defreq -@Deffn{Escape, \\x, spacing} +@Defesc{\\x, spacing} +@Defregx{.a} Sometimes, extra vertical spacing is only needed occasionally, e.g.@: to allow space for a tall construct (like an equation). The @code{\x} -escape will do this. The escape is given a numerical argument, usually +escape does this. The escape is given a numerical argument, usually enclosed in quotes (like @samp{\x'3p'}); the default scaling indicator -is@w{ }@code{v}. If this number is positive extra vertical space will -be inserted below the current line. A negative number will add space +is@w{ }@code{v}. If this number is positive extra vertical space is +inserted below the current line. A negative number adds space above. If this escape is used multiple times on the same line, the maximum of the values is used. @xref{Escapes}, for details on parameter delimiting characters. -@vindex .a @cindex extra vertical line space register The @code{.a} number register contains the most recent (nonnegative) extra vertical line space. @@ -4315,19 +4433,19 @@ extra vertical line space. ... example of inline equation ... @end example @end ignore -@end_Deffn +@end_Defesc -@findex sp +@rqindex sp @cindex no-space mode @cindex mode, no-space @cindex blank lines, disabling @cindex lines, blank, disabling -@Deffn{Request, ns, } +@Defreq{ns, } Enable @dfn{no-space mode}. In this mode, spacing (either via @code{sp} or via blank lines) is disabled. The @code{bp} request to advance to the next page is also disabled, except if it is accompanied by a page -number (see @ref{Page Control}, for more information). This mode will -end when actual text is output or the @code{rs} request is encountered. +number (see @ref{Page Control}, for more information). This mode +ends when actual text is output or the @code{rs} request is encountered. This request is useful for macros which want to avoid that subsequent macros inadvertently insert some vertical space before the text starts @@ -4335,14 +4453,14 @@ macros inadvertently insert some vertical space before the text starts is associated with the current diversion level. @c XXX xref -@end_Deffn +@end_Defreq -@Deffn{Request, rs, } +@Defreq{rs, } Disable no-space mode. This request is associated with the current diversion level. @c XXX xref -@end_Deffn +@end_Defreq @c ===================================================================== @@ -4357,27 +4475,28 @@ A tab character (@acronym{ASCII} char@w{ }9, @acronym{EBCDIC} char@w{ }5) causes a horizontal movement to the next tab stop (much like it did on a typewriter). -@Deffn{Escape, \\t, } +@Defesc{\\t, } This escape is a non-interpreted tab character. In copy mode (@pxref{Copy-in Mode}), @code{\t} is the same as a real tab character. -@end_Deffn +@end_Defesc -@Deffn{Request, ta, [@var{n1} @var{n2} @dots{} @var{nn} @t{T} @var{r1} @var{r2} @dots{} @var{rn}]} +@Defreq{ta, [@var{n1} @var{n2} @dots{} @var{nn} @t{T} @var{r1} @var{r2} @dots{} @var{rn}]} +@Defregx{.tabs} Change tab stop positions. This request takes a series of tab specifiers as arguments (optionally divided into two groups with the letter @samp{T}) which indicate where each tab stop is to be (overriding any previous settings). Tab stops can be specified absolutely, i.e., as the distance from the -left margin. For example, the following will set 6@w{ }tab stops every +left margin. For example, the following sets 6@w{ }tab stops every one inch. @example .ta 1i 2i 3i 4i 5i 6i @end example -Tab stops can also be specified relatively (using a leading @samp{+}) -which means that the specified tab stop will be set that distance from +Tab stops can also be specified using a leading @samp{+} +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. @@ -4449,7 +4568,7 @@ the user wants. @item Superfluous tabs (i.e., tab characters which do not correspond to a tab stop) are ignored except the first one which delimits the characters -belonging to the last tab stop for right-justifying resp.@: centering. +belonging to the last tab stop for right-justifying or centering. Consider the following example @example @@ -4485,7 +4604,7 @@ Tab stops are associated with the current environment (@pxref{Environments}). @item -Calling @code{ta} without an argument will unset all tab stops. +Calling @code{ta} without an argument removes all tab stops. @item @cindex tab stops, in nroff mode @@ -4494,7 +4613,6 @@ used even in nroff mode (contrary to @acronym{UNIX} @code{nroff} which has tab stops preset every 0.8@dmn{i}). @end itemize -@vindex .tabs @cindex current tab settings register The number register @code{.tabs} contains a string representation of the current tab settings suitable for use as an argument to the @code{ta} @@ -4505,21 +4623,21 @@ request. \*[tab-string] @result{} T120u @end example -@end_Deffn +@end_Defreq @cindex tab repitition character @cindex character, tab repitition -@Deffn{Request, tc, [@var{fill-char}]} -Normally @code{gtroff} will fill the space to the next tab stop with -space. This can be changed with the @code{tc} request. With no -argument @code{gtroff} will revert to using space, which is the default. +@Defreq{tc, [@var{fill-char}]} +Normally @code{gtroff} fills the space to the next tab stop with +whitespace. This can be changed with the @code{tc} request. With no +argument @code{gtroff} reverts to using whitespace, which is the default. The value of this @dfn{tab repitition} character is associated with the current environment (@pxref{Environments}). -@end_Deffn +@end_Defreq @menu -* Leaders:: -* Fields:: +* Leaders:: +* Fields:: @end menu @c --------------------------------------------------------------------- @@ -4532,7 +4650,7 @@ Sometimes it may may be desirable to use the @code{tc} request to fill a particular tab stop with a given character (for example dots in a table of contents), but also normal tab stops on the rest of the line. For this @code{gtroff} provides an alternate tab mechanism, called -@dfn{leaders} which will do just that. +@dfn{leaders} which does just that. @cindex leader character A leader character (character code@w{ }1) behaves similarly to a tab @@ -4540,21 +4658,21 @@ character: It moves to the next tab stop. The only difference is that for this movement, the fill character defaults to a period character and not to space. -@Deffn{Escape, \\a, } +@Defesc{\\a, } This escape is a non-interpreted leader character. In copy mode (@pxref{Copy-in Mode}), @code{\a} is the same as a real leader character. -@end_Deffn +@end_Defesc @cindex leader repitition character @cindex character, leader repitition -@Deffn{Request, lc, [@var{fill-char}]} -The character that will be repeated can be declared with the @code{lc} -request. Without an argument, leaders will act the same as tabs (i.e., -using space for filling). @code{gtroff}'s start-up value is @samp{.}. +@Defreq{lc, [@var{fill-char}]} +Declares the leader character. +Without an argument, leaders act the same as tabs (i.e., +using whitespace for filling). @code{gtroff}'s start-up value is @samp{.}. The value of this @dfn{leader repitition} character is associated with the current environment (@pxref{Environments}). -@end_Deffn +@end_Defreq @cindex table of contents @cindex contents, table of @@ -4600,7 +4718,7 @@ lengths plus the stretchable space equal to the field width. If more than one padding character is inserted, the available space is evenly distributed among them. -@Deffn{Request, fc, [@var{delim-char} [@var{padding-char}]]} +@Defreq{fc, [@var{delim-char} [@var{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 @@ -4625,7 +4743,7 @@ and here the result: foo bar smurf foo bar smurf @end example -@end_Deffn +@end_Defreq @c ===================================================================== @@ -4635,8 +4753,8 @@ foo bar smurf @cindex character translations @cindex translations of characters -@findex . -@findex ' +@rqindex . +@rqindex ' @cindex control character @cindex character, control @cindex no-break control character @@ -4646,22 +4764,22 @@ The control character (@samp{.}) and the no-break control character (@samp{'}) can be changed with the @code{cc} and @code{c2} requests, respectively. -@Deffn{Request, cc, [@var{c}]} +@Defreq{cc, [@var{c}]} Set the control character to @var{c}. With no argument the default control character @samp{.} is restored. The value of the control character is associated with the current environment (@pxref{Environments}). -@end_Deffn +@end_Defreq -@Deffn{Request, c2, [@var{c}]} +@Defreq{c2, [@var{c}]} Set the no-break control character to @var{c}. With no argument the default control character @samp{'} is restored. The value of the no-break control character is associated with the current environment (@pxref{Environments}). -@end_Deffn +@end_Defreq -@findex \\ -@Deffn{Request, eo, } +@esindex \\ +@Defreq{eo, } Disable the escape mechanism completely. After executing this request, the backslash character @samp{\} no longer starts an escape sequence. @@ -4684,11 +4802,11 @@ necessary then to double the escape character. Here an example: .. .ec @end example -@end_Deffn +@end_Defreq @cindex escape character @cindex character, escape -@Deffn{Request, ec, [@var{c}]} +@Defreq{ec, [@var{c}]} Set the escape character to @var{c}. With no argument the default escape character @samp{\} is restored. It can be also used to re-enable the escape mechanism after an @code{eo} request. @@ -4696,14 +4814,14 @@ the escape mechanism after an @code{eo} request. Note that changing the escape character globally will likely break macro packages since @code{gtroff} has no mechanism (like @TeX{}) to `intern' macros, i.e., to convert a macro definition into an internal form which -is independent of its representation. If a macro is called, it will be +is independent of its representation. If a macro is called, it is executed literally. -@end_Deffn +@end_Defreq -@Deffn{Escape, \\e, } +@Defesc{\\e, } This escape sequence prints the current escape character (which is the backslash character @samp{\} by default). -@end_Deffn +@end_Defesc A @dfn{translation} is a mapping of an input character to an output character. The default mappings are given in the font definition files @@ -4712,24 +4830,24 @@ with @code{tr} and in the font definition files) occur at output time, i.e., the input character gets assigned the metric information of the mapped output character. -@Deffn{Request, tr, @var{a}@var{b}@var{c}@var{d}@dots{}} +@Defreq{tr, @var{a}@var{b}@var{c}@var{d}@dots{}} Translate character @var{a} to @var{b}, character @var{c} to @var{d}, -etc. If there is an odd number of arguments, the last one will be +etc. If there is an odd number of arguments, the last one is translated to the space character. Some notes: @itemize @bullet @item -@findex \( -@findex \[ -@findex \' -@findex \` -@findex \- -@findex \_ -@findex \C -@findex \N -@findex char +@esindex \( +@esindex \[ +@esindex \' +@esindex \` +@esindex \- +@esindex \_ +@esindex \C +@esindex \N +@rqindex char @cindex special character @cindex character, special @cindex numbered character @@ -4740,12 +4858,12 @@ characters defined with the @code{char} request, and numbered characters (@code{\N'@var{xxx}'}) can be translated also. @item -@findex \e +@esindex \e The @code{\e} escape can be translated also. @item -@findex \% -@findex \~ +@esindex \% +@esindex \~ Characters can be mapped onto the @code{\%} and @code{\~} escapes (but @code{\%} and @code{\~} can't be mapped onto another character). @@ -4758,21 +4876,21 @@ Characters can be mapped onto the @code{\%} and @code{\~} escapes (but @cindex character, newline @cindex tab character @cindex character, tab -@findex \a -@findex \t +@esindex \a +@esindex \t The following characters can't be translated: space (with one exception, see below), backspace, newline, leader (and @code{\a}), tab (and @code{\t}). @item -@findex shc +@rqindex shc Translations are not considered for finding the soft hyphen character set with the @code{shc} request. @item -@findex \& +@esindex \& The character pair @samp{@var{c}\&} (this is an arbitrary character@w{ -}@var{c} followed by the zero width space character) will map this +}@var{c} followed by the zero width space character) maps this character to nothing. @example @@ -4794,9 +4912,9 @@ foo bar As shown in the example, the space character can't be the first character pair as an argument of @code{tr}. Additionally, it is not possible to map the space character to any other character; requests -like @w{@samp{.tr aa x}} will undo @w{@samp{.tr aa \&}} instead. +like @w{@samp{.tr aa x}} undo @w{@samp{.tr aa \&}} instead. -If justification is active, lines will be justified inspite of the +If justification is active, lines are justified in spite of the `empty' space character (but there is no minimal distance, i.e.@: the space character, between words). @@ -4811,10 +4929,11 @@ string), it is no longer affected by @code{tr}. @item Without an argument, the @code{tr} request is ignored. @end itemize -@end_Deffn +@end_Defreq -@findex \!@r{, and @code{trnt}} -@Deffn{Request, trnt, @var{a}@var{b}@var{c}@var{d}@dots{}} +@esindex \! +@cindex @code{\!}, and @code{trnt} +@Defreq{trnt, @var{a}@var{b}@var{c}@var{d}@dots{}} @code{trnt} is the same as the @code{tr} request except that the translations do not apply to text that is transparently throughput into a diversion with @code{\!}. @xref{Diversions}, for more information. @@ -4830,9 +4949,9 @@ For example, @end example @noindent -will print @samp{b}; if @code{trnt} is used instead of @code{tr} it will -print @samp{a}. -@end_Deffn +prints @samp{b}; if @code{trnt} is used instead of @code{tr} it +prints @samp{a}. +@end_Defreq @c ===================================================================== @@ -4850,14 +4969,14 @@ the former for tty output, the latter for everything else. With GNU Usually, a macro package can be used with both @code{nroff} and @code{troff}. Nevertheless, it is sometimes necessary to make a -distinction between the two programs (resp.@: modes), and @code{gtroff} +distinction between the two programs (modes), and @code{gtroff} provides two built-in conditions @samp{n} and @samp{t} for the @code{if}, @code{ie}, and @code{while} requests to decide whether @code{gtroff} shall behave like @code{nroff} or like @code{troff}. @pindex troffrc @pindex troffrc-end -@Deffn{Request, troff, } +@Defreq{troff, } Make the @samp{t} built-in condition true (and the @samp{n} built-in condition false) for @code{if}, @code{ie}, and @code{while} conditional requests. This is the default if @code{gtroff} (@emph{not} @@ -4865,17 +4984,17 @@ requests. This is the default if @code{gtroff} (@emph{not} the start-up files @file{troffrc} and @file{troffrc-end}. Without @option{-R}, @code{gtroff} stays in troff mode if the output device is not a tty (e.g.@: `ps'). -@end_Deffn +@end_Defreq @pindex tty.tmac -@Deffn{Request, nroff, } +@Defreq{nroff, } Make the @samp{n} built-in condition true (and the @samp{t} built-in condition false) for @code{if}, @code{ie}, and @code{while} conditional requests. This is the default if @code{gtroff} uses a tty output device; the code for switching to nroff mode is in the file -@file{tty.tmac} which will be loaded by the start-up file +@file{tty.tmac} which is loaded by the start-up file @code{troffrc}. -@end_Deffn +@end_Defreq @xref{Conditionals and Loops}, for more details on built-in conditions. @@ -4921,7 +5040,7 @@ output, defining the @dfn{left margin}. @cindex indentation @cindex line indentation @dfn{Indentation} -- this is the distance from the left margin where -text will be printed. +text is printed. @item ll @cindex line length @@ -4946,10 +5065,11 @@ Replace me with a better (and more) example! @cindex mode, troff @cindex nroff mode @cindex mode, nroff -@Deffn{Request, po, [@var{offset}]} -@Deffnx{Request, po, +offset} -@Deffnx{Request, po, -offset} -Set horizontal page offset to @var{offset} (resp.@: increment or +@Defreq{po, [@var{offset}]} +@Defreqx{po, +offset} +@Defreqx{po, -offset} +@Defregx{.o} +Set horizontal page offset to @var{offset} (or increment or decrement the current value by @var{offset}). Note that this request does not cause a break, so changing the page offset in the middle of text being filled may not yield the expected result. The initial value @@ -4958,7 +5078,6 @@ Nroff Mode}); the default scaling indicator is@w{ }@code{m} (and not@w{ }@code{v} as incorrectly documented in the original @acronym{UNIX} troff manual). -@vindex .o The current page offset can be found in the built-in number register @samp{.o}. @@ -4976,12 +5095,13 @@ the previous value before the last call to @code{po}. \n[.o] @result{} 720 @end example -@end_Deffn +@end_Defreq -@Deffn{Request, in, [@var{indent}]} -@Deffnx{Request, in, +indent} -@Deffnx{Request, in, -indent} -Set indentation to @var{indent} (resp.@: increment or decrement the +@Defreq{in, [@var{indent}]} +@Defreqx{in, +indent} +@Defreqx{in, -indent} +@Defregx{.i} +Set indentation to @var{indent} (or increment or decrement the current value by @var{indent}). This request causes a break. Initially, there is no indentation. @@ -4998,14 +5118,14 @@ indentation to zero. The effect of @code{in} is delayed until a partially collected line (if it exists) is output. A temporary indent value is reset to zero also. -@vindex .i The current indentation (as set by @code{in}) can be found in the built-in number register @samp{.i}. -@end_Deffn +@end_Defreq -@Deffn{Request, ti, offset} -@Deffnx{Request, ti, +offset} -@Deffnx{Request, ti, -offset} +@Defreq{ti, offset} +@Defreqx{ti, +offset} +@Defreqx{ti, -offset} +@Defregx{.in} Temporarily indent the next output line by @var{offset}. If an increment or decrement value is specified, adjust the temporary indentation relative to the value set by the @code{in} request. @@ -5023,19 +5143,20 @@ normal indentation, if @var{offset} is given as a relative value. The effect of @code{ti} is delayed until a partially collected line (if it exists) is output. -@vindex .in The number register @code{.in} is the indentation that applies to the current output line. The difference between @code{.i} and @code{.in} is that the latter takes into account whether a partially collected line still uses the old -indentation value resp.@: a temporary indentation value is active. -@end_Deffn - -@Deffn{Request, ll, [@var{length}]} -@Deffnx{Request, ll, +length} -@Deffnx{Request, ll, -length} -Set the line length to @var{length} (resp.@: increment or decrement the +indentation value or a temporary indentation value is active. +@end_Defreq + +@Defreq{ll, [@var{length}]} +@Defreqx{ll, +length} +@Defreqx{ll, -length} +@Defregx{.l} +@Defregx{.ll} +Set the line length to @var{length} (or increment or decrement the current value by @var{length}). Initially, the line length is set to 6.5@dmn{i}. The effect of @code{ll} is delayed until a partially collected line (if it exists) is output. The default scaling indicator @@ -5048,8 +5169,6 @@ warning of type @samp{range} and sets the line length to zero. The line length is associated with the current environment. -@vindex .l -@vindex .ll @cindex current line length register The current line length (as set by @code{ll}) can be found in the built-in number register @code{.l}. The number register @code{.ll} is @@ -5058,7 +5177,7 @@ the line length that applies to the current output line. Similar to @code{.i} and @code{.in}, the difference between @code{.l} and @code{.ll} is that the latter takes into account whether a partially collected line still uses the old line length value. -@end_Deffn +@end_Defreq @c ===================================================================== @@ -5073,14 +5192,14 @@ page layout. @cindex page length @cindex length of page -@Deffn{Request, pl, [@var{length}]} -@Deffnx{Request, pl, +length} -@Deffnx{Request, pl, -length} -Set the @dfn{page length} to @var{length} (resp.@: increment or +@Defreq{pl, [@var{length}]} +@Defreqx{pl, +length} +@Defreqx{pl, -length} +@Defregx{.p} +Set the @dfn{page length} to @var{length} (or increment or decrement the current value by @var{length}). This is the length of the physical output page. The default scaling indicator is@w{ }@code{v}. -@vindex .p @cindex current page length register The current setting can be found in the built-in number register @samp{.p}. @@ -5096,7 +5215,7 @@ further information on how to do this. Negative @code{pl} values are possible also, but not very useful: No trap is sprung, and each line is output on a single page (thus suppressing all vertical spacing). -@end_Deffn +@end_Defreq @cindex headers @cindex footers @@ -5106,44 +5225,55 @@ and bottom titles (or headers and footers). @cindex title line @cindex three-part title -@findex tl -@vindex % -The @code{tl} request will print a @dfn{title line}, which consists of +@Defreq{tl, 'left'center'right'} +@Defregx{%} +The @code{tl} request prints a @dfn{title line}, which consists of three parts: a left justified portion, a centered portion and a right justified portion. The argument to @code{tl} is specified as @code{'@var{left}'@var{center}'@var{right}'}. The @samp{%} character is replaced with the current page number. This character can be changed with the @code{pc} request (see below). +@end_Defreq @cindex length of title line @cindex title line, length -@findex lt -@vindex .lt @cindex current title line length register +@Defreq{lt, [@var{length}]} +@Defreqx{lt, +length} +@Defreqx{lt, -length} +@Defregx{.lt} The title line is printed using its own line length, which is specified -with the @code{lt} request. The current setting of this is available in -the @code{.lt} number register. +(or incremented or decremented) with the @code{lt} request. Initially, +the title line length is set to 6.5@dmn{i}. The current setting of this +is available in the @code{.lt} number register. + +If @code{lt} is called without an argument, the title length is reset to +the previous value before the last call to @code{lt}. The default +scaling indicator is@w{ }@code{m}. +@end_Defreq @cindex page number @cindex number, page -@findex pn -The @code{pn} request will change the page number of the @emph{next} +@Defreq{pn, page} +@Defregx{.pn} +The @code{pn} request changes the page number of the @emph{next} page. The only argument is the page number. @vindex % -@vindex .pn @cindex current page number register The current page number is stored in the number register @code{%}. The number register @code{.pn} contains the number of the next page: either the value set by a @code{pn} request, or the number of the current page plus@w{ }1. +@end_Defreq @cindex changing the page number character @cindex page number character, changing -@findex pc -The @code{pc} request will change the page number character (used by the +@Defreq{pc, char} +The @code{pc} request changes the page number character (used by the @code{tl} request) to a different character. With no argument, this mechanism is disabled. +@end_Defreq @xref{Traps}. @@ -5155,11 +5285,11 @@ mechanism is disabled. @cindex page control @cindex control, page -@findex bp -@findex pn +@rqindex bp +@rqindex pn @cindex new page To stop processing the current page, and move to the next page, invoke -the @code{bp} request. This request will also cause a break. It can +the @code{bp} request. This request also causes a break. It can also take an argument of what the next page should be numbered. The only difference between @code{bp} and @code{pn} is that @code{pn} does not cause a break or actually eject a page. @@ -5174,11 +5304,11 @@ not cause a break or actually eject a page. @end example @cindex orphan -@findex ne +@Defreq{ne, space} It is often necessary to force a certain amount of space before a new page occurs. This is most useful to make sure that there is not a single @dfn{orphan} line left at the bottom of a page. The @code{ne} -request will ensure that there is a certain distance, specified by the +request ensures that there is a certain distance, specified by the first argument, before the next page is triggered (see @ref{Traps}, for further information). The default unit for @code{ne} is @code{v} and the default argument is@w{ }1@dmn{v}. @@ -5191,16 +5321,18 @@ do the following before each paragraph: .ti +5n text @end example +@end_Defreq -@findex sv -@findex os -@findex ne +@rqindex os +@rqindex ne +@Defreq{sv, space} @code{sv} is similar to the @code{ne} request; it reserves the specified amount of vertical space. If the desired amount of space exists before -the next trap (bottom page boundary), the space will be output +the next trap (bottom page boundary), the space is output immediately. If there is not enough space, it is stored for later output via the @code{os} request. The default argument is@w{ }1@dmn{v} and the default unit is @code{v}. +@end_Defreq @c ===================================================================== @@ -5209,11 +5341,12 @@ and the default unit is @code{v}. @section Fonts @cindex fonts -@findex ft -@findex \f -@code{gtroff} has the ability to switch fonts at any point in the text. -There are two ways to do this, via the @code{ft} request and the -@code{\f} escape. +@code{gtroff} can switch fonts at any point in the text. + +@Defreq{ft, font} +@Defescx{\\f, font} +The @code{ft} request and the @code{\f} escape change the +current font to @samp{font}. Fonts are generally specified as upper-case strings, which are usually 1@w{ }to 4 characters representing an abbreviation or acronym of the font @@ -5224,14 +5357,16 @@ These are Times Roman, Italic, Bold, and Bold Italic. There is also at least one symbol font which contains various special symbols (Greek, mathematics). Such symbols fonts cannot be used directly, but should be used via an escape. +@c XXX should we list PostScript fonts here too? +@end_Defreq @menu -* Changing Fonts:: -* Font Families:: -* Font Positions:: -* Using Symbols:: -* Artificial Fonts:: -* Ligatures and Kerning:: +* Changing Fonts:: +* Font Families:: +* Font Positions:: +* Using Symbols:: +* Artificial Fonts:: +* Ligatures and Kerning:: @end menu @c --------------------------------------------------------------------- @@ -5241,12 +5376,12 @@ used via an escape. @cindex changing fonts @cindex fonts, changing -@findex ft +@rqindex ft @cindex previous font @cindex font, previous -Font changes can be done either with the @code{ft} request or the -@code{\f} request. With no arguments, it will switch to the previous -font (also known as @samp{P}). +Use the @code{ft} request or the @code{\f} request to change fonts. +With no arguments, @code{.ft} switches to the previous +font (use @code{\fP} to do this with an escape). @example eggs, bacon, @@ -5256,8 +5391,8 @@ spam and sausage. @end example -@findex \f -The @code{\f} escape is useful for changing fonts in the middle of +@esindex \f +Use the @code{\f} escape to change fonts in the middle of words: @example @@ -5265,22 +5400,22 @@ eggs, bacon, \fBspam\fP and sausage. @end example @noindent -Both of the above examples will produce the same output. Note the usage -of @samp{P} to indicate the previous font -- using @code{\f} it is not -possible to omit this parameter. +Both of the above examples produce the same output. Note the usage +of @samp{P} to indicate the previous font -- this cannot be omitted +using @code{\f}. -Sometimes, when putting letters of different fonts, more or less space at +Sometimes, when typesetting letters of different fonts, more or less space at such boundaries are needed. There are two escapes to help with this. -@findex \/ @cindex italic correction @cindex correction, italic +@Defesc{\\/, } The @code{\/} escape increases the width of the preceding character so -that the spacing between that character and the following character will -be correct if the following character is a Roman character. For +that the spacing between that character and the following character is +correct if the following character is a Roman character. For example, if an italic@w{ }f is immediately followed by a Roman right -parenthesis, then in many fonts the top right portion of the f will -overlap the top left of the right parenthesis. It is a good idea to use +parenthesis, then in many fonts the top right portion of the @code{f} +overlaps the top left of the right parenthesis. Use this escape sequence whenever an italic character is immediately followed by a Roman character without any intervening space. This small amount of space is also called @dfn{italic correction}. @@ -5288,14 +5423,15 @@ amount of space is also called @dfn{italic correction}. @c XXX example @c producing @i{f}), which is ugly. Inserting \/ produces f) and avoids @c this problem. +@end_Defesc -@findex \, @cindex left italic correction @cindex correction, left italic +@Defesc{\\\,, } The @code{\,} escape modifies the spacing of the following character so -that the spacing between that character and the preceding character will -be correct if the preceding character is a Roman character. It is a -good idea to use this escape sequence whenever a Roman character is +that the spacing between that character and the preceding character is +correct if the preceding character is a Roman character. +Use this escape sequence whenever a Roman character is immediately followed by an italic character without any intervening space. In analogy to above, this space could be called @dfn{left italic correction}, but this term isn't used widely. @@ -5303,19 +5439,20 @@ correction}, but this term isn't used widely. @c XXX example @c For example, inserting \, between the parenthesis and the f changes @c (f to (f. - -@findex ftr -@findex ft -@findex ul -@findex bd -@findex \f -@findex cs -@findex tkf -@findex special -@findex fspecial -@findex fp -@findex code -The @code{ftr} request will translate fonts; its syntax is +@end_Defesc + +@rqindex ft +@rqindex ul +@rqindex bd +@esindex \f +@rqindex cs +@rqindex tkf +@rqindex special +@rqindex fspecial +@rqindex fp +@rqindex code +@Defreq{ftr, F G} +The @code{ftr} request translates fonts; its syntax is @example .ftr @var{F} @var{G} @@ -5326,8 +5463,9 @@ which translates font@w{ }@var{F} to font@w{ }@var{G}. Whenever a font named @var{F} is referred to in a @code{\f} escape sequence, or in the @code{ft}, @code{ul}, @code{bd}, @code{cs}, @code{tkf}, @code{special}, @code{fspecial}, @code{fp}, or @code{code} requests, font@w{ }@var{G} -will be used. If @var{G} is missing, or equal to @var{F} then font@w{ -}@var{F} will not be translated. +is used. If @var{G} is missing, or equal to @var{F} then font@w{ +}@var{F} is not translated. +@end_Defreq @c --------------------------------------------------------------------- @@ -5341,16 +5479,16 @@ concept of font families. Each of these families has four styles (@samp{R}, @samp{I}, @samp{B} and @samp{BI}). The fonts are specified as the concatenation of the font family and -style. Specifying a font without the family part will cause +style. Specifying a font without the family part causes @code{gtroff} to use that style of the current family. By default, @code{gtroff} uses the Times family. This way, it is possible to use the basic four fonts and to select a different font family on the command line. -@findex fam -@vindex .fam -Font families can be switched with the @code{fam} request. The current +@Defreq{fam, family} +@Defregx{.fam} +Switch font families with the @code{fam} request. The current font family is available in the number register @code{.fam}. This is a string-valued register. @@ -5367,6 +5505,7 @@ baked beans, .ft R and spam. @end example +@end_Defreq @c --------------------------------------------------------------------- @@ -5380,7 +5519,9 @@ of @code{troff}, @code{gtroff} has the concept of font @dfn{positions}, on which various fonts are mounted. The last one or two are reserved for the symbol font(s). -@findex fp +@Defreq{fp, pos font [@var{external-name}]} +@Defregx{.f} +@Defregx{.fp} New fonts can be mounted with the @code{fp} request. These numeric positions can then be referred to with font changing commands. When @code{gtroff} starts it is using font number one. @@ -5402,7 +5543,6 @@ say no more! Note that after these font changes have taken place, the original font is restored. -@vindex .f @cindex current font position register The current font in use, as a font position, is available in number register @code{.f}. This can be useful to remember the current font, @@ -5414,7 +5554,6 @@ for later recall. .ft \n[save-font] @end example -@vindex .fp @cindex next free font position register The number of the next free font position is available in the number register @code{.fp}. This is useful when mounting a new font, like so: @@ -5429,18 +5568,19 @@ the next available font position when they are referenced. If a font is to be mounted explicitly with the @code{fp} request on an unused font position, it should be mounted on the first unused font position, which can be found in the @code{.fp} register. Although @code{gtroff} does -not enforce this strictly, it will not allow a font to be mounted at a +not enforce this strictly, it does not allow a font to be mounted at a position whose number is much greater than that of any currently used position. -@findex fp +@rqindex fp The @code{fp} request has an optional third argument. This argument gives the external name of the font, which is used for finding the font description file. The second argument gives the internal name of the font which is used to refer to the font in @code{gtroff} after it has -been mounted. If there is no third argument then the internal name will -be used as the external name. This feature make it possible to use +been mounted. If there is no third argument then the internal name is +used as the external name. This feature makes it possible to use fonts with long names in compatibility mode. +@end_Defreq @c --------------------------------------------------------------------- @@ -5449,8 +5589,8 @@ fonts with long names in compatibility mode. @cindex using symbols @cindex symbols, using -@findex \( -@findex \[ +@esindex \( +@esindex \[ Symbols can be inserted by using a special escape sequence. This escape is simply the escape character (usually a backslash) followed by an identifier. The symbol identifiers have to be two or more characters, @@ -5464,24 +5604,26 @@ or @code{\[*p]}. area = \(*p\fIr\fP\u2\d @end example -@findex \C -The escape @code{\C'@var{xxx}'} will typeset the character named +@Defesc{\\C, xxx} +The escape @code{\C'@var{xxx}'} typesets the character named @var{xxx}. Normally it is more convenient to use @code{\[@var{xxx}]}. But @code{\C} has the advantage that it is compatible with recent versions of @code{ditroff} and is available in compatibility mode. +@end_Defesc -@findex \N -@findex char -The escape @code{\N'@var{n}'} will typeset the character with code@w{ +@rqindex char +@Defesc{\\N, n} +The escape @code{\N'@var{n}'} typesets the character with code@w{ }@var{n} in the current font. @var{n} can be any integer. Most devices only have characters with codes between 0 and@w{ }255. If the current -font does not contain a character with that code, special fonts will -@emph{not} be searched. The @code{\N} escape sequence can be -conveniently used on conjunction with the @code{char} request: +font does not contain a character with that code, special fonts are +@emph{not} searched. The @code{\N} escape sequence can be +conveniently used in conjunction with the @code{char} request: @example .char \[phone] \f(ZD\N'37' @end example +@end_Defesc @noindent @pindex DESC @@ -5494,7 +5636,7 @@ unnamed characters in the font description file by using a name of @c XXX should be `glyph', not `character' -@findex cflags +@rqindex cflags @cindex character properties @cindex properties of characters Each character has certain properties associated with it. These @@ -5546,17 +5688,17 @@ this property) @glindex dg @glindex rq an end of sentence character followed by any number of characters with -this property will be treated as the end of a sentence if followed by a +this property is treated as the end of a sentence if followed by a newline or two spaces; in other words the character is @dfn{transparent} for the purposes of end of sentence recognition -- this is the same as having a zero space factor in @TeX{} (initially characters @samp{"')]*\(dg\(rq} have this property). @end table -@findex char @cindex defining characters @cindex characters, defining @cindex creating new characters +@Defreq{char, c string} New characters can be created with the @code{char} request. It is called as @@ -5564,18 +5706,18 @@ called as .char @var{c} @var{string} @end example -@findex tr -@findex lc -@findex \l -@findex \L -@findex hcode +@rqindex tr +@rqindex lc +@esindex \l +@esindex \L +@rqindex hcode @noindent This defines character@w{ }@var{c} to be @var{string}. Every time -character@w{ }@var{c} needs to be printed, @var{string} will be -processed in a temporary environment and the result will be wrapped up -into a single object. Compatibility mode will be turned off and the -escape character will be set to @samp{\} while @var{string} is being -processed. Any emboldening, constant spacing or track kerning will be +character@w{ }@var{c} needs to be printed, @var{string} is +processed in a temporary environment and the result is wrapped up +into a single object. Compatibility mode is turned off and the +escape character is set to @samp{\} while @var{string} is being +processed. Any emboldening, constant spacing or track kerning is applied to this object rather than to individual characters in @var{string}. A character defined by this request can be used just like a normal character provided by the output device. In particular other @@ -5585,15 +5727,17 @@ can be drawn with the character using the @code{\l} and @code{\L} escape sequences; words containing the character can be hyphenated correctly, if the @code{hcode} request is used to give the character a hyphenation code. There is a special anti-recursion feature: use of character -within the character's definition will be handled like normal characters +within the character's definition is handled like normal characters not defined with @code{char}. +@end_Defreq -@findex rchar @cindex removing character definition @cindex character, removing definition +@Defreq{rchar, def} A character definition can be removed with the @code{rchar} request. Its arguments are the characters to be removed. This undoes the effect of a @code{char} request. +@end_Defreq @xref{Special Characters}. @@ -5605,39 +5749,45 @@ of a @code{char} request. @cindex fonts, artificial There are a number of requests for artificially creating fonts. These -are largely vestigial remains from the days when output devices did not +are largely vestiges of the days when output devices did not have a wide variety of fonts, and when @code{nroff} and @code{troff} were separate programs. These are no longer necessary in GNU @code{troff}. -@findex ul @cindex underlining -The @code{ul} request will print subsequent lines in italics on a device -capable of it, or underline the text on a character output device. The +@Defreq{ul, lines} +The @code{ul} request prints subsequent lines in italics on a device +capable of it, or underlines the text on a character output device. The single argument is the number of lines to be ``underlined,'' with no -argument, the next line will be underlined. +argument, the next line is underlined. +The @code{ul} request does not underline spaces. +@end_Defreq -@findex cu @cindex continuous underlining @cindex underlining, continuous -The @code{cu} request is similar to @code{ul} ... +@Defreq{cu, lines} +The @code{cu} request is similar to @code{ul} +but underlines spaces as well. +@end_Defreq @c XXX more info -@findex uf @cindex underline font @cindex font for underlining -The @code{uf} request will set the underline font used by @code{ul} and +@Defreq{uf, font} +The @code{uf} request sets the underline font used by @code{ul} and @code{cu}. +@end_Defreq -@findex bd @cindex imitating bold face @cindex bold face, imitating +@Defreq{bd, font offset} The @code{bd} request artificially creates a bold font by printing each character twice, slightly offset. The first argument specifies the font to embolden, and the second is the number of basic units, minus one, by -which the two characters will be offset. If the second argument is -missing, emboldening will be turned off. +which the two characters is offset. If the second argument is +missing, emboldening is turned off. +@end_Defreq @c --------------------------------------------------------------------- @@ -5646,63 +5796,82 @@ missing, emboldening will be turned off. @cindex ligatures and kerning @cindex kerning and ligatures -@c XXX What are ligatures? +Ligatures are groups of characters that are run together. +For example, look at the letters @code{f} and @code{i} +in the word "file." +This produces a cleaner look (albeit subtle) to the printed output. -@c XXX more info +Most PostScript fonts support the fi and fl ligatures. +The C/A/T typesetter that was the target of AT&T @code{troff} +also supported ff, ffi, and ffl ligatures. +Advanced typesetters or "expert" fonts may include ligatures +for ft and ct, although GNU @code{troff} does not support these yet. + +@c XXX more info -> nroff mode -@findex lg -@vindex .lg @cindex ligatures enabled register +@Defreq{lg, [@var{flag}]} +@Defregx{.lg} The ligature mechanism can be switched on or off with the @code{lg} request; 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 number register @code{.lg} (set to@w{ }1 if ligatures are enabled, 0@w{ }otherwise). -@c XXX What is kerning? +Setting the ligature mode to@w{ }2 enables the two-character +ligatures (fi, fl, and ff) and disables the three-character +ligatures (ffi and ffl). +@end_Defreq + +@dfn{Pairwise kerning} is another subtle typesetting mechanism +that moves characters closer together when space permits. +@iftex +For example, look at the letters @code{T} and @code{a} +in the word "Tape." +The @code{a} is tucked slightly under the @code{T}. +@end iftex @c XXX more info +@cindex kerning enabled register +@Defreq{kern, [@var{flag}]} +@Defregx{.kern} +@Defescx{\\&, } +Kerning can be activated with the @code{kern} request. If the parameter +is non-zero or missing, enable pairwise kerning, otherwise disable it. +The number register @code{.kern} is set to@w{ }1 if pairwise kerning is +enabled, 0@w{ }otherwise. @cindex zero width space character @cindex character, zero width space @cindex space character, zero width If the font description file contains pairwise kerning information, -characters from that font will be kerned. Kerning between two +characters from that font are kerned. Kerning between two characters can be inhibited by placing @code{\&} between them. +@end_Defreq -@findex kern -@vindex .kern -@cindex kerning enabled register -Kerning can be activated with the @code{kern} request. If the parameter -is non-zero or missing, enable pairwise kerning, otherwise disable it. -The number register @code{.kern} is set to@w{ }1 if pairwise kerning is -enabled, 0@w{ }otherwise. -@findex tkf @cindex track kerning @cindex kerning, track - -@c XXX What is track kerning? - +Track kerning expands or reduces the space between characters. +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. @c XXX more info Track kerning must be used with great care since it is usually -considered bad typography if the reader notices the effect. The syntax -of the @code{tkf} request is like this: - -@example -.tkf @var{f} @var{s1} @var{n1} @var{s2} @var{n2} -@end example +considered bad typography if the reader notices the effect. -@noindent +@Defreq{tkf, f s1 n1 s2 n2} Enable track kerning for font@w{ }@var{f}. If the current font is@w{ -}@var{f} the width of every character will be increased by an amount +}@var{f} the width of every character is increased by an amount between @var{n1} and @var{n2}; if the current point size is less than or -equal to @var{s1} the width will be increased by @var{n1}; if it is -greater than or equal to @var{s2} the width will be increased by +equal to @var{s1} the width is increased by @var{n1}; if it is +greater than or equal to @var{s2} the width is increased by @var{n2}; if the point size is greater than or equal to @var{s1} and less than or equal to @var{s2} the increase in width is a linear function of the point size. +@c XXX can n1 or n2 be negative? +@end_Defreq @c ===================================================================== @@ -5722,7 +5891,7 @@ vertical spacing. The @dfn{type size} is the height from the text below this baseline). @dfn{Vertical spacing} is the amount of space @code{gtroff} allows for a line of text; normally, this is about 20%@w{ }larger than the current type size. Ratios smaller than this can result -in hard-to-read text; larger that this, it will spread the text out more +in hard-to-read text; larger than this, it spreads the text out more vertically (useful for term papers). By default, @code{gtroff} uses 10@w{ }point type on 12@w{ }point spacing. @@ -5731,8 +5900,8 @@ The difference between type size and vertical spacing is known, by typesetters, as @dfn{leading}. @menu -* Changing Type Sizes:: -* Fractional Type Sizes:: +* Changing Type Sizes:: +* Fractional Type Sizes:: @end menu @c --------------------------------------------------------------------- @@ -5742,23 +5911,17 @@ typesetters, as @dfn{leading}. @cindex changing type sizes @cindex type sizes, changing -@findex ps -@findex vs -@findex \s -@vindex .s -@vindex .v -@cindex current type size register -@cindex current vertical spacing register -Using the @code{ps} request and the @code{\s} escape the type size can -be changed. The @code{vs} request will change the vertical spacing. -The default unit for the @code{ps} and @code{vs} requests are points. -The number registers @code{.s} and @code{.v} contain the current type -size and vertical spacing. +@Defreq{ps, [@var{size}]} +@Defescx{\\s, size} +@Defregx{.s} +Use the @code{ps} request or the @code{\s} escape to +change the type size (in points). Specify the @var{size} as either +an absolute point size, or as a relative change from the +current size. The size@w{ }0, or no argument, goes back to +the previous size. -These requests take parameters in units of points. It is possible to -specify sizes as an absolute size, or as a relative change from the -current size. The size@w{ }0 means go back to the previous size. With -no argument it will also revert to the previous size. +The number register @code{.s} returns the point size in points +as a decimal fraction. @example snap, snap, @@ -5780,7 +5943,7 @@ or in the range 4 to@w{ }39. @item \s+@var{n} @itemx \s-@var{n} -Increase resp.@: decrease the point size by @var{n}@w{ }points. +Increase or decrease the point size by @var{n}@w{ }points. @var{n}@w{ }must be exactly one digit. @item \s(@var{nn} @@ -5791,7 +5954,7 @@ digits. @itemx \s-(@var{nn} @itemx \s(+@var{nn} @itemx \s(-@var{nn} -Increase resp.@: decrease the point size by @var{nn}@w{ }points. +Increase or decrease the point size by @var{nn}@w{ }points. @var{nn} must be exactly two digits. @end table @@ -5799,7 +5962,17 @@ Increase resp.@: decrease the point size by @var{nn}@w{ }points. the @code{\s} escape. Some devices may only have certain permissible sizes, in which case -@code{gtroff} will round to the nearest permissible size. +@code{gtroff} rounds to the nearest permissible size. +@end_Defreq + +@cindex current type size register +@cindex current vertical spacing register +@Defreq{vs, space} +@Defregx{.v} +Changes the vertical spacing. The default unit is points. + +The number register @code{.v} contains the current vertical spacing. +@end_Defreq @c XXX example @@ -5820,11 +5993,11 @@ Some devices may only have certain permissible sizes, in which case @cindex unit, @code{s} @cindex @code{z} unit @cindex unit, @code{z} -@findex ps -@findex cs -@findex tkf -@findex \H -@findex \s +@rqindex ps +@rqindex cs +@rqindex tkf +@esindex \H +@esindex \s A @dfn{scaled point} is equal to 1/@var{sizescale} points, where @var{sizescale} is specified in the @file{DESC} file (1@w{ }by default.) There is a new scale indicator @samp{z} which has the effect of @@ -5839,13 +6012,14 @@ variants of the @code{\s} escape sequence that take a numeric expression as their argument (see below). For example, suppose @var{sizescale} is@w{ }1000; then a scaled point -will be equivalent to a millipoint; the request @w{@samp{.ps 10.25}} is +is equivalent to a millipoint; the request @w{@samp{.ps 10.25}} is equivalent to @w{@samp{.ps 10.25z}} and thus sets the point size to 10250@w{ }scaled points, which is equal to 10.25@w{ }points. -It would make no sense to use the @samp{z} scale indicator in a numeric +@code{gtroff} disallows the use of the @samp{z} scale indicator in +instances where it would make no sense, such as a numeric expression whose default scale indicator was neither @samp{u} nor -@samp{z}, and so @code{gtroff} disallows this. Similarly it would make +@samp{z}. Similarly it would make no sense to use a scaling indicator other than @samp{z} or @samp{u} in a numeric expression whose default scale indicator was @samp{z}, and so @code{gtroff} disallows this as well. @@ -5856,18 +6030,21 @@ equal to @samp{1m}. Be sure not to confuse the @samp{s} and @samp{z} scale indicators. @vindex .s -@vindex .ps -The number register @code{.s} returns the point size in points as decimal -fraction. There is also a new number register @code{.ps} that returns -the point size in scaled points. +@Defreg{.ps} +Returns the point size in scaled points. +@end_Defreg -@vindex .psr -@vindex .sr @cindex last-requested point size register +@Defreg{.psr} +@Defregx{.sr} The last-requested point size in scaled points is contained in the @code{.psr} number register. The last requested point size in points as a decimal fraction can be found in @code{.sr}. This is a string-valued register. +@end_Defreg + +The \\s escape has the following syntax for working with +fractional type sizes: @table @code @item \s[@var{n}] @@ -5883,7 +6060,7 @@ expression with a default scale indicator of @samp{z}. @itemx \s'-@var{n}' @itemx \s+'@var{n}' @itemx \s-'@var{n}' -Increase or resp.@: decrease the point size by @var{n} scaled points; +Increase or or decrease the point size by @var{n} scaled points; @var{n} is a numeric expression with a default scale indicator of @samp{z}. @end table @@ -5897,27 +6074,30 @@ Increase or resp.@: decrease the point size by @var{n} scaled points; @section Strings @cindex strings -@findex ds @code{gtroff} has string variables, which are entirely for user -convenience (i.e.@: there are no built-in strings). They are defined -via the @code{ds} request. +convenience (i.e.@: there are no built-in strings). + +@Defreq{ds, name string} +@Defescx{\\*, name} +Defines a string variable. @example .ds UX \s-1UNIX\s0\u\s-3tm\s0\d @end example -@findex \* +@esindex \* @cindex string interpolation @cindex string expansion @cindex interpolation of strings @cindex expansion of strings -They are interpolated, or expanded in-place, via the @code{\*} escape: +Use the @code{\*} escape to @dfn{interpolate}, or expand in-place, +a previously-defined string variable. @example The \*(UX Operating System @end example -If the string named by the @code{\*} does not exist, the escape will be +If the string named by the @code{\*} does not exist, the escape is replaced by nothing. @cindex comments, with @code{ds} @@ -5950,86 +6130,96 @@ your string. .ds sign " Yours in a white wine sauce, @end example -@findex as -@cindex appending to strings -@cindex strings, appending -The @code{as} request will append a string to another string. It works -similar to the @code{ds} request except that it appends the second -argument onto the string named by the first argument. - -@example -.as sign " with shallots, onions and garlic, -@end example - -@findex \@key{RET} +@esindex \@key{RET} @cindex multi-line strings @cindex strings, multi-line @cindex newline character in strings, escaping @cindex escaping newline characters in strings Strings are not limited to a single line of text. A string can span several lines by escaping the newlines with a backslash. The resulting -string will be stored @emph{without} the newlines. +string is stored @emph{without} the newlines. @example .ds foo lots and lots \ of text are on these \ next several lines @end example +@end_Defreq -@findex substring -@cindex substrings -Rudimentary string manipulation routines are given with the -@code{substring} and @code{length} requests. The former has the -following syntax: +@cindex appending to strings +@cindex strings, appending +@Defreq{as, name string} +The @code{as} request appends a string to another string. It is +similar to the @code{ds} request except that it appends the second +argument onto the string named by the first argument. @example -.substring @var{xx} @var{n1} [@var{n2}] +.as sign " with shallots, onions and garlic, @end example +@end_Defreq -@noindent -It replaces the string in register@w{ }@var{xx} with the substring +@cindex substrings +@Defreq{substring, xx n1 [@var{n2}]} +@Defreqx{length, xx string} +Rudimentary string manipulation routines are given with the +@code{substring} and @code{length} requests. + +The @code{substring} request +replaces the string in register@w{ }@var{xx} with the substring defined by the indices @var{n1} and@w{ }@var{n2}. The first character in the string has index one. If @var{n2} is omitted, it is taken to be equal to the string's length. If the index value @var{n1} or @var{n2} -is negative or zero, it will be counted from the end of the string, +is negative or zero, it is counted from the end of the string, going backwards: The last character has index@w{ }0, the character before the last character has index@w{ }-1, etc. -@findex length @cindex length of a string @cindex string, length of Here the syntax of the @code{length} request: -@example -.length @var{xx} @var{string} -@end example - -@noindent -It computes the length of @var{string} and returns it in the number +The @code{length} request +computes the length of @var{string} and returns it in the number register@w{ }@var{xx} (which is not necessarily defined before). - -@ignore -@findex rn -@code{rn} - -@c XXX - -@findex rm -@code{rm} - -@c XXX - -@findex als -@code{als} - -@c XXX - -@findex chop -@code{chop} - -@c XXX -@end ignore - +@end_Defreq + +@cindex rename request +@cindex rename macro +@cindex rename string +@Defreq{rn, xx yy} +Renames the request, macro, or string @var{xx} to @var{yy}. +@end_Defreq + +@cindex remove request +@cindex remove macro +@cindex remove string +@Defreq{rm, xx} +Removes the request, macro, or string @var{xx}. +@code{gtroff} treats subsequent invocations as if the +object had never been defined. +@end_Defreq + +@cindex alias +@Defreq{als, new old} +Create an alias named @var{new} for the request, string, +macro, or diversion object named @var{old}. The new name and +the old name are exactly equivalent (it is similar to a hard +rather than a soft link). If @var{old} is undefined, +@code{gtroff} generates a warning of type @b{mac} and ignores +the request. + +The @code{de}, @code{am}, @code{di}, @code{da}, @code{ds}, +and @code{as} requests only create a new object if the name +of the macro, diversion or string diversion is currently +undefined or if it is defined to be a request; normally +they modify the value of an existing object. +@end_Defreq + +@Defreq{chop, xx} +Remove (chop) the last character from the macro, string, +or diversion named @var{xx}. This is useful for removing +the newline from the end of diversions that are to be +interpolated as strings. +@end_Defreq @xref{Identifiers}, and @ref{Comments}. @@ -6041,8 +6231,10 @@ register@w{ }@var{xx} (which is not necessarily defined before). @cindex conditionals and loops @cindex loops and conditionals -@findex if@r{, operators to use with it} -@findex while@r{, operators to use with it} +@rqindex if +@rqindex while +@cindex @code{if}, operators to use with it +@cindex @code{while}, operators to use with it In @code{if} and @code{while} requests, there are several more operators available: @@ -6052,18 +6244,18 @@ available: True if the current page is even or odd numbered (respectively). @item n -@findex nroff +@rqindex nroff True if the document is being processed in nroff mode. @item t -@findex troff +@rqindex troff True if the document is being processed in troff mode. @item "@var{xxx}"@var{yyy}" True if the string @var{xxx} is equal to the string @var{yyy}. Other characters can be used in place of the double quotes. @c XXX which characters? -The strings are ``formatted'' before being compared; for example, +@code{gtroff} formats the strings before being compared; for example, @example .ie "|"\fR|\fP" \ @@ -6087,16 +6279,18 @@ True if there is a number register named @var{xxx}. True if there is a string, macro, diversion, or request named @var{xxx}. @item c@var{ch} -@findex char +@rqindex char True if there is a character @var{ch} available; @var{ch} is either an @acronym{ASCII} character or a special character (@code{\(@var{ch}} or -@code{\[@var{ch}]}); the condition will also be true if @var{ch} has +@code{\[@var{ch}]}); the condition is also true if @var{ch} has been defined by the @code{char} request. @end table +@xref{Expressions}. + @menu -* if-else:: -* while:: +* if-else:: +* while:: @end menu @c --------------------------------------------------------------------- @@ -6108,17 +6302,10 @@ been defined by the @code{char} request. @code{gtroff} has if-then-else constructs like other languages, although the formatting can be painful. -@findex if -The @code{if} request has the following syntax: - -@example -.if @var{expr} @var{anything} -@end example - -@noindent -where @var{expr} is the expression to be evaluated; @var{anything} (the -remainder of the line) will be executed if @var{expr} evaluates to -non-zero (true). @var{anything} will be interpreted as though it was on +@Defreq{if, expr anything} +Evaluates the expression @var{expr}, and executes @var{anything} (the +remainder of the line) if @var{expr} evaluates to +non-zero (true). @var{anything} is interpreted as though it was on a line by itself. @xref{Expressions}, for more info. Here are some examples: @@ -6127,25 +6314,31 @@ Here are some examples: .if t .ls 2 \" double spacing in troff .if 0 .ab how'd this happen? @end example +@end_Defreq @c XXX .nop request -@findex ie -@findex el -An if-then-else is written using two requests @code{ie} and @code{el}. +@Defreq{ie, expr anything} +@Defreqx{el, anything} +Use the @code{ie} and @code{el} requests to write an if-then-else. The first request is the `if' part and the latter is the `else' part. -@c XXX example - @example -.ie -.el +.ie n .ls 2 \" double spacing in nroff +.el .ls 1 \" single spacing in troff @end example +@end_Defreq + +@c this looks like a bug in makeinfo: you can't have `@{' as an argument +@c to deffn -@findex \@{ -@findex \@} -In many cases more than one request is to be executed as a result of any -of these requests. This can be done using the @code{\@{} and @code{\@}} +@esindex \@{ +@esindex \@} +@c @Defesc{\\@@@{} +@c @Defescx{\\@@@}} +In many cases, an if (or if-else) construct needs to execute +more than one request. +This can be done using the @code{\@{} and @code{\@}} escapes. The following example shows the possible ways to use these escapes (note the position of the opening and closing braces). @@ -6160,6 +6353,7 @@ escapes (note the position of the opening and closing braces). . ds rq "\@} .ds qq " @end example +@c @end_Defesc @xref{Expressions}. @@ -6169,12 +6363,13 @@ escapes (note the position of the opening and closing braces). @subsection while @cindex while -@findex while @code{gtroff} provides a looping construct using the @code{while} request, which is used much like the @code{if} (and related) requests. -The first argument is an expression which will be evaluated. The -@code{while} request will interpret the remainder of the line until the -expression evaluates to 0 or false. + +@Defreq{while, expr anything} +Evaluates the expression @var{expr}, and repeatedly executes +@var{anything} (the remainder of the line) until @var{expr} +evaluates to 0 or false. @example .nr a 0 1 @@ -6192,17 +6387,24 @@ The preceding example produces: @cindex zero width space character @cindex character, zero width space @cindex space character, zero width -@findex \& +@esindex \& @noindent Note the usage of the @code{\&} escape to avoid a control character at the beginning of a line. +@end_Defreq -@findex break@r{, in a @code{while} loop} -@findex continue@r{, in a @code{while} loop} -The @code{break} request will @dfn{break} out of a while loop. Be sure +@rqindex while +@cindex @code{break}, in a @code{while} loop +@cindex @code{continue}, in a @code{while} loop +@Defreq{break, } +@dfn{break} out of a while loop. Be sure not to confuse this with the @code{br} request (causing a line break). -The @code{continue} request will finish the current iteration of a while +@end_Defreq + +@Defreq{continue, } +Finishes the current iteration of a while loop, immediately restarting the next iteration. +@end_Defreq @xref{Expressions}. @@ -6214,16 +6416,17 @@ loop, immediately restarting the next iteration. @cindex writing macros @cindex macros, writing -@findex de A @dfn{macro} is a collection of text and embedded commands which can be -invoked multiple times. Macros are used for defining common operations. -Macros are defined using the @code{de} request. This request takes a -name for the macro as the first argument. Subsequent lines are copied -into an internal buffer until the line @code{..} is encountered. The -optional second argument to @code{de} can change this ending token. - -Here a small example macro called @samp{P} which will cause a break and -the insertion of some vertical space. It could be used to separate +invoked multiple times. Use macros to define common operations. + +@Defreq{de, name [@var{end}]} +Defines a new macro named @var{name}. @code{gtroff} copies +subsequent lines into an internal buffer until it encounters +the line @code{..} (two dots). The +optional second argument to @code{de} changes this ending token. + +Here a small example macro called @samp{P} which causes a break and +inserts some vertical space. It could be used to separate paragraphs. @example @@ -6243,13 +6446,14 @@ paragraphs. @c => test from xxx test @c XXX info about common identifier pool for strings and macros. +@end_Defreq -@findex am @cindex appending, to a macro -The @code{am} request works similarly to @code{de} except it appends -onto the macro named by the first argument. So, to make the previously +@Defreq{am, xx} +Works similarly to @code{de} except it appends +onto the macro named @var{xx}. So, to make the previously defined @samp{P} macro actually do indented instead of block paragraphs, -is is possible to add the necessary code to the existing macro like +add the necessary code to the existing macro like this: @example @@ -6257,17 +6461,27 @@ this: .ti +5n .. @end example +@end_Defreq -@findex als -@cindex aliases, macro -@cindex macro aliases -Macros can be aliased with the @code{als} request. +@cindex alias +@Defreq{als, new old} +Create an alias named @var{new} for the request, string, +macro, or diversion object named @var{old}. The new name and +the old name are exactly equivalent (it is similar to a hard +rather than a soft link). If @var{old} is undefined, +@code{gtroff} generates a warning of type @b{mac} and ignores +the request. -@c XXX example +The @code{de}, @code{am}, @code{di}, @code{da}, @code{ds}, +and @code{as} requests only create a new object if the name +of the macro, diversion or string diversion is currently +undefined or if it is defined to be a request; normally +they modify the value of an existing object. +@end_Defreq @menu -* Copy-in Mode:: -* Parameters:: +* Copy-in Mode:: +* Parameters:: @end menu @c --------------------------------------------------------------------- @@ -6277,14 +6491,19 @@ Macros can be aliased with the @code{als} request. @cindex copy-in mode @cindex mode, copy-in -@findex \n@r{, when reading test for a macro} -@findex \$@r{, when reading test for a macro} -@findex \*@r{, when reading test for a macro} -@findex \\@r{, when reading test for a macro} -@findex \@key{RET}@r{, when reading test for a macro} -When @code{gtroff} reads in the text for a macro or diversion it copies +@esindex \n +@esindex \$ +@esindex \* +@esindex \\ +@esindex \@key{RET} +@cindex @code{\n}, when reading text for a macro +@cindex @code{\$}, when reading text for a macro +@cindex @code{\*}, when reading text for a macro +@cindex @code{\\}, when reading text for a macro +@cindex \@key{RET}, when reading text for a macro +When @code{gtroff} reads in the text for a macro or diversion, it copies the text (including request lines, but excluding escapes) into an -internal buffer. Escapes will be converted into an internal form, +internal buffer. Escapes are converted into an internal form, except for @code{\n}, @code{\$}, @code{\*}, @code{\\} and @code{\@key{RET}} which are evaluated and inserted into the text where the escape was located. This is known as @dfn{copy-in} mode or @@ -6295,8 +6514,7 @@ evaluated (either at copy-in time or at the time of use) by insulating the escapes with an extra backslash. Compare this to the @code{\def} and @code{\edef} commands in @TeX{}. -For example, the following will result in the numbers 20 and@c{ }10 -being printed: +The following example prints the numbers 20 and@w{ }10: @example .nr x 20 @@ -6314,7 +6532,6 @@ being printed: @subsection Parameters @cindex parameters -@findex \$ @vindex .$ The arguments to a macro can be examined using a variety of escapes. The number of arguments is available in the @code{.$} number register. @@ -6322,36 +6539,42 @@ Any individual argument can be retrieved with one of the following escapes: @cindex copy-in mode, and macro arguments +@Defesc{\\$@var{n}, } +@Defescx{\\$(@var{nn}, } +@Defescx{\\$[@var{nnn@dots{}}], } The escapes @code{\$@var{n}}, @code{\$(@var{nn}} and -@code{\$[@var{nnn}]} will result in the @var{n}th, @var{nn}th or +@code{\$[@var{nnn}]} retrieve the @var{n}th, @var{nn}th or @var{nnn}th argument. As usual, the first form only accepts a single -number (larger than zero), the second only a two-digit number (larger or +number (larger than zero), the second a two-digit number (larger or equal to@w{ }10), and the third any positive integer value (larger than zero). Macros can have an unlimited number of arguments. Note that due -to copy-in mode, two backslashes should be used on these in actual use +to copy-in mode, use two backslashes on these in actual use to prevent interpolation until the macro is actually invoked. +@end_Defesc -@findex shift -The request @code{shift} will shift the arguments 1@w{ }position, or as +@Defreq{shift, [@var{n}]} +Shifts the arguments 1@w{ }position, or as many positions as specified by its argument. After executing this -request, argument@w{ }@var{i} will become argument @var{i}-@var{n}; -arguments 1 to@w{ }@var{n} will no longer be available. Shifting by +request, argument@w{ }@var{i} becomes argument @var{i}-@var{n}; +arguments 1 to@w{ }@var{n} are no longer available. Shifting by negative amounts is currently undefined. +@end_Defreq -@findex \$* -@findex \$@@ +@Defesc{\\$*, } +@Defescx{\\$@@, } In some cases it is convenient to use all of the arguments at once (for example, to pass the arguments along to another macro). The @code{\$*} -escape is the concatenation of all the arguments separated by spaces. A -similar escape is @code{\$@@}, which is the concatenation of all the +escape concatenates all the arguments separated by spaces. A +similar escape is @code{\$@@}, which concatenates all the arguments with each surrounded by double quotes, and separated by spaces. +@end_Defesc -@findex \$0 -@findex als@r{, use with @code{\$0}} -The @code{\$0} escape is the name by which the current macro was -invoked. The @code{als} request can make a macro have more than one -name. +@rqindex als +@cindex @code{als}, use with @code{\$0} +@Defesc{\\$0, } +The name used to invoke the current macro. +The @code{als} request can make a macro have more than one name. @example .de vl @@ -6363,8 +6586,9 @@ name. This would be called as @example -.vl $Id: groff.texinfo,v 1.64 2001/01/23 07:39:14 wlemb Exp $ +.vl $Id: groff.texinfo,v 1.65 2001/03/19 16:16:57 wlemb Exp $ @end example +@end_Defesc @xref{Request Arguments}. @@ -6376,21 +6600,23 @@ This would be called as @cindex page motions @cindex motions, page -@findex sp@r{, as vertical page motion} +@cindex @code{sp}, as vertical page motion +@Defreq{sp, [@var{len}]} Motions up and down the page can be done with the @code{sp} request. However, this causes a break so that the actual effect is to move to the left margin and then to the specified location. +@end_Defreq -@findex mk -@findex rt +@Defreq{mk, [@var{reg}]} +@Defreqx{rt, reg} The request @code{mk} can be used to mark a location on a page, for movement to later. This request takes a register name as an argument in -which to store the current page location. With no argument it will -store the location in an internal register. The results of this can be +which to store the current page location. With no argument it +stores the location in an internal register. The results of this can be used later by the @code{rt} or the @code{sp} request. The @code{rt} -request will return @emph{upwards} to the location given in the register -name given as an argument, with no argument it will return to the -location marked with the @code{mk} request +request returns @emph{upwards} to the location given in the register +name given as an argument; with no argument it returns to the +location marked with the @code{mk} request. @c XXX example @ignore @@ -6398,19 +6624,21 @@ location marked with the @code{mk} request ... dual column example ... @end example @end ignore +@end_Defreq The following escapes give fine control of movements about the page. -@findex \v @cindex vertical motion @cindex motion, vertical -The @code{\v'@var{e}'} enables arbitrary vertical motion from the +@Defesc{\\v, e} +The @code{\v'@var{e}'} escape enables arbitrary vertical motion from the current location on the page. The argument@w{ }@var{e} specifies the distance to move; positive is downwards and negative upwards. The default unit for this escape is vertical spaces, @code{v}'s. Beware, -however, that @code{gtroff} will leave text processing to continue -wherever the motion ends, so to avoid interference with text processing, -motions should be balanced. +however, that @code{gtroff} continues text processing at the point +where the motion ends, so you should always balance motions +to avoid interference with text processing. +@end_Defesc There are some special case escapes for vertical motion. @@ -6425,13 +6653,15 @@ move upwards@w{ }.5@dmn{v}. move down@w{ }.5@dmn{v}. @end ftable -@findex \h @cindex inserting horizontal space @cindex horizontal space @cindex space, horizontal -Horizontal motions can be done via the @code{\h'@var{e}'} escape. The +@Defesc{\\h, e} +The @code{\h'@var{e}'} escape provides horizontal motions. The expression@w{ }@var{e} indicates how far to move: positive is rightwards and negative leftwards. +@c XXX Is there a default unit for this? +@end_Defesc There are a number of special case escapes for horizontal motion: @@ -6445,10 +6675,10 @@ an unbreakable space that stretches like a normal inter-word space when a line is adjusted. @item \| -a 1/6th em space. +a 1/6th em space. Ignored in nroff mode. @item \^ -a 1/12th em space. +a 1/12th em space. Ignored in nroff mode. @item \0 a space the size of a digit. @@ -6465,21 +6695,19 @@ Like @code{\&} except that it behaves like a character declared with the sentence recognition. @end ftable -@c XXX example +The following string sets the @TeX{} logo: -@ignore @example -... tex logo example ... +.ds TeX T\h'-.1667m'\v'.224m'E\v'-.224m'\h'-.125m'X @end example -@end ignore -@findex \w @cindex width escape @cindex escape, width -A frequent need is to do horizontal movement based on the width of some -arbitrary text (e.g.@: given as an argument to a macro). For that, -there is the escape @code{\w'@var{text}'} which will interpolate to the -width of the given @var{text} in basic units. +@Defesc{\\w, text} +Used as @code{\w'@var{text}'}, +returns the width of the specified @var{text} in basic units. +This allows horizontal movement based on the width of some +arbitrary text (e.g.@: given as an argument to a macro). @c XXX example @@ -6510,20 +6738,20 @@ heights and depths of characters. @item ct @vindex ct -is set according to what kinds of characters occur in @var{text}: +Defines the kinds of characters occurring in @var{text}: @table @asis @item 0 only short characters, no descenders or tall characters. @item 1 -descender. +at least one descender. @item 2 -tall character. +at least one tall character. @item 3 -both a descender and a tall character. +at least one each of a descender and a tall character. @end table @item ssc @@ -6537,12 +6765,17 @@ How far to right of the center of the last character in the @code{\w} argument, the center of an accent from a Roman font should be placed over that character. @end table +@end_Defesc -@findex \k -@vindex .k -@code{\k} +@Defesc{\\k, x} +Stores the current horizontal position in register @var{x}. +Use this, for example, to return to the beginning of a string +for highlighting or other decoration. +@end_Defesc -@code{.k} +@Defreg{.k} +Contains the current horizontal output position. +@end_Defreg @c XXX documentation @@ -6564,12 +6797,12 @@ information. All drawing is done via escapes. -@findex \l @cindex drawing horizontal lines @cindex horizontal line, drawing @cindex line, horizontal, drawing -The @code{\l} escape will draw a line rightwards from the current -location. The full syntax for this escape is like this: +@Defesc{\\l, l c} +Draws a line rightwards from the current +location. The full syntax for this escape is: @example \l'@var{l}@var{c}' @@ -6577,9 +6810,9 @@ location. The full syntax for this escape is like this: @noindent where @var{l} is the length of the line to be drawn, starting at the -current location; positive numbers will draw to the right, and negative -will draw towards the left. This can also be specified absolutely -(i.e.@: with a leading @samp{|}) which will draw back to the beginning +current location; positive numbers draw to the right, and negative +numbers draw towards the left. This can also be specified absolutely +(i.e.@: with a leading @samp{|}) which draws back to the beginning of the line. @cindex underscore character @@ -6587,13 +6820,13 @@ of the line. @cindex line drawing character @cindex character for line drawing The optional second parameter @var{c} is a character to draw the line -with. If this second argument is not specified, @code{gtroff} will use +with. If this second argument is not specified, @code{gtroff} uses the underscore character. @cindex zero width space character @cindex character, zero width space @cindex space character, zero width -@findex \& +@esindex \& To separate the two arguments (to prevent @code{gtroff} from interpreting a drawing character as a scaling indicator) use @code{\&}. @@ -6611,8 +6844,8 @@ Note that this works by outputting a box rule (a vertical line), then the text given as an argument and then another box rule. Then the line drawing escapes both draw from the current location to the beginning of the @emph{input} line. +@end_Defesc -@findex \L @cindex drawing vertical lines @cindex vertical line drawing @cindex line, vertical, drawing @@ -6620,11 +6853,13 @@ the @emph{input} line. @cindex character for line drawing @cindex box rule character @cindex character, box rule -Vertical lines are drawn using the @code{\L} escape. Its parameters are -specified similar to the @code{\l} escape. If the length is positive, -the movement will be downwards, and upwards for negative values. The +@Defesc{\\L, l c} +Draws vertical lines. Its parameters are +similar to the @code{\l} escape. The +movement is downwards for positive values, +and upwards for negative values. The default character is the box rule character. As with the vertical -motion escapes, text processing will blindly continue where the line +motion escapes, text processing blindly continues where the line ends. @c XXX example @@ -6634,11 +6869,12 @@ ends. ...box macro... @end example @end ignore +@end_Defesc -@findex \D -More flexible drawing functions are available via the @code{\D} escape. -While the previous escapes will work on a character device, these -escapes will not. +@Defesc{\\D, [various]} +The @code{\D} escape provides a variety of drawing functions. +While the previous escapes work on a character device, these +escapes do not. @table @code @item \D'l @var{dx} @var{dy}' @@ -6692,7 +6928,7 @@ Set the shade of gray to be used for filling solid objects to@w{ corresponds solid white and 1000 to solid black, and values in between correspond to intermediate shades of gray. This applies only to solid circles, solid ellipses and solid polygons. By default, a level of@w{ -}1000 will be used. +}1000 is used. @item \D'p @var{dx1} @var{dy1} @var{dx2} @var{dy2} ...' @cindex drawing a polygon @@ -6728,17 +6964,19 @@ zero selects the smallest available line thickness. A negative value makes the line thickness proportional to the current point size (this is the default behaviour of @code{ditroff}). @end table +@end_Defesc -@findex \b @cindex pile, character @cindex character pile -The @code{\b} escape will @dfn{pile} a sequence of characters -vertically, and center it vertically on the current line. This can be -used to build large brackets and braces. +@Defesc{\\b, string} +@dfn{Piles} a sequence of characters +vertically, and centers it vertically on the current line. Use it +to build large brackets and braces. @example \b'\(lt\(bv\(lk\(bv\(lb' @end example +@end_Defesc @xref{Drawing Functions}. @@ -6749,16 +6987,16 @@ used to build large brackets and braces. @section Traps @cindex traps -@dfn{Traps} are locations, which, when reached, will call a specified +@dfn{Traps} are locations, which, when reached, call a specified macro. These traps can occur at a given location on the page, at a given location in the current diversion, after a certain number of input lines or at the end of input. @menu -* Page Location Traps:: -* Diversion Traps:: -* Input Line Traps:: -* End-of-input Traps:: +* Page Location Traps:: +* Diversion Traps:: +* Input Line Traps:: +* End-of-input Traps:: @end menu @c --------------------------------------------------------------------- @@ -6768,14 +7006,47 @@ lines or at the end of input. @cindex page location traps @cindex traps, page location -@c XXX definition of wh request +@dfn{Page location traps} perform an action when @code{gtroff} +reaches a certain vertical location on the page. Page location +traps have a variety of purposes, including: + +@itemize +@item +setting headers and footers + +@item +setting body text in multiple columns + +@item +setting footnotes +@end itemize + +@cindex vertical position trap enable register +@Defreq{vpt, flag} +@Defregx{.vpt} +Enables vertical position traps if @var{flag} +is non-zero, or disables them otherwise. Vertical position traps +are traps set by the @code{wh} or @code{dt} requests. Traps set by the +@code{it} request are not vertical position traps. The parameter that +controls whether vertical position traps are enabled is global. +Initially vertical position traps are enabled. The current setting of +this is available in the @code{.vpt} number register. +@end_Defreq + +@Defreq{wh, dist macro} +Sets a page location trap. Positive values for @var{dist} set +the trap relative to the top of the page; negative values set +the trap relative to the bottom of the page. + +@var{macro} is the name of the macro to execute when the +trap is sprung. @cindex page headers @cindex page footers @cindex headers @cindex footers -Page location traps are frequently used for page headers and footers. -The following is a simple example of this. +The following is a simple example of how many macro packages +set headers and footers. @example .de hd \" Page header @@ -6791,18 +7062,21 @@ The following is a simple example of this. .wh 0 hd \" trap at top of the page .wh -1i fo \" trap one inch from bottom @end example +@end_Defreq -@vindex .t @cindex distance to next trap @cindex trap, distance -The number register @code{.t} is the distance to the next trap. +@Defreg{.t} +The distance to the next trap. +@end_Defreg -@findex ch @cindex changing trap location @cindex trap, changing location -The location of a trap can be changed later on with the @code{ch} -request. The first argument is the name of the macro to be invoked at -the trap, and the second argument is the new location for the trap. +@Defreq{ch, dist macro} +Changes the location of a trap. +The first argument is the name of the macro to be invoked at +the trap, and the second argument is the new location for the trap +(note that the parameters are specified the opposite of the @code{.wh} request). This is useful for building up footnotes in a diversion to allow more space at the bottom of the page for them. @@ -6813,34 +7087,26 @@ space at the bottom of the page for them. ... (simplified) footnote example ... @end example @end ignore +@end_Defreq -@findex vpt -@findex wh -@vindex .vpt -@cindex vertical position trap enable register -The @code{vpt} request will enable vertical position traps if the -argument is non-zero, disable them otherwise. Vertical position traps -are traps set by the @code{wh} or @code{dt} requests. Traps set by the -@code{it} request are not vertical position traps. The parameter that -controls whether vertical position traps are enabled is global. -Initially vertical position traps are enabled. The current setting of -this is available in the number register @code{.vpt}. +@Defreg{.ne} +The number register @code{.ne} contains the amount of space that was +needed in the last @code{ne} request that caused a trap to be sprung. +Useful in conjunction with the @code{.trunc} register. @xref{Page +Control}, for more information. +@end_Defreg -@vindex .trunc -@findex ne@r{, and the @code{.trunc} register} -The number register @code{.trunc} contains the amount of vertical space +@rqindex ne +@cindex @code{ne}, and the @code{.trunc} register +@Defreg{.trunc} +Contains the amount of vertical space truncated by the most recently sprung vertical position trap, or, if the trap was sprung by a @code{ne} request, minus the amount of vertical motion produced by the @code{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. - -@vindex .ne -The number register @code{.ne} contains the amount of space that was -needed in the last @code{ne} request that caused a trap to be sprung. -Useful in conjunction with the @code{.trunc} register. @xref{Page -Control}, for more information. +@end_Defreg @c --------------------------------------------------------------------- @@ -6849,13 +7115,16 @@ Control}, for more information. @cindex diversion traps @cindex traps, diversion -@findex dt -@vindex .t@r{, and diversions} -Traps can also be set @emph{within} a diversion using the @code{dt} -request. Like @code{wh} the first argument is the location of the trap -and the second argument is the name of the macro to be invoked. The -number register @code{.t} will still work within diversions. +@vindex .t +@cindex @code{.t}, and diversions +@Defreq{dt, dist macro} +Sets a trap @emph{within} a diversion. +@var{dist} is the first argument is the location of the trap +(identical to the @code{.wh} request) +and @var{macro} is the name of the macro to be invoked. The +number register @code{.t} still works within diversions. @xref{Diversions}, for more information. +@end_Defreq @c --------------------------------------------------------------------- @@ -6864,31 +7133,25 @@ number register @code{.t} will still work within diversions. @cindex input line traps @cindex traps, input line -@findex it -The @code{it} request will set an input line trap. The format for -calling this is - -@example -.it @var{n} @var{name} -@end example - -@noindent -where @var{n} is the number of lines of input which may be read before -@dfn{springing} the trap, @var{name} is the macro to be invoked. +@Defreq{it, n macro} +Sets an input line trap. +@var{n} is the number of lines of input which may be read before +@dfn{springing} the trap, @var{macro} is the macro to be invoked. Request lines are not counted as input lines. -For example, one possible use is to have a macro which will print the +For example, one possible use is to have a macro which prints the next @var{n}@w{ }lines in a bold font. @example .de B -.it B-end \\$1 +.it \\$1 B-end .ft B .. .de B-end .ft R .. @end example +@end_Defreq @c --------------------------------------------------------------------- @@ -6897,9 +7160,9 @@ next @var{n}@w{ }lines in a bold font. @cindex end-of-input traps @cindex traps, end-of-input -@findex em -The @code{em} request will set a trap at the end of input. The macro -specified as an argument will be executed after the last line of the +@Defreq{em, macro} +Sets a trap at the end of input. The @var{macro} +specified is executed after the last line of the input file has been processed. For example, if the document had to have a section at the bottom of the @@ -6919,6 +7182,7 @@ Date:\t\t\a .. .em approval @end example +@end_Defreq @c ===================================================================== @@ -6933,13 +7197,13 @@ said to be stored in a macro. This is used for saving text for output at a later time, which is useful for keeping blocks of text on the same page, footnotes, tables of contents and indices. -@findex di -@findex da -A diversion is initiated by the @code{di} request. Like the @code{de} +@Defreq{di, macro} +@Defreqx{da, macro} +Begins a diversion. Like the @code{de} request, it takes an argument of a macro name to divert subsequent text -into. The @code{da} macro will append to an existing diversion. +into. The @code{da} macro appends to an existing diversion. -@code{di} (resp.@: @code{da}) without an argument ends the diversion. +@code{di} or @code{da} without an argument ends the diversion. @c XXX example @@ -6948,24 +7212,29 @@ into. The @code{da} macro will append to an existing diversion. ... end-note example ... @end example @end ignore +@end_Defreq -@vindex .z -@vindex .d @vindex nl @vindex .h @cindex nested diversions @cindex diversion, nested +@Defreg{.z} +@Defregx{.d} Diversions may be nested. The number register @code{.z} contains the name of the current diversion. The number register @code{.d} contains the current vertical place in the diversion. If not in a diversion it is the same as the register @code{nl}. +@end_Defreg @c XXX more info -@code{.h} +@Defreg{.h} +The @dfn{high-water mark} on the current page. It corresponds to the +text baseline of the lowest line on the page. +@end_Defreg -@vindex dn -@vindex dl +@Defreg{dn} +@Defregx{dl} After completing a diversion, the built-in number registers @code{dn} and @code{dl} contain the vertical and horizontal size of the diversion. @@ -6992,22 +7261,24 @@ and @code{dl} contain the vertical and horizontal size of the diversion. .rr @@s .. @end example +@end_Defreg -@findex \! @cindex transparent output @cindex output, transparent -Requests, macros and escapes are interpreted when read into a diversion. -There are two ways to prevent this; either way will take the given text -and @dfn{transparently} embed it into the diversion. The first method -is to prefix the line with @code{\!}. This will cause the entire line -to be transparently inserted into the diversion. This is useful for +@Defesc{\\!, } +@Defescx{\\?, } +Prevents requests, macros and escapes from being +interpreted when read into a diversion. This takes the given text +and @dfn{transparently} embeds it into the diversion. This is useful for macros which shouldn't be invoked until the diverted text is actually output. @c XXX anything is read in copy mode. (what about \! ??) -@findex \? -The other way is to surround the text by the @code{\?} escape, i.e. +The @code{\!} escape transparently embeds text up to +and including the end of the line. +The @code{\?} escape transparently embeds text until the next +occurrence of the @code{\?} escape. For example: @example \?@var{anything}\? @@ -7017,8 +7288,8 @@ The other way is to surround the text by the @code{\?} escape, i.e. @var{anything} may not contain newlines; use @code{\!} to embed newlines in a diversion. The escape sequence @code{\?} is also recognized in copy mode and turned into a single internal code; it is -this code that terminates anything. Thus the following example will -print@w{ }4. +this code that terminates anything. Thus the following example +prints@w{ }4. @example .nr x 1 @@ -7037,16 +7308,16 @@ print@w{ }4. .nr x 4 .f @end example +@end_Defesc -@findex asciify @cindex unformatting diversions @cindex diversion, unformatting - -The @code{asciify} @dfn{unformats} the diversion specified as an -argument in such a way that @acronym{ASCII} and space characters that -were formatted and diverted will be treated like ordinary input +@Defreq{asciify, div} +@dfn{Unformats} the diversion specified by @var{div} +in such a way that @acronym{ASCII} and space characters that +were formatted and diverted are treated like ordinary input characters when the diversion is reread. It can be also used for gross -hacks; for example, the following will set register @code{n} to@w{ }1. +hacks; for example, the following sets register @code{n} to@w{ }1. @example .tr @@. @@ -7060,6 +7331,7 @@ hacks; for example, the following will set register @code{n} to@w{ }1. @end example @xref{Copy-in Mode}. +@end_Defreq @c ===================================================================== @@ -7071,7 +7343,7 @@ hacks; for example, the following will set register @code{n} to@w{ }1. It happens frequently that some text should be printed in a certain format regardless of what may be in effect at the time, for example, in a trap invoked macro to print headers and footers. To solve this -@code{gtroff} has @dfn{environments} in which text is processed. An +@code{gtroff} processes text in @dfn{environments}. An environment contains most of the parameters that control text processing. It is possible to switch amongst these environments; by default @code{gtroff} processes text in environment@w{ }0. The @@ -7101,24 +7373,24 @@ These environments may be given arbitrary names (see @ref{Identifiers}, for more info). Old versions of @code{troff} only had environments named @samp{0}, @samp{1} and@w{ }@samp{2}. -@findex ev -@vindex .ev @cindex switch environments @cindex current environment number/name register -The @code{ev} request will switch to another environment. The single -argument is the name of the environment to switch to. With no argument -@code{gtroff} will switch back to the previous environment. There is no -limit on the number of named environments; they will be created the +@Defreq{ev, env} +@Defregx{.ev} +Switches to another environment. The argument @var{env} +is the name of the environment to switch to. With no argument, +@code{gtroff} switches back to the previous environment. There is no +limit on the number of named environments; they are created the first time that they are referenced. The @code{.ev} register contains the name or number of the current environment. This is a string-valued register. -Note that a call to @code{ev} (with argument) will push the previously +Note that a call to @code{ev} (with argument) pushes the previously active environment onto a stack. If, say, environments @samp{foo}, @samp{bar}, and @samp{zap} are called (in that order), the first -@code{ev} request without parameter will switch back to environment -@samp{bar} (which will be popped off the stack), and a second call will -switch back to environment @samp{foo}. +@code{ev} request without parameter switches back to environment +@samp{bar} (which is popped off the stack), and a second call +switches back to environment @samp{foo}. @c XXX example @@ -7128,7 +7400,7 @@ switch back to environment @samp{foo}. @end example @end ignore -Here is another example: +Here is an example: @example .ev footnote-env @@ -7142,11 +7414,12 @@ Here is another example: \(dg Note the large, friendly letters. .ev @end example +@end_Defreq -@findex evc @cindex copy environment -To copy an environment into the current one, use the @code{evc} request, -which takes the name of the environment to copy from as an argument. +@Defreq{evc, env} +Copies the environment @var{env} into the current environment. +@end_Defreq @c ===================================================================== @@ -7155,9 +7428,8 @@ which takes the name of the environment to copy from as an argument. @section Suppressing output @cindex suppressing output -@findex \O -@code{gtroff} allows the programmer to disable resp.@: enable output -through the use of the @code{\O} escape: +@Defesc{\\O, num} +Disables or enables output depending on the value of @var{num}: @table @samp @item \O0 @@ -7167,13 +7439,16 @@ Disable any ditroff glyphs from being emitted to the device driver. Enable output of glyphs. @end table -The previous commands also reset the four registers @samp{opminx}, +@vindex opminx +@vindex opminy +@vindex opmaxx +@vindex opmaxy +@code{\O0} and @code{\O1} also reset the four registers @samp{opminx}, @samp{opminy}, @samp{opmaxx}, and @samp{opmaxy} to -1. @xref{Register Index}. These four registers mark the top left and bottom right hand corners of a box which encompasses all written glyphs. -The following two parameter of @code{\O} are @code{grohtml} device -specific. +The following two forms of @code{\O} are specific to @code{grohtml}. @table @samp @item \O2 @@ -7186,6 +7461,7 @@ Enable output of glyphs (the default). Also write out to @code{stderr} the page number and four registers encompassing the glyphs previously written since the last call to @code{\O}. @end table +@end_Defesc @c ===================================================================== @@ -7197,29 +7473,34 @@ written since the last call to @code{\O}. @cindex requests for input and output @cindex output and input requests -@findex so +@code{gtroff} has several requests for including files: + @cindex including a file @cindex file inclusion -The @code{so} request will read in the file given as an argument and -include it in place of the @code{so} request. This is quite useful for -large documents, i.e.@: keeping each chapter in a separate file. +@Defreq{so, file} +Reads in the specified @var{file} and +includes it in place of the @code{so} request. This is quite useful for +large documents, e.g.@: keeping each chapter in a separate file. @xref{gsoelim}, for more information. +@end_Defreq -@findex mso -The @code{mso} request is the same as the @code{so} request except that -the file is searched for in the same directories as macro files for the +@Defreq{mso, file} +Identical to the @code{so} request except that @code{gtroff} +searches for the specified +@var{file} in the same directories as macro files for the the @option{-m} command line option. If the file name to be included has the form @file{@var{name}.tmac} and it isn't found, @code{mso} tries to include @file{tmac.@var{name}} and vice versa. +@end_Defreq -@findex cf @cindex transparent output @cindex output, transparent -The @code{cf} and @code{trf} requests are to include a file. It will -transparently output the contents of file filename. Each line is output +@Defreq{cf, file} +@Defreqx{trf, file} +Transparently outputs the contents of @var{file}. Each line is output as it were preceded by @code{\!}; however, the lines are not subject to copy mode interpretation. If the file does not end with a newline, then -a newline will be added. For example, to define a macro@w{ }@code{x} +a newline is added. For example, to define a macro@w{ }@code{x} containing the contents of file@w{ }@file{f}, use @example @@ -7229,30 +7510,36 @@ containing the contents of file@w{ }@file{f}, use @end example The request @w{@code{.cf @var{filename}}}, when used in a diversion, -will embed in the diversion an object which, when reread, will cause the +embeds an object in the diversion which, when reread, causes the contents of @var{filename} to be transparently copied through to the -output. In @acronym{UNIX} @code{troff}, the contents of @var{filename} +output. + +In @acronym{UNIX} @code{troff}, the contents of @var{filename} is immediately copied through to the output regardless of whether there is a current diversion; this behaviour is so anomalous that it must be considered a bug. This request causes a line break. -@findex trf +@rqindex trf With @code{trf}, unlike @code{cf}, the file cannot contain characters such as NUL that are not valid @code{gtroff} input characters (@pxref{Identifiers}). This request causes a line break. +@end_Defreq -@findex nx -The @code{nx} request will force @code{gtroff} to continue processing of +@Defreq{nx, } +Forces @code{gtroff} to continue processing of the file specified as an argument. +@end_Defreq -@findex rd -The @code{rd} request will read from standard input, and include what is +@Defreq{rd, } +The @code{rd} request reads from standard input, and includes what is read as though it were part of the input file. Text is read until a blank line is encountered. +@end_Defreq @cindex form letters @cindex letters, form -Using these two requests it is easy to set up form letters. The form +Using the @code{nx} and @code{rd} requests, +it is easy to set up form letters. The form letter template is constructed like this: @example @@ -7269,7 +7556,7 @@ Body of letter. .nx repeat.let @end example -@findex ex +@rqindex ex @noindent When this is run, the following file should be redirected in. Note that requests included in this file are executed as though they were part of @@ -7293,19 +7580,21 @@ Dear Mr. Adollar, .ex @end example -@findex pi -@code{pi} +@Defreq{pi, pipe} +Pipes the output of @code{gtroff} to the shell command(s) +specified by @var{pipe}. This request must occur before +@code{gtroff} has a chance to print anything. +@end_Defreq -@c XXX documentation - -@findex sy -The @code{sy} request will allow arbitrary system commands to be -executed from within a @code{gtroff} document. The output is not saved +@Defreq{sy, cmds} +@Defregx{systat} +In @dfn{unsafe} mode, executes the shell command(s) +specified by @var{cmds}. The output is not saved anyplace, so it is up to the user to do so. @c XXX add info about safer and unsafe mode -For example, the following example will introduce the current time +For example, the following example introduces the current time into a document: @cindex time, current @@ -7321,36 +7610,37 @@ into a document: @noindent Note that this works by having the @code{perl} script (run by @code{sy}) -print out the @code{nr} requests which will set the number registers +print out the @code{nr} requests which set the number registers @samp{H}, @samp{M} and @samp{S}, and then reads those commands in with the @code{so} request. -@vindex systat @cindex @code{system()} return value register The @code{systat} number register contains the return value of the @code{system()} function executed by the last @code{sy} request. +@end_Defreq -@findex open -The @code{open} request will open a file (specified as the second -argument) for writing and associate the stream (specified as the first -argument) with it. +@Defreq{open, stream file} +@Defreqx{opena, stream file} +Opens the specified @var{file} for writing and +associates the specified @var{stream} with it. -@findex opena The @code{opena} is like @code{open}, but if the file exists, append to it instead of truncating it. +@end_Defreq -@findex write @cindex copy-in mode, and @code{write} requests @cindex mode, copy-in, and @code{write} requests -The @code{write} request will write to the file associated with the -stream specified by the first argument. The stream must previously have +@Defreq{write, stream data} +Writes to the file associated with the specified @var{stream}. +The stream must previously have been the subject of an open request. The remainder of the line is interpreted as the @code{ds} request reads its second argument: A -leading @samp{"} will be stripped, and it will be read in copy-in mode. +leading @samp{"} is stripped, and it is read in copy-in mode. +@end_Defreq -@findex close -The @code{close} request will close the stream specified by the first -argument; stream will no longer be an acceptable argument to the +@Defreq{close, stream} +Closes the specified @var{stream}; +the stream is no longer an acceptable argument to the @code{write} request. @c XXX example @@ -7360,13 +7650,15 @@ argument; stream will no longer be an acceptable argument to the ... example of open write &c... @end example @end ignore +@end_Defreq -@findex \V -The @code{\V} escape will interpolate the contents of the specified -environment variable, as returned by the function @code{getenv}. The -argument to @code{\V} is specified as an identifier, i.e.@: +@Defesc{\\V, xxx} +Interpolates the contents of the specified +environment variable, as returned by the function @code{getenv}. +Specify the argument to @code{\V} as an identifier, i.e.@: @samp{\V@var{x}}, @samp{\V(@var{xx}} or @samp{\V[@var{xxx}]}. @code{\V} is interpreted in copy-in mode. +@end_Defesc @c ===================================================================== @@ -7376,15 +7668,16 @@ is interpreted in copy-in mode. @cindex postprocessor access @cindex access of postprocessor -There are two escapes which will allow information to be directly given +There are two escapes which give information directly to the postprocessor. This is particularly useful for embedding @sc{PostScript} into the final document. -@findex \X -The @code{\X} escape will embed its argument into the @code{gtroff} +@Defesc{\\X, xxx} +Embeds its argument into the @code{gtroff} output preceded with @w{@samp{x X}}. +@end_Defesc -@findex \Y +@Defesc{\\Y, xxx} The @code{\Y} escape is called with an identifier (i.e.@: @code{\Y@var{x}}, @code{\Y(@var{xx}} or @code{\Y[@var{xxx}]}). This is approximately equivalent to @samp{\X'\*[@var{xxx}]'}. However, the @@ -7392,8 +7685,9 @@ contents of the string or macro @var{xxx} are not interpreted; also it is permitted for @var{xxx} to have been defined as a macro and thus contain newlines (it is not permitted for the argument to @code{\X} to contain newlines). The inclusion of newlines requires an extension to -the @acronym{UNIX} @code{troff} output format, and will confuse drivers +the @acronym{UNIX} @code{troff} output format, and confuses drivers that do not know about this extension. +@end_Defesc @xref{Output Devices}. @@ -7407,23 +7701,24 @@ that do not know about this extension. This section documents parts of @code{gtroff} which cannot (yet) be categorized elsewhere in this manual. -@findex nm @cindex line numbers @cindex numbers, line -Line numbers can be printed in the left margin using the @code{nm} -request. The first argument is the line number of the @emph{next} -output line; this defaults to@w{ }1. The second argument indicates on -which lines numbers will be printed, i.e.@: 5 means put line numbers on -every 5@w{ }lines; this defaults to@w{ }1. The third argument is the +@Defreq{nm, start inc space indent} +Prints line numbers in the left margin. +@var{start} is the line number of the @emph{next} +output line; this defaults to@w{ }1. @var{inc} indicates on +which lines numbers are printed, i.e.@: 5 means put line numbers on +every 5@w{ }lines; this defaults to@w{ }1. @var{space} is the space to be left between the number and the text; this defaults to@w{ }1. The fourth argument is the indentation of the line numbers. Without arguments, line numbers are turned off. +@end_Defreq @c XXX xref ln register -@findex nn -The @code{nn} request will temporarily turn off line numbering. The -first argument is the number of lines not to be numbered; this defaults +@Defreq{nn, [@var{skip}]} +Temporarily turns off line numbering. The +argument is the number of lines not to be numbered; this defaults to@w{ }1. @c XXX (does this disable incrementing or display?) @@ -7435,15 +7730,16 @@ to@w{ }1. ... line numbering example ... @end example @end ignore +@end_Defreq -@findex mc @cindex margin characters @cindex characters for margins -Margin characters can be automatically printed to the right of the text -with the @code{mc} request. The first argument is the character to be +@Defreq{mc, char dist} +Prints margin characters to the right of the text. +The first argument is the character to be printed, and the second argument is the distance away from the main body text. With no arguments the margin characters are turned off. If this -occurs before a break, no margin character will be printed. +occurs before a break, no margin character is printed. @pindex nrchbar @pindex changebar @@ -7459,13 +7755,14 @@ there are programs available for doing this (they are called ... margin char example ... @end example @end ignore +@end_Defreq -@findex lf @pindex soelim @cindex multi-file documents @cindex documents, multi-file -The primary reason for the existence of @code{lf} is to make debugging -documents which are split into many files, which are then put together +@Defreq{lf, line filename} +A debugging aid for +documents which are split into many files, then put together with @code{soelim} and other preprocessors. The second argument is the name of the file and the first argument is the input line number in that file. This way @code{gtroff} can produce error messages which are @@ -7478,6 +7775,7 @@ intelligible to the user. ... example of soelim'ed doc ... @end example @end ignore +@end_Defreq @c ===================================================================== @@ -7489,13 +7787,25 @@ intelligible to the user. @code{gtroff} is not easy to debug, but there are some useful features and strategies for debugging. -@itemize @bullet -@item -@findex tm -The @code{tm} request will send output to the standard error stream; -this is very useful for printing debugging output. +@Defreq{tm, string} +Sends the @var{string} to the standard error stream; +this is very useful for printing debugging output among other things. +@end_Defreq + +@cindex aborting +@Defreq{ab, [@var{string}]} +Similar to the @code{tm} request, except that +it causes @code{gtroff} to stop processing. With no argument it +prints @samp{User Abort}. +@end_Defreq + +@cindex @code{ex}, use in debugging +@cindex exiting +@Defreq{ex, } +The @code{ex} request also causes @code{gtroff} to stop processing +if encountered at the topmost level; see also @ref{I/O}. +@end_Defreq -@item When doing something involved it is useful to leave the debugging statements in the code and have them turned on by a command line flag. @@ -7512,89 +7822,74 @@ groff -rDB=1 file @c XXX .tm1, .tmc requests -@item -@findex ab -@cindex aborting -The @code{ab} request is similar to the @code{tm} request, except that -it will cause @code{gtroff} to stop processing. With no argument it -will print @samp{User Abort}. - -@item -@findex ex@r{, use in debugging} -@cindex exiting -The @code{ex} request will also cause @code{gtroff} to stop processing -if encountered at the topmost level; see also @ref{I/O}. - -@item If it is known in advance that there will be many errors and no useful output, @code{gtroff} can be forced to suppress formatted output with the @option{-z} flag. -@item -@findex pm @cindex dumping symbol table @cindex symbol table, dumping -The @code{pm} request will dump out the entire symbol table. +@Defreq{pm, } +The @code{pm} request prints out the entire symbol table on @code{stderr}. +@end_Defreq -@item -@findex pnr @cindex dumping number registers @cindex number registers, dumping -The @code{pnr} request will print the names and contents of all +@Defreq{pnr, } +Prints the names and contents of all currently defined number registers on @code{stderr}. +@end_Defreq -@item -@findex ptr @cindex dumping traps @cindex traps, dumping -The @code{ptr} request will print the names and positions of all traps +@Defreq{ptr, } +Prints the names and positions of all traps (not including input line traps and diversion traps) on @code{stderr}. Empty slots in the page trap list are printed as well, because they can affect the priority of subsequently planted traps. +@end_Defreq -@item -@findex fl @cindex flush output @cindex output, flush @cindex interactive use of @code{gtroff} @cindex @code{gtroff}, interactive use -The @code{fl} request instructs @code{gtroff} to flush its output -immediately. The intention is that this be used when using -@code{gtroff} interactively. There is little other use for it. This +@Defreq{fl, } +Instructs @code{gtroff} to flush its output +immediately. The intent is for interactive use. +@code{gtroff}; there is little other use for it. This request causes a line break. +@end_Defreq -@item -@findex backtrace @cindex backtrace of input stack @cindex input stack, backtrace -The @code{backtrace} request will print a backtrace of the input stack +@Defreq{backtrace, } +The @code{backtrace} request prints a backtrace of the input stack to the standard error stream. +@end_Defreq -@item @cindex warnings @code{gtroff} has command line options for printing out more warnings (@option{-w}) and for printing backtraces (@option{-b}) when a warning or an error occurs. The most verbose level of warnings is @option{-ww}. -@item -@findex warn -@vindex .warn @cindex level of warnings @cindex warnings, level -The @code{warn} request controls the level of warnings checked for. The -only argument is the sum of the numbers associated with each warning -that is to be enabled; all other warnings will be disabled. The number +@Defreq{warn, [@var{flags}]} +@Defregx{.warn} +Controls the level of warnings checked for. The +@var{flags} are the sum of the numbers associated with each warning +that is to be enabled; all other warnings are disabled. The number associated with each warning is listed below. For example, -@w{@code{.warn 0}} will disable all warnings, and @w{@code{.warn 1}} -will disable all warnings except that about missing characters. If an -argument is not given, all warnings will be enabled. The number -register @code{.warn} contains the current warning level. -@end itemize +@w{@code{.warn 0}} disables all warnings, and @w{@code{.warn 1}} +disables all warnings except that about missing characters. If an +argument is not given, all warnings are enabled. + +The number register @code{.warn} contains the current warning level. +@end_Defreq @c --------------------------------------------------------------------- @menu -* Warnings:: +* Warnings:: @end menu @node Warnings, , Debugging, Debugging @@ -7629,8 +7924,8 @@ Missing or mismatched closing delimiters. @item el @itemx 16 -@findex ie -@findex el +@rqindex ie +@rqindex el Use of the @code{el} request with no matching @code{ie} request. @xref{if-else}. @@ -7648,28 +7943,30 @@ Dubious syntax in numeric expressions. @item di @itemx 256 -@findex di@r{, debugging} -@findex da@r{, debugging} +@rqindex di +@rqindex da +@cindex @code{di}, debugging +@cindex @code{da}, debugging Use of @code{di} or @code{da} without an argument when there is no current diversion. @item mac @itemx 512 -@findex de -@c XXX more findex entries +@rqindex de +@c XXX more index entries Use of undefined strings, macros and diversions. When an undefined string, macro or diversion is used, that string is automatically defined -as empty. So, in most cases, at most one warning will be given for each +as empty. So, in most cases, at most one warning is given for each name. @item reg @itemx 1024 -@findex nr -@c XXX more findex entries +@rqindex nr +@c XXX more index entries Use of undefined number registers. When an undefined number register is used, that register is automatically defined to have a value of@w{ }0. A definition is automatically made with a value of@w{ }0. So, in most -cases, at most one warning will be given for use of a particular name. +cases, at most one warning is given for use of a particular name. @item tab @itemx 2048 @@ -7677,7 +7974,8 @@ Use of a tab character where a number was expected. @item right-brace @itemx 4096 -@findex \@}@r{, debugging} +@esindex \@} +@cindex @code{\@}}, debugging Use of @code{\@}} where a number was expected. @item missing @@ -7697,11 +7995,11 @@ encountered, the escape character is ignored. @itemx 65536 @cindex compatibility mode Missing space between a request or macro and its argument. This warning -will be given when an undefined name longer than two characters is +is given when an undefined name longer than two characters is encountered, and the first two characters of the name make a defined -name. The request or macro will not be invoked. When this warning is +name. The request or macro is not invoked. When this warning is given, no macro is automatically defined. This is enabled by default. -This warning will never occur in compatibility mode. +This warning never occurs in compatibility mode. @item font @itemx 131072 @@ -7733,46 +8031,48 @@ with documents written with old versions of @code{troff}. @cindex long names @cindex names, long Long names cause some incompatibilities. @acronym{UNIX} @code{troff} -will interpret +interprets @example .dsabcd @end example -@findex \*@r{, incompatibilities with Unix @code{troff}} -@findex \n@r{, incompatibilities with Unix @code{troff}} -@findex cp +@esindex \* +@esindex \n +@cindex @code{\*}, incompatibilities with Unix @code{troff} +@cindex @code{\n}, incompatibilities with Unix @code{troff} +@rqindex cp @vindex .C @noindent as defining a string @samp{ab} with contents @samp{cd}. Normally, GNU -@code{troff} will interpret this as a call of a macro named -@code{dsabcd}. Also @acronym{UNIX} @code{troff} will interpret +@code{troff} interprets this as a call of a macro named +@code{dsabcd}. Also @acronym{UNIX} @code{troff} interprets @code{\*[} or @code{\n[} as references to a string or number register -called @samp{[}. In GNU @code{troff}, however, this will normally be +called @samp{[}. In GNU @code{troff}, however, this is normally interpreted as the start of a long name. In compatibility mode GNU -@code{troff} will interpret these things in the traditional way. In -compatibility mode, however, long names are not recognized. +@code{troff} interprets long names in the traditional way +(which means that they are not recognized as names). Compatibility mode can be turned on with the @option{-C} command line option, and turned on or off with the @code{cp} request. The number register @code{.C} is@w{ }1 if compatibility mode is on, 0@w{ }otherwise. -@findex \A -@findex \| -@findex \^ -@findex \& -@findex \@} -@findex \@{ -@findex \@key{SP} -@findex \' -@findex \` -@findex \- -@findex \_ -@findex \! -@findex \% -@findex \c +@esindex \A +@esindex \| +@esindex \^ +@esindex \& +@esindex \@{ +@esindex \@} +@esindex \@key{SP} +@esindex \' +@esindex \` +@esindex \- +@esindex \_ +@esindex \! +@esindex \% +@esindex \c GNU @code{troff} does not allow the use of the escape sequences -@code{\|}, @code{\^}, @code{\&}, @code{\@}}, @code{\@{}, +@code{\|}, @code{\^}, @code{\&}, @code{\@{}, @code{\@}}, @code{\@key{SP}}, @code{\'}, @code{\`}, @code{\-}, @code{\_}, @code{\!}, @code{\%}, and @code{\c} in names of strings, macros, diversions, number registers, fonts or environments; @acronym{UNIX} @code{troff} does. The @@ -7781,7 +8081,8 @@ avoiding use of these escape sequences in names. @cindex fractional point sizes @cindex point sizes, fractional -@findex ps@r{, incompatibilities with Unix @code{troff}} +@rqindex ps +@cindex @code{ps}, incompatibilities with Unix @code{troff} Fractional point sizes cause one noteworthy incompatibility. In @acronym{UNIX} @code{troff} the @code{ps} request ignores scale indicators and thus @@ -7791,21 +8092,26 @@ indicators and thus @end example @noindent -will set the point size to 10@w{ }points, whereas in GNU @code{troff} it -will set the point size to 10@w{ }scaled points. @xref{Fractional Type +sets the point size to 10@w{ }points, whereas in GNU @code{troff} it +sets the point size to 10@w{ }scaled points. @xref{Fractional Type Sizes}, for more information. -@findex bd@r{, incompatibilities with Unix @code{troff}} -@findex cs@r{, incompatibilities with Unix @code{troff}} -@findex tkf@r{, incompatibilities with Unix @code{troff}} -@findex tr@r{, incompatibilities with Unix @code{troff}} -@findex fp@r{, incompatibilities with Unix @code{troff}} +@rqindex bd +@rqindex cs +@rqindex tkf +@rqindex tr +@rqindex fp +@cindex @code{bd}, incompatibilities with Unix @code{troff} +@cindex @code{cs}, incompatibilities with Unix @code{troff} +@cindex @code{tkf}, incompatibilities with Unix @code{troff} +@cindex @code{tr}, incompatibilities with Unix @code{troff} +@cindex @code{fp}, incompatibilities with Unix @code{troff} @cindex input and output characters, compatibility with Unix @cindex output characters, compatibility with Unix @cindex characters, input and output, compatibility with Unix In GNU @code{troff} there is a fundamental difference between unformatted, input characters, and formatted, output characters. -Everything that affects how an output character will be output is stored +Everything that affects how an output character is output is stored with the character; once an output character has been constructed it is unaffected by any subsequent requests that are executed, including @code{bd}, @code{cs}, @code{tkf}, @code{tr}, or @code{fp} requests. @@ -7826,21 +8132,24 @@ constructed might have had. For example, .x @end example -@findex \e@r{, incompatibilities with Unix @code{troff}} -@findex \!@r{, incompatibilities with Unix @code{troff}} -@findex \?@r{, incompatibilities with Unix @code{troff}} +@esindex \e +@esindex \! +@esindex \? +@cindex @code{\e}, incompatibilities with Unix @code{troff} +@cindex @code{\!}, incompatibilities with Unix @code{troff} +@cindex @code{\?}, incompatibilities with Unix @code{troff} @cindex transparent output, incompatibilities with Unix @code{troff} @cindex output, transparent, incompatibilities with Unix @code{troff} @noindent -will print @samp{\\} in GNU @code{troff}; each pair of input backslashes +prints @samp{\\} in GNU @code{troff}; each pair of input backslashes is turned into one output backslash and the resulting output backslashes are not interpreted as escape characters when they are reread. @acronym{UNIX} @code{troff} would interpret them as escape characters when they were reread and would end up printing one @samp{\}. The correct way to obtain a printable backslash is to use the @code{\e} -escape sequence: This will always print a single instance of the current +escape sequence: This always prints a single instance of the current escape character, regardless of whether or not it is used in a -diversion; it will also work in both GNU @code{troff} and @acronym{UNIX} +diversion; it also works in both GNU @code{troff} and @acronym{UNIX} @code{troff}. To store, for some reason, an escape sequence in a diversion that will be interpreted when the diversion is reread, either use the traditional @code{\!} transparent output facility, or, if this @@ -7870,13 +8179,13 @@ This chapter describes all preprocessors that come with @code{groff} or which are freely available. @menu -* geqn:: -* gtbl:: -* gpic:: -* ggrn:: -* grap:: -* grefer:: -* gsoelim:: +* geqn:: +* gtbl:: +* gpic:: +* ggrn:: +* grap:: +* grefer:: +* gsoelim:: @end menu @@ -7890,7 +8199,7 @@ which are freely available. @c XXX @menu -* Invoking geqn:: +* Invoking geqn:: @end menu @c --------------------------------------------------------------------- @@ -7913,7 +8222,7 @@ which are freely available. @c XXX @menu -* Invoking gtbl:: +* Invoking gtbl:: @end menu @c --------------------------------------------------------------------- @@ -7936,7 +8245,7 @@ which are freely available. @c XXX @menu -* Invoking gpic:: +* Invoking gpic:: @end menu @c --------------------------------------------------------------------- @@ -7959,7 +8268,7 @@ which are freely available. @c XXX @menu -* Invoking ggrn:: +* Invoking ggrn:: @end menu @c --------------------------------------------------------------------- @@ -7996,7 +8305,7 @@ is available as an extra package from the following address: @c XXX @menu -* Invoking grefer:: +* Invoking grefer:: @end menu @c --------------------------------------------------------------------- @@ -8019,7 +8328,7 @@ is available as an extra package from the following address: @c XXX @menu -* Invoking gsoelim:: +* Invoking gsoelim:: @end menu @c --------------------------------------------------------------------- @@ -8044,14 +8353,14 @@ is available as an extra package from the following address: @c XXX @menu -* Special Characters:: -* grotty:: -* grops:: -* grodvi:: -* grolj4:: -* grolbp:: -* grohtml:: -* gxditview:: +* Special Characters:: +* grotty:: +* grops:: +* grodvi:: +* grolj4:: +* grolbp:: +* grohtml:: +* gxditview:: @end menu @@ -8076,7 +8385,7 @@ is available as an extra package from the following address: @c XXX @menu -* Invoking grotty:: +* Invoking grotty:: @end menu @c --------------------------------------------------------------------- @@ -8098,8 +8407,8 @@ is available as an extra package from the following address: @c XXX @menu -* Invoking grops:: -* Embedding PostScript:: +* Invoking grops:: +* Embedding PostScript:: @end menu @c --------------------------------------------------------------------- @@ -8130,7 +8439,7 @@ is available as an extra package from the following address: @c XXX @menu -* Invoking grodvi:: +* Invoking grodvi:: @end menu @c --------------------------------------------------------------------- @@ -8152,7 +8461,7 @@ is available as an extra package from the following address: @c XXX @menu -* Invoking grolj4:: +* Invoking grolj4:: @end menu @c --------------------------------------------------------------------- @@ -8174,7 +8483,7 @@ is available as an extra package from the following address: @c XXX @menu -* Invoking grolbp:: +* Invoking grolbp:: @end menu @c --------------------------------------------------------------------- @@ -8196,7 +8505,7 @@ is available as an extra package from the following address: @c XXX @menu -* Invoking grohtml:: +* Invoking grohtml:: @end menu @c --------------------------------------------------------------------- @@ -8218,7 +8527,7 @@ is available as an extra package from the following address: @c XXX @menu -* Invoking gxditview:: +* Invoking gxditview:: @end menu @c --------------------------------------------------------------------- @@ -8244,8 +8553,8 @@ is available as an extra package from the following address: @c XXX @menu -* gtroff Output:: -* Font Files:: +* gtroff Output:: +* Font Files:: @end menu @@ -8257,14 +8566,15 @@ is available as an extra package from the following address: @cindex output, @code{gtroff} This section describes the format output of GNU @code{troff}. The -output format used by GNU @code{troff} is very similar to that used by +output format used by GNU @code{troff} is very similar -- but +not identical -- to that used by @acronym{UNIX} device-independent @code{troff} (@code{ditroff}). @menu -* Output Format:: -* Device Control:: -* Drawing Functions:: -* Line Continuation:: +* Output Format:: +* Device Control:: +* Drawing Functions:: +* Line Continuation:: @end menu @c --------------------------------------------------------------------- @@ -8286,10 +8596,10 @@ parameters which are separated from subsequent text by whitespace or a newline. The names of characters and fonts can be of arbitrary length; drivers -should not assume that they will be only two characters long (as +should not assume that they are only two characters long (as @code{ditroff} does). -When a character is to be printed, that character will always be in the +When a character is to be printed, that character is always in the current font. Unlike @code{ditroff}, it is not necessary for drivers to search special fonts to find a character. @@ -8404,7 +8714,7 @@ crunchy \fH\s+2frog\s0\fP!? @end example @noindent -will produce +produces @c XXX example @@ -8422,8 +8732,8 @@ will produce @cindex functions for drawing @pindex gpic -The @samp{D} drawing command has been extended. These extensions will -only be used by GNU @code{pic} if the @option{-x} option is given. +The @samp{D} drawing command has been extended. These extensions are +used by GNU @code{pic} only if the @option{-x} option is given. @xref{Drawing Requests}. @@ -8435,11 +8745,11 @@ Set the shade of gray to be used for filling solid objects to@w{ corresponds solid white and 1000 to solid black, and values in between correspond to intermediate shades of gray. This applies only to solid circles, solid ellipses and solid polygons. By default, a level of@w{ -}1000 will be used. Whatever color a solid object has, it should +}1000 is used. Whatever color a solid object has, it should completely obscure everything beneath it. A value greater than@w{ }1000 or less than@w{ }0 can also be used: this means fill with the shade of gray that is currently being used for lines and text. Normally this -will be black, but some drivers may provide a way of changing this. +is black, but some drivers may provide a way of changing this. @item DC @var{d} Draw a solid circle with a diameter of@w{ }@var{d} with the leftmost @@ -8451,7 +8761,8 @@ vertical diameter of@w{ }@var{dy} with the leftmost point at the current position. @item Dp @var{dx1} @var{dy1} @var{dx2} @var{dy2} @dots{} @var{dxn} @var{dyn} -Draw a polygon with. The first vertex is at the current position, the +Draw a polygon with automatic closure. The first vertex is +at the current position, the second vertex at an offset (@var{dx1},@var{dy1}) from the current position, the second vertex at an offset (@var{dx2},@var{dy2}) from the first vertex, and so on up to the @var{n}-th vertex. At the moment, GNU @@ -8471,7 +8782,7 @@ has been given with a negative value of@w{ }@var{n}. A zero value of@w{ }@var{n} selects the smallest available line thickness. @end table -@findex \D +@esindex \D A difficulty arises in how the current position should be changed after the execution of these commands. This is not of great importance since the code generated by GNU @code{pic} does not depend on this. Given a @@ -8481,14 +8792,14 @@ drawing command of the form \D'@var{c} @var{x1} @var{y1} @var{x2} @var{y2} @dots{} @var{xn} @var{yn}' @end example -@findex \w +@esindex \w @vindex st -@findex sb +@vindex sb @noindent where @var{c} is not one of @samp{c}, @samp{e}, @samp{l}, @samp{a} or -@samp{~}, @acronym{UNIX} @code{troff} will treat each of the x@w{ }value -as a horizontal quantity, and each of the y@w{ }values as a vertical -quantity and will assume that the width of the drawn object is sum if +@samp{~}, @acronym{UNIX} @code{troff} treats each x@w{ }value +as a horizontal quantity, and each y@w{ }value as a vertical +quantity; it assumes that the width of the drawn object is the sum of all x@w{ }values, and that the height is the sum of all y@w{ }values. (The assumption about the height can be seen by examining the @code{st} and @code{sb} registers after using such a @code{D}@w{ }command in a @@ -8516,8 +8827,8 @@ x@w{ }values and vertically by the sum of all y@w{ }values. There is a continuation convention which permits the argument to the @w{@samp{x X}} command to contain newlines: When outputting the argument -to the @w{@samp{x X}} command, GNU @code{troff} will follow each newline -in the argument with a @samp{+} character (as usual, it will terminate +to the @w{@samp{x X}} command, GNU @code{troff} follows each newline +in the argument with a @samp{+} character (as usual, it terminates the entire argument with a newline); thus if the line after the line containing the @w{@samp{x X}} command starts with @samp{+}, then the newline ending the line containing the @w{@samp{x X}} command should be @@ -8543,8 +8854,8 @@ file called @file{DESC} and for each font@w{ }@var{f} a font file called@w{ }@file{@var{f}}. @menu -* DESC file format:: -* Font file format:: +* DESC file format:: +* Font file format:: @end menu @c --------------------------------------------------------------------- @@ -8597,16 +8908,15 @@ list can extend over more than one line. @item styles @var{S1} @var{S2} @dots{} @var{Sm} @kindex styles -The first @var{m}@w{ }font positions will be associated with styles +The first @var{m}@w{ }font positions are associated with styles @var{S1} @dots{} @var{Sm}. @item fonts @var{n} @var{F1} @var{F2} @var{F3} @dots{} @var{Fn} @kindex fonts -Fonts @var{F1} @dots{} @var{Fn} will be mounted in the font positions +Fonts @var{F1} @dots{} @var{Fn} are mounted in the font positions @var{m}+1, @dots{}, @var{m}+@var{n} where @var{m} is the number of styles. This command may extend over more than one line. A font name -of@var{ }0 will cause no font to be mounted on the corresponding font -position. +of@var{ }0 means no font is mounted on the corresponding font position. @item family @var{fam} @kindex family @@ -8662,7 +8972,7 @@ than one line. @item special @kindex special The font is special; this means that when a character is requested that -is not present in the current font, it will be searched for in any +is not present in the current font, it is searched for in any special fonts that are mounted. @end table @@ -8695,7 +9005,7 @@ separated by blanks or tabs. The format is @cindex 8-bit input @cindex input, 8-bit -@findex \N +@esindex \N @kindex --- @noindent @var{name} identifies the character: If @var{name} is a single @@ -8732,11 +9042,11 @@ the character has both an ascender and a descender, for example, `('. The @var{code} field gives the code which the postprocessor uses to print the character. The character can also be input to @code{gtroff} using this code by means of the @code{\N} escape sequence. The code can -be any integer. If it starts with @samp{0} it will be interpreted as -octal; if it starts with @samp{0x} or @samp{0X} it will be interpreted as +be any integer. If it starts with @samp{0} it is interpreted as +octal; if it starts with @samp{0x} or @samp{0X} it is interpreted as hexadecimal. -Anything on the line after the @var{code} field will be ignored. +Anything on the line after the @var{code} field is ignored. The @var{metrics} field has the form: @@ -8789,7 +9099,7 @@ sequence of lines of the form: This means that when character @var{c1} appears next to character @var{c2} the space between them should be increased by@w{ }@var{n}. -Most entries in kernpairs section will have a negative value for@w{ +Most entries in the kernpairs section have a negative value for@w{ }@var{n}. @@ -8797,7 +9107,7 @@ Most entries in kernpairs section will have a negative value for@w{ @c ===================================================================== @c ===================================================================== -@node Installation, Request and Escape Index, File formats, Top +@node Installation, Request Index, File formats, Top @chapter Installation @cindex installation @@ -8808,21 +9118,30 @@ Most entries in kernpairs section will have a negative value for@w{ @c ===================================================================== @c ===================================================================== -@node Request and Escape Index, Operator Index, Installation, Top -@chapter Request and Escape Index +@node Request Index, Escape Index, Installation, Top +@chapter Request Index + +Requests appear without the leading control character (normally either +@samp{.} or @samp{'}). + +@printindex rq + + + +@c ===================================================================== +@c ===================================================================== -In this index, escapes are listed with a leading backslash (@samp{\}) to -distinguish them from requests which appear without the leading control -character (normally either @samp{.} or @samp{'}). +@node Escape Index, Operator Index, Request Index, Top +@chapter Escape Index -@printindex fn +@printindex es @c ===================================================================== @c ===================================================================== -@node Operator Index, Register Index, Request and Escape Index, Top +@node Operator Index, Register Index, Escape Index, Top @chapter Operator Index @printindex op |