3

How do I ensure that Text 3 (as well as Text 1') has the same orientation as Text 1 and Text 2?

I want one turn of my head to be sufficient to be able to read the text.


Minimal example:

\documentclass[a4paper]{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[->, node distance=3cm, every node/.style={sloped},]
    \node (a)                    {a};
    \node (c) [below right of=a] {c};
    \node (b) [below left  of=c] {b};
    \path (a) [bend right] edge node [above] {Text 1}  (b)
          (b) [bend right] edge node [above] {Text 1'} (a)
          (b) [bend right] edge node [above] {Text 2}  (c)
          (a) [bend left]  edge node [above] {Text 3}  (c);
\end{tikzpicture}
\end{document}

Updated example

  • 1
    The image looks quite fine to me. Turning Text 3 upside-down would change the angle from about -45° to about 135°. I can read text without turning my head, if it is not to much sloped, but my neck is not as flexible to be able to turn my head to a full right angle. Thus I would have to make a handstand or turn the monitor instead. – Heiko Oberdiek Sep 25 '16 at 10:10
  • @HeikoOberdiek thanks, I can see your point (but want to do it anyhow ;)). I tried to give a better example (added Text 1'). Turning my head now (to read Text 1) results in Text 1' being upside down. – Display Name Sep 25 '16 at 10:34
7

The text labels can be rotated:

\documentclass[a4paper]{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[->, node distance=3cm, every node/.style={sloped},]
    \node (a)                    {a};
    \node (c) [below right of=a] {c};
    \node (b) [below left  of=c] {b};
    \path (a) [bend right] edge node [above] {Text 1}  (b)
          (b) [bend right] edge node [above, rotate=180] {Text 1'} (a)
          (b) [bend right] edge node [above] {Text 2}  (c)
          (a) [bend left]  edge node [above, rotate=180] {Text 3}  (c);
\end{tikzpicture}
\end{document}

Result

This fixes the issue with Text 1'. The other case Text 3 is now upside-down, much less readable IMHO, see my comment to the question.

A variation with less slopes, where the labels are moved a little to the arrow start points:

\documentclass[a4paper]{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[->, node distance=3cm, every node/.style={sloped},]
    \node (a)                    {a};
    \node (c) [below right of=a] {c};
    \node (b) [below left  of=c] {b};
    \path (a) [bend right] edge node [above, pos=.35] {Text 1}  (b)
          (b) [bend right] edge node [above, pos=.35] {Text 1'} (a)
          (b) [bend right] edge node [above, pos=.4] {Text 2}  (c)
          (a) [bend left]  edge node [above, pos=.35] {Text 3}  (c);
\end{tikzpicture}
\end{document}

Result

IMHO, the label angles should be in the range -90° to +90° as the default behavior to avoid upside-down labels:

\documentclass[a4paper]{article}
\usepackage{textcomp}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[->, node distance=3cm, every node/.style={sloped},]
    \path
      \foreach \a in {0, 15, ..., 345} {
        (0, 0) edge node[above, pos=.8]{\color{blue}\a\textdegree} (\a:4cm)
      }
    ;
\end{tikzpicture}
\end{document}

Result

Changing the slope for Text 3 is a manual intervention. An automated solution would need general rules. If these rules require that the label orientation depends on each other, this would also add a serious complexity level, where the result is quite unclear to be an improvement at all.

  • Is it possible to achieve the same without (manually) adding rotate=180 to the affected edges? – Display Name Sep 25 '16 at 10:52
  • @DisplayName See the updated answer. – Heiko Oberdiek Sep 25 '16 at 11:20

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.