Debian Codegraph @

texmf-dist/doc/latex/pst-layout/pst-layout-doc.tex

raw
1 \documentclass[11pt]{article}
2 \listfiles
3 \usepackage{graphicx}
4 \usepackage[parfill]{parskip}
5 %\parindent=0pt
6 %\parskip=1ex plus 5pt
7 \usepackage[oldstyle]{savoy}
8 \usepackage[onlymath,minionint,mathlf]{MinionPro}% to use mnsymbol with minion italic
9 \usepackage[scaled=.9,sf]{myriad}
10 \usepackage[scaled=.78]{luximono}%requires T1+textcomp
11 \newcommand{\textlf}[1]{{\usefont{LY1}{5sbx}{m}{n}\selectfont #1}}% to get Savoy lf
12 \usepackage[T1]{fontenc}
13 \usepackage{textcomp} % to get the right copyright, etc.
14 \makeatletter
15 \def\textat{\protect\makeatletter\texttt{@}\protect\makeatother}
16 \def\verbatim@font{\small\normalfont\ttfamily}
17 \newcommand\ON{%
18 \gdef\lst@alloverstyle##1{%from listings, required by showexpl
19 \fboxrule=0pt
20 \fboxsep=0pt
21 % \fcolorbox{DarkBlue}{DarkBlue}{\textcolor{white}{\bfseries\strut##1}}%
22 \fcolorbox{HotPink!50}{HotPink!50}{\textcolor{black}{\strut##1}}%
23 }}
24 \newcommand\OFF{%
25 \xdef\lst@alloverstyle##1{##1}%
26 }
27 \makeatother
28 \hyphenation{Post-Script}
29 \newcommand\CMD[1]{{\texttt{\textbackslash#1}}}
30 \newlength{\lstenvsep}
31 \setlength{\lstenvsep}{\partopsep}
32 \addtolength{\lstenvsep}{\topsep}
33 %\usepackage{listings}
34 \usepackage{showexpl}
35 \lstset{preset=\RaggedRight, basicstyle=\ttfamily\small, commentstyle=\color{red},
36 explpreset={morecomment=[l]{\%},frame=single,rframe=,escapechar=`,numbers=none, aboveskip=11pt plus 4pt minus 5pt,postbreak=\space,breaklines, stringstyle=\ttfamily, backgroundcolor=\color{yellow!10}}}
37 \lstdefinestyle{syntax}{backgroundcolor=\color{blue!20}, numbers=none, xleftmargin=0pt,xrightmargin=0pt,aboveskip=12pt plus 4pt minus 3pt, belowskip=4pt plus 4pt minus 2pt, frame=single}
38 %\DefineShortVerb{\_}
39 \lstset{escapechar=`}
40 %\usepackage[dvipsnames,svgnames]{pstricks}
41 %\usepackage{pst-nodeExtras,pst-layout}
42 \usepackage{ragged2e,xspace,hyperref}
43 \begin{document}
44 %\showthe\medskipamount
45 \begin{center}{\Large {\tt pst-layout}\\[12pt]
46 \large Michael Sharpe\\[10pt]
47 msharpe at ucsd.edu}
48 \end{center}
49 \section{Quick overview}
50 This package uses {\tt pstricks} and related packages for a single purpose: to ease the design of quasi-tabular documents of a specified size. For a couple of examples, consider (a) a business card; (b) a form, assumed to be available as an {\tt eps} graphic, that must be filled out by overprinting it with \LaTeX\ text. A much more complex example that was constructed using this package is shown at\\
51 \url{http://cseweb.ucsd.edu/~gill/MissingGeoSite/index.html}.\\
52 In essence, you specify the canvas size and the units, you define a number of locations on the canvas to serve as alignment guides, and then enter arrays of parameters that govern the positions and appearances of dots, lines, frames, fragments of text and pictures.
53 After entering these arrays of data, type, for example
54 \begin{verbatim}
55 \psset{unit=1in,picwidth=4in,picheight=6in}
56 \begin{pslayout}
57 <optional: other graphics commands>
58 \end{pslayout}
59 \end{verbatim}
60 then run {\tt LaTeX+dvips+ps2pdf} to view the result. Because the data arrays are not erased after the canvas is drawn, it is not intended as an environment for creation of more than a single canvas, though with care, that is possible. Units may be specified separately by setting {\tt xunit} and {\tt yunit} instead of {\tt unit}.
61
62 A few packages are required.
63 \begin{description}
64 \item[\tt pst-node] A recent version is essential.
65 \item[\tt pst-layout] This package.
66 \item[\tt arrayjobx] This is almost the same as the {\tt arrayjob} package that is part of \TeX\ Live, but with the name \verb|\array| altered in three places (lines 108, 148, 164) so as not to conflict with the usage of \verb|\array| in \LaTeX\ and related parts of {\tt amsmath}, or with \verb|\Array| in {\tt pdftricks}. This command is normally only used internally, so there is little reason not to use {\tt arrayjobx} in place of {\tt arrayjob}.
67 \end{description}
68
69 \section{Coordinates and Node Expressions}
70 The origin is the southwest corner of the canvas so the x axis runs along the bottom edge and the y axis along the left edge. Two macros---\verb|\xmax| and \verb|\ymax| are defined within the {\tt pslayout} environment, so that, for example, the top right corner may be referred to as \verb|(\xmax,\ymax)|. Positions of points may be specified in any form acceptable to \verb|\SpecialCoor|, or as a node expression, by which is meant an expression like
71 \begin{verbatim}
72 .25(1cm,3)+.333(2;90)-1.2([nodesep=.5cm]Q)
73 \end{verbatim}
74 which specifies a linear combination of points (the items enclosed in parentheses) specified in any manner acceptable to \verb|\SpecialCoor|. The parenthesized items themselves cannot themselves be node expressions, as those are not acceptable to \verb|\SpecialCoor|. As a reminder, \verb|\SpecialCoor| understands the following forms:
75 \begin{description}
76 \item[Cartesian] Eg,
77 {\tt (3,4), (3pt,2)}.
78 \item[Polar] Eg, {\tt (2;90), (1cm;45)}.
79 \item[Mixed] Eg, {\tt (2;90 | 3,4), (P | Q)}---x coordinate from first point, y coordinate from second---very useful form in {\tt pslayout}.
80 \item[Node] Eg, {\tt (P)}, where {\tt P} is a previously defined node.
81 \item[Node relative] Eg, {\tt ([nodesep=2pt,offset=1cm]P)}---{\tt 2pt} to the right and {\tt 1cm} up from {\tt P}.
82 \item[Node segment relative] Eg, \verb+([nodesep=1,offset=2pt]{P}Q+. Relative to directed line segment from {\tt Q} toward {\tt P}, 1 unit from {\tt Q} and {\tt 2pt} to left (normal to {\tt QP}.)
83 \item[Postscript] {\tt (! <PostScript code>)} Code must leave two items on the stack, interpreted as x and y coordinates. Eg, {\tt (! 90 sin 90 cos)} gives same result as (1,0).
84 \end{description}
85
86 Note that coordinates with an unspecified unit take the appropriate unit, so {\tt (1cm,3)} means the point {\tt 1cm} to the right and 3 {\tt yunit} from the origin.
87
88 \subsection{Predefined points}
89 Some points on the canvas are already named---the corners and midpoints are named {\tt PSPbl} (bottom left), {\tt PSPtl}, {\tt PSPtr}, {\tt PSPbr}, {\tt PSPbl}, {\tt PSPbc}, {\tt PSPtc}, {\tt PSPcl}, {\tt PSPcr}, {\tt PSPcc}, whose meanings should be clear. Three of these have alternative names---{\tt R0=PSPtl}, {\tt C-1=PSPbr}, and {\tt C-2=PSPbc}. These names are special and should not normally be redefined, though you may if you are obstinate. If the choice seems odd, think of {\tt R0} as the row above the first row of the canvas, {\tt C-1} as the last column, and {\tt C-2} as half way across. Names of the form {\tt R<natural number>} and {\tt C<natural number>} are reserved for special use. They should be defined by you as alignment points along the y axis and x axis respectively. Then {\tt pslayout} constructs all possible pairs like {\tt R15C2} (think of it as row 15, column 2) to serve as named positions. Do NOT use either {\tt R} or {\tt C} alone as the name of a point. Note that {\tt R0C-1} will be the same as {\tt PSTtr} and {\tt R0C-2} will be the same as {\tt PSTtc}.
90
91
92 \section{An example file}
93 \begin{verbatim}
94 %&latex
95 \documentclass[dvips,10pt]{article}
96 \usepackage[dvipsnames]{pstricks}
97 \usepackage{pst-layout}
98 \pagestyle{empty}
99 \setlength\parindent{0pt}
100 \begin{document}
101 % Remember that C-1, C-2, R0 are predefined---do not change
102 \NumPoints=2 % ignore higher indices
103 \PointName(1)={TR}\PointPos(1)={PSPtr}
104 \PointName(2)={R1}\PointPos(2)={(R0)-(0,.25)}
105 \def\MaxR{1}\def\MaxC{0}
106 \NumFrames=1
107 \FrameStart(1)={0,0}\FrameEnd(1)={PSPtr}
108 \NumFragments=1 %
109 \Frag(1)={Some text}\FragRefPt(1)={B}%Baseline, center
110 \FragPos(1)={R1C-2}
111 \psset{unit=1in,picwidth=3in,picheight=2in}
112 \begin{pslayout}
113 \end{pslayout}
114 \end{document}
115 \end{verbatim}
116 Between \verb|\begin{document}| and \verb|\begin{pslayout}| one enters the data specifications.
117 \begin{description}
118 \item[NumPoints] The entry \verb|\NumPoints=2| directs the program to look for points with index from 1 to 2. Non-existent entries are ignored.
119 \item[Point...] The next two lines define the points with indices 1 and 2. The first line says, in effect, let {\tt TR} be an alternative name for {\tt PSPtr}. The second says to define {\tt R1} to be .25(in) below {\tt R0}, on the y axis.
120 \item[MaxR, MaxC] The following line instructs the program to create names of the for {\tt R<i>C<j>} for {\tt i<=1}, {\tt j<=0}.
121 \item[NumFragments] The entry \verb|\NumFrags=1| says to read \verb|\Frag...| entries with index 1.
122 \item[NumFrames] The entry \verb|\NumFrames=1| says to read \verb|\Frame...| entries with index 1.
123 \item[Frame(1)] The items \verb|\FrameStart(1)| and \verb|\FrameEnd(1)| define opposite corners of a rectangular frame.
124 \item[psset] The \verb|\psset{}| line defines the settings to be used in constructing the canvas.
125 \item[pslayout] The command \verb|\begin{pslayout}| initiates processing the arrays of data and inserts them one by one onto the canvas, Following that, the the graphics commands between \verb|\begin{pslayout}| and \verb|\end{pslayout}|are performed, overprinting all that went before. (There are none in this example.) The red items in the following picture were added but are not shown in the example code.\end{description}
126 \begin{figure}[htbp] % figure placement: here, top, bottom, or page
127 \centering
128 \includegraphics{example1}
129 \caption{Output (including dots and labels)}
130 \label{fig:example1}
131 \end{figure}
132 The remaining sections describe in detail how to enter graphics, points, frames, lines, dots and text fragments. (That is the order in which they are processed.)
133 \section {Graphics}
134 External graphics must be in {\tt .eps} format. The files should if possible be at natural size so that line widths and text sizes match those of other elements. The Graphics section may have the following items.
135 \begin{verbatim}
136 \NumGraphics=<maximum index>% obligatory
137 \Graphic(1)={<filename>}% omit the .eps
138 \GraphicPos(1)={<position>}% may be any form, even node expression
139 \GraphicOpts(1)={<list of options>}% eg, width=2in
140 \GraphicRefPt(1)={<reference pt>}% eg, bl, b
141 \end{verbatim}
142 If \verb|\Graphic(1)| is defined and non-empty, \verb|\GraphicPos(i)| must be specified. If \verb|\GraphicOpts()| and \verb|\GraphicRefPt()| are empty, the effect is to place the graphic using the {\tt graphicx} version of \verb|\includegraphics|, so that its center is at \verb|\GraphicPos()|. If \verb|\GraphicOpts()| is not empty, its contents are passed along as options to \verb|\includegraphics|. If \verb|\GraphicRefPt()| is not empty, its contents are used to specify the reference point of the graphic---the point which is to be translated to \verb|\GraphicPos()|. Typical values are {\tt bl} (bottom left), {\tt b} (bottom center).
143 \section{Points}
144
145 The Points section of the data may have the following elements.
146 \begin{verbatim}
147 \NumPoints=<maximum index>% obligatory
148 \PointName(1)={<your choice>}
149 \PointPos(1)={<position>}% may be any form, even node expression
150 \PointSeries(1)={<min>;<max>}% first, last indices
151 \PointInc(1)={<increment between points in series>}
152 \end{verbatim}
153 If \verb|\PointName(i)| is defined and non-empty, \verb|\PointPos(i)| must be specified. The result is to create a node of specified name at the specified location. If \verb|\PointSeries(i)| is defined, then \verb|\PointInc(i)| must be defined. here is the meaning, by example.
154 \begin{verbatim}
155 \PointName(4)={P}
156 \PointPos(4)={1,2}
157 \PointSeries(4)={5;8}
158 \PointInc(4)={.1in,.2cm}
159 \end{verbatim}
160 The result is that nodes named {\tt P5...P8} are defined, with {\tt P5} set to (1,2). Then the remaining nodes are set at increments of (.1in,.2cm), so that {\tt P8} is at (1,2)+(.3in,.6cm).
161
162 While \verb|\PointPos()| may be specified as a node expression, \verb|\PointInc()| may not---it may however use any form understood by \verb|\SpecialCoor|.
163
164 \section{Frames}
165 The Frames section of the data may have the following elements.
166 \begin{verbatim}
167 \NumFrames=<maximum index>% obligatory
168 \FrameStart(1)={<position>}% one corner
169 \FrameEnd(1)={<position>}% opposite corner
170 \FrameDelta(1)={<position>}% can specify width,height instead
171 \FrameOpts(1)={<list of options>}%eg, linewidth, linecolor
172 \FrameSolid(1)={<non-empty value for solid frame>}
173 \end{verbatim}
174 If \verb|\FrameEnd(i)| is defined and non-empty, \verb|\FrameDelta(i)| is ignored, otherwise the latter must be specified. The value of \verb|\FrameSolid| determines whether the frame is solid not. If \verb|\FrameSolid(i)| is non-empty (\verb|{1}|, say) the result will be a solid frame with color given by {\tt linecolor}, otherwise there is an outer rectangular frame in {\tt linecolor}, and the interior is filled in {\tt fillcolor} using {\tt fillstyle}. For example.
175 \begin{verbatim}
176 \FrameStart(4)={2,3}
177 \FrameDelta(4)={1cm,2}
178 \FrameOpts(4)={fillstyle=solid,fillcolor=yellow}
179 \end{verbatim}
180 results in a black frame around a solid yellow interior. (By default, {\tt fillstyle} {\tt =none,fillcolor=white}.)
181 \section{Lines}
182 The Lines section of the data may have the following elements.
183 \begin{verbatim}
184 \NumLines=<maximum index>% obligatory
185 \LStart(1)={<position>}% initial point
186 \LEnd(1)={<position>}% other end
187 \LDelta(1)={<position>}% can specify increment instead
188 \LOpts(1)={<list of options>}%eg, linewidth, linecolor
189 \LArrow(1)={<arrow specification>}
190 \end{verbatim}
191 If \verb|\LEnd(i)| is defined and non-empty, \verb|\LDelta(i)| is ignored, otherwise the latter must be specified. The value of \verb|\LArrow| determines the arrows, if any. The default here is \verb|{-}|, an ordinary line with no arrows. Other common options are \verb|{->}|, \verb|{<->}|. The value of the option {\tt arrowscale} (default value 1) affects the size of the arrowhead.) All of \verb|\LStart()|, \verb|\LEnd()|, \verb|\LDelta()| may be specified as node expressions. For example.
192 \begin{verbatim}
193 \LStart(4)={2,3}
194 \LDelta(4)={1cm,2}
195 \LOpts(4)={linewidth=.5pt,linecolor=red}
196 \LArrow(4)={->}
197 \end{verbatim}
198 results in a red line from (2,3) to (2,3)+(1cm,2) with an arrowhead at the latter.
199 \section{Dots}
200 The Dots section of the data may have the following elements.
201 \begin{verbatim}
202 \NumDots=<maximum index>% obligatory
203 \DotPos(1)={<position>}% position
204 \DotOpts(1)={<list of options>}%eg, linecolor, dotstyle, dotsize
205 \end{verbatim}
206 The position may be specified by a a node expression. The options available for a dot are many. By default, {\tt dotstyle=*}, which makes a solid circular dot. Other common choices are {\tt dotstyle=o} and {\tt dotstyle=Bo}, both of which produce circular dots, the latter a little bolder. With the default values of {\tt linecolor} and {\tt fillcolor}, you get a black edge with white fill. The size depends on {\tt dotscale} and {\tt dotsize}. See the {\tt pstricks} documentation.
207 \section{Fragments}
208 The Fragments section of the data may have the following elements.
209 \begin{verbatim}
210 \NumFragments=<maximum index>% obligatory
211 \Frag(1)={<text fragment>}
212 \FragPos(1)={<position>}% where to position it
213 \FragRefPt(1)={<one of B, c, t, r, b, tr, tl, br, bl, Bl, Br, etc>}
214 %\FragRefPt can also be polar offset from \FragPos
215 \FragRotation(1)={<rotation angle>}% eg 90
216 \FragBlankBG(1)={<non-empty value blanks background>}
217 \end{verbatim}
218 The position \verb|\FragPos()| may be specified by a node expression. \verb|\Frag()| specifies the text that is printed. (It may be a \verb|\parbox| or other \LaTeX\ construct.) The fragment is rotated through \verb|\FragRotation()|, if specified. There are two different placement regimes, depending on the form of \verb|\FragRefPt()|. If omitted (in which case it defaults to {\tt c}) or it one of the string values listed above, then that reference point is translated to \verb|\FragPos()|. On the other hand, if \verb|\FragRefPt()| contains the {\tt ;} character, it is assumed to specify a polar offset from \verb|\FragPos()|. For example, \verb|\FragRefPt(3)={8pt;30}| specifies a polar offset of {\tt 8pt} at an angle of 30 degrees. (The form \verb|{;30}| uses the value of {\tt labelsep} for the radius, which by default is {\tt 5pt}.) These behaviors correspond to those of the {\tt pstricks} \verb|\rput| and \verb|\uput| macros respectively.
219
220 If \verb|\Frag(i)| is specified, then \verb|\FragPos(i)| is obligatory. The other items are optional, but the default value of \verb|\FragRefPt(i)| is not usually appropriate in the {\tt layout} context. Most commonly, you will wish to align text fragments by baseline, centered \verb|{B}| or by baseline, left \verb|{Bl}|. Columns of numbers may require \verb|{Br}|.
221 \section{Type}
222 Dots, Frames and Lines have another feature not yet mentioned---an optional {\tt Type}. There are arrays \verb|\DotType()|, \verb|\FrameType()| and \verb|\LType()| which behave the same way in each case, so we discuss only \verb|\DotType()|.
223
224 Suppose you have several different types of Dots you wish to use in your design, with different parameters. Instead of entering these parameters each time in \verb|\DotOpts()|, you define a number of types incorporating those parameters. Let's suppose we want to use two different Dots that don't use just the default settings. We define two types, say {\tt A} and {\tt B}. In the document preamble, define them with, say,
225 \begin{verbatim}
226 \newpsobject{psdotA}{psdot}{dotstyle=Bo,dotsize=5pt}
227 \newpsobject{psdotB}{psdot}{dotstyle=o,dotsize=2pt}
228 \end{verbatim}
229 Then, if \verb|\DotType(i)={A}|, the Dot will use the first set of parameters. You may of course make changes and changes to those new defaults in \verb|\DotOpts(i)|.
230
231 There is one further complication in using \verb|\LType|. In order to prepare for a new Type {\tt A}, you need to add two line to the preamble of your document, like
232 \begin{verbatim}
233 \newpsobject{pslineA}{psline}{linecolor=red,arrows=->}
234 \newpsobject{psrlineA}{psrline}{linecolor=red,arrows=->}
235 \end{verbatim}
236 because {\tt layout} may use the macro \verb|\psrline| from {\tt pst-node} instead of \verb|\psline|.
237 \section{Other issues}
238 From the user's point of view, the {\tt pslayout} environment works as follows.
239 \begin{itemize}
240 \item If there is a macro by the name \verb|\AtLayoutStart|, insert its contents so that it applies to the entire layout. Eg,
241 \begin{verbatim}
242 \def\AtLayoutStart{\small \psset{Linewidth=.6pt,arrowscale=1.5}}
243 \end{verbatim}
244 \item If {\tt showfullcanvas} was specified by, eg,
245 \begin{verbatim}
246 \psset{unit=1in,picwidth=3.5in,picheight=2in,showfullcanvas}
247 \end{verbatim}
248 then an invisible off-white frame is drawn around the canvas so that if white space is trimmed from the resulting graphic, no part of the canvas will be trimmed.
249 \item All nodes defined by \verb|\PointName()| are constructed.
250 \item All external graphic files listed in \verb|\Graphic()| are placed.
251 \item If there is a macro by the name \verb|\FrameSettings|, and if \verb|\NumFrames>0|, its code is inserted here. Most commonly, this will be a \verb|\psset{}| to control the appearance of all frames. It could be any {\tt pstricks} command, if you needed to have an object appear before frames were drawn. The code is grouped so that it applies only within the Frames section.
252 \item All frames defined by \verb|\Frame...()| are constructed.
253 \item If there is a macro by the name \verb|\LineSettings|, and if \verb|\NumLines>0|, its code is inserted here. Most commonly, this will be a \verb|\psset{}| to control the appearance of all lines. It could be any {\tt pstricks} command, if you needed to have an object appear before lines were drawn. The code is grouped so that it applies only within the Lines section.
254 \item All lines defined by \verb|\L...()| are drawn.
255 \item If there is a macro by the name \verb|\DotSettings|, and if \verb|\NumDots>0|, its code is inserted here. Most commonly, this will be a \verb|\psset{}| to control the appearance of all dots. It could be any {\tt pstricks} command, if you needed to have an object appear before dots were drawn. The code is grouped so that it applies only within the Dots section.
256 \item All dots defined by \verb|\Dot...()| are drawn.
257 \item If there is a macro by the name \verb|\FragSettings|, and if \verb|\NumFragments>0|, its code is inserted here. Most commonly, this will be a \verb|\psset{}| to control the appearance of all fragments. It could be any {\tt pstricks} command, if you need to have an object appear after dots are rendered but before fragments are drawn. The code is grouped so that it applies only within the Fragments section.
258 \item All fragments defined by \verb|\Frag...()| are drawn.
259 \item All {\tt pstricks} commands between \verb|\begin{pslayout}| and \verb|\end{pslayout}| are carried out. This the where you place items that must be on the top layer. In particular, the command \verb|\showRC|
260 will show the defined {\tt R} and {\tt C} nodes and their combinations using green lines, as a temporary guide in your design.
261 \item The pair
262 \begin{verbatim}
263 \begin{pslayout*}
264 \end{pslayout*}
265 \end{verbatim}
266 behaves the same way as the {\tt pslayout} environment, but clips all material to the boundary of the canvas.
267 \end{itemize}
268 \section{Drawing at a fixed location on the paper}
269 In \LaTeX, this is handled most easily using the \textsf{geometry} package. See the last example below. You may use to print on custom-sized paper, placing the canvas as you wish by specifying the appropriate margin parameters and {\tt nohead} to \textsf{geometry} so that the rectangle that remains is exactly the size of your canvas. Remember then to set \verb|\parindent=0pt|.
270 \section{Examples}
271 The following would make an {\tt eps} graphic the size of a standard business card.
272 \begin{verbatim}
273 %&latex
274 %process with latex+dvips+ps2eps(+epstopdf)
275 \documentclass[dvips,10pt]{article}
276 \usepackage[dvipsnames]{pstricks}
277 \usepackage{pst-layout}
278 \usepackage{mathptmx}
279 \font\lfA=ptmr at 9.5pt %
280 \font\lfB=ptmr at 9pt %
281 \font\lfC=ptmr at 8.5pt %
282 \font\lfD=ptmr at 7.5pt %
283 % With 10pt as \normalsize, \small is 9pt
284 %\scriptsize is 7pt. The above provide more choices
285 \pagestyle{empty}
286 \setlength\parindent{0pt}
287 \begin{document}
288 % Remember that C-1, C-2, R0 are predefined---do not change
289 \def\AtLayoutStart{\scriptsize }
290 \NumPoints=5 % ignore higher indices
291 \PointName(1)={TR}\PointPos(1)={PSPtr}
292 % The next lines define nodes R1..R7 to specify rows
293 \PointName(2)={R}\PointPos(2)={0,1.03}%
294 \PointInc(2)={0,-.138in}\PointSeries(2)={1;7}
295 \PointName(3)={C0}\PointPos(3)={.19,0}%start column for name etc
296 \PointName(4)={C1}\PointPos(4)={3.31,0}%end column for name etc
297 \PointName(5)={C2}\PointPos(5)={2.22,0}%start column for email etc
298 \def\MaxR{8}\def\MaxC{2}
299 \NumGraphics=1
300 \Graphic(1)={mygraphic}%requires mygraphic.eps
301 \GraphicPos(1)={.453,1.49}
302 \GraphicRefPt(1)={c}
303 \GraphicOpts(1)={width=43pt,height=44pt}
304 \NumFragments=9 %
305 \Frag(1)={\normalsize YOUR OWN NAME}\FragRefPt(1)={B}%Baseline, center
306 \FragPos(1)={R1C-2}
307 \Frag(2)={\lfB Your Position}\FragPos(2)={R2C-2}\FragRefPt(2)={B}
308 \Frag(3)={\lfB Your Department}\FragPos(3)={R3C-2}\FragRefPt(3)={B}
309 \Frag(4)={YOUR INSTITUTION}\FragPos(4)={R6C0}\FragRefPt(4)={Bl}
310 \Frag(5)={\lfD Your Address}\FragPos(5)={R7C0}\FragRefPt(5)={Bl}
311 \Frag(6)={\lfD Phone:} \FragPos(6)={R6C2}\FragRefPt(6)={Bl}
312 \Frag(7)={\lfD email:}\FragPos(7)={R7C2}\FragRefPt(7)={Bl}
313 \Frag(8)={\lfD Your phone}\FragPos(8)={R6C1}\FragRefPt(8)={Br}
314 \Frag(9)={\lfD Your email}\FragPos(9)={R7C1}\FragRefPt(9)={Br}
315 \psset{unit=1in,picwidth=3.5in,picheight=2in,showfullcanvas}
316 \begin{pslayout}
317 \end{pslayout}
318 \end{document}
319 \end{verbatim}
320 Once this graphic is created and saved in {\tt.eps} format, say as {\tt mycard.eps}, you may print out ten cards per page using the following.
321
322 \begin{verbatim}
323 %&latex
324 %latex+dvips+epstopdf
325 \documentclass[dvips,10pt]{article}
326 \usepackage{graphicx}
327 \usepackage{pstricks-add}
328 \usepackage[vmargin=.5in,hmargin=.75in,nohead]{geometry}
329 \usepackage{mathptmx}
330 \pagestyle{empty}
331 \setlength\parindent{0pt}
332 \begin{document}
333 \psset{xunit=3.5in,yunit=2in}
334 \begin{pspicture}(2,5)
335 \multido{\iA=0+1}{5}{%
336 \multido{\iB=0+1}{2}{\rput[bl](\iB,\iA){\includegraphics{mycard}}}}
337 \end{pspicture}
338 \end{document}
339 \end{verbatim}
340
341
342 \end{document}