summaryrefslogtreecommitdiff
path: root/tex/context/base/tabl-tbl.mkiv
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2012-10-16 18:23:00 +0200
committerHans Hagen <pragma@wxs.nl>2012-10-16 18:23:00 +0200
commit5f5f059b294f1cd20c306d1c7b03ff211740c814 (patch)
treecc4be05f3409d4247a29067240e8cc53fc2e2d4f /tex/context/base/tabl-tbl.mkiv
parent14c9c4a29887284d2a4756e418be08352ccb5184 (diff)
downloadcontext-5f5f059b294f1cd20c306d1c7b03ff211740c814.tar.gz
beta 2012.10.16 18:23
Diffstat (limited to 'tex/context/base/tabl-tbl.mkiv')
-rw-r--r--tex/context/base/tabl-tbl.mkiv64
1 files changed, 61 insertions, 3 deletions
diff --git a/tex/context/base/tabl-tbl.mkiv b/tex/context/base/tabl-tbl.mkiv
index 90fba1e69..0bd2fb05e 100644
--- a/tex/context/base/tabl-tbl.mkiv
+++ b/tex/context/base/tabl-tbl.mkiv
@@ -1046,17 +1046,48 @@
\def\tabl_tabulate_start_head_nop{\tabl_tabulate_start_head_yes[]}
\def\tabl_tabulate_start_foot_nop{\tabl_tabulate_start_foot_yes[]}
+% \unexpanded\def\tabl_start_defined[#1]%
+% {\bgroup
+% \edef\currenttabulationparent{#1}%
+% \let\currenttabulation\currenttabulationparent
+% \doifnextoptionalelse\tabl_start_defined_yes\tabl_start_defined_nop}
+%
+% \def\tabl_start_defined_yes[#1]%
+% {\edef\currenttabulation{\currenttabulation:#1}%
+% \tabl_tabulate_start_building}
+%
+% \def\tabl_start_defined_nop
+% {\tabl_tabulate_start_building}
+
\unexpanded\def\tabl_start_defined[#1]%
{\bgroup
\edef\currenttabulationparent{#1}%
\let\currenttabulation\currenttabulationparent
- \doifnextoptionalelse\tabl_start_defined_yes\tabl_start_defined_nop}
+ \dodoubleargument\tabl_start_defined_indeed}
+
+\def\tabl_start_defined_indeed
+ {\iffirstargument
+ \ifsecondargument
+ \doubleexpandafter\tabl_start_defined_two
+ \else
+ \doubleexpandafter\tabl_start_defined_one
+ \fi
+ \else
+ \singleexpandafter\tabl_start_defined_zero
+ \fi}
-\def\tabl_start_defined_yes[#1]%
+\def\tabl_start_defined_one[#1][#2]%
+ {\doifassignmentelse{#1}
+ {\setuptabulation[\currenttabulation][#1]}%
+ {\edef\currenttabulation{\currenttabulation:#1}}%
+ \tabl_tabulate_start_building}
+
+\def\tabl_start_defined_two[#1][#2]%
{\edef\currenttabulation{\currenttabulation:#1}%
+ \setuptabulation[\currenttabulation][#2]%
\tabl_tabulate_start_building}
-\def\tabl_start_defined_nop
+\def\tabl_start_defined_zero[#1][#2]%
{\tabl_tabulate_start_building}
% \definetabulate[\v!tabulate][|l|p|] % we need to get rid of this one
@@ -2282,4 +2313,31 @@
[\v!fact]
[\c!unit=.75em,\c!inner=\setquicktabulate\fact,EQ={=}]
+%D Another example:
+%D
+%D \starttyping
+%D \definetabulate
+%D [whatever]
+%D [|l|r|]
+%D
+%D \definetabulate
+%D [whatever][else]
+%D [|l|c|r|]
+%D
+%D \startwhatever
+%D \NC l \NC r \NC \NR
+%D \NC left \NC right \NC \NR
+%D \stopwhatever
+%D
+%D \startwhatever[else]
+%D \NC l \NC m \NC r \NC \NR
+%D \NC left \NC middle \NC right \NC \NR
+%D \stopwhatever
+%D
+%D \startwhatever[else][format={|c|c|c|c|}]
+%D \NC l \NC m \NC m \NC r \NC \NR
+%D \NC left \NC middle \NC middle \NC right \NC \NR
+%D \stopwhatever
+%D \stoptyping
+
\protect \endinput