3

I'm trying to create my own blockquote environment in csquotes.

The \blockquoteQ command should behave like the normal \blockquote command but instead of typesetting the text upright and in quotation marks it should be typeset in italics and without quotation marks. The \blockquoteQ command is then used in my document for typesetting block quotes from ancient sources and the original \blockquote is used for block quotes from literature.

Two problems with the MWE still persists and I'm running out of ideas how to solve them:

  1. I need to change the redefinition of the \mkblockquote command temporarily in the smallquoteItalic environment when the \blockquoteQ command is executed. At the moment both environments have quotation marks
  2. It would be nice if \blockquoteQ could also have one optional parameter and one mandatory like the orignal \blockquote

MWE

\documentclass{scrartcl}
\usepackage[]{csquotes, biblatex}

 \newenvironment*{smallquoteItalic}
   {\quote\small\itshape}
   {\endquote}
\newcommand{\blockquoteQ}[2]{{\SetBlockEnvironment{smallquoteItalic}\blockquote[#1][]{#2}}}

\renewcommand{\mkblockquote}[4]{\leavevmode\llap{,,}#1``#2#4#3}

 \newenvironment*{smallquote}
   {\quote\small}
   {\endquote}

  \SetBlockEnvironment{smallquote}

\begin{document}
     \blockquote[{\autocite[][]{}}]{A block quote of literature which should be set smaller, without italics but with quotation marks. A block quote of literature which should be set smaller, without italics but with quotation marks. A block quote of literature which should be set smaller, without italics but with quotation marks}

     \blockquoteQ{{\autocite[][]{}}}{A block quote of a source which should be set smaller and in italics but without quotation marks. A block quote of a source which should be set smaller and in italics but without quotation marks. A block quote of a source which should be set smaller and in italics but without quotation marks.}
\end{document}

1 Answer 1

4

There seems to be no convenient interface to define new \blockquote-like commands in csquotes.

Here is an attempt that tries to use as much common code as possible. The core is that we use a toggle to switch the definition of \mkblockquote between \blockquote and \blockquoteQ.

\documentclass[ngerman]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[style=authoryear]{biblatex}

\addbibresource{biblatex-examples.bib}

\renewcommand{\mkcitation}[1]{\space#1}

\newenvironment*{smallquote}
  {\quote\small}
  {\endquote}

\SetBlockEnvironment{smallquote}

\newtoggle{csq@qquote}

\makeatletter
\renewcommand{\mkblockquote}[4]{%
  \leavevmode
  \begingroup
  \iftoggle{csq@qquote}
    {\itshape}
    {\advance\csq@qlevel\@ne
     \llap{\textooquote}}%
  #1%
  \iftoggle{csq@qquote}
    {}
    {\textcoquote}%
  \endgroup
  #2#4#3}

% copy the original definition of \blockquote
\let\csqq@blockquote\blockquote

% new \blockquotes with toggles
% would be nicer with grouping, but that would mess with argument grabbing
\renewcommand{\blockquote}{\togglefalse{csq@qquote}\csqq@blockquote}
\newcommand{\blockquoteQ}{\toggletrue{csq@qquote}\csqq@blockquote}
\makeatother


\begin{document}
  \blockquote[{\autocite[cf.][12]{sigfridsson}}]{A block \enquote{quote} of literature which should be set smaller, without italics but with quotation marks. A block quote of literature which should be set smaller, without italics but with quotation marks. A block quote of literature which should be set smaller, without italics but with quotation marks}

  \blockquoteQ[{\autocite[cf.][13]{sigfridsson}}]{A block \enquote{quote} of a source which should be set smaller and in italics but without quotation marks. A block quote of a source which should be set smaller and in italics but without quotation marks. A block quote of a source which should be set smaller and in italics but without quotation marks.}

  \blockquote[{\autocite[cf.][12]{sigfridsson}}]{A block \enquote{quote} of literature which should be set smaller, without italics but with quotation marks. A block quote of literature which should be set smaller, without italics but with quotation marks. A block quote of literature which should be set smaller, without italics but with quotation marks}
\end{document}

Three quote blocks. Blocks one and three are in upright font and with quotation marks. Block two is in italics without quotation marks.

1
  • Great, thank you, now I understand the toogle commands of this package. Dec 4, 2018 at 20:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .