# Remove space at the end of a macro

For a particular work, I need old style footnotes, that are typeset before the word they refer to.

So I call \footnote before the word and it works fine, but it adds a space after the footnote mark. How can I get read of this space (in essence, the opposite of \xspace)?

-
Just use \ignorespaces. See also Simulate the % in a \newcommand –  Leo Liu Jul 30 '11 at 5:44

\documentclass{article}
\begin{document}
A test \footnote{a test foot}sentence.
\end{document}


I did not see the space you talked about in the question. Did you left a space or newline between the } and the letters following it?

-
My bad, I was introducing a space in the wrapper for my notes. –  ℝaphink Jul 30 '11 at 6:20
Alternativ you may finish your \footnote{...} with a % and continue on the thext line. (I edited the answer, please wait for a peer review). –  knut Jul 30 '11 at 18:17

Yan Zhou has probably given the irght answer, but I'd add that in similar cases, \ignorespaces or \unskip can be useful. Assume for instance that a macro you are using starts and ends with spurious spaces. Then you may be able to fix it without redefining it:

\newcommand{\badmacro}{ Hello }