I am currently typesetting a relatively long document (around 170 pages); and to avoid slowing down compilation, I am generating the figures externally and I am including them in the main tex
file as pdfs
via includegraphics
. So far, I have had no major troubles compiling the figures, but I do when I draw the trees. Namely, when drawing the trees, standalone
does not respect at all the real size of the figure. Before explaining my issue further, let me show you a figure that illustrates my problem:
This is a MWE that reproduces my problem:
\documentclass[]{standalone}
\usepackage{tikz} % To plot almost everything.
\usepackage{pstricks,pst-node,egameps} % To get extensive form games.
\begin{document}
\begin{egame}(0,350)
\putbranch(100,340)(2,1){200}
\iib{$1$}[o]{$D$}{$A$}[c][$1,1$][]
\putbranch(300,240)(2,1){200}
\iib{$2$}[o]{$D$}{$A$}[c][$0,3$][]
\putbranch(500,140)(2,1){200}
\iib{$1$}[o]{$D$}{$A$}[c][$2,2$][]
\putbranch(700,40)(2,1){200}
\iib{$2$}[o]{$D$}{$A$}[c][$1,4$][]
\putbranch(900,-60)(2,1){200}
\iib{$1$}[o]{$D$}{$A$}[c][$3,3$][$...$]
\putbranch(1100,-210)(2,1){200}
\iib{$1$}[o]{$D$}{$A$}[c][$99,99$][]
\putbranch(1300,-310)(2,1){200}
\iib{$2$}[o]{$D$}{$A$}[c][$98,101$][$100,100$]
\end{egame}
\end{document}
I am drawing the trees using the egameps
package (full documentation here: https://www.economics.utoronto.ca/osborne/latex/egameps.pdf) because it has a simple syntax and it's the standard when typesetting Game Theory. Therefore, I DO want to stick to this package, which relies on pstricks
(it can also work with pdftricks
instead). The thing is that I can't get standalone to properly get the size of the tree; therefore getting incomplete trees or/and too large margins. The problem could supposedly be solved by correctly specifying the size of the tree in:
\begin{egame}(0,350)
Where (0,350) indicates a figure of 0mm width and 350mm height. However, I am absolutely unable to compute the correct size of the tree. Could anybody help me specify the correct size of the tree? I need a way to compute the correct size because I have several trees to draw and I have this problem with most of them. Therefore, manually gessing the size of this specific tree is not enough. Notice also that I have read the full package pdf twice; but no matter what I do, I never get the size right.
Alternatively, if specifying the correct size of every tree is too hard; maybe someone can provide an alternative way (via a specification in standalone
?) to force standalone
to get the document size right even if the tree size is wrongly specified. That would be enough for me.
Also, maybe someone knows an alternative documentclass that will not generate this issue but just the output I desire. Such a solution would also suffice for me.
Notice that compiling the figure as an article and then transforming it into eps
is something I have tried and I do NOT like it because when transforming the pdf
into an eps
, some things (like Greek letters or other fancy stuff) change and look weird. Also, including eps
into my main tex file slows down compilation a lot, and I precisely do not want that. Though I could generate the figure with article documentclass, then transforming into eps and then reverting the eps to pdf again with the correct sizes, I don't think this is a good working solution (it's to time expensive and the fancy stuff like the Greek letters would still be wrong).
If anyone can help me with this, I'd be VERY happy (I am aware that this is a very user-specific question and I am aware I might not get any answer; but I need to get this right!).
egame
environment, because the size of the underlyingpspicture
environment must be set manually in general (in contrast totikzpicture
of theTikZ
package).