段落编号

段落编号

enter image description here

如何格式化如上所示的段落?数字 (1) 和 (a) 位于段落的侧面,而不会造成缩进?

任何帮助都将不胜感激!

答案1

您可以根据命令\llap获取左边距中的文本。通过更改{2em}定义来更改数字和段落之间的距离。\parskip\parindent设置只是在段落开头有一个空行,而不是缩进。这有助于看到数字不会影响文本。

\documentclass{article}
\parskip=1em
\parindent=0pt
\newcommand\ParNum[1]{\strut\llap{#1\rule{2em}{0pt}}\ignorespaces}
\begin{document}
First a normal paragraph.

\ParNum{1. (a)} The data, $y$, give time intervals (in seconds) between successive downloads of a new music video from a particular server. Blah blah blah.

\ParNum{2. (c)} This is a new paragraph.
\end{document}

enter image description here

答案2

像这样吗?

\documentclass[a4paper,11pt]{article}
\usepackage[showframe]{geometry}
\usepackage{enumitem}

\begin{document}

\begin{enumerate}[wide=0pt, label=\bfseries\arabic*.]\item \begin{enumerate}[wide=0pt, label=(\alph*)]
\item Example
Example example example example example example example example example
example example example example example example example example example example
example example example example example example example example example example
example example.

\item Another example. Another example, another example, another example, another example, another example, another example example, another example, another example, another example. \end{enumerate}
\end{enumerate}

\end{document}

enter image description here

或者这样,只需添加leftmargin=*到两个枚举选项中:

enter image description here

相关内容