如何获取正确缩进的自定义枚举列表(带有清单样式的空白)?

如何获取正确缩进的自定义枚举列表(带有清单样式的空白)?

我正在尝试制作一个如下所示的枚举清单:

    Paragraph text here that says really cool stuff. Notice how the list after is 
    properly indented

    ___ 1. Thing 1
    ___ 2. Thing 2
    ___ 3. Thing 3

    And the paragraph afterward, with good margins

这个(虽然很麻烦)已经很接近了,但由于某种原因,边缘变得混乱:

Paragraph text that says really cool stuff.

\begin{enumerate}
\item[\underline{\hspace{0.5in}} 1.]
\item[\underline{\hspace{0.5in}} 2.]
\item[\underline{\hspace{0.5in}} 3.]
\end{enumerate}

And the paragraph after.

输出如下所示:

    Paragraph text here that says really cool stuff. Notice how the list after is
    NOT PROPERLY INDENTED

___ 1. Thing 1
___ 2. Thing 2
___ 3. Thing 3

    And the paragraph after.

我摆弄了一下enumitem,但我也有同样的边距问题。你能告诉我我做错了什么吗?

答案1

我又尝试了enumitem一下。尝试一下

\documentclass{article}

\usepackage[textwidth=3in]{geometry} % so shorter lines wrap
\usepackage{enumitem}

\begin{document}

Some text - a long line so that it wraps and we see the paragraph
indentation

\begin{enumerate}[itemindent=0.5in,
label=\underline{\hspace{0.5in}}\arabic{*}.]
\item Thing 1
\item Thing 2
\item Thing 3
\end{enumerate}

More text, indented as the start of a paragraph. Long enough to wrap.

\end{document}

在此处输入图片描述

itemindent是硬编码,有点丑陋,并且在某些情况下可能不够强大。

您可以将其包装enumerate在您自己的环境中,以免剪切和粘贴项目选项。

相关内容