summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/lwarp
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2020-05-13 03:03:16 +0000
committerNorbert Preining <norbert@preining.info>2020-05-13 03:03:16 +0000
commit59bb568bc26ddc9570ef64252b92f81052ccdf70 (patch)
tree18b8ec0b07db7548cd40623cd538c7e2fc9aecf2 /macros/latex/contrib/lwarp
parent675bcc9067ccef91624a9eca025506a4ce1d37b3 (diff)
CTAN sync 202005130303
Diffstat (limited to 'macros/latex/contrib/lwarp')
-rw-r--r--macros/latex/contrib/lwarp/README.txt2
-rw-r--r--macros/latex/contrib/lwarp/lwarp.dtx1235
-rw-r--r--macros/latex/contrib/lwarp/lwarp.pdfbin2703938 -> 2723559 bytes
-rwxr-xr-xmacros/latex/contrib/lwarp/lwarpmk.lua2
4 files changed, 886 insertions, 353 deletions
diff --git a/macros/latex/contrib/lwarp/README.txt b/macros/latex/contrib/lwarp/README.txt
index 992bd5efd0..1fb8e49873 100644
--- a/macros/latex/contrib/lwarp/README.txt
+++ b/macros/latex/contrib/lwarp/README.txt
@@ -1,5 +1,5 @@
-LaTeX lwarp package v0.85 README.txt
+LaTeX lwarp package v0.86 README.txt
Files included are:
diff --git a/macros/latex/contrib/lwarp/lwarp.dtx b/macros/latex/contrib/lwarp/lwarp.dtx
index 8d1bb36cd3..8139da0040 100644
--- a/macros/latex/contrib/lwarp/lwarp.dtx
+++ b/macros/latex/contrib/lwarp/lwarp.dtx
@@ -16,7 +16,7 @@
% \iffalse
%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
%<package>\ProvidesPackage{lwarp}
-%<package> [2020/05/01 v0.85 Allows LaTeX to directly produce HTML5 output.]
+%<package> [2020/05/12 v0.86 Allows LaTeX to directly produce HTML5 output.]
%
%<*driver>
\documentclass{ltxdoc}
@@ -24,7 +24,7 @@
\PassOptionsToPackage{quiet}{textcomp}% Not all chars supported in TT font.
\usepackage{lmodern}
-% \usepackage{libertine}
+\usepackage{libertine}
\usepackage[space]{erewhon}
\usepackage[varqu,varl]{inconsolata} % typewriter
% \usepackage{roboto}% conflicts with \textsc inside a float
@@ -1313,12 +1313,6 @@ Limitations when using \brand{MathJax} include:
\cs{multicolumn} only fills a single cell, resulting in a short row.
\cs{multirow} simply prints its text on the first line.
-\item \brand{MathJax} does not support subequations.
- \trouble[subequations]{mathjax=\brand{MathJax}>subequations}%
- \trouble{math>subequations}%
- This may be improved by parsing the \LaTeX{}
- math expression to manually insert tags, but this has not yet been done.
-
\item Footnotes are emulated when used inside a \brand{MathJax} expression.
\watchout[footnotes]
For an equation with a single footnote, the correct footnote number is used.
@@ -1361,12 +1355,6 @@ Limitations when using \brand{MathJax} include:
While using \brand{MathJax}, \pkg{lwarp} provides emulation
for footnotes, \pkg{bm}, \pkg{mathtools},
\pkg{nicefrac}, \pkg{siunitx}, and \pkg{units}.
-
-\item Starred macros are generally not supported
- \trouble[starred macros]{starred macros>mathjax=\brand{MathJax}}
- \trouble{math>starred macros and mathjax=\brand{MathJax}}
- \trouble{mathjax=\brand{MathJax}>starred macros}
- by MathJax or the \pkg{lwarp} emulations.
\end{itemize}
}
@@ -1438,6 +1426,27 @@ so complicated objects such as \tikz\ pictures are more likely to compile succes
\newcommand{\limitscustomizemathjax}{%
+\pkg{lwarp} detects and adjusts \brand{MathJax} equation numbering format for
+\margintag{equation numbering}
+\gindex{equation numbering>mathjax=\brand{MathJax}}
+\gindex{math>equation numbering, mathjax=\brand{MathJax}}
+\gindex{mathjax=\brand{MathJax}>equation numbering}
+\trouble{equation numbering>mathjax=\brand{MathJax}}
+\trouble{mathjax=\brand{MathJax}>equation numbering}
+\trouble{math>equation numbering>mathjax=\brand{MathJax}}
+\pkg{article} and \pkg{book} style equations as well as
+\pkg{amsmath} \cs{numberwithin} for chapters, sections, and subsections.
+Custom equation number formats may be set as follows, for example:
+\begin{sourcedisplay}
+\cs{renewcommand*}\{\cs{theequation}\}\{\cs{Alph}\{section\}.\cs{arabic}\{equation\}\} \\
+\textred{\cs{AtBeginDocument}\{} \\
+ \fquad\cs{renewcommand*}\{\cs{theMathJaxsection}\}\{\cs{Alph}\{section\}.\} \\
+\textred{\}}
+\end{sourcedisplay}
+The \pkg{amsmath} \env{subequations} environment is supported, but only
+\watchout[\env{subequation}]
+with \cs{alpha} subequation numbering.
+
\brand{MathJax} does not have preexisting support every possible math function.
\margintag{global customizations}
Additional \brand{MathJax} function definitions may be
@@ -1496,9 +1505,20 @@ macros may be defined as follows:
To maintain compile speed, use the \env{warpMathJax} environment,
and use a separate math environment for each definition.
-Starred macros are generally not supported
- \watchout[starred macros]
- by MathJax or the \pkg{lwarp} emulations.
+\DescribeMacro{\DeclareIfstar}
+To define a starred macro, instead of:
+\gindex{mathjax=\brand{MathJax}>starred macros}
+\trouble{mathjax=\brand{MathJax}>starred macros}
+\trouble{math>starred macros and mathjax=\brand{MathJax}}
+\begin{sourcedisplay}
+\cs{CustomizeMathJax}\{\cs{def}\cs{myname}\{\cs{@ifstar}\cs{starredaction}\cs{unstarredaction}\}\}
+\end{sourcedisplay}
+use:
+\begin{sourcedisplay}
+\cs{CustomizeMathJax}\{\cs{DeclareIfstar}\{\cs{myname}\}\{\cs{starredaction}\}\{\cs{unstarredaction}\}\}
+\end{sourcedisplay}
+Inside a \brand{MathJax} math expression, \cs{myname} becomes a macro
+which uses \cs{starredaction} if it is starred, or \cs{unstarredaction} if not.
}
%\newcommand{\limitscustomizeKaTeX}{%
@@ -1528,10 +1548,10 @@ in section names use paren math \texttt{\textbackslash(x+y\textbackslash)}
\trouble{math>file name}
instead of dollar math \texttt{\$x+y\$}.
(Dollar math works, but appears in the filename.)
-Or, use a short name for the \TOC\ entry without the math, or use \cs{texorpdfstring}:
+Or, use a short name for the \TOC\ entry without the math, or use \cs{texorpdfstring}
+from the \pkg{hyperref} package:
\begin{sourcedisplay}
-\cs{section}\{A name with math \\
- \fqquad \cs{texorpdfstring}\{\$1+2=3\$\}\{text description\}\}
+\cs{section}\{Some math \cs{texorpdfstring}\{\$1+2=3\$\}\{three\}\}
\end{sourcedisplay}
}
@@ -1546,7 +1566,6 @@ Or, use a short name for the \TOC\ entry without the math, or use \cs{texorpdfst
If using \brand{MathJax}:
\trouble[\brand{MathJax}]{mathjax=\brand{MathJax}>mathtools=\pkg{mathtools}}
\begin{itemize}
- \item Starred macros are not available. Starred environments do work.
\item \pkg{mathtools} \optn{disallowspaces} does not work for \brand{MathJax}.
Protect brackets which are not optional arguments, such as:
\begin{sourcedisplay}
@@ -1566,7 +1585,6 @@ Or, use a short name for the \TOC\ entry without the math, or use \cs{texorpdfst
\env{warpprint} to isolate a version for each mode.
\item \cs{DeclareParedDelimiter} and related must be in the preamble
before \linebreak \texttt{\cs{begin}\{document\}}.
- The starred versions of each macro are not created.
\end{itemize}
}
@@ -2784,12 +2802,11 @@ These packages do work with \pkg{lwarp}'s option \optn{svgmath}.
\newcommand{\limitsphysics}{%
\pkg{physics} works as-is for \HTML\ with \SVG\ math.
-For \brand{MathJax}, emulation is provided via \brand{MathJax} macros.
+For \brand{MathJax}, emulation is provided via \pkg{lwarp}'s \brand{MathJax} macros.
These are not the same as the third-party \brand{MathJax} extension.
\begin{itemize}
\item The \optn{notrig} option is honored.
-\item Starred macros are not yet detected.\watchout
\item Most macros don't work with \cs{big}, etc.\watchout
\item Macros do not auto-detect variable numbers of mandatory arguments. \watchout
Provide empty \texttt{\{\}} arguments for those which are not used.
@@ -3005,7 +3022,7 @@ This boolean may be tested by the user for later use.
%<*package>
% \fi
%
-% \CheckSum{44178}
+% \CheckSum{44713}
%
% \CharacterTable
% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
@@ -3133,6 +3150,7 @@ This boolean may be tested by the user for later use.
% \changes{v0.83}{2020/03/27}{\ 2020/03/27}
% \changes{v0.84}{2020/04/24}{\ 2020/04/24}
% \changes{v0.85}{2020/05/01}{\ 2020/05/01}
+% \changes{v0.86}{2020/05/12}{\ 2020/05/12}
@@ -3355,6 +3373,28 @@ This boolean may be tested by the user for later use.
%
% \begin{description}
% \needspace{2\baselineskip}
+% \item[v0.86:] \brand{MathJax} major updates.
+% \begin{itemize}
+% \item Fixed: Filename if named files with \filenm{*}, parens, period in section name.
+% \margintag{core}
+% \item Fixed: Labels in \env{eqnarray}, \env{lateximage}.
+% \item Updated to \brand{MathJax} v3. New repository.
+% \margintag{\brand{MathJax}}
+% \item Fixed forward references for \brand{MathJax}.
+% \item Improved \brand{MathJax} equation number formatting, now compatible with
+% \pkg{amsmath} \cs{numberwithin} for chapters, sections, subsections,
+% as well as \pkg{amsmath} \env{subequation}s.
+% See \cref{sec:limitscustomizemathjax}.
+% \item Added \cs{DeclareIfstar} to define starred \TeX\ macros in \brand{MathJax}.
+% See \cref{sec:limitscustomizemathjax}.
+% \item Generates an error if \cs{MathJaxFilename} file does not exist.
+% \item \pkg{mathtools}, \pkg{nccmath}, \pkg{physics}:
+% \margintag{packages}
+% Added starred macros for \brand{MathJax}.
+% \item \pkg{nccmath}: Fixed \cs{nr}, \cs{displaybreak} for \brand{MathJax}.
+% \item \pkg{xcolor}: Fixed \cs{textcolor} with \pkg{babel-french}.
+% \end{itemize}
+% \needspace{2\baselineskip}
% \item[v0.85:] \pkg{fontspec}
% \begin{itemize}
% \item \pkg{fontspec}: Fixed core font change macros for world languages.
@@ -6350,7 +6390,7 @@ This boolean may be tested by the user for later use.
%
% \item [|lwarp\_mathjax.txt|:] Inserted into the \HTML\ files when
% \brand{MathJax} is used to display math.
-% This file should not be modified by the user.
+% Do not modify, see \cs{MathJaxFilename} instead.
%
% \item [|comment\_*.cut|:] Temporary files used by \pkg{lwarp} to
% conditionally process blocks of text. These files may be ignored.
@@ -13087,6 +13127,7 @@ This boolean may be tested by the user for later use.
% \end{macro}
%
%
+%
% \section{Operating-System portability}
% \label{sec:OSportability}
% \changes{v0.11}{2016/03/11}{Added section: Operating-System portability.}
@@ -18758,10 +18799,13 @@ page_compositor "."
% \subsection{\filenm{lwarp_mathjax.txt}}
+% \credits{Davide P. Cervone}
+
% \DescribeFile{lwarp_mathjax.txt}
% The default MathJax script used by \pkg{lwarp} when using \brand{MathJax}.
% A recent version of MathJax is used, as served by the recommended repository.
-% Adjustments are made to allow \LaTeX\ to control the equation tags.
+% Adjustments are made to allow \LaTeX\ to control the equation tags
+% and provide for starred macros.
%
% \cs{MathJaxFilename} determines which script file is copied into the \HTML\ pages,
% and defaults to \filenm{lwarp_mathjax.txt}.
@@ -18774,8 +18818,8 @@ page_compositor "."
% To generate a custom script, such as to use a local repository,
% \margintag{custom script}
% copy \filenm{lwarp_mathjax.txt} to a new file,
-% make changes while keeping \pkg{lwarp}'s adjustments for equation numbering,
-% and use \cs{MathJaxFilename} to select new filename.
+% make changes while keeping \pkg{lwarp}'s adjustments for equation numbering
+% and starred macros, and use \cs{MathJaxFilename} to select the new filename.
%
% \changes{v0.28}{2017/04/11}{File: \filenm{lwarp_mathjax.txt}: Updated \protect\acro{CDN} repository.}
% \changes{v0.30}{2017/04/26}{Fix: \filenm{lwarp_mathjax.txt}: Only written in print mode.}
@@ -18783,12 +18827,15 @@ page_compositor "."
% \changes{v0.42}{2017/10/16}{File: \filenm{lwarp_mathjax.txt}: Updated \pkg{siunitx} script.}
% \changes{v0.45}{2017/12/21}{File: \filenm{lwarp_mathjax.txt}: Allow \brand{MathJax} inside \env{tabbing}.}
% \changes{v0.45}{2018/01/23}{File: \filenm{lwarp_mathjax.txt}: Allow \brand{MathJax} inside \env{verse}.}
-% \changes{v0.59}{2018/07/13}{File: \filenm{lwarp_mathjax.txt}: Updated to MathJax v2.7.4.}
-% \changes{v0.59}{2018/07/16}{File: \filenm{lwarp_mathjax.txt}: Fix: Removed chapter number from tagged non-numeric MathJax equations.}
+% \changes{v0.59}{2018/07/13}{File: \filenm{lwarp_mathjax.txt}: Updated to \brand{MathJax} v2.7.4.}
+% \changes{v0.59}{2018/07/16}{File: \filenm{lwarp_mathjax.txt}: Fix: Removed chapter number from tagged non-numeric \brand{MathJax} equations.}
% \changes{v0.62}{2018/11/05}{File: \filenm{lwarp_mathjax.txt}: Removed inoperable \pkg{siunitx} extension.}
-% \changes{v0.70}{2019/03/24}{File: \filenm{lwarp_mathjax.txt}: Updated to MathJax v2.7.5.}
+% \changes{v0.70}{2019/03/24}{File: \filenm{lwarp_mathjax.txt}: Updated to \brand{MathJax} v2.7.5.}
% \changes{v0.70}{2019/03/24}{File: \filenm{lwarp_mathjax.txt}: Loads \filenm{autoload-all.js} extension.}
-% \changes{v0.76}{2019/10/05}{File: \filenm{lwarp_mathjax.txt}: Updated to MathJax v2.7.6.}
+% \changes{v0.76}{2019/10/05}{File: \filenm{lwarp_mathjax.txt}: Updated to \brand{MathJax} v2.7.6.}
+% \changes{v0.86}{2020/05/03}{File: \filenm{lwarp_mathjax.txt}: Updated to \brand{MathJax} v3 current.}
+% \changes{v0.86}{2020/05/03}{File: \filenm{lwarp_mathjax.txt}: Improved equation numbering.}
+% \changes{v0.86}{2020/05/03}{File: \filenm{lwarp_mathjax.txt}: Added support for starred macros.}
%
% ^^A *lwarp_mathjax.txt
%
@@ -18796,120 +18843,250 @@ page_compositor "."
% \begin{macrocode}
\begin{LWRwriteconf}
\begin{filecontents*}[overwrite]{lwarp_mathjax.txt}
-<!-- https://groups.google.com/forum/#!topic/
- mathjax-users/jUtewUcE2bY -->
-<script type="text/x-mathjax-config">
-MathJax.Hub.Register.StartupHook("TeX AMSmath Ready",function () {
- var seteqsectionDefault = {name: "", num: 0};
- var seteqsections = {}, seteqsection = seteqsectionDefault;
- var TEX = MathJax.InputJax.TeX, PARSE = TEX.Parse;
- var AMS = MathJax.Extension["TeX/AMSmath"];
- TEX.Definitions.Add({
- macros: {
- seteqsection: "mySection",
- seteqnumber: "mySetEqNumber"
- }
- });
-
- PARSE.Augment({
- mySection: function (name) {
- seteqsection.num = AMS.number;
- var n = this.GetArgument(name);
- if (n === "") {
- seteqsection = seteqsectionDefault;
- } else {
- if (!seteqsections["_"+n])
- seteqsections["_"+n] = {name:n, num:0};
- seteqsection = seteqsections["_"+n];
+<script>
+// Lwarp MathJax emulation code
+// Based on code by Davide P. Cervone.
+// Original code: https://github.com/mathjax/MathJax/issues/2313
+// Modified by Brian Dunn to adjust equation numbering, add subequations,
+// and add starred macros.
+// Equation numbering: https://github.com/mathjax/MathJax/issues/2427
+// Starred macros: https://github.com/mathjax/MathJax/issues/2428
+//
+// LaTeX can use \seteqnumber{subequations?}{section}{number} before each equation.
+// subequations? is 0 usually, 1 if inside subequations.
+// section is a string printed as-is, or empty.
+// number is auto-incremented by MathJax between equations.
+//
+MathJax = {
+ subequations: "0",
+ section: "",
+ loader: {
+ load: ['[tex]/tagFormat']
+ },
+ startup: {
+ ready() {
+ //
+ // These would be replaced by import commands if you wanted to make
+ // a proper extension.
+ //
+ const Configuration = MathJax._.input.tex.Configuration.Configuration;
+ const CommandMap = MathJax._.input.tex.SymbolMap.CommandMap;
+ const Macro = MathJax._.input.tex.Symbol.Macro;
+ const TexError = MathJax._.input.tex.TexError.default;
+ const ParseUtil = MathJax._.input.tex.ParseUtil.default;
+ const expandable = MathJax._.util.Options.expandable;
+
+ //
+ // These are the names of the command maps:
+ //
+ const SETEQNUMBERMAP = 'seteqnumberCoreMap' ;
+
+ //
+ // These functions implement the macros:
+ //
+ const seteqnumberFunction = (parser, name) => {
+ // Get the macro parameters
+ const star = parser.GetStar(); // true if there is a *
+ const optBrackets = parser.GetBrackets(name); // contents of optional brackets
+ const newsubequations = parser.GetArgument(name); // the subequations argument
+ const neweqsection = parser.GetArgument(name); // the eq section argument
+ const neweqnumber = parser.GetArgument(name); // the eq number argument
+ MathJax.config.subequations=newsubequations ; // a string with boolean meaning
+ MathJax.config.section=neweqsection ; // a string with numeric meaning
+ parser.tags.counter = parser.tags.allCounter = neweqnumber ;
+ };
+
+ //
+ // This is the configuration for the seteqnumberFunctionConfig TeX extension.
+ //
+ const seteqnumberFunctionConfig = Configuration.create('seteqnumberCore', {
+ //
+ // Initialize the extension by creating the command map,
+ // then append the command map to the given configuration as a macro handler.
+ //
+ init(config) {
+ const map = new CommandMap(SETEQNUMBERMAP,{},{});
+ config.append(
+ Configuration.create(
+ 'seteqnumberDefs',
+ {handler: {macro: [SETEQNUMBERMAP]}}
+ )
+ );
+ },
+
+ //
+ // Add options (from the
+ // seteqnumberCore configuration object in the document's
+ // option list, if any).
+ //
+ config(config, jax) {
+ const map = jax.parseOptions.handlers.retrieve(SETEQNUMBERMAP);
+ const options = jax.parseOptions.options.seteqnumberCore;
+ for (const cs of Object.keys(options)) {
+ map.add(cs, new Macro(cs, seteqnumberFunction, options[cs]));
+ }
+ },
+
+ options: {
+ seteqnumberCore: expandable({})
}
- AMS.number = seteqsection.num;
- },
- mySetEqNumber: function (name) {
- var n = this.GetArgument(name);
- if (!n || !n.match(/^ *[0-9]+ *$/))
- n = "";
- else
- n = parseInt(n)-1;
- <!-- $ syntax highlighting -->
- if (n === "" || n < 1)
- TEX.Error
- ("Argument to "+name+" should be a positive integer");
- AMS.number = n;
- }
- });
- MathJax.Hub.Config({
- TeX: {
- equationNumbers: {
- formatTag: function (n) {
- <!-- if not numeric, don't include the chapter -->
- if (!n.match(/^ *[0-9]+ *$/ ))
- <!-- $ syntax highlighting -->
- return "("+(n).replace(/^\./,"")+")" ;
- else
- return "("+(seteqsection.name+"."+n).replace(/^\./,"")+")" ;
- },
- formatID: function (n) {
- n = (seteqsection.name+'.'+n).replace
- (/[:"'<>&]/g,"").replace(/^\./,"");
- return 'mjx-eqn-' + n;
+ }
+ );
+
+ const IFSTARMAP = 'ifstarMap';
+
+ //
+ // This function implements an ifstar macro.
+ //
+ const IfstarFunction = (parser, name, resultstar, resultnostar) => {
+ //
+ // Get the macro parameters
+ //
+ const star = parser.GetStar(); // true if there is a *
+ //
+ // Construct the replacement string for the macro
+ //
+ const macro = [(star ? resultstar : resultnostar)].join('');
+ //
+ // Insert the replacement string into the TeX string, and check
+ // that there haven't been too many maxro substitutions (prevents
+ // infinite loops).
+ //
+ parser.string = ParseUtil.addArgs(parser, macro, parser.string.slice(parser.i));
+ parser.i = 0;
+ if (++parser.macroCount > parser.configuration.options.maxMacros) {
+ throw new TexError('MaxMacroSub1',
+ 'MathJax maximum macro substitution count exceeded; ' +
+ 'is there a recursive macro call?');
+ }
+ };
+
+ //
+ // This is the configuration for the IfstarConfiguration TeX extension.
+ //
+ const IfstarConfiguration = Configuration.create('Ifstar', {
+ //
+ // Initialize the extension by creating the command map for the
+ // macros defined by \DeclareIfstar, and add the
+ // \DeclareIfstar macro itself. Then append the
+ // command map to the given configuration as a macro handler
+ //
+ init(config) {
+ const map = new CommandMap(IFSTARMAP, {
+ DeclareIfstar: ['Declare_Ifstar']
+ }, {
+ //
+ // Implements \DeclareIfstar control sequence.
+ //
+ Declare_Ifstar(parser, name) {
+ //
+ // Get the control sequence to define and the starred and
+ // non-starred macros to use.
+ //
+ let cs = ParseUtil.trimSpaces(parser.GetArgument(name));
+ const resultstar = parser.GetArgument(name);
+ const resultnostar = parser.GetArgument(name);
+ //
+ // Check that the control sequence name is valid
+ //
+ if (cs.charAt(0) === '\\') cs = cs.substr(1);
+ if (!cs.match(/^(.|[a-z]+)$/i)) { //$ syntax highlighting
+ throw new TexError(
+ 'IllegalControlSequenceName',
+ 'Illegal control sequence name for %1',
+ name
+ );
+ }
+ //
+ // Look up the command map and add the new macro to it using
+ // IfstarFunction as the function and passing it the
+ // given starred and non-starred macros.
+ //
+ const map = parser.configuration.handlers.retrieve(IFSTARMAP);
+ map.add(cs, new Macro(cs, IfstarFunction, [resultstar, resultnostar]));
}
+ });
+ config.append(
+ Configuration.create('IfstarDefs', {handler: {macro: [IFSTARMAP]}})
+ );
+ },
+
+ //
+ // Add any user-defined starred/non-starred macros (from the
+ // Ifstar configuration object in the document's
+ // option list), if any.
+ //
+ config(config, jax) {
+ const map = jax.parseOptions.handlers.retrieve(IFSTARMAP);
+ const starmacros = jax.parseOptions.options.Ifstar;
+ for (const cs of Object.keys(starmacros)) {
+ map.add(cs, new Macro(cs, IfstarFunction, starmacros[cs]));
+ }
+ },
+
+ //
+ // Indicate that Ifstar is a valid option, and can have
+ // any number of definitions. The format is
+ //
+ // name: [starred, non-starred]
+ //
+ // where 'name' is the macro name, and starred and non-starred are the
+ // macros to use for the \name macro. You can include
+ // pre-defined macros here, which will be available without
+ // further configuration.
+ //
+ options: {
+ Ifstar: expandable({})
}
- }
- });
-});
-</script>
+ });
-<!-- http://docs.mathjax.org/en/latest/options/ThirdParty.html -->
-<script type="text/x-mathjax-config">
- MathJax.Ajax.config.path["Contrib"] =
- "https://cdn.mathjax.org/mathjax/contrib";
-</script>
-<script type="text/x-mathjax-config">
-MathJax.Hub.Config({
- TeX: {
- extensions: ["autoload-all.js"] ,
- equationNumbers: {
- autoNumber: "AMS"
- }
- }
-});
-</script>
+ MathJax.startup.defaultReady();
-<!-- Alternative CDN provider: -->
-<script type="text/javascript" async
-src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.6/MathJax.js?config=TeX-AMS_HTML-full">
+ // For forward references:
+ MathJax.startup.input[0].preFilters.add(({math}) => {
+ if (math.inputData.recompile){
+ MathJax.config.subequations = math.inputData.recompile.subequations;
+ MathJax.config.section = math.inputData.recompile.section;
+ }
+ });
+ MathJax.startup.input[0].postFilters.add(({math}) => {
+ if (math.inputData.recompile){
+ math.inputData.recompile.subequations = MathJax.config.subequations;
+ math.inputData.recompile.section = MathJax.config.section;
+ }
+ });
+ } // ready
+ }, // startup
+
+ tex: {
+ packages: {'[+]': ['seteqnumberCore', 'tagFormat', 'Ifstar']},
+ seteqnumberCore: {
+ seteqnumber: [] // a user-defined macro
+ },
+ tags: "ams",
+ tagFormat: {
+ number: function (n) {
+ if(MathJax.config.subequations==0)
+ return(MathJax.config.section + n);
+ else
+ return(MathJax.config.section + String.fromCharCode(96+n));
+ },
+ },
+ }
+}
</script>
-<!-- No longer supported after April 30, 2017: -->
-<!--
<script
- src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML-full">
-</script>
--->
-
+ id="MathJax-script"
+ src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js"
+></script>
\end{filecontents*}
% \end{Verbatim}% for syntax highlighting
\end{LWRwriteconf}
% \end{macrocode}
-% ^^A A possible addition for siuntix:
-% ^^A <!-- https://github.com/burnpanck/MathJax-siunitx -->
-% ^^A
-% ^^A <script type="text/x-mathjax-config">
-% ^^A MathJax.Hub.Config({
-% ^^A extensions: ["tex2jax.js","[siunitx]/siunitx.js"],
-% ^^A jax: ["input/TeX","output/HTML-CSS"],
-% ^^A tex2jax: {
-% ^^A inlineMath: [["$","$"],["\\(","\\)"]] ,
-% ^^A processClass: "tabbing|verse"
-% ^^A },
-% ^^A TeX: {extensions: ["AMSmath.js","AMSsymbols.js", "sinuitx.js"]}
-% ^^A });
-% ^^A MathJax.Ajax.config.path['siunitx'] = 'http://rawgit.com/burnpanck/MathJax-siunitx/master/';
-% ^^A </script>
-
-
+
% ^^A \subsection{\filenm{lwarp_KaTeX.txt}}
@@ -19036,7 +19213,7 @@ src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.6/MathJax.js?config=TeX-
-- Copyright 2016-2020 Brian Dunn
-printversion = "v0.85"
+printversion = "v0.86"
requiredconfversion = "2" -- also at *lwarpmk.conf
function printhelp ()
@@ -23242,12 +23419,16 @@ end -- not --version
\LWR@simplifyname*{ }
% \end{macrocode}
% Convert punctutation into hyphens:
+% \changes{v0.86}{2020/05/04}{Fix: \filenm{*}, \filenm{(}, \filenm{)}, \filenm{.} in filename.}
% \begin{macrocode}
+\LWR@simplifyname*{*}
+\LWR@simplifyname*{(}
+\LWR@simplifyname*{)}
+\LWR@simplifyname*{.}
\LWR@simplifyname*{!}
\LWR@simplifyname*{,}
\LWR@simplifyname*{'}
\LWR@simplifyname*{+}
-\LWR@simplifyname*{,}
\LWR@simplifyname*{/}
\LWR@simplifyname*{:}
\LWR@simplifyname*{;}
@@ -23701,6 +23882,7 @@ end -- not --version
\LWR@customizedMathJax
\LWR@startpars
\end{BlockClass}
+\typeout{Done.}
\typeout{---}
\LWR@startpars
@@ -25188,8 +25370,19 @@ end -- not --version
% ^^A \ifbool{mathKaTeX}{%
% ^^A \verbatiminput{lwarp_KaTeX.txt}%
% ^^A }{%
+% \changes{v0.86}{2020/05/03}{Error if missing file.}
% \begin{macrocode}
- \verbatiminput{\LWR@mathjaxfilename}%
+ \IfFileExists{\LWR@mathjaxfilename}%
+ {\verbatiminput{\LWR@mathjaxfilename}}%
+ {%
+ \PackageError{lwarp}%
+ {%
+ \protect\MathJaxFilename\space specified the file\MessageBreak
+ \space\space\LWR@mathjaxfilename\MessageBreak
+ which does not exist%
+ }%
+ {Specify an existing file, or remove \protect\MathJaxFilename.}%
+ }%
% \end{macrocode}
% ^^A }%
% \begin{macrocode}
@@ -25318,16 +25511,6 @@ end -- not --version
\let\LWR@origcaption\caption
% \end{macrocode}
%
-% Labels:
-% \cs{ltx@label} is used in \pkg{amsmath} environments and is also
-% patched by \pkg{cleveref}.
-% \gindex{label>in HTML}
-% \margintag{Label in \HTML}
-% \changes{v0.20}{2017/01/30}{Fix: math cross references.}
-% \begin{macrocode}
-\let\LWR@origltx@label\ltx@label
-\let\ltx@label\LWR@htmlmathlabel
-% \end{macrocode}
% Not yet started any paragraph handling:
% \begin{macrocode}
\global\boolfalse{LWR@doingapar}
@@ -31470,6 +31653,52 @@ end -- not --version
% \label{sec:labels}
+% \begin{macro}{\LWR@label@subcreatetag} Creates the tag from \cs{LWR@sanitized}.
+% \begin{macrocode}
+\newcommand*{\LWR@label@subcreatetag}{%
+ \LWR@htmltag{a \LWR@print@mbox{id="\LWR@sanitized"}}%
+ \LWR@htmltag{/a}%
+}
+% \end{macrocode}
+% \end{macro}
+
+
+% \begin{macro}{\LWR@label@inmathcomment}
+% \changes{v0.86}{2020/05/11}{Fix: Labels in \env{eqnarray}.}
+% \begin{macrocode}
+\newcommand*{\LWR@label@inmathcomment}{%
+ \ifboolexpr{bool{mathjax} or ( bool{FormatWP} and bool{WPMarkMath} ) }%
+ {%
+% \end{macrocode}
+% The combined \LaTeX\ \& \HTML\ label is printed in a \cs{mbox} field:%
+% \begin{macrocode}
+ \mbox{%
+% \end{macrocode}
+% Shift the label over to the right side of the environment to avoid
+% over-printing the math:
+% \begin{macrocode}
+ \ifdef{\totwidth@}{\ifbool{LWR@amsmultline}{}{\hspace*{\totwidth@}}}{}%
+% \end{macrocode}
+% Temporarily end the \HTML\ comment,
+% insert the \LaTeX{} \& \HTML\ label, then
+% resume the \HTML\ comment.
+% \cs{@firstofone} is required to remove extra braces
+% introduced by the \pkg{amsmath} package.)
+% \begin{macrocode}
+ \LWR@htmlclosecomment%
+ \LWR@label@subcreatetag%
+ \LWR@htmlopencomment%
+ }% mbox
+ }% mathjax
+ {%
+ \LWR@label@subcreatetag%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+
+
+
% \begin{macro}{\LWR@label@createtag} \marg{label} \quad
% Creates an \HTML\ id tag.
%
@@ -31488,29 +31717,33 @@ end -- not --version
{}%
{% not lateximage
% \end{macrocode}
-% If not doing a lateximage, create an \HTML\ ID tag:
+% If not doing a lateximage, create an \HTML\ ID tag.
+%
% \changes{v0.47}{2018/01/26}{Fix: Line wrap at \HTML\ hyphen.}
-% (To be factored\dots)
+% \changes{v0.86}{2020/05/11}{Fix: Labels in \env{eqnarray}.}
% \begin{macrocode}
\LWR@sanitize{#1}%
- \ifbool{LWR@doingstartpars}%
- {% pars allowed
- \ifbool{LWR@doingapar}%
- {% par started
- \LWR@htmltag{a \LWR@print@mbox{id="\LWR@sanitized"}}%
- \LWR@htmltag{/a}%
- }% par started
- {% par not started
- \LWR@stoppars%
- \LWR@htmltag{a \LWR@print@mbox{id="\LWR@sanitized"}}%
- \LWR@htmltag{/a}%
- \LWR@startpars%
- }% par not started
- }% pars allowed
- {% pars not allowed
- \LWR@htmltag{a \LWR@print@mbox{id="\LWR@sanitized"}}%
- \LWR@htmltag{/a}%
- }% pars not allowed
+ \ifbool{LWR@insidemathcomment}%
+ {% inside HTML math comment
+ \LWR@label@inmathcomment%
+ }% inside HTML math comment
+ {% not inside HTML math comment
+ \ifbool{LWR@doingstartpars}%
+ {% pars allowed
+ \ifbool{LWR@doingapar}%
+ {% par started
+ \LWR@label@subcreatetag%
+ }% par started
+ {% par not started
+ \LWR@stoppars%
+ \LWR@label@subcreatetag%
+ \LWR@startpars%
+ }% par not started
+ }% pars allowed
+ {% pars not allowed
+ \LWR@label@subcreatetag%
+ }% pars not allowed
+ }% not inside HTML math comment
}% not lateximage
}
% \end{macrocode}
@@ -31627,7 +31860,10 @@ end -- not --version
{%
\ifthenelse{\cnttest{\LWR@lateximagedepthref{#1}}{>}{0}}%
{%
- \LWR@ImagesName\LWR@lateximagenumberref{#1}%
+% \end{macrocode}
+% \changes{v0.86}{2020/05/11}{Fixed: \cs{label} inside \env{lateximage}.}
+% \begin{macrocode}
+ lateximage-\BaseJobname-\LWR@lateximagenumberref{#1}%
}%
{%
\LWR@traceinfo{LWR@startref D3}%
@@ -31892,7 +32128,7 @@ end -- not --version
-% \begin{macro}{\href} \oarg{options} \marg{URL}
+% \begin{macro}{\LWR@href} \oarg{options} \marg{URL}
%
% Create a link with accompanying text:
%
@@ -31900,6 +32136,7 @@ end -- not --version
% \changes{v0.49}{2018/02/18}{Fix: Adapt to classes.}
% \changes{v0.52}{2018/03/26}{Fix: \progcode{\#}, \progcode{\%}, \progcode{\&}, \progcode{\~}, \progcode{\_} in \URL.}
% \changes{v0.57}{2018/06/05}{Fix: Text catcodes.}
+% \changes{v0.86}{2020/05/07}{\pkg{hyperref}: Adjusted emulation.}
% \begin{macrocode}
\DeclareDocumentCommand{\LWR@hrefb}{O{} m}{%
\LWR@ensuredoingapar%
@@ -31908,7 +32145,7 @@ end -- not --version
\LWR@subhyperreftext%
}
-\newrobustcmd*{\href}{%
+\newrobustcmd*{\LWR@href}{%
\begingroup%
\LWR@linkcatcodes%
\LWR@hrefb%
@@ -31916,12 +32153,13 @@ end -- not --version
% \end{macrocode}
% \end{macro}
-% \begin{macro}{\nolinkurl} \marg{URL}
+% \begin{macro}{\LWR@nolinkurl} \marg{URL}
%
% Print the name of the link without creating the link:
% \changes{v0.43}{2017/10/31}{Made robust.}
% \changes{v0.45}{2017/12/29}{Fix: Underscore in \URL.}
% \changes{v0.52}{2018/03/26}{Fix: \progcode{\#}, \progcode{\%}, \progcode{\&}, \progcode{\~}, \progcode{\_} in \URL.}
+% \changes{v0.86}{2020/05/07}{\pkg{hyperref}: Adjusted emulation.}
% \begin{macrocode}
\newcommand*{\LWR@nolinkurlb}[1]{%
\LWR@ensuredoingapar%
@@ -31931,7 +32169,7 @@ end -- not --version
\endgroup%
}
-\newrobustcmd*{\nolinkurl}{%
+\newrobustcmd*{\LWR@nolinkurl}{%
\begingroup%
\LWR@linkcatcodes%
\LWR@nolinkurlb%
@@ -31940,7 +32178,7 @@ end -- not --version
% \end{macro}
-% \begin{macro}{\url} \marg{URL}
+% \begin{macro}{\LWR@url} \marg{URL}
%
% Create a link whose text name is the address of the link.
%
@@ -31951,16 +32189,17 @@ end -- not --version
% \changes{v0.45}{2017/12/29}{Improved URLs with underscores.}
% \changes{v0.49}{2018/02/18}{Fix: Adapt to classes.}
% \changes{v0.52}{2018/03/26}{Fix: \progcode{\#}, \progcode{\%}, \progcode{\&}, \progcode{\~}, \progcode{\_} in \URL.}
+% \changes{v0.86}{2020/05/07}{\pkg{hyperref}: Adjusted emulation.}
% \begin{macrocode}
\DeclareDocumentCommand{\LWR@urlb}{m}{%
\LWR@ensuredoingapar%
\def\LWR@templink{#1}%
\@onelevel@sanitize\LWR@templink%
- \href{\LWR@templink}{\LWR@templink}%
+ \LWR@href{\LWR@templink}{\LWR@templink}%
\endgroup%
}
-\newrobustcmd*{\url}{%
+\newrobustcmd*{\LWR@url}{%
\begingroup%
\LWR@linkcatcodes%
\LWR@urlb%
@@ -34006,6 +34245,18 @@ end -- not --version
% \end{macrocode}
+% \DescribeBoolean{LWR@insidemathcomment}
+% True while inside an \HTML\ comment which is displaying a math
+% environment.
+% Used to undo the comment for a moment while creating a \cs{label},
+% so that the label's \HTML\ tags will be seen by \HTML.
+% \changes{v0.86}{2020/05/11}{\bool{LWR@insidemathcomment}: Added.}
+% \begin{macrocode}
+\newbool{LWR@insidemathcomment}
+\boolfalse{LWR@insidemathcomment}
+% \end{macrocode}
+
+
% \DescribeBoolean{LWR@xfakebold}
% True if \pkg{xfakebold} \cs{setBold} is in use.
% \changes{v0.67}{2019/02/17}{\pkg{xfakebold}: Added support.}
@@ -34884,6 +35135,51 @@ end -- not --version
% \end{macrocode}
%
%
+% Determing how to set \brand{MathJax} section and equation numbers.
+% Adjusts for various kinds of \cs{theequation} to determine
+% \cs{theMathJaxsection} and \cs{theMathJaxequation}.
+%
+% \begin{macrocode}
+\newcommand\LWR@article@theequation{\@arabic\c@equation}
+
+\newcommand\LWR@book@theequation
+ {\ifnum \c@chapter>\z@ \thechapter.\fi \@arabic\c@equation}
+
+
+\newcommand\LWR@chapter@theequation{\thechapter.\arabic{equation}}
+\newcommand\LWR@section@thequation{\thesection.\arabic{equation}}
+\newcommand\LWR@subsection@thequation{\thesubsection.\arabic{equation}}
+
+\AtBeginDocument{
+ % default per article class:
+ \newcommand*{\theMathJaxsubequations}{0}
+ \newcommand*{\theMathJaxsection}{}
+ \newcommand*{\theMathJaxequation}{\arabic{equation}}
+
+ \ifdefstrequal{\theequation}{\LWR@article@theequation}
+ {}{
+ \ifdefstrequal{\theequation}{\LWR@book@theequation}{
+ \renewcommand*{\theMathJaxsection}{\ifnum \c@chapter>\z@ \thechapter.\fi}
+ }{
+ \ifdefstrequal{\theequation}{\LWR@subsection@thequation}{
+ \renewcommand*{\theMathJaxsection}{\thesubsection{}.}
+ }{
+ \ifdefstrequal{\theequation}{\LWR@section@thequation}{
+ \renewcommand*{\theMathJaxsection}{\thesection{}.}
+ }{
+ \ifdefstrequal{\theequation}{\LWR@chapter@theequation}{
+ \renewcommand*{\theMathJaxsection}{\thechapter{}.}
+ }{% unknown format
+ \PackageWarningNoLine{lwarp}
+ {%
+ Unknown equation tag format for \protect\theequation.\MessageBreak
+ Article-style equation numbering will be used%
+ }
+ }}}}}
+}
+% \end{macrocode}
+%
+%
%
% \begin{macro}{\LWR@syncmathjax} Sets the \brand{MathJax} equation format
% and number for the following equations.
@@ -34893,44 +35189,35 @@ end -- not --version
% \begin{macrocode}
\newcommand*{\LWR@syncmathjax}{%
% \end{macrocode}
-% If using chapters, place the chapter number in front of the equation.
-% Otherwise, use the simple equation number.
-% \changes{v0.82}{2020/03/09}{Removed \element{par} tags.}
-% \begin{macrocode}
- \ifcsdef{thechapter}{
- \LWR@stoppars%
- \InlineClass{hidden}{
- \textbackslash(
- \textbackslash{}seteqsection \{\thechapter\}
- \textbackslash)
- }
- \LWR@startpars%
- }
- {}% not using chapters
-% \end{macrocode}
-% \brand{MathJax} doesn't allow setting the equation number to 1:
-% \begin{macrocode}
- \ifthenelse{\cnttest{\value{equation}}>0}
- {
-% \end{macrocode}
-% Tell \brand{MathJax} that the next set of equations begins with the current \LaTeX{} equation
-% number, plus one.
-% \begin{macrocode}
- \setcounter{LWR@nextequation}{\value{equation}}
- \addtocounter{LWR@nextequation}{1}
-% \end{macrocode}
+%
+% Tell \brand{MathJax} that the next equation number is
+% the current \LaTeX{} equation number.
+%
+% Before each equation, \pkg{lwarp} inserts into the \HTML\ code:
+% \begin{sourceverb}
+% \seteqnumber{subequations?}{section}{number}
+% \end{sourceverb}
+% \begin{description}
+% \item [|subequations?|] is |0| usually, |1| if inside \pkg{amsmath} \env{subequations}.
+% \item [|section|] is a string printed as-is, or empty.
+% \item [|number|] is auto-incremented by \brand{MathJax} between equations.
+% \end{description}
+%
% Place the \brand{MathJax} command inside ``\cs{(}'' and ``\cs{)}'' characters,
% to be printed to \HTML, not interpreted by \LaTeX.
% \changes{v0.82}{2020/03/09}{Removed \element{par} tags.}
+% \changes{v0.86}{2020/05/08}{Improved \brand{MathJax} equation numbers.}
% \begin{macrocode}
\LWR@stoppars%
\InlineClass{hidden}{
- \textbackslash(
- \textbackslash{}seteqnumber \{\arabic{LWR@nextequation}\}
- \textbackslash)
+ \textbackslash(%
+ \textbackslash{}seteqnumber%
+ \{\theMathJaxsubequations\}%
+ \{\theMathJaxsection\}%
+ \{\theMathJaxequation\}%
+ \textbackslash)%
}
\LWR@startpars%
- }{}% not eq > 0
}
% \end{macrocode}
% \end{macro}
@@ -34958,6 +35245,7 @@ end -- not --version
% restore various commands to their \LaTeX\ meanings.
% \begin{macrocode}
\LWR@restoreorigformatting
+ \booltrue{LWR@insidemathcomment}
% \end{macrocode}
% ^^A When a label is encountered, the \HTML\ comment is closed,
% ^^A the label is generated in an \HTML-output context,
@@ -34977,6 +35265,7 @@ end -- not --version
% Close the \HTML\ comment and resume \HTML\ paragraph handling:
% \begin{macrocode}
\LWR@htmlclosecomment
+ \boolfalse{LWR@insidemathcomment}
\LWR@startpars
}
% \end{macrocode}
@@ -35336,55 +35625,6 @@ end -- not --version
% \end{macrocode}
-% \begin{macro}{\LWR@htmlmathlabel} \marg{label}
-% \gindex{label>math environment}
-%
-% \pkg{lwarp} points \cs{ltx@label} here.
-% This is used by \cs{label} when inside a
-% \LaTeX\ AMS math environment's math display environment.
-%
-% \cs{LWR@origltx@label} points to the \LaTeX\ original,
-% modified by \pkg{lwarp}, then by \pkg{amsmath},
-% then by \pkg{cleveref}.
-% \begin{macrocode}
-\newcommand*{\LWR@htmlmathlabel}[1]{%
- \LWR@traceinfo{LWR@htmlmathlabelb #1}%
-% \end{macrocode}
-% If |mathjax| or |FormatWP|, print the \LaTeX\ expression:
-% \changes{v0.42}{2017/10/26}{If \progcode{FormatWP} print LaTeX expression.}
-% \begin{macrocode}
- \ifboolexpr{bool{mathjax} or ( bool{FormatWP} and bool{WPMarkMath} ) }%
- {%
-% \end{macrocode}
-% The combined \LaTeX\ \& \HTML\ label is printed in a \cs{text} field:
-% \begin{macrocode}
- \text{%
-% \end{macrocode}
-% Shift the label over to the right side of the environment to avoid
-% over-printing the math:
-% \begin{macrocode}
- \ifbool{LWR@amsmultline}{}{\hspace*{\totwidth@}}%
-% \end{macrocode}
-% Temporarily end the \HTML\ comment,
-% insert the \LaTeX{} \& \HTML\ label, then
-% resume the \HTML\ comment.
-% \cs{@firstofone} is required to remove extra braces
-% introduced by the \pkg{amsmath} package.)
-% \begin{macrocode}
- \LWR@htmlclosecomment%
- \LWR@origltx@label{#1}%
- \LWR@htmlopencomment%
- }% text
- }% mathjax
- {%
- \LWR@origltx@label{#1}%
- }%
-}
-% \end{macrocode}
-% \end{macro}
-
-
-
% \begin{macro}{\LWR@beginhideamsmath}
% Starts hiding \LaTeX\ math inside an \HTML\ comment.
% \begin{macrocode}
@@ -35395,6 +35635,7 @@ end -- not --version
\begingroup
\LWR@restoreorigformatting
+ \booltrue{LWR@insidemathcomment}
}
% \end{macrocode}
% \end{macro}
@@ -35406,6 +35647,7 @@ end -- not --version
\endgroup
\LWR@htmlclosecomment
+ \boolfalse{LWR@insidemathcomment}
\LWR@orignewline
\LWR@startpars
}
@@ -35422,8 +35664,8 @@ end -- not --version
% \changes{v0.34}{2017/07/29}{Fix: Added the \env{eqnarray} environments.}
%
% The \pkg{amsmath} environments already collect their contents
-% in \cs{@envbody} for further processing. \env{eqnarray} is not an \AmS\ package,
-% and thus requires special handling.
+% in \cs{@envbody} for further processing.
+% \env{eqnarray} is not an \AmS\ package, and thus requires special handling.
%
% For \SVG\ math: Each envrionment is encapsulated inside a \env{lateximage} environment,
% along with a special optional argument of \cs{LWR@amsmathbody}
@@ -39121,14 +39363,14 @@ color:\LWR@origpound\LWR@tempcolor%
\begin{warpHTML}
% \end{macrocode}
-% \begin{macro}{\phantomsection}
+% \begin{macro}{\LWR@phantomsection}
% Emulate the \pkg{hyperref} \cs{phantomsection} command,
% often used to insert the bibliography into the table of contents.
% Ignores \cs{ForceHTMLTOC}.
% \changes{v0.55}{2018/04/26}{Fix: \cs{ForceHTMLTOC} with \cs{phantomsection}.}
+% \changes{v0.86}{2020/05/07}{\pkg{hyperref}: Adjusted emulation.}
% \begin{macrocode}
-\newcounter{LWR@phantomsection}
-\DeclareDocumentCommand{\phantomsection}{}{%
+\newrobustcmd*{\LWR@phantomsection}{%
\begingroup%
\boolfalse{LWR@forcinghtmltoc}%
\section*{}%
@@ -39758,9 +40000,6 @@ color:\LWR@origpound\LWR@tempcolor%
environments to force SVG output}
\LWR@mathjaxwarn{jkmath}{}
\LWR@mathjaxwarn{mathspec}{}
- \LWR@mathjaxwarn{mathtools}
- {Avoid starred macros.\MessageBreak
- See the Lwarp manual for other limitations}
\LWR@mathjaxwarn{multirow}
{Multirow works as expected in text mode, but\MessageBreak
limited emulation is provided for MathJax math.\MessageBreak
@@ -39770,8 +40009,8 @@ color:\LWR@origpound\LWR@tempcolor%
{Enclose its uses inside lateximage environments\MessageBreak
to force SVG output}
\LWR@mathjaxwarn{physics}
- {The third-party extension is not yet used.\MessageBreak
- Avoid starred macros and automatic delimiters.\MessageBreak
+ {The third-party extension is not used.\MessageBreak
+ Avoid automatic delimiters.\MessageBreak
Use all mandatory arguments, adding empty as needed.\MessageBreak
See the Lwarp manual for details}
\LWR@mathjaxwarn{unicode-math}
@@ -40246,7 +40485,7 @@ color:\LWR@origpound\LWR@tempcolor%
%
% \begin{macrocode}
\newcommand{\alt}[1]{\ThisAltText{#1}}
-\newcommand{\newhref}[3]{\ThisAltText{#2}\href{#1}{#3}}%
+\newcommand{\newhref}[3]{\ThisAltText{#2}\LWR@href{#1}{#3}}%
\providecommand{\thead}[1]{\textbf{#1}}
% \end{macrocode}
%
@@ -41223,7 +41462,7 @@ span style="width:\LWR@printlength{\ALG@thistlm}; display:inline-block;"%
{\LWR@amsmathenv@@after}
% \end{macrocode}
% Clear the single-use \attribute{alt} text:
-% \changes{v0.74}{2019/08/20}{Add \cs{ThisAltText}.}
+% \changes{v0.74}{2019/08/20}{\pkg{amsmath}: Add \cs{ThisAltText}.}
% \begin{macrocode}
\gdef\LWR@ThisAltText{}%
}{}
@@ -41306,7 +41545,7 @@ span style="width:\LWR@printlength{\ALG@thistlm}; display:inline-block;"%
% \begin{environment}{alignat}
-% \changes{v0.51}{2018/03/11}{Fix: Added.}
+% \changes{v0.51}{2018/03/11}{\pkg{amsmath}: Fix: Added.}
% \begin{macrocode}
\BeforeBeginEnvironment{alignat}{\LWR@amsmathenv@before{alignat}}
@@ -41324,6 +41563,16 @@ span style="width:\LWR@printlength{\ALG@thistlm}; display:inline-block;"%
% \end{environment}
%
%
+% \changes{v0.86}{2020/05/08}{\pkg{amsmath}: Added support for \brand{MathJax}.}
+% \begin{macrocode}
+\AtBeginEnvironment{subequations}{
+ \renewcommand*{\theMathJaxsubequations}{1}
+ \renewcommand*{\theMathJaxsection}{\theparentequation}
+ \renewcommand*{\theMathJaxequation}{\arabic{equation}}
+}
+% \end{macrocode}
+%
+%
% For \brand{MathJax}:
% \changes{v0.79}{2020/01/27}{\pkg{amsmath}: Added \brand{MathJax} emulation.}
% \changes{v0.82}{2020/03/14}{\pkg{amsmath}: Fixed: \cs{intertext} for \brand{MathJax}.}
@@ -42239,7 +42488,7 @@ span style="width:\LWR@printlength{\ALG@thistlm}; display:inline-block;"%
% A file annotation becomes a reference:
% \begin{macrocode}
\DeclareRobustCommand{\atfi@insert@file@annot}[1]{%
- \href{#1}{\LWR@attachfile@appearance}%
+ \LWR@href{#1}{\LWR@attachfile@appearance}%
}
% \end{macrocode}
@@ -42337,7 +42586,7 @@ span style="width:\LWR@printlength{\ALG@thistlm}; display:inline-block;"%
% A file annotation becomes a reference:
% \begin{macrocode}
\DeclareRobustCommand{\atfi@insert@file@annot}[1]{%
- \href{#1}{\LWR@attachfile@appearance}%
+ \LWR@href{#1}{\LWR@attachfile@appearance}%
}
% \end{macrocode}
%
@@ -44043,7 +44292,7 @@ span style="width:\LWR@printlength{\ALG@thistlm}; display:inline-block;"%
% \end{macrocode}
%
% \begin{macrocode}
-\LetLtxMacro\burl\url
+\LetLtxMacro\burl\LWR@url
\NewDocumentCommand{\LWR@burlaltb}{O{} +m m}{%
\LWR@ensuredoingapar%
@@ -48449,7 +48698,7 @@ name = \chemmacros_translate:n {scheme-name}
\textcolor{red}{%
#1 is only a provisional stub\\\Large
the Office document
- \ifx\ed@stubURI\@empty{#2}\else\href{\ed@stubURI}{#2}\fi\
+ \ifx\ed@stubURI\@empty{#2}\else\LWR@href{\ed@stubURI}{#2}\fi\
contains more text\\which will be merged for the final document%
}%
\end{center}%
@@ -48509,7 +48758,7 @@ name = \chemmacros_translate:n {scheme-name}
% \credits{Clemens Niederberger}
%
% \DescribePackage{embrac}
-% \pkg{embrac} is nullfied for \HTML\, and used as-is for print.
+% \pkg{embrac} is patched for \HTML\, and used as-is for print.
%
% \changes{v0.65}{2018/12/10}{\pkg{embrac}: Added.}
%
@@ -53246,7 +53495,7 @@ solid {\FancyVerbRuleColor{\LWR@origpound\LWR@tempcolor}} ; % space
% \begin{macrocode}
\renewcommand*{\@p@glossarysection}[2]{%
\glsclearpage
- \phantomsection
+ \LWR@phantomsection
\ifdefempty\@@glossarysecstar
{%
\csname\@@glossarysec\endcsname{#2}%
@@ -53945,7 +54194,7 @@ solid {\FancyVerbRuleColor{\LWR@origpound\LWR@tempcolor}} ; % space
% alt tag, style, and class:
% \begin{macrocode}
\LWR@traceinfo{LWR@includegraphicsb: about to create href}%
- \href{\LWR@parsedfilename}%
+ \LWR@href{\LWR@parsedfilename}%
{% start of href
\LWR@traceinfo{LWR@includegraphicsb: about to LWR@htmltag}%
\LWR@htmltag{\LWR@ig@htmltag}%
@@ -54722,7 +54971,7 @@ solid {\FancyVerbRuleColor{\LWR@origpound\LWR@tempcolor}} ; % space
% \section{hyperref}
%
-% \credits{Sebastian Rahtz, Heiko Oberdiek}
+% \credits{Sebastian Rahtz, Heiko Oberdiek, The \LaTeX3 Project}
%
% \DescribePackage{hyperref}
% \pkg{hyperref} is emulated.
@@ -54741,6 +54990,7 @@ do not attempt to patch lwarp's version of `hyperref'.)\MessageBreak}
\DeclareOption*{}
% \end{macrocode}
+%
% \changes{v0.68}{2019/02/28}{\pkg{hyperref}: Fix for options with braces.}
% \begin{macrocode}
% \ProcessOptions\relax
@@ -54749,6 +54999,15 @@ do not attempt to patch lwarp's version of `hyperref'.)\MessageBreak}
\@process@ptions\relax% from the original \ProcessOptions
% \end{macrocode}
+% \changes{v0.86}{2020/05/07}{\pkg{hyperref}: Adjusted emulation.}
+% \begin{macrocode}
+\LetLtxMacro\href\LWR@href
+\LetLtxMacro\nolinkurl\LWR@nolinkurl
+\LetLtxMacro\url\LWR@url
+\LetLtxMacro\phantomsection\LWR@phantomsection
+% \end{macrocode}
+
+
% \begin{macrocode}
\newcommand*{\hypersetup}[1]{}
\newcommand*{\hyperbaseurl}[1]{}
@@ -55786,7 +56045,7 @@ do not attempt to patch lwarp's version of `hyperref'.)\MessageBreak}
%
% \begin{macrocode}
\NewDocumentCommand{\attachandlink}{o m o m m}{%
- \href{#2}{#5}%
+ \LWR@href{#2}{#5}%
}
% \end{macrocode}
%
@@ -55819,8 +56078,10 @@ do not attempt to patch lwarp's version of `hyperref'.)\MessageBreak}
\LWR@ProvidesPackagePass{karnaugh-map}[2017/02/20]
% \end{macrocode}
%
-% (It is hard to patch this macro, so the entire thing is redefined here,
-% with the \pkg{lwarp} modifications identified in comments.)
+% This patch is needed only because \pkg{lwarp} changes the definition of \cs{\&},
+% and the original uses \cs{ifnum} to compare |0| with \cs{\&}.
+% It is hard to patch this environment, so the entire thing is redefined here,
+% with the \pkg{lwarp} modifications identified in comments.
%
% \begin{macrocode}
\RenewDocumentEnvironment{karnaugh-map}{s O{4} O{4} O{1} O{$X_1X_0$} O{$X_3X_2$} O{$X_5X_4$}} {%
@@ -58000,7 +58261,7 @@ do not attempt to patch lwarp's version of `hyperref'.)\MessageBreak}
\let\LWRTODONOTES@orig@todototoc\todototoc
\renewcommand*{\todototoc}{%
-\phantomsection%
+\LWR@phantomsection%
\LWRTODONOTES@orig@todototoc%
}
@@ -58926,38 +59187,104 @@ do not attempt to patch lwarp's version of `hyperref'.)\MessageBreak}
\def\LWRAboxed#1&#2&#3!|!{\fbox{\(#1\)}&\fbox{\(#2\)}}
\newcommand{\Aboxed}[1]{\LWRAboxed#1&&!|!}
}
-
+% \end{macrocode}
+%
+% \changes{v0.86}{2020/05/09}{\pkg{mathtools}: Added \cs{ArrowBetweenLines*}.}
+% \begin{macrocode}
\CustomizeMathJax{
- \newcommand{\ArrowBetweenLines}[1][\Updownarrow]{#1}% no starred
+ \newcommand{\LWRABLines}[1][\Updownarrow]{#1 \notag \\}% star/nostar the same
+ \DeclareIfstar{\ArrowBetweenLines}{\LWRABLines}{\LWRABLines}
}
% \end{macrocode}
%
% \changes{v0.85}{2020/05/01}{\pkg{mathtools}: Fixed: \cs{shortintertext}.}
+% \changes{v0.86}{2020/05/09}{\pkg{mathtools}: Added starred delimited macros.}
% \begin{macrocode}
\CustomizeMathJax{\newcommand{\shortintertext}[1]{\text{#1}\notag \\}}
\CustomizeMathJax{\newcommand{\vdotswithin}[1]{\hspace{.5em}\vdots}}
-\CustomizeMathJax{\newcommand{\shortvdotswithin}[1]{ & \hspace{.5em}\vdots \\}}
+% \end{macrocode}
+%
+% \changes{v0.86}{2020/05/09}{\pkg{mathtools}: Added \cs{shortvdotswithin*}.}
+% \begin{macrocode}
+\CustomizeMathJax{\newcommand{\LWRshortvdotswithinstar}[1]{\vdots \hspace{.5em} & \\}}
+\CustomizeMathJax{\newcommand{\LWRshortvdotswithinnostar}[1]{& \hspace{.5em}\vdots \\}}
+\CustomizeMathJax{%
+ \DeclareIfstar{\shortvdotswithin}%
+ {\LWRshortvdotswithinstar}%
+ {\LWRshortvdotswithinnostar}%
+}
+
\CustomizeMathJax{\newcommand{\MTFlushSpaceAbove}{}}
\CustomizeMathJax{\newcommand{\MTFlushSpaceBelow}{\\}}
-% The following does not create a starred version of the macro:
\LetLtxMacro\LWR@mathtools@orig@DeclarePairedDelimiter\DeclarePairedDelimiter
\renewcommand{\DeclarePairedDelimiter}[3]{
\LWR@mathtools@orig@DeclarePairedDelimiter{#1}{#2}{#3}
- \CustomizeMathJax{\newcommand{#1}[2][]{{##1#2##2##1#3}}}
+% starred:
+ \appto\LWR@customizedMathJax{\LWRbackslash(}
+ \appto\LWR@customizedMathJax{%
+ \LWRbackslash{}newcommand\{\LWRbackslash\macrotocsname{#1}LWRsubstar\}%
+ }%
+ \appto\LWR@customizedMathJax{[2][]}%
+ \appto\LWR@customizedMathJax{\{\{}%
+ \LWR@subcustomizedmathjax{##1\left#2##2##1\right#3}%
+ \appto\LWR@customizedMathJax{\}\}}%
+ \appto\LWR@customizedMathJax{\LWRbackslash)\par}%
+% not starred:
+ \appto\LWR@customizedMathJax{\LWRbackslash(}
+ \appto\LWR@customizedMathJax{%
+ \LWRbackslash{}newcommand\{\LWRbackslash\macrotocsname{#1}LWRsubnostar\}%
+ }%
+ \appto\LWR@customizedMathJax{[2][]}%
+ \appto\LWR@customizedMathJax{\{\{}%
+ \LWR@subcustomizedmathjax{##1#2##2##1#3}%
+ \appto\LWR@customizedMathJax{\}\}}%
+ \appto\LWR@customizedMathJax{\LWRbackslash)\par}%
+% user macro:
+ \appto\LWR@customizedMathJax{\LWRbackslash(}
+ \appto\LWR@customizedMathJax{%
+ \LWRbackslash{}DeclareIfstar\{\LWRbackslash{}\macrotocsname{#1}\}%
+ \{\LWRbackslash{}\macrotocsname{#1}LWRsubstar\}%
+ \{\LWRbackslash{}\macrotocsname{#1}LWRsubnostar\}%
+ }%
+ \appto\LWR@customizedMathJax{\LWRbackslash)\par}%
}
\@onlypreamble\DeclareParedDelimiter
% (DeclarePairedDelimiterX is already defined to use \DeclarePairedDelimiterXPP.)
-% The following does not create a starred version of the macro.
\LetLtxMacro\LWR@mathtools@orig@DeclarePairedDelimiterXPP\DeclarePairedDelimiterXPP
\DeclareDocumentCommand{\DeclarePairedDelimiterXPP}{m O{1} m m m m m}{
\LWR@mathtools@orig@DeclarePairedDelimiterXPP{#1}[#2]{#3}{#4}{#5}{#6}{#7}
+% subsubstar, second opt arg
\appto\LWR@customizedMathJax{\LWRbackslash(}%
\appto\LWR@customizedMathJax{%
- \LWRbackslash{}newcommand\{\LWRbackslash\macrotocsname{#1}LWRsub\}%
+ \LWRbackslash{}newcommand\{\LWRbackslash\macrotocsname{#1}LWRsubsubstar\}%
+ }%
+ \appto\LWR@customizedMathJax{[#2]}%
+ \appto\LWR@customizedMathJax{\{\{\LWRbackslash{}left}%
+ \LWR@subcustomizedmathjax{#3#4#7}%
+ \appto\LWR@customizedMathJax{\LWRbackslash{}right}%
+ \LWR@subcustomizedmathjax{#5#6}%
+ \appto\LWR@customizedMathJax{\}\}}%
+ \appto\LWR@customizedMathJax{\LWRbackslash)\par}%
+% substar, first opt arg
+ \appto\LWR@customizedMathJax{\LWRbackslash(}%
+ \appto\LWR@customizedMathJax{%
+ \LWRbackslash{}newcommand\{\LWRbackslash\macrotocsname{#1}LWRsubstar\}[1][]%
+ }%
+ \appto\LWR@customizedMathJax{%
+ \{
+ \LWRbackslash{}def\LWRbackslash{}delimsize\{\#1\}
+ \LWRbackslash\macrotocsname{#1}LWRsubsubstar
+ \}%
+ }%
+ \appto\LWR@customizedMathJax{\LWRbackslash)\par}%
+% subsubnostar, second opt arg
+ \appto\LWR@customizedMathJax{\LWRbackslash(}%
+ \appto\LWR@customizedMathJax{%
+ \LWRbackslash{}newcommand\{\LWRbackslash\macrotocsname{#1}LWRsubsubnostar\}%
}%
\appto\LWR@customizedMathJax{[#2]}%
\appto\LWR@customizedMathJax{\{\{\LWRbackslash{}delimsize}%
@@ -58966,17 +59293,26 @@ do not attempt to patch lwarp's version of `hyperref'.)\MessageBreak}
\LWR@subcustomizedmathjax{#5#6}%
\appto\LWR@customizedMathJax{\}\}}%
\appto\LWR@customizedMathJax{\LWRbackslash)\par}%
+% subnostar, first opt arg
\appto\LWR@customizedMathJax{\LWRbackslash(}%
\appto\LWR@customizedMathJax{%
- \LWRbackslash{}newcommand\{\LWRbackslash\macrotocsname{#1}\}[1][]%
+ \LWRbackslash{}newcommand\{\LWRbackslash\macrotocsname{#1}LWRsubnostar\}[1][]%
}%
\appto\LWR@customizedMathJax{%
\{
\LWRbackslash{}def\LWRbackslash{}delimsize\{\#1\}
- \LWRbackslash\macrotocsname{#1}LWRsub
+ \LWRbackslash\macrotocsname{#1}LWRsubsubnostar
\}%
}%
\appto\LWR@customizedMathJax{\LWRbackslash)\par}%
+% user macro:
+ \appto\LWR@customizedMathJax{\LWRbackslash(}
+ \appto\LWR@customizedMathJax{%
+ \LWRbackslash{}DeclareIfstar\{\LWRbackslash{}\macrotocsname{#1}\}%
+ \{\LWRbackslash{}\macrotocsname{#1}LWRsubstar\}%
+ \{\LWRbackslash{}\macrotocsname{#1}LWRsubnostar\}%
+ }%
+ \appto\LWR@customizedMathJax{\LWRbackslash)\par}%
}
\@onlypreamble\DeclareParedDelimiterXPP
\@onlypreamble\DeclareParedDelimiterX
@@ -61832,16 +62168,21 @@ do not attempt to patch lwarp's version of `nameref'.)\MessageBreak
\begin{warpMathJax}
% \end{macrocode}
%
-% \changes{v0.85}{2020/05/01}{\pkg{mathtools}: Fixed: \cs{shortintertext}.}
% \begin{macrocode}
\CustomizeMathJax{\renewcommand{\intertext}[2][]{\text{#2}\notag \\}}
-% \end{macrocode}
-% \begin{macrocode}
\CustomizeMathJax{\newenvironment{fleqn}[1][]{}{}}
\CustomizeMathJax{\newenvironment{ceqn}{}{}}
\CustomizeMathJax{\newenvironment{darray}[2][c]{\begin{array}[#1]{#2}}{\end{array}}}
\CustomizeMathJax{\newcommand{\dmulticolumn}[3]{#3}}
-\CustomizeMathJax{\newcommand{\nr}{\\[.5ex]}}
+% \end{macrocode}
+%
+% As of v0.86, \brand{MathJax} v3 does not offer \cs{\textbackslash*}, so
+% the unstarred version is used here.
+% \changes{v0.86}{2020/05/10}{\pkg{nccmath}: Fixed \cs{nr}, added starred.}
+% \begin{macrocode}
+\CustomizeMathJax{\newcommand{\LWRnrnostar}[1][0.5ex]{\\[#1]}}
+\CustomizeMathJax{\DeclareIfstar{\nr}{\LWRnrnostar}{\LWRnrnostar}}
+
\CustomizeMathJax{\newcommand{\mrel}[1]{\begin{aligned}#1\end{aligned}}}
\CustomizeMathJax{\newcommand{\underrel}[2]{{#1}_{#2}}}
\CustomizeMathJax{\newcommand{\medmath}[1]{#1}}
@@ -61851,6 +62192,16 @@ do not attempt to patch lwarp's version of `nameref'.)\MessageBreak
\CustomizeMathJax{\newcommand{\mfrac}[2]{\frac{#1}{#2}}}
\CustomizeMathJax{\newcommand{\mbinom}[2]{\binom{#1}{#2}}}
\CustomizeMathJax{\newenvironment{mmatrix}{\begin{matrix}}{\end{matrix}}}
+% \end{macrocode}
+%
+% \changes{v0.86}{2020/05/10}{\pkg{nccmath}: Added \cs{displaybreak}.}
+% \begin{macrocode}
+\CustomizeMathJax{\newcommand{\displaybreak}[1][]{}}
+% \end{macrocode}
+%
+% \cs{eq}, \cs{eqs}, \cs{eqalign} are created by \LaTeX, not \brand{MathJax}.
+%
+% \begin{macrocode}
\end{warpMathJax}
% \end{macrocode}
%
@@ -64089,8 +64440,6 @@ do not attempt to patch lwarp's version of `nameref'.)\MessageBreak
\end{warpMathJax}
% \end{macrocode}
%
-%
-%
% \iffalse
%</parnotes>
% \fi
@@ -65013,6 +65362,7 @@ remember to convert PDF images to SVG using 'lwarpmk pdftosvg *-fig.pdf',
% \limitsphysics
%
% \changes{v0.79}{2020/01/29}{\pkg{physics}: Added.}
+% \changes{v0.86}{2020/05/09}{\pkg{physics}: Added starred macros.}
%
% \codehtml
%
@@ -65032,46 +65382,86 @@ remember to convert PDF images to SVG using 'lwarpmk pdftosvg *-fig.pdf',
\CustomizeMathJax{\newcommand{\vqty}[1]{\left\vert#1\right\rvert}}
\CustomizeMathJax{\newcommand{\Bqty}[1]{\left\lbrace#1\right\rbrace}}
-% doesn't work with \big, etc., no star
-\CustomizeMathJax{\newcommand{\absolutevalue}[1]{\left\lvert#1\right\rvert}}
+% doesn't work with \big, etc.
+\CustomizeMathJax{\newcommand{\LWRabsolutevaluenostar}[1]{\left\lvert#1\right\rvert}}
+\CustomizeMathJax{\newcommand{\LWRabsolutevaluestar}[1]{\lvert#1\rvert}}
+\CustomizeMathJax{%
+ \DeclareIfstar{\absolutevalue}{\LWRabsolutevaluestar}{\LWRabsolutevaluenostar}%
+}
+
\CustomizeMathJax{\let\abs\absolutevalue}
-% doesn't work with \big, etc., no star
-\CustomizeMathJax{\newcommand{\norm}[1]{%
- \left\lvert\left\lvert#1\right\rvert\right\rvert}%
+% doesn't work with \big, etc.
+\CustomizeMathJax{%
+ \newcommand{\LWRnormnostar}[1]{\left\lvert\left\lvert#1\right\rvert\right\rvert}%
+}
+\CustomizeMathJax{\newcommand{\LWRnormstar}[1]{\lvert\lvert#1\rvert\rvert}}
+\CustomizeMathJax{%
+ \DeclareIfstar{\norm}{\LWRnormstar}{\LWRnormnostar}%
+}
+
+% doesn't work with \big, etc., no paren or bracket
+\CustomizeMathJax{\newcommand{\LWRevaluatednostar}[1]{\left . #1\right\vert}}
+\CustomizeMathJax{\newcommand{\LWRevaluatedstar}[1]{#1\vert}}
+\CustomizeMathJax{%
+ \DeclareIfstar{\evaluated}{\LWRevaluatedstar}{\LWRevaluatednostar}%
}
-% doesn't work with \big, etc., no star, no paren or bracket
-\CustomizeMathJax{\newcommand{\evaluated}[1]{#1\vert}}
\CustomizeMathJax{\let\eval\evaluated}
-% no \Big, star
-\CustomizeMathJax{\newcommand{\order}[1]{\mathcal{O}\left(#1\right)}}
+% no \Big
+\CustomizeMathJax{\newcommand{\LWRordernostar}[1]{\mathcal{O}\left(#1\right)}}
+\CustomizeMathJax{\newcommand{\LWRorderstar}[1]{\mathcal{O}(#1)}}
+\CustomizeMathJax{%
+ \DeclareIfstar{\order}{\LWRorderstar}{\LWRordernostar}%
+}
+
+% no \Big
+\CustomizeMathJax{\newcommand{\LWRcommutatornostar}[2]{\left\lbrack#1,#2\right\rbrack}}
+\CustomizeMathJax{\newcommand{\LWRcommutatorstar}[2]{\lbrack#1,#2\rbrack}}
+\CustomizeMathJax{%
+ \DeclareIfstar{\commutator}{\LWRcommutatorstar}{\LWRcommutatornostar}%
+}
-% no \Big, star
-\CustomizeMathJax{\newcommand{\commutator}[2]{\left\lbrack#1,#2\right\rbrack}}
\CustomizeMathJax{\let\comm\commutator}
-% no \Big, star
-\CustomizeMathJax{\newcommand{\anticommutator}[2]{%
+% no \Big
+\CustomizeMathJax{\newcommand{\LWRanticommutatornostar}[2]{%
\left\lbrace#1,#2\right\rbrace}%
}
+\CustomizeMathJax{\newcommand{\LWRanticommutatorstar}[2]{%
+ \lbrace#1,#2\rbrace}%
+}
+\CustomizeMathJax{%
+ \DeclareIfstar{\anticommutator}{\LWRanticommutatorstar}{\LWRanticommutatornostar}%
+}
+
\CustomizeMathJax{\let\acomm\anticommutator}
-% no \Big, star
+% no \Big
\CustomizeMathJax{\let\poissonbracket\anticommutator}
\CustomizeMathJax{\let\pb\anticommutator}
-% no star
-\CustomizeMathJax{\newcommand{\vectorbold}[1]{\mathbf{#1}}}
+\CustomizeMathJax{\newcommand{\LWRvectorboldnostar}[1]{\mathbf{#1}}}
+\CustomizeMathJax{\newcommand{\LWRvectorboldstar}[1]{\pmb{#1}}}
+\CustomizeMathJax{%
+ \DeclareIfstar{\vectorbold}{\LWRvectorboldstar}{\LWRvectorboldnostar}%
+}
\CustomizeMathJax{\let\vb\vectorbold}
-% no star
-\CustomizeMathJax{\newcommand{\vectorarrow}[1]{\vec{\mathbf{#1}}}}
+\CustomizeMathJax{\newcommand{\LWRvectorarrownostar}[1]{\vec{\mathbf{#1}}}}
+\CustomizeMathJax{\newcommand{\LWRvectorarrowstar}[1]{\vec{\pmb{#1}}}}
+\CustomizeMathJax{%
+ \DeclareIfstar{\vectorarrow}{\LWRvectorarrowstar}{\LWRvectorarrownostar}%
+}
\CustomizeMathJax{\let\va\vectorarrow}
% no star
-\CustomizeMathJax{\newcommand{\vectorunit}[1]{\mathbf{\hat{#1}}}}
+\CustomizeMathJax{\newcommand{\LWRvectorunitnostar}[1]{\mathbf{\hat{#1}}}}
+\CustomizeMathJax{\newcommand{\LWRvectorunitstar}[1]{\pmb{\hat{#1}}}}
+\CustomizeMathJax{%
+ \DeclareIfstar{\vectorunit}{\LWRvectorunitstar}{\LWRvectorunitnostar}%
+}
\CustomizeMathJax{\let\va\vectorunit}
\CustomizeMathJax{\newcommand{\dotproduct}{\boldsymbol\cdot}}
@@ -65171,89 +65561,229 @@ remember to convert PDF images to SVG using 'lwarpmk pdftosvg *-fig.pdf',
\CustomizeMathJax{\newcommand{\Re}[1]{\mathrm{Re}\left\lbrace#1\right\rbrace}}
\CustomizeMathJax{\newcommand{\Im}[1]{\mathrm{Im}\left\lbrace#1\right\rbrace}}
-\CustomizeMathJax{\newcommand{\qqtext}[1]{\quad\mathrm{#1}\quad}}
+\CustomizeMathJax{\newcommand{\LWRqqtextnostar}[1]{\quad\mathrm{#1}\quad}}
+\CustomizeMathJax{\newcommand{\LWRqqtextstar}[1]{\mathrm{#1}\quad}}
+\CustomizeMathJax{\DeclareIfstar{\qqtext}{\LWRqqtextstar}{\LWRqqtextnostar}}
\CustomizeMathJax{\let\qq\qqtext}
+
\CustomizeMathJax{\newcommand{\qqcomma}{\text{,}\quad}}
\CustomizeMathJax{\let\qc\qqcomma}
-\CustomizeMathJax{\newcommand{\qcc}{\quad\text{c.c.}\quad}}
-\CustomizeMathJax{\let\qcc}
-\CustomizeMathJax{\newcommand{\qif}{\quad\text{if}\quad}}
-\CustomizeMathJax{\newcommand{\qthen}{\quad\text{then}\quad}}
-\CustomizeMathJax{\newcommand{\qelse}{\quad\text{else}\quad}}
-\CustomizeMathJax{\newcommand{\qotherwise}{\quad\text{otherwise}\quad}}
-\CustomizeMathJax{\newcommand{\qunless}{\quad\text{unless}\quad}}
-\CustomizeMathJax{\newcommand{\qgiven}{\quad\text{given}\quad}}
-\CustomizeMathJax{\newcommand{\qusing}{\quad\text{using}\quad}}
-\CustomizeMathJax{\newcommand{\qassume}{\quad\text{assume}\quad}}
-\CustomizeMathJax{\newcommand{\qsince}{\quad\text{since}\quad}}
-\CustomizeMathJax{\newcommand{\qlet}{\quad\text{let}\quad}}
-\CustomizeMathJax{\newcommand{\qfor}{\quad\text{for}\quad}}
-\CustomizeMathJax{\newcommand{\qall}{\quad\text{all}\quad}}
-\CustomizeMathJax{\newcommand{\qeven}{\quad\text{even}\quad}}
-\CustomizeMathJax{\newcommand{\qodd}{\quad\text{odd}\quad}}
-\CustomizeMathJax{\newcommand{\qinteger}{\quad\text{integer}\quad}}
-\CustomizeMathJax{\newcommand{\qand}{\quad\text{and}\quad}}
-\CustomizeMathJax{\newcommand{\qor}{\quad\text{or}\quad}}
-\CustomizeMathJax{\newcommand{\qas}{\quad\text{as}\quad}}
-\CustomizeMathJax{\newcommand{\qin}{\quad\text{in}\quad}}
+
+% \LWR@physics@qtext{\name}{text}
+\newcommand*{\LWR@physics@qtext}[2]{%
+% nostar:
+ \appto\LWR@customizedMathJax{\LWRbackslash(}
+ \appto\LWR@customizedMathJax{%
+ \LWRbackslash{}newcommand\{\LWRbackslash{}LWR\macrotocsname{#1}subnostar\}%
+ }%
+ \appto\LWR@customizedMathJax{\{}%
+ \appto\LWR@customizedMathJax{%
+ \LWRbackslash{}quad\LWRbackslash{}text\{#2\}\LWRbackslash{}quad%
+ }%
+ \appto\LWR@customizedMathJax{\}}%
+ \appto\LWR@customizedMathJax{\LWRbackslash)\par}%
+% star:
+ \appto\LWR@customizedMathJax{\LWRbackslash(}
+ \appto\LWR@customizedMathJax{%
+ \LWRbackslash{}newcommand\{\LWRbackslash{}LWR\macrotocsname{#1}substar\}%
+ }%
+ \appto\LWR@customizedMathJax{\{}%
+ \appto\LWR@customizedMathJax{\LWRbackslash{}text\{#2\}\LWRbackslash{}quad}%
+ \appto\LWR@customizedMathJax{\}}%
+ \appto\LWR@customizedMathJax{\LWRbackslash)\par}%
+% user macro:
+ \appto\LWR@customizedMathJax{\LWRbackslash(}
+ \appto\LWR@customizedMathJax{%
+ \LWRbackslash{}DeclareIfstar\{\LWRbackslash\macrotocsname{#1}\}%
+ }%
+ \appto\LWR@customizedMathJax{\{}%
+ \appto\LWR@customizedMathJax{\LWRbackslash{}LWR\macrotocsname{#1}substar\}}%
+ \appto\LWR@customizedMathJax{\LWRbackslash{}LWR\macrotocsname{#1}subnostar\}}%
+ \appto\LWR@customizedMathJax{\LWRbackslash)\par}%
+}
+
+\LWR@physics@qtext{\qcc}{c.c.}
+\LWR@physics@qtext{\qif}{if}
+\LWR@physics@qtext{\qthen}{then}
+\LWR@physics@qtext{\qelse}{else}
+\LWR@physics@qtext{\qotherwise}{otherwise}
+\LWR@physics@qtext{\qunless}{unless}
+\LWR@physics@qtext{\qgiven}{given}
+\LWR@physics@qtext{\qusing}{using}
+\LWR@physics@qtext{\qassume}{assume}
+\LWR@physics@qtext{\qsince}{since}
+\LWR@physics@qtext{\qlet}{let}
+\LWR@physics@qtext{\qfor}{for}
+\LWR@physics@qtext{\qall}{all}
+\LWR@physics@qtext{\qeven}{even}
+\LWR@physics@qtext{\qodd}{odd}
+\LWR@physics@qtext{\qinteger}{integer}
+\LWR@physics@qtext{\qand}{and}
+\LWR@physics@qtext{\qor}{or}
+\LWR@physics@qtext{\qas}{as}
+\LWR@physics@qtext{\qin}{in}
+
\CustomizeMathJax{\newcommand{\differential}[1][]{\text{d}^{#1}}}
\CustomizeMathJax{\let\dd\differential}
-\CustomizeMathJax{\newcommand{\derivative}[3][]{%
+
+\CustomizeMathJax{\newcommand{\LWRderivativenostar}[3][]{%
\frac{\text{d}^{#1}#2}{\text{d}#3^{#1}}}%
}
+\CustomizeMathJax{\newcommand{\LWRderivativestar}[3][]{%
+ {\text{d}^{#1}#2}/{\text{d}#3^{#1}}}%
+}
+\CustomizeMathJax{%
+ \DeclareIfstar{\derivative}{\LWRderivativestar}{\LWRderivativenostar}%
+}
+
\CustomizeMathJax{\let\dv\derivative}
-\CustomizeMathJax{\newcommand{\partialderivative}[3][]{%
+
+\CustomizeMathJax{\newcommand{\LWRpartialderivativenostar}[3][]{%
\frac{\partial^{#1}#2}{\partial#3^{#1}}}%
}
+\CustomizeMathJax{\newcommand{\LWRpartialderivativestar}[3][]{%
+ {\partial^{#1}#2}/{\partial#3^{#1}}}%
+}
+\CustomizeMathJax{%
+ \DeclareIfstar{\partialderivative}%
+ {\LWRpartialderivativestar}{\LWRpartialderivativenostar}
+}
+
\CustomizeMathJax{\let\pderivative\partialderivative}
\CustomizeMathJax{\let\pdv\partialderivative}
+
\CustomizeMathJax{\newcommand{\variation}{\delta}}
\CustomizeMathJax{\let\var\variation}
% Must provide two mandatory args.
% For the example in the manual with (E-TS), enclose the parens in braces
-\CustomizeMathJax{\newcommand{\functionalderivative}[3][]{%
+\CustomizeMathJax{\newcommand{\LWRfunctionalderivativenostar}[3][]{%
\frac{\delta^{#1}#2}{\delta#3^{#1}}}%
}
+\CustomizeMathJax{\newcommand{\LWRfunctionalderivativestar}[3][]{%
+ {\delta^{#1}#2}/{\delta#3^{#1}}}%
+}
+\CustomizeMathJax{%
+ \DeclareIfstar{\functionalderivative}
+ {\LWRfunctionalderivativestar}{\LWRfunctionalderivativenostar}
+}
\CustomizeMathJax{\let\fdv\functionalderivative}
% use \braket to contract
-\CustomizeMathJax{\newcommand{\bra}[1]{\langle{#1}\rvert}}
-\CustomizeMathJax{\newcommand{\ket}[1]{\lvert{#1}\rangle}}
+\CustomizeMathJax{\newcommand{\LWRbranostar}[1]{\left\langle{#1}\right\rvert}}
+\CustomizeMathJax{\newcommand{\LWRbrastar}[1]{\langle{#1}\rvert}}
+\CustomizeMathJax{\DeclareIfstar{\bra}{\LWRbrastar}{\LWRbranostar}}
+
+\CustomizeMathJax{\newcommand{\LWRketnostar}[1]{\left\lvert{#1}\right\rangle}}
+\CustomizeMathJax{\newcommand{\LWRketstar}[1]{\lvert{#1}\rangle}}
+\CustomizeMathJax{\DeclareIfstar{\ket}{\LWRketstar}{\LWRketnostar}}
% must have two args
-\CustomizeMathJax{\newcommand{\innerproduct}[2]{%
+\CustomizeMathJax{\newcommand{\LWRinnerproductnostar}[2]{%
\left\langle{#1}\middle\vert{#2}\right\rangle}%
}
+\CustomizeMathJax{\newcommand{\LWRinnerproductstar}[2]{%
+ \langle{#1}\vert{#2}\rangle}%
+}
+\CustomizeMathJax{%
+ \DeclareIfstar{\innerproduct}
+ {\LWRinnerproductstar}{\LWRinnerproductnostar}
+}
+
\CustomizeMathJax{\let\braket\innerproduct}
\CustomizeMathJax{\let\ip\innerproduct}
+
% must have two args
-\CustomizeMathJax{\newcommand{\outerproduct}[2]{%
+\CustomizeMathJax{\newcommand{\LWRouterproductnostar}[2]{%
\left\lvert{#1}\middle\rangle\!\middle\langle#2\right\rvert}%
}
+\CustomizeMathJax{\newcommand{\LWRouterproductstar}[2]{%
+ \lvert{#1}\rangle\!\langle#2\rvert}%
+}
+\CustomizeMathJax{%
+ \DeclareIfstar{\outerproduct}
+ {\LWRouterproductstar}{\LWRouterproductnostar}
+}
+
\CustomizeMathJax{\let\dyad\outerproduct}
\CustomizeMathJax{\let\op\outerproduct}
+
% must have two args, unlike the MathJax version
-\CustomizeMathJax{\newcommand{\expectationvalue}[2]{%
- \left\langle{#2}\middle\vert{#1}\middle\vert{#2}\right\rangle}%
+\CustomizeMathJax{%
+ \newcommand{\LWRexpectationvaluenostar}[2]{%
+ \vphantom{#1}%
+ \left\langle{#2}\middle\vert\smash{#1}\middle\vert{#2}%
+ \right\rangle%
+ }%
+}
+\CustomizeMathJax{%
+ \newcommand{\LWRexpectationvaluestar}[2]{%
+ \vphantom{#1#2}%
+ \left\langle\smash{#2}%
+ \middle\vert\smash{#1}\middle\vert\smash{#2}%
+ \right\rangle%
+ }%
+}
+\CustomizeMathJax{%
+ \newcommand{\LWRexpectationvaluedoublestar}[2]{%
+ \left\langle{#2}\middle\vert{#1}\middle\vert{#2}\right\rangle%
+ }%
}
+\CustomizeMathJax{% second star
+ \DeclareIfstar{\LWRsubexpectationvalue}
+ {\LWRexpectationvaluedoublestar}{\LWRexpectationvaluestar}
+}
+\CustomizeMathJax{% first star
+ \DeclareIfstar{\expectationvalue}
+ {\LWRsubexpectationvalue}{\LWRexpectationvaluenostar}
+}
+
\CustomizeMathJax{\let\expval\expectationvalue}
\CustomizeMathJax{\let\ev\expectationvalue}
-\CustomizeMathJax{\newcommand{\matrixelement}[3]{%
- \left\langle{#1}\middle\vert{#2}\middle\vert{#3}\right\rangle}%
+
+\CustomizeMathJax{%
+ \newcommand{\LWRmatrixelementnostar}[3]{%
+ \vphantom{#2}\left\langle{#1}\middle\vert\smash{#2}\middle\vert{#3}\right\rangle%
+ }%
+}
+\CustomizeMathJax{%
+ \newcommand{\LWRmatrixelementstar}[3]{%
+ \vphantom{#1#2#3}%
+ \left\langle\smash{#1}%
+ \middle\vert\smash{#2}\middle\vert\smash{#3}%
+ \right\rangle%
+ }%
+}
+\CustomizeMathJax{%
+ \newcommand{\LWRmatrixelementdoublestar}[3]{%
+ \left\langle{#1}\middle\vert{#2}\middle\vert{#3}\right\rangle%
+ }%
+}
+\CustomizeMathJax{% second star
+ \DeclareIfstar{\LWRsubmatrixelement}
+ {\LWRmatrixelementdoublestar}{\LWRmatrixelementstar}
+}
+
+\CustomizeMathJax{% first star
+ \DeclareIfstar{\matrixelement}
+ {\LWRsubmatrixelement}{\LWRmatrixelementnostar}
}
+
\CustomizeMathJax{\let\mel\matrixelement}
+
\CustomizeMathJax{\newcommand{\matrixquantity}[1]{\begin{matrix}#1\end{matrix}}}
\CustomizeMathJax{\let\mqty\matrixquantity}
+
+
\CustomizeMathJax{\newcommand{\pmqty}[1]{\begin{pmatrix}#1\end{pmatrix}}}
\CustomizeMathJax{\newcommand{\Pmqty}[1]{%
\left\lgroup\begin{matrix}#1\end{matrix}\right\rgroup}%
@@ -65285,7 +65815,8 @@ remember to convert PDF images to SVG using 'lwarpmk pdftosvg *-fig.pdf',
\CustomizeMathJax{\newcommand{\identitymatrix}[1]{(\text{imat}\{#1\})}}
\CustomizeMathJax{\let\imat\identitymatrix}
-\CustomizeMathJax{\newcommand{\xmatrix}[3]{(\text{xmat}\{\}\{#2\}\{#3\})}}
+\CustomizeMathJax{\newcommand{\LWRxmatrix}[3]{(\text{xmat}\{\}\{#2\}\{#3\})}}
+\CustomizeMathJax{\DeclareIfstar{\xmatrix}{\LWRxmatrix}{\LWRxmatrix}}
\CustomizeMathJax{\let\xmat\xmatrix}
\CustomizeMathJax{\newcommand{\zeromatrix}[2]{(\text{zmat}\{#1\}\{#2\})}}
@@ -74471,7 +75002,7 @@ remember to convert PDF images to SVG using 'lwarpmk pdftosvg *-fig.pdf',
\let\LWRTODONOTES@orig@todototoc\todototoc
\renewcommand*{\todototoc}{%
-\phantomsection%
+\LWR@phantomsection%
\LWRTODONOTES@orig@todototoc%
}
@@ -75505,7 +76036,7 @@ remember to convert PDF images to SVG using 'lwarpmk pdftosvg *-fig.pdf',
% \codehtml
%
% \begin{macrocode}
-\LetLtxMacro\LWR@url@orig@url\url
+\LetLtxMacro\LWR@url@orig@url\LWR@url
\LWR@ProvidesPackagePass{url}[2013/09/16]
% \end{macrocode}
@@ -76718,9 +77249,11 @@ padding:\LWR@printlength{\fboxsep}%
%
% \changes{v0.57}{2018/06/02}{\pkg{xcolor}: New system for switching print and \HTML\ outputs.}
% \changes{v0.81}{2020/02/28}{\pkg{xcolor}: \cs{textcolor}: Spurrious space.}
+% \changes{v0.86}{2020/05/12}{\pkg{xcolor}: \cs{textcolor}: Fixed for \pkg{babel-french}.}
% \begin{macrocode}
\NewDocumentCommand{\LWR@HTML@textcolor}{o m m}{%
\begingroup%
+\LWR@FBcancel%
\IfValueTF{#1}{%
\color[#1]{#2}%
}{%
@@ -80231,7 +80764,7 @@ height:\LWR@printlength{\LWR@tempheight}%
% \changes{v0.78}{2019/11/07}{\pkg{lwarp-common-multimedia}: Fix links with new LaTeX kernel.}
% \begin{macrocode}
\LWR@startpars
- \href{\LWR@parsedfilename}{#1}
+ \LWR@href{\LWR@parsedfilename}{#1}
\LWR@stoppars
% \end{macrocode}
% Finish.
@@ -80289,7 +80822,7 @@ height:\LWR@printlength{\LWR@tempheight}%
% The poster text inside paragraph tags, along with a reference to the \URL.
% \begin{macrocode}
\LWR@startpars
- \href{#2}{#1}
+ \LWR@href{#2}{#1}
\LWR@stoppars
% \end{macrocode}
% Finish.
@@ -80404,7 +80937,7 @@ height:\LWR@printlength{\LWR@tempheight}%
% \end{macrocode}
% If unknown, create a link to it.
% \begin{macrocode}
- \href{#3}{#2}% unknown format
+ \LWR@href{#3}{#2}% unknown format
}}}}}}}}%
% \end{macrocode}
% Paragraph handling:
diff --git a/macros/latex/contrib/lwarp/lwarp.pdf b/macros/latex/contrib/lwarp/lwarp.pdf
index 44912c4d03..eb7f89a220 100644
--- a/macros/latex/contrib/lwarp/lwarp.pdf
+++ b/macros/latex/contrib/lwarp/lwarp.pdf
Binary files differ
diff --git a/macros/latex/contrib/lwarp/lwarpmk.lua b/macros/latex/contrib/lwarp/lwarpmk.lua
index b2e06788aa..d68a28e32e 100755
--- a/macros/latex/contrib/lwarp/lwarpmk.lua
+++ b/macros/latex/contrib/lwarp/lwarpmk.lua
@@ -2,7 +2,7 @@
-- Copyright 2016-2020 Brian Dunn
-printversion = "v0.85"
+printversion = "v0.86"
requiredconfversion = "2" -- also at *lwarpmk.conf
function printhelp ()