The reason why it is shown at the origin is because there is no explicit second coordinate for TikZ to interpolate via pos
. One solution is to, roughly speaking, parameterize the arc
path via markings
library. This is simply a modification of my previous answer for marking a path with a node.
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations.markings}
\begin{document}
\begin{tikzpicture}[
arcnode/.style 2 args={
decoration={
raise=#1,
markings,
mark=at position 0.5 with {
\node[inner sep=0] {#2};
}
},
postaction={decorate}
}
]
\draw[->, arcnode={20pt}{$30$} ] (0,0) arc (0:-30:2cm) ;
\end{tikzpicture}
\end{document}
For some reason, when the curved paths become too short(e.g. your example path starts working after 1.095cm
for radius of the arc) it gives a Dimension too large
error, so probably, there is a detail that I don't know yet here. This is not the case for straight paths.