Am 08.02.2011 um 18:32 schrieb Procházka Lukáš:

Hello,

I'm trying to solve an interesting problem.

(The document should be generated by Lua actually, but probably this is not of importance.)

I'd need create various headers, but it's not known which command to be used a priori; only their "relative position" is known.

The head creating command should be the same (= \HEAD) and the level should be determined by \PUSHHEAD + \POPHEAD commands.

I'd need to solve something like this:

---
\starttext
 \HEAD{...} % Should expand to \chapter
 \PUSHHEAD
   \HEAD{...} % Should expand to \section
   \PUSHHEAD
     \HEAD{...} % Should expand to \subsection
     \PUSHHEAD
       \HEAD{...} % Should expand to \subsubsection
       \PUSHHEAD
         \HEAD{...} % Should expand to \subsubsubsection
       \POPHEAD

       \HEAD{...} % Should expand to \subsubsection again
     \POPHEAD
   \POPHEAD
 \POPHEAD
\stoptext
---

Any idea how to solve this?

http://www.ntg.nl/pipermail/ntg-context/2010/052754.html

Wolfgang