列表中的条目为图形

列表中的条目为图形

我必须在列表中包含数字。当我准备这样的列表时,数字会显示在相应条目下方。我该如何纠正这个问题?数字作为编号列表中的条目

答案1

使用该subcaption包:

\documentclass[draft]{article}
\usepackage{graphicx}
\usepackage{subcaption}

\begin{document}
\section{Section Name}
    \begin{enumerate}
\item First item
    \begin{figure}[h]
    \centering
\begin{subfigure}[b]{0.3\linewidth}
    \centering
\includegraphics{1.png} 
\caption{}\label{subfig:1}
\end{subfigure}%
\hfil
\begin{subfigure}[b]{0.3\linewidth}
    \centering
\includegraphics{2.png}
\caption{}\label{subfig:2}
\end{subfigure}%
\end{figure}

\item Second item
    \begin{figure}[h]
    \ContinuedFloat
    \centering
\begin{subfigure}[b]{0.3\linewidth}
    \centering
\includegraphics{3.png}
\caption{}\label{subfig:3}
\end{subfigure}%
\hfil
\begin{subfigure}[b]{0.3\linewidth}
    \centering
\includegraphics{4.png}
\caption{}\label{subfig:4}
\end{subfigure}%
\end{figure}
    \end{enumerate}
\end{document}

在此处输入图片描述

答案2

我认为这不是完整的解决方案,但是是个很好的例子:

在此处输入图片描述

\documentclass{article}
 
\usepackage{graphicx}

\begin{document}
\section{Section Name}
\begin{enumerate}

\item First item
%\begin{center}
\begin{figure}[h]
\begin{minipage}[h]{0.49\linewidth}
\center{\includegraphics[width=0.5\linewidth]{1.png} \\ a)}
\end{minipage}
\hfill
\begin{minipage}[h]{0.49\linewidth}
\center{\includegraphics[width=0.5\linewidth]{2.png} \\ b)}
\end{minipage}
 
\end{figure}
%\end{center}

\item Second item
  %\begin{center}
\begin{figure}[h]
\begin{minipage}[h]{0.49\linewidth}
\center{\includegraphics[width=0.5\linewidth]{3.png} \\ c)}
\end{minipage}
\hfill
\begin{minipage}[h]{0.49\linewidth}
\center{\includegraphics[width=0.5\linewidth]{4.png} \\ d)}
\end{minipage}
\end{figure}
  %\end{center}
 
\end{enumerate}
\end{document}

答案3

您很可能将图像放置在figure允许浮动的环境中。您不必这样做;将图像设置在tabular- 以下是一些选项:

在此处输入图片描述

\documentclass{article}

\usepackage[export]{adjustbox}
\usepackage{enumitem}

\begin{document}

\begin{enumerate}[label=(\roman*)]
  \item
  \begin{tabular}{ c @{\qquad} c }
    \includegraphics[height=3\normalbaselineskip]{example-image-a} &
      \includegraphics[height=3\normalbaselineskip]{example-image-b} \\
    (a) $G_1$ &
      (b) $H_1$
  \end{tabular}

  \item \leavevmode
  
  \begin{tabular}{ c @{\qquad} c }
    \includegraphics[height=3\normalbaselineskip]{example-image-a} &
      \includegraphics[height=3\normalbaselineskip]{example-image-b} \\
    (a) $G_1$ &
      (b) $H_1$
  \end{tabular}
  
  \item
  \begin{tabular}[t]{ c @{\qquad} c }
    \includegraphics[height=3\normalbaselineskip,valign=t]{example-image-a} &
      \includegraphics[height=3\normalbaselineskip,valign=t]{example-image-b} \\[2.2\normalbaselineskip]
    (a) $G_2$ &
      (b) $H_2$
  \end{tabular}

  \item
  \begin{tabular}[t]{ c @{\qquad} c }
    \includegraphics[height=3\normalbaselineskip]{example-image-a} &
      \includegraphics[height=3\normalbaselineskip]{example-image-b} \\
    (a) $G_2$ &
      (b) $H_2$
  \end{tabular}

  \item
  \begin{tabular}[b]{ c @{\qquad} c }
    \includegraphics[height=3\normalbaselineskip]{example-image-a} &
      \includegraphics[height=3\normalbaselineskip]{example-image-b} \\
    (a) $G_2$ &
      (b) $H_2$
  \end{tabular}
\end{enumerate}

\end{document}

相关内容