From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/111714 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Rik Kabel Newsgroups: gmane.comp.tex.context Subject: Re: LMTX problem with doifmode in \setuplayout Date: Tue, 8 Jun 2021 17:01:22 -0400 Message-ID: References: <15b30ada-da1b-5d3b-13bd-86948a380054@gmail.com> Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5110219684115351461==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36057"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0 Thunderbird/78.11.0 To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Tue Jun 08 23:01:57 2021 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane-mx.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lqirE-0009DT-NN for gctc-ntg-context-518@m.gmane-mx.org; Tue, 08 Jun 2021 23:01:56 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 23F712843CF; Tue, 8 Jun 2021 23:01:33 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MyFtfZNq0Bqk; Tue, 8 Jun 2021 23:01:28 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 4FB992843B7; Tue, 8 Jun 2021 23:01:28 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id AC28A2843AB for ; Tue, 8 Jun 2021 23:01:26 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JrL83sHUevwV for ; Tue, 8 Jun 2021 23:01:25 +0200 (CEST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=166.84.1.89; helo=mailbackend.panix.com; envelope-from=context@rik.users.panix.com; receiver= Original-Received: from mailbackend.panix.com (mailbackend.panix.com [166.84.1.89]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id CA51E2843A7 for ; Tue, 8 Jun 2021 23:01:24 +0200 (CEST) Original-Received: from [192.168.1.106] (cpe-69-204-137-117.nycap.res.rr.com [69.204.137.117]) by mailbackend.panix.com (Postfix) with ESMTPSA id 4G02hy74SZz3qQj for ; Tue, 8 Jun 2021 17:01:22 -0400 (EDT) In-Reply-To: <15b30ada-da1b-5d3b-13bd-86948a380054@gmail.com> Content-Language: en-US X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.26 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.io gmane.comp.tex.context:111714 Archived-At: This is a multi-part message in MIME format. --===============5110219684115351461== Content-Type: multipart/alternative; boundary="------------3BE68720416DB94158CDA7E8" Content-Language: en-US This is a multi-part message in MIME format. --------------3BE68720416DB94158CDA7E8 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit On 6/8/2021 16:11, Wolfgang Schuster wrote: > Rik Kabel schrieb am 08.06.2021 um 18:14: >> >> Hello all, >> >> Odd issue with LMTX (works fine with --luatex). \doifelsemode causes >> a failure if it is used to set a simple value such as on, off, yes, >> no, ..., but works with a dimension. Perhaps better illustrated by an >> example: >> >> \definemode        [aaa] >>                    [keep] >> \setuplayout       [ >>                     marking=\doifmodeelse{aaa}{off}{on}, >> %                   marking=on, >>                     grid=\doifmodeelse{aaa}{yes}{no}, >> %                   grid=yes, >>                     bottom=\doifmodeelse{aaa}{10mm}{20mm}, >>                    ] >> \starttext >>    This is only a test. >> \stoptext >> >> The problem occurs whether or not the mode is enabled. In the >> example, it fails with the mode test in the either the marking= or >> grid= keys, but has no problem with it in the bottom= key. >> >> The error message says: >> >> The control sequence marked should not appear >> between \csname and \endcsname. >> >> pointing to the enabled \doifmodeelse line. >> >> The same issue occurs with the following, using \doifmode: >> >> \definemode        [aaa] >>                    [keep] >> \setuplayout       [ >>                     marking=on, >>                     marking=\doifmode{aaa}{off}, >>                    ] >> \starttext >>    This is only a test. >> \stoptext >> >> This did work without complaint a few months ago. >> > > You can never be sure if these combinations (\doifXXX within > \setupXXX) work without problems. The only reliable method in this > case is: > > % default setup > > \setuplayout >     [marking=on] > > % mode dependent setup > > \startmode[aaa] > >     \setuplayout >         [marking=off] > > \stopmode > > > Wolfgang > Yes, that works. Of course, to say that you can never be sure if such combinations will work is not a welcome statement about the state of ConTeXt. More recent LMTX releases also now break older documents that worked (with LMTX and MkIV) before. If there is an error in what was previously written that is only noticed because of tighter enforcement, that is one thing, but an undocumented change to supported behaviour is less to be desired. And that it works with dimensions but not on/off/yes/no is very strange and suggests some other problem may be lurking. -- Rik --------------3BE68720416DB94158CDA7E8 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit


On 6/8/2021 16:11, Wolfgang Schuster wrote:
Rik Kabel schrieb am 08.06.2021 um 18:14:

Hello all,

Odd issue with LMTX (works fine with --luatex). \doifelsemode causes a failure if it is used to set a simple value such as on, off, yes, no, ..., but works with a dimension. Perhaps better illustrated by an example:

\definemode        [aaa]
                   [keep]
\setuplayout       [
                    marking=\doifmodeelse{aaa}{off}{on},
%                   marking=on,
                    grid=\doifmodeelse{aaa}{yes}{no},
%                   grid=yes,
                    bottom=\doifmodeelse{aaa}{10mm}{20mm},
                   ]
\starttext
   This is only a test.
\stoptext

The problem occurs whether or not the mode is enabled. In the example, it fails with the mode test in the either the marking= or grid= keys, but has no problem with it in the bottom= key.

The error message says:

The control sequence marked <to be read again> should not appear between \csname and \endcsname.

pointing to the enabled \doifmodeelse line.

The same issue occurs with the following, using \doifmode:

\definemode        [aaa]
                   [keep]
\setuplayout       [
                    marking=on,
                    marking=\doifmode{aaa}{off},
                   ]
\starttext
   This is only a test.
\stoptext

This did work without complaint a few months ago.


You can never be sure if these combinations (\doifXXX within \setupXXX) work without problems. The only reliable method in this case is:

% default setup

\setuplayout
    [marking=on]

% mode dependent setup

\startmode[aaa]

    \setuplayout
        [marking=off]

\stopmode


Wolfgang

Yes, that works. Of course, to say that you can never be sure if such combinations will work is not a welcome statement about the state of ConTeXt.

More recent LMTX releases also now break older documents that worked (with LMTX and MkIV) before. If there is an error in what was previously written that is only noticed because of tighter enforcement, that is one thing, but an undocumented change to supported behaviour is less to be desired. And that it works with dimensions but not on/off/yes/no is very strange and suggests some other problem may be lurking.

--
Rik

--------------3BE68720416DB94158CDA7E8-- --===============5110219684115351461== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCg== --===============5110219684115351461==--