ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Keith McKay <mckaymeister@gmail.com>
To: ntg-context@ntg.nl
Subject: [NTG-context] Re: Par Builder Tests
Date: Fri, 28 Jul 2023 16:04:49 +0100	[thread overview]
Message-ID: <a8d55a53-6f32-6a12-4202-4ec0f475c6b3@gmail.com> (raw)
In-Reply-To: <e20a950c-d7d6-52db-d47a-5a9b5038cd82@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 4957 bytes --]

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        10000
>>     \frozen\clubpenalty         10000
>>     \frozen\displaywidowpenalty 10000
>>     \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
>> ___________________________________________________________________________________ 
>>

[-- Attachment #2: warAndPeace1.png --]
[-- Type: image/png, Size: 15891 bytes --]

[-- Attachment #3: warAndPeace2.png --]
[-- Type: image/png, Size: 18002 bytes --]

[-- Attachment #4: Type: text/plain, Size: 495 bytes --]

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

  reply	other threads:[~2023-07-28 15:09 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-21 15:34 [NTG-context] " Keith McKay
2023-07-21 15:53 ` [NTG-context] " Hans Hagen
2023-07-21 16:10 ` Hans Hagen via ntg-context
2023-07-21 16:33   ` Keith McKay
2023-07-28 15:04     ` Keith McKay [this message]
2023-07-28 16:22       ` Henning Hraban Ramm
2023-07-28 18:20         ` Keith McKay
2023-07-30 13:09           ` Keith McKay
2023-08-01 13:37             ` [NTG-context] Bibliography cite Robert via ntg-context
2023-08-01 20:42               ` [NTG-context] " Alan Braslau via ntg-context
2023-08-01 21:26                 ` Robert via ntg-context
2023-08-04 11:57                   ` Alan Braslau via ntg-context
2023-08-05 14:43                     ` Robert via ntg-context

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a8d55a53-6f32-6a12-4202-4ec0f475c6b3@gmail.com \
    --to=mckaymeister@gmail.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).