4

In the article class I have this section of code

\if@twocolumn
  \setlength\leftmargini  {2em}
\else
  \setlength\leftmargini  {2.5em}
\fi
\leftmargin  \leftmargini
\setlength\leftmarginii  {2.2em}
\setlength\leftmarginiii {1.87em}
\setlength\leftmarginiv  {1.7em}
\if@twocolumn
  \setlength\leftmarginv  {.5em}
  \setlength\leftmarginvi {.5em}
\else
  \setlength\leftmarginv  {1em}
  \setlength\leftmarginvi {1em}
\fi
\setlength  \labelsep  {.5em}
\setlength  \labelwidth{\leftmargini}
\addtolength\labelwidth{-\labelsep}
\@beginparpenalty -\@lowpenalty
\@endparpenalty   -\@lowpenalty
\@itempenalty     -\@lowpenalty
\renewcommand\theenumi{\@arabic\c@enumi}
\renewcommand\theenumii{\@alph\c@enumii}
\renewcommand\theenumiii{\@roman\c@enumiii}
\renewcommand\theenumiv{\@Alph\c@enumiv}
\newcommand\labelenumi{\theenumi.}
\newcommand\labelenumii{(\theenumii)}
\newcommand\labelenumiii{\theenumiii.}
\newcommand\labelenumiv{\theenumiv.}
\renewcommand\p@enumii{\theenumi}
\renewcommand\p@enumiii{\theenumi(\theenumii)}
\renewcommand\p@enumiv{\p@enumiii\theenumiii}
\newcommand\labelitemi{\textbullet}
\newcommand\labelitemii{\normalfont\bfseries \textendash}
\newcommand\labelitemiii{\textasteriskcentered}
\newcommand\labelitemiv{\textperiodcentered}

that set the margins and type of items for the diferent list environments.

How can I modify this to obtain a first margin item equal to 0pt?

lockstep
  • 250,273
osjerick
  • 6,970

2 Answers2

7

To setup a list whether in an own document class, package or in the preamble I recommend the package enumitem which is really flexible.

If you avoid such package your must consult the reference manual source2e

Every environment like enumerate or itemize based on the environment list. The linked reference manual explained the length.

To visualize the length of the current environment you can use the package layouts which produced the following output:

enter image description here

Here the MWE which produced the picture above.

\documentclass[varwidth,border=10,convert]{standalone}
\usepackage{layouts}

\begin{document}
\drawdimensionstrue
\listdiagram
\end{document}
Marco Daniel
  • 95,681
2

Would this suit your needs? It sets the left margin to 0pt, meaning that the bullet or number goes into the margin. Aligning the bullet/number with the margin would be trickier (though perhaps a package can do it for you, I don't know).

\setlength\leftmargini{0em}

A MWE would then be something like:

\documentclass{article}

\setlength\leftmargini{0em}

\usepackage{lipsum}

\begin{document}

\lipsum[1]

\begin{enumerate}
\item My list 1
\item My list 2
\begin{enumerate}
    \item My nested item
\end{enumerate}
\end{enumerate}

\lipsum[2]

\begin{itemize}
\item My list 1
\end{itemize}

\lipsum[3]

\begin{description}
\item[Label] My list 1
\end{description}

\end{document}
ienissei
  • 6,223