Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

In the question Latex Math Symbol: Vitanyi puts a tiny plus symbol over his equals. How do I do that?, there was an answer to how to place additional sign over the equal sign.

And my question is, what if I also want to have some symbol/text under the equal sign? Or if I want to use \stackrel to label my equal sign that follows an tab alignment character (&=)?

share|improve this question
    
@user4217 --- I don't understand the second part of your question. Do you mean that you want to have text underneath an equals sign that follows an alignment tab character? –  Ian Thompson May 16 '11 at 17:04
    
Yes, that's what I mean. Sorry I got it wrong in the question, I've edited it. –  FloydChen May 16 '11 at 17:52
    
I have edited my answer. –  Ian Thompson May 17 '11 at 12:53

1 Answer 1

up vote 7 down vote accepted

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 from amsmath).

\documentclass{minimal}
\usepackage{amsmath}
\DeclareMathOperator*{\eq}{=}
\begin{document}
\begin{equation*}
\underset{b}{=} \quad  \eq^a_b
\end{equation*}
\end{document}

There shouldn't be any problems using this in amsmath environments such as align.

\begin{align*}
A  &\eq^b_a B \\
   &\eq^b_a C
\end{align*}

However, if you use it in the middle column of an eqnarray or eqnarray* (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 via

\newcommand{\eq}[2]{\mathrel{\operatorname*{=}_#1^#2}}

which seems to improve the spacing (and may be better in other ways as well).

share|improve this answer
    
thanks, that's helpful. –  FloydChen May 16 '11 at 17:36
5  
In this case I would prefer \newcommand{\eq}[2]{\mathrel{\operatorname*{=}_#1^#2}}} to be called as \eq{under}{over}. In this way the symbol will behave like a relation symbol. –  egreg May 16 '11 at 18:04
1  
\newcommand{\eq}[2]{\mathrel{\operatorname*{=}_#1^#2}}} is not a balanced expression (one too many }). –  Steven B. Segletes Jul 9 '13 at 10:39
    
@StevenB.Segletes --- well, that's what I get for copying from egreg's comment! –  Ian Thompson Jul 9 '13 at 11:41
1  
I suggest modifying egregs command to this form: \newcommand{\eq}[2]{\mathrel{\operatorname*{=}_{#1}^{#2}}} which allows empty strings as its arguments in case one wants text only above or below the operator –  ted Sep 23 '13 at 12:38

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.