Download CMman. - SunSITE RedIRIS

Transcript
\mtopgf{PicA}
\input{PicA.tex} \par
\mtopgf{PicB}
\input{PicB.tex}
\end{document}
The path to pgf.m4 must be defined in this file, sources PicA.m4 and PicB.m4 must contain any required include statements, and the document file should be processed using the
command pdflatex -shell-escape <filename>. This method processes each picture source
every time LATEX is run, so for large documents containing many graphics, the \mtopgf line
could be commented out after debugging the corresponding graphic.
3
Pic essentials
Pic source is a sequence of lines in a file. The first line of a diagram begins with .PS with optional
following arguments, and the last line is normally .PE. Lines outside of these pass through the pic
processor unchanged.
The visible objects can be divided conveniently into two classes, the linear objects line, arrow,
spline, arc, and the planar objects box, circle, ellipse.
The object move is linear but draws nothing. A composite object, or block, is planar and
consists of a pair of square brackets enclosing other objects, as described in Section 3.4. Objects
can be placed using absolute coordinates or relative to other objects.
Pic allows the definition of real-valued variables, which are alphameric names beginning with
lower-case letters, and computations using them. Objects or locations on the diagram can be given
symbolic names beginning with an upper-case first letter.
3.1
Manuals
At the time of writing, the classic pic manual [8] can be obtained from URL:
http://www.cs.bell-labs.com/10thEdMan/pic.pdf
A more complete manual [10] is included in the GNU groff package. A compressed postscript
version is available, at least temporarily, with these circuit files.
In both of the above manuals, explicit use of *roff string and font constructs should be replaced
by their LATEX equivalents as necessary. Further explanation is available, for example, from the gpic
“man” page, part of the GNU groff package.
Examples of use of the circuit macros in an electronics course are available on the web [2].
For a discussion of “little languages” for document production, and of pic in particular, see
Chapter 9 of [1]. Chapter 1 of [5] also contains a brief discussion of this and other languages.
3.2
The linear objects: line, arrow, spline, arc
A line can be drawn as follows:
line from position to position
where position is defined below or
line direction distance
where direction is one of up, down, left, right. When used with the m4 macros described here,
it is preferable to add an underscore: up , down , left , right . The distance is a number or
expression and the units are inches, but the assignment
scale = 25.4
has the effect of changing the units to millimetres, as described in Section 8.
Lines can also be drawn to any distance in any direction. The example,
line up 3/sqrt(2) right 3/sqrt(2)
draws a line 3 units long from the current location, at a 45◦ angle above horizontal.
The construction
line from A to B chop x
5