Title: Dynamic headings & query heading information

again I'm working on a technical manual and decided to use ConTeXt to do the job. Since I'm a developer, I always try to do things as flexible as possible.

I'm currently struggling to achieve two things:

1) a macro (that will print a list) should also add a heading. However, the heading should always be one level beneath the current heading and without numbering. Example: within a \section it should be a \subsubject, within a \chapter it should be a \subject, and so on.

2) another macro should build an index at the end of the document. I use Lua to keep a list of all database tables referenced within the document (together with some metadata) and save it in the jobpasses struct. Now I also want to track the chapters, sections, etc where these references are, to be able to see, where a database table is used.

To solve these two problems, I'm looking for information about the current heading. The level and the associated reference name.
If I have the level, I can keep my own list of necessary heading types (subject, subsubject, ...) and just get the one at level+1 to write the heading using lua (tex.sprint(....)).
With the reference name I can obviously solve 2), since I then can simply keep a list for each db table in the jobpasses structure.

I'm open for different suggestions, since I may miss an (obvious?) alternative. And as you can also probably see, I like Lua pretty much, so a solution requiring Lua is not a problem :-) (quite the contrary actually)

Best regards,

If your question is of interest to others as well, please add an entry to the 

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net

Reply via email to