I want to implement an if-then-else depending on whether a skip contains a special character or not.
So far, I tried the idea: convert the skip to a token list, and check if the letter f is in the list. Something like this:
\leftskip=10pt plus1fil\relax
\edef\mystring{\the\leftskip\the\rightskip}
\if\instring{f}{\mystring}\message{YES}\else\message{NO}\fi
\def\mystring{10.0pt plus 1.0fil}
\if\instring{f}{\mystring}\message{YES}\else\message{NO}\fi
\message{\the\leftskip}
I use \mystring as defined here: Check if a string contains a given character
Unfortunately, the code does not work. The log file contains contains NO instead of YES:
NO
YES
10.0pt plus 1.0fil
Probably I know what is wrong, but it is time to ask for a better idea: how to detect infinity?