Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

When I use the quotation environment at the start of a section I get too much space between the title and the start of the quotation. How to modify spacing around quotation environment? has ways to set the spacing manually, which is 0, but I'd rather LaTeX handle the spacing for me, as I am not sure how much to put.

So I started with this

\documentclass[12pt,letterpaper]{article}
\usepackage{setspace}           %Allows double spacing with the \doublespacing command

\begin{document}
\doublespacing

\section{Too much space}
\singlespacing 
\begin{quotation} 
    \noindent Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
\end{quotation}

\doublespacing
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."

\section{The right spacing}
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

\end{document}

And I really like the output, except for the giant space between the title and the quotation.

I tried one of the answers from the last question, but it kills all the whitespace, so I put in \baselineskip instead of 0, but that doesn't seem to work.

\documentclass[12pt,letterpaper]{article}
\usepackage{setspace}           %Allows double spacing with the \doublespacing command

\makeatletter
\renewenvironment{quotation}
               {\list{}{\listparindent=0pt%whatever you need
                        \itemindent    \listparindent
                        \leftmargin=0pt%  whatever you need
                        \rightmargin=10pt%whatever you need
                        \topsep=\baselineskip%%%%%  whatever you need
                        \parsep        \z@ \@plus\p@}%
                \item\relax}
               {\endlist}
\makeatother


\begin{document}
\doublespacing

\section{Too much space}
\singlespacing 
\begin{quotation} 
    \noindent Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
\end{quotation}

\doublespacing
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."

\section{The right spacing}
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

\end{document}

But as you can see if you compile that (I'm not sure how to put in images of the output) the spacing is the large at both the top and bottom of the environment.

And yes, I know double spacing is horrible, but the essay must be double spaced so the TA can write in comments.

Edit: I just found out that I should be using quote, not quotation, but it gives the same problem.

share|improve this question
add comment

2 Answers

up vote 6 down vote accepted

Add code to quotation based on the fact that after a section the switch \if@nobreak is true:

\usepackage{etoolbox}
\makeatletter
\AtBeginEnvironment{quotation}{\if@nobreak\vspace*{-\topskip}\fi\singlespacing}
\makeatother

Now you don't have to issue \doublespacing after quotation, because the environment will keep the single spacing confined into it.

It seems to work right even when the section falls near the bottom of a page.

Using lockstep suggestion you can also say

\usepackage{etoolbox}
\BeforeBeginEnvironment{quotation}{\begin{singlespace*}}
\AfterEndEnvironment{quotation}{\end{singlespace*}}
share|improve this answer
    
Will that still work if I use 'quote' instead of 'quotation'? –  Canageek Nov 11 '11 at 22:56
    
@Canageek Do a similar trick with quote replacing quotation; they are different environments. –  egreg Nov 11 '11 at 22:59
    
Yes, yes it does. Thank you very much. –  Canageek Nov 11 '11 at 22:59
    
I like the spacing in the first one better: Is the collapsed spacing in the second more typographically correct? –  Canageek Nov 11 '11 at 23:12
    
@egreg: To achieve the same spacing as in my answer, \BeforeBeginEnvironment and \AfterEndEnvironment is appropriate. –  lockstep Nov 11 '11 at 23:28
add comment

According to the setspace documentation (part of setspace.sty), the singlespace* environment "is reported to give improved vertical spacing around itemize and quote environments".

\documentclass[12pt,letterpaper]{article}

\usepackage[doublespacing]{setspace}

\begin{document}

\section{The modified (and hopefully right) spacing}

\begin{singlespace*} 
\begin{quotation} 
    \noindent Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
\end{quotation}
\end{singlespace*}

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."

\section{The right spacing}
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

\end{document}

enter image description here

share|improve this answer
    
I'd probably use that if I didn't have the other answer: It however appears to put less space before the start of the text then normal, which, while better, doesn't seem as pleasing to me. –  Canageek Nov 11 '11 at 23:07
    
@Canageek: The amount of space that should be put between single-spaced and double-spaced text parts is largely a matter of taste -- I only wanted to highlight setspaces "internal" solution. –  lockstep Nov 11 '11 at 23:10
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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