[NTG-context] One-off theorem titles

Aditya Mahajan adityam at umich.edu
Fri Mar 4 00:55:45 CET 2011


On Thu, 3 Mar 2011, Wolfgang Schuster wrote:

>
>> I am a bit surprised by the naming of the internal macros:
>>
>> annotation_cmd
>> annotation__cmd
>> annotation___cmd
>
> I liked the LaTeX3 system to have names in the form \<module>_<command>,
> with this you have a easy way to protect internal commands and to avoid
> command clashes,

I also like \<module>_<command>. That is better than \<module><command> 
that I have been using. Of course, this means that _ should not have its 
usual meaning. I haven't checked on how \unprotect works in MkII. If it 
makes _ a letter, then I'll switch to \<module>_<command>.

Another option might be to use \<module>.<command> with . having the right 
catcode. That will give macro names a more OOP feel.

> e.g. you define the command \getfirstcharacter in your
> filter module but this name is already used in the core (syst-aux.mkiv)
> and with the name \filter_getfirstcharacter you can avoid this without
> thinking too much about a good name.

I didn't know that. I'll change that name.

So far, I have been using \externafillter<command> for 
most commands, and sometimes it gets unreadable.

>> I know that \do \dodo \dododo is not the best notation, but I don't find _ __ ___ better.
>
> I don’t like the __ and ___ either but do you know a better way for good
> names without using do, dodo, nodo, yes or nop?

I find that \module__command and \module___command are hard to 
distinguish. For helper macros, a better idea might be:

\module_command
\module_command!
\module_command!!

These commands are easy to distinguish visually. But this will not work 
for too well for three or four levels. I think that none of the schemes 
look good for three or four levels. Perhaps we could mix both existing 
schemes to get something reasonable:

\module_command
\module_command!
\module_command!do
\module_command!redo

or maybe

\module_command
\module_command_one
\module_command_two
\module_command_three

etc.

Aditya


More information about the ntg-context mailing list