对于报告,我需要按以下方式设置子图:
- 用大写字母(A、B、C 等)枚举每个子图并将其放在图像的左上角。
- 收集整个图形下方的标题(图 XY。bla bla bla (A) bla (B) bla (C) bla)。
我完全不知道怎么去那里,也没有在互联网上找到任何建议。所以非常感谢任何帮助。
目前,我的代码如下:
\documentclass[]{scrartcl}
\usepackage{graphicx,float}
\usepackage[]{caption}
\captionsetup{font=small,format=plain}
\begin{document}
\begin{figure}[H]
\centering
\subfloat[ caption 1]{\includegraphics[width=.45\textwidth]{Figure1.eps}\label{subfig:1}}
\hspace{0.5cm}
\subfloat[caption 2 ]{\includegraphics[width=.45\textwidth]{Figure2.eps}\label{subfig:2}}
\newline
\subfloat[caption 3]{\includegraphics[width=.45\textwidth]{Figure3.eps}\label{subfig:3}}
\hspace{0.5cm}
\subfloat[caption 4]{\includegraphics[width=.45\textwidth]{Figure4.eps}\label{subfig:4}}
\caption{caption of the whole figure}\label{fig}
\end{figure}
\end{document}
PS 整个报告应该看起来像ACS的期刊“生物化学”。
答案1
起点:
\documentclass{article}
\usepackage{graphicx}
\usepackage{floatrow}
\usepackage{subcaption}
\DeclareCaptionSubType[Alph]{figure}
\captionsetup[subfigure]{labelformat=simple}
\captionsetup{subrefformat=parens}
\begin{document}
\begin{figure}
\floatsetup{capbesideposition={left,top},capbesidewidth=0.25cm}
\begin{minipage}{0.5\linewidth}
\begin{subfloatrow}
\fcapside[\FBwidth]
{\caption{\label{fig:subfig-a}}}
{\includegraphics[width=.8\textwidth]{example-image}}
\end{subfloatrow}
\end{minipage}%
\begin{minipage}{0.5\linewidth}
\begin{subfloatrow}[2]
\fcapside[\FBwidth]
{\caption{\label{fig:subfig-b}}}
{\includegraphics[width=.8\textwidth]{example-image}}
\end{subfloatrow}
\end{minipage}
\bigskip
\begin{minipage}{0.5\linewidth}
\begin{subfloatrow}
\fcapside[\FBwidth]
{\caption{\label{fig:subfig-c}}}
{\includegraphics[width=.8\textwidth]{example-image}}
\end{subfloatrow}
\end{minipage}%
\begin{minipage}{0.5\linewidth}
\begin{subfloatrow}[2]
\fcapside[\FBwidth]
{\caption{\label{fig:subfig-d}}}
{\includegraphics[width=.8\textwidth]{example-image}}
\end{subfloatrow}
\end{minipage}
\caption{A caption text that references the individual images: \subref{fig:subfig-a} shows ..., \subref{fig:subfig-b}, \subref{fig:subfig-c} and \subref{fig:subfig-d}}
\end{figure}
\end{document}
答案2
另一种方式是floatrow
:
\documentclass{scrartcl}
\usepackage{graphicx}
\usepackage{caption, subcaption}
\captionsetup{font=small, format=plain}
\usepackage{floatrow}
\begin{document}
\begin{figure}
\centering\floatsetup[subfigure]{capposition=top, captionskip=1ex}
\renewcommand{\thesubfigure}{\Alph{subfigure}}
\ffigbox[\textwidth]{%
\begin{subfloatrow}
\ffigbox{\includegraphics[width=.45\textwidth]{example-image}}{\caption{caption 1}\label{subfig:1}}
\hspace{0.5cm}
\ffigbox{\includegraphics[width=.45\textwidth]{example-image}}{\caption{caption 2}\label{subfig:2}}
\end{subfloatrow}\vskip 4ex
\begin{subfloatrow}
\ffigbox{\includegraphics[width=.45\textwidth]{example-image}}{\caption{caption 3}\label{subfig:3}}
\hspace{0.5cm}
\ffigbox{\includegraphics[width=.45\textwidth]{example-image}}{\caption{caption 4}\label{subfig:4}}
\end{subfloatrow}
}%
{\caption{caption of the whole figure}\label{fig}}
\end{figure}
\end{document}