gbranden pushed a commit to branch master
in repository groff.
commit 9f1a1be40bb8d3ff96f1e44e443faa4c98fbb0e4
Author: G. Branden Robinson <[email protected]>
AuthorDate: Fri Apr 3 16:27:23 2026 -0500
[doc,man]: Update/sync register format assignment.
---
doc/groff.texi.in | 77 ++++++++++++++++++++++++++++++-----------
man/groff.7.man | 101 ++++++++++++++++++++++++++++++++++++++++++++++++++++--
2 files changed, 156 insertions(+), 22 deletions(-)
diff --git a/doc/groff.texi.in b/doc/groff.texi.in
index 39571b841..7a0fd59d2 100644
--- a/doc/groff.texi.in
+++ b/doc/groff.texi.in
@@ -9278,14 +9278,22 @@ disable auto-incrementation of the register.
@cindex number format, assigning to register (@code{af})
@cindex register, assigning number format to (@code{af})
-A writable register's value can be interpolated in several number
-formats. By default, conventional Arabic numerals are used.
-Other formats see use in sectioning and outlining schemes and
-alternative page numbering arrangements.
+A writable register's value
+can be interpolated in several number formats.
+Conventional Arabic numerals are the default format;
+others see use in sectioning and outlining schemes
+and alternative page numbering arrangements.
+@need 1000
@Defreq {af, reg fmt}
-Use number format @var{fmt} when interpolating register @var{reg}.
-Valid number formats are as follows.
+Apply number format
+@var{fmt}
+when interpolating register
+@var{reg}.
+The default format for all writable registers is
+@samp{0}.
+Specifying an unrecognized format is an error.
+Valid formats are as follows.
@table @code
@item 0@r{@dots{}}
@@ -9310,29 +9318,55 @@ interpolates values 1,
@samp{01},
@samp{02},
@samp{03}.
-The default format for all writable registers is
-@samp{0}.
-Specifying an unrecognized format is an error.
@item I
@cindex Roman numerals
@cindex numerals, Roman
-Uppercase Roman numerals: 0, I, II, III, IV,@tie{}@enddots{}
+Uppercase Roman numerals:@:
+0,
+I,
+II,
+III,
+IV,@tie{}@enddots{}
@item i
-Lowercase Roman numerals: 0, i, ii, iii, iv,@tie{}@enddots{}
+Lowercase Roman numerals:@:
+0,
+i,
+ii,
+iii,
+iv,@tie{}@enddots{}
@item A
-Uppercase letters: 0, A, B, C, @dots{},@tie{}Z, AA, AB,@tie{}@enddots{}
+Uppercase letters:@:
+0,
+A,
+B,
+C,
+@dots{},@tie{}Z,
+AA,
+AB,@tie{}@enddots{}
@item a
-Lowercase letters: 0, a, b, c, @dots{},@tie{}z, aa, ab,@tie{}@enddots{}
+Lowercase letters:@:
+0,
+a,
+b,
+c,
+@dots{},@tie{}z,
+aa,
+ab,@tie{}@enddots{}
@end table
-Zero values are interpolated as @samp{0} in non-Arabic formats.
-Negative quantities are prefixed with @samp{-} irrespective of format.
-In Arabic formats, the sign supplements the field width. If @var{reg}
-doesn't exist, it is created with a zero value.
+The formatter interpolates zero values as
+@samp{0}
+and prefixes negative quantities with
+@samp{-}
+irrespective of format.
+In Arabic formats,
+the sign supplements the field width.
+Assigning a format to a nonexistent register
+creates it with a zero value.
@Example
.nr a 10
@@ -9379,11 +9413,14 @@ not Roman numeral characters from Unicode's Number
Forms block.}
@cindex read-only register, changing format
@cindex changing format, and read-only registers
-Assigning the format of a read-only register is an error. Instead, copy
-the read-only register's value to, and assign the format of, a writable
-register.
+Assigning the format of a read-only register is an error.
+Instead,
+copy the read-only register's value to,
+and assign the format of,
+a writable register.
@endDefreq
+@need 1000
@DefescList {\\g, , r, }
@DefescItem {\\g, (, rg, }
@DefescListEnd {\\g, [, reg, ]}
diff --git a/man/groff.7.man b/man/groff.7.man
index 124640fa2..759b65dfa 100644
--- a/man/groff.7.man
+++ b/man/groff.7.man
@@ -1403,9 +1403,10 @@ tests its argument for validity as a numeric expression.
.ne 2v
.P
A register interpolated as an operand in a numeric expression must have
-an Arabic format;
+an Arabic format
+(see subsection \[lq]Assigning register formats\[rq] below);
luckily,
-this is the default.\" @xref{Assigning Register Formats}.
+this is the default.
.
.
.P
@@ -7139,6 +7140,102 @@ part of the register's identifier.
.
.
.\" ====================================================================
+.SS "Assigning register formats"
+.\" ====================================================================
+.
+.\" BEGIN Keep (roughly) parallel with groff.texi node "Assigning
+.\" Register Formats".
+The
+.B af
+request applies a number format to a register.
+.
+The default format for all writable registers is
+.RB \[lq] 0 \[rq].
+.
+Specifying an unrecognized format is an error.
+.
+Valid formats are as follows.
+.
+.
+.TP
+.BR 0 \|.\|.\|.
+Arabic numerals 0,
+1,
+2,
+and so on.
+Any decimal digit is equivalent to
+.RB \[lq] 0 \[rq];
+the formatter merely counts the digits specified.
+.
+Multiple Arabic numerals in
+the format
+cause interpolations to be zero-padded on the left
+if necessary
+to at least as many digits as specified
+(interpolations never truncate a register value).
+.
+.
+.TP
+.B I
+Uppercase Roman numerals:
+0,
+I,
+II,
+III,
+IV,\~.\|.\|.
+.
+.
+.TP
+.B i
+Lowercase Roman numerals:
+0,
+i,
+ii,
+iii,
+iv,\~.\|.\|.
+.
+.
+.TP
+.B A
+Uppercase letters:
+0,
+A,
+B,
+C,
+\&.\|.\|.,\~Z,
+AA,
+AB,\~.\|.\|.
+.
+.
+.TP
+.B a
+Lowercase letters:
+0,
+a,
+b,
+c,
+\&.\|.\|.,\~z,
+aa,
+ab,\~.\|.\|.
+.
+.
+.P
+The formatter interpolates zero values as
+.RB \[lq] 0 \[rq]
+and prefixes negative quantities with
+.RB \[lq] \- \[rq]
+irrespective of format.
+.
+In Arabic formats,
+the sign supplements the field width.
+.
+Assigning a format to a nonexistent register
+creates it with a zero value.
+.\" END Keep (roughly) parallel with groff.texi node "Assigning
+.\" Register Formats".
+.
+.
+.\" ====================================================================
.SS "Read-only registers"
.\" ====================================================================
.
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit