4

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, lockstep Jul 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.

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

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}

enter image description here

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.