%D \module %D [ file=spac-pas, %D version=2023.06.10, %D title=\CONTEXT\ Spacing Macros, %D subtitle=Passes, %D author=Hans Hagen & Mikael Sundqvist, %D date=\currentdate, %D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}] %C %C This module is part of the \CONTEXT\ macro||package and is %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. \writestatus{loading}{ConTeXt Spacing Macros / Passes} \registerctxluafile{spac-pas}{autosuffix} %D Here we set up some nano typography features. We have moved the penalties %D that deal with par building here. We also separated them from the page %D builder related ones. \unprotect % \resetpenalties\orphanpenalties %integerdef\unknownparpassclass "000 \integerdef\verylooseparpassclass "001 \integerdef\looseparpassclass "002 \integerdef\almostlooseparpassclass "004 \integerdef\barelylooseparpassclass "008 \integerdef\decentparpassclass "010 \integerdef\barelytightparpassclass "020 \integerdef\almosttightparpassclass "040 \integerdef\tightparpassclass "080 \integerdef\verytightparpassclass "100 % \fitnessdemerits \numexpr \verylooseparpassclass + \almostlooseparpassclass \relax % 5 default % \integerdef\indecentparpassclasses\numexpr % \verylooseparpassclass % + \looseparpassclass % + \almostlooseparpassclass % + \barelylooseparpassclass % % \decentparpassclass % + \barelytightparpassclass % + \almosttightparpassclass % + \tightparpassclass % + \verytightparpassclass % \relax \integerdef\allparpassclasses "FFFF \integerdef\indecentparpassclasses\numexpr \allparpassclasses - \decentparpassclass \relax \integerdef\almostdecentparpassclasses\numexpr \verylooseparpassclass + \looseparpassclass + \almostlooseparpassclass % \decentparpassclass + \almosttightparpassclass + \tightparpassclass + \verytightparpassclass \relax \integerdef\looseparpassclasses\numexpr \verylooseparpassclass + \looseparpassclass % \decentparpassclass + \almostlooseparpassclass + \barelylooseparpassclass \relax \integerdef\tightparpassclasses\numexpr \verytightparpassclass + \tightparpassclass % \decentparpassclass + \almosttightparpassclass + \barelytightparpassclass \relax \appendtoks \ifcase\linebreakpasses\else \linebreakpasses\zerocount % maybe always: \pretolerance \plushundred \tolerance \plustwohundred \fi \to \everyforgetall \startsetups align:pass:none \pretolerance \plushundred \tolerance \plustwohundred \parpasses \zerocount \linebreakpasses\zerocount % \lettonothing\currentalignpass \stopsetups % see spac-pas-imp-tests.mkxl \lettonothing\currentalignpass \permanent\protected\def\setupalignpass[#1]% {\cdef\tempstring{align:pass:#1}% \ifx\tempstring\currentalignpass\else \linebreakpasses\plusone % none will reset this \let\currentalignpass\tempstring \fastsetup\currentalignpass \relax % to be sure \fi} \appendtoks \ifcase\linebreakpasses\else \fastsetup\currentalignpass \fi \to \everybodyfont %D This sort of belongs here: \permanent\protected\def\optionalword#1% {\removeunwantedspaces\wordboundary\discretionary{}{}{#1}} %D \starttyping %D \dostepwiserecurse{80}{100}{1}{\hsize #1mm %D Many readers will skim over formulas on their first reading %D of your exposition. Therefore, your sentences should flow %D smoothly when all but the simplest formulas are replaced by %D \quotation {blah} or some other \optionalword {grunting }noise. %D \page %D } %D \stoptyping % Musical timestamp: Archive's Call to Arms & Angels (and Super8) in loop mode % (June 2023, weirdly I had missed those releases in 2022). % \dorecurse{41}{line #1\par} % here \singlelinepenalty20000 \updateparagraphpenalties here here %D Todo: % \specificationdef \parpassonemoreline \parpasses 3 % looseness 1 % tolerance 100 % next % tolerance 200 % hyphenation 1 % next % demerits 1 % emergencystretch 4em % % \specificationdef \parpasstwomorelines \parpasses 3 % looseness 2 % tolerance 100 % next % tolerance 200 % hyphenation 1 % next % demerits 1 % emergencystretch 8em % % \permanent\protected\def\onemoreline {\parpassesexception\parpassonemoreline } % \permanent\protected\def\twomorelines{\parpassesexception\parpasstwomorelines} \protect