Debian Codegraph @

texmf-dist/doc/latex/egameps/egameps.tex

raw
1 %
2 % Changes relative to egame.sty:
3 % 1. No anomalous cases for \iib
4 %2. eginfods changed to eginfodotsep
5 %3. No small disks at ends of histories
6 %
7 %Allows any slope for branches, and any style.
8 %
9 \documentclass[12pt]{article}
10 \usepackage{mjoarti}
11 \usepackage{pstricks}
12 \usepackage{pstcol,pst-mjo,pst-3d}
13 \usepackage{url}
14 \usepackage{egameps}
15 \begin{document}
16
17 \renewcommand{\descriptionlabel}[1]{\hspace\labelsep
18 \normalfont #1\phantom{.}}
19
20 \begin{center}
21 {\bfseries Manual for {\tt egameps.sty}}\\
22 by\\
23 Martin J. Osborne\\
24 {\tt [email protected]}\\
25 Version 1.1, June 2004\\
26 (based on \texttt{egame.sty}, November 1997)
27 \end{center}
28
29
30 \section{Introduction}
31 {\tt egameps.sty} is a \LaTeX2e\ style file for drawing extensive games. It
32 is intended to have the capability of drawing any extensive game. It is not
33 very fast (probably because it is not written very efficiently, but possibly
34 simply because it needs to make a lot of computations). The latest version is
35 available at \url{http://www.economics.utoronto.ca/osborne/latex/}.
36
37 The style requires the PSTricks package (available on CTAN; documented in
38 \emph{The \LaTeX\ Graphics Companion}) and a means of printing a Postscript
39 file (e.g.\ a Postscript printer, or a non-Postscript printer and the program
40 Ghostscript). Because the style uses the PSTricks macros, it is incompatible
41 with \verb+pdftex+. You may produce a pdf file by first creating a dvi file
42 normally, then using \verb+dvips+ to create a Postscript file, and finally
43 using Ghostscript to create a pdf file from the Postscript file. (If your
44 operating system is DOS or Windows, you can automate this process in a batch
45 file. If your text editor is sufficiently configurable, you will be able to
46 initiate the process with a single keystroke.) Alternatively, you use the
47 \verb+pdftricks+ package to finesse the limitation of \verb+pdftex+; see
48 Section~\ref{s:pdftricks}.
49 \section{Installation}
50 \begin{itemize}
51 \item Put \texttt{egameps.sty} in a directory from which \TeX\ reads input
52 files. (In MiKTeX the directory might be something like
53 \url{\miktex\localtexmf\tex\latex\} or a subdirectory thereof.)
54 \item Let \TeX\ know that \texttt{egameps} has arrived. (In MiKTeX,
55 ``refresh the filename database''.)
56 \item Check that you have PSTricks. If you do not, get it from CTAN.
57 \item To use the package in a document, put the lines\newline
58 \indent\verb+\usepackage{pstricks}+\newline
59 \indent\verb+\usepackage{pstcol}+\newline
60 \indent\verb+\usepackage{egameps}+\newline
61 in the preamble. To use the macro \verb+\ctmbarc+ you need to include also
62 the line\newline
63 \indent\verb+\usepackage{pst-3d}+
64 \end{itemize}
65 \section{Using the style}
66 To draw a game using the style, first break the game into components, each
67 consisting of a node together with the branches that emanate from it, the
68 names with which the actions are labeled, and the players' payoffs if the
69 nodes at the end of the branches are terminal. To draw each component, calls
70 to two macros are needed. First \verb+\putbranch+ is called, which sets the
71 position of the node and the slope and length of the branch(es), then either
72 \verb+\ib+, \verb+\iib+, or \verb+\iiib+. The macro \verb+\ib+ draws a single
73 branch, while \verb+\iib+ and \verb+\iiib+ draw two and three branches
74 respectively. If the node has more than three branches, calls to a
75 combination of these macros are needed.
76
77 A game is begun by a call of the type\newline
78 \indent\verb+\begin{egame}400,500)+\newline
79 which starts a \verb+pspicture+, with dimensions $(400,500)$ and the
80 unitlength equal to the default of 0.1mm, or\newline
81 \indent\verb+\begin{egame}(400,500)[1mm]+\newline
82 which starts a \verb+pspicture+, with dimensions $(400,500)$ and sets the
83 unitlength at 1mm.
84
85 The next section gives examples that illustrate many of the features of the
86 package. Precise descriptions of the macros are given in
87 Section~\ref{s:descr}.
88 \section{Examples}
89 The game in Figure~\ref{f:one} is produced by the following code.
90
91 %%%%%%%%%%%%%%
92 %% EXAMPLE 1 %
93 %%%%%%%%%%%%%%
94 \begin{verbatim}
95 \begin{figure}[htb]
96 \hspace*{\fill}
97 \begin{egame}(600,280)
98 %
99 % put the initial branch at (300,240), with (x,y) direction
100 % (2,1), and horizontal length 200
101 \putbranch(300,240)(2,1){200}
102 %
103 % give the branch two actions, label it for player 1,
104 % and label the actions $L$ and $R$
105 \iib{1}{$L$}{$R$}
106 %
107 % put a branch at (100,140), with (x,y) direction
108 % (1,1) and horizontal length 100
109 \putbranch(100,140)(1,1){100}
110 %
111 % give the branch two actions, omit a player label,
112 % label the actions $a$ and $b$, and assign the payoffs
113 % $1,0$ and $2,3$ to these actions
114 \iib{}{$a$}{$b$}[$1,0$][$2,3$]
115 %
116 % put a branch at (500,140), with (x,y) direction (1,1)
117 % and horizontal length 100
118 \putbranch(500,140)(1,1){100}
119 %
120 % give the branch two actions, omit a player label,
121 % label the actions $c$ and $d$, and assign the payoffs
122 % $0,1$ and $-1,0$ to these actions
123 \iib{}{$c$}{$d$}[$0,1$][$-1,0$]
124 %
125 % draw an information set between the nodes at (100,140)
126 % and (500,140)
127 \infoset(100,140){400}{2}
128 %
129 \end{egame}
130 \hspace*{\fill}
131 \caption[]{An extensive game}\label{f:one}
132 \end{figure}
133 \end{verbatim}
134
135 \begin{figure}[htb]
136 \hspace*{\fill}
137 \begin{egame}(600,280)
138 \putbranch(300,240)(2,1){200}
139 \iib{1}{$L$}{$R$}
140 \putbranch(100,140)(1,1){100}
141 \iib{}{$a$}{$b$}[$1,0$][$2,3$]
142 \putbranch(500,140)(1,1){100}
143 \iib{}{$c$}{$d$}[$0,1$][$-1,0$]
144 \infoset(100,140){400}{2}
145 \end{egame}
146 \hspace*{\fill}
147 \caption[]{An extensive game}\label{f:one}
148 \end{figure}
149
150 Another example, illustrating more features, is produced by the following
151 code, and is shown in Figure~\ref{f:two}.
152
153 %%%%%%%%%%%%%%
154 %% EXAMPLE 2 %
155 %%%%%%%%%%%%%%
156
157 \begin{verbatim}
158 \begin{figure}[htb]
159 \hspace*{\fill}
160 %
161 % fill boxes containing payoffs with a solid red color
162 \renewcommand{\egpayboxfillstyle}{solid}
163 \renewcommand{\egpayboxfillcolor}{red}
164 % add a bit of separation around the payoffs
165 \egpayoffboxsep=1mm
166 %
167 % fill boxes containing action labels with a solid blue color
168 \renewcommand{\egalboxfillstyle}{solid}
169 \renewcommand{\egalboxfillcolor}{blue}
170 \egactionboxsep=1mm
171 %
172 % put player labels in green circles
173 \renewcommand{\egplbox}{c}
174 \renewcommand{\egplboxlinestyle}{solid}
175 \renewcommand{\egplboxlinecolor}{green}
176 \egplayerboxsep=1mm
177 %
178 \begin{egame}(500,280)
179 %
180 % put the initial branch at (300,240), with (x,y) direction
181 % (2,1), and horizontal length 200
182 \putbranch(300,240)(2,1){200}
183 %
184 % give the branch three actions, label it for player 1,
185 % label the actions $L$, $M$, and $R$, and make the middle
186 % and right actions terminal, with payoffs $1,2$ and $0,1$
187 \iiib{1}{$L$}{$M$}{$R$}[][$1,2$][$0,1$]
188 %
189 % put a branch at (100,140), with (x,y) direction
190 % (1,1) and horizontal length 100
191 \putbranch(100,140)(1,1){100}
192 %
193 % give the branch two actions, make the left-hand one dashed,
194 % label the branch for player 2, putting
195 % the player label to the top left of the node,
196 % label the actions $a$ and $b$, and assign the payoffs
197 % $1,0$ and $2,3$ to these actions
198 \iib[linestyle=dashed][]{2}[l]{$a$}{$b$}[$1,0$][$2,3$]
199 %
200 \end{egame}
201 \hspace*{\fill}
202 \caption[]{Another extensive game}\label{f:two}
203 \end{figure}
204 \end{verbatim}
205
206 \begin{figure}[htb]
207 \hspace*{\fill}
208 \renewcommand{\egpayboxfillstyle}{solid}
209 \renewcommand{\egpayboxfillcolor}{red}
210 \egpayoffboxsep=1mm
211 \renewcommand{\egalboxfillstyle}{solid}
212 \renewcommand{\egalboxfillcolor}{blue}
213 \egactionboxsep=1mm
214 \renewcommand{\egplbox}{c}
215 \renewcommand{\egplboxlinestyle}{solid}
216 \renewcommand{\egplboxlinecolor}{green}
217 \egplayerboxsep=1mm
218 \begin{egame}(500,280)
219 %
220 % put the initial branch at (300,240), with (x,y) direction
221 % (2,1), and horizontal length 200
222 \putbranch(300,240)(2,1){200}
223 %
224 % give the branch three actions, label it for player 1,
225 % label the actions $L$, $M$, and $R$, and make the middle
226 % and right actions terminal, with payoffs $1,2$ and $0,1$
227 \iiib{1}{$L$}{$M$}{$R$}[][$1,2$][$0,1$]
228 %
229 % put a branch at (100,140), with (x,y) direction
230 % (1,1) and horizontal length 100
231 \putbranch(100,140)(1,1){100}
232 %
233 % give the branch two actions, label it for player 2, putting
234 % the player label to the top left of the node,
235 % label the actions $a$ and $b$, and assign the payoffs
236 % $1,0$ and $2,3$ to these actions
237 \iib[linestyle=dashed][]{2}[l]{$a$}{$b$}[$1,0$][$2,3$]
238 %
239 \end{egame}
240 \hspace*{\fill}
241 \caption[]{Another extensive game}\label{f:two}
242 \end{figure}
243
244 Yet another example, illustrating still more features, is produced by the
245 following code, and is shown in Figure~\ref{f:three}.
246
247 \begin{verbatim}
248 \begin{figure}[htb]
249 \hspace*{\fill}
250 %
251 \begin{egame}(600,480)
252 %
253 % put the initial branch at (300,240), with (x,y) direction
254 % (1,0), and horizontal length 200
255 \putbranch(300,240)(1,0){200}
256 %
257 % give the branch two actions, label it for player $c$,
258 % and label the actions ${1\over 2}$ and ${1\over 2}$
259 \iib{$c$}{${1\over 2}$}{${1\over 2}$}
260 %
261 % put a branch at (100,240), with (x,y) direction
262 % (0,1), going right, and vertical length 100. (Notes: If the
263 % branch were specified as going left, it would look the same,
264 % but the player label would be in the wrong place. The
265 % third mandatory argument of \putbranch is the horizontal
266 % distance unless the branch is vertical, in which case it is
267 % the vertical distance.)
268 \putbranch(100,240)(0,1)[r]{100}
269 %
270 % give the branch two actions, label it for player 1,
271 % and label the actions $a$ and $b$
272 \iib{1}{$a$}{$b$}
273 %
274 % put a branch at (500,240), with (x,y) direction
275 % (0,1), going left, and vertical length 100.
276 \putbranch(500,240)(0,1)[l]{100}
277 %
278 % give the branch two actions, label it for player 1,
279 % and label the actions $b$ and $a$
280 \iib{1}{$b$}{$a$}
281 %
282 % put an information set at (100,340), of length 400,
283 % assigned to player 2
284 \infoset(100,340){400}{2}
285 %
286 % put an information set at (100,140), of length 400,
287 % assigned to player 2
288 \infoset(100,140){400}{2}
289 %
290 % put a branch at (100,340), with (x,y) direction
291 % (1,1), going up, and horizontal length 100.
292 \putbranch(100,340)(1,1)[u]{100}
293 %
294 % specify a positive horizontal shift for the action labels,
295 % which slides the ones on the right-hand branches to the
296 % right along the branches and the ones on the left to the
297 % left, improving the label positions
298 \egalhshift=20
299 %
300 % give the branch two actions, give it no player label,
301 % label the actions $L$ and $R$, and put payoffs of
302 % $-1,0$ and $0,-1$.
303 \iib{}{$L$}{$R$}[$-1,0$][$0,-1$]
304 %
305 % put a branch at (500,340), with (x,y) direction
306 % (1,1), going up, and horizontal length 100.
307 \putbranch(500,340)(1,1)[u]{100}
308 %
309 \egalhshift=20
310 %
311 % give the branch two actions, give it no player label,
312 % label the actions $L$ and $R$, and put payoffs of
313 % $1,0$ and $0,1$.
314 \iib{}{$L$}{$R$}[$1,0$][$0,1$]
315 %
316 % put a branch at (100,140), with (x,y) direction
317 % (1,1), going down, and horizontal length 100.
318 \putbranch(100,140)(1,1)[d]{100}
319 %
320 \egalhshift=20
321 %
322 % give the branch two actions, give it no player label,
323 % label the actions $L$ and $R$, and put payoffs of
324 % $2,0$ and $0,2$.
325 \iib{}{$L$}{$R$}[$1,0$][$0,1$]
326 %
327 % put a branch at (500,140), with (x,y) direction
328 % (1,1), going down, and horizontal length 100.
329 \putbranch(500,140)(1,1)[d]{100}
330 %
331 \egalhshift=20
332 %
333 % give the branch two actions, give it no player label,
334 % label the actions $L$ and $R$, and put payoffs of
335 % $3,0$ and $0,3$.
336 \iib{}{$L$}{$R$}[$1,0$][$0,1$]
337 %
338 \end{egame}
339 \hspace*{\fill}
340 \caption[]{Yet another extensive game}\label{f:three}
341 \end{figure}
342 \end{verbatim}
343
344 \begin{figure}[htb]
345 \hspace*{\fill}
346 \egpayoffboxsep=0mm
347 \begin{egame}(600,480)
348 \putbranch(300,240)(1,0){200}
349 \iib{$c$}{${1\over 2}$}{${1\over 2}$}
350 \putbranch(100,240)(0,1)[r]{100}
351 \iib{1}{$a$}{$b$}
352 \putbranch(500,240)(0,1)[l]{100}
353 \iib{1}{$b$}{$a$}
354 \infoset(100,340){400}{2}
355 \infoset(100,140){400}{2}
356 \putbranch(100,340)(1,1)[u]{100}
357 \egalhshift=20
358 \iib{}{$L$}{$R$}[$-1,0$][$0,-1$]
359 \putbranch(500,340)(1,1)[u]{100}
360 \egalhshift=20
361 \iib{}{$L$}{$R$}[$1,0$][$0,1$]
362 \putbranch(100,140)(1,1)[d]{100}
363 \egalhshift=20
364 \iib{}{$L$}{$R$}[$2,0$][$0,2$]
365 \putbranch(500,140)(1,1)[d]{100}
366 \egalhshift=20
367 \iib{}{$L$}{$R$}[$3,0$][$0,3$]
368 \end{egame}
369 \hspace*{\fill}
370 \caption[]{Yet another extensive game}\label{f:three}
371 \end{figure}
372
373 The next example, shown in Figure~\ref{f:four}, shows how to combine calls to
374 \verb+\iib+ to draw nodes followed by four branches.
375
376 \begin{verbatim}
377 \begin{figure}[htb]
378 \hspace*{\fill}
379 \begin{egame}(1200,380)
380 %
381 % put an initial node at (700,340), with (x,y) direction
382 % (3,1), and horizontal length 600
383 \putbranch(700,340)(3,1){600}
384 %
385 % give the branch two actions, label it for player $1$,
386 % label the actions $A$ and $D$, and make the right-
387 % hand node terminal, with payoffs $0,1$.
388 \iib[linecolor=red][]{$1$}{$A$}{$D$}[][$0,1$]
389 %
390 % to add two more branches to the initial node, force
391 % the branch to be initial
392 \initialtrue
393 % and specify the direction (1,1) and the horizontal length 200
394 \putbranch(700,340)(1,1){200}
395 %
396 % tighten the spacing between labels and branches, to improve
397 % appearance (given the other branches)
398 \egactionlabelsep=0.5mm
399 % give the branch two actions and label the actions $B$ and $C$
400 \iib{}{$B$}{$C$}
401 %
402 % reset default spacing
403 \egactionlabelsep=1mm
404 % put a branch at (100,140), with direction (1,1)
405 % and horizontal length 100.
406 \putbranch(100,140)(1,1){100}
407 %
408 % give the branch two actions, omit a player label,
409 % label the actions $a$ and $b$, and put payoffs
410 \iib[][linecolor=red]{}{$a$}{$b$}[$2,1$][$4,0$]
411 %
412 % put a branch at (500,140), with direction (1,1)
413 % and horizontal length 100.
414 \putbranch(500,140)(1,1){100}
415 %
416 % give the branch two actions, omit a player label,
417 % label the actions $a$ and $b$, and put payoffs
418 \iib[][linecolor=red]{}{$a$}{$b$}[$1,3$][$-1,0$]
419 %
420 % put a branch at (900,140), with direction (1,1)
421 % and horizontal length 100.
422 \putbranch(900,140)(1,1){100}
423 %
424 % give the branch two actions, omit a player label,
425 % label the actions $a$ and $b$, and put payoffs
426 \iib[][linecolor=red]{}{$a$}{$b$}[$-1,0$][$2,1$]
427 %
428 % put an information set at (100,140), of length 800,
429 % assigned to player 2
430 \infoset(100,140){800}{2}
431 %
432 \end{egame}
433 \hspace*{\fill}
434 \caption[]{Yet another extensive game}\label{f:four}
435 \end{figure}
436 \end{verbatim}
437
438 \begin{figure}[htb]
439 \hspace*{\fill}
440 \begin{egame}(1300,380)
441 %
442 % put an initial node at (700,340), with (x,y) direction
443 % (6,1), and horizontal length 600
444 \putbranch(700,340)(3,1){600}
445 %
446 % give the branch two actions, label it for player $1$,
447 % and label the actions $A$ and $D$, and make the right-
448 % hand node terminal, with payoffs $0,1$.
449 \iib[linecolor=red][]{$1$}{$A$}{$D$}[][$0,1$]
450 %
451 % to add two more branches to the initial node, force
452 % the branch to be initial
453 \initialtrue
454 % and specify the direction (2,1) and the horizontal length 200
455 \putbranch(700,340)(1,1){200}
456 %
457 % tighten the spacing between labels and branches, to improve
458 % appearance (given the other branches)
459 \egactionlabelsep=0.2mm
460 % give the branch two actions and label the actions $B$ and $C$
461 \iib{}{$B$}{$C$}
462 %
463 % reset default spacing
464 \egactionlabelsep=0.7mm
465 % put a branch at (100,140), with direction (1,1)
466 % and horizontal length 100.
467 \putbranch(100,140)(1,1){100}
468 %
469 % give the branch two actions, omit a player label,
470 % label the actions $a$ and $b$, and put payoffs
471 \iib[][linecolor=red]{}{$a$}{$b$}[$2,1$][$4,0$]
472 %
473 % put a branch at (500,140), with direction (1,1)
474 % and horizontal length 100.
475 \putbranch(500,140)(1,1){100}
476 %
477 % give the branch two actions, omit a player label,
478 % label the actions $a$ and $b$, and put payoffs
479 \iib[][linecolor=red]{}{$a$}{$b$}[$1,3$][$-1,0$]
480 %
481 % put a branch at (900,140), with direction (1,1)
482 % and horizontal length 100.
483 \putbranch(900,140)(1,1){100}
484 %
485 % give the branch two actions, omit a player label,
486 % label the actions $a$ and $b$, and put payoffs
487 \iib[][linecolor=red]{}{$a$}{$b$}[$-1,0$][$2,1$]
488 %
489 % put an information set at (100,140), of length 800,
490 % assigned to player 2
491 \infoset(100,140){800}{2}
492 %
493 \end{egame}
494 \hspace*{\fill}
495 \caption[]{Yet another extensive game}\label{f:four}
496 \end{figure}
497
498
499 \section{Description of macros\label{s:descr}}
500 \verb+\begin{egame}(+\emph{width}\verb+,+\emph{height}%
501 {\tt )[}\emph{unitlength}\verb+]+\newline
502 \noindent begins an extensive game of width \emph{width} and height
503 \emph{height} and optionally sets the unitlength to be \emph{unitlength}
504 (default 0.1mm). In the game, all distances are given as integers, which are
505 interpreted as multiples of the unitlength. These integers should (probably)
506 be divisible by two, so that the integer arithmetic employed by \TeX\ doesn't
507 lose accuracy when numbers are divided by two. I have tested the macros
508 thoroughly only with the default unitlength of 0.1mm; unless there is a
509 compelling reason to use some different unitlength, I suggest sticking to
510 0.1mm. (\verb+\begin{egame}(w,h)+ starts a \verb+pspicture+ environment
511 (defined by PSTricks) of width {\tt w} and height {\tt h}.)
512
513 Permissible values:
514 \begin{description}
515 \item[\emph{width}, \emph{height}] Any pair of integers. (You need to
516 calculate these numbers.)
517 \item[\emph{unitlength}] Any dimension. Default: 0.1mm.
518 \end{description}
519
520 \vspace{4mm}
521
522 \noindent\verb+\end{egame}+\newline
523 \noindent ends an extensive game.
524
525 \vspace{4mm}
526
527 \noindent\verb+\putbranch(+\emph{x-coord}\verb+,+\emph{y-coord}{\tt
528 )(}\emph{h-incr},\emph{v-incr}{\tt
529 )[}\emph{direction}\verb+]{+\emph{length}\verb+}+\newline
530 \noindent sets up the parameters for a branch at the point
531 $($\emph{x-coord}$,$\emph{y-coord}$)$, with direction parameter
532 $($\emph{h-incr}$,$\emph{v-incr}$)$, optional direction \emph{direction}, and
533 length \emph{length}. Note that this macro merely sets up the parameters for
534 a call to \verb+\ib+ (one branch), \verb+\iib+ (two branches), \verb+\iiib+
535 (three branches), or \verb+\ctmb+ (continuum of branches); it does not draw
536 anything. The way in which the direction parameter
537 $($\emph{h-incr}$,$\emph{v-incr}$)$ is interpreted depends on whether
538 \verb+\ib+, \verb+\iib+, or \verb+\iiib+ is used to draw the branches. The
539 \emph{length} is the horizontal distance between the ends of one of the
540 branches to be drawn, unless \emph{h-incr} is 0, in which case \emph{length}
541 is the vertical distance between the ends of one of the branches.
542
543 Permissible values:
544 \begin{description}
545 \item[$($\emph{x-coord}$,$\emph{y-coord}$)$] Any pair of integers.
546 \item[$($\emph{h-incr}$,$\emph{v-incr}$)$] Any pair of integers except
547 \verb+(0,0)+.
548 \item[\emph{direction}] {\tt d} (down), {\tt u} (up), {\tt r} (right), or {\tt
549 l} (left); default {\tt d}. (The direction can be changed also globally, by
550 specifying \verb+\egdirection{+\emph{direction}\verb+}+ before the call to
551 \verb+\putbranch+.)
552 \item[\emph{length}] Any positive integer.
553 \end{description}
554
555 \vspace{4mm}
556
557 \noindent\verb+\ib[+\emph{branchstyle}\verb+]{+\emph{player-name}\verb+}[+%
558 \emph{player-label-position}\verb+]{+\emph{action-label}\verb+}+\newline
559 \verb+[+\emph{action-label-position}\verb+][+\emph{payoffs}{\tt ]}\newline
560 \noindent puts a single branch with the parameters of the preceding call to
561 \verb+\putbranch+, optionally using the PSTricks style \emph{branchstyle},
562 assigns it the player name \emph{player-name}, optionally positions the player
563 label relative to the node according to \emph{player-label-position}, labels
564 the action \emph{action-label}, optionally positions the label according to
565 \emph{player-label-position}, and optionally adds the payoffs \emph{payoffs}.
566 A single optional argument at the end is interpreted as follows: if its value
567 is \verb+o+ (outside), \verb+i+ (inside), or \verb+c+ (centered), it
568 determines the position of the action label; otherwise, it is a payoff label.
569 If there are two optional arguments, the first must be \verb+o+ (outside),
570 \verb+i+ (inside), or \verb+c+ (centered), determining the position of the
571 action label, and the second is a payoff label. (If you do not want an
572 optional positioning argument and you want your payoff label to be ``o'',
573 ``i'', or ``c'', here's a workaround: put the label in an \verb+hbox+, as in
574 \verb+\hbox{o}+. (Note that you do not need to do this if your payoff label
575 is \verb+$o$+, etc.---only if it is just ``o''.)
576
577 The first branch in any {\tt egame} is taken to be the initial branch of the
578 game; its beginning node is indicated by \verb+\eginode+, the default of which
579 is a small circle. Subsequent branches are taken to be noninitial, and are
580 indicated by \verb+\egnode+, the default value of which is a small disk. To
581 force a node to be initial, specify \verb+\initialtrue+ before it; to force a
582 node to be noninitial, specify \verb+\initialfalse+ before it. To change the
583 appearance of nodes, see Section~\ref{s:params}.
584
585 Permissible values:
586 \begin{description}
587 \item[\emph{branchstyle}] Any PSTricks linestyle (e.g.\ \verb+linecolor=red+,
588 \verb+linestyle=dashed+, \verb+linewidth=2pt+, \verb+doubleline=true+).
589
590 Default: \verb+linecolor=black+, \verb+linestyle=solid+,
591 \verb+linewidth=0.8pt+.
592 \item[\emph{player-name}] Any character string.
593 \item[\emph{player-label-position}] Either \verb+o+ (centered over the node),
594 or
595 \begin{itemize}
596 \item If the direction of the branch (as specified either by
597 \verb+\egdirection+ or by an optional argument of \verb+\putbranch+) is {\tt
598 d} or {\tt u}, either {\tt l} (above/below and to the left) and {\tt r}
599 (above/below and to the right).
600 \item If the direction of the branch is {\tt r} or {\tt l}, either {\tt u}
601 (to the left/right and up) and {\tt d} (to the left/right and down).
602 \end{itemize}
603 Default: is to center the label above for \verb+\egdirection+=\verb+d+, below
604 for \verb+\egdirection+=\verb+u+, to the left of the node for
605 \verb+\egdirection+=\verb+r+, or to the right of the node for
606 \verb+\egdirection+=\verb+l+.
607 \item[\emph{action-label}] Any character string.
608 \item[\emph{action-label-position}] \verb+o+ (outside), \verb+i+ (inside), or
609 \verb+c+ (centered on branch).
610
611 Default: \verb+o+. (For more on action label positioning, see
612 Section~\ref{s:alp}.)
613 \item[\emph{payoffs}] Any character string.
614 \end{description}
615
616 Examples:
617 \begin{verbatim}
618 \putbranch(0,100)(2,-1){200}
619 \ib{1}{$x$}
620 \end{verbatim}
621 $$\begin{egame}(200,180)
622 \putbranch(0,140)(2,-1){200}
623 \ib{1}{$x$}
624 \psline{<->}(0,0)(200,0)
625 \rput*(100,0){200}
626 \end{egame}$$
627
628 Note that in the following example the \verb+1+ in the direction pair
629 \verb+(0,1)+ is interpreted as sending the branch down, given that the
630 \verb+\egdirection+ is \verb+d+. (That is, once you specify the
631 \verb+\egdirection+ (or leave it at the default \verb+d+) you do not need to
632 worry about getting the sign of the \emph{v-incr} correct (if the direction is
633 \verb+d+ or \verb+u+) or the sign of the \emph{h-incr} correct (if the
634 direction is \verb+l+ or \verb+r+).
635
636 \begin{verbatim}
637 \putbranch(0,100)(0,1){100}
638 \ib[linecolor=gray]{1}[l]{$x$}[c]
639 \end{verbatim}
640 $$\begin{egame}(100,140)
641 \putbranch(0,100)(0,1){100}
642 \ib[linecolor=gray]{1}[l]{$x$}[c]
643 \psline{<->}(80,0)(80,100)
644 \rput*(80,50){100}
645 \end{egame}$$
646
647 \begin{verbatim}
648 \initialfalse
649 \putbranch(0,40)(1,1)[u]{100}
650 \ib{1}{$x$}[$0,2$]
651 \end{verbatim}
652 $$\begin{egame}(100,180)
653 \initialfalse
654 \putbranch(0,40)(1,1)[u]{100}
655 \ib{1}{$x$}[$0,2$]
656 \end{egame}$$
657
658 Notice that the optional direction specifier {\tt u} in \verb+\putbranch+
659 affects not only the direction of the branch (which is determined by the
660 argument {\tt (1,1)}), but also the placement of the player label relative to
661 the starting node.
662
663 \begin{verbatim}
664 \initialfalse
665 \putbranch(0,100)(1,1){100}
666 \ib{1}[l]{$x$}[i][$0,2$]
667 \end{verbatim}
668 $$\begin{egame}(100,180)
669 \putbranch(0,140)(1,-1){100}
670 \ib{1}[l]{$x$}[i][$0,2$]
671 \end{egame}$$
672
673 \vspace{4mm}
674
675 \noindent\verb+\iib[+\emph{style1}\verb+][+\emph{style2}\verb+]{+\emph{player-%
676 name}\verb+}[+%
677 \emph{player-label-position}\verb+]{+\emph{action-label1}\verb+}+\newline
678 \verb+{+\emph{action-label2}\verb+}[+\emph{action-label-position}\verb+][+%
679 \emph{payoffs1}%
680 \verb+][+\emph{payoffs2}{\tt ]}\newline
681 \noindent puts two branches with the parameters of the preceding call to
682 \verb+\putbranch+, optionally using the PSTricks style \emph{branchstyle1} for
683 the left or upper branch and the style \emph{branchstyle2} for the other
684 branch (or \emph{branchstyle1} for both branches, if there is only one
685 optional argument), assigns it the player name \emph{player-name}, optionally
686 positions the player label relative to the node according to
687 \emph{player-label-position}, labels the left/upper action with
688 \emph{action-label1} and the right/lower action with \emph{action-label2},
689 optionally using the position \emph{action-label-position}, and optionally
690 adds payoffs \emph{payoffs1} and \emph{payoffs2}. The signs of the direction
691 parameters $($\emph{h-incr}$,$\emph{v-incr}$)$ in the preceding
692 \verb+\putbranch+ call are ignored; the directions of the branches is
693 determined by the direction of the branch (as specified either by
694 \verb+\egdirection+ or by the optional argument of \verb+\putbranch+). If,
695 for example, the direction is {\tt d}, then one branch goes down and to the
696 left and the other goes down and to the right.
697
698 The first branch in any {\tt egame} is taken to be the initial branch of the
699 game; its beginning node is indicated by \verb+\eginode+. Subsequent branches
700 are taken to be non-initial, and are indicated by \verb+\egnode+. To force a
701 node to be initial, specify \verb+\initialtrue+ before it; to force a node to
702 be noninitial, specify \verb+\initialfalse+ before it.
703
704 Permissible values:
705 \begin{description}
706 \item[\emph{style1}, \emph{style2}] Any PSTricks line styles; see \verb+\ib+.
707 If there is only one style present, it is applied to both branches. If there
708 are two styles, the first is applied to the right hand branch and the second
709 to the left hand branch if the game direction is up or down, and the first is
710 applied to the lower branch and the second to the upper branch if the game
711 direction is left or right.
712 \item[\emph{player-name}] Any character string.
713 \item[\emph{player-label-position}] Either \verb+o+ (centered over the node),
714 or
715 \begin{itemize}
716 \item If the direction of the branch (as specified either by
717 \verb+\egdirection+ or by an optional argument of \verb+\putbranch+) is {\tt
718 d} or {\tt u}, either {\tt l} (above/below and to the left) and {\tt r}
719 (above/below and to the right).
720 \item If the direction of the branch is {\tt r} or {\tt l}, either {\tt u}
721 (to the left/right and up) and {\tt d} (to the left/right and down).
722 \end{itemize}
723 Default: is to center the label above for \verb+\egdirection+=\verb+d+, below
724 for \verb+\egdirection+=\verb+u+, to the left of the node for
725 \verb+\egdirection+=\verb+r+, or to the right of the node for
726 \verb+\egdirection+=\verb+l+.
727 \item[\emph{action-label1} and \emph{action-label2}] Any character strings.
728 \item[\emph{action-label-position}] \verb+o+ (outside), \verb+i+ (inside), or
729 \verb+c+ (centered). Default: \verb+o+.
730 \item[\emph{payoffs1} and \emph{payoffs2}] Any character strings.
731 \end{description}
732
733 Examples:
734
735 Action labels ``outside'' (default):
736 \begin{verbatim}
737 \putbranch(100,140)(1,1){100}
738 \iib[linestyle=dashed]{1}{$L$}{$R$}
739 \end{verbatim}
740 $$\begin{egame}(200,180)
741 \putbranch(100,140)(1,1){100}
742 \iib[linestyle=dashed]{1}{$L$}{$R$}
743 \psline{<->}(100,0)(200,0)
744 \rput*(150,0){100}
745 \end{egame}$$
746
747 Action labels ``inside'':
748 \begin{verbatim}
749 \putbranch(100,140)(1,1){100}
750 \iib[linestyle=dashed]{1}{$L$}{$R$}[i]
751 \end{verbatim}
752 $$\begin{egame}(200,140)
753 \putbranch(100,100)(1,1){100}
754 \iib[linestyle=dashed]{1}{$L$}{$R$}[i]
755 \end{egame}$$
756
757 Action labels ``centered'':
758 \begin{verbatim}
759 \renewcommand{\egarrowstyle}{e}
760 \putbranch(0,140)(2,1)[r]{200}
761 \iib{1}{$L$}{$R$}[c]
762 \end{verbatim}
763 $$\begin{egame}(100,280)
764 \renewcommand{\egarrowstyle}{e}
765 \putbranch(0,140)(2,1)[r]{200}
766 \iib{1}{$L$}{$R$}[c]
767 \psline{<->}(0,0)(200,0)
768 \rput*(100,0){200}
769 \end{egame}$$
770
771 \begin{verbatim}
772 \renewcommand{\egarrowstyle}{e}
773 \putbranch(0,100)(1,1)[r]{100}
774 \iib[linecolor=gray][doubleline=true]{1}{$L$}{$R$}[$1,2$][$0,-1$]
775 \end{verbatim}
776 $$\begin{egame}(100,250)
777 \renewcommand{\egarrowstyle}{e}
778 \putbranch(0,100)(1,1)[r]{100}
779 \iib[linecolor=gray][doubleline=true]{1}{$L$}{$R$}[c][$1,2$][$0,-1$]
780 \end{egame}$$
781
782 \begin{verbatim}
783 \renewcommand{\egarrowstyle}{m}
784 \psset{arrowscale=2}
785 \putbranch(200,40)(1,0)[d]{200}
786 \iib{1}{$L$}{$R$}[$1,2$][$0,-1$]
787 \end{verbatim}
788 $$\begin{egame}(400,80)
789 \renewcommand{\egarrowstyle}{m}
790 \psset{arrowscale=2}
791 \putbranch(200,40)(1,0)[d]{200}
792 \iib{1}{$L$}{$R$}[$1,2$][$0,-1$]
793 \end{egame}$$
794
795 \vspace{4mm}
796
797 \psset{arrowscale=1}
798
799 \noindent\verb+\iiib[+\emph{style1}\verb+]{+\emph{player-name}\verb+}[+\emph{p%
800 layer-label-position}%
801 \verb+]{+\emph{action-label1}\verb+}+\newline
802 \verb+{+\emph{action-label2}\verb+}{+\emph{action-label3}\verb+}[+\emph{action%
803 -label-position}\verb+][+%
804 \emph{payoffs1}\verb+][+\emph{payoffs2}\verb+]+\newline
805 \verb+[+\emph{payoffs3}{\tt ]}\newline
806 \noindent puts three branches with the parameters of the preceding call to
807 \verb+\putbranch+, optionally all in the PSTricks style \emph{style}, assigns
808 it the player name \emph{player-name}, optionally positions the player label
809 relative to the node according to \emph{player-label-position}, and labels the
810 left/top action with \emph{action-label1}, the middle action with
811 \emph{action-label3}, and the right/bottom action with \emph{action-label2},
812 optionally positioning the labels according to \emph{action-label-position}
813 and putting the \emph{payoffs1}, \emph{payoffs2}, and \emph{payoffs3}. The
814 signs of the direction parameters $($\emph{h-incr}$,$\emph{v-incr}$)$ in the
815 preceding \verb+\putbranch+ call are ignored; the directions of the branches
816 are determined by the direction of the branch (as specified either by
817 \verb+\egdirection+ or by the optional argument of \verb+\putbranch+). If,
818 for example, the direction is {\tt d}, then one branch goes down and to the
819 left, one goes straight down, and one goes down and to the right.
820
821 The first branch in any {\tt egame} is taken to be the initial branch of the
822 game; its beginning node is indicated by a small circle. Subsequent branches
823 are taken to be non-initial, and are indicated by \verb+\egnode+, the default
824 value of which is a small disk. To force a node to be initial, specify
825 \verb+\initialtrue+ before it; to force a node to be noninitial, specify
826 \verb+\initialfalse+ before it.
827
828 Permissible values:
829 \begin{description}
830 \item[\emph{style}] Any PSTricks line style. [Note that only one style is
831 allowed, which applies to all three branches. If you want the branches to
832 have different styles, you need to use a combination of \verb+\ib+ and
833 \verb+\iib+.]
834 \item[\emph{player-name}] Any character string.
835 \item[\emph{player-label-position}] Either \verb+o+ (centered over the node),
836 or
837 \begin{itemize}
838 \item If the direction of the branch (as specified either by
839 \verb+\egdirection+ or by an optional argument of \verb+\putbranch+) is {\tt
840 d} or {\tt u}, either {\tt l} (above/below and to the left) and {\tt r}
841 (above/below and to the right).
842 \item If the direction of the branch is {\tt r} or {\tt l}, either {\tt u}
843 (to the left/right and up) and {\tt d} (to the left/right and down).
844 \end{itemize}
845 Default: is to center the label above for \verb+\egdirection+=\verb+d+, below
846 for \verb+\egdirection+=\verb+u+, to the left of the node for
847 \verb+\egdirection+=\verb+r+, or to the right of the node for
848 \verb+\egdirection+=\verb+l+.
849 \item[\emph{action-label1}, \emph{action-label2}, and \emph{action-label3}]
850 Any character strings.
851 \item[\emph{action-label-position}] \verb+o+ (outside), \verb+i+ (inside), or
852 \verb+c+ (centered). Default: \verb+o+.
853 \item[\emph{payoffs1}, \emph{payoffs1}, and \emph{payoffs3}] Any character
854 strings.
855 \end{description}
856
857 Examples:
858 \begin{verbatim}
859 \putbranch(200,240)(1,1){200}
860 \iiib{1}{$L$}{$M$}{$R$}
861 \end{verbatim}
862 $$\begin{egame}(400,280)
863 \putbranch(200,240)(1,1){200}
864 \iiib{1}{$L$}{$M$}{$R$}
865 \psline{<->}(200,0)(400,0)
866 \rput*(300,0){200}
867 \end{egame}$$
868
869 \begin{verbatim}
870 \putbranch(30,210)(1,1)[r]{200}
871 \iiib[linecolor=gray]{1}{$B$}{$M$}{$T$}[c][$1,2$][$0,-1$][$7,1$]
872 \end{verbatim}
873 $$\begin{egame}(340,460)
874 \putbranch(30,250)(1,1)[r]{200}
875 \iiib[linecolor=gray]{1}{$B$}{$M$}{$T$}[c][$1,2$][$0,-1$][$7,1$]
876 \psline{<->}(30,0)(230,0)
877 \rput*(130,0){200}
878 \end{egame}$$
879
880 \vspace{4mm}
881
882 \noindent
883 \verb+\ctmb[+\emph{style}\verb+]{+\emph{player-name}\verb+}[+\emph{player-labe%
884 l-position}%
885 \verb+](+\emph{h-incr}\verb+,+\emph{v-incr}\verb+)+\newline
886 \verb+{+\emph{action-label}\verb+}[+\emph{action-label-position}\verb+][+\emph%
887 {payoffs}%
888 \verb+]+\newline
889 \noindent draws a continuum of branches starting with the parameters of the
890 previous call to \verb+\putbranch+, with a single branch drawn as a line with
891 PSTricks style \emph{style}, player \emph{player}, with the label optionally
892 positioned according to \emph{player-label-position}, and slope
893 \emph{h-incr,v-incr}, labeled with \emph{action-label}, which is optionally
894 positioned according to \emph{action-label-position}, and optionally with
895 payoffs \emph{payoffs}.
896
897 \sloppy
898 The color of the triangle representing the continuum of branches is
899 \verb+\ctmfillcolor+ (default \verb+verylightgray+ (defined in the style)).
900
901
902 \fussy
903 Permissible values:
904 \begin{description}
905 \item[\emph{style}] Any PSTricks line style. [Note that this is the style of
906 the single branch, {\bfseries not} of the triangle.]
907 \item[\emph{player-name}] Any character string.
908 \item[\emph{player-label-position}] Either \verb+o+ (centered over the node),
909 or
910 \begin{itemize}
911 \item If the direction of the branch (as specified either by
912 \verb+\egdirection+ or by an optional argument of \verb+\putbranch+) is {\tt
913 d} or {\tt u}, either {\tt l} (above/below and to the left) and {\tt r}
914 (above/below and to the right).
915 \item If the direction of the branch is {\tt r} or {\tt l}, either {\tt u}
916 (to the left/right and up) and {\tt d} (to the left/right and down).
917 \end{itemize}
918 Default: is to center the label above for \verb+\egdirection+=\verb+d+, below
919 for \verb+\egdirection+=\verb+u+, to the left of the node for
920 \verb+\egdirection+=\verb+r+, or to the right of the node for
921 \verb+\egdirection+=\verb+l+.
922 \item[$($\emph{h-incr}$,$\emph{v-incr}$)$] Any pair of integers.
923 \item[\emph{action-label}] Any character string.
924 \item[\emph{action-label-position}] \verb+o+ (outside), \verb+i+ (inside), or
925 \verb+c+ (centered). Default: \verb+o+.
926 \item[\emph{payoffs}] Any character strings.
927 \end{description}
928
929 Examples:
930
931 \begin{verbatim}\putbranch(50,240)(2,-1)[d]{200}
932 \ctmb{1}(0,1){$A$}[i][$2,2$]:\end{verbatim}
933 $$\begin{egame}(100,280)
934 \putbranch(50,240)(2,-1)[d]{200}
935 \ctmb{1}(0,1){$A$}[i][$2,2$]
936 \end{egame}$$
937
938 \begin{verbatim}\renewcommand{\ctmfillcolor}{red}
939 \renewcommand{\egarrowstyle}{e}
940 \putbranch(50,240)(2,-1)[d]{200}
941 \ctmb[linecolor=blue]{1}(-1,1){$A$}[i][$2,2$]:\end{verbatim}
942 $$\begin{egame}(100,280)
943 \renewcommand{\ctmfillcolor}{red}
944 \renewcommand{\egarrowstyle}{e}
945 \putbranch(50,240)(2,-1)[d]{200}
946 \ctmb[linecolor=blue]{1}(-1,1){$A$}[i][$2,2$]
947 \end{egame}$$
948
949 \begin{verbatim}\putbranch(50,0)(2,1)[u]{200}
950 \ctmb{1}(1,1){$A$}[i][$2,2$]:\end{verbatim}
951 $$\begin{egame}(100,180)
952 \putbranch(50,0)(2,1)[u]{200}
953 \ctmb{1}(1,1){$A$}[i][$2,2$]
954 \end{egame}$$
955
956 \vspace{4mm}
957
958 \noindent
959 \verb+\ctmbarc[+\emph{style}\verb+]{+\emph{player-name}\verb+}[+\emph{player-l%
960 abel-position}%
961 \verb+](+\emph{h-incr}\verb+,+\emph{v-incr}\verb+)+\newline
962 \verb+{+\emph{action-label}\verb+}[+\emph{action-label-position}\verb+][+\emph%
963 {payoffs}%
964 \verb+]+\newline
965 \noindent represents a continuum of branches by an arc. The branches start
966 with the parameters of the previous call to \verb+\putbranch+, with a single
967 branch and the arc drawn using the PSTricks style \emph{style}, player
968 \emph{player}, the label optionally positioned according to
969 \emph{player-label-position}, the line with slope \emph{h-incr,v-incr},
970 labeled with \emph{action-label} optionally positioned according to
971 \emph{action-label-position}, and optionally with payoffs \emph{payoffs}.
972
973 \emph{This macro requires the package} \verb+pst-3d+ \emph{to be loaded after}
974 \verb+pstricks+\emph{. In the preamble to your document, include the line}
975 \verb+\include{pst-3d}+. (\verb+\pstricks+ itself includes the needed macro,
976 but its definition appears to differ from the one in \verb+pst-3d+, which is
977 the definition \verb+\ctmbarc+ needs.)
978
979 The line drawn by the macro is the intersection of (\emph{i})~a circle
980 centered at the start of the branch with radius equal to a half of the
981 distance to the following node and (\emph{ii})~the triangle defined by the
982 starting node and the two following nodes. For some parameter values, this
983 line is not a full arc---see the last example.
984
985 The options are the same as those for \verb+\ctmb+. The style of the arc is
986 controlled by the parameters \verb+\egarclinestyle+ (possible values
987 \verb+solid+, \verb+dashed+, \verb+dotted+, and \verb+none+; default
988 \verb+solid+), \verb+\egarclinewidth+ (any dimension; default \verb+0.6pt+),
989 \verb+\egarclinecolor+ (any color; default \verb+black+).
990
991 Examples:
992
993 \begin{verbatim}\putbranch(50,240)(2,2)[d]{200}
994 \ctmbarc{1}(1,-2){$A$}[i][$2,2$]:\end{verbatim}
995 $$\begin{egame}(100,280)
996 \putbranch(50,240)(2,2)[d]{200}
997 \egalhshift=-12
998 \ctmbarc{1}(1,-2){$A$}[i][$2,2$]
999 \end{egame}$$
1000
1001 \begin{verbatim}\def\egarclinestyle{dashed}
1002 \def\egarclinewidth{2pt}
1003 \def\egarclinecolor{blue}
1004 \putbranch(0,150)(2,2)[r]{150}
1005 \ctmbarc[linewidth=0.3pt,linecolor=red]{1}(1,0){$A$}[$2,2$]:\end{verbatim}
1006 $$\begin{egame}(150,300)
1007 \def\egarclinestyle{dashed}\def\egarclinewidth{2pt}\def\egarclinecolor{blue}
1008 \putbranch(0,150)(2,2)[r]{150}
1009 \ctmbarc[linewidth=0.3pt,linecolor=red]{1}(1,0){$A$}[$2,2$]
1010 \end{egame}$$
1011
1012 In the next example part of the arc extends beyond the triangle defined by the
1013 three nodes, and consequently does not appear.
1014
1015 \begin{verbatim}\putbranch(50,0)(2,1)[u]{200}
1016 \ctmbarc{1}(1,1){$A$}[i][$2,2$]:\end{verbatim}
1017 $$\begin{egame}(100,180)
1018 \putbranch(50,0)(2,1)[u]{200}
1019 \ctmbarc{1}(1,1){$A$}[i][$2,2$]
1020 \end{egame}$$
1021
1022 \vspace{4mm}
1023
1024 \noindent\verb+\infoset(+\emph{x-coord}\verb+,+\emph{y-coord}%
1025 \verb+)[+\emph{direction}\verb+]{+\emph{length}%
1026 \verb+}{+\emph{player-name}\verb+}+\newline
1027 \verb+[+\emph{player-label-position}\verb+]+\newline
1028 \noindent draws an information set starting at
1029 $($\emph{x-coord}$,$\emph{y-coord}$)$, optionally with direction
1030 \emph{direction}, of length \emph{length}, with player label
1031 \emph{player-name}. If the direction of the game is either down or up, the
1032 information set is horizontal; if the direction of the game is either right or
1033 left, the information set is vertical. The player label is positioned at the
1034 middle of the information set, either above, below, to the left, or to the
1035 right of it, depending on the direction of the game. (Its position can be
1036 adjusted by adding some space before or after the player name. For
1037 example,\newline \verb+\infoset(100,200){400}{1\hspace{10mm}}+\newline
1038 centers the box containing \verb+1\hspace{10mm}+ relative to the information
1039 set, thus moving the label by about 5mm.
1040
1041 The dot character used in the information set is given by \verb+\infosetdot+,
1042 the default value of which is \verb+\pscircle*{2.5}+; the spacing between the
1043 dots is set by \verb+\infosetdotsep+, the default value of which is 20. (See
1044 Section~\ref{s:params}.)
1045
1046 Permissible values:
1047 \begin{description}
1048 \item[$($\emph{x-coord}$,$\emph{y-coord}$)$] Any pair of integers.
1049 \item[\emph{direction}] {\tt h} (horizontal) or {\tt v} (vertical). If none
1050 is specified, it is assumed to be \verb+h+ if the game direction is \verb+d+
1051 or \verb+u+, and \verb+v+ if the game direction is \verb+r+ or \verb+l+.
1052 \item[\emph{length}] Any nonnegative integer.
1053 \item[\emph{player-name}] Any character string.
1054 \item[\emph{player-label-position}] \verb+o+ (over), \verb+u+ (up), or
1055 \verb+d+ (down) if direction is \verb+h+, \verb+o+ (over), \verb+l+ (left), or
1056 \verb+r+ (right) if direction is \verb+v+.
1057 \end{description}
1058
1059 Examples:
1060 \begin{verbatim}
1061 \egdirection{d}
1062 \infoset(0,0){300}{1}
1063 \end{verbatim}
1064 $$\begin{egame}(300,4)
1065 \egdirection{d}
1066 \infoset(0,0){300}{1}
1067 \end{egame}$$
1068
1069 \begin{verbatim}
1070 \egdirection{d}
1071 \infoset(0,0){300}{1}[o]
1072 \end{verbatim}
1073 $$\begin{egame}(300,4)
1074 \egdirection{d}
1075 \infoset(0,0){300}{1}[o]
1076 \end{egame}$$
1077
1078 \begin{verbatim}
1079 \egdirection{d}
1080 \infoset(0,0)[u]{200}{1}
1081 \end{verbatim}
1082 $$\begin{egame}(0,200)
1083 \egdirection{d}
1084 \infoset(0,0)[v]{200}{1}
1085 \end{egame}$$
1086
1087 \section{Positioning action labels}\label{s:alp}
1088 The following algorithm is used to position an action label. The ``reference
1089 point'' for a branch is its midpoint. An action label is surrounded by a box
1090 (which may be colored and bordered by a line), from which it is separated by
1091 \verb+\egactionboxsep+, then this box is surrounded by another box, from which
1092 it is separated by \verb+\egactionlabelsep+. Then, for example, for a label
1093 positioned above a downward-sloping branch, the bottom left-hand corner of the
1094 outer box is placed at the reference point, as in Figure~\ref{f:al}. For a
1095 label positioned above a horizontal branch, the bottom center of the outer box
1096 is placed at the reference point.
1097 \begin{figure}[htb]
1098 \hspace*{\fill}
1099 \begin{egame}(400,200)[0.2mm]
1100 \putbranch(0,200)(1,1){200}
1101 \ib{}{}
1102 \pspolygon[linewidth=0.4pt](100,100)(100,200)(200,200)(200,100)
1103 \pspolygon[linewidth=0.4pt](120,120)(120,180)(180,180)(180,120)
1104 \pspolygon[linewidth=0.4pt](145,145)(145,155)(155,155)(155,145)
1105 \rput(150,150){o}
1106 \psline{<->}(150,100)(150,120)
1107 \rput[l](160,110){$x$}
1108 \psline{<->}(150,120)(150,145)
1109 \rput[l](160,132.5){$y$}
1110 \rput[l](220,160){$y=\setminus $egactionboxsep}
1111 \rput[l](220,130){$x=\setminus $egactionlabelsep}
1112 \end{egame}
1113 \hspace*{\fill}
1114 \caption[]{The position of an action label above a downward-sloping
1115 branch.}\label{f:al}
1116 \end{figure}
1117
1118 This algorithm is not perfect. (Note that it is not continuous in the slope
1119 of the branch.) The positions of labels may need fine tuning, which may be
1120 achieved by setting either \verb+\egalhshift+ or \verb+\egalvshift+ or both to
1121 be nonzero (each is an integer, interpreted as a multiple of the unitlength).
1122
1123 \verb+\egalhshift+ and \verb+\egalvshift+ must be set between
1124 \verb+\putbranch+ and \verb+\ib+, \verb+\iib+, \verb+\iiib+, or \verb+\ctmb+.
1125 (They are set to zero by \verb+\putbranch+.)
1126
1127 If \verb+\egalhshift+ is nonzero and \verb+\egalvshift+ is not, the reference
1128 point for the action label on the single branch in \verb+\ib+, of the
1129 \emph{right-hand} branch for directions \verb+d+ and \verb+u+ and of both
1130 branches for directions \verb+r+ and \verb+l+ in \verb+\iib+, and for the
1131 outer branches of \verb+\iiib+, is moved horizontally by this amount and is
1132 moved vertically to maintain the same separation from the branch. (That is,
1133 the action label slides parallel to the branch; it moves horizontally by the
1134 amount \verb+\egalhshift+.) The reference point of the label on the symmetric
1135 branch is moved symmetrically. (Note that the label on the middle branch of
1136 \verb+\iiib+ is not moved. If you want to move it, you need to write separate
1137 calls to \verb+\iib+ and \verb+\ib+.)
1138
1139 Similarly, if \verb+\egalvshift+ is nonzero and \verb+\egalhshift+ is not, the
1140 reference point for the action label is moved vertically by this amount and is
1141 moved horizontally to maintain the same separation from the branch. After a
1142 branch is drawn, \verb+\egalhshift+ and \verb+\egalvshift+ are reset to zero.
1143
1144 Note that the same effect can be acheived with either \verb+\egalhshift+ or
1145 \verb+\egalvshift+. The two methods are provided simply because in some cases
1146 a vertical shift might be more natural to specify, whereas in other cases a
1147 horizontal shift might be more natural to specify.
1148
1149 If \emph{both} \verb+\egalhshift+ and \verb+\egalvshift+ are nonzero, the
1150 reference point is moved horizontally by \verb+\egalhshift+ and vertically by
1151 \verb+\egalvshift+.
1152
1153 Examples:
1154
1155 \verb+\egdirection{d}+
1156 \verb+\egalhshift=40+
1157 $$\begin{egame}(100,280)
1158 \putbranch(50,240)(2,-1)[d]{200}
1159 \egalhshift=40
1160 \iib{1}{$A$}{$B$}[$1,1$][$2,2$]
1161 \end{egame}$$
1162
1163 \verb+\egalhshift=-40+
1164 $$\begin{egame}(100,280)
1165 \putbranch(50,240)(2,-1)[d]{200}
1166 \egalhshift=-40
1167 \iib{1}{$A$}{$B$}[$1,1$][$2,2$]
1168 \end{egame}$$
1169
1170 \verb+\egalhshift=40\egalvshift=40+
1171 $$\begin{egame}(100,280)
1172 \putbranch(50,240)(2,-1)[d]{200}
1173 \egalhshift=40\egalvshift=40
1174 \iib{1}{$A$}{$B$}[$1,1$][$2,2$]
1175 \end{egame}$$
1176
1177 \verb+\egdirection{u}\egalhshift=60+
1178 $$\begin{egame}(100,280)
1179 \putbranch(40,140)(2,-1)[r]{200}
1180 \egalhshift=60
1181 \iib{1}{$A$}{$B$}[$1,1$][$2,2$]
1182 \end{egame}$$
1183 \section{Arrows}
1184 Branches can have arrows either at the end or in the middle, by setting
1185
1186 \verb+\renewcommand{\egarrowstyle}{e}+
1187
1188 \noindent (for arrows at the end), or
1189
1190 \verb+\renewcommand{\egarrowstyle}{m}+
1191
1192 \noindent (for arrows in the middle). The positioning of arrows in the middle
1193 is not ideal: the \emph{tip} of the arrow is placed in the middle of the
1194 branch, while ideally the \emph{middle} of the arrow should be there. I can't
1195 see any easy way to improve the placement.
1196
1197 The style of the arrows can be controlled with PSTricks' various parameters
1198 (as described, for example, in the \LaTeX\ Graphics Companion).
1199 \section{Parameters}\label{s:params}
1200 \noindent\verb+\egdirection+\newline
1201 \noindent Direction of game. Possible values: {\tt d} (down), {\tt u} (up),
1202 {\tt r} (right), or {\tt l} (left). Default: {\tt d}. Example:
1203 \verb+\egdirection{u}+.
1204
1205 \vspace{4mm}
1206
1207 \noindent\verb+\initialtrue+, \verb+\initialfalse+\newline
1208 \noindent Force a node other than the first one in an \verb+egame+ to be
1209 initial, or force the first node to be noninitial.
1210
1211 \vspace{4mm}
1212
1213 \sloppy
1214 \noindent\verb+\eginode+\newline
1215 \noindent Object used for initial node. Possible values: any object.
1216 Default: \verb+\pscircle+ \verb+[linewidth=0.4pt]{5}+. Example:
1217 \verb+\renewcommand{\eginode}+ \verb+{\makebox(0,0){\rule{0.5mm}{0.5mm}}}+
1218 (the \verb+\makebox+ causes the object to be positioned correctly).
1219
1220 \fussy
1221 \vspace{4mm}
1222
1223 \noindent\verb+\egnode+\newline
1224 \noindent Object used for nodes. Possible values: any object. Default:
1225 \verb+\pscircle*{5}+. Example:
1226 \verb+\renewcommand{\egnode}{\makebox(0,0){\rule{0.5mm}{0.5mm}}}+ (the
1227 \verb+\makebox+ causes the object to be positioned correctly).
1228
1229 \vspace{4mm}
1230
1231 \sloppy
1232 \noindent\verb+\infosetdot+\newline
1233 \noindent Object used for ``dots'' in information sets. Possible values: any
1234 object. Default: \verb+\pscircle*{2.5}+. Example:
1235 \verb+\renewcommand{\infosetdot}+ \verb+{\pscircle*{5}}+.
1236
1237 \fussy
1238 \vspace{4mm}
1239
1240 \noindent\verb+\infosetdotsep+\newline
1241 \noindent Spacing between dots in information set, as a multiple of the unit
1242 length. Possible values: any positive integer. Default: 20. Example:
1243 \verb+\renewcommand+ \verb+{\infosetdotsep}{40}+.
1244
1245 \vspace{4mm}
1246
1247 \noindent\verb+\egplayerlabelsep+\newline
1248 \noindent Spacing used to position box containing player label relative to
1249 center of initial node, and relative to center of information set. Possible
1250 values: any dimension. Default: 1mm. Example: \verb+\egplayerlabelsep=2mm+.
1251
1252 \vspace{4mm}
1253
1254 \noindent\verb+\egplayerboxsep+\newline
1255 \noindent Distance between edge of box around player label and player label.
1256 Possible values: any dimension. Default: 0mm. Example:
1257 \verb+\egplayerboxsep=1mm+.
1258
1259 \vspace{4mm}
1260
1261 \noindent\verb+\egactionlabelsep+\newline
1262 \noindent Spacing used to position box containing action label relative to
1263 branch. Possible values: any dimension. Default: 0.7mm. Example:
1264 \verb+\egactionlabelsep=+ \verb+1mm+.
1265
1266 \vspace{4mm}
1267
1268 \noindent\verb+\egactionboxsep+\newline
1269 \noindent Distance between edge of box around action label and action label.
1270 Possible values: any dimension. Default: 0mm. Example:
1271 \verb+\egactionboxsep=1mm+.
1272
1273 \vspace{4mm}
1274
1275 \sloppy
1276 \noindent\verb+\egpayofflabelsep+\newline
1277 \noindent Spacing used to position box containing action label relative to end
1278 of branch. Possible values: any dimension. Default: 2mm. Example:
1279 \verb+\egpayofflabelsep=1mm+.
1280
1281 \fussy
1282 \vspace{4mm}
1283
1284 \noindent\verb+\egpayoffboxsep+\newline
1285 \noindent Distance between edge of box around payoffs and payoffs. Possible
1286 values: any dimension. Default: 0mm. Example: \verb+\egpayoffboxsep=1mm+.
1287
1288 \vspace{4mm}
1289
1290 \noindent\verb+\egalpos+\newline
1291 \noindent Position of action labels. Possible values: \verb+o+ (outside),
1292 \verb+i+ (inside), \verb+c+ (center). Default: \verb+o+. Example:
1293 \verb+\renewcommand{\egalpos}{c}+.
1294
1295 \vspace{4mm}
1296
1297 \noindent\verb+\egalbox+\newline
1298 \noindent Type of box for action labels. Possible values: \verb+f+ (frame),
1299 \verb+c+ (circle). Default: \verb+f+. Example:
1300 \verb+\renewcommand{\egalbox}{c}+.
1301
1302 \vspace{4mm}
1303
1304 \sloppy
1305 \noindent\verb+\egalboxlinestyle+\newline
1306 \noindent Style of lines around boxes containing action labels. Possible
1307 values: \verb+none+, \verb+solid+, \verb+dashed+, \verb+dotted+. Default:
1308 \verb+none+. Example: \verb+\renewcommand+ \verb+{\egalboxlinestyle}{solid}+.
1309
1310 \fussy
1311 \vspace{4mm}
1312
1313 \noindent\verb+\egalboxlinecolor+\newline
1314 \noindent Color of lines around boxes containing action labels. Possible
1315 values: any defined color. Default: \verb+black+. Example:
1316 \verb+\renewcommand{\egalboxlinecolor}+ \verb+{red}+.
1317
1318 \vspace{4mm}
1319
1320 \noindent\verb+\egalboxfillstyle+\newline
1321 \noindent Style of fill of boxes containing action labels. Possible values:
1322 \verb+none+, \verb+solid+, \verb+vlines+, \verb+vlines*+, \verb+hlines+,
1323 \verb+hlines*+, \verb+crosshatch+, \verb+crosshatch*+. Default: \verb+none+.
1324 Example: \verb+\renewcommand{\egalboxfillstyle}{solid}+.
1325
1326 \vspace{4mm}
1327
1328 \sloppy
1329 \noindent\verb+\egalboxfillcolor+\newline
1330 \noindent Color of fill of boxes containing action labels. Possible values:
1331 any defined color. Default: \verb+white+. Example:
1332 \verb+\renewcommand{\egalboxfillcolor}+ \verb+{blue}+.
1333
1334 \fussy
1335 \vspace{4mm}
1336
1337 \noindent\verb+\egpaybox+\newline
1338 \noindent Type of box for payoffs. Possible values: \verb+f+ (frame),
1339 \verb+c+ (circle). Default: \verb+f+. Example:
1340 \verb+\renewcommand{\egpaybox}{c}+.
1341
1342 \vspace{4mm}
1343
1344 \sloppy
1345 \noindent\verb+\egpayboxlinestyle+\newline
1346 \noindent Style of lines around boxes containing payoffs. Possible values:
1347 \verb+none+, \verb+solid+, \verb+dashed+, \verb+dotted+. Default:
1348 \verb+none+. Example: \verb+\renewcommand+
1349 \verb+{\egpayboxlinestyle}{solid}+.
1350
1351 \fussy
1352 \vspace{4mm}
1353
1354 \noindent\verb+\egpayboxlinecolor+\newline
1355 \noindent Color of lines around boxes containing payoffs. Possible values:
1356 any defined color. Default: \verb+black+. Example:
1357 \verb+\renewcommand{\egpayboxlinecolor}+ \verb+{gray}+.
1358
1359 \vspace{4mm}
1360
1361 \noindent\verb+\egpayboxfillstyle+\newline
1362 \noindent Style of fill of boxes containing action payoffs. Possible values:
1363 \verb+none+, \verb+solid+, \verb+vlines+, \verb+vlines*+, \verb+hlines+,
1364 \verb+hlines*+, \verb+crosshatch+, \verb+crosshatch*+. Default: \verb+none+.
1365 Example: \verb+\renewcommand{\egpayboxfillstyle}{solid}+.
1366
1367 \vspace{4mm}
1368
1369 \noindent\verb+\egpayboxfillcolor+\newline
1370 \noindent Color of fill of boxes containing payoffs. Possible values: any
1371 defined color. Default: \verb+white+. Example:
1372 \verb+\renewcommand{\egpayboxfillcolor}{gray}+.
1373
1374 \vspace{4mm}
1375
1376 \noindent\verb+\egplbox+\newline
1377 \noindent Type of box for player labels. Possible values: \verb+f+ (frame),
1378 \verb+c+ (circle). Default: \verb+f+. Example:
1379 \verb+\renewcommand{\egplbox}{c}+.
1380
1381 \vspace{4mm}
1382
1383 \sloppy
1384 \noindent\verb+\egplboxlinestyle+\newline
1385 \noindent Style of lines around boxes containing player labels. Possible
1386 values: \verb+none+, \verb+solid+, \verb+dashed+, \verb+dotted+. Default:
1387 \verb+none+. Example: \verb+\renewcommand+ \verb+{\egplboxlinestyle}{solid}+.
1388
1389 \fussy
1390 \vspace{4mm}
1391
1392 \noindent\verb+\egplboxlinecolor+\newline
1393 \noindent Color of lines around boxes containing player labels. Possible
1394 values: any defined color. Default: \verb+black+. Example:
1395 \verb+\renewcommand{\egplboxlinecolor}+ \verb+{gray}+.
1396
1397 \vspace{4mm}
1398
1399 \noindent\verb+\egplboxfillstyle+\newline
1400 \noindent Style of fill of boxes containing player labels. Possible values:
1401 \verb+none+, \verb+solid+, \verb+vlines+, \verb+vlines*+, \verb+hlines+,
1402 \verb+hlines*+, \verb+crosshatch+, \verb+crosshatch*+. Default: \verb+none+.
1403 Example: \verb+\renewcommand{\egplboxfillstyle}{solid}+.
1404
1405 \vspace{4mm}
1406
1407 \sloppy
1408 \noindent\verb+\egplboxfillcolor+\newline
1409 \noindent Color of fill of boxes containing player labels. Possible values:
1410 any defined color. Default: \verb+white+. Example:
1411 \verb+\renewcommand{\egplboxfillcolor}+ \verb+{gray}+.
1412
1413 \fussy
1414 \vspace{4mm}
1415
1416 \noindent\verb+\egarrowstyle+\newline
1417 \noindent Style of arrows on branches. Possible values: \verb+n+ (none),
1418 \verb+e+ (end), \verb+m+ (mid). Default: \verb+n+ (none). Example:
1419 \verb+\renewcommand{\egarrowstyle}{m}+ (mid). The size of the arrows can be
1420 adjusted by using any of the PSTricks parameters---e.g.\
1421 \verb+\psset{arrowscale=1.5}+.
1422
1423 \vspace{4mm}
1424
1425 \sloppy
1426 \noindent\verb+\ctmfillcolor+\newline
1427 \noindent Color of triangle used to indicate continuum of branches. Possible
1428 values: any defined color. Default: \verb+verylightgray+. Example:
1429 \verb+\renewcommand+ \verb+{\ctmfillcolor}{red}+.
1430
1431 \fussy
1432 \section{Suggestions}
1433 It seems hard to proceed without first drawing the game on a piece of paper,
1434 at least roughly. Be sure to allow enough space under (in the case of a
1435 downward-pointing game) the terminal nodes---put the nodes that precede the
1436 terminal nodes high enough that the bottom of the payoffs will be at height 0.
1437 Similarly, specify the height of the game so that the label for the initial
1438 player does not poke out the top. If parts of your game poke out of the frame
1439 defined by the size you specify for your \verb+egame+, \TeX\ will not warn
1440 you, but the spacing above and/or below your game will not be right. (If you
1441 specify the height to be too small, for example, the top of your game may
1442 overlap the text above it.)
1443
1444 You can float your game in a figure (as I have done in the examples above), or
1445 you can put it in the text. (For example, you may use
1446 \verb+$$\begin{egame}...+ \verb+\end{egame}$$+). Putting it in the text has
1447 the disadvantage that if it's big and happens to start at the bottom of a page
1448 then you may get a lot of white space if it doesn't fit on the page.
1449 \section{Enhancements}
1450 It would be nice to have a graphical interface, like that in \LaTeX CAD\@.
1451 I'm not capable of writing one.
1452
1453 It would be nice also if the macros could calculate the dimensions of the
1454 whole game, so the the user does not have to specify them in the
1455 \verb+\begin{game}+ call. To make this change looks like a tough project to
1456 me.
1457
1458 The label-positioning algorithm could be enhanced, as discussed in
1459 Section~\ref{s:alp}.
1460
1461 \section{History}
1462 \begin{description}
1463 \item[Version 1.0] 2001-4-9 (based on EGAME.STY, 1997-10-16)
1464 \item[Version 1.1] 2004-6-19 (\verb+\egctmarc+ added, following suggestion of
1465 Paul Schweinzer).
1466 \end{description}
1467
1468 \section{Appendix: using pdftricks with pdftex to create a pdf
1469 file}\label{s:pdftricks}
1470 If you want to create a pdf file from your \LaTeX\ file and do not want to
1471 take the dvi $\rightarrow$ ps $\rightarrow$ pdf route, you may use
1472 \verb+pdftricks+. Eric Gartzke reports that the following input produces the
1473 expected output. (See his comments for the limitations of this method.) If
1474 you find a better solution, please let me know.
1475
1476 \begin{verbatim}\documentclass[12pt]{article}
1477 \usepackage[shell]{pdftricks}
1478
1479 \begin{psinputs}
1480 \usepackage{pstricks}
1481 \usepackage{color}
1482 \usepackage{pstcol}
1483 \usepackage{pst-plot}
1484 \usepackage{pst-tree}
1485 \usepackage{pst-eps}
1486 \usepackage{multido}
1487 \usepackage{pst-node}
1488 \usepackage{pst-eps}
1489 \usepackage{egameps}
1490 \end{psinputs}
1491
1492 \usepackage{amsfonts}
1493 \usepackage{graphicx}
1494 \usepackage{amsmath}
1495 \usepackage{setspace}
1496 \usepackage{fullpage}
1497 \usepackage{harvard}
1498 \usepackage{threeparttable}
1499 \usepackage{amssymb}
1500
1501 \newtheorem{hypothesis}{Hypothesis}
1502
1503 Postscript commands need to be separated from other commands.
1504 pdftricks literally stops the compiling of the TeX file to run
1505 postscript/dvi in the background, generating separate small
1506 TeX files and pdf files of each figure. Notice that egameps
1507 is called last. This seems to make a considerable
1508 difference. Here is an example of a simple egame tree.
1509
1510 \begin{pdfpic}
1511 \begin{figure}[htb]
1512 \hspace*{\fill}
1513 \begin{egame}(600,1250)
1514 \renewcommand{\egarrowstyle}{e}
1515 \renewcommand{\egnode}{\pscircle*{8}}
1516 \putbranch(200,1200)(0,1){150} \ib{$N$}[r]{$~k_{i},~k_{j}$}
1517 \renewcommand{\egarrowstyle}{}
1518 \putbranch(200,1050)(1,1){200} \egdirection{d}
1519 \iib{$i$}[l]{$\begin{array}{c}Status\\Quo\end{array}$}{$Challenge$}[$b_{
1520 i},~1+b_{j}$][]
1521 \putbranch(400,850)(1,1){200}
1522 \iib{$~j$}[r]{$Reject$}{$Accept$}[][$\begin{array}{c}1-
1523 d+b_{i},\\d+b_{j}\end{array}$]
1524 \putbranch(200,650)(1,1){200}
1525 \iib{$i$}[l]{$\begin{array}{c}Back\\Down\end{array}$}{$Persist$}[$\begin
1526 {array}{c}-a_{i},\\1\end{array}$][]
1527 \putbranch(400,450)(1,1){200}
1528 \iib{$j$}[r]{$Fight$}{$Acquiesce$}[$\begin{array}{c}p-k_{i},\\1-p-
1529 k_{j}\end{array}$][$\begin{array}{c}1-d,\\d\end{array}$]
1530 \end{egame}
1531 \setcounter{figure}{1}
1532 \hspace*{\fill} \caption[]{Selection Game
1533 \label{figure:selection}}
1534 \end{figure}
1535 \end{pdfpic}
1536
1537 Again, the figure is isolated from the rest of the TeX file by
1538 pdftricks commands. Also, the regular LaTeX numbering of
1539 figures is interfered with, so I adjust with a \setcounter
1540 command. Finally, the \label and \reference commands do not
1541 work, so one must simply number the figures in the text.
1542 \end{verbatim}
1543
1544
1545
1546 \end{document}
1547
1548
1549