[NTG-context] Re: Par Builder Tests

2023-07-30 Thread Keith McKay
Hraban's suggestion works really well. I setup hyphenation rules for the 
underfull boxes of Russian names and reduced the \tolerance to 600.  I'm 
now down to about 20 underfull boxes which to my eyes look fine.


Thanks again Hraban

Best Wishes

Keith

On 28/07/2023 19:20, Keith McKay wrote:


Thanks Hraban, didn't think of that so will give it a try.
Best Wishes
Keith


On Fri, 28 Jul 2023, 17:28 Henning Hraban Ramm,  wrote:

Am 28.07.23 um 17:04 schrieb Keith McKay:
> I played around with the setups for the align:pass:test4 code
below, as
> Hans suggested, and it was changing the \tolerance value which
made the
> difference. Increasing the \tolerance value to 1000 eliminated all
> overfull hboxes but still left 79 underfull hboxes. I continued to
> increase the \tolerance value up to 6600 and was left with two
overfull
> hboxes. One with a badness of 6641 (warAndPeace1.png) and one
with a
> badness of 1097 (warAndPeace2.png). Above the \tolerance of 6600
only
> warAndPeace2.png was left with a badness of 1097. Both of these
> underfull hboxes were at the beginning of a paragraph - "To his
Honor"
> in the first png and "Well, you see," in the second png. I not
sure a
> reader would spot the second png badness but the first is
noticeable to
> my eyes.

Hi Keith,
since both cases are caused by names with accents, did you try to add
hyphenation exceptions for those? Such cases are probably not
covered by
English hyphentation rules.

Hraban


___
If your question is of interest to others as well, please add an
entry to the Wiki!

maillist : ntg-context@ntg.nl /
https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net

___
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

[NTG-context] Re: Par Builder Tests

2023-07-28 Thread Keith McKay
Thanks Hraban, didn't think of that so will give it a try.
Best Wishes
Keith


On Fri, 28 Jul 2023, 17:28 Henning Hraban Ramm,  wrote:

> Am 28.07.23 um 17:04 schrieb Keith McKay:
> > I played around with the setups for the align:pass:test4 code below, as
> > Hans suggested, and it was changing the \tolerance value which made the
> > difference. Increasing the \tolerance value to 1000 eliminated all
> > overfull hboxes but still left 79 underfull hboxes. I continued to
> > increase the \tolerance value up to 6600 and was left with two overfull
> > hboxes. One with a badness of 6641 (warAndPeace1.png) and one with a
> > badness of 1097 (warAndPeace2.png). Above the \tolerance of 6600 only
> > warAndPeace2.png was left with a badness of 1097. Both of these
> > underfull hboxes were at the beginning of a paragraph - "To his Honor"
> > in the first png and "Well, you see," in the second png. I not sure a
> > reader would spot the second png badness but the first is noticeable to
> > my eyes.
>
> Hi Keith,
> since both cases are caused by names with accents, did you try to add
> hyphenation exceptions for those? Such cases are probably not covered by
> English hyphentation rules.
>
> Hraban
>
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://contextgarden.net
>
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

[NTG-context] Re: Par Builder Tests

2023-07-28 Thread Henning Hraban Ramm

Am 28.07.23 um 17:04 schrieb Keith McKay:
I played around with the setups for the align:pass:test4 code below, as 
Hans suggested, and it was changing the \tolerance value which made the 
difference. Increasing the \tolerance value to 1000 eliminated all 
overfull hboxes but still left 79 underfull hboxes. I continued to 
increase the \tolerance value up to 6600 and was left with two overfull 
hboxes. One with a badness of 6641 (warAndPeace1.png) and one with a 
badness of 1097 (warAndPeace2.png). Above the \tolerance of 6600 only 
warAndPeace2.png was left with a badness of 1097. Both of these 
underfull hboxes were at the beginning of a paragraph - "To his Honor" 
in the first png and "Well, you see," in the second png. I not sure a 
reader would spot the second png badness but the first is noticeable to 
my eyes.


Hi Keith,
since both cases are caused by names with accents, did you try to add 
hyphenation exceptions for those? Such cases are probably not covered by 
English hyphentation rules.


Hraban

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] Re: Par Builder Tests

2023-07-28 Thread Keith McKay

Hi all!

Using the example below I have completed a test using a larger book. 
This time I downloaded War and Peace from the Gutenberg Project and 
extracted the individual xhtml files for Context.


I played around with the setups for the align:pass:test4 code below, as 
Hans suggested, and it was changing the \tolerance value which made the 
difference. Increasing the \tolerance value to 1000 eliminated all 
overfull hboxes but still left 79 underfull hboxes. I continued to 
increase the \tolerance value up to 6600 and was left with two overfull 
hboxes. One with a badness of 6641 (warAndPeace1.png) and one with a 
badness of 1097 (warAndPeace2.png). Above the \tolerance of 6600 only 
warAndPeace2.png was left with a badness of 1097. Both of these 
underfull hboxes were at the beginning of a paragraph - "To his Honor" 
in the first png and "Well, you see," in the second png. I not sure a 
reader would spot the second png badness but the first is noticeable to 
my eyes.


I'm very pleased how the book has turned out, all 1668 pages of it as an 
approximately 13cm by 20cm book. The pdf is 4MB and each run in ConTeXt 
takes about 10 seconds on my M1 mac mini.


I'm interested in seeing how \setupalignpass develops and learning more 
of how to use it.


Best Wishes

Keith McKay

On 21/07/2023 17:33, Keith McKay wrote:

Thanks Hans!

I'll have a play and keep an eye on updates

Best Wishes

Keith

On 21/07/2023 17:10, Hans Hagen via ntg-context wrote:

Hi Keith,

Here an example that Mikael made for such a book:

\showframe

% let's very strict

\startsetups [*default]

    \directsetup{*reset}

    \frozen\widowpenalty    1
    \frozen\clubpenalty 1
    \frozen\displaywidowpenalty 1
    \frozen\brokenpenalty   0 % \defaultbrokenpenalty

\stopsetups

% we enable the use of expansion (this feature might become preset
% because we now delay setting the vectors anyway so less overhead)

\definefontfeature
  [default]
  [default]
  [expansion=quality,
   protrusion=quality,
   itlc=yes]

% vertical expansion

\setuplayout
  [vz=2]

% for which we need:

% \setupalign[hanging,depth,stretch,granular]

\setupalign[depth,stretch,granular]

% here are the passes:

\startsetups align:pass:test4
    \pretolerance 100
    \tolerance    200
    \parpasses    4
    classes  \indecentparpassclasses
    threshold    0.025pt
    adjustspacing  3
    adjustspacingstep  1
    adjustspacingshrink    5
    adjustspacingstretch  10
    next
    classes  \indecentparpassclasses
    threshold    0.025pt
    adjustspacing  3
    adjustspacingstep  1
    adjustspacingshrink   10
    adjustspacingstretch  20
    next
    classes  \indecentparpassclasses
    threshold    0.025pt
    adjustspacing  3
    adjustspacingstep  1
    adjustspacingshrink   25
    adjustspacingstretch  50
    next
    classes  \indecentparpassclasses
    threshold    0.025pt
    adjustspacing  3
    adjustspacingstep  1
    adjustspacingshrink   50
    adjustspacingstretch 100
    \relax
\stopsetups

\setupalignpass[test4]

\starttext
    ...
\stoptext

(work in progress so keep an eye on updates)

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-

___ 

If your question is of interest to others as well, please add an 
entry to the Wiki!


maillist : ntg-context@ntg.nl / 
https://www.ntg.nl/mailman/listinfo/ntg-context

webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___ 
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

[NTG-context] Re: Par Builder Tests

2023-07-21 Thread Keith McKay

Thanks Hans!

I'll have a play and keep an eye on updates

Best Wishes

Keith

On 21/07/2023 17:10, Hans Hagen via ntg-context wrote:

Hi Keith,

Here an example that Mikael made for such a book:

\showframe

% let's very strict

\startsetups [*default]

    \directsetup{*reset}

    \frozen\widowpenalty    1
    \frozen\clubpenalty 1
    \frozen\displaywidowpenalty 1
    \frozen\brokenpenalty   0 % \defaultbrokenpenalty

\stopsetups

% we enable the use of expansion (this feature might become preset
% because we now delay setting the vectors anyway so less overhead)

\definefontfeature
  [default]
  [default]
  [expansion=quality,
   protrusion=quality,
   itlc=yes]

% vertical expansion

\setuplayout
  [vz=2]

% for which we need:

% \setupalign[hanging,depth,stretch,granular]

\setupalign[depth,stretch,granular]

% here are the passes:

\startsetups align:pass:test4
    \pretolerance 100
    \tolerance    200
    \parpasses    4
    classes  \indecentparpassclasses
    threshold    0.025pt
    adjustspacing  3
    adjustspacingstep  1
    adjustspacingshrink    5
    adjustspacingstretch  10
    next
    classes  \indecentparpassclasses
    threshold    0.025pt
    adjustspacing  3
    adjustspacingstep  1
    adjustspacingshrink   10
    adjustspacingstretch  20
    next
    classes  \indecentparpassclasses
    threshold    0.025pt
    adjustspacing  3
    adjustspacingstep  1
    adjustspacingshrink   25
    adjustspacingstretch  50
    next
    classes  \indecentparpassclasses
    threshold    0.025pt
    adjustspacing  3
    adjustspacingstep  1
    adjustspacingshrink   50
    adjustspacingstretch 100
    \relax
\stopsetups

\setupalignpass[test4]

\starttext
    ...
\stoptext

(work in progress so keep an eye on updates)

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-

___ 

If your question is of interest to others as well, please add an entry 
to the Wiki!


maillist : ntg-context@ntg.nl / 
https://www.ntg.nl/mailman/listinfo/ntg-context

webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___ 


___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___

[NTG-context] Re: Par Builder Tests

2023-07-21 Thread Hans Hagen via ntg-context

Hi Keith,

Here an example that Mikael made for such a book:

\showframe

% let's very strict

\startsetups [*default]

\directsetup{*reset}

\frozen\widowpenalty1
\frozen\clubpenalty 1
\frozen\displaywidowpenalty 1
\frozen\brokenpenalty   0 % \defaultbrokenpenalty

\stopsetups

% we enable the use of expansion (this feature might become preset
% because we now delay setting the vectors anyway so less overhead)

\definefontfeature
  [default]
  [default]
  [expansion=quality,
   protrusion=quality,
   itlc=yes]

% vertical expansion

\setuplayout
  [vz=2]

% for which we need:

% \setupalign[hanging,depth,stretch,granular]

\setupalign[depth,stretch,granular]

% here are the passes:

\startsetups align:pass:test4
\pretolerance 100
\tolerance200
\parpasses4
classes  \indecentparpassclasses
threshold0.025pt
adjustspacing  3
adjustspacingstep  1
adjustspacingshrink5
adjustspacingstretch  10
next
classes  \indecentparpassclasses
threshold0.025pt
adjustspacing  3
adjustspacingstep  1
adjustspacingshrink   10
adjustspacingstretch  20
next
classes  \indecentparpassclasses
threshold0.025pt
adjustspacing  3
adjustspacingstep  1
adjustspacingshrink   25
adjustspacingstretch  50
next
classes  \indecentparpassclasses
threshold0.025pt
adjustspacing  3
adjustspacingstep  1
adjustspacingshrink   50
adjustspacingstretch 100
\relax
\stopsetups

\setupalignpass[test4]

\starttext
...
\stoptext

(work in progress so keep an eye on updates)

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] Re: Par Builder Tests

2023-07-21 Thread Hans Hagen

On 7/21/2023 5:34 PM, Keith McKay wrote:

Hi all,

At the end of June, Hans uploaded a new lmtx version which included 
improvements to par building which he and Mikael had been working on in 
math mode. Hans suggested in the online chat that these improvements may 
be useful in typesetting novels. I was keen to try these since I have 
typset novels in the past.


I have ran some tests on two novels which I downloaded from the 
Gutenberg Project site as epubs and extracted them to get the original 
xhtml files which I then typeset in context. I made very little in the 
way of changes to the files so that my setup for xml was very simple.


Here are my setups for the layout of the novels showing some trackers 
that were used as well:


\definepapersize[pagee][width=5.06in,height=7.81in]
\setuppapersize[pagee]
% XML setups here
\startsetups[grid][mypenalties]
\setdefaultpenalties
\setpenalties\widowpenalties{1}{150}
\setpenalties\clubpenalties {1}{150}
\stopsetups
\setuplayout[
width=10cm,
topspace=0.5in,
backspace=2.0cm,
header=7.5mm,
footer=0.25in,
location={middle,middle},
vs=2,
grid=yes,
setups=mypenalties
]
%\enabletrackers[makeup]
%\enabletrackers[builders.hpack.quality]
\enabletrackers[builders.hpack.overflow]
%\enabletrackers[layout.vz]
%\enabletrackers[paragraphs.passes]
\enabletrackers[paragraphs.passes=summary]
%\enabletrackers[paragraphs.passes=details]
\setupalign[granular]
%\setupalign[nothyphenated,hz,verytolerant]
%\setupalign[vertical,height]
%\setupalignpass[decent]
%\setupalignpass[quality]
%\setupalignpass[test1]
\setupalignpass[test2]
%\setupalignpass[test3]
%\setupalignpass[test4]
%\setupalignpass[test5]
%\setupalignpass[optional1]
%\setupalignpass[test2b]
\starttext
\setuppagenumbering[location={footer,middle},alternative=doublesided,state=start]
\setcounter[userpage][1]
%\showmakeup[vbox]
%\showlayout
\dostepwiserecurse{0}{30}{1}{
\xmlprocessfile{mysetups}{/path to xhtml 
files/4439720318703948998_84-h-\recurselevel.htm.xhtml}{}

}
\stoptext

Below are the result showing the number of overfull boxes for these 
novels using the setups in the file spac-imp-tests.mkxl . See the manual 
Low Level - Lines


Test    Novel1   Novel2
Test1    70    35
Test2    30    8
Test3    62    23
Test4    89    40
Test5    28    9
Optional1 55    19
Quality  74    32
Decent  39    11

 From these initial tests one can see that Test2 gave the lowest number 
of overfull boxes. So I edited test two, ran it, and the results are below.


Test    Novel1   Novel2

Test2b  11    0

My setup for test 2b is as follows:
\startsetups align:pass:test2b
     \pretolerance 100
     \tolerance    200
     \parpasses  3
     classes  \indecentparpassclasses
     threshold    0.025pt
     tolerance    800
     extrahyphenpenalty    50
   next
     threshold    0.025pt
     tolerance    900
     adjustspacing  3
     adjustspacingstep  1
     adjustspacingshrink   10
     adjustspacingstretch  15
     next
     threshold    0.025pt
     tolerance    1000
     adjustspacing  3
     adjustspacingstep  1
     adjustspacingshrink   20
     adjustspacingstretch  40
     emergencystretch .25\bodyfontsize
     \relax
% \linebreakpasses\plusone
\stopsetups
The only difference between test 2 and 2b are that I increased the 
tolerance in each of the three passes.
In novel 2 this was successful in eliminating the overfull boxes but not 
in Novel 1 although I noticed that majority of overfull boxes were above 
1pt with the largest about 12pt in Novel 1.


I am at the stage now where I need some kind of strategy to 
reduce/eliminate overfull boxes, other than changing the tolerance, and 
I'm hoping for some advice from the community. Suggestions for further 
reading particularly on the commands in \setupalignpass and their usage 
would be appreciated and on the best way to tackle overfull boxes.
you're too tolerant (stick to 200), you can even start out with 
pretolerance 50 and tolerance 150 and then in the passes 200


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
__