Graphics, Figures & Tablespdf graphics problems

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
michelney
Posts: 4
Joined: Fri May 15, 2009 7:29 pm

pdf graphics problems

Post by michelney »

Hi. I've been using LaTeX for years now but actually I know very little about it. I've basically never understood it and stumbled through on trial and error. I'm currently trying to use PS Tricks to create some game theory diagrams. I've downloaded all of the packages and used them in the preamble in my tex. file. But if I try to insert a diagram then Adobe Reader just fails to open it. For example if I use the example from http://www.tug.org/PSTricks/main.cgi?file=examples#game and ask TexnicCenter to build it I just get an error saying "There was an error opening this document. This file cannot be found." I can open the file in DVI, and I'm tempted just to use the "PrintScreen" function from there, open it in MS Paint, save as a picture file and insert it as a PNG file into the tex. document, because that works.

I've tried to use the egameps package but again that doesn't work at all. For example if I load the packages: egameps, pstricks and pstcol and try an example from the egameps pdf http://www.economics.utoronto.ca/osborn ... gameps.pdf , like this one:

Code: Select all

\usepackage{egameps}
\usepackage{pstricks}
\usepackage{pstcol}
\begin{document}

\begin{figure}[htb]
\hspace*{\fill}
\begin{egame}(600,280)
%
% put the initial branch at (300,240), with (x,y) direction
% (2,1), and horizontal length 200
\putbranch(300,240)(2,1){200}
%
% give the branch two actions, label it for player 1,
% and label the actions $L$ and $R$
\iib{1}{$L$}{$R$}
%
2
% put a branch at (100,140), with (x,y) direction
% (1,1) and horizontal length 100
\putbranch(100,140)(1,1){100}
%
% give the branch two actions, omit a player label,
% label the actions $a$ and $b$, and assign the payoffs
% $1,0$ and $2,3$ to these actions
\iib{}{$a$}{$b$}[$1,0$][$2,3$]
%
% put a branch at (500,140), with (x,y) direction (1,1)
% and horizontal length 100
\putbranch(500,140)(1,1){100}
%
% give the branch two actions, omit a player label,
% label the actions $c$ and $d$, and assign the payoffs
% $0,1$ and $-1,0$ to these actions
\iib{}{$c$}{$d$}[$0,1$][$-1,0$]
%
% draw an information set between the nodes at (100,140)
% and (500,140)
\infoset(100,140){400}{2}
%
\end{egame}
\hspace*{\fill}
\caption[]{An extensive game}\label{f:one}
\end{figure}
\end{document}
and build it, it won't open but furthermore TexnicCenter finds 105 errors with it, saying that virtually every line is an "undefined control sequence". I don't know whether TexnicCenter uses LaTeX2e or not, in fact I only learned what this was today and am not even sure it is relevant. As you can tell, I have virtually no idea what I am doing and would be quite grateful for any help you can offer. Thanks.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

pdf graphics problems

Post by localghost »

You have to take the compiling route LaTeX -> DVI -> PS -> PDF to get a proper PDF output. An alternative to PSTricks could be to use pgf/tikZ. There is also an example gallery [1]. There are surely some suitable examples for you.

[1] TikZ and PGF examples


Best regards and welcome to the board
Thorsten
michelney
Posts: 4
Joined: Fri May 15, 2009 7:29 pm

Re: pdf graphics problems

Post by michelney »

Thanks Thorsten. I'm looking at the manual guides for both tikZ and PGF and they both seem to do the sorts of things I wanted to do with PS Tricks.
Post Reply