You can overlay the symbols the following way: Box the wider one and let the other one lap over it (using \rlap
or \llap
). The correct centering is achieved by placing the second character into a box with the equal width but using \hss
to center it. The correct size for the different math modes can be adjusted using \mathchoice
.
\documentclass{article}
\def\qeq{\mathrel{%
\mathchoice{\QEQ}{\QEQ}{\scriptsize\QEQ}{\tiny\QEQ}%
}}
\def\QEQ{{%
\setbox0\hbox{=}%
\rlap{\hbox to \wd0{\hss?\hss}}\box0
}}
\textwidth=2cm
\begin{document}
$ A \qeq B $
$ A = B $
\[ A \qeq B \]
\[ A = B \]
$ S_{ A \qeq B } $
$ S_{ A = B } $
$ S_{S_{ A \qeq B }} $
$ S_{S_{ A = B }} $
\end{document}
Result

That notation is quite old fashioned. If you really want to use it, probably the best way is to define
\newcommand{\matr}[1]{\underline{\underline{#1}}
Here, for comparison, the result of \matr{A}
and of \underset{=}{A}
:

In any case, define your own command, so that you can easily change your mind later; with \underset
it would be
\newcommand{\matr}[1]{\underset{=}{#1}}
According to ISO norms, variables denoting matrices should be in boldface italic:
\usepackage{bm}
\newcommand{\matr}[1]{\bm{#1}}
(or, simply, \newcommand{\matr}{\bm}
or, even more simply, \let\matr\bm
).
Best Answer
The amsmath package provides the
\overset
and\underset
macros that can be used to place one symbol above or below another. If you want text above and below, you could use\DeclareMathOperator*
(also fromamsmath
).There shouldn't be any problems using this in
amsmath
environments such asalign
.However, if you use it in the middle column of an
eqnarray
oreqnarray*
(which are generally considered to be obsolete), then you will need\displaystyle
before\eq
.All of the above applies to egreg's suggestion of defining
\eq
viawhich seems to improve the spacing (and may be better in other ways as well).