我曾使用figure*
环境在 Overleaf 的双栏文章中将多个子图包含在单个图中。我还包含graphicx
并subcaption
打包了。
\begin{figure*}
\begin{subfigure}{.45\textwidth}
\centering
\includegraphics[width=.95\linewidth]{train_success.png}
\caption{An image from training set}
\label{fig:train_succ}
\end{subfigure}
\begin{subfigure}{.45\textwidth}
\centering
\includegraphics[width=.95\linewidth]{validation_success.png}
\caption{An image from validation set}
\label{fig:valid_succ}
\end{subfigure}
\caption{Output of Mask RCNN on various images}
\label{fig:mask_rcnn_train_results}
\end{figure*}
bla bla bla \ref{fig:mask_rcnn_train_results} % working fine
some random text \ref{fig:8_point} % prints ??
\begin{figure}[h]
\centering
\includegraphics{8 point.png}
\caption{8 points considered in 8-point method}
\label{fig:8_point}
\end{figure}
环境图形figure*
实际上被打印在下一页的顶部,并且被完美地引用\ref
。
但是,figure* 环境之后的任何其他图形(此处的图形 {fig:8_point})都不会使用 引用 tex 文件中的任何位置\ref
。我得到的是 ?? \ref
(对于上述情况,我得到的是“一些随机文本 ??”)。此外,图像8 point.png
被完全忽略。但是,figure*
使用 可以正确引用环境之前添加的任何图形\ref
。
环境会figure*
破坏任何东西吗?如果是这样,如何在不使用的情况下在双栏文章中的单个图中添加多个子图figure*
?我正在使用 XeLaTeX 编译器和\documentclass[sigconf,authordraft]{acmart}
作为文档类(ACM 格式,作者的草稿)。
这是一个有效的例子(我使用 Overleaf):
\documentclass[sigconf,authordraft]{acmart}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{bm}
\usepackage{array}
\usepackage{fontspec}
\usepackage{subcaption}
\AtBeginDocument{%
\providecommand\BibTeX{{%
\normalfont B\kern-0.5em{\scshape i\kern-0.25em b}\kern-0.8em\TeX}}}
\setcopyright{acmcopyright}
\copyrightyear{2018}
\acmYear{2018}
\acmDOI{10.1145/1122445.1122456}
\acmConference[Woodstock '18]{Woodstock '18: ACM Symposium on Neural
Gaze Detection}{June 03--05, 2018}{Woodstock, NY}
\acmBooktitle{Woodstock '18: ACM Symposium on Neural Gaze Detection,
June 03--05, 2018, Woodstock, NY}
\acmPrice{15.00}
\acmISBN{978-1-4503-XXXX-X/18/06}
\begin{document}
\title{A Random Title}
\author{Preetom Saha Arko}
\begin{abstract}
\end{abstract}
\maketitle
\section{Introduction}
\section{Literature Review}
\section{Problem Definition}
A sample image from the dataset has been shown in Figure \ref{fig:sample}. Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. \\
\begin{figure}[h]
\centering
\includegraphics[width=\columnwidth]{example-image-a}
\caption{A sample image from dataset}
\label{fig:sample}
\end{figure}
\section{Implementation}
\subsection{Training Model}
\begin{figure*}
\begin{subfigure}{.24\textwidth}
\centering
\includegraphics[width=.95\linewidth]{example-image-b}
\caption{An image from training set}
\label{fig:train_succ}
\end{subfigure}
\begin{subfigure}{.24\textwidth}
\centering
\includegraphics[width=.95\linewidth]{example-image-c}
\caption{An image from validation set}
\label{fig:valid_succ}
\end{subfigure}
\begin{subfigure}{.24\textwidth}
\centering
\includegraphics[width=.95\linewidth]{example-image-b}
\caption{An image unseen by model}
\label{fig:outside_succ1}
\end{subfigure}
\begin{subfigure}{.24\textwidth}
\centering
\includegraphics[width=.95\linewidth]{example-image-c}
\caption{An image unseen by model}
\label{fig:outside_succ2}
\end{subfigure}
\caption{Output of model on various images}
\label{fig:mask_rcnn_train_results}
\end{figure*}
In Figure \ref{fig:mask_rcnn_train_results}, the output of model on some images has been shown. Figure \ref{fig:train_succ} shows an image from the training set and Figure \ref{fig:valid_succ} shows an image from the validation set. Figure \ref{fig:outside_succ1} and Figure \ref{fig:outside_succ2} show two images that are neither from the training set nor from the validation set. Here we see that the model performs reasonably well on all these images.
\subsection{Image Processing}
These points have been shown in a rectangle in Figure \ref{fig:8_point}.
% prints ?? in the place of ref
\begin{figure}[h]
\centering
\includegraphics{example-image-a}
\caption{8 points considered}
\label{fig:8_point}
\end{figure}
\section{Conclusion}
\bibliographystyle{ACM-Reference-Format}
\bibliography{sample-base}
\end{document}
您还可以找到工作示例这里。