5

I have a little macro that I use for doing adding an e.g. in my writing:

\newcommand{\eg}{\emph{e.g.}\xspace}

The problem I have is that LaTeX is treating the g. as the end of a sentence and is spacing too much. Is there any way to disable this feature?

1

1 Answer 1

10

Add \@ to the definition of your custom macro. See When should I use intersentence spacing (`\@')? for details.

\documentclass{article}

\usepackage{xspace}

\newcommand{\origeg}{\emph{e.g.}\xspace}
\newcommand{\eg}{\emph{e.g.}\@\xspace}

\begin{document}

Some text \origeg and some more

Some text \eg and some more

\end{document}

enter image description here

You must log in to answer this question.

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