From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.4 Received: from cgl.ntg.nl (Cgl.ntg.nl [5.39.185.202]) by inbox.vuxu.org (Postfix) with ESMTP id 1B9D427397 for ; Fri, 28 Jun 2024 11:44:12 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 0BE99483827 for ; Fri, 28 Jun 2024 11:42:02 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at cgl.ntg.nl Authentication-Results: cgl.ntg.nl (amavisd-new); dkim=fail (1024-bit key) reason="fail (message has been altered)" header.d=flump.de 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 pNmUJYXwkAk8 for ; Fri, 28 Jun 2024 11:42:01 +0200 (CEST) Received: from cgl.ntg.nl (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id DB7ED482076 for ; Fri, 28 Jun 2024 11:40:54 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 38ADD480682 for ; Fri, 28 Jun 2024 11:40: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 XwZ8FrJkjuk3 for ; Fri, 28 Jun 2024 11:40:22 +0200 (CEST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=185.163.118.210; helo=flump.de; envelope-from=gerion.entrup@flump.de; receiver= Received: from flump.de (flump.de [185.163.118.210]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 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 C8193480678 for ; Fri, 28 Jun 2024 11:40:22 +0200 (CEST) Received: from falbala.localnet (ip4d1692dd.dynamic.kabel-deutschland.de [77.22.146.221]) by flump.de (Postfix) with ESMTPSA id 5DF4D1208359; Fri, 28 Jun 2024 11:40:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=flump.de; s=mail; t=1719567622; bh=gnJWAzlGK1n368YeE4E7fPqYh6er6H2vV3/aVSkEcvg=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=hWpQQPiTe1ZAk2EFwOjaJzLYhQnLflWyWe2bgEDhAsWueosXqKCZM4yYfmTe9ifTS Pgju4kWQzQlHx042vJK4us8Y1w8b5XO/SQGtrzQTwKOR4BpEWOKm7S1ccGg5+nkbOW vptc+421kuPQgAg/LVG2sASTaiQMKQ+8HrHEkHXs= From: Gerion Entrup To: Wolfgang Schuster Date: Fri, 28 Jun 2024 11:40:13 +0200 Message-ID: <2189336.irdbgypaU6@falbala> In-Reply-To: References: <6962468.BEx9A2HvPv@falbala> <6265396.KlZ2vcFHjT@falbala> MIME-Version: 1.0 Message-ID-Hash: EFS77GMBQWV5ZV7UOHW53IR4FV3JA5HJ X-Message-ID-Hash: EFS77GMBQWV5ZV7UOHW53IR4FV3JA5HJ X-MailFrom: gerion.entrup@flump.de 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 CC: mailing list for ConTeXt users X-Mailman-Version: 3.3.8 Precedence: list Reply-To: mailing list for ConTeXt users Subject: [NTG-context] Re: Use headcommand in \definedescription together with \definehighlight (now: \definestartstop) 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="===============4174962297474326879==" --===============4174962297474326879== Content-Type: multipart/signed; boundary="nextPart13544273.uLZWGnKmhe"; micalg="pgp-sha256"; protocol="application/pgp-signature" --nextPart13544273.uLZWGnKmhe Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8"; protected-headers="v1" From: Gerion Entrup To: Wolfgang Schuster Cc: mailing list for ConTeXt users Date: Fri, 28 Jun 2024 11:40:13 +0200 Message-ID: <2189336.irdbgypaU6@falbala> In-Reply-To: MIME-Version: 1.0 Am Donnerstag, 27. Juni 2024, 22:19:02 MESZ schrieb Wolfgang Schuster: > Gerion Entrup schrieb am 25.06.2024 um 08:41: > > Am Dienstag, 25. Juni 2024, 00:09:09 MESZ schrieb Wolfgang Schuster: > >> Gerion Entrup schrieb am 24.06.2024 um 23:57: > >>> Am Montag, 24. Juni 2024, 21:20:19 MESZ schrieb Aditya Mahajan: > >>>> On Mon, 24 Jun 2024, Gerion Entrup wrote: > >>>> > >>>>> Hi, > >>>>> > >>>>> I was in the process to convert an itemize part to a description an= d wanted to simplify the code in the same move. > >>>>> I discovered headcommand for that, but struggled to set the text in= an highlight _and_ make a colon at the end. > >>>> Not sure what exactly you want, but how about: > >>>> > >>>> \definehighlight[hl][style=3D{\m{>}\,\switchtobodyfont[tt]}] > >>>> % This is the wrong way to define such a command as '>' is not part = of the style. I have left this definition just for comparison with the soln= below. > >>> Is there a better way to define a highlight that sets a style (color,= font) _and_ a prefix (symbol)? > >>> Another way, I know of, would be just a plain def, something like \de= f{\hl}{\groupedcommand{>\,\switchtobodyfont[tt]}{}}, but actually I want to= define a highlight (just with an additional prefix). > >> > >> 1. ConTeXt already uses \hl as name for a existing command. > >> > >> 2. Use \definestartstop: > >> > >> \definestartstop [gerion] [style=3Dmono,left=3D{=E2=80=BA\thinspace}] > >> > >> \starttext > >> > >> text > >> > >> \gerion{text} > >> > >> \stoptext > >> > >>>> \definedescription[category][ > >>>> alternative=3Dtop, > >>>> headstyle=3Dbold, > >>>> width=3Dbroad, > >>>> ] > >>>> > >>>> \definedescription[desc][ > >>>> width=3Dfit, > >>>> distance=3D{\widthofstring{~}}, > >> > >> distance=3D\spaceamount, > >> > >> Wolfgang > >=20 > > This seems to be much better but does not lead to the wanted result. Th= e full example now is: > > ``` > > \definestartstop[myhl][style=3Dmono,left=3D{=E2=80=BA\thinspace}] > >=20 > > \definedescription[categorie][ > > alternative=3Dtop, > > headstyle=3Dbold, > > width=3Dbroad, > > ] > >=20 > > \definedescription[desc][ > > width=3Dbroad, > > distance=3D\spaceamount, > > headcommand=3D{\groupedcommand{\startmyhl}{\stopmyhl :}}, > > headstyle=3D, > > before=3D{\startpacked}, > > after=3D{\stoppacked}, > > alternative=3Dhanging > > ] > >=20 > > \starttext > >=20 > > This is a \myhl{highlight}. > >=20 > > Some listings > >=20 > > \startcategorie{Itemize} > > \startitemize[packed] > > \item \myhl{first}: one > > \item \myhl{second}: two > > \stopitemize > > \stopcategorie > >=20 > > Now the same as desc: > > \startcategorie{Desc} > > \startdesc{first} one \stopdesc > > \startdesc{second} two \stopdesc > > \stopcategorie > >=20 > > \stoptext > > ``` > >=20 > > This adopts the correct style in \startdesc \stopdesc and sets the colo= n but omits the =E2=80=BA (the left part). >=20 > You can do the following in the next version. >=20 > 1. Add "arguments=3Dyes" to \definestartstop to enable the optional=20 > argument for the new command. >=20 > 2. Use the new commands with the "headcommand" key and apply ":" as=20 > right delimiter for the content of \Highlight. >=20 > \definestartstop > [Highlight] > [arguments=3Dyes, > style=3Dmono, > left=3D{=E2=80=BA\thinspace}] >=20 > \definedescription > [description] > [ width=3Dbroad, > distance=3D\spaceamount, > headcommand=3D\Highlight[right=3D:], > alternative=3Dhanging] >=20 > \starttext >=20 > This is a \Highlight{highlight}. >=20 > \startdescription[title=3D{Lorem ipsum}] > \samplefile{lorem} > \stopdescription >=20 > \stoptext >=20 > Wolfgang Thanks, that will work. Do you know, why the groupedcommand solution does not work? Gerion --nextPart13544273.uLZWGnKmhe Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQGzBAABCAAdFiEEM/tVN9WpYYHnPZHxloeAdSYJHeoFAmZ+hP0ACgkQloeAdSYJ HerC7QwApBZ2yCzDkKDTwONn9h2Re60MngHKx9VrVTNbHwIXA6+YIG7hKpk6yBSS OFSfqRkVWhDiS/ZyfY8XMmneNmQSvypEX8+YO3fye8acJ+nMj0h9J9zcrVVtG9NA EXcApPfZlBHJk2N6agkxQ+OxGtngarhwHU6JslKqEY/s7kE8xwayOKuOz8MfHuUM FlnGr9E9lc2dsrwrQCopDooMMbHgInSLH3A+vfAttWMEoyNSFZ6UIfftKEPvnbCw XPq+n0E1D+UamTyUPKfnIcdtP4LIGS6ebN9ZXAMtedheEz+v5wcWMQ3kDmnxfeUI yab973LIK0dkd+c+208UM+J1q9QpQ/SH2QNBhVo/bmQwddL52Og8XRx+KwXJUipg Gf18HrhFkbk0Asx6qdwpeXi7MtEpMK+NSRTjUvCeEBObN/X6ZSdVPdIYmHYYbOfj PPAQ/tLva/vQ9j2bAjCRICReyo/kV1/SyknEOVlq29P5M+cdBUgNWdrx+YsmKuju 3nOVC7HS =BFGf -----END PGP SIGNATURE----- --nextPart13544273.uLZWGnKmhe-- --===============4174962297474326879== 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://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___________________________________________________________________________________ --===============4174962297474326879==--