# How to put a mathematical object like tensor above a node on a curved line

I want to draw a curved line and put a tensor above and below a node on it, something like this:

I tried this:

\documentclass{scrartcl}
\usepackage{tensor}

\usepackage{tikz}

\begin{document}

\begin{tikzpicture}[scale=0.8]

\draw[line width=4pt] (0,0) ..controls (2,2) and (5,-1) .. (10,2);
node[pos=0.5,below right, inner xsep=-1ex] {$\tensor{g}{_a_b}$}
\end{tikzpicture}

\end{document}


I know that I'm mixing it up with something else, but I do not enough time. Thanks!

I'm surprised that even worked. You're ending the \draw path with the semicolon before you add the node. Move the semicolon to after the node and it's fine.

\documentclass{scrartcl}
\usepackage{tensor}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw[line width=4pt] (0,0) ..controls (2,2) and (5,-1) .. (10,2)
node[pos=0.5,below] {$\tensor{g}{_a_b}$} ;
\end{tikzpicture}
\end{document}


\documentclass{scrartcl}
\usepackage{tensor}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw[line width=2pt] (0,0) ..controls (2,2) and (5,-1) .. (10,2)
node[fill,circle,minimum size=8pt,inner sep=0pt,pos=0.4,label=below:{$\tensor{g}{_a_b}$},label=above:{$t=0$}] {}
node[fill,circle,minimum size=8pt,inner sep=0pt,pos=0.8,label=below:{$\tensor{g}{_a_b}$},label=above:{$t$}] {};
\end{tikzpicture}
\end{document}

• Thanks a lot. But I do not understand "minimum size=4pt". That has no influence on result. Oct 8 '15 at 21:45
• @H.B. Sorry, a small glitch on my side. It does have an effect, for sufficiently large values. However, by default you have an inner sep that is larger (0.333em), so the node will be larger than 4pt anyway. In the updated code I set the inner sep to zero, making this more predictable. Oct 8 '15 at 21:49