TransWikia.com

Callout arrow above equation

TeX - LaTeX Asked by Crazy Horse on April 9, 2021

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{Rshtext{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.

One Answer

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-numbervalue{Callout}}{#2}%
begin{tikzpicture}[overlay,remember picture]
only#4{path (tn-numbervalue{Callout}.north) 
 ++ (0.5,0.5) node[#1,above,draw,align=center,rectangle callout,
    callout absolute pointer={(tn-numbervalue{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

Answered by user231225 on April 9, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP