I am trying to produce this image, which includes three labels, and three graphs, all automatically generated by a (Java) program. The program generates graphs (specifically, of finite state automata) and employs LaTeX and TikZ to present these graphs to clients. The graphs tend to be large, often very large, and it is very difficult to pro-grammatically make adjustment to the process for the purpose of rendering.
The above image was generated by the LaTeX input at the end of this questions. You will notice that it is consists of three nodes, and three graphs. They are placed with magic numbers which I worked out manually. It is fairly easy to add anything before or after the graphs, but it is not possible to tweak the actual list of nodes and edges. It is also not possible to know in advance which nodes would be present on the graphs.
The question is whether it is possible to enclose the graphs and nodes with something that would compute their size, and place them, e.g., in a chain.
Yet another restriction is that the entire spiel should be in a single tikzpicture
environment.
\documentclass{sciposter}
\usepackage[paperwidth=84cm,paperheight=120cm,centering,textwidth=74cm,textheight=100cm,left=2cm,top=2cm]{geometry}
\usepackage{tikz}
\begin{document}
\usetikzlibrary{graphs,chains,shapes,quotes}
\usetikzlibrary{automata, positioning, arrows}
\usetikzlibrary{graphdrawing}
\usegdlibrary{trees,force,layered,circular}
\tikzstyle{accept}=[fill=green!50]
\tikzstyle{initial}=[circle,draw]
\tikzstyle{every node}=[rectangle]
\tikzstyle{epsilon}=[]
\tikzstyle{graphs/every graph}=[simple necklace layout,
nodes={ellipse,fill=olive!20,inner sep=2pt,outer sep=2pt}, level sep =12ex, sibling sep=4ex, node distance = 35ex]
\def\magicOne{(0,-3)}
\def\magicTwo{(0,-63)}
\def\magicThree{(0,-95)}
\begin{tikzpicture}
\node at (0,0) {\Huge NFSA};
\node at (0,-61) {\Huge DFSA};
\node at (0,-92) {\Huge Minimized DFSA};
\begin{scope} \path \magicOne
graph{
"$q_{0}$" [initial,accept] -> ["\varepsilon"] "$q_{1}$" ;
"$q_{0}$" -> ["a, b"] "$q_{2}$" ;
"$q_{0}$" -> [""] "$q_{3}$" ;
"$q_{0}$" -> [""] "$q_{8}$" ;
"$q_{0}$" -> ["\varepsilon",loop] "$q_{0}$" ;
"$q_{1}$" -> ["a, b"] "$q_{2}$" ;
"$q_{1}$" -> [""] "$q_{3}$" ;
"$q_{1}$" -> ["\varepsilon"] "$q_{8}$" ;
"$q_{2}$" -> ["a, b",loop] "$q_{2}$" ;
"$q_{3}$" -> ["b"] "$q_{2}$" ;
"$q_{3}$" -> ["a"] "$q_{4}$" ;
"$q_{3}$" -> [""] "$q_{5}$" ;
"$q_{4}$" -> ["a, b"] "$q_{2}$" ;
"$q_{4}$" -> ["\varepsilon"] "$q_{5}$" ;
"$q_{5}$" -> ["a"] "$q_{2}$" ;
"$q_{5}$" -> [""] "$q_{6}$" ;
"$q_{5}$" -> [""] "$q_{7}$" ;
"$q_{5}$" -> [""] "$q_{10}$" ;
"$q_{5}$" -> ["b"] "$q_{12}$" ;
"$q_{6}$" -> ["a, b"] "$q_{2}$" ;
"$q_{6}$" -> ["\varepsilon"] "$q_{7}$" ;
"$q_{6}$" -> ["\varepsilon"] "$q_{10}$" ;
"$q_{7}$" -> ["a"] "$q_{2}$" ;
"$q_{7}$" -> [""] "$q_{1}$" ;
"$q_{7}$" -> [""] "$q_{3}$" ;
"$q_{7}$" -> [""] "$q_{8}$" ;
"$q_{7}$" -> [""] "$q_{0}$" ;
"$q_{7}$" -> ["b"] "$q_{9}$" [accept];
"$q_{8}$" -> ["a, b"] "$q_{2}$" ;
"$q_{8}$" -> ["\varepsilon"] "$q_{3}$" ;
"$q_{9}$" -> [""] "$q_{1}$" ;
"$q_{9}$" -> ["a, b"] "$q_{2}$" ;
"$q_{9}$" -> [""] "$q_{3}$" ;
"$q_{9}$" -> [""] "$q_{8}$" ;
"$q_{9}$" -> ["\varepsilon"] "$q_{0}$" ;
"$q_{10}$" -> ["b"] "$q_{2}$" ;
"$q_{10}$" -> [""] "$q_{1}$" ;
"$q_{10}$" -> [""] "$q_{3}$" ;
"$q_{10}$" -> [""] "$q_{8}$" ;
"$q_{10}$" -> [""] "$q_{0}$" ;
"$q_{10}$" -> ["a"] "$q_{11}$" [accept];
"$q_{11}$" -> [""] "$q_{1}$" ;
"$q_{11}$" -> ["a, b"] "$q_{2}$" ;
"$q_{11}$" -> [""] "$q_{3}$" ;
"$q_{11}$" -> [""] "$q_{8}$" ;
"$q_{11}$" -> ["\varepsilon"] "$q_{0}$" ;
"$q_{12}$" -> ["\varepsilon"] "$q_{6}$" ;
"$q_{12}$" -> ["a, b"] "$q_{2}$" ;
"$q_{12}$" -> [""] "$q_{7}$" ;
"$q_{12}$" -> [""] "$q_{10}$" ;
}
; \end{scope}
\begin{scope} \path \magicTwo
graph{
"$q_{0}$" [initial,accept] -> ["b"] "$q_{1}$" ;
"$q_{0}$" -> ["a"] "$q_{2}$" ;
"$q_{1}$" -> ["a, b",loop] "$q_{1}$" ;
"$q_{2}$" -> ["a"] "$q_{1}$" ;
"$q_{2}$" -> ["b"] "$q_{3}$" ;
"$q_{3}$" -> ["a"] "$q_{4}$" [accept];
"$q_{3}$" -> ["b"] "$q_{5}$" [accept];
"$q_{4}$" -> ["b"] "$q_{1}$" ;
"$q_{4}$" -> ["a"] "$q_{2}$" ;
"$q_{5}$" -> ["b"] "$q_{1}$" ;
"$q_{5}$" -> ["a"] "$q_{2}$" ;
}
; \end{scope}
\begin{scope} \path \magicThree
graph{
"$q_{0}$" [initial,accept] -> ["b"] "$q_{1}$" ;
"$q_{0}$" -> ["a"] "$q_{2}$" ;
"$q_{1}$" -> ["a, b",loop] "$q_{1}$" ;
"$q_{2}$" -> ["a"] "$q_{1}$" ;
"$q_{2}$" -> ["b"] "$q_{3}$" ;
"$q_{3}$" -> ["a, b"] "$q_{0}$" ;
}
; \end{scope}
\end{tikzpicture}
\end{document}
local bounding box
does that, but why? "place them, e.g., in a chain" - you just want the three graph placed horizontal next to each other? that would be easy.\matrix
is entirely for this purpose. If it's slow, use the pgf version.