ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Headers another way
@ 2011-02-08 17:32 Procházka Lukáš
  2011-02-08 17:37 ` Wolfgang Schuster
  2011-02-08 17:40 ` Hans Hagen
  0 siblings, 2 replies; 4+ messages in thread
From: Procházka Lukáš @ 2011-02-08 17:32 UTC (permalink / raw)
  To: ConTeXt

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

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

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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-02-09 16:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-08 17:32 Headers another way Procházka Lukáš
2011-02-08 17:37 ` Wolfgang Schuster
2011-02-09 16:25   ` Procházka Lukáš
2011-02-08 17:40 ` Hans Hagen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).