diff options
Diffstat (limited to 'tex/context/base/tabl-tab.mkiv')
-rw-r--r-- | tex/context/base/tabl-tab.mkiv | 174 |
1 files changed, 75 insertions, 99 deletions
diff --git a/tex/context/base/tabl-tab.mkiv b/tex/context/base/tabl-tab.mkiv index b9b519620..b50be8531 100644 --- a/tex/context/base/tabl-tab.mkiv +++ b/tex/context/base/tabl-tab.mkiv @@ -80,7 +80,7 @@ \appendtoks \parindent\zeropoint \raggedright - \rightskip\zeropoint \s!plus 4em \relax + \rightskip\zeropoint \!!plus 4em \relax \to \everytableparbox \newskip \tablelefttabskip @@ -854,8 +854,11 @@ \lineskiplimit\zeropoint \lineskip \zeropoint \tabskip \zeropoint - \edef\p_tabl_table_textwidth{\directtablesparameter\c!textwidth}% - \halign \ifx\p_tabl_table_textwidth\empty \else to \ifx\p_tabl_table_textwidth\v!max \hsize \else \p_tabl_table_textwidth \fi\fi + \doifelsenothing\@@titextwidth + {\halign} + {\doifelse\@@titextwidth\v!max + {\halign to \hsize} + {\halign to \@@titextwidth}}% % \the\!taTableSpread \bgroup \span @@ -875,9 +878,9 @@ \def\donormaltablelineformat#1#2% {\vrule - \s!width \zeropoint - \s!height\dimexpr\tablestrutheightfactor\tablestrutunit+#1\tablestrutunit\relax - \s!depth \dimexpr\tablestrutdepthfactor \tablestrutunit+#2\tablestrutunit\relax + \!!width \zeropoint + \!!height\dimexpr\tablestrutheightfactor\tablestrutunit+#1\tablestrutunit\relax + \!!depth \dimexpr\tablestrutdepthfactor \tablestrutunit+#2\tablestrutunit\relax \relax \cr} @@ -974,7 +977,7 @@ \def\donormaltablefullrule {\starttablenoalign \!ttGetHalfRuleThickness - \hrule\s!height\scratchdimen\s!depth\scratchdimen + \hrule\!!height\scratchdimen\!!depth\scratchdimen \stoptablenoalign} \def\donormaltableshortrule % was: \!ttShortHrule @@ -983,7 +986,7 @@ \ifx\tablecurrenthrulecolor\empty\else \switchtocolor[\tablecurrenthrulecolor]% see *DL* \fi - \leaders\hrule\s!height\scratchdimen\s!depth\scratchdimen\hfill + \leaders\hrule\!!height\scratchdimen\!!depth\scratchdimen\hfill \emptyhbox \ignorespaces} @@ -1019,7 +1022,7 @@ % SetTableToWidth -> textwidth=dimension [to dimension] % Expand -> textwidth=max [to \hsize] % WidenTableBy -> [spread #1] -% \tablelefttabskip\zeropoint\s!plus1\s!fill +% \tablelefttabskip\zeropoint\!!plus1fill % \tablerighttabskip\tablelefttabskip % LongLines -> [spread \hsize] @@ -1327,38 +1330,26 @@ \newconditional\tablerepeathead \newconditional\tablerepeattail + \unexpanded\def\starttable {\bgroup \dodoubleempty\dostarttable} \unexpanded\def\dostarttable[#1][#2]% preamble optional-settings {\ifsecondargument - \setupcurrenttables[#2]% + \getparameters[\??ti][#2]% \fi \let\stoptable\dostoptable - \edef\p_tabl_table_split{\directtablesparameter\c!split}% - \edef\p_tabl_table_frame{\directtablesparameter\c!frame}% - \ifx\p_tabl_table_split\v!auto - \ifinsidesplitfloat - \let\p_tabl_table_split\v!yes - \lettablesparameter\c!split\v!yes % might be used later, best make a proper mode - \fi - \fi - \ifx\p_tabl_table_split\v!yes - \def\stoptable{\dostoptables\egroup}% not \unexpanded as we look ahead - \expandafter\starttables - \else\ifx\p_tabl_table_split\v!repeat - \def\stoptable{\dostoptables\egroup}% not \unexpanded as we look ahead - \doubleexpandafter\starttables - \else - \ifx\p_tabl_table_frame\empty - \ifinsidefloat\else\startbaselinecorrection\fi - \else - \startframedcontent[\p_tabl_table_frame]% - \fi - \postponenotes - \doubleexpandafter\firststagestarttable - \fi\fi + \doif\@@tisplit\v!auto + {\ifinsidesplitfloat\let\@@tisplit\v!yes\fi}% + \doifinsetelse\@@tisplit{\v!yes,\v!repeat} + {\unexpanded\def\stoptable{\stoptables\egroup}% + \starttables} + {\doifelsenothing\@@tiframe + {\ifinsidefloat\else\startbaselinecorrection\fi} + {\startframedcontent[\@@tiframe]}% + \postponenotes + \firststagestarttable}% [#1]} % We cannot define \unexpanded\def\dostoptable a ssomehow lookahead @@ -1374,14 +1365,12 @@ \globalletempty\dotabletail \stoptablenoalign \dofinishtable - \ifx\p_tabl_table_frame\empty - \ifinsidefloat\else + \doifelsenothing\@@tiframe + {\ifinsidefloat\else \stopbaselinecorrection \goodbreak % compensates all the nobreaks - \fi - \else + \fi} \stopframedcontent - \fi \egroup} %D Before we can grab the argument, we have to make sure that @@ -1476,7 +1465,7 @@ % \def\doverysimpletableHL % todo % {\starttablenoalign -% \normalexpanded{\noexpand\donormaltablefullrule\m_tabl_table_HLheight}% +% \expandafter\donormaltablefullrule\@@tiHLheight % \stoptablenoalign} \def\dorestarttable#1% @@ -1576,14 +1565,9 @@ {\bgroup \let\stoptables\dostoptables \splittablestrue - \edef\p_tabl_table_split{\directtablesparameter\c!split}% - \ifx\p_tabl_table_split\v!repeat - \settrue\tablerepeathead - \settrue\tablerepeattail - \else - \setfalse\tablerepeathead - \setfalse\tablerepeattail - \fi + \doifelse\@@tisplit\v!repeat + {\settrue \tablerepeathead\settrue \tablerepeattail} + {\setfalse\tablerepeathead\setfalse\tablerepeattail}% \flushnotes \setbox\tablecontentbox\vbox\bgroup \forgetall @@ -1591,7 +1575,7 @@ \let\stoptables\relax % needed for \noalign -\def\dostoptables % not \unexpanded as we need the lookahead (brrr) +\def\dostoptables {\dochucktableautorow % AM: before the tail, else noalign problem \ifconditional\tablerepeattail\else\doinserttabletail\fi \dofinishtable @@ -1915,7 +1899,7 @@ \def\dotablevrulecommand#1% global assignments {\doifnumberelse{#1} {\global\tablevrulethicknessfactor#1\relax - \global\multiply\tablevrulethicknessfactor\m_tabl_table_VLwidth\relax} + \global\multiply\tablevrulethicknessfactor\@@tiVLwidth\relax} {\xdef\tablecurrentvrulecolor{#1}}} \unexpanded\def\dotableVL @@ -1925,7 +1909,7 @@ \def\dodotableVL[#1]% {\global\let\tablecurrentvrulecolor\empty - \global\tablevrulethicknessfactor\m_tabl_table_VLwidth\relax + \global\tablevrulethicknessfactor\@@tiVLwidth\relax \iffirstargument \rawprocesscommalist[#1]\dotablevrulecommand \fi @@ -1949,7 +1933,7 @@ \def\dotablehrulecommand#1% global assignments {\doifnumberelse{#1} {\global\tablehrulethicknessfactor#1\relax - \global\multiply\tablehrulethicknessfactor\m_tabl_table_HLheight\relax} + \global\multiply\tablehrulethicknessfactor\@@tiHLheight\relax} {\xdef\tablecurrenthrulecolor{#1}}} \unexpanded\def\dotableHL @@ -1969,7 +1953,7 @@ \writestatus\m!TABLE{change \string\MR\space into \string\SR}% \fi\fi \bgroup - \global\tablehrulethicknessfactor\m_tabl_table_HLheight\relax + \global\tablehrulethicknessfactor\@@tiHLheight\relax \iffirstargument \global\let\tablecurrenthrulecolor\empty \rawprocesscommalist[#1]\dotablehrulecommand @@ -2020,10 +2004,10 @@ {\dochucktableautorow \dofinishtablerow \starttablenoalign - \dosingleempty\dodotableTB} + \dosingleempty\dotableTB} -\def\dodotableTB[#1]% - {\blank[\iffirstargument#1\else\directtablesparameter\c!NL\fi]% +\def\dotableTB[#1]% + {\blank[\iffirstargument#1\else\@@tiNL\fi]% \nobreak \stoptablenoalign} @@ -2072,7 +2056,7 @@ \global\tabledrulespan#1\relax \else \global\tablehrulethicknessfactor#1\relax - \global\multiply\tablehrulethicknessfactor\m_tabl_table_VLwidth\relax + \global\multiply\tablehrulethicknessfactor\@@tiVLwidth\relax \fi} {\xdef\tablecurrenthrulecolor{#1}}} @@ -2090,7 +2074,7 @@ \writestatus\m!TABLE{change \string\MR\space into \string\SR}% \fi\fi \dosettableaction\tableunknownstate - \global\tablehrulethicknessfactor\m_tabl_table_HLheight\relax + \global\tablehrulethicknessfactor\@@tiHLheight\relax \global\tabledrulespan\zerocount \iffirstargument \global\let\tablecurrenthrulecolor\empty @@ -2152,28 +2136,17 @@ \let\REF \dotablereformat \to \localtabledefinitions -\installcorenamespace{tables} -\installcorenamespace{tabledistance} -\installcorenamespace{tablealign} - -\installsetuponlycommandhandler \??tables {tables} % some day we can have named tables - -\setvalue{\??tabledistance\v!none }{\dotableOpenUp00\def\LOW{\Lower6 }} -\setvalue{\??tabledistance\v!small }{\dotableOpenUp00\def\LOW{\Lower6 }} % == baseline -\setvalue{\??tabledistance\v!medium}{\dotableOpenUp11\def\LOW{\Lower7 }} -\setvalue{\??tabledistance\v!big }{\dotableOpenUp22\def\LOW{\Lower8 }} +\setvalue{\??ti:\c!distance:\v!none }{\dotableOpenUp00\def\LOW{\Lower6 }} +\setvalue{\??ti:\c!distance:\v!small }{\dotableOpenUp00\def\LOW{\Lower6 }} % == baseline +\setvalue{\??ti:\c!distance:\v!medium}{\dotableOpenUp11\def\LOW{\Lower7 }} +\setvalue{\??ti:\c!distance:\v!big }{\dotableOpenUp22\def\LOW{\Lower8 }} \appendtoks - \expandcheckedcsname\??tabledistance{\directtablesparameter\c!distance}\v!medium + \getvalue{\??ti:\c!distance:\@@tidistance}% \to \localtabledefinitions -\setvalue{\??tablealign\v!right }{\def\dotableparalignment{\raggedright}} -\setvalue{\??tablealign\v!left }{\def\dotableparalignment{\raggedleft}} -\setvalue{\??tablealign\v!middle }{\def\dotableparalignment{\raggedcenter}} -\setvalue{\??tablealign\s!unknown}{\def\dotableparalignment{\notragged}} - \appendtoks - \doifelse{\directtablesparameter\c!distance}\v!none + \doifelse\@@tidistance\v!none {\tablerowfactor\zerocount} {\tablerowfactor\plustwo }% \to \localtabledefinitions @@ -2187,28 +2160,31 @@ \@EAEAEA\dotextmodebar \fi\fi} -\appendtoks - \expandcheckedcsname\??tablealign{\directtablesparameter\c!align}\s!unknown - \assignalfadimension{\directtablesparameter\c!VL}\m_tabl_table_VLwidth 246% - \assignalfadimension{\directtablesparameter\c!HL}\m_tabl_table_HLheight246% -\to \everysetuptables +\unexpanded\def\setuptables + {\dosingleargument\dosetuptables} + +\def\dosetuptables[#1]% + {\getparameters[\??ti][#1]% + \processaction % we have a command for this + [\@@tialign] + [ \v!right=>\def\dotableparalignment{\raggedright}, + \v!left=>\def\dotableparalignment{\raggedleft}, + \v!middle=>\def\dotableparalignment{\raggedcenter}, + \s!default=>\def\dotableparalignment{\notragged}, + \s!unknown=>\def\dotableparalignment{\notragged}]% + \assignalfadimension\@@tiVL\@@tiVLwidth 246% + \assignalfadimension\@@tiHL\@@tiHLheight246} \def\dolocaltablesetup - {\directtablesparameter\c!commands\relax - \doifsomething{\directtablesparameter\c!bodyfont}{\switchtobodyfont[\directtablesparameter\c!bodyfont]}% - \tablelinethicknessunit\dimexpr\directtablesparameter\c!rulethickness/\tablelinethicknessfactor\relax - \edef\p_tabl_table_height{\directtablesparameter\c!height}% - \edef\p_tabl_table_depth{\directtablesparameter\c!depth}% - \ifx\p_tabl_table_height\v!strut - \let\tablestrutheightfactor\tablestrutheightfactor - \else - \let\tablestrutheightfactor\p_tabl_table_height - \fi - \ifx\p_tabl_table_depth\v!strut - \let\tablestrutdepthfactor\tablestrutdepthfactor - \else - \let\tablestrutdepthfactor\p_tabl_table_depth - \fi + {\@@ticommands\relax + \doifsomething\@@tibodyfont{\switchtobodyfont[\@@tibodyfont]}% + \tablelinethicknessunit\dimexpr\@@tirulethickness/\tablelinethicknessfactor\relax + \doifelse\@@tiheight\v!strut + {\let\tablestrutheightfactor\tablestrutheightfactor} + {\let\tablestrutheightfactor\@@tiheight}% + \doifelse\@@tidepth\v!strut + {\let\tablestrutdepthfactor\tablestrutdepthfactor} + {\let\tablestrutdepthfactor\@@tidepth}% \edef\tablestrutheightfactor{\withoutpt\the\dimexpr10\dimexpr\tablestrutheightfactor\points}% \edef\tablestrutdepthfactor {\withoutpt\the\dimexpr10\dimexpr\tablestrutdepthfactor \points}% \tablestrutunit\dimexpr\normalbaselineskip/12\relax % 12 is default bodyfont @@ -2267,9 +2243,9 @@ %D \stopcombination \setuptables - [\c!HL=\v!medium, - \c!VL=\v!medium, - \c!NL=\v!small, + [HL=\v!medium, + VL=\v!medium, + NL=\v!small, \c!frame=, \c!align=\v!right, \c!depth=.40, % \v!strut @@ -2280,8 +2256,8 @@ \c!distance=\v!medium, \c!bodyfont=, \c!commands=, - \c!background=\v!screen, % huh? - \c!backgroundscreen=\defaultbackgroundscreen, + \c!background=\v!screen, + \c!backgroundscreen=\@@rsscreen, \c!backgroundcolor=, \c!split=\v!auto] |