I have trouble with \tikzset.
When I create a function (here foo), the parameter \lfvert is not recognize on the second if statement. (The node didn't print it anymore)
And that give me the following error Missing number, treated as zero.
Despite the error didn't break my graph, I want to compile without error and avoid some snowball effect for the futur.
I try with {\lfvert == 0} instead of \lfvert == 0 but nothing change.
Can someone help me to find what it is the problem ? Cause the indication error looks to be too generic...
Best regard.
Code :
\documentclass{article}
\usepackage{graphicx}
\usepackage{pgf,tikz}
\usetikzlibrary{arrows}
\usepackage{ifthen}
\tikzset{
foo/.pic={
\tikzset{%
/foo/.cd,
#1
}
\ifthenelse{\cubenotateddd>0}{
\node[] at (5,5) {LFVERT=\lfvert};
\ifthenelse{\lfvert == 0}{
\node[] at (5,2) {LFVERT=\lfvert};
}{}
}{}
},
%% All parameters
/foo/.search also={/tikz},
/foo/.cd,
lfv/.store in=\lfvert,
cube/.store in=\cubenotateddd,
%% Initialisation of parameters
lfv=2,
cube=2,
}
\begin{document}
Hello, test variable in IF.
\newline
\begin{tikzpicture}[scale=0.09, line cap=round,line join=round,>=triangle
45,x=1.0cm,y=1.0cm]
\pic[] at (1cm,-3cm,0cm) {foo={lfv=2}};
\end{tikzpicture}
\end{document}
=instead of==; cf. https://texdoc.org/serve/ifthen.pdf/0 – DG' Dec 01 '22 at 09:03