From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/112826 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Sylvain Hubert via ntg-context Newsgroups: gmane.comp.tex.context Subject: Re: Weird error when using \startformula inside lua Date: Sun, 12 Sep 2021 15:41:58 +0200 Message-ID: References: Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1920743503004599182==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35451"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Sylvain Hubert To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sun Sep 12 15:42:44 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 1mPPkq-00091u-6x for gctc-ntg-context-518@m.gmane-mx.org; Sun, 12 Sep 2021 15:42:44 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id C4ACC28724C; Sun, 12 Sep 2021 15:42:16 +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 vrxEIpQz3ldf; Sun, 12 Sep 2021 15:42:14 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id B4BB228746F; Sun, 12 Sep 2021 15:42:14 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 7D07C28747D for ; Sun, 12 Sep 2021 15:42:12 +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 NVF2eUiKnhul for ; Sun, 12 Sep 2021 15:42:11 +0200 (CEST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.166.170; helo=mail-il1-f170.google.com; envelope-from=champignoom@gmail.com; receiver= Original-Received: from mail-il1-f170.google.com (mail-il1-f170.google.com [209.85.166.170]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id AD02928724C for ; Sun, 12 Sep 2021 15:42:10 +0200 (CEST) Original-Received: by mail-il1-f170.google.com with SMTP id b4so7239266ilr.11 for ; Sun, 12 Sep 2021 06:42:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=cY8zB8rq/gppvt824+rc4Bvin48WT5bTQTR1RYlnF2Y=; b=R6L2FyTftEcDz+kFzrrKzA9GTLfNOp1TTGF5YKXnrNoDcRNf9gUX+xXQ21aQqKDmaE mnIHn1puZCmG+PoSIi6JB4wXcq6QfEmavsY6D0qJzOmx05BD3gCHSydpK0HNCfMl6sXu dhzrk+8rQnN9UzhLmc6etpAXQuFsN7z2kk0kVLrbiXq0tb6kq6ZkXlTfJyxFAhX22Qbf mN9HVe3imasfeuL/lsL38/ZjP3RbtBnFVat8ujG1CJPLFCZT6SN51W3cW/fbF2NRJna7 HxWv3RVgNaVgZWBJtSzUyP8OVCnTHtaqTBixsRKZbH5wLDTdwmCZEPezDqEcaxl3nIpm GCnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=cY8zB8rq/gppvt824+rc4Bvin48WT5bTQTR1RYlnF2Y=; b=0rZ5TtF6Alk8gliSGS6YFmCJX7G8O2nz+xJ+7Ag4O5662DJEYehFU534cyXYtxcmOH yeWV8YEsR6SGb7ubtBA+UkXLvBtiA4VRJ0WnRGjFL1f4bdk6vxIq5OJU+18NgVLaivqj PzeTIUOIKFjzFWvlanXc5B7DouHZQZvVcx/lfQhK1VaFc3MRNHRFh77sfDxTbWnW/0x9 OcAN0xXgIQj7ISXIMnj0UXl5C5z8/BhOFKLYhUHyBbVDPMzdGIFfDbpFmLJkO3nKBfEG gbBIq2NeealO02uYdi3/k/jWixeO+nEhyssozU80rPnDlbrDoHyeDZgb0JTRtyo55DCX h7dg== X-Gm-Message-State: AOAM5316m9QM98l6XTWSwwalU0/8aRm/TWYKYzfq0RqEJn1IsYoo389P /ixz2fhj6jXijL5gZfWQNZBiRet5DlGsuWJXPjilJFH+cAk= X-Google-Smtp-Source: ABdhPJx9zVSr/tL7MpGMLs1SVxDxldMIjLcvHaQduoSuvtzax4+XPIP/al6ME6tU5swl8TlVrHjSYmXMtltHcs59LJw= X-Received: by 2002:a92:c64a:: with SMTP id 10mr4173326ill.102.1631454129114; Sun, 12 Sep 2021 06:42:09 -0700 (PDT) In-Reply-To: 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:112826 Archived-At: --===============1920743503004599182== Content-Type: multipart/alternative; boundary="000000000000d551ed05cbcc83b1" --000000000000d551ed05cbcc83b1 Content-Type: text/plain; charset="UTF-8" The problem also concerns \starttyping: \starttext . \startluacode context([[ \starttyping \stoptyping ]]) \stopluacode \stoptext tex error > runaway error: end of file encountered mtx-context | fatal error: return code: 256 %%%%%%%%% \starttext . \startluacode context([[ \starttyping foobar \stoptyping ]]) \stopluacode \stoptext tex error > tex error on line 5 in file ./test.tex: lua error: registered function call [1041]: ...mtx/tex/texmf-context/tex/context/base/mkxl/buff-ini.lmt:534: invalid value (nil) at index 3 in table for ' concat' stack traceback: [C]: in function 'table.concat' ...mtx/tex/texmf-context/tex/context/base/mkxl/buff-ini.lmt:534: in upvalue 'pickup' ...mtx/tex/texmf-context/tex/context/base/mkxl/buff-ini.lmt:677: in function <...mtx/tex/texmf-context/tex/context/base/mkxl/buff-ini.lmt:668> (...tail calls...) Sylvain On Sat, 11 Sept 2021 at 05:12, Aditya Mahajan via ntg-context < ntg-context@ntg.nl> wrote: > I sometimes define lua functions for showing out worked out calculations. > The following minimal example shows that > > context([[\startformula ... \stopformula]]) > > fails in LMTX with an error message: > > tex error > tex error on line 3 in file ./test.tex: Undefined > control sequence \undefined > > MWE: > > \startluacode > thirddata = thirddata or {} > > local comment = [[ > This is a famous formula > \startformula > a^2 + b^2 = c^2 > \stopformula > ]] > > function thirddata.explanation() > context(comment) > end > > \stopluacode > > \starttext > \ctxlua{thirddata.explanation()} > \stoptext > > The actual use case is more complicated (where I use templates, so I don't > want to convert everything to context.startformula() etc.). The example > compiles with MkIV but not LMTX. > > Any idea what is going on? > > Thanks, > Aditya > > > ___________________________________________________________________________________ > If your question is of interest to others as well, please add an entry to > the Wiki! > > maillist : ntg-context@ntg.nl / > http://www.ntg.nl/mailman/listinfo/ntg-context > webpage : http://www.pragma-ade.nl / http://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : http://contextgarden.net > > ___________________________________________________________________________________ > --000000000000d551ed05cbcc83b1 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
The problem also concerns \starttyping:

\starttext
.
\startluacode
context([[
\starttyping
\stoptyp= ing
]])
\stopluacode
\stoptext

tex er= ror =C2=A0 =C2=A0 =C2=A0 > runaway error: end of file encountered
mtx= -context =C2=A0 =C2=A0 | fatal error: return code: 256

%%%%%%%%%

\starttext
.
\startluacod= e
context([[
\starttyping

foobar
\stoptyping
]])
\sto= pluacode
\stoptext

tex error =C2=A0 =C2=A0 = =C2=A0 > tex error on line 5 in file ./test.tex:

lua error:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 registered function call [1041]: ...mtx/tex/t= exmf-context/tex/context/base/mkxl/buff-ini.lmt:534: invalid value (nil) at= index 3 in table for '
concat'
stack traceback:
=C2=A0 = =C2=A0 =C2=A0 =C2=A0 [C]: in function 'table.concat'
=C2=A0 =C2= =A0 =C2=A0 =C2=A0 ...mtx/tex/texmf-context/tex/context/base/mkxl/buff-ini.l= mt:534: in upvalue 'pickup'
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ...mtx/t= ex/texmf-context/tex/context/base/mkxl/buff-ini.lmt:677: in function <..= .mtx/tex/texmf-context/tex/context/base/mkxl/buff-ini.lmt:668>
=C2=A0= =C2=A0 =C2=A0 =C2=A0 (...tail calls...)


<= /div>
Sylvain

On Sat, 11 Sept 2021 at 05:12, Aditya Mahajan via nt= g-context <ntg-context@ntg.nl&= gt; wrote:
I som= etimes define lua functions for showing out worked out calculations. The fo= llowing minimal example shows that

=C2=A0 context([[\startformula ... \stopformula]])

fails in LMTX with an error message:

tex error=C2=A0 =C2=A0 =C2=A0 =C2=A0> tex error on line 3 in file ./test= .tex: Undefined control sequence \undefined

MWE:

\startluacode
=C2=A0 thirddata =3D thirddata or {}

=C2=A0 local comment =3D [[
=C2=A0 =C2=A0 This is a famous formula
=C2=A0 =C2=A0 \startformula
=C2=A0 =C2=A0 =C2=A0 a^2 + b^2 =3D c^2
=C2=A0 =C2=A0 \stopformula
=C2=A0 ]]

=C2=A0 function thirddata.explanation()
=C2=A0 =C2=A0 =C2=A0 context(comment)
=C2=A0 end

\stopluacode

\starttext
\ctxlua{thirddata.explanation()}
\stoptext

The actual use case is more complicated (where I use templates, so I don= 9;t want to convert everything to context.startformula() etc.). The example= compiles with MkIV but not LMTX.

Any idea what is going on?

Thanks,
Aditya

___________________________________________________________________________= ________
If your question is of interest to others as well, please add an entry to t= he Wiki!

maillist : ntg-cont= ext@ntg.nl / http://www.ntg.nl/mailman/listinfo/nt= g-context
webpage=C2=A0 : http://www.pragma-ade.nl / http://context.aanhet.net=
archive=C2=A0 : https://bitbucket.org/phg/context-m= irror/commits/
wiki=C2=A0 =C2=A0 =C2=A0: http://contextgarden.net
___________________________________________________________________________= ________
--000000000000d551ed05cbcc83b1-- --===============1920743503004599182== 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== --===============1920743503004599182==--