From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/93488 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: Numbering and module visualcounter Date: Mon, 25 Jan 2016 16:08:16 +0100 Message-ID: <56A63A60.8040205@gmail.com> References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4034313086668305174==" X-Trace: ger.gmane.org 1453734550 29674 80.91.229.3 (25 Jan 2016 15:09:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 25 Jan 2016 15:09:10 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Mon Jan 25 16:08:59 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 1aNilF-0005ME-Ip for gctc-ntg-context-518@m.gmane.org; Mon, 25 Jan 2016 16:08:57 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 7C85D6430; Mon, 25 Jan 2016 16:08:31 +0100 (CET) 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 BevwveYejZZh; Mon, 25 Jan 2016 16:08:28 +0100 (CET) Original-Received: from zapf.ntg.nl (localhost [IPv6:::1]) by zapf.ntg.nl (Postfix) with ESMTP id 309356427; Mon, 25 Jan 2016 16:08:28 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id F14B36422 for ; Mon, 25 Jan 2016 16:08:26 +0100 (CET) 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 njrwKcUzi2W0 for ; Mon, 25 Jan 2016 16:08:26 +0100 (CET) Original-Received: from mail-wm0-f42.google.com (mail-wm0-f42.google.com [74.125.82.42]) (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 4F92F6421 for ; Mon, 25 Jan 2016 16:08:16 +0100 (CET) Original-Received: by mail-wm0-f42.google.com with SMTP id b14so84728969wmb.1 for ; Mon, 25 Jan 2016 07:08:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type; bh=Ip8Atsy5lmSpcRkfQiZyly/RuOY3HCMqte/jqWPEvgM=; b=FPwqvIL6K14kngYqvijRL6/J1St1ksbfNgaRVaC4zp1ob0xt+S78pGZCIpsLtFyaDf bMCQF0/9AZpjNiuiA3aSMuLOwlY1B4e7fg3HROc1N0wBW4pKEEYi2IFtbTq7mJBV2xtN ykF0TElzZFMFKahURTc1LMGKm5mf9i8deQvvlg1RUQBKkM/69TnBru7tezl0/C0oa5WY Q6LpZyuJ1V67A5Yd3JxbonK/lik+zjbcl8D1g4J/BJNrYPZ1S47a+qMi5OgpO3r0HAE5 2tVhzBa0KDPhy15XcxuXtAv3C3g5mVq3iXLiljcCxukKulOovavTXBwgfN1dAcTsLi1d cO4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type; bh=Ip8Atsy5lmSpcRkfQiZyly/RuOY3HCMqte/jqWPEvgM=; b=NiddBuLOw4QCGB4ti7JzZWbhRFAdAPEakDYZH2x0lFy2PrnP1+sGNd/dWRqw4KW0Uc F1+OkouTve8yoEMtChaRt1uHCr+Aup0lPU4GUE8dKf7Hg/yClZmSRgCBMP24rwXGm0zg +TWpdu08Fm4LfRrtrzq81GoCJTgJklvuwSZYllT6Sn1HeyF/mk03tBhidNktCpYcNyFR N+sva2vZAWSvmPqs0+meNS/6V3qGp2Gc+uZF1Kodg/B5VRshFN9pzYPmtXBwENC2aBSq o1G0lZZRH8kQTQuA1krySyh1Boyt0fzX2V0j6Pl2ijzxP0FM289Bnm2tHaWES3R2t3Xg +j3w== X-Gm-Message-State: AG10YOQ8wpmLlUatRUuZ82yrjc+04uyGTB0rHZ4s2I8iANJtpuoRLCUzDv/dQFz1QFD1nQ== X-Received: by 10.28.54.65 with SMTP id d62mr17964955wma.35.1453734495814; Mon, 25 Jan 2016 07:08:15 -0800 (PST) Original-Received: from keima.localdomain (x2f242e9.dyn.telefonica.de. [2.242.66.233]) by smtp.gmail.com with ESMTPSA id q75sm16659154wmd.6.2016.01.25.07.08.14 for (version=TLSv1/SSLv3 cipher=OTHER); Mon, 25 Jan 2016 07:08:15 -0800 (PST) User-Agent: Postbox 4.0.8 (Macintosh/20151105) 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:93488 Archived-At: This is a multi-part message in MIME format. --===============4034313086668305174== Content-Type: multipart/alternative; boundary="------------020506030903010801040400" This is a multi-part message in MIME format. --------------020506030903010801040400 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable > Fabrice Couvreur > 25. Januar 2016 um 14:20 > > Hello, > In the code below, I use the module visualcounter > The numbering is obtained > > 1.1 > 1.2 > 1.3 > How to have > > 1 > 2 > 3? > thank you, > Fabrice > > \usemodule[visualcounter] > \unprotect You can drop the \unprotect and \protect command when you use \visualcounterparameter{XXX} instead of \visualcounterparameter\c!XXX > \definevisualcounter > [randomcircle] > [ > mp=3Dvisualcounter::randomcircle, > rulethickness=3D1pt, > ] > > \startuseMPgraphic{visualcounter::randomcircle} > begingroup; > > \includeMPgraphic{visualcounter::initialization} > > if (last_counter > 0) and (current_counter > 0) : > newpicture countertext ; countertext :=3D=20 > textext("\white\visualcounterparameter\c!text"); You need the value of the =E2=80=9Cn=E2=80=9D key, not the =E2=80=9Ctext=E2= =80=9D key. newpicture countertext ; countertext :=3D=20 textext("\white\visualcounterparameter{n}"); > newpicture max_countertext ; max_countertext :=3D=20 > textext("\white\visualcounterparameter{\c!max\c!text}"); > > newnumeric diameter; > diameter :=3D 1.9 * max(bbwidth(max_countertext),=20 > bbheight(max_countertext)); > > newpath randomcircle; > randomcircle :=3D fullcircle xyscaled(diameter, diameter) randomize= d=20 > (diameter/20); > > pickup pencircle scaled \visualcounterparameter\c!rulethickness ; > fill randomcircle withcolor green; % Can be made configurable > label (countertext, origin); > > > fi; > endgroup; > \stopuseMPgraphic > \protect > > \definevisualcounter > [fuzzyitem] > [randomcircle] > [counter=3D\getvalue{v_strc_itemgroups_counter}] You can set the counter for the enumeration with [counter=3Ditemgroup:itemize] > \definesymbol[fuzzy][{\framed[location=3Ddepth, frame=3Doff,=20 > strut=3Dno]{\usevisualcounter{fuzzyitem}}}] > Keep setups like this only in your examples when they are necessary=20 which isn=E2=80=99t the case here. > \setuphead [part] > [command=3D\ChapterCommand, > page=3Dyes, > textstyle=3D\ss, > sectionresetset=3D, > number=3Dno, > placehead=3Dyes, > bodypartlabel=3Dchapter] Wolfgang --------------020506030903010801040400 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
25= .=20 Januar 2016 um 14:20

Hello,
In the=20 code below, I use the module visualcounter

The numbering= is obtained

1.1
1.2
1.3

How to have

1
2
3
?
thank you,
Fabrice

\usemodule[visualcounter= ]
\unprotect
You can drop the \unprotect and \protect command when you use

=C2=A0=C2=A0=C2=A0 \visualcounterparameter{XXX}

instead of

=C2=A0=C2=A0=C2=A0 \visualcounterparameter\c!XXX=


\definevisual= counter
=C2=A0 [randomcircle]
=C2=A0 [
=C2=A0=C2=A0=C2=A0 mp=3Dvisualcounter::ran= domcircle,
=C2=A0=C2=A0=C2=A0=20 rulethickness=3D1pt,
=C2=A0 ]

\startuseMPgraphic{visualcounter:= :randomcircle}
=C2=A0 begingroup;

=C2=A0 \includeMPgraphic{visualcounter::initializatio= n}

=C2=A0 if (last_counter > 0) and (current_counter > 0) :
=C2=A0=C2=A0=C2= =A0=20 newpicture countertext=C2=A0=C2=A0=C2=A0=C2=A0 ; countertext=C2=A0=C2=A0=C2= =A0=C2=A0 :=3D=20 textext("\white\visualcounterparameter\c!text");
=
You need the value of the =E2=80=9C= n=E2=80=9D key,=20 not the =E2=80=9Ctext=E2=80=9D key.

newpicture countertext=C2=A0=C2=A0=C2=A0=C2=A0 ; countertext=C2=A0=C2=A0=C2= =A0=C2=A0 :=3D=20 textext("\white\visualcounterparameter{n}");
=C2=A0=C2=A0=C2= =A0 newpicture=20 max_countertext ; max_countertext :=3D=20 textext("\white\visualcounterparameter{\c!max\c!text}");

=C2=A0=C2= =A0=C2=A0=20 newnumeric diameter;
=C2=A0=C2=A0=C2=A0 diameter :=3D 1.9 *=20 max(bbwidth(max_countertext), bbheight(max_countertext));
=C2=A0=C2=A0= =C2=A0
=C2=A0=C2=A0=C2=A0 newpath randomcircle;
=C2=A0=C2=A0=C2=A0 randomcircle :=3D fullcircl= e=20 xyscaled(diameter, diameter) randomized (diameter/20);

=C2=A0=C2=A0= =C2=A0 pickup pencircle scaled \visualcounterparameter\c!rulethickness ;
=C2=A0=C2=A0= =C2=A0 fill=20 randomcircle withcolor green; % Can be made configurable
=C2=A0=C2=A0=C2= =A0 label=20 (countertext, origin);


=C2=A0 fi;
=C2=A0 endgroup;
\stop= useMPgraphic
\protect

\definevisualcounter
=C2=A0 [fuzzyitem]
=C2=A0 [randomcircle]
=C2=A0=20 [counter=3D\getvalue{v_strc_itemgroups_counter}]
=
You can set the counter for the enumeration with

=C2=A0=C2=A0=C2=A0 [counter=3Ditemgroup:itemize]

\definesymbol= [fuzzy][{\framed[location=3Ddepth, frame=3Doff, strut=3Dno]{\usevisualcounter{fuzzyitem}}}]

Keep setups like this only in your examples when they are necessary=20 which isn=E2=80=99t the case here.
\setuphead [par= t]
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 [command=3D\ChapterCommand,
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 page=3Dyes,
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=20 textstyle=3D\ss,
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 sect= ionresetset=3D,
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 numbe= r=3Dno,
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 placehead=3Dyes,
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 bod= ypartlabel=3Dchapter]

Wolfgang
--------------020506030903010801040400-- --===============4034313086668305174== 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= --===============4034313086668305174==--