summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/core-pgr.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/context/base/core-pgr.tex')
-rw-r--r--Master/texmf-dist/tex/context/base/core-pgr.tex292
1 files changed, 129 insertions, 163 deletions
diff --git a/Master/texmf-dist/tex/context/base/core-pgr.tex b/Master/texmf-dist/tex/context/base/core-pgr.tex
index 22015fb3e03..658bd07d1a8 100644
--- a/Master/texmf-dist/tex/context/base/core-pgr.tex
+++ b/Master/texmf-dist/tex/context/base/core-pgr.tex
@@ -278,15 +278,17 @@
\prepareMPvariables{#2}%
\prepareMPpositionvariables
\enableincludeMPgraphics
- \ifcollectMPpositiongraphics
+ \ifcollectMPpositiongraphics % no longer needed in mkiv
\expanded{\startMPdrawing#3\noexpand\stopMPdrawing}%
\global\MPdrawingdonetrue
+ \else\ifx\startMPgraphic\undefined
+ \startMPcode#3\stopMPcode
\else
\startMPgraphic#3\stopMPgraphic
\loadMPgraphic{\MPgraphicfile.\the\currentMPgraphic}{}%
\deallocateMPslot\currentMPgraphic
\placeMPgraphic
- \fi
+ \fi\fi
\egroup}
% Now we need a adapted action handler:
@@ -498,6 +500,7 @@
gridtype=0,
linetype=1,
filltype=1,
+ dashtype=0, % 1 = dashed, 2 = dashed with background
%snaptops=true, % not that nice: true/false
gridcolor=red,
linecolor=blue,
@@ -505,7 +508,9 @@
filloffset=\!!zeropoint,
linewidth=\linewidth,
gridwidth=\linewidth,
- lineradius=.5\bodyfontsize]
+ gridshift=\!!zeropoint,
+ lineradius=.5\bodyfontsize,
+ dashtype=1]
\startuseMPgraphic{mpos:par:shape}
\iftracepositions show_par \else draw_par \fi ;
@@ -515,12 +520,14 @@
boxgridtype := \MPvar{gridtype} ;
boxlinetype := \MPvar{linetype} ;
boxfilltype := \MPvar{filltype} ;
+ boxdashtype := \MPvar{dashtype} ;
boxgridcolor := \MPvar{gridcolor} ;
boxlinecolor := \MPvar{linecolor} ;
boxfillcolor := \MPvar{fillcolor} ;
boxfilloffset := \MPvar{filloffset} ;
boxlinewidth := \MPvar{linewidth} ;
boxgridwidth := \MPvar{gridwidth} ;
+ boxgridshift := \MPvar{gridshift} ;
boxlineradius := \MPvar{lineradius} ;
%snap_multi_par_tops := \MPvar{snaptops} ;
\stopuseMPgraphic
@@ -545,7 +552,7 @@
\edef\MPparcounter{\MPv\MPbself{1}{0}}%
\doifpositionelse\MPwself
{\startMPpositiongraphic{mpos:par}%
- {fillcolor,filloffset,linecolor,gridcolor,linewidth,gridwidth,lineradius}
+ {fillcolor,filloffset,linecolor,gridcolor,linewidth,gridwidth,gridshift,lineradius}
initialize_area_par(\MPpos\MPbself,
\MPpos\MPeself,
\MPpos\MPwself) ;
@@ -555,7 +562,7 @@
anchor_par(\MPanchor\MPbself) ;
\stopMPpositiongraphic}
{\startMPpositiongraphic{mpos:par}%
- {fillcolor,filloffset,linecolor,gridcolor,linewidth,gridwidth,lineradius}
+ {fillcolor,filloffset,linecolor,gridcolor,linewidth,gridwidth,gridshift,lineradius}
initialize_par(\MPpos\MPbself,
\MPpos\MPeself,
\MPpos\textanchor,
@@ -577,6 +584,14 @@
\iftracepositions show_multi_pars \else draw_multi_pars \fi ;
\stopuseMPgraphic
+\startuseMPgraphic{mpos:par:sideline}{linecolor,lineoffset}
+ for i=1 upto nofmultipars :
+ fill leftboundary multipars[i]
+ shifted (-\MPvar{lineoffset},0)
+ rightenlarged 1mm withcolor \MPvar{linecolor} ;
+ endfor ;
+\stopuseMPgraphic
+
\startMPpositionmethod{mpos:par:columnset}
\edef\MPparcounter{\MPv\MPbself{1}{0}}%
\startMPpositiongraphic{mpos:par}%
@@ -596,7 +611,7 @@
%D \setupbackground
%D [test]
%D [mp=mpos:par:columnset,
-%D methodmethode=mpos:par:columnset]
+%D method=mpos:par:columnset]
%D \stoptyping
%D We need to treat floats in a special way.
@@ -615,10 +630,10 @@
%D So far for the trickery.
-\newcounter\textbackgrounddepth
+\newcount\textbackgrounddepth
\appendtoks
- \savecurrentvalue\totalnofparbackgrounds\nofparbackgrounds
+ \expanded{\savecurrentvalue\noexpand\totalnofparbackgrounds{\number\nofparbackgrounds}}%
\to \everybye
\appendtoks
@@ -626,7 +641,7 @@
\to \everystarttext
\ifx\totalnofparbackgrounds\undefined \newcounter\totalnofparbackgrounds \fi
-\ifx\nofparbackgrounds \undefined \newcounter\nofparbackgrounds \fi
+\ifx\nofparbackgrounds \undefined \newcount \nofparbackgrounds \fi
\def\initializeparbackgrounds
{\ifcase\totalnofparbackgrounds\else
@@ -636,7 +651,7 @@
\unexpanded\def\starttextbackground
{\bgroup
- \increment\textbackgrounddepth
+ \advance\textbackgrounddepth\plusone
\dodoubleempty\dostarttextbackground}
\let\dodostarttextbackground\relax
@@ -651,9 +666,11 @@
\def\nextbtbanchor{b:\nextparbackground}
\def\nextetbanchor{e:\nextparbackground}
-\def\backgroundvariable#1%
+\def\textbackgroundparameter#1%
{\csname\??td\currenttextbackground#1\endcsname}
+\let\backgroundvariable\textbackgroundparameter % will become obsolete
+
% \definetextbackground[more][state=start,backgroundcolor=red] % location=paragraph
% \definetextbackground[test][state=start,backgroundcolor=green]
%
@@ -680,27 +697,25 @@
\def\dostarttextbackground[#1][#2]%
{\checktextbackgrounds
\def\currenttextbackground{#1}%
- \doglobal\increment\nofparbackgrounds
- %\edef\currentparbackground{background:\nofparbackgrounds}%
- \edef\currentparbackground{pbg:\nofparbackgrounds}%
- \bgroup
- \increment\nofparbackgrounds
- %\xdef\nextparbackground{background:\nofparbackgrounds}%
- \xdef\nextparbackground{pbg:\nofparbackgrounds}%
- \egroup
+ \global\advance\nofparbackgrounds\plusone
+ \edef\currentparbackground{pbg:\number\nofparbackgrounds}%
+% \bgroup
+% \advance\nofparbackgrounds\plusone
+% \xdef\nextparbackground{pbg:\number\nofparbackgrounds}%
+% \egroup
+ \xdef\nextparbackground{pbg:\number\numexpr\nofparbackgrounds+\plusone\relax}% still xdef ?
% todo : \synchonizepositionpage{b:\currentparbackground}{s:\currentparbackground}%
\setuptextbackground[#1][#2]%
\let\dodostarttextbackground\relax
\let\dodostoptextbackground \relax
- \doifvalue{\??td#1\c!state}\v!start
- {\dopresettextbackground{#1}}%
+ \doif{\textbackgroundparameter\c!state}\v!start{\dopresettextbackground{#1}}%
\dodostarttextbackground}
% todo \backgroundvariable\c!variant
\def\dopresettextbackground#1% todo: \backgroundparameter
{\ExpandFirstAfter\processaction % \EFA niet echt nodig
- [\getvalue{\??td#1\c!location}]
+ [\textbackgroundparameter\c!location]
[ \v!text=>\let\dodostarttextbackground\dostarttextbackgroundtxt
\let\dodostoptextbackground \dostoptextbackgroundtxt,
\v!paragraph=>\let\dodostarttextbackground\dostarttextbackgroundpar
@@ -713,33 +728,36 @@
\let\dodostoptextbackground \dostoptextbackgroundtxt
\fi
\fi
- \doifelsevalue{\??td#1\c!frame}\v!on
- {\doifelsevalue{\??td#1\c!corner}\v!round
+ \doifelse{\textbackgroundparameter\c!frame}\v!on
+ {\doifelse{\textbackgroundparameter\c!corner}\v!round
{\setvalue{\??td#1\c!frame}{2}}
{\setvalue{\??td#1\c!frame}{1}}}
{\setvalue{\??td#1\c!frame}{0}}%
- \doifelsevalue{\??td#1\c!background}\v!color
+ \doifelse{\textbackgroundparameter\c!background}\v!color
{\setvalue{\??td#1\c!background}{1}}
{\setvalue{\??td#1\c!background}{0}}%
%\startpositionoverlay{\v!text\getvalue{\??td#1\c!level}}%
- \startpositionoverlay{\textbackgroundoverlay{\getvalue{\??td#1\c!level}}}%
+ \startpositionoverlay{\textbackgroundoverlay{\textbackgroundparameter\c!level}}%
\expanded
{\setMPpositiongraphicrange % moet veel efficienter
{\btbanchor}% {b:\currentparbackground}%
{\etbanchor}% {e:\currentparbackground}%
- {\getvalue{\??td#1\c!method}}%
+ {\textbackgroundparameter\c!method}%
{self=\currentparbackground,
- mp=\getvalue{\??td#1\c!mp},
- gridtype=\getvalue{\??td#1\c!alternative},
- filltype=\getvalue{\??td#1\c!background},
- linetype=\getvalue{\??td#1\c!frame},
- gridcolor=\getvalue{\??td#1\c!framecolor},
- linecolor=\getvalue{\??td#1\c!framecolor},
- fillcolor=\getvalue{\??td#1\c!backgroundcolor},
- filloffset=\getvalue{\??td#1\c!backgroundoffset},
- gridwidth=\getvalue{\??td#1\c!rulethickness},
- linewidth=\getvalue{\??td#1\c!rulethickness},
- lineradius=\getvalue{\??td#1\c!radius}}}%
+ mp=\textbackgroundparameter\c!mp,
+ gridtype=\textbackgroundparameter\c!alternative,
+ filltype=\textbackgroundparameter\c!background,
+ linetype=\textbackgroundparameter\c!frame,
+ dashtype=\textbackgroundparameter{dash}, % to be internationalized
+ gridcolor=\textbackgroundparameter\c!framecolor,
+ linecolor=\textbackgroundparameter\c!framecolor,
+ lineoffset=\textbackgroundparameter\c!frameoffset,
+ fillcolor=\textbackgroundparameter\c!backgroundcolor,
+ filloffset=\textbackgroundparameter\c!backgroundoffset,
+ gridwidth=\textbackgroundparameter\c!rulethickness,
+ gridshift=\textbackgroundparameter\c!voffset,
+ linewidth=\textbackgroundparameter\c!rulethickness,
+ lineradius=\textbackgroundparameter\c!radius}}%
\stoppositionoverlay}
\def\stoptextbackground
@@ -755,7 +773,7 @@
\dostopattributes}
\def\dostarttextbackgroundtxt
- {\ifvmode \leavevmode \fi
+ {\ifvmode \dontleavehmode \fi % was leavevmode, brrr
\dostartattributes{\??td\currenttextbackground}\c!style\c!color\empty
\fpos\currentparbackground\ignorespaces}
@@ -796,8 +814,8 @@
\def\dostarttextbackgroundpar
{\endgraf % new
- \getvalue{\??td\currenttextbackground\c!before}%
- \doassignsomeskip\getvalue{\??td\currenttextbackground\c!topoffset}\to\scratchskip
+ \textbackgroundparameter\c!before
+ \doassignsomeskip\textbackgroundparameter\c!topoffset\to\scratchskip
\xdef\textbackgroundskip{\the\scratchskip}%
\noindent
\ifgridsnapping
@@ -812,16 +830,16 @@
\bgroup
\endgraf % we need a vertical nobreak - 29/06/2004
\nobreak \vskip-\lineheight \nobreak
- \doassignsomeskip\getvalue{\??td\currenttextbackground\c!topoffset}\to\scratchskip
+ \doassignsomeskip\textbackgroundparameter\c!topoffset\to\scratchskip
\ifgridsnapping \else \ifdim\textbackgroundskip>\zeropoint
\kern\textbackgroundskip\nobreak
\fi \fi
- \dosetleftskipadaption{\getvalue{\??td\currenttextbackground\c!leftoffset}}%
+ \dosetleftskipadaption{\textbackgroundparameter\c!leftoffset}%
\advance\leftskip\leftskipadaption
- \dosetleftskipadaption{\getvalue{\??td\currenttextbackground\c!rightoffset}}%
+ \dosetleftskipadaption{\textbackgroundparameter\c!rightoffset}%
\advance\rightskip\leftskipadaption
% new
- \dosetraggedcommand{\getvalue{\??td\currenttextbackground\c!align}}%
+ \dosetraggedcommand{\textbackgroundparameter\c!align}%
\raggedcommand
%
\dostartattributes{\??td\currenttextbackground}\c!style\c!color\empty
@@ -835,7 +853,7 @@
{\par
\removelastskip % new
\dostopattributes
- \doassignsomeskip\getvalue{\??td\currenttextbackground\c!bottomoffset}\to\scratchskip
+ \doassignsomeskip\textbackgroundparameter\c!bottomoffset\to\scratchskip
\ifdim\lastskip>\zeropoint
\advance\scratchskip-\lastskip
\fi
@@ -859,7 +877,7 @@
\fi
\egroup
\endgraf % new
- \getvalue{\??td\currenttextbackground\c!after}}
+ \textbackgroundparameter\c!after}
\let\textparpages \!!zeropoint
\let\textparheight\!!zeropoint
@@ -941,8 +959,8 @@
\copyparameters[\??td#1][\??td]
[\c!state,\c!location,\c!alternative,\c!mp,\c!method,
\c!background,\c!backgroundcolor,\c!corner,\c!level,
- \c!backgroundoffset,\c!before,\c!after,\c!align,
- \c!radius,\c!frame,\c!framecolor,\c!rulethickness,
+ \c!backgroundoffset,\c!before,\c!after,\c!align,dash, % dash not yet internationalized
+ \c!radius,\c!frame,\c!framecolor,\c!rulethickness,\c!voffset,\c!frameoffset,
\c!leftoffset,\c!rightoffset,\c!topoffset,\c!bottomoffset]%
\getparameters[\??td#1][#2]%
\doifvalue{\??td#1\c!state}\v!start\checktextbackgrounds
@@ -983,17 +1001,19 @@
\c!state=\v!start,
\c!location=\v!text,
\c!leftoffset=\!!zeropoint, % 1em,
- \c!rightoffset=\getvalue{\??td\currenttextbackground\c!leftoffset},
+ \c!rightoffset=\textbackgroundparameter\c!leftoffset,
\c!topoffset=\!!zeropoint, % \v!medium,
- \c!bottomoffset=\getvalue{\??td\currenttextbackground\c!topoffset},
+ \c!bottomoffset=\textbackgroundparameter\c!topoffset,
\c!level=-1,
\c!alternative=0,
\c!align=,
+ dash=0, % to be internationalized
\c!background=\v!color,
\c!backgroundcolor=lightgray,
\c!backgroundoffset=\!!zeropoint,
\c!corner=\v!rectangular,
\c!radius=.5\bodyfontsize,
+ \c!voffset=\!!zeropoint,
\c!frame=\v!on,
\c!framecolor=blue,
\c!rulethickness=\linewidth]
@@ -1082,18 +1102,18 @@
\def\stackposdistance{.5em}
-\newcounter\currentautopos
+\newcount\currentautopos
+\newcount\previousautopos
\def\POSstackprefix{stack:}
\def\dostackposbox#1#2%
{\dowithnextbox
- {#2{\let\previousautopos\currentautopos
- \doglobal\increment\currentautopos
- \hpos{\POSstackprefix\currentautopos}
- {\doifoverlappingelse{\POSstackprefix\currentautopos}{\POSstackprefix\previousautopos}
- {#1}
- {\flushnextbox}}}}%
+ {#2{\previousautopos\currentautopos
+ \global\advance\currentautopos\plusone
+ \edef\currentposition {\POSstackprefix\number\currentautopos}%
+ \edef\previousposition{\POSstackprefix\number\previousautopos}%
+ \hpos\currentposition{\doifoverlappingelse\currentposition\previousposition{#1}{\flushnextbox}}}}%
\hbox}
\def\stackposup {\dostackposbox{\raise\lineheight\flushnextbox}}
@@ -1109,30 +1129,6 @@
%D margin settings. When set to \type {yes}, this macro comes
%D into action.
-% \def\stackeddown
-% {\dowithnextbox
-% {\doglobal\increment\currentautopos
-% \hpos{\POSstackprefix\currentautopos}
-% {\edef\next
-% {\nextboxht\the\nextboxht
-% \nextboxdp\the\nextboxdp
-% \nextboxwd\the\nextboxwd}%
-% \let\previousautopos\currentautopos
-% \scratchdimen\zeropoint
-% \doloop
-% {\decrement\previousautopos
-% \doifoverlappingelse{\POSstackprefix\currentautopos}{\POSstackprefix\previousautopos}
-% {\advance\scratchdimen\MPh{\POSstackprefix\previousautopos}%
-% \advance\scratchdimen\MPd{\POSstackprefix\previousautopos}}%
-% \exitloop
-% \ifnum\previousautopos<\zerocount\exitloop\fi}%
-% % \ifdim\scratchdimen>\zeropoint
-% \setbox\nextbox\iftracepositions\@EA\ruledhbox\else\@EA\hbox\fi
-% {\lower\scratchdimen\flushnextbox}%
-% \next
-% % \fi
-% \flushnextbox}}}
-
% 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.
@@ -1186,30 +1182,31 @@
{\bgroup
% this macro assumes a few things and is meant to work for margin notes
\dowithnextbox
- {\doglobal\increment\currentautopos
+ {\global\advance\currentautopos\plusone
\global\laststackvmove\zeropoint
- \hpos{\POSstackprefix\currentautopos}
+ \hpos{\POSstackprefix\number\currentautopos}
{\edef\next
{\nextboxht\the\nextboxht
\nextboxdp\the\nextboxdp
\nextboxwd\the\nextboxwd}%
- \let\previousautopos\currentautopos
+ \previousautopos\currentautopos
\scratchdimen\zeropoint
\scratchcounter\zerocount
\doloop
- {\decrement\previousautopos\relax
- \edef\currentposition {\POSstackprefix\currentautopos}%
- \edef\previousposition{\POSstackprefix\previousautopos}%
+ {\advance\previousautopos\minusone
+ \edef\currentposition {\POSstackprefix\number\currentautopos}%
+ \edef\previousposition{\POSstackprefix\number\previousautopos}%
\ifnum\MPp\currentposition=\MPp\previousposition\relax
- %\registerstatus{doing \currentautopos/\previousautopos}%
+ %\registerstatus{doing \number\currentautopos/\number\previousautopos}%
\doifoverlappingelse\currentposition\previousposition
- {\scratchskip \MPy\currentposition
- \advance\scratchskip-\MPy\previousposition
- \advance\scratchskip-\MPd\currentposition % untested
- \advance\scratchskip \MPd\previousposition % untested
- \advance\scratchskip \MPh\currentposition
- % todo: also take depth into account
+ {\scratchskip\dimexpr
+ \MPy\currentposition
+ -\MPy\previousposition
+ -\MPd\currentposition % untested
+ +\MPd\previousposition % untested
+ +\MPh\currentposition
\relax
+ % todo: also take depth into account
\ifdim\scratchskip<\scratchdimen
%\registerstatus{no \the\scratchskip}%
\else
@@ -1223,16 +1220,16 @@
\fi}%
\ifdim\scratchdimen=\zeropoint \else
\bgroup
- \edef\currentposition{\POSstackprefix\currentautopos}%
+ \edef\currentposition{\POSstackprefix\number\currentautopos}%
\scratchskip\scratchdimen
\advance\scratchskip\MPh\currentposition
\scratchdimen-\scratchdimen
\advance\scratchdimen\MPy\currentposition
- %\registerstatus{old \currentautopos: \MPy\currentposition/\MPh\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 \currentautopos: \MPy\currentposition/\MPh\currentposition}%
+ %\registerstatus{new \number\currentautopos: \MPy\currentposition/\MPh\currentposition}%
\egroup
\global\laststackvmove\scratchdimen % new
\setbox\nextbox\iftracepositions\@EA\ruledhbox\else\@EA\hbox\fi
@@ -1242,96 +1239,53 @@
\fi
\flushnextbox}%
\egroup}}
-
+
%D The next hack make sure that margin texts near faulty
%D strutted lines are handled ok.
\newif\ifrepositionmarginbox \repositionmarginboxtrue
-\newcounter\currentmarginpos
-
-% \def\dopositionmarginbox#1%
-% {\bgroup
-% \ifrepositionmarginbox
-% \doglobal\increment\currentmarginpos
-% \setposition{\s!margin:\currentmarginpos}%
-% \scratchdimen=\MPy{\s!margin:\currentmarginpos}%
-% \doglobal\increment\currentmarginpos
-% \advance\scratchdimen by -\MPy{\s!margin:\currentmarginpos}%
-% \advance\scratchdimen by -\strutdp
-% \setbox#1=\hbox
-% {\setposition{\s!margin:\currentmarginpos}\raise\scratchdimen\box#1}%
-% \dp#1=\!!zeropoint
-% \ht#1=\!!zeropoint
-% \fi
-% \vadjust{\box#1}%
-% \egroup}
-
-% \def\dopositionmarginbox#1% how about page boundaries !
-% {\bgroup
-% \ifrepositionmarginbox
-% \doglobal\increment\currentmarginpos
-% \setposition{\s!margin:\currentmarginpos}%
-% \scratchdimen\MPy{\s!margin:\currentmarginpos}%
-% \doglobal\increment\currentmarginpos
-% \advance\scratchdimen -\MPy{\s!margin:\currentmarginpos}%
-% \advance\scratchdimen -\strutdp
-% % new
-% \setbox#1\hbox
-% {\hskip-\MPx{\s!margin:\currentmarginpos}%
-% \hskip\MPx{head:\realfolio}%
-% \box#1}%
-% % so far
-% \setbox#1\hbox
-% {\setposition{\s!margin:\currentmarginpos}%
-% \raise\scratchdimen\box#1}%
-% \dp#1\zeropoint
-% \ht#1\zeropoint
-% \fi
-% \graphicvadjust{\box#1}%
-% \egroup}
+\newcount\currentmarginpos
\def\dopositionmarginbox#1%
{\bgroup
\ifrepositionmarginbox
- \doglobal\increment\currentmarginpos
- \setposition{\s!margin:\currentmarginpos}%
+ \global\advance\currentmarginpos\plusone
+ \setposition{\s!margin:\number\currentmarginpos}%
\ifcase\marginrepositionmethod
% nothing
\or
% nothing
\or
% stack / page check yet untested
-% \scratchcounter\MPp{\s!margin:\currentmarginpos}\relax
- \scratchdimen\MPy{\s!margin:\currentmarginpos}%
- \doglobal\increment\currentmarginpos
- \advance\scratchdimen -\MPy{\s!margin:\currentmarginpos}%
+ \scratchdimen\MPy{\s!margin:\number\currentmarginpos}%
+ \global\advance\currentmarginpos\plusone
+ \advance\scratchdimen -\MPy{\s!margin:\number\currentmarginpos}%
\advance\scratchdimen -\strutdp
-% \ifnum\scratchcounter=\MPp{\s!margin:\currentmarginpos}\relax
% new
- \setbox#1\hbox
- {\hskip-\MPx{\s!margin:\currentmarginpos}%
- \hskip\MPx{head:\realfolio}%
- \box#1}%
+% bugged
+% \setbox#1\hbox
+% {\hskip-\MPx{\s!margin:\number\currentmarginpos}%
+% \hskip\MPx{head:\realfolio}%
+% \box#1}%
% so far
\setbox#1\hbox
- {\setposition{\s!margin:\currentmarginpos}%
+ {\setposition{\s!margin:\number\currentmarginpos}%
\raise\scratchdimen\box#1}%
-% \fi
\or
% move up
- \ifnum\MPp{p:\parposcounter}=\MPp{\s!margin:\currentmarginpos}\relax
- \scratchdimen\dimexpr\MPy{p:\parposcounter}-\MPy{\s!margin:\currentmarginpos}\relax
+ \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
- \ifnum\MPp{p:\parposcounter}=\MPp{\s!margin:\currentmarginpos}\relax
+ \ifnum\MPp{p:\number\parposcounter}=\MPp{\s!margin:\number\currentmarginpos}\relax
\getnoflines\margincontentheight
\advance\noflines\minusone
\scratchdimen\noflines\lineheight
\else
- \scratchdimen\dimexpr\MPy{p:\parposcounter}-\MPy{\s!margin:\currentmarginpos}\relax
+ \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
@@ -1398,11 +1352,11 @@
%D specified with symbolic names, and symbolic references to
%D the graphics involved. Each table has its own namespace.
-\newcounter\noftabpositions
-\newtoks \posXCtoks
+\newcount\noftabpositions
+\newtoks \posXCtoks
\def\tbPOSprefix
- {tbp:\noftabpositions:}
+ {tbp:\number\noftabpositions:}
\def\tablepos
{\scratchtoks\posXCtoks
@@ -1494,7 +1448,7 @@
&\global\chardef\tabulatetype#1&}
\appendtoks
- \doglobal\increment\noftabpositions
+ \global\advance\noftabpositions\plusone
\to \everytabulate
%D In order to prevent potential clashes with abbreviations,
@@ -1541,7 +1495,7 @@
\def\normalTABLEquote {\unskip\!ttRightGlue&\omit\tablepos&} % "
\appendtoks
- \doglobal\increment\noftabpositions
+ \global\advance\noftabpositions\plusone
\to \everytable
%D Since we don't want nameclashes:
@@ -1703,9 +1657,21 @@
[before={\starttextbackground[strikethrough]},
after=\stoptextbackground]
+\definetextbackground
+ [sideline]
+ [mp=mpos:par:sideline,
+ location=paragraph,
+ framecolor=red,
+ frameoffset=5mm]
+
+\definestartstop [sideline]
+ [before={\starttextbackground[sideline]},
+ after=\stoptextbackground]
+
\starttext
\startunderline \input tufte \stopunderline \blank
\startoverstrike \input tufte \stopoverstrike \blank
\startexlines \input tufte \stopexlines \blank
\startstrikethrough \input tufte \stopstrikethrough \blank
+ \startsideline \input tufte \stopsideline \blank
\stoptext