Reference Documentation: PDF Publishing with GNU Troff
修訂 | 19f3178f85992ff8dcf0f32fb55d95b700f5f82d (tree) |
---|---|
時間 | 2022-02-12 06:02:01 |
作者 | ![]() |
Commiter | Keith Marshall |
Add support for custom location keyword interpretation.
* pdfmark.tmac (pdf*href.format): Generalize keyword interpreter.
(pdf*href-K): New internal macro; it implements the interpreter for
"pdfhref K ..." macro calls; use it to map location keywords to...
(PDFHREF.FILEREF, PDFHREF.PAGEREF, PDFHREF.SECTREF): ...these; thus...
(pdf*href.format.file, pdf*href.format.page, pdf*href.format.section):
...these become redundant; delete them.
* pdfmark.ms (pdfhref K): Document it; add keeps, to avoid potential
widow lines in following paragraphs.
@@ -1389,6 +1389,13 @@ | ||
1389 | 1389 | .CW pdfhref , |
1390 | 1390 | when formatting the text in the active region of a link, |
1391 | 1391 | .XR set-format ). ( |
1392 | +.IP \*[= K] | |
1393 | +Define one or more location keywords, | |
1394 | +and associated \%format\(hystring names, | |
1395 | +which should be interpreted by the | |
1396 | +.CW pdfhref | |
1397 | +reference text formatting routine, | |
1398 | +.XR custom-format ). ( | |
1392 | 1399 | .IP \*[= Z] |
1393 | 1400 | Define the absolute position on the physical PDF output page, |
1394 | 1401 | where the \%\(lqhot\(hyspot\(rq associated with an active link is to be placed. |
@@ -1240,6 +1240,26 @@ | ||
1240 | 1240 | .ds PDFHREF.SECTREF section \\$1, |
1241 | 1241 | .ds PDFHREF.FILEREF \\$1 |
1242 | 1242 | .\" |
1243 | +.de pdf*href-K | |
1244 | +.\" ----------------------------------------------------------------- | |
1245 | +.\" Usage: | |
1246 | +.\" .pdfhref K keyword format-name [keyword format-name] ... | |
1247 | +.\" ----------------------------------------------------------------- | |
1248 | +.\" Map a format string name to an arbitrary keyword, which may be | |
1249 | +.\" interpreted by the pdf*href.format macro, (or any alternative, | |
1250 | +.\" which may have been designated by the user). | |
1251 | +.\" | |
1252 | +.while \\n(.$>1 \{\ | |
1253 | +. ds pdf*href.format.\\$1 \\$2 | |
1254 | +. shift 2 | |
1255 | +. \} | |
1256 | +.. | |
1257 | +.\" Use it, to map the standard reference mark location keywords. | |
1258 | +.\" | |
1259 | +.pdfhref K file PDFHREF.FILEREF | |
1260 | +.pdfhref K section PDFHREF.SECTREF | |
1261 | +.pdfhref K page PDFHREF.PAGEREF | |
1262 | +.\" | |
1243 | 1263 | .de pdf*href.format |
1244 | 1264 | .\" ----------------------------------------------------------------- |
1245 | 1265 | .\" Usage: (to be called ONLY by "pdfhref") |
@@ -1261,7 +1281,7 @@ | ||
1261 | 1281 | .\" |
1262 | 1282 | .ds PDFHREF.TEXT \\*[PDFHREF.PREFIX] |
1263 | 1283 | .while d\\$0.\\$1 \{\ |
1264 | -. \\$0.\\$1 "\\$2" | |
1284 | +. as PDFHREF.TEXT " \\*[\\*[\\$0.\\$1] "\\$2"]\" | |
1265 | 1285 | . shift 2 |
1266 | 1286 | . \} |
1267 | 1287 | .\" |
@@ -1281,34 +1301,6 @@ | ||
1281 | 1301 | .\" |
1282 | 1302 | .ds PDFHREF.TEXT \\*[PDFHREF.TEXT] |
1283 | 1303 | .. |
1284 | -.de pdf*href.format.file | |
1285 | -.\" ---------------------------------------------------------------------- | |
1286 | -.\" Include a file identifier in a formatted reference. | |
1287 | -.\" This is invoked ONLY by "pdf*href.format", and ONLY IF the | |
1288 | -.\" reference data includes an initial file identifier tuple. | |
1289 | -.\" ---------------------------------------------------------------------- | |
1290 | -.\" | |
1291 | -.as PDFHREF.TEXT " \\*[PDFHREF.FILEREF] | |
1292 | -.. | |
1293 | -.de pdf*href.format.page | |
1294 | -.\" ---------------------------------------------------------------------- | |
1295 | -.\" Include a page number in a formatted reference. | |
1296 | -.\" This is invoked ONLY by "pdf*href.format", and ONLY IF the | |
1297 | -.\" reference data includes an initial page number tuple. | |
1298 | -.\" ---------------------------------------------------------------------- | |
1299 | -.\" | |
1300 | -.as PDFHREF.TEXT " \\*[PDFHREF.PAGEREF] | |
1301 | -.. | |
1302 | -.de pdf*href.format.section | |
1303 | -.\" ---------------------------------------------------------------------- | |
1304 | -.\" Include a section number in a formatted reference. | |
1305 | -.\" This is invoked ONLY by "pdf*href.format", and ONLY IF the | |
1306 | -.\" reference data includes an initial section number tuple. | |
1307 | -.\" ---------------------------------------------------------------------- | |
1308 | -.\" | |
1309 | -.as PDFHREF.TEXT " \\*[PDFHREF.SECTREF] | |
1310 | -.. | |
1311 | -.\" | |
1312 | 1304 | .\" Make "pdf*href.format" the default cross reference formatter |
1313 | 1305 | .\" |
1314 | 1306 | .als pdf*href.default pdf*href.format |