page-spr.mkii / last modification: 2020-01-30 14:15
%D \module
%D   [       file=page-spr,
%D        version=2002.11.11,
%D          title=\CONTEXT\ Page Macros,
%D       subtitle=Spreading,
%D         author=Hans Hagen,
%D           date=\currentdate,
%D      copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.

\writestatus{loading}{ConTeXt Page Macros / Spreading}

% This module is experimental and not yet official!


\newif \ifinspread


% beware, ugly overload, to be redone

\def\normalsettextpagecontent#1#2#3% #2 and #3 will disappear
     {\vbox to \textheight
         \hsize\textwidth   % local variant of \sethsize
         \noindent             % content can be < \hsize
   \setbox#1\hbox to \makeupwidth
          \copy\spreadbox\hss % left page
          % prevent duplicate writes in normal run
          \ifarrangingpages \else \ifcase\showspreadmode
          \fi \fi
          \hss\box\spreadbox % right page
        \hss\box#1\hss % never change the \hss's

  {\ifinspread \ifvoid\spreadbox\else
     % this page will be discarded later
     \null \page
   \fi \fi }




\protect \endinput

% texexec --arr --pdf test
% \setuplayout[width=middle]
% \setuppapersize[A4][A3,landscape]
% \setuppagenumbering[alternative=doublesided]
% \setuparranging[2UP]
% \starttext
% \dorecurse{3}{\input tufte }
% \startspread
%   \dorecurse{10}{\input tufte }
% \stopspread
% \dorecurse{3}{\input tufte }
% \stoptext