Can I expand \ifcase to two levels:

\ifcase{1.1} = a            
\ifcase{1.2} = b 
\ifcase{1.3} = c 
\ifcase{2.1} = a
\ifcase{2.2} = b
\ifcase{3.1} = a
\ifcase{3.2} = b
\ifcase{3.3} = c

Naming should follow the second argument as in above.


Interpretation: Stripping second part of the number and convert it to a letter




\newcommand*{\test}[1]{#1 = \SecondAsAlph{#1}\par}



Interpretation: Second part of the (sub)section number is a letter




Interpretation: \ifcase skips the first part of the number

\newcommand*{\MyCaseMacro}[1]{% #1 is the number of the form <x>.<y>
  \ifcase\StripToDot#1 %
    % case <x>.0
    % case <x>.1
    % case <x>.2
    % case <x>.3
    % case <x>.<y> with <y> equal to or greater than 4 (or negative)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.