From 4958673c34d66a8ba5c30da11818006aa9b8e226 Mon Sep 17 00:00:00 2001 From: Steffen Nurpmeso Date: Wed, 27 May 2015 15:41:45 +0200 Subject: [PATCH] Adapt contrib/pdfmark --- contrib/pdfmark/PROBLEMS | 4 + contrib/pdfmark/README | 8 +- contrib/pdfmark/TODO | 4 + contrib/pdfmark/cover.ms | 7 +- contrib/pdfmark/{pdfmark.ms => pdfmark.ms.in} | 133 ++++++------ contrib/pdfmark/pdfmark.tmac | 12 +- contrib/pdfmark/{pdfroff.man => pdfroff.1.in} | 294 ++++++++++---------------- contrib/pdfmark/{pdfroff.sh => pdfroff.sh.in} | 129 ++++++----- contrib/pdfmark/spdf.tmac | 9 +- 9 files changed, 267 insertions(+), 333 deletions(-) rename contrib/pdfmark/{pdfmark.ms => pdfmark.ms.in} (97%) rename contrib/pdfmark/{pdfroff.man => pdfroff.1.in} (76%) rename contrib/pdfmark/{pdfroff.sh => pdfroff.sh.in} (84%) diff --git a/contrib/pdfmark/PROBLEMS b/contrib/pdfmark/PROBLEMS index 70aee112..1f356ae1 100644 --- a/contrib/pdfmark/PROBLEMS +++ b/contrib/pdfmark/PROBLEMS @@ -1,3 +1,5 @@ + Copyright (c) 2014 Steffen (Daode) Nurpmeso . + Copyright 2004 Free Software Foundation, Inc. @@ -30,3 +32,5 @@ the diversion). -------- Annotations placed by .pdfnote cannot exceed about 200 chars. + +# s-ts-mode diff --git a/contrib/pdfmark/README b/contrib/pdfmark/README index 3954a0ff..457a58ba 100644 --- a/contrib/pdfmark/README +++ b/contrib/pdfmark/README @@ -1,3 +1,5 @@ + Copyright (c) 2014 Steffen (Daode) Nurpmeso . + Copyright 2004 Free Software Foundation, Inc. @@ -49,8 +51,4 @@ including the '-mpdfmark' option on the groff command line; (for ms users, '-mspdf' is equivalent to '-ms -mpdfmark', with some extra macros 'thrown in'). -Comments, and bug reports are welcomed. Please post to the groff -mailing list, groff@gnu.org; (you must be subscribed to this list to -post mails). To subscribe, visit - - http://lists.gnu.org/mailman/listinfo/groff +# s-ts-mode diff --git a/contrib/pdfmark/TODO b/contrib/pdfmark/TODO index 5659a591..5c6c2186 100644 --- a/contrib/pdfmark/TODO +++ b/contrib/pdfmark/TODO @@ -1,3 +1,5 @@ + Copyright (c) 2014 Steffen (Daode) Nurpmeso . + Copyright 2004, 2005 Free Software Foundation, Inc. @@ -58,3 +60,5 @@ PDF marks. This facility now provided by `pdfroff' script; documented in `pdfroff.man'. Man page still requires an additional section, to describe use of `stylesheet' feature. Script also requires documentation in PDF and texinfo formats. + +# s-ts-mode diff --git a/contrib/pdfmark/cover.ms b/contrib/pdfmark/cover.ms index d7876b4e..a760cca7 100644 --- a/contrib/pdfmark/cover.ms +++ b/contrib/pdfmark/cover.ms @@ -1,3 +1,6 @@ +.\"@ +.\" Copyright (c) 2014 Steffen (Daode) Nurpmeso . +.\" .\" Copyright 2004 .\" Free Software Foundation, Inc. .\" @@ -46,9 +49,6 @@ .PSPIC logo.eps .nr PS 19 .CD -.fam H -.tkf HR 10z 2p 20z 4p -\H'-4z'A GNU MANUAL\H'0' .DE .\".nr PO \\n[PO*SAVED] .nr LL \\n[LL*SAVED] @@ -62,3 +62,4 @@ .rr HM*SAVED .fam .. +.\" s-ts-mode diff --git a/contrib/pdfmark/pdfmark.ms b/contrib/pdfmark/pdfmark.ms.in similarity index 97% rename from contrib/pdfmark/pdfmark.ms rename to contrib/pdfmark/pdfmark.ms.in index 22ff9519..734c538e 100644 --- a/contrib/pdfmark/pdfmark.ms +++ b/contrib/pdfmark/pdfmark.ms.in @@ -1,12 +1,9 @@ -.\" vim: ft=groff .ig -pdfmark.ms +@ pdfmark.ms.in -File position: /contrib/pdfmark/pdfmark.ms +Copyright (c) 2014 Steffen (Daode) Nurpmeso . -This file is part of groff, the GNU roff type-setting system. - -Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc. +Copyright (C) 2004 - 2006 Free Software Foundation, Inc. written by Keith Marshall Permission is granted to copy, distribute and/or modify this document @@ -20,25 +17,22 @@ Sections:-- b) The two lines below starting with `.AU' and `.AI'. -A copy of the Free Documentation License is included as a file called -FDL in the main directory of the groff source package. +You should have received a copy of the Free Documentation License +as part of the file COPYING; also located in the main directory of the +source package of this program. .. . .CS Portable Document Format -Publishing with GNU Troff +Publishing with @T_ROFF@ .AU Keith Marshall .AI .CE .\" -.\" Specify the Internet address for the groff web site. +.\" Specify the Internet address for our web site. .\" Currently, there are two available addresses; a copy is maintained at ... .\" -.ds GROFF-WEBSITE http://www.gnu.org/software/groff -.\" -.\" ... but the official home site is at ... -.\" -.ds GROFF-WEBSITE http://groff.ffii.org +.ds ROFF-WEBSITE @ROFF_WEBURL@ .\" .\" Set the PDF default document view attribute, to ensure that the document .\" outline is visible, each time the document is opened in Acrobat Reader. @@ -52,10 +46,10 @@ Publishing with GNU Troff .\" .\" Add document identification meta-data .\" -.pdfinfo /Title Portable Document Format Publishing with GNU Troff +.pdfinfo /Title Portable Document Format Publishing with @T_ROFF@ .pdfinfo /Author Keith Marshall -.pdfinfo /Subject Tips and Techniques for Exploiting PDF Features with GNU Troff -.pdfinfo /Keywords groff troff PDF pdfmark +.pdfinfo /Subject Tips and Techniques for Exploiting PDF Features with @T_ROFF@ +.pdfinfo /Keywords @T_ROFF@ @T_TROFF@ troff PDF pdfmark .\" .\" Set the default cross reference format to indicate section numbers, .\" rather than page numbers, when we insert a reference pointer. @@ -136,16 +130,16 @@ Publishing with GNU Troff It might appear that it is a fairly simple matter to produce documents in Adobe\*(rg\~\(lqPortable\~Document\~Format\(rq, commonly known as PDF, using -.CW groff ) GNU\~Troff\~( +.CW @T_ROFF@ as the document formatter. Indeed, -.CW groff 's +.CW @L_ROFF@ 's default output format is the native Adobe\*(rg\~PostScript\*(rg format, which PDF producers such as Adobe\*(rg Acrobat\*(rg Distiller\*(rg, or GhostScript, expect as their input format. Thus, the PDF production process would seem to entail simply formatting the document source with -.CW groff , +.CW @L_ROFF@ , to produce a PostScript\*(rg version of the document, which can subsequently be processed by Acrobat\*(rg Distiller\*(rg or GhostScript, to generate the final PDF document. @@ -155,7 +149,7 @@ the production cycle described above may be sufficient. However, this is a limited PDF production method, in which the resultant PDF document represents no more than an on screen image of the printed form of the document, if -.CW groff 's +.CW @L_ROFF@ 's PostScript\*(rg output were printed directly. .LP The Portable Document Format provides a number of features, @@ -181,21 +175,21 @@ possible to exploit these PDF features, which are described in the Adobe\*(rg .pdfmark-manual , with some refinement of the simple PDF production method, provided appropriate \(lqfeature implementing\(rq instructions can be embedded into -.CW groff 's +.CW @L_ROFF@ 's PostScript\*(rg rendering of the document. This, of course, implies that the original document source, which -.CW groff +.CW @L_ROFF@ will process to generate the PostScript\*(rg description of the document, must include appropriate markup to exploit the desired PDF features. It is this preparation of the -.CW groff +.CW @L_ROFF@ document source to exploit a number of these features, which provides the principal focus of this document. .LP The markup techniques to be described have been utilised in the production of the PDF version of this document itself. This has been formatted using -.CW groff 's +.CW @L_ROFF@ 's .CW ms macro package; thus, usage examples may be found in the document source file, @@ -239,7 +233,7 @@ GNU/Linux, and on Microsoft\*(rg Windows\(tm2000 operating platforms, using .pdfhref M footnote1 Later versions should, and some earlier versions may, be equally suitable. See -.pdfhref W \*[GROFF-WEBSITE] +.pdfhref W \*[ROFF-WEBSITE] for information and availability of the latest version. .FE in association with @@ -265,7 +259,7 @@ or GNU/Linux system, are and .CW make , together with an appropriate text editor, for creating and marking up the -.CW groff +.CW @L_ROFF@ input files. These additional utilities are not provided, as standard, on the Microsoft\*(rg Windows\(tm platform, @@ -301,7 +295,7 @@ UNIX\(tm tools for 32\(hybit Microsoft\*(rg Windows\(tm, available for download from .pdfhref W -A ; http://www.mingw.org it -.EM does +.EM does include those tools listed above, and is the package which was actually used when performing the Windows\(tm2000 platform tests referred to in the text. @@ -312,7 +306,7 @@ which may be available, are in any way inferior to them. .bp .NH 1 .\" We may wish a section heading to represent a named destination, -.\" so that we can create a linked reference to it, from some other +.\" so that we can create a linked reference to it, from some other .\" part of the PDF document, (or even from another PDF document). .\" .\" Here we use the "-N" option of the "XN" macro, to create a named @@ -325,19 +319,19 @@ which may be available, are in any way inferior to them. .XN -N pdf-features -- Exploiting PDF Document Features .LP To establish a consistent framework for adding PDF features, a -.CW groff +.CW @L_ROFF@ macro package, named .CW pdfmark.tmac , has been provided. Thus, to incorporate PDF features in a document, the appropriate macro calls, as described below, may be placed in the -.CW groff +.CW @L_ROFF@ document source, which should then be processed with a -.CW groff +.CW @L_ROFF@ command of the form .QP .fam C -groff -Tps [-m +@L_ROFF@ -Tps [-m .I name "] -m" .B pdfmark .I options \& [- @@ -347,7 +341,7 @@ It may be noted that the .CW pdfmark macros have no dependencies on, and no known conflicts with, any other -.CW groff +.CW @L_ROFF@ macro package; thus, users are free to use any other macro package, of their choice, to format their documents, while also using the .CW pdfmark @@ -360,7 +354,7 @@ All PDF features are implemented by embedding instances of the operator, as described in the Adobe\*(rg .pdfmark-manual , into -.CW groff 's +.CW @L_ROFF@ 's PostScript\*(rg output stream. To facilitate the use of this operator, the .CW pdfmark @@ -475,7 +469,7 @@ It should be noted that the view controlling meta\(hydata, defined by the macro, is not written immediately to the PostScript\*(rg output stream, but is stored in an internal meta\(hydata \(lqcache\(rq, (simply implemented as a -.CW groff +.CW @L_ROFF@ diversion). This \(lqcached\(lq meta\(hydata must be written out later, by invoking the .CW pdfsync @@ -512,7 +506,7 @@ was specified using a macro sequence similar to:\(en \&.pdfinfo /Title PDF Document Publishing with GNU Troff \&.pdfinfo /Author Keith Marshall \&.pdfinfo /Subject How to Exploit PDF Features with GNU Troff -\&.pdfinfo /Keywords groff troff PDF pdfmark +\&.pdfinfo /Keywords @T_ROFF@ @T_TROFF@ PDF pdfmark .DE Notice that the .CW pdfinfo @@ -690,7 +684,7 @@ the data required by the .CW pdfmark operator to create the outline entry may not be fully defined, when the outline reference is defined in the -.CW groff +.CW @L_ROFF@ document source. Specifically, when the outline entry is created, its .CW /Count @@ -722,7 +716,7 @@ top level entry is defined. .LP One potential problem, which arises from the use of the \(lqoutline cache\(rq, is that, at the end of any document formatting run, the last top level outline entry, -and any subordinates defined after it, will remain in the cache, and will +and any subordinates defined after it, will remain in the cache, and will .EM not be automatically written to the output stream. To avoid this problem, the user should follow the guidelines given in @@ -740,7 +734,7 @@ To avoid this problem, the user should follow the guidelines given in to synchronise the output state with the cache state, .XR pdfsync ), ( at the end of the -.CW groff +.CW @L_ROFF@ formatting run. .NH 3 .XN -N outline-view -- Associating a Document View with an Outline Reference @@ -828,14 +822,14 @@ This register is computed by when creating an outline entry; it specifies the vertical position of the \(lqbookmark\(rq, in basic -.CW groff +.CW @L_ROFF@ units, relative to the .EM bottom edge of the document page on which it is defined, and is followed, in the .CW PDFBOOKMARK.VIEW definition, by the -.CW grops +.CW @L_D_PS@ .CW u \(rq \(lq operator, to convert it to PostScript\*(rg units on output. It may be used in any redefined specification for @@ -863,8 +857,8 @@ This is most effectively ensured, by providing .EM identical page size specifications to -.CW groff , -.CW grops +.CW @L_ROFF@ , +.CW @L_D_PS@ and to the PostScript\*(rg to PDF converter employed, and avoiding any page length changes within the document source. .LP @@ -1376,7 +1370,7 @@ This option is .EM required , to distinguish between the series of \(lqbookmark\(rq names generated in individual passes of the -.CW groff +.CW @L_ROFF@ formatter, when the final PDF document is to be assembled from a number of separately formatted components; .XR multipart-outline ). ( @@ -1423,14 +1417,14 @@ It is also useful when the argument list to .CW pdfhref contains special characters \(em any special character, which is not valid in a -.CW groff +.CW @L_ROFF@ macro name, will cause a parsing error, if .CW pdfhref attempts to match it as a possible option flag; using the .CW -- \(rq \(lq flag prevents this, so suppressing the -.CW groff +.CW @L_ROFF@ warning message, which would otherwise ensue. .IP Using this flag after @@ -1627,7 +1621,7 @@ in addition to its inclusion in the cross reference map. Effective cross referencing of .EM any document formatted by -.CW groff +.CW @L_ROFF@ requires multiple pass formatting. Details of how this multiple pass formatting may be accomplished, when working with the @@ -1785,7 +1779,7 @@ macro, but in this case, with the .CWB L \& \& \(rq \(lq operator. This operator provides support for two distinct cases, -depending on whether the reference destination is defined in +depending on whether the reference destination is defined in the same document as the link, .XR link-intern ), ( or is defined as a named destination in a different PDF document, @@ -1833,7 +1827,7 @@ If any .CWI descriptive \& \& \~\c .CWI text arguments are specified, then they will be inserted into the -.CW groff +.CW @L_ROFF@ output stream, to define the text appearing in the \(lqhot\(hyspot\(rq region of the link; this will be printed in the link colour specified by the string, @@ -2154,24 +2148,24 @@ representation of the URI, which .EM will , therefore, appear as the entire content of the \(lqhot\(hyspot\(rq. For example, we could introduce a reference to -.pdfhref W -D \*[GROFF-WEBSITE] -A , the groff web site +.pdfhref W -D \*[ROFF-WEBSITE] -A , the @T_ROFF@ web site in which the actual URI is concealed, by using mark up such as:\(en .DS I .CW For example, we could introduce a reference to -\&.pdfhref W -D \*[GROFF-WEBSITE] -A , the groff web site +\&.pdfhref W -D \*[ROFF-WEBSITE] -A , the @T_ROFF@ web site in which the actual URI is concealed, .DE Alternatively, -to refer the reader to the groff web site, +to refer the reader to the @T_ROFF@ web site, making it obvious that the appropriate URI is -.pdfhref W -A , \*[GROFF-WEBSITE] +.pdfhref W -A , \*[ROFF-WEBSITE] the requisite mark up might be:\(en .DS I .CW -to refer the reader to the groff web site, +to refer the reader to the @T_ROFF@ web site, making it obvious that the appropriate URI is -\&.pdfhref W -A , \*[GROFF-WEBSITE] +\&.pdfhref W -A , \*[ROFF-WEBSITE] the requisite mark up might be:\e(en .DE .NH 3 @@ -2309,7 +2303,7 @@ binding package, illustrates how this may be accomplished:\(en .DS I .CW -\&.\e" groff "ms" provides the "pg@bottom" macro, which has already +\&.\e" @T_ROFF@ "ms" provides the "pg@bottom" macro, which has already \&.\e" been installed as a page transition trap. To ensure proper \&.\e" mapping of "pdfhref" links which overflow the bottom of any \&.\e" page, we need to install the "pdfhref" page transition hook, @@ -2338,7 +2332,7 @@ do not immediately write their .CW pdfmark output to the PostScript\*(rg data stream; instead, they cache their output, in a -.CW groff +.CW @L_ROFF@ diversion, in the case of the .CW pdfview and @@ -2358,7 +2352,7 @@ cached data may be implicitly written out as the document outline is compiled, but there will .EM always be some remaining data, which must be explicitly flushed out, before the -.CW groff +.CW @L_ROFF@ formatting process is allowed to complete. .LP To allow the user to choose when cached @@ -2380,15 +2374,15 @@ the \(lqmeta\(hydata cache\(rq, containing and .CW pdfinfo data, -.EM and +.EM and the \(lqoutline cache\(rq, containing any previously uncommitted document outline data, are flushed; ideally, this should be included in a -.CW groff +.CW @L_ROFF@ \(lqend macro\(rq, to ensure that .EM both caches are flushed, before -.CW groff +.CW @L_ROFF@ terminates. .LP Occasionally, @@ -2446,13 +2440,13 @@ macros described in the preceding section, provide no inherent document formatting capability of their own. However, they may be used in conjunction with any other -.CW groff +.CW @L_ROFF@ macro package of the user's choice, to add such capability. .LP In preparing this document, the standard .CW ms -macro package, supplied as a component of the GNU Troff distribution, +macro package, supplied as a component of the @T_ROFF@ distribution, has been employed. To facilitate the use of the .CW pdfmark @@ -2465,7 +2459,7 @@ has been created. The use of this binding macro package is described in the following section, .XR using-spdf ); ( it may also serve as an example to users of other standard -.CW groff +.CW @L_ROFF@ macro packages, as to how the .CW pdfmark @@ -2481,11 +2475,11 @@ macros in conjunction with the .CW ms macros, simply by issuing a -.CW groff +.CW @L_ROFF@ command of the form .QP .fam C -groff -Tps +@L_ROFF@ -Tps .B -mspdf .I "-options ...\&" ] [ file(s) ... @@ -2493,7 +2487,7 @@ file(s) ... When using the .CW spdf.tmac package, the -.CW groff +.CW @L_ROFF@ input files may be marked up using any of the standard .CW ms macros to specify document formatting, @@ -2554,3 +2548,4 @@ macro. .NH 3 .XN -N import-map -- Deploying a Document Reference Map .TC +.\" s-ts-mode diff --git a/contrib/pdfmark/pdfmark.tmac b/contrib/pdfmark/pdfmark.tmac index 2f5c9996..312baaa9 100644 --- a/contrib/pdfmark/pdfmark.tmac +++ b/contrib/pdfmark/pdfmark.tmac @@ -1,14 +1,12 @@ -.\" -*- nroff -*- .ig +@ pdfmark.tmac -pdfmark.tmac +Copyright (c) 2014 Steffen (Daode) Nurpmeso . Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Written by Keith Marshall (keith.d.marshall@ntlworld.com) -This file is part of groff. - groff is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later @@ -1176,7 +1174,7 @@ ps:exec \\*[pdf:composed.line] .\" is synchronised with the placement of the reference mark, .\" especially when the mark is defined within a diversion. .\" -.ie '\\n(.z'' .tm gropdf-info:href \\*[PDFHREF.NAME] \\$* +.ie '\\n(.z'' .tm pdfmark-info:href \\*[PDFHREF.NAME] \\$* .el \!.\\$0 \\$@ .. .\" @@ -1738,7 +1736,7 @@ ps:exec \\*[pdf:composed.line] . \" adjust the end-point vertical displacement by the same offset, . \" and then relocate the link starting point to its new displacement, . \" as established by this base line relative computation. -. \" +. \" . nr pdf:lly.end +\\n[pdf:ury.base]-\\n[pdf:ury]+\\*[PDFHREF.HEIGHT] . rnn pdf:ury.base pdf:ury . \} @@ -1955,4 +1953,4 @@ ps:exec \\*[pdf:composed.line] .als pdf*href-W pdf*href .ds pdf*href-W.link /Action << /Subtype /URI /URI (\\\\*[pdf:href-D]) >> .\" -.\" pdfmark.tmac: end of file / vim: ft=groff +.\" s-tr-mode diff --git a/contrib/pdfmark/pdfroff.man b/contrib/pdfmark/pdfroff.1.in similarity index 76% rename from contrib/pdfmark/pdfroff.man rename to contrib/pdfmark/pdfroff.1.in index 7bf164cc..415fc465 100644 --- a/contrib/pdfmark/pdfroff.man +++ b/contrib/pdfmark/pdfroff.1.in @@ -1,18 +1,10 @@ -.TH PDFROFF @MAN1EXT@ "@MDATE@" "Groff Version @VERSION@" -.\" -------------------------------------------------------------------- -.\" Legal Matters -.\" -------------------------------------------------------------------- +.TH @U_PDFROFF@ @MAN1EXT@ "@MDATE@" "@T_ROFF@ v@VERSION@" .ig -pdfroff.1 +@ pdfroff.1.in -File position: /contrib/pdfmark/pdfroff.man +Copyright (c) 2014 Steffen (Daode) Nurpmeso . -Last update: -30 Jan 2007. - -This file is part of groff, the GNU roff type-setting system. - -Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc. +Copyright (C) 2005 - 2007 Free Software Foundation, Inc. written by Keith Marshall Permission is granted to copy, distribute and/or modify this document @@ -27,12 +19,13 @@ Sections:-- b) The entire section bearing the heading "AUTHOR", extending from the ".SH AUTHOR" tag, to the end of the document. -A copy of the Free Documentation License is included as a file called -FDL in the main directory of the groff source package. +You should have received a copy of the Free Documentation License +as part of the file COPYING; also located in the main directory of the +source package of this program. .. . . -.\" -------------------------------------------------------------------- +.\" .\" Local macro definitions . .hw pdfmark @@ -44,18 +37,18 @@ FDL in the main directory of the groff source package. .. . . -.\" -------------------------------------------------------------------- +.\" . .SH NAME . -pdfroff \- create PDF documents using groff +@L_PDFROFF@ \- create PDF documents using @T_ROFF@ . . -.\" -------------------------------------------------------------------- +.\" . .SH SYNOPSIS . -.SY pdfroff +.SY @L_PDFROFF@ .OP \-abcegilpstzCEGNRSUVXZ .OP \-d cs .OP \-f fam @@ -83,12 +76,12 @@ pdfroff \- create PDF documents using groff .OP \-\-keep\-temporary\-files .I file .\|.\|. . -.SY pdfroff +.SY @L_PDFROFF@ .B \-h | .B \-\-help . -.SY pdfroff +.SY @L_PDFROFF@ .B \-v | .B \-\-version @@ -96,17 +89,17 @@ pdfroff \- create PDF documents using groff .YS . . -.\" -------------------------------------------------------------------- +.\" . .SH DESCRIPTION . -.B pdfroff -is a wrapper program for the GNU text processing system, -.BR groff . +.B @L_PDFROFF@ +is a wrapper program for the @T_ROFF@ text processing system, +.BR @L_ROFF@ . It transparently handles the mechanics of multiple pass -.B groff +.B @L_ROFF@ processing, when applied to suitably marked up -.B groff +.B @L_ROFF@ source files, such that tables of contents and body text are formatted separately, and are subsequently combined in the correct order, for final publication @@ -119,17 +112,17 @@ table of contents, in the published document. . .P For each invocation of -.BR pdfroff , +.BR @L_PDFROFF@ , the ultimate -.B groff +.B @L_ROFF@ output stream is post-processed by the GhostScript interpreter, to produce a finished PDF document. . .P -.B pdfroff +.B @L_PDFROFF@ makes no assumptions about, and imposes no restrictions on, the use of any -.B groff +.B @L_ROFF@ macro packages which the user may choose to employ, in order to achieve a desired document format; however, it @@ -143,9 +136,9 @@ macro, defined in the .B pdfmark.tmac package, is used to define public reference marks, or dynamic links to such reference marks, then -.B pdfroff +.B @L_PDFROFF@ performs as many preformatting -.B groff +.B @L_ROFF@ passes as required, up to a maximum limit of .IR four , in order to compile a document reference dictionary, @@ -153,7 +146,7 @@ to resolve references, and to expand the dynamically defined content of links. . . -.\" -------------------------------------------------------------------- +.\" . .SH USAGE . @@ -173,9 +166,9 @@ substring. . .P Otherwise, -.B pdfroff +.B @L_PDFROFF@ usage closely mirrors that of -.B groff +.B @L_ROFF@ itself. Indeed, with the exception of the @@ -186,34 +179,34 @@ and short form options, and all long form options, which are parsed internally by -.BR pdfroff , +.BR @L_PDFROFF@ , all options and file name arguments specified on the command line are passed on to -.BR groff , +.BR @L_ROFF@ , to control the formatting of the PDF document. Consequently, -.B pdfroff +.B @L_PDFROFF@ accepts all options and arguments, as specified in -.BR groff (@MAN1EXT@), +.BR @L_ROFF@ (@MAN1EXT@), which may also be considered as the definitive reference for all standard -.BR pdfroff +.BR @L_PDFROFF@ options and argument usage. . . -.\" -------------------------------------------------------------------- +.\" . .SH OPTIONS . -.B pdfroff +.B @L_PDFROFF@ accepts all of the short form options (i.e., those introduced by a single hyphen), which are available with -.B groff +.B @L_ROFF@ itself. In most cases, these are simply passed transparently to -.BR groff ; +.BR @L_ROFF@ ; the following, however, are handled specially by -.BR pdfroff . +.BR @L_PDFROFF@ . . .TP .B \-h @@ -225,24 +218,24 @@ see below. .B \-i Process standard input, after all other specified input files. This is passed transparently to -.BR groff , +.BR @L_ROFF@ , but, if grouped with other options, it .I must be the first in the group. Hiding it within a group breaks standard input processing, in the multiple pass -.B groff +.B @L_ROFF@ processing context of -.BR pdfroff . +.BR @L_PDFROFF@ . . .TP .BI \-T \ dev Only .B \-T\ ps is supported by -.BR pdfroff . +.BR @L_PDFROFF@ . Attempting to specify any other device causes -.B pdfroff +.B @L_PDFROFF@ to abort. . .TP @@ -253,28 +246,28 @@ see below. . .P See -.BR groff (@MAN1EXT@) +.BR @L_ROFF@ (@MAN1EXT@) for a description of all other short form options, which are transparently passed through -.BR pdfroff +.BR @L_PDFROFF@ to -.BR groff . +.BR @L_ROFF@ . . .P All long form options (i.e., those introduced by a double hyphen) are interpreted locally by -.BR pdfroff ; +.BR @L_PDFROFF@ ; they are .B not passed on to -.BR groff , +.BR @L_ROFF@ , unless otherwise stated below. . .TP .B \-\-help Causes -.B pdfroff +.B @L_PDFROFF@ to display a summary of the its usage syntax, and supported options, and then exit. . @@ -282,7 +275,7 @@ and then exit. .B \-\-emit\-ps Suppresses the final output conversion step, causing -.B pdfroff +.B @L_PDFROFF@ to emit PostScript output instead of PDF. This may be useful, to capture intermediate PostScript output, @@ -298,7 +291,7 @@ PDF writer. .B \-\-keep\-temporary\-files Suppresses the deletion of temporary files, which normally occurs after -.B pdfroff +.B @L_PDFROFF@ has completed PDF document formatting; this may be useful, when debugging formatting problems. @@ -306,7 +299,7 @@ when debugging formatting problems. See section .BR FILES , for a description of the temporary files used by -.BR pdfroff . +.BR @L_PDFROFF@ . . .TP .B \-\-no\-pdf\-output @@ -314,7 +307,7 @@ May be used with the .BI \%\-\-reference\-dictionary= name option (described below) to eliminate the overhead of PDF formatting, when running -.B pdfroff +.B @L_PDFROFF@ to create a reference dictionary, for use in a different document. . .TP @@ -328,7 +321,7 @@ macro. .TP .B \-\-no\-toc\-relocation May be used to eliminate the extra -.B groff +.B @L_ROFF@ processing pass, which is required to generate a table of contents, and relocate it to the start of the PDF document, @@ -341,7 +334,7 @@ While preparing for simulation of the manual collation step, which is traditionally required to relocate of a .I "table of contents" to the start of a document, -.B pdfroff +.B @L_PDFROFF@ accumulates a number of empty page descriptions into the intermediate .I PostScript @@ -349,7 +342,7 @@ output stream. During the final collation step, these empty pages are normally discarded from the finished document; this option forces -.B pdfroff +.B @L_PDFROFF@ to leave them in place. . .TP @@ -357,7 +350,7 @@ to leave them in place. Specifies the name to be used for the resultant PDF document; if unspecified, the PDF output is written to standard output. A future version of -.B pdfroff +.B @L_PDFROFF@ may use this option, to encode the document name in a generated reference dictionary. . @@ -366,7 +359,7 @@ to encode the document name in a generated reference dictionary. Specifies the name to be used for the generated reference dictionary file; if unspecified, the reference dictionary is created in a temporary file, which is deleted when -.B pdfroff +.B @L_PDFROFF@ completes processing of the current document. This option .I must @@ -376,10 +369,10 @@ for use in references placed in other PDF documents. .TP .B \-\-report\-progress Causes -.B pdfroff +.B @L_PDFROFF@ to display an informational message on standard error, at the start of each -.B groff +.B @L_ROFF@ processing pass. . .TP @@ -395,28 +388,28 @@ in the formatted PDF document. .TP .B \-\-version Causes -.B pdfroff +.B @L_PDFROFF@ to display a version identification message. The entire command line is then passed transparently to -.BR groff , +.BR @L_ROFF@ , in a .I one pass operation .IR only , in order to display the associated -.B groff +.B @L_ROFF@ version information, before exiting. . . -.\" -------------------------------------------------------------------- +.\" . .SH ENVIRONMENT The following environment variables may be set, and exported, to modify the behaviour of -.BR pdfroff . +.BR @L_PDFROFF@ . . .TP -.B PDFROFF_COLLATE +.B @U_PDFROFF@_COLLATE Specifies the program to be used for collation of the finshed PDF document. .IP @@ -427,18 +420,18 @@ when formatting with traditional macro packages, which print them at the end. However, users should not normally need to specify -.BR \%PDFROFF_COLLATE , +.BR \%@U_PDFROFF@_COLLATE , (and indeed, are not encouraged to do so). If unspecified, -.B pdfroff +.B @L_PDFROFF@ uses .BR sed (@MAN1EXT@) by default, which normally suffices. .IP If -.B \%PDFROFF_COLLATE +.B \%@L_PDFROFF@_COLLATE .I is specified, then it must act as a filter, @@ -447,58 +440,58 @@ and write its output to the .I stdout stream, whence it is piped to the -.BR \%PDFROFF_POSTPROCESSOR_COMMAND , +.BR \%@U_PDFROFF@_POSTPROCESSOR_COMMAND , to produce the finished PDF output. .IP When specifying -.BR \%PDFROFF_COLLATE , +.BR \%@U_PDFROFF@_COLLATE , it is normally necessary to also specify -.BR \%PDFROFF_KILL_NULL_PAGES . +.BR \%@U_PDFROFF@_KILL_NULL_PAGES . .IP -.B \%PDFROFF_COLLATE +.B \%@U_PDFROFF@_COLLATE is ignored, if -.B pdfroff +.B @L_PDFROFF@ is invoked with the .I \%\-\-no\-kill\-null\-pages option. . .TP -.B PDFROFF_KILL_NULL_PAGES +.B @U_PDFROFF@_KILL_NULL_PAGES Specifies options to be passed to the -.B \%PDFROFF_COLLATE +.B \%@U_PDFROFF@_COLLATE program. .IP It should not normally be necessary to specify -.BR \%PDFROFF_KILL_NULL_PAGES . +.BR \%@U_PDFROFF@_KILL_NULL_PAGES . The internal default is a .BR sed (@MAN1EXT@) script, which is intended to remove completely blank pages from the collated output stream, and which should be appropriate in most applications of -.BR pdfroff . +.BR @L_PDFROFF@ . However, if any alternative to .BR sed (@MAN1EXT@) is specified for -.BR \%PDFROFF_COLLATE , +.BR \%@U_PDFROFF@_COLLATE , then it is likely that a corresponding alternative specification for -.B \%PDFROFF_KILL_NULL_PAGES +.B \%@U_PDFROFF@_KILL_NULL_PAGES is required. .IP As in the case of -.BR \%PDFROFF_COLLATE , -.B \%PDFROFF_KILL_NULL_PAGES +.BR \%@U_PDFROFF@_COLLATE , +.B \%@U_PDFROFF@_KILL_NULL_PAGES is ignored, if -.B pdfroff +.B @L_PDFROFF@ is invoked with the .I \%\-\-no\-kill\-null\-pages option. . .TP -.B PDFROFF_POSTPROCESSOR_COMMAND +.B @U_PDFROFF@_POSTPROCESSOR_COMMAND Specifies the command to be used for the final document conversion from PostScript intermediate output to PDF. It must behave as a filter, @@ -515,7 +508,7 @@ representing the stream. .IP If unspecified, -.B \%PDFROFF_POSTPROCESSOR_COMMAND +.B \%@U_PDFROFF@_POSTPROCESSOR_COMMAND defaults to . .RS 2 @@ -527,67 +520,49 @@ defaults to .RE . .TP -.B GROFF_TMPDIR -Identifies the directory in which -.B pdfroff -should create temporary files. -If -.B \%GROFF_TMPDIR -is -.I not -specified, then the variables -.BR TMPDIR , -.B TMP -and -.B TEMP -are considered in turn, as possible temporary file repositories. -If none of these are set, then temporary files are created -in the current directory. -. -.TP -.B GROFF_GHOSTSCRIPT_INTERPRETER +.B @U_ROFF@_GHOSTSCRIPT_INTERPRETER Specifies the program to be invoked, when -.B pdfroff +.B @L_PDFROFF@ converts .B groff PostScript output to PDF. If -.B \%PDFROFF_POSTPROCESSOR_COMMAND +.B \%@U_PDFROFF@_POSTPROCESSOR_COMMAND is specified, then the command name it specifies is .I implicitly assigned to -.BR \%GROFF_GHOSTSCRIPT_INTERPRETER , +.BR \%@U_ROFF@_GHOSTSCRIPT_INTERPRETER , overriding any explicit setting specified in the environment. If -.B \%GROFF_GHOSTSCRIPT_INTERPRETER +.B \%@U_ROFF@_GHOSTSCRIPT_INTERPRETER is not specified, then -.B pdfroff +.B @L_PDFROFF@ searches the process .BR PATH , looking for a program with any of the well known names for the GhostScript interpreter; if no GhostScript interpreter can be found, -.B pdfroff +.B @L_PDFROFF@ aborts. . .TP -.B GROFF_AWK_INTERPRETER +.B @U_ROFF@_AWK_INTERPRETER Specifies the program to be invoked, when -.B pdfroff +.B @L_PDFROFF@ is extracting reference dictionary entries from a -.B groff +.B @L_ROFF@ intermediate message stream. If -.B \%GROFF_AWK_INTERPRETER +.B \%@U_ROFF@_AWK_INTERPRETER is not specified, then -.B pdfroff +.B @L_PDFROFF@ searches the process .BR PATH , looking for any of the preferred programs, `gawk', `mawk', `nawk' and `awk', in this order; if none of these are found, -.B pdfroff +.B @L_PDFROFF@ issues a warning message, and continue processing; however, in this case, no reference dictionary is created. . @@ -620,17 +595,17 @@ to search for external helper programs. .TP .B SHOW_PROGRESS If this is set to a non-empty value, then -.B pdfroff +.B @L_PDFROFF@ always behaves as if the .B \%\-\-report\-progress option is specified, on the command line. . . -.\" -------------------------------------------------------------------- +.\" . .SH FILES Input and output files for -.B pdfroff +.B @L_PDFROFF@ may be named according to any convention of the user's choice. Typically, input files may be named according to the choice of the principal formatting macro package, e.g., @@ -645,7 +620,7 @@ normally, the final output file should be named . .P Temporary files, created by -.BR pdfroff , +.BR @L_PDFROFF@ , are placed in the directory specified by environment variables (see section .BR ENVIRONMENT ), @@ -654,18 +629,18 @@ and named according to the convention \&, where .I $$ is the standard shell variable representing the process ID of the -.B pdfroff +.B @L_PDFROFF@ process itself, and .I * represents any of the extensions used by -.B pdfroff +.B @L_PDFROFF@ to identify the following temporary and intermediate files. . .TP .BI pdf $$ .tmp A scratch pad file, used to capture reference data emitted by -.BR groff , +.BR @L_ROFF@ , during the .I reference dictionary compilation phase. @@ -746,72 +721,35 @@ in the proper sequence, \&. . . -.\" -------------------------------------------------------------------- +.\" . .SH SEE ALSO -See -.BR groff (@MAN1EXT@) -for the definitive reference to document formatting with -.BR groff . -Since -.B pdfroff -provides a superset of all -.B groff -capabilities, -.BR groff (@MAN1EXT@) -may also be considered to be the definitive reference to all -.I standard -capabilities of -.BR pdfroff , -with this document providing the reference to -.BR pdfroff 's -extended features. -. -.P -While -.B pdfroff -imposes neither any restriction on, nor any requirement for, -the use of any specific -.B groff -macro package, a number of supplied macro packages, -and in particular those associated with the package -.BR pdfmark.tmac , -are best suited for use with -.BR pdfroff -as the preferred formatter. -Detailed documentation on the use of these packages may be found, -in PDF format, in the reference guide -.BR "\*(lqPortable Document Format Publishing with GNU Troff\*(rq" , -included in the installed documentation set as -.BR \%@PDFDOCDIR@/pdfmark.pdf . -. +.BR @L_ROFF@ (@MAN1EXT@) . . -.\" -------------------------------------------------------------------- +.\" . .SH AUTHOR -Copyright \(co 2005, 2006, 2007 Free Software Foundation, Inc. +Copyright \(co 2014 Steffen (Daode) Nurpmeso . +.br +Copyright \(co 2005 - 2007 Free Software Foundation, Inc. . .P This man page is distributed under the terms of the -GNU Free Documentation License (FDL), version 1.1 or later, -and is part of the -.I GNU troff -software package. +GNU Free Documentation License (FDL), version 1.1 or later. It was originally written by .MT keith.d.marshall@\:ntlworld.com Keith Marshall .ME , who also wrote the implementation of the -.I pdfroff +.I @L_PDFROFF@ program, to which it relates. . .P You should have received a copy of the FDL as part of the -.I GNU troff +.I @T_ROFF@ distribution; it is also available on\-line, at .UR http://\:www.gnu.org/\:copyleft/\:fdl.html the GNU copyleft site .UE . . -.\" -------------------------------------------------------------------- -.\" EOF / vim: ft=groff +.\" s-ts-mode diff --git a/contrib/pdfmark/pdfroff.sh b/contrib/pdfmark/pdfroff.sh.in similarity index 84% rename from contrib/pdfmark/pdfroff.sh rename to contrib/pdfmark/pdfroff.sh.in index c67b89ec..66e02a8e 100644 --- a/contrib/pdfmark/pdfroff.sh +++ b/contrib/pdfmark/pdfroff.sh.in @@ -1,29 +1,25 @@ -#! /bin/sh -# ------------------------------------------------------------------------------ +#/bin/sh +#@ Format PDF Output from groff Markup # -# Function: Format PDF Output from groff Markup +# Copyright (c) 2014 Steffen (Daode) Nurpmeso . # # Copyright (C) 2005, 2006, Free Software Foundation, Inc. # Written by Keith Marshall (keith.d.marshall@ntlworld.com) -# -# This file is part of groff. -# +# # groff is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free # Software Foundation; either version 2, or (at your option) any later # version. -# +# # groff is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. -# +# # You should have received a copy of the GNU General Public License along # with groff; see the file COPYING. If not, write to the Free Software # Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. -# -# ------------------------------------------------------------------------------ -# + # Set up an identifier for the NULL device. # In most cases "/dev/null" will be correct, but some shells on # MS-DOS/MS-Windows systems may require us to use "NUL". @@ -82,19 +78,19 @@ # is specified; if not, we will search 'GROFF_BIN_PATH', only falling # back to a 'PATH' search, if neither of these is specified. # - if test -n "$GROFF_BIN_DIR" + if test -n "$@U_ROFF@_BIN_DIR" then - GPATH=GROFF_BIN_DIR - GROFF=`searchpath groff "$GROFF_BIN_DIR"` + GPATH=@U_ROFF@_BIN_DIR + ROFF=`searchpath @L_ROFF@ "$@U_ROFF@_BIN_DIR"` # - elif test -n "$GROFF_BIN_PATH" + elif test -n "$@U_ROFF@_BIN_PATH" then - GPATH=GROFF_BIN_PATH - GROFF=`searchpath groff "$GROFF_BIN_PATH"` + GPATH=@U_ROFF@_BIN_PATH + ROFF=`searchpath @L_ROFF@ "$@U_ROFF@_BIN_PATH"` # else GPATH=PATH - GROFF=`searchpath groff "$PATH"` + ROFF=`searchpath @L_ROFF@ "$PATH"` fi # # If one or more of these is missing, diagnose and bail out. @@ -102,7 +98,8 @@ NO='' NOPROG="$CMD: installation problem: cannot find program" test "$CAT" = ":" && echo >&2 "$NOPROG 'cat' in PATH" && NO="$NO 'cat'" test "$GREP" = ":" && echo >&2 "$NOPROG 'grep' in PATH" && NO="$NO 'grep'" - test "$GROFF" = ":" && echo >&2 "$NOPROG 'groff' in $GPATH" && NO="$NO 'groff'" + test "$ROFF" = ":" && echo >&2 "$NOPROG '@L_ROFF@' in $GPATH" && + NO="$NO '@L_ROFF@'" test "$SED" = ":" && echo >&2 "$NOPROG 'sed' in PATH" && NO="$NO 'sed'" if test -n "$NO" then @@ -130,27 +127,30 @@ # (May be forced, by defining PDFROFF_POSTPROCESSOR_COMMAND in the environment; # if this is not set, leave blank to use the built in default). # - if test -n "${PDFROFF_POSTPROCESSOR_COMMAND}" + if test -n "${@U_PDFROFF@_POSTPROCESSOR_COMMAND}" then - GROFF_GHOSTSCRIPT_INTERPRETER=`set command ${PDFROFF_POSTPROCESSOR_COMMAND}; + @U_ROFF@_GHOSTSCRIPT_INTERPRETER=`set command ${@U_PDFROFF@_POSTPROCESSOR_COMMAND}; echo $2` fi # -# Set up temporary/intermediate file locations. +# Set up temporary/intermediate file locations. FIXME add shell lib etc. + i=0 + test -n "${TMPDIR}" && test -d "${TMPDIR}" && i=1 || TMPDIR=/tmp + test ${i} -ne 0 || test -d "${TMPDIR}" || TMPDIR=. # - WRKFILE=${GROFF_TMPDIR=${TMPDIR-${TMP-${TEMP-"."}}}}/pdf$$.tmp + WRKFILE=${TMPDIR}/pdf$$.tmp # - REFCOPY=${GROFF_TMPDIR}/pdf$$.cmp - REFFILE=${GROFF_TMPDIR}/pdf$$.ref + REFCOPY=${TMPDIR}/pdf$$.cmp + REFFILE=${TMPDIR}/pdf$$.ref # CS_DATA="" - TC_DATA=${GROFF_TMPDIR}/pdf$$.tc - BD_DATA=${GROFF_TMPDIR}/pdf$$.ps + TC_DATA=${TMPDIR}/pdf$$.tc + BD_DATA=${TMPDIR}/pdf$$.ps # # Set a trap, to delete temporary files on exit. # (FIXME: may want to include other signals, in released version). # - trap "rm -f ${GROFF_TMPDIR}/pdf$$.*" 0 + trap "rm -f ${TMPDIR}/pdf$$.*" 0 # # Initialise 'groff' format control settings, # to discriminate table of contents and document body formatting passes. @@ -169,7 +169,7 @@ # to be passed on to 'groff', enforcing the '-Tps' option. # DIFF="" STREAM="" INPUT_FILES="" - SHOW_VERSION="" GROFF_STYLE="$GROFF -Tps" + SHOW_VERSION="" ROFF_STYLE="$ROFF -Tps" while test $# -gt 0 do case "$1" in @@ -209,17 +209,17 @@ Display a version identification message and exit. --report-progress - Enable console messages, indicating the progress of the + Enable console messages, indicating the progress of the PDF document formatting process. --emit-ps - Emit PostScript output instead of PDF; this may be useful + Emit PostScript output instead of PDF; this may be useful when the ultimate PDF output is to be generated by a more specialised postprocessor, (e.g. gpresent), rather than the default GhostScript PDF writer. --pdf-output=name - Write the PDF, (or PostScript), output stream to file + Write the PDF, (or PostScript), output stream to file 'name'; if this option is unspecified, standard output is used for PDF, (or PostScript), output. @@ -246,13 +246,13 @@ document processing. --stylesheet=name - Use the file 'name' as a 'groff' style sheet, to control + Use the file 'name' as a '@L_ROFF@' style sheet, to control the appearance of the document's front cover section. If this option is not specified, then no special formatting is applied, to create a front cover section. --no-toc-relocation - Suppress the multiple pass 'groff' processing, which is + Suppress the multiple pass '@L_ROFF@' processing, which is normally required to position the table of contents at the start of a PDF document. @@ -263,15 +263,15 @@ --keep-temporary-files Suppress the normal clean up of temporary files, which is - scheduled when 'pdfroff' completes. + scheduled when '@L_PDFROFF@' completes. ETX exit 0 ;; --version) - GROFF_STYLE="$GROFF_STYLE \"$1\"" - SHOW_VERSION="GNU pdfroff (groff) version @VERSION@" + ROFF_STYLE="$ROFF_STYLE \"$1\"" + SHOW_VERSION="@L_PDFROFF@ v@VERSION@" ;; --report-progress) @@ -283,7 +283,7 @@ ;; --emit-ps) - PDFROFF_POSTPROCESSOR_COMMAND="$CAT" + @U_PDFROFF@_POSTPROCESSOR_COMMAND="$CAT" ;; --pdf-output) @@ -303,7 +303,7 @@ ;; --stylesheet) - STYLESHEET="$OPTARG" CS_DATA=${GROFF_TMPDIR}/pdf$$.cs + STYLESHEET="$OPTARG" CS_DATA=${TMPDIR}/pdf$$.cs ;; --no-toc-relocation) @@ -311,7 +311,7 @@ ;; --no-kill-null-pages) - PDFROFF_COLLATE="$CAT" PDFROFF_KILL_NULL_PAGES="" + @U_PDFROFF@_COLLATE="$CAT" @U_PDFROFF@_KILL_NULL_PAGES="" ;; # # any other non-null match must have matched more than one defined case, @@ -336,9 +336,9 @@ # so set up a mechanism to achieve this, for ALL 'groff' passes. # - | -i*) - STREAM="$CAT ${GROFF_TMPDIR}/pdf$$.in |" + STREAM="$CAT ${TMPDIR}/pdf$$.in |" test "$1" = "-" && INPUT_FILES="$INPUT_FILES $1" \ - || GROFF_STYLE="$GROFF_STYLE $1" + || ROFF_STYLE="$ROFF_STYLE $1" ;; # # Those standard options which expect an argument, but are specified with @@ -372,7 +372,7 @@ # All other standard options are simply passed through to 'groff', # with no validation beforehand. # - -*) GROFF_STYLE="$GROFF_STYLE \"$1\"" + -*) ROFF_STYLE="$ROFF_STYLE \"$1\"" ;; # # All non-option arguments are considered as possible input file names, @@ -391,7 +391,7 @@ if test -n "$SHOW_VERSION" then echo >&2 "$SHOW_VERSION" - echo >&2; eval $GROFF_STYLE $INPUT_FILES + echo >&2; eval $ROFF_STYLE $INPUT_FILES exit $? fi # @@ -408,8 +408,8 @@ # or if no input files are specified, then we need to capture STDIN, # so we can replay it into each 'groff' processing pass. # - test -z "$INPUT_FILES" && STREAM="$CAT ${GROFF_TMPDIR}/pdf$$.in |" - test -n "$STREAM" && $CAT > ${GROFF_TMPDIR}/pdf$$.in + test -z "$INPUT_FILES" && STREAM="$CAT ${TMPDIR}/pdf$$.in |" + test -n "$STREAM" && $CAT > ${TMPDIR}/pdf$$.in # # Unless reference resolution is explicitly suppressed, # we initiate it by touching the cross reference dictionary file, @@ -426,12 +426,12 @@ # we need to have both the 'awk' and 'diff' programs available. # NO='' - if test -n "$GROFF_AWK_INTERPRETER" + if test -n "$@U_ROFF@_AWK_INTERPRETER" then - AWK="$GROFF_AWK_INTERPRETER" + AWK="$@U_ROFF@_AWK_INTERPRETER" test -f "$AWK" && test -x "$AWK" || AWK=":" else - for prog in @GROFF_AWK_INTERPRETERS@ + for prog in @AWK_INTERPRETERS@ do AWK=`searchpath $prog "$PATH"` test "$AWK" = ":" || break @@ -506,8 +506,8 @@ # filtering them into the reference dictionary; discard incomplete 'groff' output # at this stage. # - eval $STREAM $GROFF_STYLE -Z 1>$NULLDEV 2>$WRKFILE $REFCOPY $INPUT_FILES - $AWK '/^gropdf-info:href/ {$1 = ".pdfhref D -N"; print}' $WRKFILE > $REFFILE + eval $STREAM $ROFF_STYLE -Z 1>$NULLDEV 2>$WRKFILE $REFCOPY $INPUT_FILES + $AWK '/^pdfmark-info:href/ {$1 = ".pdfhref D -N"; print}' $WRKFILE > $REFFILE done $SAY >&2 " done" # @@ -523,12 +523,12 @@ # from which the PDF output will be compiled -- but before proceding further ... # let's make sure we have a GhostScript interpreter to convert them! # - if test -n "$GROFF_GHOSTSCRIPT_INTERPRETER" + if test -n "$@U_ROFF@_GHOSTSCRIPT_INTERPRETER" then - GS="$GROFF_GHOSTSCRIPT_INTERPRETER" + GS="$@U_ROFF@_GHOSTSCRIPT_INTERPRETER" test -f "$GS" && test -x "$GS" || GS=":" else - for prog in @GROFF_GHOSTSCRIPT_INTERPRETERS@ + for prog in @GHOSTSCRIPT_INTERPRETERS@ do GS=`searchpath $prog "$PATH"` test "$GS" = ":" || break @@ -554,7 +554,7 @@ # We now extend the local copy of the reference dictionary file, # to create a full 'pdfmark' reference map for the document ... # - $AWK '/^grohtml-info/ {print ".pdfhref Z", $2, $3, $4}' $WRKFILE >> $REFCOPY + $AWK '/^@L_D_HTML@-info/ {print ".pdfhref Z", $2, $3, $4}' $WRKFILE >> $REFCOPY # # Re-enable progress reporting, if necessary ... # (Missing 'awk' or 'diff' may have disabled it, to avoid display @@ -571,7 +571,7 @@ CS_MACRO=${CS_MACRO-"CS"} CE_MACRO=${CE_MACRO-"CE"} $SAY >&2 $n "Formatting document ... front cover section ..$c" CS_FILTER="$STREAM $SED -n '/${DOT}${CS_MACRO}/,/${DOT}${CE_MACRO}/p'" - eval $CS_FILTER $INPUT_FILES | eval $GROFF_STYLE $STYLESHEET - > $CS_DATA + eval $CS_FILTER $INPUT_FILES | eval $ROFF_STYLE $STYLESHEET - > $CS_DATA $SAY >&2 ". done" fi # @@ -581,14 +581,14 @@ if test -n "$TC_DATA" then $SAY >&2 $n "Formatting document ... table of contents ..$c" - eval $STREAM $GROFF_STYLE $TOC_FORMAT $REFCOPY $INPUT_FILES > $TC_DATA + eval $STREAM $ROFF_STYLE $TOC_FORMAT $REFCOPY $INPUT_FILES > $TC_DATA $SAY >&2 ". done" fi # # In all cases, a final 'groff' pass is required, to format the document body. # $SAY >&2 $n "Formatting document ... body section ..$c" - eval $STREAM $GROFF_STYLE $BODY_FORMAT $REFCOPY $INPUT_FILES > $BD_DATA + eval $STREAM $ROFF_STYLE $BODY_FORMAT $REFCOPY $INPUT_FILES > $BD_DATA $SAY >&2 ". done" # # Finally ... @@ -596,9 +596,9 @@ # PostScript intermediate files into a single PDF output file. # $SAY >&2 $n "Writing PDF output ..$c" - if test -z "$PDFROFF_POSTPROCESSOR_COMMAND" + if test -z "$@U_PDFROFF@_POSTPROCESSOR_COMMAND" then - PDFROFF_POSTPROCESSOR_COMMAND="$GS -dQUIET -dBATCH -dNOPAUSE + @U_PDFROFF@_POSTPROCESSOR_COMMAND="$GS -dQUIET -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile="${PDF_OUTPUT-"-"} elif test -n "$PDF_OUTPUT" @@ -608,7 +608,7 @@ # # (This 'sed' script is a hack, to eliminate redundant blank pages). # - ${PDFROFF_COLLATE-"$SED"} ${PDFROFF_KILL_NULL_PAGES-' + ${@U_PDFROFF@_COLLATE-"$SED"} ${@U_PDFROFF@_KILL_NULL_PAGES-' /%%Page:/{ N /%%BeginPageSetup/b again @@ -624,8 +624,7 @@ :finish N /^%%Page:.*\n0 Cg EP$/d - '} $TC_DATA $BD_DATA | $PDFROFF_POSTPROCESSOR_COMMAND $CS_DATA - + '} $TC_DATA $BD_DATA | $@U_PDFROFF@_POSTPROCESSOR_COMMAND $CS_DATA - $SAY >&2 ". done" -# -# ------------------------------------------------------------------------------ -# $RCSfile$ $Revision$: end of file + +# s-sh-mode diff --git a/contrib/pdfmark/spdf.tmac b/contrib/pdfmark/spdf.tmac index 52bde168..2f36099a 100644 --- a/contrib/pdfmark/spdf.tmac +++ b/contrib/pdfmark/spdf.tmac @@ -1,14 +1,12 @@ -.\" -*- nroff -*- .ig +@ spdf.tmac -spdf.tmac +Copyright (c) 2014 Steffen (Daode) Nurpmeso . Copyright (C) 2004 Free Software Foundation, Inc. Written by Keith Marshall (keith.d.marshall@ntlworld.com) -This file is part of groff. - groff is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later @@ -22,7 +20,6 @@ for more details. You should have received a copy of the GNU General Public License along with groff; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. - .. .\" .if !rOPMODE .nr OPMODE 1 @@ -222,4 +219,4 @@ The content for this section is not yet available. . .pdfhref I -PT pg@bottom .\" -.\" spdf.tmac: end of file: vim: ft=groff +.\" s-tr-mode -- 2.11.4.GIT