17

I want to connect two "positions" of text with an upwards curved arrow. So far I have done this (trivially following the TikZ manual):

current state

\documentclass[a4paper,12pt]{book}
\usepackage{tikz}
\usetikzlibrary{arrows,shapes}
\begin{document}
How can I have from here \tikz[remember picture] \node[circle,fill=red!50] (n1) {}; a curved upwards arrow till here\tikz[remember picture] \node[fill=blue!50] (n2) {};?
\begin{tikzpicture}[remember picture,overlay]
\draw[->,very thick]  (n1) -- (n2);
\end{tikzpicture}
\end{document}

If by any chance you know how to add text above it, it would be nice.

0

3 Answers 3

30

Like this:

\documentclass[a4paper,12pt]{book}
\usepackage{tikz}
\usetikzlibrary{arrows,shapes}
\begin{document}
How can I have from here \tikz[remember picture] \node[circle,fill=red!50] (n1) {}; a curved upwards arrow till here\tikz[remember picture] \node[fill=blue!50] (n2) {};?
\begin{tikzpicture}[remember picture,overlay]
\draw[->,very thick]  (n1) to [out=45,in=135] (n2);
\end{tikzpicture}
\end{document}

enter image description here

And maybe a little bit like this:

\documentclass[a4paper,12pt]{book}
\usepackage{tikz}
\usetikzlibrary{arrows,shapes}
\begin{document}
How can I have from here \tikz[remember picture] \node[circle,fill=red!50] (n1) {}; a curved upwards arrow till here\tikz[remember picture] \node[fill=blue!50] (n2) {};?
\begin{tikzpicture}[remember picture,overlay]
\draw[->,very thick]  (n1) to [out=45,in=135] node[above] {some text here} (n2);
\end{tikzpicture}
\end{document}

enter image description here

And even fancier like this:

\documentclass[a4paper,12pt]{book}
\usepackage{tikz}
\usetikzlibrary{arrows,shapes,decorations.text}
\begin{document}
How can I have from here \tikz[remember picture] \node[circle,fill=red!50] (n1) {}; a curved upwards arrow till here\tikz[remember picture] \node[fill=blue!50] (n2) {};?
\begin{tikzpicture}[remember picture,overlay]
\def\myshift#1{\raisebox{1ex}}
\draw[->,very thick,postaction={decorate,decoration={text along path,text align=center,text={|\myshift|some bent text here}}}]  (n1) to [out=45,in=135] (n2);
\end{tikzpicture}
\end{document}

enter image description here

Last approach taken from this question here.

15

Another idea:

\documentclass[a4paper,12pt]{book}
\usepackage{tikz}
\usetikzlibrary{arrows,shapes}
\begin{document}
How can I have from here \tikz[remember picture] \node[circle,fill=red!50] (n1) {}; a curved upwards arrow till here \tikz[remember picture] \node[fill=blue!50] (n2) {};?
\begin{tikzpicture}[remember picture,overlay]
\draw[->,very thick]  (n1)  .. controls +(1,1) and +(-1,1) .. node[above] {text above}(n2);
\end{tikzpicture}
\end{document}

enter image description here

Use .. controls +(1,.5) and +(-1,.5) .. if you want it even flatter.

14

No bending but...

\documentclass[a4paper,12pt]{book}
\usepackage{tikz}
\usetikzlibrary{arrows,shapes,calc}
\begin{document}
How can I have from here \tikz[remember picture,baseline=-0.5ex] \node[circle,fill=red!50] (n1) {}; a curved upwards arrow till here \tikz[remember picture,baseline=-0.5ex] \node[fill=blue!50] (n2) {};?
\begin{tikzpicture}[remember picture,overlay]
\draw[->,very thick]  (n1) -- ++(0,2ex)coordinate (a) -- node[above]{some text here} ($(a-|n2)$) -- (n2);
\end{tikzpicture}
\end{document}

enter image description here

Add \footnotesize (or similar) to

node[above,font=\footnotesize]{some text here}

to get

enter image description here

1
  • 3
    I don't know... I spot two 90 degree bends. Nov 6, 2014 at 12:58

You must log in to answer this question.

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