
いくつかのサブフロートを含む図があります。図は次のようになります:
各サブフロートを個別に持っているわけではなく、単一の画像を持っています。
画像とテキスト内の参照をリンクするために、hyperref を使用しました。
\documentclass{article}
\usepackage{subfig}
\usepackage{hyperref}
\usepackage{graphicx}
\begin{document}
Figures \ref{Fig1a} and \ref{Fig1b} are in Figure \ref{Fig1}
\begin{figure}[htb]
\centering
\subfloat{
\includegraphics{example-image}
\label{Fig1a}
}
\subfloat{\label{Fig1b}}
\caption{Image description:
\textbf{(a)}~figure 1a and
\textbf{(b)}~figure 1b
}
\label{Fig1}
\end{figure}
\end{document}
ドキュメント内で をクリックするとFig1a
すぐに図が表示されますが、 をクリックするとキャプションが表示されます。Fig1b をクリックして、キャプションではなく画像に移動するにはどうすればよいでしょうか。Fig1
.pdf
Fig1b
答え1
問題は、2 番目のページを\subfloat
vmode にする方法です。これは行の末尾でのみ発生するためです。そこで、ミニページは実質的に新しいページ (vmode 内) を開始すると考えました。
もちろん、\subfloat
ミニページ内に を置くのは冗長です。基本的にはミニページ。
\documentclass{article}
\usepackage{graphicx}
\usepackage{subfig}
\usepackage{hyperref}
\begin{document}
Figures \ref{Fig1a} and \ref{Fig1b} are in Figure \ref{Fig1}
\begin{figure}[htb]
\centering
\subfloat{
\includegraphics[width={\dimexpr 0.5\textwidth-0.5\columnsep}]{example-image-a}
\label{Fig1a}
}\hfil
\begin{minipage}[b]{\dimexpr 0.5\textwidth-0.5\columnsep}
\subfloat{
\includegraphics[width=\textwidth]{example-image-b}
\label{Fig1b}
}
\end{minipage}
\caption{Image description:
\textbf{(a)}~figure 1a and
\textbf{(b)}~figure 1b
}
\label{Fig1}
\end{figure}
\end{document}
このソリューションでは、ミニページのみを使用します。subfig パッケージの一部の定義も引き続き使用します。
\documentclass{article}
\usepackage{graphicx}
\usepackage{subfig}
\usepackage{hyperref}
\makeatletter
\newcommand{\stepsubfigure}{%
\advance\c@figure by 1 %local
\refstepcounter{subfigure}%
}
\makeatother
\begin{document}
Figures \ref{Fig1a} and \ref{Fig1b} are in Figure \ref{Fig1}
\begin{figure}[htb]
\begin{minipage}[b]{\dimexpr 0.5\textwidth-0.5\columnsep}
\stepsubfigure
\includegraphics[width=\textwidth]{example-image-a}
\label{Fig1a}
\end{minipage}\hfill
\begin{minipage}[b]{\dimexpr 0.5\textwidth-0.5\columnsep}
\stepsubfigure
\includegraphics[width=\textwidth]{example-image-b}
\label{Fig1b}
\end{minipage}
\caption{Image description:
\textbf{(a)}~figure 1a and
\textbf{(b)}~figure 1b
}
\label{Fig1}
\end{figure}
\end{document}