My friend Daniel Reeves was recently discussing different ways to typeset em dashes. Here is the way I like to do it in LaTeX.
\documentclass{minimal}
%this sets up a new command \dash, which makes nice dashes
\DeclareRobustCommand\dash{%
\unskip\nobreak\thinspace\textemdash\thinspace\ignorespaces}
\begin{document}
Let's test out several different variants on making an em dash using the
\LaTeX typesetting system --- this one uses \verb|---| with spaces around it
Let's test out several different variants on making an em dash using the
\LaTeX typesetting system---this one uses \verb|---| with no spaces around it
Let's test out several different variants on making an em dash using the
\LaTeX typesetting system \dash this one uses my \verb|\dash| command
\begin{verbatim}
\DeclareRobustCommand\dash{%
\unskip\nobreak\thinspace\textemdash\thinspace\ignorespaces}
\end{verbatim}
\end{document}
Here is the resulting output:
Notice how using spaces around the --- can result in a dash at the end of a line, which is not desirable. And using no spaces around the --- doesn’t look nice, and can also result in problems when copying and pasting. The \dash command solves both of these issues. I did not come up with it myself, but I cannot remember where I found it.