1

I'm trying to use overbrace with parbox in an equation, but haven't been very successful. Any ideas on how to properly do it?

enter image description here

\documentclass[10pt]{beamer}

\usetheme[progressbar=frametitle]{metropolis}

\usepackage{mathtools}

\begin{document}

\begin{frame}[fragile]

\begin{align*}
X + \overbrace{\parbox{8em}{some text  \\ and some more}}{\text{written above}}=Y+Z
\end{align*}

\end{frame}

\end{document}
0

2 Answers 2

2

You're missing a ^ symbol between the two arguments of \overbrace. Hence, just replace

\overbrace{\parbox{8em}{some text  \\ and some more}}{\text{written above}}

with

\overbrace{\parbox{8em}{some text  \\ and some more}}^{\text{written above}}

Here's a screenshot that shows the results of incorrect and correct usage of \overbrace:

enter image description here

\documentclass{beamer}
\usetheme[progressbar=frametitle]{metropolis}
\usepackage{mathtools}
\begin{document}
\begin{frame}[fragile]
Incorrect
\[
X + \overbrace{\parbox{8em}{some text  \\ and some more}}{\text{written above}}=Y+Z
\]

Correct
\[
X + \overbrace{\parbox{8em}{some text  \\ and some more}}^{\text{written above}}=Y+Z
\]
\end{frame}
\end{document}
0

With pbox, the \overbrace would fit better the paragraph size:

\documentclass[10pt]{beamer}

\usetheme[progressbar=frametitle]{metropolis}
\usepackage{pbox}
\usepackage{mathtools}

\begin{document}

\begin{frame}[fragile]

\begin{align*}
X + \overbrace{\pbox{8em}{some text \\ and some more}}^{\text{written above}}=Y+Z
\end{align*}

\end{frame}

\end{document} 

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .