I am trying to get my subfigures on the same line.
Right now I successfully use the subfigure and TikZ packages to have a Fig. 1 (a) and Fig 1. (b).
However, no matter what I have tried they are stacked one above the other. I would like the two subfigures to be side by side.
\documentclass{article}
\usepackage{subfigure,tikz}
\usetikzlibrary{backgrounds,automata}
\begin{document}
\begin{figure}
\centering
\subfigure[Before]
{%
\begin{tikzpicture}[show background rectangle, scale=.5]
\draw[rounded corners=5pt] (0,0) rectangle (6,8);
\draw[rounded corners=5pt] (1,2) rectangle (5,6);
\draw [dashed] (3,2) to[line to] (3,6);
\node[state] (a) at (3,7) {$a$};
\node[state] (b_x) at (2,5) {$b_x$};
\node[state] (b_y) at (4,5) {$b_y$};
\node[state] (c_x) at (2,3) {$c_x$};
\node[state] (c_y) at (4,3) {$c_y$};
\node[state] (d) at (3,1) {$d$};
\draw (1.25,5.75) node {$x$};
\draw (3.25,5.75) node {$y$};
\draw (0.25,7.75) node {$z$};
\end{tikzpicture}
}
\subfigure[After]
{%
\begin{tikzpicture}[show background rectangle, scale = 0.5]
\draw[rounded corners=5pt] (0,0) rectangle (4,8);
\draw [dashed] (2,0) to[line to] (2,8);
\node[state] (a_x) at (1,7) {$a_x$};
\node[state] (a_y) at (3,7) {$a_y$};
\node[state] (b_x) at (1,5) {$b_x$};
\node[state] (b_y) at (3,5) {$b_y$};
\node[state] (c_x) at (1,3) {$c_x$};
\node[state] (c_y) at (3,3) {$c_y$};
\node[state] (d_x) at (1,1) {$d_x$};
\node[state] (d_y) at (3,1) {$d_y$};
\draw (0.25,7.75) node {$x$};
\draw (2.25,7.75) node {$y$};
\end{tikzpicture}
}
\caption{An example of the procedure} \end{figure}
\end{document}

scaleargument to see whether shrinking the figures makes them fit. – Seamus Mar 10 '11 at 14:18\subfigure[After]– Alain Matthes Mar 10 '11 at 16:2210101button in the editor. Note that it would be helpful if you posted a full MWE, including your preamble (so starting from\documentclass). At the moment, your code is not compilable because the definition ofstateis missing. Also note that thesubfigurepackage is deprecated, andsubfigshould be used instead (see here: http://tex.stackexchange.com/questions/1966/what-is-the-difference-between-subfigure-and-subfloat) – Jake Mar 10 '11 at 16:24\usetikzlibrary{backgrounds,automata}– Alain Matthes Mar 10 '11 at 16:29