Refer to this question I try to draw an interrupted line, but with text below / above and arrows at both ends.
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations}
\usetikzlibrary{positioning}
\begin{document}
\pgfdeclaredecoration{discontinuity}{start}{
\state{start}[width=0.5\pgfdecoratedinputsegmentremainingdistance-0.5\pgfdecorationsegmentlength,next state=first wave]{}
\state{first wave}[width=\pgfdecorationsegmentlength, next state=second wave]
{
\pgfpathlineto{\pgfpointorigin}
\pgfpathmoveto{\pgfqpoint{0pt}{\pgfdecorationsegmentamplitude}}
\pgfpathcurveto
{\pgfpoint{-0.25*\pgfmetadecorationsegmentlength}{0.75\pgfdecorationsegmentamplitude}}
{\pgfpoint{-0.25*\pgfmetadecorationsegmentlength}{0.25\pgfdecorationsegmentamplitude}}
{\pgfpoint{0pt}{0pt}}
\pgfpathcurveto
{\pgfpoint{0.25*\pgfmetadecorationsegmentlength}{-0.25\pgfdecorationsegmentamplitude}}
{\pgfpoint{0.25*\pgfmetadecorationsegmentlength}{-0.75\pgfdecorationsegmentamplitude}}
{\pgfpoint{0pt}{-\pgfdecorationsegmentamplitude}}
}
\state{second wave}[width=0pt, next state=do nothing]
{
\pgfpathmoveto{\pgfqpoint{0pt}{\pgfdecorationsegmentamplitude}}
\pgfpathcurveto
{\pgfpoint{-0.25*\pgfmetadecorationsegmentlength}{0.75\pgfdecorationsegmentamplitude}}
{\pgfpoint{-0.25*\pgfmetadecorationsegmentlength}{0.25\pgfdecorationsegmentamplitude}}
{\pgfpoint{0pt}{0pt}}
\pgfpathcurveto
{\pgfpoint{0.25*\pgfmetadecorationsegmentlength}{-0.25\pgfdecorationsegmentamplitude}}
{\pgfpoint{0.25*\pgfmetadecorationsegmentlength}{-0.75\pgfdecorationsegmentamplitude}}
{\pgfpoint{0pt}{-\pgfdecorationsegmentamplitude}}
\pgfpathmoveto{\pgfpointorigin}
}
\state{do nothing}[width=\pgfdecorationsegmentlength,next state=do nothing]{
\pgfpathlineto{\pgfpointdecoratedinputsegmentlast}
}
\state{final}
{
\pgfpathlineto{\pgfpointdecoratedpathlast}
}
}
\begin{tikzpicture}
\node[](S0){\LaTeX};
\node[above right = 26mm and 18mm of S0](S1){\LaTeX};
\def\myshift#1{\raisebox{1ex}}
\draw[decoration={discontinuity,amplitude=0.5cm,segment length=0.25cm,meta-segment length=0.5cm},decorate,<->,dotted,ultra thick,postaction={decorate,decoration={discontinuity,amplitude=0.5cm,segment length=0.25cm,meta-segment length=0.5cm,text along path,text align=center,text={|\sffamily\myshift|TEXTTEXT}}}](S0) -- (S1);
\end{tikzpicture}
\end{document}
RESULT
As we can see, the text is not readable and the arrows at the end of the lines are also missing.
EXPECTED RESULT
Thanks in advance!
positioning
library is needed, but even after usingexample-image
instead, and adding the library, the code produces an error.\LaTeX
?