diff options
Diffstat (limited to 'tex/context/base/supp-box.tex')
-rw-r--r-- | tex/context/base/supp-box.tex | 78 |
1 files changed, 57 insertions, 21 deletions
diff --git a/tex/context/base/supp-box.tex b/tex/context/base/supp-box.tex index 847e76167..1d305dded 100644 --- a/tex/context/base/supp-box.tex +++ b/tex/context/base/supp-box.tex @@ -260,7 +260,7 @@ \futurelet\nextph@nt\doph@nt} \def\makeph@nt#1#2#3% - {\begingroup + {\begingroup % why no \bgroup \dowithnextbox {\setbox\scratchbox\null \ht\scratchbox\ht#1\dp\scratchbox\dp#2\wd\scratchbox\wd#3% @@ -909,6 +909,8 @@ %D These macros are slow but effective and not that hard to %D program at all. +\ifx\scantokens\undefined \let\scantokens\firstofoneargument \fi + \def\dohyphenateword#1#2#3% {\bgroup \setbox\scratchbox\normalhbox @@ -917,13 +919,15 @@ \hyphenpenalty \zerocount \exhyphenpenalty\zerocount \setbox0\normalvbox - {\hsize\zeropoint \space + {\hsize\zeropoint + \hskip\zeropoint % really needed \ifnum#1=\minusone \obeyspaces \obeylines \def\obeyedspace{\hskip\zeropoint\hbox to \onepoint{}\hskip\zeropoint}% \let\obeyedline \obeyedspace - \def\next{#3}\scantokens{\next}% + \def\next{#3}\scantokens\expandafter{\next}% + % also ok: \scantokens{#3}% \else #3% \fi}% @@ -1564,6 +1568,7 @@ \newif\ifalignrigidcolumns \newif\ifstretchrigidcolumns +\newif\iftightrigidcolumns % if true: just a vbox, no depth/noflines/gridsnap corrrections %D De eerste switch bepaald het uitlijnen, de tweede rekt de %D individuele kolommen op naar \type{\vsize}. @@ -1605,23 +1610,28 @@ \setbox\scratchbox\normalhbox to \savedrigidhsize {\dorecurse\rigidcolumns {\setbox\scratchbox\vsplit\rigidcolumnbox to \scratchdimen - \dp\scratchbox\openstrutdepth + \dp\scratchbox\openstrutdepth \setbox\scratchbox\normalvtop - \ifalignrigidcolumns to - \ifstretchrigidcolumns\vsize\else\scratchdimen\fi - \fi + \ifalignrigidcolumns to + \ifstretchrigidcolumns\vsize\else\scratchdimen\fi + \fi {\unvbox\scratchbox}% \wd\scratchbox\hsize \box\scratchbox \hfill}% \hfillneg}% - \advance\scratchdimen -\openstrutdepth - \setbox\scratchbox\normalhbox{\raise\scratchdimen\box\scratchbox}% - \dp\scratchbox\openstrutdepth - \ht\scratchbox\scratchdimen + \iftightrigidcolumns + \setbox\scratchbox\normalhbox{\raise\dp\scratchbox\box\scratchbox}% + \else + \advance\scratchdimen -\openstrutdepth + \setbox\scratchbox\normalhbox{\raise\scratchdimen\box\scratchbox}% + \dp\scratchbox\openstrutdepth + \ht\scratchbox\scratchdimen + \fi \box\scratchbox}% \fi} + %D \macros %D {startvboxtohbox,stopvboxtohbox,convertvboxtohbox} %D @@ -2023,14 +2033,16 @@ %D middle and right. These box types can be used to typeset %D paragraphs. -\def\lbox{\lrcbox\raggedleft} -\def\cbox{\lrcbox\raggedcenter} -\def\rbox{\lrcbox\raggedright} +\def\lbox{\makelrcbox\normalvbox\raggedleft} +\def\cbox{\makelrcbox\normalvbox\raggedcenter} +\def\rbox{\makelrcbox\normalvbox\raggedright} + +\def\ltop{\makelrcbox\normalvtop\raggedleft} +\def\ctop{\makelrcbox\normalvtop\raggedcenter} +\def\rtop{\makelrcbox\normalvtop\raggedright} -\def\lrcbox#1#2#% - {\normalvbox#2\bgroup - \let\\=\endgraf - \forgetall#1\let\next=} +\def\makelrcbox#1#2#3#% + {#1#3\bgroup \forgetall \let\\=\endgraf #2\let\next=} %D The alternatives \type {\tbox} and \type {\bbox} can be used %D to properly align boxes, like in: @@ -2309,6 +2321,29 @@ \def\middlebox#1% {\normalhbox{\setbox0\placedbox{#1}\boxoffset=-.5\wd0\rightbox{\box0}}} + +\def\baselinemiddlebox#1% + {\normalhbox + {\setbox0\placedbox{#1}% + \global\boxhdisplacement-.5\wd0 + \global\advance\boxhdisplacement-\boxoffset + \global\boxvdisplacement-\boxoffset + \boxcursor\hskip\boxhdisplacement\raise-\boxvdisplacement\box0}} + +\def\baselineleftbox#1% + {\normalhbox + {\setbox0\placedbox{#1}% + \global\boxhdisplacement-\wd0 + \global\advance\boxhdisplacement-\boxoffset + \global\boxvdisplacement-\boxoffset + \boxcursor\hskip\boxhdisplacement\raise-\boxvdisplacement\box0}} + +\def\baselinerightbox#1% + {\normalhbox + {\setbox0\placedbox{#1}% + \global\boxhdisplacement\boxoffset + \global\boxvdisplacement-\boxoffset + \boxcursor\hskip\boxhdisplacement\raise-\boxvdisplacement\box0}} %D \macros %D {toplinebox} @@ -2640,9 +2675,10 @@ %D And even rawer: -\let\naturalhbox \normalhbox -\let\naturalvbox \normalvbox -%let\naturalvtop \normalvtop +\let\naturalhbox \normalhbox +\let\naturalvbox \normalvbox +\let\naturalvtop \normalvtop +\let\naturalvcenter \normalvtop \beginOMEGA dir |