21

I use this code:

\begin{quote}
my quote
\end{quote}

I want to set it to singlespacing although the rest of the text ist formated with oneandahalfspacing. i also want to set the font size. How can I do this?

  • What's the font size in the main document, and which font size do you want to use inside quote environments? – Mico Aug 20 '16 at 13:36
  • In the main text it is 12p and in the quote it should be 11p. – texNewbie Aug 20 '16 at 13:37
20

Assuming you use the setspace package and the instruction \onehalfspacing to modify the line spacing of the document, you may achieve your objective by including the following instructions in the preamble:

\usepackage{etoolbox}
\AtBeginEnvironment{quote}{\singlespacing\small}

In the document classes I'm familiar with, if the main document font size is 12pt, the instruction \small switches to 11pt as the font size.

A full MWE (minimum working example):

enter image description here

\documentclass[12pt]{article}
\usepackage{lipsum}   % for filler text
\usepackage{setspace} % for \onehalfspacing and \singlespacing macros
\onehalfspacing 

\usepackage{etoolbox}
\AtBeginEnvironment{quote}{\singlespacing\small}

\begin{document}
\lipsum[2]  % filler text
\begin{quote}
\lipsum[2]
\end{quote}
\lipsum[2]
\end{document}
5

You can do that with the etoolbox package:

 \documentclass[12pt]{book}
\usepackage{setspace}
\usepackage{lipsum}
\usepackage{etoolbox}
\AtBeginEnvironment{quote}{\singlespace\vspace{-\topsep}\small}
\AtEndEnvironment{quote}{\vspace{-\topsep}\endsinglespace}

\onehalfspacing

\begin{document}

\lipsum[1]
\begin{quote}
\lipsum[2]
\end{quote}

\lipsum[3]

\end{document} 

enter image description here

3

Since this is the first result I got when I Googled "latex block quote", I thought I'd mention the csquotes package I found via this Overleaf article. Seems to do about the same thing, just not the font resizing the OP asked for.

\documentclass[12pt]{book}
\usepackage[english]{babel}
\usepackage{csquotes}
\usepackage{lipsum}

\begin{document}

\lipsum[1]

\begin{displayquote}
\lipsum[2]
\end{displayquote}

\lipsum[3]

\end{document} 

... gets you this....

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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