From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,HK_RANDOM_FROM,HTML_MESSAGE, MAILING_LIST_MULTI,URIBL_SBL_A autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 14510 invoked from network); 17 Sep 2023 18:22:30 -0000 Received: from cgl.ntg.nl (5.39.185.202) by inbox.vuxu.org with ESMTPUTF8; 17 Sep 2023 18:22:30 -0000 Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 01EC24830CD for ; Sun, 17 Sep 2023 20:21:23 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at cgl.ntg.nl Received: from cgl.ntg.nl ([127.0.0.1]) by localhost (cgl.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FEmCI_BHfgWD for ; Sun, 17 Sep 2023 20:21:22 +0200 (CEST) Received: from cgl.ntg.nl (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id D4B154830F5 for ; Sun, 17 Sep 2023 20:20:36 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 4AAD8482C51 for ; Sun, 17 Sep 2023 20:20:09 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at cgl.ntg.nl Received: from cgl.ntg.nl ([127.0.0.1]) by localhost (cgl.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id u5kvd9yU-YPx for ; Sun, 17 Sep 2023 20:20:08 +0200 (CEST) Received: from mail-pj1-f47.google.com (mail-pj1-f47.google.com [209.85.216.47]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by cgl.ntg.nl (Postfix) with ESMTPS id D256C4824F3 for ; Sun, 17 Sep 2023 20:20:08 +0200 (CEST) Received: by mail-pj1-f47.google.com with SMTP id 98e67ed59e1d1-274939681b5so1591283a91.0 for ; Sun, 17 Sep 2023 11:20:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1694974806; x=1695579606; darn=ntg.nl; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=ALpwgxFTqRdgSSqhkDNolqKYueF9G1w5cGLf8FhDmwA=; b=VN/pqQtCsrEeZaCN/6zDbiph0Dxv6YLq+01O6S/RCwNWkhgBWTGtzX9QRL5DzfNaNW Ft23IAsWZofzi9jC2SWYME2ODB1A4+BHLTqYYVH5xc8AFsIucPwA8ZXPLg3P44keUD8F y9sE+KCR3SuFwdLqKv2bVR4xEJ6eCEFfzed6KVCkwz+AnD8r4XNPaltUDaKn8npuWVWN fBWlLdWqn5G/zm90npobvb8zLPOIHYbuzhvlISQoZwNOJEyXK40Bnjb7t3kAkpyE580E EzYws4lXl0M+N1IwWSmJEKhcWdI/itFWLDwfTSTaHIHeTyG8ic/P1t7BxlhJa9j9x66C VyWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694974806; x=1695579606; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ALpwgxFTqRdgSSqhkDNolqKYueF9G1w5cGLf8FhDmwA=; b=YX7t+W8Z3fu3HvZvOriSXEWc4vAUECyUrF9mJ636DRsGEo0byzFnt9nk8MilFRytK9 4eYY9P5+mP0DZbASywht74AfHN1of+5vkxpsDA/MNIgbW2YuweRoJJWTIoxX4lTRiiuz UI4RBi2SbyxkAm1mQ3OGKjV9meIY3EBLL2Gwcox3X6JfHbVBZWhlS6jzqYefbMPZGLiD HvEsL9A5sEQOqs6O/i9MkudY7Ky4xP4jNV7Pn/IVz3gWv2mtrH8fGNwdWI9FBTyvuncH byouTEoBWW45X2m/HiG9MaccypNGK+rmd53UF+LmJSZ87lf3Vrps15eCeudGVG0tOms8 uFeg== X-Gm-Message-State: AOJu0YzrLC836PDYSVs5A9PNwthg7wTsCc+ORPFxMFmX0ywShE599/CT 6xfghszkWTWCc2gUHkssKgogYu/ycVPmgcpX/6+MvBUubqA= X-Google-Smtp-Source: AGHT+IGaeWTTF00ofmYkCSfgFFj4XZhfWcjX3kLhAcJwmtU8N8Y/CCMVOgfQBeVCqGAnIcsO0ydQNxmN1HI7bEp952I= X-Received: by 2002:a17:90a:688f:b0:267:fba3:ed96 with SMTP id a15-20020a17090a688f00b00267fba3ed96mr4772439pjd.3.1694974806011; Sun, 17 Sep 2023 11:20:06 -0700 (PDT) MIME-Version: 1.0 References: <96EF80BB-8B9D-493A-B329-552392C161A9@scorecrow.com> In-Reply-To: <96EF80BB-8B9D-493A-B329-552392C161A9@scorecrow.com> From: Jeroen Date: Sun, 17 Sep 2023 20:19:56 +0200 Message-ID: To: mailing list for ConTeXt users Message-ID-Hash: VHTQ5GUKOWYQ72W7EP36XABTZHP6IODM X-Message-ID-Hash: VHTQ5GUKOWYQ72W7EP36XABTZHP6IODM X-MailFrom: contextntg@gmail.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list Reply-To: mailing list for ConTeXt users Subject: [NTG-context] Re: Framed Text with Chapter Numbers as Counter List-Id: mailing list for ConTeXt users Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: multipart/mixed; boundary="===============8649124484684474865==" --===============8649124484684474865== Content-Type: multipart/alternative; boundary="00000000000037331f060592133b" --00000000000037331f060592133b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable That works fine except that the following line does only issue the sequential number and not the chapter number. Refer to \in{code fragment}[tit1] bla MWE: \startuseMPgraphic{CountFrame} picture p; numeric w, h, o; p :=3D textext.rt("\wrappedcurrentconstruction"); w :=3D OverlayWidth; h :=3D OverlayHeight; o :=3D BodyFontSize; p :=3D p shifted (2o,h-ypart center p); draw p; path b; b :=3D boundingbox p enlarged (o/10); path a; a :=3D (2o,h)--(0,h)--(0,0)--(w,0)--(w,h)--(xpart urcorner b,h); drawoptions (withpen pencircle scaled 1pt withcolor black); draw a; draw b; setbounds currentpicture to OverlayBox; \stopuseMPgraphic \defineoverlay [CountFrame] [\useMPgraphic{CountFrame}] \defineframedtext [CountFramedText] [frame=3Doff, background=3DCountFrame, offset=3D\bodyfontsize, width=3D\textwidth, % style=3D{\switchtobodyfont[11pt,tt]}] bodyfont=3D11pt, style=3D{\tt}] \defineenumeration [Code] [title=3Dyes, alternative=3Dempty, before=3D\startCountFramedText, after=3D\stopCountFramedText, left=3D{\somenamedheadnumber{chapter}{current}.}] \starttext \startchapter [title=3Dfirst] \startCode [title=3D{The First Title}, reference=3D{tit1}] Some verbatim text \stopCode \startCode [title=3D{The Second Title}, reference=3D{tit2}] Some verbatim text \stopCode Refer to \in{code fragment}[tit1] bla \stopchapter \startchapter [title=3Dsecond] \startCode [title=3D{The Third Title}, reference=3D{tit3}] Some verbatim text \stopCode \stopchapter \stoptext Op zo 17 sep 2023 om 17:31 schreef Bruce Horrocks : > > > > On 16 Sep 2023, at 21:28, Jeroen wrote: > > > > This MWE has a framed text for some verbatim text (code) with as title > ref. a counter 1, 2, etc.. Is there a way to change this frame text title > as following with the chapter number and a sequential number and the titl= e. > > Amemd the \defineenumeration as follows: > > \defineenumeration > [Counter] > [title=3Dyes, > alternative=3Dempty, > before=3D\startCountFramedText, > after=3D\stopCountFramedText, > left=3D{\somenamedheadnumber{chapter}{current}:}] > > =E2=80=94 > Bruce Horrocks > Hampshire, UK > > > _________________________________________________________________________= __________ > If your question is of interest to others as well, please add an entry to > the Wiki! > > maillist : ntg-context@ntg.nl / > https://www.ntg.nl/mailman/listinfo/ntg-context > webpage : https://www.pragma-ade.nl / http://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : https://contextgarden.net > > _________________________________________________________________________= __________ --00000000000037331f060592133b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
That works fine except that the following line does only i= ssue the sequential number and not the chapter number.

R= efer to \in{code fragment}[tit1] bla

MWE:
=
\startuseMPgraphic{CountFrame}
=C2=A0 picture p; numeric = w, h, o;
=C2=A0 p :=3D textext.rt("\wrappedcurrentconstruction"= ;);
=C2=A0 w :=3D OverlayWidth;
=C2=A0 h :=3D OverlayHeight;
=C2= =A0 o :=3D BodyFontSize;
=C2=A0 p :=3D p shifted (2o,h-ypart center p);<= br>=C2=A0 draw p;
=C2=A0 path b;
=C2=A0 b :=3D boundingbox p enlarged= (o/10);
=C2=A0 path a;
=C2=A0 a :=3D (2o,h)--(0,h)--(0,0)--(w,0)--(w= ,h)--(xpart urcorner b,h);
=C2=A0 drawoptions (withpen pencircle scaled = 1pt withcolor black);
=C2=A0 draw a;
=C2=A0 draw b;
=C2=A0 setboun= ds currentpicture to OverlayBox;
\stopuseMPgraphic

\defineoverlay=
=C2=A0 [CountFrame]
=C2=A0 [\useMPgraphic{CountFrame}]

\defin= eframedtext
=C2=A0 [CountFramedText]
=C2=A0 [frame=3Doff,
=C2=A0 = =C2=A0background=3DCountFrame,
=C2=A0 =C2=A0offset=3D\bodyfontsize,
= =C2=A0 =C2=A0width=3D\textwidth,
% =C2=A0style=3D{\switchtobodyfont[11pt= ,tt]}]
=C2=A0 =C2=A0bodyfont=3D11pt,
=C2=A0 =C2=A0style=3D{\tt}]
<= br>\defineenumeration
=C2=A0 [Code]
=C2=A0 [title=3Dyes,
=C2=A0 = =C2=A0alternative=3Dempty,
=C2=A0 =C2=A0before=3D\startCountFramedText,<= br>=C2=A0 =C2=A0after=3D\stopCountFramedText,
=C2=A0 =C2=A0left=3D{\some= namedheadnumber{chapter}{current}.}]

\starttext

\startchapter=
=C2=A0 [title=3Dfirst]

\startCode
=C2=A0 [title=3D{The First = Title},
=C2=A0 =C2=A0reference=3D{tit1}]
=C2=A0 =C2=A0Some verbatim t= ext
\stopCode

\startCode
=C2=A0 [title=3D{The Second Title},=C2=A0 =C2=A0reference=3D{tit2}]
=C2=A0 =C2=A0Some verbatim text
\s= topCode

Refer to \in{code fragment}[tit1] bla

\stopchapter
\startchapter
=C2=A0 [title=3Dsecond]

\startCode
=C2=A0 [= title=3D{The Third Title},
=C2=A0 =C2=A0reference=3D{tit3}]
=C2=A0 = =C2=A0Some verbatim text
\stopCode

\stopchapter

\stoptext<= br>

Op zo 17 sep 2023 om 17:31 schreef Bruce Horrocks <ntg@scorecrow.com>:


> On 16 Sep 2023, at 21:28, Jeroen <contextntg@gmail.com> wrote:
>
> This MWE has a framed text for some verbatim text (code) with as title= ref. a counter 1, 2, etc.. Is there a way to change this frame text title = as following with the chapter number and a sequential number and the title.=

Amemd the \defineenumeration as follows:

\defineenumeration
=C2=A0 [Counter]
=C2=A0 [title=3Dyes,
=C2=A0 =C2=A0alternative=3Dempty,
=C2=A0 =C2=A0before=3D\startCountFramedText,
=C2=A0 =C2=A0after=3D\stopCountFramedText,
=C2=A0 =C2=A0left=3D{\somenamedheadnumber{chapter}{current}:}]

=E2=80=94
Bruce Horrocks
Hampshire, UK

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

maillist : ntg-cont= ext@ntg.nl / https://www.ntg.nl/mailman/listinfo/= ntg-context
webpage=C2=A0 : https://www.pragma-ade.nl / http://context.aanhet.net
archive=C2=A0 :
https://bitbucket.org/phg/context-m= irror/commits/
wiki=C2=A0 =C2=A0 =C2=A0: https://contextgarden.net
___________________________________________________________________________= ________
--00000000000037331f060592133b-- --===============8649124484684474865== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___________________________________________________________________________________ --===============8649124484684474865==--