[Tex/LaTex] Adding slurs to words in a text

musictikz-pgf

Friends, I have a special case in which I need to insert slurs (music) in some words in a text. A slur is a curved line connecting notes on a score to indicate that they are to be played or sung legato:

Slur 1
Slur 2

It would be something like this:

Hello world

These "text" slurs won't be used on very long words.

I thought of using \draw (point) arc (x:y:z), but I'm stuck on how can I obtain the arc lenght for such words. Besides, I have no idea of what to do if there's a line break, though I don't believe this will ever happen.

I don't if there are any specific packages for this purpose. Slurs are common in music, but not in text (at least, on this context). Any ideas?

Best Answer

The bend right option is quite useful for this kind of thing:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc}

\newcommand*\slur[1]{%
    \tikz[baseline=0]{
        \node[anchor=base,inner sep=0,outer sep=0] (A) {#1};
        \path[-] (A.south west) + (\pgflinewidth,0) edge [bend right=20] ($(A.south east)-(\pgflinewidth,0)$);
    }%
}

\begin{document}
Hello world, how \slur{are you}?
\end{document}