Skip to content

Commit f7008e7

Browse files
authored
Add files via upload
1 parent 13f3c99 commit f7008e7

File tree

4 files changed

+120
-64
lines changed

4 files changed

+120
-64
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## README for derivative package v0.95b dated 2019-09-21
1+
## README for derivative package v0.97 dated 2020-02-03
22

33
The package provides a set of commands `\NewOdvVariant`, `\NewPdvVariant` etc. that can be used to define a variant of a derivative. The package have already defined several derivatives:
44

@@ -11,7 +11,7 @@ The package provides a set of commands `\NewOdvVariant`, `\NewPdvVariant` etc. t
1111

1212
### Copyright and license
1313

14-
Copyright 2019 Simon Jensen
14+
Copyright 2019-2020 Simon Jensen
1515

1616
This work may be distributed and/or modified under the
1717
conditions of the LaTeX Project Public License, either version 1.3

derivative.pdf

647 Bytes
Binary file not shown.

derivative.sty

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
% derivative.sty
2-
% Copyright 2019 Simon Jensen
2+
% Copyright 2019-2020 Simon Jensen
33
%
44
% This work may be distributed and/or modified under the
55
% conditions of the LaTeX Project Public License, either version 1.3
@@ -16,7 +16,7 @@
1616
\NeedsTeXFormat{LaTeX2e}
1717

1818
\RequirePackage{xparse}[2018/05/09]
19-
\ProvidesExplPackage{derivative}{2019/09/21}{0.95b}{Nice and easy derivatives}
19+
\ProvidesExplPackage{derivative}{2020/02/03}{0.97}{Nice and easy derivatives}
2020

2121
%%%%% Useful conditionals %%%%%
2222

@@ -845,7 +845,27 @@
845845
\bool_set_false:c { l__deriv_#1_mics_var_bool }
846846
\__deriv_add_delims:nnn {#1} { var } {#2}
847847
}
848-
{ #2 }
848+
{ \__deriv_handle_double_sp:n {#2} }
849+
}
850+
% variable
851+
\cs_new:Npn \__deriv_handle_double_sp:n #1
852+
{
853+
\tl_set:Nn \l_tmpa_tl {#1}
854+
\str_set:Nn \l_tmpa_str {#1}
855+
856+
\str_if_in:NnTF \l_tmpa_str { ^ }
857+
{
858+
\exp_args:Nf
859+
\str_if_eq:nnTF { \tl_item:Nn \l_tmpa_tl {-2} } { ^ }
860+
{ {#1} }
861+
{
862+
\exp_args:Nf
863+
\str_if_eq:nnTF { \tl_item:Nn \l_tmpa_tl {-4} } { ^ }
864+
{ {#1} }
865+
{ #1 }
866+
}
867+
}
868+
{#1}
849869
}
850870
% dv , code-for-fraction
851871
\cs_new:Npn \__deriv_fraction:nn #1 #2
@@ -904,7 +924,7 @@
904924
{ auto } { \__deriv_scale_auto:Nnnn \__deriv_auto_left:n {#1} {#2} { 1 } }
905925
{ none } { \__deriv_scale_none:nnn {#1} {#2} { 1 } }
906926
}
907-
{ \__deriv_scale_big:nnnm {#1} {#2} { 1 } { l } }
927+
{ \__deriv_scale_big:nnnn {#1} {#2} { 1 } { l } }
908928
}
909929
% dv , name
910930
\cs_new:Npn \__deriv_scale_right:nn #1 #2
@@ -914,7 +934,7 @@
914934
{ auto } { \__deriv_scale_auto:Nnnn \__deriv_auto_right:n {#1} {#2} { 2 } }
915935
{ none } { \__deriv_scale_none:nnn {#1} {#2} { 2 } }
916936
}
917-
{ \__deriv_scale_big:nnnm {#1} {#2} { 2 } { r } }
937+
{ \__deriv_scale_big:nnnn {#1} {#2} { 2 } { r } }
918938
}
919939
% left/right , dv , name, number
920940
\cs_new:Npn \__deriv_scale_auto:Nnnn #1 #2 #3 #4
@@ -1326,4 +1346,6 @@
13261346
}
13271347
\derivset{all}
13281348

1349+
13291350
\endinput
1351+

0 commit comments

Comments
 (0)