[texhax] A case-insensitive \ifthenelse?

John R. Culleton john at wexfordpress.com
Fri Aug 25 16:53:05 CEST 2006


On Thursday 24 August 2006 20:45, Chris Bergstresser wrote:
> Hi all --
>
>    Yet another issue I can't seem to solve.  I'd like to compare a
> stored string to another string, but in a case-insensitive manner.
> Obviously, the naive ...
>
> \ifthenelse{\equal{\lowercase{\my at var}}{text}}{Yes}{No}
>
>    ...doesn't work if \my at val evaluates to "TexT".  But the more
> sophisticated ...
>
> \ifthenelse{\equal{\expandafter\lowercase\expandafter{\my at var}}{text}}{Yes}
>{No}
>
>    ...also doesn't work.  Is there a better way, or a way to fix it?
>
> -- Chris

My shot in the dark. How about
 
\ifthenelse{\equal{\lowercase{\the\my at var}}{text}}{Yes}{No}

Disclaimer: Not a LaTeX user,

John Culleton
Able Indexing and Typesetting
Precision typesetting (tm) at reasonable cost.
Satisfaction guaranteed. 
http://wexfordpress.com




More information about the texhax mailing list