Rik Kabel
25. Juni 2018 um 22:49
List,

What is the preferred way to override a standard command?

My use case is that I am trying to produce html (and epub, but that has a long long way to go) from the same source I use for pdf. Some features are not needed, and I have separate environment files for each output format to accommodate the differences.

I would like to override the standard \index command in one of those environment files, eliminating the generation of index references. There may be other constructs as well that would benefit from this simplification while allowing a common content source file.

You can use the “*export” mode to disable commands when the export is enabled.

\startmode[ebook]
\setupbackend[export=yes]
\stopmode

\starttext

\index{Knuth}\input knuth

\index{Ward}\input ward

\index{Zapf}\input zapf

\startnotmode[*export]
\completeregister[index]
\stopnotmode

\stoptext

Wolfgang