1%D \module 2%D [ file=typo-adj, 3%D version=2021.11.02, 4%D title=\CONTEXT\ Typesetting Macros, 5%D subtitle=Adjusters, 6%D author=Hans Hagen, 7%D date=\currentdate, 8%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}] 9%C 10%C This module is part of the \CONTEXT\ macro||package and is 11%C therefore copyrighted by \PRAGMA. See mreadme.pdf for 12%C details. 13 14% This is preliminary (mostly test) code ... for it to be useful we also need to 15% add some spacing options as well as penalty control. So far I never needed this 16% but who knows. 17 18\writestatus{loading}{ConTeXt Typesetting Macros / Adjusters} 19 20\registerctxluafile{typo-adj}{autosuffix} 21 22% \definesystemattribute[adjuster][public] 23 24% Musical timestamp: the announcement of the new Porcupine Tree album: Closure / 25% Continuation and the related upcoming tour. They're back! 26 27\unprotect 28 29%D \starttyping 30%D \start \showboxes 31%D \dorecurse{20}{test #1 } 32%D \insertlinebefore{BEFORE 1} 33%D \insertlineafter {AFTER 1} 34%D \dorecurse{20}{test #1 } 35%D \dorecurse{20}{test #1 } 36%D \insertlinebefore{BEFORE 2} 37%D \insertlineafter {AFTER 2} 38%D \dorecurse{20}{test #1 } 39%D \stop 40%D \stoptyping 41 42\def\typo_adjusters_line#1% no need for speed 43 {\begingroup 44 \dostarttagged\t!linetext{#1}% 45 \dowithnextbox 46 {\ht\nextbox\strutht 47 \dp\nextbox\strutdp 48 %\boxattribute\nextbox \adjusterattribute \plusone 49 \vadjust #1 index \plusone {\box\nextbox}% 50 \dostoptagged 51 \endgroup}% 52 \hbox} 53 54\tolerant\def\typo_adjusters_blank#1#*[#2]% no need for speed 55 {\begingroup 56 \dostarttagged\t!linetext{#1}% 57 \setbox\scratchbox\vbox{\blank[#2]}% 58 \vadjust #1 index \plustwo {\vskip\htdp\scratchbox}% 59 \dostoptagged 60 \endgroup} 61 62\permanent\protected\def\insertlinebefore{\typo_adjusters_line{pre}} 63\permanent\protected\def\insertlineafter {\typo_adjusters_line{post}} 64 65\permanent\protected\def\insertblankbefore{\typo_adjusters_blank{pre}} 66\permanent\protected\def\insertblankafter {\typo_adjusters_blank{post}} 67 68\protect \endinput 69 |