tags:

views:

3871

answers:

2

By default the "enumerate" environment is indented with respect to the current environment. How can I disable this indentation so that an enumerate environment of three items would produce the same output as the following piece of code?

\documentclass{article}
\begin{document}
  \paragraph{1.}
  \paragraph{2.}
  \paragraph{3.}
\end{document}
+2  A: 

Your best bet is probably to use either the mdwlist package or the enumlist package.

Or this website suggests the use of the list environment like this:

\begin{list}{\labelitemi}{\leftmargin=1em}
\item First item in the list
\item Second item
\item and so on
\end{list}

which suggests that you could redefine the length leftmargin in your enumeration if you prefer. Something like:

\newenvironment{flushenum}{
\begin{enumerate}
  \setlength{\leftmargin}{0pt}
}{\end{enumerate}}

which seems to work for me..

dmckee
A: 

I compiled the three suggested methods into one file to be able to compare them side by side. Note that \setlength{\leftmargin}{0pt} does not have any effect on the "enumerate" environment. So far, the best solution is the "list" environment using the option "\leftmargin=1.4em". However, I do not like a constant number in my code for it makes the code fragile. Does anyone know how to compute this constant (1.4em) in terms of available LaTeX variables?

\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}
reprogrammer
My test of the `\leftmargin` approach used the `newenvironemt` exhibited above, and did do the trick. I'm afraid You can do `\newlength{\enumindent}\setlength{\enumindent}{1.4em}` in the header to make it a named constant.
dmckee