I'm typing a logic definition within an align environment that uses \overset{def}{=}
from the amsmath
environment.
However, the new sign is aligned vertically based on the equality sign, and not on the entire sign. In other words, the word def
is not considered in the alignment, which produces a result that I don't like.
How can I correctly vertically align the sign?
An MWE (the spacing around the sign is not an issue):
\documentclass{article}
\usepackage{amsmath}
\begin{document}
The definition of the satisfaction relation $M,s,g \models \phi$, which specifies that formula $\phi$ is true under valuation $g$ in state $s$ of model $M$, is given below.
\begin{align*}
M,s,g &\models x &\overset{def}{=} \qquad &s = g(x)\\
M,s,g &\models n &\overset{def}{=} \qquad &V(n) = {s}\\
M,s,g &\models p &\overset{def}{=} \qquad &s \ \epsilon \ V(p)\\
\end{align*}
\end{document}
Illustrative picture:
The equality signs are aligned vertically as per the red line.
However, the center of the new equality sign (\overset{def}{=}
) is at the green line.
The new sign should move down until the green line overlaps with the red line (approximately anyway). Then the vertical alignment would be correct.
Best Answer
I would suggest that you put the def/equal sign in a column of its own:
Additional changes made
\defeq
which typesets thedef
part in roman font.=
, line 2 swapped tos=V(n)
for symmetry\(...\)
used instead of$...$
If you really want the symbol to be vertically centered, then there is a standard TeX command
\vcenter
which centers material with respect to the axis of the formula (roughly the height of the center ofx
). The argument to\vcenter
is material in vertical mode, so you need to box up the contents. The naive version of this is:You can add @daleif's smaller version of the font if you so wish, by putting
\scriptscriptstyle
before\mathrm
.A more sophisticated version of the command would be, as in How to capture the current math style?:
which would resize in superscripts.