From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/95392 Path: news.gmane.org!not-for-mail From: Fabrice Couvreur Newsgroups: gmane.comp.tex.context Subject: Re: \currentheadnumber does not work Date: Mon, 11 Jul 2016 11:58:19 +0200 Message-ID: References: <5780C4B3.5050809@gmail.com> <5780D5CA.3050407@gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0903500319795854988==" X-Trace: ger.gmane.org 1468231148 23496 80.91.229.3 (11 Jul 2016 09:59:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 11 Jul 2016 09:59:08 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Mon Jul 11 11:58:57 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 1bMXzL-0003BT-Jk for gctc-ntg-context-518@m.gmane.org; Mon, 11 Jul 2016 11:58:55 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id BB66D114B2; Mon, 11 Jul 2016 11:58:35 +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 wzlS5SdL3e01; Mon, 11 Jul 2016 11:58:35 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [IPv6:::1]) by zapf.ntg.nl (Postfix) with ESMTP id F372C114FA; Mon, 11 Jul 2016 11:58:34 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 9B7F9114B3 for ; Mon, 11 Jul 2016 11:58:34 +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 h-F83eD8IqHe for ; Mon, 11 Jul 2016 11:58:33 +0200 (CEST) Original-Received: from mail-it0-f43.google.com (mail-it0-f43.google.com [209.85.214.43]) (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 721BC114B2 for ; Mon, 11 Jul 2016 11:58:23 +0200 (CEST) Original-Received: by mail-it0-f43.google.com with SMTP id f6so50978451ith.0 for ; Mon, 11 Jul 2016 02:58:23 -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=5SrAJdOeZSpJiAiZqJYmf8M0r5kv9Vw7R7aohdcMlF4=; b=sXhhk7HPazNg4sFCL+LGyNir3DeKYBpdnVpUrdZRjCELAl/2kXV0qYsLSDd+V91I+d gJmm5VgB1Jp/XC+fZnSf4K3ApvZDdAbe7qq/eIYxwujFqM6JD6+dNc5PMvFXJnLD4/HQ 5T5cZhk9Q8AQRa63i1BckWtJhoar/6JoBkwGPI3TqaJ+729KzGedu+jmNvjiD9jZ7IH9 YTekJUMAXIz0/UArhU4EIF7s6LCpslk6+tGFQoOfct3c5IS39O5SO/o2JM72Qzvui51Z dHkxkGHu8J57wPxz2IQIldu6gxaUfeLOQdtg9dnic0lbEVJ3zCL+ZmPRLkmEtUebH4Le JTpQ== 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=5SrAJdOeZSpJiAiZqJYmf8M0r5kv9Vw7R7aohdcMlF4=; b=WdgdVe1zQwnmHUgI2frElHr+DgRVHXl+1jpIyALxLQcbH+mmkQbIfkyPoCc7C71h// m91GAWAE6UBXp+zIwYrWDk9DDWcfrsEwVd8gtxXtx3zgHFIFBm2C2Vi+E68jJ9b3nzG5 YbntIy3SXd4/aM1MY/lIlEZel7IRtkF73xkgshRMn5dZAVhoW8FvBzCIBu2dmEMjWYdV EedY349nlr9sJwhIiauHXzOsrj5LRDojhq7QNkFBtgdkZiedH/6APj78/Ew5sQtb2the k+V39uNeGOLqwi9mM0BVnR8Tp6lvLLhL3Qm5ZB8mp5CMFLgZ6IXSVgip5mvrV4Apbsm+ ajBA== X-Gm-Message-State: ALyK8tLniTNmAK50lbLptMc6NEdk5+K8VFSkbpfjX3VFnWNS8d0ugj7MBhqb7r9hUtBmg2xgd7J91JdJgFiCCA== X-Received: by 10.36.36.149 with SMTP id f143mr9431438ita.43.1468231099909; Mon, 11 Jul 2016 02:58:19 -0700 (PDT) Original-Received: by 10.64.10.2 with HTTP; Mon, 11 Jul 2016 02:58:19 -0700 (PDT) In-Reply-To: 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:95392 Archived-At: --===============0903500319795854988== Content-Type: multipart/alternative; boundary=001a1146f05a289132053759311d --001a1146f05a289132053759311d Content-Type: text/plain; charset=UTF-8 Hello Wolfgang, When compiling the file with the macro, there is a lot of files that can be deleted (mpgraph.mpy, mpgraph.pdf ...) How to do ? thank you, Fabrice 2016-07-10 10:56 GMT+02:00 Fabrice Couvreur : > Hi Wolfgang, > Thank you for the code and still as clear explanations. > Fabrice > > 2016-07-09 12:45 GMT+02:00 Wolfgang Schuster > : > >> Fabrice Couvreur >> 9. Juli 2016 um 12:17 >> 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] >> >> ConTeXt passes the section number to the argument of the \Headed command. >> >> But in this second example, using the command >> \determineheadnumber[chapter], the chapter number is always 0 >> >> You need \determineheadnumber[...] each time when the value for >> \currentheadnumber should change. >> >> \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}} >> >> \setuphead >> [chapter] >> [command=\HeadTitle, >> headstyle=\ss, >> numbercommand=\processMPheadnumber{\currentheadnumber}] >> >> The following works here. >> >> \startusableMPgraphic{NumberHead} >> picture r ; >> r := image ( graphictext >> "\bf\namedheadnumber{chapter}" >> scaled 4pt >> withfillcolor \MPcolor{lightgray} >> withpen pencircle scaled 1pt ; ) ; >> draw r ; >> \stopusableMPgraphic >> >> \def\processMPheadnumber#1% >> {\useMPgraphic{NumberHead}} >> >> \setuphead >> [chapter] >> [command=\HeadTitle, >> headstyle=\ss, >> numbercommand=\processMPheadnumber] >> >> 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 >> >> ___________________________________________________________________________________ >> > > --001a1146f05a289132053759311d Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hello Wolfgang,
When compiling the file with <= span>the macro,
there is a lot of files that can be deleted
(mpgraph.mpy= , mpgraph.pdf ...)
How to do ?
thank you,
Fabrice
=

2016-07-10 10:56 = GMT+02:00 Fabrice Couvreur <fabrice1.couvreur@gmail.com><= /span>:
Hi Wolf= gang,
Thank you for = the code and still as clear explanations.<= span class=3D"HOEnZb">
Fabrice

2016-07-09 12:45 GMT+02:00 Wolfgang Schu= ster <schuster.wolfgang@gmail.com>:
9.=20 Juli 2016 um 12:17
=
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=20 [chapter]
=C2=A0=C2=A0 [command=3D\HeadTitle,
=C2=A0=C2=A0=C2=A0 head= style=3D\ss,
=C2=A0=C2=A0=C2=A0=20 numbercommand=3D\Headed]

ConTeXt passes the section number to the argument of the \Headed=20 command.
But in this second example, using the=20 command \determineheadnumber[chapter], the chapter number is always 0
You need \determineheadnumber[...] each time when the value for=20 \currentheadnumber should change.
\setuppagenumbering[location=3Dfooter]

\start= usableMPgraphic{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=20 \MPstring{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=20 \MPcolor{lightgray}
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 withpen p= encircle scaled 1pt ; ) ;
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 draw r ;
=C2=A0=C2=A0=C2=A0 \stopusableMPgraphic

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

\def\processMPheadnumber#1= %
=C2=A0 {\setMPtext{chapter}{\bf#1}
=C2=A0=C2=A0 \useMPgraphic{NumberHead}}
=
\setuphead
=C2=A0=C2=A0 [chapter]
=C2=A0=C2=A0 [command=3D\HeadTitle,
=C2=A0=C2=A0=C2=A0 hea= dstyle=3D\ss,
=C2=A0=C2=A0=C2=A0=20 numbercommand=3D\processMPheadnumber{\currentheadnumber}]

The following works here.

\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 "\bf\namedheadnumber{chapte= r}"
=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{lightgray= }
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 withpen pencircle scaled 1pt ; )= ;
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 draw r ;
\stopusableMPgraphic

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

\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\processMPheadnumber]

Wolfgang

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

maillist : ntg-cont= ext@ntg.nl / http://www.ntg.nl/mailman/listinfo/nt= g-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
___________________________________________________________________________= ________


--001a1146f05a289132053759311d-- --===============0903500319795854988== 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= --===============0903500319795854988==--