I'm using \IfSubStr
macro of xstring
package to decide if user given options contains some letter and if they do I take some actions.
I want case independent test on whether user options contain that letter so I thought I will just use \uppercase
macro to implement case independent comparison. But it does not work as I expect.
Here is minimal demonstration:
\usepackage{xstring}
\newcommand{\test}[1]{%
\IfSubStr{\uppercase{#1}}{K}{%then
In then%
}{%else
In else%
}
}
\begin{document}
\test{k}
\end{document}
I would expect this to print In then
, but instead it prints In else
. Why is that and how do I fix it so that it prints In then
as I expect?