4

I want to do the following:

  1. Make an image using gastex.
  2. Compile the image to a stand-alone pdf image. I.e., at the end of this stage I'll have a myImage.pdf file.
  3. Include my image in a large latex file.

The idea is that I like working with gastex but I want to compile my latex file with pdflatex. (I know there is a new feature of compiling gastex with pdflatex but I can't make it work so I prefer going this way.)

The problem with step (2) is that I don't know what should be the documentclass I should use. E.g., using \documentclass{article} produces a A4 page with the image on it. I want the file to contain only the image. Also, maybe there a way to do this with \documentclass{article} and with playing with the page sizes?

For some reason standalone doesn't work for me. This code passes latex but dvipdf crashes on it:

\documentclass{standalone}

\usepackage{gastex}

\begin{document}
\begin{picture}(100,10)(0,0)
\setlength{\unitlength}{3.5pt}
\gasset{Nw=5,Nh=5} %nWidth nHeight
\node[Nmarks=i,iangle=90](A1)(5,0){$s_1$}
\node(A2)(15,0){$s_2$}
\end{picture}
\end{document}
Guy
  • 1,223

1 Answers1

2

With this input file guy.tex

\documentclass{standalone}
\usepackage{gastex}

\begin{document}
\begin{picture}(200,200)(-100,-100)
\setlength{\unitlength}{3.5pt}
\gasset{Nw=5,Nh=5} %nWidth nHeight
\node[Nmarks=i,iangle=90](A1)(5,0){$s_1$}
\node(A2)(15,0){$s_2$}
\end{picture}
\end{document}

and the command line

simpdftex latex guy && pdfcrop guy.pdf

(simpdftex just uses latex+dvips+ps2pdf) I get the following guy-crop.pdf

enter image description here

With the command line

latex guy && dvipdf guy && pdfcrop guy.pdf

the output is similar (but wrong):

enter image description here

Notice the arrow tip. The (200,200)(-100,100) coordinates for picture are just for being sure the bounding box will contain the picture, so pdfcrop will find the right boundaries. It seems that gastex doesn't advertise the bounding box of what it's producing.

However, the page http://www.lsv.ens-cachan.fr/~gastin/gastex/index.php tells that version 2.9b6 (not on TeX Live) works with auto-pst-pdf and so is "compatible" with pdflatex.

egreg
  • 1,121,712