I want to put a label (node) alongside a certain line segment which is the section of a line between the intersection points with another line.
As an example of what I mean see the picture below, I want to be able to put a node labeled C somewhere alongside the thick line segment. In this example I attempt to put it halfway using the syntax node[midway].
The picture was created with the following code
\documentclass[tikz]{standalone}
\usepackage{pgfplots}
\usetikzlibrary{fillbetween}
\begin{document}
\begin{tikzpicture}
\path[name path = line1, draw] (-1,0) .. controls (2,2) and (2,1) .. (0,-1) node {line 1};
\path[name path = line2, draw] (-1,1) -- (1,-1) node {line 2};
\draw[very thick, intersection segments={of=line1 and line2, sequence=L2}] node[midway] {$C$};
\end{tikzpicture}
\end{document}
Preferably I want to be able to put the label using the way I attempted, that is to use the syntax node[midway] for normal paths as is explained in the TikZ manual at the first tutorial (Tutorial: A Picture for Karl’s Students) at section 2.21 (adding text). The image and code below are from the manual.
\begin{tikzpicture}
\draw (0,0) .. controls (6,1) and (9,1) ..
node[near start,sloped,above] {near start}
node {midway}
node[very near end,sloped,below] {very near end} (12,0);
\end{tikzpicture}
Additionally the thick line is not exactly the line segment of line 1 between the intersection points with line 2. If you look closely you can see that it just 'overshoots' the intersection point. So perhaps this way of creating this line segment, using intersection segments, is not the way to go. A better way must exist but so far I couldn't find it in the manual or by Googling.





sequence=L2is unknown. Is there some missing definition? – dexteritas Jul 28 '17 at 19:02-synctex=1 --shell-escape -interaction=nonstopmodebut to be honest, this is somewhat of a long shot. – Alwin Jul 28 '17 at 19:08