2

I try to make a diagram for an math skript which should show some implications. I want to write the premises for some of the implications curved like the arrows next to them. So far i got the right slope:

\documentclass[12pt]{article}
\usepackage{amssymb, amsmath}
\usepackage{tikz-cd} 
\usepackage[utf8]{inputenc}
\begin{document}

\begin{tikzcd}
A
&&
\\
&
B
\arrow[Rightarrow, bend left]{ul} [below, sloped, yshift=-2.0]{\text{loooong Text}}
&
\\
\end{tikzcd}

\end{document}

If by any chance you know how to do it, it would be nice.

Bernard
  • 271,350
  • 2
    Welcome to TeX.SE! I guess you need to load the decorations.text library and decorate a text along a path. –  May 22 '18 at 17:18
  • How does that work in tikz-cd? I gues i need a graphic like in tikz to use that on the right coordinates, don`t I? – JohannesB May 22 '18 at 17:29
  • I added an answer because it's too long for a comment. I'll be busy now but will be happy to assist you with layout changes in 2 hours or so. –  May 22 '18 at 17:39

1 Answers1

2

Like this...

\documentclass[12pt]{article}
\usepackage{amssymb, amsmath}
\usepackage{tikz-cd} 
\usetikzlibrary{decorations.text}
\usepackage[utf8]{inputenc}
\begin{document}

\begin{tikzcd}
A
&&
\\[0.5cm]
&
B
\arrow[Rightarrow, bend left,postaction={decoration={text along path,
text={loong Text},raise=2.5pt},decorate}]{ul} [below, sloped,
  yshift=-2.0]{\phantom{\text{loooong Text}}}
&
\\
\end{tikzcd}

\end{document}

enter image description here

And here is a version in which the text is above the path. And yes, if the text is too long, it will be cut. You can make the font smaller and play with the option fit to path .

\documentclass[12pt]{article}
\usepackage{amssymb, amsmath}
\usepackage{tikz-cd} 
\usetikzlibrary{decorations.text}
\usepackage[utf8]{inputenc}
\begin{document}

\begin{tikzcd}
A
\arrow[Leftarrow, bend right,postaction={decoration={text along path,
text align=fit to path,
text={|\sffamily\tiny|very long Text},raise=2.5pt},decorate}]{dr} [below, sloped,
  yshift=-2.0]{\phantom{\text{loooong Text}}}
&&
\\[0.5cm]
&
B
&
\\
\end{tikzcd}
\end{document}

enter image description here

or with text align=center,

enter image description here

  • Thanks for the help so far, when i try this the label has a cut off and i want it upside down. Thanks for the help! – JohannesB May 22 '18 at 17:45
  • Thank you very much! What i wanted exactly is to have the text at the lower side of the arrow but this is no problem with rais=-7pt Unfortunately i still have a problem: how do i use 'ü' in the text? i get an inputenc error with utf8. – JohannesB May 22 '18 at 20:21
  • @JohannesB Non-English characters have to be put into braces, see here, where you can also see how to move the text in case the standard raise does not give you the desired result. –  May 22 '18 at 20:27
  • Thank you very much! Now i finally have everything for the work. – JohannesB May 22 '18 at 20:30
  • @JohannesB Great! How about removing the comments then. BTW, if the answer worked for you, could you perhaps consider accepting it by clicking on the checkmark left of it? –  May 22 '18 at 20:34