Is it possible to change te outcome of a command depending on how many times it is called? I would like to have a command with 3 possible outcomes.
- Case 1: Outcome A in case it only occurs once in the document.
- Case 2: Outcome B for the first time it occurs in a document where it occurs multiple times and outcome C for the subsequent times it occurs in that document.
I would like not to use any arguments just the name of the command.
I know how to make the second case with a nested
\newcommand. But does anyone know how to differentiate between case 1 and case 2? In other words, how can I make a command/function that has 3 different outcomes depending on how many times it is called?