[texhax] Extraneous space in macro

Edsko de Vries edsko at edsko.net
Fri Jul 18 13:48:01 CEST 2008


I'm trying to write a macro that behaves like \ref but appends the
corresponding page number to a buffer. Everything is working ok, except
that I'm getting an extraneous space. Here is a reduced version that
shows the problem:




Refer to Section~\bref{sec:first}, Section~\bref{sec:second} and
Section~\bref{sec:third} (\Buffer).

\section{First section}\label{sec:first}
\section{Second section}\label{sec:second}
\section{Third section}\label{sec:third}


If you run the example, you will see that there is too much space in
between the "Section"s and the section numbers. I'm not sure what's
causing the problem; the problem disappears when I remove the

Can anyone see what's going wrong? If not, is there an alternative way
to append stuff to a buffer (instead of using \patchcommand)? 



More information about the texhax mailing list