texlive[68838] Master/texmf-dist: diffcoeff (14nov23)
commits+karl at tug.org
commits+karl at tug.org
Tue Nov 14 22:02:04 CET 2023
Revision: 68838
https://tug.org/svn/texlive?view=revision&revision=68838
Author: karl
Date: 2023-11-14 22:02:04 +0100 (Tue, 14 Nov 2023)
Log Message:
-----------
diffcoeff (14nov23)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/diffcoeff/README.txt
trunk/Master/texmf-dist/doc/latex/diffcoeff/diffcoeff.pdf
trunk/Master/texmf-dist/doc/latex/diffcoeff/diffcoeff.tex
trunk/Master/texmf-dist/tex/latex/diffcoeff/diffcoeff.sty
Modified: trunk/Master/texmf-dist/doc/latex/diffcoeff/README.txt
===================================================================
--- trunk/Master/texmf-dist/doc/latex/diffcoeff/README.txt 2023-11-14 21:01:55 UTC (rev 68837)
+++ trunk/Master/texmf-dist/doc/latex/diffcoeff/README.txt 2023-11-14 21:02:04 UTC (rev 68838)
@@ -10,10 +10,8 @@
http://www.latex-project.org/lppl.txt
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-Version 5.3 of diffcoeff fixes a bug that arose in the use
-of the differential in beamer, introduces an alternative way
-of specifying orders of differentiation and reintroduces the
-override option.
+Version 5.4 of diffcoeff adds to the configurability of the
+differential and adjusts documentation accordingly.
Version 5.0 of diffcoeff introduced many interface incompat-
ibilities with version 4, which is still available through
@@ -24,15 +22,13 @@
Manifest
%%%%%%%%
-Changed files:
README.txt this document
-diffcoeff.sty LaTeX .sty file (current version, v5.1)
-diffcoeff.pdf documentation for current version, v5.1
-diffcoeff.tex LaTeX source of documentation for v5.3
-diffcoeff5.def definition file for v5.1
+diffcoeff.sty LaTeX .sty file
+diffcoeff.pdf documentation for current version
+diffcoeff.tex LaTeX source of documentation
+diffcoeff5.def definition file
-Unchanged files
-diffcoeff4.sty LaTeX .sty file, v4.2
+diffcoeff4.sty LaTeX .sty file for v4.2
diffcoeff4.pdf documentation for v4.2
diffcoeff4.tex LaTeX source of documentation for v4.2
diffcoeff-doc.def definition file for v4.2
Modified: trunk/Master/texmf-dist/doc/latex/diffcoeff/diffcoeff.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/diffcoeff/diffcoeff.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/diffcoeff/diffcoeff.tex 2023-11-14 21:01:55 UTC (rev 68837)
+++ trunk/Master/texmf-dist/doc/latex/diffcoeff/diffcoeff.tex 2023-11-14 21:02:04 UTC (rev 68838)
@@ -1,4 +1,4 @@
-%% LyX 2.4.0-beta2 created this file. For more info, see https://www.lyx.org/.
+%% LyX 2.4.0~beta5 created this file. For more info, see https://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[english]{report}
\usepackage{lmodern}
@@ -38,7 +38,7 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
\newenvironment{centred}%
- {\begin{center}\baselineskip=13pt\parskip=1pt }{\end{center}}
+ {\begin{center}}{\end{center}}
\newenvironment{example}%
{\begin{center}\ttfamily}{\end{center}}
@@ -86,6 +86,10 @@
lvwrap-Ldelim = \onemu\mleft [,
lvwrap-Rdelim = \mright ]
}
+% differential d^n x
+\difdef { l } { dn }{ style = d^ }
+\NewDocumentCommand \dn { m m }
+ { \dl.dn.[#1]{#2} }
% mimicking the \Braket command
% of the braket package
\difdef{ s }{ bk }
@@ -113,7 +117,7 @@
\title{\texttt{diffcoeff}~\\
a \LaTeX{} package to ease\texttt{ }the~\\
writing of differential coefficients \\
- Version 5.3}
+ Version 5.4}
\author{Andrew Parsloe\\
{\small (ajparsloe at gmail.com)}}
\maketitle
@@ -655,18 +659,18 @@
For partial differentiation in more than one variable -- so-called
\emph{mixed} partial derivatives -- see \xA7\ref{subsec:Mixed-partial-derivatives}.
-\subsubsection{Alternative method}
+\subsubsection{Alternative method (colon notation)}
From version 5.3 of \texttt{diffcoeff} it is also possible to specify
-the order by the method shown in the example
+the order by the method shown here:
\begin{centred}
\verb`\[ \diffp y{x:2}, \quad \diffp y{x:n+1}. \]` $\Longrightarrow$
\[ \diffp y{x:2}, \quad \diffp y{x:n+1}. \]
\end{centred}
A colon separates the variable from its order of differentiation.
-This is really intended not for one variable, as here, but for mixed
-partial derivatives when there are a number of variables subject to
-different orders of differentiation.
+This is more relevant when there is more than one variable subject
+to different orders of differentiation -- so-called mixed partial
+derivatives.
\subsection{Appending the differentiand}
@@ -802,8 +806,8 @@
It is easy to add a superscript to a derivative to indicate evaluation
at two points and the difference between the values:
\begin{centred}
-\verb`\[ \diff {\sin x}x[0]^{\!\!\pi/2} \]` ${\displaystyle \Longrightarrow}$
-\[ \diff{\sin x}x[0]^{\!\!\pi/2} \]
+\verb`\[ \diff {\sin x}x[0]^{\mkern-10mu\pi/2} \]` ${\displaystyle \Longrightarrow}$
+\[ \diff{\sin x}x[0]^{\mkern-9mu\pi/2} \]
\end{centred}
but to my eye either square brackets or a vertical rule are clearer
for this purpose (and do not involve nudging the subscript or superscript
@@ -910,14 +914,14 @@
To differentiate variables to higher order, their orders need to be
specified explicitly. To do so use a comma list for the optional argument
-(or, since version 5.3, use the alternative method of \xA7\ref{subsec:Alternative-method}):
+or, since version 5.3, use the alternative method of \xA7\ref{subsec:Alternative-method}:
\begin{centred}
-\verb`$ \difcp[2,3]F{x,y,z} $` $\Longrightarrow$ $ \difcp[2,3] F{x,y,z}$,
+\verb`\[ \diffp[2,3]F{x,y,z}, \]` $\Longrightarrow$ \[ \diffp[2,3]F{x,y,z}, \]
-\verb`\[ \diffp[2,3]F{x,y,z} \]` $\Longrightarrow$ \[ \diffp[2,3]F{x,y,z}. \]
+\verb`$ \difcp F{x:2,y:3,z} $` $\Longrightarrow$ $ \difcp F{x:2,y:3,z}$.
\end{centred}
\noindent Notice that the overall order of the derivative -- 6 --
-in the second of these is again automatically calculated and inserted
+in the first of these is again automatically calculated and inserted
as a superscript on the $\partial$ symbol in the numerator.
In the example, the comma list of orders has only \emph{two} members,
@@ -930,12 +934,11 @@
But you \emph{cannot} use an order specification like \verb`[,,2]`;
instead write {\ttfamily\verb`[1,1,2]`} (which is the natural
thing to do in any case).\textbf{ }It is only the \emph{tail} of an
-order specification which can be omitted.
+order specification which can be omitted. In the other direction,
+if there are more orders of differentiation specified than there are
+variables, the list of orders is truncated to match the number of
+variables.
-In the other direction, if there are more orders of differentiation
-specified than there are variables, the list of orders is truncated
-to match the number of variables.
-
\subsubsection{Algebraic orders of differentiation}
Orders of differentiation do not need to be numerical. They can also
@@ -950,7 +953,7 @@
\[ \diffp[1,km+1,m+k-1]{F(x,y,z)}{x,y,z}. \]
\end{centred}
-\subsubsection{Alternative method}
+\subsubsection{Alternative method (colon notation)}
\label{subsec:Alternative-method}When there are two or more variables
of differentiation, particularly when subject to different orders
@@ -993,13 +996,9 @@
option, entering the factorized form between angle brackets before
the differentiand:
\begin{verbatim}
- \[
- \diffp<(k+1)(m+1)>{F(x,y,z)}{x,y:km+1,z:m+k-1}
- \]
+ \[ \diffp<(k+1)(m+1)>{F(x,y,z)}{x,y:km+1,z:m+k-1}. \]
\end{verbatim}
-$\Longrightarrow$ \[
- \diffp<(k+1)(m+1)>{F(x,y,z)}{x,y:km+1,z:m+k-1}.
- \]
+$\Longrightarrow$ \[ \diffp<(k+1)(m+1)>{F(x,y,z)}{x,y:km+1,z:m+k-1}. \]
When the override option is used, the algorithm that calculates the
total order is sidestepped. It does not get called at all. In this
@@ -1173,7 +1172,7 @@
\[
\diffp[2]F{x,y,z},
\]
-\verb`2 mu` of spacing is inserted between the $\partial y$ and
+Spacing of \verb`2 mu` is inserted between the $\partial y$ and
$\partial z$, but because the superscript already provides some separation
between them, only \verb`1 mu` is inserted between $\partial x^{2}$
and $\partial y$. The values used for the spacing and its adjustment
@@ -1222,7 +1221,7 @@
$d\sin x$ that is of the second order. But as the examples in the
Rogues' Gallery show -- see particularly (\ref{eq:eg3}) -- the
inclination seems to be to do otherwise. This may be because one wants
-in any case to parenthesise the variable to show that the `d' symbol
+in any case to parenthesize the variable to show that the `d' symbol
attaches to the whole variable and not just its \emph{first} character.
A second, outer pair of parentheses then seems too fussy and detracts
from comprehending the symbol `at a glance':
@@ -1235,8 +1234,8 @@
-- of long variables for \emph{higher order} derivatives is customisable
(\xA7\ref{sec:ChangingDefaults}).
-For first order derivatives parenthesising does not occur automatically.
-If you want the variable of differentiation to be parenthesised, you
+For first order derivatives parenthesizing does not occur automatically.
+If you want the variable of differentiation to be parenthesized, you
need to do it yourself:
\begin{centred}
\verb`\[\diff {f(x)}{x/k}, \quad \diff {f(x)}{(x/k)}.\]` $\Longrightarrow$
@@ -1250,7 +1249,7 @@
\begin{centred}
\verb`\[ \diffp[2]q{\frac 1\Theta} \]` $\Longrightarrow$ \[ \diffp[2]q{\frac 1\Theta}.\]
\end{centred}
-\noindent As noted, when differentiating to first order, parenthesising
+\noindent As noted, when differentiating to first order, parenthesizing
is up to the user:
\begin{centred}
\verb`\[ \diffp q{(\frac 1\Theta),V} \]` $\Longrightarrow$ \[ \diffp q{(\frac 1\Theta),V}. \]
@@ -1263,8 +1262,8 @@
in the \LaTeX 3 bundle {\ttfamily\verb`l3packages`}). The
stuff of \verb`xtemplate` is \emph{templates}, their definition,
their manipulation. For \verb`diffcoeff` a template is a list of
-parameter values determining how a derivative looks in the pdf. The
-parameters may be broad-brush settings like whether the derivative
+parameter values determining what a derivative looks like in the pdf.
+The parameters may be broad-brush settings like whether the derivative
is built from \verb`\frac` or the slash \verb`/` or in compact form,
or whether the operator symbol is \verb`d` or \verb`\partial` (or
\verb`\nabla` or \verb`\delta` or \ldots ), or the parameters may
@@ -1324,7 +1323,7 @@
in Table~\ref{tab:DIF-defaults} indicating lines of inheritance
of default values. Only the child and grandchild templates of \verb`DIF`
are used for actual construction of derivatives (and jacobians and
-differentials). \verb`DIF` itself sits `above the fray'.
+differentials). \verb`DIF` itself `sits above the fray'.
\begin{table}
\centering{}\caption{\protect\label{tab:Template-inheritance}Template inheritance}
@@ -1356,7 +1355,7 @@
\noindent\begin{minipage}[t]{1\columnwidth}%
\begin{shaded}%
\noindent Users of version 4 of \texttt{diffcoeff} will notice similarities
-with and differences from the earlier version. Some key names remain
+with and differences from that earlier version. Some key names remain
(\verb`op-symbol`), some names have changed (\verb`multi-term-sep`
for \verb`denom-term-sep`), keys beginning with an asterisk, \verb`*`,
lack a following hyphen (\verb`*derivand-sep` rather than \verb`*-derivand-sep`),
@@ -1409,7 +1408,7 @@
{\small derivand-sep} & {\small\texttt{3 mu plus 1 mu minus 2 mu}} & {\small f, fp, s, sp, c, cp}\tabularnewline
{\small op-symbol} & {\small\texttt{\textbackslash mathrm\{d\}}} & {\small f, fp, s, sp, c, cp, j, l}\tabularnewline
{\small op-symbol-alt} & {\small\texttt{op-symbol}} & {\small f, fp, s, sp, \phantom{{\small c, cp,}} j}\tabularnewline
-{\small op-order-nudge} & {\small\texttt{0 mu}} & {\small f, fp, s, sp, c, cp}\tabularnewline
+{\small op-order-nudge} & {\small\texttt{0 mu}} & {\small f, fp, s, sp, c, cp, \phantom{j,} l }\tabularnewline
{\small var-sup-nudge} & {\small\texttt{1 mu}} & {\small f, fp, s, sp, \phantom{{\small c, cp,} j,} l}\tabularnewline
{\small multi-term-sep} & {\small\texttt{2 mu plus 1 mu minus 1 mu}} & {\small f, fp, s, sp, c, cp, \phantom{j,} l}\tabularnewline
{\small term-sep-adjust} & {\small\texttt{-1 mu}} & {\small f, fp, s, sp, c, cp, \phantom{j,} l}\tabularnewline
@@ -1461,12 +1460,13 @@
respectively, not scalable
\item default in templates \verb`DIFS`, \verb`DIFSP` = \verb`/`
\end{itemize}
-\item for compact-form derivatives, \verb`\difc`, \verb`\difcp`, a choice
-of \texttt{\_} or \verb`dl`
+\item for compact-form derivatives, \verb`\difc`, \verb`\difcp`, and
+differentials, a choice of \verb`_` or \verb`dl` or \verb`d^`
\begin{itemize}
-\item \_ forms derivatives of compact form like $\difc yx$, $\difcp[1,2]{z}{x,y}$
+\item \verb`_` forms derivatives of compact form like $\difc yx$, $\difcp[1,2]{z}{x,y}$
+\item \verb`d^` is a synonym for \verb`_`
\item \verb`dl` forms differentials like $\difc.dl.{}x$ and $\difcp.dl.[2]{}{x,y,z}$
-\item default in templates \verb`DIFC`, \verb`DIFCP` = \texttt{\_}
+\item default in templates \verb`DIFC`, \verb`DIFCP` = \verb`_`
\end{itemize}
\item overall default in template \verb`DIF` = \verb`frac`
\end{itemize}
@@ -1763,11 +1763,12 @@
\emph{three} mandatory arguments for defining variant forms of derivative.
Do not confuse with the command \verb`\diffdef` of earlier versions
of \verb`diffcoeff` which took \emph{two }mandatory arguments for
-this purpose. The third argument is required to identify which one
-or more of the fraction forms \verb`f`, \verb`s`, \verb`c`, \verb`fp`,
-\verb`sp`, \verb`cp` of the commands \verb`\difx`, \verb`\difxp`,
-the variant applies to. In earlier versions this was not necessary
-since there was only the one primary derivative command \verb`\diff`.\end{shaded}%
+this purpose. The additional argument is required to identify which
+one or more of the fraction forms \verb`f`, \verb`s`, \verb`c`,
+\verb`fp`, \verb`sp`, \verb`cp` of the commands \verb`\difx`,
+\verb`\difxp`, the variant applies to. In earlier versions this was
+not necessary since there was only the one primary derivative command
+\verb`\diff`.\end{shaded}%
\end{minipage}
\medskip{}
@@ -1840,11 +1841,11 @@
In earlier versions of \verb`diffcoeff`, if there was no explicit
\verb`def-file=<filename>` package option statement, then a file
-\verb`diffcoeff.def` was searched for and if found loaded. This is
-no longer the case. Version 5 of \verb`diffcoeff` searches for a
-\verb`.def` \emph{only if it is explicitly named} in a package option
-statement. (This decision was made at least in part to avoid conflict
-with a \verb`diffcoeff.def` file from an earlier version of \verb`diffcoeff`
+\verb`diffcoeff.def` was sought and if found loaded. This is no longer
+the case. Version 5 of \verb`diffcoeff` searches for a \verb`.def`
+\emph{only if it is explicitly named} in a package option statement.
+(This decision was made at least in part to avoid conflict with a
+\verb`diffcoeff.def` file from an earlier version of \verb`diffcoeff`
tucked away in some non-obvious place and producing obscure errors
in the current version 5.) \end{shaded}%
\end{minipage}
@@ -1876,7 +1877,7 @@
}
\end{verbatim}
to give both upright- (the \verb`f`) and slash-fraction (the \verb`s`)
-forms of the acceleration. Appending tne dot-delimited name \verb`n`
+forms of the acceleration. Appending the dot-delimited name \verb`n`
to \verb`\difs`, \verb`$ \difs.n.{v^i}t $` $\Longrightarrow$ $ \difs.n.{v^i}t $,
and appending the dot-delimited name \verb`n` to \verb`\diff`,
\begin{centred}
@@ -2152,15 +2153,17 @@
\verb`$ \difc[3]f{} $` $\Longrightarrow$ $ \difc[3]f{} $
\end{centred}
Note that this is the behaviour from version 5.2 of \verb`diffcoeff`.
-In version 5.1, a brace pair alone would halt compilation; a \emph{nested
-}brace pair, \verb`{{}}`, was required.
+In version 5.1, a \emph{nested }brace pair, \verb`{{}}`, was required;
+a brace pair alone halted compilation. If you want to write `differentials
+of differentials' then this is a possible way of doing so; but see
+also the third example in \xA7\ref{subsec:Variant-differentials}.
Suppose now we define a variant form (as is done in \verb`diffcoeff5.def`),
\begin{verbatim}
\difdef { cp } { dl } { style = dl }
\end{verbatim}
-and use it to form a similar expression but without the differentiand,
-an empty argument in its place:
+and use it to form a similar expression but without the differentiand
+this time, an empty argument in its place:
\begin{centred}
\verb`$ \difcp.dl.[3,2]{}{x,y,z} $` $\Longrightarrow$ $ \difcp.dl.[3,2]{}{x,y,z} $
\end{centred}
@@ -2401,8 +2404,12 @@
or in integrals, like $\int\sin x\dl x$, or multi-variable integrals
like
\[
-\iiintop_{-\infty}^{\infty}V(x,y,z)\dl{x,y,z}.
+\iiintop_{-\infty}^{\infty}V(x,y,z)\dl{x,y,z},
\]
+or, with subscripted variables, rendered more cryptically as
+\[
+\iiintop_{-\infty}^{\infty}V(x_{1},x_{2},x_{3})\dl[3]x,\text{ or }\iiintop_{-\infty}^{\infty}V(x_{1},x_{2},x_{3})\dl.dn.[3]x.
+\]
They also occur in differential geometry and elsewhere in the form
of line elements like
\begin{centred}
@@ -2409,64 +2416,75 @@
$\dl.+.{x,y,z}^2$ \quad{}and\quad{} $c^2\dl.-.{t,x,y,z}^2$.
\end{centred}
Surely we want the `d's in these expressions to correspond to their
-form (upright or math italic) in derivatives? To this end, \verb`diffcoeff`
-provides a command \verb`\dl` to write the `d' in a differential
-in a manner consistent with the default form used in derivatives.
-In the present document, the default form is upright and so
+form (upright or math italic) in derivatives?
+
+To this end, \verb`diffcoeff` provides a command \verb`\dl` to write
+the `d' in a differential in a manner consistent with the default
+form used in derivatives. In the present document, the default form
+is upright and so
\begin{centred}
\verb`$ \dl x $` $\Longrightarrow$ $ \dl x. $
\end{centred}
-\noindent To use the command before a multi-token variable of differentiation,
+\noindent (From version 5.4 of \texttt{diffcoeff}, following the pattern
+of \verb`\diff`, \verb`\difs` and \verb`\difc`, the command \verb`\difl`
+is also available: \verb`$ \difl x $` $\Longrightarrow$ $ \difl x $.)
+To use the command before a multi-token variable of differentiation,
put the variable in braces:
\begin{centred}
\verb`$ \dl{\vec{x}},\quad \dl{\mathbf{x}} $` $\Longrightarrow$
$ \dl{\vec{x}},\quad \dl{\mathbf{x}} $.
\end{centred}
-For the triple integral above, writing the differentials required
+For the first triple integral above, writing the differentials required
not three but just the \emph{one} command:
\begin{centred}
\verb`$ \dl{x,y,z} $` $\Longrightarrow$ $ \dl{x,y,z} $.
\end{centred}
-To write the line elements I made use of a dot-delimited argument
-producing a variant form of the differential (see below \xA7\ref{subsec:Line-elements}):
+For the second triple integral, $\dl[3]x$ was just \verb`\dl[3]x`,
+and for the third I used a dot-delimited argument producing a variant
+form of the differential \verb`\dl.dn.[3]x` (which could be compacted
+further into a macro if it were to be used often); see \xA7\ref{subsec:Variant-differentials}
+below.
+
+To write the line elements I again made use of a variant form of the
+differential (and again see \xA7\ref{subsec:Line-elements}):
\begin{centred}
\verb`$ \dl.+.{x,y,z}^2 $` $\Longrightarrow$ $ \dl.+.{x,y,z}^2 $,
\verb`$ c^2\dl.-.{t,x,y,z}^2 $` $\Longrightarrow$ $ c^2\dl.-.{t,x,y,z}^2 $.
\end{centred}
-(If what you want is not $\dl[2]x$ but $\difc[2]f{}$, with the superscript
-attached to the \verb`d`, see \xA7\ref{subsec:Compact=002013form-derivatives}.)
\subsection{Template \texttt{DIFL}}
\begin{wraptable}{o}{0.5\columnwidth}%
-\begin{centering}
-\caption{\texttt{DIFL} defaults\protect\label{tab:DIFL-defaults}}
+\centering{}\caption{\texttt{DIFL} defaults\protect\label{tab:DIFL-defaults}}
\begin{center}
-\begin{tabular}{lrr}
+\begin{tabular}{lr}
\toprule
-{\small key} & {\small default} & {\small comment}\tabularnewline
+{\small key} & {\small default}\tabularnewline
\midrule
-{\small style} & {\small\texttt{dl}} & {\small locked}\tabularnewline
-{\small outer-Ldelim} & {\small\texttt{\textbackslash ,}} & \tabularnewline
-{\small outer-Rdelim} & & \tabularnewline
+{\small style} & {\small\texttt{dl}}\tabularnewline
+{\small outer-Ldelim} & {\small\texttt{\textbackslash ,}}\tabularnewline
+{\small outer-Rdelim} & \tabularnewline
\bottomrule
\end{tabular}
-\par\end{center}
-\par\end{centering}
-\end{wraptable}%
+\par\end{center}\end{wraptable}%
The differential command \verb`\dl` gives access to a template \verb`DIFL`
which inherits the default values of the fundamental template \verb`DIF`
-with the (few) changes shown in Table~\ref{tab:DIFL-defaults}. Note
-that the \verb`style` key is fixed at the value \verb`dl`; it cannot
-be changed. The \verb`outer-Ldelim` key inserts a small space before
-the differential; the \verb`outer-Rdelim` key does nothing. For the
-differential, both \verb`outer-Ldelim` and \verb`outer-Rdelim` are
-\emph{always inserted}. This differs from the derivative for which
-\verb`outer-Ldelim` and \verb`outer-Rdelim` are inserted only if
-there is a trailing optional argument. It is as if the differential
-command \verb`\dl` had a built-in empty trailing optional argument.
+with the (few) changes shown in Table~\ref{tab:DIFL-defaults}. In
+prior versions of \texttt{diffcoeff} the \verb`style` key was fixed
+at the value \verb`dl`; from the current version, 5.4, it can also
+take the value \verb`d^`. With the default style \verb`dl`, \verb`$\dl[2]x$`
+$\Longrightarrow$ $\dl[2]x$; with style \verb`d^`, \verb`$\dl[3]x$`
+$\Longrightarrow$ $\dl.dn.[3]x$, a form sometimes used when abbrviating
+the product of differentials in a multiple integral. The \verb`outer-Ldelim`
+key inserts a thin space before the differential; the \verb`outer-Rdelim`
+key does nothing. For the differential, both \verb`outer-Ldelim`
+and \verb`outer-Rdelim` are \emph{always inserted}. This differs
+from the derivative for which \verb`outer-Ldelim` and \verb`outer-Rdelim`
+are inserted only if there is a trailing optional argument. It is
+as if the differential command \verb`\dl` had a built-in empty trailing
+optional argument.
That so few of the \verb`DIF` defaults are changed in \verb`DIFL`
indicates that much of the machinery of derivative formation is irrelevant
@@ -2500,7 +2518,12 @@
will be raised; overrides the \verb`order-spec` ; see \xA7\ref{subsec:Line-elements}
for examples of use.
\end{enumerate}
-Only the third argument is mandatory, although it may be empty.
+Only the third argument is mandatory, although it may be empty. As
+with derivatives, the square-bracket delimited order spec. can be
+replaced with colon-modified arguments in the variable specification:
+\begin{centred}
+\verb`$ \dl[3]x,\quad \dl{x:3} $` $\Longrightarrow$ $ \dl[3]x,\quad \dl{x:3} $.
+\end{centred}
\subsection{Variant forms of differential}
@@ -2534,7 +2557,8 @@
-- perhaps in a document like the present one to discuss the minutiae
of spacing in the denominators of mixed partial derivatives.
\begin{centred}
-\verb`$\dl.p.[3,2]{x,y,z}$` $\Longrightarrow$ $\dl.p.[3,2]{x,y,z}$
+\verb`$\dl.p.[3,2]{x,y,z},\quad \dl.p.{x:3,y:2,z}$` $\Longrightarrow$
+$\dl.p.[3,2]{x,y,z},\quad \dl.p.{x:3,y:2,z}$
\end{centred}
As you can see from the example, just as for mixed partial derivatives,
if more than one variable is specified but the \verb`order-spec`
@@ -2553,6 +2577,29 @@
\begin{centred}
\verb`$ \dl.b.x,\quad \dl.b.{x,y,z} $` $\Longrightarrow$ $ \dl.b.x ,\quad \dl.b.{x,y,z} $.
\end{centred}
+A third example is of a differential raised to a power in which the
+superscript is attached to the \verb`d`, as provided by the definition
+\begin{verbatim}
+ \difdef { l } { dn } { style = d^ }
+\end{verbatim}
+With this definition
+\begin{verbatim}
+ \[ \iiintop_{-\infty}^{\infty}
+ V(x_{1},x_{2},x_{3})\dl.dn.[3]x.
+\end{verbatim}
+$\Longrightarrow$ \selectlanguage{english}%
+\[ \iiintop_{-\infty}^{\infty}
+ V(x_{1},x_{2},x_{3})\dl.dn.[3]x. \]If you are going to need this form of differential often, you could
+save some keystrokes with a macro definition like
+\begin{centred}
+\selectlanguage{english}%
+\verb`\NewDocumentCommand \dn { m m } { \dl.dn.[#1]{#2} }`
+\end{centred}
+In fact I have added this and the associated \selectlanguage{english}%
+\verb`\difdef` command to the preamble of the present document, so that it suffices
+to write \selectlanguage{english}%
+\verb`\dn3x` to obtain $\dn3x{}$.
+\selectlanguage{english}%
\subsubsection{Line elements}
@@ -2641,25 +2688,22 @@
for writing jacobians -- not the determinant as such but the symbol
conventionally used to denote the determinant. For example
\begin{centred}
-\verb`\[ \jacob{u,v,w}{x,y,z} \]` $\Longrightarrow$ \[ \jacob{u,v,w}{x,y,z} \]
+\verb`\[ \jacob{u,v}{x,y},\quad \jacob{u,v,w}{x,y,z}. \]` $\Longrightarrow$
+\[ \jacob{u,v}{x,y},\quad \jacob{u,v,w}{x,y,z}. \]
\end{centred}
The comma lists can contain any number of variables, even one or none,
-\[
-\jacob uv,\quad\jacob{}{},
-\]
nor need the numbers in numerator and denominator be equal. \verb`\jacob`
-does \emph{not} check such things. It is perfectly possible to form
-unbalanced objects like
-\begin{centred}
-\verb`\[ \jacob{u,v,w}{x,y},\quad\jacob{u,v}{x,y,z}. \]` $\Longrightarrow$
-\[ \jacob{u,v,w}{x,y},\quad\jacob{u,v}{x,y,z}. \]
-\end{centred}
-Perhaps there are contexts where these are meaningful?
+does \emph{not} check such things. (It may be possible to exploit
+this fact when defining variant forms of jacobian, or other notations
+-- like the \verb`\Braket` example in \xA7\ref{subsec:Other-notations}.)
-\subsection{Template \texttt{DIFJ}}
+From version 5.4 of \texttt{diffcoeff}, following the pattern of \verb`\diff`,
+\verb`\difs` and \verb`\difc`, the command \verb`\difj` is also
+available and is equivalent to \verb`\jacob`.
-\begin{wraptable}{o}{0.45\columnwidth}%
-\centering{}\caption{\texttt{DIFJ} defaults\protect\label{tab:DIFJ-defaults}}
+\begin{wraptable}[8]{o}{0.45\columnwidth}%
+\centering{}\vspace{2ex}
+\caption{\texttt{DIFJ} defaults\protect\label{tab:DIFJ-defaults}}
\begin{center}
\begin{tabular}{lr}
\toprule
@@ -2671,6 +2715,10 @@
\bottomrule
\end{tabular}
\par\end{center}\end{wraptable}%
+~~
+
+\subsection{Template \texttt{DIFJ}}
+
Jacobians are configurable. Like other commands of \verb`diffcoeff`,
\verb`\jacob` gives access to a template, in this case \verb`DIFJ`,
which is a child of the fundamental template \verb`DIF` and inherits
@@ -2800,7 +2848,8 @@
generally is) empty.\newpage{}
\end{enumerate}
\begin{description}
-\item [{\texttt{\textbackslash jacob}}] jacobian with arguments and delimiters:
+\item [{\texttt{\textbackslash jacob}}] (also \verb`\difj`) jacobian
+with arguments and delimiters:
\end{description}
\begin{enumerate}
\item \verb`.name.` (optional) name of variant form of jacobian;
@@ -2808,7 +2857,8 @@
\item \verb`{denom}` (mandatory) comma list of variables forming the denominator.
\end{enumerate}
\begin{description}
-\item [{\texttt{\textbackslash dl}}] differential with arguments and delimiters:
+\item [{\texttt{\textbackslash dl}}] (also \verb`\difl`) differential
+with arguments and delimiters:
\begin{enumerate}
\item \verb`.name.` (optional) name of variant form of differential;
\item \verb`[order(s)]` (optional) order of differential or comma list
@@ -2839,12 +2889,9 @@
\section{Templates}
The following lists record the default values of the templates used
-by \verb`diffcoeff`. A marginal \verb`>` indicates where a setting
-differs from that in \verb`DIF`, \verb`>>` where a setting differs
-from that in \verb`DIFF`, \verb`DIFS` or \verb`DIFC` as the case
-may be. For the latter templates, only \emph{relevant }keys have been
-listed -- those which affect the appearance of the derivative (or
-jacobian or differential).
+by \verb`diffcoeff`. For templates other than \verb`DIF`, only \emph{relevant
+}keys have been listed -- those which affect the appearance of the
+derivative (or jacobian or differential).
\subsection{\texttt{DIF} (primogenitor)}
\begin{verbatim}
@@ -2881,7 +2928,7 @@
\subsection{\texttt{DIFF} (upright-fraction derivative)}
\label{subsec:DIFF-(upright-fraction-derivative)}Relevant keys and
-default values for template \verb`DIFF`.
+default values for template \verb`DIFF`.
\begin{verbatim}
style = frac,
derivand-sep = 3 mu plus 1 mu minus 2 mu,
@@ -2906,7 +2953,8 @@
\subsubsection{\texttt{DIFFP}}
-\verb`DIFF` defaults as above with these changes:
+\verb`DIFF` defaults as above with the following changes (a marginal
+\verb`>>` indicates where a setting differs from that in \verb`DIFF`):
\begin{verbatim}
>> op-symbol = \partial,
>> op-order-nudge = 1 mu,
@@ -2916,7 +2964,8 @@
\subsection{\texttt{DIFS} (slash-fraction derivative)}
\label{subsec:DIFS-(slash-fraction-derivative)}Relevant keys and
-default values for template \verb`DIFS`.
+default values for template \verb`DIFS`. A marginal \verb`>` indicates
+where a setting differs from that in \verb`DIF`.
\begin{verbatim}
> style = /,
slash-tok = /,
@@ -2947,7 +2996,8 @@
\subsubsection{\texttt{DIFSP}}
-\verb`DIFS` defaults as above with these changes:
+\verb`DIFS` defaults as above with the following changes (a marginal
+\verb`>>` indicates where a setting differs from that in \verb`DIFS`):
\begin{verbatim}
>> op-symbol = \partial,
>> op-order-nudge = 1 mu
@@ -2956,7 +3006,8 @@
\subsection{\texttt{DIFC} (compact derivative)}
\label{subsec:DIFC-(compact-derivative)}Relevant keys and default
-values for template \verb`DIFC`.
+values for template \verb`DIFC`. A marginal \verb`>` indicates where
+a setting differs from that in \verb`DIF`.
\begin{verbatim}
> style = _ ,
> derivand-sep = 1 mu plus 1 mu minus 2 mu,
@@ -2974,7 +3025,8 @@
\subsubsection{\texttt{DIFCP}}
-\verb`DIFC` defaults as above with these changes:
+\verb`DIFC` defaults as above with these changes (a marginal \verb`>>`
+indicates where a setting differs from that in \verb`DIFC`):
\begin{verbatim}
>> op-symbol = \partial,
>> op-order-nudge = 1 mu
@@ -2983,7 +3035,8 @@
\subsection{\texttt{DIFJ} (jacobian)}
\label{subsec:DIFJ-(jacobian)}Relevant keys and default values for
-template \verb`DIFJ`.
+template \verb`DIFJ`. A marginal \verb`>` indicates where a setting
+differs from that in \verb`DIF`.
\begin{verbatim}
style = frac,
slash-tok = /,
@@ -3002,9 +3055,11 @@
\subsection{\texttt{DIFL} (differential)}
\label{subsec:DIFL-(differential)}Relevant keys and default values
-for template \verb`DIFL`.
+for template \verb`DIFL`. A marginal \verb`>` indicates where a
+setting differs from that in \verb`DIF`.
\begin{verbatim}
op-symbol = \mathrm{d},
+ op-order-nudge = 0 mu,
var-sup-nudge = 1 mu,
multi-term-sep = 2 mu plus 1 mu minus 1 mu,
term-sep-adjust = -1 mu,
@@ -3209,6 +3264,10 @@
lvwrap-Ldelim = \onemu\mleft [,
lvwrap-Rdelim = \mright ]
}
+% differential d^n x
+\difdef { l } { dn }{ style=d^ }
+\NewDocumentCommand \dn { m m }
+ { \dl.dn.[#1]{#2} }
% mimicking the \Braket command
% of the braket package
\difdef{ s }{ bk }
@@ -3314,6 +3373,11 @@
\item Reinstates (from v.4) the order-override option as an alternative
to \verb`\difoverride` but now angle-bracket delimited.
\end{enumerate}
+\item Version 5.4 (2023-11-08)
+\begin{enumerate}
+\item Adjusts both code and documentation about the differential to enable
+forms like $\dn[3]x$ (sometimes used in multiple integrals).
\end{enumerate}
+\end{enumerate}
\end{document}
Modified: trunk/Master/texmf-dist/tex/latex/diffcoeff/diffcoeff.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/diffcoeff/diffcoeff.sty 2023-11-14 21:01:55 UTC (rev 68837)
+++ trunk/Master/texmf-dist/tex/latex/diffcoeff/diffcoeff.sty 2023-11-14 21:02:04 UTC (rev 68838)
@@ -8,10 +8,10 @@
% Andrew Parsloe ajparsloe at gmail.com
%
\DeclareRelease{v4}{}{diffcoeff4.sty}
-\DeclareCurrentRelease{}{2023/04/12}
+\DeclareCurrentRelease{}{2023/11/14}
\RequirePackage{xtemplate,mleftright}
-\ProvidesExplPackage {diffcoeff} {2023/04/12} {5.3}
+\ProvidesExplPackage {diffcoeff} {2023/11/14} {5.4}
{Write differential coefficients easily and consistently.}
\keys_define:nn { diffcoeff }
{
@@ -35,6 +35,9 @@
}
\bool_if:NT \l__diffcoeff_mLR_bool
{ \mleftright }
+\cs_if_exist:NTF \seq_map_pairwise_function:NNN
+ { \cs_set_eq:NN \__diffcoeff_braid:NNN \seq_map_pairwise_function:NNN }
+ { \cs_set_eq:NN \__diffcoeff_braid:NNN \seq_mapthread_function:NNN }
%%%%%%%%%% messages %%%%%%%%%
\cs_new:Npn \__diffcoeff_msg_autocalc:n #1
{
@@ -109,7 +112,7 @@
style-group : choice { f, s, c, j, l } = f,
style : choice { frac, tfrac, dfrac,
/, auto, big, Big, bigg, Bigg,
- _, dl
+ _, dl,d^
} = frac ,
slash-tok : tokenlist = / ,
slash-sep : tokenlist = 0 mu,
@@ -160,6 +163,7 @@
bigg = \__diffcoeff_style:nn { 5 } { bigg },
Bigg = \__diffcoeff_style:nn { 5 } { Bigg },
_ = \__diffcoeff_style:nn { 6 } {},
+ d^ = \__diffcoeff_style:nn { 6 } {},
dl = \__diffcoeff_style:nn { 7 } {},
unknown = \__diffcoeff_style:nn { 9 } {}
},
@@ -228,7 +232,7 @@
{
\msg_error:nnxx { diffcoeff } { unknown-style }
{ \l__diffcoeff_instance_tl }
- { \__diffcoeff_style_group:n { \l__diffcoeff_group_int } }
+ { \__diffcoeff_style_group_base:n { \l__diffcoeff_group_int } }
}
}
}
@@ -239,14 +243,14 @@
{
( \int_compare_p:nNn { \int_div_truncate:nn {#2} {3} } = { #1 }
&& \int_compare_p:nNn { #1 } < { 3 } ) % f,s,c
- || ( \int_compare_p:nNn { \int_div_truncate:nn {#2} {2} } < { #1 }
- && \int_compare_p:nNn { #1 } = { 3 } ) % j
- || \int_compare_p:nNn { #1 + #2 } = { 11 } % l
+ || ( \int_compare_p:nNn { \int_div_truncate:nn {#2} {2} } < { #1 }
+ && \int_compare_p:nNn { #1 } = { 3 } ) % j
+ || \int_compare_p:nNn { #1 + #2 } > { 9 } % l
}
{
\msg_warning:nnxx { diffcoeff } { wrong-style }
{ \l__diffcoeff_instance_tl }
- { \__diffcoeff_style_group:n { #1 } }
+ { \__diffcoeff_style_group_base:n { #1 } }
\int_compare:nNnTF { #1 } = { 3 }
{ \__diffcoeff_style:nn { 0 } {} }
{
@@ -261,7 +265,7 @@
\int_compare:nNnF { #1 } = { 1 }
{ \bool_set_false:N \l__diffcoeff_innerwrap_bool }
}
-\cs_new:Npn \__diffcoeff_style_group:n #1
+\cs_new:Npn \__diffcoeff_style_group_base:n #1
{ \clist_item:nn { frac, /, _, frac, dl } { #1 + 1 } }
%%%%%%%%% append? (& wrap slash diff operator?)
\cs_new_protected:Npn \__diffcoeff_append:n #1
@@ -580,7 +584,7 @@
}
\tl_set:Nx \l_tmpa_tl
{
- \seq_mapthread_function:NNN \l_tmpa_seq \l_tmpb_seq
+ \__diffcoeff_braid:NNN \l_tmpa_seq \l_tmpb_seq
\__diffcoeff_tot_order:nn
}
\exp_args:NV \tl_if_head_eq_charcode:nNTF \l_tmpa_tl +
@@ -621,8 +625,11 @@
\cs_new_protected:Npn \__diffcoeff_build:nn #1#2
{
\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 } }
+ \int_compare:nNnF { \l__diffcoeff_group_int } = { 4 }
+ {
+ \tl_put_left:Nx \l__diffcoeff_derivand_tl
+ { \__diffcoeff_spaced:n { \l__diffcoeff_spaced_int } }
+ }
\__diffcoeff_wrap_and_form:nn { #2 }
{
\__diffcoeff_form_deriv:xNN
@@ -632,8 +639,9 @@
\l__diffcoeff_derivand_tl
}
}
+ % extra braces for \[ \alert{\dl x} \] in beamer
\cs_new:Npn \__diffcoeff_wrap_and_form:nn #1#2
- { % extra braces for \[ \alert{\dl x} \] in beamer
+ {
\tl_if_novalue:nTF {#1}
{{ #2 }}
{{
@@ -697,7 +705,7 @@
%%%%%%%%%% denominator %%%%%%%%%
\cs_new:Npn \__diffcoeff_build_denom:
{
- \seq_mapthread_function:NNN \l__diffcoeff_ords_seq
+ \__diffcoeff_braid:NNN \l__diffcoeff_ords_seq
\l__diffcoeff_vars_seq \__diffcoeff_build_denom_items:nn
\__diffcoeff_build_denom_item:VV \l__diffcoeff_ord_tl \l__diffcoeff_var_tl
\str_if_eq:VnF \l__diffcoeff_ord_tl { 1 }
@@ -722,14 +730,23 @@
% #1 vphantom orders #2 order #3 var
\cs_new:Npn \__diffcoeff_build_denom_difc:nnn #1#2#3
{
- \exp_not:o \l__diffcoeff_opii_tl \c_math_subscript_token
- { \mskip \l__diffcoeff_opsubnudge_tl {}#3 } ^
- {
- \mskip \l__diffcoeff_opordsep_tl \exp_not:o { \vphantom{#1} }
- \str_if_eq:nnF { #2 } { 1 }
- { \exp_not:o {#2} \mskip \l__diffcoeff_sep_adj_tl }
- }
- }
+ \exp_not:o \l__diffcoeff_opii_tl
+ \int_compare:nNnTF { \l__diffcoeff_group_int } = { 4 }
+ {
+ \str_if_eq:nnF { #2 } { 1 }
+ { ^{ \mskip \l__diffcoeff_opordsep_tl \exp_not:o {#2} } }
+ #3
+ }
+ {
+ \c_math_subscript_token { \mskip \l__diffcoeff_opsubnudge_tl {}#3 }
+ ^
+ {
+ \mskip \l__diffcoeff_opordsep_tl \exp_not:o { \vphantom{#1} }
+ \str_if_eq:nnF { #2 } { 1 }
+ { \exp_not:o {#2} \mskip \l__diffcoeff_sep_adj_tl }
+ }
+ }
+ }
\cs_generate_variant:Nn \__diffcoeff_build_denom_difc:nnn { o }
% #1 order #2 var
\cs_new:Npn \__diffcoeff_build_denom_dif:nn #1#2
@@ -760,7 +777,7 @@
%%%%%%%%%%
% #1 op+order; #2 denom; #3 diff'iand
\cs_new:Npn \__diffcoeff_form_deriv:nNN #1#2#3
- {
+ {
\bool_if:NTF \l__diffcoeff_append_bool
{ \l__diffcoeff_frac_tl { #1 } { #2 } #3 }
{ \l__diffcoeff_frac_tl { #1 #3 } { #2 } }
@@ -838,7 +855,7 @@
\DeclareChildTemplate { diffcoeff } { DIF } { DIFC }
{ style-group = c }
{
- style = _ ,
+ style = _ ,
derivand-sep = 1 mu plus 1 mu minus 1 mu ,
multi-term-sep = 1 mu ,
term-sep-adjust = 0 mu ,
@@ -948,6 +965,7 @@
{ {\l__diffcoeff_lvw_ldelim_tl #3\l__diffcoeff_lvw_rdelim_tl } } {}
\group_end:
}
+\NewDocumentCommand \difj {} { \jacob }
% differential; #1 variant ; #2 ord(s); #3 vars; #4 exponent
\NewDocumentCommand \dl { >{ \TrimSpaces } D..{} O{1} m e{^} }
{
@@ -963,4 +981,5 @@
{\c_false_bool} {#2} {} {#3} {}
\group_end:
}
+\NewDocumentCommand \difl {} { \dl }
% end of file diffcoeff.sty
\ No newline at end of file
More information about the tex-live-commits
mailing list.