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? (The aim is that Lua should generate or not the \PUSHHEAD + \POPHEAD commands very simply; it's much easier to do this instead to define complicated rules whether to call \section or \subsection at a particular place.) Best regards, Lukas
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
Hello,
thanks Hans and Wolfgang for the answers - I'll study the examples.
Best regards,
Lukas
On Tue, 08 Feb 2011 18:37:43 +0100, Wolfgang Schuster
Any idea how to solve this?
see levels-001.tex in testsuite ... there is a mechanism for that Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
participants (3)
-
Hans Hagen
-
Procházka Lukáš
-
Wolfgang Schuster