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