Debian Codegraph @

upstream/debian-trixie/man1/pic2graph.1

raw
1 .TH pic2graph 1 "3 June 2025" "groff 1.23.0"
2 .SH Name
3 pic2graph \- convert a
4 .I pic
5 diagram into a cropped image
6 .
7 .
8 .\" ====================================================================
9 .\" Legal Terms
10 .\" ====================================================================
11 .\"
12 .\" This documentation is released to the public domain.
13 .
14 .
15 .\" Save and disable compatibility mode (for, e.g., Solaris 10/11).
16 .do nr *groff_pic2graph_1_man_C \n[.cp]
17 .cp 0
18 .
19 .\" Define fallback for groff 1.23's MR macro if the system lacks it.
20 .nr do-fallback 0
21 .if !\n(.f .nr do-fallback 1 \" mandoc
22 .if \n(.g .if !d MR .nr do-fallback 1 \" older groff
23 .if !\n(.g .nr do-fallback 1 \" non-groff *roff
24 .if \n[do-fallback] \{\
25 . de MR
26 . ie \\n(.$=1 \
27 . I \%\\$1
28 . el \
29 . IR \%\\$1 (\\$2)\\$3
30 . .
31 .\}
32 .rr do-fallback
33 .
34 .
35 .\" ====================================================================
36 .SH Synopsis
37 .\" ====================================================================
38 .
39 .SY pic2graph
40 .RB [ \-unsafe ]
41 .RB [ \-format\~\c
42 .IR output-format ]
43 .RB [ \-eqn\~\c
44 .IR delimiters ]
45 .RI [ convert-argument \~.\|.\|.]
46 .YS
47 .
48 .
49 .SY pic2graph
50 .B \-\-help
51 .YS
52 .
53 .
54 .SY pic2graph
55 .B \-v
56 .
57 .SY pic2graph
58 .B \-\-version
59 .YS
60 .
61 .
62 .\" ====================================================================
63 .SH Description
64 .\" ====================================================================
65 .
66 .I pic2graph
67 reads a
68 .MR \%pic 1
69 program from the standard input and writes an image file,
70 by default in Portable Network Graphics (PNG) format,
71 to the standard output.
72 .
73 It furthermore translates
74 .MR \%eqn 1
75 constructs, so it can be used for generating images of mathematical
76 formulae.
77 .
78 .
79 .PP
80 The input PIC code should
81 .I not
82 be wrapped with the
83 .B .PS
84 and
85 .BR .PE / .PF
86 macros that normally guard it within
87 .MR groff 1
88 documents.
89 .
90 .
91 .\" FIXME: How old? This text hasn't been touched since 2008 at latest.
92 .\" Older versions of
93 .\" .I \%convert
94 .\" will produce a black-on-white graphic; newer ones may produce a
95 .\" black-on-transparent graphic.
96 .
97 .PP
98 Arguments not recognized by
99 .I pic2graph
100 are passed to the ImageMagick or GraphicsMagick program
101 .MR convert 1 .
102 .
103 .
104 By specifying these, you can give your image a border,
105 .\" Transparent backgrounds are the default in 2018.
106 .\" force the background transparent,
107 set the image's pixel density,
108 or perform other useful transformations.
109 .
110 .
111 .PP
112 The output image is clipped using
113 .IR \%convert 's
114 .B \-trim
115 option to the smallest possible bounding box that contains all the black
116 pixels.
117 .
118 .
119 .\" ====================================================================
120 .SH Options
121 .\" ====================================================================
122 .
123 .B \-\-help
124 displays a usage message,
125 while
126 .B \-v
127 and
128 .B \-\-version
129 show version information;
130 all exit afterward.
131 .
132 .TP
133 .BI \-eqn\~ delimiters
134 Use
135 .I delimiters
136 as the opening and closing
137 characters that delimit
138 .I \%eqn
139 directives;
140 the default is \(lq$$\(rq.
141 .
142 The option argument
143 .I delimiters
144 should be a two-character string,
145 but an empty string (\(dq\(dq) is accepted as a directive to disable
146 .I \%eqn
147 processing.
148 .
149 .
150 .TP
151 .BI \-format\~ output-format
152 Write the image in
153 .IR output-format ,
154 which must be understood by
155 .IR \%convert ;
156 the default is PNG.
157 .
158 .
159 .TP
160 .B \-unsafe
161 Run
162 .I groff
163 in
164 .I unsafe
165 mode, enabling the PIC command
166 .B sh
167 to execute arbitrary Unix shell commands.
168 .
169 The
170 .I groff
171 default is to forbid this.
172 .
173 .
174 .\" ====================================================================
175 .SH Environment
176 .\" ====================================================================
177 .
178 .TP
179 .I \%GROFF_TMPDIR
180 .TQ
181 .I \%TMPDIR
182 .TQ
183 .I TMP
184 .TQ
185 .I TEMP
186 These environment variables are searched in the given order to determine
187 the directory where temporary files will be created.
188 .
189 If none are set,
190 .I /tmp
191 is used.
192 .
193 .
194 .\" ====================================================================
195 .SH Authors
196 .\" ====================================================================
197 .
198 .I pic2graph
199 was written by
200 .MT esr@\:thyrsus\:.com
201 Eric S.\& Raymond
202 .ME ,
203 based on a recipe by W.\& Richard Stevens.
204 .
205 .
206 .\" ====================================================================
207 .SH "See also"
208 .\" ====================================================================
209 .
210 W.\& Richard Stevens,
211 .UR http://\:www\:.kohala\:.com/\:start/\:troff/\:pic2html\:.html
212 .I Turning PIC into HTML
213 .UE
214 .
215 .
216 .PP
217 .MR eqn2graph 1 ,
218 .MR grap2graph 1 ,
219 .MR \%pic 1 ,
220 .MR \%eqn 1 ,
221 .MR groff 1 ,
222 .MR convert 1
223 .
224 .
225 .\" Restore compatibility mode (for, e.g., Solaris 10/11).
226 .cp \n[*groff_pic2graph_1_man_C]
227 .do rr *groff_pic2graph_1_man_C
228 .
229 .
230 .\" Local Variables:
231 .\" fill-column: 72
232 .\" mode: nroff
233 .\" End:
234 .\" vim: set filetype=groff textwidth=72: