[NTG-context] [m-database] How to properly add module arguments?
mseven at telus.net
Sun Feb 26 11:36:05 CET 2023
> I added a stanza to the appropriate interface file:
> --- begin stanza added to i-database.xml ---
> I modeled that after the stanza for the argument `strip`. I think
> that's the only thing I need to do in the interface file.
I'd recommend completely ignoring the interface i-*.xml files. They
don't do anything particularly useful for a third-party module.
> \c!skipheader=\v!no, % <- Added, following the pattern with strip
This line is your issue. Inside \unprotect...\protect, "!" is treated as
a letter, so you're trying to expand the value of the macro
"\c!skipheader". The problem is that that macro isn't defined anywhere.
Backing up a little further, the \c!... commands are all string
*C*onstants. If you see a command with a name like \c!blah, it almost
certain expands to exactly the string "blah". Why is this useful? Well,
if you run ConTeXt in another language, then the \c!... commands will
instead contain that string but in the other language. So something like
\c!left would be "left" in English, "gauche" in French, "links" in
German, "vlevo" in Czech, etc.
You could define \c!skipheader to just be "skipheader", or you could
give it a translated value for 10 or so languages. But the easier
solution is to just use the string "skipheader" directly:
skipheader=\v!no, % <-- HERE
As a more general suggestion, it is usually a really bad idea to modify the
standard ConTeXt files since any changes will be overwritten on updates.
Probably the best solution is to make a new file called "t-xdatabase.mkiv"
stored in your texmf-local/, start the file with "\usemodule[database]"
then add any changes after that. Or, just copy and paste the original file
into your new file. (Maybe you were doing this already though)
Hope this helps,
More information about the ntg-context