texlive[63590] Master/texmf-dist: diffcoeff (14jun22)
commits+karl at tug.org
commits+karl at tug.org
Tue Jun 14 22:20:47 CEST 2022
Revision: 63590
http://tug.org/svn/texlive?view=revision&revision=63590
Author: karl
Date: 2022-06-14 22:20:47 +0200 (Tue, 14 Jun 2022)
Log Message:
-----------
diffcoeff (14jun22)
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 2022-06-14 20:20:34 UTC (rev 63589)
+++ trunk/Master/texmf-dist/doc/latex/diffcoeff/README.txt 2022-06-14 20:20:47 UTC (rev 63590)
@@ -11,15 +11,12 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-This is version 4.0 of diffcoeff.sty, and associated files,
+This is version 4.1 of diffcoeff.sty, and associated files,
and requires the LaTeX3 bundles l3kernel and l3packages. The
package eases the consistent writing of ordinary, partial
-and other derivatives of arbitrary order. Version 4.0 adds a
-package option enabling a space to be inserted by default
-before the differentiand, prevents the inappropriate forming
-of the ligature df when f is the differentiand, adds a diff-
-erential command for \partial, and no longer accepts a brace-
-delimited final optional argument (a relic from v.1).
+and other derivatives of arbitrary order. Version 4.1 resolves
+an error arising from changes to xtemplate and some spacing
+issues in derivative denominators.
Manifest
%%%%%%%%
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 2022-06-14 20:20:34 UTC (rev 63589)
+++ trunk/Master/texmf-dist/doc/latex/diffcoeff/diffcoeff.tex 2022-06-14 20:20:47 UTC (rev 63590)
@@ -13,6 +13,7 @@
\usepackage{wrapfig}
\usepackage{booktabs}
\usepackage{calc}
+\usepackage{url}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{esint}
@@ -26,6 +27,7 @@
\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
+\newcommand{\noun}[1]{\textsc{#1}}
%% Because html converters don't know tabularnewline
\providecommand{\tabularnewline}{\\}
@@ -55,7 +57,7 @@
\title{\texttt{diffcoeff}~\\
a \LaTeX{} package to ease\texttt{ }the~\\
writing of differential coefficients \\
- Version 4.0}
+ Version 4.1}
\author{Andrew Parsloe\\
{\small (ajparsloe at gmail.com)}}
\maketitle
@@ -78,9 +80,10 @@
The \LaTeX{} package \texttt{diffcoeff.sty} is written in the expl3
language of \LaTeX 3\texttt{ }and requires the bundles \texttt{l3kernel}
-which is now is part of standard \LaTeX{} (since early 2020) and \texttt{l3packages}
-(the latter for the \texttt{xparse}, \texttt{l3keys2e} and \texttt{xtemplate}
-packages\texttt{)}. The package is invoked in the usual way by entering
+which is now part of standard \LaTeX{} (since early 2020) and \texttt{l3packages}
+(the latter for the \texttt{xparse}, \texttt{l3keys2e} and especially
+\texttt{xtemplate} packages\texttt{)}. The package is invoked in the
+usual way by entering
\begin{lyxcode}
\textbackslash usepackage\{diffcoeff\}
\end{lyxcode}
@@ -110,6 +113,14 @@
and has been deprecated since version 2.
\end{enumerate}
+\subsubsection*{New in version 4.1}
+\begin{enumerate}
+\item changes the code handling the \verb`long-var-wrap` setting to avoid
+a problem with a change in \verb`xtemplate` (see \url{https://tex.stackexchange.com/questions/646976/error-with-package-diffcoeff})\footnote{Based on a suggestion from \noun{Joseph Wright}.};
+\item prevents (hitherto overlooked) ligatures in the \emph{denominators}
+of differential coefficients.
+\end{enumerate}
+
\subsection{Package options}
\label{subsec:Package-options}There are three package options, which
@@ -229,7 +240,7 @@
F'(x)=\diff!{F(x)}x.
\]
\texttt{diffcoeff} can now produce such spaced derivatives, either
-as the default behaviour or at explicit request.
+as the default behaviour or at explicit request; see \xA7\ref{subsec:Spacing-before-derivand}.
\newpage{}
@@ -261,8 +272,8 @@
\subsection{Spacing before the differentiand}
\label{subsec:Spacing-before-derivand}There are (at least) two different
-ways in which we think of derivatives.\footnote{I thank Hans Sch\xFClein for first raising this issue with me and for
-subsequent thoughtful comments. } We are all familiar with the argument presented in elementary calculus
+ways in which we think of derivatives.\footnote{I thank \noun{Hans Sch\xFClein} for first raising this issue with me
+and for subsequent thoughtful comments. } We are all familiar with the argument presented in elementary calculus
books where a curve is shown, and a point on the curve through which
a chord has been drawn. The chord is a side -- the hypotenuse --
of a small right-angled triangle, the other sides having lengths $\delta x$
@@ -302,7 +313,7 @@
function $f'$ and is justly called the derivative of $f$. As you
can see a small space has been inserted between the $d$ and the $f$
in the numerator. By default the space is \texttt{3 mu} but with the
-ability to stretch \texttt{1 mu} or shrink\texttt{ 2 mu}{\ttfamily\footnote{In \TeX -speak, \texttt{3mu plus 1mu minus 2mu}. }}
+ability to stretch by \texttt{1 mu} or shrink by\texttt{ 2 mu}{\ttfamily\footnote{In \TeX -speak, \texttt{3mu plus 1mu minus 2mu}. }}
as \TeX{} adjusts lines to fit on the page. (A `mu' is a `math unit'
and is one eighteenth of a quad.) To achieve this result I have inserted
an exclamation mark \verb`!` before the braces delimiting the differentiand.
@@ -933,9 +944,9 @@
If a left parenthesis is preceded by a \emph{variable} (i.e., not
a sign or a number) this signals to \texttt{diffcoeff} the \emph{static}
-use of parentheses. No attempt is made to evaluate what is between
-them and they are treated simply as an extension of the variable.
-For example,
+use of parentheses, something like $f(k)$, `function of $k$'.
+No attempt is made to evaluate what is between them and they are treated
+simply as an extension of the variable. For example,
\begin{centred}
\verb`\[ \diffp[f(k+1)+1,f(k-1)-1]{F(x,y)}{x,y} \]` $\Longrightarrow$
\[ \diffp[f(k+1)+1,f(k-1)-1]{F(x,y)}{x,y}. \]
@@ -1055,12 +1066,12 @@
{\small key} & {\small default}\tabularnewline
\midrule
{\small op-symbol} & {\small\texttt{d}}\tabularnewline
-{\small op-symbol-alt} & {\small\texttt{= op-symbol}}\tabularnewline
+{\small op-symbol-alt} & {\small\texttt{op-symbol}}\tabularnewline
{\small op-order-sep} & {\small\texttt{1 mu}}\tabularnewline
{\small derivand-sep} & {\small\texttt{3 mu plus 1 mu minus 2 mu}}\tabularnewline
-{\small /-derivand-sep} & {\small\texttt{= derivand-sep}}\tabularnewline
-{\small{*}-derivand-sep} & {\small\texttt{= derivand-sep}}\tabularnewline
-{\small{*}/-derivand-sep} & {\small\texttt{= /-derivand-sep}}\tabularnewline
+{\small /-derivand-sep} & {\small\texttt{derivand-sep}}\tabularnewline
+{\small{*}-derivand-sep} & {\small\texttt{derivand-sep}}\tabularnewline
+{\small{*}/-derivand-sep} & {\small\texttt{/-derivand-sep}}\tabularnewline
{\small denom-term-sep} & {\small\texttt{2 mu}}\tabularnewline
{\small /-denom-term-sep} & {\small\texttt{1 mu}}\tabularnewline
{\small term-sep-adjust} & {\small\texttt{-1 mu}}\tabularnewline
@@ -1309,9 +1320,9 @@
{\small key} & {\small default}\tabularnewline
\midrule
{\small derivand-sep} & {\small\texttt{3mu plus 1mu minus 2mu}}\tabularnewline
-{\small{*}-derivand-sep} & {\small\texttt{= derivand-sep}}\tabularnewline
-{\small /-derivand-sep} & {\small\texttt{= derivand-sep}}\tabularnewline
-{\small{*}/-derivand-sep} & {\small\texttt{= /-derivand-sep}}\tabularnewline
+{\small{*}-derivand-sep} & {\small\texttt{derivand-sep}}\tabularnewline
+{\small /-derivand-sep} & {\small\texttt{derivand-sep}}\tabularnewline
+{\small{*}/-derivand-sep} & {\small\texttt{ /-derivand-sep}}\tabularnewline
\bottomrule
\end{tabular}
\par\end{centering}
@@ -1411,7 +1422,7 @@
\textbackslash NewDocumentCommand~\textbackslash diffp~\{~\}~\{~\textbackslash diff.p.~\}
\end{lyxcode}
Note that this identification of \texttt{\textbackslash diffp} with
-\texttt{\textbackslash diff.p. }means there is no equivalent dot-delimited
+\texttt{\textbackslash diff.p.} means there is no equivalent dot-delimited
argument available for \texttt{\textbackslash diffp}. The \emph{dot-delimited
argument applies only to} \texttt{\textbackslash diff}.
@@ -1712,8 +1723,8 @@
\section{Differentials in integrals, etc.}
-Forms like $dx$ occur not only in derivatives but also in other contexts,\footnote{I thank Sergio Callegari for drawing my attention to this rather obvious
-point, and its omission from previous versions of \texttt{diffcoeff}.} for example, the expression for a total differential like
+Forms like $dx$ occur not only in derivatives but also in other contexts,\footnote{I thank \noun{Sergio Callegari} for drawing my attention to this rather
+obvious point, and its omission from previous versions of \texttt{diffcoeff}.} for example, the expression for a total differential like
\[
\dl P=\diffp Px\dl x+\diffp Py\dl y+\diffp Pz\dl z,
\]
@@ -2038,7 +2049,14 @@
variables held constant. This was a relic from version 1 of \texttt{diffcoeff},
and has been deprecated since version 2.
\end{enumerate}
+\item Version 4.1
+\begin{enumerate}
+\item changes the code for the \verb`long-var-wrap` setting to avoid a
+problem arising from a change in \verb`xtemplate`;
+\item improves spacing between operator and variable in \emph{denominators}
+of differential coefficients (e.g. prevents ligatures).
\end{enumerate}
+\end{enumerate}
\section{Commands}
\begin{description}
@@ -2062,9 +2080,6 @@
\item \{\emph{key=value comma list}\}
\end{enumerate}
\item [{\texttt{\textbackslash diffp}}] \texttt{= \textbackslash diff.p.}
-\end{description}
-\newpage{}
-\begin{description}
\item [{\texttt{\textbackslash dl}}] arguments (all optional):
\begin{enumerate}
\item .\emph{name}. (as for \texttt{\textbackslash diff})
@@ -2072,6 +2087,7 @@
`d' is wanted)
\item \emph{digit} (insert spacing of this number of mu before the `d')
\end{enumerate}
+\item [{\texttt{\textbackslash dpl}}] \texttt{= \textbackslash dl.p.}
\item [{\texttt{\textbackslash negmu}}] insert a $-1$ mu space
\item [{\texttt{\textbackslash nilmu}}] insert a $0$ mu space
\item [{\texttt{\textbackslash onemu}}] insert a $1$ mu space
Modified: trunk/Master/texmf-dist/tex/latex/diffcoeff/diffcoeff.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/diffcoeff/diffcoeff.sty 2022-06-14 20:20:34 UTC (rev 63589)
+++ trunk/Master/texmf-dist/tex/latex/diffcoeff/diffcoeff.sty 2022-06-14 20:20:47 UTC (rev 63590)
@@ -9,7 +9,7 @@
%
\RequirePackage{expl3}
\RequirePackage{xparse,l3keys2e,xtemplate}
-\ProvidesExplPackage {diffcoeff} {2021/12/24} {4.0}
+\ProvidesExplPackage {diffcoeff} {2022/06/14} {4.1}
{Write differential coefficients consistently and easily.}
%
\keys_define:nn { diffcoeff }
@@ -34,7 +34,6 @@
\tl_new:N \l__diffcoeff_curr_num_tl
\tl_new:N \l__diffcoeff_curr_var_tl
\tl_new:N \l__diffcoeff_paren_tl
-\tl_new:N \l__diffcoeff_trailing_tl
\tl_const:Nn \c__diffcoeff_digits_tl { 1234567890 }
@@ -60,10 +59,10 @@
\int_new:N \l__diffcoeff_parenvar_int
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\DeclareObjectType { derivative } { 5 }
+\DeclareObjectType { derivative } { 3 }
% defaults: ordinary deriv. values
-\DeclareTemplateInterface { derivative } { DERIV } { 5 }
+\DeclareTemplateInterface { derivative } { DERIV } { 3 }
{
op-symbol : tokenlist = d ,
op-symbol-alt : tokenlist = \KeyValue { op-symbol },
@@ -92,7 +91,7 @@
% #1 order spec(seqvar); #2 order override(tlvar)
% #3 derivand(tlvar); #4 denominator(seqvar)
% #5 subscript(tlvar)
-\DeclareTemplateCode { derivative } { DERIV } { 5 }
+\DeclareTemplateCode { derivative } { DERIV } { 3 }
{
op-symbol = \l__diffcoeff_op_tl,
op-symbol-alt = \l__diffcoeff_op_alt_tl,
@@ -99,14 +98,14 @@
op-order-sep = \l__diffcoeff_oporder_muskip,
derivand-sep = \l__diffcoeff_derivsep_muskip,
long-var-wrap = {
- dv = \cs_set:Npn \__diffcoeff_wrap_longvars:nn #1#2
- { \l__diffcoeff_op_alt_tl {#2}^{#1} },
- d(v) = \cs_set:Npn \__diffcoeff_wrap_longvars:nn #1#2
- { \l__diffcoeff_op_alt_tl {(#2)}^{#1} },
- (dv) = \cs_set:Npn \__diffcoeff_wrap_longvars:nn #1#2
- { (\l__diffcoeff_op_alt_tl {#2)}^{#1} },
- unknown = \cs_set:Npn \__diffcoeff_wrap_longvars:nn #1#2
- { \l__diffcoeff_op_alt_tl {(#2)}^{#1} }
+ dv = \cs_set_eq:NN \__diffcoeff_wrap_longvars:nn
+ \__diffcoeff_wrap_longvars_dv:nn,
+ d(v) = \cs_set_eq:NN \__diffcoeff_wrap_longvars:nn
+ \__diffcoeff_wrap_longvars_dvi:nn,
+ (dv) = \cs_set_eq:NN \__diffcoeff_wrap_longvars:nn
+ \__diffcoeff_wrap_longvars_dvii:nn,
+ unknown = \cs_set_eq:NN \__diffcoeff_wrap_longvars:nn
+ \__diffcoeff_wrap_longvars_dvi:nn
},
denom-term-sep = \l__diffcoeff_varsep_muskip,
term-sep-adjust = \l__diffcoeff_sep_adj_muskip,
@@ -133,7 +132,7 @@
{
\int_compare:nNnT { \l__diffcoeff_format_int } > { 1 }
{ \__diffcoeff_slash_vals: }
- \__diffcoeff_build:NNNNN #1#2#3#4#5
+ \__diffcoeff_build:nnn { #1 } { #2 } { #3 }
}
}
%%%%%%%%%%
@@ -145,8 +144,11 @@
\tl_set:NV \l__diffcoeff_ldelim_tl \l__diffcoeff_ldelimi_tl
\tl_set:NV \l__diffcoeff_rdelim_tl \l__diffcoeff_rdelimi_tl
}
-\cs_new:Npn \__diffcoeff_build:NNNNN #1#2#3#4#5
+% #1 diff'and; #2 vars clist; #3 trailing arg
+\cs_new:Npn \__diffcoeff_build:nnn #1#2#3
{
+ \tl_set:Nn \l__diffcoeff_derivand_tl { #1 }
+ \seq_set_from_clist:Nn \l__diffcoeff_vars_seq { #2 }
\bool_if:nT
{
!\l__diffcoeff_opwrap_bool &&
@@ -161,25 +163,27 @@
}
{ \__diffcoeff_derivsep: }
{ \tl_put_left:Nn \l__diffcoeff_derivand_tl { \mskip 0 mu } }
- \exp_args:NV\tl_if_novalue:nF #5
+ \tl_if_novalue:nF { #3 }
{ \l__diffcoeff_ldelim_tl \mskip \l__diffcoeff_elbowrm_muskip }
\bool_if:NTF \l__diffcoeff_single_var_bool
{
- \tl_set:Nx \l_tmpa_tl { \seq_use:Nn #4 { , } }
- \__diffcoeff_single:NNN #2 #3 \l_tmpa_tl
+ \tl_set:Nx \l_tmpa_tl { \seq_use:Nn \l__diffcoeff_vars_seq { , } }
+ \__diffcoeff_single:NNN \l__diffcoeff_tot_order_tl \l__diffcoeff_derivand_tl \l_tmpa_tl
}
{
\int_zero:N \l_tmpa_int
- \seq_mapthread_function:NNN #1 #4 \__diffcoeff_map_orders:nn
- \__diffcoeff_mixed:NNN #2 #3 \l__diffcoeff_denom_seq
+ \seq_mapthread_function:NNN \l__diffcoeff_orders_seq
+ \l__diffcoeff_vars_seq \__diffcoeff_map_orders:nn
+ \__diffcoeff_mixed:NNN \l__diffcoeff_tot_order_tl
+ \l__diffcoeff_derivand_tl \l__diffcoeff_denom_seq
}
- \exp_args:NV\tl_if_novalue:nF #5
+ \tl_if_novalue:nF { #3 }
{
\mskip \l__diffcoeff_elbowrm_muskip \l__diffcoeff_rdelim_tl
- \exp_args:NV\tl_if_empty:nF #5
+ \tl_if_empty:nF { #3 }
{
\c_math_subscript_token
- { \mskip \l__diffcoeff_subnudge_muskip #5 }
+ { \mskip \l__diffcoeff_subnudge_muskip { #3 } }
}
}
}
@@ -213,16 +217,22 @@
}
}
}
-% (ptl) form denom from #1 orders seq & #2 vars seq
+\cs_new:Npn \__diffcoeff_wrap_longvars_dv:nn #1#2
+ { \l__diffcoeff_op_alt_tl { {}#2 }^{ #1 } }
+\cs_new:Npn \__diffcoeff_wrap_longvars_dvi:nn #1#2
+ { \l__diffcoeff_op_alt_tl { {}(#2) }^{ #1 } }
+\cs_new:Npn \__diffcoeff_wrap_longvars_dvii:nn #1#2
+ { (\l__diffcoeff_op_alt_tl { {}#2) }^{ #1 } }
+% (ptl) form denom #1 from orders seq & #2 from vars seq
\cs_new_protected:Npn \__diffcoeff_map_orders:nn #1#2
{
\tl_if_eq:nnTF { #1 } { 1 }
- { \seq_put_right:Nn \l__diffcoeff_denom_seq { \l__diffcoeff_op_alt_tl #2 } }
+ { \seq_put_right:Nn \l__diffcoeff_denom_seq { \l__diffcoeff_op_alt_tl { #2 } } }
{
\int_compare:nNnTF { \tl_count:n { #2 } } = { 1 }
{
\seq_put_right:Nn \l__diffcoeff_denom_seq
- { \l__diffcoeff_op_alt_tl #2^{ #1 } }
+ { \l__diffcoeff_op_alt_tl { #2 }^{ #1 } }
}
{
\seq_put_right:Nn \l__diffcoeff_denom_seq
@@ -288,10 +298,10 @@
\cs_new_protected:Npn \__diffcoeff_denom_single:NN #1#2
{
\tl_if_eq:nVTF { 1 } #1
- { \l__diffcoeff_op_alt_tl #2 }
+ { \l__diffcoeff_op_alt_tl {}#2 }
{
\int_compare:nNnTF { \tl_count:N #2 } = { 1 }
- { \l__diffcoeff_op_alt_tl #2^{ #1 } }
+ { \l__diffcoeff_op_alt_tl {}#2^{ #1 } }
{ \__diffcoeff_wrap_longvars:nn { #1\vphantom) } { #2 } }
}
}
@@ -344,13 +354,9 @@
\IfBooleanTF #5
{ \bool_set_true:N \l__diffcoeff_altsep_bool }
{ \bool_set_false:N \l__diffcoeff_altsep_bool }
- \tl_set:Nn \l__diffcoeff_derivand_tl { #6 }
- \tl_set:Nn \l__diffcoeff_trailing_tl { #9 }
- \seq_set_from_clist:Nn \l__diffcoeff_vars_seq { #8 }
\seq_set_from_clist:Nn \l__diffcoeff_orders_seq { #3 }
- \int_set:Nn \l__diffcoeff_vars_int
- { \seq_count:N \l__diffcoeff_vars_seq }
\int_set:Nn \l_tmpb_int { \seq_count:N \l__diffcoeff_orders_seq }
+ \int_set:Nn \l__diffcoeff_vars_int { \clist_count:n { #8 } }
\int_compare:nNnTF { \l__diffcoeff_vars_int } = { 1 }
{ \bool_set_true:N \l__diffcoeff_single_var_bool }
{
@@ -359,7 +365,7 @@
\msg_error:nnxxxx { diffcoeff } { numbers-conflict }
{ \int_use:N \l__diffcoeff_vars_int } { \int_use:N \l_tmpb_int }
{ \seq_use:Nn \l__diffcoeff_orders_seq { , } }
- { \seq_use:Nn \l__diffcoeff_vars_seq { , } }
+ { \clist_use:nn { #8 } { , } }
}
{ % pad orders seq if nec.
\int_step_inline:nnnn
@@ -385,12 +391,7 @@
\int_zero:N \l__diffcoeff_format_int
\IfBooleanT #2 { \int_incr:N \l__diffcoeff_format_int }
\IfBooleanT #7 { \int_add:Nn \l__diffcoeff_format_int { 2 } }
- \UseInstance { derivative } { ord\l__diffcoeff_type_tl }
- \l__diffcoeff_orders_seq
- \l__diffcoeff_tot_order_tl
- \l__diffcoeff_derivand_tl
- \l__diffcoeff_vars_seq
- \l__diffcoeff_trailing_tl
+ \UseInstance { derivative } { ord\l__diffcoeff_type_tl } {#6}{#8}{#9}
\group_end:
} % end of \diff
%%%%%%%%%%%%%%%%%%%
More information about the tex-live-commits
mailing list.