From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/93492 Path: news.gmane.org!not-for-mail From: Fabrice Couvreur Newsgroups: gmane.comp.tex.context Subject: Re: Numbering and module visualcounter Date: Mon, 25 Jan 2016 18:06:15 +0100 Message-ID: References: <56A63A60.8040205@gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============9166333404386099464==" X-Trace: ger.gmane.org 1453741628 25241 80.91.229.3 (25 Jan 2016 17:07:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 25 Jan 2016 17:07:08 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Mon Jan 25 18:06:53 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 1aNkbM-0005qx-Cq for gctc-ntg-context-518@m.gmane.org; Mon, 25 Jan 2016 18:06:52 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 6A14E6451; Mon, 25 Jan 2016 18:06: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 jY4r1AX4AVgM; Mon, 25 Jan 2016 18:06:29 +0100 (CET) Original-Received: from zapf.ntg.nl (localhost [IPv6:::1]) by zapf.ntg.nl (Postfix) with ESMTP id 61BB16452; Mon, 25 Jan 2016 18:06:29 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 5B7466450 for ; Mon, 25 Jan 2016 18:06:28 +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 ziXXdSQriy1C for ; Mon, 25 Jan 2016 18:06:27 +0100 (CET) Original-Received: from mail-ig0-f176.google.com (mail-ig0-f176.google.com [209.85.213.176]) (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 3537A644F for ; Mon, 25 Jan 2016 18:06:17 +0100 (CET) Original-Received: by mail-ig0-f176.google.com with SMTP id z14so38766316igp.0 for ; Mon, 25 Jan 2016 09:06:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=71ADRYFndv+R2Jmr8wO+KO+K/RqkBEyhe70Y5nmCgDs=; b=OgvK+FaRoPfsMifMDWc6jwRjXxWlwxipSwQ4yb/3drqfAbOtQksw/+4rNxXZP9kfyd +Q7OjnIbUqbdX7W27utYzY3RkC3q9UDm+WQ+gz35JYYrgRTdUl0eIyN+mxGjSKvq1Tkn +Umk9mm7bz1rH0vTyAmw7iUYczn17tp747RafnYLxzKMWZvpf+ZU34voiP+0/XW9sCVm KERvyPlA5mJQ9aXdhIOJggAkA9mvh+v198Nu4HJYM18K+893+raFo8tE+89kCX3qIlOc /Wdcvv7R2LRGtCZz1krSuy7v0iFp7wu9pz6o3Pz1o/eZaEDlJchRyfQhy0+2JyaUIa8Y R/Vw== 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:date :message-id:subject:from:to:content-type; bh=71ADRYFndv+R2Jmr8wO+KO+K/RqkBEyhe70Y5nmCgDs=; b=jjJ9XVWfxZe4SbI+kRU6KtE4E/yUv2aH+O/JuO/rsN6RlCH391DHoeLSI0UnqJp0I7 eEA1cN2aTe3MqNDG2FfYEq30OmikNL6R34g+1pnc0Speh8L1H7UlTmorQVkCVbRn0LLO thEvC2Z4ddeLi/tVHR5iSG799ffLp6SLufUUx+t5qGpHk6I8Eq4lmnnqZkWA/hwnRXCu mH8g4pQ2T9abmSrFC0/DW58wqhDRgxPY5Nv3BemHV1MGnB6WMPaHyOy0qJpMhzgy86rO 1k8oiGk40DUQrgTfR1/4ywdCw+GEQGUvjZiv2DIM9RQGgVFVdqkZnxVZau2Cikcd1O6c HUqQ== X-Gm-Message-State: AG10YOS1bFSE2wsMxSGo5qZqHLjlzWHZ1aQ+a2OZ3/y8lH8/mgWBCVnvw4QaAhLv3OY638pTOV0xFIMjM8tmUg== X-Received: by 10.50.150.99 with SMTP id uh3mr17477613igb.1.1453741575056; Mon, 25 Jan 2016 09:06:15 -0800 (PST) Original-Received: by 10.64.1.65 with HTTP; Mon, 25 Jan 2016 09:06:15 -0800 (PST) In-Reply-To: <56A63A60.8040205@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:93492 Archived-At: --===============9166333404386099464== Content-Type: multipart/alternative; boundary=001a1134cf802d38c1052a2b96dd --001a1134cf802d38c1052a2b96dd Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Wolfgang, Without your help, I would not have found. I'll try to understand but as of today my knowledge is not yet sufficient. Thank you Fabrice 2016-01-25 16:08 GMT+01:00 Wolfgang Schuster : > 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 > 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 > textext("\white\visualcounterparameter{n}"); > > newpicture max_countertext ; max_countertext :=3D > textext("\white\visualcounterparameter{\c!max\c!text}"); > > newnumeric diameter; > diameter :=3D 1.9 * max(bbwidth(max_countertext), > bbheight(max_countertext)); > > newpath randomcircle; > randomcircle :=3D 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=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, > strut=3Dno]{\usevisualcounter{fuzzyitem}}}] > > Keep setups like this only in your examples when they are necessary 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 > > > _________________________________________________________________________= __________ > 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 > > _________________________________________________________________________= __________ > --001a1134cf802d38c1052a2b96dd Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi Wol= fgang,
W= ithout your help, I would n= ot have found. I'll try to understand but as of today my knowledge is not yet sufficient= .
Thank you
Fabrice

2016-01-25 16:08 GMT+01= :00 Wolfgang Schuster <schuster.wolfgang@gmail.com>:
25.=20 Januar 2016 um 14:20
=

Hello,<= span style=3D"font-family:verdana,sans-serif">
In the=20 code below, I use the module visualc= ounter
The numbering is obtained

1.1
1.2
1.3

How to have

1
2 =
3
?
thank you,
Fabrice

\usemodule[visualcounter]
\unprote= ct
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


\definevisualcounter
=C2=A0 [randomcircle]
=C2=A0 [
=C2=A0=C2=A0=C2=A0 mp=3Dvisualcounter::rando= mcircle,
=C2=A0=C2=A0=C2=A0=20 rulethickness=3D1pt,
=C2=A0 ]

\startuseMPgraphic{visualcounter::r= andomcircle}
=C2=A0 begingroup;

=C2=A0 \includeMPgraphic{visualcounter::initialization}=

=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=9Cn=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 fullcircle= =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;
\stopus= eMPgraphic
\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 [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=20 textstyle=3D\ss,
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 sectio= nresetset=3D,
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 number=3D= no,
=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 bodyp= artlabel=3Dchapter]

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
___________________________________________________________________________= ________

--001a1134cf802d38c1052a2b96dd-- --===============9166333404386099464== 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= --===============9166333404386099464==--