Revert lever 3; record why the parfillskip lever cannot be tuned

A finite \parfillskip was tried at 0.75\textwidth (no effect) and then,
after deriving the threshold, at 0.15\textwidth (real effect, bad
trade). Badness is 100(G/X)^3 against tolerance 4000, so the threshold
is G ~ 3.4(X + 24pt): on a 430pt measure any X at or above
0.25\textwidth prescribes a threshold longer than the measure and can
never fire. The only values in range are 0.15 and 0.10, and 0.10 bites
harder — so the lever is effectively binary.

At 0.15 it did what it promised and cost more than it bought:

  paragraph-final   mean 161.7 -> 142.7, p90 319 -> 267, max 398 -> 341
  paragraph-internal median 22.8 -> 35.7pt, >3em short 29.4% -> 48.0%
  underfull boxes   123 -> 1902

There are far more interior lines than final ones. Back to ragged2e's
default, with the derivation kept in the preamble so this is not
rediscovered by experiment a third time.

Net of all five levers: 5 fixed a real conflict, 2 and 4 are harmless
and near-inert here (the ragged right margin is never reached, and only
1.6% of lines begin with a protrudable character), 1 and 3 were
reverted as measurably harmful. Rag is within ~1% of where it started.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-14 23:06:37 +06:00
co-authored by Claude Opus 5
parent 4116c4eca6
commit 9776331de0
+10 -4
View File
@@ -42,10 +42,16 @@
% emptied the log of underfull-box warnings, which looked like a win and was only the
% goalposts moving. Do not raise it again without measuring (tools: work/rag.py).
\setlength{\RaggedRightRightskip}{0pt plus 2em}
% Lever 3: the default \parfillskip of 0pt plus 1fil accepts a last line of any length.
% A finite fill makes TeX score a very short last line as badness and rearrange to
% avoid one.
\setlength{\RaggedRightParfillskip}{0pt plus 0.75\textwidth}
% \parfillskip stays at ragged2e's default (0pt plus 1fil: a last line may be any
% length). A finite fill was tried twice on 2026-09-14 and is not worth it. Badness is
% 100(G/X)^3 for a gap G against stretch X and \tolerance=4000 accepts up to G ~ 3.4X,
% with \rightskip adding its own 24pt — so on this 430pt measure any X at or above
% 0.25\textwidth prescribes a threshold longer than the measure and can never fire
% (0.75\textwidth was tried first and changed nothing at all). The only values in range
% are 0.15 and 0.10\textwidth, and at 0.15 the cost lands on the interior lines: last
% lines improve (p90 gap 319 -> 267pt) but paragraph-internal median rag goes 22.8 ->
% 35.7pt, lines more than 3em short 29.4% -> 48.0%, and underfull boxes 123 -> 1902.
% There are far more interior lines than final ones. Measured with work/rag.py.
% The first line indents 1.6em; set here so \RaggedRight applies it rather than
% relying on the direct \parindent assignment further down to repair it afterwards.
\setlength{\RaggedRightParindent}{1.6em}