GNU Info

Info Node: (groff)Built-in Registers

(groff)Built-in Registers


Prev: Assigning Formats Up: Registers
Enter node , (file) or (file)node

Built-in Registers
------------------

   The following lists some built-in registers which are not described
elsewhere in this manual.  Any register which begins with a `.' is
read-only.  A complete listing of all built-in registers can be found in
Note: Register Index.

`.H'
     Horizontal resolution in basic units.

`.V'
     Vertical resolution in basic units.

`dw'
     Day of the week (1-7).

`dy'
     Day of the month (1-31).

`mo'
     Current month (1-12).

`year'
     The current year.

`yr'
     The current year minus 1900.  Unfortunately, the documentation of
     UNIX Version 7's `troff' had a year 2000 bug: It incorrectly
     claimed that `yr' contains the last two digits of the year.  That
     claim has never been true of either traditional `troff' or GNU
     `troff'.  Old `troff' input that looks like this:


          '\" The following line stopped working after 1999
          This document was formatted in 19\n(yr.

     can be corrected as follows:


          This document was formatted in \n[year].

     or, to be portable to older `troff' versions, as follows:


          .nr y4 1900+\n(yr
          This document was formatted in \n(y4.

`.c'
`c.'
     The current _input_ line number.  Register `.c' is read-only,
     whereas `c.' (a `gtroff' extension) is writable also, affecting
     both `.c' and `c.'.

`ln'
     The current _output_ line number after a call to the `nm' request
     to activate line numbering.

     Note: Miscellaneous, for more information about line numbering.

`.x'
     The major version number.  For example, if the version number
     is 1.03 then `.x' contains `1'.

`.y'
     The minor version number.  For example, if the version number
     is 1.03 then `.y' contains `03'.

`.Y'
     The revision number of `groff'.

`.g'
     Always 1.  Macros should use this to determine whether they are
     running under GNU `troff'.

`.A'
     If the command line option `-a' is used to produce an ASCII
     approximation of the output, this is set to 1, zero otherwise.
     Note: Groff Options.

`.P'
     This register is set to 1 (and to 0 otherwise) if the current page
     is actually being printed, i.e., if the `-o' option is being used
     to only print selected pages.  Note: Groff Options, for more
     information.

`.T'
     If `gtroff' is called with the `-T' command line option, the
     number register `.T' is set to 1, and zero otherwise.  Note: Groff
     Options.

     Additionally, `gtroff' predefines a single read-write string
     register `.T' which contains the current output device (for
     example, `latin1' or `ps').


automatically generated by info2www version 1.2.2.9