gbranden pushed a commit to branch master
in repository groff.
commit 8dc1df406c363933c906988a09cdcec76f9e0f5f
Author: Deri James <[email protected]>
AuthorDate: Sat Nov 4 18:20:08 2023 -0500
[gropdf]: Add `pdfpagenumbering` macro.
* tmac/pdf.tmac: Do it.
* src/devices/gropdf/gropdf.1.man: Document it.
---
ChangeLog | 7 +++++
src/devices/gropdf/gropdf.1.man | 58 +++++++++++++++++++++++++++++++++++++++++
tmac/pdf.tmac | 7 +++++
3 files changed, 72 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index ca0ab245c..909ce52c0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2024-01-03 Deri James <[email protected]>
+
+ [gropdf]: Add `pdfpagenumbering` macro.
+
+ * tmac/pdf.tmac: Do it.
+ * src/devices/gropdf/gropdf.1.man: Document it.
+
2024-01-03 G. Branden Robinson <[email protected]>
Increment Perl dependency from 5.6.1. gropdf requires 5.8.
diff --git a/src/devices/gropdf/gropdf.1.man b/src/devices/gropdf/gropdf.1.man
index 94de98853..0cc04d7e1 100644
--- a/src/devices/gropdf/gropdf.1.man
+++ b/src/devices/gropdf/gropdf.1.man
@@ -1386,6 +1386,64 @@ see
.MR groff_tmac @MAN5EXT@ .
.RE
.
+.TP
+.BI "\[rs]X\[aq]pdf: pagenumbering\~" "type prefix start" \[aq]
+This is used to control the page numbering shown in the pdf reader\[aq]s
+outline pane which contains your bookmarks. Normally the page numbers
+shown against the bookmark is the physical page number in the file, But
+this may not match the different page number styles within the document.
+.RS
+.LP
+In a single document there may be a cover sheet (which has no page
+number), a TOC (which uses lower case roman numbers), and the main body
+of the document (which has decimal page numbers). Use this command
+somewhere on the page where the numbering system changes, once changed
+the numbers will automatically increment until the number system changes
+again, so don\[aq]t call for every page, just when you want to change
+the numbering.
+.LP
+The parameters are:-
+.TP
+.I type
+This specifies the type of numbering to use for this page onward. It
+should be one of
+.RB \[lq] "Decimal | Roman | roman | Alpha | alpha" \[rq].
+Only the initial letter is relevant. The alphabetic number systems use
+A-Z (then AA-AZ ... ZA-ZZ).
+The
+.I type
+may also be
+.RB \[lq] . \[rq]
+which means no numbering system is chosen, but you may still provide a
+.I prefix
+to have a custom name (such as "Cover");
+.TP
+.I prefix
+Provides a string to insert before the number.
+If the document has an Appendix with page numbers in the form
+.RI A- n ,
+the
+.I prefix
+would be set to \[lq]A-\[rq] and the
+.I type
+would be
+.BR Decimal .
+.
+.
+.TP
+.I start
+Gives the start number for the incrementing page numbers in the outline
+pane. If no value is given for
+.I start
+it will default to 1, which is usually correct.
+.LP
+The convenience macro for this command is \[lq]
+.BI ".pdfpagenumbering " "type prefix start"
+\[rq] using '.' for preceding missing values, or just \[lq]
+.BR .pdfpagenumbering \[rq]
+on its own to have no page numbers shown in the outline pane.
+.RE
+.
.
.\" ====================================================================
.SS Macros
diff --git a/tmac/pdf.tmac b/tmac/pdf.tmac
index 6a2fa7bba..68d5557e0 100644
--- a/tmac/pdf.tmac
+++ b/tmac/pdf.tmac
@@ -824,6 +824,13 @@ am solely responsible for any bugs I may have introduced
into this file.
.device pdf: background \\$*
..
.
+.de pdfpagenumbering
+.\" 1=type of [D=decimal,R=Roman,r=roman,A=Uppercase,a=lowercase]
+.\" 2=prefix label
+.\" 3=start number
+.device pdf: pagenumbering \\$*
+..
+.
.cp \n[*groff_pdf_tmac_C]
.do rr *groff_pdf_tmac_C
.
_______________________________________________
Groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit