From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/65890 Path: news.gmane.org!not-for-mail From: =?iso-8859-2?B?UHJvY2jhemthIEx1a+G5?= Newsgroups: gmane.comp.tex.context Subject: Headers another way Date: Tue, 08 Feb 2011 18:32:10 +0100 Message-ID: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed"; DelSp="yes" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1297186347 13550 80.91.229.12 (8 Feb 2011 17:32:27 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 8 Feb 2011 17:32:27 +0000 (UTC) To: ConTeXt Original-X-From: ntg-context-bounces@ntg.nl Tue Feb 08 18:32:23 2011 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PmrQM-0008Li-RH for gctc-ntg-context-518@m.gmane.org; Tue, 08 Feb 2011 18:32:22 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 1F1F6CAA0E; Tue, 8 Feb 2011 18:32:22 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 813UpUOgO-Vz; Tue, 8 Feb 2011 18:32:19 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 583C7CAA03; Tue, 8 Feb 2011 18:32:19 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 7A179CAA03 for ; Tue, 8 Feb 2011 18:32:18 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id E0yBRaShbCjz for ; Tue, 8 Feb 2011 18:32:06 +0100 (CET) Original-Received: from filter4-til.mf.surf.net (filter4-til.mf.surf.net [194.171.167.220]) by balder.ntg.nl (Postfix) with ESMTP id BF458CA9FE for ; Tue, 8 Feb 2011 18:32:06 +0100 (CET) Original-Received: from joe.mail.tiscali.it (joe.mail.tiscali.it [213.205.33.54]) by filter4-til.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id p18HW4MG026748 for ; Tue, 8 Feb 2011 18:32:06 +0100 Original-Received: from lk-2008-nbk (84.222.71.226) by joe.mail.tiscali.it (8.5.132) id 4D08E71A01604A48 for ntg-context@ntg.nl; Tue, 8 Feb 2011 18:32:04 +0100 User-Agent: Opera Mail/11.01 (Win32) X-Bayes-Prob: 0.8201 (Score 2, tokens from: @@RPTN) X-CanIt-Geo: ip=213.205.33.54; country=IT; latitude=42.8333; longitude=12.8333; http://maps.google.com/maps?q=42.8333,12.8333&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 05E5tw4Q0 - cb6cd29867a5 - 20110208 X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.220 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:65890 Archived-At: 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 ___________________________________________________________________________________