将图形以这种格式放置在乳胶中

将图形以这种格式放置在乳胶中

在此处输入图片描述如何以这种格式放置图形??

a                          - a

 b                          - b

 c                          - c

 figure1Name               -  figure2Name    

答案1

使用minipage

\documentclass[10pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\begin{document}
    \begin{figure}
        \centering
        \begin{minipage}{0.45\textwidth}
            \centering
            \includegraphics[height=3cm]{example-image-a}\\
            a.
        \end{minipage}\hfill
        \begin{minipage}{0.45\textwidth}
            \centering
            \includegraphics[height=3cm]{example-image-a}\\
            a.
        \end{minipage}
    \end{figure}
    \begin{figure}
        \centering
        \begin{minipage}{0.45\textwidth}
            \centering
            \includegraphics[height=3cm]{example-image-b}\\
            b.
        \end{minipage}\hfill
        \begin{minipage}{0.45\textwidth}
            \centering
            \includegraphics[height=3cm]{example-image-b}\\
            b.
        \end{minipage}
        \end{figure}
        \begin{figure}
            \centering
            \begin{minipage}{0.45\textwidth}
                \centering
                \includegraphics[height=3cm]{example-image-c}\\
                c.
            \end{minipage}\hfill
            \begin{minipage}{0.45\textwidth}
                \centering
                \includegraphics[height=3cm]{example-image-c}\\
                c.
            \end{minipage}
        \end{figure}
\end{document}

你有这个:

测试

答案2

使用以下subfloat包中的环境的替代解决方案:subfigminipage

\documentclass[10pt,a4paper]{article}
\usepackage{subfig}
\usepackage{graphicx}

\usepackage{showframe}% for showing page layout only, in real use it had to be removed

\begin{document}
    \begin{figure}[htb]
    \centering
\begin{minipage}[t]{0.5\textwidth}
    \centering
\subfloat[]{\includegraphics[width=0.9\linewidth]{example-image-a}}\\
\subfloat[]{\includegraphics[width=0.9\linewidth]{example-image-b}}\\
\subfloat[]{\includegraphics[width=0.9\linewidth]{example-image-c}}
\caption{my first figure}
\end{minipage}%
\begin{minipage}[t]{0.5\textwidth}
    \centering
\subfloat[]{\includegraphics[width=0.9\linewidth]{example-image-a}}\\
\subfloat[]{\includegraphics[width=0.9\linewidth]{example-image-b}}\\
\subfloat[]{\includegraphics[width=0.9\linewidth]{example-image-c}}
\caption{my second figure}
\end{minipage}
    \end{figure}
\end{document}

在此处输入图片描述

此外,subfloat您还可以使用subfigure包中的subcaption。 它更强大,但需要稍微多一点的代码,例如:

\begin{subfigure}[t]{\linewidth}
\centering
\includegraphics[width=0.9\linewidth]{example-image}
\end{subfigure}

在这两种情况下,您都可以根据自己的喜好添加子标题。以上使用的是默认预设。有关详细信息,请参阅这些软件包的文档以及软件包caption

相关内容