texlive[66834] Master/texmf-dist: diffcoeff (12apr23)

commits+karl at tug.org commits+karl at tug.org
Wed Apr 12 22:06:06 CEST 2023


Revision: 66834
          http://tug.org/svn/texlive?view=revision&revision=66834
Author:   karl
Date:     2023-04-12 22:06:05 +0200 (Wed, 12 Apr 2023)
Log Message:
-----------
diffcoeff (12apr23)

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
    trunk/Master/texmf-dist/tex/latex/diffcoeff/diffcoeff5.def

Modified: trunk/Master/texmf-dist/doc/latex/diffcoeff/README.txt
===================================================================
--- trunk/Master/texmf-dist/doc/latex/diffcoeff/README.txt	2023-04-12 20:05:51 UTC (rev 66833)
+++ trunk/Master/texmf-dist/doc/latex/diffcoeff/README.txt	2023-04-12 20:06:05 UTC (rev 66834)
@@ -10,10 +10,10 @@
   http://www.latex-project.org/lppl.txt
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-Version 5.2 of diffcoeff initializes two variables that other-
-wise can conflict with other packages and improves handling 
-of an empty differentiation variable argument. There are some
-small additions to the documentation.
+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.0 of diffcoeff introduced many interface incompat-
 ibilities with version 4, which is still available through 
@@ -28,12 +28,12 @@
 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.1
+diffcoeff.tex         LaTeX source of documentation for v5.3
+diffcoeff5.def        definition file for v5.1
 
 Unchanged files
-diffcoeff5.def         definition file for v5.1
-diffcoeff4.sty         LaTeX .sty file, 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
+diffcoeff4.sty        LaTeX .sty file, 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-04-12 20:05:51 UTC (rev 66833)
+++ trunk/Master/texmf-dist/doc/latex/diffcoeff/diffcoeff.tex	2023-04-12 20:06:05 UTC (rev 66834)
@@ -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 at gmail.com)}}
 \maketitle
@@ -148,22 +148,22 @@
 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 @@
 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 \xA7\ref{sec:Variant-forms}) of derivative:
+of variant forms of derivative (see \xA7\ref{sec:Variant-forms}):
 \begin{verbatim}
     \usepackage[def-file=<filename>]{diffcoeff}
 \end{verbatim}
@@ -402,10 +402,10 @@
 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 @@
 in a single variable, or a comma list of orders of differentiation
 for a mixed partial derivative; see \xA7\ref{subsec:Higher-order-derivatives}
 and \xA7\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 \xA7\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 @@
 For partial differentiation in more than one variable -- so-called
 \emph{mixed} partial derivatives -- see \xA7\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 @@
 \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 @@
 \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 @@
 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 \xA7\ref{subsec:Alternative-method}):
 \begin{centred}
 \verb`$ \difcp[2,3]F{x,y,z} $` $\Longrightarrow$ $ \difcp[2,3] F{x,y,z}$,
 
@@ -934,65 +950,94 @@
 \[ \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}
 
-\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: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}
+
+\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 \xA7\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.)
+\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.
 
-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.
-
 \subsubsection{Parentheses}
 
 Auto-calculation of the total order accommodates the simple use of
@@ -1029,17 +1074,11 @@
 \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 @@
     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 @@
         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 @@
 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 @@
 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 @@
 \begin{verbatim}
 % file `diffcoeff5.def'
 % definitions for variant forms
-% 2023/01/03
+% 2023/04/10
 % Andrew Parsloe ajparsloe at gmail.com
 % 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -3047,7 +3085,7 @@
     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 @@
 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}

Modified: trunk/Master/texmf-dist/tex/latex/diffcoeff/diffcoeff.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/diffcoeff/diffcoeff.sty	2023-04-12 20:05:51 UTC (rev 66833)
+++ trunk/Master/texmf-dist/tex/latex/diffcoeff/diffcoeff.sty	2023-04-12 20:06:05 UTC (rev 66834)
@@ -8,10 +8,10 @@
 % Andrew Parsloe ajparsloe at gmail.com
 %
 \DeclareRelease{v4}{}{diffcoeff4.sty}
-\DeclareCurrentRelease{}{2023/01/24}
+\DeclareCurrentRelease{}{2023/04/12}
 
 \RequirePackage{xtemplate,mleftright}
-\ProvidesExplPackage {diffcoeff} {2023/01/24} {5.2} 
+\ProvidesExplPackage {diffcoeff} {2023/04/12} {5.3} 
   {Write differential coefficients easily and consistently.}
 \keys_define:nn { diffcoeff }
   { 
@@ -40,8 +40,8 @@
   { 
     in~the~order~spec.~[#1]~\msg_line_context:.~Calculation~of~the~
     total~order~of~differentiation~fails~in~this~case.~
-    Use~the~\tl_to_str:n { \difoverride }command~to~enter~the~total~order.~
-    \msg_see_documentation_text:n {diffcoeff}
+    Use~the~override~option~(or~\tl_to_str:n { \difoverride }command)~
+    to~enter~the~total~order.~\msg_see_documentation_text:n {diffcoeff}
   }
 \cs_new:Npn \__diffcoeff_msg_style:nnn #1#2#3
   { 
@@ -205,11 +205,9 @@
     \__diffcoeff_check_style:nn 
         { \l__diffcoeff_group_int } { \l__diffcoeff_style_int }
     \__diffcoeff_append:n { #1 }
-    \exp_args:Nx \__diffcoeff_orders:nn 
-        { \int_max:nn { 1 } { \clist_count:n {#4} } } { #2 }
-    \__diffcoeff_override:N \l__diffcoeff_override_tl
+    \__diffcoeff_orders_vars:nn { #2 } { #4 }
     \__diffcoeff_derivand:n { #3 }
-    \__diffcoeff_build:nn { #4 } { #5 } 
+    \__diffcoeff_build:nn { #4 } { #5 }
   }
 %%%%%%%%%%
 \cs_new_protected:Npn \__diffcoeff_style:nn #1#2
@@ -277,13 +275,55 @@
       }
       { \bool_set_false:N \l__diffcoeff_append_bool } 
   }
-%%%%%%%%%
+%%%%%%%%% #1 orders, #2 vars 
+\cs_new_protected:Npn \__diffcoeff_orders_vars:nn #1#2
+  {
+    \str_if_eq:nnT { #2 } { / } 
+       { % v4 notation
+          \msg_error:nnnn { diffcoeff } { version-conflict } { / } 
+              { Use~\difs or~\difsp instead.~ } 
+       }
+    \clist_if_empty:nTF { #2 }
+      { 
+        \seq_set_from_clist:Nn \l__diffcoeff_vars_seq { \prg_do_nothing: } 
+        \__diffcoeff_orders:nn { 1 } { #1 }
+      }
+      { 
+        \exp_args:NnV
+        \str_if_in:nnTF { #2 } \c_colon_str
+          { 
+            \str_set:Nn \l_tmpa_str { #2 }
+            \clist_map_inline:Nn \l_tmpa_str
+              {
+                \exp_args:NNV
+                \seq_set_split:Nnn \l_tmpa_seq \c_colon_str { ##1 }
+                \seq_pop:NN \l_tmpa_seq \l_tmpa_tl
+                \seq_put_right:NV \l__diffcoeff_vars_seq \l_tmpa_tl
+                \seq_if_empty:NTF \l_tmpa_seq
+                  { \seq_put_right:Nn \l__diffcoeff_ords_seq { 1 } }
+                  {
+                    \seq_pop:NN \l_tmpa_seq \l_tmpa_tl
+                    \tl_set_rescan:Nno 
+                        \l_tmpa_tl \ExplSyntaxOn \l_tmpa_tl
+                    \seq_put_right:NV \l__diffcoeff_ords_seq \l_tmpa_tl
+                  }
+              }
+          }
+          { 
+            \seq_set_from_clist:Nn \l__diffcoeff_vars_seq { #2 } 
+            \exp_args:Nx \__diffcoeff_orders:nn 
+              { \int_max:nn { 1 } { \clist_count:n {#2} } } { #1 }
+          }
+      }
+    \__diffcoeff_override:N \l__diffcoeff_override_tl
+  }
 % #1(int) no. of vars; #2(clist) orders spec
 \cs_new_protected:Npn \__diffcoeff_orders:nn #1#2 
   { 
     \bool_if:NTF \l__diffcoeff_exponent_bool
       { 
-        \exp_args:NNx \seq_set_from_clist:Nn \l__diffcoeff_ords_seq 
+        \exp_args:NNx 
+        \seq_set_from_clist:Nn \l__diffcoeff_ords_seq 
             { \prg_replicate:nn { #1 } { \l__diffcoeff_exponent_tl, } }
       }
       {
@@ -307,12 +347,12 @@
   }
 \cs_new_protected:Npn \__diffcoeff_override:N #1
   {
-    \tl_if_empty:NTF { #1 } 
+    \tl_if_empty:NTF #1
       { 
         \__diffcoeff_calc_tot_order:NN \l__diffcoeff_ords_seq
             \l__diffcoeff_tot_ord_tl 
       }
-      { \tl_set:Nn \l__diffcoeff_tot_ord_tl { #1 } }
+      { \tl_set_eq:NN \l__diffcoeff_tot_ord_tl #1 }
     \seq_pop_right:NN \l__diffcoeff_ords_seq \l__diffcoeff_ord_tl
   }
 %%%%%%%%%% calc. total order %%%%%%%%%%
@@ -351,14 +391,17 @@
     \tl_if_in:nnTF { 1234567890 } { #1 }
       { \int_set:Nn #2 { 1 } } % digit
       { 
-        \str_case:nnF { #1 }
-          {
-            { + } { \int_set:Nn #2 { 0 } }
-            { - } { \int_set:Nn #2 { 0 } }
-            { ( } { \int_set:Nn #2 { 3 } }
-            { ) } { \int_set:Nn #2 { 4 } }
+        \tl_if_in:nnTF { +- } { #1 }
+          { \int_set:Nn #2 { 0 } }
+          { 
+            \tl_if_eq:nnTF { ( } { #1 }
+              { \int_set:Nn #2 { 3 } }
+              {
+                \tl_if_eq:nnTF { ) } { #1 } 
+                  { \int_set:Nn #2 { 4 } }
+                  { \int_set:Nn #2 { 2 } }  % var
+              }
           }
-          { \int_set:Nn #2 { 2 } }  % var
       }
   }
 % #1(tl) curr tok; #2(int) curr state; #3(int) curr tok ndx
@@ -565,47 +608,43 @@
   }
 %%%%%%%%% derivand
 \cs_new_protected:Npn \__diffcoeff_derivand:n #1
-  {
+  { 
     \tl_set:Nn \l__diffcoeff_derivand_tl { #1 }
     \int_compare:nNnTF { \tl_count:N \l__diffcoeff_derivand_tl } > { 1 }
       { \bool_set_true:N \l__diffcoeff_multitok_bool }
       { 
-        \str_if_eq:VnTF \l__diffcoeff_derivand_tl { ! } 
+        \str_if_eq:VnT \l__diffcoeff_derivand_tl { ! } 
           { \msg_error:nnnn { diffcoeff } { version-conflict } { #1 } {} }
-          {
-            \str_if_eq:VnT \l__diffcoeff_derivand_tl { [ } 
-              { \msg_error:nnnn { diffcoeff } { version-conflict } { the~
-                order-override~argument } { Use~\difoverride instead.~ } }
-          }
       }
   }
 %%%%%%%%% build #1 vars clist; #2 trailing arg
 \cs_new_protected:Npn \__diffcoeff_build:nn #1#2
   { 
-    \str_if_eq:nnT { #1 } { / } 
-       { 
-          \msg_error:nnnn { diffcoeff } { version-conflict } { / } 
-          { Use~\difs or~\difsp instead.~ } 
-       }
-    \clist_if_empty:nTF { #1 }
-      { \seq_set_from_clist:Nn \l__diffcoeff_vars_seq { \prg_do_nothing: } }
-      { \seq_set_from_clist:Nn \l__diffcoeff_vars_seq { #1 } }
     \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 } }
-    \tl_if_novalue:nF { #2 } 
-      { \__diffcoeff_delim:N l \mskip \l__diffcoeff_elbowrm_tl }
-    \__diffcoeff_form_deriv:xNN 
-        { \__diffcoeff_build_numer:Vn \l__diffcoeff_tot_ord_tl
-          { \l__diffcoeff_style_int } }
-        \__diffcoeff_build_denom:
-        \l__diffcoeff_derivand_tl
-    \tl_if_novalue:nF { #2 }
-      { \__diffcoeff_trailing_arg:n { #2 } }
+    \__diffcoeff_wrap_and_form:nn { #2 }
+      {
+        \__diffcoeff_form_deriv:xNN 
+          { \__diffcoeff_build_numer:Vn \l__diffcoeff_tot_ord_tl
+                { \l__diffcoeff_style_int } }
+          \__diffcoeff_build_denom:
+          \l__diffcoeff_derivand_tl 
+      }
   }
+\cs_new:Npn \__diffcoeff_wrap_and_form:nn #1#2
+  { % extra braces for \[ \alert{\dl x} \] in beamer
+      \tl_if_novalue:nTF {#1}
+        {{ #2 }}
+        {{
+          \__diffcoeff_delim:N l \mskip \l__diffcoeff_elbowrm_tl 
+          #2
+          \__diffcoeff_trailing_arg:n { #1 } 
+        }}
+  }
 \cs_new:Npn \__diffcoeff_delim:N #1
   { 
-    \bool_if:nTF { \l__diffcoeff_innerwrap_bool  && \l__diffcoeff_append_bool }
+    \bool_if:nTF { \l__diffcoeff_innerwrap_bool && \l__diffcoeff_append_bool }
       { \use:c { l__diffcoeff_#1 delimapp_tl } }
       { \use:c { l__diffcoeff_#1 delim_tl } }
   }
@@ -621,7 +660,7 @@
        { \c_math_subscript_token { \mskip \__diffcoeff_subnudge: #1 } }
   }
 \cs_new:Npn \__diffcoeff_spaced:n #1
-  { 
+  {
     \int_case:nn { \int_sign:n { #1 } }
       {
         { 1 } { \__diffcoeff_derivsep: }
@@ -694,7 +733,7 @@
 \cs_generate_variant:Nn \__diffcoeff_build_denom_difc:nnn { o }
 % #1 order #2 var
 \cs_new:Npn \__diffcoeff_build_denom_dif:nn #1#2
-  { 
+  {
     \str_if_eq:nnTF { #1 } { 1 }
       { \exp_not:o { \l__diffcoeff_opii_tl #2 } }
       { 
@@ -867,6 +906,8 @@
     \mskip \l__diffcoeff_slashsep_tl #3
     \bool_if:NT #1 { \l__diffcoeff_ropwrap_tl }
   }
+\NewDocumentCommand \difoverride { >{\TrimSpaces} m } 
+  { \tl_set:Nn \l__diffcoeff_override_tl { #1 } }
 % derivatives
 % #1(tl) variant name; #2(*) append boolean; #3(*) switch #5#6 order;
 % #4(clist) diff. orders; #5(tl) = derivand; #6(clist) = diff. vars; 
@@ -874,18 +915,20 @@
 \clist_map_inline:nn { f,s,c, fp, sp, cp }
   { 
     \exp_args:Nc \NewDocumentCommand {dif#1} 
-      { >{\TrimSpaces} D..{} s s O{1} >{\TrimSpaces} m  m !o }
+      { >{\TrimSpaces} D..{} s s O{1} D<>{} >{\TrimSpaces} m  m !o }
       { 
         \IfBooleanTF ##3
-          { \__diffcoeff_inputs:nnnnnnn {#1}  
-                {##1} {##2} {##4} {##6} {##5} {##7} }
-          { \__diffcoeff_inputs:nnnnnnn {#1}  
-                {##1} {##2} {##4} {##5} {##6} {##7} }
+          { \__diffcoeff_inputs:nnnnnnnn {#1}  
+                {##1} {##2} {##4} {##7} {##6} {##8} {##5} }
+          { \__diffcoeff_inputs:nnnnnnnn {#1}  
+                {##1} {##2} {##4} {##6} {##7} {##8} {##5} }
       }
   }
-\cs_new_protected:Npn \__diffcoeff_inputs:nnnnnnn #1#2#3#4#5#6#7
+\cs_new_protected:Npn \__diffcoeff_inputs:nnnnnnnn #1#2#3#4#5#6#7#8
   { 
     \group_begin:
+    \tl_if_empty:nF { #8 }
+      { \tl_set:Nn \l__diffcoeff_override_tl { #8 } }
     \tl_set:Nx \l__diffcoeff_instance_tl 
         { dif#1 \tl_if_empty:nF { #2 } { .#2 } }
     \UseInstance { diffcoeff } { \l__diffcoeff_instance_tl } 
@@ -892,8 +935,6 @@
         {#3} {#4} {#5} {#6} {#7}
     \group_end:
   }
-\NewDocumentCommand \difoverride { >{\TrimSpaces} m } 
-  { \tl_set:Nn \l__diffcoeff_override_tl { #1 } }
 % Jacobian
 \NewDocumentCommand \jacob { >{\TrimSpaces} D..{} m  m }
   { 

Modified: trunk/Master/texmf-dist/tex/latex/diffcoeff/diffcoeff5.def
===================================================================
--- trunk/Master/texmf-dist/tex/latex/diffcoeff/diffcoeff5.def	2023-04-12 20:05:51 UTC (rev 66833)
+++ trunk/Master/texmf-dist/tex/latex/diffcoeff/diffcoeff5.def	2023-04-12 20:06:05 UTC (rev 66834)
@@ -51,7 +51,7 @@
     style         = auto     ,
     outer-Ldelim  = \left [  ,
     outer-Rdelim  = \right ] ,
-    sub-nudge     = 0 mu    ,
+    sub-nudge     = 0 mu     ,
     *inner-Ldelim = \mleft ( ,
     *inner-Rdelim = \mright ),
     *outer-Ldelim = \left [  ,
@@ -62,7 +62,7 @@
     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 [,



More information about the tex-live-commits mailing list.