[tex-eplain] make \write[numbered]tocentry more abstract about section depth?

Dorai Sitaram dorai at ccs.neu.edu
Wed Apr 26 17:29:26 CEST 2006


Currently, \writetocentry, and its related \writenumberedtocentry, and the
indeed the ultimately underlying \writenumberedcontentsentry macro, take a
depth argument that is something like `chapter' or `section'.  

Since these procedures are provided as building blocks anyway, wouldn't it
be more helpful to macro writers if this argument is the actual number
denoting the section depth, perhaps (and this is up to the user) 1 for
chapter, 2 for section, 3 for subsection, etc.?  This will let the user
abstract away the depth details cleanly when writing toc macros.  (Indeed
abstracting away the depth as a number is useful for writing a single
template for section macros of any depth, as this number can be used to
calculate spacing, indentation, font size very arithmetically and in a
single "formula".)

It is also no tougher to write (and arguably easier)

\writetocentry{1}{etc}  

than to 

\writetocentry{chapter}{etc}

The symbolic/mnemonic name doesn't really contribute much, as none of these
macros are (or should be) called explicitly in a document.


Dorai


More information about the tex-eplain mailing list