Text FormattingVertical Space around "quote" Environment

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
bobjones
Posts: 2
Joined: Mon Feb 06, 2012 5:05 pm

Vertical Space around "quote" Environment

Post by bobjones »

I haven't found any threads exactly on topic here, though my issue does relate to an unresolved problem mentioned at the end of this thread:

http://www.latex-community.org/forum/vi ... =44&t=7449

Basically, I am required to have a double-spaced document, but all the block quotations should have tighter spacing. I have tried a simple addition to the "quote" environment, such as:

Code: Select all

\let\oldquote=\quote
\let\oldendquote=\endquote
\renewenvironment{quote}
   {\oldquote\OnehalfSpacing}
   {\oldendquote}
(The reason for the caps in the \OnehalfSpacing command is because I'm using the Memoir class. I've also tried it with the standard setspace commands using a different document class, and I get similar results.)

This fixes the spacing within the quote environment, but it causes uneven spacing in the vertical whitespace above and below the block quote. In this case, the vertical space is greater after the block quote. But when I've tried varying the spacing of the main text and the block quotes (e.g., single spacing in main text, 1.5 spacing in quotes), I've gotten inconsistent results -- sometimes the space below is wider and sometimes it is narrower.

I don't much care about the exact size of the vertical space before and after a quote environment, but I do want it to be equal above and below.

How can I get the vertical spaces around the quote to be the same?

Minimal example with Memoir follows:

Code: Select all

\documentclass{memoir}
\usepackage[english]{babel}
\usepackage{blindtext}

\DoubleSpacing

\let\oldquote=\quote
\let\oldendquote=\endquote
\renewenvironment{quote}
   {\oldquote\OnehalfSpacing}
   {\oldendquote}

\begin{document}
  \blindtext
  \begin{quote}
    \blindtext
  \end{quote}
  \blindtext
\end{document}
Minimal example using setspace follows:

Code: Select all

\documentclass{book}
\usepackage[english]{babel}
\usepackage{blindtext}
\usepackage{setspace}

\doublespacing

\let\oldquote=\quote
\let\oldendquote=\endquote
\renewenvironment{quote}
   {\oldquote\onehalfspacing}
   {\oldendquote}

\begin{document}
  \blindtext
  \begin{quote}
    \blindtext
  \end{quote}
  \blindtext
\end{document}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

rdonohoe
Posts: 3
Joined: Fri Sep 09, 2011 5:33 pm

Re: Vertical Space around "quote" Environment

Post by rdonohoe »

Any solution found for this? I have the exact same issue. I have 1.5 spacing in the body and need to make the quotes single spacing and footnotesize but when I edit the memoir file I get a huge whitespace after the quote block.

Any help would be great!
bobjones
Posts: 2
Joined: Mon Feb 06, 2012 5:05 pm

Vertical Space around "quote" Environment

Post by bobjones »

I did find a workaround for this problem, if others still have it. Perhaps there's a more elegant solution available from someone who knows LaTeX inner workings in more detail.

Basically, my workaround is just appending some negative vertical space to the end of the quote environment, modifying my original redefinition as follows:

Code: Select all

\DoubleSpacing

\let\oldquote=\quote
\let\oldendquote=\endquote
\renewenvironment{quote}
   {\oldquote\OnehalfSpacing}
   {\oldendquote\vspace{-0.5em}}
One could tweak the amount of vspace (here -0.5em) as needed. In my scenario -- going from double spaced to a 1.5 spaced quote environment -- I think what's happening is that the additional leading (whether 1.5 spacing or double) is added ABOVE each text line.

That is, the output is something like the following. (Note that in LaTeX, an "em" seems to be defined as a square space equal in height and width to the point size, i.e., the nominal height, of the font.)

Code: Select all

[1 EM SPACE]
Here are double-
[1 EM SPACE]
spaced lines.
     [BEGIN QUOTE SPACE]
     [0.5 EM SPACE]
     Here are one-and-a-half-
     [0.5 EM SPACE]
     spaced lines.
     [END QUOTE SPACE]
[1 EM SPACE]
Here are double-
[1 EM SPACE]
spaced lines.
Even if the paragraph spaces (here labeled "QUOTE SPACE") surrounding the beginning and the end of the quote block are the same, there will be a larger gap after the quote. The "double-spacing" appears to insert additional vertical space before the first line of the last paragraph.

(I don't know for sure that this is what's happening -- perhaps someone more knowledgeable about LaTeX internals will know.)

Since my quote blocks are reduced from double-spaced (i.e., 1 em vertical space between lines) to 1.5-spaced (i.e., 0.5 em vertical space between lines), subtracting 0.5 em after the quote environment seems to do the trick. Again, there's probably a more elegant way to achieve equal spacing here.

I haven't tested this for other spacing combinations, but it makes sense and appears to solve my issue. Note that if you're dealing with single-spacing, that's NOT the same as ZERO em between lines -- usually, you still have about 0.2 em as default in LaTeX, depending on font size. This link has some further details in the answers:

http://tex.stackexchange.com/questions/ ... r-as-it-is
cmcork3
Posts: 1
Joined: Thu Oct 18, 2018 9:45 pm

Vertical Space around "quote" Environment

Post by cmcork3 »

When dealing with how to create equal space above and below a quote environment in Memoir, when the quoted material is single-spaced but the main text is double-spaced, I found that this works:

Code: Select all

\begin{Spacing}{1}
\begin{quote}
% text to be quoted
\end{quote}
\end{Spacing}\noindent
Some variation on this may resolve the other issues.
Post Reply