I have a tikz drawing I want to export as a PDF. \documentclass{standalone} allows for the PDF to be cropped to the size of the drawing. However, the subfigures are then horizontally stacked. What can be done to vertically stack the subfigures with \documentclass{standalone}?
My MWE:
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric, arrows, shapes,shadows,positioning}
\usetikzlibrary{backgrounds}
\tikzstyle{class} = [rectangle, rounded corners, minimum width=1cm, minimum height=1cm,text centered, draw=black, text = black]
\tikzstyle{process} = [rectangle, rounded corners, minimum width=1cm, minimum height=0.0cm,text centered, draw=white, text = black]
\tikzstyle{io} = [rectangle, rounded corners, minimum width=3cm, minimum height=1cm,text centered, draw=black, fill=white]
\tikzstyle{arrow} = [thick,->,>=stealth, color=black]
\tikzstyle{container} = [draw, rectangle, dashed, rounded corners, minimum height = 1.6cm, minimum width=1.55cm]
\tikzstyle{note} = [rectangle, dashed, draw, fill=white, text centered, rounded corners, minimum height=1.5cm, draw=black]
\usepackage{subfigure}
\renewcommand{\thesubfigure}{(\Alph{subfigure})}
\begin{document}
\begin{figure}[h!]
\centering
\subfigure[Caption for sub figure A.]{
\begin{tikzpicture}[node distance = 3.5cm]
\node(MSa)[class]{MS};
\node(trans)[process, right of = MSa]{$P^{\left(\text{\textit{trans}}\right)}$};
\node(MSb)[class, right of = trans]{MS+1};
\node(MSc)[class, below of = MSa, yshift = 1.8cm]{MS};
\draw[arrow](MSa.east) -- node[above, scale = 0.8, align=left]{$U(T^{\uparrow}_{min},T^{\uparrow}_{max})$} (trans.west);
\draw[arrow](trans.east) -- (MSb.west);
\draw[arrow](trans.south) |- (MSc.east);
\label{fig:MS dynamics prg}
\end{tikzpicture}}
\subfigure[Caption for sub figure B]{
\begin{tikzpicture}[node distance = 3.5cm]
\node(MSa)[class]{MS};
\node(cure)[process, right of = MSa]{$P^{\left(\text{\textit{cure}}\right)}$};
\node(MSb)[class, right of = cure]{MS-1};
\draw[arrow]([yshift = 0.1cm]MSa.east) -- ([yshift = 0.1cm]cure.west);
\draw[arrow](cure.east) -- node[above, scale = 0.8, align=left]{$U(T^{\downarrow}_{min},T^{\downarrow}_{max})$} (MSb.west);
\draw[arrow]([yshift = -0.1cm]cure.west) -- ([yshift = -0.1cm]MSa.east);
\label{fig:MS dynamics reg}
\end{tikzpicture}}
\end{figure}
\end{document}



subfigurepackage is deprecated. It's better to usesubfigorsubcaption. See https://www.ctan.org/pkg/subfigure – Ignasi Jun 17 '21 at 06:01