0

I'm trying to change the fontsize of csquotes' blockquotes, but seem to be facing some unexpected hard-time.

I know csquotes uses an environment for that, which is by default quote, and can be set with \SetBlockEnvironment. And I do recall being able to use a "begin environment" hook on that single environment for this purpose. And I think I'm not going senile on this (yet), since I am able to find advice along these lines here on the site (e.g. https://tex.stackexchange.com/a/370024/105447 and https://tex.stackexchange.com/a/370027/105447).

However, this is currently not working (so, please consider this before flagging duplicate). A MWE to demonstrate:

\documentclass{article}

\usepackage{lipsum}

\usepackage{csquotes} \SetBlockEnvironment{quotation}

\AtBeginEnvironment{quotation}{\footnotesize\bfseries}

\begin{document}

\begin{quotation} \lipsum[1] \end{quotation}

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

\end{document}

enter image description here

My question here is then is: is this expected behavior? Has something changed in this regard with the new hook system?

If it is not expected, where should I report it: csquotes or latex?

If it is expected, what is the current best method to change font size for csquotes' block quotes? (including \blockquote and friends).

gusbrs
  • 13,740
  • displayquote essentially calls, with your setting, \quotation, not \begin{quotation}, so the hooks pertaining to the quotation environment are not applied. As far as I can see, your idea would have never worked. – egreg Jun 22 '21 at 14:38
  • Can you explain which output you want to see? I'm guessing you want quotation also to show in small and bold? I just checked with older versions of TeX Live on Overleaf and the output is always the same as shown in the screenshot. – moewe Jun 22 '21 at 14:42
  • Yes, moewe, that's what I'd expect to see. But, as you and @egred observed, the hypothesis I'm not senile on that memory yet, may well be wrong. :-) – gusbrs Jun 22 '21 at 14:49

2 Answers2

1

This has never worked, even if the etoolbox hook mechanism is used (so with LaTeX kernels prior to the 2020-10-01 release).

The problem is that \begin{displayquote} does \csuse{\csq@blockenvironment} (and similarly for \end{displayquote}), which in your case reduces to executing \quotation. Thus the hooks pertaining to the environment are not executed: they're triggered by \begin{quotation}.

You can solve the issue by patching the relevant commands to use \begin{\csq@blockenvironment} and \end{\csq@blockenvironment}.

\documentclass{article}

\usepackage{lipsum}

\usepackage{csquotes} \SetBlockEnvironment{quotation}

\AtBeginEnvironment{quotation}{\footnotesize\bfseries}

\makeatletter \patchcmd{\csq@bdquote}{\csuse}{\begin}{}{} \patchcmd{\csq@edquote}{\csuse{end\csq@blockenvironment}}{\end{\csq@blockenvironment}}{}{} \makeatother

\begin{document}

\begin{quotation} \lipsum[1] \end{quotation}

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

\end{document}

enter image description here

I fervently hope that \bfseries is used only by way of example.

egreg
  • 1,121,712
  • Probably my memory has failed me this time. About "I fervently hope that \bfseries is used only by way of example." Yes, of course!, and \footnotesize too. :-) Thank you very much! But, even though your answer gets the job (well) done, I think moewe's got a point with \mkbegdispquote as a more "user level" handle for the purpose. – gusbrs Jun 22 '21 at 14:59
1

I'd look into using official csquotes hooks for these kinds of things.

There is \mkblockquote for \blockquote and friends as well as \mkbegdispquote/\mkenddispquote for displayquote and friends.

So to make displayquote go small and bold, you could use

\documentclass{article}

\usepackage{lipsum}

\usepackage{csquotes} \renewcommand{\mkbegdispquote}[2]{\footnotesize\bfseries}

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

Small and bold displayquote.


For smaller display quotes csquotes.cfg suggest something along the lines of

\documentclass{article}

\usepackage{lipsum}

\usepackage{csquotes}

\newenvironment*{footnoteboldquote} {\quote\footnotesize\bfseries} {\endquote}

\SetBlockEnvironment{footnoteboldquote}

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

moewe
  • 175,683