GasTeX: Graphs and Automata Simplified in TeX

version 2.9b6

Last update: May 11, 2011

New in version 2.9b6 (04/03/2011)

Thanks to the package auto-pst-pdf, GasTeX is now fully compatible with pdflatex.
To use this feature, a new option "pst-pdf" has been added to the package gastex:

\usepackage[pst-pdf=md5]{gastex}

The default (inactive) value is "off" in order to get backward compatibility: compilation with latex+dvips(+ps2pdf).
There are 4 active values: "md5 (recommended), auto, on, draft" which are described in the example file ex-gastex-pstpdf.tex.
When using an active mode, the latex file should be compiled with pdflatex using the --shell-escape option.
Moreover, the new "gpicture" environment should be used for gastex pictures (instead of the classical "picture" environment of latex).
One may safely replace all picture environments with gpicture, even when using latex+dvips(+ps2pdf).
There are a few useful options to the gpicture environment which are also described in the example file ex-gastex-pstpdf.tex.

New in version 2.9b1 (23/09/2010)

As suggested by Jean Berstel, it is now possible to set independently the width and the height of a loop with the two new parameters loopwidth and loopheight. The parameter loopdiam simply sets loopwidth and loopheight to the same value. See the example here.
\gasset{loopdiam=4}
\drawloop(A){}
\drawloop[loopdiam=12](B){}
\drawloop[loopwidth=4,loopheight=6](C){}

Documentation

There is no real documentation for gastex. The best is to learn by examples (see below).
See also the file gastex.sty where all macros are documented.

Examples

GasTeX is a set of LaTeX macros which allow to draw very easily graphs, automata, nets, diagrams, etc... under the picture environment of LaTeX. A picture with gastex basically consists of nodes and edges. Here are a few examples of pictures that are easily defined with gastex. and a whole lot of automata examples by Jean-Éric Pin.

Download

Version 2.8 of GasTeX is available here on CTAN since the end of 2006. So it should be available by default on your system unless your TeX installation is really old.

The new version 2.9bx should be available on CTAN soon.
Meanwhile, you may download the necessary files below.

Feedback

I hope you will find gastex helpful. Let me know if you have any problem or suggestion to improve gastex.
If you are using gastex, I'd like to know it so please send me an email and if you wish I'll let you know about new versions if any (I don't intend to spend much time in the near future).

History since version 2.0

Version 2.8: (2006/11/26)

Packaged for CTAN.

Version 2.7: (2004/05/02)

gastex is now compatible with the xcolor package which allows very useful color expressions such as red!50!blue!60!white.

Version 2.6: (2004/04/23)

Improved precision of some computations.

Version 2.5: (2004/04/17)

The horizontal shifts that one gets sometimes (e.g. with overlays in presentations) should no more occur provided \nullfont is used inside the picture environment:

\begin{picture}(100,35)(-50,0)\nullfont
...
\end{picture}
\selectfont is automatically used by gastex for node or edge labels.
I found this solution looking in the package pgf (portable graphics format) by Till Tantau.
I also recommend his excellent beamer package for laptop presentations.

version 2.4: (2003/08/12)

All these macros use gasset parameters and in particular: Nframe, Nfill, linecolor, fillcolor, dash, ...

Uncompatibility: The macro \drawline was introduced in version 2.1 to draw a line between two points. The new version allows to draw a line defined by an arbitrary number of points but the syntax is different. It was \drawline(x1,y1,x2,y2) and it is now \drawline(x1,y1)(x2,y2).

version 2.3: (2002/05/05) version 2.2: (2002/01/03) version 2.1: version 2.01:

Remarks

Known problems and (hopefully) solutions

About LSV