[Tex/LaTex] Align captions of subfigures:

captionssubfloats

Hi I want to include the following two tikz figures in my document:

\documentclass{article}

\usepackage{tikz}
\usepackage{subcaption}


\begin{document}
\begin{figure}
\begin{subfigure}[l]{.46\textwidth}
\centering
\resizebox{.8\textwidth}{!}{%
\begin{tikzpicture}
[bend angle =60,inner sep=0pt, minimum size =10mm,very thick,
from/.style={<-},
towards/.style={->},
protein/.style={circle,draw=black,very thick},
reaction/.style={}]
\node[protein] (p) at (-2,0) {$P$};
\node[protein] (ps) at (2,0) {$P^*$}
edge [towards, bend left] node[below=10pt,name=e2,minimum size =0mm] {$E_2$} (p)
edge [from,bend right] node[above=10pt,name=e1,minimum size = 0mm] {$E_1$} (p) ;
\draw[->] (e1) -- +(0pt,-12pt);
\draw[->] (e2) -- +(0pt,12pt);
\end{tikzpicture}%
}
\caption{Goldbeter-Koshland Loop.}
\end{subfigure}
\begin{subfigure}[r]{.46\textwidth}
\resizebox{.8\textwidth}{!}{%
\begin{tikzpicture}
[bend angle =60,inner sep=0pt, minimum size =10mm,very thick,
from/.style={<-},
towards/.style={->},
protein/.style={circle,draw=black,very thick},
reaction/.style={}]
\node[protein] (p) at (-1.5,0) {$P$};
\node[protein] (ps) at (1.5,0) {$P^*$}
edge [towards, bend left] node[below=10pt,name=e2, minimum size =0mm] {$E_2$} (p)
edge [from,bend right] node[above=10pt,name=e1,minimum size =0mm] {$E_1$} (p) ;
\draw[->] (e1) -- +(0pt,-12pt);
\draw[->] (e2) -- +(0pt,12pt);
\node[protein] (q) at (0 , -3) {$Q$};
\node[protein] (qs) at (3 , -3) {$Q^*$}
edge [towards, bend left] node[below=10pt,name=e3, minimum size =0mm] {$E_3$} (q)
edge [from,bend right] node[above=10pt,name=e4,minimum size =0mm] {} (q) ;
\draw[->] (ps) -- +(0pt,-50pt);
\draw[->] (e3) -- +(0pt,12pt);
\end{tikzpicture}%
}
\caption{Goldbeter-Koshland Cascade.}
\end{subfigure}
\end{figure}

\end{document}

Everything is as I want it except that the caption in the two subfigures are not aligned.

Thanks for the help.

Best Answer

You can let the floatrow package do the hard work for you:

\documentclass{article}
\usepackage{tikz}
\usepackage{subcaption}
\usepackage{floatrow}

\begin{document}

\begin{figure}
\ffigbox
{%
\begin{subfloatrow}
\ffigbox[\FBwidth][1.5\FBheight]
  {\caption{Goldbeter-Koshland Loop.}}
  {\resizebox{.4\textwidth}{!}{%
\begin{tikzpicture}
[bend angle =60,inner sep=0pt, minimum size =10mm,very thick,
from/.style={<-},
towards/.style={->},
protein/.style={circle,draw=black,very thick},
reaction/.style={}]
\node[protein] (p) at (-2,0) {$P$};
\node[protein] (ps) at (2,0) {$P^*$}
edge [towards, bend left] node[below=10pt,name=e2,minimum size =0mm] {$E_2$} (p)
edge [from,bend right] node[above=10pt,name=e1,minimum size = 0mm] {$E_1$} (p) ;
\draw[->] (e1) -- +(0pt,-12pt);
\draw[->] (e2) -- +(0pt,12pt);
\end{tikzpicture}%
}}%
\ffigbox[\FBwidth]
{\caption{Goldbeter-Koshland Cascade.}}
{\resizebox{.4\textwidth}{!}{%
\begin{tikzpicture}
[bend angle =60,inner sep=0pt, minimum size =10mm,very thick,
from/.style={<-},
towards/.style={->},
protein/.style={circle,draw=black,very thick},
reaction/.style={}]
\node[protein] (p) at (-1.5,0) {$P$};
\node[protein] (ps) at (1.5,0) {$P^*$}
edge [towards, bend left] node[below=10pt,name=e2, minimum size =0mm] {$E_2$} (p)
edge [from,bend right] node[above=10pt,name=e1,minimum size =0mm] {$E_1$} (p) ;
\draw[->] (e1) -- +(0pt,-12pt);
\draw[->] (e2) -- +(0pt,12pt);
\node[protein] (q) at (0 , -3) {$Q$};
\node[protein] (qs) at (3 , -3) {$Q^*$}
edge [towards, bend left] node[below=10pt,name=e3, minimum size =0mm] {$E_3$} (q)
edge [from,bend right] node[above=10pt,name=e4,minimum size =0mm] {} (q) ;
\draw[->] (ps) -- +(0pt,-50pt);
\draw[->] (e3) -- +(0pt,12pt);
\end{tikzpicture}%
}}%
\end{subfloatrow}}{}
\end{figure}

\end{document}

enter image description here