如何使用 overleaf 在 IEEE 格式的页面开头放置 8 个这样的数字。我的代码是这样的,它只在一行中放置三个数字,但是当我放置 4 个数字时,它不适合在一行中。
\begin{figure*}[]
\centering
%\begin{subfigure}{\columnwidth}
%\centering
\subfloat[aaaaaaaaaaa.]{\includegraphics[width=0.2\textwidth]{a.png}
%\caption{}
\label{fig:CS_2n}
}\hfil
%\end{subfigure}
%\begin{subfigure}{\columnwidth}
%\centering
%\centering
\subfloat[bbbbbbbbbbbbb]{\includegraphics[width=0.2\textwidth]{v.png}
\caption{vvvvvvvvvvvvvvvvvvvvvvvvvv}
\label{fig:CS_3n}
}\hfil
%\end{subfigure}
%\begin{subfigure}{\columnwidth}
%\centering
\subfloat[cccccccccccccccc.]{\includegraphics[width=0.2\textwidth]{cv.png}
%\caption{}
\label{fig:CS_3n}
}\hfil
\subfloat[dddddddddddddddd]{\includegraphics[width=0.2\textwidth]{tt.png}
%\caption{}
\label{fig:CS_3n}
}\hfil
\caption{fffffffffffffffffffffffffffffffff}%
\end{figure*}
从我的代码来看,当我尝试执行此操作时,它看起来像这样,因为我需要为前两张图片和后两张图片添加单独的标题
但是,示例图片是这样的,前两张图片有单独的标题,后两张图片有单独的标题,并且水平对齐
答案1
考虑@Leonardiis 的评论,扩展到 MWE 的代码片段应该/可以是:
\documentclass{ieeetran}
\usepackage[draft]{graphicx}
\usepackage{subcaption}
\begin{document}
\begin{figure*}[ht]
\centering
\setkeys{Gin}{width=0.24\linewidth} % <---
\subfloat[aaaaaaaaaaa. \label{fig:CS_2n}]{\includegraphics{example-image} }\hfil
\subfloat[bbbbbbbbbbbbb. \label{fig:CS_3n}]{\includegraphics{example-image} }\hfil
\subfloat[cccccccccccccccc. \label{fig:CS_3n}]{\includegraphics{example-image} }\hfil
\subfloat[dddddddddddddddd. \label{fig:CS_3n}]{\includegraphics{example-image} }
\caption{fffffffffffffffffffffffffffffffff}
\label{fig:first}
\bigskip
\subfloat[aaaaaaaaaaa. \label{fig:CS_2n}]{\includegraphics{example-image} }\hfil
\subfloat[bbbbbbbbbbbbb. \label{fig:CS_3n}]{\includegraphics{example-image} }\hfil
\subfloat[cccccccccccccccc. \label{fig:CS_3n}]{\includegraphics{example-image} }\hfil
\subfloat[dddddddddddddddd. \label{fig:CS_3n}]{\includegraphics{example-image} }
\caption{fffffffffffffffffffffffffffffffff}%
\label{fig:second}
\end{figure*}
\end{document}
其生产成果为:
如您所见,结果符合预期。所有图形元素都在正确的位置。
编辑:
如果您希望有两行\subfloat
s,只需添加另一行:
\begin{figure*}
\centering
\setkeys{Gin}{width=0.22\linewidth} % <---
\subfloat[aaaaaaaaaaa. \label{fig:CS_2n}]{\includegraphics{example-image} }\hfil
\subfloat[bbbbbbbbbbbbb. \label{fig:CS_3n}]{\includegraphics{example-image} }\hfil
\subfloat[cccccccccccccccc. \label{fig:CS_4n}]{\includegraphics{example-image} }\hfil
\subfloat[dddddddddddddddd. \label{fig:CS_5n}]{\includegraphics{example-image} }
\caption{fffffffffffffffffffffffffffffffff}
\label{fig:first}
\bigskip
\subfloat[aaaaaaaaaaa. \label{fig:CS_2n-2}]{\includegraphics{example-image} }\hfil
\subfloat[bbbbbbbbbbbbb. \label{fig:CS_3n-2}]{\includegraphics{example-image} }\hfil
\subfloat[cccccccccccccccc. \label{fig:CS_4n-2}]{\includegraphics{example-image} }\hfil
\subfloat[dddddddddddddddd. \label{fig:CS_5n-2}]{\includegraphics{example-image} }
\caption{fffffffffffffffffffffffffffffffff}
\label{fig:second}
\end{figure*}
结果是:
编辑(2):
\begin{figure*}
\centering
\setkeys{Gin}{width=0.48\linewidth} % <---
\begin{minipage}{0.48\linewidth}
\includegraphics{example-image}\hfil
\includegraphics{example-image}
\caption{fffffffffffffffffffffffffffffffff}
\label{fig:first}
\end{minipage}
\hfill
\begin{minipage}{0.48\linewidth}
\includegraphics{example-image}\hfil
\includegraphics{example-image}
\caption{fffffffffffffffffffffffffffffffff}
\label{fig:second}
\end{minipage}
\bigskip
\begin{minipage}{0.48\linewidth}
\includegraphics{example-image}\hfil
\includegraphics{example-image}
\caption{fffffffffffffffffffffffffffffffff}
\label{fig:third}
\end{minipage}
\hfill
\begin{minipage}{0.48\linewidth}
\includegraphics{example-image}\hfil
\includegraphics{example-image}
\caption{fffffffffffffffffffffffffffffffff}
\label{fig:fourth}
\end{minipage}
\end{figure*}