# How to use \openautoquote that must not be in a env in a env?

I was trying to improve this answer to make it fully compatible with csquotes.

Consider this example:

\documentclass{article}
\usepackage{csquotes}

% hanging indentation for quotes, https://tex.stackexchange.com/a/166213/98645
\renewcommand{\mkbegdispquote}[2]{\strut\llap{}}
% #1 is closing punctuation, #2 is citation.
% We don't use them in this instance, but they
% need to be "catered for"
\renewcommand{\mkenddispquote}[2]{#1''\ifblank{#2}{}{#2}}
% #1 is closing punctuation, #2 is citation.
% again, we provide for them if needed

\begin{document}
\begin{displayquote}
Now we use an \enquote{quote inside the quote} in this
long text.\\
Bear with me.
\end{displayquote}

\end{document}


The problems there are:

1. The quotation marks are now again statically defined – which goes against the aim of csquotes. You can fix this by replacing them above, e.g. in German you'd use ,, instead of the  in \mkbegdispquote, but this is still not flexible then.
2. Worse, it breaks csquotes actual intended mechanism for nested quotations.
In the above example “quote inside the quote“ will be typesetted wrong and use outer quotation marks (“”), instead of inner ones (‘’) as it is supposed to do.

## Tries to fix

Looking at the csquotes doc I've tried to fix this:

\renewcommand{\mkbegdispquote}[2]{\strut\llap{\openautoquote}}
\renewcommand{\mkenddispquote}[2]{#1\closeautoquote\ifblank{#2}{}{#2}}


That would have been too easy, would not it? The problem seems to be, \openautoquote does not work and thinks it is unbalanced, if it is in a "environment" (please bear with me if this is the wrong term, I don't know the LaTeX internals), i.e. in \llap. My next idea then was to "fake" this, display an ordinary symbol and hide the one that just says csquotes that it should count a nesting in it's quotation order.

\renewcommand{\mkbegdispquote}[2]{\strut\llap{\textooquote}\vphantom{\openautoquote}}


Well… it's still in \vphantom now, so of course it still does not work. I have also seen no way in csquotes to manually adjust the nesting without displaying the actual sign.

So how can I do that?

Problem one above is effectively fixed, just the second one is my problem here.

• Note: I also noticed you can of course manually use \enquote* (the starred version) inside of the quote to force the quotes correctly. – rugk Aug 29 at 11:11

There is also an init command:

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[ngerman,french,english]{babel}
\usepackage[autostyle]{csquotes}
\renewcommand{\mkbegdispquote}[2]{\leavevmode\llap{\textooquote}\initoquote}
\renewcommand{\mkenddispquote}[2]{#1\textcoquote\ifblank{#2}{}{#2}}
\begin{document}
\begin{displayquote}
Now we use an \enquote{quote inside the quote} in this
long text.\\
Bear with me.
\end{displayquote}

\selectlanguage{french}
\begin{displayquote}
Now we use an \enquote{quote inside the quote} in this
long text.\\
Bear with me.
\end{displayquote}

\selectlanguage{ngerman}
\begin{displayquote}
Now we use an \enquote{quote inside the quote} in this
long text.\\
Bear with me.
\end{displayquote}

\end{document}


• Thanks! And while we are at it, csquotes provides a foreigndisplayquote environment, which includes the babel language selection. So you may want to use this instead of \selectlanguage. – rugk Aug 29 at 11:11