I have defined the equal by definition sign:

enter image description here

with this code: \newcommand{\eqdef}{\overset{def}{=}}.

However, "def" extends over the edges of the equal sign. Is there a wider equal sign to use?

  • 2
    You could just use the various 'equivalence' signs (mathworld.wolfram.com/Equivalent.html) that denote 'equality by definition'. – Dancrumb Nov 19 '11 at 16:55
  • 1
    A more specific link: mathworld.wolfram.com/Defined.html – Dancrumb Nov 19 '11 at 16:55
  • 1
    Rather than using an abbreviated word over an elongated equal sign, have you considered using either the $\equiv$ symbol or the macro $\overset{!}{=}$? – Mico Nov 19 '11 at 20:34
  • I have considered $\equiv$, as well as $\triangleq$, but decided to use $\overset{def}{=}$, as (I think) is more obvious what it means – Zack Nov 19 '11 at 21:20
  • Related Question: Short equals sign. – Peter Grill May 26 '12 at 4:04

Just put two equals signs, backing up slightly:


This is how TeX builds extensible arrows.

enter image description here

The magic macro \joinrel is defined as


and the magic is done by the fact that TeX doesn't put spaces between consecutive relation symbols:


will thus result in two equals signs slightly superimposed to each other.

  • I had to accept this as, \joinrel > \usepackage{extarrows}. – Zack Nov 19 '11 at 16:47
  • Amazing solution, egreg! :) – Paulo Cereda Nov 20 '11 at 10:28

The extarrows package provides \xlongequal{<stuff>}:

enter image description here

\usepackage{extarrows}% http://ctan.org/pkg/extarrows
\[ f(x) \eqdef g(x) = ax^2+bx+c \]

extarrows requires amsmath (so it is loaded by default). As such, I've used \text which scales to the appropriate text font in the given math size.

If you want the boundary of the overset def to be tighter, use


which removes some space around def.


If you want the size to math exactly, you can use \resizebox from the graphicx package and scale the width to the desired size (width of the unscaled version), and leave the height to be the same as the height of the = sign. Here is a comparison of the regular, and re sized versions:

enter image description here

\usepackage{graphicx}% needed for \resizebox
\usepackage{calc}%     needed for the width/height calculations

\newcommand*{\eqdefU}{\ensuremath{\mathop{\overset{\MyDef}{=}}}}% Unscaled version

    f(x) &\eqdefU g(x) = h(x) \quad\text{Unscaled}\\
    f(x) &\eqdef  g(x) = h(x) \quad\text{Scaled}
  • 1
    \usepackage{pgf} why do you need it? There are only basic box calculations. – user2478 Nov 19 '11 at 19:12
  • @Herbert: Yep, it was left over from an earlier version that did more complicated calculations. ctan.org/pkg/graphicx – Peter Grill Nov 20 '11 at 1:49
  • a simply \height instead of \heightof{=} should also work, because you can take the natural height. – user2478 Nov 20 '11 at 6:35

It doesn't strictly answer the question but if you only want the "def" to be about the same size as the equal sign you could also resize the text, i.e.


\newcommand*{\eqdef}{\ensuremath{\overset{\mathclap{\text{\Tiny def}}}{=}}}


 A &\eqdef B \\
 &= C


This way it looks better (in my opinion) when used together with normal equal signs. enter image description here

  • Can you choose font sizes below 5pt? When I run your example, I get the warning Font shape OT1/cmr/m/n' in size <4> not available ... size <5> substituted`. – Mico Nov 20 '11 at 0:26
  • @Mico: I don't really know. I chose the font size more or less randomly. But I guess your right and one really can't go below 5pt (at least not by default) as nothing changed when I tried smaller font sizes. – Philipp Nov 20 '11 at 22:09

Here is one adaptation of the Philipp's proposition so as to take care of the different math modes.

% Source : http://tex.stackexchange.com/questions/35404/is-there-a-wider-equal-sign



                {% \displaystyle
                {% \textstyle
                {% \scriptstyle
                {% \scriptscriptstyle


    A &\eqDef B \\
    A &= C

        \textbf{Style}            & \verb!\eqDef!
        \\ \hline
        \verb!\displaystyle!      & \displaystyle      A \eqDef B
        \verb!\textstyle!         & \textstyle         A \eqDef B
        \verb!\scriptstyle!       & \scriptstyle       A \eqDef B
        \verb!\scriptscriptstyle! & \scriptscriptstyle A \eqDef B


Just the plain horizontal extension of the equation mark is possible with the graphicx package:


You can also define a command for this and use it lateron


like this:

  • Will this provide the correct spacing around the relation? Perhaps wrap it with \mathrel. How would you replicate the output requested by the OP? – Werner Dec 15 '16 at 19:13

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.