Reference Documentation: PDF Publishing with GNU Troff
リビジョン | 94c6fe3ee37243597c54429bc537951e01cd6058 (tree) |
---|---|
日時 | 2023-04-04 20:41:26 |
作者 | Keith Marshall <keith@user...> |
コミッター | Keith Marshall |
Implement a duplex printing layout capability.
* pdfmark.ms [duplex] (BT): Augment macro definition, to alternate
left and right margin widths, between even and odd numbered pages;
activated by "-duplex" option to pdfroff command, (i.e. define a
string called "uplex", with "-duplex=true", for example).
[duplex && pdfroff] (preserve_blank_pages): Suggest it for...
[body]: ...this document assembly component.
@@ -102,6 +102,39 @@ | ||
102 | 102 | .nr QI 3n |
103 | 103 | .nr HY 0 |
104 | 104 | . |
105 | +.if duplex \{\ | |
106 | +.\" When duplex printing layout has been specified, we alternate the | |
107 | +.\" left and right margin settings, as we move from odd to even page | |
108 | +.\" numbers, and back; groff-ms calls the "BT" hook macro within the | |
109 | +.\" scope of a bottom-of-page trap, so we may augment this to adjust | |
110 | +.\" the margins as required. | |
111 | +.\" | |
112 | +. am BT | |
113 | +. \" groff doesn't provide any specific indicator for right margin | |
114 | +. \" width, or indeed for overall paper width; however, we may get | |
115 | +. \" the paper width by inference, from papersize.tmac, which sets | |
116 | +. \" it to two inches more than the initial default value of \n(.l | |
117 | +. \" | |
118 | +. \" When advancing from an odd numbered to an even numbered page, | |
119 | +. \" adjust the PO register to the original right margin width, as | |
120 | +. \" inferred by subtraction of the original effective left margin | |
121 | +. \" setting, as established by the initial setting of PO, and the | |
122 | +. \" effective line length, as established by the initial setting | |
123 | +. \" of LL, from the inferred paper width. | |
124 | +. \" | |
125 | +. ie o .nr PO 2i+\n(.lu-\n(POu-\n(LLu | |
126 | +. | |
127 | +. \" Conversely, when advancing from an even numbered page to an | |
128 | +. \" odd numbered page, we simple revert PO to its initial value. | |
129 | +. \" | |
130 | +. el .nr PO \n(POu | |
131 | +. . | |
132 | +.\" Additionally, for duplex printing, it may be best to request the | |
133 | +.\" preservation of blank pages within the document body. | |
134 | +.\" | |
135 | +. if d pdfroff .pdfroff option preserve_blank_pages=body | |
136 | +.\} | |
137 | +. | |
105 | 138 | .\" Generate headers in larger point sizes, for NH levels < 4, |
106 | 139 | .\" with point size increasing by 1.5p, for each lesser NH level. |
107 | 140 | .\" |