# Creating own block environment in csquotes

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}


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}

\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}
\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}


• Great, thank you, now I understand the toogle commands of this package. – user2653422 Dec 4 '18 at 20:19