Re: [NTG-context] context module t-account in LMTX

2022-04-26 Thread Wolfgang Schuster via ntg-context

Heinrich Paeßens via ntg-context schrieb am 26.04.2022 um 16:13:

Hi there

I just tried to test the use of the /t-account module/, compiling with 
LMTX, but no avail.


What is wrong? Does the module need a fix for LMTX or is the fault on 
my side (having no experience …)?


The module which can be downloaded from the modules section of the 
context wiki page is no longer supported.


I wrote a new version of the module a few years ago after I got a user 
request but I haven't put the new version on the wiki. To use the new 
version of the module you can download the file from my github site [1] 
and put it in the same folder as your document. There are examples how 
to use the module at the end of the file.


[1] https://github.com/wolfgangschuster/taccount/tree/master/files

Wolfgang

___
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
___


[NTG-context] context module t-account in LMTX

2022-04-26 Thread Heinrich Paeßens via ntg-context
Hi there

I just tried to test the use of the t-account module, compiling with LMTX, but 
no avail.

What is wrong? Does the module need a fix for LMTX or is the fault on my side 
(having no experience …)?

Many thanks for your support. Kind regards,
Heinrich

the example is in the file 
tst-account.tex

——
% !TEX program = lmtx

\usemodule[t-account]
\environment TACCOUNT

\startDEBITS
\debit [Auto] {2000}
\debit [Bus]  {5000}


\startCREDITS
\credit [Bank] {1000}
\credit [Kasse] {200}
\credit [Kasse] {200}
\stopCREDITS

\stopACCOUNT
——


leads to error shown in the log:
——
resolvers   | formats | executing runner 'run luametatex format': 
/Users/hp/Library/context-osx-64/tex/texmf-osx-64/bin/luametatex 
--jobname="./tst-account.tex" 
--fmt=/Users/hp/Library/context-osx-64/tex/texmf-cache/luametatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luametatex/cont-en.fmt
 
--lua=/Users/hp/Library/context-osx-64/tex/texmf-cache/luametatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luametatex/cont-en.lui
  --c:autopdf --c:currentrun=1 --c:directives="system.showerror" 
--c:fulljobname="./tst-account.tex" --c:input="./tst-account.tex" 
--c:kindofrun=1 --c:maxnofruns=9 --c:purgeall 
--c:texmfbinpath="/Users/hp/Library/context-osx-64/tex/texmf-osx-64/bin"

system  > 
system  > ConTeXt  ver: 2022.04.15 20:20 LMTX  fmt: 2022.4.17  int: 
english/english
system  > 
system  > 'cont-new.mkxl' loaded
open source > level 1, order 1, name 
'/Users/hp/Library/context-osx-64/tex/texmf-context/tex/context/base/mkxl/cont-new.mkxl'
system  > beware: some patches loaded from cont-new.mkiv
close source> level 1, order 1, name 
'/Users/hp/Library/context-osx-64/tex/texmf-context/tex/context/base/mkxl/cont-new.mkxl'
system  > files > jobname './tst-account', input './tst-account.tex', 
result './tst-account'
fonts   > latin modern fonts are not preloaded
languages   > language 'en' is active
open source > level 1, order 2, name './tst-account.tex'
modules > using user prefixed file 't-account'
modules > 't-account' is loaded
open source > level 2, order 3, name 
'/Users/hp/Library/context-osx-64/tex/texmf-modules/tex/context/third/account/t-account.mkiv'
close source> level 2, order 3, name 
'/Users/hp/Library/context-osx-64/tex/texmf-modules/tex/context/third/account/t-account.mkiv'
context report  > file: tst-account-status.html
mtx-context | fatal error: return code: 1
——

and the -status.html says:
——
Error  Undefined control sequence \startDEBITS
File   ./tst-account.tex
Line   7

 1 % !TEX program = lmtx
 2 \usemodule[t-account]
 3 \environment TACCOUNT
 4 
 5 \startACCOUNT[left=S,middle=Bilanz,right=H]
 6 
 7 >>  \startDEBITS
 8 \debit [Auto] {2000}
 9 \debit [Bus]  {5000}
10 \stopDEBITS
11 
12 \startCREDITS
13 \credit [Bank] {1000}
14 \credit [Kasse] {200}
15 \credit [Kasse] {200}
16 \stopCREDITS
17
——



___
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
___


Re: [NTG-context] lua-widow-control module error in LMTX

2022-04-26 Thread Eduardo Bohoyo via ntg-context

Erratum: When I wrote script, I meant hyphen.

El 26/4/22 a las 11:45, Eduardo Bohoyo escribió:

Hi:

No line such as "Widow/orphan detected. Attempting to delete".

I see interleaved new groups with the same line always repeating a 
warning message throughout the whole file. In short, there are 613 new 
lines with the message "luatex warning > tex: left parfill skip is gone".
But I didn't give it any importance, because I interpreted that they 
could be inherent to the module.


I can see "modules > 'lua-widow-control' is loaded".

But, luckily, I can also see this:

open source > level 2, order 4, name 
'/opt/luametatex/texmf-modules/tex/context/third/lua-widow-control/t-lua-widow-control.mkxl'
resolvers   > lua > loading file 
'/opt/luametatex/texmf-modules/tex/luatex/lua-widow-control/lua-widow-control.lua' 
succeeded
close source    > level 2, order 4, name 
'/opt/luametatex/texmf-modules/tex/context/third/lua-widow-control/t-lua-widow-control.mkxl'

module  > lua-widow-control > Already enabled


On the other hand, the distribution and size of my paragraphs take 
great care that their "design" optimises the module's goodness, 
except, of course, for the first pages of each of the nine dummy text 
chapters (they start at a third of a page).
But it is very curious that, even so, only the two orphan lines I 
mentioned, and only two of the five widows relate to two or three of 
those "supposedly problematic" first chapter pages (as I said, nine in 
total). And the case of the broken scripts is even stranger: only two 
of the six breakages concern a couple of those early chapter pages.


I will go over the lua-widow-control.pdf document once more in case 
there is a tiny detail I am missing, but I think, if I keep going at 
this pace, I will end up learning it by heart.


Well, joking aside, thanks again for your advice, Max.

Edu.

El 26/4/22 a las 4:42, Max Chernoff escribió:

On 2022-04-25 6:51 p.m., Eduardo Bohoyo wrote:
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.


Well thanks :) These days I write most of my documents in LMTX, so 
the LMTX

support is pretty self-serving -- I'm admittedly surprised that there's
another lwc + LMTX user.

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.


Yeah, it's a pretty easy mistake to make. For Knuth TeX, shared files go
in texmf/tex/generic and Plain-specific files go in texmf/tex/plain, but
with LuaTeX there's just texmf/tex/luatex so it gets a little confusing.

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.


So the first step here is to check the log file. If you see lines like

    module  > lua-widow-control > Widow/orphan detected. 
Attempting to remove.
    module  > lua-widow-control > Widow/Orphan NOT removed on 
page X.


then that means that lwc found a widow/orphan, but gave up. This usually
only happens if the page has only really short paragraphs, but it can 
also
happen if there aren't any paragraphs that both start and finish on 
the page.
I've got some neat graphs for this (see the upcoming TUGboat issue), 
but with

default settings this should happen for much less than 10% of potential
widows/orphans, so it seems unlikely that this is happening for every 
page.


If this actually is the issue, then you can try raising the 
"emergencystretch"
value in "\setuplwc", but that's probably going to give terrible 
results. The real
solution is to rewrite something, but that should usually be pretty 
rare.


---

If you see lines like

    module  > lua-widow-control > Widow/orphan detected. 
Attempting to remove.
    module  > lua-widow-control > Widow/orphan successfully 
removed at paragraph X on page Y.


but the widows/orphans weren't actually removed, then something 
really weird
is going on and definitely means that there's a bug in lwc. Rerun the 
document with


    \setuplwc[debug=true]

immediately after "\usemodule[lua-widow-control]" and either reply 
with the log

or post a new issue on the lwc GitHub.

---

If you only see

    modules > 'lua-widow-control' is loaded

but not any other lines mentioning lwc, then something weird is going 
on, and
lwc is loaded but not enabled. If this is the case, same as 

Re: [NTG-context] lua-widow-control module error in LMTX

2022-04-26 Thread Eduardo Bohoyo via ntg-context

Hi:

No line such as "Widow/orphan detected. Attempting to delete".

I see interleaved new groups with the same line always repeating a 
warning message throughout the whole file. In short, there are 613 new 
lines with the message "luatex warning > tex: left parfill skip is gone".
But I didn't give it any importance, because I interpreted that they 
could be inherent to the module.


I can see "modules > 'lua-widow-control' is loaded".

But, luckily, I can also see this:

open source > level 2, order 4, name 
'/opt/luametatex/texmf-modules/tex/context/third/lua-widow-control/t-lua-widow-control.mkxl'
resolvers   > lua > loading file 
'/opt/luametatex/texmf-modules/tex/luatex/lua-widow-control/lua-widow-control.lua' 
succeeded
close source    > level 2, order 4, name 
'/opt/luametatex/texmf-modules/tex/context/third/lua-widow-control/t-lua-widow-control.mkxl'

module  > lua-widow-control > Already enabled


On the other hand, the distribution and size of my paragraphs take great 
care that their "design" optimises the module's goodness, except, of 
course, for the first pages of each of the nine dummy text chapters 
(they start at a third of a page).
But it is very curious that, even so, only the two orphan lines I 
mentioned, and only two of the five widows relate to two or three of 
those "supposedly problematic" first chapter pages (as I said, nine in 
total). And the case of the broken scripts is even stranger: only two of 
the six breakages concern a couple of those early chapter pages.


I will go over the lua-widow-control.pdf document once more in case 
there is a tiny detail I am missing, but I think, if I keep going at 
this pace, I will end up learning it by heart.


Well, joking aside, thanks again for your advice, Max.

Edu.

El 26/4/22 a las 4:42, Max Chernoff escribió:

On 2022-04-25 6:51 p.m., Eduardo Bohoyo wrote:
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.


Well thanks :) These days I write most of my documents in LMTX, so the 
LMTX

support is pretty self-serving -- I'm admittedly surprised that there's
another lwc + LMTX user.

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.


Yeah, it's a pretty easy mistake to make. For Knuth TeX, shared files go
in texmf/tex/generic and Plain-specific files go in texmf/tex/plain, but
with LuaTeX there's just texmf/tex/luatex so it gets a little confusing.

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.


So the first step here is to check the log file. If you see lines like

    module  > lua-widow-control > Widow/orphan detected. 
Attempting to remove.
    module  > lua-widow-control > Widow/Orphan NOT removed on 
page X.


then that means that lwc found a widow/orphan, but gave up. This usually
only happens if the page has only really short paragraphs, but it can 
also
happen if there aren't any paragraphs that both start and finish on 
the page.
I've got some neat graphs for this (see the upcoming TUGboat issue), 
but with

default settings this should happen for much less than 10% of potential
widows/orphans, so it seems unlikely that this is happening for every 
page.


If this actually is the issue, then you can try raising the 
"emergencystretch"
value in "\setuplwc", but that's probably going to give terrible 
results. The real

solution is to rewrite something, but that should usually be pretty rare.

---

If you see lines like

    module  > lua-widow-control > Widow/orphan detected. 
Attempting to remove.
    module  > lua-widow-control > Widow/orphan successfully 
removed at paragraph X on page Y.


but the widows/orphans weren't actually removed, then something really 
weird
is going on and definitely means that there's a bug in lwc. Rerun the 
document with


    \setuplwc[debug=true]

immediately after "\usemodule[lua-widow-control]" and either reply 
with the log

or post a new issue on the lwc GitHub.

---

If you only see

    modules > 'lua-widow-control' is loaded

but not any other lines mentioning lwc, then something weird is going 
on, and
lwc is loaded but not enabled. If this is the case, same as last time: 
enable

debug mode and reply with the log.

---

If you don't see

    modules