ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Henning Hraban Ramm <texml@fiee.net>
To: ntg-context@ntg.nl
Subject: [NTG-context] Re: “breaking news”
Date: Tue, 1 Oct 2024 21:16:08 +0200	[thread overview]
Message-ID: <df4f99f6-3096-4454-af55-6978353e7c7a@fiee.net> (raw)
In-Reply-To: <d7c5e3dc-e1f6-41db-97ca-0557248e1068@xs4all.nl>

Am 01.10.24 um 00:17 schrieb Hans Hagen:
>> It’s a novel of ~650 pages with a big range of paragraph lengths (some 
>> dialogues with short lines as well as paragraphs that span pages). “Of 
>> course” you often get a 3-line paragraph over a page break – it’s hard 
>> to avoid widows and orphans.
> 
> depends .. three liners can be made to work in fact one should then use 
> \widowpenalties and \clubpenalties with a high value for the first two 
> entries (and maybe disable them to overlap)

I have
\setpenalties\widowpenalties{2}{8000}
\setpenalties\clubpenalties{2}{10000}

Does this make sense? While I saw in your demonstrations that it’s 
possible to set different penalties per line, I never tried.

Otherwise, I found out the easiest solution is a \vbox, VZ does the 
rest. Should have thought of that earlier, would have saved me a few hours.

> here is a teaser:
> 
> \permanent \specificationdef \lesswidowpenalties \widowpenalties
>      \plusthree options \numexpr\largestspecificationoptioncode+ 
> \doublespecificationoptioncode\relax
>      \plusfivethousand    \plusseventyfivehundred
>      \plustwohundredfifty \plusfivehundred
>      \zerocount           \zerocount
> \relax
> 
> \permanent \specificationdef \lessclubpenalties \clubpenalties
>      \plusthree options \numexpr\largestspecificationoptioncode+ 
> \doublespecificationoptioncode\relax
>      \plusfivethousand    \plusseventyfivehundred
>      \plustwohundredfifty \plusfivehundred
>      \zerocount           \zerocount
> \relax
> 
> used in upcoming new \setupalign options lesswidows and lessclubs 
> because the above is not something that users should nother about.
> 
> These set high penalties for the first and last line, somewhat lower for 
> the ones following and preceding.
> 
> We also have strictwidows and strictclubs that do your three thing.

Ok, I’m looking forward to it.

> In case you wonder about the 'double' ... we can have different values 
> for left and right pages because (we think that) on a spread a widow or 
> club is less of a problem.
> 
> Fwiw, much of this of this already has been there for a while (as 
> discussed at the meeting) but we're now integrating it into \setupalign 
> and making sure that the overhead can be neglected.

Great!

>> I already do without grid, VZ works, HZ also should (I didn’t check 
>> with a tracker, and it’s not so extreme that I’d see it), but it’s not 
>> enough to automatically avoid single lines.
> 
> Indeed, so the stricter penalties combine well with vz
> 
>> If a paragraph starts at page breaks, I can tweak the layout like
>> \page\setuplayout[narrow]. I defined narrow, normal, and wide versions 
>> with 1 mm difference. Before I didn’t know you can call named layouts 
>> like this, also relative page numbers like \definelayout[+1][wide] are 
>> nice.
>>
>> If that’s not enough, I’m using \letterspacing with tiny ± values.
>>
>> So much about dirty tricks. ;)
> 
> parpasses will permit you to have steps with different solutions so 
> expansion can be delayed till it is really needed; interesting is that 
> even with (say 8) par passes, most time the solution is found in the 
> first (no hyphenation with 100 tolerance) or second pass (hyphenation 
> with 200 tolerance) and the number last pass can be counted on one hand

Yes, you demonstrated several times. I just didn’t dare or was too lazy 
to delve into the “plain TeX” syntax to try.

> (there are options to mark pararaphs and see what pass succeeded as well 
> as overviews in the logs so that one can go to problematic places but 
> that's for Keith to experiment with)
> 
> We're really surprised how well this all works on complex content (say 
> very math intense, read: demanding wrt where to break).

If it also works with code examples, It’ll be great for the ConTeXt 
journal and my book.

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

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2024-10-01 19:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-30 16:22 [NTG-context] " Henning Hraban Ramm
2024-09-30 18:14 ` [NTG-context] " Hans Hagen
2024-09-30 20:45   ` Henning Hraban Ramm
2024-09-30 22:17     ` Hans Hagen
2024-10-01 19:16       ` Henning Hraban Ramm [this message]
2024-10-01 19:31         ` Hans Hagen

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=df4f99f6-3096-4454-af55-6978353e7c7a@fiee.net \
    --to=texml@fiee.net \
    --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).