From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/114785 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eduardo Bohoyo via ntg-context Newsgroups: gmane.comp.tex.context Subject: Re: lua-widow-control module error in LMTX Date: Tue, 26 Apr 2022 02:51:19 +0200 Message-ID: References: <3456f6af-1770-d46e-899d-bcefddda5689@telus.net> Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3323523206696416609==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27892"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eduardo Bohoyo To: Max Chernoff , ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Tue Apr 26 02:52:00 2022 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 1nj9Qu-0006sV-AN for gctc-ntg-context-518@m.gmane-mx.org; Tue, 26 Apr 2022 02:52:00 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 89ADB2A377E; Tue, 26 Apr 2022 02:51:28 +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 ERZWmaUDdp7M; Tue, 26 Apr 2022 02:51:26 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id DE4252A3750; Tue, 26 Apr 2022 02:51:25 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 0E6BF2A374C for ; Tue, 26 Apr 2022 02:51:25 +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 lMeRbqFDlAlB for ; Tue, 26 Apr 2022 02:51:23 +0200 (CEST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=178.21.23.139; helo=knopi.disroot.org; envelope-from=ebohoyod@disroot.org; receiver= Original-Received: from knopi.disroot.org (knopi.disroot.org [178.21.23.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 2B9DE2A373C for ; Tue, 26 Apr 2022 02:51:22 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id A670B42B09; Tue, 26 Apr 2022 02:51:22 +0200 (CEST) X-Virus-Scanned: SPAM Filter at disroot.org Original-Received: from knopi.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jint4Yg4o8Zx; Tue, 26 Apr 2022 02:51:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1650934280; bh=rQcnp7zQtvEkZKlUrClGVN61qU2Iev1SrSNVItLrDZc=; h=Date:Subject:To:References:From:In-Reply-To; b=TEaOyOyNeeb1DzxITu3AT/2DawNVmWge5LI9e5eoGdah9nQHkXrJrYvGFuNXNmAwB lMMI7L1Wod2vR6Yco/qvPJEdby6m5NqY9bKHauyWsyHmIA6b0itLMZWpFQM2lV1v1c W0JmjU8h+EOq0zryONntLr5ebjID/go/2VQEznefeA1d1fbcK6rizw+rtc3kNO2cMH RG6OwODC74Wxh0HsQreR6cQeGLR5fg4zT3SmtKe5biwLmPdbOTsefWsyiVzk441Htz 8sqvFuE7+E+zbCfqBOZCa7KBGVH7xYB3P3XzZPPMlY7hDlLI18ma59f1vAnH01ASRG 8dsRoILJWMC3Q== Content-Language: es-ES In-Reply-To: <3456f6af-1770-d46e-899d-bcefddda5689@telus.net> 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:114785 Archived-At: This is a multi-part message in MIME format. --===============3323523206696416609== Content-Type: multipart/alternative; boundary="------------7WWzMBRS34V11vKTngRjkSTn" Content-Language: es-ES This is a multi-part message in MIME format. --------------7WWzMBRS34V11vKTngRjkSTn Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hi, Max: First things first.  I want to acknowledge and thank you for the tough mission that surely involves maintaining this module for the benefit of the TeX community and, most especially, for LMTX in particular, due to the very reasons you have just explained. Regarding your remarks, you are right in your assumptions: I didn't have the required lua file installed in its corresponding folder. That's what I was missing, and, logically, what made my compilation crash. To make my confusion even worse, I had done a strict search inside the mkxl code. It wouldn't take me to line 63 because I had added the extension (lua-widow-control.lua, not just lua-widow-control). Anyway, a mess only due to my ignorance. Now I finally get the pdf. But unfortunately, this "new" pdf is the same with the module uncommented as when I had it commented. There is no difference at all. And you're right: even context --make doesn't solve the problem. To give you an idea, although my dummy document has 78 pages, only 55 can really be said to be dummy text that can benefit from the module. Well, only in those 55 pages I have 2 orphans, 5 widows and 6 broken hyphens. I have read several times all the options of the module in the /lua-widow-control.pdf/ document, but I don't even dare to mess with those options because it seems to me very radical that my output pdf is the same with the module uncommented in my code. Of course, mtxrun --find-file lua-widow-control.lua yields what you would expect: /opt/luametatex/texmf-modules/tex/luatex/lua-widow-control/lua-widow-control.lua Thanks again for your work and yours observations. Edu. El 25/4/22 a las 22:00, Max Chernoff escribió: > (Please keep me CC'd as I'm not subscribed to the list) > > Hi, I'm the lua-widow-control author. > > > lua error > lua error on line 74 in file > > > /opt/luametatex/texmf-modules/tex/context/third/lua-widow-control/t-lua-widow-control.mkxl > > > > The odd thing is that line 75 of the t-lua-widow-control file is empty. > > The \setuplwc command ends on line 74, which then triggers > \everysetuplwc which then calls \ctxlua{lwc.enable_callbacks()}. This > fails since lwc is undefined because the Lua file isn't loaded because > ConTeXt can't seem to find the file. > > In Plain LuaTeX and LuaLaTeX, a missing Lua file is a fatal error: > >     $ luatex "\nonstopmode\directlua{require 'not-a-real-file'}\bye" > >     This is LuaTeX, Version 1.13.2 (TeX Live 2021/W32TeX) >      restricted system commands enabled. > >     [\directlua]:1: module 'not-a-real-file' not found: >             no field package.preload['not-a-real-file'] >             [kpse lua searcher] file not found: 'not-a-real-file' >     stack traceback: >             [C]: in function 'require' >             [\directlua]:1: in main chunk. >     <*> \nonstopmode\directlua{require 'not-a-real-file'} >                                                       \bye >     (see the transcript file for additional information) >     warning  (pdf backend): no pages of output. >     Transcript written on texput.log. > > so I'm a little surprised that ConTeXt just issues a warning here when > it can't find the file: > >    resolvers > lua > unknown file 'lua-widow-control.lua' > > > when it says it doesn't know the lua-widow-control.lua file. I don't > see > > any mention of this file within the t-lua-widow-control module. > > lua-widow-control.lua is loaded at line 63 of the .mkxl: >     \ctxloadluafile{lua-widow-control} > > > Could it be that this module is not yet mature for lmtx > > Lua-widow-control is certainly more stable with Plain/LaTeX, but it > usually runs fine with LMTX. The entire lwc manual is written in > ConTeXt/LMTX so I (usually) notice pretty quickly when things break. > > The only real "issue" with LMTX is that the engine changes pretty > quickly, so lwc may sometimes be broken for a few days between an > engine update and whenever I push out a fix. This doesn't happen with > Plain/LaTeX since the LuaTeX engine is mostly frozen. > > Interestingly, the MkXL version of lwc actually predates the MkIV > version, although only by a few months. > > > I have \usemodule[lua-widow-control] in my tex document, and > > I haven't forgotten to do the prescribed mtxrun --generate after > > including the module in my third-party folder of my luametatex > > installation on Arch. > > Hmm, that's odd then. I'm not entirely sure why this is happening, so > I'm going to take a random guess: > > Maybe you installed lwc using a zipfile from either GitHub or the > ConTeXt Garden modules site, then you copied the files into your > texmf-modules/ folder, *but* you only copied the "tex/context/" folder > and not all of the folders in the "tex" folder. The > "lua-widow-control.lua" file is in the "tex/luatex/" folder, so if you > didn't also copy that across you're going to have problems. > > Again, just a random guess.  If that doesn't work, you could maybe try > running >     context --make > but I doubt that that would fix anything here. You could also try > deleting the filename cache files at: >     {CONTEXT}/texmf-cache/luametatex-cache/context/*/trees/*.lu? > then rerunning >     mtxrun --generate > I've never deleted those files before, but it's in a folder called > "cache" so it's _probably_ safe to delete (make a backup just in case > though). > > If none of that works, then the issue could be something else on your > end, or I could have screwed something up in lwc. In that case, try > running >     find /opt/luametatex/texmf-modules/ -path '*widow*' -print > and >     mtxrun --find-file lua-widow-control.lua > and reply with the output. > > Oh, and one more note. ConTeXt version "2022-04-11 19:20" renamed some > of the engine Lua functions, so make sure to update to lwc v2.0.6 (if > you're using a recent ConTeXt version). Otherwise after you fix the > "unknown file" error, you would get an "attempt to call a nil value" > error which isn't any better. > > Let me know if you have any other issues. > >  -- Max --------------7WWzMBRS34V11vKTngRjkSTn Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

Hi, Max:

First things first.  I want to acknowledge and thank you for the tough mission that surely involves maintaining this module for the benefit of the TeX community and, most especially, for LMTX in particular, due to the very reasons you have just explained.

Regarding your remarks, you are right in your assumptions: I didn't have the required lua file installed in its corresponding folder. That's what I was missing, and, logically, what made my compilation crash.

To make my confusion even worse, I had done a strict search inside the mkxl code. It wouldn't take me to line 63 because I had added the extension (lua-widow-control.lua, not just lua-widow-control).

Anyway, a mess only due to my ignorance.

Now I finally get the pdf. But unfortunately, this "new" pdf is the same with the module uncommented as when I had it commented. There is no difference at all. And you're right: even context --make doesn't solve the problem. To give you an idea, although my dummy document has 78 pages, only 55 can really be said to be dummy text that can benefit from the module. Well, only in those 55 pages I have 2 orphans, 5 widows and 6 broken hyphens.

I have read several times all the options of the module in the lua-widow-control.pdf document, but I don't even dare to mess with those options because it seems to me very radical that my output pdf is the same with the module uncommented in my code.

Of course, mtxrun --find-file lua-widow-control.lua yields what you would expect:

 /opt/luametatex/texmf-modules/tex/luatex/lua-widow-control/lua-widow-control.lua

Thanks again for your work and yours observations.

Edu.

El 25/4/22 a las 22:00, Max Chernoff escribió:
(Please keep me CC'd as I'm not subscribed to the list)

Hi, I'm the lua-widow-control author.

> lua error > lua error on line 74 in file
> /opt/luametatex/texmf-modules/tex/context/third/lua-widow-control/t-lua-widow-control.mkxl
>
> The odd thing is that line 75 of the t-lua-widow-control file is empty.

The \setuplwc command ends on line 74, which then triggers \everysetuplwc which then calls \ctxlua{lwc.enable_callbacks()}. This fails since lwc is undefined because the Lua file isn't loaded because ConTeXt can't seem to find the file.

In Plain LuaTeX and LuaLaTeX, a missing Lua file is a fatal error:

    $ luatex "\nonstopmode\directlua{require 'not-a-real-file'}\bye"

    This is LuaTeX, Version 1.13.2 (TeX Live 2021/W32TeX)
     restricted system commands enabled.

    [\directlua]:1: module 'not-a-real-file' not found:
            no field package.preload['not-a-real-file']
            [kpse lua searcher] file not found: 'not-a-real-file'
    stack traceback:
            [C]: in function 'require'
            [\directlua]:1: in main chunk.
    <*> \nonstopmode\directlua{require 'not-a-real-file'}
                                                      \bye
    (see the transcript file for additional information)
    warning  (pdf backend): no pages of output.
    Transcript written on texput.log.

so I'm a little surprised that ConTeXt just issues a warning here when it can't find the file:

   resolvers > lua > unknown file 'lua-widow-control.lua'

> when it says it doesn't know the lua-widow-control.lua file. I don't see
> any mention of this file within the t-lua-widow-control module.

lua-widow-control.lua is loaded at line 63 of the .mkxl:
    \ctxloadluafile{lua-widow-control}

> Could it be that this module is not yet mature for lmtx

Lua-widow-control is certainly more stable with Plain/LaTeX, but it usually runs fine with LMTX. The entire lwc manual is written in ConTeXt/LMTX so I (usually) notice pretty quickly when things break.

The only real "issue" with LMTX is that the engine changes pretty quickly, so lwc may sometimes be broken for a few days between an engine update and whenever I push out a fix. This doesn't happen with Plain/LaTeX since the LuaTeX engine is mostly frozen.

Interestingly, the MkXL version of lwc actually predates the MkIV version, although only by a few months.

> I have \usemodule[lua-widow-control] in my tex document, and
> I haven't forgotten to do the prescribed mtxrun --generate after
> including the module in my third-party folder of my luametatex
> installation on Arch.

Hmm, that's odd then. I'm not entirely sure why this is happening, so I'm going to take a random guess:

Maybe you installed lwc using a zipfile from either GitHub or the ConTeXt Garden modules site, then you copied the files into your texmf-modules/ folder, *but* you only copied the "tex/context/" folder and not all of the folders in the "tex" folder. The "lua-widow-control.lua" file is in the "tex/luatex/" folder, so if you didn't also copy that across you're going to have problems.

Again, just a random guess.  If that doesn't work, you could maybe try running
    context --make
but I doubt that that would fix anything here. You could also try deleting the filename cache files at:
    {CONTEXT}/texmf-cache/luametatex-cache/context/*/trees/*.lu?
then rerunning
    mtxrun --generate
I've never deleted those files before, but it's in a folder called "cache" so it's _probably_ safe to delete (make a backup just in case though).

If none of that works, then the issue could be something else on your end, or I could have screwed something up in lwc. In that case, try running
    find /opt/luametatex/texmf-modules/ -path '*widow*' -print
and
    mtxrun --find-file lua-widow-control.lua
and reply with the output.

Oh, and one more note. ConTeXt version "2022-04-11 19:20" renamed some of the engine Lua functions, so make sure to update to lwc v2.0.6 (if you're using a recent ConTeXt version). Otherwise after you fix the "unknown file" error, you would get an "attempt to call a nil value" error which isn't any better.

Let me know if you have any other issues.

 -- Max
--------------7WWzMBRS34V11vKTngRjkSTn-- --===============3323523206696416609== 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== --===============3323523206696416609==--