I have a value defined in a macro, e.g.:
I need to check if a value does not equal a string, e.g.:
IF #1 NOT EQUAL TO "apple" THEN PRINT "It is not a apple, it is #1." FI
I have tried using this, but it does not work:
\ifx#1="apple" \else It is not a apple, it is #1. \fi
I have also tried using this, but it also does not work:
\startlua if #1 ~= "apple" then context("It is not a apple, it is #1.") end \stoplua
- The macro might be set to any value.
- If anything other than "apple" appears inside, including TeX commands which do not create output, it should still be considered a negative result.
How can I create a plain TeX or Lua conditional which checks if the value is not equal?