1GROFF(7)               Miscellaneous Information Manual               GROFF(7)
2
3
4

NAME

6       groff - a short reference for the GNU roff language
7

DESCRIPTION

9       The  name  groff  stands for GNU roff and is the free implementation of
10       the roff type-setting system.  See roff(7) for a survey and  the  back‐
11       ground of the groff system.
12
13       This document gives only short descriptions of the predefined roff lan‐
14       guage elements as used in groff.  Both the classical features  and  the
15       groff extensions are provided.
16
17       Historically,  the roff language was called troff.  groff is compatible
18       with the classical system and provides proper extensions.  So  in  GNU,
19       the  terms  roff,  troff, and groff language could be used as synonyms.
20       However troff slightly tends to refer more to  the  classical  aspects,
21       whereas  groff  emphasizes  the GNU extensions, and roff is the general
22       term for the language.
23
24       This file is only a short version of the complete documentation that is
25       found  in the groff info(1) file, which contains more detailed, actual,
26       and concise information.
27
28       The general syntax for writing groff documents is relatively easy,  but
29       writing extensions to the roff language can be a bit harder.
30
31       The roff language is line-oriented.  There are only two kinds of lines,
32       control lines and text lines.  The control lines start with  a  control
33       character,  by  default  a period “.”  or a single quote “'”; all other
34       lines are text lines.
35
36       Control lines represent commands, optionally with arguments.  They have
37       the following syntax.  The leading control character can be followed by
38       a command name; arguments, if any, are separated  by  blanks  from  the
39       command name and among themselves, for example,
40
41              .command_name arg1 arg2
42
43       For  indentation, any number of space or tab characters can be inserted
44       between the leading control character and the  command  name,  but  the
45       control character must be on the first position of the line.
46
47       Text lines represent the parts that will be printed.  They can be modi‐
48       fied by escape sequences, which are recognized by a  leading  backslash
49\’.   These  are  in-line or even in-word formatting elements or func‐
50       tions.  Some of these take arguments separated by  single  quotes  “'”,
51       others  are regulated by a length encoding introduced by an open paren‐
52       thesis ‘(’ or enclosed in brackets ‘[’ and ‘]’.
53
54       The roff language provides flexible instruments  for  writing  language
55       extension,  such  as  macros.  When interpreting macro definitions, the
56       roff system enters a special operating mode, called the copy mode.
57
58       The copy mode behavior can be quite tricky, but there  are  some  rules
59       that ensure a safe usage.
60
61       1.     Printable  backslashes  must  be denoted as \e.  To be more pre‐
62              cise, \e represents the current  escape  character.   To  get  a
63              backslash glyph, use \(rs or \[rs].
64
65       2.     Double all backslashes.
66
67       3.     Begin all text lines with the special non-spacing character \&.
68
69       This  does not produce the most efficient code, but it should work as a
70       first measure.  For better strategies, see  the  groff  info  file  and
71       groff_tmac(5).
72
73       Reading roff source files is easier, just reduce all double backslashes
74       to a single one in all macro definitions.
75

GROFF ELEMENTS

77       The roff language elements add formatting information to a  text  file.
78       The  fundamental  elements  are  predefined commands and variables that
79       make roff a full-blown programming language.
80
81       There  are  two  kinds  of  roff  commands,  possibly  with  arguments.
82       Requests  are written on a line of their own starting with a dot ‘.’ or
83       a “'”, whereas Escape sequences are in-line functions and in-word  for‐
84       matting elements starting with a backslash ‘\’.
85
86       The  user  can define her own formatting commands using the de request.
87       These commands are called  macros,  but  they  are  used  exactly  like
88       requests.  Macro packages are pre-defined sets of macros written in the
89       groff language.  A user's possibilities to create escape sequences her‐
90       self is very limited, only special characters can be mapped.
91
92       The  groff  language provides several kinds of variables with different
93       interfaces.  There are pre-defined variables, but the user  can  define
94       her own variables as well.
95
96       String  variables  store character sequences.  They are set with the ds
97       request and retrieved by the \* escape  sequences.   Strings  can  have
98       variables.
99
100       Register  variables  can  store  numerical values, numbers with a scale
101       unit, and occasionally string-like objects.  They are set with  the  nr
102       request and retrieved by the \n escape sequences.
103
104       Environments  allow  the  user  to  temporarily store global formatting
105       parameters like line length, font size, etc. for later reuse.  This  is
106       done by the ev request.
107
108       Fonts  are  identified  either by a name or by an internal number.  The
109       current font is chosen by the ft request or by the \f escape sequences.
110       Each  device  has  special fonts, but the following fonts are available
111       for all devices.  R is the standard font Roman.  B is its bold counter‐
112       part.   The italic font is called I and is available everywhere, but on
113       text devices it is displayed as an  underlined  Roman  font.   For  the
114       graphical  output devices, there exist constant-width pendants of these
115       fonts, CR, CI, and CB.  On text devices, all characters have a constant
116       width anyway.
117
118       Moreover,  there  are  some advanced roff elements.  A diversion stores
119       information into a macro for later usage.  A trap is a positional  con‐
120       dition  like  a certain number of lines from page top or in a diversion
121       or in the input.  Some action can be prescribed to be run automatically
122       when the condition is met.
123
124       More  detailed  information and examples can be found in the groff info
125       file.
126

CONTROL CHARACTERS

128       There is a small set of characters that have a special controlling task
129       in certain conditions.
130
131       .      A  dot  is  only special at the beginning of a line or after the
132              condition in the requests if, ie, el, and while.   There  it  is
133              the control character that introduces a request (or macro).  The
134              special behavior can be delayed by using  the  \.   escape.   By
135              using the cc request, the control character can be set to a dif‐
136              ferent character, making the dot ‘.’ a non-special character.
137
138              In all other positions, it just means a dot character.  In  text
139              paragraphs,  it is advantageous to start each sentence at a line
140              of its own.
141
142       '      The single quote has two controlling tasks.  At the beginning of
143              a  line  and  in the conditional requests it is the non-breaking
144              control character.  That means that it introduces a request like
145              the  dot,  but  with  the  additional property that this request
146              doesn't cause a linebreak.  By using the c2  request,  the  non-
147              break control character can be set to a different character.
148
149              As  a second task, it is the most commonly used argument separa‐
150              tor in some functional escape sequences (but any pair of charac‐
151              ters  not  part  of the argument will work).  In all other posi‐
152              tions, it denotes the  single  quote  or  apostrophe  character.
153              Groff  provides  a printable representation with the \(cq escape
154              sequence.
155
156       "      The double quote is  used  to  enclose  arguments  in  requests,
157              macros,  and strings.  In the ds and as requests, a leading dou‐
158              ble quote in the argument will be stripped  off,  making  every‐
159              thing else afterwards the string to be defined (enabling leading
160              whitespace).  The escaped double quote \" introduces a  comment.
161              Otherwise, it is not special.  Groff provides a printable repre‐
162              sentation with the \(dq escape sequence.
163
164       \      The backslash usually introduces an escape sequence (this can be
165              changed  with  the ec request).  A printed version of the escape
166              character is the \e escape; a backslash glyph can be obtained by
167              \(rs.
168
169       (      The  open  parenthesis  is only special in escape sequences when
170              introducing an escape name or argument consisting of exactly two
171              characters.   In  groff, this behavior can be replaced by the []
172              construct.
173
174       [      The opening bracket is only special in groff  escape  sequences;
175              there  it is used to introduce a long escape name or long escape
176              argument.  Otherwise, it is non-special, e.g. in macro calls.
177
178       ]      The closing bracket is only special in groff  escape  sequences;
179              there  it terminates a long escape name or long escape argument.
180              Otherwise, it is non-special.
181
182       space  Space characters are only functional characters.  They  separate
183              the arguments in requests, macros, and strings, and the words in
184              text lines.  They are subject to groff's horizontal spacing cal‐
185              culations.   To get a defined space width, escape sequences like
186\ ’ (this is the escape character followed by a space), \|, \^,
187              or \h should be used.
188
189       newline
190              In  text  paragraphs,  newlines mostly behave like space charac‐
191              ters.  Continuation lines can be specified by  an  escaped  new‐
192              line,  i.e., by specifying a backslash ‘\’ as the last character
193              of a line.
194
195       tab    If a tab character occurs during text the  interpreter  makes  a
196              horizontal  jump to the next pre-defined tab position.  There is
197              a sophisticated interface for handling tab positions.
198

NUMERICAL EXPRESSIONS

200       A numerical value is a signed or unsigned  integer  or  float  with  or
201       without  an  appended scaling indicator.  A scaling indicator is a one-
202       character abbreviation for a unit of measurement.  A number followed by
203       a scaling indicator signifies a size value.  By default, numerical val‐
204       ues do not have a scaling indicator, i.e., they are normal numbers.
205
206       The roff language defines the following scaling indicators.
207
208              c         Centimeter
209              i         Inch
210              P         Pica = 1/6 inch
211              p         Point = 1/72 inch
212              m         Em = the font size in points (width of letter `m')
213              M         100th of an Em
214              n         En = Em/2
215              u         Basic unit for actual output device
216              v         Vertical   line   space   in   basic   units    scaled
217                        point = 1/sizescale  of  a point (defined in font DESC
218                        file)
219              f         Scale by 65536.
220
221       Numerical expressions are combinations of the numerical values  defined
222       above  with  the  following  arithmetical  operators already defined in
223       classical troff.
224
225              +         Addition
226              -         Subtraction
227              *         Multiplication
228              /         Division
229              %         Modulo
230              =         Equals
231              ==        Equals
232              <         Less than
233              >         Greater than
234              <=        Less or equal
235              >=        Greater or equal
236              &         Logical and
237              :         Logical or
238              !         Logical not
239              (         Grouping of expressions
240              )         Close current grouping
241
242       Moreover, groff added the following  operators  for  numerical  expres‐
243       sions:
244
245              e1>?e2    The maximum of e1 and e2.
246              e1<?e2    The minimum of e1 and e2.
247              (c;e)     Evaluate e using c as the default scaling indicator.
248
249       For details see the groff info file.
250

CONDITIONS

252       Conditions occur in tests raised by the if, ie, and the while requests.
253       The following table characterizes the different types of conditions.
254
255              N         A numerical expression N yields true if its  value  is
256                        greater than 0.
257              !N        True if the value of I is 0.
258              's1's2'   True if string s1 is identical to string s2.
259              !'s1's2'  True if string s1 is not identical to string s2.
260              cch       True if there is a character ch available.
261              dname     True  if  there  is  a  string,  macro,  diversion, or
262                        request called name.
263              e         Current page number is even.
264              o         Current page number is odd.
265              mname     True if there is a color called name.
266              n         Formatter is nroff.
267              rreg      True if there is a register named reg.
268              t         Formatter is troff.
269

REQUESTS

271       This section provides a short reference for  the  predefined  requests.
272       In groff, request and macro names can be arbitrarily long.  No bracket‐
273       ing or marking of long names is needed.
274
275       Most requests take one or more arguments.  The arguments are  separated
276       by  space  characters  (no tabs!); there is no inherent limit for their
277       length or number.  An argument can be enclosed  by  a  pair  of  double
278       quotes.   This  is very handy if an argument contains space characters,
279       e.g., "arg with space" denotes a single argument.
280
281       Some requests have optional arguments with a different behaviour.   Not
282       all  of  these details are outlined here.  Refer to the groff info file
283       and groff_diff(7) for all details.
284
285       In the following request specifications, most argument names were  cho‐
286       sen  to be descriptive.  Only the following denotations need clarifica‐
287       tion.
288
289              c         denotes a single character.
290              font      a font either specified as a font name or a font  num‐
291                        ber.
292              anything  all  characters up to the end of the line or within \{
293                        and \}.
294              n         is a numerical expression that evaluates to an integer
295                        value.
296              N         is   an  arbitrary  numerical  expression,  signed  or
297                        unsigned.
298              ±N        has three meanings depending on  its  sign,  described
299                        below.
300
301       If  an  expression  defined  as ±N starts with a ‘+’ sign the resulting
302       value of the expression will be added  to  an  already  existing  value
303       inherent  to the related request, e.g. adding to a number register.  If
304       the expression starts with a ‘-’ the value of the  expression  will  be
305       subtracted from the request value.
306
307       Without  a  sign,  N replaces the existing value directly.  To assign a
308       negative number either prepend 0 or  enclose  the  negative  number  in
309       parentheses.
310
311   Request Short Reference
312       .         Empty line, ignored.  Useful for structuring documents.
313       .\" anything
314                 Complete line is a comment.
315       .ab string
316                 Print string on standard error, exit program.
317       .ad       Begin  line  adjustment  for  output  lines in current adjust
318                 mode.
319       .ad c     Start line adjustment in mode c (c=l,r,b,n).
320       .af register c
321                 Assign format c to register (c=l,i,I,a,A).
322       .aln alias register
323                 Create alias name for register.
324       .als alias object
325                 Create alias name for request, string,  macro,  or  diversion
326                 object.
327       .am macro Append to macro until .. is encountered.
328       .am macro end
329                 Append to macro until .end is called.
330       .ami macro
331                 Append  to a macro whose name is contained in the string reg‐
332                 ister macro until .. is encountered.
333       .ami macro end
334                 Append to a macro indirectly.  macro and end are string  reg‐
335                 isters whose contents are interpolated for the macro name and
336                 the end macro, respectively.
337       .am1 macro
338                 Same as .am but with compatibility mode switched  off  during
339                 macro expansion.
340       .am1 macro end
341                 Same  as  .am but with compatibility mode switched off during
342                 macro expansion.
343       .as stringvar anything
344                 Append anything to stringvar.
345       .asciify diversion
346                 Unformat ASCII characters, spaces, and some escape  sequences
347                 in diversion.
348       .as1 stringvar anything
349                 Same  as  .as but with compatibility mode switched off during
350                 string expansion.
351       .backtrace
352                 Print a backtrace of the input on stderr.
353       .bd font N
354                 Embolden font by N-1 units.
355       .bd S font N
356                 Embolden Special Font S when current font is font.
357       .blm      Unset the blank line macro.
358       .blm macro
359                 Set the blank line macro to macro.
360       .box      End current diversion.
361       .box macro
362                 Divert to macro, omitting a partially filled line.
363       .boxa     End current diversion.
364       .boxa macro
365                 Divert and append to macro, omitting a partially filled line.
366       .bp       Eject current page and begin new page.
367       .bp ±N    Eject current page; next page number ±N.
368       .br       Line break.
369       .brp      Break and spread output line.  Same as \p.
370       .break    Break out of a while loop.
371       .c2       Reset no-break control character to “'”.
372       .c2 c     Set no-break control character to c.
373       .cc       Reset control character to ‘.’.
374       .cc c     Set control character to c.
375       .ce       Center the next input line.
376       .ce N     Center following N input lines.
377       .cf filename
378                 Copy contents of file filename unprocessed to  stdout  or  to
379                 the diversion.
380       .cflags mode c1 c2 ...
381                 Treat characters c1, c2, ... according to mode number.
382       .ch trap N
383                 Change trap location to N .
384       .char c anything
385                 Define character c as string anything.
386       .chop object
387                 Chop  the  last  character  off  macro,  string, or diversion
388                 object.
389       .close stream
390                 Close the stream.
391       .color    Enable colors.
392       .color N  If N is zero disable colors, otherwise enable them.
393       .continue Finish the current iteration of a while loop.
394       .cp       Enable compatibility mode.
395       .cp N     If N is zero disable compatibility mode, otherwise enable it.
396       .cs font N M
397                 Set constant character width mode for font to N/36  ems  with
398                 em M.
399       .cu N     Continuous underline in nroff, like .ul in troff.
400       .da       End current diversion.
401       .da macro Divert and append to macro.
402       .de macro Define or redefine macro until .. is encountered.
403       .de macro end
404                 Define or redefine macro until .end is called.
405       .de1 macro
406                 Same  as  .de but with compatibility mode switched off during
407                 macro expansion.
408       .de1 macro end
409                 Same as .de but with compatibility mode switched  off  during
410                 macro expansion.
411       .defcolor color scheme component
412                 Define  or  redefine  a color with name color.  scheme can be
413                 rgb, cym, cymk, gray, or grey.  component can be single  com‐
414                 ponents  specified  as fractions in the range 0 to 1 (default
415                 scaling indicator f), as a string  of  two-digit  hexadecimal
416                 color  components  with  a leading #, or as a string of four-
417                 digit hexadecimal components with two leading #.   The  color
418                 default can't be redefined.
419       .dei macro
420                 Define  or  redefine  a  macro whose name is contained in the
421                 string register macro until .. is encountered.
422       .dei macro end
423                 Define or redefine a macro indirectly.   macro  and  end  are
424                 string  registers  whose  contents  are  interpolated for the
425                 macro name and the end macro, respectively.
426       .di       End current diversion.
427       .di macro Divert to macro .
428       .do name  Interpret .name with compatibility mode disabled.
429       .ds stringvar anything
430                 Set stringvar to anything.
431       .ds1 stringvar anything
432                 Same as .ds but with compatibility mode switched  off  during
433                 string expansion.
434       .dt N trap
435                 Set  diversion  trap  to  position N (default scaling indica‐
436                 tor v).
437       .ec       Reset escape character to ‘\’.
438       .ec c     Set escape character to c.
439       .ecr      Restore escape character saved with .ecs.
440       .ecs      Save current escape character.
441       .el anything
442                 Else part for if-else (ie) request.
443       .em macro The macro will be run after the end of input.
444       .eo       Turn off escape character mechanism.
445       .ev       Switch to previous environment.
446       .ev env   Push down environment number or name env and switch to it.
447       .evc env  Copy the contents of environment env to the current  environ‐
448                 ment.  No pushing or popping.
449       .ex       Exit from roff processing.
450       .fam      Return to previous font family.
451       .fam name Set the current font family to name.
452       .fc       Disable field mechanism.
453       .fc a     Set field delimiter to a and pad character to space.
454       .fc a b   Set field delimiter to a and pad character to b.
455       .fchar c anything
456                 Define fallback character c as string anything.
457       .fi       Fill output lines.
458       .fl       Flush output buffer.
459       .fp n font
460                 Mount font on position n.
461       .fp n internal external
462                 Mount  font with long external name to short internal name on
463                 position n.
464       .fspecial font s1 s2 ...
465                 When the current font is font, then the  fonts  s1,  s2,  ...
466                 will be special.
467       .ft       Return to previous font.  Same as \f[] or \fP.
468       .ft font  Change  to  font name or number font; same as \f[font] escape
469                 sequence.
470       .ftr font1 font2
471                 Translate font1 to font2.
472       .hc       Remove additional hyphenation indicator character.
473       .hc c     Set up additional hyphenation indicator character c.
474       .hcode c1 code1 c2 code2 ...
475                 Set the hyphenation code of character c1 to code1, that of c2
476                 to code2, etc.
477       .hla lang Set the current hyphenation language to lang.
478       .hlm n    Set the maximum number of consecutive hyphenated lines to n.
479       .hpf file Read hyphenation patterns from file.
480       .hpfa file
481                 Append hyphenation patterns from file.
482       .hpfcode file
483                 Set input mapping for .hpf.
484       .hw words List of words with exceptional hyphenation.
485       .hy N     Switch to hyphenation mode N.
486       .hym n    Set  the  hyphenation  margin  to  n (default scaling indica‐
487                 tor m).
488       .hys n    Set the hyphenation space to n.
489       .ie cond anything
490                 If cond then anything else goto .el.
491       .if cond anything
492                 If cond then anything; otherwise do nothing.
493       .ig       Ignore text until .. is encountered.
494       .ig end   Ignore text until .end.
495       .in       Change to previous indent value.
496       .in ±N    Change indent according to ±N (default scaling indicator m).
497       .it N trap
498                 Set an input-line count trap for the next N lines.
499       .itc N trap
500                 Same as .it but count lines interrupted with \c as one line.
501       .kern     Enable pairwise kerning.
502       .kern n   If n is zero, disable pairwise kerning, otherwise enable it.
503       .lc       Remove leader repetition character.
504       .lc c     Set leader repetition character to c.
505       .length register anything
506                 Write the length of the string anything in register.
507       .linetabs Enable line-tabs mode (i.e., calculate tab positions relative
508                 to output line).
509       .linetabs n
510                 If n is zero, disable line-tabs mode, otherwise enable it.
511       .lf N file
512                 Set input line number to N and filename to file.
513       .lg N     Ligature mode on if N>0.
514       .ll       Change to previous line length.
515       .ll ±N    Set  line  length according to ±N (default size 6.5i, default
516                 scaling indicator m).
517       .ls       Change to the previous value of additional intra-line skip.
518       .ls N     Set additional intra-line skip value to N,  i.e.,  N-1  blank
519                 lines are inserted after each text output line.
520       .lt ±N    Length of title (default scaling indicator m).
521       .mc       Margin character off.
522       .mc c     Print  character  c  after  each text line at actual distance
523                 from right margin.
524       .mc c N   Set margin character to c and distance to N from right margin
525                 (default scaling indicator m).
526       .mk register
527                 Mark current vertical position in register.
528       .mso file The  same  as the .so request except that file is searched in
529                 the tmac directories.
530       .na       No output-line adjusting.
531       .ne       Need a one-line vertical space.
532       .ne N     Need N vertical space (default scaling indicator v).
533       .nf       No filling or adjusting of output-lines.
534       .nh       No hyphenation.
535       .nm       Number mode off.
536       .nm ±N [M [S [I]]]
537                 In line number  mode,  set  number,  multiple,  spacing,  and
538                 indent.
539       .nn       Do not number next line.
540       .nn N     Do not number next N lines.
541       .nop anything
542                 Always execute anything.
543       .nr register ±N M
544                 Define or modify register using ±N with auto-increment M.
545       .nroff    Make the built-in condition n true and t false.
546       .ns       Turn no-space mode on.
547       .nx       Immediately jump to end of current file.
548       .nx filename
549                 Next file.
550       .open stream filename
551                 Open  register  filename for writing and associate the stream
552                 named register stream with it.
553       .opena stream filename
554                 Like .open but append to it.
555       .os       Output vertical distance that was saved by the sv request.
556       .output string
557                 Emit string directly to intermediate output, allowing leading
558                 whitespace  if  string  starts with " (which will be stripped
559                 off).
560       .pc       Reset page number character to ‘%’.
561       .pc c     Page number character.
562       .pi program
563                 Pipe output to program (nroff only).
564       .pl       Set page length to default 11i.  The current page  length  is
565                 stored in register .p.
566       .pl ±N    Change page length to ±N (default scaling indicator v).
567       .pm       Print macro names and sizes (number of blocks of 128 bytes).
568       .pm t     Print  only  total  of  sizes  of macros (number of 128 bytes
569                 blocks).
570       .pn ±N    Next page number N.
571       .pnr      Print the names and contents of all currently defined  number
572                 registers on stderr.
573       .po       Change  to  previous page offset.  The current page offset is
574                 available in register .o.
575       .po ±N    Page offset N.
576       .ps       Return to previous point-size.
577       .ps ±N    Point size; same as \s[±N].
578       .psbb filename
579                 Get the bounding box of a PostScript image filename.
580       .pso command
581                 This behaves like the so request except that input comes from
582                 the standard output of command.
583       .ptr      Print  the  names  and  positions of all traps (not including
584                 input line traps and diversion traps) on stderr.
585       .pvs      Change to previous post-vertical line spacing.
586       .pvs ±N   Change post-vertical line spacing according  to  ±N  (default
587                 scaling indicator p).
588       .rchar c1 c2 ...
589                 Remove the definitions of characters c1, c2, ...
590       .rd prompt
591                 Read insertion.
592       .return   Return from a macro.
593       .rj n     Right justify the next n input lines.
594       .rm name  Remove request, macro, or string name.
595       .rn old new
596                 Rename request, macro, or string old to new.
597       .rnn reg1 reg2
598                 Rename register reg1 to reg2.
599       .rr register
600                 Remove register.
601       .rs       Restore spacing; turn no-space mode off.
602       .rt ±N    Return  (upward only) to marked vertical place (default scal‐
603                 ing indicator v).
604       .shc      Reset soft hyphen character to \(hy.
605       .shc c    Set the soft hyphen character to c.
606       .shift n  In a macro, shift the arguments by n positions.
607       .sizes s1 s2 ... sn [0]
608                 Set available font sizes similar to the sizes  command  in  a
609                 DESC file.
610       .so filename
611                 Include source file.
612       .sp       Skip one line vertically.
613       .sp N     Space  vertical  distance N up or down according to sign of N
614                 (default scaling indicator v).
615       .special s1 s2 ...
616                 Fonts s1, s2, etc. are special and will be searched for char‐
617                 acters not in the current font.
618       .spreadwarn
619                 Toggle  the  spread  warning  on and off without changing its
620                 value.
621       .spreadwarn limit
622                 Emit a warning if each space in an output line is widened  by
623                 limit or more (default scaling indicator m).
624       .ss N     Space-character  size  set  to  N/12 of the spacewidth in the
625                 current font.
626       .ss N M   Space-character size set to N/12 and sentence space size  set
627                 to M/12 of the spacewidth in the current font (=1/3 em).
628       .sty n style
629                 Associate style with font position n.
630       .substring xx n1 n2
631                 Replace the string named xx with the substring defined by the
632                 indices n1 and n2.
633       .sv       Save 1v of vertical space.
634       .sv N     Save the  vertical  distance  N  for  later  output  with  os
635                 request.
636       .sy command-line
637                 Execute program command-line.
638       .ta T N   Set  tabs  after  every  position  that  is  a  multiple of N
639                 (default scaling indicator m).
640       .ta n1 n2 ... nn T r1 r2 ... rn
641                 Set tabs at positions n1, n2,  ...,  nn,  then  set  tabs  at
642                 nn+r1,  nn+r2,  ...,  nn+rn, then at nn+rn+r1, nn+rn+r2, ...,
643                 nn+rn+rn, and so on.
644       .tc       Remove tab repition character.
645       .tc c     Set tab repetition character to c.
646       .ti ±N    Temporary indent next line (default scaling indicator m).
647       .tkf font s1 n1 s2 n2
648                 Enable track kerning for font.
649       .tl ’leftcenterright
650                 Three-part title.
651       .tm anything
652                 Print anything on terminal (UNIX standard message output).
653       .tm1 anything
654                 Print anything on terminal (UNIX  standard  message  output),
655                 allowing  leading whitespace if anything starts with " (which
656                 will be stripped off).
657       .tmc anything
658                 Similar to .tm1 without emitting a final newline.
659       .tr abcd...
660                 Translate a to b, c to d, etc. on output.
661       .trf filename
662                 Transparently output the contents of file filename.
663       .trin abcd...
664                 This is the same as the tr request except  that  the  asciify
665                 request will use the character code (if any) before the char‐
666                 acter translation.
667       .trnt abcd...
668                 This is the same as the tr request except that  the  transla‐
669                 tions  do  not apply to text that is transparently throughput
670                 into a diversion with \!.
671       .troff    Make the built-in condition t true and n false.
672       .uf font  Underline font set to font (to be switched to by .ul).
673       .ul N     Underline (italicize in troff) N input lines.
674       .unformat diversion
675                 Unformat space characters and tabs, preserving font  informa‐
676                 tion in diversion.
677       .vpt n    Enable vertical position traps if n is non-zero, disable them
678                 otherwise.
679       .vs       Change to previous vertical base line spacing.
680       .vs ±N    Set vertical base line spacing according to ±N (default scal‐
681                 ing indicator p).  Default value is 12p.
682       .warn n   Set warnings code to n.
683       .warnscale si
684                 Set scaling indicator used in warnings to si.
685       .wh N     Remove (first) trap at position N.
686       .wh N trap
687                 Set location trap; negative means from page bottom.
688       .while cond anything
689                 While condition cond is true, accept anything as input.
690       .write stream anything
691                 Write anything to the stream named stream.
692       .writec stream anything
693                 Similar to .write without emitting a final newline.
694       .writem stream xx
695                 Write  contents  of  macro  or  string xx to the stream named
696                 stream.
697
698       Besides these standard groff requests, there  might  be  further  macro
699       calls.   They  can  originate  from a macro package (see roff(7) for an
700       overview) or from a preprocessor.
701
702       Preprocessor macros are easy to be recognized.  They enclose their code
703       into a pair of characteristic macros.
704
705                      ┌─────────────┬─────────────┬────────────┐
706                      │preprocessor │ start macro │  end macro │
707                      ├─────────────┼─────────────┼────────────┤
708eqn      .PS     .PE     
709grap     .G1     .G2     
710grn      .GS     .GE     
711pic      .PS     .PE     
712refer     .R1     .R2     
713soelim    nonenone
714tbl      .TS     .TE     
715                      └─────────────┴─────────────┴────────────┘

ESCAPE SEQUENCES

717       Escape  sequences are in-line language elements usually introduced by a
718       backslash ‘\’ and followed  by  an  escape  name  and  sometimes  by  a
719       required  argument.   Input  processing is continued directly after the
720       escaped character or the argument resp. without an intervening  separa‐
721       tion  character.   So  there  must be a way to determine the end of the
722       escape name and the end of the argument.
723
724       This is done by enclosing names (escape name and  arguments  consisting
725       of a variable name) by a pair of brackets [name] and constant arguments
726       (number expressions and characters) by apostrophes  (ASCII  0x27)  like
727       constant.
728
729       There  are  abbreviations  for short names.  Two character escape names
730       can be specified by an opening parenthesis like \(xy without a  closing
731       counterpart.   And  all  one-character names different from the special
732       characters ‘[’ and ‘(’ can even be specified without a  marker  in  the
733       form \c.
734
735       Constant  arguments  of  length 1 can omit the marker apostrophes, too,
736       but there is no two-character analogue.
737
738       While 1-character escape sequences are mainly used  for  in-line  func‐
739       tions  and  system  related  tasks, the 2-letter names following the \(
740       construct are used for special characters predefined by the  roff  sys‐
741       tem.   Escapes sequences with names of more than two characters \[name]
742       denote user defined named characters (see the char request).
743
744   Single Character Escapes
745       \"     Beginning of a comment.  Everything up to the end of the line is
746              ignored.
747       \#     Everything  up  to  and  including  the next newline is ignored.
748              This is interpreted in copy mode.  This is like \"  except  that
749              the terminating newline is ignored as well.
750       \*s    The  string  stored in the string variable with 1-character name
751              s.
752       \*(st  The string stored in the string variable with  2-character  name
753              st.
754       \*[stringvar arg1 arg2 ...]
755              The  string  stored in the string variable with arbitrary length
756              name stringvar, taking arg1, arg2, ... as arguments.
757       \$0    The name by which  the  current  macro  was  invoked.   The  als
758              request can make a macro have more than one name.
759       \$x    Macro  or  string  argument  with 1-place number x, where x is a
760              digit between 1 and 9.
761       \$(xy  Macro or string argument with 2-digit number xy.
762       \$[nexp]
763              Macro or string argument with  number  nexp,  where  nexp  is  a
764              numerical expression evaluating to an integer ≥1.
765       \$*    In  a  macro  or  string, the concatenation of all the arguments
766              separated by spaces.
767       \$@    In a macro or string, the concatenation  of  all  the  arguments
768              with each surrounded by double quotes, and separated by spaces.
769       \\     reduces  to  a single backslash; useful to delay its interpreta‐
770              tion as escape character in copy mode.  For  a  printable  back‐
771              slash,  use \e, or even better \[rs], to be independent from the
772              current escape character.
773       \’     The acute accent ´; same as \(aa.  Unescaped: apostrophe,  right
774              quotation mark, single quote (ASCII 0x27).
775       \`     The  grave accent `; same as \(ga.  Unescaped: left quote, back‐
776              quote (ASCII 0x60).
777       \-     The - sign in the current font.
778       \.     An uninterpreted dot (period), even at start of line.
779       \%     Default optional hyphenation character.
780       \!     Transparent line indicator.
781       \?anything?
782              In a diversion, this will transparently embed  anything  in  the
783              diversion.   anything is read in copy mode.  See also the escape
784              sequences \!  and \?.
785       \space Unpaddable space-size space character (no line break).
786       \0     Digit width.
787       \|     1/6 em narrow space character; zero width in nroff.
788       \^     1/12 em half-narrow space character; zero width in nroff.
789       \&     Non-printable, zero width character.
790       \)     Like \& except that it behaves like a  character  declared  with
791              the  cflags request to be transparent for the purposes of end of
792              sentence recognition.
793       \/     Increases the width of the preceding character so that the spac‐
794              ing  between  that character and the following character will be
795              correct if the following character is a roman character.
796       \,     Modifies the spacing of the  following  character  so  that  the
797              spacing  between that character and the preceding character will
798              correct if the preceding character is a roman character.
799       \~     Unbreakable space that stretches like a normal inter-word  space
800              when a line is adjusted.
801       \:     Inserts  a  zero-width  break point (similar to \% but without a
802              soft hyphen character).
803       \newline
804              Ignored newline, for continuation lines.
805       \{     Begin conditional input.
806       \}     End conditional input.
807       \(sc   The special character with 2-character name sc, see section Spe‐
808              cial Characters.
809       \[name]
810              The named character with arbitrary length name name.
811       \a     Non-interpreted leader character.
812       \A’anything
813              If  anything  is acceptable as a name of a string, macro, diver‐
814              sion, register, environment or font it expands to 1,  and  to  0
815              otherwise.
816       \b’abc...
817              Bracket building function.
818       \B’anything
819              If  anything  is  acceptable  as  a  valid numeric expression it
820              expands to 1, and to 0 otherwise.
821       \c     Interrupt text processing.
822       \C’char
823              The character called char; same as \[char],  but  compatible  to
824              other roff versions.
825       \d     Forward (down) 1/2 em vertical unit (1/2 line in nroff).
826       \D’charseq
827              Draw  a  graphical element defined by the characters in charseq;
828              see groff info file for details.
829       \e     Printable version of the current escape character.
830       \E     Equivalent to an escape character, but  is  not  interpreted  in
831              copy-mode.
832       \fF    Change to font with 1-character name or 1-digit number F.
833       \fP    Switch back to previous font.
834       \f(fo  Change to font with 2-character name or 2-digit number fo.
835       \f[font]
836              Change  to  font with arbitrary length name or number expression
837              font.
838       \f[]   Switch back to previous font.
839       \Ff    Change to font family with 1-character name f.
840       \F(fm  Change to font family with 2-character name fm.
841       \F[fam]
842              Change to font family with arbitrary length name fam.
843       \F[]   Switch back to previous font family.
844       \g[reg]
845              Return format of  register  with  name  reg  suitable  for  .af.
846              Alternative forms \g(xy and \gx.
847       \h’NLocal horizontal motion; move right N (left if negative).
848       \H’NSet height of current font to N.
849       \k[reg]
850              Mark  horizontal  input  place in register with arbitrary length
851              name reg.  Alternative forms \k(xy and \kx.
852       \l’NcHorizontal line drawing function (optionally using character c).
853       \L’NcVertical line drawing function (optionally using character c).
854       \m[color]
855              Change to color color.  Alternative forms \m(co and \mc.
856       \m[]   Switch back to previous color.
857       \M[color]
858              Change filling color for closed drawn objects  to  color  color.
859              Alternative forms \M(co and \Mc.
860       \M[]   Switch to previous fill color.
861       \nr    The  numerical  value  stored  in the register variable with the
862              1-character name r.
863       \n(re  The numerical value stored in the  register  variable  with  the
864              2-character name re.
865       \n[reg]
866              The  numerical  value stored in the register variable with arbi‐
867              trary length name reg.
868       \N’nTypeset the character with code n in the current font,  no  spe‐
869              cial fonts are searched.  Useful for adding characters to a font
870              using the char request.
871       \o’abc...
872              Overstrike characters a, b, c, etc.
873       \O0    Disable glyph output.  Mainly for internal use.
874       \O1    Enable glyph output.  Mainly for internal use.
875       \p     Break and spread output line.
876       \r     Reverse 1 em vertical motion (reverse line in nroff).
877       \R’name ±n
878              The same as .nr name ±n.
879       \s[±N] Set the point size to N scaled  points.   Note  the  alternative
880              forms  \s±[N], \s'±N', \s±'N', \s(±xy, \s±(xy, \s±x.  Same as ps
881              request.
882       \S’NSlant output N degrees.
883       \t     Non-interpreted horizontal tab.
884       \u     Reverse (up) 1/2 em vertical motion (1/2 line in nroff).
885       \v’NLocal vertical motion; move down N (up if negative).
886       \V[env]
887              The contents of the environment variable env.  Alternative forms
888              \V(xy and \Vx.
889       \w’string
890              The width of the character sequence string.
891       \x’NExtra line-space function (negative before, positive after).
892       \X’string
893              Output string as device control function.
894       \Y[name]
895              Output  string  variable  or  macro name uninterpreted as device
896              control function.  Alternative forms \Y(xy and \Yx.
897       \zc    Print c with zero width (without spacing).
898       \Z’anything
899              Print anything and then  restore  the  horizontal  and  vertical
900              position; anything may not contain tabs or leaders.
901
902       The  escape  sequences \e, \., \", \$, \*, \a, \n, \t, \g, and \newline
903       are interpreted in copy mode.
904
905       Escape sequences starting with \( or \[ do not represent single charac‐
906       ter escape sequences, but introduce escape names with two or more char‐
907       acters.
908
909       If a backslash is followed by a character that does  not  constitute  a
910       defined escape sequence the backslash is silently ignored and the char‐
911       acter maps to itself.
912
913   Special Characters
914       Common special characters are predefined by  escape  sequences  of  the
915       form  \(xy  with  characters x and y.  Some of these exist in the usual
916       font while most of them are only available in the special font.   Below
917       you'll  find  a selection of the most important glyphs; a complete list
918       can be found in groff_char(7).
919
920              \(bu   Bullet sign
921              \(co   Copyright
922              \(ct   Cent
923              \(dd   Double dagger
924              \(de   Degree
925              \(dg   Dagger
926              \(rs   Printable double quote
927              \(em   Em-dash
928              \(hy   Hyphen
929              \(rg   Registered sign
930              \(rs   Printable backslash character
931              \(sc   Section sign
932              \(ul   Underline character
933              \(==   Identical
934              \(>=   Larger or equal
935              \(<=   Less or equal
936              \(!=   Not equal
937              \(->   Right arrow
938              \(<-   Left arrow
939              \(+-   Plus-minus sign
940
941   Strings
942       Strings are defined by the ds request and can be retrieved  by  the  \*
943       escape sequence.
944
945       Strings  share  their  name  space  with macros.  So strings and macros
946       without arguments are roughly equivalent; it  is  possible  to  call  a
947       string  like  a  macro  and  vice-versa, but this often leads to unpre‐
948       dictable results.  The following strings are predefined in groff.
949
950       \*[.T]    The name of the current output device as specified by the  -T
951                 command line option.
952

REGISTERS

954       Registers  are  variables that store a value.  In groff, most registers
955       store numerical values (see section NUMERICAL EXPRESSIONS  above),  but
956       some can also hold a string value.
957
958       Each  register is given a name.  Arbitrary registers can be defined and
959       set with the request nr register.
960
961       The value stored in a register can be retrieved by the escape sequences
962       introduced by \n.
963
964       Most  useful  are  predefined registers.  In the following the notation
965       name is used to refer to a register called register name to make  clear
966       that we speak about registers.  Please keep in mind that the \n[] deco‐
967       ration is not part of the register name.
968
969   Read-only Registers
970       The following registers have predefined values that should not be modi‐
971       fied  by the user (usually, registers starting with a dot a read-only).
972       Mostly, they provide information  on  the  current  settings  or  store
973       results from request calls.
974
975       \n[.$]    Number of arguments in the current macro or string.
976       \n[.a]    Post-line  extra  line-space  most  recently  utilized  using
977                 \x’N.
978       \n[.A]    Set to 1 in troff if option -A is used; always 1 in nroff.
979       \n[.c]    Current input line number.
980       \n[.C]    1 if compatibility mode is in effect, 0 otherwise.
981       \n[.cdp]  The depth of the last character added to the current environ‐
982                 ment.   It  is  positive  if  the character extends below the
983                 baseline.
984       \n[.ce]   The number of lines remaining to be centered, as set  by  the
985                 ce request.
986       \n[.cht]  The  height  of the last character added to the current envi‐
987                 ronment.  It is positive if the character extends  above  the
988                 baseline.
989       \n[.color]
990                 1 if colors are enabled, 0 otherwise.
991       \n[.csk]  The  skew of the last character added to the current environ‐
992                 ment.  The skew of a character is how far to the right of the
993                 center of a character the center of an accent over that char‐
994                 acter should be placed.
995       \n[.d]    Current vertical place in current diversion; equal to  regis‐
996                 ter register nl.
997       \n[.ev]   The  name  or  number of the current environment (string-val‐
998                 ued).
999       \n[.f]    Current font number.
1000       \n[.fam]  The current font family (string-valued).
1001       \n[.fn]   The current (internal) real font name (string-valued).
1002       \n[.fp]   The number of the next free font position.
1003       \n[.g]    Always 1 in GNU troff.  Macros should use it to test if  run‐
1004                 ning under groff.
1005       \n[.h]    Text base-line high-water mark on current page or diversion.
1006       \n[.H]    Available horizontal resolution in basic units.
1007       \n[.hla]  The current hyphenation language as set by the .hla request.
1008       \n[.hlc]  The  number  of  immediately preceding consecutive hyphenated
1009                 lines.
1010       \n[.hlm]  The maximum allowed number of consecutive  hyphenated  lines,
1011                 as set by the hlm request.
1012       \n[.hy]   The current hyphenation flags (as set by the hy request).
1013       \n[.hym]  The current hyphenation margin (as set by the hym request).
1014       \n[.hys]  The current hyphenation space (as set by the hys request).
1015       \n[.i]    Current ident.
1016       \n[.in]   The indent that applies to the current output line.
1017       \n[.int]  Positive if last output line contains \c.
1018       \n[.kern] 1 if pairwise kerning is enabled, 0 otherwise.
1019       \n[.l]    Current line length.
1020       \n[.lg]   The current ligature mode (as set by the lg request).
1021       \n[.linetabs]
1022                 The current line-tabs mode (as set by the linetabs request).
1023       \n[.ll]   The line length that applies to the current output line.
1024       \n[.lt]   The title length (as set by the lt request).
1025       \n[.n]    Length of text portion on previous output line.
1026       \n[.ne]   The  amount  of  space that was needed in the last ne request
1027                 that caused a trap to be sprung.  Useful in conjunction  with
1028                 register .trunc.
1029       \n[.ns]   1 if in no-space mode, 0 otherwise.
1030       \n[.o]    Current page offset.
1031       \n[.p]    Current page length.
1032       \n[.pn]   The  number  of  the  next page: either the value set by a pn
1033                 request, or the number of the current page plus 1.
1034       \n[.ps]   The current pointsize in scaled points.
1035       \n[.psr]  The last-requested pointsize in scaled points.
1036       \n[.pvs]  The current post-vertical line spacing.
1037       \n[.rj]   The number of lines to be right-justified as set  by  the  rj
1038                 request.
1039       \n[.s]    Current point size as a decimal fraction.
1040       \n[.sr]   The  last requested pointsize in points as a decimal fraction
1041                 (string-valued).
1042       \n[.t]    Distance to the next trap.
1043       \n[.T]    Set to 1 if option -T is used.
1044       \n[.tabs] A string representation of the current tab settings  suitable
1045                 for use as an argument to the ta request.
1046       \n[.trunc]
1047                 The  amount  of vertical space truncated by the most recently
1048                 sprung vertical position trap, or, if the trap was sprung  by
1049                 a ne request, minus the amount of vertical motion produced by
1050                 .ne.  In other words, at the point a trap is sprung, it  rep‐
1051                 resents  the  difference  of what the vertical position would
1052                 have been but for the trap, and what  the  vertical  position
1053                 actually  is.   Useful  in  conjunction with the register .ne
1054                 register.
1055       \n[.ss]   The value of the parameters set by the first argument of  the
1056                 ss request.
1057       \n[.sss]  The value of the parameters set by the second argument of the
1058                 ss request.
1059       \n[.u]    Equal to 1 bin fill mode and 0 in nofill mode.
1060       \n[.v]    Current vertical line spacing.
1061       \n[.V]    Available vertical resolution in basic units.
1062       \n[.vpt]  1  if vertical position traps are enabled, 0 otherwise.
1063       \n[.w]    Width of previous character.
1064       \n[.warn] The sum of the number codes of the  currently  enabled  warn‐
1065                 ings.
1066       \n[.x]    The major version number.
1067       \n[.y]    The minor version number.
1068       \n[.Y]    The revision number of groff.
1069       \n[.z]    Name of current diversion.
1070
1071   Writable Registers
1072       The following registers can be read and written by the user.  They have
1073       predefined default values, but these can be modified for customizing  a
1074       document.
1075
1076       \n[%]     Current page number.
1077       \n[c.]    Current input line number.
1078       \n[ct]    Character type (set by width function \w).
1079       \n[dl]    Maximal width of last completed diversion.
1080       \n[dn]    Height of last completed diversion.
1081       \n[dw]    Current day of week (1-7).
1082       \n[dy]    Current day of month (1-31).
1083       \n[hours] The number of hours past midnight.  Initialized at start-up.
1084       \n[hp]    Current horizontal position at input line.
1085       \n[llx]   Lower  left  x-coordinate  (in  PostScript  units) of a given
1086                 PostScript image (set by .psbb).
1087       \n[lly]   Lower left y-coordinate (in  PostScript  units)  of  a  given
1088                 PostScript image (set by .psbb).
1089       \n[ln]    Output line number.
1090       \n[minutes]
1091                 The  number of minutes after the hour.  Initialized at start-
1092                 up.
1093       \n[mo]    Current month (1-12).
1094       \n[nl]    Vertical position of last printed text base-line.
1095       \n[rsb]   Like register sb, but takes account of the heights and depths
1096                 of characters.
1097       \n[rst]   Like register st, but takes account of the heights and depths
1098                 of characters.
1099       \n[sb]    Depth of string below base line (generated by width  function
1100                 \w).
1101       \n[seconds]
1102                 The  number  of  seconds  after  the  minute.  Initialized at
1103                 start-up.
1104       \n[skw]   Right skip width from the center of the last character in the
1105                 \w argument.
1106       \n[slimit]
1107                 If greater than 0, the maximum number of objects on the input
1108                 stack.  If ≤0 there is no limit, i.e., recursion can continue
1109                 until virtual memory is exhausted.
1110       \n[ssc]   The  amount  of  horizontal  space  (possibly  negative) that
1111                 should be added to the  last  character  before  a  subscript
1112                 (generated by width function \w).
1113       \n[st]    Height of string above base line (generated by width function
1114                 \w).
1115       \n[systat]
1116                 The return value of the system()  function  executed  by  the
1117                 last sy request.
1118       \n[urx]   Upper  right  x-coordinate  (in  PostScript units) of a given
1119                 PostScript image (set by .psbb).
1120       \n[ury]   Upper right y-coordinate (in PostScript  units)  of  a  given
1121                 PostScript image (set by .psbb).
1122       \n[year]  The current year (year 2000 compliant).
1123       \n[yr]    Current  year  minus  1900.   For Y2K compliance use register
1124                 register year instead.
1125

COMPATIBILITY

1127       The differences of the groff language in comparison to classical  troff
1128       as defined by [CSTR #54] are documented in groff_diff(7).
1129
1130       The  groff system provides a compatibility mode, see groff(1) on how to
1131       invoke this.
1132

BUGS

1134       Report bugs to the groff bug mailing list ⟨bug-groff@gnu.org⟩.  Include
1135       a complete, self-contained example that will allow the bug to be repro‐
1136       duced, and say which version of groff you are using.
1137

AUTHORS

1139       Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
1140
1141       This document is distributed under the terms of the FDL (GNU Free Docu‐
1142       mentation  License)  version  1.1 or later.  You should have received a
1143       copy of the FDL on your system, it is also available on-line at the GNU
1144       copyleft site ⟨http://www.gnu.org/copyleft/fdl.html⟩.
1145
1146       This  document  is  part  of  groff, the GNU roff distribution.  It was
1147       written by Bernd Warken ⟨bwarken@mayn.de⟩; it is maintained  by  Werner
1148       Lemberg ⟨wl@gnu.org⟩.
1149

SEE ALSO

1151       The  main  source  of  information  for the groff language is the groff
1152       info(1) file.  Besides the gory details, it contains many examples.
1153
1154       groff(1)
1155              the usage of the groff program and pointers to the documentation
1156              and availability of the groff system.
1157
1158       groff_diff(7)
1159              the  differences  of the groff language as compared to classical
1160              roff.  This is the authoritative  document  for  the  predefined
1161              language elements that are specific to groff.
1162
1163       groff_char(7)
1164              the predefined groff characters (glyphs).
1165
1166       groff_font(5)
1167              the specification of fonts and the DESC file.
1168
1169       roff(7)
1170              the  history  of  roff, the common parts shared by all roff sys‐
1171              tems, and pointers to further documentation.
1172
1173       [CSTR #54]
1174              Nroff/Troff User's Manual by Osanna & Kernighan ⟨http://
1175              cm.bell-labs.com/cm/cs/54.ps⟩ — the bible for classical troff.
1176
1177
1178
1179Groff Version 1.18.1.4           29 June 2002                         GROFF(7)
Impressum