8

I want to create a list and have \vfill between all the items. Something like this:

\documentclass{article}

\begin{document}

\begin{itemize}
\item One \vfill
\item Two \vfill
\item Three \vfill
\item Four \vfill
\end{itemize}

\end{document}

which works, but would be more elegant if it was like this:

\documentclass{article}

\begin{document}

\renewcommand{\itemsep}{\vfill}
\begin{itemize}
    \item One
    \item Two
    \item Three
    \item Four
\end{itemize}

\end{document}

But I get errors (because \itemsep is a length?). So how can this be achieved? Further, I would want it only to affect the local environment, rather than globally for all such lists.

2
  • you may take a look at the enumitem package
    – Rico
    Jan 21, 2013 at 10:23
  • @Timebandit Thx for the suggestion. I tried itemsep=\vfill as an option but that didn't work. Perhaps this is just the same problem as the original, although a solution in enumitem might well be neater.
    – Geoff
    Jan 21, 2013 at 10:31

1 Answer 1

9
  1. \vfill is an instruction that, more or less, tells TeX to "finish the paragraph and insert blank space to fill".

  2. \itemsep is a rubber length parameter, so \renewcommand{\itemsep}{\vfill} is simply wrong.

  3. Also \setlength{\itemsep}{\vfill}, or the equivalent itemsep=\vfill with enumitem, is wrong, because \vfill isn't a rubber length specification.

Use

\setlength{\itemsep}{\fill}

or

itemsep=\fill

As explained in the LaTeX manual, \vfill does the same as

\par\vspace{\fill}

and, similarly but not quite, \hfill can be considered as an abbreviation for \hspace{\fill}.

If you want also an automatic \vfill at the end, I suggest you to define a new environment:

\documentclass{article}
\usepackage[pass,showframe]{geometry} % just to show the final effect

\usepackage{enumitem}

\newenvironment{fullpageitemize}
  {\itemize[nolistsep,itemsep=\fill]}
  {\vfill\enditemize}

\begin{document}

\begin{fullpageitemize}
    \item One
    \item Two
    \item Three
    \item Four
\end{fullpageitemize}

\end{document}

With nolistsep we remove all vertical space, then reset \itemsep to \fill; finally a \vfill is executed just at the end of the environment.

enter image description here

4
  • Thx for the explanation. Using \fill did give a positive reaction, but I would still like to have a fill at the final \item too. As it stands, your solution pushes the final \item directly to the bottom.
    – Geoff
    Jan 21, 2013 at 10:41
  • Actually, the first offered solution (\setlength{\itemsep}{\fill}) didn't work.
    – Geoff
    Jan 21, 2013 at 10:43
  • @Geoff The \setlength command must go after \begin{itemize} (just like enumitem does, essentially).
    – egreg
    Jan 21, 2013 at 10:44
  • Right you are! All the same, both solutions leave no \vfill space at the end.
    – Geoff
    Jan 21, 2013 at 10:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .