summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/tabl-tsp.mkiv
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/context/base/tabl-tsp.mkiv')
-rw-r--r--Master/texmf-dist/tex/context/base/tabl-tsp.mkiv55
1 files changed, 29 insertions, 26 deletions
diff --git a/Master/texmf-dist/tex/context/base/tabl-tsp.mkiv b/Master/texmf-dist/tex/context/base/tabl-tsp.mkiv
index 9ceb3af6e89..d274df6cb4a 100644
--- a/Master/texmf-dist/tex/context/base/tabl-tsp.mkiv
+++ b/Master/texmf-dist/tex/context/base/tabl-tsp.mkiv
@@ -13,14 +13,11 @@
\writestatus{loading}{ConTeXt Table Macros / Splitting}
-%D The code in this file is move here from other places.
+%D The code in this file is move here from other places and needs
+%D a mkiv cleanup.
\unprotect
-% only to be used with single tokens (will be prim)
-
-\ifx\htdp\undefined \def\htdp#1{\dimexpr\ht#1+\dp#1\relax} \fi
-
%D Although the name resembles floats, and therefore this should be
%D a page module, we decided to make it core functionality because the
%D table code depends on it. Othrwise there would be too much
@@ -29,12 +26,9 @@
% \splitfloat [settings] {\placetable[optional args]{test}} {content}
-% \def\s!noftablesplits{nofsplittables}
+% there is no need for a tracked structure number here
-\definenumber % we need a nicer name like nofsplittables, we then also need to set \s!parent
- [\??si]
- [\c!way=\v!by\v!text,
- \c!conversion=\@@siconversion]
+\newcount\noffloatssplits
\unexpanded\def\setupfloatsplitting
{\dodoubleargument\getparameters[\??si]}
@@ -59,8 +53,8 @@
\insidefloattrue
\insidesplitfloattrue
\getparameters[\??si][#1]%
- \resetnumber[\??si]%
- \def\floatcaptionsuffix{\convertednumber[\??si]}%
+ \global\noffloatssplits\zerocount
+ \def\floatcaptionsuffix{\convertnumber\@@siconversion\noffloatssplits}%
\let\extrasplitfloatlines\@@silines
\the\everysplitfloatsetup
\def\splitfloatcommand{#2}%
@@ -113,15 +107,20 @@
{\forgetall
\dontcomplain
\global\settrue\splitfloatdone
- \chardef\nodelocationmode\zerocount % bypass auto-renumbering
- \incrementnumber[\??si]%
- \ifcase\rawnumber[\??si]\or \ifconditional\onlyonesplitofffloat
- \let\floatcaptionsuffix\empty
- \fi \fi
+ \nodelocationmode\zerocount % bypass auto-renumbering
+ \global\advance\noffloatssplits\plusone
+ \ifcase\noffloatssplits\relax
+ \or
+ \ifconditional\onlyonesplitofffloat
+ \let\floatcaptionsuffix\empty
+ \fi
+ \else
+ \global\settrue\usesamefloatnumber % one shot
+ \fi
\bgroup
\ifconditional\somenextplitofffloat
\settrue\retainfloatnumber
-\notesenabledfalse % best here, experimental, brrr; test with note in caption
+ \notesenabledfalse % best here, experimental, brrr; test with note in caption
\else
\setfalse\retainfloatnumber
\fi
@@ -161,7 +160,7 @@
{\doif\extrasplitfloatlines\v!auto
{\bgroup
\settrue\retainfloatnumber
- \chardef\nodelocationmode\zerocount
+ \nodelocationmode\zerocount
\forcelocalfloats
\setuplocalfloats[\c!before=,\c!after=,\c!inbetween=]%
\splitfloatcommand{\hbox to \wd#1{\strut}}% dummy line
@@ -201,21 +200,25 @@
\newbox\tsplitnext
\newbox\tsplittail
-\def\resettsplit{% only \def's starting a a new line are seen by the dep checker
+\newtoks\everyresettsplit
+
+\def\resettsplit{\the\everyresettsplit}
+
+\appendtoks
\def\tsplitminimumfreelines{0}%
\def\tsplitminimumfreespace{0pt}%
- \setbox\tsplitcontent \vbox{}%
- \setbox\tsplitresult \vbox{}%
- \setbox\tsplithead \vbox{}%
- \setbox\tsplitnext \vbox{}%
- \setbox\tsplittail \vbox{}%
+ \setbox\tsplitcontent\emptyvbox
+ \setbox\tsplitresult \emptyvbox
+ \setbox\tsplithead \emptyvbox
+ \setbox\tsplitnext \emptyvbox
+ \setbox\tsplittail \emptyvbox
\let\tsplitbeforeresult\donothing
\let\tsplitafterresult \donothing
\let\tsplitinbetween \donothing
\let\tsplitbefore \donothing
\let\tsplitafter \donothing
\let\postprocesstsplit \donothing
-}
+\to \everyresettsplit
\resettsplit