Skip to content

Instantly share code, notes, and snippets.

@takuma7
Created January 31, 2016 04:10
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save takuma7/f793ebb22c6720f3ba32 to your computer and use it in GitHub Desktop.
Save takuma7/f793ebb22c6720f3ba32 to your computer and use it in GitHub Desktop.
%%%% Preamble >>>
\usepackage{subcaption}
\newlength{\twosubht}
\newsavebox{\twosubbox}
%%%%% <<<
\begin{figure}[htp]
% preliminary
\sbox\twosubbox{%
\resizebox{\dimexpr.99\textwidth-1em}{!}{% {(num of image)-1}em
\includegraphics[height=100cm]{first-image}%
\includegraphics[height=100cm]{second-image}%
}%
}
\setlength{\twosubht}{\ht\twosubbox}
% typeset
\centering
\subcaptionbox{\label{fig:first}}{%
\includegraphics[height=\twosubht]{first-image}%
}\quad
\subcaptionbox{\label{fig:second}}{%
\includegraphics[height=\twosubht]{second-image}%
}
\caption{(\subref{fig:first}) First. (\subref{fig:second}) Second.}
\label{fig:two-images-same-height}
\end{figure}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment