Reference Documentation: PDF Publishing with GNU Troff
Revision | afdfa353df9931623bbacb08290bb3227327594d (tree) |
---|---|
Time | 2024-06-14 18:47:45 |
Author | Keith Marshall <keith@user...> |
Commiter | Keith Marshall |
Correct manpage page trap and end macro handling.
* tmac/anpdf.tmac (anpdf-atend): New macro; assign it...
(anpdf-reload-man): ...here, as end macro replacement for...
(an-end): ...this default groff_man(7) internal end macro.
(anpdf-reload-man): Append groff_pdfhref(7) page trap handler to...
(PT): ...this groff_man(7) page trap hook.
@@ -118,7 +118,15 @@ | ||
118 | 118 | .\" |
119 | 119 | . anpdf-pdfsync O |
120 | 120 | . als anpdf-pdfsync pdfsync |
121 | -. em anpdf-pdfsync | |
121 | +. em anpdf-atend | |
122 | +. | |
123 | +.\" We also need to install a page trap handler, to ensure that | |
124 | +.\" any links which span page breaks are correctly mapped; it is | |
125 | +.\" convenient to attach this to groff_man's existing PT handler, | |
126 | +.\" but this will be redefined every time reload-man is called, | |
127 | +.\" so we must reattach our handler every time. | |
128 | +.\" | |
129 | +. pdfhref I -PT PT | |
122 | 130 | . |
123 | 131 | .\" If TH is called again, ensure that we intercept it; (we must |
124 | 132 | .\" not allow reload-man to get immediate control, which it will |
@@ -137,6 +145,14 @@ | ||
137 | 145 | .\" |
138 | 146 | .de anpdf-pdfsync |
139 | 147 | .. |
148 | +.\" anpdf-pdfsync must be called by the active end-of-input macro; | |
149 | +.\" anpdf-atend is assigned, overriding but then encapsulating the | |
150 | +.\" default an-end macro, to achieve the required objective. | |
151 | +.\" | |
152 | +.de1 anpdf-atend | |
153 | +. anpdf-pdfsync | |
154 | +. an-end | |
155 | +.. | |
140 | 156 | . |
141 | 157 | .\" PDF Document Outlines |
142 | 158 | .\" --------------------- |