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 03472246C4 for ; Mon, 24 Jun 2024 21:21:06 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 0BC3D48462C for ; Mon, 24 Jun 2024 21:20:50 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at cgl.ntg.nl Authentication-Results: cgl.ntg.nl (amavisd-new); dkim=fail (2048-bit key) reason="fail (message has been altered)" header.d=messagingengine.com 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 75cIXSMhXYG7 for ; Mon, 24 Jun 2024 21:20:49 +0200 (CEST) Received: from cgl.ntg.nl (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id A5F8148430D for ; Mon, 24 Jun 2024 21:20:40 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id E698D483EF4 for ; Mon, 24 Jun 2024 21:20:30 +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 JIMW-LD9pHXq for ; Mon, 24 Jun 2024 21:20:30 +0200 (CEST) Received-SPF: Softfail (mailfrom) identity=mailfrom; client-ip=64.147.123.193; helo=wfforwardl2-smtp.messagingengine.com; envelope-from=adityam@umich.edu; receiver= Received: from wfforwardl2-smtp.messagingengine.com (wfforwardl2-smtp.messagingengine.com [64.147.123.193]) (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 1A1B4483EC1 for ; Mon, 24 Jun 2024 21:20:28 +0200 (CEST) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailfforwardl.west.internal (Postfix) with ESMTP id 06A847C0191 for ; Mon, 24 Jun 2024 15:20:25 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Mon, 24 Jun 2024 15:20:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1719256825; x=1719343225; bh=jZ0BLzFOcK+/DSA2iS23fUikJepS 3hfooy2LSUN7DqA=; b=dWhynzW0oTK1vF+4FwYj5A99HNuifQhYeZ6iBy5ecel9 luHU8BB1mdG4KNtwrStMwf2LN8cg0P9Kgmofl4/H7V7460xlrdIaffA2+phlJgXL hdk33SM/gIwWepBJ90nNazOqhwdB5u/lz7Ukju2n//VXO7osx4X2vTspF6Zt1/IM oCQInT6IiCqQ8+VyRTNRMP1LwaUDYw1XJ97tkKWqLbD0uy7RKHbInTZ8l57Hdi3F 6Y0bra+OoWbTCnK/prthpz+i2xlRA4c5siyIff7EYVpcuQecC3y4Qgsz3BesWxzk vaDKRjwOWzZkxqanT9t6RPPElCF5YTw1mnX5tB6m5A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrfeeguddgudefkecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd entegunhfkugdqfgfuqdfftedtleculdeftddtmdenucfjughrpeffhffvufgjkfhfgggt sehttdertddttddvnecuhfhrohhmpeetughithihrgcuofgrhhgrjhgrnhcuoegrughith ihrghmsehumhhitghhrdgvughuqeenucggtffrrghtthgvrhhnpeejfeetudehvedvgffh feegieeiieehtdegvdevveevfedtjedvtddvieelffelhfenucevlhhushhtvghrufhiii gvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrughithihrghmsehumhhitghhrdgv ughu X-ME-Proxy: Feedback-ID: i00d8410d:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Mon, 24 Jun 2024 15:20:24 -0400 (EDT) Date: Mon, 24 Jun 2024 21:20:19 +0200 (CEST) From: Aditya Mahajan X-X-Sender: adityam@carbonpad.cim.mcgill.ca To: mailing list for ConTeXt users In-Reply-To: <6962468.BEx9A2HvPv@falbala> Message-ID: <84spr3rq-s578-4r1n-1374-10p53ro1s358@hzvpu.rqh> References: <6962468.BEx9A2HvPv@falbala> MIME-Version: 1.0 Message-ID-Hash: DTIGD3H4J3NR67PUUF7QLUPC6JNRFJZR X-Message-ID-Hash: DTIGD3H4J3NR67PUUF7QLUPC6JNRFJZR X-MailFrom: adityam@umich.edu 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: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On Mon, 24 Jun 2024, Gerion Entrup wrote: > Hi, > > I was in the process to convert an itemize part to a description and 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={\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. \definedescription[category][ alternative=top, headstyle=bold, width=broad, ] \definedescription[desc][ width=fit, distance={\widthofstring{~}}, headcommand={\groupedcommand{>\,}{:}}, headstyle=\tt, before={\startpacked}, after={\stoppacked}, alternative=hanging, ] \starttext This is a \hl{highlight}. Some listings \startcategory{Itemize} \startitemize[packed] \item \hl{first}: one \item \hl{second}: two \stopitemize \stopcategory Now the same as desc: \startcategory{Desc} \startdesc{first} one \stopdesc \startdesc{second} two \stopdesc \stopcategory \stoptext Aditya ___________________________________________________________________________________ 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 ___________________________________________________________________________________