summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/diffcoeff/diffcoeff.sty
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/diffcoeff/diffcoeff.sty')
-rw-r--r--macros/latex/contrib/diffcoeff/diffcoeff.sty32
1 files changed, 14 insertions, 18 deletions
diff --git a/macros/latex/contrib/diffcoeff/diffcoeff.sty b/macros/latex/contrib/diffcoeff/diffcoeff.sty
index fc1ae05eb7..448911e829 100644
--- a/macros/latex/contrib/diffcoeff/diffcoeff.sty
+++ b/macros/latex/contrib/diffcoeff/diffcoeff.sty
@@ -8,10 +8,10 @@
% Andrew Parsloe ajparsloe@gmail.com
%
\DeclareRelease{v4}{}{diffcoeff4.sty}
-\DeclareCurrentRelease{}{2023/01/16}
+\DeclareCurrentRelease{}{2023/01/24}
\RequirePackage{xtemplate,mleftright}
-\ProvidesExplPackage {diffcoeff} {2023/01/16} {5.1}
+\ProvidesExplPackage {diffcoeff} {2023/01/24} {5.2}
{Write differential coefficients easily and consistently.}
\keys_define:nn { diffcoeff }
{
@@ -77,7 +77,6 @@
\bool_new:N \l__diffcoeff_multitok_bool
\bool_new:N \l__diffcoeff_append_bool
\bool_new:N \l__diffcoeff_op_left_bool
-\bool_new:N \l__diffcoeff_dl_bool
\bool_new:N \l__diffcoeff_exponent_bool
\tl_new:N \l__diffcoeff_override_tl
\tl_new:N \l__diffcoeff_frac_tl
@@ -206,7 +205,8 @@
\__diffcoeff_check_style:nn
{ \l__diffcoeff_group_int } { \l__diffcoeff_style_int }
\__diffcoeff_append:n { #1 }
- \exp_args:Nx \__diffcoeff_orders:nn { \clist_count:n {#4} } { #2 }
+ \exp_args:Nx \__diffcoeff_orders:nn
+ { \int_max:nn { 1 } { \clist_count:n {#4} } } { #2 }
\__diffcoeff_override:N \l__diffcoeff_override_tl
\__diffcoeff_derivand:n { #3 }
\__diffcoeff_build:nn { #4 } { #5 }
@@ -225,7 +225,7 @@
{ 4 } { \tl_set:Nn \l__diffcoeff_frac_tl { \difsafrac } }
{ 5 } { \tl_set:Nn \l__diffcoeff_frac_tl { \difsbfrac[#2] } }
{ 6 } { \tl_set:Nn \l__diffcoeff_frac_tl {} }
- { 7 } { \bool_set_true:N \l__diffcoeff_dl_bool }
+ { 7 } { \tl_set:Nn \l__diffcoeff_frac_tl {} }
{ 9 }
{
\msg_error:nnxx { diffcoeff } { unknown-style }
@@ -265,14 +265,6 @@
}
\cs_new:Npn \__diffcoeff_style_group:n #1
{ \clist_item:nn { frac, /, _, frac, dl } { #1 + 1 } }
-\cs_new:Npn \__diffcoeff_style_aux:n #1
- {
- \int_compare:nNnTF { #1 } = { 3 } { { 0 } {} }
- {
- \int_compare:nNnTF { #1 } = { 4 } { { 7 } {} }
- { { 3*#1 } {} }
- }
- }
%%%%%%%%% append? (& wrap slash diff operator?)
\cs_new_protected:Npn \__diffcoeff_append:n #1
{
@@ -288,8 +280,8 @@
%%%%%%%%%
% #1(int) no. of vars; #2(clist) orders spec
\cs_new_protected:Npn \__diffcoeff_orders:nn #1#2
- {
- \bool_if:NTF \l__diffcoeff_exponent_bool
+ {
+ \bool_if:NTF \l__diffcoeff_exponent_bool
{
\exp_args:NNx \seq_set_from_clist:Nn \l__diffcoeff_ords_seq
{ \prg_replicate:nn { #1 } { \l__diffcoeff_exponent_tl, } }
@@ -299,7 +291,7 @@
\exp_args:Nnx\__diffcoeff_adj_ords_seq:nn { #1 }
{ \seq_count:N \l__diffcoeff_ords_seq }
}
- \tl_set:Nx \l__diffcoeff_vph_tl {\seq_use:Nn\l__diffcoeff_ords_seq {} }
+ \tl_set:Nx \l__diffcoeff_vph_tl { \seq_use:Nn\l__diffcoeff_ords_seq {} }
}
\cs_new_protected:Npn \__diffcoeff_adj_ords_seq:nn #1#2
{
@@ -530,6 +522,8 @@
% #1 (propv) key=var, val=coeff; #2 <= total order
\cs_new_protected:Npn \__diffcoeff_evaluate:NN #1#2
{
+ \seq_clear:N \l_tmpa_seq
+ \seq_clear:N \l_tmpb_seq
\prop_map_inline:Nn #1 { \seq_put_left:Nn \l_tmpa_seq { ##1 } }
\seq_sort:Nn \l_tmpa_seq
{
@@ -593,7 +587,9 @@
\msg_error:nnnn { diffcoeff } { version-conflict } { / }
{ Use~\difs or~\difsp instead.~ }
}
- \seq_set_from_clist:Nn \l__diffcoeff_vars_seq { #1 }
+ \clist_if_empty:nTF { #1 }
+ { \seq_set_from_clist:Nn \l__diffcoeff_vars_seq { \prg_do_nothing: } }
+ { \seq_set_from_clist:Nn \l__diffcoeff_vars_seq { #1 } }
\seq_pop_right:NN \l__diffcoeff_vars_seq \l__diffcoeff_var_tl
\tl_put_left:Nx \l__diffcoeff_derivand_tl
{ \__diffcoeff_spaced:n { \l__diffcoeff_spaced_int } }
@@ -678,7 +674,7 @@
}
% #1 order #2 var
\cs_new:Npn \__diffcoeff_build_denom_item:nn #1#2
- {
+ {
\int_compare:nNnTF { \l__diffcoeff_style_int } = { 6 }
{ \__diffcoeff_build_denom_difc:onn \l__diffcoeff_vph_tl {#1}{#2} }
{ \__diffcoeff_build_denom_dif:nn {#1} {#2} }