Questions tagged [xspace]

3 questions
6
votes
3 answers

Spacing issues with xspace

Let's say my macro is \newcommand{\k}{king\xspace}. Then the spacings in "... said the \k." will be fine. But what do I do if I want no spacing in the middle of \k\k.? I want "kingking." not "king king." Is there a way to do this?
queen
  • 61
  • 1
  • 2
4
votes
0 answers

Generating a non breaking space with xspace

I wrote a \newcommand*{\test}{test\xspace}. Everything works as expected, but my question is the following: is there a way to generate a non-breaking space version of \xspace? Thanks.
tidel
  • 158
  • 6
1
vote
1 answer

latex: xspace not suppressing space in combination with textit

I put xspace at the end of most of my macros, e.g. \newcommand*{\foobar}{foobar\index{foobar}\xspace} but I just discovered that if the macro is placed inside textit, it does not work as expected, e.g. Test 1: \foobar. Test 2:…
hlovdal
  • 26,565
  • 10
  • 94
  • 165