summaryrefslogtreecommitdiff
path: root/tex/context/base/cont-new.mkiv
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/cont-new.mkiv')
-rw-r--r--tex/context/base/cont-new.mkiv227
1 files changed, 24 insertions, 203 deletions
diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv
index b0b002991..a5b59432f 100644
--- a/tex/context/base/cont-new.mkiv
+++ b/tex/context/base/cont-new.mkiv
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\newcontextversion{2012.08.13 18:45}
+\newcontextversion{2012.08.14 10:44}
%D This file is loaded at runtime, thereby providing an excellent place for
%D hacks, patches, extensions and new features.
@@ -20,230 +20,51 @@
\writestatus\m!system{beware: some patches loaded from cont-new.mkiv}
-\def\dividedsize#1#2#3% size gap n
- {\dimexpr
- \ifnum\dimexpr#1\relax>\plusone
- (\dimexpr#1\relax-\numexpr#3-1\relax\dimexpr#2\relax)/#3\else#1%
- \fi
- \relax}
-
-%D Idea:
-
-% \newinsert\thispageinsert % <- installinsertion
-%
-% \def\flushatthispage
-% {\bgroup
-% \dowithnextbox{\insert\thispageinsert{\box\nextbox}\egroup}%
-% \hbox}
-%
-% \appendtoks
-% \ifvoid\thispageinsert\else\hbox{\smashedbox\thispageinsert}\fi
-% \to \everyshipout
-
-%D Idea:
-
-% \definemarkedpage[nobackgrounds]
-% \markpage[nobackgrounds]
-% \doifmarkedpageelse{nobackgrounds}
-
-\unexpanded\def\inlinedbox
- {\bgroup
- \dowithnextbox
- {\scratchdimen\nextboxht
- \advance\scratchdimen\nextboxdp
- \advance\scratchdimen-\lineheight
- \divide\scratchdimen\plustwo
- \advance\scratchdimen\strutdepth
- \setbox\nextbox\hbox{\lower\scratchdimen\flushnextbox}%
- \nextboxht\strutht
- \nextboxdp\strutdp
- \flushnextbox
- \egroup}%
- \hbox}
-
-\def\dimenratio#1#2% etex only
- {\withoutpt\the\dimexpr2\dimexpr(#1)/\dimexpr(#2)/32768\relax\relax}
-
-\def\doxprecurse#1#2%
- {\ifnum#1=\zerocount % no \ifcase
- \expandafter\gobblethreearguments
- \else
- #2\expandafter\expandafter\expandafter\doxprecurse\expandafter
- \fi\expandafter{\the\numexpr#1-1\relax}{#2}}
-
-\unexpanded\def\asciistr#1{\dontleavehmode{\defconvertedargument\ascii{#1}\verbatimfont\ascii}}
-
-\def\shapefill{\vskip\zeropoint\s!plus\lineheight\s!minus\lineheight\relax}
-
-
-\def\minimalhbox#1#%
- {\dowithnextbox
- {\bgroup
- \setbox\scratchbox\hbox#1{\hss}%
- \ifdim\nextboxwd<\wd\scratchbox\nextboxwd\wd\scratchbox\fi
- \flushnextbox
- \egroup}
- \hbox}
-
-\def\gobbleuntilempty#1\empty{}
-
-\def\dodimchoice#1#2#3%
- {\ifdim#1#2%
- #3\@EA\gobbleuntilempty
- \else
- \@EA\dodimchoice
- \fi{#1}}
+%D Maybe:
-\def\donumchoice#1#2#3%
- {\ifnum#1#2%
- #3\@EA\gobbleuntilempty
- \else
- \@EA\dodimchoice
- \fi{#1}}
-
-\def\dimchoice#1#2{\dodimchoice{#1}#2{=#1}{#1}\empty}
-\def\numchoice#1#2{\donumchoice{#1}#2{=#1}{#1}\empty}
-
-% \the\dimexpr(\dimchoice {7pt}{{<10pt}{8pt}{<12pt}{9pt}{<15pt}{10pt}{=11pt}{12pt}})
-% \the\dimexpr(\dimchoice{11pt}{{<10pt}{8pt}{<12pt}{9pt}{<15pt}{10pt}{=11pt}{12pt}})
-% \the\dimexpr(\dimchoice{14pt}{{<10pt}{8pt}{<12pt}{9pt}{<15pt}{10pt}{=11pt}{12pt}})
-
-% between alignment lines certain rules apply, and even a
-% simple test can mess up a table, which is why we have a
-% special test facility
-%
-% \ruledvbox
-% {\starttabulate[|l|p|]
-% \NC 1test \NC test \NC \NR
-% \tableifelse{\doifelse{a}{a}}{\NC Xtest \NC test \NC \NR}{}%
-% \stoptabulate}
-
-\def\tableifelse#1%
- {\tablenoalign
- {#1%
- {\aftergroup \firstoftwoarguments}%
- {\aftergroup\secondoftwoarguments}}}
-
-\def\tableiftextelse#1{\tableifelse{\doiftextelse{#1}}}
-
-\def\tightvbox{\dowithnextbox{\nextboxdp\zeropoint\flushnextbox}\vbox}
-\def\tightvtop{\dowithnextbox{\nextboxht\zeropoint\flushnextbox}\vtop}
-
-\unexpanded\def\obeysupersubletters
- {\let\super\normalsuper
- \let\suber\normalsuber
- \let\normalsuper\letterhat
- \let\normalsuber\letterunderscore
- \enablesupersub}
-
-\unexpanded\def\obeysupersubmath
- {\let\normalsuper\letterhat
- \let\normalsuber\letterunderscore
- \enablesupersub}
-
-\def\startgridcorrection
- {\dosingleempty\dostartgridcorrection}
-
-\def\dostartgridcorrection[#1]%
+\unexpanded\def\tightvbox{\dowithnextbox{\dp\nextbox\zeropoint\box\nextbox}\vbox}
+\unexpanded\def\tightvtop{\dowithnextbox{\ht\nextbox\zeropoint\box\nextbox}\vtop}
+
+%D Needs some work:
+
+\unexpanded\def\startgridcorrection
+ {\dosingleempty\spac_grid_correction_start}
+
+\def\spac_grid_correction_start[#1]%
{\ifgridsnapping
\snaptogrid[#1]\vbox\bgroup
\else
\startbaselinecorrection
\fi}
-\def\stopgridcorrection
+\unexpanded\def\stopgridcorrection
{\ifgridsnapping
\egroup
\else
\stopbaselinecorrection
\fi}
-\def\checkgridsnapping
+\unexpanded\def\checkgridsnapping
{\lineskip\ifgridsnapping\zeropoint\else\normallineskip\fi}
-
-\def\startcolumnmakeup % don't change
+
+%D Probably obsolete:
+
+\unexpanded\def\startcolumnmakeup % don't change
{\bgroup
- \getrawnoflines\textheight % teksthoogte kan topskip hebben, dus raw
- \scratchdimen\noflines\lineheight
- \advance\scratchdimen-\lineheight
- \advance\scratchdimen\topskip
- \setbox\scratchbox
- \ifcase\showgridstate\vbox\else\ruledvbox\fi to \scratchdimen\bgroup
- \forgetall} % ! don't change
-
-\def\stopcolumnmakeup
+ \getrawnoflines\textheight % raw as we cna have topskip
+ \setbox\scratchbox\vbox to \dimexpr\noflines\lineheight-\lineheight+\topskip\relax
+ \bgroup
+ \forgetall}
+
+\unexpanded\def\stopcolumnmakeup
{\egroup
\dp\scratchbox\zeropoint
\wd\scratchbox\textwidth
\box\scratchbox
\egroup
\page_otr_command_synchronize_hsize}
-
-% incomplete, will be a special case of float placement
-
-\def\startfixed{\dosingleempty\dostartfixed}
-
-\def\dostartfixed[#1]%
- {\expanded{\dowithnextbox{\noexpand\dodofixed{\ifhmode0\else1\fi}{#1}}}%
- \vbox\bgroup
- \setlocalhsize}
-
-\def\stopfixed
- {\egroup}
-
-\def\dodofixed#1#2%
- {\ifcase#1\relax
- \processaction
- [#2]
- [ \v!high=>\bbox {\flushnextbox},
- \v!low=>\tbox {\flushnextbox},
- \v!middle=>\vcenter{\flushnextbox},
- \v!lohi=>\vcenter{\flushnextbox},
- \s!unknown=>\tbox {\flushnextbox},
- \s!default=>\tbox {\flushnextbox}]%
- \else
- \startbaselinecorrection
- \noindent\flushnextbox
- \stopbaselinecorrection
- \fi}
-% \startitemize
-%
-% \item \externalfigure[koe][height=2cm]
-% \item \externalfigure[koe][height=2cm]
-% \item \externalfigure[koe][height=2cm]
-% \item \externalfigure[koe][height=2cm]
-%
-% \page
-%
-% \item \startfixed \externalfigure[koe][height=2cm]\stopfixed
-% \item \startfixed[high]\externalfigure[koe][height=2cm]\stopfixed
-% \item \startfixed[low] \externalfigure[koe][height=2cm]\stopfixed
-% \item \startfixed[lohi]\externalfigure[koe][height=2cm]\stopfixed
-%
-% \page
-%
-% \item test \startfixed \externalfigure[koe][height=2cm]\stopfixed
-% \item test \startfixed[high]\externalfigure[koe][height=2cm]\stopfixed
-% \item test \startfixed[low] \externalfigure[koe][height=2cm]\stopfixed
-% \item test \startfixed[lohi]\externalfigure[koe][height=2cm]\stopfixed
-%
-% \page
-%
-% \item test \par \startfixed \externalfigure[koe][height=2cm]\stopfixed
-% \item test \par \startfixed[high]\externalfigure[koe][height=2cm]\stopfixed
-% \item test \par \startfixed[low] \externalfigure[koe][height=2cm]\stopfixed
-% \item test \par \startfixed[lohi]\externalfigure[koe][height=2cm]\stopfixed
-%
-% \stopitemize
-
-\def\obeyfollowingtoken{{}} % end \cs scanning
-
-% potential new defaults:
-%
-% \setbreakpoints[compound]
-
-% till we fixed all styles:
+%D Till we fixed all styles:
\let\\=\crlf