我正在使用此处提供的 acm latex 期刊模板:http://www.acm.org/publications/authors/submissions
这遵循单列格式。现在我有 8 张图片,我想按照以下模式显示这些图片和标题:
我不知道如何使用子图或任何其他方式获取这种格式。
\documentclass[format=acmsmall, review=false, screen=true]{acmart}
\usepackage{subcaption}
\usepackage{array}
\usepackage{varwidth}
\usepackage{lipsum}
\begin{document}
\title[This is a Title]{This is a title}
\maketitle
\section{Introduction}
\lipsum[2-4]
\begin{center}
\begin{minipage}{0.5\columnwidth}
\includegraphics[width=\linewidth]{pam}
\captionof{figure}{}
\end{minipage}
\end{center}
\begin{center}
\begin{minipage}{0.5\columnwidth}
\includegraphics[width=\linewidth]{jam}
\captionof{figure}{}
\end{minipage}
\end{center}
.
.
.
.
\end{document}
答案1
使用subcaption
软件包,subfigure
环境是一个环境,具有附加的处理和语句minipage
能力。\caption
\label
\documentclass[format=acmsmall, review=false,
screen=true, demo]{acmart}
\usepackage{subcaption}
\usepackage{array,varwidth,lipsum}
\begin{document}
\title{Chow, Dow, and Pow}
\author{Mr. T and the A-Team}
\date{\today}
\maketitle
\section{Introduction}
\lipsum[2-4] % filler text
\begin{figure}[tp!]
\begin{subfigure}{0.475\textwidth}
\includegraphics[width=\linewidth]{figa}
\caption{}
\end{subfigure}\hfill
\begin{subfigure}{0.475\textwidth}
\includegraphics[width=\linewidth]{figb}
\caption{}
\end{subfigure}
\medskip
\begin{subfigure}{0.475\textwidth}
\includegraphics[width=\linewidth]{figc}
\caption{}
\end{subfigure}\hfill
\begin{subfigure}{0.475\textwidth}
\includegraphics[width=\linewidth]{figd}
\caption{}
\end{subfigure}
\medskip
\begin{subfigure}{0.475\textwidth}
\includegraphics[width=\linewidth]{fige}
\caption{}
\end{subfigure}\hfill
\begin{subfigure}{0.475\textwidth}
\includegraphics[width=\linewidth]{figf}
\caption{}
\end{subfigure}
\medskip
\begin{subfigure}{0.475\textwidth}
\includegraphics[width=\linewidth]{figg}
\caption{}
\end{subfigure}\hfill
\begin{subfigure}{0.475\textwidth}
\includegraphics[width=\linewidth]{figh}
\caption{}
\end{subfigure}
\caption{Overall figure caption}
\end{figure}
\lipsum[5-12] % more filler text
\end{document}
答案2
\documentclass[format=acmsmall, review=false,
screen=true, demo]{acmart}
\usepackage{subfig}
\usepackage{array,varwidth,lipsum}
\begin{document}
\title{Chow, Dow, and Pow}
\author{Mr. T and the A-Team}
\date{\today}
\maketitle
\section{Introduction}
\lipsum[2-4] % filler text
\begin{figure}[tp!]
\subfloat[]{\includegraphics[width=0.46\linewidth]{figa}}%
\hfill
\subfloat[]{\includegraphics[width=0.48\linewidth]{figb}}
\medskip
\subfloat[]{\includegraphics[width=0.48\linewidth]{figc}}%
\hfill
\subfloat[]{\includegraphics[width=0.48\linewidth]{figd}}
\medskip
\subfloat[]{\includegraphics[width=0.48\linewidth]{fige}}%
\hfill
\subfloat[]{\includegraphics[width=0.48\linewidth]{figf}}
\medskip
\subfloat[]{\includegraphics[width=0.48\linewidth]{figg}}%
\hfill
\subfloat[]{\includegraphics[width=0.48\linewidth]{figh}}
\caption{Overall figure caption}
\end{figure}
\lipsum[5-12] % more filler text
\end{document}
编辑:
添加%
用于终止左侧四幅图像的代码行(如建议 米科在下面的评论中)。
答案3
我按照以下方式制作了两幅图像:
\begin{center}
\begin{minipage}{0.5\textwidth}
\includegraphics[width=0.95\linewidth]{imgs/gmail_spam/spam_spam}
\captionof{figure}{}
\end{minipage}%
\begin{minipage}{0.5\textwidth}
\includegraphics[width=0.95\linewidth]{imgs/gmail_spam/spam_phishing}
\captionof{figure}{}
\end{minipage}
\end{center}
\begin{center}
\begin{minipage}{0.5\textwidth}
...
重复 4 次。这样就得到了所需的格式。
如果有其他解决方案,请告诉我。