I'm using accents to produce a variant of the \in operator but when I place an accent on it, as in \tilde{\in}, I get spacing that is different from \in, see the example and the image below. My question is: what is the best way to make it so that \tilde{\in} get the same spacing as \in?

In the example below I also provide two failed attempts of getting the right spacing. I'm not especially accustomed to math mode and definitions of operators. Maybe the right way to go with \DeclareMathOperator?



The spacing I want:
w_{1} \in w_{2}

The spacing I get with an accent:
w_{1} \tilde{\in} w_{2}

Better spacing but an ugly hack:

The wrong spacing (too tight?):
w_{1} \mathop{\tilde{\in}} w_{2}


Example of math mode accents and spacing

1 Answer 1


An accented symbol is treated by TeX as an ordinary one; you have to tell it that you want a relation symbol:

\( w_{1} \mathrel{\tilde{\in}} w_{2} \)

The commands for declaring a math symbol are

  • \mathord (ordinary)
  • \mathbin (binary operation)
  • \mathrel (binary relation)
  • \mathop (operator, use with care)

An ordinary symbol is typeset without any spacing around it. A binary operation is something like +; for example, if one wanted to define a "mod" operation, a correct way would be


(amsmath does it in a quite different way, but that's not the point). A binary relation is like <; the spacing around binary relation symbols is larger than around operation symbols. Moreover the space around relation symbols is uncompressible, while it is for operations.

As already said, putting an accent over a symbol makes it lose its predefined nature: the accented cluster is considered as an ordinary symbol; therefore we have to state explicitly its nature.

  • Please forgive my ignorance of mathematical terms. I'm trying to understand the semantics of these commands. Am I correct if I understand "binary operation" as any operation manipulating two terms, such as 1+2, and if I understand "binary relation" as any two term relation, such as the logical connectives conjunction and disjunction? Where are these commands documented?
    – N.N.
    Jun 22, 2011 at 12:30
  • 3
    @N.N.: Yes. You can read TeXbook, Chapter 17: More about Math, or TeX by Topic, Chapter 23: Mathematics Typesetting.
    – Leo Liu
    Jun 22, 2011 at 12:39

You must log in to answer this question.

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