Following this 2005 thread from the XeTeX list, I’ve defined a \spaceddash command and assigned it to the Unicode em-dash character U+2014 “—”:
\documentclass{minimal}
\usepackage[utf8]{inputenc}
\DeclareRobustCommand{\spaceddash}%
{\unskip\nobreak\thinspace\textemdash\thinspace\ignorespaces}
\DeclareUnicodeCharacter{2014}{\spaceddash}
\begin{document}
meow — meow
meow—meow
— meow
meow —.
\end{document}
The document this produces looks something like this:
meow — meow
meow — meow
— meow
meow — .
Notice the thin-space between the em-dash on the last line and the period afterward—I’d like to get rid of it.
Following the example of xspace & xpunctuate, I’m trying to define a sort of \xthinspace command, one that will insert the \thinspace except if the dash is followed by certain punctuation marks (e.g., period, comma, close-parenthesis, close-quote).
How do I go about this?
