ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <j.hagen@xs4all.nl>
To: Keith McKay <mckaymeister@gmail.com>,
	mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: [NTG-context] Re: Par Builder Tests
Date: Fri, 21 Jul 2023 17:53:16 +0200	[thread overview]
Message-ID: <17634714-588f-6356-6512-58860e9a4a03@xs4all.nl> (raw)
In-Reply-To: <71307b8a-b5cc-dd88-a145-8df34c5af67e@gmail.com>

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
___________________________________________________________________________________

  reply	other threads:[~2023-07-21 15:58 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 ` Hans Hagen [this message]
2023-07-21 16:10 ` [NTG-context] " Hans Hagen via ntg-context
2023-07-21 16:33   ` Keith McKay
2023-07-28 15:04     ` Keith McKay
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=17634714-588f-6356-6512-58860e9a4a03@xs4all.nl \
    --to=j.hagen@xs4all.nl \
    --cc=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).