1

I use list environments for short text. In myitem environment I define new space between items. How I can reduce vertical space before first item? This space is bigger than between paragraphs.

 \documentclass[12pt]{article}
 \usepackage{lipsum}

 \newenvironment{myitem}{\begin{itemize}
    \setlength{\leftmargin}{-5.0cm}
    \setlength{\itemindent}{0.0cm}
    \setlength{\itemsep}{0pt}
     \setlength{\parskip}{0pt}
     \setlength{\parsep}{0pt}}     
     {\end{itemize}}

 \begin{document}
 \lipsum[1]
 \lipsum[2]
 \begin{myitem}
 \item lorem ipsum dolor  lorem ipsum dolor  lorem ipsum dolor  lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor 
 \item lorem ipsum dolor
 \item lorem ipsum dolor
 \item lorem ipsum dolor
 \end{myitem}
  \lipsum[3]
 \end{document}

enter image description here

  • 1
    There's always \vspace{negative length}... – Steven B. Segletes Jun 6 '14 at 9:46
  • 1
    \usepackage{enumitem}...\begin{itemize}[nosep]... – Andrew Swann Jun 6 '14 at 9:54
3

This is not easy to do directly and the best and simplest interface is the package enumitem. Here you can set-up mylist (I prefer that name to myitem) as a copy of itemize with maximum list depth 1, bullet labels, a specified leftmargin and no vertical spacing via:

\newlist{mylist}{itemize}{1}
\setlist[mylist]{label=\textbullet,leftmargin=1cm,nosep}

Sample output

\documentclass[12pt]{article}
\usepackage{lipsum,enumitem}

\newlist{mylist}{itemize}{1}
\setlist[mylist]{label=\textbullet,leftmargin=1cm,nosep}

\begin{document}
\lipsum[1]
\lipsum[2]
\begin{mylist}
\item lorem ipsum dolor lorem ipsum dolor lorem ipsum dolor lorem
  ipsum dolor lorem ipsum dolor lorem ipsum dolor
\item lorem ipsum dolor
\item lorem ipsum dolor
\item lorem ipsum dolor
\end{mylist}
\lipsum[3]

\end{document}
  • I add enumitem in preambula and definition of mylist. But when I compile my MWE, i receive error: Package keyval Error: nosep undefined \item – Ama Jun 6 '14 at 10:43
  • Make sure you have an up-to-date version of enumitem - this feature was introduced in version 3.4 - the current version is 3.5.2 or so. – Andrew Swann Jun 6 '14 at 13:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.