页面顶部并排显示两栏格式的图表

页面顶部并排显示两栏格式的图表

我尝试了下面的代码,并在文档中获得了图像,例如图像 2(彩色图像)。我想将像图片 1(黑白图像)这样的清晰可见的图像并排放置在双栏格式的页面顶部。我该如何实现?有人可以帮忙吗?

 \begin{figure}%
\centering
\subfloat[]{{\includegraphics[width=3cm]{aq.PNG} }}%
\qquad
\subfloat[]{{\includegraphics[width=3cm]{aq.PNG} }}%
\caption{zzzzzzzzzzzzzzzzzzzzzz}%
\label{fig:example}%
 \end{figure}
 \begin{figure}%
\centering
\subfloat[]{{\includegraphics[width=3cm]{aq.PNG} }}%
\qquad
\subfloat[]{{\includegraphics[width=3cm]{aq.PNG} }}%
\caption{xxxxxxxxxxxxxxxxxxxxxxxxxxxx}%
\label{fig:example}%
 \end{figure}

在此处输入图片描述

我关注了两个并排的身影但它在我的情况下不起作用,因为我使用的是 2 列格式 IEEE 模板

\documentclass{article}
\usepackage{lipsum}
\usepackage{mwe}

\begin{document}

\begin{figure}
    \centering
    \begin{minipage}{0.45\textwidth}
        \centering
        \includegraphics[width=0.9\textwidth]{c.PNG} % first figure itself
        \caption{first figure}
    \end{minipage}\hfill
    \begin{minipage}{0.45\textwidth}
        \centering
        \includegraphics[width=0.9\textwidth]{h.PNG} % second figure itself
        \caption{second figure}
    \end{minipage}
\end{figure}


\end{document}

答案1

我猜您正在寻找以下内容:

\documentclass{ieeetran}
\usepackage{lipsum}
\usepackage{mwe}

\begin{document}
\lipsum[1]
\begin{figure}[t]
    \centering
    \begin{minipage}{0.48\linewidth}
        \centering
        \includegraphics[width=\linewidth]{example-image-duck}%{c.PNG} % first figure itself
        \caption{first figure}
    \end{minipage}\hfill
    \begin{minipage}{0.45\linewidth}
        \centering
        \includegraphics[width=\linewidth]{example-image-duck}%{h.PNG} % second figure itself
        \caption{second figure}
    \end{minipage}
\end{figure}
\lipsum[2-7]

\end{document}

MWE 的结果是:

在此处输入图片描述

(红线表示页面布局)

从以上代码与您的代码的比较中可以看出,我将 替换\textwidth\linewidth,这考虑了列宽。这样可以将数字放在一列中。您还可以使用它\columnwidth来定义小页面的宽度。

编辑: 使用\textwidth使图像的宽度几乎等于列的宽度。因此,在ieeetran文档类中,它不能放在一列中。如果您确实想要如此宽的图像(从插入文档的点开始出现在下一页的顶部),那么您需要将上面的 MWE(最小工作示例)替换为figurefigure*在这种情况下,您将获得:

在此处输入图片描述

(红线表示页面布局)

附录: 从答案下面的 OP 评论中我得出结论,他对发送案例感兴趣,其中每个案例minipage都有两张图片:

在此处输入图片描述

\documentclass{ieeetran}
\usepackage{lipsum}
\usepackage{mwe}

\begin{document}
\lipsum[1]
\begin{figure*}[t]
    \centering
    \begin{minipage}{\columnwidth}
    \includegraphics[width=0.48\linewidth]{example-image-duck}
\hfill
    \includegraphics[width=0.48\linewidth]{example-image-duck}
        \caption{first figure}
    \end{minipage}\hfill
    \begin{minipage}{\columnwidth}
    \includegraphics[width=0.48\linewidth]{example-image-duck}
\hfill
    \includegraphics[width=0.48\linewidth]{example-image-duck}
        \caption{second figure}
    \end{minipage}
\end{figure*}
\lipsum[2-20]

\end{document}

相关内容