How do I compare two macros that are one-expansion away from being strings?
\def\A{ICT}
\newgetenv[\ICT]{\A}
% `\newgetenv` from https://tex.stackexchange.com/a/184924
Now I want to check if whatever \ICT evaluates to is simply what \A evaluates to; i.e.: "ICT".
Attempts (one line at a time; others commented):
\ifdefequal{\expandafter\ICT}{\expandafter\A}{\def\ICT{FOO}}{\def\ICT{BAR}}
\ifdefequal{\ICT}{\expandafter\A}{\def\ICT{FOO}}{\def\ICT{BAR}}
\ifdefequal{\expandafter\ICT}{\A}{\def\ICT{FOO}}{\def\ICT{BAR}}
I've also tried the same 3 possibilities with \ifcsequal and \ifdefstring. Also tried giving up on the \A and just using: ICT verbatim.
But they all define an \ICT with a value of BAR, no matter what I set my $ICT system environment variable to.
\expandafterto do in those situations. They will just expand into the internal definition ofifdefequaldon't you just want\ifx\A\ICT yes \else no\fi? – David Carlisle Jun 18 '17 at 16:52\newgetenvfrom one of my answers apparently... – Jun 18 '17 at 16:53\IfStrEqfrom the xstring pacakge and\ifx. Neither worked. I've got this test-case repository, but I'm not sure how to resolve the\inputmacro (which isn't recognised). Trying to find what package to\usepackagefor… – A T Jun 18 '17 at 16:58\pdfstrcmp? – Jun 18 '17 at 17:03