3

This:

\documentclass{memoir}

\nonzeroparskip

\tightlists

% \usepackage{enumitem}
% \setlist{nosep}

\begin{document}
Lorem ipsum dolor sit amet, consectetuer
adipiscing elit. Ut purus elit, vestibulum ut, placerat ac,
adipiscing vitae, felis.

Nulla malesuada porttitor diam. Donec felis
erat, congue non, volutpat at, tincidunt tristique, libero. Vivamus
viverra fermentum felis.
\begin{itemize}
\item Proin fermentum massa ac quam.
\item Sed diam turpis, molestie vitae, placerat a, molestie nec, leo.
\item Maecenas lacinia.
\end{itemize}
Nam ipsum ligula, eleifend at, accumsan nec, suscipit a, ipsum. Morbi
blandit ligula feugiat magna.
\end{document}

produces extra vertical space in the list (both before and after the list and between the items). Uncommenting the enumitem stuff kills the space between the items, but not before and after the list.

I'd like to have no extra vertical space in lists, preferably with enumitem (I use it to define new lists conveniently). How to do it?

  • I don't know whether you will be happy with this but you can use before and after keys provided by enumitem\setlist{nosep,before=\vspace{-0.5\baselineskip},after=\vspace{-0.5\baselineskip}} – user11232 Nov 11 '14 at 23:08
  • How about, as a starting point \usepackage{enumitem} % Set packed items? \setitemize{noitemsep,topsep=0pt,parsep=0pt,partopsep=0pt} – katang Jan 1 '15 at 23:00
1

The paragraph and lists chapter of the memoir user guide talks about the use of \tightlist. I successfully applied the \tightlist declaration inside of the document.

\documentclass{memoir}
\begin{document}

  \tightlist
  \begin{enumerate}
    \item Read this a little...
    \item ...bit easier
  \end{enumerate}

\end{document}

According the help you can also apply it within a specific list environment -- which I have not tried.

  • I would also add that your spacing can be impacted by the typesetting of the page.. but in a full page the above MWE application of \tightlist should work. – Jim D Jan 12 '16 at 23:29
  • Unfortunately, this does not answer the question for two reasons. (1) Your answer does not account for the memoir command \nonzeroparskip. (2) Moreover, \tightlist and \firmlist are meant to be used within the list environment, while \tightlists and \firmlists are meant to be used to affect all lists after the command is used. – jon Jan 13 '16 at 4:44
1

@HarishKumar suggested the easiest way to fix the problem. It approximates what \nonzeroparskip does (which is slightly more flexible). However, if you want to avoid using enumitem, then you could do this:

\documentclass{memoir}

\makeatletter
% memoir.cls has these two commands:
% \newcommand*{\abnormalparskip}[1]{%
%   \setlength{\parskip}{#1}\m@mabparskip=#1\relax
%   \m@mnzpskiptrue}

% \newcommand*{\nonzeroparskip}{\abnormalparskip{%
%   0.5\baselineskip
%   \@plus .1\baselineskip \@minus .1\baselineskip% NTG
% %%  0.5/baselineskip \@plus 2pt% RF
% }}

% Create a length that negates/removes the value of \abnormalparskip
\newlength{\rmnonzeroparskip}
\setlength{\rmnonzeroparskip}{%
  \dimexpr-0.5\baselineskip \@plus .1\baselineskip \@minus .1\baselineskip\relax}
% Create a macro that uses the above length
\newcommand*{\removenzps}{\vspace*{\rmnonzeroparskip}}
\makeatother
\tightlists
\nonzeroparskip

% etoolbox allows us to hook into environments
\usepackage{etoolbox}
\AtBeginEnvironment{itemize}{\traditionalparskip}
\AfterEndEnvironment{itemize}{\removenzps}
%\AfterEndEnvironment{itemize}{\vspace*{-0.5\baselineskip}} % <-- this is similar to Harish Kumar's suggestion


\begin{document}
Lorem ipsum dolor sit amet, consectetuer
adipiscing elit. Ut purus elit, vestibulum ut, placerat ac,
adipiscing vitae, felis.


Nulla malesuada porttitor diam. Donec felis
erat, congue non, volutpat at, tincidunt tristique, libero. Vivamus
viverra fermentum felis.
\begin{itemize}
\item Proin fermentum massa ac quam.
\item Sed diam turpis, molestie vitae, placerat a, molestie nec, leo.
\item Maecenas lacinia.
\end{itemize}
Nam ipsum ligula, eleifend at, accumsan nec, suscipit a, ipsum. Morbi
blandit ligula feugiat magna.

Nam ipsum ligula, eleifend at, accumsan nec, suscipit a, ipsum. Morbi
blandit ligula feugiat magna.

\end{document}

Or, if you want to use enumitem (which I normally recommend), but would rather stick to the (default) value set by \nonzeroparskip, then you could do this:

\documentclass{memoir}

\makeatletter

\newlength{\rmnonzeroparskip}
\setlength{\rmnonzeroparskip}{%
  \dimexpr-0.5\baselineskip \@plus .1\baselineskip \@minus .1\baselineskip\relax}
\makeatother

\tightlists
\nonzeroparskip

\usepackage{enumitem}
% \setlist{nosep,  before=\vspace{-0.5\baselineskip}, after=\vspace{-0.5\baselineskip}} % <-- similar to what Harish Kumar suggested
\setlist{nosep,
% here we just use the length, not the subsequent macro
 before={\vspace{\rmnonzeroparskip}}, after=\vspace{\rmnonzeroparskip}}


\begin{document}
Lorem ipsum dolor sit amet, consectetuer
adipiscing elit. Ut purus elit, vestibulum ut, placerat ac,
adipiscing vitae, felis.


Nulla malesuada porttitor diam. Donec felis
erat, congue non, volutpat at, tincidunt tristique, libero. Vivamus
viverra fermentum felis.
\begin{itemize}
\item Proin fermentum massa ac quam.
\item Sed diam turpis, molestie vitae, placerat a, molestie nec, leo.
\item Maecenas lacinia.
\end{itemize}
Nam ipsum ligula, eleifend at, accumsan nec, suscipit a, ipsum. Morbi
blandit ligula feugiat magna.

Nam ipsum ligula, eleifend at, accumsan nec, suscipit a, ipsum. Morbi
blandit ligula feugiat magna.

\end{document}

Note also that it is better in memoir to declare \tightlists before \nonzeroparskip.

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.