5

Any suggestion on how to get slanted text for the labels "Diapason", "Diapente" and "Diatessaron"?

(PDFLATEX on Linux Lubuntu with texlive 2014)

Thank you, A

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

\begin{tikzpicture}[scale=5]


\coordinate [label=above:ut] (ut) at (2,0);
\coordinate [label=above:fa'] (fa') at (4,0);


\coordinate [label=above:C] (C) at (2, 2.4);
\coordinate [label=above:c] (c) at (4, 1.2);

\draw (ut) -- (fa');
\draw (ut) -- (C);
\draw (C) -- (c);
\draw (fa') -- (c);

\coordinate [label=above:sol] (sol) at ($ (ut)!2.0/3!(fa') $);
\coordinate [label=above:G] (G) at ($ (C)!2.0/3!(c) $);
\draw (sol) --(G);

\node [fill=black, inner sep=1pt] (c') at ($ (ut)!1.0/6!(C) $) {};
\node [fill=black, inner sep=1pt] (c') at ($ (ut)!2.0/6!(C) $) {};
\node [fill=black, inner sep=1pt] (c') at ($ (ut)!3.0/6!(C) $) {};
\node [fill=black, inner sep=1pt] (c') at ($ (ut)!4.0/6!(C) $) {};
\node [fill=black, inner sep=1pt] (c') at ($ (ut)!5.0/6!(C) $) {};

\node [fill=black, inner sep=1pt] (c') at ($ (fa')!1.0/3!(c) $) {};
\node [fill=black, inner sep=1pt] (c') at ($ (fa')!2.0/3!(c) $) {};
\draw (fa') -- (c);

\node [fill=black, inner sep=1pt] (c') at ($ (sol)!1.0/4!(G) $) {};
\node [fill=black, inner sep=1pt] (c') at ($ (sol)!2.0/4!(G) $) {};
\node [fill=black, inner sep=1pt] (c') at ($ (sol)!3.0/4!(G) $) {};


\draw [bend right=800]  (ut) to node [sloped, above] {Diapason} (fa');
\draw [bend right=800]  (ut) to node [sloped, above] {Diapente} (sol);
\draw [bend right=800]  (sol) to node [sloped, above] {Diatessaron} (fa');


\end{tikzpicture}
\end{document}

enter image description here

  • You can just put them in \textsl{...} – Dan H. Sep 18 '14 at 10:33
  • I am trying this \draw [bend right=800] (sol) to node [sloped, above] {\textsl{Diatessaron}} (fa'); but it does not seem to work. Do I need a particular tikz library for sloped text? – user56153 Sep 18 '14 at 10:38
  • I just changed the line to \draw [bend right=800] (sol) to node [above] {\textsl{Diatessaron}} (fa'); and its fine. Maybe you can add to your question, what system, compiler etc. you use. – Dan H. Sep 18 '14 at 10:44
3

You can use decorations.text library:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc}
\usetikzlibrary{decorations.text}
\begin{document}

\begin{tikzpicture}[scale=5]


\coordinate [label=above right:ut] (ut) at (2,0);
\coordinate [label=above right:fa'] (fa') at (4,0);


\coordinate [label=above:C] (C) at (2, 2.4);
\coordinate [label=above:c] (c) at (4, 1.2);

\draw (ut) -- (fa');
\draw (ut) -- (C);
\draw (C) -- (c);
\draw (fa') -- (c);

\coordinate [label=above right:sol] (sol) at ($ (ut)!2.0/3!(fa') $);
\coordinate [label=above:G] (G) at ($ (C)!2.0/3!(c) $);
\draw (sol) --(G);

\node [fill=black, inner sep=1pt] (c') at ($ (ut)!1.0/6!(C) $) {};
\node [fill=black, inner sep=1pt] (c') at ($ (ut)!2.0/6!(C) $) {};
\node [fill=black, inner sep=1pt] (c') at ($ (ut)!3.0/6!(C) $) {};
\node [fill=black, inner sep=1pt] (c') at ($ (ut)!4.0/6!(C) $) {};
\node [fill=black, inner sep=1pt] (c') at ($ (ut)!5.0/6!(C) $) {};

\node [fill=black, inner sep=1pt] (c') at ($ (fa')!1.0/3!(c) $) {};
\node [fill=black, inner sep=1pt] (c') at ($ (fa')!2.0/3!(c) $) {};
\draw (fa') -- (c);

\node [fill=black, inner sep=1pt] (c') at ($ (sol)!1.0/4!(G) $) {};
\node [fill=black, inner sep=1pt] (c') at ($ (sol)!2.0/4!(G) $) {};
\node [fill=black, inner sep=1pt] (c') at ($ (sol)!3.0/4!(G) $) {};

\draw[postaction={decorate,decoration={text along path,text align=center,text={Diapason},raise=5pt}}](ut)to[bend right=800] (fa'){};
\draw[postaction={decorate,decoration={text along path,text align=center,text={Diapente},raise=5pt}}](ut)to[bend right=800] (sol){};
\draw[postaction={decorate,decoration={text along path,text align=center,text={Diatessaron},raise=5pt}}](sol)to[bend right=800] (fa'){};

%\draw [bend right=800]  (ut) to node [sloped, above] {Diapason} (fa');
%\draw [bend right=800]  (ut) to node [sloped, above] {Diapente} (sol);
%\draw [bend right=800]  (sol) to node [sloped, above] {Diatessaron} (fa');


\end{tikzpicture}
\end{document}

I have also changed the labels to above right as in label=above right:ut to improve readability.

enter image description here

You can further reduce typing by using a loop like

\foreach \x in {0.16,0.32,...,0.8}{
\node [fill=black, inner sep=1pt]  at ($ (ut)!\x!(C) $) {};
}
\foreach \x in {0.333,0.666}{
\node [fill=black, inner sep=1pt]  at ($ (fa')!\x!(c) $) {};
}
\foreach \x in {0.25,0.5,0.75}{
\node [fill=black, inner sep=1pt]  at ($ (sol)!\x!(G) $) {};
}

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.