我有六个子图(即图 1a、1b、1c 等),我想在文本中引用子图和主图(即图 1)。在此示例中,\ref{fig: lattice_strain}
应引用图 1,并且\ref{fig: Fe_Lat_Strain}
应为图 1a。但我得到的却[??]
是文本正文。如能得到任何帮助,我将不胜感激!
例子:
Figure \ref{fig: lattice_strain} illustrates the change in the measured lattice strain with engineering strain and time for several Fe (\ref{fig: Fe_Lat_Strain}, M$_{23}$C$_{6}$ (\ref{fig: M_Lat_Strain}) and Nb(N, C) (\ref{fig: N_Lat_Strain} precipitate reflections in the loading direction.
\begin{figure}[h]
\captionsetup[subfloat]{labelfont=bf}
\begin{minipage}{\linewidth}
\centering
\subfloat[]{\label{fig: Fe_Lat_Strain}\includegraphics[scale=1]{Fe_Lat_Strain}}
\centering
\subfloat[]{\label{fig: M_Lat_Strain}\includegraphics[scale=1]{M_Lat_Strain}}
\centering
\subfloat[]{\label{fig: N_Lat_Strain}\includegraphics[scale=1]{N_Lat_Strain}}
\end{minipage}\par\smallskip
\begin{minipage}{\linewidth}
\centering
\subfloat[]{\label{fig: Fe_Lat_Time}\includegraphics[scale=1]{Fe_Lat_Time}}
\centering
\subfloat[]{\label{fig: M_Lat_Time}\includegraphics[scale=1]{M_Lat_Time}}
\centering
\subfloat[]{\label{fig: N_Lat_Time}\includegraphics[scale=1]{N_Lat_Time}}
\end{minipage}
\label{fig: lattice_strain}
\caption{(a--c)...(d-f)...}
\end{figure}
答案1
除了遵循@TorbjørnT 的建议并发布\label
说明后相关的\caption
指令,您应该考虑大大简化代码,例如,通过摆脱两个minipage
“包装器”并省略所有 6\centering
条指令。接下来,为图像设置合理的(相对)宽度,并通过发出\hfill
指令在视觉上分离子图。
\documentclass[demo]{article} % remove 'demo' option in real document
\usepackage{subfig,graphicx}
\begin{document}
Figure \ref{fig:lattice_strain} \dots
(\ref{fig:Fe_Lat_Strain}),
M$_{23}$C$_{6}$ (\ref{fig:M_Lat_Strain}),
and Nb(N, C) (\ref{fig:N_Lat_Strain}) \dots
\begin{figure}[h]
\captionsetup[subfloat]{labelfont=bf}
\subfloat[]{\label{fig:Fe_Lat_Strain}\includegraphics[width=0.3\textwidth]{Fe_Lat_Strain}}
\hfill
\subfloat[]{\label{fig:M_Lat_Strain}\includegraphics[width=0.3\textwidth]{M_Lat_Strain}}
\hfill
\subfloat[]{\label{fig:N_Lat_Strain}\includegraphics[width=0.3\textwidth]{N_Lat_Strain}}
\smallskip
\subfloat[]{\label{fig:Fe_Lat_Time}\includegraphics[width=0.3\textwidth]{Fe_Lat_Time}}
\hfill
\subfloat[]{\label{fig:M_Lat_Time}\includegraphics[width=0.3\textwidth]{M_Lat_Time}}
\hfill
\subfloat[]{\label{fig:N_Lat_Time}\includegraphics[width=0.3\textwidth]{N_Lat_Time}}
\caption{(a--c) \dots\ (d--f) \dots}
\label{fig:lattice_strain}
\end{figure}
\end{document}