[OS X TeX] Re: Eliminate extra vertical space in enumerate? (Gary L. Gray)

Juan José Torrens jjtorrens at unavarra.es
Sun May 6 22:45:38 CEST 2012


> De: "Gary L. Gray" <glgray at me.com>
> Fecha: 6 de mayo de 2012 20:17:47 GMT+02:00
> Para: TeX on Mac OS X Mailing List <MacOSX-TeX at email.esm.psu.edu>
> Asunto: [OS X TeX] Eliminate extra vertical space in enumerate?
> Responder a: TeX on Mac OS X Mailing List <macosx-tex at email.esm.psu.edu>
> 
> 
> Hi All,
> 
> This is not a Mac specific question, but I thought I would venture here first.
> 
> In the solutions manual for my textbooks, the problem statement and accompanying figure for each solution is enclosed in a box at the top of the page. If the problem statements consists of nothing but an enumerate environment, then extra vertical space is placed between the beginning of the environment and the rule of the enclosing box above it. Is there some way that this space can be removed in the case for which the problem state is nothing but this environment? Appended is a short example that exhibits the behavior I am describing. Notice the white space above the enumerate environment that does not exist in the second framebox.
> 
> Thank you.
> 
> Gary
> 
> 
> \documentclass{article}
> \begin{document}
> 
> \framebox{%
> \parbox{\textwidth}{%
> \begin{enumerate}
> \item
> First item.
> \item
> Second item.
> \item
> Third item.
> \end{enumerate}%
> }}
> 
> \framebox{%
> \parbox{\textwidth}{%
> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin sollicitudin arcu quis leo molestie ut porttitor nibh ullamcorper. Duis quis urna nec mauris aliquet convallis.}}
> 
> \end{document}
> 

Hi Gary,

I would change your code as follows:

\documentclass{article}
\usepackage{enumitem}
\begin{document}

\noindent
\framebox[\textwidth]{%
\parbox{\dimexpr\textwidth-2\fboxrule-2\fboxsep}{%
\begin{enumerate}[topsep=0pt]
\item
First item.
\item
Second item.
\item
Third item.
\end{enumerate}%
}}

\noindent
\framebox[\textwidth]{%
\parbox{\dimexpr\textwidth-2\fboxrule-2\fboxsep}{%
Lorem ipsum dolor sit amet, consectetur adipiscing elit. 
Proin sollicitudin arcu quis leo molestie ut porttitor 
nibh ullamcorper. Duis quis urna nec mauris aliquet 
convallis.}}

\end{document}

The enumitem package is quite useful to customize list environments. Please note also that the boxes were too wide, so there were some warnings about that.

Regards

Juanjo

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/macostex-archives/attachments/20120506/0597b3c1/attachment.html>


More information about the macostex-archives mailing list