Skip to content

Commit db2d3f6

Browse files
committed
v1.01
1 parent ab15be5 commit db2d3f6

File tree

4 files changed

+32
-48
lines changed

4 files changed

+32
-48
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## README for derivative package v1.0 dated 2021-05-25
1+
## README for derivative package v1.01 dated 2021-05-28
22

33
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:
44

derivative.pdf

-36 Bytes
Binary file not shown.

derivative.sty

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
\NeedsTeXFormat{LaTeX2e}
1717

1818
\RequirePackage{xparse}[2018/05/09]
19-
\ProvidesExplPackage{derivative}{2021/05/25}{1.0}{Nice and easy derivatives and differentials for LaTeX}
19+
\ProvidesExplPackage{derivative}{2021/05/28}{1.01}{Nice and easy derivatives and differentials for LaTeX}
2020

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

@@ -147,6 +147,7 @@
147147

148148
\prop_const_from_keyval:Nn \c__deriv_dv_pkg_keys_prop
149149
{
150+
style-inf = d,
150151
style-frac = \frac,
151152
style-frac-/ = \slashfrac,
152153
style-var = single,
@@ -188,12 +189,9 @@
188189
mixed-order = 1
189190
}
190191

191-
\bool_lazy_or:nnTF { \sys_if_engine_luatex_p: } { \sys_if_engine_xetex_p: }
192-
{ \prop_gput:Nnn \c__deriv_dv_pkg_keys_prop { style-inf } { \symnormal } }
193-
{ \prop_gput:Nnn \c__deriv_dv_pkg_keys_prop { style-inf } { \mathnormal } }
194-
195192
\prop_const_from_keyval:Nn \c__deriv_i_pkg_keys_prop
196193
{
194+
style-inf = d,
197195
style-notation = multiple,
198196
style-notation-* = single,
199197
scale-var = auto,
@@ -207,16 +205,12 @@
207205
sep-var-inf = \mathop{}\!,
208206
sep-var-var = {,},
209207
sep-ord-ord = {,},
210-
sep-end = \mathop{}\!,
208+
sep-end = 0,
211209
switch-* = false,
212210
var = none,
213211
order = 1
214212
}
215213

216-
\bool_lazy_or:nnTF { \sys_if_engine_luatex_p: } { \sys_if_engine_xetex_p: }
217-
{ \prop_gput:Nnn \c__deriv_i_pkg_keys_prop { style-inf } { \symnormal } }
218-
{ \prop_gput:Nnn \c__deriv_i_pkg_keys_prop { style-inf } { \mathnormal } }
219-
220214
%%%%%% Key-val for all %%%%%%
221215

222216
\prop_const_from_keyval:Nn \c__deriv_all_pkg_keys_prop
@@ -387,12 +381,13 @@
387381
\cs_new_protected:Npn \deriv_preamble:NNnnn #1 #2 #3 #4 #5
388382
{
389383
\tl_set:Nx #1 { \cs_to_str:N #2 }
390-
\__deriv_preamble_aux:Vnn #1 {#4} {#5}
391-
\exp_args:NV \deriv_set_style_inf:nnn {#1} {#3} {#5}
384+
\tl_if_novalue:nTF {#4}
385+
{ \__deriv_preamble_aux:Vnn #1 { style-inf={#3} } {#5} }
386+
{ \__deriv_preamble_aux:Vnn #1 { style-inf={#3}, #4} {#5} }
392387
}
393-
% dv/i, variant, inf
388+
% variant, inf, dv/i
394389
\cs_new_protected:Npn \deriv_set_style_inf:nnn #1 #2 #3
395-
{ \keys_set:nn { deriv/#3/#1 } { style-inf = {#2} } }
390+
{ \__deriv_set_default:nnn {#1} { style-inf = {#2} } {#3} }
396391
% variant, key-value, dv/i
397392
\cs_new_protected:Npn \__deriv_preamble_aux:nnn #1 #2 #3
398393
{

derivative.tex

Lines changed: 22 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,6 @@
5050
\definecolor{RoyalBlue}{RGB}{0, 35, 102}
5151
\definecolor{RoyalGreen}{RGB}{32, 77, 2}
5252

53-
%\definecolor{RoyalGray}{RGB}{75, 75, 75}
54-
%\definecolor{RoyalDarkGray}{RGB}{225, 225, 225}
55-
%\definecolor{RoyalLightGray}{RGB}{30, 30, 30}
56-
%\definecolor{RoyalRed}{RGB}{255, 177, 151} % 207, 102, 121
57-
%\definecolor{RoyalBlue}{RGB}{187, 134, 252} % 55, 185, 255
58-
%\definecolor{RoyalGreen}{RGB}{3, 218, 198} % 52, 177, 20
59-
%\definecolor{RoyalPageCoulor}{RGB}{18, 18, 18} % 30, 30, 30
60-
%\definecolor{RoyalTextCoulor}{RGB}{225, 225, 225}
61-
%\pagecolor{RoyalPageCoulor}
62-
%\color{RoyalTextCoulor}
63-
6453
\RequirePackage{amsmath, amsthm}
6554
\allowdisplaybreaks
6655
\theoremstyle{remark}
@@ -103,7 +92,7 @@
10392

10493
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10594

106-
\NewDocumentCommand{\forside}{}
95+
\NewDocumentCommand{\forside}{ m }
10796
{
10897
\thispagestyle{empty}
10998

@@ -134,7 +123,7 @@
134123

135124
\begin{abstract}
136125
\noindent \ignorespaces
137-
The~\mypackage{}~package~provides~a~set~of~commands~which~makes~writing~ordinary~and~partial~derivatives~of~arbitrary~order~in~a~straight~forward~manner.~Additionally,~this~package~provides~a~set~of~commands~to~define~variants~of~the~aforementioned~derivatives.~A~set~of~optional~arguments~along~with~lots~of~package~options~allow~for~easy~and~great~flexibility~over~the~derivative's~format,~such~as~where~the~function~is~positioned,~point~of~evaluation,~and~switching~between~fraction~styles.~Moreover,~the~mixed~order~of~the~partial~derivative~and~variants~hereof~is~automatically~computed.~This~package~is~written~in~the~\pkg{expl3}~language~and~requires~therefore~the~\LaTeX3~package~bundles~\pkg{l3kernel}~and~\pkg{l3package}.~Additionally,~the~\pkg{mleftright}~package~is~optional~and~provides~the~improved~automatically~scaling~\cs{mleft}~and~\cs{mright}.
126+
#1
138127
\end{abstract}
139128

140129
\vfill
@@ -394,7 +383,6 @@
394383
{
395384
}
396385

397-
398386
\tl_new:N \l__mydoc_number_tl
399387
\tl_new:N \l_mydoc_index_item_tl
400388
\tl_new:N \l_mydoc_index_subitem_tl
@@ -1319,14 +1307,12 @@
13191307
\ExplSyntaxOff
13201308
\makeatother
13211309

1322-
1323-
13241310
\Pakkenavn{derivative}
13251311
\Titel{The \pakkenavn{} package}
13261312
\Forfatter{Simon Jensen}
13271313
1328-
\Dato{2021/05/25}
1329-
\Version{1.0}
1314+
\Dato{2021/05/28}
1315+
\Version{1.01}
13301316

13311317
\RequirePackage{derivative}[\dato]
13321318
\derivset{all}[scale-auto = mleftmright]
@@ -1362,13 +1348,14 @@
13621348

13631349
\begin{document}
13641350

1365-
\forside
1351+
\forside{%
1352+
The \mypackage{} package provides a set of commands which makes writing ordinary and partial derivatives of arbitrary order in a straight forward manner. Additionally, this package provides a set of commands to define variants of the aforementioned derivatives. A set of optional arguments along with lots of package options allow for easy and great flexibility over the derivative's format, such as where the function is positioned, point of evaluation, and switching between fraction styles. Moreover, the mixed order of the partial derivative and variants hereof is automatically computed. This package is written in the \pkg{expl3} language and requires therefore the \LaTeX3 package bundles \pkg{l3kernel} and \pkg{l3package}. Additionally, the \pkg{mleftright} package is optional and provides the improved automatically scaling \cs{mleft} and \cs{mright}.%
1353+
}
13661354

13671355
\clearpage
13681356
\tableofcontents
13691357

13701358
\clearpage
1371-
\section{Introduction}
13721359
This package started as a personal package a few years ago that I used in various projects. Firstly, it was written in \tex{} and \latex, which gave rise to various errors as the complexity of the package grew larger and ended up as a spaghetti code. Therefore, the code was rewritten into the \latex3 language and may now be easily maintained. Originally this package was written because there did not exist any great package for derivatives. It was first much later that I discovered the \pkg{diffcoeff} package, which does a good job. However, at this time, I had already written much of the code with no documentation. So I decided to write one and make it into a package for the public.
13731360

13741361
As a note on terminology, I use the wording \emph{infinitesimal} abbreviated as \texttt{inf} for the operator symbols $d, \partial, \delta$ etc. that used in derivatives like $\odv{y}{x}, \pdv{y}{x}, \fdv{y}{x}$ and in differentials like $\odif{x}, \pdif{x}, \fdif{x}$. In the description of macros and options, I often write \emph{cs-\meta{placeholder}} to denote a comma-separated list of \meta{placeholder}. For example, \oarg{cs-numbers} is used in the option section for math space keys to denote comma-separated list of numbers. It should also be noted that whenever an argument reads \meta{keyvalue list}, it means that it is a comma-separated list of keyvalue pairs.
@@ -2041,7 +2028,7 @@
20412028
\subsubsection*{Miscellaneous}
20422029

20432030
\begin{option}*{fun}[cat=misc, new = v1.0]
2044-
\begin{values}
2031+
\begin{values}[default = false]
20452032
true, false
20462033
\end{values}
20472034
Adds or remove delimiters around the function.
@@ -2054,7 +2041,7 @@
20542041
\end{option}
20552042

20562043
\begin{option}{frac}[cat=misc, new = v1.0]
2057-
\begin{values}
2044+
\begin{values}[default = false]
20582045
true, false
20592046
\end{values}
20602047
Adds or remove delimiters around the fractional part of the derivative.
@@ -2232,7 +2219,7 @@
22322219
\end{option}
22332220

22342221
\begin{option}{sep-end}
2235-
\begin{values}[default = \cs{mathop}\{\}\cs{!}]
2222+
\begin{values}[default = 0]
22362223
\meta{cs-number}, \marg{mspace}, \marg{delimiter}
22372224
\end{values}
22382225
Sets the math space that is inserted to the right of the last differential. The key's default value is \val{\default}.
@@ -2288,7 +2275,6 @@
22882275
\end{option}
22892276

22902277

2291-
22922278
\clearpage
22932279
\section{Defining variants} \label{sec:defvar}
22942280
This section goes into detail with how to define derivative and differential variants based on the package's internal commands, as mentioned earlier. The \mypackage{} package provides a \latex2 way of defining the derivatives.
@@ -2485,6 +2471,8 @@
24852471
\pdv[order={n+3k, n-k}, mixed-order={2(n+k)}]{f}{x,y}
24862472
\end{example}
24872473

2474+
2475+
24882476
\clearpage
24892477
\section{Miscellaneous}
24902478

@@ -2518,7 +2506,6 @@
25182506
\end{function}
25192507

25202508

2521-
25222509
\clearpage
25232510
\section{To do}\label{sec:todo}
25242511

@@ -2531,11 +2518,11 @@
25312518
\answer{\cmark\xmark}{There could be an draft/final option for the package. But what is should turn off/on is harder to say.}
25322519
\end{todo}
25332520

2534-
\subsection{Future changes}
2535-
The list describes what \emph{will be changed} in the package in a later release.
2536-
\begin{changes}
2537-
\item
2538-
\end{changes}
2521+
%\subsection{Future changes}
2522+
%The list describes what \emph{will be changed} in the package in a later release.
2523+
%\begin{changes}
2524+
% \item
2525+
%\end{changes}
25392526

25402527
\subsection{Future considerations}
25412528
The list describes what \emph{might be changed or added} to the package in a later release.
@@ -2547,7 +2534,6 @@
25472534
\end{consideration}
25482535

25492536

2550-
25512537
\clearpage
25522538
\addsec{Index}
25532539
Numbers in bold refer to the page where the entry is defined.
@@ -2558,8 +2544,6 @@
25582544

25592545
\printindex[macro]
25602546

2561-
2562-
25632547
\clearpage
25642548
\addsec{Change history}
25652549

@@ -2610,6 +2594,11 @@
26102594
\item Fixed Documentation errors
26112595
\item Enhanced support for preventing options effecting nested derivatives/differentials
26122596
\end{change}
2597+
\begin{change}[version = 1.01, date = 2021-05-28, beta = false]
2598+
\item Changed the option \key[index=false]{sep-end} default value because it caused issues
2599+
\item Fixed code errors due to changes introduced in version 1.0 to the option \key[index=false]{style-inf}
2600+
\item Fixed documentation errors
2601+
\end{change}
26132602
\end{changelog}
26142603

26152604
\end{document}

0 commit comments

Comments
 (0)