Debian Codegraph @

texmf-dist/doc/support/mkpic/mkpic.html

raw
1 <!DOCTYPE html>
2 <html Lang="en">
3 <head>
4 <meta name="generator" content="gendoc" />
5 <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
6 <title>mkpic documentation</title>
7 <style media="screen">
8 tr { vertical-align:baseline; }
9 p { margin-top:10px; }
10 * { padding: 0; margin: 0; }
11 body {
12 font-family:Fontin,serif;
13 font-size:small;
14 color:#444;
15 margin-left: 30px;
16 max-width: 40em;
17 }
18 .top {
19 margin-top:10px;
20 margin-bottom:5px;
21 }
22 .bot {
23 margin-top:10px;
24 margin-bottom:0px;
25 }
26 h1 {
27 font-size: 120%;
28 color:#a00;
29 text-shadow: rgba(135,145,135,0.65) 3px 3px 4px;
30 margin-top: 30px;
31 padding-bottom: 0.4em;
32 }
33 h4 {
34 margin-top:15px;
35 margin-bottom:0px;
36 }
37 :link,
38 :visited {
39 color: #aa0000;
40 text-decoration: none;
41 }
42 :link:hover,
43 :visited:hover {
44 border-bottom: 1px dotted #6C8C22;
45 }
46 ul { list-style-type: circle; }
47 li { margin-left: 1.5em; }
48 pre,code {
49 font-family:monospace;
50 font-size: medium;
51 color: #023aaa;
52 }
53 td { padding-right: 1em; }
54 .red { color:#f00; }
55 .green { color:#0f0; }
56 .blue { color:#00f; }
57 .big {
58 font-size:xx-large;
59 font-weight:900;
60 color:#a00;
61 text-shadow: rgba(135,145,135,0.65) 3px 3px 4px;
62 padding-right: .4em;
63 }
64 .kop {
65 font-size:large;
66 font-weight:900;
67 color:#a00;
68 text-shadow: rgba(135,145,135,0.65) 3px 3px 4px;
69 }
70 .left {
71 font-size:xx-small;
72 font-family:sans-serif;
73 margin-top:0px;
74 float: left;
75 width: 53%;
76 }
77 .right {
78 font-size:xx-small;
79 font-family:sans-serif;
80 text-align:right;
81 margin-top:0px;
82 float: right;
83 width: 45%;
84 }
85 img { vertical-align:top; }
86 h1.sub { color:#770; margin-top:2px; }
87 </style>
88 </head>
89 <body class="file">
90 <div>
91 <hr class="top"/>
92 <span class="big">mkpic</span>
93 <span class="kop">interface for making pictures with mfpic</span>
94 <hr class="bot"/>
95 <div class="left">doc generated from the script with <a href="http://www.dekkerdocumenten.nl/unix/doc/gendoc.html">gendoc</a></div>
96 <div class="right">perl script, version=1.03</div><div><br/>
97 <p>
98 <h1>Synopsis</h1>
99 <table><colgroup><col style="width:10%"/><col style="width:90%"/></colgroup><tr><td></td><td></td></tr><tr><td colspan="2"><pre>mkpic [options] [picfile]</pre></td></tr></table><p>
100 <h1>Options</h1>
101 <table><tr><td><pre>-c,--clean</pre></td><td>remove all but the input file and die</td></tr><tr><td><pre>-p,--pdfsample</pre></td><td>create pdf file with sample images</td></tr><tr><td><pre>-f,--font=&lt;font command&gt;</pre></td><td>set default font for labels</td></tr><tr><td><pre> --[no]box</pre></td><td>produce framed boxes</td></tr><tr><td><pre>-V,--version</pre></td><td>report version number and die</td></tr><tr><td><pre>-h,--help</pre></td><td>display help info and die</td></tr><tr><td><pre> --[no]debug</pre></td><td>display debugging information</td></tr><tr><td><pre>-l,--log=&lt;logfile&gt;</pre></td><td>file for warning messages</td></tr></table><p>
102 Without an input file, the DATA section is used. <p>
103 <h1>Command overview</h1>
104 <p>
105 <table><tr><td><pre>begin</pre></td><td><pre>name xl yl xmin ymin xmax ymax xlabel ylabel</pre>
106 </td></tr><tr><td colspan="2"><pre>end</pre></td></tr><tr><td colspan="2"><pre>stop</pre></td></tr><tr><td colspan="2"><pre>var=value</pre></td></tr><tr><td><pre>#</pre></td><td><pre>comment</pre>
107 </td></tr><tr><td colspan="2"></td></tr><tr><td><pre>arccst</pre></td><td><pre>xcenter ycenter xstart ystart theta</pre>
108 </td></tr><tr><td><pre>arcset</pre></td><td><pre>xstart ystart xend yend theta</pre>
109 </td></tr><tr><td><pre>arccrtt</pre></td><td><pre>xcenter ycenter radius theta1 theta2</pre>
110 </td></tr><tr><td><pre>arc3</pre></td><td><pre>x1 y1 x2 y2 x3 y3</pre>
111 </td></tr><tr><td colspan="2"></td></tr><tr><td><pre>xmark</pre></td><td><pre>[label1] x1 [label2] x2 ...</pre>
112 </td></tr><tr><td><pre>Xmark</pre></td><td><pre>[label1] x1 [label2] x2 ...</pre>
113 </td></tr><tr><td><pre>ymark</pre></td><td><pre>[label1] y1 [label2] y2 ...</pre>
114 </td></tr><tr><td><pre>Ymark</pre></td><td><pre>[label1] y1 [label2] y2 ...</pre>
115 </td></tr><tr><td colspan="2"></td></tr><tr><td><pre>xdrop</pre></td><td><pre>x y</pre>
116 </td></tr><tr><td><pre>ydrop</pre></td><td><pre>x y</pre>
117 </td></tr><tr><td><pre>xydrop</pre></td><td><pre>x y</pre>
118 </td></tr><tr><td colspan="2"></td></tr><tr><td><pre>arrow</pre></td><td><pre>x1 y1 x2 y2 label</pre>
119 </td></tr><tr><td><pre>label</pre></td><td><pre>YX x y label</pre>
120 </td></tr><tr><td><pre>xlabels</pre></td><td><pre>YX x y dx label ...</pre>
121 </td></tr><tr><td><pre>ylabels</pre></td><td><pre>YX x y dy label ...</pre>
122 </td></tr><tr><td colspan="2"></td></tr><tr><td><pre>point</pre></td><td><pre>x1 y1 x2 y2 ...</pre>
123 </td></tr><tr><td><pre>dpoint</pre></td><td><pre>x1 y1 dx1 dy1 ...</pre>
124 </td></tr><tr><td><pre>lines</pre></td><td><pre>x1 y1 x2 y2 ...</pre>
125 </td></tr><tr><td><pre>dlines</pre></td><td><pre>x1 y1 dx1 dy1 ...</pre>
126 </td></tr><tr><td><pre>curve</pre></td><td><pre>x1 y1 x2 y2 ...</pre>
127 </td></tr><tr><td><pre>dcurve</pre></td><td><pre>x1 y1 dx1 dy1 ...</pre>
128 </td></tr><tr><td colspan="2"></td></tr><tr><td><pre>rect</pre></td><td><pre>x1 y1 x2 y2</pre>
129 </td></tr><tr><td><pre>drect</pre></td><td><pre>x y dx dy</pre>
130 </td></tr><tr><td><pre>dcrect</pre></td><td><pre>x y dx dy</pre>
131 </td></tr><tr><td><pre>crect</pre></td><td><pre>x1 y1 x2 y2</pre>
132 </td></tr><tr><td><pre>arect</pre></td><td><pre>xc yc width height theta</pre>
133 </td></tr><tr><td><pre>bar</pre></td><td><pre>x xdev height</pre>
134 </td></tr><tr><td colspan="2"></td></tr><tr><td><pre>func</pre></td><td><pre>xmin xmax step expression-in-x</pre>
135 </td></tr><tr><td colspan="2"></td></tr><tr><td><pre>grid</pre></td><td><pre>dx dy xgap ygap</pre>
136 </td></tr><tr><td><pre>hatch</pre></td><td>
137 </td></tr><tr><td><pre>bhat</pre></td><td>
138 </td></tr><tr><td><pre>ehat</pre></td><td>
139 </td></tr></table><p>
140 <h1>Description</h1>
141 <b><a href="../mkpic">mkpic</a></b> 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 <b><a href="../mkpic">mkpic</a></b> script, which is used if you run it without an input file). For an extensive description see the files <code>mkpicdoc.tex</code> and <code>mkpicdoc.pdf</code>, which are part of the distribution. <p>
142 <b><a href="../mkpic">mkpic</a></b> produces two files. Assuming an input file named <code>picfile</code> defaulting to <code>mkpic</code> these are: <p>
143 <table><colgroup><col style="width:10%"/><col style="width:90%"/></colgroup><tr><td></td><td></td></tr><tr><td colspan="2"><pre>picfile.mac</pre></td></tr><tr><td></td><td>a macro file which will contain <code>TeX</code> commands for every picture</td></tr><tr><td colspan="2"><pre>picfile.sty</pre></td></tr><tr><td></td><td>a style file for latex, defining the same <code>TeX</code> commands for every picture.</td></tr></table><p>
144 With the <code>--pdfsample</code> option, two other files are produced: <p>
145 <table><colgroup><col style="width:10%"/><col style="width:90%"/></colgroup><tr><td></td><td></td></tr><tr><td colspan="2"><pre>picfile.pdf</pre></td></tr><tr><td></td><td>a PDF file containing all pictures. This lets you easily check the results of your designs.</td></tr></table><p>
146 <table><colgroup><col style="width:10%"/><col style="width:90%"/></colgroup><tr><td></td><td></td></tr><tr><td colspan="2"><pre>picfile.tex</pre></td></tr><tr><td></td><td>the <code>TeX</code> source used for creating this PDF file.</td></tr></table><p>
147 In <code>LaTeX</code>, you have to include <code>\usepackage{picfile}</code> and to include commands like <code>\Fig</code><i>name</i> in your source, where <i>name</i> is the name you gave one of your pictures in an <b><a href="../mkpic">mkpic</a></b> <code>begin</code> command. <p>
148 In TeX and ConTeXt, you have to <code>\input&#x2423;picfile.mac</code> and to include commands like <code>\Fig</code><i>name</i> in your source, where <i>name</i> is the name you gave one of your pictures in an <b><a href="../mkpic">mkpic</a></b> <code>begin</code> command. <p>
149 In TeX, you must use the <code>\bye</code> command (<i>not</i> <code>\end</code> to finish your TeX source <p>
150 See the RUNNING section for how to run <b><a href="../mkpic">mkpic</a></b> and TeX, LaTeX, or ConTeXt. <p>
151 <h1>Commands</h1>
152 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): <p>
153 <table><colgroup><col style="width:10%"/><col style="width:90%"/></colgroup><tr><td></td><td></td></tr><tr><td colspan="2"><pre>begin, end</pre></td></tr><tr><td></td><td>Every picture begins with the <code>begin</code> command and ends with the <code>end</code> command. The <code>begin</code> 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 <code>.mac</code> file. Thus the command</td></tr><tr><td colspan="2"></td></tr><tr><td></td><td><pre>begin aa ...</pre>
154 </td></tr><tr><td colspan="2"></td></tr><tr><td></td><td>starts writing <code>\def\Figaa{...}</code> to the <code>.mac</code> file, and the picture can be reproduced in a <code>TeX</code> document by importing the <code>.mac</code> file and using the <code>\Figaa</code> command. </td></tr><tr><td colspan="2"></td></tr><tr><td></td><td>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.</td></tr><tr><td colspan="2"></td></tr><tr><td colspan="2"><pre>stop</pre></td></tr><tr><td></td><td>stops further reading of the input. Useful if you have many pictures, but want to see only the first few for testing purposes.</td></tr><tr><td colspan="2"></td></tr><tr><td colspan="2"><pre>var=value</pre></td></tr><tr><td></td><td>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. </td></tr><tr><td colspan="2"></td></tr><tr><td><pre>#</pre></td><td>
155 </td></tr><tr><td></td><td>denotes a comment</td></tr><tr><td colspan="2"></td></tr><tr><td colspan="2"><pre>xmark, ymark, Xmark, Ymark</pre></td></tr><tr><td></td><td>These commands place one or more labels along the x- or y-axes, either below (<code>xmark</code> and <code>ymark</code>) or above (<code>Xmark</code> and <code>Ymark</code>) the axis.</td></tr><tr><td colspan="2"></td></tr><tr><td></td><td>For the <code>[xXyY]mark</code> 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: <code>{1950}</code>.</td></tr><tr><td colspan="2"></td></tr><tr><td colspan="2"><pre>arccst</pre></td></tr><tr><td></td><td>(Mnemonic: <code>c</code>enter <code>s</code>tart <code>t</code>heta.) Draws an arc with its center in <code>xcenter,ycenter</code>, starting in <code>xstart,ystart</code> and with an arc length of <code>theta</code> degrees.</td></tr><tr><td colspan="2"></td></tr><tr><td colspan="2"><pre>arcset</pre></td></tr><tr><td></td><td>(Mnemonic: <code>s</code>tart <code>e</code>nd <code>t</code>heta.) Draws an arc starting in <code>xstart,ystart</code>end ending in <code>xend,yend</code> and with an arc length of <code>theta</code> degrees.</td></tr><tr><td colspan="2"></td></tr><tr><td colspan="2"><pre>arccrtt</pre></td></tr><tr><td></td><td>(Mnemonic: <code>c</code>enter <code>r</code>adius <code>t</code>heta1 <code>t</code>heta2.) Draws an arc with its center in <code>xcenter,ycenter</code>, a radius <code>radius</code> starting at <code>theta1</code> degrees and ending at <code>theta2</code> degrees.</td></tr><tr><td colspan="2"></td></tr><tr><td colspan="2"><pre>arc3</pre></td></tr><tr><td></td><td>(Mnemonic: <code>3</code> points.) Draws an arc starting at <code>(x1,y1)</code>, through <code>(x2,y2)</code> and ending in <code>(x3,y3)</code>.</td></tr><tr><td colspan="2"></td></tr><tr><td colspan="2"><pre>xdrop, ydrop, xydrop</pre></td></tr><tr><td></td><td>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.</td></tr><tr><td colspan="2"></td></tr><tr><td colspan="2"><pre>arrow</pre></td></tr><tr><td></td><td>draws an arrow from <code>(x1,y1)</code> to <code>(x2,y2)</code> labeled on its tail with <code>label</code></td></tr><tr><td colspan="2"></td></tr><tr><td colspan="2"><pre>label</pre></td></tr><tr><td></td><td>draws a label at <code>(x,y)</code>. <code>YX</code> tells how it will be adjusted: for Y=t,b,c <code>(x,y)</code> 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 <code>(x,y)</code>. Thus</td></tr><tr><td colspan="2"></td></tr><tr><td></td><td><pre>label tl 0 0 Hello World!</pre>
156 </td></tr><tr><td colspan="2"></td></tr><tr><td></td><td>will draw the string "Hello World" with its lower left corner at (0,0)</td></tr><tr><td colspan="2"></td></tr><tr><td colspan="2"><pre>xlabels</pre></td></tr><tr><td></td><td>draws many labels, starting at <code>(x,y)</code>, and incrementing <code>x</code> with <code>dx</code> after every label. <code>YX</code>: see <code>label</code>. Labels may not contain spaces; if you need spaces, use - instead.</td></tr><tr><td colspan="2"></td></tr><tr><td colspan="2"><pre>ylabels</pre></td></tr><tr><td></td><td>Same as <code>xlabels</code>, but incrementing <code>y</code> with <code>dy</code> instead.</td></tr><tr><td colspan="2"></td></tr><tr><td colspan="2"><pre>point</pre></td></tr><tr><td></td><td>draws points (dots) at <code>(x1,y1)</code>, <code>(x2,y2)</code> et cetera.</td></tr><tr><td colspan="2"></td></tr><tr><td colspan="2"><pre>dpoint</pre></td></tr><tr><td></td><td>draws points (dots) starting at <code>(x1,y1)</code> and then moving by <code>(dx1,dy1)</code>, <code>(dx2,dy2)</code> et cetera.</td></tr><tr><td colspan="2"></td></tr><tr><td><pre>lines</pre></td><td>
157 </td></tr><tr><td></td><td>draws line segments from <code>(x1,y1)</code> to <code>(x2,y2)</code>, <code>(x3,y3)</code> et cetera.</td></tr><tr><td colspan="2"></td></tr><tr><td colspan="2"><pre>dlines</pre></td></tr><tr><td></td><td>draws line segments starting at <code>(x1,y1)</code> and then moving by <code>(dx1,dy1)</code>, <code>(dx2,dy2)</code> et cetera.</td></tr><tr><td colspan="2"></td></tr><tr><td colspan="2"><pre>curve</pre></td></tr><tr><td></td><td>draws a bezier curve from <code>(x1,y1)</code> to <code>(x2,y2)</code>, <code>(x3,y3)</code> et cetera.</td></tr><tr><td colspan="2"></td></tr><tr><td colspan="2"><pre>dcurve</pre></td></tr><tr><td></td><td>draws a bezier curve starting at <code>(x1,y1)</code> and then moving by <code>(dx1,dy1)</code>, <code>(dx2,dy2)</code> et cetera.</td></tr><tr><td colspan="2"></td></tr><tr><td colspan="2"><pre>rect</pre></td></tr><tr><td></td><td>draws a rectangle with diagonal points at <code>(x1,y1)</code> and <code>(x2,y2)</code>.</td></tr><tr><td colspan="2"></td></tr><tr><td colspan="2"><pre>drect</pre></td></tr><tr><td></td><td>draws a rectangle with diagonal points at <code>(x,y)</code> and <code>(x+dx,y+dy)</code>.</td></tr><tr><td colspan="2"></td></tr><tr><td colspan="2"><pre>crect</pre></td></tr><tr><td></td><td>clears a rectangle with diagonal points at <code>(x1,y1)</code> and <code>(x2,y2)</code>.</td></tr><tr><td colspan="2"></td></tr><tr><td colspan="2"><pre>dcrect</pre></td></tr><tr><td></td><td>clears a rectangle with diagonal points at <code>(x,y)</code> and <code>(x+dx,y+dy)</code>.</td></tr><tr><td colspan="2"></td></tr><tr><td colspan="2"><pre>arect</pre></td></tr><tr><td></td><td>draws a rectangle with a widdh <code>width</code> and a height <code>height</code>; the middle of the bottom is at <code>(xc,yc)</code> and the centerline through <code>(xc,yc)</code> makes an angle <code>theta</code> with the x-axis.</td></tr><tr><td colspan="2"></td></tr><tr><td colspan="2"><pre>bar</pre></td></tr><tr><td></td><td>draws a equivalent with <code>rect&#x2423;x-xdev&#x2423;0&#x2423;x+xdev&#x2423;height</code></td></tr><tr><td colspan="2"></td></tr><tr><td colspan="2"><pre>func</pre></td></tr><tr><td></td><td>draws the function given by <code>expression-in-x</code> between <code>xmin</code> and <code>xmax</code>, stepping with <code>step</code> units in the x-direction. Note that the <code>expression-in-x</code> will be evaluated by <code>Metafont</code>, so you will have to use metafont syntax.</td></tr><tr><td colspan="2"></td></tr><tr><td colspan="2"><pre>grid</pre></td></tr><tr><td></td><td>draw dotted grid lines at distances dx and dy in the x- and y directions; the gaps between the dots are set to <code>xgap</code> an <code>ygap</code> respectively. For an esthetic appearance, be sure to use integer <code>dx/xgap</code> and <code>dy/ygap</code> ratios.</td></tr><tr><td colspan="2"></td></tr><tr><td colspan="2"><pre>hatch</pre></td></tr><tr><td></td><td>hatch the closed curve that follows.</td></tr><tr><td colspan="2"></td></tr><tr><td colspan="2"><pre>bhat</pre></td></tr><tr><td></td><td>starts a path that will eventually be closed, and then hatched.</td></tr><tr><td colspan="2"></td></tr><tr><td colspan="2"><pre>ehat</pre></td></tr><tr><td></td><td>ends a path started with <code>bhat</code>, closes it and then hatches it.</td></tr><tr><td colspan="2"></td></tr><tr><td colspan="2"><pre>anything else</pre></td></tr><tr><td></td><td>will be inserted as is in the macro file, and therefore should be a valid <code>mfpic</code> 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.</td></tr></table><p>
158 <p>
159 <h1>Running mkpic/TeX</h1>
160 The effect of running <pre>mkpic picfile
161 </pre>
162 is the creation of <code>picfile.mac</code>, which you can <code>\input</code> into a TeX or ConTeXt source, and <code>picfile.sty</code> which can be input into a LaTeX source using the <code>\usepackage</code> command. <p>
163 After running TeX (or LaTeX or ConTeXt), you will find a file <code>picfile.mf</code> 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: <p>
164 <pre>mkpic picfile pdflatex file.tex mf picfile gftopk picfile.600gf pdflatex file pdflatex file
165 </pre>
166 <p>
167 <h1>Bug</h1>
168 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. <p>
169 <h1>Author</h1>
170 <a href="mailto:[email protected]">Wybo Dekker</a> <p>
171 <h1>Copyright</h1>
172 Released under the <a href="http://www.gnu.org/copyleft/gpl.html">GNU General Public License</a> </div></div></body></html>