11

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?

3
  • 5
    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, 2011 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, 2013 at 16:17
  • @TRiG: Yes, that’s why I said “bad imitation”. I have two friends with Tourette’s.
    – Jon Purdy
    Apr 23, 2013 at 20:22

4 Answers 4

18

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}

1
  • Beautifully done, Caramdir! Thanks. =) Aug 14, 2011 at 16:56
6

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}
1
  • Thanks Mike, I really like your approach! =) Aug 14, 2011 at 16:52
6

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

1
  • Very nice, Alan! I really like your tikz and pstricks codes. Aug 14, 2011 at 16:55
5

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

1
  • Thanks for a pstricks implementation, Herbert! Aug 14, 2011 at 16:54

You must log in to answer this question.

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