I tried to reproduce Andrew Stacey's graph from the question "Creating this vectorised watermark in TikZ", but I get several error messages and no PDF file is produced.
However, if I use Overleaf, it works perfectly, I don't understand why. Maybe Overleaf uses an old version of the package?
My technical level in Latex is quite low, would you have any ideas to help me to make this file compilable?
\documentclass{article}
% \url{https://tex.stackexchange.com/q/427775/86}
\usepackage{tikz}
\usetikzlibrary{calligraphy}
\ExplSyntaxOn
\NewDocumentCommand \SPathSplit { m m m m }
{
\spath_get:nnN {#2} {path} \l__tmpa_tl
\spath_split_curve:nVNN {#1} \l__tmpa_tl \l__tmpb_tl \l__tmpc_tl
\spath_clear_new:n {#3}
\spath_clear_new:n {#4}
\spath_put:nnV {#3} {path} \l__tmpb_tl
\spath_put:nnV {#4} {path} \l__tmpc_tl
}
\ExplSyntaxOff
\makeatletter
\tikzset{save as spath/.code={%
\tikz@addmode{%
\pgfsyssoftpath@getcurrentpath\spath@tmp@path%
\MakeSPath{#1}{\spath@tmp@path}%
}%
},%
restore spath/.code={%
\SPathInfoInto{#1}{minbb}{\spath@tmp@pt}%
\expandafter\pgfqpoint\spath@tmp@pt
\pgf@protocolsizes\pgf@x\pgf@y
\SPathInfoInto{#1}{maxbb}{\spath@tmp@pt}%
\expandafter\pgfqpoint\spath@tmp@pt
\pgf@protocolsizes\pgf@x\pgf@y
\SPathInfoInto{#1}{path}{\spath@tmp@path}%
\pgfsyssoftpath@setcurrentpath\spath@tmp@path
},
heavy line width=.8pt,
light line width=.1pt,
line cap=butt
}
\makeatother
\begin{document}
\begin{tikzpicture}
\pen (0,0);
\clip (1,-5) rectangle (11,1);
\foreach[count=\n] \x in {0,0.05,...,2}{
\tikzset{every path/.style={blue!\n!red!80},pen colour=blue!\n!red!80}
\begin{scope}[opacity=.35,transparency group]
\path[save spath=curve] (0,\x) .. controls (4-\x,-4-3*\x) and (11-2*\x,4-3*\x) .. (12,-5+3*\x);
\SPathSplit{1/2}{curve}{first}{last}
\SPathSplit{1/2}{first}{first}{middle}
\draw[ultra thin, restore spath=first];
\calligraphy[heavy, restore spath=middle];
\draw[ultra thin, restore spath=last];
\end{scope}
\begin{scope}[opacity=.35,transparency group]
\path[save spath=curve] (0,\x-1) .. controls (4-\x,\x-2) and (11-2*\x,-4-3*\x) .. (12,-3+3*\x);
\SPathSplit{3/4}{curve}{first}{last}
\SPathSplit{3/4}{last}{middle}{last}
\draw[ultra thin, restore spath=first];
\calligraphy[heavy, restore spath=middle];
\draw[ultra thin, restore spath=last];
\end{scope}
\begin{scope}[opacity=.35,transparency group]
\path[save spath=curve] (0,\x-3) .. controls (4-\x,\x-2) and (11-4*\x,-1-4*\x) .. (12,-5+3.5*\x);
\SPathSplit{1/4}{curve}{first}{last}
\SPathSplit{2/3}{last}{middle}{last}
\draw[ultra thin, restore spath=first];
\calligraphy[heavy, restore spath=middle];
\draw[ultra thin, restore spath=last];
\end{scope}
}
\end{tikzpicture}
\end{document}
log
file extract :
! Package pgfkeys Error: I do not know the key '/tikz/save spath', to which you
passed 'curve', and I am going to ignore it. Perhaps you misspelled it.
See the pgfkeys package documentation for explanation.
Type H <return> for immediate help.
...
l.79 }
This error message was generated by an \errmessage
command, so I can't give any explicit help.
Pretend that you're Hercule Poirot: Examine all clues,
and deduce the truth by order and method.
! Undefined control sequence.
\SPathSplit code #1#2#3#4->\spath_get:nnN
{#2}{path}\l__tmpa_tl \spath_split...
l.79 }
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\SPathSplit code ...get:nnN {#2}{path}\l__tmpa_tl
\spath_split_curve:nVNN {#...
l.79 }
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\SPathSplit code ...pa_tl \spath_split_curve:nVNN
{#1}\l__tmpa_tl \l__tmpb_t...
l.79 }
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\SPathSplit code ...it_curve:nVNN {#1}\l__tmpa_tl
\l__tmpb_tl \l__tmpc_tl \s...
l.79 }
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\SPathSplit code ...N {#1}\l__tmpa_tl \l__tmpb_tl
\l__tmpc_tl \spath_clear_n...
l.79 }
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\SPathSplit code ...pa_tl \l__tmpb_tl \l__tmpc_tl
\spath_clear_new:n {#3}\sp...
l.79 }
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\SPathSplit code ...l__tmpc_tl \spath_clear_new:n
{#3}\spath_clear_new:n {#4...
l.79 }
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\SPathSplit code ..._new:n {#3}\spath_clear_new:n
{#4}\spath_put:nnV {#3}{pa...
l.79 }
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\SPathSplit code ...lear_new:n {#4}\spath_put:nnV
{#3}{path}\l__tmpb_tl \spa...
l.79 }
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\SPathSplit code ...put:nnV {#3}{path}\l__tmpb_tl
\spath_put:nnV {#4}{path}\...
l.79 }
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\SPathSplit code ...th}\l__tmpb_tl \spath_put:nnV
{#4}{path}\l__tmpc_tl
l.79 }
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\SPathSplit code ...put:nnV {#4}{path}\l__tmpc_tl
l.79 }
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\SPathSplit code #1#2#3#4->\spath_get:nnN
{#2}{path}\l__tmpa_tl \spath_split...
l.79 }
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\SPathSplit code ...get:nnN {#2}{path}\l__tmpa_tl
\spath_split_curve:nVNN {#...
l.79 }
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\SPathSplit code ...pa_tl \spath_split_curve:nVNN
{#1}\l__tmpa_tl \l__tmpb_t...
l.79 }
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\SPathSplit code ...it_curve:nVNN {#1}\l__tmpa_tl
\l__tmpb_tl \l__tmpc_tl \s...
l.79 }
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\SPathSplit code ...N {#1}\l__tmpa_tl \l__tmpb_tl
\l__tmpc_tl \spath_clear_n...
l.79 }
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\SPathSplit code ...pa_tl \l__tmpb_tl \l__tmpc_tl
\spath_clear_new:n {#3}\sp...
l.79 }
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\SPathSplit code ...l__tmpc_tl \spath_clear_new:n
{#3}\spath_clear_new:n {#4...
l.79 }
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\SPathSplit code ..._new:n {#3}\spath_clear_new:n
{#4}\spath_put:nnV {#3}{pa...
l.79 }
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\SPathSplit code ...lear_new:n {#4}\spath_put:nnV
{#3}{path}\l__tmpb_tl \spa...
l.79 }
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\SPathSplit code ...put:nnV {#3}{path}\l__tmpb_tl
\spath_put:nnV {#4}{path}\...
l.79 }
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\SPathSplit code ...th}\l__tmpb_tl \spath_put:nnV
{#4}{path}\l__tmpc_tl
l.79 }
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\SPathSplit code ...put:nnV {#4}{path}\l__tmpc_tl
l.79 }
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\pgfkeys@code #1\pgfeov ->\SPathInfoInto
{#1}{minbb}{\spath@tmp@pt }\expanda...
l.79 }
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\pgfkeys@code ...foInto {#1}{minbb}{\spath@tmp@pt
}\expandafter \pgfqpoint \...
l.79 }
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\pgfkeys@code ...ndafter \pgfqpoint \spath@tmp@pt
\pgf@protocolsizes \pgf@x ...
l.79 }
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Missing number, treated as zero.
<to be read again>
\relax
l.79 }
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)
! Illegal unit of measure (pt inserted).
<to be read again>
\relax
l.79 }
Dimensions can be in units of em, ex, in, pt, pc,
cm, mm, dd, cc, nd, nc, bp, or sp; but yours is a new one!
I'll assume that you meant to say pt, for printer's points.
To recover gracefully from this error, it's best to
delete the erroneous units; e.g., type `2' to delete
two letters. (See Chapter 27 of The TeXbook.)
! Missing = inserted for \ifdim.
<to be read again>
\relax
l.79 }
I was expecting to see `<', `=', or `>'. Didn't.
! Missing number, treated as zero.
<to be read again>
\relax
l.79 }
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)
! Illegal unit of measure (pt inserted).
<to be read again>
\relax
l.79 }
Dimensions can be in units of em, ex, in, pt, pc,
cm, mm, dd, cc, nd, nc, bp, or sp; but yours is a new one!
I'll assume that you meant to say pt, for printer's points.
To recover gracefully from this error, it's best to
delete the erroneous units; e.g., type `2' to delete
two letters. (See Chapter 27 of The TeXbook.)
! Missing number, treated as zero.
<to be read again>
\relax
l.79 }
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)
! Illegal unit of measure (pt inserted).
<to be read again>
\relax
l.79 }
Dimensions can be in units of em, ex, in, pt, pc,
cm, mm, dd, cc, nd, nc, bp, or sp; but yours is a new one!
I'll assume that you meant to say pt, for printer's points.
To recover gracefully from this error, it's best to
delete the erroneous units; e.g., type `2' to delete
two letters. (See Chapter 27 of The TeXbook.)
! Missing number, treated as zero.
<to be read again>
\global
l.79 }
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)
! Illegal unit of measure (pt inserted).
<to be read again>
\global
l.79 }
Dimensions can be in units of em, ex, in, pt, pc,
cm, mm, dd, cc, nd, nc, bp, or sp; but yours is a new one!
I'll assume that you meant to say pt, for printer's points.
To recover gracefully from this error, it's best to
delete the erroneous units; e.g., type `2' to delete
two letters. (See Chapter 27 of The TeXbook.)
! Missing number, treated as zero.
<to be read again>
\relax
l.79 }
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)
! Illegal unit of measure (pt inserted).
<to be read again>
\relax
l.79 }
Dimensions can be in units of em, ex, in, pt, pc,
cm, mm, dd, cc, nd, nc, bp, or sp; but yours is a new one!
I'll assume that you meant to say pt, for printer's points.
To recover gracefully from this error, it's best to
delete the erroneous units; e.g., type `2' to delete
two letters. (See Chapter 27 of The TeXbook.)
! Missing number, treated as zero.
<to be read again>
\relax
l.79 }
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)
! Illegal unit of measure (pt inserted).
<to be read again>
\relax
l.79 }
Dimensions can be in units of em, ex, in, pt, pc,
cm, mm, dd, cc, nd, nc, bp, or sp; but yours is a new one!
I'll assume that you meant to say pt, for printer's points.
To recover gracefully from this error, it's best to
delete the erroneous units; e.g., type `2' to delete
two letters. (See Chapter 27 of The TeXbook.)
! Missing = inserted for \ifdim.
<to be read again>
\relax
l.79 }
I was expecting to see `<', `=', or `>'. Didn't.
! Missing number, treated as zero.
<to be read again>
\relax
l.79 }
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)
! Illegal unit of measure (pt inserted).
<to be read again>
\relax
l.79 }
Dimensions can be in units of em, ex, in, pt, pc,
cm, mm, dd, cc, nd, nc, bp, or sp; but yours is a new one!
I'll assume that you meant to say pt, for printer's points.
To recover gracefully from this error, it's best to
delete the erroneous units; e.g., type `2' to delete
two letters. (See Chapter 27 of The TeXbook.)
! Missing number, treated as zero.
<to be read again>
\global
l.79 }
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)
! Illegal unit of measure (pt inserted).
<to be read again>
\global
l.79 }
Dimensions can be in units of em, ex, in, pt, pc,
cm, mm, dd, cc, nd, nc, bp, or sp; but yours is a new one!
I'll assume that you meant to say pt, for printer's points.
To recover gracefully from this error, it's best to
delete the erroneous units; e.g., type `2' to delete
two letters. (See Chapter 27 of The TeXbook.)
! Missing number, treated as zero.
<to be read again>
\relax
l.79 }
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)
! Illegal unit of measure (pt inserted).
<to be read again>
\relax
l.79 }
Dimensions can be in units of em, ex, in, pt, pc,
cm, mm, dd, cc, nd, nc, bp, or sp; but yours is a new one!
I'll assume that you meant to say pt, for printer's points.
To recover gracefully from this error, it's best to
delete the erroneous units; e.g., type `2' to delete
two letters. (See Chapter 27 of The TeXbook.)
! Missing number, treated as zero.
<to be read again>
\global
l.79 }
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)
! Illegal unit of measure (pt inserted).
<to be read again>
\global
l.79 }
Dimensions can be in units of em, ex, in, pt, pc,
cm, mm, dd, cc, nd, nc, bp, or sp; but yours is a new one!
I'll assume that you meant to say pt, for printer's points.
To recover gracefully from this error, it's best to
delete the erroneous units; e.g., type `2' to delete
two letters. (See Chapter 27 of The TeXbook.)
! Missing = inserted for \ifdim.
<to be read again>
\global
l.79 }
I was expecting to see `<', `=', or `>'. Didn't.
! Missing number, treated as zero.
<to be read again>
\global
l.79 }
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)
! Illegal unit of measure (pt inserted).
<to be read again>
\global
l.79 }
Dimensions can be in units of em, ex, in, pt, pc,
cm, mm, dd, cc, nd, nc, bp, or sp; but yours is a new one!
I'll assume that you meant to say pt, for printer's points.
To recover gracefully from this error, it's best to
delete the erroneous units; e.g., type `2' to delete
two letters. (See Chapter 27 of The TeXbook.)
! You can't use a prefix with `the character <'.
<to be read again>
<
l.79 }
I'll pretend you didn't say \long or \outer or \global or
\protected.
! Missing number, treated as zero.
<to be read again>
\global
l.79 }
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)
! Illegal unit of measure (pt inserted).
<to be read again>
\global
l.79 }
Dimensions can be in units of em, ex, in, pt, pc,
cm, mm, dd, cc, nd, nc, bp, or sp; but yours is a new one!
I'll assume that you meant to say pt, for printer's points.
To recover gracefully from this error, it's best to
delete the erroneous units; e.g., type `2' to delete
two letters. (See Chapter 27 of The TeXbook.)
! Missing number, treated as zero.
<to be read again>
\global
l.79 }
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)
! Illegal unit of measure (pt inserted).
<to be read again>
\global
l.79 }
Dimensions can be in units of em, ex, in, pt, pc,
cm, mm, dd, cc, nd, nc, bp, or sp; but yours is a new one!
I'll assume that you meant to say pt, for printer's points.
To recover gracefully from this error, it's best to
delete the erroneous units; e.g., type `2' to delete
two letters. (See Chapter 27 of The TeXbook.)
! Missing number, treated as zero.
<to be read again>
\global
l.79 }
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)
! Illegal unit of measure (pt inserted).
<to be read again>
\global
l.79 }
Dimensions can be in units of em, ex, in, pt, pc,
cm, mm, dd, cc, nd, nc, bp, or sp; but yours is a new one!
I'll assume that you meant to say pt, for printer's points.
To recover gracefully from this error, it's best to
delete the erroneous units; e.g., type `2' to delete
two letters. (See Chapter 27 of The TeXbook.)
! Missing = inserted for \ifdim.
<to be read again>
\global
l.79 }
I was expecting to see `<', `=', or `>'. Didn't.
! Missing number, treated as zero.
<to be read again>
\global
l.79 }
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)
spath3
library has been considerably updated recently and so code that digs a bit deeper, like this, might need adapting. I guess that overleaf uses the older version.