# How to have only 1 space between a word and a counter [duplicate]

I am using the following counter:

\newcounter{foo}
\newcommand\num{
\refstepcounter{foo}
\thefoo.}


Two (2) spaces are automatically inserted between the preceding word and the counter -- e.g., word \num shows up in the pdf file as word 1.

Is there a way to have just one space between a word and a counter? If possible, I'd like to avoid writing word\num and would prefer to write it like word \num

• Use % at the end of line, e.g., …\num{% and …foo}%. – Manuel Jul 9 '14 at 19:18

Comment out spurious blank spaces (one carriage return tantamounts to a blank space) in the definition:

\documentclass{article}
\newcounter{foo}
\newcommand\num{%
\refstepcounter{foo}%
\thefoo.}

\begin{document}

a \num

\end{document}


• Yes, that works perfectly -- thank you very much!!! :) – lawlist Jul 9 '14 at 19:22