What is the equivalent of \ifthenelse{<statement>}{<iftrue>}{<iffalse>}
when using expl3
syntax?
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.
Sign up to join this communityWhat is the equivalent of \ifthenelse{<statement>}{<iftrue>}{<iffalse>}
when using expl3
syntax?
expl3
has different conditional macros, such as\bool_if:NTF \some_bool {true branch}{false branch}
or\seq_if_in:NnTF
etc, depending on the 'variable' type and the precise application usage – user31729 Feb 16 '19 at 19:39\bool_if:{ \equal{#1}{#2} }{ <iftrue> }{ <iffalse> }
work? – noibe Feb 16 '19 at 19:42\int_compare:nNnTF {#1} = {#2} {true}{false}
-- the\equal
etc. syntax is not available inexpl3
and I found\ifthenelse
never convincing -- see theinterface3
manual please – user31729 Feb 16 '19 at 19:44\bool_if:nTF { \int_compare_p:nNn {#1} = {#2} } { true } { false }
, but as @ChristianHupfer says normally one would use just the basicint
comparison. – Joseph Wright♦ Feb 16 '19 at 19:46