缩进段落以与枚举环境水平对齐

缩进段落以与枚举环境水平对齐

我有一个包含要点的枚举列表,每个要点都附有评论。我想将我的评论与枚举列表中的逐项要点垂直对齐。下面是 MWE 及其输出。

\documentclass{article}
\usepackage{enumitem}
\begin{document}
\begin{enumerate}[align=left, label=\large{\textbf{\arabic*}}]
    \item Here is my first point.
\end{enumerate}
\textbf{C:} Here is my comment to the first point.
\begin{enumerate}[resume, align=left, label=\large{\textbf{\arabic*}}]
    \item Here is my second point.
\end{enumerate}
\textbf{C:} Here is my comment to the second point.
\end{document}

在此处输入图片描述

我想要的输出将是这样的(忽略花括号):

1{ } 这是我的第一点。

C{ } 这是我对第一点的评论。

2{ } 这是我的第二点。

C{ } 以下是我对第二点的评论。


编辑:正如 David 和 Werner 所建议的:

\documentclass{article}
\usepackage{enumitem}
\newcommand{\citem}{\item[\textbf{C:}]}
\begin{document}
\begin{enumerate}[align=left, label=\large{\textbf{\arabic*}}]
    \item Here is my first point.
    \citem Here is my comment to the first point.
    \item Here is my second point.
    \citem Here is my comment to the second point.
\end{enumerate}
\end{document}

在此处输入图片描述

答案1

只需使用单一enumerate环境并用于\item[C:]您的评论。

答案2

一种可能的解决方案是定义一个类似列表的环境,并为评论提供适当的设置:

\documentclass{article}
\usepackage{enumitem}

\newlist{mycomm}{enumerate}{1}
\setlist[mycomm]{align=left,label=\bfseries C:}
\newcommand\mycomment[1]{%
  \begin{mycomm}\item#1\end{mycomm}}

\begin{document}
\begin{enumerate}[align=left, label=\large\bfseries\arabic*]
    \item Here is my first point.
\end{enumerate}
\mycomment{Here is my comment to the first point.}
\begin{enumerate}[resume*]
    \item Here is my second point.
\end{enumerate}
\mycomment{Here is my comment to the second point.}

\end{document}

在此处输入图片描述

请注意,\large不带参数。使用时resume*您不必再次指定以前的设置。

相关内容