From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/74707 Path: news.gmane.org!not-for-mail From: Philipp Gesang Newsgroups: gmane.comp.tex.context Subject: Re: marking? Date: Sat, 25 Feb 2012 15:37:12 +0100 Message-ID: <20120225143712.GA30367@phlegethon> References: <4F475321.9060708@uni-bonn.de> <59069C59-B6D8-4D38-9249-C61AEAF547DE@googlemail.com> <4F48E86F.7000109@uni-bonn.de> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1547248381==" X-Trace: dough.gmane.org 1330180640 27347 80.91.229.3 (25 Feb 2012 14:37:20 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 25 Feb 2012 14:37:20 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sat Feb 25 15:37:19 2012 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1S1IkP-0004IH-Uj for gctc-ntg-context-518@m.gmane.org; Sat, 25 Feb 2012 15:37:18 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 22330CB25F; Sat, 25 Feb 2012 15:37:17 +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 9TRoyI0kzINc; Sat, 25 Feb 2012 15:37:13 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 79A5FCB256; Sat, 25 Feb 2012 15:37:13 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id CC282CB256 for ; Sat, 25 Feb 2012 15:37:11 +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 zWE6vXQdWlif for ; Sat, 25 Feb 2012 15:36:59 +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 C81BBCB251 for ; Sat, 25 Feb 2012 15:36:59 +0100 (CET) Original-Received: from relay.uni-heidelberg.de (relay.uni-heidelberg.de [129.206.100.212]) by filter4-til.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id q1PEawcE025511 for ; Sat, 25 Feb 2012 15:36:58 +0100 Original-Received: from ix.urz.uni-heidelberg.de (cyrus-portal.urz.uni-heidelberg.de [129.206.100.176]) by relay.uni-heidelberg.de (8.14.1/8.14.1) with ESMTP id q1PEavNV028863 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sat, 25 Feb 2012 15:36:57 +0100 Original-Received: from extmail.urz.uni-heidelberg.de (extmail.urz.uni-heidelberg.de [129.206.100.140]) by ix.urz.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id q1PEavX1022545 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sat, 25 Feb 2012 15:36:57 +0100 Original-Received: from localhost (dslb-188-104-138-159.pools.arcor-ip.net [188.104.138.159]) (authenticated bits=0) by extmail.urz.uni-heidelberg.de (8.13.4/8.13.1) with ESMTP id q1PEatTE007215 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO) for ; Sat, 25 Feb 2012 15:36:56 +0100 Mail-Followup-To: mailing list for ConTeXt users In-Reply-To: <4F48E86F.7000109@uni-bonn.de> X-Operating-System: Linux phlegethon 3.2.5-1-ARCH X-Polite-Request: "Please try to be nice, don't send html mail." User-Agent: Mutt/1.5.21 (2010-09-15) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=129.206.100.212; country=DE; region=01; city=Heidelberg; latitude=49.4167; longitude=8.7000; http://maps.google.com/maps?q=49.4167,8.7000&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 05GCeAWzf - 85b5174524db - 20120225 (trained as not-spam) 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:74707 Archived-At: --===============1547248381== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="gKMricLos+KVdGMg" Content-Disposition: inline --gKMricLos+KVdGMg Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2012-02-25 14:55, Thomas A. Schmitz wrote: > On 02/24/2012 05:09 PM, Wolfgang Schuster wrote: > >Marks aren=E2=80=99t the right tool for this because they are meant for = text which > >goes into the header and footer after the page is finished. There is ano= ther > >mechanism which does what you want. > > > >\setupheadertexts[chapter] > > > >\define[2]\ChapterCommand > > {\vbox\bgroup\starttabulate > > \NC Title \EQ \structurevariable{title} \NC\NR > > \NC Marking \EQ \structurevariable{marking} \NC\NR > > \stoptabulate\egroup} > > > >\setuphead[chapter][command=3D\ChapterCommand] > > > >\starttext > > > >\startchapter[title=3D{Hello World},marking=3D{A}] > > > >\starttabulate > >\NC Title \EQ \namedstructurevariable{chapter}{title} \NC\NR > >\NC Marking \EQ \namedstructurevariable{chapter}{marking} \NC\NR > >\stoptabulate > > > >\stopchapter > > > >\stoptext > > > >Wolfgang >=20 > Hi Wolfgang, >=20 > may I ask two additional questions? >=20 > 1. From what I see on dev-context, there's a problem right now, so > it may be better to wait a bit with these commands. Correct? >=20 > 2. What would be the equivalent in lua? I'm looking for something like th= is: >=20 > function chaptertest(s) > if chapter.structurevariable =3D=3D "A" then > context(s) context(" is in chapter A!") > else > context(s) context(" is in a different chapter!") > end > end If you only need the current section at the position where the test occurs, then you can try the following (beware this might not be canonical). =C2=B7=C2=B7=C2=B7=C2=B7=C2=B7 chaptertest.lua =C2=B7=C2=B7=C2=B7=C2=B7=C2= =B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7= =C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2= =B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7= =C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7 local context =3D context local check_structure =3D function (s) context(s) local current =3D structures.sections.current() if current.userdata and current.userdata.location =3D=3D "A" then context" is in chapter A" else context" is elsewhere." end end commands.checkstructure =3D function (s) check_structure(s) end =C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2= =B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7= =C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2= =B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7= =C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2= =B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7 =C2=B7=C2=B7=C2=B7=C2=B7=C2=B7 chaptertest.tex =C2=B7=C2=B7=C2=B7=C2=B7=C2= =B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7= =C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2= =B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7= =C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7 \ctxloadluafile{chaptertest} \unprotect \def\lookup#1{\ctxcommand{checkstructure\!!bs#1\!!es}} \protect \starttext \startchapter[title=3Dfoo] [location=3DA] \lookup{My dear something}\par \input knuth \stopchapter \startchapter[title=3Dbar] [location=3DB] \lookup{My dear something}\par \input knuth \stopchapter \stoptext =C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2= =B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7= =C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2= =B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7= =C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2= =B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7 For more info about the local structure you might want to have a look at table.print(structures.sections.current()) Regards Philipp >=20 > Is this possible? What would be the correct call for my pseudo-code > chapter.structurevariable (could be either to the chaptermark or to > the chapter title, I just need something to test against). >=20 > Thanks a lot >=20 > Thomas > _________________________________________________________________________= __________ > If your question is of interest to others as well, please add an entry to= the Wiki! >=20 > maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-co= ntext > webpage : http://www.pragma-ade.nl / http://tex.aanhet.net > archive : http://foundry.supelec.fr/projects/contextrev/ > wiki : http://contextgarden.net > _________________________________________________________________________= __________ --=20 () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments --gKMricLos+KVdGMg Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAk9I8hgACgkQ02lYlJYWs9LPswCfcG6yPMF9rCIOHWXCU9UXxYmK LGkAn3hkExXzCkIJ59unwqiPrC+zx5xU =nGqx -----END PGP SIGNATURE----- --gKMricLos+KVdGMg-- --===============1547248381== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ 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 ___________________________________________________________________________________ --===============1547248381==--