summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-06-13 21:44:12 +0000
committerKarl Berry <karl@freefriends.org>2018-06-13 21:44:12 +0000
commit0dc40a1ee19496b265caf65c297647f19b2a6096 (patch)
tree6443eab155e506a7e1d53c73ad4723f38c882bf1 /Master/texmf-dist/source/latex
parent581f55ef218d96498090aaefe5634c3b2dffe058 (diff)
cellprops (13jun18)
git-svn-id: svn://tug.org/texlive/trunk@48004 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex')
-rw-r--r--Master/texmf-dist/source/latex/cellprops/cellprops.dtx99
1 files changed, 73 insertions, 26 deletions
diff --git a/Master/texmf-dist/source/latex/cellprops/cellprops.dtx b/Master/texmf-dist/source/latex/cellprops/cellprops.dtx
index 2ec12963014..bcb4bcd0388 100644
--- a/Master/texmf-dist/source/latex/cellprops/cellprops.dtx
+++ b/Master/texmf-dist/source/latex/cellprops/cellprops.dtx
@@ -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@initread: \tab@initread
- \cs_set_protected_nopar:Npn \tab@initread {
- \cs_set_eq:NN \tab@initread \@@_orig_tab@initread:
- \tab@initread
- \tl_put_left:Nn \tab@tabtext {\int_gincr:N \g_@@_col_int}
- }
+ \cs_set_eq:NN \@@_orig_tab@readpreamble:n \tab@readpreamble
+ \cs_set_eq:NN \tab@readpreamble \@@_readpreamble:n
% \end{macrocode}
% Zero \cs{col@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@readpreamble \@@_orig_tab@readpreamble:n
+ \tl_put_left:Nn \tab@multicol {\@@_startrow:}
+ \tl_put_left:Nn \tab@tabtext {\int_gincr:N \g_@@_col_int}
+ \tab@readpreamble{#1}
+ \exp_args:Nx \tab@preamble
+ { \exp_not:N\@@_startrow: \the\tab@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@array
+\cs_set_protected_nopar:Npn \LT@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@startrow: \tab@startrow
-\cs_set_nopar:Npn \tab@startrow {
- \@@_orig_tab@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,16 +734,15 @@
}
}
-\cs_set_eq:NN \@@_orig_tab@arraycr: \tab@arraycr
-\cs_set_protected_nopar:Npn \tab@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@arraycr:
}
-
+\cs_set_eq:NN \@@_orig_tab@arraycr:n \tab@arraycr
+\cs_set_nopar:Npn \tab@arraycr { \@@_endrow:\@@_orig_tab@arraycr:n }
\cs_set_eq:NN \@@_orig_multicolumn:w \multicolumn
\cs_set:Npn \multicolumn#1#2#3 {
@@ -704,7 +752,6 @@
}
}
-
\cs_new_protected_nopar:Nn \@@_fix_valign_end: {
\exp_args:NV \tl_if_eq:nnTF \tab@hlstate {b} {
\dim_gadd:Nn \tab@endheight {