Debian Codegraph @

upstream/fedora-rawhide/man7/groff.7

raw
1 '\" t
2 .TH groff 7 "2026-03-03" "groff 1.24.0"
3 .SH Name
4 groff \- GNU
5 .I roff
6 language reference
7 .
8 .
9 .\" ====================================================================
10 .\" Legal Terms
11 .\" ====================================================================
12 .\"
13 .\" Copyright 2000-2024 Free Software Foundation, Inc.
14 .\" 2017-2026 G. Branden Robinson
15 .\"
16 .\" This file is part of groff, the GNU roff typesetting system.
17 .\"
18 .\" Permission is granted to copy, distribute and/or modify this
19 .\" document under the terms of the GNU Free Documentation License,
20 .\" Version 1.3 or any later version published by the Free Software
21 .\" Foundation; with no Invariant Sections, with no Front-Cover Texts,
22 .\" and with no Back-Cover Texts.
23 .\"
24 .\" A copy of the Free Documentation License is included as a file
25 .\" called FDL in the main directory of the groff source package.
26 .
27 .
28 .\" Save and disable compatibility mode (for, e.g., Solaris 10/11).
29 .do nr *groff_groff_7_man_C \n[.cp]
30 .cp 0
31 .
32 .\" Define fallback for groff 1.23's MR macro if the system lacks it.
33 .nr do-fallback 0
34 .if !\n(.f .nr do-fallback 1 \" mandoc
35 .if \n(.g .if !d MR .nr do-fallback 1 \" older groff
36 .if !\n(.g .nr do-fallback 1 \" non-groff *roff
37 .if \n[do-fallback] \{\
38 . de MR
39 . ie \\n(.$=1 \
40 . I \%\\$1
41 . el \
42 . IR \%\\$1 (\\$2)\\$3
43 . .
44 .\}
45 .rr do-fallback
46 .
47 .
48 .\" ====================================================================
49 .\" Local definitions
50 .\" ====================================================================
51 .
52 .\" define a string tx for the TeX logo
53 .ie t .ds tx T\h'-.1667m'\v'.224m'E\v'-.224m'\h'-.125m'X
54 .el .ds tx TeX
55 .
56 .
57 .\" ====================================================================
58 .\" Setup
59 .\" ====================================================================
60 .
61 .\" Man pages should not define page-local macros. Most of these were
62 .\" written long ago; someday we'll revise the page without them.
63 .
64 .\" ====================================================================
65 .\" start a macro, escape sequence, or register definition
66 .
67 .de TPx
68 . TP 11n \" ".linetabs" + 2n
69 ..
70 .\" ====================================================================
71 .\" .Text anything ...
72 .\"
73 .\" All arguments are printed as text.
74 .\"
75 .de Text
76 . nop \)\\$*
77 ..
78 .
79 .\" ========= characters =========
80 .
81 .de squoted_char
82 . Text \[oq]\f[B]\\$1\f[]\[cq]\\$2
83 ..
84 .de dquoted_char
85 . Text \[lq]\f[B]\\$1\f[]\[rq]\\$2
86 ..
87 .\" ========= requests =========
88 .
89 .\" synopsis of a request
90 .de REQ
91 . ie \\n[.$]=1 \{\
92 . Text \%\f[B]\\$1\f[]
93 . \}
94 . el \{\
95 . Text \%\f[B]\\$1\~\f[]\f[I]\\$2\f[]
96 . \}
97 ..
98 .
99 .\" reference of a request
100 .de request
101 . ie (\\n[.$] < 2) \
102 . B \%\\$*
103 . el \
104 . BR \%\\$*
105 ..
106 .
107 .\" ========= numeric elements =========
108 .
109 .\" number with a trailing unit
110 .de scalednumber
111 . Text \\$1\^\f[B]\\$2\f[]\\$3\f[R]
112 . ft P
113 ..
114 .
115 .\" representation of units within the text
116 .de scaleindicator
117 . Text \f[B]\\$1\f[]\\$2\f[R]
118 . ft P
119 ..
120 .
121 .\" representation of mathematical operators within the text
122 .de operator
123 . squoted_char \\$@
124 ..
125 .
126 .
127 .\" ========= escape sequences =========
128 .
129 .\" ====================================================================
130 .\" .ESC name [arg]
131 .\"
132 .\" Synopsis of an escape sequence, optionally with argument
133 .\" Args : 1 or 2; 'name' obligatory, 'arg' optional
134 .\" name : suitable name for an escape sequence (c, (xy, [long])
135 .\" arg : arbitrary word
136 .\" Result : prints \namearg, where 'name' is in B, 'arg' in I
137 .\"
138 .de ESC
139 . Text "\f[B]\e\\$1\,\f[I]\\$2\/\fR"
140 ..
141 .\" ====================================================================
142 .\" .ESC[] name arg
143 .\"
144 .\" Synopsis for escape sequence with a bracketed long argument
145 .\" Args : 2 obligatory
146 .\" name : suitable name for an escape sequence (c, (xy, [long])
147 .\" arg : arbitrary text
148 .\" Result : prints \name[arg], where 'name' is in B, 'arg' in I
149 .\"
150 .de ESC[]
151 . Text "\f[B]\e\\$1\[lB]\f[]\,\f[I]\\$2\/\f[]\f[B]\[rB]\f[]"
152 ..
153 .\" ====================================================================
154 .\" .ESCq name arg
155 .\"
156 .\" Synopsis for escape sequence with a bracketed long argument
157 .\" Args : 2 obligatory
158 .\" name : suitable name for an escape sequence (c, (xy, [long])
159 .\" arg : arbitrary text
160 .\" Result : prints \name'arg', where 'name' is in B, 'arg' in I
161 .\"
162 .de ESCq
163 . Text "\f[B]\e\\$1\[aq]\f[]\,\f[I]\\$2\/\f[]\f[B]\[aq]\f[]"
164 ..
165 .\" ====================================================================
166 .\" .ESC? arg
167 .\"
168 .\" Synopsis for escape sequence with a bracketed long argument
169 .\" Args : 1 obligatory
170 .\" arg : arbitrary text
171 .\" Result : prints '\?arg\?', where the '\?' are in B, 'arg' in I
172 .\"
173 .de ESC?
174 . Text "\f[B]\e?\,\f[I]\\$1\/\f[B]\[rs]?\f[R]"
175 ..
176 .\" ====================================================================
177 .\" .esc name [punct]
178 .\"
179 .\" Reference of an escape sequence (no args), possibly punctuation
180 .\" Args : 1 obligatory
181 .\" name : suitable name for an escape sequence (c, (xy, [long])
182 .\" punct : arbitrary
183 .\" Result : prints \name, where 'name' is in B, 'punct' in R
184 .\"
185 .de esc
186 . ie (\\n[.$] < 2) \
187 . B "\e\\$1"
188 . el \
189 . BR "\e\\$1" \\$2
190 ..
191 .\" ====================================================================
192 .\" .escarg name arg [punct]
193 .\"
194 .\" Reference of an escape sequence (no args)
195 .\" Args : 1 obligatory, 1 optional
196 .\" name : suitable name for an escape sequence (c, (xy, [long])
197 .\" arg : arbitrary word
198 .\" Result : prints \namearg, where
199 .\" 'name' is in B, 'arg' in I
200 .\"
201 .de escarg
202 . Text \f[B]\e\\$1\f[]\,\f[I]\\$2\/\f[]\\$3
203 ..
204 .\" ====================================================================
205 .\" .esc[] name arg [punct]
206 .\"
207 .\" Reference for escape sequence with a bracketed long argument
208 .\" Args : 2 obligatory
209 .\" name : suitable name for an escape sequence (c, (xy, [long])
210 .\" arg : arbitrary text
211 .\" Result : prints \name[arg], where 'name' is in B, 'arg' in I
212 .\"
213 .de esc[]
214 . Text \f[B]\e\\$1\[lB]\f[]\,\f[I]\\$2\/\f[]\f[B]\[rB]\f[]\\$3
215 ..
216 .
217 .\" ========= strings =========
218 .
219 .\" synopsis for string, with \*[]
220 .de STRING
221 . Text \[rs]*[\f[B]\\$1\f[]] \\$2
222 ..
223 .\" synopsis for a long string
224 .de string
225 . if \n[.$]=0 \
226 . return
227 . Text \f[B]\[rs]*\[lB]\\$1\[rB]\f[]\\$2
228 ..
229 .
230 .\" ========= registers =========
231 .
232 .\" synopsis for registers, with \n[]
233 .de REG
234 . Text \%\[rs]n[\f[B]\\$1\f[]]
235 ..
236 .\" reference of a register, without decoration
237 .de register
238 . Text register
239 . ie (\\n[.$] < 2) \
240 . B \\$*
241 . el \
242 . BR \\$*
243 ..
244 .
245 .\" begin list [piloting a possible extension to man(7)]
246 .de LS
247 . nr saved-PD \\n[PD]
248 . nr PD 0
249 ..
250 .
251 .\" end list [piloting a possible extension to man(7)]
252 .de LE
253 . nr PD \\n[saved-PD]
254 ..
255 .
256 .
257 .\" end of macro definitions
258 .
259 .
260 .\" ====================================================================
261 .SH Description
262 .\" ====================================================================
263 .
264 .I groff
265 is short for GNU
266 .IR roff ,
267 a free reimplementation of the AT&T device-independent
268 .I troff \" AT&T
269 typesetting system.
270 .
271 See
272 .MR roff 7
273 for a survey of and background on
274 .I roff
275 systems.
276 .
277 .
278 .P
279 This document is intended as a reference.
280 .
281 The primary
282 .I groff
283 manual,
284 .IR "Groff: The GNU Implementation of troff" ,
285 by Trent A.\& Fisher and Werner Lemberg,
286 is a better resource for learners,
287 containing many examples and much discussion.
288 .
289 It is written in Texinfo;
290 you can browse it interactively with \[lq]info groff\[rq].
291 .
292 Additional formats,
293 including plain text,
294 HTML,
295 \*(tx DVI,
296 and PDF,
297 may be available in
298 .IR /usr/\:\%share/\:\%doc/\:\%groff .
299 .
300 .
301 .\" BEGIN Keep parallel with groff.texi node "Conventions Used in This
302 .\" Manual", first paragraph.
303 .P
304 We apply the term \[lq]groff\[rq] to the language documented here,
305 the GNU implementation of the overall system,
306 the project that develops that system,
307 and the command of that name.
308 .
309 In the first sense,
310 .I groff
311 is an extended dialect of the
312 .I roff
313 language,
314 for which many
315 similar implementations exist.
316 .
317 We say \[lq]the formatter\[rq] when speaking of behavior
318 that is generally true of
319 .I troff \" generic
320 and
321 .I nroff \" generic
322 programs.
323 .\" END Keep parallel with groff.texi node "Conventions Used in This
324 .\" Manual", first paragraph.
325 .
326 .
327 .P
328 GNU
329 .IR troff , \" GNU
330 installed on this system as
331 .MR \%troff 1 ,
332 is the
333 .I formatter:
334 a program that reads device and font descriptions
335 (\c
336 .MR groff_font 5 ),
337 interprets the
338 .I groff
339 language expressed in input text,
340 and translates it into a device-independent page description language
341 (\c
342 .MR groff_out 5 )
343 that is usually then post-processed by an output driver to produce
344 PostScript,
345 PDF,
346 HTML,
347 DVI,
348 or terminal output.
349 .
350 .
351 .\" ====================================================================
352 .SH "Input format"
353 .\" ====================================================================
354 .
355 .\" BEGIN Keep (roughly) parallel with groff.texi node "Input Format".
356 Organize input to
357 GNU
358 .I troff \" GNU
359 into lines separated by the Unix newline character
360 (U+000A),
361 using the character encoding it recognizes:
362 ISO\~Latin-1 (8859-1).
363 .
364 We recommend use of ISO\~646:1991\~IRV (US-ASCII)
365 or (equivalently) the Basic Latin subset
366 of ISO\~10646 (Unicode);
367 see
368 .MR groff_char 7 .
369 .
370 .
371 .P
372 Some control characters
373 (from the sets \[lq]C0 Controls\[rq] and \[lq]C1 Controls\[rq]
374 as Unicode describes them)
375 are invalid as input characters.
376 .
377 GNU
378 .I troff \" GNU
379 discards them upon reading.
380 (It also emits a warning in category
381 \[lq]input\[rq];
382 see section \[lq]Warnings\[rq] of
383 .MR \%troff 1 .)
384 .
385 It processes
386 a character sequence \[lq]foo\[rq],
387 followed by an invalid
388 character and then \[lq]bar\[rq],
389 as \[lq]foobar\[rq].
390 .
391 .
392 .P
393 Invalid input characters comprise
394 .BR 0x00 ,
395 .BR 0x0B ,
396 .BR 0x0D \[en] 0x1F ,
397 and
398 .BR 0x80 \[en] 0x9F .
399 (Historically,
400 control characters like
401 ASCII
402 STX,
403 ETX,
404 and
405 BEL
406 (Control+B,
407 Control+C,
408 and
409 Control+G)
410 respectively)
411 have been observed in
412 .I roff
413 documents,
414 particularly in macro packages employing them as delimiters
415 with the output comparison operator
416 to try to avoid collisions with the content
417 of arbitrary user-supplied parameters
418 (see subsection \[lq]Conditional expressions\[rq] below).
419 .
420 We discourage this expedient;
421 in
422 GNU
423 .I troff \" GNU
424 it is unnecessary
425 (outside of compatibility mode)
426 because the program parses delimited arguments
427 at a different input level than their surrounding context.
428 .
429 See section \[lq]Miscellaneous\[rq] of
430 .MR groff_diff 7 .)
431 .
432 GNU
433 .I troff \" GNU
434 uses some of these code points for internal purposes,
435 making non-trivial the extension of the program
436 to accept UTF-8
437 or other encodings that use characters from these ranges.
438 .\" END Keep (roughly) parallel with groff.texi node "Input Format".
439 .
440 .
441 .\" ====================================================================
442 .SH "Syntax characters"
443 .\" ====================================================================
444 .
445 Several input characters are syntactically significant to
446 .IR groff .
447 .
448 The most important of these distinguish
449 .I "control lines,"
450 which instruct the formatter,
451 from
452 .I "text lines"
453 that are formatted as output.
454 .
455 .
456 .IP . 4n
457 A dot at the beginning of an input line marks it as a control line.
458 .
459 It can also follow the
460 .request el
461 and
462 .request nop
463 requests,
464 and the condition in
465 .RB \[lq] if \[rq],
466 .request ie ,
467 and
468 .RB \[lq] while \[rq]
469 requests.
470 .
471 The control character invokes requests and calls macros by the name that
472 follows it.
473 .
474 The
475 .request cc
476 request can change the control character.
477 .
478 .
479 .IP \[aq]
480 The neutral apostrophe is the
481 .I "no-break control character,"
482 recognized where the control character is.
483 .
484 It suppresses the (first) break implied by the
485 .request bp ,
486 .request ce ,
487 .request cf ,
488 .request fi ,
489 .request fl ,
490 .RB \[lq] in \[rq],
491 .request nf ,
492 .request rj ,
493 .request sp ,
494 .request ti ,
495 and
496 .request trf
497 requests.
498 .
499 The requested operation takes effect at the next break.
500 .
501 It makes
502 .request br
503 and
504 .request brp
505 nilpotent.
506 .
507 The no-break control character can be changed with the
508 .request c2
509 request.
510 .
511 When formatted,
512 .RB \[lq] \[aq] \[rq]
513 may be typeset as a typographical quotation mark;
514 use the
515 .esc [aq]
516 special character escape sequence to format a neutral apostrophe glyph.
517 .
518 .
519 .IP \[dq]
520 The neutral double quote can be used to enclose arguments to macros and
521 strings,
522 and is required if those arguments contain space or tab characters.
523 .
524 The requests
525 .RB \[lq] as \[rq],
526 .request as1 ,
527 .request cf ,
528 .request char ,
529 .request ds ,
530 .request ds1 ,
531 .request fchar ,
532 .request fschar ,
533 .request mso ,
534 .request msoquiet ,
535 .request nx ,
536 .RB \[lq] open \[rq],
537 .request opena ,
538 .request pi ,
539 .request schar ,
540 .RB \[lq] so \[rq],
541 .request soquiet ,
542 .request sy ,
543 and
544 .request trf
545 strip a leading neutral double quote
546 from their final arguments
547 to allow embedding of leading spaces.
548 All such arguments are \[lq]strings\[rq] in a general sense,
549 representing character sequences,
550 file names,
551 operating system commands,
552 or parameters to an output device extension command.
553 .
554 To include a double quote inside a quoted argument,
555 use the
556 .esc [dq]
557 special character escape sequence
558 (which also serves to typeset the glyph in text).
559 .
560 .
561 .IP \[rs]
562 A backslash introduces an escape sequence.
563 .
564 The escape character can be changed with the
565 .request ec
566 request;
567 .request eo
568 disables escape sequence recognition.
569 .
570 Use the
571 .esc [rs]
572 special character escape sequence to format a backslash glyph,
573 and
574 .esc e
575 to typeset the glyph of the current escape character.
576 .
577 .
578 .IP (
579 An opening parenthesis is special only in certain escape sequences;
580 when recognized,
581 it introduces an argument of exactly two characters.
582 .
583 .I groff
584 offers the more flexible square bracket syntax.
585 .
586 .
587 .IP [
588 An opening bracket is special only in certain escape sequences;
589 when recognized,
590 it introduces an argument (list) of any length,
591 not including a closing bracket.
592 .
593 .
594 .IP ]
595 A closing bracket is special only when an escape sequence using an
596 opening bracket as an argument delimiter is being interpreted.
597 .
598 It ends the argument (list).
599 .
600 .
601 .P
602 Additionally,
603 the Control+A character (U+0001) in text is interpreted as a
604 .I leader
605 (see below).
606 .
607 .
608 .P
609 Horizontal whitespace characters are significant to
610 .I groff,
611 but trailing spaces on text lines are ignored.
612 .\" slack text for widow/orphan control: trailing tabs are not
613 .
614 .
615 .TP 9n \" "newline" + 2n
616 .I space
617 On control lines and within bracketed escape sequences,
618 spaces separate arguments.
619 .
620 On text lines,
621 they separate words.
622 .
623 Multiple adjacent space characters in text cause
624 .I groff
625 to attempt end-of-sentence detection on the preceding word
626 (and trailing punctuation).
627 .
628 The amount of space between words and sentences is controlled by the
629 .request ss
630 request.
631 .
632 When filling is enabled
633 (the default),
634 a line may be broken at a space.
635 .
636 When adjustment is enabled
637 (the default),
638 inter-word spaces are expanded until the output line reaches the
639 configured length.
640 .
641 An adjustable but non-breaking space is available with
642 .esc \[ti] .
643 .
644 To get a space of fixed width,
645 use one of the escape sequences
646 .squoted_char "\[rs]\~"
647 (the escape character followed by a space),
648 .esc 0 ,
649 .esc | ,
650 .esc \[ha] ,
651 or
652 .esc h ;
653 see section \[lq]Escape sequences\[rq] below.
654 .
655 .
656 .TP
657 .I newline
658 On text lines,
659 a newline formats an inter-word space and,
660 if filling is enabled,
661 triggers end-of-sentence recognition on the preceding text.
662 .
663 See section \[lq]Line continuation\[rq] below.
664 .
665 .
666 .TP
667 .I tab
668 A tab character on a text line causes the drawing position to advance to
669 the next defined tab stop.
670 .
671 .
672 .\" ====================================================================
673 .SH Sentences
674 .\" ====================================================================
675 .
676 Configure the sets of characters that potentially end sentences
677 or are transparent to sentence endings
678 with the
679 .B \%cflags
680 request.
681 .\" (@pxref{Using Symbols}).
682 .
683 Use the
684 .B ss
685 request
686 to change\[em]or eliminate\[em]supplemental inter-sentence space.
687 .\" (@pxref{Manipulating Filling and Adjustment}).
688 .
689 .\" ====================================================================
690 .SH "Tabs and leaders"
691 .\" ====================================================================
692 .
693 .\" BEGIN Keep (roughly) parallel with groff.texi node "Tabs and
694 .\" Leaders".
695 The formatter interprets input horizontal tab characters
696 (\[lq]tabs\[rq]) and Control+A characters (\[lq]leaders\[rq]) into
697 movements to the next tab stop.
698 .
699 Tabs simply move to the next tab stop;
700 leaders place enough periods to fill the space.
701 .
702 Tab stops are by default located every half inch measured from the
703 drawing position corresponding to the beginning of the input line;
704 see section \[lq]Page geometry\[rq] of
705 .MR roff 7 .
706 .
707 Tabs and leaders do not cause breaks and therefore do not interrupt
708 filling.
709 .
710 Tab stops can be configured with the
711 .B ta
712 request,
713 and tab and leader glyphs with the
714 .B tc
715 and
716 .B lc
717 requests,
718 respectively.
719 .\" END Keep (roughly) parallel with groff.texi node "Tabs and Leaders".
720 .
721 .
722 .\" ====================================================================
723 .SH "Line continuation"
724 .\" ====================================================================
725 .
726 When filling is enabled,
727 input and output line breaks generally do not correspond.
728 .
729 The
730 .I roff
731 language therefore distinguishes input and output line continuation.
732 .
733 .
734 .P
735 A backslash
736 .B \[rs]
737 immediately followed by a newline,
738 sometimes discussed as
739 .BI \[rs] newline\c
740 ,
741 suppresses the effects of that newline
742 on the input.
743 .
744 The next input line thus retains the classification of its predecessor
745 as a control or text line.
746 .
747 .BI \[rs] newline
748 is useful for managing line lengths in the input during document
749 maintenance;
750 you can break an input line at a space,
751 or in the middle of a word,
752 request invocation,
753 macro call,
754 or escape sequence.
755 .
756 Input line continuation is invisible to the formatter,
757 with two exceptions:
758 the
759 .B \[or]
760 operator recognizes the new input line,
761 and the input line counter register
762 .B .c
763 increments.
764 .
765 .
766 .P
767 The
768 .esc c
769 escape sequence continues an
770 .I output
771 line.
772 .
773 Nothing on the input line after it is formatted.
774 .
775 In contrast to
776 .BI \[rs] newline\c
777 ,
778 a line after
779 .esc c
780 is treated as a new input line,
781 so a control character is recognized at its beginning.
782 .
783 The visual results depend on whether filling is enabled.
784 .
785 An intervening control line that causes a break overrides
786 .esc c ,
787 flushing out the pending output line in the usual way.
788 .
789 The
790 .register .int
791 interpolates a positive value only if the pending output line has been
792 continued with
793 .esc c ;
794 this datum is associated with the
795 environment.
796 .
797 .
798 .\" ====================================================================
799 .SH Colors
800 .\" ====================================================================
801 .
802 .\" BEGIN Keep (roughly) parallel with groff.texi node "Colors".
803 .I groff
804 supports color output with a variety of color spaces and up to 16 bits
805 per channel.
806 .
807 Some devices,
808 particularly terminals,
809 may be more limited.
810 .
811 When color support is enabled,
812 two colors are current at any given time:
813 the
814 .I stroke color,
815 with which glyphs,
816 rules (lines),
817 and geometric objects like circles and polygons are drawn,
818 and the
819 .I fill color,
820 which can be used to paint the interior of a closed geometric figure.
821 .
822 The
823 .BR color ,
824 .BR \%defcolor ,
825 .BR gcolor ,
826 and
827 .B fcolor
828 requests;
829 .B \[rs]m
830 and
831 .B \[rs]M
832 escape sequences;
833 and
834 .BR .color ,
835 .BR .m ,
836 and
837 .B .M
838 registers exercise color support.
839 .
840 .
841 .P
842 Each output device has a color named
843 .RB \[lq] default \[rq],
844 which cannot be redefined.
845 .
846 A device's default stroke and fill colors are not necessarily the same.
847 .
848 For the
849 .BR dvi ,
850 .BR html ,
851 .BR pdf ,
852 .BR ps ,
853 and
854 .B xhtml
855 output devices,
856 .I \%troff
857 automatically loads a macro file defining many color names at startup.
858 .
859 By the same mechanism,
860 the devices supported by
861 .MR grotty 1
862 recognize the eight standard ISO\~6429/ECMA-48 color names.
863 (These are known vulgarly as \[lq]ANSI\[rq] colors,
864 after its X3.64 standard,
865 now withdrawn.)
866 .\" END Keep (roughly) parallel with groff.texi node "Colors".
867 .
868 .
869 .br
870 .ne 3v
871 .\" ====================================================================
872 .SH Measurements
873 .\" ====================================================================
874 .
875 .\" BEGIN Keep (roughly) parallel with groff.texi node "Measurements".
876 Express numeric parameters that specify measurements
877 as integers
878 or decimal fractions
879 with an optional scaling unit suffixed.
880 .
881 A
882 .I "scaling unit"
883 is a letter
884 that immediately follows the magnitude of a measurement.
885 .
886 Digits after the decimal point are optional.
887 .
888 .
889 .P
890 The formatter scales measurements by the specified scaling unit,
891 storing them internally
892 (with any fractional part discarded)
893 in basic units.
894 .
895 The device resolution can therefore be obtained
896 by storing a value of
897 .RB \[lq] 1i \[rq]
898 to a register,
899 then reading the register.
900 .
901 .
902 .P
903 .LS
904 .TP
905 .B u
906 Basic unit;
907 it is at least as small as any other unit.
908 .
909 .TP
910 .B i
911 Inch;
912 defined as 2.54\~centimeters.
913 .
914 .TP
915 .B c
916 Centimeter.
917 .
918 .TP
919 .B p
920 Point;
921 a typesetter's unit used for measuring type size.
922 .
923 There are 72\~points to an inch.
924 .
925 .TP
926 .B P
927 Pica;
928 another typesetter's unit.
929 .
930 There are 6\~picas to an inch and 12\~points to a pica.
931 .
932 .TP
933 .B z
934 Typographical point;
935 like
936 .BR p ,
937 but used only with type sizes,
938 to overcome a limitation of AT&T
939 .IR troff . \" AT&T
940 .
941 .TP
942 .B s
943 Scaled point.
944 .
945 .TP
946 .B f
947 Multiplication by 65,536;
948 .
949 scales decimal fractions in the interval [0, 1] to 16-bit unsigned
950 integers.
951 .LE
952 .
953 .
954 .P
955 The magnitudes of other scaling units depend on the text formatting
956 parameters in effect.
957 .
958 .
959 .P
960 .LS
961 .TP
962 .B m
963 Em;
964 an em is equal to the current type size in points.
965 .
966 .TP
967 .B n
968 En;
969 on typesetters,
970 an en is one-half em,
971 but on terminals an en equals an em.
972 .
973 .TP
974 .B v
975 Vee;
976 distance between text baselines.
977 .
978 .TP
979 .B M
980 Hundredth of an em.
981 .LE
982 .\" END Keep (roughly) parallel with groff.texi node "Measurements".
983 .
984 .
985 .\" ====================================================================
986 .SS "Motion quanta"
987 .\" ====================================================================
988 .
989 .\" BEGIN Keep (roughly) parallel with groff.texi node "Motion Quanta".
990 The basic unit
991 .B u
992 is not necessarily an output device's smallest addressable length;
993 .B u
994 can be smaller to avoid integer rounding errors.
995 .
996 The minimum distances that a device can work with
997 in the horizontal and vertical directions are termed its
998 .I "motion quanta,"
999 stored in the
1000 .B .H
1001 and
1002 .B .V
1003 registers,
1004 respectively.
1005 .
1006 The formatter rounds measurements to applicable motion quanta.
1007 .
1008 Half-quantum fractions round toward zero.
1009 .\" END Keep (roughly) parallel with groff.texi node "Motion Quanta".
1010 .
1011 .
1012 .\" ====================================================================
1013 .SS "Default units"
1014 .\" ====================================================================
1015 .
1016 .\" BEGIN Keep (roughly) parallel with groff.texi node "Default Units".
1017 A general-purpose register
1018 (one created or updated with the
1019 .B nr
1020 request;
1021 see section \[lq]Registers\[rq] below)
1022 is implicitly dimensionless,
1023 or reckoned in basic units if interpreted in a measurement context.
1024 .
1025 But it is convenient for many requests and escape sequences to infer a
1026 scaling unit for an argument if none is specified.
1027 .
1028 An explicit scaling unit
1029 (not after a closing parenthesis)
1030 can override an undesirable default.
1031 .
1032 Effectively,
1033 the default unit is suffixed to the expression if a scaling unit is not
1034 already present.
1035 .
1036 GNU
1037 .IR troff 's \" GNU
1038 use of integer arithmetic in numeric expressions
1039 should also be kept in mind.
1040 .\" END Keep (roughly) parallel with groff.texi node "Default Units".
1041 .
1042 .
1043 .br
1044 .ne 5v
1045 .\" ====================================================================
1046 .SH "Numeric expressions"
1047 .\" ====================================================================
1048 .
1049 .\" BEGIN Keep (roughly) parallel with groff.texi node "Numeric
1050 .\" expressions".
1051 When evaluated,
1052 a
1053 .I numeric expression
1054 interpolates an integer.
1055 .\"It can be as simple as a literal
1056 .\".RB \[lq] 0 \[rq]
1057 .\"or it can be a complex sequence of register and string interpolations
1058 .\"interleaved with measurements and operators.
1059 .
1060 GNU
1061 .I troff \" GNU
1062 recognizes the following operators.
1063 .
1064 .
1065 .P
1066 .TS
1067 Rf(CR) L.
1068 + addition
1069 \- subtraction
1070 * multiplication
1071 / truncating division
1072 % modulus
1073 _
1074 \f[R]unary\f[] + assertion, motion, incrementation
1075 \f[R]unary\f[] \- negation, motion, decrementation
1076 _
1077 ; scaling
1078 >? maximum
1079 <? minimum
1080 _
1081 < less than
1082 > greater than
1083 <= less than or equal
1084 >= greater than or equal
1085 \&= equal
1086 == equal
1087 _
1088 & logical conjunction (\[lq]and\[rq])
1089 : logical disjunction (\[lq]or\[rq])
1090 ! logical complementation (\[lq]not\[rq])
1091 _
1092 ( ) precedence
1093 _
1094 | boundary-relative measurement
1095 .TE
1096 .
1097 .
1098 .P
1099 .I \%troff
1100 provides a set of mathematical and logical operators familiar to
1101 programmers\[em]as well as some unusual ones\[em]but supports only
1102 integer arithmetic.
1103 .
1104 (Provision is made for interpreting and
1105 reporting decimal fractions in certain cases.)
1106 .
1107 The internal data type used for computing results depends on the host
1108 machine but is at least a 32-bit signed integer,
1109 which suffices to represent magnitudes within a range of \[+-]2
1110 billion.
1111 .
1112 (If that's not enough, see
1113 .MR groff_tmac 5
1114 for the
1115 .I 62bit.tmac
1116 macro package.)
1117 .
1118 Arithmetic saturates.
1119 (If overflow would occur,
1120 GNU
1121 .I troff \" GNU
1122 emits a warning in category
1123 .RB \%\[lq] range \[rq].
1124 See section \[lq]Warnings\[rq] of
1125 .MR \%troff 1 .)
1126 .
1127 .
1128 .P
1129 Arithmetic infix operators perform a function on the numeric expressions
1130 to their left and right;
1131 they are
1132 .B +
1133 (addition),
1134 .B \-
1135 (subtraction),
1136 .B *
1137 (multiplication),
1138 .B /
1139 (truncating division),
1140 and
1141 .B %
1142 (modulus).
1143 .
1144 .I Truncating division
1145 rounds to the integer nearer to zero,
1146 no matter how large the fractional portion.
1147 .
1148 Division and modulus by zero
1149 are errors and abort evaluation of a numeric expression.
1150 .
1151 .
1152 .P
1153 Arithmetic unary operators operate on the numeric expression to their
1154 right;
1155 they are
1156 .B \-
1157 (negation)
1158 and
1159 .B +
1160 (assertion\[em]for completeness;
1161 it does nothing).
1162 .
1163 The unary minus must often be used with parentheses to avoid confusion
1164 with the decrementation operator,
1165 discussed below.
1166 .
1167 .
1168 .P
1169 The sign of the modulus of operands of mixed signs is determined by the
1170 sign of the first.
1171 .
1172 Division and modulus operators satisfy the following property:
1173 given a
1174 .RI dividend\~ a
1175 and a
1176 .RI divisor\~ b ,
1177 a
1178 .RI quotient\~ q
1179 formed by
1180 .RB \[lq] "(a / b)" \[rq]
1181 and a
1182 .RI remainder\~ r
1183 by
1184 .RB \[lq] "(a % b)" \[rq],
1185 then
1186 .IR qb \~+\~ r \~=\~ a .
1187 .
1188 .
1189 .P
1190 GNU
1191 .IR troff 's \" GNU
1192 scaling operator,
1193 used with parentheses as
1194 .BI ( c ; e )\c
1195 ,
1196 evaluates a numeric
1197 .RI expression\~ e
1198 .RI using\~ c
1199 as the default scaling unit.
1200 .
1201 If
1202 .I c
1203 is omitted,
1204 scaling units are ignored in the evaluation
1205 .RI of\~ e .
1206 .
1207 GNU
1208 .I troff \" GNU
1209 also provides a pair of operators to compute the extremum of two
1210 operands:
1211 .B >?\&
1212 (maximum)
1213 and
1214 .B <?\&
1215 (minimum).
1216 .
1217 .
1218 .P
1219 Comparison operators comprise
1220 .B <
1221 (less than),
1222 .B >
1223 (greater than),
1224 .B <=
1225 (less than or equal),
1226 .B >=
1227 (greater than or equal),
1228 and
1229 .B =
1230 (equal,
1231 with a synonym
1232 .BR == ).
1233 .
1234 When evaluating a comparison,
1235 the formatter replaces it with
1236 .RB \[lq] 0 \[rq]
1237 if it is false and
1238 .RB \[lq] 1 \[rq]
1239 if true.
1240 .
1241 In the
1242 .I roff
1243 language,
1244 positive values are true,
1245 others false.
1246 .
1247 .
1248 .P
1249 Operate on truth values with the logical operators
1250 .B &
1251 (logical conjunction or \[lq]and\[rq])
1252 and
1253 .B :
1254 (logical disjunction or \[lq]or\[rq]).
1255 .
1256 They evaluate as comparison operators do.
1257 .
1258 A logical complementation (\[lq]not\[rq]) operator,
1259 .B !\&,
1260 works only within
1261 .RB \[lq] if \[rq],
1262 .RB \[lq] ie \[rq],
1263 and
1264 .RB \[lq] while \[rq]
1265 requests.
1266 .
1267 .\" This is worded to avoid implying that the operator doesn't apply to
1268 .\" conditional expressions in general, albeit without mentioning them
1269 .\" because they're out of scope.
1270 Furthermore,
1271 the formatter recognizes
1272 .B !\&
1273 only at the beginning of a numeric expression
1274 not contained by another numeric expression.
1275 .
1276 In other words,
1277 .B !\&
1278 must be the \[lq]outermost\[rq] operator.
1279 .
1280 Its presence elsewhere causes the expression
1281 to evaluate false.
1282 .
1283 (GNU
1284 .I troff \" GNU
1285 emits a warning in category
1286 .RB \%\[lq] number \[rq].
1287 See section \[lq]Warnings\[rq] of
1288 .MR \%troff 1 .)
1289 .
1290 This unfortunate limitation maintains compatibility with AT&T
1291 .IR troff .\" AT&T
1292 .
1293 Test a numeric expression for falsity
1294 within a complex expression
1295 by comparing it to a false value.
1296 .
1297 .
1298 .P
1299 The
1300 .I roff
1301 language has no operator precedence:
1302 expressions are evaluated strictly from left to right,
1303 in contrast to schoolhouse arithmetic.
1304 .
1305 Use parentheses
1306 .B ( )
1307 to impose a desired precedence upon subexpressions.
1308 .
1309 .
1310 .P
1311 For many requests and escape sequences that cause motion on the page,
1312 the unary operators
1313 .B +
1314 and
1315 .B \-
1316 work differently when leading a numeric expression.
1317 .
1318 They then indicate a motion relative to the drawing position:
1319 positive is down in vertical contexts,
1320 right in horizontal ones.
1321 .
1322 .
1323 .P
1324 .B +
1325 and
1326 .B \-
1327 are also treated differently by the following requests and escape
1328 sequences:
1329 .BR bp ,
1330 .BR in ,
1331 .BR ll ,
1332 .BR pl ,
1333 .BR pn ,
1334 .BR po ,
1335 .BR ps ,
1336 .BR pvs ,
1337 .BR rt ,
1338 .BR ti ,
1339 .BR \[rs]H ,
1340 .BR \[rs]R ,
1341 and
1342 .BR \[rs]s .
1343 .
1344 Here,
1345 leading plus and minus signs serve as incrementation and decrementation
1346 operators,
1347 respectively.
1348 .
1349 To negate an expression in these contexts,
1350 subtract it from zero
1351 or include the unary minus in parentheses with its argument.
1352 .\" @xref{Setting Registers}, for examples.
1353 .
1354 .
1355 .P
1356 A leading
1357 .B \[or]
1358 operator indicates a motion relative not to the drawing position but to
1359 a boundary.
1360 .
1361 For horizontal motions,
1362 the measurement specifies a distance relative to a drawing position
1363 corresponding to the beginning of the
1364 .I input
1365 line.
1366 .
1367 By default,
1368 tab stops reckon movements in this way.
1369 Most escape sequences do not;
1370 .\" XXX: Which ones do?
1371 .B \[or]
1372 tells them to do so.
1373 .
1374 For vertical motions,
1375 the
1376 .B \[or]
1377 operator specifies a distance from the first text baseline on the page
1378 or in the current diversion,
1379 using the current vertical spacing.
1380 .
1381 .
1382 .P
1383 The
1384 .B \[rs]B
1385 escape sequence tests its argument for validity as a numeric expression.
1386 .
1387 .
1388 .br
1389 .ne 2v
1390 .P
1391 A register interpolated as an operand in a numeric expression must have
1392 an Arabic format;
1393 luckily,
1394 this is the default.\" @xref{Assigning Register Formats}.
1395 .
1396 .
1397 .P
1398 Because spaces separate arguments to requests,
1399 spaces are not allowed in numeric expressions
1400 unless parentheses surround the (sub)expression containing them.
1401 .\"@xref{Invoking Requests}, and
1402 .\"@ref{Conditionals and Loops}.
1403 .\" END Keep (roughly) parallel with groff.texi node "Numeric
1404 .\" expressions".
1405 .
1406 .
1407 .\" ====================================================================
1408 .SH Identifiers
1409 .\" ====================================================================
1410 .
1411 .\" BEGIN Keep (roughly) parallel with groff.texi node "Identifiers".
1412 An
1413 .I identifier
1414 labels a GNU
1415 .I troff \" GNU
1416 datum such as a register,
1417 name
1418 (macro,
1419 string,
1420 or diversion),
1421 typeface,
1422 color,
1423 special character or character class,
1424 hyphenation language code,
1425 environment,
1426 or stream.
1427 .
1428 Valid identifiers consist of one or more ordinary characters.
1429 .
1430 An
1431 .I "ordinary character"
1432 is any Unicode Basic Latin character
1433 that is not a space and not the escape character;
1434 recall section \[lq]Input format\[rq] above.
1435 .
1436 .
1437 .P
1438 An identifier with a closing bracket (\[lq]]\[rq]) in its name can't be
1439 accessed with bracket-form escape sequences that expect an identifier as
1440 a parameter.
1441 .
1442 Similarly,
1443 the
1444 identifier \[lq](\[rq] can't be interpolated
1445 .I except
1446 with bracket forms.
1447 .
1448 .
1449 .P
1450 Beginning a macro,
1451 string,
1452 or diversion name with the character
1453 \[lq][\[rq]
1454 or
1455 \[lq]]\[rq]
1456 forecloses use of the
1457 .MR \%refer 1
1458 preprocessor,
1459 which recognizes input lines starting with
1460 \[lq].[\[rq]
1461 and
1462 \[lq].]\[rq]
1463 as bibliographic reference delimiters.
1464 .
1465 .
1466 .P
1467 The escape sequence
1468 .B \[rs]A
1469 tests its argument for validity as an identifier.
1470 .
1471 .
1472 .P
1473 The formatter's handling of undefined identifiers is context-dependent.
1474 .
1475 There is no way to invoke an undefined request;
1476 such syntax is interpreted as a macro call instead.
1477 .
1478 If the identifier is interpreted as a string,
1479 macro,
1480 or diversion name,
1481 the formatter defines it as empty and interpolates nothing.
1482 (GNU
1483 .I troff \" GNU
1484 emits a warning in category
1485 .RB \[lq] mac \[rq].
1486 See section \[lq]Warnings\[rq] of
1487 .MR \%troff 1 .)
1488 .
1489 Similarly,
1490 if the identifier is interpreted as a register name,
1491 the formatter initializes it to zero
1492 and interpolates that value.
1493 GNU
1494 .I troff \" GNU
1495 emits a warning in category
1496 .RB \[lq] reg \[rq];
1497 see section \[lq]Warnings\[rq] in
1498 .MR \%troff 1 ,
1499 and subsection \[lq]Interpolating registers\[rq] and section
1500 \[lq]Strings\[rq] below.
1501 .
1502 Attempting to use an undefined
1503 typeface,
1504 special character or character class,
1505 color,
1506 environment,
1507 hyphenation language code,
1508 or
1509 stream
1510 generally provokes an error diagnostic.
1511 .
1512 .
1513 .P
1514 Identifiers for requests,
1515 macros,
1516 strings,
1517 and diversions share one name
1518 space;
1519 special characters and character classes another.
1520 .
1521 No other object types do.
1522 .\" END Keep (roughly) parallel with groff.texi node "Identifiers".
1523 .
1524 .
1525 .br
1526 .ne 4v
1527 .\" ====================================================================
1528 .SH "Control characters"
1529 .\" ====================================================================
1530 .
1531 .\" BEGIN Keep (roughly) parallel with groff.texi node "Control
1532 .\" Characters".
1533 .\" The mechanism of using @code{roff}'s control characters to invoke
1534 .\" requests and call macros was introduced in @ref{Requests and Macros}.
1535 The formatter recognizes a control character
1536 only at the beginning of an input line,
1537 or at the beginning of a branch of a control structure request;
1538 .\" see @ref{Conditionals and Loops}.
1539 see section \[lq]Control structures\[rq] below.
1540 .
1541 .
1542 .P
1543 A few requests cause a break implicitly;
1544 use the no-break control character to prevent the break.
1545 .
1546 Break suppression is its sole behavioral distinction.
1547 .
1548 Employing the no-break control character to invoke requests that don't
1549 cause breaks is harmless but poor style.
1550 .
1551 .
1552 .P
1553 The control character
1554 .RB \[lq] .\& \[rq]
1555 and the no-break control character
1556 .RB \[lq] \|\[aq]\| \[rq]
1557 can be changed with the
1558 .B cc
1559 and
1560 .B c2
1561 requests,
1562 respectively.
1563 .
1564 Within a macro definition,
1565 .\" you might wish to know
1566 register
1567 .B .br
1568 indicates the control character used to call it.
1569 .\" END Keep (roughly) parallel with groff.texi node "Control
1570 .\" Characters".
1571 .
1572 .
1573 .\" ====================================================================
1574 .SH "Invoking requests"
1575 .\" ====================================================================
1576 .
1577 .\" BEGIN Keep (roughly) parallel with groff.texi node "Invoking
1578 .\" Requests".
1579 A control character is optionally followed by tabs and/or spaces and
1580 then an identifier naming a request or macro.
1581 .
1582 The invocation of an unrecognized request is interpreted as a macro
1583 call.
1584 .
1585 Defining a macro with the same name as a request replaces the request.
1586 .
1587 Deleting a request name with the
1588 .B rm
1589 request makes it unavailable.
1590 .
1591 The
1592 .B als
1593 request can alias requests,
1594 permitting them to be wrapped or non-destructively replaced.
1595 .
1596 See section \[lq]Strings\[rq] below.
1597 .
1598 .
1599 .br
1600 .ne 4v
1601 .P
1602 There is no inherent limit on argument length or quantity.
1603 .
1604 Most requests take one or more arguments,
1605 and ignore any they do not expect.
1606 .
1607 A request may be separated from its arguments by tabs or spaces,
1608 but only spaces can separate an argument from its successor.
1609 .
1610 Only one between arguments is necessary;
1611 any excess is ignored.
1612 .
1613 .\" slack text for widow/orphan management
1614 .\" (In compatibility mode,
1615 .\" a space is not necessary
1616 .\" after a request or macro name of two characters' length.)
1617 .
1618 GNU
1619 .I troff \" GNU
1620 does not allow tabs for argument separation.
1621 .
1622 (Plan\~9
1623 .I troff \" Plan 9
1624 does.)
1625 .
1626 .
1627 .br
1628 .ne 3v
1629 .P
1630 Generally,
1631 a space
1632 .I within
1633 a request argument is not relevant,
1634 not meaningful,
1635 or is supported by bespoke provisions,
1636 as with the
1637 .B tl
1638 request's delimiters.
1639 .
1640 Some requests,
1641 like
1642 .BR ds ,
1643 interpret the remainder of the control line as a single argument.
1644 .
1645 See section \[lq]Strings\[rq] below.
1646 .
1647 .
1648 .P
1649 Spaces and tabs immediately after a control character are ignored.
1650 .
1651 Commonly,
1652 authors use them to indent the source of documents or macro files.
1653 .\" END Keep (roughly) parallel with groff.texi node "Invoking
1654 .\" Requests".
1655 .
1656 .
1657 .\" ====================================================================
1658 .SH "Calling macros"
1659 .\" ====================================================================
1660 .
1661 .\" BEGIN Keep (roughly) parallel with groff.texi node "Calling Macros".
1662 If a macro of the desired name does not exist when called,
1663 the formatter creates it
1664 and assigns it an empty definition.
1665 .
1666 (GNU
1667 .I troff \" GNU
1668 emits a warning in category
1669 .RB \[lq] mac \[rq].
1670 .
1671 See section \[lq]Warnings\[rq] in
1672 .MR \%troff 1 .)
1673 .
1674 Calling an undefined macro
1675 .I does
1676 end a macro definition naming it as its end macro
1677 (see section \[lq]Writing macros\[rq] below).
1678 .
1679 .
1680 .P
1681 To embed spaces
1682 .I within
1683 a macro argument,
1684 enclose the argument in neutral double quotes
1685 .RB \[oq] \|\[dq]\| \[cq].
1686 .
1687 Horizontal motion escape sequences are sometimes a better choice for
1688 arguments to be formatted as text.
1689 .
1690 .
1691 .P
1692 The foregoing raises the question of how to embed neutral double quotes
1693 or backslashes in macro arguments when
1694 .I those
1695 characters are desired as literals.
1696 .
1697 In GNU
1698 .IR troff , \" GNU
1699 the special character escape sequence
1700 .B \[rs][rs]
1701 produces a backslash and
1702 .B \[rs][dq]
1703 a neutral double quote.
1704 .
1705 .
1706 .P
1707 In GNU
1708 .IR troff 's \" GNU
1709 AT&T compatibility mode,
1710 these characters remain available as
1711 .B \[rs](rs
1712 and
1713 .BR \[rs](dq ,
1714 respectively.
1715 .
1716 AT&T
1717 .I troff \" AT&T
1718 did not consistently define these special characters,
1719 .\" It seems that AT&T troff never recognized \(rs, though DWB 3.3
1720 .\" defined \(bs as an alias of "\" on its "Latin1" device, in
1721 .\" deliberate(?) collision with the Bell System logo identifier. It
1722 .\" also defined \(dq for several devices (pcl, Latin1, nroff, ...)
1723 .\" along with \(aq.
1724 but its descendants can be made to support them.
1725 .
1726 See
1727 .MR groff_font 5 .
1728 .
1729 If even that is not feasible,
1730 .\" Nope nope nope--if you're this much of a masochist, go read Texinfo.
1731 see the \[lq]Calling Macros\[rq] section of the
1732 .I groff
1733 Texinfo manual for the complex macro argument quoting rules of AT&T
1734 .IR troff . \" AT&T
1735 .\" END Keep (roughly) parallel with groff.texi node "Calling Macros".
1736 .
1737 .
1738 .\" ====================================================================
1739 .SH "Using escape sequences"
1740 .\" ====================================================================
1741 .
1742 .\" BEGIN Keep (roughly) parallel with groff.texi node "Using Escape
1743 .\" Sequences".
1744 Whereas requests must occur on control lines,
1745 escape sequences can occur intermixed with text and may appear in
1746 arguments to requests,
1747 macros,
1748 and other escape sequences.
1749 .
1750 An escape sequence is introduced by the escape character,
1751 a backslash
1752 .BR \[rs] .
1753 .\" (but see the @code{ec} request below)
1754 .
1755 The next character selects the escape's function.
1756 .
1757 .
1758 .P
1759 Escape sequences vary in length.
1760 .
1761 Some take an argument,
1762 and of those,
1763 some have different syntactical forms for a one-character,
1764 two-character,
1765 or arbitrary-length argument.
1766 .
1767 Others accept
1768 .I only
1769 an arbitrary-length argument.
1770 .
1771 In the former scheme,
1772 a one-character argument follows the function character immediately,
1773 an opening parenthesis
1774 .RB \[lq] ( \[rq]
1775 introduces a two-character argument
1776 (no closing parenthesis is used),
1777 and an argument of arbitrary length is enclosed in brackets
1778 .RB \[lq] [] \[rq].
1779 .
1780 In the latter scheme,
1781 the user selects a delimiter character.
1782 .
1783 A few escape sequences are idiosyncratic,
1784 and support both of the foregoing conventions
1785 .RB ( \|\[rs]s ),
1786 designate their own termination sequence
1787 .RB ( \|\[rs]? ),
1788 consume input until the next newline
1789 .RB ( \|\[rs]! ,
1790 .BR \|\[rs]" ,
1791 .BR \|\[rs]# ),
1792 or support an additional modifier character
1793 .RB ( \|\[rs]s
1794 again,
1795 and
1796 .BR \|\[rs]n ).
1797 .
1798 In no case can an escape sequence parameter contain an unescaped
1799 newline.
1800 .\" As with requests, use of some escape sequences in source documents
1801 .\" may interact poorly with a macro package you use; consult its
1802 .\" documentation to learn of ``safe'' sequences or alternative
1803 .\" facilities it provides to achieve the desired result.
1804 .
1805 .
1806 .P
1807 If the character that follows the escape character
1808 does not identify a defined operation,
1809 the formatter ignores the escape character.
1810 .
1811 (GNU
1812 .I troff \" GNU
1813 emits a warning in category
1814 .RB \%\[lq] escape \[rq].
1815 .
1816 See section \[lq]Warnings\[rq] in
1817 .MR \%troff 1 .)
1818 .
1819 .
1820 .P
1821 Escape sequence interpolation is of higher precedence than escape
1822 sequence argument interpretation.
1823 .
1824 This rule affords flexibility in using escape sequences to construct
1825 parameters to other escape sequences.
1826 .
1827 .
1828 .P
1829 The escape character can be interpolated
1830 .RB ( \[rs]e ).
1831 .
1832 Requests permit the escape mechanism to be deactivated
1833 .RB ( eo )
1834 and restored,
1835 or the escape character changed
1836 .RB ( ec ),
1837 and to save and restore it
1838 .RB ( ecs
1839 and
1840 .BR ecr ).
1841 .\" END Keep (roughly) parallel with groff.texi node "Using Escape
1842 .\" Sequences".
1843 .
1844 .
1845 .\" ====================================================================
1846 .SH Delimiters
1847 .\" ====================================================================
1848 .
1849 .\" BEGIN Keep (roughly) parallel with groff.texi node "Delimiters".
1850 Some escape sequences that require parameters use delimiters.
1851 .
1852 The neutral apostrophe
1853 .B \[aq]
1854 is a popular choice and shown in this document.
1855 .
1856 The neutral double quote
1857 .B \[dq]
1858 is also commonly seen.
1859 .
1860 Punctuation characters are the best choice
1861 (and most portable to other
1862 .IR troff s, \" generic
1863 except for those meaningful in numeric expressions;
1864 see below.
1865 .\" GNU troff happily accepts tabs and leaders; AT&T troff doesn't.
1866 .
1867 .
1868 .br
1869 .ne 3v
1870 .P
1871 The following escape sequences are not themselves delimited,
1872 and thus are allowed as delimiters:
1873 .BI \[rs] space\c
1874 ,
1875 .BR \[rs]% ,
1876 .BR \[rs]| ,
1877 .BR \[rs]\[ha] ,
1878 .BR \[rs]{ ,
1879 .BR \[rs]} ,
1880 .BR \[rs]\[aq] ,
1881 .BR \[rs]\[ga] ,
1882 .BR \[rs]\- ,
1883 .BR \[rs]_ ,
1884 .BR \[rs]! ,
1885 .BR \[rs]? ,
1886 .BR \[rs]) ,
1887 .BR \[rs]\|/ ,
1888 .BR \[rs], \^,
1889 .BR \[rs]& ,
1890 .BR \[rs]: ,
1891 .BR \[rs]\[ti] ,
1892 .BR \[rs]0 ,
1893 .BR \[rs]a ,
1894 .BR \[rs]c ,
1895 .BR \[rs]d ,
1896 .BR \[rs]e ,
1897 .BR \[rs]E ,
1898 .BR \[rs]p ,
1899 .BR \[rs]r ,
1900 .BR \[rs]t ,
1901 and
1902 .BR \[rs]u .
1903 .
1904 However,
1905 we discourage using them this way;
1906 they can make the input confusing to read.
1907 .
1908 (The
1909 .MR \%eqn 1
1910 and
1911 .MR \%tbl 1
1912 preprocessors use parameterized but non-delimited special character
1913 escape sequences
1914 .B \[rs](
1915 and
1916 .B \[rs][
1917 to bracket portions of their output.)
1918 .
1919 An invalid escape sequence is valid as a delimiter
1920 if the character after the escape character would be valid.
1921 .
1922 .
1923 .br
1924 .ne 3v
1925 .P
1926 The escape sequences
1927 .BR \[rs]D ,
1928 .BR \[rs]h ,
1929 .BR \[rs]H ,
1930 .BR \[rs]l ,
1931 .BR \[rs]L ,
1932 .BR \[rs]N ,
1933 .BR \[rs]R ,
1934 .BR \[rs]s ,
1935 .BR \[rs]S ,
1936 .BR \[rs]v ,
1937 and
1938 .B \[rs]x
1939 prohibit delimiters that are meaningful in numeric expressions,
1940 because they accept numeric expressions as
1941 (or within)
1942 their arguments.
1943 .
1944 For consistency,
1945 GNU
1946 .I troff \" GNU
1947 prohibits the same delimiters in the argument to the
1948 .B tl
1949 request.
1950 .
1951 The
1952 .RB \[lq] if \[rq],
1953 .BR ie ,
1954 and
1955 .RB \[lq] while \[rq]
1956 requests each interpret their first argument
1957 as a conditional expression;
1958 only characters that are not meaningful as operators
1959 in that context
1960 can be used as output comparison delimiters.
1961 .
1962 The following inputs are therefore invalid as delimiters in
1963 GNU
1964 .IR troff . \" GNU
1965 .
1966 .
1967 .RS
1968 .IP \[bu] 3n
1969 the numerals 0\[en]9 and the decimal point
1970 .RB \[lq] . \[rq]
1971 .
1972 .
1973 .IP \[bu]
1974 the (single-character) operators
1975 .B +\-/*%<>=&:()|
1976 .
1977 .
1978 .IP \[bu]
1979 any escape sequences other than
1980 .BR \[rs]% ,
1981 .BR \[rs]: ,
1982 .BR \[rs]{ ,
1983 .BR \[rs]} ,
1984 .BR \[rs]\[aq] ,
1985 .BR \[rs]\[ga] ,
1986 .BR \[rs]\- ,
1987 .BR \[rs]_ ,
1988 .BR \[rs]! ,
1989 .BR \[rs]/ ,
1990 .BR \[rs]c ,
1991 .BR \[rs]e ,
1992 and
1993 .B \[rs]p
1994 .RE
1995 .
1996 .
1997 .P
1998 Delimiter syntax is flexible
1999 (and laborious to describe)
2000 primarily for historical reasons;
2001 the foregoing restrictions need be kept in mind mainly when using
2002 GNU
2003 .I troff \" GNU
2004 in AT&T compatibility mode.
2005 .
2006 Normally,
2007 GNU
2008 .I troff \" GNU
2009 keeps track of the nesting depth of escape sequence interpolations,
2010 so the only characters you need to avoid using as delimiters are those
2011 that appear in the arguments you input,
2012 not those that result from interpolation.
2013 .
2014 Typically,
2015 .B \[aq]
2016 works fine.
2017 .
2018 See section \[lq]Implementation differences\[rq] in
2019 .MR groff_diff 7 .
2020 .\" END Keep (roughly) parallel with groff.texi node "Delimiters".
2021 .
2022 .
2023 .\" ====================================================================
2024 .SH "Dummy characters"
2025 .\" ====================================================================
2026 .
2027 .\" BEGIN Keep (roughly) parallel with groff.texi node "Dummy
2028 .\" Characters".
2029 As discussed in
2030 .MR roff 7 ,
2031 the first character on an input line is treated specially.
2032 .
2033 Further,
2034 formatting a glyph has many
2035 consequences on formatter state
2036 (see section \[lq]Environments\[rq] below).
2037 .
2038 Occasionally,
2039 we want to escape this context or embrace some of those consequences
2040 without actually rendering a glyph to the output.
2041 .
2042 .B \[rs]&
2043 interpolates a dummy character,
2044 which is constitutive of output but invisible.
2045 .
2046 Its presence alters the interpretation context of a subsequent input
2047 character,
2048 and enjoys several applications:
2049 preventing the insertion of extra space after an end-of-sentence
2050 character,
2051 preventing interpretation of a control character at the beginning of an
2052 input line,
2053 preventing kerning between two glyphs,
2054 and permitting the
2055 .B tr
2056 request to remap a character to \[lq]nothing\[rq].
2057 .
2058 .B \[rs])
2059 works as
2060 .B \[rs]&
2061 does,
2062 except that it does not cancel a pending end-of-sentence state.
2063 .\" END Keep (roughly) parallel with groff.texi node "Dummy Characters".
2064 .
2065 .
2066 .\" ====================================================================
2067 .SH "Page control"
2068 .\" ====================================================================
2069 .
2070 .\" BEGIN Keep (roughly) parallel with groff.texi node "Page Control".
2071 Discretionary page breaks
2072 can prevent the unwanted separation of content.
2073 .
2074 A new page number takes effect during page ejection;
2075 see subsection \[lq]The implicit page trap\[rq] below.
2076 .
2077 The
2078 .B bp
2079 request breaks the page,
2080 incrementing the page number by one
2081 (or setting it per the supplied argument).
2082 .
2083 The
2084 .B ne
2085 request forces a page break if insufficient vertical space is available
2086 (it asserts \[lq]needed\[rq] space).
2087 .
2088 .B sv
2089 requires vertical space as
2090 .B ne
2091 does,
2092 but also
2093 .I saves
2094 it for later output by the
2095 .B os
2096 request.
2097 .
2098 .
2099 .P
2100 The
2101 .B nl
2102 register interpolates the vertical drawing position
2103 as of the most recently typeset output line.
2104 .
2105 It does not necessarily
2106 (and often does not)
2107 represent that of the pending output line,
2108 because the formatter does not determine the position of its baseline
2109 until it is output.
2110 .\" recall @ref{Manipulating Spacing}.
2111 .
2112 Assigning a value to
2113 .B nl
2114 sets the vertical drawing position
2115 in advance of further modifications to baseline positioning
2116 arising from alterations to type size,
2117 changes to vertical spacing,
2118 or application of extra pre- or post-vertical spacing.
2119 .
2120 .
2121 .P
2122 When the formatter starts,
2123 the transition to the first page
2124 .RB "has not yet happened\[em]" nl
2125 is negative.
2126 If you plant a page location trap at vertical position
2127 .RB \[lq] 0 \[rq]
2128 (idiomatically to format a header),
2129 you can assign a negative value to
2130 .B nl
2131 to spring that trap even if the page has already started
2132 (see subsection \[lq]Page location traps\[rq] below).
2133 .\" END Keep (roughly) parallel with groff.texi node "Page Control".
2134 .
2135 .
2136 .\" TODO: Add sections here about characters (including custom
2137 .\" defintions with the `char` request family) and fonts (including
2138 .\" special fonts and the character resolution process).
2139 .\" ====================================================================
2140 .SH "Control structures"
2141 .\" ====================================================================
2142 .
2143 .I groff
2144 has \[lq]if\[rq] and \[lq]while\[rq] control structures like other
2145 languages.
2146 .
2147 However,
2148 the syntax for grouping multiple input lines in the branches or bodies
2149 of these structures is unusual.
2150 .
2151 .
2152 .P
2153 They have a common form:
2154 the request name is
2155 (except for
2156 .request el
2157 \[lq]else\[rq])
2158 followed by a conditional expression
2159 .IR cond-expr ;
2160 the remainder of the line,
2161 .IR input ,
2162 is interpreted as if it were an input line.
2163 .
2164 Any quantity of spaces between arguments to requests serves only to
2165 separate them;
2166 leading spaces in
2167 .I input
2168 are therefore not seen.
2169 .
2170 .I input
2171 effectively
2172 .I cannot
2173 be omitted;
2174 if
2175 .I cond-expr
2176 is true and
2177 .I input
2178 is empty,
2179 the newline at the end of the control line is interpreted as a blank
2180 line
2181 (and therefore a blank text line).
2182 .
2183 .
2184 .P
2185 It is frequently desirable for a control structure to govern more than
2186 one request,
2187 macro call,
2188 or text line,
2189 or combination of the foregoing.
2190 .
2191 The opening and closing brace escape sequences
2192 .esc {
2193 and
2194 .esc }
2195 perform such grouping.
2196 .
2197 Brace escape sequences outside of control structures have no meaning and
2198 produce no output.
2199 .
2200 .
2201 .P
2202 .esc {
2203 should appear
2204 (after optional spaces and tabs)
2205 immediately subsequent to the request's conditional expression.
2206 .
2207 .esc }
2208 should appear on a line with other occurrences of itself as necessary to
2209 match
2210 .esc {
2211 sequences.
2212 .
2213 It can be preceded by a control character,
2214 spaces,
2215 and tabs.
2216 .
2217 Input after any quantity of
2218 .esc }
2219 sequences on the same line is processed only if all the preceding
2220 conditions to which they correspond are true.
2221 .
2222 Furthermore,
2223 a
2224 .esc }
2225 closing the body of a
2226 .RB \[lq] while \[rq]
2227 request must be the last such escape sequence on an input line.
2228 .
2229 .
2230 .P
2231 GNU
2232 .I troff \" GNU
2233 treats the body of a
2234 .RB \[lq] while \[rq]
2235 request similarly to that of a
2236 .B de
2237 request
2238 (albeit one not read in copy mode),
2239 but stores it under an internal name
2240 and deletes it when the loop finishes.
2241 .
2242 The operation of a macro containing a
2243 .RB \[lq] while \[rq]
2244 request can slow significantly if its
2245 body is large.
2246 .
2247 Each time
2248 GNU
2249 .I troff \" GNU
2250 interpolates the macro,
2251 it parses and stores the
2252 .RB \[lq] while \[rq]
2253 body again.
2254 .
2255 An often better solution\[em]and one that is more portable,
2256 since AT&T
2257 .I troff \" AT&T
2258 lacked the
2259 .RB \[lq] while \[rq]
2260 request\[em]is to instead write a recursive macro,
2261 which is parsed only once
2262 (unless you redefine it).
2263 .
2264 To prevent infinite loops,
2265 GNU
2266 .I troff \" GNU
2267 limits the default number of available recursion levels
2268 to 1,000 or somewhat less
2269 (because things other than macro calls can be on the input stack).
2270 .
2271 You can disable this protective measure,
2272 or alter the limit,
2273 by setting the
2274 .B slimit
2275 register.
2276 .
2277 See section \[lq]Debugging\[rq] below.
2278 .
2279 .
2280 .\" ====================================================================
2281 .SS "Conditional expressions"
2282 .\" ====================================================================
2283 .
2284 .\" BEGIN Keep (roughly) parallel with groff.texi node "Operators in
2285 .\" Conditionals".
2286 The
2287 .RB \[lq] if \^\[rq],
2288 .BR ie ,
2289 and
2290 .RB \[lq] while \[rq]
2291 requests test the truth values of numeric expressions.
2292 .
2293 They also support several additional Boolean operators;
2294 the members of this expanded class are termed
2295 .IR "conditional expressions" ;
2296 their truth values are as shown below.
2297 .
2298 .
2299 .br
2300 .ne 3v
2301 .P
2302 .TS
2303 rf(BI) lB
2304 rB lx.
2305 cond-expr\f[B].\|.\|. .\|.\|.is true if.\|.\|.
2306 _
2307 T{
2308 .BI \[aq] s1 \[aq] s2 \[aq]
2309 T} T{
2310 .I s1
2311 produces the same formatted output as
2312 .IR s2 .
2313 T}
2314 T{
2315 .BI c\~ g
2316 T} T{
2317 a character
2318 .I g
2319 is defined.
2320 T}
2321 T{
2322 .BI d\~ m
2323 T} T{
2324 a string,
2325 macro,
2326 diversion,
2327 or request
2328 .I m
2329 is defined.
2330 T}
2331 e T{
2332 the current page number is even.
2333 T}
2334 T{
2335 .BI F\~ f
2336 T} T{
2337 a font named
2338 .I f
2339 is available.
2340 T}
2341 T{
2342 .BI m\~ c
2343 T} T{
2344 a color named
2345 .I c
2346 is defined.
2347 T}
2348 n T{
2349 the formatter is in
2350 .I nroff
2351 mode.
2352 T}
2353 o T{
2354 the current page number is odd.
2355 T}
2356 T{
2357 .BI r\~ n
2358 T} T{
2359 a register named
2360 .I n
2361 is defined.
2362 T}
2363 T{
2364 .BI S\~ s
2365 T} T{
2366 a font style named
2367 .I s
2368 is available.
2369 T}
2370 t T{
2371 the formatter is in
2372 .I troff
2373 mode.
2374 T}
2375 v T{
2376 n/a
2377 (historical artifact;
2378 always false).
2379 T}
2380 .TE
2381 .
2382 .
2383 .br
2384 .ne 2v
2385 .P
2386 If the first argument to an
2387 .RB \[lq] if \^\[rq],
2388 .BR ie ,
2389 or
2390 .RB \[lq] while \[rq]
2391 request begins with a non-alphanumeric character apart from
2392 .RB \[lq] !\& \[rq]
2393 (see below)
2394 and is not a numeric expression,
2395 the formatter performs an
2396 .I output comparison test.
2397 .
2398 Shown first in the table above,
2399 the
2400 .I output comparison operator
2401 interpolates a true value if formatting its comparands
2402 .I s1
2403 and
2404 .I s2
2405 produces the same output commands.
2406 .
2407 Other delimiters can be used in place of the neutral apostrophes;
2408 see section \[lq]Delimiters\[rq] above.
2409 .
2410 .I troff \" generic
2411 formats
2412 .I s1
2413 and
2414 .I s2
2415 in separate scratch buffers;
2416 after comparison,
2417 it discards the resulting data.
2418 .
2419 The resulting glyph properties,
2420 including font family,
2421 style,
2422 size,
2423 and
2424 slant,
2425 must match,
2426 but not necessarily the requests and/or escape sequences
2427 used to obtain them.
2428 .
2429 Motions must match in orientation and magnitude to within the applicable
2430 horizontal or vertical motion quantum of the device,
2431 after rounding.
2432 .
2433 .\" TODO: Uncomment and add forward reference when we add a "GNU troff
2434 .\" internals" subsection to this page.
2435 .\"(All of this is to say that the lists of output nodes created by
2436 .\"formatting
2437 .\".I s1
2438 .\"and
2439 .\".I s2
2440 .\"must be identical.)
2441 .
2442 .
2443 .P
2444 Surround the comparands with
2445 .B \[rs]?\&
2446 to avoid formatting them;
2447 this causes them to be compared character by character,
2448 as with string comparisons in other programming languages.
2449 .
2450 Since
2451 GNU
2452 .I troff \" GNU
2453 reads comparands protected with
2454 .B \[rs]?\&
2455 in copy mode,
2456 they need not be syntactically valid.
2457 .
2458 The escape character is still lexically recognized,
2459 however,
2460 and consumes the next character.
2461 .\" but see Savannah #67329
2462 .
2463 .
2464 .P
2465 The above operators can't be combined with most others,
2466 but a leading
2467 .RB \[lq] !\& \[rq],
2468 not followed immediately by spaces or tabs,
2469 complements an expression.
2470 .
2471 Spaces and tabs are optional immediately after the
2472 .RB \[lq] c \[rq],
2473 .RB \[lq] d \[rq],
2474 .RB \[lq] F \[rq],
2475 .RB \[lq] m \[rq],
2476 .RB \[lq] r \[rq],
2477 and
2478 .RB \[lq] S \[rq]
2479 operators,
2480 but right after
2481 .RB \[lq] !\& \[rq],
2482 they end the predicate and the conditional evaluates true.
2483 .
2484 (This bizarre behavior maintains compatibility with AT&T
2485 .IR troff .)
2486 .
2487 .
2488 .P
2489 Conditional operators do not create
2490 .I roff
2491 language objects as interpolations with
2492 .B \[rs]n
2493 and
2494 .B \[rs]*
2495 escape sequences do.
2496 .\" END Keep (roughly) parallel with groff.texi node "Operators in
2497 .\" Conditionals".
2498 .
2499 .
2500 .\" ====================================================================
2501 .SH "Syntax reference conventions"
2502 .\" ====================================================================
2503 .
2504 In the following request and escape sequence specifications,
2505 most argument names were chosen to be descriptive.
2506 .
2507 GNU
2508 .I troff \" GNU
2509 reads arguments named
2510 .I character-sequence,
2511 .I command,
2512 .I contents,
2513 .I file,
2514 and
2515 .I message
2516 in copy mode
2517 (see section \[lq]Copy Mode\[rq] below)
2518 until the end of the input line.
2519 .
2520 A
2521 .I character-sequence
2522 comprises one or more ordinary,
2523 special,
2524 or indexed characters;
2525 spaces;
2526 or escape sequences that interpolate only these.
2527 .\" XXX: or tabs, leaders, backspace, and delete characters
2528 .
2529 We name the remaining arguments for clarity;
2530 they are also
2531 .I character-sequences.
2532 .
2533 A neutral double quote
2534 .RB \[oq] \[dq] \[cq] \" single quotes around double quote
2535 can optionally prefix a
2536 .I character-sequence;
2537 the formatter discards one if present,
2538 permitting initial embedded spaces in the argument.
2539 .
2540 .I input
2541 refers to arbitrary character sequences
2542 (up to a newline or delimiter)
2543 that
2544 GNU
2545 .I troff \" GNU
2546 fully interprets,
2547 in contrast to copy mode.
2548 .
2549 .
2550 .P
2551 A few denotations are more specific.
2552 .
2553 .
2554 .P
2555 .LS
2556 .RS
2557 .
2558 .TPx
2559 .I b
2560 is a numerical expression evaluated as a Boolean;
2561 positive values are true,
2562 others false.
2563 .
2564 .TPx
2565 .I c
2566 denotes a single character\[em]\c
2567 ordinary,
2568 special,
2569 or indexed.
2570 .
2571 .TPx
2572 .I command
2573 is an instance of
2574 .I contents
2575 (see below)
2576 to be passed to the system as a command
2577 (potentially with arguments).
2578 .\" ...limiting the file names you can express; see Savannah #64071.
2579 .
2580 GNU
2581 .I troff \" GNU
2582 strips a leading neutral double quote,
2583 allowing embedded leading spaces.
2584 .
2585 .TPx
2586 .I contents
2587 is arbitrary input,
2588 excluding an unescaped newline,
2589 read in copy mode.
2590 .
2591 GNU
2592 .I troff \" GNU
2593 strips a leading neutral double quote,
2594 allowing embedded leading spaces.
2595 .
2596 .TPx
2597 .I div
2598 is a diversion identifier.
2599 .
2600 .TPx
2601 .I env
2602 is an environment identifier.
2603 .
2604 .TPx
2605 .I file
2606 is an instance of
2607 .I contents
2608 naming a file on the system.
2609 .\" ...limiting the file names you can express; see Savannah #65108.
2610 .
2611 GNU
2612 .I troff \" GNU
2613 strips a leading neutral double quote,
2614 allowing embedded leading spaces.
2615 .
2616 GNU
2617 .I troff \" GNU
2618 does not accept newlines
2619 (line feeds)
2620 in file names supplied as arguments to requests.
2621 .
2622 .TPx
2623 .I font
2624 is a typeface specified as a font identifier,
2625 an abstract style,
2626 or a mounting position.
2627 .
2628 .TPx
2629 .I ident
2630 is a valid
2631 .I groff
2632 identifier;
2633 its use often indicates that the operation creates an object of a type
2634 subsequently referred to as
2635 .I mac,
2636 .I reg,
2637 .I str,
2638 and so forth.
2639 .
2640 .TPx
2641 .I mac
2642 is a macro identifier.
2643 .
2644 .TPx
2645 .I message
2646 is an instance of
2647 .I contents
2648 to emit on the standard error stream.
2649 .\" ...limiting the messages you can express; see Savannah #62787.
2650 .
2651 GNU
2652 .I troff \" GNU
2653 strips a leading neutral double quote,
2654 allowing embedded leading spaces.
2655 .
2656 .TPx
2657 .I n
2658 is a numeric expression that evaluates to a non-negative integer.
2659 .
2660 .TPx
2661 .I \[+-]N
2662 is a numeric expression with a meaning dependent on its sign;
2663 see below.
2664 .
2665 .TPx
2666 .I name
2667 is a macro,
2668 string,
2669 or diversion identifier,
2670 or the name of a request.
2671 .
2672 .br
2673 .ne 3v
2674 .TPx
2675 .I npl
2676 is a numeric expression constituting a count of subsequent
2677 .I productive
2678 input lines;
2679 that is,
2680 those that directly produce formatted output.
2681 .
2682 Text lines produce output,
2683 as do control lines containing requests like
2684 .RB \[lq] ".tl //\^Page %//\^" \[rq]
2685 or escape sequences like
2686 .RB \[lq] \[rs]\^l\[aq]1i\[aq] \[rq].
2687 .
2688 Macro calls are not themselves productive,
2689 but their interpolations can be.
2690 .
2691 .TPx
2692 .I reg
2693 is a register identifier.
2694 .
2695 .TPx
2696 .I str
2697 is a string identifier.
2698 .
2699 .TPx
2700 .I stream
2701 is an output stream identifier.
2702 .RE
2703 .LE
2704 .
2705 .
2706 .P
2707 If a numeric expression presented as
2708 .I \[+-]N
2709 starts with a
2710 .squoted_char +
2711 sign,
2712 an increment in the amount of
2713 .RI of\~ N
2714 is applied to the value applicable to the request or escape sequence.
2715 .
2716 If it starts with a
2717 .squoted_char \-
2718 sign,
2719 a decrement of magnitude
2720 .I N
2721 is applied instead.
2722 .
2723 Without a sign,
2724 .I N
2725 replaces any existing value.
2726 .
2727 A
2728 .I roff
2729 formatter always interprets a leading minus sign
2730 .RI in\~ N
2731 as a decrementation operator,
2732 not an algebraic sign.
2733 .
2734 To assign a register a negative value
2735 or the negated value of another interpolation,
2736 you must force the formatter to interpret
2737 .RB \[lq] \- \[rq]
2738 as a negation or minus,
2739 rather than decrementation,
2740 operator:
2741 enclose the
2742 .RB \[lq] \- \[rq]
2743 with its operand in parentheses
2744 or subtract the expression of interest from zero.
2745 .
2746 If a prior value does not exist\c
2747 \[em]the register was undefined\[em]\c
2748 an increment or decrement applies as if to\~0.
2749 .
2750 .
2751 .\" ====================================================================
2752 .SH "Request short reference"
2753 .\" ====================================================================
2754 .
2755 Not all details of request behavior are outlined here.
2756 .
2757 See the
2758 .I groff
2759 Texinfo manual or,
2760 for features new to GNU
2761 .IR troff , \" GNU
2762 .MR groff_diff 7 .
2763 .
2764 .
2765 .\" Note: The following syntax summaries do _not_ generally use brackets
2766 .\" to mark optional arguments (there are a few exceptions, alas).
2767 .\" Instead, request invocations taking different argument quantities
2768 .\" are synopsized separately.
2769 .P
2770 .LS
2771 .
2772 .TPx
2773 .REQ .ab
2774 Abort the formatter;
2775 exit with failure status.
2776 .
2777 .TPx
2778 .REQ .ab terminal-message
2779 Abort the formatter;
2780 write
2781 .I terminal-message
2782 to the standard error stream and exit with failure status.
2783 .
2784 .TPx
2785 .REQ .ad
2786 Enable output line alignment and adjustment using the mode stored in
2787 .BR \[rs]n[.j] .
2788 .
2789 .TPx
2790 .REQ .ad c
2791 Enable output line alignment and adjustment in mode
2792 .I c
2793 .RI ( c =\c
2794 .BR b , c , l , n , r ).
2795 .
2796 Sets
2797 .BR \[rs]n[.j] .
2798 .
2799 .TPx
2800 .REQ .af "reg c"
2801 Assign format
2802 .I c
2803 to register
2804 .I reg,
2805 where
2806 .I c
2807 is
2808 .RB \[lq] i \[rq],
2809 .RB \[lq] I \[rq],
2810 .RB \[lq] a \[rq],
2811 .RB \[lq] A \[rq],
2812 or a sequence of decimal digits whose quantity denotes the minimum width
2813 in digits to be used when the register is interpolated.
2814 .
2815 .RB \[lq] i \[rq]
2816 and
2817 .RB \[lq] a \[rq]
2818 indicate Roman numerals and basic Latin alphabetics,
2819 respectively,
2820 in the lettercase specified.
2821 .
2822 The default is
2823 .BR 0 .
2824 .
2825 .TPx
2826 .REQ .aln "new-register existing-register"
2827 Create alias
2828 (additional name)
2829 .I new-register
2830 of
2831 .IR existing-register ,
2832 causing the names to refer to the same stored object.
2833 .
2834 If
2835 .I existing-register
2836 is undefined,
2837 the formatter ignores the request.
2838 GNU
2839 .I troff \" GNU
2840 emits a warning in category
2841 .RB \[lq] reg \[rq].
2842 .
2843 .TPx
2844 .REQ .als "new-name existing-name"
2845 Create alias
2846 (additional name)
2847 .I new-name
2848 of request,
2849 string,
2850 macro,
2851 or diversion
2852 .IR existing-name ,
2853 causing the names to refer to the same stored object.
2854 .
2855 If
2856 .I existing-name
2857 is undefined,
2858 the formatter ignores the request.
2859 GNU
2860 .I troff \" GNU
2861 emits a warning in category
2862 .RB \[lq] mac \[rq].
2863 .
2864 If
2865 .I new-name
2866 already exists,
2867 its definition is lost unless already aliased.
2868 .
2869 .TPx
2870 .REQ .am mac
2871 Append to macro
2872 .I mac
2873 until encountering
2874 .RB \[lq] .\|.\& \[rq]
2875 at the start of a control line in the current conditional block.
2876 .
2877 .TPx
2878 .REQ .am "mac end-mac"
2879 Append to macro
2880 .I mac
2881 until
2882 .I end-mac
2883 is called at the start of a control line in the current conditional
2884 block.
2885 .
2886 .I end-mac
2887 can be a request.
2888 .
2889 .TPx
2890 .REQ .am1 mac
2891 As
2892 .RB \[rq] am \[rq],
2893 with compatibility mode disabled when the appendment to macro
2894 .I mac
2895 is interpreted.
2896 .
2897 .TPx
2898 .REQ .am1 "mac end-mac"
2899 As
2900 .RB \[lq] .am
2901 .IR mac \[rq],
2902 with compatibility mode disabled when the appendment to macro
2903 .I mac
2904 is interpreted.
2905 .
2906 .TPx
2907 .REQ .ami str
2908 Append to a macro indirectly\[em]its name is in string
2909 .IR str \[em]until
2910 encountering
2911 .RB \[lq] .\|.\& \[rq].
2912 .
2913 .TPx
2914 .REQ .ami "str end-mac-str"
2915 Append to a macro indirectly.
2916 .
2917 As
2918 .RB \[rq] am \[rq],
2919 but
2920 .I str
2921 and
2922 .I end-mac-str
2923 contain the names of the macro to be appended to,
2924 and that whose call ends the appendment,
2925 respectively.
2926 .
2927 .TPx
2928 .REQ .ami1 str
2929 As
2930 .request ami ,
2931 with compatibility mode disabled when the appendment is interpreted.
2932 .
2933 .TPx
2934 .REQ .ami1 "str end-mac-str"
2935 As
2936 .request ami ,
2937 with compatibility mode disabled when the appendment is interpreted.
2938 .
2939 .\" a degenerate case
2940 .TPx
2941 .REQ .as ident
2942 Create string
2943 .I ident
2944 with empty contents;
2945 no operation if
2946 .I ident
2947 already exists.
2948 .
2949 .TPx
2950 .REQ .as "str contents"
2951 Append
2952 .I contents
2953 to string
2954 .IR str .
2955 .
2956 .\" a doubly degenerate case
2957 .TPx
2958 .REQ .as1 ident
2959 As
2960 .RB \[lq] .as
2961 .IR ident \[rq].
2962 .
2963 .TPx
2964 .REQ .as1 "str contents"
2965 As
2966 .RB \[rq] as \[rq],
2967 with compatibility mode disabled when the appendment to string
2968 .I str
2969 is interpreted.
2970 .
2971 .TPx
2972 .REQ .asciify div
2973 Unformat ordinary characters,
2974 spaces,
2975 and some escape sequences \" XXX: vague
2976 in diversion
2977 .IR div .
2978 .
2979 When transforming a glyph node back into an input sequence
2980 that demands expression as a special character escape sequence,
2981 GNU
2982 .I troff
2983 uses the default escape character.
2984 .
2985 .TPx
2986 .REQ .backtrace
2987 Write the state of the input stack to the standard error stream.
2988 .
2989 See the
2990 .B \-b
2991 option of
2992 .MR groff 1 .
2993 .
2994 .TPx
2995 .REQ .bd font
2996 Stop emboldening font
2997 .I font.
2998 .
2999 .TPx
3000 .REQ .bd "font n"
3001 Embolden
3002 .I font
3003 by overstriking its glyphs offset by
3004 .IR n \-1
3005 units.
3006 .
3007 See
3008 .register .b .
3009 .\" XXX: negative values accepted; check AT&T troff
3010 .
3011 .TPx
3012 .REQ .bd "special-font font"
3013 Stop emboldening
3014 .I special-font
3015 when
3016 .I font
3017 is selected.
3018 .
3019 .\" XXX: Possibly allow prefixing an integer with `\&` to force
3020 .\" interpretation of this form.
3021 .I special-font
3022 must be a font name,
3023 not a mounting position.
3024 .
3025 .TPx
3026 .REQ .bd "special-font font n"
3027 Embolden
3028 .I special-font,
3029 overstriking its glyphs offset by
3030 .IR n \-1
3031 units when
3032 .I font
3033 is selected.
3034 .
3035 See
3036 .register .b .
3037 .
3038 .TPx
3039 .REQ .blm
3040 Unset blank line macro (trap).
3041 .
3042 Restore default handling of blank lines.
3043 .
3044 .TPx
3045 .REQ .blm mac
3046 Set blank line macro (trap) to
3047 .IR mac .
3048 .
3049 .TPx
3050 .REQ .box
3051 Stop directing output to current diversion;
3052 any pending output line is discarded.
3053 .
3054 .TPx
3055 .REQ .box ident
3056 Direct output to diversion
3057 .IR ident ,
3058 omitting a partially collected line.
3059 .
3060 .TPx
3061 .REQ .boxa
3062 Stop appending output to current diversion;
3063 any pending output line is discarded.
3064 .
3065 .TPx
3066 .REQ .boxa div
3067 Append output to diversion
3068 .IR div ,
3069 omitting a partially collected line.
3070 .
3071 .TPx
3072 .REQ .bp
3073 Break page and start a new one.
3074 .
3075 .TPx
3076 .REQ .bp \[+-]N
3077 Break page,
3078 starting a new one numbered
3079 .IR \[+-]N .
3080 .
3081 .TPx
3082 .REQ .br
3083 Break output line.
3084 .
3085 .TPx
3086 .REQ .brp
3087 Break and force adjustment of the output line
3088 per the current adjustment mode.
3089 .
3090 .TPx
3091 .REQ .break
3092 Break out of a
3093 .RB \[rq] while \[rq]
3094 loop.
3095 .
3096 .TPx
3097 .REQ .c2
3098 Reset no-break control character to
3099 .dquoted_char \[aq] .
3100 .
3101 .TPx
3102 .REQ .c2 o
3103 Recognize ordinary character
3104 .I o
3105 as no-break control character.
3106 .
3107 .TPx
3108 .REQ .cc
3109 Reset control character to
3110 .squoted_char . .
3111 .
3112 .TPx
3113 .REQ .cc o
3114 Recognize ordinary character
3115 .I o
3116 as the control character.
3117 .
3118 .TPx
3119 .REQ .ce
3120 Break,
3121 center the output of the next productive input line without filling,
3122 and break again.
3123 .
3124 .TPx
3125 .REQ .ce npl
3126 Break,
3127 center the output of the next
3128 .I npl
3129 productive input lines without filling,
3130 then break again.
3131 .
3132 If
3133 .I npl
3134 \[<=] 0,
3135 stop centering.
3136 .
3137 .TPx
3138 .REQ .cf file
3139 Break and copy contents of
3140 .I file
3141 as \[lq]throughput\[rq] to GNU
3142 .I troff \" GNU
3143 output
3144 (see
3145 .MR groff_out 5 ).
3146 .
3147 Each line of
3148 .I file
3149 is output
3150 as if preceded by
3151 .BR \[rs]!\& ,
3152 but is not interpreted by the formatter.
3153 .
3154 Unsafe request;
3155 disabled by default.
3156 .
3157 .TPx
3158 .REQ .cflags "n c\fR\&.\|.\|.\&\fP"
3159 Assign properties encoded by non-negative integer
3160 .I n
3161 to each character or class
3162 .IR c .
3163 .
3164 Spaces need not separate
3165 .I c
3166 arguments.
3167 .\" TODO: Add subsection discussing character flags.
3168 .
3169 .TPx
3170 .REQ .ch mac
3171 Unplant page location trap
3172 .IR mac .
3173 .
3174 .TPx
3175 .REQ .ch "mac vertical-position"
3176 Change page location trap
3177 .I mac
3178 planted by
3179 .request wh
3180 by moving its location to
3181 .I vertical-position
3182 (default scaling unit\~\c
3183 .scaleindicator v ).
3184 .
3185 .TPx
3186 .REQ .char c
3187 Define an
3188 ordinary,
3189 special,
3190 or
3191 indexed
3192 character
3193 .I c
3194 as empty.
3195 .
3196 .TPx
3197 .REQ .char "c contents"
3198 Define an
3199 ordinary,
3200 special,
3201 or
3202 indexed
3203 character
3204 .I c
3205 as
3206 .I contents.
3207 .
3208 .TPx
3209 .REQ .chop name
3210 Remove the last character from the macro,
3211 string,
3212 or diversion
3213 .I name.
3214 .
3215 .TPx
3216 .REQ .class "ident c \fR\&.\|.\|.\&\fP"
3217 Define a (character) class
3218 .I ident
3219 comprising the characters or range expressions
3220 .IR c ,
3221 where each
3222 .I c
3223 is an
3224 ordinary,
3225 special,
3226 or
3227 indexed
3228 character;
3229 or a
3230 .I "range expression."
3231 .
3232 A class thus defined can then be referred to
3233 in a
3234 .B \%cflags
3235 request in lieu of listing all the characters within it.
3236 .
3237 .TPx
3238 .REQ .close stream
3239 Close
3240 .IR stream ,
3241 making it unavailable for
3242 .RB \[rq] write \[rq]
3243 requests.
3244 .
3245 .TPx
3246 .REQ .color
3247 Enable output of color-related device-independent output commands.
3248 .
3249 It is enabled by default.
3250 .
3251 .TPx
3252 .REQ .color b
3253 Enable or disable output of color-related device-independent output
3254 commands per Boolean expression
3255 .IR b .
3256 .
3257 .TPx
3258 .REQ .composite c
3259 Remove composite character mapping for character
3260 .I c.
3261 .
3262 .TPx
3263 .REQ .composite "c1 c2"
3264 Map character
3265 .I c1
3266 to
3267 .I c2
3268 when
3269 .I c1
3270 is a combining component in a composite character.
3271 .
3272 .TPx
3273 .REQ .continue
3274 Skip the remainder of a
3275 .RB \[lq] while \[rq]
3276 loop's body,
3277 immediately retesting its conditional expression.
3278 .
3279 .TPx
3280 .REQ .cp
3281 Enable AT&T
3282 .I troff \" AT&T
3283 compatibility mode.
3284 .
3285 It is disabled by default.
3286 .
3287 .TPx
3288 .REQ .cp b
3289 Enable or disable AT&T
3290 .I troff \" AT&T
3291 compatibility mode per Boolean expression
3292 .IR b .
3293 .
3294 .TPx
3295 .REQ .cs f
3296 Disable constant-width glyph spacing mode for font
3297 .I f.
3298 .
3299 .TPx
3300 .REQ .cs "f n"
3301 Enable constant-width glyph spacing mode for font
3302 .I f
3303 at
3304 .IR n /36
3305 ems.
3306 .
3307 .TPx
3308 .REQ .cs "f n p"
3309 Enable constant-width glyph spacing mode for
3310 .I font
3311 at
3312 .IR n /36
3313 ems,
3314 as if one em equals
3315 .I p
3316 scaled points.
3317 .
3318 .TPx
3319 .REQ .cu
3320 Continuously underline the output of the next productive input line.
3321 .
3322 .TPx
3323 .REQ .cu npl
3324 Continuously underline the output of the next
3325 .I npl
3326 productive input lines.
3327 .
3328 If
3329 .IR npl =0,
3330 stop continuously underlining.
3331 .
3332 .TPx
3333 .REQ .da
3334 Stop appending output to current diversion.
3335 .
3336 .TPx
3337 .REQ .da div
3338 Append output to diversion
3339 .IR div .
3340 .
3341 .TPx
3342 .REQ .de ident
3343 Define macro
3344 .I ident
3345 until
3346 .RB \[lq] .\|.\& \[rq]
3347 occurs at the start of a control line in the current conditional block.
3348 .
3349 .TPx
3350 .REQ .de "ident end-mac"
3351 Define macro
3352 .I ident
3353 until
3354 .I end-mac
3355 is called at the start of a control line in the current conditional
3356 block.
3357 .
3358 .I end-mac
3359 can be a request.
3360 .
3361 .TPx
3362 .REQ .de1 ident
3363 As
3364 .request de ,
3365 with compatibility mode disabled when
3366 .I mac
3367 is interpreted.
3368 .
3369 .TPx
3370 .REQ .de1 "ident end-mac"
3371 As
3372 .RB \[lq] .de
3373 .IR "ident end-mac" \[rq],
3374 with compatibility mode disabled when
3375 .I mac
3376 is interpreted.
3377 .
3378 .TPx
3379 .REQ .defcolor "ident scheme color-component \f[R].\|.\|."
3380 Define a color named
3381 .I ident.
3382 .
3383 .I scheme
3384 identifies a color space and determines the number of required
3385 .IR color-component s;
3386 it must be one of
3387 .RB \[lq] rgb \[rq]
3388 (three components),
3389 .RB \[lq] cmy \[rq]
3390 (three),
3391 .RB \[lq] cmyk \[rq]
3392 (four),
3393 or
3394 .RB \[lq] gray \[rq]
3395 (one).
3396 .
3397 .RB \[lq] grey \[rq]
3398 is accepted as a synonym of
3399 .RB \[lq] gray \[rq].
3400 .
3401 The color components can be encoded as a single hexadecimal value
3402 starting with
3403 .B #
3404 or
3405 .BR ## .
3406 .
3407 The former indicates that each component is in the range 0\[en]255
3408 (0\[en]FF),
3409 the latter the range 0\[en]65,535 (0\[en]FFFF).
3410 .
3411 Alternatively,
3412 each color component can be specified as a decimal fraction in the range
3413 0\[en]1,
3414 interpreted using a default scaling unit
3415 .RB of\~\[lq] f \[rq],
3416 which multiplies its value by 65,536
3417 (but clamps it at 65,535).
3418 .
3419 .TPx
3420 .REQ .dei str
3421 Define macro indirectly.
3422 .
3423 As
3424 .request de ,
3425 but interpolate string
3426 .I str
3427 to obtain the macro's name.
3428 .
3429 .TPx
3430 .REQ .dei "str end-mac-str"
3431 Define macro indirectly.
3432 .
3433 As
3434 .request de ,
3435 but
3436 .I str
3437 and
3438 .I end-mac-str
3439 contain the names of the macro to be defined,
3440 and that whose call ends the definition,
3441 respectively.
3442 .
3443 .TPx
3444 .REQ .dei1 str
3445 As
3446 .request dei ,
3447 with compatibility mode disabled when the macro is interpreted.
3448 .
3449 .TPx
3450 .REQ .dei1 "str end-mac-str"
3451 As
3452 .request dei ,
3453 with compatibility mode disabled when the macro is interpreted.
3454 .
3455 .TPx
3456 .REQ .device character-sequence
3457 Embed
3458 .I character-sequence
3459 into
3460 GNU
3461 .I troff \" GNU
3462 output as parameters to an
3463 .RB \[lq]x X\[rq]
3464 device extension command;
3465 see
3466 .MR groff_out 5 .
3467 .
3468 The output driver or other postprocessor interprets
3469 .I character-sequence
3470 as it sees fit.
3471 .
3472 .TPx
3473 .REQ .devicem name
3474 Write contents of macro or string
3475 .I name
3476 to
3477 .I \%troff
3478 output as the argument to a device extension command.
3479 .
3480 .TPx
3481 .REQ .di
3482 Stop directing output to current diversion.
3483 .
3484 .TPx
3485 .REQ .di ident
3486 Direct output to diversion
3487 .IR ident .
3488 .
3489 .TPx
3490 .REQ .do "name argument \fR\&.\|.\|.\&\fP"
3491 Interpret the string,
3492 request,
3493 diversion,
3494 or macro
3495 .I name
3496 (along with any further arguments)
3497 with compatibility mode disabled.
3498 .
3499 Compatibility mode is restored
3500 (only if it was active)
3501 when the interpolation of
3502 .I name
3503 is interpreted.
3504 .
3505 .TPx
3506 .REQ .ds ident
3507 Create empty string named
3508 .IR ident .
3509 .
3510 .TPx
3511 .REQ .ds "ident contents"
3512 Create a string named
3513 .I ident
3514 containing
3515 .I contents.
3516 .
3517 .TPx
3518 .REQ .ds1 ident
3519 .TQ
3520 .REQ .ds1 "ident contents"
3521 As
3522 .request ds ,
3523 with compatibility mode disabled when the string is interpreted.
3524 .
3525 .TPx
3526 .REQ .dt
3527 Clear diversion trap.
3528 .
3529 .TPx
3530 .REQ .dt "vertical-position mac"
3531 Set the diversion trap to macro
3532 .I mac
3533 at
3534 .I vertical-position
3535 (default scaling unit\~\c
3536 .scaleindicator v ).
3537 .
3538 .TPx
3539 .REQ .ec
3540 Recognize
3541 .B \[rs]
3542 as the escape character.
3543 .
3544 .TPx
3545 .REQ .ec o
3546 Recognize ordinary character
3547 .I o
3548 as the escape character.
3549 .
3550 .TPx
3551 .REQ .ecr
3552 Restore escape character saved with
3553 .request ecs .
3554 .
3555 .TPx
3556 .REQ .ecs
3557 Save the escape character.
3558 .
3559 .TPx
3560 .REQ .el
3561 Interpolate a newline if the conditional expression of the corresponding
3562 .request ie
3563 request was false.
3564 .
3565 .TPx
3566 .REQ .el input
3567 Interpret
3568 .I input
3569 as if it were an input line if the conditional expression of the
3570 corresponding
3571 .request ie
3572 request was false.
3573 .
3574 .TPx
3575 .REQ .em
3576 Unset end-of-input macro.
3577 .
3578 .TPx
3579 .REQ .em mac
3580 Call macro
3581 .I mac
3582 after the end of input.
3583 .
3584 .TPx
3585 .REQ .eo
3586 Disable the escape mechanism in interpretation mode.
3587 .
3588 .TPx
3589 .REQ .ev
3590 Pop environment stack,
3591 returning to previous one.
3592 .
3593 .TPx
3594 .REQ .ev env
3595 Push current environment onto stack and switch to
3596 .IR env ,
3597 creating it if necessary.
3598 .
3599 .TPx
3600 .REQ .evc env
3601 Copy environment
3602 .I env
3603 to the current one.
3604 .
3605 .TPx
3606 .REQ .ex
3607 Exit the formatter.
3608 .
3609 .TPx
3610 .REQ .fam
3611 Set default font family to previous value.
3612 .
3613 .TPx
3614 .REQ .fam name
3615 Set default font family to
3616 .IR name .
3617 .
3618 .TPx
3619 .REQ .fc
3620 Disable field mechanism.
3621 .
3622 .TPx
3623 .REQ .fc c
3624 Set field delimiter to\~\c
3625 .I c
3626 and pad glyph to space.
3627 .
3628 .TPx
3629 .REQ .fc "c1 c2"
3630 Set field delimiter to\~\c
3631 .I c1
3632 and pad glyph to\~\c
3633 .IR c2 .
3634 .
3635 .TPx
3636 .REQ .fchar c
3637 Define fallback
3638 .RI character\~ c
3639 as empty.
3640 .
3641 .TPx
3642 .REQ .fchar "c contents"
3643 Define fallback
3644 .RI character\~ c
3645 as
3646 .IR contents .
3647 .
3648 As
3649 .request char ,
3650 but while that request hides a glyph with the same name in the selected
3651 font,
3652 .B fchar
3653 definitions are used only if the font
3654 lacks a glyph for
3655 .IR c .
3656 .
3657 GNU
3658 .I troff \" GNU
3659 performs this test before searching special fonts.
3660 .
3661 .TPx
3662 .REQ .fcolor
3663 Restore previous fill color,
3664 or the default if there is none.
3665 .
3666 .TPx
3667 .REQ .fcolor col
3668 Select
3669 .I col
3670 as the fill color.
3671 .
3672 .TPx
3673 .REQ .fi
3674 Enable filling of output lines;
3675 a pending output line is broken.
3676 .
3677 Sets
3678 .BR \[rs]n[.u] .
3679 .
3680 .TPx
3681 .REQ .fl
3682 Flush any pending output line.
3683 .
3684 .TPx
3685 .REQ .fp "pos id"
3686 Mount font with font description file name
3687 .I id
3688 at non-negative position
3689 .IR pos .
3690 .
3691 .TPx
3692 .REQ .fp "pos id font-description-file-name"
3693 Mount font with
3694 .I font-description-file-name
3695 as name
3696 .I id
3697 at non-negative position
3698 .IR pos .
3699 .
3700 .TPx
3701 .REQ .fschar "f c"
3702 Define fallback
3703 .RI character\~ c
3704 specific to
3705 .RI font\~ f
3706 as empty.
3707 .
3708 .TPx
3709 .REQ .fschar "f c contents"
3710 Define fallback
3711 .RI character\~ c
3712 specific to
3713 .RI font\~ f
3714 as
3715 .IR contents .
3716 .
3717 As
3718 .request char ,
3719 but GNU
3720 .I troff \" GNU
3721 locates a character defined by
3722 .B fschar
3723 after any fonts named as arguments to the
3724 .B \%fspecial
3725 are searched and before those named as arguments to the
3726 .RB \%\[lq] special \[rq]
3727 request.
3728 .
3729 .TPx
3730 .REQ .fspecial f
3731 Empty the list of fonts treated as special when
3732 .I f
3733 is selected.
3734 .
3735 .TPx
3736 .REQ .fspecial "f s \fR\&.\|.\|.\&\fP"
3737 Declare each font
3738 .I s
3739 as special only when
3740 .RB font\~ f
3741 is selected.
3742 .
3743 .\" TODO: Move this sentence to a new (sub)section describing the glyph
3744 .\" resolution procedure.
3745 GNU
3746 .I troff \" GNU
3747 searches fonts specified as arguments to the
3748 .RB \%\[lq] special \[rq]
3749 request after those given as arguments to the
3750 .B \%fspecial
3751 request.
3752 .
3753 .TPx
3754 .REQ .ft
3755 .TQ
3756 .REQ ".ft P"
3757 Select the typeface
3758 .I font.
3759 .
3760 If
3761 .I font
3762 is an integer,
3763 the formatter interprets it as a mounting position;
3764 the font mounted there is selected.
3765 .
3766 If that position refers to an abstract style,
3767 GNU
3768 .I troff \" GNU
3769 combines it with the default family
3770 (see
3771 .B fam
3772 above and
3773 .B \[rs]F
3774 below)
3775 to make a resolved font name.
3776 .
3777 If
3778 .I font
3779 is
3780 .RB \[lq] DESC \[rq],
3781 if the mounting position is not an abstract style
3782 and no font is mounted there,
3783 or the mounting position is negative,
3784 GNU
3785 .I troff \" GNU
3786 ignores the request.
3787 .
3788 (It also
3789 emits a warning in category
3790 .RB \[lq] font \[rq],
3791 or
3792 .RB \[lq] range \[rq],
3793 as appropriate.
3794 .
3795 See section \[lq]Warnings\[rq] in
3796 .MR \%troff 1 .)
3797 .
3798 Also see
3799 .B \[rs]f .
3800 .
3801 .TPx
3802 .REQ .ftr f
3803 Remove translation of font named
3804 .IR f .
3805 .
3806 .TPx
3807 .REQ .ftr "f1 f2"
3808 Translate font name
3809 .I f1
3810 to
3811 .IR f2 .
3812 .
3813 .TPx
3814 .REQ .fzoom font\~\f[B]0\f[]
3815 Stop magnifying
3816 .IR font .
3817 .
3818 .TPx
3819 .REQ .fzoom "font zoom"
3820 Set magnification of mounted
3821 .I font
3822 to
3823 .IR zoom ,
3824 a multiplier of the current type size in thousandths
3825 (default:
3826 1000).
3827 .
3828 .TPx
3829 .REQ .gcolor
3830 Restore previous stroke color,
3831 or the default if there is none.
3832 .
3833 .TPx
3834 .REQ .gcolor col
3835 Select
3836 .I col
3837 as the stroke color.
3838 .
3839 .TPx
3840 .REQ .hc
3841 Reset the hyphenation character
3842 .RB to\~ \[rs]%
3843 (the default).
3844 .
3845 .TPx
3846 .REQ .hc c
3847 Change the hyphenation character
3848 .RI to\~ c .
3849 .
3850 .TPx
3851 .REQ .hcode "dst1 src1 \fR[\fPdst2 src2\fR] .\|.\|.\fP"
3852 Set the hyphenation code of character
3853 .I dst1
3854 to that of
3855 .IR src1 ,
3856 and so on.
3857 .
3858 .TPx
3859 .REQ .hla
3860 Clear the environment's hyphenation language
3861 (disabling automatic hyphenation).
3862 .
3863 .TPx
3864 .REQ .hla ident
3865 Set the environment's hyphenation language to
3866 .IR ident .
3867 .
3868 .TPx
3869 .REQ .hlm
3870 Set the consecutive automatically hyphenated line limit to
3871 .B \-1
3872 (the default),
3873 meaning \[lq]no limit\[rq].
3874 .
3875 .TPx
3876 .REQ .hlm n
3877 Set the consecutive automatically hyphenated line limit to
3878 .RI to\~ n.
3879 .
3880 A negative value means \[lq]no limit\[rq].
3881 .
3882 .TPx
3883 .REQ .hpf file
3884 Read hyphenation patterns from
3885 .IR file .
3886 .
3887 .TPx
3888 .REQ .hpfa file
3889 Append hyphenation patterns from
3890 .IR file .
3891 .
3892 .TPx
3893 .REQ .hpfcode "a b \fR[\fPc d\fR] .\|.\|.\fP"
3894 .I Caution:
3895 This request will be withdrawn in a future
3896 .I groff
3897 release.
3898 .
3899 Use
3900 .B hcode
3901 instead.
3902 .
3903 .
3904 .IP
3905 Define mappings for character codes in hyphenation pattern files.
3906 .
3907 .TPx
3908 .REQ .hw "word \fR.\|.\|.\fP"
3909 Define each argument
3910 .I word
3911 (comprising ordinary,
3912 special,
3913 or indexed characters)
3914 as a
3915 .I "hyphenation exception word"
3916 such that each occurence of a hyphen-minus
3917 .RB \[lq] \- \[rq]
3918 in
3919 .I word
3920 indicates a hyphenation point.
3921 .
3922 .TPx
3923 .REQ .hy
3924 Set automatic hyphenation mode to the value of the
3925 .B \%.hydefault
3926 register.
3927 .
3928 .TPx
3929 .REQ .hy\~0
3930 Disable automatic hyphenation;
3931 same as
3932 .BR .nh .
3933 .
3934 .TPx
3935 .REQ .hy mode
3936 Set automatic hyphenation mode to
3937 .IR mode ;
3938 see section \[lq]Hyphenation\[rq] below.
3939 .
3940 .TPx
3941 .REQ .hydefault mode
3942 Set hyphenation mode default to
3943 .IR mode ;
3944 see section \[lq]Hyphenation\[rq] below.
3945 .
3946 .TPx
3947 .REQ .hym
3948 Set the (right) hyphenation margin to
3949 .B 0
3950 (the default).
3951 .
3952 .TPx
3953 .REQ .hym length
3954 Set the (right) hyphenation margin to
3955 .I length
3956 (default scaling unit\~\c
3957 .scaleindicator m ).
3958 .
3959 .TPx
3960 .REQ .hys
3961 Set the hyphenation space to
3962 .B 0
3963 (the default).
3964 .
3965 .TPx
3966 .REQ .hys hyphenation-space
3967 Suppress automatic hyphenation in adjustment modes
3968 .RB \[lq] b \[rq]
3969 or
3970 .RB \[lq] n \[rq]
3971 if that adjustment can be achieved by adding no more than
3972 .I hyphenation-space
3973 to each inter-word space
3974 (default scaling unit\~\c
3975 .scaleindicator m ).
3976 .
3977 .TPx
3978 .REQ .ie cond-expr
3979 Interpolate a newline if
3980 .I cond-expr
3981 is true,
3982 otherwise skip to a corresponding
3983 .request el
3984 request.
3985 .
3986 .TPx
3987 .REQ .ie "cond-expr input"
3988 If
3989 .I cond-expr
3990 is true,
3991 interpret
3992 .I input
3993 as if it were an input line,
3994 otherwise skip to a corresponding
3995 .request el
3996 request.
3997 .
3998 .TPx
3999 .REQ .if cond-expr
4000 Interpolate a newline if
4001 .I cond-expr
4002 is true.
4003 .
4004 .TPx
4005 .REQ .if "cond-expr input"
4006 If
4007 .I cond-expr
4008 is true,
4009 then interpret
4010 .I input
4011 as if it were an input line.
4012 .
4013 .TPx
4014 .REQ .ig
4015 Ignore input
4016 (except for side effects of
4017 .B \[rs]R
4018 on auto-incrementing registers)
4019 until
4020 .RB \[lq] .\|.\& \[rq]
4021 occurs at the start of a control line in the current conditional block.
4022 .
4023 .TPx
4024 .REQ .ig end-mac
4025 Ignore input
4026 (except for side effects of
4027 .B \[rs]R
4028 on auto-incrementing registers)
4029 until
4030 .I end-mac
4031 is called at the start of a control line in the current conditional
4032 block.
4033 .
4034 .I end-mac
4035 can be a request.
4036 .
4037 .TPx
4038 .REQ .in
4039 Set indentation amount to previous value.
4040 .
4041 .TPx
4042 .REQ .in \[+-]N
4043 Set indentation to
4044 .I \[+-]N
4045 (default scaling unit\~\c
4046 .scaleindicator m ).
4047 .
4048 .TPx
4049 .REQ .it
4050 Cancel any pending input line trap.
4051 .
4052 .TPx
4053 .REQ .it "npl mac"
4054 Set
4055 (or replace)
4056 an input line trap in the environment,
4057 calling
4058 .I mac
4059 after the next
4060 .I npl
4061 productive input lines have been read.
4062 .
4063 Lines interrupted with the
4064 .B \[rs]c
4065 escape sequence are counted separately.
4066 .
4067 .TPx
4068 .REQ .itc
4069 Cancel any pending input line trap.
4070 .
4071 .TPx
4072 .REQ .itc "npl mac"
4073 As
4074 .RB \[rq] it \[rq],
4075 but lines interrupted with the
4076 .B \[rs]c
4077 escape sequence do not apply to the line count.
4078 .
4079 .TPx
4080 .REQ .kern
4081 Enable pairwise kerning.
4082 .
4083 .TPx
4084 .REQ .kern b
4085 Enable or disable pairwise kerning
4086 per Boolean expression
4087 .IR b .
4088 .
4089 .TPx
4090 .REQ .lc
4091 Unset leader repetition character.
4092 .
4093 .TPx
4094 .REQ .lc c
4095 Set leader repetition character
4096 .RI to\~ c
4097 (default:
4098 .RB \[lq] . \[rq]).
4099 .
4100 .TPx
4101 .REQ .length "reg contents"
4102 Compute the number of characters in
4103 .I contents
4104 and store the count
4105 in the register
4106 .IR reg .
4107 .
4108 .TPx
4109 .REQ .linetabs
4110 Activate line-tabs in the environment.
4111 .
4112 It is disabled by default.
4113 .
4114 .TPx
4115 .REQ .linetabs b
4116 Activate or deactivate line-tabs in the environment per Boolean
4117 expression
4118 .IR b .
4119 .
4120 .TPx
4121 .REQ .lf input-line-number
4122 Set the input line number
4123 the formatter uses when reporting diagnostics.
4124 The argument becomes the input line number of the
4125 .I next
4126 line the formatter reads.
4127 .
4128 .TPx
4129 .REQ .lf "input-line-number character-sequence"
4130 As
4131 .B lf
4132 with one argument,
4133 but also update the reported file name to
4134 .IR character-sequence .
4135 .\" ...limiting the file names you can express; see Savannah #65108.
4136 .
4137 .TPx
4138 .REQ .lg
4139 Enable ligature mode
4140 .BR 1 .
4141 .
4142 .TPx
4143 .REQ .lg m
4144 Set ligature mode to
4145 .I m
4146 .RB ( 0
4147 = disable,
4148 .B 1
4149 = enable,
4150 .B 2
4151 = enable for two-letter ligatures only).
4152 .\" XXX: negative values accepted (mapped to 1); check AT&T troff
4153 .
4154 .TPx
4155 .REQ .ll
4156 Set line length to previous value.
4157 .
4158 Does not affect a pending output line.
4159 .
4160 .TPx
4161 .REQ .ll \[+-]N
4162 Set line length to
4163 .I \[+-]N
4164 (default length
4165 .scalednumber 6.5 i ,
4166 default scaling unit\~\c
4167 .scaleindicator m ).
4168 .
4169 Does not affect a pending output line.
4170 .
4171 .TPx
4172 .REQ .lsm
4173 Unset the leading space macro (trap).
4174 .
4175 Restore default handling of lines with leading spaces.
4176 .
4177 .TPx
4178 .REQ .lsm mac
4179 Set the leading space macro (trap) to
4180 .IR mac .
4181 .
4182 .TPx
4183 .REQ .ls
4184 Change to the previous value of additional intra-line skip.
4185 .
4186 .TPx
4187 .REQ .ls n
4188 Set additional intra-line skip value to
4189 .IR n ,
4190 i.e.,
4191 .IR n \-1
4192 blank lines are inserted after each text output line.
4193 .\" XXX: negative values accepted; check AT&T troff
4194 .
4195 .TPx
4196 .REQ .lt
4197 Set length of title lines to previous value.
4198 .
4199 .TPx
4200 .REQ .lt \[+-]N
4201 Set length of title lines
4202 (default length
4203 .scalednumber 6.5 i ,
4204 default scaling unit\~\c
4205 .scaleindicator m ).
4206 .
4207 .TPx
4208 .REQ .mc
4209 Cease writing margin character.
4210 .
4211 .TPx
4212 .REQ .mc c
4213 Begin writing margin
4214 .RI character\~ c
4215 to the right of each output line at a distance of
4216 .scalednumber 10 p .
4217 .
4218 .TPx
4219 .REQ .mc "c d"
4220 Begin writing margin
4221 .RI character\~ c
4222 on each output line at
4223 .RI distance\~ d
4224 to the right of the right margin
4225 (default distance
4226 .scalednumber 10 p ,
4227 default scaling unit\~\c
4228 .scaleindicator m ).
4229 .
4230 .TPx
4231 .REQ .mk
4232 Mark vertical drawing position in an internal register;
4233 see
4234 .BR .rt .
4235 .
4236 .TPx
4237 .REQ .mk reg
4238 Mark vertical drawing position in register
4239 .IR reg .
4240 .
4241 .TPx
4242 .REQ .mso file
4243 As
4244 .RB \[rq] so \[rq],
4245 except that GNU
4246 .I troff \" GNU
4247 searches for the specified
4248 .I file
4249 in the same directories as macro files;
4250 see
4251 .I GROFF_TMAC_PATH
4252 in section \[lq]Environment\[rq] of
4253 .MR groff 1
4254 and
4255 .B \-m
4256 in section \[lq]Options\[rq]
4257 of the same page.
4258 .
4259 .TPx
4260 .REQ .msoquiet file
4261 As
4262 .request mso ,
4263 but no warning is emitted if
4264 .I file
4265 does not exist.
4266 .
4267 .TPx
4268 .REQ .na
4269 Disable output line adjustment.
4270 .
4271 .TPx
4272 .REQ .ne
4273 Break page if distance to next page location trap is less than one vee.
4274 .
4275 .TPx
4276 .REQ .ne d
4277 Break page if distance to next page location trap is less than distance
4278 .I d
4279 (default scaling unit\~\c
4280 .scaleindicator v ).
4281 .
4282 .TPx
4283 .REQ .nf
4284 Disable filling of output lines;
4285 a pending output line is broken.
4286 .
4287 Clears
4288 .BR \[rs]n[.u] .
4289 .
4290 .TPx
4291 .REQ .nh
4292 Disable automatic hyphenation;
4293 same as
4294 .RB \[lq] ".hy 0" \[rq].
4295 .
4296 .TPx
4297 .REQ .nm
4298 Deactivate output line numbering.
4299 .
4300 .TPx
4301 .REQ .nm \[+-]N
4302 .TQ
4303 .REQ .nm "\[+-]N m"
4304 .TQ
4305 .REQ .nm "\[+-]N m s"
4306 .TQ
4307 .REQ .nm "\[+-]N m s i"
4308 Activate output line numbering:
4309 number the next output line
4310 .I \[+-]N,
4311 writing numbers every
4312 .I m
4313 lines
4314 (default 1),
4315 with
4316 .I s
4317 numeral widths
4318 .RB ( \[rs]0 )
4319 between the line number and the output
4320 (default 1),
4321 and indenting the line number by
4322 .I i
4323 numeral widths
4324 (default 0).
4325 .
4326 .TPx
4327 .REQ .nn
4328 Suppress numbering of the next output line counted by
4329 .BR nm .
4330 .
4331 .TPx
4332 .REQ .nn n
4333 Suppress numbering of the next
4334 .I n
4335 output lines counted by
4336 .BR nm .
4337 .
4338 If
4339 .IR n =0,
4340 cancel suppression.
4341 .\" XXX: negative values accepted; check AT&T troff
4342 .
4343 .TPx
4344 .REQ .nop
4345 Interpolate a newline.
4346 .
4347 .TPx
4348 .REQ .nop input
4349 Interpret
4350 .I input
4351 as if it were an input line.
4352 .
4353 .TPx
4354 .REQ .nr "reg \[+-]N"
4355 Define or update register
4356 .I reg
4357 with value
4358 .IR N .
4359 .
4360 .TPx
4361 .REQ .nr "reg \[+-]N I"
4362 Define or update register
4363 .I reg
4364 with value
4365 .I N
4366 and auto-increment
4367 .IR I ,
4368 which may be any integer.
4369 .
4370 .TPx
4371 .REQ .nroff
4372 Make the conditional expressions
4373 .B n
4374 true and
4375 .B t
4376 false.
4377 .
4378 .TPx
4379 .REQ .ns
4380 Enable
4381 .IR "no-space mode" ,
4382 ignoring
4383 .B .sp
4384 requests until a glyph or
4385 .B \[rs]D
4386 primitive is output.
4387 .
4388 See
4389 .BR .rs .
4390 .
4391 .TPx
4392 .REQ .nx
4393 Stop processing the input file and read the next,
4394 if any.
4395 .
4396 .TPx
4397 .REQ .nx file
4398 Stop processing the input file and read
4399 .IR file .
4400 .
4401 .TPx
4402 .REQ .open "ident file"
4403 Open
4404 .I file
4405 for writing and associate a stream named
4406 .I ident
4407 with it,
4408 making it available for
4409 .RB \[rq] write \[rq]
4410 requests.
4411 .
4412 Unsafe request;
4413 disabled by default.
4414 .
4415 .TPx
4416 .REQ .opena "ident file"
4417 As
4418 .RB \[lq] open \[rq],
4419 but if
4420 .I file
4421 already exists,
4422 appends to it instead of overwriting it.
4423 .
4424 Unsafe request;
4425 disabled by default.
4426 .
4427 .TPx
4428 .REQ .os
4429 Output vertical space that was saved by the
4430 .request sv
4431 request.
4432 .
4433 .TPx
4434 .REQ .output character-sequence
4435 Emit
4436 .I character-sequence
4437 \[lq]transparently\[rq]
4438 (directly) to
4439 .IR \%troff 's
4440 output.
4441 .
4442 .TPx
4443 .REQ .pc
4444 Reset page number character to\~\c
4445 .squoted_char % .
4446 .
4447 .TPx
4448 .REQ .pc c
4449 Change the page number character used in titles
4450 .RI to\~ c .
4451 .
4452 .TPx
4453 .REQ .pchar "c \fR\&.\|.\|.\&\fP"
4454 Report,
4455 to the standard error stream,
4456 information about each character
4457 (be it
4458 ordinary,
4459 special,
4460 or indexed)
4461 .RI "or character class\~" c .
4462 .
4463 A character defined by a request
4464 .RB ( char ,
4465 .BR \%fchar ,
4466 .BR \%fschar ,
4467 or
4468 .BR \%schar )
4469 reports its contents as a JSON-encoded string,
4470 but the output is not otherwise in JSON format.
4471 .
4472 .TPx
4473 .REQ .pcolor
4474 Report,
4475 to the standard error stream,
4476 each defined color name,
4477 its color space identifier,
4478 and channel value assignments.
4479 .
4480 A device's default stroke and/or fill colors,
4481 \[lq]default\[rq],
4482 are not listed since they are immutable and their details unknown to the
4483 formatter.
4484 .
4485 .TPx
4486 .REQ .pcolor "col \fR\&.\|.\|.\&\fP"
4487 Report,
4488 to the standard error stream,
4489 the name,
4490 color space identifier,
4491 and channel value assignments of each color
4492 .IR col .
4493 .
4494 .TPx
4495 .REQ .pcomposite
4496 Report,
4497 to the standard error stream,
4498 the list of configured composite character mappings.
4499 .
4500 See the
4501 .RB \%\[lq] composite \[rq]
4502 request.
4503 .
4504 The \[lq]from\[rq] code point is listed first,
4505 followed by its \[lq]to\[rq] mapping.
4506 .
4507 .TPx
4508 .REQ .pev
4509 Report the state of the current environment followed by that of all
4510 other environments to the standard error stream.
4511 .
4512 .TPx
4513 .REQ .pfp
4514 Report,
4515 to the standard error stream,
4516 the list of occupied font mounting positions.
4517 .\" Recall the @code{fp} request description in @ref{Selecting Fonts}.
4518 .
4519 Occupied mounting positions are listed,
4520 one per line,
4521 in increasing order,
4522 followed by the typeface name;
4523 if the name corresponds to an abstract style,
4524 the entry ends there.
4525 .
4526 Otherwise,
4527 the name of the font description file
4528 and the font's \[lq]internal name\[rq] datum,
4529 the meaning of which varies by output device,
4530 follow.
4531 .
4532 .TPx
4533 .REQ .pftr
4534 Report,
4535 to the standard error stream,
4536 the list of font translations.
4537 .
4538 .TPx
4539 .REQ .phw
4540 Report,
4541 to the standard error stream,
4542 the list of hyphenation exception words
4543 associated with the hyphenation language
4544 selected by the
4545 .B hla
4546 request.
4547 .
4548 A
4549 .RB \[lq] \- \[rq]
4550 marks each hyphenation point.
4551 .
4552 A word prefixed with
4553 .RB \[lq] \- \[rq]
4554 is not hyphenated at all.
4555 .
4556 The report suffixes words
4557 to which automatic hyphenation applies
4558 (meaning those defined in a hyphenation pattern file
4559 rather than with the
4560 .B hw
4561 request)
4562 with a tab and asterisk
4563 .RB \[lq] * \[rq].
4564 .
4565 .
4566 .TPx
4567 .REQ .pi command
4568 Pipe GNU
4569 .I troff \" GNU
4570 output through
4571 .I command
4572 (which is read in copy mode)
4573 by passing it to
4574 .MR popen 3 .
4575 .
4576 Multiple
4577 .B pi
4578 requests construct a multi-stage pipeline in the same order as the
4579 formatter encounters the requests.
4580 .
4581 Unsafe request;
4582 disabled by default.
4583 .
4584 .TPx
4585 .REQ .pl
4586 Set page length to default
4587 .scalednumber 11 i .
4588 The current page length is stored in register
4589 .BR .p .
4590 .
4591 .TPx
4592 .REQ .pl \[+-]N
4593 Change page length to
4594 .I \[+-]N
4595 (default scaling unit\~\c
4596 .scaleindicator v ).
4597 .
4598 .TPx
4599 .REQ .pline
4600 Report,
4601 in JSON syntax to the standard error stream,
4602 the list of output nodes corresponding to the pending output line.
4603 .
4604 In JSON,
4605 a pair of empty brackets
4606 .RB \[lq] "[ ]" \[rq]
4607 represents an empty list.
4608 .
4609 A
4610 .I pending
4611 output line has not yet undergone adjustment,
4612 and lacks a line number and margin character
4613 (all as applicable).
4614 .
4615 .TPx
4616 .REQ .pm
4617 Report,
4618 to the standard error stream,
4619 the names of all defined macros,
4620 strings,
4621 and diversions and their lengths in characters or nodes.
4622 .
4623 .TPx
4624 .REQ .pm "name \fR\&.\|.\|.\&\fP"
4625 Report,
4626 to the standard error stream,
4627 the JSON-encoded name and contents of each macro,
4628 string,
4629 or diversion
4630 .IR name .
4631 .
4632 .TPx
4633 .REQ .pn \[+-]N
4634 Set next page number.
4635 .
4636 .TPx
4637 .REQ .pnr
4638 Report the names,
4639 values,
4640 and
4641 (as applicable)
4642 autoincrement amounts and
4643 assigned formats of all defined registers to the standard error stream.
4644 .
4645 .TPx
4646 .REQ .pnr "reg \fR\&.\|.\|.\&\fP"
4647 Report the name and value and,
4648 if its type is numeric,
4649 the autoincrement amount and assigned format,
4650 of each register
4651 .I reg
4652 to the standard error stream.
4653 .
4654 .TPx
4655 .REQ .po
4656 Change to previous page offset.
4657 .
4658 The current page offset is available in register
4659 .BR .o .
4660 .
4661 .TPx
4662 .REQ .po \[+-]N
4663 Alter page offset
4664 (default scaling unit\~\c
4665 .scaleindicator m ).
4666 .
4667 .TPx
4668 .REQ .ps
4669 Restore previous type size.
4670 .TPx
4671 .
4672 .REQ .ps \[+-]N
4673 Set/increase/decrease the type size to/by
4674 .I N
4675 scaled points
4676 (a non-positive resulting type size is set to 1\~u);
4677 also see
4678 .esc[] s \[+-]N .
4679 .
4680 .TPx
4681 .REQ .psbb postscript-file
4682 Retrieve the bounding box of the PostScript image found in
4683 .I postscript-file,
4684 which must conform to Adobe's Document Structuring Conventions (DSC).
4685 .
4686 See registers
4687 .BR llx ,
4688 .BR lly ,
4689 .BR urx ,
4690 .BR ury .
4691 .
4692 .TPx
4693 .REQ .pso command
4694 As
4695 .RB \[lq] so \[rq],
4696 except that input comes from the standard output stream of
4697 .IR command ,
4698 which is passed to
4699 .MR popen 3 .
4700 .
4701 Unsafe request;
4702 disabled by default.
4703 .
4704 .TPx
4705 .REQ .pstream
4706 Report,
4707 in
4708 JSON
4709 syntax to the standard error stream,
4710 the list of open streams,
4711 including the name of each open stream,
4712 the name of the file backing it,
4713 and its mode
4714 (writing or appending).
4715 .
4716 .TPx
4717 .REQ .pwh
4718 Report names and positions of all page location traps to the standard
4719 error stream.
4720 .
4721 .TPx
4722 .REQ .pvs
4723 Change to previous post-vertical line spacing.
4724 .
4725 .TPx
4726 .REQ .pvs \[+-]N
4727 Change post-vertical line spacing according to
4728 .I \[+-]N
4729 (default scaling unit\~\c
4730 .scaleindicator p ).
4731 .
4732 .TPx
4733 .REQ .rchar "c\fR.\|.\|.\&\fP"
4734 Remove definition of each
4735 ordinary,
4736 special,
4737 or
4738 indexed
4739 character
4740 .IR c ,
4741 undoing the effect of a
4742 .BR char ,
4743 .BR \%fchar ,
4744 or
4745 .B \%schar
4746 request.
4747 .
4748 Spaces need not separate
4749 .I c
4750 arguments.
4751 .\" XXX: Removal of a class is unspecified.
4752 .
4753 The character definition removed
4754 (if any)
4755 is the first encountered in the resolution process documented
4756 in section \[lq]Using Symbols\[rq] of
4757 .IR "Groff: The GNU Implementation of troff" .
4758 .\" TODO: Get that information into this man page!
4759 .
4760 Glyphs,
4761 which are defined by font description files,
4762 cannot be removed.
4763 .
4764 .TPx
4765 .REQ .rd
4766 Read insertion from standard input stream,
4767 ringing terminal bell as prompt.
4768 .
4769 .TPx
4770 .REQ .rd terminal-message
4771 Read insertion from standard input stream,
4772 writing
4773 .I terminal-message
4774 to standard error stream as prompt.
4775 .
4776 .TPx
4777 .REQ .return
4778 .\" XXX: useless request warning if not interpreting a macro?
4779 Stop interpreting an interpolated macro,
4780 skipping the remainder of its definition.
4781 .
4782 .TPx
4783 .REQ .return input
4784 As
4785 .BR return ,
4786 but perform the skip twice\[em]once within the macro being interpreted
4787 and once in an enclosing macro.
4788 .
4789 .TPx
4790 .REQ .rfschar "f c\fR\&.\|.\|.\&\fP"
4791 Remove each fallback special
4792 .RI character\~ c
4793 for font
4794 .IR f .
4795 .
4796 Spaces need not separate
4797 .I c
4798 arguments.
4799 .
4800 See
4801 .BR fschar .
4802 .
4803 .TPx
4804 .REQ .rj
4805 Break,
4806 right-align the output of the next productive input line without
4807 filling,
4808 then break again.
4809 .
4810 .TPx
4811 .REQ .rj npl
4812 Break,
4813 right-align the output of the next
4814 .I npl
4815 productive input lines without filling,
4816 then break again.
4817 .
4818 If
4819 .I npl
4820 \[<=] 0,
4821 stop right-aligning.
4822 .
4823 .TPx
4824 .REQ .rm "name \f[R].\|.\|."
4825 Remove each request,
4826 macro,
4827 diversion,
4828 or string
4829 .IR name .
4830 .
4831 .TPx
4832 .REQ .rn "old new"
4833 Rename request,
4834 macro,
4835 diversion,
4836 or string
4837 .I old
4838 to
4839 .IR new .
4840 .
4841 .TPx
4842 .REQ .rnn "reg1 reg2"
4843 Rename register
4844 .I reg1
4845 to
4846 .IR reg2 .
4847 .
4848 .TPx
4849 .REQ .rr "reg \f[R].\|.\|."
4850 Remove each register
4851 .IR reg .
4852 .
4853 .TPx
4854 .REQ .rs
4855 Restore spacing;
4856 disable no-space mode.
4857 .
4858 See
4859 .BR .ns .
4860 .
4861 .TPx
4862 .REQ .rt
4863 Return
4864 .I (upward only)
4865 to vertical position marked by
4866 .B .mk
4867 on the current page.
4868 .
4869 .TPx
4870 .REQ .rt N
4871 Return
4872 .I (upward only)
4873 to vertical position
4874 .I N
4875 (default scaling
4876 unit\~\c
4877 .scaleindicator v ).
4878 .\" XXX: negative values accepted; check AT&T troff
4879 .
4880 .TPx
4881 .REQ .schar c
4882 Define global fallback character
4883 .I c
4884 as empty.
4885 .
4886 .TPx
4887 .REQ .schar "c contents"
4888 Define global fallback character
4889 .I c
4890 as
4891 .IR contents .
4892 .
4893 As
4894 .BR char ,
4895 but GNU
4896 .I troff \" GNU
4897 locates a character defined with
4898 .B schar
4899 after any fonts named as arguments to the
4900 .RB \%\[lq] special \[rq]
4901 request and before any mounted special fonts.
4902 .
4903 .TPx
4904 .REQ .shc
4905 Reset the soft hyphen character to
4906 .esc [hy] .
4907 .
4908 .TPx
4909 .REQ .shc c
4910 Set the soft hyphen character
4911 .RI to\~ c .
4912 .
4913 .TPx
4914 .REQ .shift
4915 Shift macro or string parameters one place
4916 .I n
4917 places:
4918 .RI argument\~ i
4919 becomes argument
4920 .IR i \|\-\| 1 ;
4921 argument 1
4922 becomes unavailable.
4923 .
4924 .TPx
4925 .REQ .shift n
4926 Shift macro or string parameters
4927 .I n
4928 places:
4929 .RI argument\~ i
4930 becomes argument
4931 .IR i \|\-\| n ;
4932 arguments 1
4933 .RI to\~ n
4934 become unavailable.
4935 .
4936 .TPx
4937 .REQ .sizes "s1 s2 \f[R].\|.\|.\&\f[] sn \f[R][\f[B]0\f[]]"
4938 Set available type sizes to the list of values or ranges;
4939 each
4940 .IR s i
4941 is interpreted in units of scaled points (\c
4942 .scaleindicator s ).
4943 .
4944 GNU
4945 .I troff \" GNU
4946 strips a leading neutral double quote from
4947 .IR s1 ;
4948 it reads
4949 each
4950 .IR s i
4951 in copy mode.
4952 .
4953 .TPx
4954 .REQ .so file
4955 Replace the request's control line
4956 with the contents of
4957 .IR file ,
4958 \[lq]sourcing\[rq] it.
4959 GNU
4960 .I troff \" GNU
4961 searches for
4962 .I file
4963 in any directories specified by
4964 .B \-I
4965 command-line options,
4966 followed by the current working directory.
4967 .
4968 If
4969 .I file
4970 does not exist,
4971 the formatter ignores the request.
4972 (GNU
4973 .I troff \" GNU
4974 emits a warning in category
4975 .RB \[lq] file \[rq].)
4976 .
4977 .TPx
4978 .REQ .soquiet file
4979 As
4980 .RB \[rq] so \[rq],
4981 but no warning is emitted if
4982 .I file
4983 does not exist.
4984 .
4985 .TPx
4986 .REQ .sp
4987 Break and move the next text baseline down by one vee,
4988 or until springing a page location trap.
4989 .
4990 If invoked with the no-break control character,
4991 .B sp
4992 moves the text baseline applicable to the entire pending output line.
4993 .
4994 .TPx
4995 .REQ .sp vertical-distance
4996 As
4997 .BR sp ,
4998 but move by
4999 .I vertical-distance
5000 instead of
5001 .BR 1v .
5002 .
5003 Inside a diversion,
5004 the formatter ignores any argument.
5005 .
5006 A negative
5007 .I vertical-distance
5008 cannot reduce the position of the text baseline below zero.
5009 .
5010 Applying the boundary-relative measurement operator
5011 .B \[or]
5012 operator to
5013 .I vertical-distance,
5014 as in
5015 .RB \[lq] \[or]\c
5016 .IR N \[rq],
5017 moves to a position relative to the page top for positive
5018 .IR N ,
5019 and the bottom if
5020 .I N
5021 is negative.
5022 .
5023 .TPx
5024 .REQ .special
5025 Empty the list of special fonts designated by this request
5026 when given arguments.
5027 .
5028 .TPx
5029 .REQ .special "s \fR\&.\|.\|.\&\fP"
5030 Declare each font
5031 .I s
5032 as special,
5033 irrespective of its description file,
5034 populating a list that
5035 GNU
5036 .I troff \" GNU
5037 searches,
5038 in order,
5039 to find the glyph demanded.
5040 .
5041 .\" TODO: Move this sentence to a new (sub)section describing the glyph
5042 .\" resolution procedure.
5043 GNU
5044 .I troff \" GNU
5045 searches fonts specified as arguments to the
5046 .RB \%\[lq] special \[rq]
5047 request after those given as arguments to the
5048 .B \%fspecial
5049 request.
5050 .
5051 .TPx
5052 .REQ .spreadwarn
5053 Toggle the spread warning on and off (the default) without changing its
5054 value.
5055 .
5056 .TPx
5057 .REQ .spreadwarn N
5058 Emit a
5059 .B break
5060 warning if the additional space inserted for each space between words in
5061 an adjusted output line is greater than or equal to
5062 .IR N .
5063 .
5064 A negative
5065 .I N
5066 is treated as 0.
5067 .
5068 The default scaling unit is\~\c
5069 .scaleindicator m .
5070 .
5071 At startup,
5072 .request spreadwarn
5073 is inactive and
5074 .I N
5075 is
5076 .scalednumber "3 m" .
5077 .\" XXX: Negative values are accepted to make future implementation of
5078 .\" "squeezable" adjustable spaces smoother; see Savannah #40963.
5079 .
5080 .TPx
5081 .REQ .ss n
5082 Set minimum inter-word space and supplemental inter-sentence space sizes
5083 to
5084 .IR n \~12ths
5085 of the selected font's
5086 .B spacewidth
5087 parameter
5088 (default: 12).
5089 .
5090 .TPx
5091 .REQ .ss "n m"
5092 As
5093 .RB \[lq] .ss\~\c
5094 .IR n \[rq],
5095 but set supplemental inter-sentence space size to
5096 .IR m \~12ths
5097 of the selected font's
5098 .B spacewidth
5099 parameter.
5100 .
5101 .TPx
5102 .REQ .stringdown str
5103 Replace each byte in the string named
5104 .I str
5105 with its lowercase version.
5106 .
5107 .TPx
5108 .REQ .stringup str
5109 Replace each byte in the string named
5110 .I str
5111 with its uppercase version.
5112 .
5113 .TPx
5114 .REQ .sty "pos style"
5115 Associate abstract
5116 .I style
5117 with non-negative font position
5118 .IR pos .
5119 .
5120 .TPx
5121 .REQ .substring "str start \fR[\fPend\fR]\fP"
5122 Replace the string named
5123 .I str
5124 with its substring bounded by the indices
5125 .I start
5126 and
5127 .IR end ,
5128 inclusive.
5129 .
5130 Negative indices count backward from the end of the string.
5131 .
5132 .TPx
5133 .REQ .sv
5134 As
5135 .request ne ,
5136 but save
5137 .scalednumber "1 v"
5138 for output with
5139 .request os
5140 request.
5141 .
5142 .TPx
5143 .REQ .sv d
5144 As
5145 .request ne ,
5146 but save distance
5147 .I d
5148 for later output with
5149 .request os
5150 request
5151 (default scaling unit\~\c
5152 .scaleindicator v ).
5153 .\" XXX: negative values accepted; check AT&T troff
5154 .
5155 .TPx
5156 .REQ .sy command
5157 Execute
5158 .I command
5159 (which is read in copy mode)
5160 in the operating environment
5161 by passing it to
5162 .MR system 3 .
5163 .
5164 See register
5165 .BR \%systat .
5166 .
5167 Unsafe request;
5168 disabled by default.
5169 .
5170 .TPx
5171 .REQ .ta
5172 Clear tab stops.
5173 .
5174 .TPx
5175 .REQ .ta "n1 n2 \fR\&.\|.\|.\&\fP n\fRn\fP \f[B]T\f[] r1 r2 \
5176 \fR\&.\|.\|.\&\fP r\fRn\fP"
5177 Set tabs at positions
5178 .IR n1 ,
5179 .IR n2 ,
5180 \&.\|.\|.\&,
5181 .IR n n,
5182 then set tabs at
5183 .IR n n+ m \[tmu] r n+ r1
5184 through
5185 .IR n n+ m \[tmu] r n+ r n,
5186 where
5187 .I m
5188 increments from 0,
5189 1,
5190 2,
5191 \&.\|.\|.\& to the output line length.
5192 .
5193 Each
5194 .IR n \~argument
5195 can be prefixed with
5196 .RB a\~\[lq] + \[rq]
5197 to place the tab stop
5198 .I ni
5199 at a distance relative to the previous,
5200 .IR n ( i \-1).
5201 .
5202 Each argument
5203 .IR ni \~or\~ ri
5204 can be suffixed with a letter to align text within the tab column
5205 bounded by tab stops
5206 .IR i \~and\~ i +1;
5207 .RB \[lq] L \[rq]
5208 for left-aligned
5209 (the default),
5210 .RB \[lq] C \[rq]
5211 for centered,
5212 and
5213 .RB \[lq] R \[rq]
5214 for right-aligned.
5215 .
5216 .TPx
5217 .REQ .tag
5218 Reserved for internal use.
5219 .
5220 .TPx
5221 .REQ .taga
5222 Reserved for internal use.
5223 .
5224 .TPx
5225 .REQ .tc
5226 Unset tab repetition character.
5227 .
5228 .TPx
5229 .REQ .tc c
5230 Set tab repetition character
5231 .RI to\~ c
5232 (default: none).
5233 .
5234 .TPx
5235 .REQ .ti \[+-]N
5236 Temporarily indent next output line
5237 (default scaling unit\~\c
5238 .scaleindicator m ).
5239 .
5240 .TPx
5241 .REQ .tkf "font s1 n1 s2 n2"
5242 Enable track kerning for
5243 .IR font .
5244 .
5245 .TPx
5246 .REQ .tl \f[B]\[aq]\f[]left\f[B]\[aq]\f[]center\f[B]\[aq]\f[]right\
5247 \f[B]\[aq]\f[]
5248 Format three-part title.
5249 .
5250 .TPx
5251 .REQ .tm
5252 Write a newline to the standard error stream.
5253 .
5254 .TPx
5255 .REQ .tm terminal-message
5256 Send
5257 .IR terminal-message ,
5258 followed by a newline,
5259 to the standard error stream.
5260 The formatter reads the argument
5261 to the end of the input line in copy mode,
5262 but does
5263 .I not
5264 remove a leading double quote;
5265 contrast
5266 .BR .tm1 .
5267 .
5268 .TPx
5269 .REQ .tm1
5270 As
5271 .request tm .
5272 .
5273 .TPx
5274 .REQ .tm1 message
5275 As
5276 .request tm ,
5277 but removes a leading neutral double quote
5278 .RB \[oq] \[dq] \[cq]
5279 from
5280 .IR message ,
5281 permitting initial embedded spaces in it,
5282 and reads it to the end of the input line in copy mode.
5283 .
5284 .TPx
5285 .REQ .tmc
5286 No operation.
5287 .
5288 .TPx
5289 .REQ .tmc message
5290 As
5291 .request tm1 ,
5292 but does not append a newline.
5293 .
5294 .TPx
5295 .REQ .tr abcd\fR\&.\|.\|.\&\fP
5296 Translate ordinary or special characters
5297 .I a
5298 to
5299 .IR b ,
5300 .I c
5301 to
5302 .IR d ,
5303 and so on prior to output.
5304 .
5305 .TPx
5306 .REQ .trf file
5307 Break and copy contents of
5308 .I file
5309 as \[lq]throughput\[rq] to GNU
5310 .I troff \" GNU
5311 output
5312 (see
5313 .MR groff_out 5 ).
5314 .
5315 Unlike
5316 .request cf ,
5317 characters invalid as input to GNU
5318 .I troff \" GNU
5319 are discarded.
5320 .
5321 If
5322 .IR file 's
5323 contents do not end with a newline,
5324 .B trf
5325 appends one.
5326 .
5327 .TPx
5328 .REQ .trin abcd\fR\&.\|.\|.\&\fP
5329 As
5330 .request tr ,
5331 except that
5332 .request asciify
5333 ignores the translation when a diversion is interpolated.
5334 .
5335 .TPx
5336 .REQ .trnt abcd\fR\&.\|.\|.\&\fP
5337 As
5338 .request tr ,
5339 except that translations are suppressed in the argument to
5340 .esc ! .
5341 .
5342 .TPx
5343 .REQ .troff
5344 Make the conditional expressions
5345 .B t
5346 true and
5347 .B n
5348 false.
5349 .
5350 .TPx
5351 .REQ .uf font
5352 Set underline font used by
5353 .request ul
5354 to
5355 .I font.
5356 .
5357 .TPx
5358 .REQ .ul
5359 Underline
5360 (italicize in
5361 .I troff
5362 mode)
5363 the output of the next productive input line.
5364 .
5365 .TPx
5366 .REQ .ul npl
5367 Underline
5368 (italicize in
5369 .I troff
5370 mode)
5371 the output of the next
5372 .I npl
5373 productive input line.
5374 .
5375 If
5376 .IR npl =0,
5377 stop underlining.
5378 .
5379 .TPx
5380 .REQ .unformat div
5381 Unformat space characters and tabs in diversion
5382 .IR div ,
5383 preserving font information.
5384 .\" XXX: too vague
5385 .
5386 .TPx
5387 .REQ .vpt
5388 Enable vertical position traps.
5389 .
5390 They are enabled by default.
5391 .
5392 .TPx
5393 .REQ .vpt b
5394 Enable or disable vertical position traps per Boolean expression
5395 .IR b .
5396 .
5397 .TPx
5398 .REQ .vs
5399 Change to previous vertical spacing.
5400 .
5401 .TPx
5402 .REQ .vs \[+-]N
5403 Set vertical spacing to
5404 .I \[+-]N
5405 (default scaling unit\~\c
5406 .scaleindicator p ).
5407 .
5408 .TPx
5409 .REQ .warn
5410 Enable all warning categories.
5411 .
5412 .TPx
5413 .REQ .warn\~0
5414 Disable all warning categories.
5415 .
5416 .TPx
5417 .REQ .warn n
5418 Enable warnings in categories whose codes sum
5419 .RI to\~ n ;
5420 .\" TODO: Move that table here, perhaps.
5421 see
5422 .MR \%troff 1 .
5423 .
5424 .TPx
5425 .REQ .warnscale scaling-unit
5426 Select scaling unit used in certain warnings \" `output_warning()`
5427 (one of
5428 .BR u ,
5429 .BR i ,
5430 .BR c ,
5431 .BR p ,
5432 or
5433 .BR P ;
5434 default:
5435 .BR i ).
5436 .
5437 Ignored on
5438 .IR nroff -mode
5439 output devices,
5440 for which these diagnostics report the vertical page location in lines,
5441 and the horizontal page location in ens.
5442 .
5443 .TPx
5444 .REQ .wh vertical-position
5445 Remove visible page location trap at
5446 .I vertical-position
5447 (default scaling unit\~\c
5448 .scaleindicator v ).
5449 .
5450 .TPx
5451 .REQ .wh "vertical-position mac"
5452 Plant macro
5453 .I mac
5454 as page location trap at
5455 .I vertical-position
5456 (default scaling unit\~\c
5457 .scaleindicator v ),
5458 removing any visible trap already there.
5459 .
5460 .TPx
5461 .REQ .while cond-expr
5462 Interpolate newlines unless and until
5463 .I cond-expr
5464 evaluates false.
5465 .
5466 .TPx
5467 .REQ .while "cond-expr input"
5468 Repeatedly execute
5469 .I input
5470 unless and until
5471 .I cond-expr
5472 evaluates false.
5473 .
5474 .TPx
5475 .REQ .write "stream character-sequence"
5476 Write
5477 .IR character-sequence ,
5478 a sequence of ordinary characters,
5479 spaces,
5480 or tabs,
5481 .\" ...or, technically, backspace and delete characters, but let's not
5482 .\" dwell on that.
5483 to
5484 .IR stream ,
5485 which must previously have been the subject of an
5486 .RB \[lq] open \[rq]
5487 (or
5488 .BR opena )
5489 request,
5490 followed by a newline.
5491 .
5492 GNU
5493 .I troff \" GNU
5494 flushes the stream after writing to it.
5495 .
5496 .TPx
5497 .REQ .writec "stream character-sequence"
5498 As
5499 .RB \[rq] write \[rq],
5500 but does not write a newline to the output.
5501 .
5502 .TPx
5503 .REQ .writem "stream name"
5504 Write the contents of the macro or string
5505 .I name
5506 to
5507 .IR stream ,
5508 which must previously have been the subject of an
5509 .RB \[lq] open \[rq]
5510 (or
5511 .BR opena )
5512 request.
5513 .
5514 GNU
5515 .I troff \" GNU
5516 reads the contents of
5517 .I name
5518 in copy mode.
5519 .
5520 .LE
5521 .
5522 .
5523 .\" ====================================================================
5524 .SH "Escape sequence short reference"
5525 .\" ====================================================================
5526 .
5527 The escape sequences
5528 .esc \[dq] ,
5529 .esc # ,
5530 .esc $ ,
5531 .esc * ,
5532 .esc ? ,
5533 .esc a ,
5534 .esc e ,
5535 .esc n ,
5536 .esc t ,
5537 .esc g ,
5538 .esc V ,
5539 and
5540 .escarg \& newline
5541 are interpreted even in copy mode.
5542 .
5543 .
5544 .P
5545 The escape sequences
5546 .esc f ,
5547 .esc F ,
5548 .esc H ,
5549 .esc m ,
5550 .esc M ,
5551 .esc R ,
5552 .esc s ,
5553 and
5554 .esc S
5555 are not tokenized when
5556 GNU
5557 .I troff \" GNU
5558 reads its input.
5559 .
5560 .esc R
5561 updates only the formatter's register dictionary,
5562 and does not contribute (directly) to output.
5563 .
5564 The others alter the environment
5565 (see section \[lq]Environments\[rq] below).
5566 .
5567 See the \[lq]Gtroff Internals\[rq] section of the
5568 .I groff
5569 Texinfo manual.
5570 .
5571 .
5572 .P
5573 .LS
5574 .
5575 .\" ========= comments =========
5576 .
5577 .TP
5578 .ESC \[dq]
5579 Comment;
5580 read everything up to the next newline in copy mode and discard it.
5581 .
5582 .
5583 .TP
5584 .ESC #
5585 Whole-line comment;
5586 read everything up to and including the next newline in copy mode and
5587 discard it.
5588 .
5589 .
5590 .\" ========= strings =========
5591 .
5592 .TP
5593 .ESC * s
5594 Interpolate string with one-character
5595 .RI name\~ s .
5596 .
5597 .
5598 .TP
5599 .ESC *( st
5600 Interpolate string with two-character
5601 .RI name\~ st .
5602 .
5603 .
5604 .TP
5605 .ESC[] * string
5606 Interpolate string with name
5607 .I string
5608 (of arbitrary length).
5609 .
5610 .
5611 .TP
5612 .ESC[] * "string arg \fR\&.\|.\|.\fP"
5613 Interpolate string with name
5614 .I string
5615 (of arbitrary length),
5616 taking
5617 .I arg
5618 \&.\|.\|.\&
5619 as arguments.
5620 .
5621 .
5622 .\" ========= macro arguments =========
5623 .
5624 .TP
5625 .ESC $0
5626 Interpolate name by which currently executing macro was invoked.
5627 .
5628 .
5629 .TP
5630 .ESC $ n
5631 Interpolate macro or string parameter
5632 .RI numbered\~ n
5633 .RI (1\|\[<=]\| n \|\[<=]\|9).
5634 .
5635 .
5636 .TP
5637 .ESC $( nn
5638 Interpolate macro or string parameter
5639 .RI numbered\~ nn
5640 .RI (01\|\[<=]\| nn \|\[<=]\|99).
5641 .
5642 .TP
5643 .ESC[] $ nnn
5644 Interpolate macro or string parameter
5645 .RI numbered\~ nnn
5646 .RI ( nnn \|\[>=]\|1).
5647 .
5648 .
5649 .TP
5650 .ESC $*
5651 Interpolate catenation of all macro or string parameters,
5652 separated by spaces.
5653 .
5654 .
5655 .TP
5656 .ESC $@
5657 Interpolate catenation of all macro or string parameters,
5658 with each surrounded by double quotes and separated by spaces.
5659 .
5660 .
5661 .TP
5662 .ESC $\[ha]
5663 Interpolate catenation of all macro or string parameters
5664 as if they were arguments to the
5665 .request ds
5666 request.
5667 .
5668 .
5669 .\" ========= escaped characters =========
5670 .
5671 .
5672 .TP
5673 .ESC \[aq]
5674 is a synonym for
5675 .esc [aa] ,
5676 the acute accent special character.
5677 .
5678 .
5679 .TP
5680 .ESC \[ga]
5681 is a synonym for
5682 .esc [ga] ,
5683 the grave accent special character.
5684 .
5685 .
5686 .TP
5687 .ESC \-
5688 is a synonym for
5689 .esc [\-] ,
5690 the minus sign special character.
5691 .
5692 .
5693 .TP
5694 .ESC _
5695 is a synonym for
5696 .esc [ul] ,
5697 the underrule special character.
5698 .
5699 .
5700 .TP
5701 .ESC %
5702 Mark a hyphenation point within a word.
5703 At the beginning of a word,
5704 prevent it from being otherwise hyphenated.
5705 .
5706 .
5707 .TP
5708 .ESC ! character-sequence
5709 .I Transparently
5710 embed
5711 .IR character-sequence ,
5712 up to and including the end of the line,
5713 into the current diversion,
5714 requests,
5715 macro calls,
5716 and escape sequences
5717 when reading them into a diversion.
5718 .
5719 Doing so prevents them from taking effect
5720 until the diverted text is actually output.
5721 .
5722 .
5723 .TP
5724 .ESC? character-sequence
5725 Transparently embed
5726 .IR character-sequence ,
5727 up to its own next occurrence on the input line,
5728 into a diversion,
5729 or unformatted as an output comparand in a conditional expression.
5730 .
5731 Ignored in the top-level diversion.
5732 .
5733 .
5734 .\" ========= spaces and fixed-width horizontal motions =========
5735 .
5736 .TP 8n \" "\space" + 2n
5737 .ESC \f[I]space
5738 Move right one inter-word space.
5739 .
5740 .
5741 .TP
5742 .ESC \[ti]
5743 Insert an unbreakable,
5744 adjustable space.
5745 .
5746 .
5747 .TP
5748 .ESC 0
5749 Move right by the width of a numeral in the current font.
5750 .
5751 .
5752 .TP
5753 .ESC |
5754 Move one-sixth em to the right on typesetters.
5755 .
5756 .
5757 .TP
5758 .ESC \[ha]
5759 Move one-twelfth em to the right on typesetters.
5760 .
5761 .
5762 .TP
5763 .ESC &
5764 Interpolate a dummy character.
5765 .
5766 .
5767 .TP
5768 .ESC \|)
5769 Interpolate a dummy character that is transparent to end-of-sentence
5770 recognition.
5771 .
5772 .
5773 .TP
5774 .ESC \|/
5775 Apply italic correction.
5776 .
5777 Use between an immediately adjacent oblique glyph on the left and an
5778 upright glyph on the right.
5779 .
5780 .
5781 .TP
5782 .ESC \|,
5783 Apply left italic correction.
5784 .
5785 Use between an immediately adjacent upright glyph on the left and an
5786 oblique glyph on the right.
5787 .
5788 .
5789 .TP
5790 .ESC :
5791 Non-printing break point
5792 (similar to
5793 .esc % ,
5794 but never produces a hyphen glyph).
5795 .
5796 .
5797 .TP
5798 .ESC "" newline
5799 Continue current input line on the next.
5800 .
5801 .
5802 .\" ========= structuring =========
5803 .
5804 .TP
5805 .ESC {
5806 Begin conditional input.
5807 .
5808 .TP
5809 .ESC }
5810 End conditional input.
5811 .
5812 .\" ========= longer escape names =========
5813 .
5814 .TP
5815 .ESC ( sc
5816 Interpolate glyph of special character with two-character identifier
5817 .IR sc .
5818 .
5819 .
5820 .TP
5821 .ESC[] "" spchar
5822 Interpolate glyph of special character with identifier
5823 .I spchar
5824 (of arbitrary length).
5825 .
5826 .
5827 .TP
5828 .ESC[] "" "base-char comp \fR\&.\|.\|."
5829 Interpolate composite glyph constructed from
5830 .I base-char
5831 and each component
5832 .IR comp .
5833 .
5834 .
5835 .TP
5836 .ESC[] "" "\f[B]char\f[]nnn"
5837 Interpolate glyph of eight-bit encoded character
5838 .IR nnn ,
5839 where
5840 .RI 0\|\[<=]\| nnn \|\[<=]\|255.
5841 .
5842 .
5843 .TP
5844 .ESC[] "" "\f[B]u\f[]nnnn\f[R][\f[]n\f[R][\f[]n\f[R]]]"
5845 Interpolate glyph of Unicode character with code point
5846 .IR nnnn [ n [ n ]]
5847 in uppercase hexadecimal.
5848 .
5849 .
5850 .TP
5851 .ESC[] "" "\f[B]u\f[]base-char\f[R][\f[]\f[B]_\f[]\
5852 combining-component\f[R]].\|.\|."
5853 Interpolate composite glyph from Unicode character
5854 .I base-char
5855 and
5856 .IR combining-components .
5857 .
5858 .
5859 .\" ========= alphabetical escape sequences =========
5860 .
5861 .TP
5862 .ESC a
5863 Interpolate a leader in copy mode.
5864 .
5865 .TP
5866 .ESCq A input
5867 Interpolate 1 if
5868 .I input
5869 is a valid identifier,
5870 and\~0 otherwise.
5871 .
5872 Because GNU
5873 .I troff \" GNU
5874 ignores any input character with an invalid code when reading it,
5875 invalid identifiers are empty or contain
5876 spaces,
5877 tabs,
5878 newlines,
5879 or
5880 escape sequences
5881 that interpolate something other than a sequence of ordinary characters.
5882 .
5883 .TP
5884 .ESCq b string
5885 Build bracket:
5886 pile a sequence of glyphs corresponding to each character in
5887 .I string
5888 vertically,
5889 and center it vertically on the output line.
5890 .
5891 .TP
5892 .ESCq B input
5893 Interpolate 1 if
5894 .I input
5895 is a valid numeric expression,
5896 and\~0 otherwise.
5897 .
5898 .
5899 .TP
5900 .ESC c
5901 Continue output line at next input line.
5902 .
5903 .
5904 .TP
5905 .ESCq C glyph
5906 As
5907 .esc[] "" glyph ,
5908 but compatible with other
5909 .I troff \" generic
5910 implementations.
5911 .
5912 .
5913 .TP
5914 .ESC d
5915 Move downward \[12]\~em on typesetters.
5916 .\" XXX: No current groff nroff-mode output driver supports half-line
5917 .\" motions.
5918 .\" (\[12]\~line in
5919 .\" .I nroff
5920 .\" contingent on device support).
5921 .
5922 .
5923 .TP
5924 .ESCq D drawing-command
5925 See subsection \[lq]Drawing commands\[rq] below.
5926 .
5927 .
5928 .TP
5929 .ESC e
5930 Interpolate the escape character.
5931 .
5932 .
5933 .TP
5934 .ESC E
5935 As
5936 .esc e ,
5937 but not interpreted in copy mode.
5938 .
5939 .TP
5940 .ESC fP
5941 Select previous font mounting position
5942 (abstract style or font);
5943 same as
5944 .RB \[lq] .ft \[rq]
5945 or
5946 .RB \[lq] .ft\~P \[rq].
5947 .
5948 .TP
5949 .ESC f F
5950 Select font mounting position,
5951 abstract style,
5952 or font with one-character name or one-digit
5953 .RI position\~ F .
5954 .
5955 .IR F \~cannot
5956 be
5957 .BR P .
5958 .
5959 .TP
5960 .ESC f( ft
5961 Select font mounting position,
5962 abstract style,
5963 or font with two-character name or two-digit
5964 .RI position\~ ft .
5965 .
5966 .TP
5967 .ESC[] f font
5968 Select font mounting position,
5969 abstract style,
5970 or font with arbitrarily long name or position
5971 .IR font .
5972 .
5973 .I font
5974 cannot be
5975 .BR P .
5976 .
5977 .TP
5978 .ESC[] f ""
5979 Select previous font mounting position
5980 (abstract style or font).
5981 .
5982 .TP
5983 .ESC F f
5984 Set default font family to that with one-character
5985 .RI name\~ f .
5986 .
5987 .TP
5988 .ESC F( fm
5989 Set default font family to that with two-character
5990 .RI name\~ fm .
5991 .
5992 .TP
5993 .ESC[] F fam
5994 Set default font family to that with arbitrarily long name
5995 .IR fam .
5996 .
5997 .TP
5998 .ESC[] F ""
5999 Set default font family to previous value.
6000 .
6001 .TP
6002 .ESC g r
6003 Interpolate format of register with one-character
6004 .RI name\~ r .
6005 .
6006 .
6007 .TP
6008 .ESC g( rg
6009 Interpolate format of register with two-character
6010 .RI name\~ rg .
6011 .
6012 .
6013 .TP
6014 .ESC[] g reg
6015 Interpolate format of register with arbitrarily long name
6016 .IR reg .
6017 .
6018 .
6019 .TP
6020 .ESCq h N
6021 Horizontally move the drawing position by
6022 .IR N \~ems
6023 (or specified units);
6024 .B \[or]
6025 may be used.
6026 .
6027 Positive motion is rightward.
6028 .
6029 .
6030 .TP
6031 .ESCq H N
6032 Set
6033 (increment, decrement)
6034 the height of the current font,
6035 but not its width.
6036 .
6037 If
6038 .I N
6039 is zero,
6040 the formatter uses the font's inherent height for its type size
6041 default scaling unit\~\c
6042 .scaleindicator z ).
6043 .
6044 .TP
6045 .ESC k r
6046 Store the horizontal drawing position,
6047 relative to that corresponding to the start of the input line
6048 (ignoring page offset and indentation),
6049 in register
6050 .RI name\~ r .
6051 .
6052 .TP
6053 .ESC k( rg
6054 Store the horizontal drawing position,
6055 relative to that corresponding to the start of the input line
6056 (ignoring page offset and indentation),
6057 in register
6058 .RI name\~ rg .
6059 .
6060 .
6061 .TP
6062 .ESC[] k reg
6063 Store the horizontal drawing position,
6064 relative to that corresponding to the start of the input line
6065 (ignoring page offset and indentation),
6066 in register
6067 .RI name\~ reg .
6068 .
6069 .
6070 .TP
6071 .ESCq l N\/\f[R][\f[]c\f[R]]
6072 Draw horizontal line of length
6073 .I N
6074 with character
6075 .I c
6076 (default:
6077 .BR \[rs][ru] ;
6078 default scaling unit\~\c
6079 .scaleindicator m ).
6080 .
6081 .
6082 .TP
6083 .ESCq L N\/\f[R][\f[]c\f[R]]
6084 Draw vertical line of length
6085 .I N
6086 with character
6087 .I c
6088 (default:
6089 .BR \[rs][br] ;
6090 default scaling unit\~\c
6091 .scaleindicator v ).
6092 .
6093 .
6094 .TP
6095 .ESC m c
6096 Select stroke color with one-character
6097 .RI name\~ c .
6098 .
6099 .
6100 .TP
6101 .ESC m( cl
6102 Select stroke color with two-character
6103 .RI name\~ cl .
6104 .
6105 .
6106 .TP
6107 .ESC[] m color
6108 Select stroke color with arbitrarily long
6109 .RI name\~ color .
6110 .
6111 .
6112 .TP
6113 .ESC[] m ""
6114 Restore previous stroke color.
6115 .
6116 .
6117 .TP
6118 .ESC M c
6119 Select fill color with one-character
6120 .RI name\~ c .
6121 .
6122 .
6123 .TP
6124 .ESC M( cl
6125 Select fill color with two-character
6126 .RI name\~ cl .
6127 .
6128 .
6129 .TP
6130 .ESC[] M color
6131 Select fill color with arbitrarily long
6132 .RI name\~ color .
6133 .
6134 .
6135 .TP
6136 .ESC[] M ""
6137 Restore previous fill color.
6138 .
6139 .
6140 .br
6141 .ne 4v \" XXX: why not 3v?
6142 .TP
6143 .ESC n r
6144 Interpolate value of register with one-character
6145 .RI name\~ r .
6146 .
6147 .
6148 .TP
6149 .ESC n( rg
6150 Interpolate value of register with two-character
6151 .RI name\~ rg .
6152 .
6153 .
6154 .TP
6155 .ESC[] n reg
6156 Interpolate value of register with arbitrarily long
6157 .RI name\~ reg .
6158 .
6159 .
6160 .TP
6161 .ESCq N n
6162 Format indexed character numbered
6163 .I n
6164 in the current font.
6165 .
6166 .TP
6167 .ESCq o abc\f[R].\|.\|.\f[]
6168 Overstrike centered glyphs of characters
6169 .IR a ,
6170 .IR b ,
6171 .IR c ,
6172 and so on.
6173 .
6174 .TP
6175 .ESC O0
6176 At the outermost suppression level,
6177 disable emission of glyphs and geometric objects to the output
6178 driver.
6179 .
6180 .
6181 .TP
6182 .ESC O1
6183 At the outermost suppression level,
6184 enable emission of glyphs and geometric objects to the output driver.
6185 .
6186 .
6187 .TP
6188 .ESC O2
6189 At the outermost suppression level,
6190 enable glyph and geometric primitive emission to the output driver and
6191 write to the standard error stream the page number,
6192 four bounding box registers enclosing glyphs written since the previous
6193 .B \[rs]O
6194 escape sequence,
6195 the page offset,
6196 line length,
6197 image file name
6198 (if any),
6199 horizontal and vertical device motion quanta,
6200 and input file name.
6201 .
6202 .
6203 .TP
6204 .ESC O3
6205 Begin a nested suppression level.
6206 .
6207 .
6208 .TP
6209 .ESC O4
6210 End a nested suppression level.
6211 .
6212 .
6213 .TP
6214 .ESC[] O "\f[B]5\f[]Pfile"
6215 At the outermost suppression level,
6216 write the name
6217 .I file
6218 to the standard error stream at
6219 .RI position\~ P ,
6220 which must be one of
6221 .BR l ,
6222 .BR r ,
6223 .BR c ,
6224 or
6225 .BR i .
6226 .
6227 .
6228 .TP
6229 .ESC p
6230 Break output line at next word boundary;
6231 adjust if applicable.
6232 .
6233 .
6234 .TP
6235 .ESC r
6236 Move \[lq]in reverse\[rq] (upward) 1\~em.
6237 .
6238 .
6239 .TP
6240 .ESCq R "name\~\[+-]N"
6241 Set,
6242 increment,
6243 or decrement register
6244 .I name
6245 .RI by\~ N .
6246 .
6247 .
6248 .TP
6249 .ESC s \[+-]N
6250 Set/increase/decrease the type size to/by
6251 .I N
6252 scaled points.
6253 .
6254 .I N
6255 must be a single digit.
6256 .
6257 If
6258 .IR n \~is
6259 an unsigned
6260 \[lq]0\[rq],
6261 restore the previous size.
6262 .
6263 (In compatibility mode only,
6264 a non-zero
6265 .I N
6266 must be in the range 4\[en]39.)
6267 .
6268 Otherwise,
6269 as
6270 .request ps
6271 request.
6272 .
6273 .
6274 .TP
6275 .ESC s( \[+-]N
6276 .TQ
6277 .BI \es \[+-] ( N
6278 Set/increase/decrease the type size to/by
6279 .I N
6280 scaled points;
6281 .I N
6282 is a two-digit number \[>=]1.
6283 .
6284 If
6285 .IR n \~is
6286 an unsigned
6287 \[lq]00\[rq],
6288 restore the previous size.
6289 .
6290 Otherwise,
6291 as
6292 .request ps
6293 request.
6294 .
6295 .
6296 .TP
6297 .ESC[] s \[+-]N
6298 .TQ
6299 .BI \es \[+-] [ N ]
6300 .TQ
6301 .ESCq s \[+-]N
6302 .TQ
6303 .BI \es \[+-] \[aq] N \[aq]
6304 Set/increase/decrease the type size to/by
6305 .I N
6306 scaled points.
6307 .
6308 If
6309 .IR n \~is
6310 an unsigned
6311 \[lq]0\[rq]
6312 (with any number of leading zeroes),
6313 restore the previous size.
6314 .
6315 Otherwise,
6316 as
6317 .request ps
6318 request.
6319 .
6320 .
6321 .TP
6322 .ESCq S N
6323 Slant the glyphs of the currently selected font by
6324 @var{N}
6325 degrees.
6326 .
6327 Positive values slant in the direction of text flow.
6328 .
6329 Only integer values are possible.
6330 .
6331 .
6332 .TP
6333 .ESC t
6334 Interpolate a tab in copy mode.
6335 .
6336 .
6337 .TP
6338 .ESC u
6339 Move upward \[12]\~em on typesetters.
6340 .\" XXX: No current groff nroff-mode output driver supports half-line
6341 .\" motions.
6342 .\" (\[12]\~line in
6343 .\" .I nroff
6344 .\" contingent on device support).
6345 .
6346 .
6347 .TP
6348 .ESCq v N
6349 Vertically move the drawing position by
6350 .IR N \~vees
6351 (or specified units);
6352 .B \[or]
6353 may be used.
6354 .
6355 Positive motion is downward.
6356 .
6357 .
6358 .TP
6359 .ESC V e
6360 Interpolate value of system environment variable with one-character
6361 .RI name\~ e
6362 as returned by
6363 .MR getenv 3 .
6364 .
6365 .
6366 .TP
6367 .ESC V( ev
6368 Interpolate value of system environment variable with two-character
6369 .RI name\~ ev
6370 as returned by
6371 .MR getenv 3 .
6372 .
6373 .
6374 .TP
6375 .ESC[] V env
6376 Interpolate value of system environment variable with arbitrarily
6377 long
6378 .RI name\~ env
6379 as returned by
6380 .MR getenv 3 .
6381 .
6382 .
6383 .TP
6384 .ESCq w input
6385 Interpolate the width of
6386 .IR input ,
6387 as interpreted,
6388 in basic units.
6389 .
6390 This escape sequence
6391 allows several properties of formatted output to be measured
6392 without writing it out.
6393 .
6394 The formatter processes
6395 .I input
6396 in a dummy environment:
6397 this means that font and type size changes,
6398 for example,
6399 may occur within it without affecting subsequent output.
6400 .
6401 .
6402 .TP
6403 .ESCq x N
6404 Increase vertical spacing of pending output line by
6405 .IR N \~vees
6406 (or specified units;
6407 negative before,
6408 positive after).
6409 .
6410 .TP
6411 .ESCq X character-sequence
6412 Write
6413 .I character-sequence
6414 to
6415 .I \%troff
6416 output as a device extension command.
6417 .
6418 The
6419 .I groff
6420 special character repertoire is unknown to output drivers outside of
6421 glyphs named in a device's fonts,
6422 and even then they may not possess complete coverage of the names
6423 documented in
6424 .MR groff_char 7 .
6425 .
6426 Further,
6427 escape sequences that produce horizontal or vertical motions,
6428 hyphenation breaks,
6429 or that are dummy characters may appear in strings
6430 or be converted to nodes,
6431 particularly in diversions. \" (@pxref{Gtroff Internals})
6432 .
6433 These are not representable when interpolated directly into
6434 device-independent output,
6435 as might be done when writing out tag names for PDF bookmarks,
6436 which can appear in a viewer's navigation pane.
6437 .
6438 .
6439 .\" XXX: Force paragraph spacing here. I know--it's terrible. And
6440 .\" unnecessary once we get this giant discussion moved to its own
6441 .\" (sub)section.
6442 .if t .sp 0.4v
6443 .if n .sp 1v
6444 .\"IP
6445 So that documents or macro packages do not have to laboriously
6446 \[lq]sanitize\[rq] strings destined for interpolation
6447 in device extension commands,
6448 this escape sequence
6449 .\" XXX: and soon other things
6450 performs certain transformations on its argument.
6451 .
6452 For these transformations,
6453 character translations and definitions are ignored.
6454 .
6455 .
6456 .if t .sp 0.4v
6457 .if n .sp 1v
6458 .\"IP
6459 GNU
6460 .I troff \" GNU
6461 converts several ordinary characters that typeset as non-basic Latin
6462 code points to code points outside that range so that they are used
6463 consistently whether they are formatted as glyphs or used in a device
6464 control command argument.
6465 .
6466 These ordinary characters are
6467 .RB \[lq]\| \[aq] \|\[rq],
6468 .RB \[lq]\| \- \|\[rq],
6469 .RB \[lq]\| \[ha] \|\[rq],
6470 .RB \[lq]\| \[ga] \|\[rq],
6471 and
6472 .RB \[lq]\| \[ti] \|\[rq];
6473 others are written as-is.
6474 .
6475 .
6476 .if t .sp 0.4v
6477 .if n .sp 1v
6478 .\"IP
6479 Special characters that typeset as Unicode basic Latin characters
6480 are translated to basic Latin characters accordingly.
6481 .
6482 So that any Unicode code point can be represented in device extension
6483 commands,
6484 for example in an author's name in document metadata
6485 or as a usefully named bookmark or hyperlink anchor,
6486 GNU
6487 .I troff \" GNU
6488 maps other special characters to Unicode special character notation.
6489 .
6490 Special characters without a Unicode representation,
6491 and escape sequences that do not interpolate a sequence
6492 of ordinary and/or special characters,
6493 produce warnings in category
6494 .RB \[lq] char \[rq].
6495 .
6496 .TP
6497 .ESC Y n
6498 Write contents of macro or string
6499 .I n
6500 to
6501 .I \%troff
6502 output as a device extension command.
6503 .
6504 .TP
6505 .ESC Y( nm
6506 Write contents of macro or string
6507 .I nm
6508 to
6509 .I \%troff
6510 output as a device extension command.
6511 .
6512 .TP
6513 .ESC[] Y name
6514 Write contents of macro or string
6515 .I name
6516 to
6517 .I \%troff
6518 output as a device extension command.
6519 .
6520 .TP
6521 .ESC z c
6522 Format character
6523 .I c
6524 with zero width\[em]without advancing the drawing position.
6525 .
6526 .TP
6527 .ESCq Z input
6528 Save the drawing position,
6529 format
6530 .IR input ,
6531 then restore it.
6532 .
6533 GNU
6534 .I troff \" GNU
6535 ignores tabs and leaders in
6536 .I input
6537 with an error diagnostic.
6538 .LE
6539 .
6540 .
6541 .\" ====================================================================
6542 .SS "Drawing commands"
6543 .\" ====================================================================
6544 .
6545 .\" BEGIN Keep (roughly) parallel with groff.texi node "Drawing
6546 .\" commands".
6547 Drawing commands direct the output device to render geometrical objects
6548 rather than glyphs.
6549 .
6550 Specific devices may support only a subset,
6551 or may feature additional ones;
6552 consult the man page for the output driver in use.
6553 .
6554 Terminals in particular implement almost none.
6555 .
6556 .
6557 .P
6558 Rendering starts at the drawing position;
6559 when finished,
6560 the drawing position is left at the rightmost point of the object,
6561 even for closed figures,
6562 except where noted.
6563 .
6564 GNU
6565 .I troff \" GNU
6566 draws stroked (outlined) objects with the stroke color,
6567 and shades filled ones with the fill color.
6568 .
6569 See section \[lq]Colors\[rq] above.
6570 .
6571 Coordinates
6572 .I h
6573 and
6574 .I v
6575 are horizontal and vertical motions relative to the drawing position
6576 or previous point in the command.
6577 .
6578 The default scaling unit for horizontal measurements
6579 (and diameters of circles)
6580 .RB is\~ m ;
6581 for vertical ones,
6582 .BR v .
6583 .
6584 .
6585 .P
6586 Circles,
6587 ellipses,
6588 and polygons can be drawn stroked or filled.
6589 .
6590 These are independent properties;
6591 if you want a filled,
6592 stroked figure,
6593 you must draw the same figure twice using each drawing command.
6594 .
6595 A filled figure is always smaller than an outlined one because the
6596 former is drawn only within its defined area,
6597 whereas strokes have a line thickness
6598 (set with
6599 .BR \[rs]D\[aq]t\[aq] ).
6600 .
6601 .
6602 .P
6603 .LS
6604 .TP
6605 .BI \[rs]D\[aq]\[ti]\~ "h1 v1"\~\c
6606 .RI .\|.\|.\~ "hn vn"\c
6607 .B \[aq]
6608 Draw B-spline to each point in sequence,
6609 leaving drawing position at
6610 .RI ( hn ,\~ vn ).
6611 .
6612 .\" XXX: This is one case where a valid coordinate pair could be off the
6613 .\" page (even negative) and we need to discuss this frankly.
6614 .TP
6615 .BI \[rs]D\[aq]a\~ "hc vc h v" \[aq]
6616 Draw circular arc centered at
6617 .RI ( hc ,\~ vc )
6618 counterclockwise from the drawing position to a point
6619 .RI ( h ,\~ v )
6620 relative to the center.
6621 .
6622 .RI ( hc ,\~ vc )
6623 is adjusted to the point nearest the perpendicular bisector of the arc's
6624 chord.
6625 .
6626 .TP
6627 .BI \[rs]D\[aq]c\~ "d" \[aq]
6628 Draw circle of diameter
6629 .I d
6630 with its leftmost point at the drawing position.
6631 .
6632 .TP
6633 .BI \[rs]D\[aq]C\~ "d" \[aq]
6634 As
6635 .BR \[rs]D\[aq]C\[aq] ,
6636 but the circle is filled.
6637 .
6638 .TP
6639 .BI \[rs]D\[aq]e\~ "h v" \[aq]
6640 Draw ellipse of width
6641 .I h
6642 and height
6643 .I v
6644 with its leftmost point at the drawing position.
6645 .
6646 .\" How do we draw an ellipse with rotated axes?
6647 .TP
6648 .BI \[rs]D\[aq]E\~ "h v" \[aq]
6649 As
6650 .BR \[rs]D\[aq]e\[aq] ,
6651 but the ellipse is filled.
6652 .
6653 .\" XXX: Df and dF are taken care of by \M and .defcolor.
6654 .TP
6655 .BI \[rs]D\[aq]l\~ "h v" \[aq]
6656 Draw line from the drawing position to
6657 .RI ( h ,\~ v ).
6658 .
6659 .TP
6660 .BI \[rs]D\[aq]p\~ "h1 v1"\~\c
6661 .RI .\|.\|.\~ "hn vn"\c
6662 .B \[aq]
6663 Draw polygon with vertices at the drawing position
6664 and each point in sequence.
6665 .
6666 GNU
6667 .I troff \" GNU
6668 closes the polygon by drawing a line from
6669 .RI ( hn ,\~ vn )
6670 back to the initial drawing position.
6671 .
6672 .\" XXX: This would be the "STUPID_DRAWING_POSITIONING" complained of in
6673 .\" src/libs/libdriver/input.cpp. It is neither the rightmost point
6674 .\" of the figure nor the initial drawing position that GNU troff
6675 .\" automatically returned to close the figure.
6676 Afterward,
6677 the drawing position is left at
6678 .RI ( hn ,\~ vn ).
6679 .
6680 .TP
6681 .BI \[rs]D\[aq]P\~ "h1 v1"\~\c
6682 .RI .\|.\|.\~ "hn vn"\c
6683 .B \[aq]
6684 As
6685 .BR \[rs]D\[aq]p\[aq] ,
6686 but the polygon is filled.
6687 .
6688 .TP
6689 .BI \[rs]D\[aq]t\~ "n" \[aq]
6690 Set stroke thickness of geometric objects to
6691 .RI to\~ n
6692 basic units.
6693 .
6694 A zero
6695 .I n
6696 selects the minimum supported thickness.
6697 .
6698 A negative
6699 .I n
6700 selects a thickness proportional to the type size;
6701 this is the default.
6702 .LE
6703 .\" END Keep (roughly) parallel with groff.texi node "Drawing
6704 .\" commands".
6705 .
6706 .
6707 .\" ====================================================================
6708 .SH Strings
6709 .\" ====================================================================
6710 .
6711 .\" BEGIN Keep (roughly) parallel with groff.texi node "Strings".
6712 .I groff
6713 supports strings primarily for user convenience.
6714 .
6715 Conventionally,
6716 if one would define a macro only to interpolate a small amount of text,
6717 without invoking requests or calling any other macros,
6718 one defines a string instead.
6719 .
6720 Only one string is predefined by the language.
6721 .
6722 .
6723 .TPx
6724 .STRING .T
6725 Contains the name of the output device
6726 (for example,
6727 .RB \[lq] utf8 \[rq]
6728 or
6729 .RB \[lq] pdf \[rq] ).
6730 .
6731 .
6732 .P
6733 The
6734 .request ds
6735 request creates a string with a specified name and contents.
6736 .
6737 If the identifier named by
6738 .request ds
6739 already exists as an alias,
6740 the target of the alias is redefined.
6741 .
6742 If
6743 .request ds
6744 is invoked with only one argument,
6745 the named string becomes empty.
6746 .
6747 The formatter removes a leading neutral double quote
6748 .RB \[oq] \[dq] \[cq] \" single quotes around double quote
6749 from
6750 .I contents
6751 to permit the embedding of leading spaces.
6752 .
6753 It interprets any other
6754 .RB \[oq] \[dq] \[cq] \" single quotes around double quote
6755 literally,
6756 but the wise author uses the special character escape sequence
6757 .B \[rs][dq]
6758 instead if the string
6759 might be interpolated as part of a macro argument;
6760 see section \[lq]Calling macros\[rq] above.
6761 .
6762 .
6763 .P
6764 The
6765 .esc *
6766 escape sequence dereferences a string's name,
6767 interpolating its contents.
6768 .
6769 If the name does not exist,
6770 the formatter defines it as empty,
6771 interpolates nothing,
6772 and emits a warning in category
6773 .RB \%\[lq] mac \[rq].
6774 .
6775 See section \[lq]Warnings\[rq] in
6776 .MR \%troff 1 .
6777 .
6778 The bracketed interpolation form accepts arguments that are handled as
6779 macro arguments are;
6780 see section \[lq]Calling macros\[rq] above.
6781 .
6782 In contrast to macro calls,
6783 an argument containing a closing bracket
6784 .B ]
6785 must be enclosed in double quotes.
6786 .
6787 When defining strings,
6788 argument interpolations must be escaped if they are to reference
6789 parameters from the calling context;
6790 see section \[lq]Parameters\[rq] below.
6791 .
6792 Any non-initial neutral double quote
6793 .B \[dq]
6794 is interpreted literally,
6795 but it is wise to use the special character escape sequence
6796 .B \[rs][dq]
6797 instead if the string might be interpolated as part of a macro argument;
6798 see section \[lq]Calling macros\[rq] above.
6799 .
6800 Strings are not limited to a single input line of text.
6801 .BI \[rs] newline
6802 works just as it does elsewhere.
6803 .
6804 The resulting string is stored
6805 .I without
6806 the newlines.
6807 .
6808 When filling is disabled,
6809 care is required to avoid overrunning the line length when interpolating
6810 strings.
6811 .
6812 Conversely,
6813 when filling is enabled,
6814 it is not necessary to append
6815 .B \[rs]c
6816 to a string interpolation to prevent a break afterward,
6817 as might be required in a macro argument.
6818 .
6819 Nor does a string require use of
6820 the GNU
6821 .I troff \" GNU
6822 .B chop
6823 request to excise a trailing newline as is often done with diversions.
6824 .
6825 It is not possible to embed a newline in a string that will be
6826 interpreted as such when the string is interpolated.
6827 .
6828 To achieve that effect,
6829 use
6830 .B \[rs]*
6831 to interpolate a macro instead;
6832 see section \[lq]Punning names\[rq] below.
6833 .
6834 .
6835 .P
6836 The
6837 .RB \[lq] as \[rq]
6838 request is similar to
6839 .request ds
6840 but appends to a string instead of redefining it.
6841 .
6842 If
6843 .RB \[lq] as \[rq]
6844 is invoked with only one argument,
6845 no operation is performed
6846 (beyond dereferencing the string).
6847 .
6848 .
6849 .P
6850 Because strings are similar to macros,
6851 they too can be defined to suppress AT&T
6852 .I troff \" AT&T
6853 compatibility mode enablement when interpolated;
6854 see section \[lq]Compatibility mode\[rq] below.
6855 .
6856 The
6857 .request ds1
6858 request defines a string that suspends compatibility mode when the
6859 string is later interpolated.
6860 .
6861 .request as1
6862 is likewise similar to
6863 .RB \[lq] as \[rq],
6864 with compatibility mode suspended when the appended portion of the
6865 string is later interpolated.
6866 .
6867 .
6868 .P
6869 .I Caution:
6870 These requests treat the remainder of the input line
6871 as their second argument,
6872 including any spaces,
6873 up to a newline or comment escape sequence.
6874 .
6875 Ending string definitions
6876 (and appendments)
6877 with a comment,
6878 even an empty one,
6879 prevents unwanted space from creeping into them during source document
6880 maintenance.
6881 .
6882 This rule and suggestion also applies to the second argument of the
6883 .RB \[lq] length \[rq]
6884 request,
6885 to requests that define characters
6886 .RB ( char ,
6887 .BR fchar ,
6888 .BR fschar ,
6889 and
6890 .BR schar ),
6891 and to the file name or command arguments of the
6892 .BR cf ,
6893 .BR hpf ,
6894 .BR hpfa ,
6895 .BR mso ,
6896 .BR msoquiet ,
6897 .BR nx ,
6898 .RB \[lq] open \[rq],
6899 .BR opena ,
6900 .BR pi ,
6901 .BR pso ,
6902 .RB \[lq] so \[rq],
6903 .BR soquiet ,
6904 and
6905 .B trf
6906 requests.
6907 .
6908 .
6909 .br
6910 .ne 3v
6911 .P
6912 Several requests exist to perform rudimentary string operations.
6913 .
6914 Strings can be queried
6915 (\c
6916 .request length )
6917 and modified
6918 (\c
6919 .request chop ,
6920 .request substring ,
6921 .request stringup ,
6922 .request stringdown ),
6923 and their names can be manipulated through renaming,
6924 removal,
6925 and aliasing
6926 (\c
6927 .request rn ,
6928 .request rm ,
6929 .request als).
6930 .
6931 .
6932 .br
6933 .ne 2v
6934 .P
6935 Redefinitions and appendments \[lq]write through\[rq] request,
6936 macro,
6937 string,
6938 and diversion names.
6939 .
6940 To replace an aliased object with a separately defined one,
6941 you must use the
6942 .B rm
6943 request on its name first.
6944 .\" END Keep (roughly) parallel with groff.texi node "Strings".
6945 .
6946 .
6947 .\" ====================================================================
6948 .SH Registers
6949 .\" ====================================================================
6950 .
6951 .\" BEGIN Keep (roughly) parallel with groff.texi node "Registers".
6952 In the
6953 .I roff
6954 language,
6955 numbers and measurements can be stored in
6956 .I registers.
6957 .
6958 Many built-in registers exist,
6959 supplying anything from components of the date
6960 to details of formatting parameters;
6961 some of these are read-only.
6962 .
6963 You can also define your own.
6964 .
6965 See section \[lq]Identifiers\[rq] above
6966 regarding the construction of valid names for registers.
6967 .
6968 .
6969 .P
6970 Each register
6971 (except read-only ones)
6972 can be assigned a
6973 .IR format ,
6974 causing its value to interpolate with leading zeroes,
6975 in Roman numerals,
6976 or alphabetically.
6977 .
6978 Some read-only registers are string-valued,
6979 meaning that they interpolate text and lack a format.
6980 .
6981 .
6982 .P
6983 Define registers and update their values with the
6984 .B nr
6985 request or the
6986 .B \[rs]R
6987 escape sequence.
6988 .
6989 .
6990 .P
6991 User-defined registers can also be incremented or decremented
6992 by a configured amount
6993 at the time they are interpolated.
6994 .
6995 The value of the increment is specified with a third argument to the
6996 .B nr
6997 request,
6998 and a special interpolation syntax,
6999 .BI \[rs]n \[+-]\c
7000 ,
7001 alters and then retrieves the register's value.
7002 .
7003 Together,
7004 these features are called
7005 .IR auto-increment .
7006 .
7007 (A negative auto-increment can be
7008 considered an \[lq]auto-decrement\[rq].)
7009 .
7010 .
7011 .P
7012 Many predefined registers are available.
7013 .
7014 The following presentation uses
7015 register interpolation syntax
7016 .BI \[rs]n[ name ]
7017 to refer to a register
7018 .I name
7019 to clearly distinguish it from a string or request
7020 .IR name ;
7021 the symbols
7022 .B \[rs]n[]
7023 are
7024 .I not
7025 part of the register name.
7026 .
7027 The register name space is separate from that used for requests,
7028 macros,
7029 strings,
7030 and diversions.
7031 .\" END Keep (roughly) parallel with groff.texi node "Registers".
7032 .
7033 .
7034 .\" ====================================================================
7035 .SS "Read-only registers"
7036 .\" ====================================================================
7037 .
7038 Predefined registers whose identifiers start with a dot are read-only.
7039 .
7040 Many are Boolean-valued.
7041 .
7042 .
7043 .P
7044 .I Caution:
7045 Built-in registers are subject to removal like others;
7046 once removed,
7047 they can be recreated only as normal writable registers
7048 and will not otherwise reflect the configuration of the formatter.
7049 .
7050 .
7051 .P
7052 A register name
7053 is often associated with a request of the same name
7054 (without the dot);
7055 exceptions are noted.
7056 .
7057 .
7058 .P
7059 .LS
7060 .
7061 .TP 15n
7062 .REG .$
7063 Count of arguments passed to currently interpolated macro or string.
7064 .
7065 .TP
7066 .REG .a
7067 Amount of extra post-vertical line space;
7068 see
7069 .esc x .
7070 .
7071 .TP
7072 .REG .A
7073 Approximate output is being formatted (Boolean-valued);
7074 see
7075 .I \%troff
7076 .B \-a
7077 option.
7078 .
7079 .TP
7080 .REG .b
7081 Font emboldening offset;
7082 see
7083 .request bd .
7084 .
7085 .TP
7086 .REG .br
7087 The normal control character was used to call the macro being
7088 interpreted (Boolean-valued).
7089 .
7090 .TP
7091 .REG .c
7092 Input line number;
7093 see
7094 .request lf
7095 and
7096 .register \f[R]\[lq]\f[]c.\f[R]\[rq]\f[] .
7097 .
7098 .TP
7099 .REG .C
7100 AT&T
7101 .I troff \" AT&T
7102 compatibility mode is enabled (Boolean-valued);
7103 see
7104 .request cp .
7105 .
7106 Always false when processing
7107 .RB \[rq] do \[rq];
7108 see
7109 .register .cp .
7110 .
7111 .TP
7112 .REG .cdp
7113 Depth of last glyph formatted in the environment;
7114 .\" TODO: Give page a discussion of glyph properties and move this.
7115 positive if glyph extends below the baseline.
7116 .
7117 .TP
7118 .REG .ce
7119 Count of input lines remaining to be centered
7120 in the environment.
7121 .
7122 .TP
7123 .REG .cht
7124 Height of last glyph formatted in the environment;
7125 .\" TODO: Give page a discussion of glyph properties and move this.
7126 positive if glyph extends above the baseline.
7127 .
7128 .TP
7129 .REG .color
7130 Color output is enabled (Boolean-valued).
7131 .
7132 .TP
7133 .REG .cp
7134 Within
7135 .RB \[rq] do \[rq],
7136 the saved value of compatibility mode;
7137 see
7138 .register .C .
7139 .
7140 .TP
7141 .REG .csk
7142 Skew of the last glyph formatted in the environment;
7143 see
7144 .register skw .
7145 .
7146 .TP
7147 .REG .d
7148 Vertical drawing position in diversion.
7149 .
7150 .TP
7151 .REG .ev
7152 Name of environment (string-valued).
7153 .
7154 .TP
7155 .REG .f
7156 Mounting position of selected font;
7157 see
7158 .request ft
7159 and
7160 .esc f .
7161 .
7162 .TP
7163 .REG .F
7164 Name of input file (string-valued);
7165 see
7166 .request lf .
7167 .
7168 .TP
7169 .REG .fam
7170 Name of the environment's default font family (string-valued).
7171 .
7172 .TP
7173 .REG .fn
7174 Resolved name of font selected in the environment (string-valued);
7175 see
7176 .request ft
7177 and
7178 .esc f .
7179 .
7180 .TP
7181 .REG .fp
7182 Next non-zero free font mounting position index.
7183 .
7184 .TP
7185 .REG .g
7186 Always true in GNU
7187 .I troff \" GNU
7188 (Boolean-valued).
7189 .
7190 .TP
7191 .REG .h
7192 Text baseline high-water mark on page or in diversion.
7193 .
7194 .TP
7195 .REG .H
7196 Horizontal motion quantum of output device in basic units.
7197 .
7198 .TP
7199 .REG .height
7200 Height of the environment's selected font;
7201 see
7202 .esc H .
7203 .
7204 .TP
7205 .REG .hla
7206 Hyphenation language in environment (string-valued).
7207 .
7208 .TP
7209 .REG .hlc
7210 Count of immediately preceding consecutive hyphenated lines in
7211 environment.
7212 .
7213 .TP
7214 .REG .hlm
7215 Maximum quantity of consecutive hyphenated lines allowed in environment.
7216 .
7217 .TP
7218 .REG .hy
7219 Automatic hyphenation mode in environment.
7220 .
7221 .TP
7222 .REG .hydefault
7223 Hyphenation mode default in environment.
7224 .
7225 .TP
7226 .REG .hym
7227 Hyphenation margin in environment.
7228 .
7229 .TP
7230 .REG .hys
7231 Hyphenation space adjustment threshold in environment.
7232 .
7233 .TP
7234 .REG .i
7235 Environment's indentation amount;
7236 see
7237 .RB \[rq] in \[rq].
7238 .
7239 .TP
7240 .REG .in
7241 Indentation amount applicable to the output line pending
7242 in the environment;
7243 see
7244 .request ti .
7245 .
7246 .TP
7247 .REG .int
7248 The text most recently formatted in the environment
7249 was \[lq]interrupted\[rq] or continued with
7250 .esc c
7251 (Boolean-valued).
7252 .
7253 .TP
7254 .REG .it
7255 Count of input lines remaining
7256 in the environment's pending input trap.
7257 .
7258 .TP
7259 .REG .itc
7260 The environment's pending input trap honors output line continuation
7261 with
7262 .esc c
7263 (Boolean-valued).
7264 .
7265 .TP
7266 .REG .itm
7267 Name of the macro associated with the pending input trap
7268 (string-valued).
7269 .
7270 .TP
7271 .REG .j
7272 The environment's adjustment mode encoded as an integer;
7273 see
7274 .request ad
7275 and
7276 .request na .
7277 .
7278 Do not interpret or perform arithmetic on its value.
7279 .
7280 .TP
7281 .REG .k
7282 The environment's horizontal drawing position relative to indentation.
7283 .
7284 .TP
7285 .REG .kern
7286 Pairwise kerning is enabled (Boolean-valued).
7287 .
7288 .TP
7289 .REG .l
7290 Line length;
7291 see
7292 .request ll .
7293 .
7294 .TP
7295 .REG .L
7296 Line spacing;
7297 see
7298 .request ls .
7299 .
7300 .TP
7301 .REG .lg
7302 Ligature mode.
7303 .
7304 .TP
7305 .REG .linetabs
7306 Line-tabs mode is enabled in the environment (Boolean-valued).
7307 .
7308 .TP
7309 .REG .ll
7310 Line length applicable to the environment's pending output line.
7311 .
7312 .TP
7313 .REG .lt
7314 Environment's title line length.
7315 .
7316 .TP
7317 .REG .m
7318 Stroke color (string-valued);
7319 see
7320 .request gcolor
7321 and
7322 .esc m .
7323 .
7324 The default stroke color is named
7325 .RB \%\[lq] default \[rq].
7326 .
7327 .TP
7328 .REG .M
7329 Fill color (string-valued);
7330 see
7331 .request fcolor
7332 and
7333 .esc M .
7334 .
7335 The default fill color is named
7336 .RB \&\[lq] default \[rq].
7337 .
7338 .TP
7339 .REG .n
7340 Length of formatted output on previous output line.
7341 .
7342 .TP
7343 .REG .ne
7344 Amount of vertical space required by last
7345 .request ne
7346 that caused a trap to be sprung;
7347 also see
7348 .register .trunc .
7349 .
7350 .TP
7351 .REG .nm
7352 Output line numbering is enabled in the environment (Boolean-valued).
7353 .
7354 .TP
7355 .REG .nn
7356 Count of lines remaining in the environment
7357 for which numbering is suppressed
7358 while output line numbering is enabled.
7359 .
7360 .TP
7361 .REG .ns
7362 No-space mode is enabled (Boolean-valued).
7363 .
7364 .TP
7365 .REG .o
7366 Page offset;
7367 see
7368 .request po .
7369 .
7370 .TP
7371 .REG .O
7372 Output suppression nesting level;
7373 see
7374 .esc O .
7375 .
7376 .TP
7377 .REG .p
7378 Page length;
7379 see
7380 .request pl .
7381 .
7382 .TP
7383 .REG .P
7384 The page is selected for output (Boolean-valued);
7385 see
7386 .I \%troff
7387 .B \-o
7388 option.
7389 .
7390 .TP
7391 .REG .pe
7392 Page ejection is in progress (Boolean-valued).
7393 .
7394 .TP
7395 .REG .pn
7396 Number of the next page.
7397 .
7398 .TP
7399 .REG .ps
7400 The environment's type size in scaled points.
7401 .
7402 .TP
7403 .REG .psr
7404 The environment's most recently requested type size in scaled points;
7405 see
7406 .request ps
7407 and
7408 .esc s .
7409 .
7410 .TP
7411 .REG .pvs
7412 The environment's post-vertical line spacing.
7413 .
7414 .TP
7415 .REG .R
7416 Maximum representable integer in GNU
7417 .IR troff . \" GNU
7418 .
7419 .TP
7420 .REG .rj
7421 Count of input lines remaining to be right-aligned
7422 in the environment.
7423 .
7424 .TP
7425 .REG .s
7426 The environment's type size in points as a decimal fraction
7427 (string-valued);
7428 see
7429 .request ps
7430 and
7431 .esc s .
7432 .
7433 .TP
7434 .REG .slant
7435 Slant in degrees of the environment's selected font;
7436 see
7437 .esc S .
7438 .
7439 .TP
7440 .REG .sr
7441 The environment's most recently requested type size
7442 in points as a decimal fraction
7443 (string-valued);
7444 see
7445 .request ps
7446 and
7447 .esc s .
7448 .
7449 .TP
7450 .REG .ss
7451 Size of the environment's minimum inter-word space
7452 in twelfths of the space width of the selected font.
7453 .
7454 .TP
7455 .REG .sss
7456 Size of the environment's supplemental inter-sentence space
7457 in twelfths of the space width of the selected font.
7458 .
7459 .TP
7460 .REG .sty
7461 The environment's selected abstract style (string-valued);
7462 see
7463 .request ft
7464 and
7465 .esc f .
7466 .
7467 .TP
7468 .REG .t
7469 Distance to next vertical position trap;
7470 see
7471 .request wh
7472 and
7473 .request ch .
7474 .
7475 If no such traps exist between the drawing position
7476 and the bottom of the page,
7477 .I \%troff
7478 interpolates the distance to the page bottom.
7479 .
7480 Within a diversion,
7481 in the absence of a diversion trap,
7482 this distance is
7483 the maximum possible vertical position supported by the output device.
7484 .
7485 .
7486 .TP
7487 .REG .T
7488 An output device was explicitly selected (Boolean-valued);
7489 see
7490 .I \%troff
7491 .B \-T
7492 option.
7493 .
7494 .TP
7495 .REG .tabs
7496 The environment's tab stop settings
7497 (if any)
7498 suitable for use as argument to
7499 .request ta
7500 (string-valued).
7501 .
7502 .TP
7503 .REG .trap
7504 Name of the next vertical position trap
7505 after the vertical drawing position.
7506 (string-valued);
7507 see
7508 .request wh ,
7509 .request ch ,
7510 and
7511 .request dt .
7512 .
7513 .TP
7514 .REG .trunc
7515 Amount of vertical space truncated by the most recently sprung
7516 vertical position trap,
7517 or,
7518 if the trap was sprung by an
7519 .request ne ,
7520 minus the amount of vertical motion produced by
7521 .request ne ;
7522 also see
7523 .register .ne .
7524 .
7525 .TP
7526 .REG .u
7527 Filling is enabled in the environment (Boolean-valued);
7528 see
7529 .request fi
7530 and
7531 .request nf .
7532 .
7533 .TP
7534 .REG .U
7535 Unsafe mode is enabled (Boolean-valued);
7536 see
7537 .I \%troff
7538 .B \-U
7539 option.
7540 .
7541 .TP
7542 .REG .v
7543 The environment's vertical line spacing;
7544 see
7545 .request vs .
7546 .
7547 .TP
7548 .REG .V
7549 Vertical motion quantum of the output device in basic units.
7550 .
7551 .TP
7552 .REG .vpt
7553 Vertical position traps are enabled (Boolean-valued).
7554 .
7555 .TP
7556 .REG .w
7557 Width of last glyph formatted in the environment.
7558 .
7559 .TP
7560 .REG .warn
7561 Sum of the numeric codes of enabled warning categories.
7562 .
7563 .TP
7564 .REG .x
7565 Major version number of the running
7566 .I \%troff
7567 formatter.
7568 .
7569 .TP
7570 .REG .y
7571 Minor version number of the running
7572 .I \%troff
7573 formatter.
7574 .
7575 .TP
7576 .REG .Y
7577 Revision number of the running
7578 .I \%troff
7579 formatter.
7580 .
7581 .TP
7582 .REG .z
7583 Name of diversion (string-valued).
7584 .
7585 Empty if output is directed to the top-level diversion.
7586 .
7587 .TP
7588 .REG .zoom
7589 Magnification of the environment's selected font
7590 (in thousandths;
7591 zero if no magnification);
7592 see
7593 .request fzoom .
7594 .LE
7595 .
7596 .
7597 .\" ====================================================================
7598 .SS "Writable predefined registers"
7599 .\" ====================================================================
7600 .
7601 Several registers are predefined but also modifiable;
7602 some are updated upon interpretation of certain requests or escape
7603 sequences.
7604 .
7605 Date- and time-related registers are set to the local time as determined
7606 by
7607 .MR localtime 3
7608 when the formatter launches.
7609 .
7610 This initialization can be overridden by
7611 .I \%SOURCE_DATE_EPOCH
7612 and
7613 .IR TZ ;
7614 see section \[lq]Environment\[rq] of
7615 .MR groff 1 .
7616 .
7617 .
7618 .P
7619 .LS
7620 .
7621 .TP 15n
7622 .REG $$
7623 Process ID of
7624 .IR \%troff .
7625 .
7626 .TP
7627 .REG %
7628 Page number.
7629 .
7630 .TP
7631 .REG c.
7632 Input line number.
7633 .
7634 .TP
7635 .REG ct
7636 Union of character types of each glyph rendered into dummy environment
7637 by
7638 .esc w .
7639 .
7640 .TP
7641 .REG dl
7642 Width of last closed diversion.
7643 .
7644 .TP
7645 .REG dn
7646 Height of last closed diversion.
7647 .
7648 .TP
7649 .REG dw
7650 Day of the week (1\[en]7;
7651 1 is Sunday).
7652 .
7653 .TP
7654 .REG dy
7655 Day of the month (1\[en]31).
7656 .
7657 .TP
7658 .REG hours
7659 Count of hours elapsed since midnight (0\[en]23).
7660 .
7661 .TP
7662 .REG hp
7663 Horizontal drawing position relative to that at the start of the input
7664 line.
7665 .
7666 .TP
7667 .REG llx
7668 Lower-left
7669 .I x
7670 coordinate
7671 (in PostScript units)
7672 of PostScript image;
7673 see
7674 .request psbb .
7675 .
7676 .TP
7677 .REG lly
7678 Lower-left
7679 .I y
7680 coordinate
7681 (in PostScript units)
7682 of PostScript image;
7683 see
7684 .request psbb .
7685 .
7686 .TP
7687 .REG ln
7688 Output line number;
7689 see
7690 .request nm .
7691 .
7692 .TP
7693 .REG lsn
7694 Count of leading spaces on input line.
7695 .
7696 .TP
7697 .REG lss
7698 Amount of horizontal space corresponding to leading spaces on input
7699 line.
7700 .
7701 .TP
7702 .REG minutes
7703 Count of minutes elapsed in the hour (0\[en]59).
7704 .
7705 .TP
7706 .REG mo
7707 Month of the year (1\[en]12).
7708 .
7709 .TP
7710 .REG nl
7711 Vertical drawing position.
7712 .
7713 .TP
7714 .REG opmaxx
7715 .TP
7716 .REG opmaxy
7717 .TP
7718 .REG opminx
7719 .TP
7720 .REG opminy
7721 These four registers mark the top left- and bottom right-hand corners of
7722 a rectangle encompassing all formatted output on the page.
7723 .
7724 They are reset to \-1 by
7725 .B \[rs]O0
7726 or
7727 .BR \[rs]O1 .
7728 .
7729 .TP
7730 .REG rsb
7731 As
7732 .register sb ,
7733 adding maximum glyph height to measurement.
7734 .
7735 .TP
7736 .REG rst
7737 As
7738 .register st ,
7739 adding maximum glyph depth to measurement.
7740 .
7741 .TP
7742 .REG sb
7743 Maximum displacement of text baseline below its original position
7744 after rendering into dummy environment by
7745 .esc w .
7746 .
7747 .TP
7748 .REG seconds
7749 Count of seconds elapsed in the minute (0\[en]60). \" not 59; see POSIX
7750 .
7751 .TP
7752 .REG skw
7753 Skew of last glyph rendered into dummy environment by
7754 .esc w .
7755 .
7756 .TP
7757 .REG slimit
7758 The maximum depth of
7759 .IR \%troff 's
7760 internal input stack.
7761 .
7762 If \[<=]0,
7763 there is no limit:
7764 recursion can continue until available memory is exhausted.
7765 .
7766 The default is 1,000.
7767 .
7768 .TP
7769 .REG ssc
7770 Subscript correction of last glyph rendered into dummy environment by
7771 .esc w .
7772 .
7773 .TP
7774 .REG st
7775 Maximum displacement of text baseline above its original position
7776 after rendering into dummy environment by
7777 .esc w .
7778 .
7779 .TP
7780 .REG systat
7781 Return value of
7782 .MR system 3 ;
7783 see
7784 .request sy .
7785 .
7786 .TP
7787 .REG urx
7788 Upper-right
7789 .I x
7790 coordinate
7791 (in PostScript units)
7792 of PostScript image;
7793 see
7794 .request psbb .
7795 .
7796 .TP
7797 .REG ury
7798 Upper-right
7799 .I y
7800 coordinate
7801 (in PostScript units)
7802 of PostScript image;
7803 see
7804 .request psbb .
7805 .
7806 .TP
7807 .REG year
7808 Gregorian year.
7809 .
7810 .TP
7811 .REG yr
7812 Gregorian year minus 1900.
7813 .LE
7814 .
7815 .
7816 .\" ====================================================================
7817 .SH "Using fonts"
7818 .\" ====================================================================
7819 .
7820 .\" BEGIN Keep (roughly) parallel with groff.texi node "Using Fonts".
7821 In digital typography,
7822 a
7823 .I font
7824 is a collection of characters in a specific typeface that a device can
7825 render as glyphs at a desired size.
7826 .
7827 (Terminals and some typesetters have fonts that render at only one or
7828 two sizes.
7829 .
7830 As examples,
7831 take the
7832 .I groff
7833 .B lj4
7834 device's
7835 Lineprinter,
7836 and
7837 .BR lbp 's
7838 Courier and Elite faces.)
7839 .
7840 .
7841 A
7842 .I roff
7843 formatter can change typefaces at any point in the text.
7844 .
7845 The basic faces are a set of
7846 .I styles
7847 combining upright and slanted shapes with normal and heavy stroke
7848 weights:
7849 .RB \[lq] R \[rq],
7850 .RB \[lq] I \[rq],
7851 .RB \[lq] B \[rq],
7852 and
7853 .RB \[lq] BI \[rq]\[em]\c
7854 these stand for
7855 .I roman,
7856 .I bold,
7857 .I italic,
7858 and
7859 .I bold-italic.
7860 .
7861 For linguistic text,
7862 GNU
7863 .I troff \" GNU
7864 groups typefaces into
7865 .I families
7866 containing each of these styles.
7867 .
7868 (Font designers prepare families such that the styles share esthetic
7869 properties.)
7870 .
7871 A
7872 .I "text font"
7873 is thus often a family combined with a style,
7874 but it need not be:
7875 consider the
7876 .B ps
7877 and
7878 .B pdf
7879 devices'
7880 .B ZCMI
7881 (Zapf Chancery Medium italic)\[em]\c
7882 often,
7883 no other style of Zapf Chancery Medium is provided.
7884 .
7885 On typesetters,
7886 at least one
7887 .I "special font"
7888 is available,
7889 comprising
7890 .I unstyled
7891 glyphs for mathematical operators and other purposes.
7892 .
7893 .
7894 .P
7895 Like the AT&T
7896 .I troff \" AT&T
7897 formatter,
7898 GNU
7899 .I troff \" GNU
7900 does not itself load or manipulate a digital font file;
7901 .\" @footnote{Historically, the fonts @code{troff}s dealt with were not
7902 .\" Free Software or, as with the Graphic Systems C/A/T, did not even
7903 .\" exist in the digital domain.}
7904 instead it
7905 works with a
7906 .I font description file
7907 that characterizes it,
7908 including its glyph repertoire and the
7909 .I metrics
7910 (dimensions) of each glyph.
7911 .
7912 This information permits the formatter to accurately place glyphs with
7913 respect to each other.
7914 .
7915 Before using a font description,
7916 the formatter associates it with a
7917 .I "mounting position,"
7918 a place in an ordered list of available typefaces.
7919 .
7920 So that a document need not be strongly coupled to a specific font
7921 family,
7922 in GNU
7923 .I troff \" GNU
7924 an output device can associate a style in the abstract sense with a
7925 mounting position.
7926 .
7927 Thus the default family can be combined with a style dynamically,
7928 producing a
7929 .I "resolved font name."
7930 .
7931 A user-specified font name that combines family and style,
7932 or refers to a font that is not a member of a family,
7933 is already \[lq]resolved\[rq].
7934 .
7935 .
7936 .P
7937 Fonts often have trademarked names,
7938 and even Free Software fonts can require renaming upon modification.
7939 .
7940 .I groff
7941 maintains a convention that a device's serif font family is given the
7942 name
7943 .B T
7944 (\[lq]Times\[rq]),
7945 its sans-serif family
7946 .B H
7947 (\[lq]Helvetica\[rq]),
7948 and its
7949 monospaced family
7950 .B C
7951 (\[lq]Courier\[rq]).
7952 .
7953 Historical inertia has driven
7954 .IR groff 's
7955 font identifiers to short uppercase abbreviations of font names,
7956 as with
7957 .BR TR ,
7958 .BR TB ,
7959 .BR TI ,
7960 .BR TBI ,
7961 and a special font
7962 .BR S .
7963 .
7964 .
7965 .P
7966 The default family used with abstract styles can be changed at any time;
7967 initially,
7968 it
7969 .RB is\~ T .
7970 .
7971 Typically,
7972 abstract styles are arranged in the first four mounting positions in the
7973 order shown above.
7974 .
7975 The default mounting position,
7976 and therefore style,
7977 is always
7978 .B 1
7979 .RB ( R ).
7980 .
7981 By issuing appropriate formatter instructions,
7982 you can override these defaults before your document writes its first
7983 glyph.
7984 .
7985 .
7986 .P
7987 Terminals cannot change font families and lack special fonts.
7988 .
7989 They support style changes by overstriking,
7990 or by altering ISO\~6429/\:ECMA-48
7991 .I "graphic renditions"
7992 (character cell attributes).
7993 .\" END Keep (roughly) parallel with groff.texi node "Using Fonts".
7994 .
7995 .
7996 .P
7997 The
7998 .B ft
7999 request
8000 and
8001 .B \[rs]f
8002 escape sequence select a typeface by name,
8003 abstract style,
8004 or mounting position.
8005 .
8006 The
8007 .B fam
8008 request
8009 and
8010 .B \[rs]F
8011 escape sequence set the default font family.
8012 .
8013 The
8014 .B ftr
8015 request translates one font name to another;
8016 .B fzoom
8017 magnifies or reduces the typeface corresponding to a resolved one.
8018 .
8019 .B sty
8020 and
8021 .B fp
8022 associate abstract styles and font names with mounting positions.
8023 .
8024 .
8025 .
8026 .
8027 .\" ====================================================================
8028 .SS "Characters and glyphs"
8029 .\" ====================================================================
8030 .
8031 A glyph is a graphical representation of a character.
8032 Whereas a
8033 .I character
8034 is an abstraction of semantic information,
8035 a
8036 .I glyph
8037 is an intelligble mark visible on screen or paper.
8038 .
8039 A character has many possible representation forms;
8040 for example,
8041 the character \[lq]A\[rq]
8042 can be written in an upright or slanted typeface,
8043 producing distinct glyphs.
8044 .
8045 Sometimes,
8046 a sequence of characters map to a single glyph:@:
8047 this is a
8048 .IR ligature \[em]\c
8049 the most common is `fi'.
8050 .
8051 .
8052 .P
8053 Space characters never become glyphs in
8054 GNU
8055 .IR troff . \" GNU
8056 .
8057 If not discarded
8058 (as when trailing text lines),
8059 horizontal motions represent them in the output.
8060 .
8061 .
8062 .P
8063 The formatter supports three kinds of character.
8064 An ordinary character
8065 (see section \[lq]Identifiers\[rq] above)
8066 is the most commonly used,
8067 has no special syntax,
8068 and typically represents itself.
8069 .
8070 (Depending on the breadth
8071 of the output device's glyph repertoire,
8072 the characters
8073 .BR \[aq] ,
8074 .BR \- ,
8075 .BR \[ha] ,
8076 .BR \[ga] ,
8077 and
8078 .B \[ti]
8079 can be exceptions to this rule.
8080 .
8081 .B \[dq]
8082 and
8083 .B \[rs]
8084 are not exceptions,
8085 but because they are syntactically meaningful to the formatter,
8086 access to their glyphs
8087 may require use of special characters
8088 (or changing or disabling the escape character).
8089 .
8090 See
8091 .MR groff_char 7 .
8092 .
8093 Interpolate a
8094 .I "special character"
8095 with the
8096 .RB \[lq] \[rs][\c
8097 .IB xxx ]
8098 or
8099 .RB \[lq] \[rs]C\[aq]\c
8100 .IB xxx \[aq]\c
8101 \[rq]
8102 escape sequence syntax,
8103 where
8104 .I xxx
8105 is an identifer.
8106 .
8107 An
8108 .I "indexed character"
8109 bypasses most character-to-glyph resolution logic,
8110 uses the
8111 .RB \[lq] \[rs]N\[aq]\c
8112 .IB i \[aq]\c
8113 syntax,
8114 and selects a glyph from the currently selected font
8115 by its integer-valued position
8116 .I i
8117 in the output device's representation of that font.
8118 .
8119 (A device's fonts
8120 do not necessarily arrange their glyphs
8121 according to a standard character encoding.)
8122 .
8123 .
8124 .P
8125 .I "User-defined characters"
8126 are similar to string definitions
8127 (see section \[lq]Strings\[rq] above)
8128 and permit extension of or substitution within the character repertoire.
8129 .
8130 Any ordinary,
8131 special,
8132 or indexed character can be user-defined.
8133 .
8134 The
8135 .BR char ,
8136 .BR fchar ,
8137 .BR schar ,
8138 and
8139 .B fschar
8140 requests create user-defined characters
8141 employed at various stages of the character-to-glyph resolution process.
8142 .
8143 .
8144 .P
8145 .\" A
8146 .\" @c TODO: XXX: Kill off this "symbol" terminology.
8147 .\" @dfn{symbol}
8148 .\" is simply a named glyph.
8149 In a
8150 .I troff \" system
8151 system,
8152 a font description file
8153 .\" (recall @ref{Font Directories})
8154 lists all of the glyphs a particular font provides.
8155 .
8156 If the user requests a glyph
8157 not available in the currently selected font,
8158 the formatter looks it up an ordered list of
8159 .I "special fonts."
8160 .
8161 By default,
8162 the
8163 .RB \[lq] ps \[rq]
8164 (PostScript)
8165 and
8166 .RB \[lq] pdf \[rq]
8167 output devices support the two special fonts
8168 .RB \[lq] SS \[rq]
8169 (slanted symbol)
8170 and
8171 .RB \[lq] S \[rq]
8172 (symbol);
8173 and these devices'
8174 .I DESC
8175 files arrange them such that the formatter searches
8176 the former before the latter.
8177 .
8178 Other output devices use different names for special fonts.
8179 Fonts mounted with the
8180 .B fonts
8181 keyword in the
8182 .I DESC
8183 file are globally available.
8184 .
8185 GNU
8186 .IR troff 's \" GNU
8187 .B \%special
8188 and
8189 .B \%fspecial
8190 requests alter the list of fonts treated as special on a general basis,
8191 or only when a certain font is currently selected,
8192 respectively.
8193 .
8194 .
8195 .P
8196 GNU
8197 .I troff \" GNU
8198 employs the following procedure to resolve an input character
8199 into a glyph.
8200 User-defined characters make this resolution process recursive.
8201 The first step that succeeds ends the resolution procedure
8202 for the character being formatted,
8203 which may not be the last in the sequence interpolated
8204 by a user-defined character.
8205 .
8206 .
8207 .IP \[bu]
8208 Interpolate the definition of any character
8209 defined by the
8210 .B char
8211 request
8212 and apply this procedure to each character in its definition.
8213 .
8214 .
8215 .IP \[bu]
8216 Check the current font for a glyph corresponding to the character.
8217 .
8218 .
8219 .IP \[bu]
8220 Interpolate the definition of any user-defined character matching
8221 defined by the
8222 .B fchar
8223 request
8224 and apply this procedure to each character in its definition.
8225 .
8226 .
8227 .IP \[bu]
8228 Check whether the current font has a font-specific list of special
8229 fonts;
8230 if so,
8231 check the each font therein,
8232 in the order determined by the last applicable
8233 .B \%fspecial
8234 request,
8235 for a glyph corresponding to the character.
8236 .
8237 .
8238 .IP \[bu]
8239 Interpolate the definition of any character
8240 defined by the
8241 .B fschar
8242 request for the currently selected font,
8243 and apply this procedure to each character in its definition.
8244 .
8245 .
8246 .IP \[bu]
8247 Check each font in the list configured by the most recently issued
8248 .B \%special
8249 request for a glyph corresponding to the character.
8250 .
8251 .
8252 .IP \[bu]
8253 Interpolate the definition of any character
8254 defined by the
8255 .B sschar
8256 request
8257 and apply this procedure to each character in its definition.
8258 .
8259 .
8260 .IP \[bu]
8261 Finally,
8262 iterate through the list of mounted fonts by position.
8263 .\" recall @xref{Font Positions}.
8264 .
8265 For each mounted font,
8266 if that font bears the
8267 .B \%special
8268 directive
8269 (see
8270 .MR groff_font 5 ),
8271 check it for a glyph corresponding to the character.
8272 .
8273 This stage of the resolution process
8274 can sometimes lead to surprising
8275 results since the
8276 .B fonts
8277 directive in the
8278 .I DESC
8279 file often contains empty positions that are filled
8280 by a macro file or document employing the
8281 .B fp
8282 request
8283 after the formatter initializes.
8284 .
8285 .
8286 .\" ====================================================================
8287 .SS "Special fonts"
8288 .\" ====================================================================
8289 .
8290 .\" BEGIN Keep (roughly) parallel with groff.texi node "Special Fonts".
8291 Special fonts are those that the formatter searches,
8292 in mounting position order,
8293 when it cannot find a requested glyph in the selected font.
8294 .
8295 Typically,
8296 they are declared as such in their description files
8297 .\" @footnote{@xref{Font Description File Format}.}
8298 (see
8299 .MR groff_font 5 ),
8300 and
8301 contain unstyled glyphs.
8302 .
8303 The \[lq]Symbol\[rq] and \[lq]Zapf Dingbats\[rq] fonts
8304 of the PostScript and PDF standards are examples.
8305 .
8306 Ordinarily,
8307 only typesetters have special fonts.
8308 .
8309 .
8310 .P
8311 GNU
8312 .IR troff 's \" GNU
8313 .B \%special
8314 and
8315 .B \%fspecial
8316 requests permit a document
8317 to supplement the set of fonts the device configures
8318 for glyph search
8319 without having to use
8320 the
8321 .B fp
8322 request to manipulate the list of mounting positions,
8323 which can be tedious\[em]by default,
8324 GNU
8325 .I troff \" GNU
8326 mounts 40 fonts at startup
8327 when using the
8328 .B ps
8329 device.
8330 .\" END Keep (roughly) parallel with groff.texi node "Special Fonts".
8331 .
8332 .\" ====================================================================
8333 .SH Hyphenation
8334 .\" ====================================================================
8335 .
8336 When filling,
8337 .I groff
8338 hyphenates words as needed at user-specified and automatically
8339 determined hyphenation points.
8340 .
8341 Explicitly hyphenated words such as \[lq]mother-in-law\[rq] are always
8342 eligible for breaking after each of their hyphens.
8343 .
8344 The hyphenation
8345 .RB character\~ \[rs]%
8346 and non-printing break
8347 .RB point\~ \[rs]:
8348 escape sequences may be used to control the hyphenation and breaking of
8349 individual words.
8350 .
8351 The
8352 .B hw
8353 request sets user-defined hyphenation points for specified words at any
8354 subsequent occurrence.
8355 .
8356 Otherwise,
8357 .I groff
8358 determines hyphenation points automatically by default.
8359 .
8360 .
8361 .P
8362 Several requests influence automatic hyphenation.
8363 .
8364 Because conventions vary,
8365 a variety of hyphenation modes is available to the
8366 .B hy
8367 request;
8368 these determine whether hyphenation will apply to a word prior to
8369 breaking a line at the end of a page
8370 (more or less;
8371 see below for details),
8372 and at which positions within that word automatically determined
8373 hyphenation points are permissible.
8374 .
8375 The localization macro files loaded by
8376 .I troffrc
8377 configure a default hyphenation mode appropriate to the language.
8378 .
8379 .
8380 .br
8381 .ne 3v
8382 .TP
8383 .B 0
8384 disables hyphenation.
8385 .
8386 .
8387 .TP
8388 .B 1
8389 enables hyphenation except after the first and before the last character
8390 of a word.
8391 .
8392 .
8393 .P
8394 The remaining values \[lq]imply\[rq]
8395 .BR 1 ;
8396 that is,
8397 they enable hyphenation under the same conditions as
8398 .RB \[lq] ".hy 1" \[rq],
8399 and then apply or lift restrictions relative to that basis.
8400 .
8401 .
8402 .TP
8403 .B 2
8404 disables hyphenation of the last word on a page or column,
8405 even for explicitly hyphenated words.
8406 .
8407 (Hyphenation is prevented if the next page location trap is closer to
8408 the vertical drawing position than the next text baseline would be.
8409 .
8410 See section \[lq]Traps\[rq] below.)
8411 .
8412 .
8413 .TP
8414 .B 4
8415 disables hyphenation before the last two characters of a word.
8416 .
8417 .
8418 .TP
8419 .B 8
8420 disables hyphenation after the first two characters of a word.
8421 .
8422 .
8423 .TP
8424 .B 16
8425 enables hyphenation before the last character of a word.
8426 .
8427 .
8428 .TP
8429 .B 32
8430 enables hyphenation after the first character of a word.
8431 .
8432 .
8433 .P
8434 Apart from value\~2,
8435 restrictions imposed by the hyphenation mode are
8436 .I not
8437 respected for words whose hyphenations have been specified with the
8438 hyphenation character
8439 .RB (\[lq] \|\[rs]% \[rq]
8440 by default)
8441 or the
8442 .B .hw
8443 request.
8444 .
8445 .
8446 .P
8447 Nonzero values are additive.
8448 .
8449 For example,
8450 mode\~12 causes
8451 .I groff
8452 to hyphenate neither the last two nor the first two characters of a
8453 word.
8454 .
8455 Some values cannot be used together because they contradict;
8456 for instance,
8457 values 4 and\~16,
8458 and values 8 and\~32.
8459 .
8460 As noted,
8461 it is superfluous to add\~1 to any non-zero even mode.
8462 .
8463 .
8464 .br
8465 .ne 2v
8466 .P
8467 The places within a word that are eligible for hyphenation are
8468 determined by language-specific data
8469 .RB ( hla ,
8470 .BR hpf ,
8471 and
8472 .BR hpfa )
8473 and lettercase relationships
8474 .RB ( hcode
8475 and
8476 .BR hpfcode ).
8477 .
8478 Furthermore,
8479 hyphenation of a word might be suppressed due to a limit on
8480 consecutive hyphenated lines
8481 .RB ( hlm ),
8482 a minimum line length threshold
8483 .RB ( hym ),
8484 or because the line can instead be adjusted with additional inter-word
8485 space
8486 .RB ( hys ).
8487 .
8488 .
8489 .\" ====================================================================
8490 .SH Localization
8491 .\" ====================================================================
8492 .
8493 GNU
8494 .I troff \" GNU
8495 ties the set of hyphenation patterns
8496 to the hyphenation language code
8497 selected by the
8498 .B hla
8499 request.
8500 .
8501 The
8502 .B hpf
8503 request is usually invoked by a localization file loaded by the
8504 .I troffrc
8505 file.
8506 .
8507 .I groff
8508 provides localization files for several languages;
8509 See subsection \[lq]Localization packages\[rq] of
8510 .MR groff_tmac 5 .
8511 .
8512 For Western languages,
8513 the localization file
8514 sets the default hyphenation mode
8515 and loads hyphenation patterns and exceptions.
8516 .
8517 By default,
8518 .I troffrc
8519 loads the localization file for English.
8520 .
8521 .
8522 .\" ====================================================================
8523 .SH "Writing macros"
8524 .\" ====================================================================
8525 .
8526 The
8527 .B .de
8528 request defines a macro named for its argument.
8529 .
8530 If that name already exists as an alias,
8531 the target of the alias is redefined;
8532 see section \[lq]Strings\[rq] above.
8533 .
8534 .I \%troff
8535 enters \[lq]copy mode\[rq]
8536 (see below),
8537 storing subsequent input lines as the definition.
8538 .
8539 If the optional second argument is not specified,
8540 the definition ends with the control line
8541 .RB \[lq] .\|. \[rq]\&
8542 (two dots).
8543 .
8544 Tabs and spaces are permitted between the dots.
8545 .
8546 Alternatively,
8547 a second argument to
8548 .B .de
8549 names a macro whose call
8550 (or request whose invocation)
8551 syntax ends the definition;
8552 this
8553 .I "end macro"
8554 is then interpreted normally.
8555 .
8556 Spaces or tabs are permitted after the first control character in the
8557 line containing this ending token,
8558 but a tab immediately after the token prevents its recognition as the
8559 end of a macro definition.
8560 .
8561 Macro definitions can be nested if they use distinct end macros or if
8562 their ending tokens are sufficiently escaped.
8563 .
8564 An end macro need not be defined until it is called.
8565 .
8566 This fact enables a nested macro definition to begin inside one macro
8567 and end inside another.
8568 .
8569 .
8570 .P
8571 Variants of
8572 .B .de
8573 disable compatibility mode and/or indirect the names of the macros
8574 specified for definition or termination:
8575 these are
8576 .BR .de1 ,
8577 .BR .dei ,
8578 and
8579 .BR .dei1 .
8580 .
8581 Append to macro definitions with
8582 .BR .am ,
8583 .BR .am1 ,
8584 .BR .ami ,
8585 and
8586 .BR .ami1 .
8587 .
8588 The
8589 .BR .als ,
8590 .BR .rm ,
8591 and
8592 .B .rn
8593 requests create an alias of,
8594 remove,
8595 and rename a macro,
8596 respectively.
8597 .
8598 .B \%.return
8599 stops the execution of a macro immediately,
8600 returning to the enclosing context.
8601 .
8602 .
8603 .\" ====================================================================
8604 .SS Parameters
8605 .\" ====================================================================
8606 .
8607 .\" BEGIN Keep (roughly) parallel with groff.texi node "Parameters".
8608 Macro call and string interpolation parameters can be accessed using
8609 escape sequences starting with
8610 .RB \[lq] \|\[rs]$ \[rq].
8611 .
8612 The
8613 .B \[rs]n[.$]
8614 read-only register stores the count of parameters available to a macro
8615 or string;
8616 change its value with the
8617 .B .shift
8618 request,
8619 which dequeues parameters from the current list.
8620 .
8621 The
8622 .B \[rs]$0
8623 escape sequence interpolates the name by which a macro was called.
8624 .
8625 Applying string interpolation to a macro does not change this name.
8626 .\" END Keep (roughly) parallel with groff.texi node "Parameters".
8627 .
8628 .
8629 .\" ====================================================================
8630 .SS "Copy mode"
8631 .\" ====================================================================
8632 .
8633 GNU
8634 .I troff \" GNU
8635 processes certain requests in
8636 .I "copy mode:"
8637 it copies ordinary,
8638 special,
8639 and indexed characters as-is;
8640 interpolates the escape sequences
8641 .BR \[rs]n ,
8642 .BR \[rs]g ,
8643 .BR \[rs]$ ,
8644 .BR \[rs]* ,
8645 .BR \[rs]V ,
8646 and
8647 .B \[rs]?\&
8648 normally;
8649 discards comments
8650 .B \[rs]"
8651 and
8652 .BR \[rs]# ;
8653 interpolates
8654 .BR \[rs]a ,
8655 .BR \[rs]e ,
8656 and
8657 .BR \[rs]t ,
8658 as the current
8659 leader,
8660 escape,
8661 or
8662 tab
8663 character with
8664 respectively;
8665 represents
8666 .\" see src/roff/troff/input.h
8667 .BI \[rs] newline \c
8668 ,
8669 .BR \[rs]& ,
8670 .BR \[rs]_ ,
8671 .BR \[rs]| ,
8672 .BR \[rs]\[ha] ,
8673 .BR \[rs]{ ,
8674 .BR \[rs]} ,
8675 .BR \[rs]\[ga] ,
8676 .BR \[rs]\[aq] ,
8677 .BR \[rs]\- ,
8678 .BR \[rs]! ,
8679 .BR \[rs]c ,
8680 .BR \[rs]% ,
8681 .BI \[rs] space \c
8682 ,
8683 .BR \[rs]E ,
8684 .BR \[rs]) ,
8685 .BR \[rs]\[ti] ,
8686 and
8687 .B \[rs]:
8688 in an encoded form,
8689 and copies other escape sequences as-is.
8690 .
8691 The term \[lq]copy mode\[rq] reflects its most visible application
8692 in requests that populate macros and strings,
8693 but other requests also use it when interpreting arguments
8694 that can't meaningfully represent typesetting operations.
8695 For example,
8696 a font selection escape sequence has no meaning
8697 in a hyphenation pattern file name
8698 .RB ( hpf )
8699 or a diagnostic message written to the terminal
8700 .RB ( tm ).
8701 .
8702 The complement of copy mode\[em]a
8703 .I roff
8704 formatter's behavior when not defining or appending to a macro,
8705 string,
8706 or diversion\[em]where all macros are interpolated,
8707 requests invoked,
8708 and valid escape sequences processed immediately upon recognition,
8709 can be termed
8710 .IR "interpretation mode" .
8711 .
8712 .
8713 .P
8714 The escape character
8715 .RB ( \[rs]
8716 by default)
8717 when used before itself
8718 .I quotes
8719 an escape character for later interpreation
8720 in an enclosing context.
8721 .
8722 Escape character quotation enables you to control
8723 whether the formatter interprets a given
8724 .BR \[rs]n ,
8725 .BR \[rs]g ,
8726 .BR \[rs]$ ,
8727 .BR \[rs]* ,
8728 .BR \[rs]V ,
8729 or
8730 .B \[rs]?\&
8731 escape sequence at the time the macro containing it is defined,
8732 or later when the macro is called.
8733 .
8734 .
8735 .P
8736 You can think of
8737 .B \[rs]\[rs]
8738 as a \[lq]delayed\[rq] backslash;
8739 it is the escape character followed by a backslash from which the escape
8740 character has removed its special meaning.
8741 .
8742 Consequently,
8743 .B \[rs]\[rs]
8744 is not best considered an escape sequence,
8745 but a quoted escape character.
8746 .
8747 In any escape sequence
8748 .BI \[rs] X
8749 that
8750 .I \%troff
8751 does not recognize,
8752 the formatter discards the escape character and outputs
8753 .I X.
8754 .
8755 An unrecognized escape sequence causes a warning in category
8756 .RB \%\[lq] escape \[rq],
8757 with two exceptions,
8758 .B \[rs]\[rs]
8759 being one.
8760 .
8761 The other is
8762 .BR \[rs]. ,
8763 which quotes the control character.
8764 .
8765 It is used to permit nested macro definitions to end
8766 without a named macro call to conclude them.
8767 .
8768 Without a syntax for quoting the control character,
8769 this would not be possible.
8770 .
8771 Outside of copy mode,
8772 .I roff
8773 documents should not use the
8774 .B \[rs]\[rs]
8775 or
8776 .B \[rs].\&
8777 character sequences;
8778 they serve only to obfuscate the input.
8779 .
8780 Use
8781 .B \[rs]e
8782 to represent the escape character,
8783 .B \[rs][rs]
8784 to obtain a backslash glyph,
8785 and
8786 .B \[rs]&
8787 before
8788 .B .\&
8789 and
8790 .B \[aq]
8791 where
8792 .I \%troff
8793 expects them as control characters
8794 if you mean to use them literally.
8795 .
8796 .
8797 .br
8798 .ne 2v
8799 .P
8800 Macro definitions can be nested to arbitrary depth.
8801 .
8802 Given the input character sequence
8803 .RB \[lq] \|\[rs]\[rs] \[rq]
8804 in a macro or string definition,
8805 the formatter interpets each escape character in multiple contexts;
8806 once,
8807 when populating the macro or string,
8808 where the first
8809 .RB \[lq] \[rs] \[rq]
8810 serves its quotation function\[em]thus
8811 only one
8812 .RB \[lq] \[rs] \[rq]
8813 is stored in the definition.
8814 .
8815 (Verify this fact with the
8816 .B pm
8817 request.)
8818 .
8819 The formatter interprets the second
8820 .RB \[lq] \[rs] \[rq]
8821 as an escape character
8822 (assuming the escape character hasn't been changed in the meantime)
8823 each time it interpolates the macro or string definition.
8824 .
8825 This fact leads to exponential growth
8826 in the quantity of escape characters
8827 required to quote and thereby delay interpolation of
8828 .BR \[rs]n ,
8829 .BR \[rs]g ,
8830 .BR \[rs]$ ,
8831 .BR \[rs]* ,
8832 .BR \[rs]V ,
8833 and
8834 .B \[rs]?\&
8835 at each nesting level.
8836 .
8837 An alternative is to use
8838 .BR \[rs]E ,
8839 which represents an escape character that is not interpreted in copy
8840 mode.
8841 .
8842 Because
8843 .B \[rs].\&
8844 is not a true escape sequence,
8845 we can't use
8846 .B \[rs]E
8847 to keep
8848 .RB \[lq] .\|.\& \[rq]
8849 from ending a macro definition prematurely.
8850 .
8851 If the multiplicity of backslashes complicates maintenance,
8852 use end macros.
8853 .
8854 .
8855 .\" ====================================================================
8856 .SH Traps
8857 .\" ====================================================================
8858 .
8859 .\" BEGIN Keep (roughly) parallel with groff.texi node "Traps".
8860 .I Traps
8861 are locations in the output,
8862 or conditions on the input that,
8863 when reached or fulfilled,
8864 call a specified macro.
8865 .
8866 A
8867 .I "vertical position trap"
8868 calls a macro when the formatter's vertical drawing position reaches or
8869 passes,
8870 in the downward direction,
8871 a certain location on the output page or in a diversion.
8872 .
8873 Its applications include setting page headers and footers,
8874 body text in multiple columns,
8875 and footnotes.
8876 .
8877 These traps can occur at a given location either on the page
8878 .RB ( wh ,\~ ch )
8879 or in the current diversion
8880 .RB ( dt )\[em]together,
8881 these are known as
8882 vertical position traps,
8883 which can be disabled and re\[e ad]nabled
8884 .RB ( vpt ).
8885 .
8886 .
8887 .P
8888 A diversion is not formatted in the context of a page,
8889 so it lacks page location traps;
8890 instead it can have a
8891 .I "diversion trap."
8892 .
8893 There can exist at most one such vertical position trap per diversion.
8894 .
8895 .
8896 .P
8897 Other kinds of trap can be planted
8898 at a blank line
8899 .RB ( blm );
8900 at a line with leading space characters
8901 .RB ( lsm );
8902 after a certain number of productive input lines
8903 .RB ( it ,\~ itc );
8904 or at the end of input
8905 .RB ( em ).
8906 .
8907 .
8908 .P
8909 Setting a trap is also called
8910 .I planting
8911 one.
8912 .
8913 It is said that a trap is
8914 .I sprung
8915 if its condition is fulfilled.
8916 .
8917 .
8918 .P
8919 The formatter passes no arguments to macros called by traps.
8920 .\" END Keep (roughly) parallel with groff.texi node "Traps".
8921 .
8922 .
8923 .br
8924 .ne 5v
8925 .P
8926 Registers associated with trap management include
8927 vertical position trap enablement status
8928 .RB ( \[rs]n[.vpt] ),
8929 distance to the next trap
8930 .RB ( \[rs]n[.t] ),
8931 and the name of that trap
8932 .RB ( \[rs]n[.trap] );
8933 the count of lines remaining in the pending input trap
8934 .RB ( \[rs]n[.it] ),
8935 the name of the macro associated with it
8936 .RB ( \[rs]n[.itm] ),
8937 and whether that input trap honors the
8938 .B \[rs]c
8939 output line continuation escape sequence
8940 .RB ( \[rs]n[.itc] );
8941 amount of needed
8942 .RB ( .ne -requested)
8943 space that caused the most recent vertical position trap to be sprung
8944 .RB ( \[rs]n[.ne] ),
8945 amount of needed space truncated from the amount requested
8946 .RB ( \[rs]n[.trunc] );
8947 page ejection status
8948 .RB ( \[rs]n[.pe] );
8949 and
8950 leading space count
8951 .RB ( \[rs]n[lsn] )
8952 with its corresponding amount of motion
8953 .RB ( \[rs]n[lss] ).
8954 .
8955 .
8956 .\" ====================================================================
8957 .SS "Page location traps"
8958 .\" ====================================================================
8959 .
8960 A
8961 .I "page location trap"
8962 is a vertical position trap that applies to the page;
8963 that is,
8964 to the top-level diversion.
8965 .
8966 Many can be present;
8967 manage them with the
8968 .B wh
8969 and
8970 .B ch
8971 requests.
8972 .
8973 Non-negative page locations given to these requests set the trap
8974 relative to the top of the page;
8975 negative values set the trap relative to the bottom of the page.
8976 .
8977 It is not possible to plant a trap less than one basic unit from the
8978 page bottom:
8979 a location of \[lq]\-0\[rq] is interpreted as \[lq]0\[rq],
8980 the top of the page.
8981 .
8982 An existing
8983 .I visible
8984 trap
8985 (see below)
8986 at the same location is removed;
8987 this is
8988 .BR wh 's
8989 sole function if its second argument is missing.
8990 .
8991 .
8992 .P
8993 A trap is sprung only if it is
8994 .I visible,
8995 meaning that its location is reachable on the page and it is not hidden
8996 by another trap at the same location already planted there.
8997 .
8998 (A trap planted at \[lq]20i\[rq] or \[lq]\-30i\[rq] will not be sprung
8999 on a page of length \[lq]11i\[rq].)
9000 .
9001 .
9002 .P
9003 A trap above the top or at or below the bottom of the page
9004 can be made visible
9005 by either moving it into the page area
9006 or increasing the page length so that the trap is on the page.
9007 .
9008 A negative trap value always uses the
9009 .I current
9010 page length;
9011 the formatter does not convert it to an absolute vertical position.
9012 .
9013 We can use the
9014 .B pwh
9015 request to dump page location traps to the standard error stream;
9016 see section \[lq]Debugging\[rq] below.
9017 .
9018 GNU
9019 .I troff \" GNU
9020 reports their positions in basic units,
9021 and includes empty slots in the list,
9022 where a trap had been planted
9023 but subsequently (re)moved,
9024 because they can affect the visibility of subsequently planted traps.
9025 .
9026 .
9027 .br
9028 .ne 6v
9029 .\" ====================================================================
9030 .SS "The implicit page trap"
9031 .\" ====================================================================
9032 .
9033 An
9034 .I implicit page trap
9035 always exists in the top-level diversion
9036 (see below);
9037 its purpose is to eject the current page and start the next one.
9038 .
9039 It works like a trap in some ways but not others.
9040 .
9041 It has no name,
9042 so it cannot be moved or deleted with
9043 .B wh
9044 or
9045 .B ch
9046 requests.
9047 .
9048 You cannot hide it by placing another trap at its location,
9049 and can move it only by redefining the page length with
9050 .BR pl .
9051 .
9052 Its operation is suppressed when vertical page traps are disabled with
9053 GNU
9054 .I troff's \" GNU
9055 .B vpt
9056 request.
9057 .
9058 .
9059 .\" ====================================================================
9060 .SH Diversions
9061 .\" ====================================================================
9062 .
9063 .\" BEGIN Keep (roughly) parallel with groff.texi node "Diversions".
9064 In
9065 .I roff
9066 systems it is possible to format text as if for output,
9067 but instead of writing it immediately,
9068 one can
9069 .I divert
9070 the formatted text into a named storage area.
9071 .
9072 It is retrieved later by specifying its name after a control character.
9073 .
9074 The formatter uses the same name space for such
9075 .I diversions
9076 as for strings and macros;
9077 see section \[lq]Identifiers\[rq] above.
9078 .
9079 Such text is sometimes said to be \[lq]stored in a macro\[rq],
9080 but this coinage obscures the important distinction
9081 between macros and strings on one hand
9082 and diversions on the other;
9083 the former store
9084 .I unformatted
9085 input text,
9086 and the latter capture
9087 .I formatted
9088 output.
9089 .\" TODO: Add forward reference when we add a "GNU troff internals"
9090 .\" subsection to this page.
9091 .
9092 Diversions also do not interpret arguments.
9093 .
9094 Applications of diversions include
9095 footnotes,
9096 tables of contents,
9097 indices,
9098 and \[lq]keeps\[rq]
9099 (preventing a page break from occurring at an inconvenient place
9100 by forcing a set of output lines to be set as a group).
9101 .
9102 For orthogonality it is said that GNU
9103 .I troff \" GNU
9104 populates the
9105 .I top-level diversion
9106 if no diversion is active
9107 (that is,
9108 formatted output is being \[lq]diverted\[rq] directly
9109 to the output device).
9110 .
9111 The top-level diversion has no name.
9112 .
9113 .
9114 .P
9115 Dereferencing an undefined diversion creates an empty one of that name.
9116 .
9117 (GNU
9118 .I troff \" GNU
9119 also emits a warning in category
9120 \[lq]mac\[rq];
9121 see section \[lq]Warnings\[rq] of
9122 .MR \%troff 1 .)
9123 .
9124 A diversion does not exist for the purpose of testing with the
9125 .B d
9126 conditional expression operator
9127 until its initial definition ends;
9128 see subsection \[lq]Conditional expressions\[rq] above.
9129 .\" The following requests create and alter diversions.
9130 .
9131 .
9132 .P
9133 The
9134 .B di
9135 request creates a diversion,
9136 including any partially collected line.
9137 .
9138 .B da
9139 appends to a diversion,
9140 creating one if it does not already exist.
9141 .
9142 If the diversion's name already exists as an alias,
9143 the target of the alias is replaced or appended to;
9144 see section \[lq]Strings\[rq] above.
9145 .
9146 The pending output line is diverted as well.
9147 .
9148 Switching to another environment
9149 (with the
9150 .B ev
9151 request)
9152 before invoking
9153 .B di
9154 or
9155 .B da
9156 avoids including any pending output line in the diversion.
9157 (See section \[lq]Environments[\[rq] below.)
9158 .
9159 .
9160 .P
9161 Invoking
9162 .B di
9163 or
9164 .B da
9165 without an argument stops diverting output
9166 to the diversion named by the most recent corresponding request.
9167 .
9168 Invoking
9169 .B di
9170 or
9171 .B da
9172 without an argument
9173 when no diversion is being populated does nothing.
9174 .
9175 (GNU
9176 .I troff \" GNU
9177 emits a warning in category
9178 \[lq]di\[rq];
9179 see section \[lq]Warnings\[rq] of
9180 .MR \%troff 1 .)
9181 .
9182 .
9183 .P
9184 .B box
9185 and
9186 .B boxa
9187 work similarly,
9188 but ignore partially collected lines.
9189 .
9190 Call any of these macros again without an argument to end the diversion.
9191 .
9192 .
9193 .br
9194 .ne 2v
9195 .P
9196 Diversion requests can be nested.
9197 .
9198 The registers
9199 .B .d
9200 and
9201 .B .z
9202 report information about the current diversion,
9203 and
9204 .B dn
9205 and
9206 .B dl
9207 about the most recently closed one.
9208 .
9209 .B .h
9210 is meaningful in diversions,
9211 including the top-level one.
9212 .
9213 .
9214 .P
9215 After output to a (named) diversion stops,
9216 the formatter stores its vertical and horizontal sizes,
9217 to the writable registers
9218 .B dn
9219 and
9220 .BR dl ,
9221 respectively.
9222 .\" XXX Do these measure:
9223 .\" net motion of the drawing position,
9224 .\" maximal motion of the drawing position relative to that where the
9225 .\" diversion started,
9226 .\" or
9227 .\" the maximal bounds of spilled ink relative to the drawing position
9228 .\" where the diversion started?
9229 .\" Savannah #64728.
9230 .
9231 Only the lines just processed are counted:
9232 for the computation of
9233 .B dn
9234 and
9235 .BR dl ,
9236 the requests
9237 .B da
9238 and
9239 .B boxa
9240 are handled as if
9241 .B di
9242 and
9243 .B box
9244 had been used,
9245 respectively\[em]lines that have been already stored in the diversion
9246 (box) are not taken into account.
9247 .
9248 .
9249 .P
9250 The
9251 .B \[rs]!\&
9252 and
9253 .B \[rs]?\&
9254 escape sequences and
9255 .B output
9256 request escape from a diversion,
9257 the first two to the enclosing level and the last to the top level.
9258 .
9259 This facility is termed
9260 .IR "transparent embedding" .
9261 .
9262 .
9263 .P
9264 The
9265 .B \%asciify
9266 and
9267 .RB \%\[lq] unformat \[rq]
9268 requests reprocess diversions.
9269 .\" XXX: That's a weak statement. What we need is a `for` request and
9270 .\" a new conditional expression operator that tests whether an item in
9271 .\" a node list is an (otherwise unrepresentable) node. See Savannah
9272 .\" #62264.
9273 .\" END Keep (roughly) parallel with groff.texi node "Diversions".
9274 .
9275 .
9276 .\" ====================================================================
9277 .SH "Punning names"
9278 .\" ====================================================================
9279 .
9280 .\" BEGIN Keep (roughly) parallel with groff.texi node "Punning Names".
9281 Macros,
9282 strings,
9283 and diversions share a name space;
9284 see section \[lq]Identifiers\[rq] above.
9285 .
9286 Internally,
9287 the same mechanism is used to store them.
9288 .
9289 You can thus call a macro with string interpolation syntax and vice
9290 versa.
9291 .
9292 Interpolating a string does not hide existing macro arguments.
9293 .
9294 Place the sequence
9295 .B \[rs]\[rs]
9296 at the end of a line in a macro definition or,
9297 within a macro definition,
9298 immediately after the interpolation of a macro as a string,
9299 to suppress the effect of a newline.
9300 .\" END Keep (roughly) parallel with groff.texi node "Punning Names".
9301 .
9302 .
9303 .\" ====================================================================
9304 .SH Environments
9305 .\" ====================================================================
9306 .
9307 .\" BEGIN Keep (roughly) parallel with groff.texi node "Environments".
9308 Environments store most of the parameters that control text processing.
9309 .
9310 A default environment named
9311 .RB \[lq] 0 \[rq]
9312 (zero)
9313 exists when
9314 exists when the formatter starts up;
9315 formatting-related requests and escape sequences modify its properties.
9316 .
9317 .
9318 .P
9319 You can create new environments and switch among them.
9320 .
9321 Only one is current at any given time.
9322 .
9323 Active environments are managed using a
9324 .I stack,
9325 a data structure supporting \[lq]push\[rq] and \[lq]pop\[rq] operations.
9326 .
9327 The current environment is at the top of the stack.
9328 .
9329 The same environment name can be pushed onto the stack multiple times,
9330 possibly interleaved with others.
9331 .
9332 Popping the environment stack does not destroy the current environment;
9333 it remains accessible by name and can be made current again
9334 by pushing it at any time.
9335 .
9336 Environments cannot be renamed or deleted,
9337 and can only be modified when current.
9338 .
9339 To inspect the environment stack,
9340 use the
9341 .B pev
9342 request;
9343 see section \[lq]Debugging\[rq] below.
9344 .
9345 .
9346 .P
9347 Environments store the following information.
9348 .
9349 .
9350 .IP \[bu] 3n
9351 a partially collected line, if any
9352 .
9353 .
9354 .IP \[bu]
9355 data about the most recently output glyph and line
9356 (registers
9357 .BR .cdp ,
9358 .BR .cht ,
9359 .BR .csk ,
9360 .BR .n ,
9361 .BR .w )
9362 .
9363 .
9364 .IP \[bu]
9365 typeface parameters
9366 (size,
9367 family,
9368 style,
9369 height and slant,
9370 inter-word and inter-sentence space sizes)
9371 .
9372 .
9373 .IP \[bu]
9374 page parameters
9375 (line length,
9376 title length,
9377 vertical spacing,
9378 line spacing,
9379 indentation,
9380 line numbering,
9381 centering,
9382 right-alignment,
9383 underlining,
9384 hyphenation parameters)
9385 .
9386 .
9387 .IP \[bu]
9388 filling enablement;
9389 adjustment enablement and mode
9390 .
9391 .
9392 .IP \[bu]
9393 tab stops;
9394 tab,
9395 leader,
9396 escape,
9397 control,
9398 no-break control,
9399 hyphenation,
9400 and
9401 margin characters
9402 .
9403 .
9404 .IP \[bu]
9405 input line traps
9406 .
9407 .
9408 .IP \[bu]
9409 stroke and fill colors
9410 .
9411 .
9412 .P
9413 The
9414 .B ev
9415 request
9416 (with an argument)
9417 pushes to
9418 and
9419 (without)
9420 pops from the environment stack,
9421 while
9422 .B evc
9423 copies a named environment's parameters to the current one.
9424 .\" END Keep (roughly) parallel with groff.texi node "Environments".
9425 .
9426 .
9427 .\" ====================================================================
9428 .SH "Postprocessor access"
9429 .\" ====================================================================
9430 .
9431 .\" BEGIN Keep (roughly) parallel with groff.texi node "Postprocessor
9432 .\" Access".
9433 Beyond the
9434 .B cf
9435 and
9436 .B trf
9437 requests,
9438 two escape sequences and two requests enable documents
9439 to pass information directly to a postprocessor.
9440 .
9441 These are useful for exercising device-specific capabilities that the
9442 .I groff
9443 language does not abstract or generalize;
9444 examples include the embedding of hyperlinks and image files.
9445 .
9446 Device-specific functions are documented
9447 in each output driver's man page,
9448 such as
9449 .MR gropdf 1 ,
9450 .MR grops 1 ,
9451 or
9452 .MR grotty 1 .
9453 .
9454 .
9455 .P
9456 The
9457 .RB \[lq] device \[rq]
9458 request and
9459 .B \[rs]X
9460 escape sequence embed their arguments into GNU
9461 .I troff \" GNU
9462 output as parameters to an
9463 .RB \[lq] "x X" \[rq]
9464 device extension command
9465 (see
9466 .MR groff_out 5 ).
9467 .
9468 The interpretation of such parameters is determined by the output driver
9469 or other postprocessor.
9470 .
9471 .
9472 .P
9473 GNU
9474 .I troff \" GNU
9475 also permits the interpolation of macro or string contents
9476 as a device extension command.
9477 .
9478 The
9479 .B \%devicem
9480 request and
9481 .B \[rs]Y
9482 escape sequence correspond to
9483 .RB \[lq] ".device \[rs]*[\c"
9484 .IB name ]\c
9485 \[rq]
9486 and
9487 .RB \[lq] \[rs]X\[aq]\[rs]*[\c
9488 .IB name ]\c
9489 \[rq],
9490 respectively.
9491 .
9492 They differ from their counterparts
9493 in that GNU
9494 .I troff \" GNU
9495 does not interpret the contents of the string or macro
9496 .IR name ;
9497 further,
9498 .I name
9499 may be a macro and thus contain newlines.
9500 .
9501 (There is no way to embed a newline in the arguments to
9502 .RB \%\[lq] device \[rq]
9503 or
9504 .BR \[rs]X .)
9505 .
9506 The inclusion of newlines requires an extension to the AT&T
9507 .I troff \" AT&T
9508 device-independent page description language,
9509 and their presence confuses drivers that do not know about it
9510 (see subsection \[lq]Device control commands\[rq] of
9511 .MR groff_out 5 ).
9512 .
9513 .
9514 .P
9515 Use of device extension commands early in a document
9516 (before the first text is formatted)
9517 can interfere with processing of page location traps.
9518 If you experience problems when placing them early,
9519 precede the first with a dummy character escape sequence
9520 .RB \[lq] \[rs]& \[rq];
9521 recall section \[lq]Dummy Characters\[rq] above.
9522 .
9523 .
9524 .P
9525 The
9526 .B tag
9527 and
9528 .B taga
9529 requests are reserved for internal use.
9530 .\" END Keep (roughly) parallel with groff.texi node "Postprocessor
9531 .\" Access".
9532 .
9533 .
9534 .\" ====================================================================
9535 .SH Underlining
9536 .\" ====================================================================
9537 .
9538 In
9539 .I RUNOFF
9540 (see
9541 .MR roff 7 ),
9542 underlining,
9543 even of lengthy passages,
9544 was straightforward because only fixed-pitch printing devices were
9545 targeted.
9546 .
9547 Typesetter output posed a greater challenge.
9548 .
9549 There exists a
9550 .I groff
9551 request
9552 .B .ul
9553 (see above)
9554 that underlines subsequent source lines on terminals,
9555 but on typesetters,
9556 it selects an italic font style instead.
9557 .
9558 .
9559 The
9560 .I ms
9561 macro package
9562 (see
9563 .MR groff_ms 7 )
9564 offers a macro
9565 .BR .UL ,
9566 but it too produces the desired effect only on typesetters,
9567 and has other limitations.
9568 .
9569 .
9570 .P
9571 One could adapt
9572 .IR ms 's
9573 approach to the construction of a macro as follows.
9574 .
9575 .RS
9576 .EX
9577 \&.de UNDERLINE
9578 \&. ie n \[rs]\[rs]$1\[rs]f[I]\[rs]\[rs]$2\[rs]f[P]\[rs]\[rs]$3
9579 \&. el \[rs]\[rs]$1\[rs]Z\[aq]\[rs]\[rs]$2\[aq]\[rs]v\[aq].25m\[aq]\
9580 \[rs]D\[aq]l \[rs]w\[aq]\[rs]\[rs]$2\[aq]u 0\[aq]\[rs]v\[aq]\-.25m\
9581 \[aq]\[rs]\[rs]$3
9582 \&..
9583 .EE
9584 .RE
9585 .
9586 If
9587 .MR doclifter 1
9588 makes trouble, change the macro name
9589 .B UNDERLINE
9590 into some 2-letter word, like
9591 .BR Ul .
9592 .
9593 Moreover,
9594 change the form of the font selection escape sequence from
9595 .B \[rs]f[P]
9596 to
9597 .BR \[rs]fP .
9598 .
9599 .
9600 .\" ====================================================================
9601 .SS "Underlining without macro definitions"
9602 .\" ====================================================================
9603 .
9604 If one does not want to use macro definitions,
9605 e.g.,
9606 when
9607 .I doclifter
9608 gets lost,
9609 use the following.
9610 .
9611 .RS
9612 .EX
9613 \&.ds u1 before
9614 \&.ds u2 in
9615 \&.ds u3 after
9616 \&.ie n \[rs]*[u1]\[rs]f[I]\[rs]*[u2]\[rs]f[P]\[rs]*[u3]
9617 \&.el \[rs]*[u1]\[rs]Z\[aq]\[rs]*[u2]\[aq]\[rs]v\[aq].25m\[aq]\[rs]D\
9618 \[aq]l \[rs]w\[aq]\[rs]*[u2]\[aq]u 0\[aq]\[rs]v\[aq]\-.25m\[aq]\[rs]*\
9619 [u3]
9620 .EE
9621 .RE
9622 .
9623 .ne 2v
9624 When using
9625 .IR doclifter ,
9626 it might be necessary to change syntax forms such as
9627 .B \e[xy]
9628 and
9629 .B \e*[xy]
9630 to those supported by AT&T
9631 .IR troff :
9632 .B \e*(xy
9633 and
9634 .BR \e(xy ,
9635 and so on.
9636 .
9637 .
9638 .P
9639 Then these lines could look like
9640 .RS
9641 .EX
9642 \&.ds u1 before
9643 \&.ds u2 in
9644 \&.ds u3 after
9645 \&.ie n \[rs]*[u1]\[rs]fI\[rs]*(u2\[rs]fP\[rs]*(u3
9646 \&.el \[rs]*(u1\[rs]Z\[aq]\[rs]*(u2\[aq]\[rs]v\[aq].25m\[aq]\[rs]D\
9647 \[aq]l \[rs]w\[aq]\[rs]*(u2\[aq]u 0\[aq]\[rs]v\[aq]\-.25m\[aq]\[rs]*(u3
9648 .EE
9649 .RE
9650 .
9651 .
9652 .P
9653 The result looks like
9654 .RS
9655 .ft CR
9656 before
9657 \z\[ul]i\
9658 \z\[ul]n
9659 after
9660 .ft R
9661 .RE
9662 .
9663 .
9664 .\" ====================================================================
9665 .SS "Underlining by overstriking with \[rs](ul"
9666 .\" ====================================================================
9667 .
9668 The
9669 .B \[rs]z
9670 escape sequence writes a glyph without advancing the
9671 drawing position,
9672 enabling overstriking.
9673 .
9674 Thus,
9675 .BI \[rs]z c \[rs](ul
9676 formats
9677 .I c
9678 with an underrule glyph on top of it.
9679 .
9680 Video terminals implement the underrule by setting a character cell's
9681 underline attribute,
9682 so this technique works in both
9683 .I nroff \" mode
9684 and
9685 .I troff \" mode
9686 modes.
9687 .
9688 .
9689 .P
9690 Long words may then look intimidating in the input;
9691 a clarifying approach might be to use the input line continuation escape
9692 sequence
9693 .BI \[rs] newline
9694 to place each underlined character on its own input line.
9695 .
9696 Thus,
9697 .
9698 .RS
9699 .EX
9700 \&.nf
9701 \[rs]&\[rs]fB: ${\[rs]fIvar\[rs]fR\[rs]c
9702 \[rs]zo\[rs](ul\[rs]
9703 \[rs]zp\[rs](ul\[rs]c
9704 \[rs]&\[rs]fIvalue\[rs]fB}
9705 \&.fi
9706 .EE
9707 .RE
9708 .
9709 produces
9710 .
9711 .RS
9712 .EX
9713 .BI ": ${" var \c
9714 \zo\(ul\
9715 \zp\(ul\c
9716 .IB value }
9717 .EE
9718 .RE
9719 .
9720 as output.
9721 .
9722 .
9723 .\" ====================================================================
9724 .SH "Compatibility mode"
9725 .\" ====================================================================
9726 .
9727 .MR groff_diff 7
9728 documents differences between the
9729 .I roff
9730 language recognized by
9731 GNU
9732 .I troff \" GNU
9733 and that of
9734 AT&T
9735 .IR troff , \" AT&T
9736 as well as the device,
9737 font,
9738 and device-independent page description formats described by
9739 CSTR\~#54.
9740 .
9741 GNU
9742 .I troff \" GNU
9743 provides an
9744 AT&T
9745 .I troff \" AT&T
9746 compatibility mode.
9747 .
9748 The
9749 .request cp
9750 request and registers
9751 .B .C
9752 and
9753 .B .cp
9754 set and test the enablement of this mode.
9755 .
9756 .
9757 .\" ====================================================================
9758 .SH Debugging
9759 .\" ====================================================================
9760 .
9761 .\" BEGIN Keep (roughly) parallel with groff.texi node "Debugging".
9762 Preprocessors use the
9763 .B lf
9764 request to preserve the identities of line numbers and names of input
9765 files.
9766 .
9767 .I groff
9768 emits a variety of error diagnostics and supports several categories of
9769 warning;
9770 the output of these can be selectively suppressed with
9771 .RB \[lq] warn \[rq]
9772 (and see the
9773 .BR \-E ,
9774 .BR \-w ,
9775 and
9776 .B \-W
9777 options of
9778 .MR \%troff 1 ).
9779 .
9780 A trace of the formatter's input processing stack can be emitted when
9781 errors or warnings occur by means of
9782 .MR \%troff 1 's
9783 .B \-b
9784 option,
9785 or produced on demand with the
9786 .request backtrace
9787 request.
9788 .
9789 .BR tm ,
9790 .BR tmc ,
9791 and
9792 .B tm1
9793 can be used to emit customized diagnostic messages or for
9794 instrumentation while troubleshooting.
9795 .
9796 .B ex
9797 and
9798 .B ab
9799 cause early termination with successful and error exit codes
9800 respectively,
9801 to halt further processing when continuing would be fruitless.
9802 .
9803 Examine the state of the formatter with requests that write lists of
9804 defined names\[em]macros,
9805 strings,
9806 and
9807 .RB diversions\[em]( pm );
9808 characters
9809 .RB ( pchar "; experimental);"
9810 colors
9811 .RB ( pcolor );
9812 composite character mappings
9813 .RB ( pcomposite );
9814 environments
9815 .RB ( pev );
9816 occupied font mounting positions
9817 .RB ( pfp );
9818 font translations
9819 .RB ( pftr );
9820 automatic hyphenation codes
9821 .RB ( pchar )
9822 and exceptions
9823 .RB ( phw );
9824 registers
9825 .RB ( pnr );
9826 open streams
9827 .RB ( pstream );
9828 and
9829 page location traps
9830 .RB ( pwh ).
9831 .
9832 Requests can also disclose
9833 to the standard error stream
9834 the internal properties and representations of
9835 characters and classes
9836 .RB ( pchar ),
9837 macros
9838 (and strings and diversions)
9839 .RB ( pm ),
9840 and the list of output nodes corresponding to the pending input line
9841 .RB ( pline ).
9842 .\" END Keep (roughly) parallel with groff.texi node "Debugging".
9843 .
9844 .
9845 .\" ====================================================================
9846 .SH Authors
9847 .\" ====================================================================
9848 .
9849 This document was written by
9850 Trent A.\& Fisher,
9851 .MT wl@\:gnu\:.org
9852 Werner Lemberg
9853 .ME ,
9854 and
9855 .MT g.branden\:.robinson@\:gmail\:.com
9856 G.\& Branden Robinson
9857 .ME .
9858 .
9859 Section \[lq]Underlining\[rq] was primarily written by
9860 .MT groff\-bernd\:.warken\-72@\:web\:.de
9861 Bernd Warken
9862 .ME .
9863 .
9864 .
9865 .\" ====================================================================
9866 .SH "See also"
9867 .\" ====================================================================
9868 .
9869 .ne 2v
9870 .IR "Groff: The GNU Implementation of troff" ,
9871 by Trent A.\& Fisher and Werner Lemberg,
9872 is the primary
9873 .I groff
9874 manual.
9875 .
9876 You can browse it interactively with \[lq]info groff\[rq].
9877 .
9878 .
9879 .br
9880 .ne 4v
9881 .P
9882 \[lq]Troff User's Manual\[rq]
9883 by Joseph F.\& Ossanna,
9884 1976
9885 (revised by Brian W.\& Kernighan,
9886 1992),
9887 AT&T Bell Laboratories Computing Science Technical Report No.\& 54,
9888 widely called simply \[lq]CSTR\~#54\[rq],
9889 documents the language,
9890 device and font description file formats,
9891 and device-independent page description language
9892 referred to collectively in
9893 .I groff
9894 documentation as
9895 .RI \[lq]AT&T\~ troff \[rq].
9896 .
9897 .
9898 .br
9899 .ne 3v
9900 .P
9901 \[lq]A Typesetter-independent TROFF\[rq]
9902 by Brian W.\& Kernighan,
9903 1982,
9904 AT&T Bell Laboratories Computing Science Technical Report No.\& 97
9905 (CSTR\~#97),
9906 provides additional insights into the
9907 device and font description file formats
9908 and device-independent page description language.
9909 .
9910 .
9911 .TP
9912 .MR groff 1
9913 is the preferred interface to the
9914 .I groff
9915 system;
9916 it manages the pipeline that carries a source document through
9917 preprocessors,
9918 the
9919 .I \%troff
9920 formatter,
9921 and an output driver to viewable or printable form.
9922 .
9923 It also exhaustively lists the man pages provided with the GNU
9924 .I roff
9925 system.
9926 .
9927 .
9928 .TP
9929 .MR groff_char 7
9930 discusses character encoding issues
9931 and escape sequences that produce glyphs.
9932 .
9933 .
9934 .TP
9935 .MR groff_diff 7
9936 covers differences between the
9937 GNU
9938 .I troff \" GNU
9939 formatter,
9940 its device and font description file formats,
9941 its device-independent page description language,
9942 and those of AT&T
9943 .IR troff .\" AT&T
9944 .
9945 .
9946 .TP
9947 .MR groff_font 5
9948 describes the formats of the files that describe devices
9949 .RI ( DESC )
9950 and fonts.
9951 .
9952 .
9953 .TP
9954 .MR groff_tmac 5
9955 surveys macro packages provided with
9956 .IR groff ,
9957 describes how documents can take advantage of them,
9958 offers guidance on writing macro packages and using diversions,
9959 and includes historical information.
9960 .\" slack text for widow/orphan management
9961 .\" on macro package naming conventions.
9962 .
9963 .
9964 .TP
9965 .MR roff 7
9966 presents a detailed history of
9967 .I roff
9968 systems and summarizes concepts common to them.
9969 .
9970 .
9971 .\" Clean up.
9972 .rm tx
9973 .
9974 .\" Restore compatibility mode (for, e.g., Solaris 10/11).
9975 .cp \n[*groff_groff_7_man_C]
9976 .do rr *groff_groff_7_man_C
9977 .
9978 .
9979 .\" Local Variables:
9980 .\" fill-column: 72
9981 .\" mode: nroff
9982 .\" End:
9983 .\" vim: set filetype=groff textwidth=72: