如何在 ACM ACR 这个模板中添加这样的图片https://www.ctan.org/pkg/acmart。. minipage 和 subfig subcaption 包在我的模板中不起作用,我收到此错误 LaTeX 错误:环境子图未定义。这是我预期的输出
这是我按照此代码得到的输出: [![在此处输入图像描述][2]][2]
\RequirePackage{comment}
\RequirePackage{algorithm}
\RequirePackage{algpseudocode}
\RequirePackage{graphicx}
\RequirePackage{booktabs}
\RequirePackage{makecell}
\RequirePackage{tabularx}
\RequirePackage{subcaption}
\RequirePackage{caption}
\RequirePackage{subcaption}
\begin{figure}
\begin{minipage}{0.45\columnwidth}
\includegraphics[width=\textwidth]{example-image-a}
\caption*{MNIST-O}
\end{minipage}
\hfill
\begin{minipage}{0.45\columnwidth}
\includegraphics[width=\textwidth]{example-image-b}
\caption*{F-MNIST}
\end{minipage}
\begin{minipage}{0.45\columnwidth}
\includegraphics[width=\textwidth]{example-image-c}
\caption*{CIFAR-10}
\end{minipage}
\hfill
\begin{minipage}{0.45\columnwidth}
\includegraphics[width=\textwidth]{example-image-a}
\caption*{HP News}
\end{minipage}
\caption{Accuracy}
\end{figure}
目前没有子标题,其为图 5、图 6、图 7 和图 8、图 9
答案1
这是否符合要求
平均能量损失
\documentclass[acmsmall, screen, ]{acmart}
\usepackage{subcaption, lipsum}
\begin{document}
\title{Title}
\author{author 1}
\begin{abstract}
The abstract is a short summary of the work to be presented in the article.
\end{abstract}
\maketitle
\lipsum[1][4-6]\par
\begin{figure}[h]
\centering
\begin{subfigure}{0.48\textwidth}
\includegraphics[width=\textwidth]{example-image-a}
\subcaption{The 1907 Franklin Model D roadster.}
\end{subfigure}
% <— this is important. There should be no empty line here.
\begin{subfigure}{0.48\textwidth}
\includegraphics[width=\textwidth]{example-image-b}
\subcaption{The 1907 Franklin Model D roadster.}
\end{subfigure}
\\
\begin{subfigure}{0.48\textwidth}
\includegraphics[width=\textwidth]{example-image-c}
\subcaption{The 1907 Franklin Model D roadster.}
\end{subfigure}
%
\begin{subfigure}{0.48\textwidth}
\includegraphics[width=\textwidth]{example-image-a}
\subcaption{The 1907 Franklin Model D roadster.}
\end{subfigure}
\caption{Wow or whatever}
\end{figure}
\lipsum[5]
\end{document}