summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/diffcoeff/diffcoeff.tex
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/diffcoeff/diffcoeff.tex')
-rw-r--r--macros/latex/contrib/diffcoeff/diffcoeff.tex257
1 files changed, 152 insertions, 105 deletions
diff --git a/macros/latex/contrib/diffcoeff/diffcoeff.tex b/macros/latex/contrib/diffcoeff/diffcoeff.tex
index 320960b2ed..1879b02eef 100644
--- a/macros/latex/contrib/diffcoeff/diffcoeff.tex
+++ b/macros/latex/contrib/diffcoeff/diffcoeff.tex
@@ -113,7 +113,7 @@
\title{\texttt{diffcoeff}~\\
a \LaTeX{} package to ease\texttt{ }the~\\
writing of differential coefficients \\
- Version 5.2}
+ Version 5.3}
\author{Andrew Parsloe\\
{\small (ajparsloe@gmail.com)}}
\maketitle
@@ -148,22 +148,22 @@ was a mistake) and, more noticeably, the `slash switch' \verb`/`.
Slash-fraction derivatives are now created with the \verb`\difs`
and \verb`\difsp` commands. New commands \verb`\difc` and \verb`\difcp`
produce derivatives in `compact notation' like $\difc yx$ and $\difcp yx$.
-To avoid cluttering formulas with a second square-bracket delimited
-optional argument before the differentiand, the order-override option
-has been replaced by a new command \verb`\difoverride`. The order
-of differentiand and variable(s) of differentiation can now be reversed,
-when the differentiand is appended, by using a second star, e.g.,
-\verb`\diffp**`. The two-argument \verb`\diffdef` command of earlier
-versions has been replaced by the three-argument command \verb`\difdef`,
-the additional argument determining which one or more of the \verb`f`,
-\verb`s`, \verb`c`, \verb`fp`, \verb`sp` or \verb`cp` forms the
-defined variant applies to. The differential command \verb`\dl` has
-been rewritten and is now fully template-configurable (allowing easy
-writing of line elements like $\dl.+.{x,y,z}^{2}$), and the jacobian
-command \verb`\jacob` is also configurable. Indeed version 5 of \verb`diffcoeff`
-more fully embraces the configurability offered by the \verb`xtemplate`
-package than previous versions, bringing other notations -- like
-those of the \verb`braket` package -- within its compass.
+The order-override option (for mixed partial derivatives) has been
+changed to use angle brackets (for clarity) or a command \verb`\difoverride`.
+The sequential order of differentiand and variable(s) of differentiation
+can now be reversed, when the differentiand is appended, by using
+a second star, e.g., \verb`\diffp**`. The two-argument \verb`\diffdef`
+command of earlier versions has been replaced by the three-argument
+command \verb`\difdef`, the additional argument determining which
+one or more of the \verb`f`, \verb`s`, \verb`c`, \verb`fp`, \verb`sp`
+or \verb`cp` forms the defined variant applies to. The differential
+command \verb`\dl` has been rewritten and is now fully template-configurable
+(allowing easy writing of line elements like $\dl.+.{x,y,z}^{2}$),
+and the jacobian command \verb`\jacob` is also configurable. Indeed
+version 5 of \verb`diffcoeff` more fully embraces the configurability
+offered by the \verb`xtemplate` package than previous versions, bringing
+other notations -- like those of the \verb`braket` package -- within
+its compass.
\subsubsection*{ISO defaults}
@@ -236,7 +236,7 @@ so that the spacing around scalable delimiters modified by \verb`\left`,
The present document does not use this package option.
\item The third package option requires the \verb`<filename>` of a file
with extension \verb`.def`, \verb`<filename>.def`, containing definitions
-of variant forms (see §\ref{sec:Variant-forms}) of derivative:
+of variant forms of derivative (see §\ref{sec:Variant-forms}):
\begin{verbatim}
\usepackage[def-file=<filename>]{diffcoeff}
\end{verbatim}
@@ -402,10 +402,10 @@ as the \emph{differentiand} or \emph{derivand }(in line with \emph{integrand},
All commands, \verb`\difx`, \verb`\difxp`, share the same syntax.
With options present the syntax is
\begin{verbatim}
- \difx.name.*[order-spec]{differentiand}
+ \difx.name.*[order-spec]<override>{differentiand}
{variable(s)}[pt of eval]
- \difx.name.**[order-spec]{variable(s)}
+ \difx.name.**[order-spec]<override>{variable(s)}
{differentiand}[pt of eval]
\end{verbatim}
The syntax is identical for \verb`\difxp`. The seven arguments have
@@ -429,6 +429,9 @@ see §\ref{subsec:Transposing-the-argument}.
in a single variable, or a comma list of orders of differentiation
for a mixed partial derivative; see §\ref{subsec:Higher-order-derivatives}
and §\ref{subsec:Mixed-partial-derivatives}.
+\item \verb`override` (optional) The total order of differentiation when
+it cannot be calculated by \texttt{diffcoeff} or is wanted in a different
+form from that calculated by \texttt{diffcoeff}; see §\ref{subsec:Order-override-command}.
\item \verb`differentiand` (mandatory) The function being differentiated.
\item \verb`variable(s)` (mandatory) The variable of differentiation or
a comma list of variables of differentiation (for a mixed partial
@@ -652,6 +655,19 @@ and in compact form,
For partial differentiation in more than one variable -- so-called
\emph{mixed} partial derivatives -- see §\ref{subsec:Mixed-partial-derivatives}.
+\subsubsection{Alternative method}
+
+From version 5.3 of \texttt{diffcoeff} it is also possible to specify
+the order by the method shown in the example
+\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.
+
\subsection{Appending the differentiand}
\label{subsec:Appending-the-differentiand}Some differentiands are
@@ -673,9 +689,8 @@ all the variables on which it depends:
\verb`\[ \diffp*[2]{\Phi(x,y,z)}x \]` $\Longrightarrow$ \[ \diffp*[2]{\Phi(x,y,z)}x. \]
\end{centred}
A virtue of using an asterisk to append the differentiand is that
-if one isn't sure whether a differentiand should be appended or not,
-it is an easy matter to simply insert or delete the asterisk to compare
-the results.
+if one isn't sure whether to append or not, it is an easy matter to
+simply insert or delete the asterisk to compare the results.
For instance, a second derivative is an iterated derivative -- one
in which a derivative forms the differentiand of another . Thus
@@ -705,8 +720,8 @@ other are reversed. Thus it is clearer to the eye to write
\end{centred}
than \verb`\[ \diff*{(ax^2+bxy+cy^2)}x \]`, where the eye has to
search for the variable of differentiation. This is especially the
-case if the differentiand contains more than one variable and commands
-like \verb`\frac` or \verb`\sqrt` requiring braced arguments:
+case if the differentiand contains more than one variable and includes
+commands like \verb`\frac` or \verb`\sqrt` requiring braced arguments:
\begin{centred}
\verb`\[ \diffp**x{\frac1{\sqrt{x^2-y^2}}} \]` $\Longrightarrow$
\[ \diffp**x{\frac1{\sqrt{x^2-y^2}}} \]
@@ -894,7 +909,8 @@ for this example but it becomes messy if different orders of differentiation
are involved for different variables.
To differentiate variables to higher order, their orders need to be
-specified explicitly. To do so use a comma list for the optional argument:
+specified explicitly. To do so use a comma list for the optional argument
+(or, since version 5.3, use the alternative method of §\ref{subsec:Alternative-method}):
\begin{centred}
\verb`$ \difcp[2,3]F{x,y,z} $` $\Longrightarrow$ $ \difcp[2,3] F{x,y,z}$,
@@ -934,64 +950,93 @@ Or again,
\[ \diffp[1,km+1,m+k-1]{F(x,y,z)}{x,y,z}. \]
\end{centred}
-\subsubsection{Order-override command: \texttt{\textbackslash difoverride}}
+\subsubsection{Alternative method}
+
+\label{subsec:Alternative-method}When there are two or more variables
+of differentiation, particularly when subject to different orders
+of differentiation, it may be easier to see which order is associated
+with which variable if they are paired together in the variable argument.
+To do so, separate the order from the variable by a colon,\footnote{I thank \noun{Christophe Bal} for this suggestion.}
+like this:
+\begin{centred}
+\verb`\[ \diffp{F(x,y,z)}{x,y:km+1,z:m+k-1} \]` $\Longrightarrow$
+\[ \diffp{F(x,y,z)}{x,y:km+1,z:m+k-1}. \]
+\end{centred}
+In the example, note that it suffices to write \verb`x` rather than
+\verb`x:1`.
+
+If, in a fit of absent-mindedness, one specifies the orders of differentiation
+by both methods, it is the orders in the variable argument that prevail:
+\begin{centred}
+\verb`\[ \diffp[1,2,3]{F(x,y,z)}{x:4,y:5,z:6} \]` $\Longrightarrow$
+\[ \diffp[1,2,3]{F(x,y,z)}{x:4,y:5,z:6} \]
+\end{centred}
+
+\subsubsection{Order-override option and command}
-\noindent\label{subsec:Order-override-command}$m+k+km+1$ factorizes
-to $(k+1)(m+1)$ and you may prefer to express the total order of
-differentiation in this form. \verb`diffcoeff` is not a computer
-algebra system and does not do such factorizations but the \verb`\difoverride`
-command offers the means to use the factorized form as the total order
-of differentiation in the derivative. (The \verb`\difoverride` command
-replaces the order-override option of the \verb`\diff` command in
-version 4 of \verb`diffcoeff`. That option is no longer available.)
+\label{subsec:Order-override-command}With version 5.3 of \texttt{diffcoeff}
+the order-override option has been reinstated, having been replaced
+in versions 5.0 to 5.2 by a command \verb`\difoverride` (see below).
+In version 4 and earlier this optional argument was square-bracket
+delimited. It is now \emph{angle-bracket }delimited (using the `less
+than' and `greater than' symbols, \verb`< >`).\footnote{I thank \noun{Christophe Bal} for urging the availability of this
+argument and the use of angle brackets.} The reason for angle brackets is both for visual distinction and
+because the alternative method of specifying the order of differentiation
+(by means of colons in the variable specification; see immediately
+above §\ref{subsec:Alternative-method}) requires the override option
+to be distinguishable from the order specification.
+
+In the penultimate example above, the total order of differentiation
+$m+k+km+1$ factorizes to $(k+1)(m+1)$. \verb`diffcoeff` is not
+a computer algebra system and does not do such factorizations but
+you can still express the total order in this form by using the override
+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}
+ \]
+\end{verbatim}
+$\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
+way not only can the total order be presented in whatever manner one
+wishes but essentially arbitrary material can be attached as a superscript
+to the $\partial$ symbol in the numerator. (For compact-form derivatives,
+which do not use a total order of differentiation, the override option
+is irrelevant.)
+
+\paragraph{Order-override command:}
+
+\noindent Alternatively, you can use the \verb`\difoverride` command
+in place of the override option. You might prefer to do this to avoid
+cluttered expressions. The command takes one (mandatory) argument,
+the total order of differentiation, which it stores:
\begin{verbatim}
\[
\difoverride{(k+1)(m+1)}
\diffp[1,km+1,m+k-1]{F(x,y,z)}{x,y,z}
+ \difoverride{},\quad
+ \diffp[1,km+1,m+k-1]{F(x,y,z)}{x,y,z}
\]
\end{verbatim}
$\Longrightarrow$ \[
\difoverride{(k+1)(m+1)}
\diffp[1,km+1,m+k-1]{F(x,y,z)}{x,y,z}
+ \difoverride{},\quad
+ \diffp[1,km+1,m+k-1]{F(x,y,z)}{x,y,z}
\]
-\verb`\difoverride` takes only one (mandatory) argument, the total
-order of differentiation, which it stores. When \verb`\difoverride`
-is non-empty, then the algorithm that calculates the total order is
-sidestepped. It does not get called at all. In this way one can present
-not only the total order in whatever manner one wishes but essentially
-arbitrary material as a superscript to the $\partial$ symbol in the
-numerator. (For compact-form derivatives, which do not use a total
-order of differentiation, the command is irrelevant.)
-
-Note that in the example \verb`\difoverride` has been used \emph{within
-}the math environment. This is good practice. It prevents the contents
-of \verb`\difoverride` erroneously overriding the orders of later
-derivatives:
-\begin{verbatim}
- $ \difoverride{N} \difsp[m,n]f{x,y} $,\quad
- $ \difsp[1,2]f{x,y} $.
-\end{verbatim}
-$\Longrightarrow$ $ \difoverride{N} \difsp[m,n]f{x,y} $,\quad
- $ \difsp[1,2]f{x,y} $.
-
-\noindent There is no spillover here whereas by placing the override
-command outside the math environment the command reaches beyond the
-intended target. To cancel the overreach, I have used \verb`\difoverride`
-with an \emph{empty} argument, :
-\begin{verbatim}
- \difoverride{K}
- $ \difsp[m,n]f{x,y} $,\quad
- $ \difsp[1,2]f{x,y} $,\quad
- \difoverride{}
- $ \difsp[1,2]f{x,y}$.
-\end{verbatim}
-$\Longrightarrow$ \difoverride{K} $ \difsp[m,n]f{x,y} $,\quad
- $ \difsp[1,2]f{x,y} $,\quad
- \difoverride{} $ \difsp[1,2]f{x,y}$.
-
-\noindent Clearly one should use the override command \emph{within}
-the math environment.
+\noindent Note that in the example \verb`\difoverride` has been used
+\emph{within }the math environment. This is good practice. It prevents
+the contents of the command erroneously overriding the orders of later
+derivatives in other math environments; but it does mean cancelling
+the override (with the statement \verb`\diffoverride{}`) in \emph{this}
+environment if a second derivative is present, to prevent the second
+derivative also displaying the factorized form.
\subsubsection{Parentheses}
@@ -1029,17 +1074,11 @@ preceded by something that is not a number or a sign as signalling
\verb`\[\diffp[m(k-1)+1,m(k+1)-1]F{x,y}\]` $\Longrightarrow$ \[\diffp[m(k-1)+1,m(k+1)-1]F{x,y}\]
\end{centred}
\noindent If, in fact, \verb`m` is intended as a \emph{variable}
-then the order-override command is there to rescue the situation:
+then the order-override option or command is there to rescue the situation:
\begin{verbatim}
- \[
- \difoverride{2mk}
- \diffp[m(k-1)+1,m(k+1)-1]F{x,y}
- \]
+ \[ \diffp<2mk>F{x:m(k-1)+1,y:m(k+1)-1} \]
\end{verbatim}
-$\Longrightarrow$ \[
- \difoverride { 2mk }
- \diffp[m(k-1)+1,m(k+1)-1]F{x,y}
- \]
+$\Longrightarrow$ \[ \diffp<2mk>F{x:m(k-1)+1,y:m(k+1)-1} \]
\subsubsection{Error messages}
@@ -1060,24 +1099,19 @@ and continuing,
number followed by ^ in the order spec. [2^k,1] on
line xx. Calculation of the total order of
differentiation fails in this case. Use the
- \difoverride command to enter the total order.
- See the diffcoeff documentation for further
- information.
+ override option (or \difoverride command) to
+ enter the total order. See the diffcoeff
+ documentation for further information.
\end{verbatim}
(The \verb`xx` will be replaced by a specific line number in each
case. Line breaking may also differ from case to case.) To avoid such
-errors and enable compilation to proceed, use the override command:
-\begin{verbatim}
- \[
- \difoverride { 2^{n+1} }
- \diffp[2^n+1,2^n-1]F{x,y}
- \]
-\end{verbatim}
-$\Longrightarrow$ \[
- \difoverride { 2^{n+1} }
- \diffp[2^n+1,2^n-1]F{x,y}
- \]
-
+errors and enable compilation to proceed, do as the message suggests
+-- use the override option (or \verb`\difoverride` command). For
+(a slightly more complicated) example,
+\begin{centred}
+\verb`\[ \diffp[2^n+1,2^n-1]<2^{n+1}>F{x,y} \]` $\Longrightarrow$
+\[ \diffp[2^n+1,2^n-1]<2^{n+1}>F{x,y} \]
+\end{centred}
There are limitations on what order specifications the \verb`diffcoeff`
package can `digest', but in real life that is unlikely to be significant.
Mixed partial derivatives are used far less often than the pure derivatives,
@@ -2071,7 +2105,7 @@ slash fraction (name \verb`1`):
style = big ,
outer-Ldelim = \bigl (,
outer-Rdelim = \bigr ),
- sub-nudge = -2.5 mu,
+ sub-nudge = -2 mu,
*inner-Ldelim = \bigl (,
*inner-Rdelim = \bigr ),
*outer-Ldelim = \bigl [,
@@ -2324,12 +2358,14 @@ The second method is to use the package option \verb`DIF`. For instance
loading \verb`diffcoeff` with the call
\begin{verbatim}
\usepackage
- [
- DIF = { op-symbol = d,
- op-order-nudge = 1 mu,
- outer-Ldelim = \left . ,
- outer-Rdelim = \right |,
- sub-nudge = 0 mu }
+ [ DIF =
+ {
+ op-symbol = d,
+ op-order-nudge = 1 mu,
+ outer-Ldelim = \left . ,
+ outer-Rdelim = \right |,
+ sub-nudge = 0 mu
+ }
]{diffcoeff}
\end{verbatim}
will overwrite the built-in defaults with these new values, which
@@ -2747,6 +2783,8 @@ otherwise indicated) and their delimiters:
is appended, available only if first star is also present;
\item \verb`[order(s)]` order of differentiation, or comma list of orders
of differentiation (for mixed partial derivatives);
+\item \verb`<override>` total order of differentiation override (for mixed
+partial derivatives);
\item \verb`{differentiand}` (mandatory) function being differentiated;
\item \verb`{variable(s)}` (mandatory) differentiation variable or, for
mixed partial derivatives, comma list of differentiation variables;
@@ -2985,7 +3023,7 @@ for template \verb`DIFL`.
\begin{verbatim}
% file `diffcoeff5.def'
% definitions for variant forms
-% 2023/01/03
+% 2023/04/10
% Andrew Parsloe ajparsloe@gmail.com
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -3047,7 +3085,7 @@ for template \verb`DIFL`.
style = big ,
outer-Ldelim = \bigl (,
outer-Rdelim = \bigr ),
- sub-nudge = -2.5 mu,
+ sub-nudge = -2 mu ,
*inner-Ldelim = \bigl (,
*inner-Rdelim = \bigr ),
*outer-Ldelim = \bigl [,
@@ -3267,6 +3305,15 @@ variable;
error when \verb`scrbook` class was used;
\item amends documentation.
\end{enumerate}
+\item Version 5.3 (2023-04-10)
+\begin{enumerate}
+\item Fixes a bug when \verb`\dl` was used in a particular way in \texttt{beamer}
+(e.g. \verb`\[\alert{\dl x}\]`).
+\item Provides an alternative method of specifying orders of differentiation
+by means of colon separators in the variable argument.
+\item Reinstates (from v.4) the order-override option as an alternative
+to \verb`\difoverride` but now angle-bracket delimited.
+\end{enumerate}
\end{enumerate}
\end{document}