texlive[63892] Master/texmf-dist: fixdif (14jul22)

commits+karl at tug.org commits+karl at tug.org
Thu Jul 14 22:18:31 CEST 2022


Revision: 63892
          http://tug.org/svn/texlive?view=revision&revision=63892
Author:   karl
Date:     2022-07-14 22:18:31 +0200 (Thu, 14 Jul 2022)
Log Message:
-----------
fixdif (14jul22)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/fixdif/fixdif.pdf
    trunk/Master/texmf-dist/source/latex/fixdif/fixdif.dtx
    trunk/Master/texmf-dist/tex/latex/fixdif/fixdif.sty

Modified: trunk/Master/texmf-dist/doc/latex/fixdif/fixdif.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/source/latex/fixdif/fixdif.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/fixdif/fixdif.dtx	2022-07-14 20:18:14 UTC (rev 63891)
+++ trunk/Master/texmf-dist/source/latex/fixdif/fixdif.dtx	2022-07-14 20:18:31 UTC (rev 63892)
@@ -126,7 +126,7 @@
 %</internal>
 %
 %<*driver>
-\ProvidesFile{fixdif.dtx}[2022/07/09 (c) Copyright 2022 by Zhang Tingxuan]
+\ProvidesFile{fixdif.dtx}[2022/07/14 (c) Copyright 2022 by Zhang Tingxuan]
 \documentclass{ltxdoc}
 
 \usepackage{xcolor}
@@ -133,7 +133,7 @@
 \definecolor{titlecolor}{RGB}{0,12,160}
 \usepackage{doc}
 \usepackage{fancyvrb}
-\fvset{xleftmargin=2em,fontsize=\small,gobble=2}
+\fvset{xleftmargin=2.5em,fontsize=\small,gobble=2}
 \MakeShortVerb|
 
 \usepackage{hologo}
@@ -145,7 +145,7 @@
 
 \title{The \pkg{fixdif} Package}
 \author{Zhang Tingxuan}
-\date{2022/07/09\quad Version 1.2\thanks{\url{https://github.com/AlphaZTX/fixdif}}}
+\date{2022/07/14\quad Version 1.3\thanks{\url{https://github.com/AlphaZTX/fixdif}}}
 
 \usepackage{hyperref}
 \hypersetup{
@@ -152,7 +152,8 @@
   pdftitle   = {The fixdif Package},
   pdfauthor  = {Zhang Tingxuan},
   pdfcreator = {pdfLaTeX/XeLaTeX/LuaLaTeX},
-  hidelinks,
+  linkcolor  = black,
+  urlcolor   = titlecolor!80!black,
 }
 \def\pkg{\textsf}
 
@@ -188,10 +189,9 @@
 
 \usepackage{fixdif}
 
-
 \linespread{1.05}
-\parskip5pt plus 2pt minus 1pt
-\parindent3em
+\parskip6pt plus 2pt minus 1pt
+\parindent2.5em
 
 \begin{document}
   \DocInput{\jobname.dtx}
@@ -391,14 +391,14 @@
 % Then you get |\D| for an uppercase upright ``D'' as a differential operator.
 %
 % If your second argument contains only one command like |\Delta|, 
-% you should use \cs{letdif} or \cs{letdif*} instead.
+% it's recommended to use \cs{letdif} or \cs{letdif*} instead.
 %
 % These two commands will check whether \meta{cmd} has been defined already. 
 % If so, an error message will be given.
 %
-% \noindent\textcolor{titlecolor}{\cs{renewdif}\marg{cmd}\marg{multi-cmd}}\DescribeMacro{\newdif}
+% \noindent\textcolor{titlecolor}{\cs{renewdif}\marg{cmd}\marg{multi-cmd}}\DescribeMacro{\renewdif}
 % \hfill(without correction, preamble only)\\
-% \noindent\textcolor{titlecolor}{\cs{renewdif*}\marg{cmd}\marg{multi-cmd}}\DescribeMacro{\newdif*}
+% \noindent\textcolor{titlecolor}{\cs{renewdif*}\marg{cmd}\marg{multi-cmd}}\DescribeMacro{\renewdif*}
 % \hfill(with correction, preamble only)
 %
 % These two commands are basically the same as \cs{newdif} and \cs{newdif*}. 
@@ -406,6 +406,55 @@
 % whether \meta{cmd} has \emph{not} been defined yet. If so, an error message 
 % will be given.
 %
+% \section{Using differential operators temporarily}
+%
+% \noindent\textcolor{titlecolor}{\cs{mathdif}\marg{symbol}}\DescribeMacro{\mathdif}
+% \hfill(without correction, in math mode only)\\ 
+%\noindent\textcolor{titlecolor}{\cs{mathdif*}\marg{symbol}}\DescribeMacro{\mathdif*}
+% \hfill(with correction, in math mode only)
+%
+% These two commands can be used in math mode only, more specifically, 
+% after \verb|\begin{document}|. For example, \verb|$x\mathdif{\Delta}\psi$| 
+% will get $x\mathdif{\Delta}\psi$.
+%
+% \section{Examples}
+%
+% This section shows how to use this package properly in your document.
+%
+% Take the two examples below:
+% \begin{Verbatim}
+% \letdif{\Delta}{Delta}       % Example 1, in preamble
+% \letdif{\nabla}{nabla}       % Example 2, in preamble
+% \end{Verbatim}
+% Actually, the second example is more reasonable. 
+% Sometimes, we take ``$\Delta$'' as laplacian (equivalent to $\nabla^2$), 
+% while ``$\Delta$'' can also be regarded as a variable 
+% or function at some other times. Consequently, it's better to save 
+% a different command for ``$\Delta$'' as laplacian while reserve 
+% \verb|\Delta| as a command for an ordinary math symbol ``$\Delta$''. 
+% However, in the vast majority of cases, ``$\nabla$'' is regarded as 
+% nabla operator so there is no need to save a different command for 
+% ``$\nabla$''. Then we can correct the code above:
+% \begin{Verbatim}
+% \letdif{\laplacian}{Delta}   % Example 1, corrected, in preamble
+% \end{Verbatim}
+% With the \pkg{xparse} package, we can define the command in another method:
+% \begin{Verbatim}
+% \letdif{\nabla}{nabla}
+% \DeclareDocumentCommand{ \laplacian }{ s }{
+%   \IfBooleanTF{#1}{\mathdif{\Delta}}{\nabla^2}
+% }
+% \end{Verbatim}
+% Then \verb|\laplacian| produces $\nabla^2$ and \verb|\laplacian*| 
+% produces $\Delta$.
+%
+% \paragraph{Dealing with ``$+$'' and ``$-$''}
+% If you input \verb|$-\d x$|, you'll get ``$-\d x$'' in your document, 
+% but compared to ``$-\d x$'', ``$-{\d x}$'' is better. To get ``$-{\d x}$'', 
+% you can input \verb|-{\d x}|. The ``\verb|\d x|'' in a \emph{group} will be 
+% regarded \textsl{ordinary} but not \textsl{inner}
+% so that the small skip will disappear.
+%
 % \section{The source code}
 %    \begin{macrocode}
 %<*package>
@@ -413,10 +462,10 @@
 % Check the \TeX{} format and provides the package name.
 %    \begin{macrocode}
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{fixdif}[2022/05/29 Interface for defining the differential operator.]
+\ProvidesPackage{fixdif}[2022/07/14 Interface for defining the differential operators.]
 %    \end{macrocode}
 % 
-% \subsection{Control the skip between slash and differential operator}
+% \subsection{Control the skip between slashes and differential operator}
 % Change the math code of slash ($/$) and backslash ($\backslash$) so that the skip 
 % between slashes and differential operators can be ignored.
 %    \begin{macrocode}
@@ -572,6 +621,15 @@
   \fi%
 }}
 \def\renewdif{\@ifstar\s at renewdif\@renewdif}
+%    \end{macrocode}
+% \subsection{In-document commands: \cs{mathdif} and \cs{mathdif*}}
+%    \begin{macrocode}
+\def\@mathdif#1{\mathinner{#1}\mup at tch}
+\def\s at mathdif#1{\s at beforep@tch\mathinner{#1\mbox{}}\mup at tch}
+\DeclareRobustCommand\mathdif{\@ifstar\s at mathdif\@mathdif}
+%    \end{macrocode}
+% End of the package.
+%    \begin{macrocode}
 %</package>
 %    \end{macrocode}
 \endinput
\ No newline at end of file

Modified: trunk/Master/texmf-dist/tex/latex/fixdif/fixdif.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/fixdif/fixdif.sty	2022-07-14 20:18:14 UTC (rev 63891)
+++ trunk/Master/texmf-dist/tex/latex/fixdif/fixdif.sty	2022-07-14 20:18:31 UTC (rev 63892)
@@ -29,7 +29,7 @@
 %%                               and README.md.
 %% 
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{fixdif}[2022/05/29 Interface for defining the differential operator.]
+\ProvidesPackage{fixdif}[2022/07/14 Interface for defining the differential operators.]
 \@ifpackageloaded{unicode-math}{
   \Umathcode`\/="4 "0 "002F
   \Umathcode"2044="4 "0 "2044
@@ -111,6 +111,9 @@
   \fi%
 }}
 \def\renewdif{\@ifstar\s at renewdif\@renewdif}
+\def\@mathdif#1{\mathinner{#1}\mup at tch}
+\def\s at mathdif#1{\s at beforep@tch\mathinner{#1\mbox{}}\mup at tch}
+\DeclareRobustCommand\mathdif{\@ifstar\s at mathdif\@mathdif}
 \endinput
 %%
 %% End of file `fixdif.sty'.



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