I need to make a simple conditional in a macro. If #1 is "1", "2", "3", "4", "5", or "6", then print Text: #1, otherwise, do nothing, even if it is empty. I tried this code:
\ifnum#1=1
Text:~#1
\if
I cannot even get make it able to check if 1 is present. How can I check #1 is equal to "1", "2", "3", "4", "5", or "6"?
#1definitely an integer, or does the answer need to cover the case where it's not? Can it be an integer expression (such as10 - 6) and if so does that need to count? – Joseph Wright♦ Apr 22 '12 at 11:24\macro{1},\macro{2},\macro{3},\macro{4},\macro{5}, and\macro{6}should count as a match. Something like\macro{15}should not count as any match. Usually, the macro is empty, like\macro{}, I guess is why my code is getting confused. – Village Apr 22 '12 at 11:29\macro{\really\wild\input}be taken into account? – egreg Apr 22 '12 at 12:49