In this mmwe, the same test work if used on a parameter of a macto and fails on a pgf key. Any idea why ?
\documentclass{article}
\usepackage{xparse,tikz}
\usetikzlibrary{calc}
\usepackage{ifluatex}
\makeatletter
\ifluatex
\RequirePackage{pdftexcmds}
\let\pdfstrcmp\pdf@strcmp
\let\pdffilemoddate\pdf@filemoddate
\fi
\tikzset{%
Cote/.style={to path={\pgfextra{
\pgfinterruptpath
\draw[>=latex,|<->|] let
\p1=($(\tikztostart)!2mm!90:(\tikztotarget)$),
\p2=($(\tikztotarget)!2mm!-90:(\tikztostart)$)
in(\p1) -- (\p2) node[pos=.5,sloped,above]{\Cote{\@aspect}};
\endpgfinterruptpath
}(\tikztostart) -- (\tikztotarget) \tikztonodes}}
}
\pgfkeys{tikz/Cote/.cd,
aspect/.store in=\@aspect,
aspect=o,
}
\makeatletter
\NewDocumentCommand{\Cote}{m
}{%
\ifnum\pdfstrcmp{\unexpanded\expandafter{\@car#1\@nil}}{(}=\z@
true
\else
false
\fi
}
\makeatother
\begin{document}
\Cote{(F)} -- \Cote{F}
\begin{tikzpicture}
\path[Cote/aspect=F] (0,0) to[Cote] (5,0) ;
\path[Cote/aspect=(F)] (0,2) to[Cote] (5,2) ;
\end{tikzpicture}
\end{document}
Edit There is a problem with a more complex macro. My mwe was too minimal.
The non minimal exemple is my answer to this question : How to define at tikz style option to draw a dimension line between to specific points
\documentclass{article}
\usepackage{xparse,tikz}
\usetikzlibrary{calc}
\usepackage{ifluatex}
\makeatletter
\ifluatex
\RequirePackage{pdftexcmds}
\let\pdfstrcmp\pdf@strcmp
\let\pdffilemoddate\pdf@filemoddate
\fi
\tikzset{%
Cote/.style={to path={\pgfextra{
\pgfinterruptpath
\draw[>=latex,|<->|] let
\p1=($(\tikztostart)!2mm!90:(\tikztotarget)$),
\p2=($(\tikztotarget)!2mm!-90:(\tikztostart)$)
in(\p1) -- (\p2) node[pos=.5,sloped,above]{\expandafter\Cote{$\pi$}\expandafter<\@aspect>};
\endpgfinterruptpath
}(\tikztostart) -- (\tikztotarget) \tikztonodes}}
}
\pgfkeys{tikz/Cote/.cd,
aspect/.store in=\@aspect,
aspect=o,
}
\makeatletter
\NewDocumentCommand{\Cote}{md<>
}{%
#1
\ifnum\pdfstrcmp{\unexpanded\expandafter{\@car#2\@nil}}{(}=\z@
true
\else
false
\fi
}
\makeatother
\begin{document}
\Cote{$\pi$}<($\pi$)> -- \Cote{$\pi$}<F>
\begin{tikzpicture}
\path[Cote/aspect=F] (0,0) to[Cote] (5,0) ;
\path[Cote/aspect=(F)] (0,2) to[Cote] (5,2) ;
\end{tikzpicture}
\end{document}


\let\pdfstrcmp\pdf@strcmp????????? – David Carlisle Feb 28 '18 at 14:04\let\pdfstrcmp\pdf@strcmp(which defines\pdfstrcmpto loop indefinitely) – David Carlisle Feb 28 '18 at 14:09\let\pdfstrcmp\pdf@strcmpin that linked code. Furthermore, you should say what\pdf@strcmpis supposed to be before you use that as a\letreplacement – Feb 28 '18 at 14:10pdftexcmdspackage uses consistent new names for all the commands it defines. Both your\letstatements completely break it. – David Carlisle Feb 28 '18 at 14:12\pdf@strcmpand\pdf@moddatewithout renaming them back on the original names. (but the ifluatex version works) note there is not really any question in your question. You just say "it fails" without saying what you get or what you expected. – David Carlisle Feb 28 '18 at 14:42fails. – Tarass Feb 28 '18 at 14:47