%% %% This is file `decision-table.sty', %% generated with the docstrip utility. %% %% The original source files were: %% %% decision-table.dtx (with options: `package') %% %% Copyright (C) 2020 by S. Vandevelde, F. Pantigny %% %% This file may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either %% version 1.3c of this license or (at your option) any later %% version. The latest version of this license is in: %% %% http://www.latex-project.org/lppl.txt %% %% 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} \RequirePackage{l3keys2e} \ProvidesExplPackage {decision-table} {\dmnfiledate} {\dmnfileversion} {Table of decision} \RequirePackage { nicematrix } \NewDocumentCommand \dmntable { 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 } \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 } \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_input_int + \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 { \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_output_int + 1 } } ] } \exp_args:Ne \multicolumn { \int_eval:n { \l__dmn_input_int + 1 } } { l } { #1 } \\ #2 & \clist_use:Nn \l__dmn_input_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 - 1 } & } ##1 \int_compare:nTF { \c@jCol = \l__dmn_input_int + \l__dmn_output_int + 1 } { \\ } { & } } \end { NiceTabular } } \endinput %% %% End of file `decision-table.sty'.