I'd like to have to automatically give a position to a node label without needing to manually choose the angle using the label options. What I want is just to say "please go in the middle of this path, and perpendicularly to the path, mode n centimeters and place my label here". I don't want to specify manually the angle (too annoying to compute when you have not trivial paths), and the options right
and left
are not good because they don't go perpendicularly to the path, but rather horizontally or vertically.
Any idea?
Thanks.
MWE:
\documentclass{article}
\usepackage{tikz}
\begin{document}
A is too below, B is too right\\
\begin{tikzpicture}
\draw (0,0) -- node[midway,below]{A} node[midway,right]{B}
node[circle,fill=red,inner sep=.5pt]{} (3,1.5);
\end{tikzpicture}
\end{document}
auto
key with possiblyswap
? – percusse May 17 '18 at 23:28