# Spacing in unusual csquotes style

I am currently transcribing and editing some old letters by an ancestor. In some letters he used quotation marks for quotes or titles (books, poems, songs etc.), but occasionally he forgot to set a closing mark.

I want to keep my transcription as close to the original as possible -- meaning that all my additions to the text should be marked --, and of course I want to keep using csquotes for handling quotations. Fortunately, it is quite easy to define a new quotation style with an emphasized closing quotation mark! However, I have problems with the spacing after a quotation, especially in cases where an inner ends immediately before an outer quote.

In the past, I could use \xspace even if it was followed by a closing quotation mark because I had included \csq@qclose@i in \xspaceaddexceptions-- but this doesn't seem to work with my new style.

\documentclass{article}
\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}

\usepackage{xspace}
\makeatletter
) \} \] \,
\csq@qclose@i
\xspace
\[     % This doesn't work here!
}
\makeatother

\usepackage[autostyle,german=quotes]{csquotes}
\renewcommand{\mktextins}[1]{\textbf{[#1]}}         % \textbf could also be something else, e.g. \color

\DeclareQuoteStyle{norightmark}
{\quotedblbase}     {\textins{\textquotedblleft}\xspace}%[0.05em]
{\quotesinglbase}   {\textins{\textquoteleft}\xspace}

\begin{document}
\setquotestyle{norightmark}
\enquote{This is an \enquote{inner quote\xspace}followed by normal text, and that is \enquote{an inner quote ending together with the outer quote.}}There should be white space before this sentence.
\setquotestyle*%

\vspace{1cm}
The following paragraph has normal quotations:

\enquote{This is \enquote{an inner quote\xspace}followed by normal text, and that is \enquote{an inner quote ending together with the outer quote.\xspace}}There should be white space before this sentence.
\end{document}


So, how can I get rid of the white space between the inner and outer closing quotation marks without having to remove \xspace from my quote style?

• Have you tried adding \textins to \xspaceaddexceptions? That seemed to work for me, if I understood what you want... May I ask why you want to use xspace in the first place? It seems just so much more natural to me to have no \xspace and the appropriate space instead. But I probably simply don't understand what exactly you want to achieve. – moewe Mar 11 '18 at 15:49
• @moewe Thanks, adding \textins does work, and I hadn't tried it before! My reason for using such unnatural spacing here? It's an MWE, it doesn't have to make sense in real life! :-) Think of it as trying out stuff under lab conditions: In my real document I have defined some primitive macros which expand to "text followed by \xspace". They could occur just before the end of a quotation, but including these macro definitions would have made the MWE longer. I thought it would be cheaper to skip the definitions here and just insert \xspace directly. Sorry if that was confusing! – Andreas Mar 22 '18 at 21:31
• OK, I'm always sceptical when I see xspace (tex.stackexchange.com/q/86565/35864) it always makes me suspect something weird is going on. – moewe Mar 22 '18 at 21:41

You need to add \textins to \xspaceaddexceptions. The command will then be recognised by xpatch as not needing space before it.