# Equivalent of pstricks command \psecurve in tikz

What is the equivalent of the pstricks command \psecurve in tikz?

The yellow line is the \psecurve. It's basically the same as the \pscurve: the curve is defined by all the named points, but is not drawn to the end points.

\documentclass{article}
\usepackage{pstricks}
\pagestyle{empty}
\begin{document}

\begin{pspicture}(0,-3)(5,5)
\pscurve[linewidth=5pt,arrows=<->](0,0)(2,3)(4,-3)(2,5)(1,0)
\psecurve[linewidth=1.5pt,linecolor=yellow](0,0)(2,3)(4,-3)(2,5)(1,0)
\end{pspicture}

\end{document}


You can use my style between style (from TikZ: Thick curve segment in a curve):

\documentclass[margin=2mm]{standalone}
\usepackage{tikz}
\usepackage{ifthen}
\usetikzlibrary{decorations.pathreplacing,decorations.markings}
\newcounter{pos}
\tikzset{
initcounter/.code={\setcounter{pos}{0}},
style between/.style n args={3}{
postaction={initcounter, decorate,
decoration={show path construction, curveto code={
\pgfmathtruncatemacro{\min}{#1 - 1}
\ifthenelse{\thepos < #2 \AND \thepos > \min}{
\draw[#3]
(\tikzinputsegmentfirst) .. controls
(\tikzinputsegmentsupporta) and (\tikzinputsegmentsupportb)
.. (\tikzinputsegmentlast);
}{}
}
}
},
},
}
\begin{document}
\begin{tikzpicture}[line join=round]
\draw[line width=5pt,<->]
(0,0) to[out=70,in=180] (2,3) to[out=0,in=180] (4,-3)
to [out=0,in=0] (2,5) to[out=180,in=100] (1,0);

\path [style between={2}{4}{line width=1.5pt,yellow}]
(0,0) to[out=70,in=180] (2,3) to[out=0,in=180] (4,-3)
to [out=0,in=0] (2,5) to[out=180,in=100] (1,0);
\end{tikzpicture}
\end{document}

• Could you explain how this works at all? Feb 19, 2013 at 0:33
• @A.Ellett Look at the show path construction decoration into the pgf manual. Feb 19, 2013 at 0:38
• That's what I've been doing. It still looks like magic to me. Feb 19, 2013 at 0:43
• The default arrow head of TikZ is not as sharp as that of PSTricks. (But it is not the point here) Feb 19, 2013 at 2:09
• @GarbageCollector TikZ \neq PSTricks. You may use >=stealth... Feb 19, 2013 at 7:00