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 D614C217F5 for ; Tue, 25 Jun 2024 00:00:13 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 7D216484733 for ; Mon, 24 Jun 2024 23:58:41 +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 6EJkmtQ0DOOf for ; Mon, 24 Jun 2024 23:58:41 +0200 (CEST) Received: from cgl.ntg.nl (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id DD0BB4845B5 for ; Mon, 24 Jun 2024 23:58:08 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 0D3054843F5 for ; Mon, 24 Jun 2024 23:57:43 +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 6S1GKGcDaU_X for ; Mon, 24 Jun 2024 23:57:42 +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 A38304843F1 for ; Mon, 24 Jun 2024 23:57:42 +0200 (CEST) Received: from falbala.localnet (ip4d1692dd.dynamic.kabel-deutschland.de [77.22.146.221]) by flump.de (Postfix) with ESMTPSA id F0C5D111A8B5; Mon, 24 Jun 2024 23:57:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=flump.de; s=mail; t=1719266262; bh=zKahRGvcIPDN6KZH/mFViS3cV3+7dQY+fqT9Ihgb0gA=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=59HAWW47obnMivleI18bsftA6DFB3+UzDi/tLEtNwGCS6zrbHOpHuWMx5ieJ+91yF 0u44kGNaEf/Vese0IBFydmRnW058Nd0jXjHQJk8Kp/3MROvqXqcvh7Wv4joNWX4kj2 4lA3WLDXahk1uAWWEWJHK898Of/nEzSLWINAL4wo= From: Gerion Entrup To: mailing list for ConTeXt users Date: Mon, 24 Jun 2024 23:57:35 +0200 Message-ID: <8750205.cEBGB3zze1@falbala> In-Reply-To: <84spr3rq-s578-4r1n-1374-10p53ro1s358@hzvpu.rqh> References: <6962468.BEx9A2HvPv@falbala> <84spr3rq-s578-4r1n-1374-10p53ro1s358@hzvpu.rqh> MIME-Version: 1.0 Message-ID-Hash: WADTCGAFPAOMIN5BTBAGCE36JHS5SVFP X-Message-ID-Hash: WADTCGAFPAOMIN5BTBAGCE36JHS5SVFP 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 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 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="===============3100649460643760790==" --===============3100649460643760790== Content-Type: multipart/signed; boundary="nextPart9151104.0VBMTVartN"; micalg="pgp-sha256"; protocol="application/pgp-signature" --nextPart9151104.0VBMTVartN Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8"; protected-headers="v1" From: Gerion Entrup To: mailing list for ConTeXt users Cc: Aditya Mahajan Date: Mon, 24 Jun 2024 23:57:35 +0200 Message-ID: <8750205.cEBGB3zze1@falbala> In-Reply-To: <84spr3rq-s578-4r1n-1374-10p53ro1s358@hzvpu.rqh> MIME-Version: 1.0 Am Montag, 24. Juni 2024, 21:20:19 MESZ schrieb Aditya Mahajan: > On Mon, 24 Jun 2024, Gerion Entrup wrote: >=20 > > Hi, > >=20 > > I was in the process to convert an itemize part to a description and wa= nted 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. >=20 > Not sure what exactly you want, but how about: >=20 > \definehighlight[hl][style=3D{\m{>}\,\switchtobodyfont[tt]}] > % This is the wrong way to define such a command as '>' is not part of th= e style. I have left this definition just for comparison with the soln belo= w. 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 \def{\hl}= {\groupedcommand{>\,\switchtobodyfont[tt]}{}}, but actually I want to defin= e a highlight (just with an additional prefix). > \definedescription[category][ > alternative=3Dtop, > headstyle=3Dbold, > width=3Dbroad, > ] >=20 > \definedescription[desc][ > width=3Dfit, > distance=3D{\widthofstring{~}}, > headcommand=3D{\groupedcommand{>\,}{:}},=20 Hmm, this works, but duplicates the above definition. If I don't want to use > as prefix but =E2=80=BA, I need to replace it in t= wo places. > headstyle=3D\tt, > before=3D{\startpacked}, > after=3D{\stoppacked}, > alternative=3Dhanging, > ] Gerion --nextPart9151104.0VBMTVartN 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/tVN9WpYYHnPZHxloeAdSYJHeoFAmZ5688ACgkQloeAdSYJ HepGeQv/VS45Aunj/QMZwLlQV3exh4QYmojk4mrQxMJGio5rPCltdYroEdUy0o7w jZyFTzmOmk9W4I6xq1fdgZT4NRNvbPrnyyhfXNglaX1Qj05/UaPD1e8fgM3GG3Af e8af8FgGE5GN4FRUdsJiACLFJZh72GdprQ6gj3BqiEoSco+zOtRJIDj/qsukpJJ6 0X1M0jcSsFnInuhMRTqbQvFb9BwUHQ4ogkfrkqfXQXBnhDvLk6munCvcURwyd5zq qg+5lVOwarIkS3wowiuPUNyAhjGiAHyOfb+15ZesJ7upmaZFKwZK43QwD573VZKG W5QNo6rJsWfrPVcJYZw9nNqvqDy5IHbkGKwOpHljkpoIxBoyWav7BDJbEWbBmCYm fY2VWTL+MchMee68BCEYCC3GBTt9noTAWTfRJ7738vZbtMbaj1DBJv/Cp8Ev9VKl bl/MR+FZmC8H1WG3lGumLcW3rDdiL+mmMNPYJQxe1aaHyZAbzR5Ikvfmh47c5y0a vtD3pBhD =pZAl -----END PGP SIGNATURE----- --nextPart9151104.0VBMTVartN-- --===============3100649460643760790== 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 ___________________________________________________________________________________ --===============3100649460643760790==--