4

On the last few metres of typesetting a book I encountered a very nasty issue which I luckily managed to isolate in a MWE. The problem is that blockquotes patched with relsize to have a slightly reduced text size (next smaller "tex size" is too small for book format imho) leads to a diminished linespread in the preceding paragraph - if there is no empty line in the code before \begin{quote}.

Following MWE has more pronounced values to show the effect. Note the difference in the empty line in the code and the changed outcome for paragraph 1 and 2. With relsize of .9 (as in the real case) it's hardly visible.

Does this mean that the patching affects the preceding paragraph somehow? Seems like a bug since it only affects linespread and not text size.

Occurred with Texlive/Xetex but Overleaf/Latex produces the same problem. The problem seems to relate to the relsize part since I get a similar result with setspace/setstretch.

Some feedback on what went wrong would be appreciated, since I am a uneasy that issues like this might also happen in other instances, where I might not have noticed them yet.

enter image description here

\documentclass[fontsize=11.5pt,twoside]{scrreprt} 
\usepackage{blindtext}
\usepackage{etoolbox}
\usepackage{relsize}

\linespread{1.8} %for effect

\AtBeginEnvironment{quote}{\relscale{.3}} %smaller than real, also for effect

\begin{document}
    \subsection{problem}
\blindtext 

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

\end{document}
1

Your patch is wrong. You are adding the \relsize actually before the quote.

Try out

\AtBeginEnvironment{quote}{\relscale{.3}xxxxx}

to see what I mean.

Better use

\appto\quote{\relscale{.3}}
  • Thanks!! The \appto version works robustly! I think I was looking for a way to change the fontsize in quotes globally and found this solution on this board somewhere, which I also used for reducing the space around it a bit. Does "appto" also work for longtables, or do I need "apptocmd" for that? – Paul Burgh Jul 7 '18 at 15:53
  • Suitable patches depends on the command/environment you want to patch. There is no "will always work" command. – Ulrike Fischer Jul 7 '18 at 15:57
2

You need to end a paragraph when changing font size. If you don't, the \baselineskip which determines the line spacing will be incorrect for one or more sizes. This is because certain settings, including this one, are applied to paragraphs in their entirety and only when the paragraph ends. So the \baselineskip for all parts of a paragraph is determined by the \baselineskip currently active when the paragraph ends.

The problem can, therefore, be avoided by inserting some paragraph breaks. If you do not want actual paragraph breaks, use \noindent to avoid indentation of the first line.

\documentclass[fontsize=11.5pt,twoside]{scrreprt}% note that this means 12pt font is used
\usepackage{blindtext}
\usepackage{etoolbox}
\usepackage{relsize}

\linespread{1.8} %for effect - note that you really, really, really shouldn't do this like this

\AtBeginEnvironment{quote}{\relscale{.3}} %smaller than real, also for effect - note that the resulting sizes are larger than provided here

\begin{document}
\subsection{problem}
\blindtext 

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

\noindent\blindtext 

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

\noindent\blindtext

\end{document}

paragraph breaks fix line-spacing

If you really want to do things like this, you should read the relevant parts of KOMA's manual and use setspace as it advised. Moreover, you are requesting font sizes which aren't available. See the console or log for details and consider using scalable fonts. Any of the following will get you such fonts

\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{cfr-lm}
\usepackage{<other type1 font package>}
  • Thank you for your reply! I am using the Tex Gyre Pagella font, where it seemed to be the only solution I could find to get a noticably smaller, but not uncomfortably small size for blockquotes and tables, as was the requirement. Good to know that there is indeed a paragraph conflict - so \begin{quote} doesn't start a new paragraph? That was probably what I wondered about. – Paul Burgh Jul 7 '18 at 10:58
  • 1
    @PaulBurgh Not sure. I think \begin{quote} probably does, but \end{quote} doesn't. I just added paragraph breaks everywhere on the grounds that was easiest. (Two paragraph breaks are just the same as one, so it makes no odds if you add an extra blank line.) – cfr Jul 7 '18 at 11:41
  • Yeah, I had figured out that an empty line in the code did it but found it highly interesting that this would occur and that it would effect the preceding paragraph. Looks like there is no new paragraph at the beginning, but there is one at the end, since the effect disappears. Hm, lets go Jamiroquai and call it a Space(ing) Oddity. – Paul Burgh Jul 7 '18 at 12:25
  • As an afterthought: After quote needs a paragraph since leaving an empty line or not after it decides upon following indent if I'm not mistaken. – Paul Burgh Jul 7 '18 at 12:26
  • @PaulBurgh You could just look at the definition. – cfr Jul 7 '18 at 21:33

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.