如何禁用LaTeX列表项的缩进?

rep*_*mer 18 latex margin

默认情况下,"枚举"环境相对于当前环境缩进.如何禁用此缩进,以便三个项的枚举环境将生成与下面的代码相同的输出?

\documentclass{article}
\begin{document}
  \paragraph{1.}
  \paragraph{2.}
  \paragraph{3.}
\end{document}
Run Code Online (Sandbox Code Playgroud)

dmc*_*kee 12

您最好的选择可能是使用mdwlist包装enumlist包装.

或者这个网站建议使用这样的list环境:

\begin{list}{\labelitemi}{\leftmargin=1em}
\item First item in the list
\item Second item
\item and so on
\end{list}
Run Code Online (Sandbox Code Playgroud)

这表明leftmargin如果您愿意,可以重新定义枚举中的长度.就像是:

\newenvironment{flushenum}{
\begin{enumerate}
  \setlength{\leftmargin}{0pt}
}{\end{enumerate}}
Run Code Online (Sandbox Code Playgroud)

这似乎对我有用..


rep*_*mer 1

我将三种建议的方法编译到一个文件中,以便能够并排比较它们。注意\setlength{\leftmargin}{0pt}对环境没有任何影响enumerate。到目前为止,最好的解决方案是list使用选项的环境\leftmargin=1.4em。但是,我不喜欢代码中的常量,因为它会使代码变得脆弱。有谁知道如何1.4em根据可用的 LaTeX 变量来计算这个常数 ( ) ?

\documentclass{article}
\begin{document}

\section*{Paragraph}
\paragraph{1.} First
\paragraph{2.} Second
\paragraph{3.} Third

\section*{list}

\newcounter{itemcounter}
\begin{list}
{\textbf{\arabic{itemcounter}.}}
{\usecounter{itemcounter}\leftmargin=1.4em}
\item First
\item Second
\item Third
\end{list}

\section*{enumerate with leftmargin}
\begin{enumerate}
\renewcommand{\labelenumi}{\textbf{\theenumi}.}
\setlength{\leftmargin}{0pt}
\item First
\item Second
\item Third
\end{enumerate}

\end{document}
Run Code Online (Sandbox Code Playgroud)