Debian Codegraph @

upstream/debian-trixie/man1/grap2graph.1

raw
1 .TH grap2graph 1 "3 June 2025" "groff 1.23.0"
2 .SH Name
3 grap2graph \- convert a
4 .I grap
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_grap2graph_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 grap2graph
40 .RB [ \-unsafe ]
41 .RB [ \-format\~\c
42 .IR output-format ]
43 .RI [ convert-argument \~.\|.\|.]
44 .YS
45 .
46 .
47 .SY grap2graph
48 .B \-\-help
49 .YS
50 .
51 .
52 .SY grap2graph
53 .B \-v
54 .
55 .SY grap2graph
56 .B \-\-version
57 .YS
58 .
59 .
60 .\" ====================================================================
61 .SH Description
62 .\" ====================================================================
63 .
64 .I grap2graph
65 reads a
66 .MR grap 1
67 program from the standard input and writes an image file,
68 by default in Portable Network Graphics (PNG) format,
69 to the standard output.
70 .
71 .
72 .PP
73 The input GRAP code should
74 .I not
75 be wrapped with the
76 .B .G1
77 and
78 .B .G2
79 macros that normally guard it within
80 .MR groff 1
81 documents.
82 .
83 .
84 .\" FIXME: How old? This text hasn't been touched since 2008 at latest.
85 .\" Older versions of
86 .\" .I \%convert
87 .\" will produce a black-on-white graphic; newer ones may produce a
88 .\" black-on-transparent graphic.
89 .
90 .PP
91 Arguments not recognized by
92 .I grap2graph
93 are passed to the ImageMagick or GraphicsMagick program
94 .MR convert 1 .
95 .
96 .
97 By specifying these, you can give your image a border,
98 .\" Transparent backgrounds are the default in 2018.
99 .\" force the background transparent,
100 set the image's pixel density,
101 or perform other useful transformations.
102 .
103 .
104 .PP
105 The output image is clipped using
106 .IR \%convert 's
107 .B \-trim
108 option to the smallest possible bounding box that contains all the black
109 pixels.
110 .
111 .
112 .\" ====================================================================
113 .SH Options
114 .\" ====================================================================
115 .
116 .B \-\-help
117 displays a usage message,
118 while
119 .B \-v
120 and
121 .B \-\-version
122 show version information;
123 all exit afterward.
124 .
125 .
126 .TP
127 .BI \-format\~ output-format
128 Write the image in
129 .IR output-format ,
130 which must be understood by
131 .IR \%convert ;
132 the default is PNG.
133 .
134 .
135 .TP
136 .B \-unsafe
137 Run
138 .I groff
139 in
140 .I unsafe
141 mode, enabling the PIC command
142 .B sh
143 to execute arbitrary Unix shell commands.
144 .
145 The
146 .I groff
147 default is to forbid this.
148 .
149 .
150 .\" ====================================================================
151 .SH Environment
152 .\" ====================================================================
153 .
154 .TP
155 .I \%GROFF_TMPDIR
156 .TQ
157 .I \%TMPDIR
158 .TQ
159 .I TMP
160 .TQ
161 .I TEMP
162 These environment variables are searched in the given order to determine
163 the directory where temporary files will be created.
164 .
165 If none are set,
166 .I /tmp
167 is used.
168 .
169 .
170 .\" ====================================================================
171 .SH Authors
172 .\" ====================================================================
173 .
174 .I grap2graph
175 was written by
176 .MT esr@\:thyrsus\:.com
177 Eric S.\& Raymond
178 .ME ,
179 based on a recipe for
180 .MR pic2graph 1 ,
181 by W.\& Richard Stevens.
182 .
183 .
184 .\" ====================================================================
185 .SH "See also"
186 .\" ====================================================================
187 .
188 .MR pic2graph 1 ,
189 .MR eqn2graph 1 ,
190 .MR grap 1 ,
191 .MR \%pic 1 ,
192 .MR groff 1 ,
193 .MR convert 1
194 .
195 .
196 .\" Restore compatibility mode (for, e.g., Solaris 10/11).
197 .cp \n[*groff_grap2graph_1_man_C]
198 .do rr *groff_grap2graph_1_man_C
199 .
200 .
201 .\" Local Variables:
202 .\" fill-column: 72
203 .\" mode: nroff
204 .\" End:
205 .\" vim: set filetype=groff textwidth=72: