3

In Latex, How do I write "\sim_G" but so that the G is directly underneath the "\sim"?

Al Mc
  • 31

1 Answers1

5

If you are going to use it often, you can declare it to be a math operator. If used rarely, you can make a stack or an \underset. Here, I show all ways. Notice I made the stack a \mathrel, rather than \mathop, which has a slightly larger horizontal spacing. Choose what suits. When using the \stackunder, the vertical gap may be set with the optional argument.

\documentclass{article}
\usepackage{amsmath}
\DeclareMathOperator*{\simop}{\sim}
\usepackage{stackengine}
\stackMath
\begin{document}
\[A \underset{G}{\sim} B \mathrel{\stackunder[1.8pt]{\sim}{\scriptstyle G}} B \simop_G A \]
\end{document}

enter image description here