[texhax] command inserting space

Greg Matheson lang at ms.chinmin.edu.tw
Sun Nov 27 11:59:44 CET 2005


The FAQ says commands gobble the following space, but I'm having
problems with a space being inserted after my commands.

I am making fill-in-the-blank exercises from texts. I have been
using a perl program to convert letters other than the first in
words into boxes. But now I've decided to keep the last letter of
each word as well as the first.

I had been converting words into the form f\xxx where I had
defined \xxx with \newcommand to be 3 boxes, for example. This
worked well.

But it appears I cannot have a space at the end of my command,
and get no space in the printed document. Despite the FAQ saying
spaces are gobbled, I find 'f\xx m' is appearing as 'f__ m',
rather than 'f__m'.

Experimenting with the FAQ space-preserving recommendations, in
the form of f\xx{}m and f\xx\m did not work.

If I just have perl output the box, eg, as '$\Box$', rather than
have a latex command in the output of the perl program, there is
no space.

I experimented with non-letter command names like 'f\2m' but
there also a space is being inserted.

How can I use a command to insert my boxes?

-- 
Greg Matheson           It was said a million monkeys on a million typewriters
                        would eventually write the works of Shakespeare.
                        Now, thanks to the Internet, we know this is not so.
                                 http://www.research.att.com/~reeds/monkeys.html



More information about the texhax mailing list