diff options
Diffstat (limited to 'Master/texmf-dist/tex/context/base/page-txt.mkiv')
-rw-r--r-- | Master/texmf-dist/tex/context/base/page-txt.mkiv | 121 |
1 files changed, 48 insertions, 73 deletions
diff --git a/Master/texmf-dist/tex/context/base/page-txt.mkiv b/Master/texmf-dist/tex/context/base/page-txt.mkiv index f4e2d76f94c..bdc7c1bb6cd 100644 --- a/Master/texmf-dist/tex/context/base/page-txt.mkiv +++ b/Master/texmf-dist/tex/context/base/page-txt.mkiv @@ -64,7 +64,7 @@ %D \showsetup{setupfooter} %D \showsetup{setupbottom} -\def\setuplayouttext +\unexpanded\def\setuplayouttext {\dotripleempty\dosetuplayouttext} \def\dosetuplayouttext[#1][#2][#3]% beware, non global @@ -86,11 +86,11 @@ \fi \fi} -\def\setuptop {\dotripleempty\dosetuplayouttext[\v!top]} -\def\setupheader {\dotripleempty\dosetuplayouttext[\v!header]} -\def\setuptext {\dotripleempty\dosetuplayouttext[\v!text]} -\def\setupfooter {\dotripleempty\dosetuplayouttext[\v!footer]} -\def\setupbottom {\dotripleempty\dosetuplayouttext[\v!bottom]} +\unexpanded\def\setuptop {\dotripleempty\dosetuplayouttext[\v!top]} +\unexpanded\def\setupheader {\dotripleempty\dosetuplayouttext[\v!header]} +\unexpanded\def\setuptext {\dotripleempty\dosetuplayouttext[\v!text]} +\unexpanded\def\setupfooter {\dotripleempty\dosetuplayouttext[\v!footer]} +\unexpanded\def\setupbottom {\dotripleempty\dosetuplayouttext[\v!bottom]} %D \macros %D {noheaderandfooterlines,notopandbottomlines} @@ -125,11 +125,11 @@ %D \showsetup{setupfootertexts} %D \showsetup{setupbottomtexts} -\def\setuptoptexts {\dosixtupleempty\dosetuptexts[\v!top ]} -\def\setupheadertexts {\dosixtupleempty\dosetuptexts[\v!header ]} -\def\setuptexttexts {\dosixtupleempty\dosetuptexts[\v!text ]} -\def\setupfootertexts {\dosixtupleempty\dosetuptexts[\v!footer ]} -\def\setupbottomtexts {\dosixtupleempty\dosetuptexts[\v!bottom ]} +\unexpanded\def\setuptoptexts {\dosixtupleempty\dosetuptexts[\v!top ]} +\unexpanded\def\setupheadertexts {\dosixtupleempty\dosetuptexts[\v!header ]} +\unexpanded\def\setuptexttexts {\dosixtupleempty\dosetuptexts[\v!text ]} +\unexpanded\def\setupfootertexts {\dosixtupleempty\dosetuptexts[\v!footer ]} +\unexpanded\def\setupbottomtexts {\dosixtupleempty\dosetuptexts[\v!bottom ]} %D The left, right and center variables can also be set %D directly using the previously discussed macros. @@ -192,12 +192,12 @@ %D The next macro will be cleaned up and made less messy and %D dependent. -\def\placetextlinestrut#1% +\unexpanded\def\placetextlinestrut#1% {\doifvalue{#1\c!strut}\v!yes{\setstrut\strut}} \def\dosingletexts#1#2#3#4#5#6% {\bgroup - \defconvertedargument\ascii{#6}% no longer \defconvertedargument + \defconvertedargument\ascii{#6}% no longer \defconvertedargument, this also does not permit \v!pagenumber (i.e. v!) \ifx\ascii\empty\else \dostartattributes{\??tk#1#2}#3#4\empty \placetextlinestrut{\??tk#1}% here ! @@ -236,13 +236,26 @@ %D the \type {status} variable. This is handled by the next %D couple of macros. +% \def\settextlinestatus#1% +% {\edef\textlinestatus{\csname\??tk#1\c!state\endcsname}} + \def\settextlinestatus#1% - {\edef\textlinestatus{\csname\??tk#1\c!state\endcsname}} + {\ifcase0\csname\??tk#1\c!n\endcsname\relax + \edef\textlinestatus{\csname\??tk#1\c!state\endcsname}% + \else + \setxvalue{\??tk#1\c!n}{\the\numexpr\csname\??tk#1\c!n\endcsname-1}% + \let\textlinestatus\v!stop + \fi} + +\appendtoks + \doifinset\v!header\floatspecification{\setxvalue{\??tk\v!header\c!n}{1}}% + \doifinset\v!footer\floatspecification{\setxvalue{\??tk\v!footer\c!n}{1}}% +\to \everybeforeflushedpagefloat \def\resettextlinestatus#1% postpone {\expandafter\gdef\csname\??tk#1\s!reset\endcsname{\global\expandafter\let\csname\??tk#1\c!state\endcsname\v!normal}} -\def\placelayouttextline#1% #2 +\unexpanded\def\placelayouttextline#1% #2 {\settextlinestatus#1% \csname\??tk::\ifcsname\??tk::\textlinestatus\endcsname\textlinestatus\else\s!unknown\fi\endcsname#1} % {#2} @@ -468,39 +481,6 @@ \hss}% \dp#1\zeropoint} -\definepalet - [layout] - [grid=red, - page=green] - -\def\addtextgridlayer#1% to be checked for color and layer - {\ifcase\showgridstate\else % 1=bottom 2=top - \startcolor[layout:grid]% - \setgridbox\scratchbox\makeupwidth\textheight % todo: check color - \setbox#1\hbox - {\ifcase\showgridstate\or\or\box#1\hskip-\makeupwidth\fi - \bgroup % color - \ifcase\layoutcolumns\else - \gray - \setlayoutcomponentattribute\v!grid\v!columns - \hbox \layoutcomponentboxattribute to \makeupwidth - {\dorecurse\layoutcolumns - {\hskip\layoutcolumnwidth - \ifnum\recurselevel<\layoutcolumns - \vrule - \!!height\ht\scratchbox - \!!depth\dp\scratchbox - \!!width\layoutcolumndistance - \fi}}% - \hskip-\makeupwidth - \fi - \setlayoutcomponentattribute\v!grid\v!lines - \hbox \layoutcomponentboxattribute{\box\scratchbox}% - \egroup - \ifcase\showgridstate\or\hskip-\makeupwidth\box#1\fi}% - \stopcolor - \fi} - %D The placement of a whole line is handled by the next two %D macros. These are hooked into the general purpose token %D list registers mentioned before. @@ -624,7 +604,7 @@ \fi \ifdim\rightedgewidth>\zeropoint \hskip\rightedgedistance - \dododoplacelayouttextline\rightedgewidth\currentlayouttextline\v!edge{\thelayoutrightedgeline#1}% + \dododoplacelayouttextline\rightedgewidth\currentlayouttextline\v!edge{\thelayoutrightedgeline#3}% \fi}} \def\thelayoutleftedgeline#1% @@ -722,20 +702,15 @@ %D This code will move to \type {page-flt.tex}. -\appendtoks - \plaatsrechtermargeblok \hskip-\rightmarginwidth -\to \rightmargintextcontent - -\appendtoks - \plaatslinkermargeblok \hskip-\leftmarginwidth -\to \leftmargintextcontent +\appendtoks \placerightmarginblock \hskip-\rightmarginwidth \to \rightmargintextcontent +\appendtoks \placeleftmarginblock \hskip-\leftmarginwidth \to \leftmargintextcontent %D The next hook will later be used for keeping track of %D positions, i.e.\ it will provide a proper (page %D dependent) reference point. \ifx\undefined\placepositionanchors - \def\placepositionanchors{\vskip\textheight} + \unexpanded\def\placepositionanchors{\vskip\textheight} \fi %D \macros @@ -759,7 +734,7 @@ %D \chapter{tweede} \dorecurse{20}{\input tufte \relax} %D \stoptyping -\def\definetext +\unexpanded\def\definetext {\doseventupleempty\dodefinetext} \def\dodefinetext[#1][#2][#3][#4][#5][#6][#7]% @@ -778,25 +753,25 @@ %D The rest of this file is dedicated to setting up the %D texts. This code is not that impressive. -\setupheadertexts [\v!text] [] [] +\setupheadertexts [\v!text] [] [] \setupheadertexts [\v!margin] [] [] -\setupheadertexts [\v!edge] [] [] +\setupheadertexts [\v!edge] [] [] -\setupfootertexts [\v!text] [] [] +\setupfootertexts [\v!text] [] [] \setupfootertexts [\v!margin] [] [] -\setupfootertexts [\v!edge] [] [] +\setupfootertexts [\v!edge] [] [] -\setuptexttexts [\v!text] [] [] +\setuptexttexts [\v!text] [] [] \setuptexttexts [\v!margin] [] [] -\setuptexttexts [\v!edge] [] [] +\setuptexttexts [\v!edge] [] [] -\setupbottomtexts [\v!text] [] [] +\setupbottomtexts [\v!text] [] [] \setupbottomtexts [\v!margin] [] [] -\setupbottomtexts [\v!edge] [] [] +\setupbottomtexts [\v!edge] [] [] -\setuptoptexts [\v!text] [] [] +\setuptoptexts [\v!text] [] [] \setuptoptexts [\v!margin] [] [] -\setuptoptexts [\v!edge] [] [] +\setuptoptexts [\v!edge] [] [] % alternative % @@ -860,11 +835,11 @@ %D While the header and footer lines are moved away from the %D main text, the top and bottom lines are centered. -\setuptop [\c!state=\v!normal,\c!before=\vss,\c!after=\vss,\c!strut=] -\setupheader[\c!state=\v!normal,\c!before=, \c!after=\vss,\c!strut=\v!yes] -\setuptext [\c!state=\v!normal,\c!before=\vss,\c!after=\vss,\c!strut=] -\setupfooter[\c!state=\v!normal,\c!before=\vss,\c!after=, \c!strut=\v!yes] -\setupbottom[\c!state=\v!normal,\c!before=\vss,\c!after=\vss,\c!strut=] +\setuptop [\c!state=\v!normal,\c!n=0,\c!before=\vss,\c!after=\vss,\c!strut=] +\setupheader[\c!state=\v!normal,\c!n=0,\c!before=, \c!after=\vss,\c!strut=\v!yes] +\setuptext [\c!state=\v!normal,\c!n=0,\c!before=\vss,\c!after=\vss,\c!strut=] +\setupfooter[\c!state=\v!normal,\c!n=0,\c!before=\vss,\c!after=, \c!strut=\v!yes] +\setupbottom[\c!state=\v!normal,\c!n=0,\c!before=\vss,\c!after=\vss,\c!strut=] \setuptop [\c!style=,\c!color=] \setupheader[\c!style=,\c!color=] |