I regularely use lists defined with pgfmath and encountered an error if one of the list items is "33" but not " 33" or "32".... Please find below a minimal example to reproduce the error. Thanks to anyone that could help me correct this issue.
\documentclass{minimal}
\usepackage{pgfmath}
\makeatletter
\def\pgfmathdeclarelist#1#2{%
\def\pgfmath@list@name{#1}%
\c@pgfmath@counta=0%
\pgfmath@declarelistlist#2{\pgfmath@stop}%
}
\def\pgfmath@declarelistlist#1{%
\ifx#1\pgfmath@stop%
\expandafter\edef\csname pgfmath@list@\pgfmath@list@name @length\endcsname{\the\c@pgfmath@counta}%
\else%
\advance\c@pgfmath@counta by1\relax%
\pgfutil@namedef{pgfmath@list@\pgfmath@list@name @\the\c@pgfmath@counta}{#1}%
\expandafter\pgfmath@declarelistlist%
\fi%
}
\makeatother
\begin{document}
\pgfmathdeclarelist{list}{{33}}
\end{document}

\ifx#1\pgfmath@stopand so if#1is33(or44, or...) the\ifxexpands to true. – campa Mar 27 '23 at 09:39\pgfmathdeclarelist{list}{5 10 20 30 36}, is that so? – egreg Mar 28 '23 at 16:40