diff options
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r-- | Master/texmf-dist/doc/latex/derivative/README.md | 4 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/derivative/derivative.pdf | bin | 207643 -> 205047 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/derivative/derivative.tex | 76 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/derivative/derivative.sty | 68 |
4 files changed, 94 insertions, 54 deletions
diff --git a/Master/texmf-dist/doc/latex/derivative/README.md b/Master/texmf-dist/doc/latex/derivative/README.md index c440e837c5e..5dc61019df4 100644 --- a/Master/texmf-dist/doc/latex/derivative/README.md +++ b/Master/texmf-dist/doc/latex/derivative/README.md @@ -1,4 +1,4 @@ -## README for derivative package v1.31 dated 2023-11-04 +## README for derivative package v1.4 dated 2024-02-08 The package provides a set of commands `\NewDerivative`, `\NewDifferential` etc. that can be used to define a derivative or a differential operator, respectively. The package have already defined several derivatives and differentials: @@ -16,7 +16,7 @@ The package provides a set of commands `\NewDerivative`, `\NewDifferential` etc. ### Copyright and license -Copyright 2019-2023 Simon Jensen +Copyright 2019-2024 Simon Jensen This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3 diff --git a/Master/texmf-dist/doc/latex/derivative/derivative.pdf b/Master/texmf-dist/doc/latex/derivative/derivative.pdf Binary files differindex 13fdeefa661..509cc963fe0 100644 --- a/Master/texmf-dist/doc/latex/derivative/derivative.pdf +++ b/Master/texmf-dist/doc/latex/derivative/derivative.pdf diff --git a/Master/texmf-dist/doc/latex/derivative/derivative.tex b/Master/texmf-dist/doc/latex/derivative/derivative.tex index 8e328377610..f9c693535e3 100644 --- a/Master/texmf-dist/doc/latex/derivative/derivative.tex +++ b/Master/texmf-dist/doc/latex/derivative/derivative.tex @@ -1,5 +1,5 @@ % derivative.tex -% Copyright 2019-2023 Simon Jensen +% Copyright 2019-2024 Simon Jensen % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either version 1.3 @@ -42,23 +42,23 @@ group_skip "\n\n\\par\\bigskip\n" \RequirePackage[style=english,english=british]{csquotes} \RequirePackage[final,babel,auto]{microtype} \RequirePackage{xcolor} -% \definecolor{RoyalGray}{RGB}{127, 144, 158} -% \definecolor{RoyalDarkGray}{RGB}{78, 93, 104} -% \definecolor{RoyalLightGray}{RGB}{250, 250, 250} -% \definecolor{RoyalRed}{RGB}{157, 16, 45} -% \definecolor{RoyalBlue}{RGB}{0, 35, 102} -% \definecolor{RoyalGreen}{RGB}{32, 77, 2} - - \definecolor{RoyalGray}{RGB}{75, 75, 75} - \definecolor{RoyalDarkGray}{RGB}{225, 225, 225} - \definecolor{RoyalLightGray}{RGB}{30, 30, 30} - \definecolor{RoyalRed}{RGB}{255, 177, 151} % 207, 102, 121 - \definecolor{RoyalBlue}{RGB}{187, 134, 252} % 55, 185, 255 - \definecolor{RoyalGreen}{RGB}{3, 218, 198} % 52, 177, 20 - \definecolor{RoyalPageCoulor}{RGB}{18, 18, 18} % 30, 30, 30 - \definecolor{RoyalTextCoulor}{RGB}{225, 225, 225} - \pagecolor{RoyalPageCoulor} - \color{RoyalTextCoulor} + \definecolor{RoyalGray}{RGB}{127, 144, 158} + \definecolor{RoyalDarkGray}{RGB}{78, 93, 104} + \definecolor{RoyalLightGray}{RGB}{250, 250, 250} + \definecolor{RoyalRed}{RGB}{157, 16, 45} + \definecolor{RoyalBlue}{RGB}{0, 35, 102} + \definecolor{RoyalGreen}{RGB}{32, 77, 2} + +% \definecolor{RoyalGray}{RGB}{75, 75, 75} +% \definecolor{RoyalDarkGray}{RGB}{225, 225, 225} +% \definecolor{RoyalLightGray}{RGB}{30, 30, 30} +% \definecolor{RoyalRed}{RGB}{255, 177, 151} % 207, 102, 121 +% \definecolor{RoyalBlue}{RGB}{187, 134, 252} % 55, 185, 255 +% \definecolor{RoyalGreen}{RGB}{3, 218, 198} % 52, 177, 20 +% \definecolor{RoyalPageCoulor}{RGB}{18, 18, 18} % 30, 30, 30 +% \definecolor{RoyalTextCoulor}{RGB}{225, 225, 225} +% \pagecolor{RoyalPageCoulor} +% \color{RoyalTextCoulor} \RequirePackage{amsmath, amsthm} \allowdisplaybreaks @@ -1220,10 +1220,12 @@ group_skip "\n\n\\par\\bigskip\n" \mydoc_narg:n {#1} \group_end: } -\DeclareDocumentCommand{\oarg}{ m } +\DeclareDocumentCommand{\oarg}{ s m } { \group_begin: - \mydoc_oarg:n {#1} + \bool_if:nTF {#1} + { \mydoc_oarg_star:n {#2} } + { \mydoc_oarg:n {#2} } \group_end: } \DeclareDocumentCommand{\earg}{ m } @@ -1282,6 +1284,14 @@ group_skip "\n\n\\par\\bigskip\n" \mydoc_arg_delim_format:n { ] } } +\cs_new:Npn \mydoc_oarg_star:n #1 +{ + \__mydoc_oarg_font: + \mydoc_arg_delim_format:n { [ } + #1 + \mydoc_arg_delim_format:n { ] } +} + \cs_new:Npn \mydoc_earg:n #1 { \seq_set_from_clist:Nn \l__deriv_earg_seq {#1} @@ -1369,8 +1379,8 @@ group_skip "\n\n\\par\\bigskip\n" \Titel{The \pakkenavn{} package} \Forfatter{Simon Jensen} \Email{sjelatex@gmail.com} -\Dato{2023/11/04} -\Version{1.31} +\Dato{2024/02/08} +\Version{1.4} \RequirePackage{derivative}[\dato] @@ -1445,14 +1455,18 @@ Regarding terminology, I use the abbreviation \texttt{inf} to represent the oper The behavior of the star can be reversed by setting \keyval{switch-*}{true}. In other words, the equations in the previous example will be interchanged. \end{argument} - \begin{argument}{2}[updated = v1.0] + \begin{argument}{2}[updated = v1.4] The second argument of \macro{1}, enclosed in square brackets, is optional and used to specify options for the derivative using a \keyval[index=false]{key}{value} syntax. For instance, the order of differentiation can be set using the \key[cat=misc]{order} option. Here is an example: \begin{example} \pdv[order={2,3}]{f}{x,y,z} \\ \pdv[order={\beta,a,n+2a}]{f}{x,y,z} \\ - \pdv[order={2,n^2,n^2-1}]{f}{x,y,z} \\ + \pdv[sep-var-inf=0]{f}{x,y,z} \\ \pdv[order={3/2-n/3,n/2,1/3}]{f}{x,y,z} \end{example} + To ease the cumbersome order key, implicit orders can now be given: + \begin{example} + \pdv[n+2, \alpha]{f}{x,y,z} + \end{example} For a comprehensive list of available options that can be applied to derivatives, please refer to \cref{ssec:options_dv}. %The order may be a number, a symbol and a combination hereof. Note that the total order of differentiation (i.e $\odif[order=n+2]{}$) is automatically calculated and sorted. This is particularly useful when dealing with mixed partial derivatives which is further described in \cref{ssec:DV_pdv,ssec:overall_order} \end{argument} @@ -1632,14 +1646,18 @@ If you require more information on the usage and customization of these derivati The behavior of the star can be reversed by setting \keyval{switch-*}{true}. In other words, the equations in the previous example will be interchanged. \end{argument} - \begin{argument}{2} + \begin{argument}{2}[updated = v1.4] The second argument, enclosed in square brackets, is optional and is used to specify options for the differential using the \keyval[index=false]{key}{value} syntax. Here are some examples: \begin{example} \odif[order={n,3}]{x,y,z} \\ \odif[sep-var-inf=0]{x,y,z} \\ \odif*[sep-var-var=0]{x,y,z} \end{example} - The available options for the differential can be found in \cref{ssec:options_inf} + To ease the cumbersome order key, implicit orders can now be given: + \begin{example} + \odif[n+2, \alpha]{x,y,z} + \end{example} + For a comprehensive list of available options that can be applied to differentials, please refer to \cref{ssec:options_inf} \end{argument} \begin{argument}{3} @@ -3049,7 +3067,11 @@ Numbers in bold refer to the page where the entry is defined. \begin{change}[version=1.31, date=2023-11-04, beta=false] \item Fixed issue relating to the order when nesting derivatives (issues \#14). \end{change} + \bigskip + \begin{change}[version=1.4, date=2024-02-08, beta=false] + \item Introduced implicit order parameter to simplify specifying the order of differentiation, for example: \cs{pdv}\oarg*{n,2}\narg{f}\narg{x,y} (issues \#2 and \#10). + \end{change} \end{changelog} -\end{document} +\end{document}
\ No newline at end of file diff --git a/Master/texmf-dist/tex/latex/derivative/derivative.sty b/Master/texmf-dist/tex/latex/derivative/derivative.sty index 6948795968b..48f04012102 100644 --- a/Master/texmf-dist/tex/latex/derivative/derivative.sty +++ b/Master/texmf-dist/tex/latex/derivative/derivative.sty @@ -1,5 +1,5 @@ % derivative.sty -% Copyright 2019-2023 Simon Jensen +% Copyright 2019-2024 Simon Jensen % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either version 1.3 @@ -16,10 +16,9 @@ \NeedsTeXFormat{LaTeX2e} -\RequirePackage{expl3}[2021/11/07] -\RequirePackage{xparse}[2021/11/07] +\RequirePackage{expl3}[2023/12/08] \RequirePackage{l3keys2e} -\ProvidesExplPackage{derivative}{2023/11/04}{1.31}{Nice and easy derivatives and differentials for LaTeX} +\ProvidesExplPackage{derivative}{2024/02/08}{1.4}{Nice and easy derivatives and differentials for LaTeX} \bool_new:N \l__deriv_pkg_italic_bool \bool_new:N \l__deriv_pkg_upright_bool @@ -118,6 +117,7 @@ \tl_new:N \l__deriv_cs_name_tl \tl_new:N \l__deriv_derivset_tl +\bool_new:N \l__deriv_first_unknown_key_bool \tl_new:N \l__deriv_gcd_result_tl \tl_new:N \l__deriv_gcd_remain_tl @@ -290,14 +290,14 @@ scale-frac .choices:nn = { auto, none, big, Big, bigg, Bigg } { \__deriv_set_scale:nnn {dv_#1} {##1} { frac } }, scale-frac-/ .choices:nn = { auto, none, big, Big, bigg, Bigg } { \__deriv_set_scale:nnn {dv_#1} {##1} { frac_slash } }, - delims-eval .tl_set:c = { l__deriv_dv_#1_delims_eval_tl }, - delims-eval-/ .tl_set:c = { l__deriv_dv_#1_delims_eval_slash_tl }, - delims-eval-! .tl_set:c = { l__deriv_dv_#1_delims_eval_compact_tl }, - delims-fun .tl_set:c = { l__deriv_dv_#1_delims_fun_tl }, - delims-var .tl_set:c = { l__deriv_dv_#1_delims_var_tl }, - delims-var-! .tl_set:c = { l__deriv_dv_#1_delims_var_compact_tl }, - delims-frac .tl_set:c = { l__deriv_dv_#1_delims_frac_tl }, - delims-frac-/ .tl_set:c = { l__deriv_dv_#1_delims_frac_slash_tl }, + delims-eval .tl_set:c = { l__deriv_dv_#1_delims_eval_tl }, + delims-eval-/ .tl_set:c = { l__deriv_dv_#1_delims_eval_slash_tl }, + delims-eval-! .tl_set:c = { l__deriv_dv_#1_delims_eval_compact_tl }, + delims-fun .tl_set:c = { l__deriv_dv_#1_delims_fun_tl }, + delims-var .tl_set:c = { l__deriv_dv_#1_delims_var_tl }, + delims-var-! .tl_set:c = { l__deriv_dv_#1_delims_var_compact_tl }, + delims-frac .tl_set:c = { l__deriv_dv_#1_delims_frac_tl }, + delims-frac-/ .tl_set:c = { l__deriv_dv_#1_delims_frac_slash_tl }, sep-inf-ord .code:n = { \__deriv_set_rubber_length:cn { l__deriv_dv_#1_sep_inf_ord_tl } {##1} }, sep-inf-fun .code:n = { \__deriv_set_rubber_length:cn { l__deriv_dv_#1_sep_inf_fun_tl } {##1} }, @@ -329,12 +329,23 @@ fun .bool_set:c = { l__deriv_dv_#1_misc_fun_bool }, frac .bool_set:c = { l__deriv_dv_#1_misc_frac_bool }, var .clist_set:c = { l__deriv_dv_#1_misc_var_clist }, - var .default:n = {all}, + var .default:n = { all }, order .clist_set:c = { l__deriv_dv_#1_misc_order_clist }, ord .meta:n = { order={##1} }, mixed-order .tl_set:c = { l__deriv_dv_#1_misc_mixed_order_tl }, mixord .meta:n = { mixed-order={##1} }, + + unknown .code:n = + { + \bool_if:NT \l__deriv_first_unknown_key_bool + { + \clist_clear:c { l__deriv_dv_#1_misc_order_clist } + \bool_set_false:N \l__deriv_first_unknown_key_bool + } + \exp_args:NnnV \tl_set_rescan:Nnn \l__deriv_tmpa_tl { } \l_keys_key_str + \clist_put_right:cV { l__deriv_dv_#1_misc_order_clist } \l__deriv_tmpa_tl + } } } @@ -345,7 +356,7 @@ { \keys_define:nn { deriv/i/#1 } { - style-inf .tl_set:c = { l__deriv_i_#1_style_inf_tl }, + style-inf .tl_set:c = { l__deriv_i_#1_style_inf_tl }, style-var .choices:nn = { single, multiple, mixed } { \__deriv_i_set_style_var:nnn {i_#1} {##1} { } }, style-var-* .choices:nn = { single, multiple, mixed } { \__deriv_i_set_style_var:nnn {i_#1} {##1} { _star } }, @@ -370,7 +381,18 @@ var .default:n = {all}, order .clist_set:c = { l__deriv_i_#1_misc_order_clist }, - ord .clist_set:c = { l__deriv_i_#1_misc_order_clist }, + ord .meta:n = { order={##1} }, + + unknown .code:n = + { + \bool_if:NT \l__deriv_first_unknown_key_bool + { + \clist_clear:c { l__deriv_i_#1_misc_order_clist } + \bool_set_false:N \l__deriv_first_unknown_key_bool + } + \exp_args:NnnV \tl_set_rescan:Nnn \l__deriv_tmpa_tl { } \l_keys_key_str + \clist_put_right:cV { l__deriv_i_#1_misc_order_clist } \l__deriv_tmpa_tl + } } } @@ -462,6 +484,7 @@ % keyval, dv/i, variant \cs_new_protected:Npn \deriv_local_keys:nnn #1 #2 #3 { + \bool_set_true:N \l__deriv_first_unknown_key_bool \tl_if_novalue:nTF {#1} { \bool_if:cT { l__deriv_#2_#3_local_keys_bool } @@ -759,7 +782,7 @@ % Temporary store the order argument \tl_set:Nf \l__deriv_tmpb_tl { \seq_use:Nn #2 { \__deriv_insert_mskip:nn {#4} { ord_ord } } } - + \seq_pop_left:NN \l__deriv_tmpa_seq \l__deriv_tmpc_tl \tl_put_right:Nx #3 { @@ -769,7 +792,6 @@ \__deriv_show_order:NT \l__deriv_tmpb_tl { \__deriv_insert_ord:Nnn \l__deriv_tmpb_tl {#4} { var_ord } } } - \str_if_eq:cNT { l__deriv_#4_misc_mixed_order_tl } 1 { \tl_set_eq:cN { l__deriv_#4_misc_mixed_order_tl } \l__deriv_tmpb_tl } } @@ -1553,10 +1575,10 @@ \bool_while_do:nn { \deriv_binary_if_even_p:N #2 } { \deriv_binary_shift_right:N #2 } - \__deriv_gcd_swap_helper:NNff #1 #2 { \int_from_bin:V #1 } { \int_from_bin:V #2 } + \__deriv_gcd_swap_helper:NNff #1 #2 { \exp_args:NV \int_from_bin:n {#1} } { \exp_args:NV \int_from_bin:n {#2} } } \deriv_binary_shift_left:NV #1 \l__deriv_gcd_counter_int - \tl_set:Nx #1 { \int_from_bin:V #1 } + \tl_set:Nx #1 { \exp_args:NV \int_from_bin:n {#1} } } \cs_new:Npn \__deriv_gcd_swap_helper:NNnn #1 #2 #3 #4 { @@ -1659,7 +1681,7 @@ \DeclareDocumentCommand{\slashfrac}{ o m m } { - \group_begin: +\group_begin: \tl_if_novalue:nTF {#1} { \__deriv_slashfrac_auto:nn {#2} {#3} } { @@ -1670,7 +1692,7 @@ } { \__deriv_slashfrac_scale:nnn {#1} {#2} {#3} } } - \group_end: +\group_end: } % numerator, denominator \cs_new_protected:Npn \__deriv_slashfrac_auto:nn #1 #2 @@ -1695,7 +1717,6 @@ %%%%% Generate variants %%%%% \prg_generate_conditional_variant:Nnn \__deriv_show_order:N { c } { T, TF } -\prg_generate_conditional_variant:Nnn \tl_if_head_eq_charcode:nN { V } { T, F, TF } \cs_generate_variant:Nn \__deriv_set_rubber_length:Nn { c } \cs_generate_variant:Nn \deriv_dv_define:Nnn { NV } @@ -1726,9 +1747,6 @@ \cs_generate_variant:Nn \__deriv_update_seq:NNNNn { NNNNV } \cs_generate_variant:Nn \__deriv_addfrac:NNnnnnn { NNVVxx } -\cs_generate_variant:Nn \int_to_bin:n { V } -\cs_generate_variant:Nn \int_from_bin:n { V } - %%%%% Messages %%%%% \msg_new:nnnn { deriv } { command-already-defined } |