![间距和换行](https://linux22.com/image/346547/%E9%97%B4%E8%B7%9D%E5%92%8C%E6%8D%A2%E8%A1%8C.png)
我想按照以下格式写几行。例如:
This is my request for better writing:
a. I want to break the first line in a the next few words and
to continue here for next few more words.
b. I want to break the first line in a the next few words and
to continue here for next few more words.
c. I want to break the first line in a the next few words and
to continue here for next few more words.
我希望行号“a”在几个空格后开始。当相应的行中断时,它应该在它开始的第一个单词下继续,例如在行 a(以“I”开头,I 下的单词是 to... b 和 c 也需要相同的行为。
有人可以帮忙解决吗?
答案1
听起来你正在寻找环境enumerate
。你可以使用enumitem 包。您可以用 来断行,\\
或者用一个空行或 来开始一个新段落\par
。
编辑leftmargin
:您可以使用、itemindent
、和键自定义水平间距,labelindent
请参阅labelwidth
labelsep
enumitem 包文档。
\documentclass{article}
\usepackage[showframe]{geometry}% display page margins to make effect of leftmargin better visible
\usepackage{enumitem}% to customize enumerate/itemize/description
\setlist[enumerate,0]{% global customization of enumerate environment, see page 9 of enumitem package documentation.
label=\alph*.,
leftmargin=1cm,
}
% a custom command to save some typing, displays the value of a dimension in a table
\newcommand{\displaydimension}[1]{#1 & \the\csname #1\endcsname \\}
\begin{document}
\begin{enumerate}
\item you can \\
break a line
\item and you can \par
start a new paragraph
\item current values for horizontal spacing:
\begin{tabular}[t]{@{}ll@{}}
\displaydimension{leftmargin}
\displaydimension{itemindent}
\displaydimension{labelindent}
\displaydimension{labelwidth}
\displaydimension{labelsep}
\end{tabular}
\[ \texttt{leftmargin} + \texttt{itemindent} = \texttt{labelindent} + \texttt{labelwidth} + \texttt{labelsep} \]
\hfill\scriptsize (according to \texttt{enumitem} package documentation page~4)
\end{enumerate}
\end{document}
请注意,屏幕截图上的值不是默认值,而是leftmargin=1cm
源代码中显示的。默认值为leftmargin=25.00003pt
。
答案2
我不知道您是否希望使用等宽字体,还是使用普通文本。对于后者,请查看枚举和列表:
\documentclass{article}
\usepackage{enumitem} % for resizing spaces in enumeration
\setlist{parsep=0pt,
itemsep=0pt,
%topsep=0pt
}
\usepackage{blindtext}
\renewcommand{\theenumi}{\alph{enumi}}
\begin{document}
Some Text. \blindtext
\begin{enumerate}
\item Test 1
\item Test 2
\end{enumerate}
More text. \blindtext
\end{document}
我使用将renewcommand
枚举从 1.、2.、.. 更改为 a.、b.、...,如有必要,还请参阅如何更改“枚举”列表格式以使用字母而不是默认的阿拉伯数字?