5

I want to change the layout of this. The two \underbrace should have the same height and the distances should be equal.

I hope you can teach me how to do this.

Thank you a lot!

\documentclass{scrartcl}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage{amsthm}
\newcommand{\vin}{\rotatebox[origin=c]{-90}{$\in$}}

\begin{document}
$$\underbrace{f^{12}}_{\substack{\vin\\{\cal M}_{12k}(\Gamma)}}\cdot\underbrace{\Delta^{-k}}_{\substack{\vin\\{\cal M}_{-12k}(\Gamma)}}\in{\cal S}_{0}(\Gamma)=\{0\}$$
\end{document}
egreg
  • 1,121,712

4 Answers4

3

Add \vphantom{f} in the argument to the second \underbrace, so you equalize the depths.

Some notes.

  1. I added a better definition for \vin, so it appears smaller in \substack

  2. I added braces around the \underbrace constructions, so as to make the spacing better (not really relevant here, but in other situations it can be)

  3. $$ should never be used in LaTeX (from day one), see Why is \[ ... \] preferable to $$ ... $$?

  4. The syntax {\cal M} has been deprecated for more than twenty years.

Here's the code:

\documentclass{scrartcl}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage{amsthm}

\newcommand{\vin}{\mathpalette\dovin\relax}
\newcommand{\dovin}[2]{%
  \rotatebox[origin=c]{-90}{$#1\in$}%
}

\begin{document}
\[
{\underbrace{f^{12}}_{\substack{\vin\\\mathcal{M}_{12k}(\Gamma)}}}
\cdot
{\underbrace{\vphantom{f}\Delta^{-k}}_{\substack{\vin\\\mathcal{M}_{-12k}(\Gamma)}}}
\in\mathcal{S}_{0}(\Gamma)=\{0\}
\]
\end{document}

Actually the only necessary packages are amsmath and graphicx.

enter image description here

egreg
  • 1,121,712
2

\vphantom can be used to reserve the vertical space for the f with descender for the second brace:

\documentclass{scrartcl}
\usepackage{amsmath}
\usepackage{mathtools}
\newcommand{\vin}{\rotatebox[origin=c]{-90}{$\in$}}

\begin{document}
\[
  \underbrace{f^{12}}_{\substack{\vin\\{\cal M}_{12k}(\Gamma)}}\cdot
  \underbrace{\vphantom{f}\Delta^{-k}}_{\substack{\vin\\{\cal M}_{-12k}(\Gamma)}}
  \in{\cal S}_{0}(\Gamma)=\{0\}
\]
\end{document}

Result

BTW: Why is \[\] preferable to $$$$?

Heiko Oberdiek
  • 271,626
2
\documentclass{scrartcl}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage{amsthm}
\newcommand{\vin}{\rotatebox[origin=c]{-90}{$\in$}}

\begin{document}
    \begin{equation}
    \underbrace{f^{12}}_{\substack{\vin\\{\cal M}_{12k}(\Gamma)}}\cdot\underbrace{\vphantom{f^{12}}\Delta^{-k}}_{\substack{\vin\\{\cal M}_{-12k}(\Gamma)}}\in{\cal S}_{0}(\Gamma)=\{0\}
    \end{equation}
\end{document}
JPi
  • 13,595
1

One could use \makebox with \strut to create unform extra height:

\documentclass{scrartcl}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage{amsthm}
\newcommand{\vin}{\rotatebox[origin=c]{-90}{$\in$}}
\newcommand*{\myBox}[1]{\makebox{\strut #1}}

\begin{document}

\[ \underbrace{\myBox{$f^{12}$}}_{\substack{\vin\\{\cal M}_{12k}(\Gamma)}}
\cdot\underbrace{\myBox{$\Delta^{-k}$}}_{\substack{\vin\\{\cal M}_{-12k}
(\Gamma)}}\in{\cal S}_{0}(\Gamma)=\{0\} \]

\end{document}

If you want to customize the space you could design your own strut.