From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/93483 Path: news.gmane.org!not-for-mail From: Fabrice Couvreur Newsgroups: gmane.comp.tex.context Subject: Numbering and module visualcounter Date: Mon, 25 Jan 2016 14:20:34 +0100 Message-ID: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5496467919043156348==" X-Trace: ger.gmane.org 1453728073 17644 80.91.229.3 (25 Jan 2016 13:21:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 25 Jan 2016 13:21:13 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Mon Jan 25 14:21:00 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 1aNh4m-00034F-Hh for gctc-ntg-context-518@m.gmane.org; Mon, 25 Jan 2016 14:21:00 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 59F106402; Mon, 25 Jan 2016 14:20:49 +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 wrkQuYQs6iXk; Mon, 25 Jan 2016 14:20:48 +0100 (CET) Original-Received: from zapf.ntg.nl (localhost [IPv6:::1]) by zapf.ntg.nl (Postfix) with ESMTP id A408F63EE; Mon, 25 Jan 2016 14:20:48 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 7F3EF63EE for ; Mon, 25 Jan 2016 14:20:47 +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 yLAoahcgCkhs for ; Mon, 25 Jan 2016 14:20:46 +0100 (CET) Original-Received: from mail-io0-f177.google.com (mail-io0-f177.google.com [209.85.223.177]) (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 50BBA63DB for ; Mon, 25 Jan 2016 14:20:36 +0100 (CET) Original-Received: by mail-io0-f177.google.com with SMTP id g73so154397072ioe.3 for ; Mon, 25 Jan 2016 05:20:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=vjnu2qzTcqbkiJIWQMazS5tGPVhTdWnapWxx5tI3U20=; b=S2BMaS9yXC6a/KncLFhu71Qg8A/oj/fx/PklK3OiyHMs5KkdMg7MznBNdCiE/EMgrI L3IwzZx2dLM5FTpGYcfRQtPZI7QCC3RW94n2nt+gpucaMhy9uAxArOUbXe/DnYIWNCQO rt7jY/XWZOy4hW04Ptzb+liipT6XNxOBeKQs6sCZr5E3hgiefCZBO3MKv8ByRo5kwsFG 1fW0Fjn63fem/Vcad7tooz1CKW3CJD7XAVo68d09prXd67EA/bY7HIjNLBd6RPh6x/cK QSssm6EECH1iQ+K2GoysRX9OEChbq8McuN7CxBVtVyOFK+M8odlhY44J++AtCJS//Ybd qPkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to :content-type; bh=vjnu2qzTcqbkiJIWQMazS5tGPVhTdWnapWxx5tI3U20=; b=KmVLBU19n+vYga5FIrGO2fuzzrpkvX+zre1vrxBB0Vhr10dNVYejxg/CfgpmT7/gzE EML3Nh2+IVs+odYYgf5fUlubCaf4g3EeywsLeUP3JFuoc7UbehiFPX5j3g1OKX7difPR W/bRIqa0naQxdut/EheDCrRHJrzxylUI2fVxyIwECCCpR1NXNkmEYWZrns/8VIBu267Y gT8ViCjJHWLqkZvo+DnP8XCticvYcjayRyrKID7soN8TVkJnqVvRSG9CbJGJQY9svLsk AZ/NEo2XXMrELLwtjPMiWQFp0uyDs7mKcjmzNUD07+ZlDGgmh16/TIzRtABtNQfBRwww A01g== X-Gm-Message-State: AG10YOQ8mKVcB/ftfnGBze2HfHWJTBaK7qcfgEmqKzqAsyOfLVgouhWXoXpPHuZ+Og0Jt4mm6NM6jqnxWGxS/w== X-Received: by 10.107.167.17 with SMTP id q17mr16417049ioe.61.1453728034615; Mon, 25 Jan 2016 05:20:34 -0800 (PST) Original-Received: by 10.64.1.65 with HTTP; Mon, 25 Jan 2016 05:20:34 -0800 (PST) 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:93483 Archived-At: --===============5496467919043156348== Content-Type: multipart/alternative; boundary=001a114151081a79e9052a286f3b --001a114151081a79e9052a286f3b Content-Type: text/plain; charset=UTF-8 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 \definevisualcounter [randomcircle] [ mp=visualcounter::randomcircle, rulethickness=1pt, ] \startuseMPgraphic{visualcounter::randomcircle} begingroup; \includeMPgraphic{visualcounter::initialization} if (last_counter > 0) and (current_counter > 0) : newpicture countertext ; countertext := textext("\white\visualcounterparameter\c!text"); newpicture max_countertext ; max_countertext := textext("\white\visualcounterparameter{\c!max\c!text}"); newnumeric diameter; diameter := 1.9 * max(bbwidth(max_countertext), bbheight(max_countertext)); newpath randomcircle; randomcircle := fullcircle xyscaled(diameter, diameter) randomized (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=\getvalue{v_strc_itemgroups_counter}] \definesymbol[fuzzy][{\framed[location=depth, frame=off, strut=no]{\usevisualcounter{fuzzyitem}}}] \setuphead [part] [command=\ChapterCommand, page=yes, textstyle=\ss, sectionresetset=, number=no, placehead=yes, bodypartlabel=chapter] \setuphead [chapter] [command=\ChapterCommand, textstyle=\ss, sectionresetset=, conversion=, number=no, page=no, placehead=yes, bodypartlabel=part, sectionsegments=chapter:chapter] \setuphead [section] [command=\ChapterCommand, textstyle=\ss, page=yes, conversion=numbers, sectionsegments=section:section, number=yes] \starttext \startpart [title={First Part}] \startchapter [title={First chapter}] \startsection [title={First section}] \startitemize[fuzzy] \startitem \input knuth \stopitem \startitem \input knuth \stopitem \stopitemize \stopsection \stopchapter \stoppart \stoptext --001a114151081a79e9052a286f3b Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

Hello,<= br> 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
\definevisu= alcounter
=C2=A0 [randomcircle]
=C2=A0 [
=C2=A0=C2=A0=C2=A0 mp=3Dv= isualcounter::randomcircle,
=C2=A0=C2=A0=C2=A0 rulethickness=3D1pt,
= =C2=A0 ]

\startuseMPgraphic{visualcounter::randomcircle}
=C2=A0 b= egingroup;

=C2=A0 \includeMPgraphic{visualcounter::initialization}
=C2=A0 if (last_counter > 0) and (current_counter > 0) :
=C2= =A0=C2=A0=C2=A0 newpicture countertext=C2=A0=C2=A0=C2=A0=C2=A0 ; countertex= t=C2=A0=C2=A0=C2=A0=C2=A0 :=3D textext("\white\visualcounterparameter\= c!text");
=C2=A0=C2=A0=C2=A0 newpicture max_countertext ; max_count= ertext :=3D textext("\white\visualcounterparameter{\c!max\c!text}"= ;);

=C2=A0=C2=A0=C2=A0 newnumeric diameter;
=C2=A0=C2=A0=C2=A0 di= ameter :=3D 1.9 * 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 fullcircle xyscaled(diameter, diameter= ) randomized (diameter/20);

=C2=A0=C2=A0=C2=A0 pickup pencircle scal= ed \visualcounterparameter\c!rulethickness ;
=C2=A0=C2=A0=C2=A0 fill ran= domcircle withcolor green; % Can be made configurable
=C2=A0=C2=A0=C2=A0= label (countertext, origin);


=C2=A0 fi;
=C2=A0 endgroup;
= \stopuseMPgraphic
\protect

\definevisualcounter
=C2=A0 [fuzzyi= tem]
=C2=A0 [randomcircle]
=C2=A0 [counter=3D\getvalue{v_strc_itemgro= ups_counter}]

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

\setuphead [part= ]
=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 textstyle=3D\ss,
=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 sectionresetset=3D,
=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 number=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 bodypartlabel=3Dchapter]

\setuphead [chapter]
= =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 textstyle=3D\ss,
=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 sectionresetset=3D,
=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 conversion=3D,
=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 number=3Dno,
=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 page=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 bodypartlabel=3Dpart,
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 sectionsegments=3Dchapter:chapter]

\setuphead [section]
= =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 textstyle=3D\ss,
=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 conversion=3Dnumbers,
=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 sectionsegments=3Dsection:section,
=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 number=3Dyes]

\startte= xt

\startpart
=C2=A0 [title=3D{First Part}]

\startchapter<= br>=C2=A0=C2=A0=C2=A0=C2=A0 [title=3D{First chapter}]

\startsection<= br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 [title=3D{First section}]

\startit= emize[fuzzy]

\startitem \input knuth \stopitem
\startitem \input = knuth \stopitem

\stopitemize

\stopsection

\stopchapter=

\stoppart

\stoptext
--001a114151081a79e9052a286f3b-- --===============5496467919043156348== 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= --===============5496467919043156348==--