diff options
author | G. Branden Robinson <g.branden.robinson@gmail.com> | 2022-07-08 02:24:52 -0500 |
---|---|---|
committer | G. Branden Robinson <g.branden.robinson@gmail.com> | 2022-07-14 04:24:38 -0500 |
commit | d2ab4774f24480aaf4c0d55410e0c1e745b585f9 (patch) | |
tree | 7b66e320922497bd165d252a8010584a9332e3b8 /tmac/s.tmac | |
parent | e746dcfbd703173dbd913520e28c51b75e02d3bf (diff) | |
download | groff-git-d2ab4774f24480aaf4c0d55410e0c1e745b585f9.tar.gz |
[ms]: Add new `RP` optional arguments.
* tmac/s.tmac (RP): Recognize new optional arguments `no-renumber` and
`no-repeat-info`, the latter as a synonym for the existing `no`. The
former suppresses the page number manipulation that normally occurs.
Drop now-unnecessary `pn 0` request.
(top level, cov*first-page-init, RP, cov*print): Rename
`cov*rp-format` to `cov*use-rp-format` for clarity.
(cov*break-page): New macro breaks the cover page at the end,
resetting next page number to 1 only if desired by user.
(cov*print, cov*rp-print): Call `cov*break-page` instead of invoking
`bp`.
* doc/groff.texi (Document Description Macros) <RP>:
* doc/ms.ms (Document description macros) <RP>:
* tmac/groff_ms.7.man (Document description macros) <RP>: Document them.
* NEWS: Add item.
Prompted by formatting Kernighan & Cherry's "Typesetting Mathematics --
User's Guide (Second Edition) from the Unix V7 Programmer's Manual for
PDF, where the page numbers in a viewer's navigation sidebar are out of
sync with those formatted on the pages.
Diffstat (limited to 'tmac/s.tmac')
-rw-r--r-- | tmac/s.tmac | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/tmac/s.tmac b/tmac/s.tmac index 5a8f89f73..11f507111 100644 --- a/tmac/s.tmac +++ b/tmac/s.tmac @@ -187,7 +187,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. .par@init .als RP cov*err-not-after-first-page .@init -.ie \\n[cov*rp-format] \{\ +.ie \\n[cov*use-rp-format] \{\ . pg@cs-top . als FS cov*FS . als FE cov*FE @@ -206,14 +206,21 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. .br \\*[FS]\\ .. -.nr cov*rp-format 0 +.nr cov*use-rp-format 0 +.\" If we add more cover page formats, these behaviors and names could +.\" be generalized. .nr cov*rp-no-repeat-info 0 -.\" released paper format +.nr cov*rp-no-renumber 0 +.\" report (AT&T: "released paper") document type .de RP -.nr cov*rp-format 1 -.if \\n[.$] .if '\\$1'no' .nr cov*rp-no-repeat-info 1 +.nr cov*use-rp-format 1 +.while \\n[.$] \{\ +. if '\\$1'no' .nr cov*rp-no-repeat-info 1 +. if '\\$1'no-repeat-info' .nr cov*rp-no-repeat-info 1 +. if '\\$1'no-renumber' .nr cov*rp-no-renumber 1 +. shift +.\} .if rPO .po \\n(POu -.pn 0 .. .de TL .br @@ -365,16 +372,20 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. .de @div-end!cov*ab-div .AE .. +.de cov*break-page +.ie \\n[cov*rp-no-renumber] .bp +.el .bp 1 +.. .de cov*print .als cov*print @nop .ie d cov*tl-div \{\ -. ie \\n[cov*rp-format] .cov*rp-print +. ie \\n[cov*use-rp-format] .cov*rp-print . el .cov*draft-print .\} .el \{\ -. if \\n[cov*rp-format] \{\ +. if \\n[cov*use-rp-format] \{\ . @warning .RP format but no .TL -. bp 1 +. .cov*break-page . als FS @FS . als FE @FE . CHECK-FOOTER-AND-KEEP @@ -416,7 +427,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. .if -\\n[FM]/2+1v+\\n[cov*page-length]<\\n[nl] \ . @error cover sheet overflow .pl \\n[cov*page-length]u -.bp 1 +.cov*break-page .if !\\n[cov*rp-no-repeat-info] .cov*tl-au-print .rs .sp 1 |