How, in general, can I (re)define commands based on in which other command they are nested?
A more specific example: I have a custom latex command (say, \code{}
) that makes text appear bold. However, when used inside another custom command (such as in \question{Will you use \code{command 1} or \code{command 2}?}
), I want the \code{}
text to be NOT bold. So I want to redefine \code{}
when inside another command.
BTW: When using CSS to format HTML pages, it would go something like this:
.code {font-weight: bold;}
.question .code {font-weight: normal;}