4

I'd like to type out something to the effect of the below image. But I am not completely sure how to label the \cong.

enter image description here

Trogdor
  • 727

2 Answers2

6

The package amsmath provides a macro \overset, which works like LaTeX's \stackrel but is somewhat more general (\stackrel expects only a binary relation, \overset works with everything).

\documentclass{article}

\usepackage{amsmath}

\begin{document}

$A \overset{\varphi}{\cong} B$

\end{document}

enter image description here

campa
  • 31,130
5

Here, I chose to add the \varphi in \scriptscriptstyle, but one could change that to \scriptstyle to suit. I also chose a 1pt stacking gap, which can also be changed to suit.

If one wants to prevent an oversized overstack from messing with the natural spacing of \cong, then invoke \def\useanchorwidth{T} prior to the event, as shown in the 2nd example.

\documentclass{article}
\usepackage{amsmath,stackengine}
\stackMath
\begin{document}
\[
A \mathrel{\stackon[1pt]{\cong}{\scriptscriptstyle\varphi}} B
\]
\[
\def\useanchorwidth{T}
A \mathrel{\stackon[1pt]{\cong}{\scriptscriptstyle xyz}} B
\]
\[
A \cong B
\]
\end{document}

enter image description here

This, of course, can be formulated as a macro

\newcommand\overcong[1][]{%
  \mathrel{\stackengine{1pt}{\cong}{\scriptscriptstyle #1}{O}{c}{F}{T}{S}}
}

with usage A \overcong[xyz] B.