groff: update vendor branch to v1.20.1
[dragonfly.git] / contrib / groff / contrib / pdfmark / pdfroff.man
CommitLineData
465b256c
JR
1.TH PDFROFF @MAN1EXT@ "@MDATE@" "Groff Version @VERSION@"
2.\" --------------------------------------------------------------------
3.\" Legal Matters
4.\" --------------------------------------------------------------------
5.ig
6pdfroff.1
7
8File position: <groff-source>/contrib/pdfmark/pdfroff.man
9
4d3e9548 10Last update: 5 Jan 2009
465b256c
JR
11
12This file is part of groff, the GNU roff type-setting system.
13
4d3e9548 14Copyright (C) 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
465b256c
JR
15written by Keith Marshall <keith.d.marshall@ntlworld.com>
16
17Permission is granted to copy, distribute and/or modify this document
4d3e9548 18under the terms of the GNU Free Documentation License, Version 1.3 or
465b256c
JR
19any later version published by the Free Software Foundation; with no
20Front-Cover Texts, no Back-Cover Texts, and the following Invariant
21Sections:--
22
23 a) This "Legal Matters" section, extending from the start of
24 the document, to the end of the enclosing ".ig" section.
25
26 b) The entire section bearing the heading "AUTHOR", extending
27 from the ".SH AUTHOR" tag, to the end of the document.
28
29A copy of the Free Documentation License is included as a file called
30FDL in the main directory of the groff source package.
31..
465b256c 32.
4d3e9548
JL
33.
34.\" --------------------------------------------------------------------
35.\" Local macro definitions
465b256c
JR
36.
37.hw pdfmark
4d3e9548
JL
38.
39.de NH
40. hy 0
465b256c 41\&\\$*
4d3e9548 42. hy
465b256c 43..
4d3e9548
JL
44.
45.
46.\" --------------------------------------------------------------------
47.
48.SH NAME
49.
50pdfroff \- create PDF documents using groff
51.
52.
465b256c
JR
53.\" --------------------------------------------------------------------
54.
55.SH SYNOPSIS
4d3e9548
JL
56.
57.SY pdfroff
58.OP \-abcegilpstzCEGNRSUVXZ
59.OP \-d cs
60.OP \-f fam
61.OP \-F dir
62.OP \-I dir
63.OP \-L arg
64.OP \-m name
65.OP \-M dir
66.OP \-n num
67.OP \-o list
68.OP \-P arg
69.OP \-r cn
70.OP \-T dev
71.OP \-w name
72.OP \-W name
73.OP \-\-emit\-ps
74.OP \-\-no\-toc\-relocation
75.OP \-\-no-kill\-null\-pages
76.OP \-\-stylesheet=\fIname\fP
77.OP \-\-no\-pdf\-output
78.OP \-\-pdf\-output=\fIname\fP
79.OP \-\-no\-reference\-dictionary
80.OP \-\-reference\-dictionary=\fIname\fP
81.OP \-\-report\-progress
82.OP \-\-keep\-temporary\-files
83.I file .\|.\|.
84.
85.SY pdfroff
86.B \-h
465b256c 87|
4d3e9548
JL
88.B \-\-help
89.
90.SY pdfroff
91.B \-v
465b256c 92|
4d3e9548
JL
93.B \-\-version
94.RI [ option\ .\|.\|. ]
95.YS
96.
465b256c
JR
97.
98.\" --------------------------------------------------------------------
99.
100.SH DESCRIPTION
4d3e9548 101.
465b256c
JR
102.B pdfroff
103is a wrapper program for the GNU text processing system,
104.BR groff .
105It transparently handles the mechanics of multiple pass
106.B groff
107processing, when applied to suitably marked up
108.B groff
109source files,
110such that tables of contents and body text are formatted separately,
111and are subsequently combined in the correct order, for final publication
112as a single PDF document.
113A further optional
4d3e9548 114\*(lqstyle sheet\*(rq
465b256c 115capability is provided;
4d3e9548 116this allows for the definition of content which is required to precede the
465b256c 117table of contents, in the published document.
4d3e9548 118.
465b256c
JR
119.P
120For each invocation of
121.BR pdfroff ,
122the ultimate
123.B groff
4d3e9548 124output stream is post-processed by the GhostScript interpreter,
465b256c 125to produce a finished PDF document.
4d3e9548 126.
465b256c
JR
127.P
128.B pdfroff
129makes no assumptions about, and imposes no restrictions on,
130the use of any
131.B groff
132macro packages which the user may choose to employ,
133in order to achieve a desired document format;
134however, it
135.I does
136include specific built in support for the
137.B pdfmark
138macro package, should the user choose to employ it.
139Specifically, if the
140.I pdfhref
141macro, defined in the
142.B pdfmark.tmac
143package, is used to define public reference marks,
144or dynamic links to such reference marks, then
145.B pdfroff
4d3e9548 146performs as many preformatting
465b256c
JR
147.B groff
148passes as required, up to a maximum limit of
149.IR four ,
150in order to compile a document reference dictionary,
151to resolve references, and to expand the dynamically defined
152content of links.
153.
4d3e9548 154.
465b256c
JR
155.\" --------------------------------------------------------------------
156.
157.SH USAGE
4d3e9548
JL
158.
159The command line is parsed in accordance with normal GNU conventions,
160but with one exception \(em when specifying any short form option
161(i.e., a single character option introduced by a single hyphen),
162and if that option expects an argument, then it
163.I must
164be specified independently (i.e., it may
165.I not
166be appended to any group of other single character short form options).
167.
168.P
169Long form option names (i.e., those introduced by a double hyphen)
170may be abbreviated to their minimum length unambiguous initial
171substring.
172.
173.P
174Otherwise,
465b256c
JR
175.B pdfroff
176usage closely mirrors that of
177.B groff
178itself.
179Indeed,
180with the exception of the
181.BR \-h ,
182.BR \-v ,
183and
4d3e9548 184.BI \-T \ dev
465b256c
JR
185short form options, and
186all long form options,
187which are parsed internally by
188.BR pdfroff ,
189all options and file name arguments specified on the command line are
190passed on to
191.BR groff ,
192to control the formatting of the PDF document.
193Consequently,
194.B pdfroff
195accepts all options and arguments, as specified in
196.BR groff (@MAN1EXT@),
197which may also be considered as the definitive reference for all standard
198.BR pdfroff
199options and argument usage.
200.
4d3e9548 201.
465b256c
JR
202.\" --------------------------------------------------------------------
203.
204.SH OPTIONS
4d3e9548 205.
465b256c
JR
206.B pdfroff
207accepts all of the short form options
208(i.e., those introduced by a single hyphen),
209which are available with
210.B groff
211itself.
212In most cases, these are simply passed transparently to
213.BR groff ;
214the following, however, are handled specially by
215.BR pdfroff .
4d3e9548 216.
465b256c
JR
217.TP
218.B \-h
219Same as
220.BR \-\-help ;
221see below.
4d3e9548 222.
465b256c
JR
223.TP
224.B \-i
225Process standard input, after all other specified input files.
226This is passed transparently to
227.BR groff ,
228but, if grouped with other options, it
229.I must
230be the first in the group.
4d3e9548
JL
231Hiding it within a group
232breaks standard input processing, in the multiple pass
465b256c
JR
233.B groff
234processing context of
235.BR pdfroff .
4d3e9548 236.
465b256c 237.TP
4d3e9548 238.BI \-T \ dev
465b256c 239Only
4d3e9548 240.B \-T\ ps
465b256c
JR
241is supported by
242.BR pdfroff .
4d3e9548 243Attempting to specify any other device causes
465b256c
JR
244.B pdfroff
245to abort.
4d3e9548 246.
465b256c
JR
247.TP
248.B \-v
249Same as
250.BR \-\-version ;
251see below.
4d3e9548 252.
465b256c
JR
253.P
254See
255.BR groff (@MAN1EXT@)
256for a description of all other short form options,
257which are transparently passed through
258.BR pdfroff
259to
260.BR groff .
4d3e9548 261.
465b256c
JR
262.P
263All long form options
264(i.e., those introduced by a double hyphen)
265are interpreted locally by
266.BR pdfroff ;
267they are
268.B not
269passed on to
270.BR groff ,
271unless otherwise stated below.
4d3e9548 272.
465b256c
JR
273.TP
274.B \-\-help
275Causes
276.B pdfroff
277to display a summary of the its usage syntax, and supported options,
278and then exit.
4d3e9548
JL
279.
280.TP
281.B \-\-emit\-ps
282Suppresses the final output conversion step,
283causing
284.B pdfroff
285to emit PostScript output instead of PDF.
286This may be useful,
287to capture intermediate PostScript output,
288when using a specialised postprocessor,
289such as
290.I gpresent
291for example,
292in place of the default
293.I GhostScript
294PDF writer.
295.
296.TP
297.B \-\-keep\-temporary\-files
298Suppresses the deletion of temporary files,
299which normally occurs after
300.B pdfroff
301has completed PDF document formatting;
302this may be useful,
303when debugging formatting problems.
304.IP
305See section
306.BR FILES ,
307for a description of the temporary files used by
308.BR pdfroff .
309.
465b256c
JR
310.TP
311.B \-\-no\-pdf\-output
312May be used with the
4d3e9548 313.BI \%\-\-reference\-dictionary= name
465b256c
JR
314option (described below) to eliminate the overhead of PDF formatting,
315when running
316.B pdfroff
317to create a reference dictionary, for use in a different document.
4d3e9548 318.
465b256c
JR
319.TP
320.B \-\-no\-reference\-dictionary
321May be used to eliminate the overhead of creating a reference dictionary,
4d3e9548 322when it is known that the target PDF document contains no public
465b256c
JR
323references, created by the
324.I pdfhref
325macro.
4d3e9548 326.
465b256c
JR
327.TP
328.B \-\-no\-toc\-relocation
329May be used to eliminate the extra
330.B groff
331processing pass,
332which is required to generate a table of contents,
333and relocate it to the start of the PDF document,
334when processing any document which lacks an automatically
335generated table of contents.
4d3e9548
JL
336.
337.TP
338.B \-\-no\-kill\-null\-pages
339While preparing for simulation of the manual collation step,
340which is traditionally required to relocate of a
341.I "table of contents"
342to the start of a document,
343.B pdfroff
344accumulates a number of empty page descriptions
345into the intermediate
346.I PostScript
347output stream.
348During the final collation step,
349these empty pages are normally discarded from the finished document;
350this option forces
351.B pdfroff
352to leave them in place.
353.
465b256c
JR
354.TP
355.BI \-\-pdf\-output= name
356Specifies the name to be used for the resultant PDF document;
357if unspecified, the PDF output is written to standard output.
358A future version of
359.B pdfroff
360may use this option,
361to encode the document name in a generated reference dictionary.
4d3e9548 362.
465b256c
JR
363.TP
364.BI \-\-reference\-dictionary= name
365Specifies the name to be used for the generated reference dictionary file;
366if unspecified, the reference dictionary is created in a temporary file,
367which is deleted when
368.B pdfroff
369completes processing of the current document.
370This option
371.I must
372be specified, if it is desired to save the reference dictionary,
373for use in references placed in other PDF documents.
4d3e9548 374.
465b256c
JR
375.TP
376.B \-\-report\-progress
377Causes
378.B pdfroff
379to display an informational message on standard error,
380at the start of each
381.B groff
382processing pass.
4d3e9548 383.
465b256c
JR
384.TP
385.BI \-\-stylesheet= name
386Specifies the name of an
387.IR "input file" ,
388to be used as a style sheet for formatting of content,
389which is to be placed
390.I before
391the table of contents,
392in the formatted PDF document.
4d3e9548 393.
465b256c
JR
394.TP
395.B \-\-version
396Causes
397.B pdfroff
398to display a version identification message.
399The entire command line is then passed transparently to
400.BR groff ,
401in a
402.I one
403pass operation
404.IR only ,
405in order to display the associated
406.B groff
407version information, before exiting.
408.
4d3e9548 409.
465b256c
JR
410.\" --------------------------------------------------------------------
411.
412.SH ENVIRONMENT
413The following environment variables may be set, and exported,
414to modify the behaviour of
415.BR pdfroff .
4d3e9548
JL
416.
417.TP
418.B PDFROFF_COLLATE
419Specifies the program to be used
420for collation of the finshed PDF document.
421.IP
422This collation step may be required to move
423.I tables of contents
424to the start of the finished PDF document,
425when formatting with traditional macro packages,
426which print them at the end.
427However,
428users should not normally need to specify
429.BR \%PDFROFF_COLLATE ,
430(and indeed,
431are not encouraged to do so).
432If unspecified,
433.B pdfroff
434uses
435.BR sed (@MAN1EXT@)
436by default,
437which normally suffices.
438.IP
439If
440.B \%PDFROFF_COLLATE
441.I is
442specified,
443then it must act as a filter,
444accepting a list of file name arguments,
445and write its output to the
446.I stdout
447stream,
448whence it is piped to the
449.BR \%PDFROFF_POSTPROCESSOR_COMMAND ,
450to produce the finished PDF output.
451.IP
452When specifying
453.BR \%PDFROFF_COLLATE ,
454it is normally necessary to also specify
455.BR \%PDFROFF_KILL_NULL_PAGES .
456.IP
457.B \%PDFROFF_COLLATE
458is ignored,
459if
460.B pdfroff
461is invoked with the
462.I \%\-\-no\-kill\-null\-pages
463option.
464.
465.TP
466.B PDFROFF_KILL_NULL_PAGES
467Specifies options to be passed to the
468.B \%PDFROFF_COLLATE
469program.
470.IP
471It should not normally be necessary to specify
472.BR \%PDFROFF_KILL_NULL_PAGES .
473The internal default is a
474.BR sed (@MAN1EXT@)
475script,
476which is intended to remove completely blank pages
477from the collated output stream,
478and which should be appropriate in most applications of
479.BR pdfroff .
480However,
481if any alternative to
482.BR sed (@MAN1EXT@)
483is specified for
484.BR \%PDFROFF_COLLATE ,
485then it is likely that a corresponding alternative specification for
486.B \%PDFROFF_KILL_NULL_PAGES
487is required.
488.IP
489As in the case of
490.BR \%PDFROFF_COLLATE ,
491.B \%PDFROFF_KILL_NULL_PAGES
492is ignored,
493if
494.B pdfroff
495is invoked with the
496.I \%\-\-no\-kill\-null\-pages
497option.
498.
499.TP
500.B PDFROFF_POSTPROCESSOR_COMMAND
501Specifies the command to be used for the final document conversion
502from PostScript intermediate output to PDF.
503It must behave as a filter,
504writing its output to the
505.I stdout
506stream,
507and must accept an arbitrary number of
508.I files .\|.\|.\&
509arguments,
510with the special case of
511.I \-
512representing the
513.I stdin
514stream.
515.IP
516If unspecified,
517.B \%PDFROFF_POSTPROCESSOR_COMMAND
518defaults to
519.
520.RS 2
521.IP
522.I
523.ad l
524.NH gs \-dBATCH \-dQUIET \-dNOPAUSE \-sDEVICE=pdfwrite \-sOutputFile=\-
525.ad
526.RE
527.
465b256c
JR
528.TP
529.B GROFF_TMPDIR
530Identifies the directory in which
531.B pdfroff
532should create temporary files.
533If
4d3e9548 534.B \%GROFF_TMPDIR
465b256c
JR
535is
536.I not
537specified, then the variables
538.BR TMPDIR ,
539.B TMP
540and
541.B TEMP
542are considered in turn, as possible temporary file repositories.
4d3e9548 543If none of these are set, then temporary files are created
465b256c 544in the current directory.
4d3e9548 545.
465b256c
JR
546.TP
547.B GROFF_GHOSTSCRIPT_INTERPRETER
548Specifies the program to be invoked, when
549.B pdfroff
550converts
551.B groff
552PostScript output to PDF.
553If
4d3e9548
JL
554.B \%PDFROFF_POSTPROCESSOR_COMMAND
555is specified,
556then the command name it specifies is
557.I implicitly
558assigned to
559.BR \%GROFF_GHOSTSCRIPT_INTERPRETER ,
560overriding any explicit setting specified in the environment.
561If
562.B \%GROFF_GHOSTSCRIPT_INTERPRETER
465b256c
JR
563is not specified, then
564.B pdfroff
4d3e9548 565searches the process
465b256c
JR
566.BR PATH ,
567looking for a program with any of the well known names
568for the GhostScript interpreter;
569if no GhostScript interpreter can be found,
570.B pdfroff
4d3e9548
JL
571aborts.
572.
465b256c
JR
573.TP
574.B GROFF_AWK_INTERPRETER
575Specifies the program to be invoked, when
576.B pdfroff
577is extracting reference dictionary entries from a
578.B groff
579intermediate message stream.
580If
4d3e9548 581.B \%GROFF_AWK_INTERPRETER
465b256c
JR
582is not specified, then
583.B pdfroff
4d3e9548 584searches the process
465b256c
JR
585.BR PATH ,
586looking for any of the preferred programs, `gawk', `mawk', `nawk'
587and `awk', in this order;
588if none of these are found,
589.B pdfroff
4d3e9548
JL
590issues a warning message, and continue processing;
591however, in this case, no reference dictionary is created.
592.
465b256c
JR
593.TP
594.B OSTYPE
595Typically defined automatically by the operating system,
596.B OSTYPE
4d3e9548 597is used on Microsoft Win32/MS-DOS platforms
465b256c
JR
598.IR only ,
599to infer the default
4d3e9548 600.B \%PATH_SEPARATOR
465b256c
JR
601character,
602which is used when parsing the process
603.B PATH
604to search for external helper programs.
4d3e9548 605.
465b256c
JR
606.TP
607.B PATH_SEPARATOR
608If set,
4d3e9548 609.B \%PATH_SEPARATOR
465b256c 610overrides the default separator character,
4d3e9548 611(`:' on POSIX/UNIX systems,
465b256c
JR
612inferred from
613.B OSTYPE
4d3e9548 614on Microsoft Win32/MS-DOS),
465b256c
JR
615which is used when parsing the process
616.B PATH
617to search for external helper programs.
4d3e9548 618.
465b256c
JR
619.TP
620.B SHOW_PROGRESS
621If this is set to a non-empty value, then
622.B pdfroff
4d3e9548
JL
623always behaves as if the
624.B \%\-\-report\-progress
465b256c
JR
625option is specified, on the command line.
626.
4d3e9548 627.
465b256c
JR
628.\" --------------------------------------------------------------------
629.
630.SH FILES
631Input and output files for
632.B pdfroff
633may be named according to any convention of the user's choice.
634Typically, input files may be named according to the choice of the
635principal formatting macro package, e.g.,
636.IB file .ms
637might be an input file for formatting using the
638.B ms
639macros
640.RB ( s.tmac );
641normally, the final output file should be named
642.IB file .pdf\c
643\&.
4d3e9548 644.
465b256c
JR
645.P
646Temporary files, created by
647.BR pdfroff ,
648are placed in the directory specified by environment variables (see
649section
650.BR ENVIRONMENT ),
651and named according to the convention
652.BI pdf $$ .*\c
653\&, where
654.I $$
655is the standard shell variable representing the process ID of the
656.B pdfroff
657process itself, and
658.I *
4d3e9548 659represents any of the extensions used by
465b256c 660.B pdfroff
4d3e9548
JL
661to identify the following temporary and intermediate files.
662.
663.TP
664.BI pdf $$ .tmp
665A scratch pad file,
666used to capture reference data emitted by
667.BR groff ,
668during the
669.I reference dictionary
670compilation phase.
671.
672.TP
673.BI pdf $$ .ref
674The
675.IR "reference dictionary" ,
676as compiled in the last but one pass of the
677.I reference dictionary
678compilation phase;
679(at the start of the first pass,
680this file is created empty;
681in successive passes,
682it contains the
683.I reference dictionary
684entries,
685as collected in the preceding pass).
686.IP
687If the
688.BR \%\-\-reference\-dictionary =\c
689.I name
690option is specified,
691this intermediate file becomes permanent,
692and is named
693.IR name ,
694rather than
695.BI pdf $$ .ref\c
696\&.
697.
698.TP
699.BI pdf $$ .cmp
700Used to collect
701.I reference dictionary
702entries during the active pass of the
703.I reference dictionary
704compilation phase.
705At the end of any pass,
706when the content of
707.BI pdf $$ .cmp
708compares as identical to
709.BI pdf $$ .ref\c
710\&,
711(or the corresponding file named by the
712.BR \%\-\-reference\-dictionary =\c
713.I name
714option),
715then
716.I reference dictionary
717compilation is terminated,
718and the
719.I document reference map
720is appended to this intermediate file,
721for inclusion in the final formatting passes.
722.
723.TP
724.BI pdf $$ .tc
725An intermediate
726.I PostScript
727file,
728in which \*(lqTable of Contents\*(rq entries are collected,
729to facilitate relocation before the body text,
730on ultimate output to the
731.I GhostScript
732postprocessor.
733.
734.TP
735.BI pdf $$ .ps
736An intermediate
737.I PostScript
738file,
739in which the body text is collected prior to ultimate output to the
740.I GhostScript
741postprocessor,
742in the proper sequence,
743.I after
744.BI pdf $$ .tc\c
745\&.
746.
465b256c
JR
747.
748.\" --------------------------------------------------------------------
749.
750.SH SEE ALSO
751See
752.BR groff (@MAN1EXT@)
753for the definitive reference to document formatting with
754.BR groff .
755Since
756.B pdfroff
757provides a superset of all
758.B groff
759capabilities,
760.BR groff (@MAN1EXT@)
761may also be considered to be the definitive reference to all
762.I standard
763capabilities of
764.BR pdfroff ,
765with this document providing the reference to
766.BR pdfroff 's
767extended features.
4d3e9548 768.
465b256c
JR
769.P
770While
771.B pdfroff
772imposes neither any restriction on, nor any requirement for,
773the use of any specific
774.B groff
775macro package, a number of supplied macro packages,
776and in particular those associated with the package
777.BR pdfmark.tmac ,
778are best suited for use with
779.BR pdfroff
780as the preferred formatter.
781Detailed documentation on the use of these packages may be found,
782in PDF format, in the reference guide
783.BR "\*(lqPortable Document Format Publishing with GNU Troff\*(rq" ,
784included in the installed documentation set as
4d3e9548
JL
785.BR \%@PDFDOCDIR@/pdfmark.pdf .
786.
465b256c
JR
787.
788.\" --------------------------------------------------------------------
789.
790.SH AUTHOR
4d3e9548
JL
791Copyright \(co 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
792.
793.P
465b256c 794This man page is distributed under the terms of the
4d3e9548 795GNU Free Documentation License (FDL), version 1.3 or later,
465b256c
JR
796and is part of the
797.I GNU troff
798software package.
4d3e9548
JL
799It was originally written by
800.MT keith.d.marshall@\:ntlworld.com
801Keith Marshall
802.ME ,
465b256c
JR
803who also wrote the implementation of the
804.I pdfroff
805program, to which it relates.
4d3e9548
JL
806.
807.P
465b256c
JR
808You should have received a copy of the FDL as part of the
809.I GNU troff
4d3e9548
JL
810distribution; it is also available on\-line, at
811.UR http://\:www.gnu.org/\:copyleft/\:fdl.html
812the GNU copyleft site
813.UE .
465b256c
JR
814.
815.\" --------------------------------------------------------------------
816.\" EOF / vim: ft=groff