在我的文档中有一个“图 1”,我使用\put(x,y){(a) Some text description here.}
[针对 (a) 和 (b)]命令手动将部分标记为“(a)”和“(b)”。
我正在使用\label{label name here}
“图 1”标题内的命令来\ref{label name here}
产生所需的效果,但有一件事除外。目前,我的文本中有
...如图 1(a) 所示。
但是,只有“1”是“链接”,而不是“(a)”。我意识到我目前没有为此效果设置代码;这就是我寻求帮助的原因。
注意:我目前正在使用
\usepackage[usenames,dvipsnames]{color}
\usepackage{natbib}
\usepackage[colorlinks=true]{hyperref}
\hypersetup{colorlinks=true, citecolor=ForestGreen, linkcolor=Red, urlcolor=Blue}
========================
编辑以提供 MWE
\documentclass[10pt]{article}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage[a4paper]{geometry}
\geometry{top=1.0in, bottom=1.2in, left=1.2in, right=1.2in}
\usepackage{epstopdf}
\usepackage[usenames,dvipsnames]{color}
\usepackage{natbib}
\usepackage[colorlinks=true]{hyperref}
\hypersetup{colorlinks=true, citecolor=ForestGreen, linkcolor=Red, urlcolor=Blue}
\begin{document}
\noindent Some text here to talk about the first part of the figure followed by a reference to see Figure \ref{Figure1}(a). Some text here to talk about the second part of the figure followed by a reference to see Figure \ref{Figure1}(b).
\begin{figure}[h]
\centering
\setlength{\unitlength}{0.1\textwidth}
\vspace{0.7in}
\setlength{\unitlength}{0.1\textwidth}
\begin{picture}(5.5,4.5)
\put(-1,0){\includegraphics[width=4cm]{Figure1Name.eps}}
\put(-1,2.65){\footnotesize{(a) Some text describing the first part.}}
\put(-1,-0.45){\footnotesize{(b)Some text describing the second part.}}
\end{picture}
\parbox{5.4in}{\vspace{0.5in}\caption{\normalsize{The caption for Figure 1 goes here. Both parts of Figure 1 are described. \label{Figure1}}}}
\end{figure}
\end{document}
========================
输出
答案1
我建议您用几个环境替换环境picture
中的环境。(通过加载包即可使用环境。)这样,您可以为每个子图单独生成标签——以及为整个图生成标签——然后您可以单独交叉引用每个实体。该命令允许您自定义标题外观的几乎每个方面,包括字体大小。figure
subfigure
subfigure
subcaption
\captionsetup
以下修改后的 MWE 形式显示了如何实现这一点。它有三个\caption
指令\label
,分别用于子图和整体图。
\documentclass[10pt]{article}
\usepackage[demo]{graphicx} % remove demo option for real program
\usepackage{amsmath,amssymb}
\usepackage[a4paper]{geometry}
\geometry{top=1.0in, bottom=1.2in, left=1.2in, right=1.2in}
\usepackage{subcaption}
\captionsetup[sub]{size=footnotesize} % optional
\usepackage{epstopdf}
\usepackage[usenames,dvipsnames]{color}
\usepackage{natbib}
\usepackage[colorlinks=true]{hyperref}
\hypersetup{colorlinks=true, citecolor=ForestGreen, linkcolor=Red, urlcolor=Blue}
\begin{document}
Some text here to talk about the first part of the figure followed by a
reference to Figure~\ref{fig:1a}. Some text here to talk about the second
part of the figure followed by a reference to Figure~\ref{fig:1b}.
\begin{figure}[h]
\centering
\begin{subfigure}{0.5\textwidth} % or whatever dimension is desired
\centering
\includegraphics[width=4cm]{spiral.eps}
\caption{Some text describing the first part.}
\label{fig:1a}
\end{subfigure}
\bigskip
\begin{subfigure}{0.5\textwidth}
\centering
\includegraphics[width=\columnwidth]{redsquare.pdf}
\caption{Some text describing the second part.}
\label{fig:1b}
\end{subfigure}
\caption{The caption for Figure 1 goes here. Both parts of Figure 1 are described.}
\label{Figure1}
\end{figure}
\end{document}