Possible Duplicate:
Horizontal Spacing: double \hspace removal?

I'm trying to keep my document as abstract as possible since I'm likely to change representation of the terms I'm using on a regular basis. For this reason, I have created a number of commands similar to the following:


I can then use these commands to describe a simple grammar rule:

\gtDepth \gnInt \gtSemi

The problem is, of course, that there is no spacing between these terms. I would like to write something like the following:


Specifically, I want this "minspace" construct to create space only if it is not already adjacent to that much space. For instance, I would like


to be equivalent to


because the 3mm space is larger. It seems that \mathop provides this behavior in a very crude sort of way: things in \mathop are padded on the left and the right, but two \mathops adjacent to each other don't create twice as much space.

Any thoughts?


  • Do you need the objects to be equally spaced or the space between some of them should be different?
    – egreg
    Commented Mar 12, 2012 at 17:14
  • @MarcoDaniel The question is tagged "mathmode" and \xspace doesn't work there.
    – egreg
    Commented Mar 12, 2012 at 17:16
  • @egreg: I didn't see the tag mathmode ;-) Commented Mar 12, 2012 at 17:20

1 Answer 1


Just found another stackexchange post that solves the problem. shame! It's over here: Horizontal Spacing: double \hspace removal?

Specifically, I was looking for the following. I modified it from the original post to remove the horizontal mode assertion; this makes it work in math mode for me.

        \hskip \@tempskipb
    \ifdim \lastskip =\z@
    \hskip #1\relax

Sorry about the dupe!

  • There's no need to be sorry, now I know about \lastskip :-) Commented Mar 12, 2012 at 17:18

Not the answer you're looking for? Browse other questions tagged .