列表中的项目符号和数字缩进

列表中的项目符号和数字缩进

我想对列表进行自定义缩进:

  1. 项目符号或数字距左边距缩进 1.2 厘米
  2. 文本(所有行)距左边距缩进 1.8 厘米

我正在尝试使用该enumitem包。使用选项缩进文本很容易leftmargin,但我无法成功缩进项目符号/数字。我尝试了itemindent、和 的不同值labelindentlabelwidthlabelsep没有得到我想要的结果。

这是 MWE。

\documentclass{article}

\usepackage{enumitem}
\setlist{noitemsep, topsep=0pt, parsep=0pt, partopsep=0pt, leftmargin=1.8cm}

\begin{document}

\noindent Here is some text.

\begin{itemize}
    \item \( y_i = 1 \) if individual \( i \) is employed is employed is employed is employed is employed is employed is employed is employed is employed is employed,
    \item \( y_i = 2 \) if individual \( i \) is unemployed is unemployed is unemployed is unemployed is unemployed is unemployed is unemployed is unemployed,
    \item \( y_i = 3 \) if individual \( i \) is inactive is inactive is inactive is inactive is inactive is inactive is inactive is inactive is inactive.
\end{itemize}
\noindent \rule{1.2cm}{1pt}$\bullet$ \par
\noindent \rule{1.8cm}{1pt} \par

\begin{enumerate}
    \item \( y_i = 1 \) if individual \( i \) is employed is employed is employed is employed is employed is employed is employed is employed is employed is employed,
    \item \( y_i = 2 \) if individual \( i \) is unemployed is unemployed is unemployed is unemployed is unemployed is unemployed is unemployed is unemployed,
    \item \( y_i = 3 \) if individual \( i \) is inactive is inactive is inactive is inactive is inactive is inactive is inactive is inactive is inactive.
\end{enumerate}
\noindent \rule{1.2cm}{1pt}3 \par
\noindent \rule{1.8cm}{1pt} \par

\noindent Here is some text.

\end{document}

答案1

我使用了一些盒子来计算宽度:

在此处输入图片描述

\documentclass{article}

\usepackage{enumitem}% http://ctan.org/pkg/enumitem
\setbox1=\hbox{$\bullet$}
\setlist{noitemsep, topsep=0pt, parsep=0pt, partopsep=0pt, leftmargin=1.8cm, labelindent=1.2cm, labelwidth=\wd1, itemindent=*, labelsep=\dimexpr0.6cm-\wd1}

\begin{document}

\noindent Here is some text.

\begin{itemize}
    \item \( y_i = 1 \) if individual \( i \) is employed is employed is employed is employed is employed is employed is employed is employed is employed is employed,
    \item \( y_i = 2 \) if individual \( i \) is unemployed is unemployed is unemployed is unemployed is unemployed is unemployed is unemployed is unemployed,
    \item \( y_i = 3 \) if individual \( i \) is inactive is inactive is inactive is inactive is inactive is inactive is inactive is inactive is inactive.
\end{itemize}
\noindent \rule{1.2cm}{1pt}$\bullet$ \par
\noindent \rule{1.8cm}{1pt} \par

\setbox1=\hbox{1.}
\setlist{noitemsep, topsep=0pt, parsep=0pt, partopsep=0pt, leftmargin=1.8cm, labelindent=1.2cm, labelwidth=\wd1, itemindent=*, labelsep=\dimexpr0.6cm-\wd1}

\begin{enumerate}
    \item \( y_i = 1 \) if individual \( i \) is employed is employed is employed is employed is employed is employed is employed is employed is employed is employed,
    \item \( y_i = 2 \) if individual \( i \) is unemployed is unemployed is unemployed is unemployed is unemployed is unemployed is unemployed is unemployed,
    \item \( y_i = 3 \) if individual \( i \) is inactive is inactive is inactive is inactive is inactive is inactive is inactive is inactive is inactive.
\end{enumerate}
\noindent \rule{1.2cm}{1pt}3 \par
\noindent \rule{1.8cm}{1pt} \par

\noindent Here is some text.

\end{document}

enumitem 文档给出了长度的水平间距组成的图形。leftmargin由 4 个其他长度构成;或者您可以指定除一个之外的所有长度*,然后计算得出。请参阅3 有关水平间距的更多信息,第 5 页。显然,要准确找出哪些长度通向哪里可能很棘手......

在此处输入图片描述

相关内容