Most latex tags have straightforward meanings, for instance,
\sqrt
stands for/comes from "square root"
\equiv
stands for/comes from "equivalent to"
What does "rel" in \mathrel
and \stackrel
stands for?
math-modemath-operators
Most latex tags have straightforward meanings, for instance,
\sqrt
stands for/comes from "square root"
\equiv
stands for/comes from "equivalent to"
What does "rel" in \mathrel
and \stackrel
stands for?
Best Answer
You asked,
The meaning of
rel
inmathrel
quickly becomes fairly obvious if one considers the entire list of 13 types of math atoms; see also p. 158 of the TeXbook:One area where the status of the math atoms matters is in the spacing around binary and relational operators. E.g., if you examine the typeset output of
a+b
anda=b
, you'll notice that the spacing around the+
and=
symbols is not the same; the space around the latter symbol is slightly greater (unless the symbols are encountered in scriptstyle or scriptscriptstyle mode). This difference in spacing embodies typographic rules developed over decades (centuries?) of fine math typesetting.The
\mathrel
directive, which is a "TeX primitive" command, serves to change the math status of its argument to, you guessed it,mathrel
. For example, writing\mathrel+
changes the math status of+
frombin
(which is the default in most (all?) TeX systems) torel
. Aside: This is just an example; I am not suggesting that anyone would actually want to run this instruction. A more realistic example: Suppose that you want to denote the open interval from-a
tob
with]-a,b[
. Writing the open interval directly in this way would, however, cause incorrect spacing between]
(remember that its default math status isclose
) and the-
symbol. To get the correct spacing between]
and the unary-
symbol, you could writethereby overriding the default math status of the
[
and]
symbols. Better still, load themathtools
package and use its\DeclarePairedDelimiter
macro to define a macro called, say,\openint
with variable-sized delimiters as follows:This setup would allow you to write
\openint{-a,b}
in the body of the document.Then there is
\stackrel
macro: It's a LaTeX command that allows placing superscript terms above some object (often, but not necessarily, an=
symbol), making the math status of the combined objectmathrel
; e.g,,\stackrel{!}{=}
places!
above=
, and the status of the combined object ismathrel
. There is also a package calledstackrel
, which extends the functionality of\stackrel
in two ways. First, it allows placing subscript terms below a main object, while setting the status of the combined object tomathrel
. E.g.,places
x
below and!
above the=
symbol, and the math status of the combined object is set tomathrel
. Second, it provides an additional macro called\stackbin
, which allows placing subscript and superscript terms alongside a main object and setting the math status of the combined object tomathbin
.