summaryrefslogtreecommitdiff
path: root/macros
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
parent675bcc9067ccef91624a9eca025506a4ce1d37b3 (diff)
CTAN sync 202005130303
Diffstat (limited to 'macros')
-rw-r--r--macros/latex/contrib/anonymous-acm/README.txt (renamed from macros/latex/contrib/anonymous/README.txt)4
-rw-r--r--macros/latex/contrib/anonymous-acm/anonymous-acm.pdf (renamed from macros/latex/contrib/anonymous/anonymous.pdf)bin379745 -> 379921 bytes
-rw-r--r--macros/latex/contrib/anonymous-acm/anonymous-acm.sty (renamed from macros/latex/contrib/anonymous/anonymous.sty)6
-rw-r--r--macros/latex/contrib/anonymous-acm/anonymous-acm.tex (renamed from macros/latex/contrib/anonymous/anonymous.tex)16
-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
-rw-r--r--macros/xetex/latex/xepersian-hm/INSTALL.txt38
-rw-r--r--macros/xetex/latex/xepersian-hm/doc-ligature-xep.pdfbin0 -> 10115 bytes
-rw-r--r--macros/xetex/latex/xepersian-hm/doc-ligature-xephm.pdfbin0 -> 13119 bytes
-rw-r--r--macros/xetex/latex/xepersian-hm/kashida-glyph-example.pdfbin91742 -> 91743 bytes
-rw-r--r--macros/xetex/latex/xepersian-hm/kashida-hrule-example.pdfbin90706 -> 90701 bytes
-rw-r--r--macros/xetex/latex/xepersian-hm/kashida-xep-XB-example.pdfbin78687 -> 78693 bytes
-rw-r--r--macros/xetex/latex/xepersian-hm/xepersian-hm-doc.ltx59
-rw-r--r--macros/xetex/latex/xepersian-hm/xepersian-hm-doc.pdfbin240878 -> 264881 bytes
-rw-r--r--macros/xetex/latex/xepersian-hm/xepersian-hm.dtx301
-rw-r--r--macros/xetex/latex/xepersian-hm/xepersian-hm.pdfbin55239 -> 57525 bytes
18 files changed, 1181 insertions, 482 deletions
diff --git a/macros/latex/contrib/anonymous/README.txt b/macros/latex/contrib/anonymous-acm/README.txt
index 52425830b7..33126a8d3d 100644
--- a/macros/latex/contrib/anonymous/README.txt
+++ b/macros/latex/contrib/anonymous-acm/README.txt
@@ -1,6 +1,6 @@
-The anonymous package for acmart.cls
+The anonymous-acm package for acmart.cls
-The anonymous package allows for the easy anonymization and deanonymization of academic papers that use the official Association of Computing Machinery (ACM) master article template, acmart.cls. The required information for both the anonymous and non-anonymous versions are specified at the time of writing. Anonymization or deanonymization is carried out by simply changing one option and recompiling.
+The anonymous-acm package allows for the easy anonymization and deanonymization of academic papers that use the official Association of Computing Machinery (ACM) master article template, acmart.cls. The required information for both the anonymous and non-anonymous versions are specified at the time of writing. Anonymization or deanonymization is carried out by simply changing one option and recompiling.
Maintained by Brett A. Becker, brett.becker@ucd.ie
diff --git a/macros/latex/contrib/anonymous/anonymous.pdf b/macros/latex/contrib/anonymous-acm/anonymous-acm.pdf
index c3fb9de338..821daee2da 100644
--- a/macros/latex/contrib/anonymous/anonymous.pdf
+++ b/macros/latex/contrib/anonymous-acm/anonymous-acm.pdf
Binary files differ
diff --git a/macros/latex/contrib/anonymous/anonymous.sty b/macros/latex/contrib/anonymous-acm/anonymous-acm.sty
index 173e61a4d4..21964043f6 100644
--- a/macros/latex/contrib/anonymous/anonymous.sty
+++ b/macros/latex/contrib/anonymous-acm/anonymous-acm.sty
@@ -1,4 +1,4 @@
-%% anonymous.sty
+%% anonymous-acm.sty
%% version 1.0 09-May-2020
%% Maintained by Brett A. Becker: brett.becker@ucd.ie
@@ -18,7 +18,7 @@
%% Identification
%% The package identifies itself and the LaTeX version needed
-\ProvidesPackage{anonymous}
+\ProvidesPackage{anonymous-acm}
\NeedsTeXFormat{LaTeX2e}
@@ -28,7 +28,7 @@
% Declare options
\DeclareOption{true}{\AnonConditiontrue}
\DeclareOption{false}{\AnonConditionfalse}
-\DeclareOption*{\PackageWarning{anonymous}{Unknown ‘\CurrentOption’}}
+\DeclareOption*{\PackageWarning{anonymous-acm}{Unknown ‘\CurrentOption’}}
\ProcessOptions\relax
% Anonymous Authors
diff --git a/macros/latex/contrib/anonymous/anonymous.tex b/macros/latex/contrib/anonymous-acm/anonymous-acm.tex
index 71bd2a1978..7c7a3e0411 100644
--- a/macros/latex/contrib/anonymous/anonymous.tex
+++ b/macros/latex/contrib/anonymous-acm/anonymous-acm.tex
@@ -1,4 +1,4 @@
-%% documentation for anonymous.sty
+%% documentation for anonymous-acm.sty
%% version 1.0 09-May-2020
%% Maintained by Brett A. Becker brett.becker@ucd.ie
@@ -20,9 +20,9 @@
\setcopyright{rightsretained}
-\usepackage[false]{anonymous}
+\usepackage[false]{anonymous-acm}
-\title{The anonymous Package for the ACM \LaTeX~ Master Article Template}
+\title{The anonymous-acm Package for the ACM \LaTeX~ Master Article Template}
\subtitle{Version 1.0: May 09, 2020}
\authoranon{
@@ -74,7 +74,7 @@ Academics often need to submit anonymous versions of their papers for peer-revie
%\tableofcontents
\section{Introduction}
-The anonymous package allows for the easy anonymization and deanonymization of academic papers. The required information for both the anonymous and non-anonymous versions of the paper are specified at the time of writing. It is made to be used with the official Association of Computing Machinery (ACM) master article template for \LaTeX~ as described in Section \ref{sec:reqs}. This pdf was produced using acmart. acmart has an anonymous mode which allows for the anonymization of author information, the optional acknowledgments section, and also allows arbitrary text to be hidden (without being replaced by anything such as placeholder text). This package provides additional functionality including placeholder text, anonymous links and anonymous citations/references as described in Section~\ref{sec:usage}.
+The anonymous-acm package allows for the easy anonymization and deanonymization of academic papers. The required information for both the anonymous and non-anonymous versions of the paper are specified at the time of writing. It is made to be used with the official Association of Computing Machinery (ACM) master article template for \LaTeX~ as described in Section \ref{sec:reqs}. This pdf was produced using acmart. acmart has an anonymous mode which allows for the anonymization of author information, the optional acknowledgments section, and also allows arbitrary text to be hidden (without being replaced by anything such as placeholder text). This package provides additional functionality including placeholder text, anonymous links and anonymous citations/references as described in Section~\ref{sec:usage}.
\subsection{Demonstration}
A live demonstration of this package is available on Overleaf at:
@@ -84,16 +84,16 @@ A live demonstration of this package is available on Overleaf at:
\noindent (Overleaf account required).
\subsection{Installation}
-The anonymous package can be found at:
+The anonymous-acm package can be found at:
\begin{itemize}
- \item \url{https://ctan.org/pkg/anonymous}
+ \item \url{https://ctan.org/pkg/anonymous-acm}
\end{itemize}
-\noindent Simply include anonymous.sty in the preamble of your .tex file.
+\noindent Simply include anonymous-acm.sty in the preamble of your .tex file.
\subsection{Requirements}
\label{sec:reqs}
-At this time the anonymous package is designed to work with \textbf{acmart}, the official Association of Computing Machinery (ACM) master article template for \LaTeX. This file was prepared with acmart. It is available here:
+The anonymous-acm package is designed to work with \textbf{acmart}, the official Association of Computing Machinery (ACM) master article template for \LaTeX. This file was prepared with acmart. It is available here:
\begin{itemize}
\item \url{https://www.acm.org/publications/proceedings-template}
\end{itemize}
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 ()
diff --git a/macros/xetex/latex/xepersian-hm/INSTALL.txt b/macros/xetex/latex/xepersian-hm/INSTALL.txt
new file mode 100644
index 0000000000..3176048e77
--- /dev/null
+++ b/macros/xetex/latex/xepersian-hm/INSTALL.txt
@@ -0,0 +1,38 @@
+ xepersian-hm -- INSTALL
+======================
+
+ Source: xepersian-hm.dtx ( 2020/05/11 v0.5e)
+ Author: Hossein Movahhedian
+ Info: filecontents + macro + verbatim
+ License: LPPL 1.3c
+ Copyright (C) 2020 Hossein Movahedian.
+ <dma8hm1334 AT gmail DOT com>
+
+- To extract the package and at the same time produce the
+ documentation, execute: xelatex thrice on xepersian-hm.dtx.
+
+Files should then be moved to appropriate locations.
+
+-- *.dtx -> TEXMF/source/xelatex/xepersian-hm/
+-- *.ins -> TEXMF/source/xelatex/xepersian-hm/
+
+-- *.sty -> TEXMF/tex/xelatex/xepersian-hm/
+-- *.def -> TEXMF/tex/xelatex/xepersian-hm/
+
+-- *.pdf -> TEXMF/doc/xelatex/xepersian-hm/
+-- *.tex -> TEXMF/doc/xelatex/xepersian-hm/
+-- *.ltx -> TEXMF/doc/xelatex/xepersian-hm/
+-- *.txt -> TEXMF/doc/xelatex/xepersian-hm/
+
+Don't forget to run 'texconfig rehash' afterwards.
+
+The example files
+
+ kashida-glyph-example.tex
+ kashida-hrule-example.tex
+ kashida-xep-XB-example.tex
+
+illustrate some features of the package and are an addendum to the
+main documentation xepersian-hm.pdf.
+
+Thats it.
diff --git a/macros/xetex/latex/xepersian-hm/doc-ligature-xep.pdf b/macros/xetex/latex/xepersian-hm/doc-ligature-xep.pdf
new file mode 100644
index 0000000000..c02b5b5a5c
--- /dev/null
+++ b/macros/xetex/latex/xepersian-hm/doc-ligature-xep.pdf
Binary files differ
diff --git a/macros/xetex/latex/xepersian-hm/doc-ligature-xephm.pdf b/macros/xetex/latex/xepersian-hm/doc-ligature-xephm.pdf
new file mode 100644
index 0000000000..ea5822c8d9
--- /dev/null
+++ b/macros/xetex/latex/xepersian-hm/doc-ligature-xephm.pdf
Binary files differ
diff --git a/macros/xetex/latex/xepersian-hm/kashida-glyph-example.pdf b/macros/xetex/latex/xepersian-hm/kashida-glyph-example.pdf
index 77033af7c5..9e65b1261e 100644
--- a/macros/xetex/latex/xepersian-hm/kashida-glyph-example.pdf
+++ b/macros/xetex/latex/xepersian-hm/kashida-glyph-example.pdf
Binary files differ
diff --git a/macros/xetex/latex/xepersian-hm/kashida-hrule-example.pdf b/macros/xetex/latex/xepersian-hm/kashida-hrule-example.pdf
index 6cf4f8078c..5578b52549 100644
--- a/macros/xetex/latex/xepersian-hm/kashida-hrule-example.pdf
+++ b/macros/xetex/latex/xepersian-hm/kashida-hrule-example.pdf
Binary files differ
diff --git a/macros/xetex/latex/xepersian-hm/kashida-xep-XB-example.pdf b/macros/xetex/latex/xepersian-hm/kashida-xep-XB-example.pdf
index a35eef3bcd..5e022cdf55 100644
--- a/macros/xetex/latex/xepersian-hm/kashida-xep-XB-example.pdf
+++ b/macros/xetex/latex/xepersian-hm/kashida-xep-XB-example.pdf
Binary files differ
diff --git a/macros/xetex/latex/xepersian-hm/xepersian-hm-doc.ltx b/macros/xetex/latex/xepersian-hm/xepersian-hm-doc.ltx
index ba04fee903..42c5562caf 100644
--- a/macros/xetex/latex/xepersian-hm/xepersian-hm-doc.ltx
+++ b/macros/xetex/latex/xepersian-hm/xepersian-hm-doc.ltx
@@ -27,7 +27,7 @@
}
}
-\date{Released \quad 2020-05-07 \quad v0.5d}
+\date{Released \quad 2020-05-12 \quad v0.5e}
\let\tmpthepage\thepage
\renewcommand{\thepage}{\lr{\Large\textbf\tmpthepage}}
@@ -81,6 +81,19 @@ problems. These problems along withe fixes in xepersian-hm are briefly:
filled by horizontal rule appears as a solid box. This is fixed by
using the \textsf{kashida} glyph instead of the horizontal rule in
\textsf{xepersian-hm}.
+ \item Activating kashida in \textsf{xepersian} disturbs ligatures. This is
+ fixed in \textsf{xepersian-hm} by escaping the components of the
+ ligature which form the glyph, i.e. by inserting an escape character
+ before Persian letters joined to form the ligature without any empty
+ characters, blank characters, invisible characters and whitespace
+ characters which form the glyph. See
+ \mbox{Figures \ref{fig:ligatures-xep} and \ref{fig:ligatures-xephm}}.
+ Currently only 3 ligature glyphs are available in
+ \textsf{xepersian-hm}, but you can add as many as you want or let
+ me know the ligature glyphs that you need, so that I can add them in
+ the next release of the package. Of course, this is not the best
+ solution, but it works.
+
\item If italic or oblique style of some fonts such as \textsf{X Series 2}
is used in \textsf{xepersian}, an extra gap is left between the
stretched characters. This is fixed in \textsf{HM Series} fonts.
@@ -88,24 +101,34 @@ problems. These problems along withe fixes in xepersian-hm are briefly:
For comparing the outputs of \textsf{xepersian} and \textsf{xepersian-hm} with
a variety of options available to these packages, please see the
-\mbox{Figure \ref{fig:xepersian-XB}},
-\mbox{Figure \ref{fig:xepersian-hm-hrule}}, and
-\mbox{Figure \ref{fig:xepersian-hm-glyph}}.
+\mbox{Figures \ref{fig:xepersian-XB}, \ref{fig:xepersian-hm-hrule}}, and \ref{fig:xepersian-hm-glyph}.
+
+\begin{figure}
+ \centerline{\fbox{\includegraphics[scale=1]{doc-ligature-xep.pdf}}}
+ \caption{Package: \textsf{xeprsian}, Font: \textsf{Noto Sans Arabic}, \textsf{Scale=1.1}, \textsf{Kashida=On}}
+ \label{fig:ligatures-xep}
+\end{figure}
+
+\begin{figure}
+ \centerline{\fbox{\includegraphics[scale=1]{doc-ligature-xephm.pdf}}}
+ \caption{Package: \textsf{xeprsian-hm}, Font: \textsf{Noto Sans Arabic}, \textsf{Scale=1.1}, \textsf{Kashida=glyph}}
+ \label{fig:ligatures-xephm}
+\end{figure}
\begin{figure}
- \centerline{\includegraphics[scale=1]{doc-samples-xep.pdf}}
+ \centerline{\fbox{\includegraphics[scale=1]{doc-samples-xep.pdf}}}
\caption{Package: \textsf{xeprsian}, Font: \textsf{XB Kayhan}, \textsf{Scale=4.5}, \textsf{Kashida=0n}}
\label{fig:xepersian-XB}
\end{figure}
\begin{figure}
- \centerline{\includegraphics[scale=1]{doc-samples-hrule.pdf}}
+ \centerline{\fbox{\includegraphics[scale=1]{doc-samples-hrule.pdf}}}
\caption{Package: \textsf{xeprsian-hm}, Font: \textsf{HM XKayhan}, \textsf{Scale=4.5}, \textsf{Kashida=hrule}}
\label{fig:xepersian-hm-hrule}
\end{figure}
\begin{figure}
- \centerline{\includegraphics[scale=1]{doc-samples-glyph.pdf}}
+ \centerline{\fbox{\includegraphics[scale=1]{doc-samples-glyph.pdf}}}
\caption{Package: \textsf{xeprsian-hm}, Font: \textsf{HM XKayhan}, \textsf{Scale=4.5}, \textsf{Kashida=glyph}}
\label{fig:xepersian-hm-glyph}
\end{figure}
@@ -160,6 +183,7 @@ The options available in \textsf{xepersian-hm} are:
\texttt{high}: & \texttt{25} \\
\texttt{max}: & \texttt{10000}
\end{longtable}
+
\item \texttt{kashidastretch}: \\
which specifies the amount of extra stretching
for some combinations of characters. You may strictly specify the value of
@@ -202,6 +226,25 @@ The options available in \textsf{xepersian-hm} are:
For example: \mbox{\texttt{'kashidastretch=titr'}} is equivalent to\linebreak
\mbox{\texttt{'kashidastretch=0.12 em plus 0.5 em'}}
+
+ \item \texttt{ligature}: \\
+ which fixes the disturbance of ligatures caused by activation of kashida in
+ \textsf{xepersian}. You may strictly specify the value of this option.
+ For example \texttt{'ligature=dlig'} or you may use the default value.
+ The available values are:
+
+ \begin{longtable}{ll}
+ \texttt{aalt}: & Access All Alternatives \\
+ \texttt{ccmp}: & Glyph Composition/Decomposition \\
+ \texttt{dlig}: & Discretionary Ligatures \\
+ \texttt{fina}: & Final (Terminal) Forms \\
+ \texttt{init}: & Initial Forms \\
+ \texttt{locl}: & Localized Forms \\
+ \texttt{medi}: & Medial Forms \\
+ \texttt{rlig}: & Required Ligatures \\
+ \texttt{default}: & All the above features
+ \end{longtable}
+ Please note that this feature is still experimental and is not regarded as stable.
\end{itemize}
\section{Commands}
@@ -223,7 +266,7 @@ The options available in \textsf{xepersian-hm} are:
\item Kashida and ligatures:
The method used to implement kashida feature breaks a ligature if it is applied to the letters which are joined to form
- the ligature.
+ the ligature. This is fixed in \textsf{xepersian-hm}, but it is still immature.
\end{description}
\end{latin}
diff --git a/macros/xetex/latex/xepersian-hm/xepersian-hm-doc.pdf b/macros/xetex/latex/xepersian-hm/xepersian-hm-doc.pdf
index f1f5e0dad2..06a9d05ddd 100644
--- a/macros/xetex/latex/xepersian-hm/xepersian-hm-doc.pdf
+++ b/macros/xetex/latex/xepersian-hm/xepersian-hm-doc.pdf
Binary files differ
diff --git a/macros/xetex/latex/xepersian-hm/xepersian-hm.dtx b/macros/xetex/latex/xepersian-hm/xepersian-hm.dtx
index 5e2ac7ef40..d762f805d3 100644
--- a/macros/xetex/latex/xepersian-hm/xepersian-hm.dtx
+++ b/macros/xetex/latex/xepersian-hm/xepersian-hm.dtx
@@ -67,7 +67,7 @@ make time to fix.
% }^^A
% }
%
-% \date{Released \quad 2020-05-07 \quad v0.5d}
+% \date{Released \quad 2020-05-12 \quad v0.5e}
%
% \maketitle
%
@@ -96,7 +96,7 @@ make time to fix.
\RequirePackage{zref-savepos}[2020-03-03]
\RequirePackage{xepersian}
\ExplSyntaxOn
-\ProvidesExplPackage {xepersian-hm} {2020-05-07} {0.5d} { Fixes~issues~in~xepersian~package }
+\ProvidesExplPackage {xepersian-hm} {2020-05-12} {0.5e} { Fixes~issues~in~xepersian~package }
\int_const:Nn \c_xephm_ksh_int {"0640} % kashida
\int_const:Nn \c_xephm_lrm_int {"200E} % left-right-mark
@@ -127,11 +127,14 @@ make time to fix.
\tl_new:N \l_xephm_skip_default_tl
+\tl_new:N \l_xephm_active_ligs_tl
+
\tl_new:N \l_xephm_gap_filler_tl
\dim_new:N \l_xephm_diff_pos_dim
\bool_set_false:N \l_xephm_kashida_hm_fix_bool
+\bool_set_false:N \l_xephm_ligature_bool
\bool_set_false:N \l_xephm_linebreakpenalty_bool
\int_set:Nn \l_xephm_min_penalty_int { 0 }
@@ -143,37 +146,68 @@ make time to fix.
\tl_set:Nn \l_xephm_stretch_glyph_tl { glyph }
\tl_set:Nn \l_xephm_stretch_hrule_tl { hrule }
-\tl_set:Nn \l_xephm_kayhan_tl { kayhan }
-\tl_set:Nn \l_xephm_khorramshahr_tl { khorramshahr }
-\tl_set:Nn \l_xephm_kayhannavaar_tl { kayhannavaar }
-\tl_set:Nn \l_xephm_kayhanpook_tl { kayhanpook }
-\tl_set:Nn \l_xephm_kayhansayeh_tl { kayhansayeh }
-\tl_set:Nn \l_xephm_khoramshahr_tl { khoramshahr }
-\tl_set:Nn \l_xephm_khorramshahr_tl { khorramshahr }
-\tl_set:Nn \l_xephm_niloofar_tl { niloofar }
-\tl_set:Nn \l_xephm_paatch_tl { paatch }
-\tl_set:Nn \l_xephm_riyaz_tl { riyaz }
-\tl_set:Nn \l_xephm_roya_tl { roya }
-\tl_set:Nn \l_xephm_shafigh_tl { shafigh }
-\tl_set:Nn \l_xephm_shafighKurd_tl { shafighKurd }
-\tl_set:Nn \l_xephm_shafighUzbek_tl { shafighUzbek }
-\tl_set:Nn \l_xephm_shiraz_tl { shiraz }
-\tl_set:Nn \l_xephm_sols_tl { sols }
-\tl_set:Nn \l_xephm_tabriz_tl { tabriz }
-\tl_set:Nn \l_xephm_titr_tl { titr }
-\tl_set:Nn \l_xephm_titre_tl { titre }
-\tl_set:Nn \l_xephm_traffic_tl { traffic }
-\tl_set:Nn \l_xephm_vahid_tl { vahid }
-\tl_set:Nn \l_xephm_vosta_tl { vosta }
-\tl_set:Nn \l_xephm_yaghut_tl { yaghut }
-\tl_set:Nn \l_xephm_yagut_tl { yagut }
-\tl_set:Nn \l_xephm_yas_tl { yas }
-\tl_set:Nn \l_xephm_yekan_tl { yekan }
-\tl_set:Nn \l_xephm_yermook_tl { yermook }
-\tl_set:Nn \l_xephm_zar_tl { zar }
-\tl_set:Nn \l_xephm_ziba_tl { ziba }
-\tl_set:Nn \l_xephm_default_tl { default }
-\tl_set:Nn \l_xephm_noskip_tl { noskip }
+\tl_set:Nn \l_xephm_fnt_kayhan_tl { kayhan }
+\tl_set:Nn \l_xephm_fnt_kayhannavaar_tl { kayhannavaar }
+\tl_set:Nn \l_xephm_fnt_kayhanpook_tl { kayhanpook }
+\tl_set:Nn \l_xephm_fnt_kayhansayeh_tl { kayhansayeh }
+\tl_set:Nn \l_xephm_fnt_khoramshahr_tl { khoramshahr }
+\tl_set:Nn \l_xephm_fnt_khorramshahr_tl { khorramshahr }
+\tl_set:Nn \l_xephm_fnt_niloofar_tl { niloofar }
+\tl_set:Nn \l_xephm_fnt_paatch_tl { paatch }
+\tl_set:Nn \l_xephm_fnt_riyaz_tl { riyaz }
+\tl_set:Nn \l_xephm_fnt_roya_tl { roya }
+\tl_set:Nn \l_xephm_fnt_shafigh_tl { shafigh }
+\tl_set:Nn \l_xephm_fnt_shafighKurd_tl { shafighKurd }
+\tl_set:Nn \l_xephm_fnt_shafighUzbek_tl { shafighUzbek }
+\tl_set:Nn \l_xephm_fnt_shiraz_tl { shiraz }
+\tl_set:Nn \l_xephm_fnt_sols_tl { sols }
+\tl_set:Nn \l_xephm_fnt_tabriz_tl { tabriz }
+\tl_set:Nn \l_xephm_fnt_titr_tl { titr }
+\tl_set:Nn \l_xephm_fnt_titre_tl { titre }
+\tl_set:Nn \l_xephm_fnt_traffic_tl { traffic }
+\tl_set:Nn \l_xephm_fnt_vahid_tl { vahid }
+\tl_set:Nn \l_xephm_fnt_vosta_tl { vosta }
+\tl_set:Nn \l_xephm_fnt_yaghut_tl { yaghut }
+\tl_set:Nn \l_xephm_fnt_yagut_tl { yagut }
+\tl_set:Nn \l_xephm_fnt_yas_tl { yas }
+\tl_set:Nn \l_xephm_fnt_yekan_tl { yekan }
+\tl_set:Nn \l_xephm_fnt_yermook_tl { yermook }
+\tl_set:Nn \l_xephm_fnt_zar_tl { zar }
+\tl_set:Nn \l_xephm_fnt_ziba_tl { ziba }
+\tl_set:Nn \l_xephm_fnt_default_tl { default }
+\tl_set:Nn \l_xephm_fnt_noskip_tl { noskip }
+
+\tl_set:Nn \l_xephm_lig_aalt_tl { aalt } % Access All Alternatives
+\tl_set:Nn \l_xephm_lig_ccmp_tl { ccmp } % Glyph Composition/Decomposition
+\tl_set:Nn \l_xephm_lig_dlig_tl { dlig } % Discretionary Ligatures
+\tl_set:Nn \l_xephm_lig_fina_tl { fina } % Final (Terminal) Forms
+\tl_set:Nn \l_xephm_lig_init_tl { init } % Initial Forms
+\tl_set:Nn \l_xephm_lig_locl_tl { locl } % Localized Forms
+\tl_set:Nn \l_xephm_lig_medi_tl { medi } % Medial Forms
+\tl_set:Nn \l_xephm_lig_rlig_tl { rlig } % Required Ligatures
+\tl_set:Nn \l_xephm_lig_default_tl { default }
+
+\clist_set:Nn \l_xephm_lig_aalt_clist { { } } % Access All Alternatives
+\clist_set:Nn \l_xephm_lig_ccmp_clist { { } } % Glyph Composition/Decomposition
+\clist_set:Nn \l_xephm_lig_dlig_clist { FDF2 = الله , FDF3 = اکبر , FDFB = جلجلاله } % Discretionary Ligatures
+\clist_set:Nn \l_xephm_lig_fina_clist { { } } % Final (Terminal) Forms
+\clist_set:Nn \l_xephm_lig_init_clist { { } } % Initial Forms
+\clist_set:Nn \l_xephm_lig_locl_clist { { } } % Localized Forms
+\clist_set:Nn \l_xephm_lig_medi_clist { { } } % Medial Forms
+\clist_set:Nn \l_xephm_lig_rlig_clist { { } } % Required Ligatures
+\clist_set:Nn \l_xephm_lig_default_clist { { } }
+
+\clist_set:Nn \l_xephm_lig_names_clist
+ {
+ \l_xephm_lig_aalt_tl , { \l_xephm_lig_aalt_clist } ,
+ \l_xephm_lig_ccmp_tl , { \l_xephm_lig_ccmp_clist } ,
+ \l_xephm_lig_dlig_tl , { \l_xephm_lig_dlig_clist } ,
+ \l_xephm_lig_fina_tl , { \l_xephm_lig_fina_clist } ,
+ \l_xephm_lig_init_tl , { \l_xephm_lig_init_clist } ,
+ \l_xephm_lig_locl_tl , { \l_xephm_lig_locl_clist } ,
+ \l_xephm_lig_medi_tl , { \l_xephm_lig_medi_clist } ,
+ \l_xephm_lig_rlig_tl , { \l_xephm_lig_rlig_clist } ,
+ }
\msg_new:nnn { xepersian-hm } { kashida-character-is-not-available-in-the-main-font }
{
@@ -219,7 +253,6 @@ make time to fix.
} { } { \tl_set:Nx \l_xephm_gap_filler_tl { #1 } }
\tl_if_empty:NT \l_xephm_gap_filler_tl { \msg_error:nn { xepersian-hm } { specify-value-for-kashida-option } }
\bool_set_true:N \l_xephm_kashida_hm_fix_bool
- \tex_input:D { kashida-xepersian-hm.def }
} ,
linebreakpenalty .code:n =
@@ -227,58 +260,82 @@ make time to fix.
\int_set:Nn \l_tmpa_int { #1 }
\int_case:nnTF \l_tmpa_int
{
- \l_xephm_min_penalty_int { \int_set:Nn \l_xephm_line_break_penalty_int { \l_xephm_min_penalty_int } }
- \l_xephm_low_penalty_int { \int_set:Nn \l_xephm_line_break_penalty_int { \l_xephm_low_penalty_int } }
- \l_xephm_med_penalty_int { \int_set:Nn \l_xephm_line_break_penalty_int { \l_xephm_med_penalty_int } }
+ \l_xephm_min_penalty_int { \int_set:Nn \l_xephm_line_break_penalty_int { \l_xephm_min_penalty_int } }
+ \l_xephm_low_penalty_int { \int_set:Nn \l_xephm_line_break_penalty_int { \l_xephm_low_penalty_int } }
+ \l_xephm_med_penalty_int { \int_set:Nn \l_xephm_line_break_penalty_int { \l_xephm_med_penalty_int } }
\l_xephm_high_penalty_int { \int_set:Nn \l_xephm_line_break_penalty_int { \l_xephm_high_penalty_int } }
- \l_xephm_max_penalty_int { \int_set:Nn \l_xephm_line_break_penalty_int { \l_xephm_max_penalty_int } }
+ \l_xephm_max_penalty_int { \int_set:Nn \l_xephm_line_break_penalty_int { \l_xephm_max_penalty_int } }
} { } { \int_set:Nn \l_xephm_line_break_penalty_int { #1 } }
\bool_set_true:N \l_xephm_linebreakpenalty_bool
} ,
kashidastretch .code:n =
{
- \tl_set:Nn \l_tmpb_tl { #1 }
- \tl_case:NnTF \l_tmpb_tl
+ \tl_set:Nn \l_tmpa_tl { #1 }
+ \tl_case:NnTF \l_tmpa_tl
{
- \l_xephm_kayhan_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.14 em plus 0.5 em } }
- \l_xephm_khorramshahr_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.131 em plus 0.5 em } }
- \l_xephm_kayhannavaar_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.129 em plus 0.5 em } }
- \l_xephm_kayhanpook_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.133 em plus 0.5 em } }
- \l_xephm_kayhansayeh_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.135 em plus 0.5 em } }
- \l_xephm_khoramshahr_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.128 em plus 0.5 em } }
- \l_xephm_khorramshahr_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.13 em plus 0.5 em } }
- \l_xephm_niloofar_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.132 em plus 0.5 em } }
- \l_xephm_paatch_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.127 em plus 0.5 em } }
- \l_xephm_riyaz_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.125 em plus 0.5 em } }
- \l_xephm_roya_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.142 em plus 0.5 em } }
- \l_xephm_shafigh_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.143 em plus 0.5 em } }
- \l_xephm_shafighKurd_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.126 em plus 0.5 em } }
- \l_xephm_shafighUzbek_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.123 em plus 0.5 em } }
- \l_xephm_shiraz_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.122 em plus 0.5 em } }
- \l_xephm_sols_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.124 em plus 0.5 em } }
- \l_xephm_tabriz_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.119 em plus 0.5 em } }
- \l_xephm_titr_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.12 em plus 0.5 em } }
- \l_xephm_titre_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.121 em plus 0.5 em } }
- \l_xephm_traffic_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.124 em plus 0.5 em } }
- \l_xephm_vahid_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.134 em plus 0.5 em } }
- \l_xephm_vosta_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.136 em plus 0.5 em } }
- \l_xephm_yaghut_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.138 em plus 0.5 em } }
- \l_xephm_yagut_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.137 em plus 0.5 em } }
- \l_xephm_yas_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.126 em plus 0.5 em } }
- \l_xephm_yekan_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.141 em plus 0.5 em } }
- \l_xephm_yermook_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.139 em plus 0.5 em } }
- \l_xephm_zar_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.116 em plus 0.5 em } }
- \l_xephm_ziba_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.119 em plus 0.5 em } }
- \l_xephm_default_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.14 em plus 0.5 em } }
- \l_xephm_noskip_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0 em plus 0.5 em } }
+ \l_xephm_fnt_kayhan_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.14 em plus 0.5 em } }
+ \l_xephm_fnt_kayhannavaar_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.129 em plus 0.5 em } }
+ \l_xephm_fnt_kayhanpook_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.133 em plus 0.5 em } }
+ \l_xephm_fnt_kayhansayeh_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.135 em plus 0.5 em } }
+ \l_xephm_fnt_khoramshahr_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.128 em plus 0.5 em } }
+ \l_xephm_fnt_khorramshahr_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.13 em plus 0.5 em } }
+ \l_xephm_fnt_niloofar_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.132 em plus 0.5 em } }
+ \l_xephm_fnt_paatch_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.127 em plus 0.5 em } }
+ \l_xephm_fnt_riyaz_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.125 em plus 0.5 em } }
+ \l_xephm_fnt_roya_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.142 em plus 0.5 em } }
+ \l_xephm_fnt_shafigh_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.143 em plus 0.5 em } }
+ \l_xephm_fnt_shafighKurd_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.126 em plus 0.5 em } }
+ \l_xephm_fnt_shafighUzbek_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.123 em plus 0.5 em } }
+ \l_xephm_fnt_shiraz_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.122 em plus 0.5 em } }
+ \l_xephm_fnt_sols_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.124 em plus 0.5 em } }
+ \l_xephm_fnt_tabriz_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.119 em plus 0.5 em } }
+ \l_xephm_fnt_titr_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.12 em plus 0.5 em } }
+ \l_xephm_fnt_titre_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.121 em plus 0.5 em } }
+ \l_xephm_fnt_traffic_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.124 em plus 0.5 em } }
+ \l_xephm_fnt_vahid_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.134 em plus 0.5 em } }
+ \l_xephm_fnt_vosta_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.136 em plus 0.5 em } }
+ \l_xephm_fnt_yaghut_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.138 em plus 0.5 em } }
+ \l_xephm_fnt_yagut_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.137 em plus 0.5 em } }
+ \l_xephm_fnt_yas_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.126 em plus 0.5 em } }
+ \l_xephm_fnt_yekan_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.141 em plus 0.5 em } }
+ \l_xephm_fnt_yermook_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.139 em plus 0.5 em } }
+ \l_xephm_fnt_zar_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.116 em plus 0.5 em } }
+ \l_xephm_fnt_ziba_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.119 em plus 0.5 em } }
+ \l_xephm_fnt_default_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0.14 em plus 0.5 em } }
+ \l_xephm_fnt_noskip_tl { \tl_set:Nn \l_xephm_skip_default_tl { 0 em plus 0.5 em } }
} { } { \tl_set:Nn \l_xephm_skip_default_tl { #1 } }
} ,
kashidastretch .default:n = \tl_set:Nn \l_xephm_skip_default_tl { 0 em plus 0.5 em } ,
+
+ ligatures .code:n =
+ {
+ \tl_set:Nn \l_tmpa_tl { #1 }
+ \tl_case:NnTF \l_tmpa_tl
+ {
+ \l_xephm_lig_aalt_tl { \tl_set:Nx \l_xephm_active_ligs_tl { \l_xephm_lig_aalt_tl } }
+ \l_xephm_lig_ccmp_tl { \tl_set:Nx \l_xephm_active_ligs_tl { \l_xephm_lig_ccmp_tl } }
+ \l_xephm_lig_dlig_tl { \tl_set:Nx \l_xephm_active_ligs_tl { \l_xephm_lig_dlig_tl } }
+ \l_xephm_lig_fina_tl { \tl_set:Nx \l_xephm_active_ligs_tl { \l_xephm_lig_fina_tl } }
+ \l_xephm_lig_init_tl { \tl_set:Nx \l_xephm_active_ligs_tl { \l_xephm_lig_init_tl } }
+ \l_xephm_lig_locl_tl { \tl_set:Nx \l_xephm_active_ligs_tl { \l_xephm_lig_locl_tl } }
+ \l_xephm_lig_medi_tl { \tl_set:Nx \l_xephm_active_ligs_tl { \l_xephm_lig_medi_tl } }
+ \l_xephm_lig_rlig_tl { \tl_set:Nx \l_xephm_active_ligs_tl { \l_xephm_lig_rlig_tl } }
+ \l_xephm_lig_default_tl { \tl_set:Nx \l_xephm_active_ligs_tl { \l_xephm_lig_default_tl } }
+ } { } { \tl_set:Nn \l_xephm_active_ligs_tl { #1 } }
+ \bool_set_true:N \l_xephm_ligature_bool
+ } ,
+ ligatures .default:n = \tl_set:Nn \l_xephm_active_ligs_tl { \l_xephm_lig_default_tl } ,
+
}
\ProcessKeysOptions { xepersian-hm }
+\bool_if:NT \l_xephm_kashida_hm_fix_bool
+ {
+ \tex_input:D { kashida-xepersian-hm.def }
+ }
+
\ExplSyntaxOff
\endinput
%</xepersian-hm-sty>
@@ -288,7 +345,7 @@ make time to fix.
% \begin{macrocode}
%<*kashida-xepersian-hm-def>
\ExplSyntaxOn
-\ProvidesExplFile {kashida-xepersian-hm.def} {2020-05-07} {0.5d} { Fixes~implementation~of~Kashida~in~xepersian~package }
+\ProvidesExplFile {kashida-xepersian-hm.def} {2020-05-12} {0.5e} { Fixes~implementation~of~Kashida~in~xepersian~package }
\newXeTeXintercharclass \c_xephm_d_charclass % dual-joiner class
\newXeTeXintercharclass \c_xephm_l_charclass % lam
@@ -296,44 +353,72 @@ make time to fix.
\newXeTeXintercharclass \c_xephm_a_charclass % alef
\newXeTeXintercharclass \c_xephm_y_charclass % yeh
-%% Partly adapted from LaTeX2e source
-\cs_new:Nn \xephm_line_break: {
- \if_mode_vertical:
- \GenericError{
- \space\space\space\space\space\space\space\space\space\space\space\space\space\space\space
- }{
- LaTeX Error: There’s no line here to end
- }{
- See the LaTeX manual or LaTeX Companion for explanation.
- }{
- Your command was ignored.\MessageBreak
- Type \space I <command> <return> \space to replace it~
- with another command,\MessageBreak
- or \space <return> \space to continue without it.}
- \else:
- \l_tmpa_skip \tex_lastskip:D
- \tex_unskip:D
- \tex_penalty:D -\l_xephm_line_break_penalty_int
- \dim_compare:nT { \l_tmpa_skip > \c_zero_skip }
- { \skip_horizontal:N \l_tmpa_skip \tex_ignorespaces:D }
- \fi:
+\bool_if:NT \l_xephm_ligature_bool
+{
+ \clist_new:N \l_xephm_ligatures_clist
+ \int_new:N \l_xephm_lig_names_len_int
+ \int_set:Nn \l_xephm_lig_names_len_int { \clist_count:N \l_xephm_lig_names_clist }
+ \int_step_inline:nnnn { 1 } { 2 } { \l_xephm_lig_names_len_int }
+ {
+ \int_set:Nn \l_tmpa_int { #1 }
+ \int_set:Nn \l_tmpb_int { \int_eval:n { \l_tmpa_int + 1 } }
+ \tl_set:Nf \l_tmpa_tl { \clist_item:Nn \l_xephm_lig_names_clist { \l_tmpa_int } }
+ \clist_set:Nx \l_tmpa_clist { { \clist_item:Nn \l_xephm_lig_names_clist { \l_tmpb_int } } }
+ \bool_if:nT { \tl_if_eq_p:NN \l_xephm_active_ligs_tl \l_tmpa_tl || \tl_if_eq_p:NN \l_xephm_active_ligs_tl \l_xephm_lig_default_tl }
+ {
+ \clist_put_left:Nx \l_xephm_ligatures_clist { \l_tmpa_clist }
+ }
+ }
+ \clist_map_inline:Nn \l_xephm_ligatures_clist
+ {
+ \seq_set_split:Nnn \l_tmpa_seq { = } { #1 }
+ \seq_pop_left:NN \l_tmpa_seq \l_tmpa_tl { } { }
+ \seq_pop_left:NN \l_tmpa_seq \l_tmpb_tl { } { }
+ \tl_const:cx { \tl_use:N \l_tmpb_tl } { \char"\l_tmpa_tl \ }
+ }
}
-\NewDocumentCommand { \discouragebadlinebreaks } { O{\l_xephm_line_break_penalty_int} O{\c_xephm_skip_b_tl} m }
- {
- \IfNoValueF {#1}
- { \int_set:Nn \l_xephm_line_break_penalty_int {#1} }
- \IfNoValueF {#2}
- { \tl_set:Nn \l_xephm_skip_default_tl {#2} }
- \xephm_put_line_breaks:n { #3 }
- }
-
-\cs_new_protected:Nn \xephm_put_line_breaks:n
- {
- \tl_set:Nn \l_xephm_line_break_tl { #1 }
- \regex_replace_all:nnN { ([ابپتثجحخچدذرزژسشعغصضفقطظکگلمنوهیـ])+ } { \ \0 \ \c{xephm_line_break:}\ } \l_xephm_line_break_tl
- \tl_use:N \l_xephm_line_break_tl
- }
+\bool_if:NT \l_xephm_linebreakpenalty_bool
+{
+ %% Partly adapted from LaTeX2e source
+ \cs_new:Nn \xephm_line_break: {
+ \if_mode_vertical:
+ \GenericError{
+ \space\space\space\space\space\space\space\space\space\space\space\space\space\space\space
+ }{
+ LaTeX Error: There’s no line here to end
+ }{
+ See the LaTeX manual or LaTeX Companion for explanation.
+ }{
+ Your command was ignored.\MessageBreak
+ Type \space I <command> <return> \space to replace it~
+ with another command,\MessageBreak
+ or \space <return> \space to continue without it.}
+ \else:
+ \l_tmpa_skip \tex_lastskip:D
+ \tex_unskip:D
+ \tex_penalty:D -\l_xephm_line_break_penalty_int
+ \dim_compare:nT { \l_tmpa_skip > \c_zero_skip }
+ { \skip_horizontal:N \l_tmpa_skip \tex_ignorespaces:D }
+ \fi:
+ }
+
+ \NewDocumentCommand { \discouragebadlinebreaks } { O{\l_xephm_line_break_penalty_int} O{\c_xephm_skip_b_tl} m }
+ {
+ \IfNoValueF {#1}
+ { \int_set:Nn \l_xephm_line_break_penalty_int {#1} }
+ \IfNoValueF {#2}
+ { \tl_set:Nn \l_xephm_skip_default_tl {#2} }
+ \xephm_put_line_breaks:n { #3 }
+ }
+
+ \cs_new_protected:Nn \xephm_put_line_breaks:n
+ {
+ \tl_set:Nn \l_xephm_line_break_tl { #1 }
+ \regex_replace_all:nnN { ([ابپتثجحخچدذرزژسشعغصضفقطظکگلمنوهیـ])+ } { \ \0 \ \c{xephm_line_break:}\ } \l_xephm_line_break_tl
+ \tl_use:N \l_xephm_line_break_tl
+ }
+}
%% Partly adapted from the code provided by David Carlisle in:
%% https://tex.stackexchange.com/questions/356709/how-to-know-the-width-and-fill-the-glue-space-between-two-characters-when-using/356721#356721
diff --git a/macros/xetex/latex/xepersian-hm/xepersian-hm.pdf b/macros/xetex/latex/xepersian-hm/xepersian-hm.pdf
index fd7f043992..bf0ff83fe0 100644
--- a/macros/xetex/latex/xepersian-hm/xepersian-hm.pdf
+++ b/macros/xetex/latex/xepersian-hm/xepersian-hm.pdf
Binary files differ