In an aldordoc verbatim context, i. e., in the scope of the adsnippet and adusage environments and the ∖adcode command, certain LATEX commands retain their meaning. These commands are called active commands and will be expanded.
The following list contains all the active commands.
Basically, the function adtranslateActiveCommands splits the given string on active commands.
The active commands are copied unmodified to the output or translated to an internal form in the case of the interface-only command ∖adname.
The other parts of the given string are escaped appropriately so that they appear in the output in a verbatim form. This escaping is done via the function escapeForVerb.
Note that the \ is not considered to be an escape character so that for example
\adcode|x/\\adname{bit?}(0,a)|
|
will be correctly translated into
\verb|x/\|\adinternalusename{bit?}{bit?}{bit?}{}{bit?}\verb|(0,a)|
|
A problematic situation could look like this
\adcode|x/\adname{b}|
|
which is currently translated into
\verb|x/|\adinternalusename{b}{b}{b}{}{b}
|
and basically means x/b. If, however, adname is a function that is applied to b and it was actually meant as
x /\ adname {b}
|
then there should be at least one space between \ and adname.
The two lines
\adcode|if \adthistype{} then ...|
\adcode|if \adthistype then ...| |
are translated into
\verb|if |\adthistype{}\verb| then ...|
\verb|if |\adthistype\verb| then ...| |
and thus result in identical output.
Note that we work here with the same regular expression for a type constructor as in Section 38.1.