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

This question already has an answer here:

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

## marked as duplicate by Werner, egreg, user31729, texenthusiast, lockstepJul 9 '14 at 19:59

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

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

## 1 Answer

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