Is there a standard way to define mutually exclusive options in a package?
Could someone provide a simple example?
Currently I am mostly intrested in LaTeX2e but it would be nice to see a LaTeX3 implementation also.
This generates an if-switch which is set to true by
If you however mean otherwise mutually exclusive options, e.g. three options where only one can be used, then you best define three if-switches which are set to true by its corresponding option. The options then either set the if-switches of the other options to false or raise an error or warning if one of these if-switches are already set to true.
or with error messages:
The standard LaTeX document classes take
A key question: How to address a user who specifies contradictory options? For example, specify
This is because the base LaTeX document classes use
If you want the implementation to scold the user for specifying mutually exclusive options you will have to do something a bit more involved.
Below is an example that I use for a list of option where only one can be active. You can also specify a default option.