Running Adobe Reader X? Use these instructions.
If you've spent any time typing extensive-form games in LaTeX, you've run into egameps.sty, by the formidable Martin Osborne (of A Course in Game Theory fame). It's an excellent package which will do just about anything you need — although I do wish I could make indifference sets with an arc, rather than horizontal or vertical lines (actually, it turns out this is possible, if convoluted) — and will allow you to extend it to produce everything else.
All is good and well, then, except for the fact that it (natively) compiles only to PostScript; for those of us stuck on Windows boxes, this is a painful reality. Not to knock Ghostview, but PostScript rendering on Windows is tedious at best, and frustrating and time-prohibitive at worst. Compared to the sleek, fast interface of Acrobat Reader (who can compete with a company with the funding of Adobe?), there's really no argument in my book; perhaps if I were working on a bigger project, PostScript would have its advantages, but as someone typing up a couple dozen pages of problem set per week, there's no cause.
How can we make the whole process easier, if perhaps violating the principle which drives PostScript compilation in the first place? For the purposes of this how-to, I'll be using TeXnicCenter, my favorite go-to editor in Windows. The way I use it, it's not much more than a GUI wrapper for VI, but it's comfortable and has some useful macros. If you're interested in doing this more generally (say, a system binding to run as :!latexpdf
in VI or whatnot), the general principles should extend to any batch/Perl/Python script you can cook up.
The general principle at work here is that TeXnicCenter allows you to define Output Profiles, which correspond to different compilation mechanisms for your . Included with the program are default output profiles for compilation to DVI, PS, or PDF. We're going to chain these mechanisms together to get what we're looking for.
For the purposes of this set of instructions, we'll assume my MiKTeX install directory is C:\Program Files\MiKTeX 2.7.
At this point, the document should successfully compile: just select LaTeX => DVI => PS => PDF (or whatever you chose) from the dropdown in the top bar, and compile (Ctrl + F7). Compilation will take a hair longer than normal, as the background postprocessors run. You can watch the compilation icons in the top bar to see the status, as there's some nonverbose lag in the conversion from DVI to PS and then to PDF.
However, there is still a little more we can do. One of the nicest features of TeXnicCenter is the ability to view your document at any time, simply by pressing F5. I am going to assume you are using Adobe Reader, and that it is installed as C:\PROGRAM FILES\ADOBE\READER 8.0\READER\ACRORD32.EXE. To enable this, reopen the Output Profiles dialog (if you closed it), and select your new output profile.
Putting these together is not particularly difficult: with a little time to browse the existing output profiles which ship with TeXnicCenter, and some knowledge of the conversion and compilation utilities that come with MiKTeX, you can piece it together for yourself. Still, these are the kinds of things I'm always looking for when it's late at night an my game tree just won't compile the way I need it to.
\documentclass[12pt]{article} \usepackage{pstricks} \usepackage{egameps} \begin{document} \begin{center} \begin{figure}[htb] \hspace*{\fill} % % Notice the careful use of {}, (), and [] below % \begin{egame}(1000,1000) \putbranch(500,900)(2,1){300} \iib{N}{Hungry}{Thirsty} \putbranch(200,750)(1,2){150} \iib{K}{Eat}{Drink}[$10$][$9$] \putbranch(800,750)(1,2){150} \iib{K}{Eat}{Drink}[$9$][$10$] \infoset(200,750){600}{} \end{egame} \end{figure} \end{center} \end{document}
Happy LaTeXing!
PS You can do something similar with dvipng.exe in the MiKTeX distribution, but why bother when you've got LaTeX to png at 618034.com?
Update (2011-01-31): thanks to Rob in the comments for pointing out that the DDE instructions above no longer work in Adobe Reader X. There is a helpful set of instructions over at Agmon's blog, although the server seems to have issues from time to time (Google's cache of the page is ugly but contains all of the important stuff). Once I've upgraded to X, I'll update the instructions here, but as I see it it's useful to have instructions for multiple versions of Reader.
Included \(\LaTeX\) graphics are generated at LaTeX to png or by .