diff options
author | Karl Berry <karl@freefriends.org> | 2019-09-29 21:12:55 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-09-29 21:12:55 +0000 |
commit | 44653b0a992fdb4afc38d7d612b5375b20d8ab1f (patch) | |
tree | d2cbc97e008fd52be1e8ff1d35d2b5da418db850 /Master/texmf-dist/tex | |
parent | d562da77633756a85b1e9f8d36b06d394def49e5 (diff) |
cellprops (29sep19)
git-svn-id: svn://tug.org/texlive/trunk@52205 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r-- | Master/texmf-dist/tex/latex/cellprops/cellprops.sty | 73 |
1 files changed, 38 insertions, 35 deletions
diff --git a/Master/texmf-dist/tex/latex/cellprops/cellprops.sty b/Master/texmf-dist/tex/latex/cellprops/cellprops.sty index 14e1bf5a17d..dd455c340d6 100644 --- a/Master/texmf-dist/tex/latex/cellprops/cellprops.sty +++ b/Master/texmf-dist/tex/latex/cellprops/cellprops.sty @@ -6,22 +6,23 @@ %% %% cellprops.dtx (with options: `package') %% -%% File: cellprops.dtx (C) Copyright 2018 RIVAUD Julien +%% File: cellprops.dtx (C) Copyright 2016-2019 RIVAUD Julien %% %% It may be distributed and/or modified under the conditions of the %% General Public License (GPL), either version 3 of this %% license or (at your option) any later version. \NeedsTeXFormat{LaTeX2e}[1995/12/01] -\RequirePackage{expl3}[2016/01/19] +\RequirePackage{expl3}[2018/06/19] \def\ExplFileName{cellprops} \def\ExplFileDescription{CSS-like cell and table properties} -\def\ExplFileDate{2018/07/16} -\def\ExplFileVersion{1.4} +\def\ExplFileDate{2019/09/29} +\def\ExplFileVersion{1.6} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} \RequirePackage{xparse} \RequirePackage{xcolor} +\RequirePackage{etoolbox} \RequirePackage{mdwtab} \cs_set_nopar:Npn \tab@pop #1 { \tl_set:Nx #1 { \tl_tail:N #1 } } \cs_new:Nn \__cellprops_generic_setter:nnn { @@ -60,7 +61,7 @@ \seq_map_inline:Nn \l_tmpa_seq { \tl_if_empty:nF {##1} { \exp_args:NNV \seq_set_split:Nnn \l_tmpb_seq \c_colon_str {##1} - \int_compare:nNnTF {\seq_count:N \l_tmpb_seq} = \c_two { + \int_compare:nNnTF {\seq_count:N \l_tmpb_seq} = { 2 } { \seq_get_left:NN \l_tmpb_seq \l_tmpa_tl \exp_args:NNV \str_set:Nn \l_tmpa_str \l_tmpa_tl \seq_get_right:NN \l_tmpb_seq \l_tmpa_tl @@ -118,7 +119,7 @@ \str_if_eq:nnTF {#2} {inherit} { \__cellprops_generic_setter:nnn \exp_not:n {#1} {\c__cellprops_inherit_color_tl} }{ - \str_case_x:nnF { \str_range:nnn {#2} {1} {4} } { + \str_case_e:nnF { \str_range:nnn {#2} {1} {4} } { {rgb(} { \__cellprops_generic_setter:nnn \use:n {#1} { \exp_not:n {\color[RGB]} {\str_range:nnn {#2} {5} {-2}} @@ -463,7 +464,18 @@ \exp_args:Nx \tab@preamble { \exp_not:N\__cellprops_startrow: \the\tab@preamble \exp_not:N\__cellprops_endrow: } } +\cs_new_protected_nopar:Nn \__cellprops_update_color:Nn { + \__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 + } +} +\cs_new_protected_nopar:Nn \__cellprops_update_colors: { + \__cellprops_update_color:Nn \l__cellprops_color_tl {color} + \__cellprops_update_color:Nn \l__cellprops_bgcolor_tl {background-color} +} +\AtEndPreamble{% \cs_set_eq:NN \__cellprops_orig_array:w \@array \cs_set_protected_nopar:Npn \@array[#1]#2 { \__cellprops_array_init: @@ -484,17 +496,6 @@ \__cellprops_orig_LTarray:w [#1]{#2} \__cellprops_array_startcontent: } -\cs_new_protected_nopar:Nn \__cellprops_update_color:Nn { - \__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 - } -} - -\cs_new_protected_nopar:Nn \__cellprops_update_colors: { - \__cellprops_update_color:Nn \l__cellprops_color_tl {color} - \__cellprops_update_color:Nn \l__cellprops_bgcolor_tl {background-color} -} \cs_new_nopar:Nn \__cellprops_end_array:n { \tl_if_empty:NF \g__cellprops_borders_tl { \\ } @@ -520,7 +521,7 @@ \bool_if:NF \g__cellprops_inrow_bool { \bool_gset_true:N \g__cellprops_inrow_bool \int_gincr:N \g__cellprops_row_int - \int_gset_eq:NN \g__cellprops_col_int \c_one + \int_gset_eq:NN \g__cellprops_col_int \c_one_int \dim_gzero:N \g__cellprops_ht_dim \dim_gzero:N \g__cellprops_dp_dim } @@ -562,6 +563,8 @@ } } +} + \cs_new_nopar:Nn \__cellprops_fix_valign_end:n { \noalign{ \dim_set:Nn \l_tmpa_dim {#1} @@ -569,7 +572,7 @@ \exp_args:NV \tl_if_eq:nnTF \tab@hlstate {b} { \dim_gadd:Nn \tab@endheight { \g__cellprops_dp_dim + \l_tmpa_dim } }{ - \int_compare:nNnT \g__cellprops_row_int = \c_one { + \int_compare:nNnT \g__cellprops_row_int = \c_one_int { \dim_gadd:Nn \tab@endheight { \g__cellprops_ht_dim } } } @@ -654,7 +657,7 @@ \__cellprops_begin_raw_cell:n { #1 \hbox_set:Nw \l__cellprops_cell_box - \str_case_x:nnF {\__cellprops_get_property:n {math-mode}} { + \str_case_e:nnF {\__cellprops_get_property:n {math-mode}} { { text } { \tab@btext } { math } { \tab@bmaths } }{% any other treated as |auto| @@ -664,7 +667,7 @@ } \cs_new_protected_nopar:Nn \__cellprops_endcell: { - \str_case_x:nnF {\__cellprops_get_property:n {math-mode}} { + \str_case_e:nnF {\__cellprops_get_property:n {math-mode}} { { text } { \tab@etext } { math } { \tab@emaths } }{% any other treated as |auto| @@ -715,7 +718,7 @@ #1 \hbox_set_end: \__cellprops_end_raw_cell: - \spewnotes\hfil + \spewnotes } \cs_new_protected_nopar:Nn \__cellprops_begin_raw_cell:n { @@ -877,17 +880,7 @@ {\g__cellprops_dp_dim} {\box_dp:N \l__cellprops_cell_box} } - % Handle hpadding and halign - \skip_set:Nn \l_tmpa_skip { - \dim_max:nn - {0pt} - { (\__cellprops_get_property:n {min-width}) - - \box_wd:N \l__cellprops_cell_box } - } - \skip_add:Nn \l_tmpa_skip { - 0pt plus 1fil - } - % padding-left and border-left + % Handle padding-left and border-left \__cellprops_get_border_info:n {left} \skip_set:Nn \l__cellprops_left_skip {\__cellprops_get_property:n {padding-left} + \l__cellprops_border_width_dim} @@ -923,7 +916,17 @@ \exp_not:n { \kern \c_zero_dim } } } - \str_case_x:nnF {\__cellprops_get_property:n {text-align}} { + % Handle hpadding and halign + \skip_set:Nn \l_tmpa_skip { + \dim_max:nn + {0pt} + { (\__cellprops_get_property:n {min-width}) + - \box_wd:N \l__cellprops_cell_box } + } + \skip_add:Nn \l_tmpa_skip { + 1sp plus 1fil + } + \str_case_e:nnF {\__cellprops_get_property:n {text-align}} { { right } { \skip_add:Nn \l__cellprops_left_skip { \l_tmpa_skip } } @@ -951,7 +954,7 @@ \group_end: } \skip_horizontal:N \l__cellprops_left_skip - \box_use_clear:N \l__cellprops_cell_box + \box_use_drop:N \l__cellprops_cell_box \skip_horizontal:N \l__cellprops_right_skip \kern\c_zero_dim \group_end: |