diff options
Diffstat (limited to 'Master/texmf-dist/tex/context/base/tabl-tab.mkiv')
-rw-r--r-- | Master/texmf-dist/tex/context/base/tabl-tab.mkiv | 93 |
1 files changed, 34 insertions, 59 deletions
diff --git a/Master/texmf-dist/tex/context/base/tabl-tab.mkiv b/Master/texmf-dist/tex/context/base/tabl-tab.mkiv index 24bbb4dd607..b50be8531ef 100644 --- a/Master/texmf-dist/tex/context/base/tabl-tab.mkiv +++ b/Master/texmf-dist/tex/context/base/tabl-tab.mkiv @@ -4,8 +4,7 @@ %D title=\CONTEXT\ Table Macros, %D subtitle=\TABLE\ Embedding, %D author=Hans Hagen with copied and patched code from MJ Wichura, -%D date=\currentdate, -%D copyright=PRAGMA-ADE (patched and extensions)] +%D date=\currentdate] %C %C This module is part of the \CONTEXT\ macro||package and is %C therefore copyrighted by \PRAGMA. See mreadme.pdf for @@ -894,7 +893,7 @@ \def\@VLd{.125em} -\def\do!ttInsertVrule % will be merged in 2005 +\def\do!ttInsertVrule {\vrule\!!width \ifnum\!tgCode=\plusone \ifx\!tgValue\empty @@ -984,6 +983,9 @@ \def\donormaltableshortrule % was: \!ttShortHrule {\omit \!ttGetHalfRuleThickness + \ifx\tablecurrenthrulecolor\empty\else + \switchtocolor[\tablecurrenthrulecolor]% see *DL* + \fi \leaders\hrule\!!height\scratchdimen\!!depth\scratchdimen\hfill \emptyhbox \ignorespaces} @@ -1166,10 +1168,9 @@ %D \stoptable %D \stopbuffer %D -%D \startcombination -%D {\tracetablesfalse\getbuffer} {\type{\tracetablesfalse}} -%D {\tracetablestrue\getbuffer} {\type{\tracetablestrue}} -%D \stopcombination +%D \startlinecorrection +%D \getbuffer +%D \stoplinecorrection %D %D This table is specified as: %D @@ -1190,37 +1191,9 @@ %D \VL beta \VL 2 \VL\AR %D \VL gamma \VL 3 \VL\AR %D \HL -%D \stoptable -%D \stopbuffer -%D -%D When we use the split table feature, we get a bit more -%D information. -%D -%D {\tracetablesfalse\getbuffer} -%D -%D Sometimes in tables information shows up that is not typed -%D in by the user. These messages give a cue in what aspect a -%D table definition is wrong. -%D -%D \startbuffer -%D \starttable[||||] -%D \HL -%D \VL first second \VL third \VL\AR -%D \HL -%D \VL alfa \VL 1 \VL a \VL\AR -%D \VL beta \VL 2 \VL b \VL -%D \VL gamma \VL \THREE{3} c \VL\AR -%D \HL -%D \stoptable +%D \stoptables %D \stopbuffer %D -%D \typebuffer -%D -%D Those terrible table has three errors, which all show up in -%D typeset messages. Errors cannot always recovered 100\% and -%D therefore can result in two or more succesive messages, like -%D in the last row. -%D %D \getbuffer %D %D Some simple color support is provided: @@ -1239,7 +1212,8 @@ %D %D \typebuffer \getbuffer -\def\s!TaBlE{TaBlE} +\installcorenamespace{tabletemplate} + \def\m!TABLE{TABLE} %D We already saw that the table macros report errors and @@ -1293,16 +1267,14 @@ %D instead of brackets because we need brackets to specify the %D format. %D -%D \startbuffer +%D \starttyping %D \starttable{|q[00,000]|Q[00,00]|} %D \HL %D \VL -1,2 \VL 12,35 \VL\FR %D \VL 11,203 \VL 2,4 \VL\LR %D \HL %D \stoptable -%D \stopbuffer -%D -%D \ShowExample +%D \stoptyping %D %D Although a more efficient implementation is possible |<|we %D can for instance share common macros|>| we just adapt a copy @@ -1383,7 +1355,7 @@ % We cannot define \unexpanded\def\dostoptable a ssomehow lookahead % in alignments fail then, so we relax it and define it locally. -\let\stoptabel\relax +\let\stoptable\relax \def\dostoptable {\dochucktableautorow % before the tail, else noalign problem @@ -1404,7 +1376,7 @@ %D Before we can grab the argument, we have to make sure that %D the \CATCODES\ are set. The first stage takes care of that. -\def\firststagestarttable% +\def\firststagestarttable {\bgroup \global\intabletrue \secondstagestarttable} @@ -1428,6 +1400,9 @@ %D The implementation of the definition macro is not that %D complicated: +\installcorenamespace{tablehead} +\installcorenamespace{tabletail} + \unexpanded\def\definetabletemplate % to be redone {\bgroup \catcode\barasciicode\othercatcode @@ -1435,13 +1410,13 @@ \def\dodefinetabletemplate[#1][#2][#3][#4]% {\ifsecondargument - \setgvalue{\s!TaBlE#1}{\dousetabletemplate{#2}{#3}{#4}}% + \setgvalue{\??tabletemplate#1}{\dousetabletemplate{#2}{#3}{#4}}% \fi \egroup} \def\dousetabletemplate#1#2#3% - {\gdef\dotablehead{\getvalue{@@tablehead#2}}% - \gdef\dotabletail{\getvalue{@@tabletail#3}}% + {\gdef\dotablehead{\executeifdefined{\??tablehead#2}\empty}% + \gdef\dotabletail{\executeifdefined{\??tabletail#3}\empty}% \secondstagestarttable[#1]} %D The optional third and fourth arguments define which table @@ -1521,9 +1496,9 @@ \global\setfalse\hassometabletail \expanded{\doifinstringelse{|}{#1}} {\xdef\restarttable{\noexpand\dorestarttable{\noexpand\thirdstagestarttable{#1}}}} - {\doifdefinedelse{\s!TaBlE#1} - {\gdef\restarttable{\getvalue{\s!TaBlE#1}}} - {\gdef\restarttable{\dorestartable{\getvalue{#1}}}}}% + {\doifdefinedelse{\??tabletemplate#1} + {\gdef\restarttable{\getvalue{\??tabletemplate#1}}} + {\gdef\restarttable{\dorestarttable{\getvalue{#1}}}}}% \egroup \restarttable} @@ -1683,10 +1658,10 @@ \def\settablehead{\dodoubleempty\dosettablehead} \def\settabletail{\dodoubleempty\dosettabletail} -\long\def\dosettablehead[#1][#2]#3\end{\setvalue{@@tablehead#1}{\tablenoalign{\global\settrue\hassometablehead}#3}} -\long\def\dosettabletail[#1][#2]#3\end{\setvalue{@@tabletail#1}{\tablenoalign{\global\settrue\hassometabletail}#3}} +\long\def\dosettablehead[#1][#2]#3\end{\setvalue{\??tablehead#1}{\tablenoalign{\global\settrue\hassometablehead}#3}} +\long\def\dosettabletail[#1][#2]#3\end{\setvalue{\??tabletail#1}{\tablenoalign{\global\settrue\hassometabletail}#3}} -%D Redudant \type{\HL}'s are removed automatically, so +%D Redundant \type{\HL}'s are removed automatically, so %D mid||lines can be used without problems. %D The order of the next macros is more or less random. First @@ -2087,9 +2062,9 @@ \unexpanded\def\dotableDL {\dochecktabledivision - \dosingleempty\dotableDL} + \dosingleempty\dodotableDL} -\def\dotableDL[#1]% +\def\dodotableDL[#1]% {\ifnum\tableactionstate=\tablerulestate \writestatus\m!TABLE{skipping \string\DL}% \else @@ -2104,9 +2079,9 @@ \iffirstargument \global\let\tablecurrenthrulecolor\empty \rawprocesscommalist[#1]\dotabledrulecommand - \ifx\tablecurrenthrulecolor\empty\else - \switchtocolor[\tablecurrenthrulecolor]% - \fi + % \ifx\tablecurrenthrulecolor\empty\else + % \switchtocolor[\tablecurrenthrulecolor]% see *DL* + % \fi \fi \ifcase\tabledrulespan \global\advance\currenttablecolumn \plusone @@ -2202,7 +2177,7 @@ \def\dolocaltablesetup {\@@ticommands\relax - \expanded{\switchtobodyfont[\@@tibodyfont]}% expanded ? + \doifsomething\@@tibodyfont{\switchtobodyfont[\@@tibodyfont]}% \tablelinethicknessunit\dimexpr\@@tirulethickness/\tablelinethicknessfactor\relax \doifelse\@@tiheight\v!strut {\let\tablestrutheightfactor\tablestrutheightfactor} @@ -2279,7 +2254,7 @@ \c!rulethickness=\linewidth, \c!rulecolor=, \c!distance=\v!medium, - \c!bodyfont=\the\bodyfontsize, + \c!bodyfont=, \c!commands=, \c!background=\v!screen, \c!backgroundscreen=\@@rsscreen, |