diff options
author | Taco Hoekwater <taco@elvenkind.com> | 2011-06-01 08:54:21 +0000 |
---|---|---|
committer | Taco Hoekwater <taco@elvenkind.com> | 2011-06-01 08:54:21 +0000 |
commit | d7ccb42582f85acf30568913610ccf4d602023fb (patch) | |
tree | 7292e3545a420676878e7451b68892d360c62cb6 /Master/texmf-dist/tex/context/base/page-ini.mkiv | |
parent | 2d62a6fe9b80def59c392268022f1f9a2d6e358f (diff) |
commit context 2011.05.18
git-svn-id: svn://tug.org/texlive/trunk@22719 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/context/base/page-ini.mkiv')
-rw-r--r-- | Master/texmf-dist/tex/context/base/page-ini.mkiv | 135 |
1 files changed, 70 insertions, 65 deletions
diff --git a/Master/texmf-dist/tex/context/base/page-ini.mkiv b/Master/texmf-dist/tex/context/base/page-ini.mkiv index 07d3422829c..7969e4f3e46 100644 --- a/Master/texmf-dist/tex/context/base/page-ini.mkiv +++ b/Master/texmf-dist/tex/context/base/page-ini.mkiv @@ -28,7 +28,7 @@ \def\m!otr{otr} -\chardef\normalpagebox=255 +% \setnewconstant\normalpagebox 255 % already set \newbox\pagebox @@ -300,11 +300,14 @@ \expandafter\invokenormaloutputroutine \fi} -\mainoutput{\invokeoutputroutine} \output{\inotrtrue\the\mainoutput} +\mainoutput{\invokeoutputroutine} %D Some hooks: -\output{\inotrtrue\the\everybeforeoutput\the\mainoutput\the\everyafteroutput} +\def\setoutputroutine#1% + {\global\output{\inotrtrue\the\everybeforeoutput#1\the\everyafteroutput}} + +\setoutputroutine{\the\mainoutput} \ifx\pagediscards\undefined \let\pagediscards\relax \fi @@ -332,8 +335,8 @@ \newcount\nofcolumns \nofcolumns = 1 \newcount\mofcolumns \mofcolumns = 1 -\chardef\maxnofcolumns = 50 -\chardef\allocatednofcolumns = 0 +\setnewconstant\maxnofcolumns 50 +\setnewconstant\allocatednofcolumns 0 %D The next dimensions reports the final column height @@ -366,7 +369,7 @@ \@EA\newbox\csname\@col@-\recurselevel-h\endcsname % top insert \@EA\newbox\csname\@col@-\recurselevel-l\endcsname % top insert \fi}% - \global\chardef\allocatednofcolumns=\nofcolumns + \global\allocatednofcolumns\nofcolumns \fi} \def\firstcolumnbox {\columntextbox\plusone} @@ -448,7 +451,7 @@ \newdimen\localcolumnwidth \newdimen\savedpagetotal -\chardef\columndirection=0 % 0:lr 1:rl +\newconstant\columndirection % 0:lr 1:rl \def\minbalancetoplines {1} \def\minfreecolumnlines {2} @@ -562,8 +565,7 @@ \fi \fi#1#2% \resetselectiepagina - \incrementpagenumber - \incrementsubpagenumber + \doincrementpageboundcounters % should hook into an every \checkpagedimensions \ifnum\outputpenalty>\superpenalty \else \dosupereject @@ -576,8 +578,6 @@ \maxdeadcycles=1000 -% will be installable tracer; better use chardef - % this needs a real cleanup \def\doplaceversiontext#1#2% @@ -601,7 +601,7 @@ \vskip\!!sixpoint \hbox to \makeupwidth {\infofont - \getmessage\m!systems{27}:\space\currentdate\space + \getmessage\m!system{27}:\space\currentdate\space \doplaceversiontext\v!project \currentproject \doplaceversiontext\v!product \currentproduct \doplaceversiontext\v!component\currentcomponent @@ -612,13 +612,13 @@ % tot hier \def\doversion[#1]% - {\chardef\conceptmode\zerocount + {\conceptmode\zerocount \overfullrule\zeropoint \processaction % \v!final=> [#1] - [ \v!concept=>\chardef\conceptmode\plusone, % simple banner - \v!file=>\chardef\conceptmode\plustwo, % full banner - \v!temporary=>\chardef\conceptmode\plusthree % full banner plus + [ \v!concept=>\conceptmode\plusone, % simple banner + \v!file=>\conceptmode\plustwo, % full banner + \v!temporary=>\conceptmode\plusthree % full banner plus \overfullrule5\points]} % info in the margin \def\version @@ -699,28 +699,28 @@ \newtoks\afterpage \newtoks\aftereverypage \newtoks\beforepage \newtoks\beforeeverypage -\chardef\showgridstate=0 +\newconstant\showgridstate -\def\showgrid +\unexpanded\def\showgrid {\dosingleempty\doshowgrid} \def\doshowgrid[#1]% - {\chardef\showgridstate \plusone % downward compatible default - \chardef\gridboxlinemode \plusone - \chardef\gridboxlinenomode\plusone + {\showgridstate \plusone % downward compatible default + \gridboxlinemode \plusone + \gridboxlinenomode\plusone \processallactionsinset [#1]% - [ \v!reset=>\chardef\showgridstate \zerocount, - \v!bottom=>\chardef\showgridstate \plusone, - \v!top=>\chardef\showgridstate \plustwo, - \v!none=>\chardef\gridboxlinemode \zerocount, - \v!all=>\chardef\gridboxlinemode \plusone, - \v!lines=>\chardef\gridboxlinemode \plustwo, - \v!frame=>\chardef\gridboxlinemode \plusthree, - \v!nonumber=>\chardef\gridboxlinenomode\zerocount, - \v!right=>\chardef\gridboxlinenomode\plusone, - \v!left=>\chardef\gridboxlinenomode\plustwo, - \v!outer=>\chardef\gridboxlinenomode\plusthree]% + [ \v!reset=>\showgridstate \zerocount, + \v!bottom=>\showgridstate \plusone, + \v!top=>\showgridstate \plustwo, + \v!none=>\gridboxlinemode \zerocount, + \v!all=>\gridboxlinemode \plusone, + \v!lines=>\gridboxlinemode \plustwo, + \v!frame=>\gridboxlinemode \plusthree, + \v!nonumber=>\gridboxlinenomode\zerocount, + \v!right=>\gridboxlinenomode\plusone, + \v!left=>\gridboxlinenomode\plustwo, + \v!outer=>\gridboxlinenomode\plusthree]% \ifcase\showgridstate \let\addtextgridlayer\gobbleoneargument \else % 1=bottom 2=top @@ -781,50 +781,56 @@ \newif\ifarrangingpages \arrangingpagesfalse -\chardef\pageornamentstate\zerocount % 0=on 1=one-off 2=always-off +\newconstant\pageornamentstate % 0=on 1=one-off 2=always-off -\def\pagebodyornamentstrue {\chardef\pageornamentstate\zerocount} % for a while -\def\pagebodyornamentsfalse{\chardef\pageornamentstate\plusone} % for a while +\def\pagebodyornamentstrue {\pageornamentstate\zerocount} % for a while +\def\pagebodyornamentsfalse{\pageornamentstate\plusone} % for a while \appendtoks \ifcase\pageornamentstate\or - \chardef\pageornamentstate\zerocount + \pageornamentstate\zerocount \fi \to \everyaftershipout \let\poparrangedpages\relax \let\pusharrangedpage\relax -\ifx\shiftprintpagebox\undefined +\ifdefined\shiftprintpagebox \else \let\shiftprintpagebox\gobbleoneargument \let\shiftpaperpagebox\gobbleoneargument \fi -\ifx\registerpageposition\undefined +\ifdefined\registerpageposition \else \let\registerpageposition\gobbleoneargument \fi -\def\reportarrangedpage#1% - {\showmessage\m!systems - {23}{\the\realpageno.\the\pageno\ifnum\subpageno>0 .\the\subpageno\fi,#1}} - \newif\ifsavepagebody \newbox\savedpagebody % beware, \??ly is used before defined, i.e. bad module design \setuplayout[\c!method=\v!normal] +\def\docolumnpagebodymarks#1#2#3#4% first last column box + {\ifnum#3=#1\relax + \dosynchronizemarking[\number#3,\v!column:\number#3,\v!first,\v!column:\v!first][#4]% + \else\ifnum#3=#2\relax + \dosynchronizemarking[\number#3,\v!column:\number#3,\v!last, \v!column:\v!last ][#4]% + \else + \dosynchronizemarking[\number#3,\v!column:\number#3 ][#4]% + \fi\fi} + \def\buildpagebody#1#2% {\ifsavepagebody\global\setbox\savedpagebody\fi \vbox - {\beginrestorecatcodes -% \forgetall % igv problemen, check: \boxmaxdepth\maxdimen + {%\pushcatcodetable + %\forgetall % igv problemen, check: \boxmaxdepth\maxdimen \boxmaxdepth\maxdimen % new \dontcomplain + % marks get done here + \dosynchronizemarking[\v!page][#2]% % the following plugin uses and sets pagebox; beware: this % will change and is for my (hh) personal experiments - \executeifdefined{\??ly\c!method\@@lymethod}% - {\getvalue{\??ly\c!method\v!normal}}#1#2% + \executeifdefined{\??ly\c!method\@@lymethod}{\getvalue{\??ly\c!method\v!normal}}#1#2% % the finishing touch \ifcase\pageornamentstate \addpagebackground \pagebox @@ -852,7 +858,7 @@ \negateprintbox \pagebox \fi \box\pagebox - \endrestorecatcodes}% + }% \popcatcodetable \ifsavepagebody\copy\savedpagebody\fi} \setvalue{\??ly\c!method\v!normal}#1#2% @@ -893,8 +899,7 @@ \prependtoks \let\nextbox\nestednextbox \to \everybeforepagebody \def\dopagebody#1#2% - {%\getallmarks % now in following token register - \the\everybeforepagebody + {\the\everybeforepagebody \starttextproperties % \setnextsubpageno % nog eens: als in pagina (tbv standaard opmaak) \dontshowboxes % dan hier blokkeren en verderop resetten @@ -919,8 +924,8 @@ \newif\ifpagebreakdisabled \pagebreakdisabledfalse -\chardef\testpagemethod \zerocount % todo: \testnewpage[method=,lines=,voffset=] -\chardef\testpagetrigger\zerocount +\newconstant\testpagemethod % todo: \testnewpage[method=,lines=,voffset=] +\newconstant\testpagetrigger \def\testpage {\dotripleempty\dotestpage[\plusone ]} % \def\testpageonly{\dotripleempty\dotestpage[\plustwo ]} % no penalties added to the mvl @@ -1020,9 +1025,9 @@ \penalty-\!!tenthousand % untested ! ! \column \fi \fi} -\let\resetcurrentsectionmarks\relax - -% was: \resetsectionmarks\firstsection, zie \handlepagebreak +\ifdefined\resetcurrentstructuremarkswithpage \else + \let\resetcurrentstructuremarkswithpage\relax +\fi \def\page{\pagebreak} % the short form of \pagebreak (mult-com one) @@ -1057,7 +1062,7 @@ \edef\prevrealpageno{\the\realpageno}% \ifcase\pageornamentstate \or % disable reset after shipout - \global\chardef\pageornamentstate\plustwo + \global\pageornamentstate\plustwo \fi \iffirstargument % or if empty i.e. [] \executepagebreakhandlers{#1}% @@ -1070,7 +1075,7 @@ % as WS found out so we have to wait till the next side % effect shows up % \ifcase\pageornamentstate\or - \global\chardef\pageornamentstate\zerocount + \global\pageornamentstate\zerocount % \fi \fi \egroup} @@ -1106,7 +1111,7 @@ {} % do nothing if empty \installpagebreakhandler \v!reset - {% better not: \global\chardef\pageornamentstate\zerocount + {% better not: \global\pageornamentstate\zerocount \resetpagebreak} \installpagebreakhandler \v!disable @@ -1128,7 +1133,7 @@ \installpagebreakhandler \v!blank {\ifcase\pageornamentstate - \global\chardef\pageornamentstate\plusone + \global\pageornamentstate\plusone \fi} \installpagebreakhandler \v!no @@ -1164,20 +1169,20 @@ \installpagebreakhandler \v!left {\ejectinsert \gotonextpageX % will become \gotonextpage - \doifbothsidesoverruled{}{\resetcurrentsectionmarks\ejectdummypage}{}} + \doifbothsidesoverruled{}{\resetcurrentstructuremarkswithpage\ejectdummypage}{}} \installpagebreakhandler \v!right {\ejectinsert \gotonextpageX % will become \gotonextpage - \doifbothsidesoverruled{}{}{\resetcurrentsectionmarks\ejectdummypage}} + \doifbothsidesoverruled{}{}{\resetcurrentstructuremarkswithpage\ejectdummypage}} \installpagebreakhandler \v!even {\page - \doifoddpageelse{\resetcurrentsectionmarks\ejectdummypage}\donothing} + \doifoddpageelse{\resetcurrentstructuremarkswithpage\ejectdummypage}\donothing} \installpagebreakhandler \v!odd {\page - \doifoddpageelse\donothing{\resetcurrentsectionmarks\ejectdummypage}} + \doifoddpageelse\donothing{\resetcurrentstructuremarkswithpage\ejectdummypage}} \installpagebreakhandler \v!quadruple % not yet ok inside columnsets {\ifdoublesided @@ -1298,7 +1303,7 @@ % We don't want spurious last pages (due to left over marks): \def\noshipout - {\writestatus\m!systems{ignoring further shipouts}% + {\writestatus\m!system{ignoring further shipouts}% \global\advance\realpageno\minusone % else no flush of resources \dowithnextbox{\deadcycles\zerocount}} @@ -1424,7 +1429,7 @@ \def\registeredtextarea#1#2#3% #1=lower-dp #2=correct-ht #3=box {\hbox\bgroup \ifregistertextareas \ifx\registerMPtextarea\undefined \else - \setbox\registertextbox\null + \setbox\registertextbox\emptyhbox \wd\registertextbox\wd#3% \ht\registertextbox\ht#3% \dp\registertextbox\dp#3% @@ -1494,7 +1499,7 @@ {\ifvoid\facingpage\else \ifnum\realpageno>\plusone \bgroup - \chardef\pageornamentstate\plusone + \pageornamentstate\plusone \finishfacingpage \myshipout{\buildpagebody\box\facingpage}% \egroup |