I want to be able to label an edge with a part of the label above it and the other part below it like in the following example :
For the moment I have this solution:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{positioning}
\begin{document}
\begin{tikzpicture}[text=black]
\node [draw, ] (a) at (0,0) {a};
\node [draw, below left=4 of a] (b) {b};
\draw[->] (a) to[bend left] node[midway, sloped, above]{to} node[midway, sloped, below]{b} (b.east) ;
\end{tikzpicture}
\end{document}
Where I create tWo midway nodes, one above the edge, the other one below it but I wanted to know if there is a simpler solution.
[EDIT] @AndréC solutions gives the following result on Overleaf: