
我有一個帶有一些子浮點的圖形。該圖是這樣的:
我沒有單獨的每個子浮動,我有一張圖片。
為了將圖片與文字中的參考連結起來,我使用了 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
問題是如何讓第二個\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}