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.

Several times already I wanted to express something like

  !
A = B

or

   n->0
X ------> oo

in a math environment. How do I achieve this?

On a related note: What is the correct term for this? Googling for ! and = unsurprisingly doesn't yield too many useful results.

share|improve this question

2 Answers 2

up vote 5 down vote accepted

In the code below, I create a new command, \mbeq (short for "must be equal"...), which is a "math relational" operator (same type as the "ordinary" equal sign). Using the \overset command in the definition of the \mbeq operator automatically makes the new command "inherit" the type of the second argument of the \overset command; hence, it's not necessarily to assign the type "mathrel" explicitly.

\documentclass{article}
\usepackage{amsmath}
 % "mbeq": must be equal
\newcommand{\mbeq}{\overset{!}{=}}
\begin{document}
$ a\mbeq b$, $x\xrightarrow{n\to 0}\infty$
\end{document}

enter image description here

Finally, I'm not aware of a commonly used term for the "must be equal" symbol (exclamation mark set over equality symbol). I searched detexify, and no predefined symbol came up.

share|improve this answer
2  
As I said in another comment, the \mathrel here is redundant, because \overset usually guesses right. But +1 for suggesting a new command for it. –  egreg Oct 21 '11 at 23:42
    
Thanks, @egreg. I'll update my answer accordingly. –  Mico Oct 22 '11 at 1:13
\documentclass{article}
\usepackage{amsmath}

\begin{document}

\[ \overset{!}{=}\qquad x\xrightarrow{n\to 0}\infty \]

\end{document}

enter image description here

share|improve this answer
2  
Rather than \stackrel I'd recommend \overset –  egreg Oct 21 '11 at 22:42
    
@egreg: right. I've edited my answer, thanks. –  Gonzalo Medina Oct 21 '11 at 22:52
    
@egreg: In this \case, there is no difference between the visual output of \stackrel and \overset. I guess the only motivation behind it is that it has an \underset counterpart which makes it more generic in terms of usage. –  Werner Oct 21 '11 at 22:58
3  
@Werner That's a happy case. Try with \stackrel{!}{x} and you'll see the difference. Besides, \overset tries to guess the nature of the main symbol (relation or operation), so using the correct spacing; conversely, \stackrel always creates a relation. –  egreg Oct 21 '11 at 23:05

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.