summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/decision-table
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2021-10-01 22:02:48 +0000
committerKarl Berry <karl@freefriends.org>2021-10-01 22:02:48 +0000
commit4af946c33a1598291b1859381a7ab77c5fe268ab (patch)
tree642e82d7ad4800a45c7e94229bef0da3cadec0b9 /Master/texmf-dist/tex/latex/decision-table
parent70ae9df7d9a703df61a8f6287328a3c496150351 (diff)
decision-table (2oct21)
git-svn-id: svn://tug.org/texlive/trunk@60673 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/decision-table')
-rw-r--r--Master/texmf-dist/tex/latex/decision-table/decision-table.sty253
1 files changed, 250 insertions, 3 deletions
diff --git a/Master/texmf-dist/tex/latex/decision-table/decision-table.sty b/Master/texmf-dist/tex/latex/decision-table/decision-table.sty
index 19ece4adcc3..c48d3cb2d7e 100644
--- a/Master/texmf-dist/tex/latex/decision-table/decision-table.sty
+++ b/Master/texmf-dist/tex/latex/decision-table/decision-table.sty
@@ -6,7 +6,7 @@
%%
%% decision-table.dtx (with options: `package')
%%
-%% Copyright (C) 2020 by S. Vandevelde, F. Pantigny
+%% Copyright (C) 2020-2021 by S. Vandevelde, F. Pantigny
%%
%% This file may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either
@@ -18,8 +18,25 @@
%% and version 1.3c or later is part of all distributions of
%% LaTeX version 2005/12/01 or later.
%%
-\def\dmnfileversion{0.0.3}
-\def\dmnfiledate{2020/12/08}
+\def\dmnfileversion{0.0.4}
+\def\dmnfiledate{2021/10/01}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\RequirePackage{l3keys2e}
\ProvidesExplPackage
@@ -75,6 +92,236 @@
}
\end { NiceTabular }
}
+\NewDocumentCommand \dmnoutputtable { m m m m }
+ {
+ \clist_clear_new:N \l__dmn_output_clist
+ \clist_set:Nn \l__dmn_output_clist { #3 }
+ \int_zero_new:N \l__dmn_output_int
+ \int_set:Nn \l__dmn_output_int { \clist_count:N \l__dmn_output_clist }
+ \seq_clear_new:N \l__dmn_cells_seq
+ \seq_set_split:Nnn \l__dmn_cells_seq { , } { #4 }
+ \use:x
+ {
+ \exp_not:N \begin { NiceTabular }
+ { r \prg_replicate:nn { \l__dmn_output_int } l }
+ [
+ hvlines-except-corners ,
+ code-before =
+ \exp_not:N \rectanglecolor
+ { blue!10!green!60!black!30 }
+ { 2 - 2 }
+ { 2 - \int_eval:n { 1 } }
+ \exp_not:N \rectanglecolor
+ { green!30!blue!15 }
+ { 2 - \int_eval:n { 2 } }
+ { 2 - \int_eval:n { \l__dmn_output_int + 1 } }
+ ]
+ }
+ \exp_args:Ne \multicolumn
+ { \int_eval:n { 1 } }
+ { l }
+ { #1 } \\
+ #2 &
+ \clist_use:Nn \l__dmn_output_clist { & } \\
+ 1 &
+ \seq_map_inline:Nn \l__dmn_cells_seq
+ {
+ \int_compare:nT { \c@jCol = 0 } { \int_eval:n { \c@iRow - 1 } & }
+ ##1
+ \int_compare:nTF { \c@jCol = \l__dmn_output_int + 1 }
+ { \\ }
+ { & }
+ }
+ \end { NiceTabular }
+ }
+
+\NewDocumentCommand \glossarytable { m m m }
+ {
+ \clist_clear_new:N \l__clist
+ \clist_set:Nn \l__clist { #2 }
+ \int_zero_new:N \l__cint
+ \int_set:Nn \l__cint { \clist_count:N \l__clist }
+ \seq_clear_new:N \l__dmn_cells_seq
+ \seq_set_split:Nnn \l__dmn_cells_seq { , } { #3 }
+ \use:x
+ {
+ \exp_not:N \begin { NiceTabular }
+ { c \prg_replicate:nn { \l__cint -1 } c }
+ [
+ hvlines-except-corners ,
+ code-before =
+ \exp_not:N \rectanglecolor
+ { blue!30!green!10!red!40 }
+ { 1 - \int_eval:n { 1 } }
+ { 1 - \int_eval:n { \l__cint} }
+ ]
+ }
+ \exp_args:Ne \multicolumn
+ { \int_eval:n { \l__cint } }
+ { c }
+ { \textbf{#1} } \\
+ \bf \clist_use:Nn \l__clist { & \bf } \\
+ \seq_map_inline:Nn \l__dmn_cells_seq
+ {
+ \int_compare:nT { \c@jCol = 0 } { }
+ ##1
+ \int_compare:nTF { \c@jCol = \l__cint }
+ { \\ }
+ { & }
+ }
+ \end { NiceTabular }
+ }
+\NewDocumentCommand \pdmntable { m m m m m m}
+ {
+ \clist_clear_new:N \l__dmn_input_clist
+ \clist_set:Nn \l__dmn_input_clist { #3 }
+ \clist_clear_new:N \l__dmn_output_clist
+ \clist_set:Nn \l__dmn_output_clist { #4 }
+ \clist_clear_new:N \l__suboutput_clist
+ \clist_set:Nn \l__dmn_suboutput_clist { #5 }
+ \int_zero_new:N \l__dmn_input_int
+ \int_set:Nn \l__dmn_input_int { \clist_count:N \l__dmn_input_clist }
+ \int_zero_new:N \l__dmn_output_int
+ \int_set:Nn \l__dmn_output_int { \clist_count:N \l__dmn_output_clist }
+ \int_zero_new:N \l__dmn_suboutput_int
+ \int_set:Nn \l__dmn_suboutput_int { \clist_count:N \l__dmn_suboutput_clist }
+ \seq_clear_new:N \l__dmn_cells_seq
+ \seq_set_split:Nnn \l__dmn_cells_seq { , } { #6 }
+ \seq_clear_new:N \l__dmn_inputcells_seq
+ \seq_set_split:Nnn \l__dmn_inputcells_seq { , } { #3 }
+ \use:x
+ {
+ \exp_not:N \begin { NiceTabular }
+ { r \prg_replicate:nn { \l__dmn_input_int + \l__dmn_suboutput_int + 1} l }
+ [
+ hvlines-except-corners ,
+ code-before =
+ \exp_not:N \rectanglecolor
+ { blue!10!green!60!black!30 }
+ { 2 - 2 }
+ { 2 - \int_eval:n { \l__dmn_input_int + 1 } }
+ \exp_not:N \rectanglecolor
+ { green!30!blue!15 }
+ { 2 - \int_eval:n { \l__dmn_input_int + 2 } }
+ { 2 - \int_eval:n { \l__dmn_input_int + \l__dmn_suboutput_int + 1 } }
+ \exp_not:N \rectanglecolor
+ { red!60!green!60!blue!15}
+ { 3 - \int_eval:n { 1 } }
+ { 3 - \int_eval:n { \l__dmn_input_int + \l__dmn_suboutput_int + 1 } }
+ ]
+ }
+ \exp_args:Ne \multicolumn
+ { \int_eval:n { \l__dmn_input_int + 1 } }
+ { l }
+ { #1 } \\
+ #2 &
+ \clist_use:Nn \l__dmn_input_clist { & } &
+ \exp_args:Ne \multicolumn
+ { \int_eval:n {\l__dmn_suboutput_int}}
+ { c }
+ { #4 } \\
+ \seq_map_inline:Nn \l__dmn_inputcells_seq
+ { & }
+ & \clist_use:Nn \l__dmn_suboutput_clist { & } & \\
+ %\clist_use:Nn \l__dmn_output_clist { & } \\
+ 1 &
+ \seq_map_inline:Nn \l__dmn_cells_seq
+ {
+ \int_compare:nT { \c@jCol = 0 } { \int_eval:n { \c@iRow - 2 } & }
+ ##1
+ \int_compare:nTF { \c@jCol = \l__dmn_input_int + \l__dmn_suboutput_int + 1 }
+ { \\ }
+ { & }
+ }
+ \end { NiceTabular }
+ }
+\NewDocumentCommand \pdmnoutputtable { m m m m m }
+ {
+ \clist_clear_new:N \l__dmn_output_clist
+ \clist_set:Nn \l__dmn_output_clist { #3 }
+ \clist_clear_new:N \l__suboutput_clist
+ \clist_set:Nn \l__dmn_suboutput_clist { #4 }
+ \int_zero_new:N \l__dmn_output_int
+ \int_set:Nn \l__dmn_output_int { \clist_count:N \l__dmn_output_clist }
+ \int_zero_new:N \l__dmn_suboutput_int
+ \int_set:Nn \l__dmn_suboutput_int { \clist_count:N \l__dmn_suboutput_clist }
+ \seq_clear_new:N \l__dmn_cells_seq
+ \seq_set_split:Nnn \l__dmn_cells_seq { , } { #5 }
+ \use:x
+ {
+ \exp_not:N \begin { NiceTabular }
+ { r \prg_replicate:nn { \l__dmn_suboutput_int } l }
+ [
+ hvlines-except-corners ,
+ code-before =
+ \exp_not:N \rectanglecolor
+ { blue!10!green!60!black!30 }
+ { 2 - 2 }
+ { 2 - \int_eval:n { 1 } }
+ \exp_not:N \rectanglecolor
+ { green!30!blue!15 }
+ { 2 - \int_eval:n { 2 } }
+ { 2 - \int_eval:n { \l__dmn_suboutput_int + 1 } }
+ \exp_not:N \rectanglecolor
+ { red!60!green!60!blue!15}
+ { 3 - \int_eval:n { 1 } }
+ { 3 - \int_eval:n { \l__dmn_suboutput_int + 1 } }
+ ]
+ }
+ \exp_args:Ne \multicolumn
+ { \int_eval:n { 1 } }
+ { l }
+ { #1 } \\
+ #2 &
+ \exp_args:Ne \multicolumn
+ { \int_eval:n {\l__dmn_suboutput_int}}
+ { c }
+ { #3 } \\
+ & \clist_use:Nn \l__dmn_suboutput_clist { & } \\
+ 1 &
+ \seq_map_inline:Nn \l__dmn_cells_seq
+ {
+ \int_compare:nT { \c@jCol = 0 } { \int_eval:n { \c@iRow - 1 } & }
+ ##1
+ \int_compare:nTF { \c@jCol = \l__dmn_suboutput_int + 1 }
+ { \\ }
+ { & }
+ }
+ \end { NiceTabular }
+ }
+
+\NewDocumentCommand \goaltable { m m }
+ {
+ \seq_clear_new:N \l__dmn_cells_seq
+ \seq_set_split:Nnn \l__dmn_cells_seq { , } { #2 }
+ \use:x
+ {
+ \exp_not:N \begin { NiceTabular }
+ { \prg_replicate:nn { 1 } c }
+ [
+ hvlines-except-corners ,
+ code-before =
+ \exp_not:N \rectanglecolor
+ { blue!30!green!10!red!20 }
+ { 1 - \int_eval:n { 1 } }
+ { 1 - \int_eval:n { 1} }
+ ]
+ }
+ \textbf{#1} \\
+ %\exp_args:Ne \multicolumn
+ % { \int_eval:n { 1 } }
+ % { c }
+ % { \textbf{#1} } \\
+ \seq_map_inline:Nn \l__dmn_cells_seq
+ {
+ \int_compare:nT { \c@jCol = 0 } { }
+ ##1
+ \int_compare:nTF { \c@jCol = 1 }
+ { \\ }
+ { & }
+ }
+ \end { NiceTabular }
+ }
\endinput
%%