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,T_SCC_BODY_TEXT_LINE 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 0E10E29B99 for ; Mon, 3 Jun 2024 13:39:36 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 7BCD3484EE5 for ; Mon, 3 Jun 2024 13:38:23 +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 VSDiXR16bfo6 for ; Mon, 3 Jun 2024 13:38:22 +0200 (CEST) Received: from cgl.ntg.nl (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id E6F89484EEF for ; Mon, 3 Jun 2024 13:37:24 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 451CE484D96 for ; Mon, 3 Jun 2024 13:36:54 +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 HksOnVPGfw6T for ; Mon, 3 Jun 2024 13:36:53 +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 DB948484D95 for ; Mon, 3 Jun 2024 13:36:53 +0200 (CEST) Received: from falbala.localnet (unknown [130.75.33.21]) by flump.de (Postfix) with ESMTPSA id E2FB4F7B122; Mon, 3 Jun 2024 13:36:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=flump.de; s=mail; t=1717414611; bh=zGjTT6JepU/HWH07RCbPbG2oRuK7y6cO5S50JtNWdHI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=IYNAOBRJOa5VE4qBqsYHhgsQ5H2UND9m76ZZgZnhU5PucpiknCQFN4hsQUWmgcJtJ Xf1UxV/CEGTMmnB70iLviZyWJamRxgkCckodcy36GCXkTVuhxSKm9dRtkWwZ42Dnni smPg+emSYjp6a605yWFGSZju6KB1qPAG9HzgFeOs= From: Gerion Entrup To: Wolfgang Schuster Date: Mon, 03 Jun 2024 13:36:48 +0200 Message-ID: <3062501.q0ZmV6gNhb@falbala> In-Reply-To: References: <4119708.MHq7AAxBmi@falbala> <2603727.72vocr9iq0@falbala> MIME-Version: 1.0 Message-ID-Hash: WKWVYL764ZUG6UJD55CSX7SPSHGMO2TA X-Message-ID-Hash: WKWVYL764ZUG6UJD55CSX7SPSHGMO2TA 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: setuphead in connection with the command argument 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="===============4677962519247156149==" --===============4677962519247156149== Content-Type: multipart/signed; boundary="nextPart2723251.n0HT0TaD9V"; micalg="pgp-sha256"; protocol="application/pgp-signature" --nextPart2723251.n0HT0TaD9V Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="utf-8"; protected-headers="v1" From: Gerion Entrup To: Wolfgang Schuster Cc: mailing list for ConTeXt users Date: Mon, 03 Jun 2024 13:36:48 +0200 Message-ID: <3062501.q0ZmV6gNhb@falbala> In-Reply-To: MIME-Version: 1.0 Am Montag, 3. Juni 2024, 00:05:22 MESZ schrieb Wolfgang Schuster: > Gerion Entrup schrieb am 01.06.2024 um 16:34: > > Am Samstag, 1. Juni 2024, 09:53:46 MESZ schrieb Wolfgang Schuster: > >> Gerion Entrup schrieb am 31.05.2024 um 00:37: > >>> What, if I define multiple of them? Is the system not made for this? > >> > >> Multiple of what? > > > > When I define `alternative=` _and_ `command=` in the same `\setuphead`. > > Or `alternative=` and `style=`, or `alternative=` and `command=`. > > > > I guess style is applied just to the arguments/macros of the command/the alternative? > > And combining alternative and command never make sense. > > The following descriptions applies to most setup commands when exclude > special cases like \setupbodyfont or \setuplayout. > > > When you make multiple changes to the values of a command with > > \setuphead [section] [style=bold] > > and > > \setuphead [section] [color=blue] > > you achieve the same result as setting both values at the same time like > > \setuphead [section] [style=bold,color=blue] > > > What you're doing here is just passing some value to a parameter, > nothing else happens at this time. When you process a document Context > has already passed the value "normal" to the "alternative" parameter in > the \setuphead command. When you now pass a custom macro the "command" > parameter in \setuphead all you have done is to set a value, nothing > else happened at this point. > > > The evaluation of the parameter happens when Context places the content > of a heading with \startchapter etc. in your document and only at this > point it has to make a decision what should happen when both "command" > and "alternative" are set. The order in which the parameters are used is > the following: a) check if the "command" parameter has a value and if > this is true is it and ignore the "alternative" value b) if no value is > present for the "command" parameter use the value of "alternative". > > > The value of the "style" parameter is unrelated of the > command/alternative values because it isn't needed to choose a layout > for the heading, all the parameter does is to change the font/style > which is independent of the layout. > Thank you. I think that I understand command vs alternative now. With try and error, I experienced, that the font/style of the `style` parameter interleave in a strange way. Therefore I see it as related. What i mean is: Example 1 ``` \define[2]\MyChapter{% \bold This is bold #1 #2 } \setuphead[title, chapter][command=\MyChapter, style=\italic] \starttext \startchapter[title=foo] \stopchapter \stoptext ``` "This is bold" is bold, but "1" and "foo" are italic. The font size is normal. It seems, that "style" is just applied to "#1" and "#2" _before_ evaluating MyChapter. Example 2 ``` \define[2]\MyChapter{% \bold This is bold #1 #2 } % this should be the "default" style \setuphead[title, chapter][command=\MyChapter, style=\tfc] \starttext \startchapter[title=foo] \stopchapter \stoptext ``` "This is bold" is bold, "1" and "2" are normal, but the whole font size is bigger. It seems, that "style" is applied partially to the whole text and somehow special to "#1" and "#2" (Why are these arguments not bold?) As of your explanations, I currently think of the following logic for typesetting (in pseudocode): ``` function typeset_chapter(style, numberstyle, textstyle, command, alternative, chapter_number, chapter_title) { local formatted_chapter_number = apply_style(numberstyle, apply_style(style, chapter_number)) local formatted_chapter_title = apply_style(textstyle, apply_style(style, chapter_title)) if (alternative != "normal") set_TeX_macro("\headnumbercontent", formatted_chapter_number) set_TeX_macro("\headtextcontent", formatted_chapter_title) typeset_as_TeX(get_TeX_code(alternative)) else evaluate_TeX_function(command, #1=formatted_chapter_number, #2=formatted_chapter_title) endif } ``` But this does not fit to example 2. Best Gerion --nextPart2723251.n0HT0TaD9V 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/tVN9WpYYHnPZHxloeAdSYJHeoFAmZdqtAACgkQloeAdSYJ Heqm9gwA0pTnM+lHoaK+nKhvS88mc9JG98Wzz5gSMlW7+qSlyQ/nuYdzGife7/Dn UvBZEsod3Bv2YI2EBz6TPSau94BzmVTW1WnJq+XqFwIRWLTcpvzhUWuWmuC2wrF9 QyLqCOigk/Zixdo69wbQd7x6yCNBudiBL6cpZyDbgMQ1Oow81jxT6LBrxgZIvMgT zTBPAO8gN7Jd+GmNZ7WIrmsEkvYfX+youJsVMdTepAYKUHAurEaFO7oOU4uQdCPL c4ADrf+3BUYaxbnZDdLBYlctEsUvsd6tEKY/YpflMKFVX8YrLXtzFVuygKy/XURH c0KypKuv+tu1OOdX0/w2F5B3odpryhBWVbU+SSei2c/iCmgBXn2GSVl93IsM/yv1 40ZJ7xtbN6BcAqUxHbnAb3xMQYzMaiRKlVpRs69WUmqr010ES0zXGPSvH0oJffHU QJrAkg4z/uE4Fnz8Mj5pO6Y8IyKppczRgEi0xhZZo0MCp+z4Zk8nHKiOkWdr4Lvq DKxK9/Q3 =oMUq -----END PGP SIGNATURE----- --nextPart2723251.n0HT0TaD9V-- --===============4677962519247156149== 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 ___________________________________________________________________________________ --===============4677962519247156149==--