我想知道应如何按照图 1a 和图 1b 的方式在手稿中交叉引用以下标题。
\begin{figure}
\minipage{0.50\textwidth}
\includegraphics[width=\textwidth]{fig1}
\endminipage\hfill
\minipage{0.50\textwidth}
\includegraphics[width=\textwidth]{fig2}
\endminipage\hfill
\caption{$(a)$ taghyer jabejaei: $R$ is the reference configuration and $D$ is the deformed configuration and $(b)$ Salam Khub hasti density $\bf f$ agr bashe en ro dorost kard force density $\bf t$ at both points} \label{fig:m}
\end{figure}
答案1
我建议你加载副标题包,它提供了一个名为的环境subfigure
。我进一步建议你加载聪明人包有助于简化对子图等项目的交叉引用。
\documentclass{article}
\usepackage{subcaption} % provides 'subfigure' environment
\usepackage[demo]{graphicx} % omit 'demo' option in real document
\usepackage[capitalize]{cleveref} % for "clever" cross-referencing
\begin{document}
\begin{figure}
\begin{subfigure}{0.475\textwidth}
\includegraphics[width=\linewidth]{fig1}
\caption{First subfigure} \label{fig:1a}
\end{subfigure}\hfill% leave no blank line between subfigures
\begin{subfigure}{0.475\textwidth}
\includegraphics[width=\linewidth]{fig2}
\caption{Second subfigure} \label{fig:1b}
\end{subfigure}
\caption{A figure with two subfigures} \label{fig:1}
\end{figure}
\noindent
A cross-reference to \cref{fig:1b}.
\end{document}
附录:如果您不需要单独交叉引用子图,并且如果您愿意提供描述两个图像文件内容的长标题,则当然不需要加载包subcaption
或将图像文件放置在minipage
环境中。
\documentclass{article}
\usepackage[demo]{graphicx} % omit 'demo' option in real document
\usepackage[capitalize]{cleveref} % for "clever" cross-referencing
\begin{document}
\begin{figure}
\includegraphics[width=0.475\textwidth]{fig1}
\hfill
\includegraphics[width=0.475\textwidth]{fig2}
\caption{Left-hand panel: taghyer jabejaei, $R$ is the reference configuration and $D$ is the deformed configuration. Right-hand panel: Salam Khub hasti density $\mathbf{f}$ agr bashe en ro dorost kard force density $\mathbf{t}$ at both points} \label{fig:m}
\end{figure}
\noindent
A cross-reference to \cref{fig:m}.
\end{document}