From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/110918 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Aditya Mahajan Newsgroups: gmane.comp.tex.context Subject: Re: Typing within doifmode leads to error Date: Sat, 20 Mar 2021 16:23:57 -0400 (EDT) Message-ID: References: <41b732e4-b771-15a2-7fc1-5ead8086f4f9@xs4all.nl> <1628b6da-77e8-7935-9847-859317bec564@xs4all.nl> <9f6c1bc1-8aa6-7f69-6586-e8edab181097@xs4all.nl> Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="8323329-78571674-1616271837=:819312" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30295"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Alpine 2.23 (LNX 453 2020-06-18) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sat Mar 20 21:24:40 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 1lNi9H-0007lE-CL for gctc-ntg-context-518@m.gmane-mx.org; Sat, 20 Mar 2021 21:24:39 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id E8FF2281B41; Sat, 20 Mar 2021 21:24:03 +0100 (CET) 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 OmC-LqxKy81v; Sat, 20 Mar 2021 21:24:03 +0100 (CET) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 07990281B42; Sat, 20 Mar 2021 21:24:03 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 240CE281B41 for ; Sat, 20 Mar 2021 21:24:02 +0100 (CET) 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 byTXYVh56ml4 for ; Sat, 20 Mar 2021 21:24:01 +0100 (CET) Received-SPF: Softfail (mailfrom) identity=mailfrom; client-ip=132.206.73.2; helo=orford.cim.mcgill.ca; envelope-from=adityam@umich.edu; receiver= Original-Received: from orford.cim.mcgill.ca (smtp.cim.mcgill.ca [132.206.73.2]) (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 6E513281B3A for ; Sat, 20 Mar 2021 21:24:00 +0100 (CET) Original-Received: from adi-thinkpad (198-48-192-62.cpe.teksavvy.com [198.48.192.62]) (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) (Authenticated sender: adityam) by orford.cim.mcgill.ca (Postfix) with ESMTPSA id 44ABA69FFA5 for ; Sat, 20 Mar 2021 16:23:58 -0400 (EDT) In-Reply-To: <9f6c1bc1-8aa6-7f69-6586-e8edab181097@xs4all.nl> 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:110918 Archived-At: This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-78571674-1616271837=:819312 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE On Sat, 20 Mar 2021, Hans Hagen wrote: > On 3/20/2021 4:00 PM, Christoph Reller wrote: > > On Sat, Mar 20, 2021 at 12:12 PM Hans Hagen > > wrote: > >=20 > > On 3/20/2021 8:24 AM, Aditya Mahajan wrote: > > > On Sat, 20 Mar 2021, Christoph Reller wrote: > > >> Of course we can do this in lua: > > >> > > >> if tex.modes["A"] and not tex.modes{"B"] then > > >> ... > > >> end > > > > > > ... which means that you can use that at the context end as well > > (old feature). > > > Save the following as test.mkix (or add "% macros=3Dmkix" as the > > first line): > > > > > > ``` > > > \starttext > > > > > > \starttyping > > > A and not B > > > \stoptyping > > > > > > \starttyping > > > not (A and not B) > > > \stoptyping > > > > > > \stoptext > > a neat application! > >=20 > >=20 > > Thank you for this hint, Aditya. This would be a very nice solution=20 > > indeed. But it does not seem to work: > >=20 > > % macros=3Dmkix > > \definemode[A][yes] > > \starttext > > \startluacode > > =C2=A0 if tex.modes['A'] then > > =C2=A0 =C2=A0 context("A") > > =C2=A0 end > > \stopluacode > > > > A > > > > \stoptext > >=20 > > With ConTeXt LMTX=C2=A02021.03.17 the output of the above is a single "= A". I=20 > > would expect two.=C2=A0What am I doing wrong? >=20 > When the file gets preprocessed the mode is not known >=20 > context --mode=3DA foo.tex >=20 > it does of course also work when you set the mode in a parent file and=20 > then include foo.tex I wonder if we could have an environment, say \startluatemplate ... \stoplu= atemplate, which is evaluated on the fly rather than when loading a file.= =20 Aditya --8323329-78571674-1616271837=:819312 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== --8323329-78571674-1616271837=:819312--