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,MAILING_LIST_MULTI,URIBL_SBL_A autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 26907 invoked from network); 14 Sep 2023 07:57:45 -0000 Received: from cgl.ntg.nl (5.39.185.202) by inbox.vuxu.org with ESMTPUTF8; 14 Sep 2023 07:57:45 -0000 Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id A216B483025 for ; Thu, 14 Sep 2023 09:56:36 +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 LFBBwHOelxBT for ; Thu, 14 Sep 2023 09:56:36 +0200 (CEST) Received: from cgl.ntg.nl (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 3E96748302B for ; Thu, 14 Sep 2023 09:56:11 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id A78BC482C47 for ; Thu, 14 Sep 2023 09:55:52 +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 0YWIyQVEE6Vi for ; Thu, 14 Sep 2023 09:55:52 +0200 (CEST) Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (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 4D4BE482C43 for ; Thu, 14 Sep 2023 09:55:52 +0200 (CEST) Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-401ec23be82so6837235e9.0 for ; Thu, 14 Sep 2023 00:55:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694678152; x=1695282952; darn=ntg.nl; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:cc:to:subject:from:to:cc :subject:date:message-id:reply-to; bh=3vebby82HFwaVVy8S24PLULs4vEJzxjF83IFFMBdRPA=; b=ak+0b+Luk2AjMmSEuH4PRpsmE2lZPLQ0Leq+JBIQs+LpYbuj3C90Nit4dBkRQvkPl4 UHcbGt2M2oJfQAqL+sOS3IhM2mXlcoCL6/9AfEYHpEzr31psBeBWhj5Ybfhu//UmaS2r VRpNWC8R6tAL9S8S9OlDHiT512/thNQksE8zk1+kxZD2wZtcOqQUZCLy1MyPG0iIB1xn cYGzKSCph4fD4yKttftCqdKWH+b++SBJJtif3buk2NQi+xs2lnj3wy3ABQ0pIs4B8BNW WkDjs2gadvDEzDaGGyNQ8mXwfvXPjLB21xYEyPIDYOAa+r3psxikA+T3Mvzp0MFeNNLb b1MQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694678152; x=1695282952; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:cc:to:subject :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=3vebby82HFwaVVy8S24PLULs4vEJzxjF83IFFMBdRPA=; b=VmfMPuqkfkZFKVXSK/fGRxzAF4xWb05OySM69os7IXuBz/wjT8i/1ebA4VetBtbuPB 5scnWjRH49arZMV6bvpXp308IH4LtVpQ4cCP+tHHyU8hwDEpMYPf16bE4lIsPxsxwnPC 6XEgEzQ16+uKKbrqAuzy63TwKURkhuCr6b6hkyt7VGU0ryL1C/SToQwEjVHixE4Z9bh2 T3ffEApqr3fPxB7aZW3FeDGCoau3/CWT4U96S3ZEumOXvAJIxq9L3R/hWBAwL3DsueFv Yb532+j8fP2bH2pnhl3SgEyeQngUPuiG/9DtsEoBA/u19X5OQhQrOmjA1M+jQ5As1kz6 hNMg== X-Gm-Message-State: AOJu0YxodvBVa+8GbuVj1UT+3yY32/QyzID3eNX2+7Mdq4IyF8ieI6sL 93kU+v1mf5DLKWwow/OMuhWFSQ3068EswQ== X-Google-Smtp-Source: AGHT+IG2z+4un8PuGrfunWqkRfc9KRpqufeC7UDyd2fq5fsNzcE1L3DWg2WNMZTpGSpv5Wu27rBkrA== X-Received: by 2002:a05:600c:3d95:b0:404:7462:1f6f with SMTP id bi21-20020a05600c3d9500b0040474621f6fmr241613wmb.8.1694678151481; Thu, 14 Sep 2023 00:55:51 -0700 (PDT) Received: from [192.168.1.103] (85-160-35-196.reb.o2.cz. [85.160.35.196]) by smtp.gmail.com with ESMTPSA id f2-20020a7bc8c2000000b003fed70fb09dsm1225855wml.26.2023.09.14.00.55.50 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Sep 2023 00:55:51 -0700 (PDT) To: denis.maier@unibe.ch References: <005bc695-fac3-18d0-f903-81f7720506d7@gmail.com> <76b371c6-6560-e2ff-80c3-d2d29ef3915f@gmail.com> From: Wolfgang Schuster Message-ID: <79492d15-0b98-ce1b-a032-b1b0fc54c664@gmail.com> Date: Thu, 14 Sep 2023 09:55:49 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 PostboxApp/7.0.60 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US Message-ID-Hash: HT2VSC7LAAUE62RSX5KUJFMCA6QXBC67 X-Message-ID-Hash: HT2VSC7LAAUE62RSX5KUJFMCA6QXBC67 X-MailFrom: wolfgang.schuster.lists@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 CC: ntg-context@ntg.nl X-Mailman-Version: 3.3.8 Precedence: list Reply-To: mailing list for ConTeXt users Subject: [NTG-context] Re: Using structureuservariables before the heading 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="windows-1252"; format="flowed" Content-Transfer-Encoding: quoted-printable denis.maier@unibe.ch schrieb am 12.09.2023 um 23:32: > You need a box to get the author on a separate line. >=20 > % \define[2]\ChapterCommand > %=A0=A0 {\vbox > %=A0=A0=A0=A0=A0 {\structureuservariable{author} > %=A0=A0=A0=A0=A0 \blank > %=A0=A0=A0=A0=A0 #1\space#2}} >=20 > \starttexdefinition protected ChapterCommand #1#2 > =A0 \vbox\bgroup > =A0=A0=A0 \structureuservariable{author} > =A0=A0=A0 \blank > =A0=A0=A0 #1\space#2 > =A0 \egroup > \stoptexdefinition >=20 > Thank you so much, Wolfgang! >=20 > Why do you need protected here? I=92ve realized that \protected\def also = > helps a bit, but, of course, paragraph breaks are ignored there as well=85 You probably haven't noticed it yet but unlike the other predefined=20 layouts for sections you don't have to write "alternative=3Dcommand" to=20 use the layout which is passed to the command key. To make this work ConTeXt has to check whether the argument of the=20 command key is empty or not but this is problematic when you pass=20 commands with arguments. When you try to example below you can see that the first definition of=20 \Mycommand fails because \edef\CheckMycommand tries to expand its=20 argument which causes problems because \Mycommand tries to read the=20 following argument. To solve this problem you can use the \protected=20 modifier when you create \Mycommand. \starttext \def\Mycommand#1{#1}% fails %\protected\def\Mycommand#1{#1}% works \edef\CheckMycommand{\Mycommand} \ifempty\CheckMycommand \tex{Mycommand} is empty \else \tex{Mycommand} has content \fi \stoptext > If just found the following in the lowlevel-macros manual: >=20 > =ABTraditional TEX has three prefixes that can be used with macros:=20 > \global, \outer and \long. The last two are no-op's in LuaMetaTEX and if = > you want to know what they do (did) you can look it up in the TEXbook.=BB >=20 > So, \long is gone, but why is that? Is there a new mechanism that serves = > the same purpose? Other than using a vbox, I mean=85 The purpose of the \long modifier is to specify whether the argument of=20 a command can or cannot contain multiple paragraph (either by an empty=20 line or with \par). This was needed by TeX in the early days where=20 memory was limited but not on the current machines. For a very long time ConTeXt made each command definition long by=20 default (i.e. \def\...{...} behaved the same way as \long\def\...{...})=20 and as a result \long was dropped. \def\CommandA#1{#1} \long\def\CommandB#1{#1} \starttext \CommandA{xxx}% works \CommandA{xxx yyy}% fails because you have a empty line in the argument \CommandA{xxx\par yyy}%fails because you have \par in the argument \CommandB{xxx\par yyy}% works because \CommandB is \long \stoptext Wolfgang ___________________________________________________________________________= ________ If your question is of interest to others as well, please add an entry to t= he Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-con= text webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___________________________________________________________________________= ________