8

Am I wrong in thinking that \xspace should not introduce a space when used inside an \enquote command as used in the following MWE? And how can I get the two to work together?

\documentclass{article}
\usepackage{csquotes}
\usepackage{xspace}

\newcommand{\test}{test\xspace}

\begin{document}
    \test. \test, ``\test'' \test \enquote{\test} \test \enquote{\test}. 
\end{document}

Output from the MWE

1

1 Answer 1

8

enter image description here

You can add csquotes end of argument marker to the xspace list of exceptions:

\documentclass{article}
\usepackage{csquotes}
\usepackage{xspace}
\makeatletter
\xspaceaddexceptions{\csq@qclose@i}
\makeatletter

\newcommand{\test}{test\xspace}

\begin{document}
    \test. \test, ``\test'' \test \enquote{\test} \test \enquote{\test}. 
\end{document}

But note problems like this are inevitable and predicted:

Drawbacks of xspace

You must log in to answer this question.

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