summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/meta-pag.mkiv
diff options
context:
space:
mode:
authorContext Git Mirror Bot <phg42.2a@gmail.com>2016-01-12 17:15:07 +0100
committerContext Git Mirror Bot <phg42.2a@gmail.com>2016-01-12 17:15:07 +0100
commit8d8d528d2ad52599f11250cfc567fea4f37f2a8b (patch)
tree94286bc131ef7d994f9432febaf03fe23d10eef8 /tex/context/base/mkiv/meta-pag.mkiv
parentf5aed2e51223c36c84c5f25a6cad238b2af59087 (diff)
downloadcontext-8d8d528d2ad52599f11250cfc567fea4f37f2a8b.tar.gz
2016-01-12 16:26:00
Diffstat (limited to 'tex/context/base/mkiv/meta-pag.mkiv')
-rw-r--r--tex/context/base/mkiv/meta-pag.mkiv121
1 files changed, 121 insertions, 0 deletions
diff --git a/tex/context/base/mkiv/meta-pag.mkiv b/tex/context/base/mkiv/meta-pag.mkiv
new file mode 100644
index 000000000..6b6abd211
--- /dev/null
+++ b/tex/context/base/mkiv/meta-pag.mkiv
@@ -0,0 +1,121 @@
+%D \module
+%D [ file=meta-pag,
+%D version=1999.07.10,
+%D title=\METAPOST\ Graphics,
+%D subtitle=Initialization,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+%D These definitions used to be part of the old \type
+%D {core-mps} file, later changed into \type {meta-ini}, but
+%D keeping them separate is cleaner.
+
+\writestatus{loading}{MetaPost Graphics / Page Data Management}
+
+\unprotect
+
+%D The next few macros tell \METAPOST\ how the \CONTEXT\
+%D pagebody looks.
+
+\startMPextensions
+ boolean PageStateAvailable;
+ PageStateAvailable:=true;
+\stopMPextensions
+
+% maybe always set as frozen anyway
+
+% \startMPinitializations
+% PaperHeight:=\the\paperheight;
+% PaperWidth:=\the\paperwidth;
+% PrintPaperHeight:=\the\printpaperheight;
+% PrintPaperWidth:=\the\printpaperwidth;
+% TopSpace:=\the\topspace;
+% BottomSpace:=\the\bottomspace;
+% BackSpace:=\the\backspace;
+% CutSpace:=\the\cutspace;
+% MakeupHeight:=\the\makeupheight;
+% MakeupWidth:=\the\makeupwidth;
+% TopHeight:=\the\topheight;
+% TopDistance:=\the\topdistance;
+% HeaderHeight:=\the\headerheight;
+% HeaderDistance:=\the\headerdistance;
+% TextHeight:=\the\textheight;
+% FooterDistance:=\the\footerdistance;
+% FooterHeight:=\the\footerheight;
+% BottomDistance:=\the\bottomdistance;
+% BottomHeight:=\the\bottomheight;
+% LeftEdgeWidth:=\the\leftedgewidth;
+% LeftEdgeDistance:=\the\leftedgedistance;
+% LeftMarginWidth:=\the\leftmarginwidth;
+% LeftMarginDistance:=\the\leftmargindistance;
+% TextWidth:=\the\textwidth;
+% RightMarginDistance:=\the\rightmargindistance;
+% RightMarginWidth:=\the\rightmarginwidth;
+% RightEdgeDistance:=\the\rightedgedistance;
+% RightEdgeWidth:=\the\rightedgewidth;
+% InnerMarginDistance:=\the\innermargindistance;
+% InnerMarginWidth:=\the\innermarginwidth;
+% OuterMarginDistance:=\the\outermargindistance;
+% OuterMarginWidth:=\the\outermarginwidth;
+% InnerEdgeDistance:=\the\inneredgedistance;
+% InnerEdgeWidth:=\the\inneredgewidth;
+% OuterEdgeDistance:=\the\outeredgedistance;
+% OuterEdgeWidth:=\the\outeredgewidth;
+% PageOffset:=\the\pagebackgroundoffset;
+% PageDepth:=\the\pagebackgrounddepth;
+% LayoutColumns:=\the\layoutcolumns;
+% LayoutColumnDistance:=\the\layoutcolumndistance;
+% LayoutColumnWidth:=\the\layoutcolumnwidth;
+% %
+% boolean OnRightPage,OnOddPage,InPageBody;
+% %
+% OnRightPage:=\MPonrightpage;
+% OnOddPage:=\MPonoddpage;
+% InPageBody:=\ifinpagebody true \else false \fi;
+% %
+% RealPageNumber:=\the\realpageno;
+% PageNumber:=\the\pageno;
+% NOfPages:=\lastpage;
+% LastPageNumber:=\lastpage;
+% %
+% CurrentColumn:=\number\mofcolumns;
+% NOfColumns:=\number\nofcolumns;
+% \stopMPinitializations
+
+\def\MPonrightpage{true}
+\def\MPonoddpage {true}
+
+\def\freezeMPpagelayout
+ {\edef\MPonrightpage{\doifbothsides {tru}{tru}{fals}e}%
+ \edef\MPonoddpage {\doifelseoddpage {tru}{fals}e}}
+
+%D We need to freeze the pagelayout before the backgrounds
+%D are build, because the overlay will temporarily become
+%D zero (overlay).
+
+\appendtoks
+ \freezeMPpagelayout
+\to \everybeforepagebody
+
+%D By freezing these value every graphic, we can use layout
+%D variables that change halfways a page, whatever use that
+%D has.
+
+% obsolete (but keep the code)
+%
+% \prependtoks
+% \calculatereducedvsizes % this is really needed
+% \freezeMPpagelayout
+% \freezeMPlayout % to be used grouped
+% \to \everyMPgraphic
+
+\prependtoks
+ \calculatereducedvsizes % bah, this is really needed
+\to \everyMPgraphic
+
+\protect \endinput