I've seen the following command used a lot to make the triangle-equals operator that means "is defined as":
\newcommand{\defeq}{\stackrel{\triangle}{=}}
However, I don't like how far apart the triangle and the equals sign are, so I'd like to reduce the space between them. I tried using a raisebox, but it does not seem to be having any effect:
\newcommand{\defeq}{\stackrel{\raisebox{-10pt}{\(\scriptstyle\triangle\)}}{=}}
It also has no effect if I put different values in for the extend-above and extend-below arguments
Does anyone know how to manually adjust the vertical space in \stackrel
, or why the above does not work?
Best Answer
\stackrel
exploits the same TeX's internal mechanism used for setting limits over\sum
:Therefore lowering the "superscript" won't have any effect (raising would). In any case it's better to use
\overset
fromamsmath
. And, in this particular case, to use the predefined symbol.How to solve your problem in other situations, without measuring?
Alignments are what we need: but
array
would leave too much space and we'd need measuring again. Here's a way out; I'll use the "triangle over equals" just by way of example: always use an already available symbol.I've left a (commented) line where one could adjust the separation between the two parts; it's better to specify
ex
rather thanpt
units, so that the symbol can be used in various font sizes.We say that the symbol is a relation.
We enclose the building into a
\vbox
, so that the baseline of the bottom element will be used for the whole thing.In the
\vbox
we suppress the usual interline skip mechanism (\offinterlineskip
).We start an alignment;
\ialign
is just a way to use\halign
with\tabskip
set to zero.The alignment consists of one column, with centered items (
\hfil#\hfil\cr
, the#
needs to be doubled because we're in a definition).The two rows, possibly adjusting the separation with a positive or negative kern.
Here are some examples