11

How can i remove space before enumerate?

% before \begin{document}
\usepackage{enumerate}

This is first line and i need to remove space between this line and item list below it.

% after \begin{document}
\begin{enumerate}[-]
 \item asdasd
 \item dsfdsf
\end{enumerate}
lockstep
  • 250,273
manish
  • 9,111

2 Answers2

9

This is easiest to do with the enumitem package. You can either specify topsep=0pt or probably better nosep which will also reduce the vertical spacing between items:

Sample output

\documentclass{article}

\usepackage[shortlabels]{enumitem}

\begin{document}
This is first line and i need to remove space between this line and
item list below it.
\begin{enumerate}[-,topsep=0pt]
\item asdasd
\item dsfdsf
\end{enumerate}

This is first line and i need to remove space between this line and
item list below it.
\begin{enumerate}[-,nosep]
\item asdasd
\item dsfdsf
\end{enumerate}

\end{document}

To set such an option globally, use \setlist:

\documentclass{article}

\usepackage[shortlabels]{enumitem}
\setlist[enumerate]{nosep}

\begin{document}
This is first line and i need to remove space between this line and
item list below it.
\begin{enumerate}[-]
\item asdasd
\item dsfdsf
\end{enumerate}

\end{document}

enumitem with the shortlabels option essentially reproduces the behaviour of the enumerate package.

Andrew Swann
  • 95,762
5

some what similar question had been asked before: Vertical space in lists a possible idea could be if you want to use enumerate:

\documentclass[12pt]{report}
\usepackage{paralist}
  \let\itemize\compactitem
  \let\enditemize\endcompactitem
  \let\enumerate\compactenum
  \let\endenumerate\endcompactenum
  \let\description\compactdesc
  \let\enddescription\endcompactdesc
  \pltopsep=1pt
  \plitemsep=1pt
  \plparsep=1pt

\begin{document}
This is the first line
\begin{enumerate}
 \item asdasd
 \item dsfdsf
 \item fajfaf
\end{enumerate}
\end{document}

With this code result is: enter image description here

You can change the vertical length by :

\pltopsep=1pt
Umz
  • 664