In the following example I want write Tuesday if the variable dia is Monday. The following example write rest not matter the string of variable dia.
\documentclass{article}
\def\dia#1{\if{#1=monday}{tuesday}\else{rest}\fi}
\begin{document}
\dia{monday}
\end{document}
Best Answer
There are many ways to do it. The following also works with plain TeX and without e-TeX or other extensions. However, it is not expandable, but this does not seems to be needed here.
Links:
Difference between
\if
and\ifx
Are there any “if” commands like
\ifnum
in LaTeX?...
An expandable solution without direct string comparison: