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

* Re: Headers another way
  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
  1 sibling, 1 reply; 4+ messages in thread
From: Wolfgang Schuster @ 2011-02-08 17:37 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1129 bytes --]


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


[-- Attachment #1.2: Type: text/html, Size: 1822 bytes --]

[-- Attachment #2: Type: text/plain, Size: 486 bytes --]

___________________________________________________________________________________
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

* Re: Headers another way
  2011-02-08 17:32 Headers another way Procházka Lukáš
  2011-02-08 17:37 ` Wolfgang Schuster
@ 2011-02-08 17:40 ` Hans Hagen
  1 sibling, 0 replies; 4+ messages in thread
From: Hans Hagen @ 2011-02-08 17:40 UTC (permalink / raw)
  To: mailing list for ConTeXt users

 > 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
-----------------------------------------------------------------
___________________________________________________________________________________
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

* Re: Headers another way
  2011-02-08 17:37 ` Wolfgang Schuster
@ 2011-02-09 16:25   ` Procházka Lukáš
  0 siblings, 0 replies; 4+ messages in thread
From: Procházka Lukáš @ 2011-02-09 16:25 UTC (permalink / raw)
  To: ConTeXt

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 <schuster.wolfgang@googlemail.com> wrote:

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

___________________________________________________________________________________
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).