3

I am trying to get some lecture slides ready and I want to a callout arrow pointing to a variable in an equation, something like this:

enter image description here

I tried to use \overset with \Rsh, but the arrow does not line up with the text and is pointing in the wrong direction and just looks sloppy. I am looking for pointers (excuse the pun!) to make this happen. Thanks in advance!

What I tried to do is this:

\documentclass{article}
\usepackage{amsmath}

\[
 H=\dfrac{p^{2}}{2m}+ \overset{\Rsh\text{Potential Energy}}{V(x) \qquad \qquad \qquad }
\]
\end{document}

It looks terrible. Maybe I need to use the tikzpicture package to draw the callout arrow.

0

1 Answer 1

8

If it is really for lecture slides you can do something of the sort

\documentclass{beamer}
\usepackage{tikz}
\usetikzlibrary{shapes.callouts,tikzmark}
\newcounter{Callout}
\newcommand<>{\Callout}[3][]{\stepcounter{Callout}%
\tikzmarknode{tn-\number\value{Callout}}{#2}%
\begin{tikzpicture}[overlay,remember picture]
\only#4{\path (tn-\number\value{Callout}.north) 
 ++ (0.5,0.5) node[#1,above,draw,align=center,rectangle callout,
    callout absolute pointer={(tn-\number\value{Callout}.north)}]{#3};}
\end{tikzpicture}}
\begin{document}
\begin{frame}[t]
\frametitle{Hamilton function}
The Hamilton function reads
\[H=\frac{p^2}{2m}+\Callout<.(1)>{V(x)}{potential energy}
\]
\pause
bla bla
\end{frame}
\end{document}

enter image description here

1
  • Thank you, that looks pretty good. I'll will try it out. Dec 21, 2020 at 9:30

You must log in to answer this question.

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