我想让两张图片并排显示,每张图片都应该有自己的标题和编号。我尝试使用 paracol 和 minipage 来实现这一点。它们似乎都有自己的缺陷。代码如下:
\begin{paracol}{2}
\begin{figure}
\centering
\includegraphics[width=0.99\linewidth]{images/img_size_dependency.pdf}
\caption{The relation between image size and [email protected]$}
\label{fig:img_sizes}
\end{figure}
\switchcolumn
\begin{figure}
\centering
\includegraphics[width=0.99\linewidth]{images/training_set_dependency.pdf}
\caption{Mean average precision based on the size of training set}
\label{fig:training_set_sizes}
\end{figure}
\end{paracol}
\begin{figure}
\begin{minipage}{0.49\textwidth}
\centering
\includegraphics[width=0.99\linewidth]{images/img_size_dependency.pdf}
\captionof{figure}{The relation between image size and [email protected]$}
\label{fig:img_sizes}
\end{minipage}%
\begin{minipage}{0.5\textwidth}
\centering
\includegraphics[width=0.99\linewidth]{images/training_set_dependency.pdf}
\captionof{figure}{Mean average precision based on the size of training set}
\label{fig:training_set_sizes}
\end{minipage}
\end{figure}
这些行的代码结果如下: minipage 的单个标题,而不是 paracolumn 的递增计数器(即使我添加了此行:\globalcounter{figures})。您对如何解决这个问题有什么建议吗?
答案1
以下是如何使用该包获取它的演示floatrow
:
\documentclass{article}
\usepackage{graphicx}
\usepackage{floatrow}
\begin{document}
\begin{figure}
\begin{floatrow}[2]
\ffigbox[\FBwidth]{\caption{Marie \v{C}erminova, known as Toyen: \emph{She sleeps} (1937)}}%
{\includegraphics{LaDormeuse}}\qquad
\ffigbox[\FBwidth]{\caption{Piero di Cosimo: \emph{Portrait of Simonetta Vespucci} (ca 1480)}}%
{\includegraphics{Piero_di_Cosimo_3}}
\end{floatrow}
\end{figure}
\end{document}