I know basically what \mathrel does when it's given a parameter: it typesets its parameter as though it were a mathematical relation for the purposes of spacing.

However, I have seen in several places the usage \mathrel{}, which seems to be treating the empty group as a relation. This doesn't square with how I've been told \mathrel is supposed to work; is there something else going on here?

In short, what does \mathrel (and, presumably, \mathbin, \mathop, etc.) do when its parameter is an empty group?

(I have seen this other question, but it didn't make sense to me and seemed to be not quite the same as mine.)

  • 1
    Can you point to a place where \mathrel{} is used? – egreg Mar 19 '16 at 22:27
  • @egreg See, for example, the answers to this other question. – Ptharien's Flame Mar 19 '16 at 22:29
  • 1
    That uses the fact that \middle ends a subformula and starts another one, so \mathrel{} only adds the space on one side. – egreg Mar 19 '16 at 22:43
  • @egreg Ah! That makes a lot of sense, thanks. Although it seems like a bit of a kludge. :P – Ptharien's Flame Mar 19 '16 at 23:14

In math mode {} makes an empty math atom (not just an empty group as in text mode) so \mathrel{} makes an empty atom that gets relation spacing.


$a {} b$ to $ a \mathrel{} b$

enter image description here

  • Thanks! I'm still confused as to why one would use such a thing, but you've explained what it is, at least. :) – Ptharien's Flame Mar 19 '16 at 22:35
  • 2
    @Ptharien'sFlame I'm not sure I would use that construct (empty \mathop more likely) but typical use is something that you can not surrpound like \middle or \left \right but you want to get the automatic relation spacing (including automatic lack of space in superscripts etc) – David Carlisle Mar 20 '16 at 9:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.