From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/95376 Path: news.gmane.org!not-for-mail From: Fabrice Couvreur Newsgroups: gmane.comp.tex.context Subject: Re: \currentheadnumber does not work Date: Sat, 9 Jul 2016 12:17:37 +0200 Message-ID: References: <5780C4B3.5050809@gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7494215251420965097==" X-Trace: ger.gmane.org 1468059509 27740 80.91.229.3 (9 Jul 2016 10:18:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 9 Jul 2016 10:18:29 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sat Jul 09 12:18:18 2016 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bLpL0-0007ij-AF for gctc-ntg-context-518@m.gmane.org; Sat, 09 Jul 2016 12:18:18 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 6F51910BE8; Sat, 9 Jul 2016 12:17:52 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DjX2BnADgARj; Sat, 9 Jul 2016 12:17:51 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [IPv6:::1]) by zapf.ntg.nl (Postfix) with ESMTP id 9417910C69; Sat, 9 Jul 2016 12:17:51 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 1FE9110C13 for ; Sat, 9 Jul 2016 12:17:51 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id u_WsNihGXsYD for ; Sat, 9 Jul 2016 12:17:50 +0200 (CEST) Original-Received: from mail-it0-f51.google.com (mail-it0-f51.google.com [209.85.214.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id D95A810BE8 for ; Sat, 9 Jul 2016 12:17:39 +0200 (CEST) Original-Received: by mail-it0-f51.google.com with SMTP id u186so27427177ita.0 for ; Sat, 09 Jul 2016 03:17:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=YaH4Ewiv8jk9YX5gbpCjgUZP2jNIyMHLW9Oj6EPdNIE=; b=clF7Lo8edykHp98BpHYy0ggfelhFGdm4VeGp933SdKmv7KX5OdFHRC8Q2rR2GHiMWl 1hJS43tI/KN6pOjetT7Gl1ABYv383ctvaVLVk/dI6LubBnD7VDprPYYr9iRbV+y5rY9F ipvc1hdBfsEJ16Id+v5RcMyanOM4VXT4koVioLYQm8mfyFbl9IY0c1UecFIdJh9EF79s LBdKyQZv4wXkd4/1ccs0TnTEGCiZJcCC5UFCOzcIovbJ/xbWsAnYUS16HI9JaGk4Te4G eG0nV+eIgyroAi3DD09e+WhjQH6Q7K1vUJRzWInM3pMi+Jak1nug4VlUFYAsKBREBk01 3U8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=YaH4Ewiv8jk9YX5gbpCjgUZP2jNIyMHLW9Oj6EPdNIE=; b=CVM0odz5KKb53zZHmLVgXRRTkCVj7obwJ3oZzZD4ME0U80AAvspazYexYYlb0vj2qm rT+WoLmjaNbNTej1vaSi/x2Ylo4CnLiF9m8GlEM+v1HskgDIsO8969Hal+hJzVDTIktL jFIxTH0p3jWEixbz8lQIwWdH2Hqn+2A2fhQnutRkchnKW7E3BnaGBKiNhJUeNTh/2sXq I3seAg36NstYFm8bYiKgVr6sH5VdpY+qG6Ou6hyyAj1tdPie3htSDZuvbfnFjOs1ikQg /ai47bh7hN6wKkbt6i+sWP0KP+ybQ9TuPV3dpjYhY5cWaXbGT0h2ugV5ckEQsR2Drc+Q P6bQ== X-Gm-Message-State: ALyK8tKO0y+hMcI6pN+w9FkEXLXRARc2OGJTeDeUy4qq4vJYeLa7YjA2j6OJ2EyMHHsVGI2qdoJwoSkxXHaN8g== X-Received: by 10.36.66.19 with SMTP id i19mr8623itb.30.1468059458124; Sat, 09 Jul 2016 03:17:38 -0700 (PDT) Original-Received: by 10.64.10.2 with HTTP; Sat, 9 Jul 2016 03:17:37 -0700 (PDT) In-Reply-To: <5780C4B3.5050809@gmail.com> X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.16 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.org gmane.comp.tex.context:95376 Archived-At: --===============7494215251420965097== Content-Type: multipart/alternative; boundary=001a11405b8282c28f0537313a86 --001a11405b8282c28f0537313a86 Content-Type: text/plain; charset=UTF-8 Hi Wolfgang, In the first example, so I do not need the command \currentheadnumber but just do : \setuphead [chapter] [command=\HeadTitle, headstyle=\ss, numbercommand=\Headed] But in this second example, using the command \determineheadnumber[chapter], the chapter number is always 0 \setuppagenumbering[location=footer] \startusableMPgraphic{NumberHead} picture r ; r := image ( graphictext \MPstring{chapter} scaled 4pt withfillcolor \MPcolor{lightgray} withpen pencircle scaled 1pt ; ) ; draw r ; \stopusableMPgraphic \defineoverlay[NumberHead][\uniqueMPgraphic{NumberHead}] \def\processMPheadnumber#1% {\setMPtext{chapter}{\bf#1} \useMPgraphic{NumberHead}} \unexpanded\def\HeadTitle#1#2% {\framed [frame=off, bottomframe=on, width=broad, align={broad,nothyphenated,left}] {#1\blank[nowhite]#2}} \determineheadnumber[chapter] \setuphead [chapter] [command=\HeadTitle, headstyle=\ss, numbercommand=\processMPheadnumber{\currentheadnumber}] \starttext \startchapter [title={Fist chapter}] \input knuth \stopchapter \startchapter [title={Second chapter}] \input knuth \stopchapter \startchapter [title={Third chapter}] \input knuth \stopchapter \stoptext 2016-07-09 11:32 GMT+02:00 Wolfgang Schuster : > Fabrice Couvreur > 9. Juli 2016 um 11:12 > Hello, > In this command, I have two problems : > > - \currentheadnumber does not work > > You need > > \determineheadnumber[chapter] > > before you can access the value with > > \currentheadnumber > > - the chapter number appears in black > > You need this setup: > > \setuphead > [chapter] > [numbercommand=\Headed] > > Wolfgang > > > ___________________________________________________________________________________ > 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 > > ___________________________________________________________________________________ > --001a11405b8282c28f0537313a86 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi Wolfgang= ,

In= the first example, so I do not need the command=C2=A0 \currentheadnumber=C2=A0 but= just do :

\setuphead
=C2=A0=C2=A0 [chapter]=C2=A0=C2=A0 [command=3D\HeadTitle,
=C2=A0=C2=A0=C2=A0 headstyle=3D\ss= ,
=C2=A0=C2=A0=C2=A0 numbercommand=3D\Headed]


<= /span>But in this second example, using the command \de= termineheadnumber[chapter], the chapter number is always= 0

\setuppagen= umbering[location=3Dfooter]

\startusableMPgraphic{NumberHead}
=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 picture r ;
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 r= :=3D image ( graphictext
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 \MP= string{chapter}
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 scaled 4pt=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 withfillcolor \MPcolor{lightgra= y}
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 withpen pencircle scaled 1= pt ; ) ;
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 draw r ;
=C2=A0=C2=A0=C2=A0 \= stopusableMPgraphic

\defineoverlay[NumberHead][\uniqueMPgraphic{Numb= erHead}]

\def\processMPheadnumber#1%
=C2=A0 {\setMPtext{chapter}{= \bf#1}
=C2=A0=C2=A0 \useMPgraphic{NumberHead}}


\unexpanded\de= f\HeadTitle#1#2%
=C2=A0 {\framed
=C2=A0=C2=A0=C2=A0 [frame=3Doff,
= =C2=A0=C2=A0=C2=A0 bottomframe=3Don,
=C2=A0=C2=A0=C2=A0 width=3Dbroad,=C2=A0=C2=A0=C2=A0 align=3D{broad,nothyphenated,left}]
=C2=A0=C2=A0=C2= =A0 {#1\blank[nowhite]#2}}

\determineheadnumber[chapter]

\set= uphead
=C2=A0=C2=A0 [chapter]
=C2=A0=C2=A0 [command=3D\HeadTitle,
= =C2=A0=C2=A0=C2=A0 headstyle=3D\ss,
=C2=A0=C2=A0=C2=A0 numbercommand=3D\= processMPheadnumber{\currentheadnumber}]

\starttext

\startcha= pter
=C2=A0 [title=3D{Fist chapter}]

\input knuth

\stopcha= pter

\startchapter
=C2=A0 [title=3D{Second chapter}]

\inpu= t knuth

\stopchapter

\startchapter
=C2=A0 [title=3D{Third = chapter}]

\input knuth

\stopchapter

\stoptext

2016-07-09 11:32 GMT+02:00 Wolfgang Schuster <schuster.wolf= gang@gmail.com>:
9.=20 Juli 2016 um 11:12
=
Hello,
In this command, I have tw= o problems :

- \currentheadnumber does not work
You need

=C2=A0=C2=A0=C2=A0 \determineheadnumber[chapter]

before you can access the value with

=C2=A0=C2=A0=C2=A0 \currentheadnumber
- the chapter=20 number appears in black
You need this setup:

\setuphead
=C2=A0=C2=A0 [chapter]
=C2=A0=C2=A0 [numbercommand=3D\Headed]

Wolfgang

_______________________________________________________________________= ____________
If your question is of interest to others as well, please add an entry to t= he Wiki!

maillist : ntg-context@ntg.nl / <= a href=3D"http://www.ntg.nl/mailman/listinfo/ntg-context" rel=3D"noreferrer= " target=3D"_blank">http://www.ntg.nl/mailman/listinfo/ntg-context
webpage=C2=A0 : http://www.pragma-ade.nl / http://tex.aanhet.net
archive=C2=A0 : http://foundry.supelec.fr/projects/con= textrev/
wiki=C2=A0 =C2=A0 =C2=A0: http://contextgarden.net
___________________________________________________________________________= ________

--001a11405b8282c28f0537313a86-- --===============7494215251420965097== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly90ZXguYWFuaGV0Lm5ldAphcmNoaXZlICA6IGh0dHA6Ly9mb3VuZHJ5LnN1cGVsZWMu ZnIvcHJvamVjdHMvY29udGV4dHJldi8Kd2lraSAgICAgOiBodHRwOi8vY29udGV4dGdhcmRlbi5u ZXQKX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX18= --===============7494215251420965097==--