[Tex/LaTex] Applying custom size and spacing to quote environment

line-spacingquoting

Am using "article" document class in LyX and trying to get the quote paragraph-environment to run with "small" text size and single-spacing (globally), while keeping the rest of the document (standard paragraph environment) with the default settings — default text size and double-spacing.

Have tried using the following in the LaTeX Preamble:

\let\oldquote\quote
\renewcommand\quote{\small\singlespacing\oldquote}

This almost works. The problem is that some paragraphs in the standard environment take on the singlespacing that I am trying to apply (exclusively) to the quote environment. How do I make sure that the singlespacing only applies to the quote environment?

Best Answer

Add the following to the preamble:

\expandafter\def\expandafter\quote\expandafter{\quote\small\singlespacing}

A complete example:

\documentclass{article}
\usepackage{setspace}
\usepackage{lipsum}

\expandafter\def\expandafter\quote\expandafter{\quote\small\singlespacing}
\doublespacing

\begin{document}

\lipsum[4]
\begin{quote}
\lipsum[4]
\end{quote}
\lipsum[4]

\end{document}

enter image description here

\expandafter<token1><token2> will be replaced by <token1> expansion of <token2> and <token1> won't be expanded until after <token2> gets expanded.

Related Question