From: Mikael Sundqvist <mickep@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: [NTG-context] Re: penalties
Date: Thu, 10 Oct 2024 17:45:31 +0200 [thread overview]
Message-ID: <CAHy-LL93GYi70uffvXFFVRsbgj7XvOj6THrEXG1YMgmbUs=sag@mail.gmail.com> (raw)
In-Reply-To: <40876bf1-1d13-4af6-a3e6-969594cdaee1@fiee.net>
Hi,
On Thu, Oct 10, 2024 at 2:58 PM Henning Hraban Ramm <texml@fiee.net> wrote:
>
> Yesterday I learned:
>
> \startsetups[*default]
> \widowpenalties 3 10000 1000 0
> \clubpenalties 3 10000 1000 0
> \orphanpenalties 2 8000 1000
> \stopsetups
>
> If I want the penalty settings applied to “everything” (after defining
> the layout, I think?), then I need the setup "*defaults".
Yes, for now, since it got reset when \setuplayout was done. But we
are working on making it possible to also setup this with \setupalign,
with a few "reasonable" pre-defined setups. So, for example in my math
book I currently run
\setupalign[lesswidows,lessclubs,lessorphans,strictmath]
and that actually makes a few of these setups. It will of course be
possible to define your own set of penalties and use them instead.
>
> Since TeX uses a club against orphans (brutal!), I’m not sure what
> \orphanpenalty is for.
Wolfgang already explained this, but in short they are there to
discourage that a paragraph ends with only one word. We looked at it
yesterday at the meeting. You saw those penalties in action when you
did \showmakeup[hpenalty].
>
> I remember \twinpenalty is against doubled words (below each other?),
> and \toddlerpenalty against single letter words at the end of a line
> (why “toddler”?).
Indeed. Well, you can imagine a little toddler not really being able
to join the rest, or if you want, tied to the rest.
>
> widows and clubs get only 150 in TeX, but 2000 in ConTeXt, as far as I
> could find.
>
> Are there more penalties that make sense to set individually?
If you do math there might be more (set above by strictmath), but I
think you are fine with the ones above. Since you are finishing a
project, please tell if more problems show up. We can have another
chat where we try to solve...
>
> WRT demerits: Did I understand correctly that demerits are the “sum”
> (some formula) of badness and penalties in a line or paragraph?
A bit like that. For each possible breakpoint you get a badness value.
Then you can see it as if TeX runs over the paragraph once more, given
all possible breakpoints, with or without extra penalties, and builds
up a demerits for the different possible solutions. They can come from
badness, penalties and additional demerits (adjdemerits not to have
incompatible lines for example). Then, at the end, the best solution
(least demerits) is the one that will be used.
We are currently writing an article on the parbuilder, with and
without parpasses. You saw an early draft at the meeting yesterday.
/Mikael
___________________________________________________________________________________
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
___________________________________________________________________________________
next prev parent reply other threads:[~2024-10-10 15:50 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-10 12:54 [NTG-context] penalties Henning Hraban Ramm
2024-10-10 14:40 ` [NTG-context] penalties Wolfgang Schuster
2024-10-10 15:45 ` Mikael Sundqvist [this message]
2024-10-10 16:44 ` Henning Hraban Ramm
2024-10-31 18:26 [NTG-context] penalties Thomas Meyer
2024-10-31 20:33 ` [NTG-context] penalties Hans Hagen
2024-11-04 9:05 ` Thomas Meyer
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='CAHy-LL93GYi70uffvXFFVRsbgj7XvOj6THrEXG1YMgmbUs=sag@mail.gmail.com' \
--to=mickep@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).