summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/tabl-ntb.mkiv
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/context/base/tabl-ntb.mkiv')
-rw-r--r--Master/texmf-dist/tex/context/base/tabl-ntb.mkiv78
1 files changed, 40 insertions, 38 deletions
diff --git a/Master/texmf-dist/tex/context/base/tabl-ntb.mkiv b/Master/texmf-dist/tex/context/base/tabl-ntb.mkiv
index 96b1aabed82..99da4b5e8a3 100644
--- a/Master/texmf-dist/tex/context/base/tabl-ntb.mkiv
+++ b/Master/texmf-dist/tex/context/base/tabl-ntb.mkiv
@@ -5,7 +5,7 @@
%D subtitle=Natural Tables,
%D author=Hans Hagen,
%D date=\currentdate,
-%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%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
@@ -22,6 +22,24 @@
% todo: fast if
% todo: avoid halign (just do it manual) and thereby globals
+% bug: width 3cm is not honored and column becomes too wide
+% as given width is added to distributed width
+%
+% \bTABLE
+% \bTR
+% \bTD test \eTD
+% \bTD \framed[height=3cm]{test} \eTD
+% \bTD[width=3cm] \dorecurse{30}{a } \eTD
+% \bTD \input ward \eTD
+% \eTR
+% \bTR
+% \bTD test \eTD
+% \bTD \framed[height=3cm]{test} \eTD
+% \bTD \dorecurse{30}{a } \eTD
+% \bTD \input ward \eTD
+% \eTR
+% \eTABLE
+
% \unexpanded\def\startrow {\bTR}
% \unexpanded\def\stoprow {\eTR}
% \unexpanded\def\startcell#1\stopcell{\bTD#1\eTD}
@@ -61,24 +79,16 @@
% \placefigure[left]{}{}
% \startlinecorrection \dontleavehmode \bTABLE
% \bTR \bTD oeps \eTD \eTR
-% \eTABLE
-% \stoplinecorrection
+% \eTABLE \stoplinecorrection
% \placefigure[right]{}{}
% \startlinecorrection \dontleavehmode \bTABLE
% \bTR \bTD oeps \eTD \eTR
-% \eTABLE
-% \stoplinecorrection
+% \eTABLE \stoplinecorrection
% \stoptext
%D To Do:
%D
%D \starttyping
-%D splitsen = ja | herhaal => als nofTH>1 then ja als herhaal
-%D \stoptyping
-
-%D To Do:
-%D
-%D \starttyping
%D break over pagina
%D kop herhalen
%D reset settings
@@ -116,12 +126,13 @@
%D
%D \typebuffer \getbuffer
-\let\dotagTABLEalign\relax
+\ifdefined\dotagTABLEcell \else \let\dotagTABLEcell \relax \fi
+\ifdefined\dotagTABLEsignal \else \let\dotagTABLEsignal\relax \fi
\def\bTBLCELL % why not \doinhibitblank
{\inhibitblank
- \dotagTABLEalign
- \doconvertfont\tbltblstyle\empty
+ \dotagTABLEcell
+ \dousestyleparameter\tbltblstyle
\everypar{\tbltblleft\delayedbegstrut}}
\def\eTBLCELL
@@ -923,21 +934,6 @@
\fi
\egroup}}
-% \def\begintbl
-% {\global\tblspn\zerocount
-% \global\tblcol\zerocount
-% \global\tblrow\zerocount
-% \global\advance\tblrow\minusone
-% \tabskip\zeropoint
-% \halign\bgroup
-% \registerparoptions % new
-% \ignorespaces##\unskip&&\ignorespaces##\unskip\cr}
-
-% \def\endtbl
-% {\egroup}
-
-\let\dotagTABLEcell\relax
-
\def\begintbl
{\global\tblspn\zerocount
\global\tblcol\zerocount
@@ -950,10 +946,12 @@
\halign\bgroup
\registerparoptions
% watch out: tagging the cell happens at the outer level (faster)
- \ignorespaces##\unskip&&\dostarttagged\t!tablecell\empty\ignorespaces##\unskip\dostoptagged\cr} % one too many
+% \ignorespaces##\unskip&&\dostarttagged\t!tablecell\empty\ignorespaces##\unskip\dostoptagged\cr} % one too many
+ \ignorespaces##\unskip&&\ignorespaces##\unskip\cr} % one too many
\def\endtbl
- {\dostoptagged\egroup
+ {\dostoptagged
+ \egroup
\dostoptagged}
\setvalue{\tblnone TBL}#1#2%
@@ -1009,16 +1007,17 @@
\settblhei{#1}{\the\ht\scratchbox}%
\fi}%
-\let\dotagnoftablecolumns\relax
-\let\dotagnoftablerows \relax
+\newcount\tablecellrows
+\newcount\tablecellcolumns
\def\domakeTBLthree#1 #2 %
{% height
+ \dostarttagged\t!tablecell\empty
\!!counta \gettblcol{#1}{#2}\relax
\!!countb \gettblrow{#1}{#2}\relax
\!!heighta\gettblht {#1}{#2}\relax
-\dotagnoftablecolumns
-\dotagnoftablerows
+ \tablecellcolumns\!!counta % used later so don't adapt these
+ \tablecellrows \!!countb % used later so don't adapt these
\scratchdimen\zeropoint
\ifnum\!!counta=\maximumcol\relax
% case: nc=maxcolumns
@@ -1041,7 +1040,10 @@
\advance\scratchcounter\plusone}%
\edef\widthTBL{\the\dimexpr\scratchdimen-\tbltblcolumndistance\relax}%
% cell
- \setbox\scratchbox\hbox{\gettbltxt{#1}{#2}}%
+ \setbox\scratchbox\hbox attr \taggedattribute \attribute\taggedattribute \bgroup
+ \dotagTABLEsignal % maybe we need to add some packaging in this case
+ \gettbltxt{#1}{#2}%
+ \egroup
\ifnum\!!counta=\maximumcol\relax
% case: nc=maxcolumns
\else
@@ -1057,7 +1059,7 @@
\else
\normalexpanded{\noexpand\directgotobox{\box\scratchbox}[\!!stringa]}% to be checked
\fi
- \dotagTABLEcell} % right spot
+ \dostoptagged} % right spot
\def\inTBLcell#1#2% hm, do we need #1 #2 ? we use tblcol anyway
{\doifnotinset\localwidth{\v!fit,\v!broad}% user set
@@ -1384,7 +1386,7 @@
\settblht{#1}{#2}{\the\ht\scratchbox}%
\settblwd{#1}{#2}{\the\wd\scratchbox}%
\ifautoTBLcheckwidth
- \ifdim\wd\scratchbox<.75\hsize
+ \ifdim\wd\scratchbox<.75\hsize % fuzzy guess
\ifdim\ht\scratchbox>2\openlineheight % honor width since this
\scratchdimen\gettblaut\tblcol\relax % can be a figure or so
\ifdim\scratchdimen=\zeropoint