This question is almost a duplicate of this question. The question is asked in a comment, but is never answered.
When vertically aligning two subfigures as suggested in section 5.4 of the subfig-documentation, the second figure becomes right-aligned.
Does anyone know, how to avoid this?
EDIT: The whole thing is top be used in a presentation / Beamer.
An example of my code:
\newsavebox{\tempbox}
\begin{figure}
\centering
\sbox{\tempbox}{
\includegraphics[width=0.35\textwidth]{Figures/superleder.jpg}
}
\subfloat[Superleder][Superleder\footnotemark]{\usebox{\tempbox}}
\subfloat[Neutronstjerne][Neutronstjerne
\footnote{\url{http://westsalemhigh.com/contract/Tech2/Showcase/Stars/NeutronStar.jpg}}]
{
\vbox to \ht\tempbox{
\vfil
\includegraphics[width=0.35\textwidth]{Figures/neutronstjerne.jpg}
\vfil}
}
\end{figure}
\footnotetext{\url{http://thecustomizewindows.com/wp-content/uploads/2012/06/Superconductor-and-Superconductivity.jpg}}
Best Answer
The problem with that solution using
\vbox
without extra precautions is that the box produced by\vbox
will have a width equal to\textwidth
; the second subfigure is "pushed to the right" by the first subfigure and this results in an overfull\hbox
(you should see the warning message in the output console).Now that the question has been edited to mention this is for the
beamer
class. here's an option using\subcaptionbox
and someminipage
s; the height of the bigger image is measured and used as the common height for bothminipage
s (if no captions are required, the same principle can be applied, without\subcaptionbox
):Changing the alignment options for the
minipage
s one can easily achieve top, bottom alignment.In cases like this, with the standard classes, the powerful
floatrow
package makes the job trivial, using itsheightadjust
andvalign
keys: