In some hand-me-down tex i inherited, a control sequence is used as a variable, for instance:
\def\accessflavor{ats}
it is used to generate postfixes on included tex files (called, i.e., image01_ats) and the like.
I want to use it in a conditional structure, i. e. something like
\if\accessflavor ats
This text is only shown if the Flavor of Access is 'ats'.
\fi
I tried a a lot of variations, including various brackets, escape sequences and macros, but i cannot get it to work. Mostly, not even an error message appears. The online examples i found either deal with a more specific IF, like \ifodd, \ifx, etc., or more (seemingly) complex cases like testing two macros for identity.
Can somebody clear up the usage for me?


multiaudiencepackage which allows you to separate some parts of your text for different "audiences" and provides higher-level switches. As part of this, you can use its\CurrentAudiencevariable to get the audience you are currently writing for (e.g. for file names). – TeXnician Apr 15 '19 at 14:57