texlive[48004] Master/texmf-dist: cellprops (13jun18)

commits+karl at tug.org commits+karl at tug.org
Wed Jun 13 23:44:12 CEST 2018


Revision: 48004
          http://tug.org/svn/texlive?view=revision&revision=48004
Author:   karl
Date:     2018-06-13 23:44:12 +0200 (Wed, 13 Jun 2018)
Log Message:
-----------
cellprops (13jun18)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/cellprops/cellprops.pdf
    trunk/Master/texmf-dist/source/latex/cellprops/cellprops.dtx
    trunk/Master/texmf-dist/tex/latex/cellprops/cellprops.sty

Modified: trunk/Master/texmf-dist/doc/latex/cellprops/cellprops.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/source/latex/cellprops/cellprops.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/cellprops/cellprops.dtx	2018-06-13 21:43:58 UTC (rev 48003)
+++ trunk/Master/texmf-dist/source/latex/cellprops/cellprops.dtx	2018-06-13 21:44:12 UTC (rev 48004)
@@ -15,7 +15,7 @@
 \def\ExplFileName{cellprops}
 \def\ExplFileDescription{CSS-like cell and table properties}
 \def\ExplFileDate{2018/06/12}
-\def\ExplFileVersion{1.1a}
+\def\ExplFileVersion{1.2}
 %</driver|package>
 %<*driver>
 \documentclass[full]{l3doc}
@@ -164,6 +164,8 @@
 %        corresponding vertical alignment (\cs{vtop}, \cs{vcenter} or \cs{vbox}).
 %    \item "*{"\<count>"}{"\<coltypes>"}": same as in \pkg{array} or
 %        \pkg{mdwtab}.
+%    \item ">{"\<prefix>"}" and "<{"\<suffix>"}":
+%        same as in \pkg{array} or \pkg{mdwtab}.
 %    \item You can try to use constructs of \pkg{array} or \pkg{mdwtab}, but they
 %        might alter the function of \pkg{cellprops}. Most should be fine though.
 % \end{itemize}
@@ -197,9 +199,16 @@
 %       handle those without slowing down the general case.
 % \end{itemize}
 %
+% \subsection{Compatibility}
+%
+% This package has been tested compatible with \pkg{diagbox}, \pkg{spreadtab},
+% \pkg{collcell}. Compatibility with \pkg{longtable} has been specifically taken
+% care of, provided \pkg{cellprops} is loaded afterwards.
+%
 % \subsection{TODO}
 %
-% Add "border" properties. Test with different table-oriented packages. Improve
+% Add "border" properties. Test with different table-oriented packages, and add
+% a test suite with compatibility tests. Improve
 % the documentation, and test more \LaTeX\ table constructs and preamble column
 % types. Enforce $n\ge0$ in ":nth-child" selectors to match the CSS
 % specification.
@@ -268,7 +277,11 @@
 }
 
 \cs_set_protected_nopar:Nn \@@_get_property:nN {
-    \tl_set_eq:Nc #2 { l_@@_property_value_#1_tl }
+    \tl_if_exist:cTF { l_@@_property_value_#1_tl } {
+        \tl_set_eq:Nc #2 { l_@@_property_value_#1_tl }
+    }{
+        \tl_clear:N #2
+    }
 }
 %    \end{macrocode}
 %   \end{macro}
@@ -595,8 +608,7 @@
 \tl_new:N  \l_@@_bgcolor_tl
 
 % To count rows and columns
-\cs_set_eq:NN \@@_orig_array: \@array
-\cs_set_protected_nopar:Npn \@array[#1]#2 {
+\cs_new_protected:Nn \@@_array_init: {
     \tl_set:Nx \l_@@_restore_tl {
         \bool_if:NTF \g_@@_inrow_bool {
             \exp_not:n {\bool_gset_true:N \g_@@_inrow_bool}
@@ -614,12 +626,8 @@
     }
     \int_gzero:N \g_@@_row_int
     \bool_gset_false:N \g_@@_inrow_bool
-    \cs_set_eq:NN \@@_orig_tab at initread: \tab at initread
-    \cs_set_protected_nopar:Npn \tab at initread {
-        \cs_set_eq:NN \tab at initread \@@_orig_tab at initread:
-        \tab at initread
-        \tl_put_left:Nn \tab at tabtext {\int_gincr:N \g_@@_col_int}
-    }
+    \cs_set_eq:NN \@@_orig_tab at readpreamble:n \tab at readpreamble
+    \cs_set_eq:NN \tab at readpreamble \@@_readpreamble:n
 %    \end{macrocode}
 % Zero \cs{col at sep} but remember its value for the default padding.
 %    \begin{macrocode}
@@ -643,9 +651,43 @@
     \tl_set_eq:NN \l_@@_color_tl \g_tmpa_tl
     \tl_set_eq:NN \l_@@_bgcolor_tl \g_tmpb_tl
     \@@_recall_properties:n {tr}
-    \@@_orig_array:[{#1}]{#2}
+}
+
+\cs_set_nopar:Nn \@@_array_startcontent: {
     \hlx{s[\l_@@_tablepadding_top_dim]}
 }
+
+\cs_set_protected_nopar:Nn \@@_readpreamble:n {
+    \cs_set_eq:NN \tab at readpreamble \@@_orig_tab at readpreamble:n
+    \tl_put_left:Nn \tab at multicol {\@@_startrow:}
+    \tl_put_left:Nn \tab at tabtext {\int_gincr:N \g_@@_col_int}
+    \tab at readpreamble{#1}
+    \exp_args:Nx \tab at preamble
+        { \exp_not:N\@@_startrow: \the\tab at preamble \exp_not:N\@@_endrow: }
+}
+
+
+\cs_set_eq:NN \@@_orig_array:w \@array
+\cs_set_protected_nopar:Npn \@array[#1]#2 {
+    \@@_array_init:
+    \@@_orig_array:w [#1]{#2}
+    \@@_array_startcontent:
+}
+
+\cs_set_eq:NN \@@_orig_LTmkpream:n \@mkpream
+\cs_set_protected_nopar:Npn \@mkpream#1 {
+    \group_end:
+    \@@_array_init:
+    \group_begin:
+    \@@_orig_LTmkpream:n {#1}
+}
+
+\cs_set_eq:NN \@@_orig_LTarray:w \LT at array
+\cs_set_protected_nopar:Npn \LT at array [#1]#2 {
+    \@@_orig_LTarray:w [#1]{#2}
+    \@@_array_startcontent:
+}
+
 %    \end{macrocode}
 % The color inheritance is handled with \cs{l_@@_inherit_color_tl},
 % \cs{l_@@_color_tl} and \cs{l_@@_bgcolor_tl}. The role of
@@ -654,9 +696,9 @@
 % the inherit variable.
 %    \begin{macrocode}
 \cs_new_protected_nopar:Nn \@@_update_color:Nn {
-    \@@_get_property:nN {#2} \l_tmpc_tl
-    \exp_args:NV \tl_if_eq:NNF \l_tmpc_tl \c_@@_inherit_color_tl {
-        \tl_set_eq:NN #1 \l_tmpc_tl
+    \@@_get_property:nN {#2} \l_tmpa_tl
+    \exp_args:NV \tl_if_eq:NNF \l_tmpa_tl \c_@@_inherit_color_tl {
+        \tl_set_eq:NN #1 \l_tmpa_tl
     }
 }
 
@@ -665,17 +707,24 @@
     \@@_update_color:Nn \l_@@_bgcolor_tl {background-color}
 }
 
-\cs_set_eq:NN \@@_orig_endarray: \endarray
-\cs_set_nopar:Npn \endarray {
+\cs_set_nopar:Nn \@@_end_array:n {
     \crcr
     \hlx{s[\l_@@_tablepadding_bottom_dim]}
-    \@@_orig_endarray:
+    #1
     \tl_use:N \l_@@_restore_tl
 }
 
-\cs_set_eq:NN \@@_orig_tab at startrow: \tab at startrow
-\cs_set_nopar:Npn \tab at startrow {
-    \@@_orig_tab at startrow:
+\cs_set_eq:NN \@@_orig_endarray: \endarray
+\cs_set_nopar:Npn \endarray {
+    \@@_end_array:n { \@@_orig_endarray: }
+}
+
+\cs_set_eq:NN \@@_orig_endLT: \endlongtable
+\cs_set_nopar:Npn \endlongtable {
+    \@@_end_array:n { \@@_orig_endLT: }
+}
+
+\cs_set_protected_nopar:Nn \@@_startrow: {
     \bool_if:NF \g_@@_inrow_bool {
         \bool_gset_true:N \g_@@_inrow_bool
         \int_gincr:N \g_@@_row_int
@@ -685,17 +734,16 @@
     }
 }
 
-\cs_set_eq:NN \@@_orig_tab at arraycr: \tab at arraycr
-\cs_set_protected_nopar:Npn \tab at arraycr {
+\cs_set_protected_nopar:Npn \@@_endrow: {
     \bool_if:NT \g_@@_inrow_bool {
         \bool_gset_false:N \g_@@_inrow_bool
         \@@_fix_valign_end:
     }
-    \@@_orig_tab at arraycr:
 }
 
+\cs_set_eq:NN \@@_orig_tab at arraycr:n \tab at arraycr
+\cs_set_nopar:Npn \tab at arraycr { \@@_endrow:\@@_orig_tab at arraycr:n }
 
-
 \cs_set_eq:NN \@@_orig_multicolumn:w \multicolumn
 \cs_set:Npn \multicolumn#1#2#3 {
     \@@_orig_multicolumn:w {#1}{#2}{
@@ -704,7 +752,6 @@
     }
 }
 
-
 \cs_new_protected_nopar:Nn \@@_fix_valign_end: {
     \exp_args:NV \tl_if_eq:nnTF \tab at hlstate {b} {
         \dim_gadd:Nn \tab at endheight {

Modified: trunk/Master/texmf-dist/tex/latex/cellprops/cellprops.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/cellprops/cellprops.sty	2018-06-13 21:43:58 UTC (rev 48003)
+++ trunk/Master/texmf-dist/tex/latex/cellprops/cellprops.sty	2018-06-13 21:44:12 UTC (rev 48004)
@@ -16,7 +16,7 @@
 \def\ExplFileName{cellprops}
 \def\ExplFileDescription{CSS-like cell and table properties}
 \def\ExplFileDate{2018/06/12}
-\def\ExplFileVersion{1.1a}
+\def\ExplFileVersion{1.2}
 \ProvidesExplPackage
   {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
 
@@ -36,7 +36,11 @@
 }
 
 \cs_set_protected_nopar:Nn \__cellprops_get_property:nN {
-    \tl_set_eq:Nc #2 { l__cellprops_property_value_#1_tl }
+    \tl_if_exist:cTF { l__cellprops_property_value_#1_tl } {
+        \tl_set_eq:Nc #2 { l__cellprops_property_value_#1_tl }
+    }{
+        \tl_clear:N #2
+    }
 }
 \cs_set_protected:Nn \__cellprops_define_properties:nn {
     \clist_map_inline:nn {#2} {
@@ -317,8 +321,7 @@
 \tl_new:N  \l__cellprops_color_tl
 \tl_new:N  \l__cellprops_bgcolor_tl
 
-\cs_set_eq:NN \__cellprops_orig_array: \@array
-\cs_set_protected_nopar:Npn \@array[#1]#2 {
+\cs_new_protected:Nn \__cellprops_array_init: {
     \tl_set:Nx \l__cellprops_restore_tl {
         \bool_if:NTF \g__cellprops_inrow_bool {
             \exp_not:n {\bool_gset_true:N \g__cellprops_inrow_bool}
@@ -336,12 +339,8 @@
     }
     \int_gzero:N \g__cellprops_row_int
     \bool_gset_false:N \g__cellprops_inrow_bool
-    \cs_set_eq:NN \__cellprops_orig_tab at initread: \tab at initread
-    \cs_set_protected_nopar:Npn \tab at initread {
-        \cs_set_eq:NN \tab at initread \__cellprops_orig_tab at initread:
-        \tab at initread
-        \tl_put_left:Nn \tab at tabtext {\int_gincr:N \g__cellprops_col_int}
-    }
+    \cs_set_eq:NN \__cellprops_orig_tab at readpreamble:n \tab at readpreamble
+    \cs_set_eq:NN \tab at readpreamble \__cellprops_readpreamble:n
     \dim_set_eq:NN \l__cellprops_colsep_dim \col at sep
     \dim_zero:N \col at sep
     \dim_zero:N \tab at extrasep
@@ -358,13 +357,46 @@
     \tl_set_eq:NN \l__cellprops_color_tl \g_tmpa_tl
     \tl_set_eq:NN \l__cellprops_bgcolor_tl \g_tmpb_tl
     \__cellprops_recall_properties:n {tr}
-    \__cellprops_orig_array:[{#1}]{#2}
+}
+
+\cs_set_nopar:Nn \__cellprops_array_startcontent: {
     \hlx{s[\l__cellprops_tablepadding_top_dim]}
 }
+
+\cs_set_protected_nopar:Nn \__cellprops_readpreamble:n {
+    \cs_set_eq:NN \tab at readpreamble \__cellprops_orig_tab at readpreamble:n
+    \tl_put_left:Nn \tab at multicol {\__cellprops_startrow:}
+    \tl_put_left:Nn \tab at tabtext {\int_gincr:N \g__cellprops_col_int}
+    \tab at readpreamble{#1}
+    \exp_args:Nx \tab at preamble
+        { \exp_not:N\__cellprops_startrow: \the\tab at preamble \exp_not:N\__cellprops_endrow: }
+}
+
+\cs_set_eq:NN \__cellprops_orig_array:w \@array
+\cs_set_protected_nopar:Npn \@array[#1]#2 {
+    \__cellprops_array_init:
+    \__cellprops_orig_array:w [#1]{#2}
+    \__cellprops_array_startcontent:
+}
+
+\cs_set_eq:NN \__cellprops_orig_LTmkpream:n \@mkpream
+\cs_set_protected_nopar:Npn \@mkpream#1 {
+    \group_end:
+    \__cellprops_array_init:
+    \group_begin:
+    \__cellprops_orig_LTmkpream:n {#1}
+}
+
+\cs_set_eq:NN \__cellprops_orig_LTarray:w \LT at array
+\cs_set_protected_nopar:Npn \LT at array [#1]#2 {
+    \__cellprops_orig_LTarray:w [#1]{#2}
+    \__cellprops_array_startcontent:
+}
+
 \cs_new_protected_nopar:Nn \__cellprops_update_color:Nn {
-    \__cellprops_get_property:nN {#2} \l_tmpc_tl
-    \exp_args:NV \tl_if_eq:NNF \l_tmpc_tl \c__cellprops_inherit_color_tl {
-        \tl_set_eq:NN #1 \l_tmpc_tl
+    \__cellprops_get_property:nN {#2} \l_tmpa_tl
+    \exp_args:NV \tl_if_eq:NNF \l_tmpa_tl \c__cellprops_inherit_color_tl {
+        \tl_set_eq:NN #1 \l_tmpa_tl
     }
 }
 
@@ -373,17 +405,24 @@
     \__cellprops_update_color:Nn \l__cellprops_bgcolor_tl {background-color}
 }
 
-\cs_set_eq:NN \__cellprops_orig_endarray: \endarray
-\cs_set_nopar:Npn \endarray {
+\cs_set_nopar:Nn \__cellprops_end_array:n {
     \crcr
     \hlx{s[\l__cellprops_tablepadding_bottom_dim]}
-    \__cellprops_orig_endarray:
+    #1
     \tl_use:N \l__cellprops_restore_tl
 }
 
-\cs_set_eq:NN \__cellprops_orig_tab at startrow: \tab at startrow
-\cs_set_nopar:Npn \tab at startrow {
-    \__cellprops_orig_tab at startrow:
+\cs_set_eq:NN \__cellprops_orig_endarray: \endarray
+\cs_set_nopar:Npn \endarray {
+    \__cellprops_end_array:n { \__cellprops_orig_endarray: }
+}
+
+\cs_set_eq:NN \__cellprops_orig_endLT: \endlongtable
+\cs_set_nopar:Npn \endlongtable {
+    \__cellprops_end_array:n { \__cellprops_orig_endLT: }
+}
+
+\cs_set_protected_nopar:Nn \__cellprops_startrow: {
     \bool_if:NF \g__cellprops_inrow_bool {
         \bool_gset_true:N \g__cellprops_inrow_bool
         \int_gincr:N \g__cellprops_row_int
@@ -393,15 +432,16 @@
     }
 }
 
-\cs_set_eq:NN \__cellprops_orig_tab at arraycr: \tab at arraycr
-\cs_set_protected_nopar:Npn \tab at arraycr {
+\cs_set_protected_nopar:Npn \__cellprops_endrow: {
     \bool_if:NT \g__cellprops_inrow_bool {
         \bool_gset_false:N \g__cellprops_inrow_bool
         \__cellprops_fix_valign_end:
     }
-    \__cellprops_orig_tab at arraycr:
 }
 
+\cs_set_eq:NN \__cellprops_orig_tab at arraycr:n \tab at arraycr
+\cs_set_nopar:Npn \tab at arraycr { \__cellprops_endrow:\__cellprops_orig_tab at arraycr:n }
+
 \cs_set_eq:NN \__cellprops_orig_multicolumn:w \multicolumn
 \cs_set:Npn \multicolumn#1#2#3 {
     \__cellprops_orig_multicolumn:w {#1}{#2}{



More information about the tex-live-commits mailing list