# Inconsistent linespacing of main text around block quotes

I am facing a strange problem. In the main text of my document I have set the linespacing to 1.5 using the \usepackage[onehalfspacing]setspace . The main text has consistent linespacing, except around block quotes. Randomly before and after the block quotes, the linespacing of the main text is changing to something smaller. And even stranger is that in multiple compilation passes, this spacing seems to change. The picture below will perhaps help you understand what I mean.

I have only modified the quote environment to set a smaller and sf font. I have not modified linespacing anywhere else. With linespacing set to double using \usepackage[doublespacing]{setspace} this issue seems to go away and I am getting consistent double line spacing all across the document.

Any ideas on what is causing this?

I am not sure if I can post a MWE, as this is a large document ~600 pages with several packages included. I am using XeLaTeX for compilation.

Edit: this is the code that I have used for modifying the blockquote:

AtBeginEnvironment{quote}{\smaller}
\renewcommand{\sfdefault}{lmss}
\newfontfamily{\quotefont}{Linux Biolinum}
\let\quoteOld\quote
\let\endquoteOld\endquote
\renewenvironment{quote}{\quotefont\quoteOld}{\endquoteOld}


Now, commenting the first line, does create consistent line spacing. But how can I use a smaller font size in the quote environment, and not affecting the linespacing?

• Hard to say when you do not share the code that produce this. You'll have to make a copy of your project and reduce it down to show us some code we can test. My guess: incorrect use of font scaling commands, for example thinking that they take arguments. Again impossible to say without code – daleif Mar 29 '18 at 7:24
• line spacing is a property of the paragraph. This means that settings at the end of the paragraph can change the line spacing at the begin. It also means that if you didn't define your blockquote correctly its line spacing can change the line spacing of the text before the quote. – Ulrike Fischer Mar 29 '18 at 7:44
• you should leave a blank line before the quote, or you could begin the redefined quote environment with \par to ensure the proper line spacing in the preceding text. – barbara beeton Mar 29 '18 at 17:40

You have the definitions backwards. Let's see an example:

\documentclass{article}
\usepackage{etoolbox}
\usepackage{relsize}
\usepackage{setspace}
\usepackage{fontspec}

\usepackage{lipsum} % for mock text

\AtBeginEnvironment{quote}{\smaller}
\newfontfamily{\quotefont}{Linux Biolinum O}
\let\quoteOld\quote
\let\endquoteOld\endquote
\renewenvironment{quote}{\quotefont\quoteOld}{\endquoteOld}

\onehalfspacing

\begin{document}

\lipsum*[2]
\begin{quote}
\lipsum*[3]
\end{quote}
\lipsum*[4]

\end{document}


What's going wrong? That \smaller is issue before the \par emitted as part of \quoteOld, so the paragraph before the quote is typeset with the interline space pertaining to \smaller.

Solution: issue \smaller later.

\documentclass{article}
\usepackage{relsize}
\usepackage{setspace}
\usepackage{fontspec}

\usepackage{lipsum} % for mock text

\newfontfamily{\quotefont}{Linux Biolinum O}

\let\quoteOld\quote
\let\endquoteOld\endquote
\renewenvironment{quote}{\quoteOld\smaller\quotefont}{\endquoteOld}

\onehalfspacing

\begin{document}

\lipsum*[2]
\begin{quote}
\lipsum*[3]
\end{quote}
\lipsum*[4]

\end{document}


In my opinion you should define your own environment, rather than redefining quote.

• Thanks for the response! but strangely when the line spacing was set to double, the inconsistency in the linespacing disappears, at least I could not visually make out the difference as seen in the example above. Any ideas on why it should be so? – Damitr Mar 30 '18 at 8:47
• @Damitr I think that you just aren't able to tell the difference apart visually. – egreg Mar 30 '18 at 9:03