Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
2  
From the title, I thought you wanted to insert ethnic slurs at random points within words throughout a text, like some bad imitation of Tourette's. The conclusions we jump to… –  Jon Purdy Aug 14 '11 at 3:17
    
@JonPurdy. You're thinking of coprolalia, which is an occasional feature of Tourette's syndrome, but not an intrinsic part of the condition. –  TRiG Apr 23 '13 at 16:17
    
@TRiG: Yes, that’s why I said “bad imitation”. I have two friends with Tourette’s. –  Jon Purdy Apr 23 '13 at 20:22
add comment

4 Answers 4

up vote 16 down vote accepted

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}

share|improve this answer
    
Beautifully done, Caramdir! Thanks. =) –  Paulo Cereda Aug 14 '11 at 16:56
add comment

If you really want an arc, here's a TikZ solution, although Mike's solution is nicely simple. I've also added a pstricks version if you prefer that.

\documentclass{article}
\usepackage{tikz}

\newcommand*{\slur}[1]{
   \tikz[baseline=0]{
     \node[inner sep={0pt}, outer sep={0pt},anchor=base] (A) {#1};
     \draw[very thick] (A.base west) .. controls +(0,-.5) and +(0,-.5) .. (A.base east);}
}
% pstricks alternative
%\usepackage{pst-node}
%\newcommand*{\psslur}[1]{\rnode{A}{}#1\rnode{B}
%   {}\nccurve[ncurv=.4,linewidth=1.2pt,angleA=-90,angleB=-90]{A}{B}}


\begin{document}

Some regular words. \slur{A slurred group} and some more regular words.

\end{document}

output of code

share|improve this answer
    
Very nice, Alan! I really like your tikz and pstricks codes. –  Paulo Cereda Aug 14 '11 at 16:55
add comment

Run with xelatex or latex

\documentclass{article}
\usepackage{pst-node,xspace}    
\newcommand*\psslur[2][]{\rnode[lb]{A}{#2\rnode[rb]{B}{}}%
   \nccurve[#1,ncurv=.4,linewidth=1.2pt,
            angleA=-80,angleB=-100]{A}{B}\xspace}

\begin{document}

\psslur{Some} regular words. \psslur[linecolor=red]{A slurred group} 
   and some more regular words.

\end{document}

enter image description here

share|improve this answer
    
Thanks for a pstricks implementation, Herbert! –  Paulo Cereda Aug 14 '11 at 16:54
add comment

It's not exactly an arc, but it may be close enough for your purposes. Using Table 175, Comprehensive LaTeX Symbol List:

enter image description here

\documentclass{article}
\usepackage{amsmath,mathabx}

\newcommand{\slur}[1]{$\undergroup{\text{#1}}$}

\begin{document}
Hello world, how \slur{are you}?
\end{document}
share|improve this answer
    
Thanks Mike, I really like your approach! =) –  Paulo Cereda Aug 14 '11 at 16:52
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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