I answered another question (LaTeX \models symbol that goes both ways) creating a new symbol, a relation, without using \mathrel
.
In his answer to the same question, Werner used it (he also used \joinrel
, a command I didn't know, where I used \!
).
In this case, however, I see no difference in the results with or without \mathrel
. Is it always needed?
\documentclass{article}
\newcommand{\mymod}{\mathrel{\models\!\mid}}
\newcommand{\mymode}{\models\!\mid}
\newcommand{\mymodel}{\mathrel{\models\joinrel\mid}}
\begin{document}
This is without \verb|\mathrel|, with \verb|\!|:
\[ A \mymod B\quad {\scriptstyle A \mymod B }\quad {\scriptscriptstyle A \mymod B }\]
This is with \verb|\mathrel|, with \verb|\!|:
\[ A \mymode B\quad {\scriptstyle A \mymode B }\quad {\scriptscriptstyle A \mymode B } \]
This is with \verb|\mathrel| and \verb|\joinrel|:
\[ A \mymodel B \quad {\scriptstyle A \mymodel B }\quad {\scriptscriptstyle A \mymodel B }\]
They seem the same to me. What is the difference?
\end{document}
\!
does\mskip-\thinmuskip
where\thinmuskip=3mu
, whereas\joinrel
does\mathrel{\mkern-3mu}
, so if the atoms on both sides of\joinrel
are also rel atoms, the two commands are equivalent.\mathrel
like\mathbin
etc. adjust the "class" of the following group. The different groups are described in the TeX Book. It's basically to tell the system the semantics of your symbol.\mid
and\models
are but as the spacing seems correct it is probably\mathbin
or\mathrel
. The only semantic difference is that you now do not have one relation but actually two following each other (models and mid). I don't know whether this might have any side effects on the spacing but I think that, as long as you are not adding any groups inbetween, you are safe.