diff options
Diffstat (limited to 'tex/context/base/anch-pgr.mkiv')
-rw-r--r-- | tex/context/base/anch-pgr.mkiv | 366 |
1 files changed, 174 insertions, 192 deletions
diff --git a/tex/context/base/anch-pgr.mkiv b/tex/context/base/anch-pgr.mkiv index 957fd25af..7c3ffdf43 100644 --- a/tex/context/base/anch-pgr.mkiv +++ b/tex/context/base/anch-pgr.mkiv @@ -147,11 +147,6 @@ \def\MPanchoridentifier{mpa} % {mp-anchor} \def\MPoverlayposprefix{MO::} -% obsolete and wrong anyway -% -% \long\unexpanded\def\defineMPpositiongraphic#1% -% {\long\setvalue{\MPoverlayposprefix#1}} - %D The rest of the definitions concerning such overlays may %D look complicated, @@ -217,16 +212,6 @@ \fi \fi} -% \def\cleanuppositionaction#1% not in trialtypesetting -% {\ifcsname\POSactionprefix#1++\endcsname -% \the\everycleanpositionaction -% \iflocalpositioning -% \global\expandafter\let\csname\POSactionprefix#1++\endcsname\empty -% \else -% \global\expandafter\let\csname\POSactionprefix#1++\expandafter\endcsname\csname\POSactionprefix#1++\endcsname -% \fi -% \fi} - \def\handlepositionaction#1\with#2\on#3% {\bgroup \ifx\currentpositionoverlay\empty @@ -1076,185 +1061,187 @@ \def\stackposleft {\dostackposbox{\copy\nextbox\hskip\nextboxwd\hskip\stackposdistance}} \def\stackposright{\dostackposbox{\hskip\stackposdistance\hskip\nextboxwd\flushnextbox}} -%D \macros -%D {stackeddown} -%D -%D However, a better implementation is possible with the -%D following macro. We now have an extra key \type {stack} for -%D margin settings. When set to \type {yes}, this macro comes -%D into action. - -% Because there can be many stacked items in a line and successive lines, we -% play dirty and adapt the position and height of the current node so that -% this becomes visible to a next pass. +% obsolete % -% \startbuffer -% \inleft {test 1} test 1 \inleft {test 2} test 2 \endgraf -% \inleft {test 3} test 3 -% \stopbuffer -% \getbuffer \typebuffer \flushstatus \page +% %D \macros +% %D {stackeddown} +% %D +% %D However, a better implementation is possible with the +% %D following macro. We now have an extra key \type {stack} for +% %D margin settings. When set to \type {yes}, this macro comes +% %D into action. % -% \startbuffer -% \inleft {test 1} test 1 \inleft {test 2} test 2 \inleft {test 3} test 3 \endgraf -% \inleft {test 4} test 4 -% \stopbuffer -% \getbuffer \typebuffer \flushstatus \page +% % Because there can be many stacked items in a line and successive lines, we +% % play dirty and adapt the position and height of the current node so that +% % this becomes visible to a next pass. +% % +% % \startbuffer +% % \inleft {test 1} test 1 \inleft {test 2} test 2 \endgraf +% % \inleft {test 3} test 3 +% % \stopbuffer +% % \getbuffer \typebuffer \flushstatus \page +% % +% % \startbuffer +% % \inleft {test 1} test 1 \inleft {test 2} test 2 \inleft {test 3} test 3 \endgraf +% % \inleft {test 4} test 4 +% % \stopbuffer +% % \getbuffer \typebuffer \flushstatus \page +% % +% % \startbuffer +% % \inleft {test 1} test 1 \endgraf +% % \inleft {test 2} test 2 \endgraf +% % \inleft {test 3} test 3 +% % \stopbuffer +% % \getbuffer \typebuffer \flushstatus \page +% % +% % \startbuffer +% % \inleft {test 1\\test 1} test 1 \inleft {test 2} test 2 \endgraf +% % \inleft {test 3} test 3 +% % \stopbuffer +% % \getbuffer \typebuffer \flushstatus \page +% % +% % \startbuffer +% % \inleft {test 1\\test 1\\test 1\\test 1\\test 1} test 1 \endgraf +% % test 2 \endgraf +% % \inleft {test 3} test 3 +% % \stopbuffer +% % \getbuffer \typebuffer \flushstatus \page +% % +% % \startbuffer +% % \inleft{test 1} test \inleft{test 2} test \inleft{test 3\\test 3} test +% % \stopbuffer +% % \getbuffer \typebuffer \flushstatus \page +% % +% % \startbuffer +% % \inleft{test 1\\test 1\\test 1} test \inleft{test 2\\test 2} test \inleft{test 3\\test 3\\test 3} test \endgraf +% % \inleft{test 1\\test 1\\test 1} test \inleft{test 2\\test 2} test \inleft{test 3\\test 3\\test 3} test +% % \stopbuffer +% % \getbuffer \typebuffer \flushstatus \page % -% \startbuffer -% \inleft {test 1} test 1 \endgraf -% \inleft {test 2} test 2 \endgraf -% \inleft {test 3} test 3 -% \stopbuffer -% \getbuffer \typebuffer \flushstatus \page +% \newdimen\laststackvmove % use \scratchdimenone instead of skip % -% \startbuffer -% \inleft {test 1\\test 1} test 1 \inleft {test 2} test 2 \endgraf -% \inleft {test 3} test 3 -% \stopbuffer -% \getbuffer \typebuffer \flushstatus \page +% \def\stackeddown +% {\bgroup +% % this macro assumes a few things and is meant to work for margin notes +% \dowithnextbox +% {\global\advance\currentautopos\plusone +% \global\laststackvmove\zeropoint +% \hpos{\POSstackprefix\number\currentautopos} +% {\edef\next +% {\nextboxht\the\nextboxht +% \nextboxdp\the\nextboxdp +% \nextboxwd\the\nextboxwd}% +% \previousautopos\currentautopos +% \scratchdimen\zeropoint +% \scratchcounter\zerocount +% \doloop +% {\advance\previousautopos\minusone +% \edef\currentposition {\POSstackprefix\number\currentautopos}% +% \edef\previousposition{\POSstackprefix\number\previousautopos}% +% \ifnum\MPp\currentposition=\MPp\previousposition\relax +% %\registerstatus{doing \number\currentautopos/\number\previousautopos}% +% \doifoverlappingelse\currentposition\previousposition +% {\scratchskip\dimexpr +% \MPy\currentposition +% -\MPy\previousposition +% -\MPd\currentposition % untested +% +\MPd\previousposition % untested +% +\MPh\currentposition +% \relax\relax % second relax realy needed, forgotten while dimexpressing +% % todo: also take depth into account +% \ifdim\scratchskip<\scratchdimen +% %\registerstatus{no \the\scratchskip}% +% \else +% %\registerstatus{yes \the\scratchskip}% +% \scratchdimen\scratchskip +% \fi}% +% \donothing % {\registerstatus{next}}% +% \ifnum\previousautopos<\zerocount\exitloop\fi +% \else +% \exitloop +% \fi}% +% \ifdim\scratchdimen=\zeropoint \else +% \bgroup +% \edef\currentposition{\POSstackprefix\number\currentautopos}% +% \scratchskip\scratchdimen +% \advance\scratchskip\MPh\currentposition +% \scratchdimen-\scratchdimen +% \advance\scratchdimen\MPy\currentposition +% %\registerstatus{old \number\currentautopos: \MPy\currentposition/\MPh\currentposition}% +% \expanded{\replacepospxywhd +% {\currentposition}{\MPp\currentposition}{\MPx\currentposition}{\the\scratchdimen}% +% {\MPw\currentposition}{\the\scratchskip}{\MPd\currentposition}}% +% %\registerstatus{new \number\currentautopos: \MPy\currentposition/\MPh\currentposition}% +% \egroup +% \global\laststackvmove\scratchdimen % new +% \setbox\nextbox\iftracepositions\@EA\ruledhbox\else\@EA\hbox\fi +% {\lower\scratchdimen\flushnextbox}% +% \next +% %\registerstatus{\strut}% +% \fi +% \flushnextbox}% +% \egroup}} % -% \startbuffer -% \inleft {test 1\\test 1\\test 1\\test 1\\test 1} test 1 \endgraf -% test 2 \endgraf -% \inleft {test 3} test 3 -% \stopbuffer -% \getbuffer \typebuffer \flushstatus \page +% %D The next hack make sure that margin texts near faulty +% %D strutted lines are handled ok. % -% \startbuffer -% \inleft{test 1} test \inleft{test 2} test \inleft{test 3\\test 3} test -% \stopbuffer -% \getbuffer \typebuffer \flushstatus \page +% \newif\ifrepositionmarginbox \repositionmarginboxtrue % -% \startbuffer -% \inleft{test 1\\test 1\\test 1} test \inleft{test 2\\test 2} test \inleft{test 3\\test 3\\test 3} test \endgraf -% \inleft{test 1\\test 1\\test 1} test \inleft{test 2\\test 2} test \inleft{test 3\\test 3\\test 3} test -% \stopbuffer -% \getbuffer \typebuffer \flushstatus \page - -\newdimen\laststackvmove % use \scratchdimenone instead of skip - -\def\stackeddown - {\bgroup - % this macro assumes a few things and is meant to work for margin notes - \dowithnextbox - {\global\advance\currentautopos\plusone - \global\laststackvmove\zeropoint - \hpos{\POSstackprefix\number\currentautopos} - {\edef\next - {\nextboxht\the\nextboxht - \nextboxdp\the\nextboxdp - \nextboxwd\the\nextboxwd}% - \previousautopos\currentautopos - \scratchdimen\zeropoint - \scratchcounter\zerocount - \doloop - {\advance\previousautopos\minusone - \edef\currentposition {\POSstackprefix\number\currentautopos}% - \edef\previousposition{\POSstackprefix\number\previousautopos}% - \ifnum\MPp\currentposition=\MPp\previousposition\relax - %\registerstatus{doing \number\currentautopos/\number\previousautopos}% - \doifoverlappingelse\currentposition\previousposition - {\scratchskip\dimexpr - \MPy\currentposition - -\MPy\previousposition - -\MPd\currentposition % untested - +\MPd\previousposition % untested - +\MPh\currentposition - \relax\relax % second relax realy needed, forgotten while dimexpressing - % todo: also take depth into account - \ifdim\scratchskip<\scratchdimen - %\registerstatus{no \the\scratchskip}% - \else - %\registerstatus{yes \the\scratchskip}% - \scratchdimen\scratchskip - \fi}% - \donothing % {\registerstatus{next}}% - \ifnum\previousautopos<\zerocount\exitloop\fi - \else - \exitloop - \fi}% - \ifdim\scratchdimen=\zeropoint \else - \bgroup - \edef\currentposition{\POSstackprefix\number\currentautopos}% - \scratchskip\scratchdimen - \advance\scratchskip\MPh\currentposition - \scratchdimen-\scratchdimen - \advance\scratchdimen\MPy\currentposition - %\registerstatus{old \number\currentautopos: \MPy\currentposition/\MPh\currentposition}% - \expanded{\replacepospxywhd - {\currentposition}{\MPp\currentposition}{\MPx\currentposition}{\the\scratchdimen}% - {\MPw\currentposition}{\the\scratchskip}{\MPd\currentposition}}% - %\registerstatus{new \number\currentautopos: \MPy\currentposition/\MPh\currentposition}% - \egroup - \global\laststackvmove\scratchdimen % new - \setbox\nextbox\iftracepositions\@EA\ruledhbox\else\@EA\hbox\fi - {\lower\scratchdimen\flushnextbox}% - \next - %\registerstatus{\strut}% - \fi - \flushnextbox}% - \egroup}} - -%D The next hack make sure that margin texts near faulty -%D strutted lines are handled ok. - -\newif\ifrepositionmarginbox \repositionmarginboxtrue - -\newcount\currentmarginpos - -\def\dopositionmarginbox#1% - {\bgroup - \ifrepositionmarginbox - \global\advance\currentmarginpos\plusone - %\setposition{\s!margin:\number\currentmarginpos}% not always - \ifcase\marginrepositionmethod - % nothing - \or - % nothing - \or - % stack / page check yet untested - \setposition{\s!margin:\number\currentmarginpos}% - \scratchdimen\MPy{\s!margin:\number\currentmarginpos}% - \global\advance\currentmarginpos\plusone - \advance\scratchdimen -\MPy{\s!margin:\number\currentmarginpos}% - \advance\scratchdimen -\strutdp - % new but bugged - % \setbox#1\hbox - % {\hskip-\MPx{\s!margin:\number\currentmarginpos}% - % \hskip\MPx{head:\the\realpageno}% - % \box#1}% - % so far - \setbox#1\hbox - {\setposition{\s!margin:\number\currentmarginpos}% - \raise\scratchdimen\box#1}% - \or - % move up - \setposition{\s!margin:\number\currentmarginpos}% - \ifnum\MPp{p:\number\parposcounter}=\MPp{\s!margin:\number\currentmarginpos}\relax - \scratchdimen\dimexpr\MPy{p:\number\parposcounter}-\MPy{\s!margin:\number\currentmarginpos}\relax - \expanded{\setbox#1\hbox{\raise\scratchdimen\box#1}\ht#1\the\ht#1\dp#1\the\dp#1}% - \fi - \or - % move up, assume end of par - \setposition{\s!margin:\number\currentmarginpos}% - \ifnum\MPp{p:\number\parposcounter}=\MPp{\s!margin:\number\currentmarginpos}\relax - \getnoflines\margincontentheight - \advance\noflines\minusone - \scratchdimen\noflines\lineheight - \else - \scratchdimen\dimexpr\MPy{p:\number\parposcounter}-\MPy{\s!margin:\number\currentmarginpos}\relax - \fi - \expanded{\setbox#1\hbox{\raise\scratchdimen\box#1}\ht#1\the\ht#1\dp#1\the\dp#1}% - \fi - \dp#1\zeropoint - \ht#1\zeropoint - \fi - \graphicvadjust{\dontleavehmode\box#1}% dontleavehmode is needed to get direction right - \egroup} - -% \setnewconstant\marginrepositionmethod\plusone % sidemethod -% \setnewconstant\margincontentmethod \plusthree % textmethod % beware: 1 = old method -% \setnewconstant\marginpagecheckmethod \plusone % splitmethod +% \newcount\currentmarginpos +% +% \def\dopositionmarginbox#1% +% {\bgroup +% \ifrepositionmarginbox +% \global\advance\currentmarginpos\plusone +% %\setposition{\s!margin:\number\currentmarginpos}% not always +% \ifcase\marginrepositionmethod +% % nothing +% \or +% % nothing +% \or +% % stack / page check yet untested +% \setposition{\s!margin:\number\currentmarginpos}% +% \scratchdimen\MPy{\s!margin:\number\currentmarginpos}% +% \global\advance\currentmarginpos\plusone +% \advance\scratchdimen -\MPy{\s!margin:\number\currentmarginpos}% +% \advance\scratchdimen -\strutdp +% % new but bugged +% % \setbox#1\hbox +% % {\hskip-\MPx{\s!margin:\number\currentmarginpos}% +% % \hskip\MPx{head:\the\realpageno}% +% % \box#1}% +% % so far +% \setbox#1\hbox +% {\setposition{\s!margin:\number\currentmarginpos}% +% \raise\scratchdimen\box#1}% +% \or +% % move up +% \setposition{\s!margin:\number\currentmarginpos}% +% \ifnum\MPp{p:\number\parposcounter}=\MPp{\s!margin:\number\currentmarginpos}\relax +% \scratchdimen\dimexpr\MPy{p:\number\parposcounter}-\MPy{\s!margin:\number\currentmarginpos}\relax +% \expanded{\setbox#1\hbox{\raise\scratchdimen\box#1}\ht#1\the\ht#1\dp#1\the\dp#1}% +% \fi +% \or +% % move up, assume end of par +% \setposition{\s!margin:\number\currentmarginpos}% +% \ifnum\MPp{p:\number\parposcounter}=\MPp{\s!margin:\number\currentmarginpos}\relax +% \getnoflines\margincontentheight +% \advance\noflines\minusone +% \scratchdimen\noflines\lineheight +% \else +% \scratchdimen\dimexpr\MPy{p:\number\parposcounter}-\MPy{\s!margin:\number\currentmarginpos}\relax +% \fi +% \expanded{\setbox#1\hbox{\raise\scratchdimen\box#1}\ht#1\the\ht#1\dp#1\the\dp#1}% +% \fi +% \dp#1\zeropoint +% \ht#1\zeropoint +% \fi +% \graphicvadjust{\dontleavehmode\box#1}% dontleavehmode is needed to get direction right +% \egroup} +% +% % \setnewconstant\marginrepositionmethod\plusone % sidemethod +% % \setnewconstant\margincontentmethod \plusthree % textmethod % beware: 1 = old method +% % \setnewconstant\marginpagecheckmethod \plusone % splitmethod %D For a right menu, a sequence of calls to \type %D {right_menu_button} is generated. @@ -1315,11 +1302,6 @@ \def\tbPOSprefix {tbp:\number\noftabpositions:} -% \def\tableposindeed -% {\scratchtoks\posXCtoks -% \global\posXCtoks\emptytoks -% \the\scratchtoks} - \def\tablepos {\normalexpanded{\global\posXCtoks\emptytoks\the\posXCtoks}} |