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.

There are posts here explained how to Add a comment on top of "equal" and "approximate" symbols , the idea is to use \stackrel{text}{=}, however, if the text is a bit long, for example I'd like to right

LHS\stackrel{t=x^n}{=}RHS

then the text over the equal symbol is a bit too long.

How could I make it more pretty?

share|improve this question
    
You could always try turnstile with null verticals. \turnstile{n}{d}{}{t=x^n}{n}, for example. (The package automatically adjusts the horizontal lines to the size of whatever is placed over and/or under them.) –  cfr Jul 29 at 2:44
2  
The best thing to do here is not to do that; surely there's a better way to indicate what you want to express than overloading the equality symbol. –  Gonzalo Medina Jul 29 at 2:47

5 Answers 5

up vote 1 down vote accepted

Prettiest of all ;-)

\documentclass{article}
\begin{document}
\[
  y \stackrel{t=x^n}{=\joinrel=\joinrel=} x
\]
\end{document}
share|improve this answer

Less is sometimes more. Consider this merely a suggestion:

enter image description here

\documentclass{article}
\begin{document}
It is obvious that
\[
  LHS \stackrel{*}{=} RHS
\]
where $\stackrel{*}{=}$ denotes an equality based on the fact that $t = x^n\!$.
\end{document}
share|improve this answer
    
thanks for the suggestion. I'll adopt your approach however take @JPi 's reply as the (literal) answer to the question. –  athos Aug 14 at 2:16

The stackengine package has a parameter \def\useanchorwidth{} that when set to T, ignores the stacked-on or -under content when determining the width of the stack. The optional argument provides the stacking gap. A {}={} had to be used to get the stacked equal sign to act as a math relation.

\documentclass{article}
\usepackage{stackengine}
\stackMath
\begin{document}
\def\useanchorwidth{T}
$LHS\stackunder[1pt]{{}={}}{\scriptstyle t=x^n}RHS$\par\medskip
$y\stackon[4pt]{{}={}}{\scriptscriptstyle blah-blah}A x^2 +Bx +c$
\end{document}

enter image description here

share|improve this answer

With aligned equal signs:

\documentclass{article}
\usepackage{mathtools}
\begin{document}
\Huge
$LHS\,\stackrel{\mathllap{t}=\mathrlap{x^n}}{=}\,RHS$

\end{document}

enter image description here

share|improve this answer

This is somewhat similar to Werner's suggestion but with the additional use of \mathclap and \smash:

\documentclass{article}

\usepackage{mathtools}

\newcommand*\Ref[2]{\stackrel{\mathclap{\scriptscriptstyle\smash{(#1)}}}{#2}}
\newcommand*\RefEq[1]{\ensuremath{(#1)}}

\begin{document}

\begin{equation}
  A \Ref{\triangle}{=} B
\end{equation}
From \RefEq{\triangle} we see that $A = B$.

\end{document}

output

share|improve this answer

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.