From debb4feb8ae38805ed81932e37c58285cb6dcc1c Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Wed, 23 Sep 2009 10:07:00 +0200 Subject: beta 2009.09.23 10:07 --- tex/context/base/page-sid.mkiv | 95 +++++++++++++----------------------------- 1 file changed, 29 insertions(+), 66 deletions(-) (limited to 'tex/context/base/page-sid.mkiv') diff --git a/tex/context/base/page-sid.mkiv b/tex/context/base/page-sid.mkiv index 26cc9c026..c30204a4e 100644 --- a/tex/context/base/page-sid.mkiv +++ b/tex/context/base/page-sid.mkiv @@ -150,39 +150,6 @@ \fi \fi} -% \def\setsidefloatskips -% {\global\sidefloatrightskip\zeropoint -% \global\sidefloatleftskip \zeropoint -% \ifcase\sidefloattype -% \or % backspace -% \global \sidefloatleftskip \rightorleftpageaction \backspace \cutspace -% \or % leftedge -% \global \sidefloatleftskip \rightorleftpageaction \leftmargindistance\rightmargindistance -% \global\advance\sidefloatleftskip \rightorleftpageaction \leftmarginwidth\rightmarginwidth -% \global\advance\sidefloatleftskip \rightorleftpageaction \leftedgedistance\rightedgedistance -% \or % leftmargin -% \global \sidefloatleftskip \rightorleftpageaction \leftmargindistance\rightmargindistance -% \or % leftside -% \or % rightside -% \or % rightmargin -% \global \sidefloatrightskip\rightorleftpageaction \rightmargindistance\leftmargindistance -% \or % rightedge -% \global \sidefloatrightskip\rightorleftpageaction \rightmargindistance\leftmargindistance -% \global\advance\sidefloatrightskip\rightorleftpageaction \rightmarginwidth\leftmarginwidth -% \global\advance\sidefloatrightskip\rightorleftpageaction \rightedgedistance\leftedgedistance -% \or % cutspace -% \global \sidefloatrightskip\rightorleftpageaction \cutspace\backspace -% \fi -% \ifdim\sidefloatrightskip>\zeropoint -% \doglobal\advance\sidefloatrightskip\rightskip -% \fi -% \ifdim\sidefloatleftskip>\zeropoint -% \doglobal\advance\sidefloatleftskip\leftskip -% \fi} - - -% use \outermarginwidth etc here - \def\setsidefloatskips {\global\sidefloatrightskip\zeropoint \global\sidefloatleftskip \zeropoint @@ -467,6 +434,30 @@ % % keep this ^ +\def\repositionsidefloat#1% + {\global\setbox\floatbox\hbox % no \hskip, but \kern here + {\ifnum\sidefloattype=\plusfour + \hskip\sidefloatleftshift + \else\ifnum\sidefloattype=\plusone + \hskip\sidefloatleftshift + \fi\fi + \ifnum\sidefloattype>\plusfour + \hskip-\sidefloatextrashift + \else + \hskip\sidefloatshift + \fi + \vbox{#1\ifnum\sidefloatalign=\plusfour \removedepth\fi}% + \ifnum\sidefloattype>\plusfour + \kern\sidefloatshift + \else + \kern-\sidefloatextrashift + \fi + \ifnum\sidefloattype=8 + \kern\sidefloatrightshift + \else\ifnum\sidefloattype=\plusfive + \kern\sidefloatrightshift + \fi\fi}} + \def\putsidefloat#1% grid (4) is rather experimental {\par \whitespace @@ -490,28 +481,7 @@ \fi \previoussidefloat \stallsidefloat - \global\setbox\floatbox\hbox % no \hskip, but \kern here - {\ifnum\sidefloattype=\plusfour - \hskip\sidefloatleftshift - \else\ifnum\sidefloattype=\plusone - \hskip\sidefloatleftshift - \fi\fi - \ifnum\sidefloattype>\plusfour - \hskip-\sidefloatextrashift - \else - \hskip\sidefloatshift - \fi - \vbox{#1\ifnum\sidefloatalign=\plusfour \removedepth\fi}% - \ifnum\sidefloattype>\plusfour - \kern\sidefloatshift - \else - \kern-\sidefloatextrashift - \fi - \ifnum\sidefloattype=8 - \kern\sidefloatrightshift - \else\ifnum\sidefloattype=\plusfive - \kern\sidefloatrightshift - \fi\fi}% + \repositionsidefloat{#1}% \ifnum\sidefloatalign=\plusfour \getnoflines{\ht\floatbox}% \scratchdimen\noflines\lineheight @@ -576,17 +546,6 @@ \fi \setsidefloat} -% \def\progresssidefloat -% {\sidefloatprogress\sidefloatvsize -% \iffloatflag -% \advance\sidefloatprogress -\sidefloatpagetotal -% \global\floatflagfalse -% \else -% \advance\sidefloatprogress -\pagetotal -% \fi} -% -% more compact: - \def\progresssidefloat {\sidefloatprogress\sidefloatvsize \advance\sidefloatprogress-\iffloatflag\sidefloatpagetotal\global\floatflagfalse\else\pagetotal\fi} @@ -676,6 +635,10 @@ \fi \egroup \par +\ifgridsnapping + \getrawnoflines\sidefloatheight + \sidefloatheight=\noflines\lineheight +\fi \kern-\sidefloatheight \penalty10001 % oeps, this will change \normalbaselines -- cgit v1.2.3