Debian Codegraph @

texmf-dist/doc/man/man1/mkpic.1

raw
1 .TH mkpic 1 "October 03, 2025" "mkpic version 1.03" "DekDoc scripts"
2 .SH NAME
3
4 mkpic - interface for making pictures with mfpic
5
6 .SH Synopsis
7
8 .B mkpic [options] [picfile]
9
10 .SH Options
11
12 .B -c,--clean
13 .RS
14 remove all but the input file and die
15 .RE
16 .B -p,--pdfsample
17 .RS
18 create pdf file with sample images
19 .RE
20 .B -f,--font=<font command>
21 .RS
22 set default font for labels
23 .RE
24 .B --[no]box
25 .RS
26 produce framed boxes
27 .RE
28 .B -V,--version
29 .RS
30 report version number and die
31 .RE
32 .B -h,--help
33 .RS
34 display help info and die
35 .RE
36 .B --[no]debug
37 .RS
38 display debugging information
39 .RE
40 .B -l,--log=<logfile>
41 .RS
42 file for warning messages
43 .RE
44
45 Without an input file, the DATA section is used.
46
47 .SH Command overview
48
49 .B begin
50 .RS
51
52 .B name xl yl xmin ymin xmax ymax xlabel ylabel
53
54 .RE
55 .B end
56 .B stop
57 .B var=value
58 .B #
59 .RS
60
61 .B comment
62
63 .RE
64 .B
65 .B arccst
66 .RS
67
68 .B xcenter ycenter xstart ystart theta
69
70 .RE
71 .B arcset
72 .RS
73
74 .B xstart ystart xend yend theta
75
76 .RE
77 .B arccrtt
78 .RS
79
80 .B xcenter ycenter radius theta1 theta2
81
82 .RE
83 .B arc3
84 .RS
85
86 .B x1 y1 x2 y2 x3 y3
87
88 .RE
89 .B
90 .B xmark
91 .RS
92
93 .B [label1] x1 [label2] x2 ...
94
95 .RE
96 .B Xmark
97 .RS
98
99 .B [label1] x1 [label2] x2 ...
100
101 .RE
102 .B ymark
103 .RS
104
105 .B [label1] y1 [label2] y2 ...
106
107 .RE
108 .B Ymark
109 .RS
110
111 .B [label1] y1 [label2] y2 ...
112
113 .RE
114 .B
115 .B xdrop
116 .RS
117
118 .B x y
119
120 .RE
121 .B ydrop
122 .RS
123
124 .B x y
125
126 .RE
127 .B xydrop
128 .RS
129
130 .B x y
131
132 .RE
133 .B
134 .B arrow
135 .RS
136
137 .B x1 y1 x2 y2 label
138
139 .RE
140 .B label
141 .RS
142
143 .B YX x y label
144
145 .RE
146 .B xlabels
147 .RS
148
149 .B YX x y dx label ...
150
151 .RE
152 .B ylabels
153 .RS
154
155 .B YX x y dy label ...
156
157 .RE
158 .B
159 .B point
160 .RS
161
162 .B x1 y1 x2 y2 ...
163
164 .RE
165 .B dpoint
166 .RS
167
168 .B x1 y1 dx1 dy1 ...
169
170 .RE
171 .B lines
172 .RS
173
174 .B x1 y1 x2 y2 ...
175
176 .RE
177 .B dlines
178 .RS
179
180 .B x1 y1 dx1 dy1 ...
181
182 .RE
183 .B curve
184 .RS
185
186 .B x1 y1 x2 y2 ...
187
188 .RE
189 .B dcurve
190 .RS
191
192 .B x1 y1 dx1 dy1 ...
193
194 .RE
195 .B
196 .B rect
197 .RS
198
199 .B x1 y1 x2 y2
200
201 .RE
202 .B drect
203 .RS
204
205 .B x y dx dy
206
207 .RE
208 .B dcrect
209 .RS
210
211 .B x y dx dy
212
213 .RE
214 .B crect
215 .RS
216
217 .B x1 y1 x2 y2
218
219 .RE
220 .B arect
221 .RS
222
223 .B xc yc width height theta
224
225 .RE
226 .B bar
227 .RS
228
229 .B x xdev height
230
231 .RE
232 .B
233 .B func
234 .RS
235
236 .B xmin xmax step expression-in-x
237
238 .RE
239 .B
240 .B grid
241 .RS
242
243 .B dx dy xgap ygap
244
245 .RE
246 .B hatch
247 .RS
248
249 .B
250
251 .RE
252 .B bhat
253 .RS
254
255 .B
256
257 .RE
258 .B ehat
259 .RS
260
261 .B
262
263 .RE
264
265 .SH Description
266 mkpic provides an easy interface for making small pictures with mfpic. To this end an input file has to be created consisting of commands, one per line, with space separated parameters (or you modify the DATA section of the mkpic script, which is used if you run it without an input file). For an extensive description see the files mkpicdoc.tex and mkpicdoc.pdf, which are part of the distribution.
267
268 mkpic produces two files. Assuming an input file named picfile defaulting to mkpic these are:
269
270 .B picfile.mac
271 .RS
272 a macro file which will contain TeX commands for every picture
273 .RE
274 .B picfile.sty
275 .RS
276 a style file for latex, defining the same TeX commands for every picture.
277 .RE
278
279 With the --pdfsample option, two other files are produced:
280
281 .B picfile.pdf
282 .RS
283 a PDF file containing all pictures. This lets you easily check the results of your designs.
284 .RE
285
286 .B picfile.tex
287 .RS
288 the TeX source used for creating this PDF file.
289 .RE
290
291 In LaTeX, you have to include \\usepackage{picfile} and to include commands like \\Fig\fIname\fR in your source, where \fIname\fR is the name you gave one of your pictures in an mkpic begin command.
292
293 In TeX and ConTeXt, you have to \\input␣picfile.mac and to include commands like \\Fig\fIname\fR in your source, where \fIname\fR is the name you gave one of your pictures in an mkpic begin command.
294
295 In TeX, you must use the \\bye command (\fInot\fR \\end to finish your TeX source
296
297 See the RUNNING section for how to run mkpic and TeX, LaTeX, or ConTeXt.
298
299 .SH Commands
300 The source is set up so that it is easy to add your own commands, Currently the following commands have been implemented (the arguments are not listed here; for those, refer to the SYNOPSIS section):
301
302 .B begin, end
303 .RS
304 Every picture begins with the begin command and ends with the end command. The begin command defines a name for the picture and defines a tex command with that name, prefixed with 'Fig'. The resulting command is written to a .mac file. Thus the command
305 .RE
306 .B
307 .RS
308
309 .B begin aa ...
310
311 .RE
312 .B
313 .RS
314 starts writing \\def\\Figaa{...} to the .mac file, and the picture can be reproduced in a TeX document by importing the .mac file and using the \\Figaa command.
315 .RE
316 .B
317 .RS
318 xl and yl are the lengths of the x- and y-axes. xlabel and ylabel are the label that are placed at the ends of those axes. Use a space to suppress labeling, or "-" to suppress drawing the axes at all.
319 .RE
320 .B
321 .B stop
322 .RS
323 stops further reading of the input. Useful if you have many pictures, but want to see only the first few for testing purposes.
324 .RE
325 .B
326 .B var=value
327 .RS
328 sets the variable var to value. This variable, or an expression containing it, can be used instead of any numerical parameter. Variable names may contain lower and uppercase letters, digits or underscores, with the restriction that they must start with a letter and may not end in an underscore.
329 .RE
330 .B
331 .B #
332 .RS
333
334 .B
335
336 .RE
337 .RS
338 denotes a comment
339 .RE
340 .B
341 .B xmark, ymark, Xmark, Ymark
342 .RS
343 These commands place one or more labels along the x- or y-axes, either below (xmark and ymark) or above (Xmark and Ymark) the axis.
344 .RE
345 .B
346 .RS
347 For the [xXyY]mark commands a parameter containing any character other than [-.0-9] is interpreted as the label (this implies that you cannot use expressions here!) to be placed and its position is expected in the next parameter. If a parameter is just a number, it is placed at that x-position. If you want a number to be interpreted as a label, put it in braces: {1950}.
348 .RE
349 .B
350 .B arccst
351 .RS
352 (Mnemonic: center start theta.) Draws an arc with its center in xcenter,ycenter, starting in xstart,ystart and with an arc length of theta degrees.
353 .RE
354 .B
355 .B arcset
356 .RS
357 (Mnemonic: start end theta.) Draws an arc starting in xstart,ystartend ending in xend,yend and with an arc length of theta degrees.
358 .RE
359 .B
360 .B arccrtt
361 .RS
362 (Mnemonic: center radius theta1 theta2.) Draws an arc with its center in xcenter,ycenter, a radius radius starting at theta1 degrees and ending at theta2 degrees.
363 .RE
364 .B
365 .B arc3
366 .RS
367 (Mnemonic: 3 points.) Draws an arc starting at (x1,y1), through (x2,y2) and ending in (x3,y3).
368 .RE
369 .B
370 .B xdrop, ydrop, xydrop
371 .RS
372 These commands draw dotted arrows perpendicularly to the x-axis, the y-axis and both axes, respectively, ending on the axes with the arrow head.
373 .RE
374 .B
375 .B arrow
376 .RS
377 draws an arrow from (x1,y1) to (x2,y2) labeled on its tail with label
378 .RE
379 .B
380 .B label
381 .RS
382 draws a label at (x,y). YX tells how it will be adjusted: for Y=t,b,c (x,y) will be, in the y-direction, on top, bottom or center of the label respectively, for X=l,r,c it will be, in the x-direction, left, right or center adjusted on (x,y). Thus
383 .RE
384 .B
385 .RS
386
387 .B label tl 0 0 Hello World!
388
389 .RE
390 .B
391 .RS
392 will draw the string "Hello World" with its lower left corner at (0,0)
393 .RE
394 .B
395 .B xlabels
396 .RS
397 draws many labels, starting at (x,y), and incrementing x with dx after every label. YX: see label. Labels may not contain spaces; if you need spaces, use - instead.
398 .RE
399 .B
400 .B ylabels
401 .RS
402 Same as xlabels, but incrementing y with dy instead.
403 .RE
404 .B
405 .B point
406 .RS
407 draws points (dots) at (x1,y1), (x2,y2) et cetera.
408 .RE
409 .B
410 .B dpoint
411 .RS
412 draws points (dots) starting at (x1,y1) and then moving by (dx1,dy1), (dx2,dy2) et cetera.
413 .RE
414 .B
415 .B lines
416 .RS
417
418 .B
419
420 .RE
421 .RS
422 draws line segments from (x1,y1) to (x2,y2), (x3,y3) et cetera.
423 .RE
424 .B
425 .B dlines
426 .RS
427 draws line segments starting at (x1,y1) and then moving by (dx1,dy1), (dx2,dy2) et cetera.
428 .RE
429 .B
430 .B curve
431 .RS
432 draws a bezier curve from (x1,y1) to (x2,y2), (x3,y3) et cetera.
433 .RE
434 .B
435 .B dcurve
436 .RS
437 draws a bezier curve starting at (x1,y1) and then moving by (dx1,dy1), (dx2,dy2) et cetera.
438 .RE
439 .B
440 .B rect
441 .RS
442 draws a rectangle with diagonal points at (x1,y1) and (x2,y2).
443 .RE
444 .B
445 .B drect
446 .RS
447 draws a rectangle with diagonal points at (x,y) and (x+dx,y+dy).
448 .RE
449 .B
450 .B crect
451 .RS
452 clears a rectangle with diagonal points at (x1,y1) and (x2,y2).
453 .RE
454 .B
455 .B dcrect
456 .RS
457 clears a rectangle with diagonal points at (x,y) and (x+dx,y+dy).
458 .RE
459 .B
460 .B arect
461 .RS
462 draws a rectangle with a widdh width and a height height; the middle of the bottom is at (xc,yc) and the centerline through (xc,yc) makes an angle theta with the x-axis.
463 .RE
464 .B
465 .B bar
466 .RS
467 draws a equivalent with rect␣x-xdev␣0␣x+xdev␣height
468 .RE
469 .B
470 .B func
471 .RS
472 draws the function given by expression-in-x between xmin and xmax, stepping with step units in the x-direction. Note that the expression-in-x will be evaluated by Metafont, so you will have to use metafont syntax.
473 .RE
474 .B
475 .B grid
476 .RS
477 draw dotted grid lines at distances dx and dy in the x- and y directions; the gaps between the dots are set to xgap an ygap respectively. For an esthetic appearance, be sure to use integer dx/xgap and dy/ygap ratios.
478 .RE
479 .B
480 .B hatch
481 .RS
482 hatch the closed curve that follows.
483 .RE
484 .B
485 .B bhat
486 .RS
487 starts a path that will eventually be closed, and then hatched.
488 .RE
489 .B
490 .B ehat
491 .RS
492 ends a path started with bhat, closes it and then hatches it.
493 .RE
494 .B
495 .B anything else
496 .RS
497 will be inserted as is in the macro file, and therefore should be a valid mfpic statement. You use this when you need such a statement only once, or a few times and therefore see no need to define a proper command for it.
498 .RE
499
500 .SH Running mkpic/TeX
501 The effect of running mkpic picfile
502
503 is the creation of picfile.mac, which you can \\input into a TeX or ConTeXt source, and picfile.sty which can be input into a LaTeX source using the \\usepackage command.
504
505 After running TeX (or LaTeX or ConTeXt), you will find a file picfile.mf and you will have to run Metafont on it, which (assuming you configured TeX for 600 dpi) produces picfile.600gf. This file will have to be converted to a pk file with gftopk. Finally, you need to run TeX, normally at least twice, again. So for pdfLaTeX the sequence is:
506
507 mkpic picfile pdflatex file.tex mf picfile gftopk picfile.600gf pdflatex file pdflatex file
508
509 .SH Bug
510 Currently only up to 256 pictures can be generated. In the future this problem will probably be solved by introducing more than one font and generating tex-command names that have the font name in front.
511
512 .SH Author
513 Wybo Dekker ([email protected])
514
515 .SH Copyright
516 Released under the GNU General Public License (www.gnu.org\fIcopyleft\fRgpl.html)