summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/page-app.mkiv
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/context/base/page-app.mkiv')
-rw-r--r--Master/texmf-dist/tex/context/base/page-app.mkiv70
1 files changed, 13 insertions, 57 deletions
diff --git a/Master/texmf-dist/tex/context/base/page-app.mkiv b/Master/texmf-dist/tex/context/base/page-app.mkiv
index 7dd71cf2ab8..b42eef05403 100644
--- a/Master/texmf-dist/tex/context/base/page-app.mkiv
+++ b/Master/texmf-dist/tex/context/base/page-app.mkiv
@@ -13,8 +13,7 @@
\writestatus{loading}{ConTeXt Page Macros / Applications}
-%D The fitting page code is moved from \type {meta-fig} to
-%D here.
+%D This needs an update with a proper define and inheritance.
\unprotect
@@ -35,7 +34,6 @@
\c!rightmargin=\!!zeropoint,\c!rightedge=\!!zeropoint,
\c!header=\!!zeropoint,\c!footer=\!!zeropoint]
-
\def\dostartfittingpage[#1][#2]%
{\page % this is kind of tricky! there can be preceding page refs
\autostarttext
@@ -74,7 +72,7 @@
\let\checkcurrentlayout\relax % else interference with odd/even layout
\processaction
[\getvalue{\currentfittingpage\c!paper}]
- [ \v!auto=>\let\fittingpapersize\printpapersize,
+ [ \v!auto=>\def\fittingpapersize{\printpapersize},
\s!unknown=>\let\fittingpapersize\commalistelement,
\s!default=>\def\fittingpapersize{\??fp\s!dummy}]%
\expanded{\setuppapersize[\??fp\s!dummy][\fittingpapersize]}%
@@ -85,7 +83,7 @@
\c!height=\fittinght]%
\setuplayout
[\v!page]%
- \startmakeup[\v!standard][\c!textstate=\v!empty,\c!doublesided=\v!no,\c!page=]%
+ \startmakeup[\v!standard][\c!textstate=\v!empty,\c!doublesided=\v!no,\c!pagestate=\getvalue{\currentfittingpage\c!pagestate}]%
\centerbox{\box\scratchbox}%
\stopmakeup
\stoplocallayout
@@ -111,6 +109,7 @@
\setupTEXpage
[\c!scale=1000,
+ \c!pagestate=,
\c!strut=\v!no,
\c!align=\v!normal, % needed, else problems !
\c!offset=\v!overlay,
@@ -130,7 +129,7 @@
\unexpanded\def\startTEXstream
{\dosingleempty\dostartTEXstream}
-\def\dostartTEXstream[#1]%
+\def\dostartTEXstream[#1]% old code, to be redone
{\page
\defineoutputstream[tex]%
\enableoutputstream[tex]%
@@ -140,61 +139,18 @@
\outputstreamunvbox[tex]%
\stopTEXpage}}
-%D Application pages (for an example, see \type {m-pstric}):
-
-\def\@@texapp{texapp}
-\def\@@texdim{texdim}
+%D Application pages, a quick \MKIV\ hack:
-\def\saveTEXapplication#1#2%
- {\immediate\openout\scratchwrite=\bufferprefix\@@texdim.tmp
- \immediate\write\scratchwrite{\dimen#1=\the\ht\scratchbox}%
- \immediate\write\scratchwrite{\dimen#2=\the\wd\scratchbox}%
- \immediate\closeout\scratchwrite}
+\definetypesetting[TEXapplication]
+\definebuffer[TEXapplication]
-\def\restoreTEXapplication
- {\readlocfile{\bufferprefix\@@texdim.tmp}\donothing\donothing}
+% we could use a counter and saves runs on numbering them.
-\def\startTEXapplication
- {\dosingleempty\dostartTEXapplication}
+\def\TEXapplicationfilename{\jobname-texapplication.tex}
-\long\def\dostartTEXapplication[#1]#2#3\stopTEXapplication
- {\bgroup
- \bgroup
- \let\f!temporaryextension\c!tex
- \setbuffer[\@@texapp]%
- \starttext
- #2% preamble
- \startTEXpage[#1]%
- \topskip\zeropoint
- \setbox\scratchbox\hbox{#3}%
- \saveTEXapplication02% dimensions
- \box\scratchbox
- \stopTEXpage
- \stoptext
- \endbuffer
- \egroup
- \doifelse\jobsuffix{dvi}\donetrue\donefalse
- \executesystemcommand{texexec \bufferprefix\@@texapp.tex --once --batch}%
- \ifdone % eps
- \executesystemcommand{dvips -E* -o \@@texapp.eps \@@texapp}%
- \else % pdf
- \executesystemcommand{dvips \bufferprefix\@@texapp}%
- \executesystemcommand{ps2pdf \bufferprefix\@@texapp.ps \bufferprefix\@@texapp.pdf}%
-% \executesystemcommand{texmfstart pstopdf \bufferprefix\@@texapp.ps \bufferprefix\@@texapp.pdf}%
- \fi
- \restoreTEXapplication % dimensions
- \doifelse\jobsuffix{dvi}\donetrue\donefalse
- \setbox\scratchbox\hbox
- {\expanded{\externalfigure
- [\bufferprefix\@@texapp.\ifdone eps\else pdf\fi]
- [\c!object=\v!no]}}%
- \setbox\scratchbox\hbox
- {\lower\ht\scratchbox\hbox{\raise\dimen2\box\scratchbox}}%
- \wd\scratchbox\dimen0
- \ht\scratchbox\dimen2
- \dp\scratchbox\zeropoint
- \box\scratchbox
- \egroup}
+\def\stopTEXapplication
+ {\savebuffer[\thedefinedbuffer{TEXapplication}][\TEXapplicationfilename]%
+ \typesetfile[TEXapplication][\TEXapplicationfilename]\relax}
%D \macros
%D {startpagefigure}