I would like to draw special lines over parts of my equations, basically the functionality that overline provides. However, I do not want a straight line, but a squiggly line, as in rightsquigarrow.

I have also tried widetilde (not exactly squiggly, but at least it is something), but it cannot be made arbitrarily long, which is a requirement for me.

A typical usecase would be

\oversquigline{ABCD} \\

It should look something like this:

enter image description here

How can I achieve what I want?


Based on How to create a squiggle arrow with some text on it in TikZ?, I have come up with this:



\begin{tikzpicture}[decoration={snake,amplitude=0.2ex},baseline={([yshift=-.8ex]current bounding box)}]
\node (\thesarrow) {$#1$};
\draw[->,decorate] ([xshift=1ex,yshift=-0.2ex]\thesarrow.north west) -- ([xshift=-1ex,,yshift=-0.2ex]\thesarrow.north east);

Here is an example:


x=&\oversquigline{ABCD} \\
y=&\oversquigline{A^i} + \oversquigline{B_x^i} + \oversquigline{a}


enter image description here

It works reasonably well, but is a bit ugly for "a"...

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.