diff options
Diffstat (limited to 'macros/latex')
48 files changed, 6612 insertions, 3423 deletions
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/american-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/american-apa.lbx index 3d4c044114..a5dea0b748 100644 --- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/american-apa.lbx +++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/american-apa.lbx @@ -1,4 +1,4 @@ -\ProvidesFile{american-apa.lbx}[2019/12/22\space v9.4\space APA biblatex localisation] +\ProvidesFile{american-apa.lbx}[2020/02/01\space v9.5\space APA biblatex localisation] \InheritBibliographyExtras{american} \NewBibliographyString{revisededition} diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/apa.bbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/apa.bbx index 2195222875..276fa50c0e 100644 --- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/apa.bbx +++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/apa.bbx @@ -1,4 +1,4 @@ -%% Copyright 2019 Philip Kime +%% Copyright 2020 Philip Kime %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3 @@ -12,7 +12,7 @@ %% %% The Current Maintainer of this work is Philip Kime. -\ProvidesFile{apa.bbx}[2019/12/22\space v9.4\space APA biblatex references style] +\ProvidesFile{apa.bbx}[2020/02/01\space v9.5\space APA biblatex references style] \RequireBiber[3] \RequireBibliographyStyle{standard} \urlstyle{rm} % APA examples all have URLs in same font as text @@ -491,48 +491,46 @@ {\addcomma\space\ldots\space} {\ifthenelse{\value{listcount}>\maxprtauth\AND\value{listcount}<\value{listtotal}} {} - {\printtext{\usebibmacro{name:apa:family-given}% + {\usebibmacro{name:apa:family-given}% {\namepartfamily}% {\namepartgiven}% {\namepartgiveni}% {\namepartprefix}% - {\namepartsuffix}}% + {\namepartsuffix}% \let\bibstring\bibcplstring - \setunit{\addspace}% - \printtext{\mkbibparense{\usebibmacro{role}}}% - \hasitemannotation[\currentname][username]{\addspace\mkbibbrackets{\getitemannotation[\currentname][username]}}{}}}% - \ifthenelse{\value{listcount}=\value{listtotal}}% - {\ifmorenames - {\printdelim{andothersdelim} - \bibstring{andothers}} - {}% - \let\bibstring\bibcplstring - \setunit{\addspace}% - \printtext{\mkbibparense{\usebibmacro{roles}}}} - {}} + \usebibmacro{role}{\addspace}{\mkbibparens}% + \hasitemannotation[\currentname][username] + {\addspace\mkbibbrackets{\getitemannotation[\currentname][username]}} + {}}}% + \ifthenelse{\value{listcount}=\value{listtotal}}% + {\ifmorenames + {\printdelim{andothersdelim}% + \bibstring{andothers}} + {}% + \let\bibstring\bibcplstring + \usebibmacro{roles}{\addspace}{\mkbibparens}} + {}} \DeclareNameFormat{apanames}{% \ifthenelse{\value{listcount}=\maxprtauth\AND\value{listcount}<\value{listtotal}} {\addcomma\space\ldots\space} {\ifthenelse{\value{listcount}>\maxprtauth\AND\value{listcount}<\value{listtotal}} {} - {\printtext{\usebibmacro{name:apa:given-family}% + {\usebibmacro{name:apa:given-family}% {\namepartfamily}% {\namepartgiven}% {\namepartgiveni}% {\namepartprefix}% - {\namepartsuffix}}% + {\namepartsuffix}% \let\bibstring\bibcpsstring - \setunit{\addcomma\addspace}% - \usebibmacro{role}}}% + \usebibmacro{role}{\addcomma\space}{\@firstofone}}}% \ifthenelse{\value{listcount}=\value{listtotal}}% {\ifmorenames {\printdelim{andothersdelim}% \bibstring{andothers}} {}% \let\bibstring\bibcplstring - \setunit{\addspace}% - \usebibmacro{roles}} + \usebibmacro{roles}{\addspace}{\@firstofone}} {}} \renewbibmacro*{author/editor}{% @@ -585,9 +583,12 @@ \printfield{nameaddon}% \ifnameundef{with} {} - {\setunit{}\addspace\mkbibparens{\printtext{\bibstring{with}\addspace}% - \printnames[apaauthor][-\value{listtotal}]{with}} - \setunit*{\addspace}}} + {\setunit{\addspace}% + \printtext[parens]{% + \bibstring{with}% + \setunit{\addspace}% + \printnames[apaauthor][-\value{listtotal}]{with}}% + \setunit{\addspace}}} \newbibmacro*{author:related}{% \ifnameundef{author} @@ -639,8 +640,8 @@ \DeclareFieldFormat{apadate}{% \ifboolexpr{ test {\ifdatecirca} or test {\ifdateuncertain} } - {\printtext{\mkbibbrackets{#1}}} - {\printtext{\mkbibparens{#1}}}} + {\mkbibbrackets{#1}} + {\mkbibparens{#1}}} % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -758,9 +759,10 @@ \renewbibmacro*{eprint}{% \iffieldundef{eprinttype} {} - {\printtext{% - \iffieldbibstring{eprinttype}{\bibcplstring{\strfield{eprinttype}}}{\strfield{eprinttype}}% - \setunit{\addspace}}}% + {\iffieldbibstring{eprinttype} + {\bibcplstring{\strfield{eprinttype}}} + {\strfield{eprinttype}}% + \setunit{\addspace}}% \printfield{eprint}} \DeclareFieldFormat{eprint}{#1} @@ -811,73 +813,79 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Names -% Individual name roles -\newbibmacro*{role}{% - \hasitemannotation[\currentname][role]% - {\getitemannotation[\currentname][role]} - {\ifitemannotation[\currentname][role]{writer} - {\bibstring{writer}% - \setunit{\addspace\&\addspace}} - {}% - \ifitemannotation[\currentname][role]{director} - {\bibstring{director}% - \setunit{\addspace\&\addspace}} - {}% - \ifitemannotation[\currentname][role]{execproducer} - {\bibstring{execproducer}% - \setunit{\addspace\&\addspace}} - {}% - \ifitemannotation[\currentname][role]{producer} - {\bibstring{producer}% - \setunit{\addspace\&\addspace}} - {}% - \ifitemannotation[\currentname][role]{host} - {\bibstring{host}% - \setunit{\addspace\&\addspace}} +\newcommand*{\apabbx@ifrole@item}{% + \xifinlist{item@\currentname @role@\the\value{listcount}}% + \abx@annotation@defined} + +\newtoggle{apabbx:role:item:punct} + +\newcommand*{\apabbx@rolelist@item}{} +\forcsvlist{\listadd\apabbx@rolelist@item}{% + writer,director,execproducer,producer,host,chair,guestexpert} + +\newcommand*{\apabbx@printrole@item@i}[1]{% + \ifitemannotation[\currentname][role]{#1} + {\iftoggle{apabbx:role:item:punct} + {\addspace\&\space} {}% - \ifitemannotation[\currentname][role]{chair} - {\bibstring{chair}% - \setunit{\addspace\&\addspace}} + \bibstring{#1}% + \toggletrue{apabbx:role:item:punct}} + {}% +} + +\newcommand*{\apabbx@printrole@item}{% + \forlistloop{\apabbx@printrole@item@i}{\apabbx@rolelist@item}} + +% Individual name roles +% takes two arguments +% {<pre punct>}{<wrapper>} +\newbibmacro*{role}[2]{% + \apabbx@ifrole@item + {#1% + #2{% + \togglefalse{apabbx:role:item:punct}% + \hasitemannotation[\currentname][role]% + {\getitemannotation[\currentname][role]} + {\apabbx@printrole@item}}} + {}% +} + +\newcommand*{\apabbx@ifrole@field}{% + \xifinlist{field@\currentname @role@}% + \abx@annotation@defined} + +\newtoggle{apabbx:role:field:punct} + +\newcommand*{\apabbx@rolelist@field}{} +\forcsvlist{\listadd\apabbx@rolelist@field}{% + writers,directors,execproducers,producers,hosts,chairs,guestexperts} + +\newcommand*{\apabbx@printrole@field@i}[1]{% + \iffieldannotation[\currentname][role]{#1} + {\iftoggle{apabbx:role:field:punct} + {\addspace\&\space} {}% - \ifitemannotation[\currentname][role]{guestexpert} - {\bibstring{guestexpert}% - \setunit{\addspace\&\addspace}} - {}}% - \setunit{}} + \bibstring{#1}% + \toggletrue{apabbx:role:field:punct}} + {}% +} + +\newcommand*{\apabbx@printrole@field}{% + \forlistloop{\apabbx@printrole@field@i}{\apabbx@rolelist@field}} % roles for complete name lists -\newbibmacro*{roles}{% - \hasfieldannotation[\currentname][role]% - {\getfieldannotation[\currentname][role]} - {\iffieldannotation[\currentname][role]{writers} - {\bibstring{writers}% - \setunit{\addspace\&\addspace}} - {}% - \iffieldannotation[\currentname][role]{directors} - {\bibstring{directors}% - \setunit{\addspace\&\addspace}} - {}% - \iffieldannotation[\currentname][role]{execproducers} - {\bibstring{execproducers}% - \setunit{\addspace\&\addspace}} - {}% - \iffieldannotation[\currentname][role]{producers} - {\bibstring{producers}% - \setunit{\addspace\&\addspace}} - {}% - \iffieldannotation[\currentname][role]{hosts} - {\bibstring{hosts}% - \setunit{\addspace\&\addspace}} - {}% - \iffieldannotation[\currentname][role]{chairs} - {\bibstring{chairs}% - \setunit{\addspace\&\addspace}} - {}% - \iffieldannotation[\currentname][role]{guestexperts} - {\bibstring{guestexperts}% - \setunit{\addspace\&\addspace}} - {}}% - \setunit{}} +% takes two arguments +% {<pre punct>}{<wrapper>} +\newbibmacro*{roles}[2]{% + \apabbx@ifrole@field + {#1% + #2{% + \togglefalse{apabbx:role:field:punct}% + \hasfieldannotation[\currentname][role]% + {\getfieldannotation[\currentname][role]} + {\apabbx@printrole@field}}} + {}% +} % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -969,7 +977,7 @@ \setunit*{\addcomma\addspace}% \usebibmacro{apaeditorstrg}{editor}% \setunit*{\addspace\&\space}% - \printtext{\bibcpstring{translator}}} + \bibcpstring{translator}} {\ifnameundef{editor}% {}% {\printnames[apanames][-\value{listtotal}]{editor}% @@ -981,13 +989,13 @@ {\setunit{}}% {\printnames[apanames][-\value{listtotal}]{translator}% \setunit{\addcomma\addspace}% - \printtext{\bibcpstring{translator}}% + \bibcpstring{translator}% \clearname{translator}}% \ifnameundef{narrator}% {\setunit{}}% {\printnames[apanames][-\value{listtotal}]{narrator}% \setunit{\addcomma\addspace}% - \printtext{\bibcpstring{narrator}}% + \bibcpstring{narrator}% \clearname{narrator}}}}} \newbibmacro*{editor+trans}{% @@ -1055,7 +1063,10 @@ not test {\iffieldundef{origyear}} not test {\iffieldundef{labelyear}} and not test {\iffieldsequal{labelyear}{origyear}}} - {\printtext{\mkbibparens{\bibcpstring{origyear}~\printorigdate}}% + {\printtext[parens]{% + \bibcpstring{origyear} + \setunit{\addnbspace}% + \printorigdate}% \renewcommand*{\finentrypunct}{\relax}} {}} @@ -1216,11 +1227,12 @@ % (APA 10.12) Audiovisual \newbibmacro*{mainvideo}{% - \iffieldundef{maintitle}{} + \iffieldundef{maintitle} + {} {\usebibmacro{in}% \printnames[apanames][-\value{listtotal}]{execproducer}% \setunit{\addspace}% - \printtext{\mkbibparens{\bibcplstring{execproducers}}}% + \bibcplstring[\mkbibparens]{execproducers}% \setunit{\addcomma\addspace}% \printfield{maintitle}}} @@ -1351,9 +1363,9 @@ % disable normal date printing if it's in the citation info \iftoggle{apa:courtdate} {\iflistundef{organization} - {\printtext{\mkbibparens{#1}}} - {\printtext{\mkbibparens{% - \printlist{organization}\space #1}}}} + {\mkbibparens{#1}} + {\mkbibparens{% + \printlist{organization}\space #1}}} {}} % @@ -1384,7 +1396,7 @@ \newbibmacro*{legmattitle}{% \iffieldundef{title} - {\bibcpsstring{\thefield{source}}% + {\ifbibxstring{\thefield{source}}{\bibcpsstring{\thefield{source}}}{}% \setunit*{\addspace}% \bibcpsstring{\thefield{type}}% \setunit*{\addspace}% @@ -2048,8 +2060,8 @@ {} {\iffieldundef{urlyear} {} - {\printtext{\bibstring{retrieved}}% - \addspace + {\bibstring{retrieved}% + \setunit{\addspace}% \printurldate \setunit{\urldatecomma}% \bibstring{from}% diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/apa.cbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/apa.cbx index 60bce4cd69..40cfadefd9 100644 --- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/apa.cbx +++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/apa.cbx @@ -1,4 +1,4 @@ -%% Copyright 2019 Philip Kime +%% Copyright 2020 Philip Kime %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3 @@ -12,7 +12,7 @@ %% %% The Current Maintainer of this work is Philip Kime. -\ProvidesFile{apa.cbx}[2019/12/22\space v9.4\space APA biblatex citation style] +\ProvidesFile{apa.cbx}[2020/02/01\space v9.5\space APA biblatex citation style] \RequireBiber[3] %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/apa.dbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/apa.dbx index bdf8c528b4..5687733b51 100644 --- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/apa.dbx +++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/apa.dbx @@ -1,4 +1,4 @@ -%% Copyright 2019 Philip Kime +%% Copyright 2020 Philip Kime %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3 @@ -12,7 +12,7 @@ %% %% The Current Maintainer of this work is Philip Kime. -\ProvidesFile{apa.dbx}[2019/12/22\space v9.4\space APA biblatex style data model] +\ProvidesFile{apa.dbx}[2020/02/01\space v9.5\space APA biblatex style data model] \RequireBiber[3] \DeclareDatamodelEntrytypes{ diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/austrian-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/austrian-apa.lbx index 2152e0653b..e98bbb5e17 100644 --- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/austrian-apa.lbx +++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/austrian-apa.lbx @@ -1,4 +1,4 @@ -\ProvidesFile{austrian-apa.lbx}[2019/12/22\space v9.4\space APA biblatex localisation] +\ProvidesFile{austrian-apa.lbx}[2020/02/01\space v9.5\space APA biblatex localisation] \InheritBibliographyExtras{austrian} % Following DGPs guidlines for German/Austrian diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa-test-references.bib b/macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa-test-references.bib index f1a2f31010..66eb59f056 100644 --- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa-test-references.bib +++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa-test-references.bib @@ -502,16 +502,6 @@ DOI = {10.1080/09658211.2018.1441423}, } - - - - - - - - - - % (APA 10.1 Example 1) % Note that the URL is suppressed if there is a DOI @ARTICLE{10.1:1, diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa-test.pdf b/macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa-test.pdf Binary files differindex 9e8550bb05..c98168fa60 100644 --- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa-test.pdf +++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa-test.pdf diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa.pdf b/macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa.pdf Binary files differindex e60a13f702..1688d3a536 100644 --- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa.pdf +++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa.pdf diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa.tex b/macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa.tex index fa2745dad1..ba07b6c704 100644 --- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa.tex +++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/biblatex-apa.tex @@ -24,7 +24,7 @@ url={http://mirror.ctan.org/macros/latex/exptl/biblatex-contrib/biblatex-apa/}, author={Philip Kime}, email={Philip@kime.org.uk}, - revision={9.4}, + revision={9.5}, date={\today}} \hypersetup{% @@ -397,6 +397,14 @@ the examples. \begin{changelog} +\begin{release}{9.5}{2020-02-01} +\item Bugfixes +\end{release} + +\begin{release}{9.4}{2019-12-22} +\item Bugfixes +\end{release} + \begin{release}{9.3}{2019-12-21} \item Rationalised some entrytype usage \end{release} diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/brazilian-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/brazilian-apa.lbx index 32ea0349e4..2d255a0670 100644 --- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/brazilian-apa.lbx +++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/brazilian-apa.lbx @@ -1,4 +1,4 @@ -\ProvidesFile{brazilian-apa.lbx}[2019/12/22\space v9.4\space APA biblatex localisation] +\ProvidesFile{brazilian-apa.lbx}[2020/02/01\space v9.5\space APA biblatex localisation] \InheritBibliographyExtras{brazilian} \NewBibliographyString{revisededition} diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/british-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/british-apa.lbx index d33e390f92..e250ee65a3 100644 --- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/british-apa.lbx +++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/british-apa.lbx @@ -1,4 +1,4 @@ -\ProvidesFile{british-apa.lbx}[2019/12/22\space v9.4\space APA biblatex localisation] +\ProvidesFile{british-apa.lbx}[2020/02/01\space v9.5\space APA biblatex localisation] \InheritBibliographyExtras{british} \NewBibliographyString{revisededition} diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/danish-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/danish-apa.lbx index 5eb2430cf1..e1d31d68a0 100644 --- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/danish-apa.lbx +++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/danish-apa.lbx @@ -1,4 +1,4 @@ -\ProvidesFile{danish-apa.lbx}[2019/12/22\space v9.4\space APA biblatex localisation] +\ProvidesFile{danish-apa.lbx}[2020/02/01\space v9.5\space APA biblatex localisation] \InheritBibliographyExtras{danish} \NewBibliographyString{revisededition} diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/dutch-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/dutch-apa.lbx index 3f36d6331b..a25af318fd 100644 --- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/dutch-apa.lbx +++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/dutch-apa.lbx @@ -1,4 +1,4 @@ -\ProvidesFile{dutch-apa.lbx}[2019/12/22\space v9.4\space APA biblatex localisation] +\ProvidesFile{dutch-apa.lbx}[2020/02/01\space v9.5\space APA biblatex localisation] \InheritBibliographyExtras{dutch} \NewBibliographyString{revisededition} diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/english-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/english-apa.lbx index 8d0e798320..fd325840d3 100644 --- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/english-apa.lbx +++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/english-apa.lbx @@ -1,4 +1,4 @@ -\ProvidesFile{english-apa.lbx}[2019/12/22\space v9.4\space APA biblatex localisation] +\ProvidesFile{english-apa.lbx}[2020/02/01\space v9.5\space APA biblatex localisation] \InheritBibliographyExtras{english} \NewBibliographyString{revisededition} diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/french-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/french-apa.lbx index 53ef923c6d..ff34c5bd69 100644 --- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/french-apa.lbx +++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/french-apa.lbx @@ -1,4 +1,4 @@ -\ProvidesFile{french-apa.lbx}[2019/12/22\space v9.4\space APA biblatex localisation] +\ProvidesFile{french-apa.lbx}[2020/02/01\space v9.5\space APA biblatex localisation] \InheritBibliographyExtras{french} \NewBibliographyString{revisededition} diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/galician-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/galician-apa.lbx index 8d340301d2..7baef5db24 100644 --- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/galician-apa.lbx +++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/galician-apa.lbx @@ -1,4 +1,4 @@ -\ProvidesFile{galician-apa.lbx}[2019/12/22\space v9.4\space APA biblatex localisation] +\ProvidesFile{galician-apa.lbx}[2020/02/01\space v9.5\space APA biblatex localisation] \InheritBibliographyExtras{galician} \setcounter{smartand}{0} % Turn off "smart and" or ampersands will all be replaced diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/german-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/german-apa.lbx index 9262e8b254..27be3dc3d2 100644 --- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/german-apa.lbx +++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/german-apa.lbx @@ -1,4 +1,4 @@ -\ProvidesFile{german-apa.lbx}[2019/12/22\space v9.4\space APA biblatex localisation] +\ProvidesFile{german-apa.lbx}[2020/02/01\space v9.5\space APA biblatex localisation] \InheritBibliographyExtras{german} % Following DGPs guidlines for German/Austrian diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/greek-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/greek-apa.lbx index 45d00c966b..1741c080a1 100644 --- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/greek-apa.lbx +++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/greek-apa.lbx @@ -1,4 +1,4 @@ -\ProvidesFile{greek-apa.lbx}[2019/12/22\space v9.4\space APA biblatex localisation] +\ProvidesFile{greek-apa.lbx}[2020/02/01\space v9.5\space APA biblatex localisation] \InheritBibliographyExtras{greek} \NewBibliographyString{revisededition} diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/italian-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/italian-apa.lbx index dfed969730..73cd0ebdf3 100644 --- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/italian-apa.lbx +++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/italian-apa.lbx @@ -1,4 +1,4 @@ -\ProvidesFile{italian-apa.lbx}[2019/12/22\space v9.4\space APA biblatex localisation] +\ProvidesFile{italian-apa.lbx}[2020/02/01\space v9.5\space APA biblatex localisation] \InheritBibliographyExtras{italian} \NewBibliographyString{revisededition} diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/naustrian-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/naustrian-apa.lbx index 201cfa1c07..13aa253002 100644 --- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/naustrian-apa.lbx +++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/naustrian-apa.lbx @@ -1,4 +1,4 @@ -\ProvidesFile{naustrian-apa.lbx}[2019/12/22\space v9.4\space APA biblatex localisation] +\ProvidesFile{naustrian-apa.lbx}[2020/02/01\space v9.5\space APA biblatex localisation] \InheritBibliographyExtras{naustrian} % Following DGPs guidlines for German/Austrian diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/ngerman-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/ngerman-apa.lbx index fe72f9b8f6..de82a0556c 100644 --- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/ngerman-apa.lbx +++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/ngerman-apa.lbx @@ -1,4 +1,4 @@ -\ProvidesFile{ngerman-apa.lbx}[2019/12/22\space v9.4\space APA biblatex localisation] +\ProvidesFile{ngerman-apa.lbx}[2020/02/01\space v9.5\space APA biblatex localisation] \InheritBibliographyExtras{ngerman} % Following DGPs guidlines for German/Austrian diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/norsk-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/norsk-apa.lbx index ac3f89d301..15ba2bf677 100644 --- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/norsk-apa.lbx +++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/norsk-apa.lbx @@ -1,4 +1,4 @@ -\ProvidesFile{norsk-apa.lbx}[2019/12/22\space v9.4\space APA biblatex localisation] +\ProvidesFile{norsk-apa.lbx}[2020/02/01\space v9.5\space APA biblatex localisation] \InheritBibliographyExtras{norsk} \NewBibliographyString{revisededition} diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/norwegian-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/norwegian-apa.lbx index 7578dcd0dd..0fc240f30b 100644 --- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/norwegian-apa.lbx +++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/norwegian-apa.lbx @@ -1,4 +1,4 @@ -\ProvidesFile{norwegian-apa.lbx}[2019/12/22\space v9.4\space APA biblatex localisation] +\ProvidesFile{norwegian-apa.lbx}[2020/02/01\space v9.5\space APA biblatex localisation] \InheritBibliographyExtras{norwegian} \NewBibliographyString{revisededition} diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/nswissgerman-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/nswissgerman-apa.lbx index e0bee5c83c..02d8a1fc9a 100644 --- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/nswissgerman-apa.lbx +++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/nswissgerman-apa.lbx @@ -1,4 +1,4 @@ -\ProvidesFile{nswissgerman-apa.lbx}[2019/12/22\space v9.4\space APA biblatex localisation] +\ProvidesFile{nswissgerman-apa.lbx}[2020/02/01\space v9.5\space APA biblatex localisation] \InheritBibliographyExtras{nswissgerman} % Following DGPs guidlines for German/Austrian/Swiss German diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/nynorsk-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/nynorsk-apa.lbx index f06936bbfa..c3e34ba4d7 100644 --- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/nynorsk-apa.lbx +++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/nynorsk-apa.lbx @@ -1,4 +1,4 @@ -\ProvidesFile{nynorsk-apa.lbx}[2019/12/22\space v9.4\space APA biblatex localisation] +\ProvidesFile{nynorsk-apa.lbx}[2020/02/01\space v9.5\space APA biblatex localisation] \InheritBibliographyExtras{nynorsk} \NewBibliographyString{revisededition} diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/portuguese-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/portuguese-apa.lbx index 6e80f0791b..8ab547b392 100644 --- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/portuguese-apa.lbx +++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/portuguese-apa.lbx @@ -1,4 +1,4 @@ -\ProvidesFile{portuguese-apa.lbx}[2019/12/22\space v9.4\space APA biblatex localisation] +\ProvidesFile{portuguese-apa.lbx}[2020/02/01\space v9.5\space APA biblatex localisation] \InheritBibliographyExtras{portuguese} \NewBibliographyString{revisededition} diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/russian-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/russian-apa.lbx index 7f0292a4a4..130f9db214 100644 --- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/russian-apa.lbx +++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/russian-apa.lbx @@ -1,4 +1,4 @@ -\ProvidesFile{russian-apa.lbx}[2019/12/22\space v9.4\space APA biblatex localisation] +\ProvidesFile{russian-apa.lbx}[2020/02/01\space v9.5\space APA biblatex localisation] \InheritBibliographyExtras{russian} \NewBibliographyString{revisededition} diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/slovene-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/slovene-apa.lbx index 128514c4de..7c6d66f25e 100644 --- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/slovene-apa.lbx +++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/slovene-apa.lbx @@ -1,4 +1,4 @@ -\ProvidesFile{slovene-apa.lbx}[2019/12/22\space v9.4\space APA biblatex localisation] +\ProvidesFile{slovene-apa.lbx}[2020/02/01\space v9.5\space APA biblatex localisation] \InheritBibliographyExtras{slovene} \NewBibliographyString{revisededition} diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/spanish-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/spanish-apa.lbx index 1472a1f9ef..60c7c1773a 100644 --- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/spanish-apa.lbx +++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/spanish-apa.lbx @@ -1,4 +1,4 @@ -\ProvidesFile{spanish-apa.lbx}[2019/12/22\space v9.4\space APA biblatex localisation] +\ProvidesFile{spanish-apa.lbx}[2020/02/01\space v9.5\space APA biblatex localisation] \InheritBibliographyExtras{spanish} \setcounter{smartand}{0} % Turn off "smart and" or ampersands will all be replaced diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/swedish-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/swedish-apa.lbx index 691d202eec..b6bc5dd15b 100644 --- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/swedish-apa.lbx +++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/swedish-apa.lbx @@ -1,4 +1,4 @@ -\ProvidesFile{swedish-apa.lbx}[2019/12/22\space v9.4\space APA biblatex localisation] +\ProvidesFile{swedish-apa.lbx}[2020/02/01\space v9.5\space APA biblatex localisation] \InheritBibliographyExtras{swedish} \NewBibliographyString{revisededition} diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-apa/swissgerman-apa.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-apa/swissgerman-apa.lbx index d48a68ad7c..283a7aa28c 100644 --- a/macros/latex/contrib/biblatex-contrib/biblatex-apa/swissgerman-apa.lbx +++ b/macros/latex/contrib/biblatex-contrib/biblatex-apa/swissgerman-apa.lbx @@ -1,4 +1,4 @@ -\ProvidesFile{swissgerman-apa.lbx}[2019/12/22\space v9.4\space APA biblatex localisation] +\ProvidesFile{swissgerman-apa.lbx}[2020/02/01\space v9.5\space APA biblatex localisation] \InheritBibliographyExtras{swissgerman} % Following DGPs guidlines for German/Austrian/Swiss German diff --git a/macros/latex/contrib/chemformula/README b/macros/latex/contrib/chemformula/README index 3323880942..5de7b5d18b 100644 --- a/macros/latex/contrib/chemformula/README +++ b/macros/latex/contrib/chemformula/README @@ -1,14 +1,14 @@ -------------------------------------------------------------------------- -the CHEMFORMULA package v4.15g 2019/09/27 +the CHEMFORMULA package v4.15i 2020/02/01 typeset chemical compounds and reactions -------------------------------------------------------------------------- Clemens Niederberger -Web: http://www.mychemistry.eu/forums/forum/chemformula/ +Web: https://github.com/cgnieder/chemformula/ E-Mail: contact@mychemistry.eu -------------------------------------------------------------------------- -Copyright 2011-2019 Clemens Niederberger +Copyright 2011--2020 Clemens Niederberger This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3 @@ -24,7 +24,7 @@ The Current Maintainer of this work is Clemens Niederberger. -------------------------------------------------------------------------- The chemformula package consists of the following files - chemformula.sty, - - chemformula_en.tex, chemformula_en.pdf, + - chemformula-manual.cls, chemformula-manual.tex, chemformula-manual.pdf, - README -------------------------------------------------------------------------- If you have any ideas, questions, suggestions or bugs to report, please diff --git a/macros/latex/contrib/chemformula/chemformula-manual.cls b/macros/latex/contrib/chemformula/chemformula-manual.cls new file mode 100644 index 0000000000..e57fd96154 --- /dev/null +++ b/macros/latex/contrib/chemformula/chemformula-manual.cls @@ -0,0 +1,304 @@ +% -------------------------------------------------------------------------- +% the CHEMFORMULA package +% +% typeset chemical compounds and reactions +% +% -------------------------------------------------------------------------- +% Clemens Niederberger +% -------------------------------------------------------------------------- +% https://github.com/cgnieder/chemformula/ +% contact@mychemistry.eu +% -------------------------------------------------------------------------- +% If you have any ideas, questions, suggestions or bugs to report, please +% feel free to contact me. +% -------------------------------------------------------------------------- +% Copyright 2011--2020 Clemens Niederberger +% +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2005/12/01 or later. +% +% This work has the LPPL maintenance status `maintained'. +% +% The Current Maintainer of this work is Clemens Niederberger. +% -------------------------------------------------------------------------- +\ProvidesClass{chemformula-manual}[2020/02/01] + +\LoadClass[load-preamble,add-index]{cnltx-doc} +\RequirePackage{imakeidx} +\RequirePackage[utf8]{inputenc} + +\RequirePackage{chemformula} +\RequirePackage{chemmacros} + +\setcnltx{ + package = {chemformula}, + info = {typeset chemical compounds and reactions} , + url = http://www.mychemistry.eu/forums/forum/chemformula/ , + authors = Clemens Niederberger , + email = contact@mychemistry.eu , + abstract = {% + \centering + \includegraphics{chemmacros-logo.pdf} + \par + } , + add-cmds = { + bond, + ce, ch, charrow, chcpd, chemformula@bondlength, chemsetup, chlewis, + chname, + DeclareChemAdditionSymbol, DeclareChemArrow, DeclareChemBond, + DeclareChemBondAlias, DeclareChemCompoundProperty, DeclareChemSymbol, + mch, + NewChemAdditionSymbol, NewChemArrow, NewChemBond, NewChemBondAlias, + NewChemCompoundProperty, NewChemSymbol, + ox, OX, + pch, + redox, RemoveChemCompoundProperty, RenewChemAdditionSymbol, + RenewChemArrow, RenewChemBond, RenewChemCompoundProperty, + RenewChemSymbol, + setchemformula, ShowChemArrow, ShowChemBond + } , + add-silent-cmds = { + addplot, + chemfig, + DeclareInstance, draw, + sample, setchemfig, sfrac, + usetikzlibrary + } , + index-setup = { othercode=\footnotesize, level=\section } , + makeindex-setup = { columns=3, columnsep=1em } +} + +\RequirePackage{chemfig,booktabs,cancel,varioref} +\RequirePackage[version=4]{mhchem} + +\def\libertine@figurestyle{LF} +\RequirePackage{amsmath} +\undef\lvert \undef\lVert +\undef\rvert \undef\rVert +\RequirePackage[libertine]{newtxmath} +\def\libertine@figurestyle{OsF} + +\RequirePackage{fontawesome} +\RequirePackage{datetime2} +\DTMsetup{useregional=numeric,datesep=/} +\newrobustcmd*\chemformula@add@version[2]{% + \csdef{chemformula@ver@#2}{% + \DTMdate{#1}% + \csgdef{chemformula@ver@#2used}{}% + \csdef{chemformula@ver@#2}{\DTMdate{#1}}% + }% +} + +\newrobustcmd*\chemformula@date[1]{% + \ifcsdef{chemformula@ver@#1used}{}{ (\csuse{chemformula@ver@#1})}} +\newrobustcmd*\chemformula@ifnew[1]{\ifcsstring{c_chemformula_version_tl}{#1}} +\newrobustcmd*\chemformula@NEW{\faStarO\ New} + +\renewrobustcmd*\sinceversion[1]{% + \chemformula@ifnew{#1}% + {\cnltx@version@note{\textcolor{red}{\chemformula@NEW}}}% + {\cnltx@version@note{\GetTranslation{cnltx-introduced}~#1\chemformula@date{#1}}}% +} +\renewrobustcmd*\changedversion[1]{% + \cnltx@version@note{\GetTranslation{cnltx-changed}~#1\chemformula@date{#1}}% +} + +\newnote*\sincechanged[2]{% + \GetTranslation{cnltx-introduced}~#1\chemformula@date{#1}, + changed with version~#2\chemformula@date{#2}\chemformula@ifnew{#2}{ \chemformula@NEW}{}% +} + +\RenewDocumentEnvironment{commands}{} + {% + \cnltx@set@catcode_{12}% + \let\command\cnltx@command + \cnltxlist + } + {\endcnltxlist} + +\RequirePackage{tcolorbox,xsimverb} +\tcbuselibrary{skins,breakable} +\tcbset{enhanced,enhanced jigsaw} + +\newtcolorbox{bewareofthedog}{ + colback = white , + colframe = red , + underlay={% + \path[draw=none] + (interior.south west) + rectangle node[red]{\Huge\bfseries !} + ([xshift=-4mm]interior.north west); + }% +} + +\newtcolorbox{cnltxcode}[1][]{ + boxrule = 1pt , + colback = cnltxbg , + colframe = cnltx , + arc = 5pt , + beforeafter skip = .5\baselineskip ,% + #1% +} + +\newcommand*\chemformula@readoptions[1]{% + \catcode`\^^M=13 + \chemformula@read@options{#1}% +} + +\begingroup +\catcode`\^^M=13 +\gdef\chemformula@read@options#1#2^^M{% + \endgroup + \ifblank{#2}{}{\chemformula@read@options@#2}% + #1% + \XSIMfilewritestart*{\jobname.tmp}% +}% +\endgroup +\def\chemformula@read@options@[#1]{\pgfqkeys{/cnltx}{#1}} + +\RenewDocumentEnvironment{sourcecode}{} + {% + \begingroup + \chemformula@readoptions{% + \setlength\cnltx@sidebysidewidth + {\dimexpr .45\columnwidth -\lst@xleftmargin -\lst@xrightmargin\relax}% + \expanded{% + \noexpand\lstset{ + style=cnltx, + \ifboolexpe{ bool {cnltx@sidebyside} and not bool {cnltx@codeonly} } + {linewidth=\cnltx@sidebysidewidth,}{}% + \expandonce\cnltx@local@listings@options + }% + }% + \XSIMgobblechars{2}% + }% + } + {% + \XSIMfilewritestop + \cnltxcode[breakable]% + \lstinputlisting[style=cnltx]{\jobname.tmp}% + \endcnltxcode + } + +\RenewDocumentEnvironment{example}{} + {% + \begingroup + \chemformula@readoptions{% + \setlength\cnltx@sidebysidewidth + {\dimexpr .45\columnwidth -\lst@xleftmargin -\lst@xrightmargin\relax}% + \expanded{% + \noexpand\lstset{ + style=cnltx, + \ifboolexpe{ bool {cnltx@sidebyside} and not bool {cnltx@codeonly} } + {linewidth=\cnltx@sidebysidewidth,}{}% + \expandonce\cnltx@local@listings@options + }% + }% + \XSIMgobblechars{2}% + }% + } + {% + \XSIMfilewritestop + \ifbool{cnltx@sidebyside} + {% + \cnltxcode + \noindent + \minipage[c]{\cnltx@sidebysidewidth}% + \cnltx@pre@source@hook + \lstinputlisting[style=cnltx] {\jobname.tmp}% + \cnltx@after@source@hook + \endminipage\hfill + \minipage[c]{\cnltx@sidebysidewidth}% + \cnltx@pre@example@hook + \input {\jobname.tmp}% + \cnltx@after@example@hook + \endminipage + } + {% + \cnltxcode[breakable]% + \cnltx@pre@source@hook + \lstinputlisting{\jobname.tmp}% + \cnltx@after@source@hook + \tcblower + \cnltx@pre@example@hook + \input {\jobname.tmp}% + \cnltx@after@example@hook + }% + \endcnltxcode + } + +\RequirePackage[ + backend=biber, + style=cnltx, + sortlocale=en_US, + indexing=cite]{biblatex} +\RequirePackage{csquotes,varioref} +\defbibheading{bibliography}{\section{References}} + +\RequirePackage[biblatex]{embrac}[2012/06/29] +\ChangeEmph{[}[,.02em]{]}[.055em,-.08em] +\ChangeEmph{(}[-.01em,.04em]{)}[.04em,-.05em] + +\chemformula@add@version{2012-01-28}{3.0} +\chemformula@add@version{2012-01-30}{3.0a} +\chemformula@add@version{2012-02-03}{3.0b} +\chemformula@add@version{2012-02-05}{3.0c} +\chemformula@add@version{2012-02-10}{3.0d} +\chemformula@add@version{2012-02-19}{3.1} +\chemformula@add@version{2012-02-26}{3.1a} +\chemformula@add@version{2012-03-03}{3.1b} +\chemformula@add@version{2012-03-14}{3.1c} +\chemformula@add@version{2012-03-20}{3.2} +\chemformula@add@version{2012-05-07}{3.3} +\chemformula@add@version{2012-05-13}{3.3a} +\chemformula@add@version{2012-05-18}{3.3b} +\chemformula@add@version{2012-05-18}{3.3c} +\chemformula@add@version{2012-07-24}{3.3d} +\chemformula@add@version{2012-08-21}{3.3e} +\chemformula@add@version{2012-09-11}{3.4} +\chemformula@add@version{2012-10-03}{3.4a} +\chemformula@add@version{2013-01-04}{3.4b} +\chemformula@add@version{2013-01-28}{3.5} +\chemformula@add@version{2013-02-19}{3.5a} +\chemformula@add@version{2013-02-26}{3.6} +\chemformula@add@version{2013-02-27}{3.6a} +\chemformula@add@version{2013-04-19}{3.6b} +\chemformula@add@version{2013-07-06}{4.0} +\chemformula@add@version{2013-07-26}{4.0a} +\chemformula@add@version{2013-08-24}{4.1} +\chemformula@add@version{2013-10-24}{4.2} +\chemformula@add@version{2013-11-04}{4.2a} +\chemformula@add@version{2014-01-24}{4.3} +\chemformula@add@version{2014-01-29}{4.4} +\chemformula@add@version{2014-04-07}{4.5} +\chemformula@add@version{2014-06-30}{4.6} +\chemformula@add@version{2014-08-04}{4.7} +\chemformula@add@version{2014-08-08}{4.8} +\chemformula@add@version{2014-10-07}{4.9} +\chemformula@add@version{2015-03-16}{4.10} +\chemformula@add@version{2015-04-03}{4.10a} +\chemformula@add@version{2015-06-30}{4.11} +\chemformula@add@version{2015-08-12}{4.12} +\chemformula@add@version{2015-08-29}{4.12a} +\chemformula@add@version{2015-09-08}{4.12b} +\chemformula@add@version{2015-01-01}{4.13} +\chemformula@add@version{2015-10-21}{4.14} +\chemformula@add@version{2016-01-07}{4.14a} +\chemformula@add@version{2016-05-03}{4.14b} +\chemformula@add@version{2016-05-11}{4.15} +\chemformula@add@version{2016-06-08}{4.15a} +\chemformula@add@version{2016-06-08}{4.15b} +\chemformula@add@version{2016-08-21}{4.15c} +\chemformula@add@version{2017-02-02}{4.15d} +\chemformula@add@version{2017-03-23}{4.15e} +\chemformula@add@version{2019-09-23}{4.15f} +\chemformula@add@version{2019-09-27}{4.15g} +\chemformula@add@version{2019-10-13}{4.15h} +\chemformula@add@version{2020-02-01}{4.15i} + +\endinput diff --git a/macros/latex/contrib/chemformula/chemformula_en.pdf b/macros/latex/contrib/chemformula/chemformula-manual.pdf Binary files differindex b32d5e8205..ab030bac8a 100644 --- a/macros/latex/contrib/chemformula/chemformula_en.pdf +++ b/macros/latex/contrib/chemformula/chemformula-manual.pdf diff --git a/macros/latex/contrib/chemformula/chemformula_en.tex b/macros/latex/contrib/chemformula/chemformula-manual.tex index 234fa89f71..6ceb89003d 100644 --- a/macros/latex/contrib/chemformula/chemformula_en.tex +++ b/macros/latex/contrib/chemformula/chemformula-manual.tex @@ -16,7 +16,7 @@ % If you have any ideas, questions, suggestions or bugs to report, please % feel free to contact me. % -------------------------------------------------------------------------- -% Copyright 2011-2019 Clemens Niederberger +% Copyright 2011--2020 Clemens Niederberger % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either version 1.3 @@ -30,60 +30,9 @@ % % The Current Maintainer of this work is Clemens Niederberger. % -------------------------------------------------------------------------- -\documentclass[load-preamble+]{cnltx-doc} -\usepackage[utf8]{inputenc} -\usepackage[T1]{fontenc} -\usepackage{chemformula} -\usepackage{chemmacros} -\setcnltx{ - package = {chemformula}, - info = {typeset chemical compounds and reactions} , - url = http://www.mychemistry.eu/forums/forum/chemformula/ , - authors = Clemens Niederberger , - email = contact@mychemistry.eu , - abstract = {% - \centering - \includegraphics{chemmacros-logo.pdf} - \par - } , - add-cmds = { - bond, - ce, ch, charrow, chcpd, chemformula@bondlength, chemsetup, chlewis, - chname, - DeclareChemAdditionSymbol, DeclareChemArrow, DeclareChemBond, - DeclareChemBondAlias, DeclareChemCompoundProperty, DeclareChemSymbol, - mch, - NewChemAdditionSymbol, NewChemArrow, NewChemBond, NewChemBondAlias, - NewChemCompoundProperty, NewChemSymbol, - ox, OX, - pch, - redox, RemoveChemCompoundProperty, RenewChemAdditionSymbol, - RenewChemArrow, RenewChemBond, RenewChemCompoundProperty, - RenewChemSymbol, - setchemformula, ShowChemArrow, ShowChemBond - } , - add-silent-cmds = { - addplot, - chemfig, - DeclareInstance, draw, - sample, setchemfig, sfrac, - usetikzlibrary - } , - index-setup = { othercode=\footnotesize, level=\section , noclearpage } , - makeindex-setup = { columns=3, columnsep=1em } -} - -\usepackage{chemfig,booktabs,cancel,varioref} -\usepackage[version=4]{mhchem} +\documentclass{chemformula-manual} -\makeatletter -\def\libertine@figurestyle{LF} -\RequirePackage{amsmath} -\undef\lvert \undef\lVert -\undef\rvert \undef\rVert -\RequirePackage[libertine]{newtxmath} -\def\libertine@figurestyle{OsF} -\makeatother +\addbibresource{cnltx.bib} \chemsetup{ greek = newtx , @@ -92,11 +41,6 @@ chemformula/format = \libertineLF } -\usepackage[biblatex]{embrac} -\ChangeEmph{[}[,.02em]{]}[.055em,-.08em] -\ChangeEmph{(}[-.01em,.04em]{)}[.04em,-.05em] -\usepackage{csquotes} - \usepackage[accsupp]{acro} \acsetup{ long-format = \scshape , @@ -109,9 +53,6 @@ accsupp = IUPAC } -% \chemsetup{ option/synchronize } -% \setchemformula{ format = \libertineLF } - \sisetup{ detect-mode=false, mode=text, @@ -310,20 +251,6 @@ or need to divide them you need to add an empty group: \cs{ch}\Marg{\cs*{command}\marg{} ABC}. The different input types are described in the following sections. -% % TODO: Module überdenken, Beschreibung anpassen -% There are some options to customize the output of the \cs{ch} command. They -% can either be applied locally using the optional argument or can be set -% globally using the setup command. All options of \chemformula\ belong to the -% module \module{chemformula} and can be set in different ways: -% \begin{commands} -% \command{chemsetup}[\Oarg{chemformula}\marg{options}] -% when loaded via \chemmacros -% \command{chemsetup}[\Marg{chemformula/\meta{options}}] -% when loaded via \chemmacros -% \command{setchemformula}[\marg{options}] -% independent from \chemmacros -% \end{commands} - \section{Stoichiometric Factors} A stoichiometric factor may only contain of numbers and the signs \verbcode+.,_/()+ @@ -1588,89 +1515,6 @@ There are a number of options for customizations: Symbol for neutral particles. \end{options} - - -% \section{Further Examples} -% This section presents some examples of a possible usage. - -% \begin{example} -% \begin{reaction}[Synthese von Alkanen] -% !(Synthesegas)( $n$ CO + $(2n+1)$ H2 ) -% ->[\SI{200}{\celsius}][[CoNi]] -% C_{$n$}H_{$2n+2$} + $n$ H2O -% \end{reaction} -% \end{example} - -% \begin{example} -% \begin{reactions*} -% "a)" && CH4 + Cl2 &-> CH3Cl + HCl && "{\small Chlormethan/Methylchlorid}" \\ -% "b)" && CH3Cl + Cl2 &-> CH2Cl2 + HCl && "{\small Dichlormethan/Methylenchlorid}" \\ -% "c)" && CH2Cl2 + Cl2 &-> CHCl3 + HCl && "{\small Trichlormethan/Chloroform}" \\ -% "d)" && CHCl3 + Cl2 &-> CCl4 + HCl && "{\small Tetrachlormethan/Tetrachlorkohlenstoff}" -% \end{reactions*} -% \end{example} - -% \begin{example} -% \chemsetup[ox]{parse=false} -% \ch{ -% "\ox{\delm,C}" -{} "\ox{\delp,M}" \qquad -% ( <-> "\ox{\delp,C}" -{} "\ox{\delm,Br}" ) -% } \\ -% \ch[adduct-space=0pt]{X. + .Y <=> X-Y + Bindungsenergie} \\ -% \ch[name-format=\normalsize]{ -% !(\State{H}{f}\qquad)() !(\textcolor{red}{??})( CH4\gas{} ) + -% !(\num{0})( 2 O2\gas{} ) -% -> -% !(\num{-94.3})( CO2\gas{} ) + -% !(\num{-57.9})( H2O\lqd{} ) + -% !(\num{-192.1})( "\State{H}" ) -% } -% \end{example} - -% \begin{example} -% \newcommand\cstack[1]{% -% \clap{% -% \begin{tabular}{c} -% #1 -% \end{tabular} -% }% -% } -% \begin{reactions*} -% CH3MgBr + "\ox*{1,Cu}" X & -% -> "\glqq" CH3 "\ox*{1,Cu}\grqq" + MgBrX "\qquad X~$=$~Br,I,CN" \\ -% 2 MeLi + CuI & -% -> !(\cstack{Dimethylcuprat\\(Gilmann-Cuprat)})( Me2CuLi ) + Li -% \end{reactions*} -% \end{example} - -% \begin{example} -% % needs `chemfig' -% \begin{reactions*} -% H3C-CH3 + Cl2 & -% ->[$\Delta$][$h\nu$] H3CCH2Cl + HCl & & -% "\Enthalpy{-27.1}" \\ -% H3C-CH3 + "\Lewis{0.,Cl}" & -% -> H3CCH2 "\Lewis{0.,\vphantom{H}}" + HCl & & -% "\Enthalpy{-5.0}" \\ -% H3C-CH2 "\Lewis{0.,\vphantom{H}}" + Cl2 & -% -> H3CCH2Cl + "\Lewis{0.,Cl}" & & -% "\Enthalpy{-23.0}" -% \end{reactions*} -% \end{example} - -% The following example shows how the cancelling of compounds could be -% done\footnote{Inspired by a question on TeX.SE: -% \url{http://tex.stackexchange.com/q/30118/5049}}. -% \begin{example} -% % needs `cancel' -% \begin{align*} -% \ch{\cancel{HCOOH\aq} + H2O\lqd{} &<=> H3O^+\aq{} + \cancel{HCOO^-\aq}} \\ -% \ch{\cancel{HCOO^-\aq} + H2O\lqd{} &<=> \cancel{HCOOH\aq} + OH^-\aq}\\[-1ex] -% \cline{1-2} -% \ch{H2O\lqd{} + H2O\lqd{} &<=> H3O^+\aq{} + OH^-\aq} -% \end{align*} -% \end{example} - \appendix \newenvironment{changes}[2][]{% \subsection*{Version #2\ifblank{#1}{}{ (#1)}} @@ -1770,4 +1614,13 @@ There are a number of options for customizations: \change New option \option{adduct-penalty}. \end{changes} +\begin{changes}{4.15} + \change The order of arrow definitions doesn't matter any more. + \change New quasi equilibria arrows. + \change Require \pkg{amsmath}. + \change Allow \option{name-format} to end with a macro that takes an + argument. + \change Various bug fixes. +\end{changes} + \end{document} diff --git a/macros/latex/contrib/chemformula/chemformula.sty b/macros/latex/contrib/chemformula/chemformula.sty index 4fc8bb60ed..f54109bf59 100644 --- a/macros/latex/contrib/chemformula/chemformula.sty +++ b/macros/latex/contrib/chemformula/chemformula.sty @@ -12,7 +12,7 @@ % If you have any ideas, questions, suggestions or bugs to report, please % feel free to contact me. % -------------------------------------------------------------------------- -% Copyright 2011-2019 Clemens Niederberger +% Copyright 2011--2020 Clemens Niederberger % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either version 1.3 @@ -30,9 +30,9 @@ \usetikzlibrary{arrows.meta} \ExplSyntaxOn -\tl_const:Nn \c_chemformula_date_tl {2019/10/13} +\tl_const:Nn \c_chemformula_date_tl {2020/02/01} \tl_const:Nn \c_chemformula_version_number_tl {4.15} -\tl_const:Nn \c_chemformula_version_suffix_tl {h} +\tl_const:Nn \c_chemformula_version_suffix_tl {i} \tl_const:Nx \c_chemformula_version_tl { \c_chemformula_version_number_tl \c_chemformula_version_suffix_tl } \tl_const:Nn \c_chemformula_info_tl @@ -1487,17 +1487,18 @@ \cs_new_protected:Npn \chemformula_bond:n #1 { \chemformula_skip_nobreak:N \l__chemformula_bond_space_dim + \hbox_set:Nn \l__chemformula_tmpa_box {K} + \dim_set:Nn \l__chemformula_tmpa_dim { \box_ht:N \l__chemformula_tmpa_box } \chemformula_tikz:nn { inner~sep = 0pt , outer~sep = 0pt , - text~height = 1em , + text~height = \l__chemformula_tmpa_dim , baseline = (chemformula-bond-ground.base) } { - \draw node[ draw=none, minimum~height=1em, minimum~width=0 ] - (chemformula-bond-ground) at (0pt,0pt) {}; - \draw (chemformula-bond-ground) ++ (0pt,-.1716em) + \coordinate (chemformula-bond-ground) at (0pt,0pt) ; + \draw (chemformula-bond-ground) ++ (0pt,.5\l__chemformula_tmpa_dim) coordinate (chemformula-bond-start) ; \draw (chemformula-bond-start) ++(\l__chemformula_bond_dim ,0pt) coordinate (chemformula-bond-end) ; @@ -3578,6 +3579,7 @@ VERSION HISTORY (https://tex.stackexchange.com/q/511592/) - fix bug: local format changes are now applied again +2020/02/01 - version 4.15i - fix issue #12 % -------------------------------------------------------------------------- % IDEAS: diff --git a/macros/latex/contrib/ducksay/README.md b/macros/latex/contrib/ducksay/README.md index b09e3d5fb2..1e74c85621 100644 --- a/macros/latex/contrib/ducksay/README.md +++ b/macros/latex/contrib/ducksay/README.md @@ -9,7 +9,7 @@ option) any later version. The latest version of this license is in the file: This work is "maintained" (as per LPPL maintenance status) by Jonathan P. Spratte. -Copyright (C) 2017-2019 by Jonathan P. Spratte +Copyright (C) 2017-2020 by Jonathan P. Spratte The package draws ASCII art of animals saying a specified message. The following macros are available: diff --git a/macros/latex/contrib/ducksay/ducksay.dtx b/macros/latex/contrib/ducksay/ducksay.dtx index a6479e46ff..9dbc894562 100644 --- a/macros/latex/contrib/ducksay/ducksay.dtx +++ b/macros/latex/contrib/ducksay/ducksay.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% File: ducksay.dtx Copyright (C) 2017-2019 Jonathan P. Spratte +% File: ducksay.dtx Copyright (C) 2017-2020 Jonathan P. Spratte % % This work may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this license or @@ -27,7 +27,7 @@ Released under the LaTeX Project Public License v1.3c or later See http://www.latex-project.org/lppl.txt -------------------------------------------------------------- -Copyright (C) 2017-2019 Jonathan P. Spratte +Copyright (C) 2017-2020 Jonathan P. Spratte This work may be distributed and/or modified under the conditions of the LaTeX Project Public License (LPPL), either version 1.3c of this license or @@ -63,7 +63,7 @@ and the derived files ducksay.pdf \ProvidesFile{ducksay.dtx} [\csname ducksay@date\endcsname\ cowsay for LaTeX] \documentclass{l3doc} -% silence the false positives about internal control sequences in the animals +% silence the false positives about internal control sequences in the animals \csname msg_redirect_name:nnn\endcsname{l3doc}{foreign-internal}{none} \usepackage[version=2]{ducksay} \usepackage{marginnote} @@ -158,7 +158,7 @@ and the derived files ducksay.pdf } \makeatother \setcounter{secnumdepth}{5} -\setcounter{tocdepth}{5} +\setcounter{tocdepth}{3} \NewDocumentCommand \tocmsg {} {% \marginpar @@ -202,8 +202,8 @@ and the derived files ducksay.pdf \NeedsTeXFormat{LaTeX2e} \RequirePackage{xparse,l3keys2e} -\def\ducksay@version{2.4.1} -\def\ducksay@date{2019-09-28} +\def\ducksay@version{2.5} +\def\ducksay@date{2020-02-01} \ProvidesExplPackage {ducksay} {\ducksay@date} @@ -375,9 +375,10 @@ and the derived files ducksay.pdf % \texttt{\cs{textcolor}\marg{color}\marg{text}}. Note that you can't % use braces in the arguments of \cs{textcolor}.\\ % You can also use a delimited \cs{color} of the form -% \texttt{\cs{bgroup}\bp\cs{color}\bp\marg{color}\bp\meta{text}\bp\cs{egroup}}, a space -% after that |\egroup| will be considered a space in the output, so you don't -% have to care for correct termination of the |\egroup| (so +% \texttt +% {\cs{bgroup}\bp\cs{color}\bp\marg{color}\bp\meta{text}\bp\cs{egroup}}, +% a space after that |\egroup| will be considered a space in the output, so +% you don't have to care for correct termination of the |\egroup| (so % \texttt{\cs{bgroup}\bp \cs{color}\bp\{red\}\bp RedText\bp % \cs{egroup}OtherText} is valid syntax). You can't nest delimited % \cs{color}s.\\ @@ -426,7 +427,7 @@ and the derived files ducksay.pdf % dedicated description of each version look into \autoref{sec:v1} and % \autoref{sec:v2}. The package author would choose |version=2|, the other % version is mostly for legacy reasons. The default is |2|. -% \item[\anml] +% \item[\anml] % One of the animals listed in \autoref{sec:animals} or any of the ones % added with \cs{AddAnimal}. Not useable as package option. Also don't use % it in \cs{DucksayOptions}, it'll break the default animal selection. @@ -450,8 +451,16 @@ and the derived files ducksay.pdf % worth it (and I hope the affected documents are few). % \item[no-tail] % Sets |tail-1| and |tail-2| to be a space. +% \item[random=\meta{bool}] +% If |true| a random animal will be used instead of the default one on each +% usage of \cs{ducksay} or \cs{duckthink}. The initial value is false and it +% defaults to true. % \item[say] % Sets |tail-1| and |tail-2| as backslashes. +% \item[schroedinger] +% Sets randomly either |animal=schroedinger-alive| or +% |animal=schroedinger-dead| at the time of use. Both have the same size, so +% this doesn't affect the needed space. % \item[tail-1=\meta{token list}] % Sets the first tail symbol in the output to be \meta{token list}. If set % outside of \cs{ducksay} and \cs{duckthink} it will be overwritten inside @@ -889,6 +898,13 @@ and the derived files ducksay.pdf % definition uses a |p|-type column for |arg=tab| and |arg=tab*|. If both % |wd| is not smaller than 0 and |wd*| is not smaller than 0pt, |wd*| will % take precedence. +% \item[wd-eq-body=\meta{bool}] +% if this is |true|, |wd| is smaller than 0, and |wd*| is smaller than 0pt +% the \msg\ will be as wide as the \anml's body. Note that because the +% \anml\ bodies contain white space on their left end and due to the +% additional horizontal bubble delimiters the bubble will be wider than the +% \anml's body. If the |none| option was also used this option has no +% effect. % \end{options} % %^^A=<< @@ -920,23 +936,15 @@ and the derived files ducksay.pdf % {% % \tiny % \hfill -% \makebox[8em][r] -% {% -% \rlap -% { -% \ducksay -% [ -% ghost,MSG=\footnotesize,b,body-mirrored,no-bubble, -% body-bigger=10 -% ]{} -% } -% \ducksay[fairy,MSG=\footnotesize,b,msg-to-body=r,body-to-msg=hc] -% {We're the\\new ones.} -% \rlap{\ducksay -% [crusader,MSG=\footnotesize,body=\normalsize,t,out-x=-4cm,out-y=2cm] -% {Deus\\vult!\rlap{\footnotemark}}}% -% }% -% }\footnotetext{Latin; ``I feeleth fusty already.''} +% \ducksay[snake,MSG=\footnotesize]{I'm zsse\\new one.}\\[\medskipamount] +% \duckthink[cat,MSG=\footnotesize,body-mirrored,body-to-msg=hc,msg-align=c] +% {I sneaked\\in, too.}\\[\medskipamount] +% \duckthink[sleepy-cat,MSG=\footnotesize,msg-align=c] +% {Better make a quick\\catnap, sneaking is\\tiring.}\\[\medskipamount] +% \rlap{\kern-1em\ducksay[schroedinger-alive,no-bubble,body-mirrored,b]{}} +% \ducksay[schroedinger-dead,MSG=\footnotesize,msg-align=c,body-align=r,b] +% {Hadn't you opened\\the documentation!} +% } % The following animals are provided by this package. I did not create them (but % altered some), they belong to their original creators. % \bgroup @@ -965,6 +973,11 @@ and the derived files ducksay.pdf % ,rabbit^^A % ,snail^^A % ,whale^^A +% ,snake^^A +% ,cat^^A +% ,sleepy-cat^^A +% ,schroedinger-dead^^A +% ,schroedinger-alive^^A % ,crusader^^A % ,knight^^A % ,fairy^^A @@ -1043,6 +1056,7 @@ and the derived files ducksay.pdf % \paragraph{Sequences} % \begin{macrocode} \seq_new:N \l_ducksay_msg_lines_seq +\seq_new:N \l_ducksay_defined_animals_seq % \end{macrocode} % \paragraph{Token lists} % \begin{macrocode} @@ -1060,6 +1074,7 @@ and the derived files ducksay.pdf % \begin{macrocode} \bool_new:N \l_ducksay_version_one_bool \bool_new:N \l_ducksay_version_two_bool +\bool_new:N \l_ducksay_random_animal_bool % \end{macrocode} % \paragraph{Boxes} % \begin{macrocode} @@ -1120,13 +1135,21 @@ and the derived files ducksay.pdf ,tail-2 .initial:x = \c_backslash_str ,no-tail .meta:n = { tail-1 = { ~ }, tail-2 = { ~ } } ,think .meta:n = { tail-1 = { O }, tail-2 = { o } } + ,random .bool_set:N = \l_ducksay_random_animal_bool ,say .code:n = { \exp_args:Nx \DucksayOptions { tail-1 = { \c_backslash_str }, tail-2 = { \c_backslash_str } } } + ,schroedinger .code:n = + { + \int_compare:nNnTF { \int_rand:n { 2 } } = \c_one_int + { \keys_set:nn { ducksay } { animal = schroedinger-dead } } + { \keys_set:nn { ducksay } { animal = schroedinger-alive } } + } + ,schroedinger .value_forbidden:n = true ,version .choice: - ,version / 1 .code:n = + ,version / 1 .code:n = { \bool_set_false:N \l_ducksay_version_two_bool \bool_set_true:N \l_ducksay_version_one_bool @@ -1177,24 +1200,25 @@ and the derived files ducksay.pdf % \begin{macrocode} \cs_generate_variant:Nn \tl_replace_once:Nnn { NVn } \cs_generate_variant:Nn \tl_replace_all:Nnn { NVn } +\cs_generate_variant:Nn \keys_set:nn { nx } % \end{macrocode} %^^A=<< % % \paragraph{Internal}^^A>>= % -% \begin{macro}{\__ducksay_everyeof:w}^^A>>= +% \begin{macro}[internal]{\__ducksay_everyeof:w}^^A>>= % \begin{macrocode} \cs_set_eq:NN \__ducksay_everyeof:w \tex_everyeof:D % \end{macrocode} % \end{macro}^^A=<< % -% \begin{macro}{\__ducksay_scantokens:w}^^A>>= +% \begin{macro}[internal]{\__ducksay_scantokens:w}^^A>>= % \begin{macrocode} \cs_set_eq:NN \__ducksay_scantokens:w \tex_scantokens:D % \end{macrocode} % \end{macro}^^A=<< % -% \begin{macro}{\ducksay_replace_verb_newline:Nn}^^A>>= +% \begin{macro}[internal]{\ducksay_replace_verb_newline:Nn}^^A>>= % \begin{macrocode} \cs_new_protected:Npx \ducksay_replace_verb_newline:Nn #1 #2 { @@ -1203,7 +1227,7 @@ and the derived files ducksay.pdf % \end{macrocode} % \end{macro}^^A=<< % -% \begin{macro}{\ducksay_replace_verb_newline_newline:Nn}^^A>>= +% \begin{macro}[internal]{\ducksay_replace_verb_newline_newline:Nn}^^A>>= % \begin{macrocode} \cs_new_protected:Npx \ducksay_replace_verb_newline_newline:Nn #1 #2 { @@ -1213,7 +1237,7 @@ and the derived files ducksay.pdf % \end{macrocode} % \end{macro}^^A=<< % -% \begin{macro}{\ducksay_process_verb_newline:nnn}^^A>>= +% \begin{macro}[internal]{\ducksay_process_verb_newline:nnn}^^A>>= % \begin{macrocode} \cs_new_protected:Npn \ducksay_process_verb_newline:nnn #1 #2 #3 { @@ -1224,7 +1248,7 @@ and the derived files ducksay.pdf % \end{macrocode} % \end{macro}^^A=<< % -% \begin{macro}{\ducksay_add_animal_inner:nnnn}^^A>>= +% \begin{macro}[internal]{\ducksay_add_animal_inner:nnnn}^^A>>= % \begin{macrocode} \cs_new_protected:Npn \ducksay_add_animal_inner:nnnn #1 #2 #3 #4 { @@ -1271,21 +1295,39 @@ and the derived files ducksay.pdf #2 .code:n = { \exp_not:n { \tl_set_eq:NN \l_ducksay_animal_tl } - \exp_after:wN \exp_not:N \cs:w l_ducksay_animal_#2_tl \cs_end: + \exp_not:c { l_ducksay_animal_#2_tl } \exp_not:n { \exp_args:NV \DucksayOptions } - \exp_after:wN - \exp_not:N \cs:w l_ducksay_animal_#2_options_tl \cs_end: + \exp_not:c { l_ducksay_animal_#2_options_tl } } } \tl_if_exist:cF { l_ducksay_animal_#2_options_tl } { \tl_new:c { l_ducksay_animal_#2_options_tl } } \IfBooleanT { #4 } { \keys_define:nn { ducksay } { default_animal .meta:n = { #2 } } } + \seq_if_in:NnF \l_ducksay_defined_animals_seq { #2 } + { \seq_push:Nn \l_ducksay_defined_animals_seq { #2 } } } \cs_generate_variant:Nn \ducksay_add_animal_inner:nnnn { nnVn } % \end{macrocode} % \end{macro}^^A=<< % +% \begin{macro}[internal]{\ducksay_default_or_random_animal:} +% \begin{macrocode} +\cs_new_protected:Npn \ducksay_default_or_random_animal: + { + \tl_if_empty:NT \l_ducksay_animal_tl + { + \bool_if:NTF \l_ducksay_random_animal_bool + { + \keys_set:nx { ducksay } + { \seq_rand_item:N \l_ducksay_defined_animals_seq } + } + { \keys_set:nn { ducksay } { default_animal } } + } + } +% \end{macrocode} +% \end{macro} +% %^^A=<< % % \paragraph{Document level}^^A>>= @@ -1389,7 +1431,7 @@ and the derived files ducksay.pdf % % \paragraph{Internal}^^A>>= % -% \begin{macro}{\ducksay_longest_line:n}^^A>>= +% \begin{macro}[internal]{\ducksay_longest_line:n}^^A>>= % Calculate the length of the longest line % \begin{macrocode} \cs_new:Npn \ducksay_longest_line:n #1 @@ -1406,7 +1448,7 @@ and the derived files ducksay.pdf % \end{macrocode} % \end{macro}^^A=<< % -% \begin{macro}{\ducksay_open_bubble:}^^A>>= +% \begin{macro}[internal]{\ducksay_open_bubble:}^^A>>= % Draw the opening bracket of the bubble % \begin{macrocode} \cs_new:Npn \ducksay_open_bubble: @@ -1431,7 +1473,7 @@ and the derived files ducksay.pdf % \end{macrocode} % \end{macro}^^A=<< % -% \begin{macro}{\ducksay_close_bubble:}^^A>>= +% \begin{macro}[internal]{\ducksay_close_bubble:}^^A>>= % Draw the closing bracket of the bubble % \begin{macrocode} \cs_new:Npn \ducksay_close_bubble: @@ -1457,7 +1499,7 @@ and the derived files ducksay.pdf % \end{macrocode} % \end{macro}^^A=<< % -% \begin{macro}{\ducksay_print_msg:nn}^^A>>= +% \begin{macro}[internal]{\ducksay_print_msg:nn}^^A>>= % Print out the message % \begin{macrocode} \cs_new:Npn \ducksay_print_msg:nn #1 #2 @@ -1472,7 +1514,7 @@ and the derived files ducksay.pdf % \end{macrocode} % \end{macro}^^A=<< % -% \begin{macro}{\ducksay_print:nn}^^A>>= +% \begin{macro}[internal]{\ducksay_print:nn}^^A>>= % Print out the whole thing % \begin{macrocode} \cs_new:Npn \ducksay_print:nn #1 #2 @@ -1512,7 +1554,7 @@ and the derived files ducksay.pdf % \end{macrocode} % \end{macro}^^A=<< % -% \begin{macro}{\ducksay_say_and_think:nn}^^A>>= +% \begin{macro}[internal]{\ducksay_say_and_think:nn}^^A>>= % Reset some variables % \begin{macrocode} \cs_new:Npn \ducksay_say_and_think:nn #1 #2 @@ -1521,8 +1563,7 @@ and the derived files ducksay.pdf \int_set:Nn \l_ducksay_msg_width_int { -\c_max_int } \int_set:Nn \l_ducksay_msg_height_int { -\c_max_int } \keys_set:nn { ducksay } { #1 } - \tl_if_empty:NT \l_ducksay_animal_tl - { \keys_set:nn { ducksay } { default_animal } } + \ducksay_default_or_random_animal: \ducksay_print:nV { #2 } \l_ducksay_rel_align_tl \group_end: } @@ -1604,6 +1645,7 @@ and the derived files ducksay.pdf \bool_new:N \l_ducksay_eat_arg_box_bool \bool_new:N \l_ducksay_eat_arg_tab_verb_bool \bool_new:N \l_ducksay_mirrored_body_bool +\bool_new:N \l_ducksay_msg_eq_body_width_bool % \end{macrocode} % % \paragraph{Coffins} @@ -1646,6 +1688,7 @@ and the derived files ducksay.pdf ,wd* .dim_set:N = \l_ducksay_msg_width_dim ,wd* .initial:n = -\c_max_dim ,wd* .value_required:n = true + ,wd-eq-body .bool_set:N = \l_ducksay_msg_eq_body_width_bool ,none .bool_set:N = \l_ducksay_no_body_bool ,no-bubble .bool_set:N = \l_ducksay_no_bubble_bool ,body-mirrored .bool_set:N = \l_ducksay_mirrored_body_bool @@ -1753,7 +1796,8 @@ and the derived files ducksay.pdf % % \paragraph{Internal}^^A>>= % -% \begin{macro}{\ducksay_evaluate_message_alignment_fixed_width_common:}^^A>>= +% \begin{macro}[internal] +% {\ducksay_evaluate_message_alignment_fixed_width_common:}^^A>>= % \begin{macrocode} \cs_new:Npn \ducksay_evaluate_message_alignment_fixed_width_common: { @@ -1768,7 +1812,8 @@ and the derived files ducksay.pdf % \end{macrocode} % \end{macro}^^A=<< % -% \begin{macro}{\ducksay_evaluate_message_alignment_fixed_width_tabular:}^^A>>= +% \begin{macro}[internal] +% {\ducksay_evaluate_message_alignment_fixed_width_tabular:}^^A>>= % \begin{macrocode} \cs_new:Npn \ducksay_evaluate_message_alignment_fixed_width_tabular: { @@ -1788,7 +1833,8 @@ and the derived files ducksay.pdf % \end{macrocode} % \end{macro}^^A=<< % -% \begin{macro}{\ducksay_evaluate_message_alignment_fixed_width_vbox:}^^A>>= +% \begin{macro}[internal] +% {\ducksay_evaluate_message_alignment_fixed_width_vbox:}^^A>>= % \begin{macrocode} \cs_new:Npn \ducksay_evaluate_message_alignment_fixed_width_vbox: { @@ -1798,18 +1844,18 @@ and the derived files ducksay.pdf % \end{macrocode} % \end{macro}^^A=<< % -% \begin{macro}{\ducksay_calculate_msg_width_from_int:}^^A>>= +% \begin{macro}[internal]{\ducksay_calculate_msg_width_from_int:}^^A>>= % \begin{macrocode} \cs_new:Npn \ducksay_calculate_msg_width_from_int: { \hbox_set:Nn \l_ducksay_tmpa_box { { \l_ducksay_msg_fount_tl M } } - \dim_set:Nn \l_ducksay_msg_width_dim + \dim_set:Nn \l_ducksay_msg_width_dim { \l_ducksay_msg_width_int \box_wd:N \l_ducksay_tmpa_box } } % \end{macrocode} % \end{macro}^^A=<< % -% \begin{macro}{\ducksay_msg_tabular_begin:}^^A>>= +% \begin{macro}[internal]{\ducksay_msg_tabular_begin:}^^A>>= % \begin{macrocode} \cs_new:Npn \ducksay_msg_tabular_begin: { @@ -1823,7 +1869,7 @@ and the derived files ducksay.pdf % \end{macrocode} % \end{macro}^^A=<< % -% \begin{macro}{\ducksay_msg_tabular_end:}^^A>>= +% \begin{macro}[internal]{\ducksay_msg_tabular_end:}^^A>>= % \begin{macrocode} \cs_new:Npn \ducksay_msg_tabular_end: { @@ -1832,7 +1878,7 @@ and the derived files ducksay.pdf % \end{macrocode} % \end{macro}^^A=<< % -% \begin{macro}{\ducksay_width_case_none_int_dim:nnn}^^A>>= +% \begin{macro}[internal]{\ducksay_width_case_none_int_dim:nnn}^^A>>= % \begin{macrocode} \cs_new:Npn \ducksay_width_case_none_int_dim:nnn #1 #2 #3 { @@ -1847,14 +1893,36 @@ and the derived files ducksay.pdf % \end{macrocode} % \end{macro}^^A=<< % -% \begin{macro}{\ducksay_digest_options:n}^^A>>= +% \begin{macro}[internal]{\ducksay_digest_options:n}^^A>>= % \begin{macrocode} \cs_new:Npn \ducksay_digest_options:n #1 { \group_begin: \keys_set:nn { ducksay } { #1 } - \tl_if_empty:NT \l_ducksay_animal_tl - { \keys_set:nn { ducksay } { default_animal } } + \ducksay_default_or_random_animal: + \bool_if:NF \l_ducksay_no_body_bool + { + \hcoffin_set:Nn \l_ducksay_body_coffin + { + \frenchspacing + \l_ducksay_body_fount_tl + \begin{tabular} { @{} l @{} } + \l_ducksay_animal_tl + \ducksay_make_body_bigger: + \relax + \end{tabular} + } + \bool_if:NT \l_ducksay_msg_eq_body_width_bool + { + \bool_lazy_and:nnT + { \int_compare_p:nNn \l_ducksay_msg_width_int < \c_zero_int } + { \dim_compare_p:nNn \l_ducksay_msg_width_dim < \c_zero_dim } + { + \dim_set:Nn \l_ducksay_msg_width_dim + { \coffin_wd:N \l_ducksay_body_coffin } + } + } + } \bool_if:NTF \l_ducksay_eat_arg_box_bool { \ducksay_width_case_none_int_dim:nnn @@ -1875,7 +1943,7 @@ and the derived files ducksay.pdf { l } { \tl_set:Nn \l_ducksay_msg_tabular_column_tl { l } } { c } { \tl_set:Nn \l_ducksay_msg_tabular_column_tl { c } } { r } { \tl_set:Nn \l_ducksay_msg_tabular_column_tl { r } } - { j } + { j } { \msg_error:nn { ducksay } { justify~unavailable } \tl_set:Nn \l_ducksay_msg_tabular_column_tl { l } @@ -1894,7 +1962,7 @@ and the derived files ducksay.pdf % \end{macrocode} % \end{macro}^^A=<< % -% \begin{macro}{\ducksay_set_bubble_top_kern:}^^A>>= +% \begin{macro}[internal]{\ducksay_set_bubble_top_kern:}^^A>>= % \begin{macrocode} \cs_new:Npn \ducksay_set_bubble_top_kern: { @@ -1908,7 +1976,7 @@ and the derived files ducksay.pdf % \end{macrocode} % \end{macro}^^A=<< % -% \begin{macro}{\ducksay_set_bubble_bottom_kern:}^^A>>= +% \begin{macro}[internal]{\ducksay_set_bubble_bottom_kern:}^^A>>= % \begin{macrocode} \cs_new:Npn \ducksay_set_bubble_bottom_kern: { @@ -1922,7 +1990,7 @@ and the derived files ducksay.pdf % \end{macrocode} % \end{macro}^^A=<< % -% \begin{macro}{\ducksay_make_body_bigger:}^^A>>= +% \begin{macro}[internal]{\ducksay_make_body_bigger:}^^A>>= % \begin{macrocode} \cs_new:Npn \ducksay_make_body_bigger: { @@ -1932,7 +2000,7 @@ and the derived files ducksay.pdf % \end{macrocode} % \end{macro}^^A=<< % -% \begin{macro}{\ducksay_make_body_bigger_aux:n}^^A>>= +% \begin{macro}[internal]{\ducksay_make_body_bigger_aux:n}^^A>>= % \begin{macrocode} \cs_new:Npn \ducksay_make_body_bigger_aux:n #1 { @@ -1941,7 +2009,7 @@ and the derived files ducksay.pdf % \end{macrocode} % \end{macro}^^A=<< % -% \begin{macro}{\ducksay_shipout:}^^A>>= +% \begin{macro}[internal]{\ducksay_shipout:}^^A>>= % \begin{macrocode} \cs_new_protected:Npn \ducksay_shipout: { @@ -1954,7 +2022,7 @@ and the derived files ducksay.pdf { \fp_eval:n { - ceil + ceil ( \box_wd:N \l_ducksay_msg_box / \box_wd:N \l_ducksay_tmpa_box ) @@ -2060,16 +2128,6 @@ and the derived files ducksay.pdf } \bool_if:NF \l_ducksay_no_body_bool { - \hcoffin_set:Nn \l_ducksay_body_coffin - { - \frenchspacing - \l_ducksay_body_fount_tl - \begin{tabular} { @{} l @{} } - \l_ducksay_animal_tl - \ducksay_make_body_bigger: - \relax - \end{tabular} - } \bool_if:NT \l_ducksay_mirrored_body_bool { \coffin_scale:Nnn \l_ducksay_body_coffin @@ -2105,7 +2163,7 @@ and the derived files ducksay.pdf % and \cs{duckthink}. They all should allow almost arbitrary content and the % height and width are set based on the dimensions. % -% \begin{macro}{\ducksay_eat_argument_tabular:w}^^A>>= +% \begin{macro}[internal]{\ducksay_eat_argument_tabular:w}^^A>>= % \begin{macrocode} \cs_new:Npn \ducksay_eat_argument_tabular:w { @@ -2116,7 +2174,7 @@ and the derived files ducksay.pdf % \end{macrocode} % \end{macro}^^A=<< % -% \begin{macro}{\ducksay_eat_argument_tabular_inner:w}^^A>>= +% \begin{macro}[internal]{\ducksay_eat_argument_tabular_inner:w}^^A>>= % \begin{macrocode} \cs_new:Npn \ducksay_eat_argument_tabular_inner:w #1 { @@ -2132,7 +2190,7 @@ and the derived files ducksay.pdf % \end{macrocode} % \end{macro}^^A=<< % -% \begin{macro}{\ducksay_eat_argument_tabular_verb:w}^^A>>= +% \begin{macro}[internal]{\ducksay_eat_argument_tabular_verb:w}^^A>>= % \begin{macrocode} \NewDocumentCommand \ducksay_eat_argument_tabular_verb:w { >{ \ducksay_process_verb_newline:nnn { ~ } { ~ \par } } +v } @@ -2149,14 +2207,14 @@ and the derived files ducksay.pdf % \end{macrocode} % \end{macro}^^A=<< % -% \begin{macro}{\ducksay_eat_argument_tabular_normal:w}^^A>>= +% \begin{macro}[internal]{\ducksay_eat_argument_tabular_normal:w}^^A>>= % \begin{macrocode} \NewDocumentCommand \ducksay_eat_argument_tabular_normal:w { +m } { \ducksay_eat_argument_tabular_inner:w { #1 } } % \end{macrocode} % \end{macro}^^A=<< % -% \begin{macro}{\ducksay_eat_argument_hbox:w}^^A>>= +% \begin{macro}[internal]{\ducksay_eat_argument_hbox:w}^^A>>= % \begin{macrocode} \cs_new_protected_nopar:Npn \ducksay_eat_argument_hbox:w { @@ -2168,7 +2226,7 @@ and the derived files ducksay.pdf % \end{macrocode} % \end{macro}^^A=<< % -% \begin{macro}{\ducksay_eat_argument_vbox:w}^^A>>= +% \begin{macro}[internal]{\ducksay_eat_argument_vbox:w}^^A>>= % \begin{macrocode} \cs_new_protected_nopar:Npn \ducksay_eat_argument_vbox:w { @@ -2238,7 +2296,7 @@ and the derived files ducksay.pdf %<*animals> \ProvidesFile{ducksay.animals.tex} [\ducksay@date\space v\ducksay@version\space ducksay animals] -%^^A some of the below are from http://ascii.co.uk/art/kangaroo +%^^A some of the below are from http://ascii.co.uk/art/ \AddAnimal{duck}%>>= { \ \ __ @@ -2268,7 +2326,7 @@ and the derived files ducksay.pdf ||----w | || ||}%=<< \AddAnimal{head-in}%>>= -{ \ +{ \ \ ^__^ / (oo)\_______/ ________ (__)\ )=( ___|_ \____ @@ -2284,7 +2342,7 @@ and the derived files ducksay.pdf || ||>>}%=<< \AddAnimal{tux}%>>= { \ - \ .--. + \ .--. |o_o | |\_/ | // \ \ @@ -2326,24 +2384,24 @@ and the derived files ducksay.pdf ,/' `\_,}%=<< %^^A http://chris.com/ascii/index.php?art=animals/rabbits \AddAnimal[tail-symbol=s,tail-count=3]{rabbit}%>>= -{ s - s / \`\ __ - s | \ `\ /`/ \ - \_/`\ \-"-/` /\ \ - | | \ | - (d b) \_/ - / \ - ,".|.'.\_/.'.|.", - / /\' _|_ '/\ \ - | / '-`"`-' \ | - | | | | - | \ \ / / | - \ \ \ / / / - `"`\ : /'"` - `""`""`}%=<< +{ s + s / \`\ __ + s | \ `\ /`/ \ + \_/`\ \-"-/` /\ \ + | | \ | + (d b) \_/ + / \ + ,".|.'.\_/.'.|.", + / /\' _|_ '/\ \ + | / '-`"`-' \ | + | | | | + | \ \ / / | + \ \ \ / / / + `"`\ : /'"` + `""`""`}%=<< \AddAnimal{bunny}%>>= -{ \ - \ / +{ \ + \ / /\ / ( ) .( o ).}%=<< @@ -2355,9 +2413,9 @@ and the derived files ducksay.pdf \AddAnimal[tail-symbol=s,tail-count=3]{dragon}%>>= { s / \ //\ s |\___/| / \// \\ - s /0 0 \__ / // | \ \ - / / \/_/ // | \ \ - @_^_@'/ \/_ // | \ \ + s /0 0 \__ / // | \ \ + / / \/_/ // | \ \ + @_^_@'/ \/_ // | \ \ //_^_/ \/_ // | \ \ ( //) | \/// | \ \ ( / /) _|_ / ) // | \ _\ @@ -2394,25 +2452,25 @@ and the derived files ducksay.pdf "-._.._'.__.-'_.."}%=<< %^^A http://www.ascii-art.de/ascii/uvw/unicorn.txt \AddAnimal{unicorn}%>>= -{ \ - \ /((((((\\\\ - ---====((((((((((\\\\\ - (( \\\\\\\ - ( (* _/ \\\\\\\ - \ / \ \\\\\\_ __,,__ - | | | </ "-----"" ((\\\\ - o_| / / \ \\\\ \\\\\\\ - | ._ ( \ \\\\\\\\\\\\\\\\ - | / / / \\\\\\\ \\ - .______/\/ / / / \\\ - / __.____/ _/ _( /\ - / / / ________/:_ ___,,--' \ / \_ - / / \ \ """"""" \ \ \_ \ - ( < \ \ > / \ \ - \/ \\_ / / > ) - \_| / / / / - _// _// - /_| /_|}%=<< +{ \ + \ /((((((\\\\ + ---====((((((((((\\\\\ + (( \\\\\\\ + ( (* _/ \\\\\\\ + \ / \ \\\\\\_ __,,__ + | | | </ "-----"" ((\\\\ + o_| / / \ \\\\ \\\\\\\ + | ._ ( \ \\\\\\\\\\\\\\\\ + | / / / \\\\\\\ \\ + .______/\/ / / / \\\ + / __.____/ _/ _( /\ + / / / ________/:_ ___,,--' \ / \_ + / / \ \ """"""" \ \ \_ \ + ( < \ \ > / \ \ + \/ \\_ / / > ) + \_| / / / / + _// _// + /_| /_|}%=<< %^^A https://asciiart.website//index.php?art=animals/other%20(water) \AddAnimal[tail-count=3,tail-symbol=s]{whale}%>>= { s |-. @@ -2577,6 +2635,61 @@ and the derived files ducksay.pdf { s s s}%=<< +%^^A head taken from https://www.asciiart.eu/animals/reptiles/snakes +\AddAnimal[tail-symbol=s,tail-count=3]{snake} +{ s + s /^\/^\ + s _|__| O | + /' \_/ \ + \/ |_________/ \ \ + \_/ \_______ \ \ + `| | |\ + / / _---_ | | + / / / __ "-_ ," | + | "--" / "-_ "--" ," + "-_____-" "-___-"} +%^^A http://www.ascii-art.de/ascii/c/cat.txt +\AddAnimal{cat} ++ \ + \ _ ___ .--. + \`.|\..----...-'` `-._.-' .-' + / ' ` , __.-' + )/' _/ \ `-_, / + `-'" `"\_ ,_.-;_.-\_ ', + _.-'_./ {_.' ; / + {_.-``-' {_/+ +%^^A https://www.asciiart.eu/animals/cats +\AddAnimal{sleepy-cat} +{ \ + \ |\ _,,,---,,_ _._ + /,`.-'`' -. )'._,'.-,) + |,4- ) )-,_. ,\ ( `-.-' + '---''(_/--' `-'\_)} +\AddAnimal{schroedinger-dead} +{ \ + \ _.--"""--._ + | | + | -|- | + | | | + | | + | Felix | + __|___________|__ _ + o . . . + ~ . o o + . ~ .} +%^^A https://www.asciiart.eu/animals/cats +\AddAnimal{schroedinger-alive} +{ \ + \ ,_ _ + |\\__,'/ + / _ _ | ,--. + ( @ @ ) / ,-' + \ _T_/-._( ( + / `. \ + | _ \ | + \ \ , / | + || |-_\__ / + ((_/`(____,-'} %</animals> % \end{macrocode}^^A=<< %^^A%^^A https://www.asciiart.eu/mythology/fairies diff --git a/macros/latex/contrib/ducksay/ducksay.pdf b/macros/latex/contrib/ducksay/ducksay.pdf Binary files differindex f92d20fca5..794fb87149 100644 --- a/macros/latex/contrib/ducksay/ducksay.pdf +++ b/macros/latex/contrib/ducksay/ducksay.pdf diff --git a/macros/latex/contrib/lwarp/README.txt b/macros/latex/contrib/lwarp/README.txt index 195a61cffb..f91cc09657 100644 --- a/macros/latex/contrib/lwarp/README.txt +++ b/macros/latex/contrib/lwarp/README.txt @@ -1,5 +1,5 @@ -LaTeX lwarp package v0.78 README.txt +LaTeX lwarp package v0.79 README.txt Files included are: @@ -41,7 +41,7 @@ and version 1.3 or later is part of all distributions of LaTeX version 2005/12/01 or later. -Copyright 2016-2019 Brian Dunn +Copyright 2016-2020 Brian Dunn Homepage: http://BDTechConcepts.com Email: bd@BDTechConcepts.com diff --git a/macros/latex/contrib/lwarp/lwarp.dtx b/macros/latex/contrib/lwarp/lwarp.dtx index e52d6bfdb3..0de08ba438 100644 --- a/macros/latex/contrib/lwarp/lwarp.dtx +++ b/macros/latex/contrib/lwarp/lwarp.dtx @@ -1,7 +1,7 @@ % % \iffalse meta-comment % -% Copyright 2016-2019 Brian Dunn +% Copyright 2016-2020 Brian Dunn % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either version 1.3 @@ -16,7 +16,7 @@ % \iffalse %<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01] %<package>\ProvidesPackage{lwarp} -%<package> [2019/11/07 v0.78 Allows LaTeX to directly produce HTML5 output.] +%<package> [2020/02/01 v0.79 Allows LaTeX to directly produce HTML5 output.] % %<*driver> \documentclass{ltxdoc} @@ -233,7 +233,7 @@ pageanchor=true,hyperindex=true,hyperfootnotes=false% \hypersetup{% pdfinfo={% -Title={LaTeX lwarp package},% +Title={LaTeX Lwarp package},% Author={Brian Dunn},% Subject={LaTeX to HTML conversion},% Keywords={LaTeX, HTML, conversion}% @@ -303,6 +303,7 @@ Keywords={LaTeX, HTML, conversion}% \newcommand{\epkg}[1]{\textcolor[Hsb]{300,1,.5}{\pkg{#1}}}% package emulated for HTML \newcommand{\ipkg}[1]{\textcolor[Hsb]{0,0,.5}{\pkg{#1}}}% package ignored \newcommand{\wpkg}[1]{\textcolor[Hsb]{0,1,.5}{\pkg{#1}}}% package warning special case +\newcommand{\sjax}{\textsuperscript{\textcolor{orange!70!black}{MJ}}} % green/cyan/blue/magenta % \newcommand{\spkg}[1]{\textcolor[Hsb]{120,1,.4}{\pkg{#1}}}% package supported as-is @@ -1174,6 +1175,7 @@ SVG math does not work inside \TeX\ boxes, since a \cs{newpage} is required before and after each image. \subsubsection{\brand{MathJax} option} +\label{sec:limitsmathjax} The popular \brand{MathJax} alternative (\url{mathjax.org}) may be used to display math. \margintag{\brand{MathJax} math option} @@ -1202,41 +1204,63 @@ Limitations when using \brand{MathJax} include: \margintag{\brand{MathJax} limitations} \DescribeProgram{MathJax} \begin{itemize} -\item \brand{MathJax} itself does not support subequations. - \margintag{subequations} -\trouble{MathJax=\brand{MathJax}>subequations}% -\trouble{math>subequations}% +\item \brand{MathJax} does not support \cs{multicolumn} or \pkg{multirow}. + \trouble[\cs{multicolumn}, \pkg{multirow}]% + {multicolumn=\cs{multicolumn}>MathJax=\brand{MathJax}} + \trouble{multirow=\pkg{multirow}>MathJax=\brand{MathJax}} + \trouble{array=\env{array}>MathJax=\brand{MathJax}} + \trouble{MathJax=\brand{MathJax}>multicolumn=\cs{multicolumn}} + \trouble{MathJax=\brand{MathJax}>multirow=\cs{multirow}} + These may be used in text \env{tabular}s or \SVG\ math, + but in \brand{MathJax} math \env{array}s they are emulated. + \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 inside equations are not yet supported while using \brand{MathJax}. - \margintag{footnotes in math} + \watchout[footnotes in math] + \pkg{lwarp} provides a basic emulation for \brand{MathJax}. + +\item Inside a \brand{MathJax} expression, + \trouble[references in math]{MathJax=\brand{MathJax}>references} + \trouble{cross reference>MathJax=\brand{MathJax}} + \trouble{reference>MathJax=\brand{MathJax}} + references to equations work within the same \HTML\ web page, but do not + work when referring to an equation in a different \HTML\ web page. + Outside of a \brand{MathJax} expression, in the text body, references work + as expected. + \item Math appearing inside a lateximage, \margintag{lateximage} and therefore also inside a \tikz\ or \env{picture} - environment, is rendered as SVG math even if \brand{MathJax} is used in the rest of the document. -\item Usage of \pkg{siunitx} inside a math equation - \margintag{siunitx} - is supported via a third-party \brand{MathJax} extension. - While inside a math expression, do not use \cs{SI} or \cs{si} inside \cs{text}, - where it will be rendered as normal text. - \trouble[siunitx inside an equation]{siunitx=\pkg{siunitx}>MathJax=\brand{MathJax}} - \trouble{MathJax=\brand{MathJax}>siunitx=\pkg{siunitx}} + environment, is rendered as SVG math even if \brand{MathJax} + is used in the rest of the document. - \href{https://github.com/burnpanck/MathJax-siunitx} - {\texttt{https://github.com/burnpanck/MathJax-siunitx}} +\item For \pkg{siunitx}, + \margintag{\pkg{siunitx}} + see \nameref{sec:limitssiunitx}, \cref{sec:limitssiunitx}. - Also see \cref{sec:limitssiunitx}. +\item For \pkg{physics}, + \margintag{\pkg{physics}} + see \nameref{sec:limitsphysics}, \cref{sec:limitsphysics}. \item A \env{tabbing} environment is emulated - using an \HTML\ \element{pre}.\margintag{tabbing} + using an \HTML\ \element{pre}.\margintag{tabbing}\ While \brand{MathJax} is enabled inside \env{tabbing}, the browser may not correctly render the horizontal alignment of the math and text following after on the same line. -\item Other math-related macros and packages are not supported by \brand{MathJax}, +\item Other math-related macros and packages are not directly supported by \brand{MathJax}, \trouble[other macros and packages]{MathJax=\brand{MathJax}>unsupported packages} including \cs{ensuremath} and \pkg{bigdelim}, - along with occasionally-used macros such as \cs{relax}. - \pkg{lwarp} emulates footnotes, \pkg{units}, and \pkg{nicefrac} for MathJax. + and occasionally-used macros such as \cs{relax}. + While using \brand{MathJax}, \pkg{lwarp} provides emulation + for footnotes, \pkg{bm}, \pkg{mathtools}, + \pkg{nicefrac}, \pkg{siunitx}, and \pkg{units}. \end{itemize} } @@ -1315,13 +1339,26 @@ and thus will have a global effect. Examples: \begin{sourcedisplay} +\cs{begin}\{warpMathJax\} \\ \cs{CustomizeMathJax}\{ \\ \fqquad\cs{newcommand}\{\cs{expval}\}[1]\{\cs{langle}\#1\cs{rangle}\} \\ \fqquad\cs{newcommand}\{\cs{abs}\}[1]\{\cs{lvert}\#1\cs{rvert}\} \\ \} \\ -\cs{CustomizeMathJax}\{\cs{newcommand}\{\cs{arsinh}\}\{\cs{text}\{arsinh\}\}\} \\ -\cs{CustomizeMathJax}\{\cs{newcommand}\{\cs{arcosh}\}\{\cs{text}\{arcosh\}\}\} -\cs{CustomizeMathJax}\{\cs{newcommand}\{\cs{NN}\}\{\cs{mathbb}\{N\}\}\} +\cs{CustomizeMathJax}\{\cs{newcommand}\{\cs{arcsinh}\}\{\cs{text}\{arcsinh\}\}\} \\ +\cs{CustomizeMathJax}\{\cs{newcommand}\{\cs{arccosh}\}\{\cs{text}\{arccosh\}\}\} \\ +\cs{CustomizeMathJax}\{\cs{newcommand}\{\cs{NN}\}\{\cs{mathbb}\{N\}\}\} \\ +\cs{end}\{warpMathJax\} +\end{sourcedisplay} + +\pkg{lwarp} already provides \brand{MathJax} customizations for some packages. + +When using \pkg{siunitx}, a similar process may be used to add custom units: +\margintag{\pkg{siunitx}} +\begin{sourcedisplay} +\cs{begin}\{warpMathJax\} \\ +\cs{CustomizeMathJax}\{\cs{newcommand}\{\cs{myunit}\}\{\cs{mathrm}\{WXYZ\}\}\} \\ +\cs{CustomizeMathJax}\{\cs{newcommand}\{\cs{umyunit}\}\{\cs{mathrm}\{\cs{micro}\cs{myunit}\}\}\} \\ +\cs{end}\{warpMathJax\} \end{sourcedisplay} } @@ -1359,6 +1396,41 @@ Or, use a short name for the \TOC\ entry without the math, or use \cs{texorpdfst \end{sourcedisplay} } +\newcommand{\limitsmathtools}{% + \trouble[equation numbering]{mathtools=\pkg{mathtools}} + \optn{showonlyrefs} is disabled, as it conflicts with \pkg{cleveref}, which is + used by \pkg{lwarp}. Equation numbers may not match the print version. + + \optn{mathic} is not emulated for \HTML. + \watchout[italic correction] + + 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} + \cs{begin}\{gathered\}\textred{\{\}} \\ + {[}p{]}=1 \dots \\ + \cs{end}\{gathered\} + \end{sourcedisplay} + \item \optn{showonlyrefs} does not work in \brand{MathJax}, and will result + in a difference in equation numbering compared to the print version. + \item Due to \brand{MathJax} limitations, the following do not render well: + \cs{overbracket}, \cs{underbracket}, \cs{overbrace}, \cs{underbrace}, + \env{rcases}, \env{drcases}, \cs{Aboxed}, and \linebreak \cs{ArrowBetweenLines}. + \item For the new \env{cases}-like environments, + \cs{text} must be used to set the normal roman font if desired. + \item \env{alignat} in \brand{MathJax} requires math mode, but + in \LaTeX it doesn't. It may be required to use \env{warpHTML} and + \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} +} + \newcommand{\limitschemfig}{% If using \cs{polymerdelim} to add delimiters to a \cs{chemfig}, wrap both inside a single \env{lateximage}: @@ -1849,10 +1921,7 @@ or the packages \pkg{multirow}, \pkg{longtable}, \pkg{supertabular}, or \pkg{xta rounded top corners. Trim corners are not rounded with \texttt{@} or \texttt{!} columns, and full-width rules ignore trim. - - \item \cs{toprule}, \cs{midrule}, \cs{bottomrule}, and \cs{hline} - \margintag{full-width rules} - ignore trim. When given an optional width, each cell is styled + When given an optional width, each cell is styled to create the custom border. Without an optional width, the entire row is given a class to assign the standard border. @@ -1970,6 +2039,11 @@ or the packages \pkg{multirow}, \pkg{longtable}, \pkg{supertabular}, or \pkg{xta \dots\ \& & \textred{\cs{mcolrowcell}} \hfill \& \hfill \textred{\cs{mcolrowcell}} & \&\ \dots \\ \end{tabular} \end{sourcedisplay} + \item \brand{MathJax} does not support \pkg{multirow}, so it is emulated + \trouble[MathJax]{MathJax=\brand{MathJax}>multirow=\cs{multirow}} + \trouble{multirow=\pkg{multirow}>MathJax=\brand{MathJax}} + to only print its text on the first row. + \cs{multirow} works as expected in text \env{tabular}s or \SVG\ math. \end{itemize} } @@ -2108,6 +2182,9 @@ are above or below the delimiter: \end{tabular} \hrule \end{sourcedisplay} + +For \brand{MathJax}, limited emulation is provided which merely prints the +delimter and optional text in the first row. } \newcommand{\limitscolortbl}{% @@ -2198,11 +2275,11 @@ have limited \HTML\ tags, resulting in an ``inline'' format, without markup except for \HTML\ breaks. Use \cs{newline} or \cs{par} for an \HTML\ break. -When using \cs{linewidth}, \cs{textwidth}, and \cs{textheight}, +When using \env{minipage}, \cs{parbox}, and \env{fminipage}, \trouble[minipage size]{minipage>size} -widths and heights in \HTML\ are scaled proportionally to a 6\texttimes{}9 inch text area, -and inside a \env{multicols} \cs{linewidth} is divided by the specified number -of columns. +a virtual $6 \times 9$ inch text area is used for +\cs{linewidth}, \cs{textwidth}, and \cs{textheight}, both for sizing the minipage, +and also for its contents. If a \env{minipage} or \cs{parbox} is assigned a width of exactly \cs{linewidth}, \margintag{if width is \cs{linewidth}} @@ -2229,6 +2306,10 @@ widths of all following \env{minipage}s and \cs{parboxes} until the end of the local scope, and \cs{IgnoreMinipageWidths} may be used to tell \pkg{lwarp} to ignore the specified widths. +Inside a \env{multicols}, \cs{linewidth} is divided by the specified number +\trouble[\pkg{multicol}]{multicol=\pkg{multicol}>\cs{linewidth}} +of columns. + Nested \env{minipage}s adopt their parent's text alignment in \HTML, \trouble[text alignment]{minipage>alignment} whereas in regular \LaTeX{} \PDF\ output they do not. @@ -2377,6 +2458,7 @@ If selecting options with braces in \cs{usepackage} does not work: To ensure proper float numbering, set caption positions such as: \trouble[numbering]{caption=\pkg{caption}>numbering} +\trouble{float>numbering} \trouble{subcaption=\pkg{subcaption}>numbering} \begin{sourcedisplay} \cs{captionsetup}[figure]\{position=bottom\} \\ @@ -2474,19 +2556,52 @@ output for \optn{per-mode} and \optn{quotient-mode}. Some units will require that the expression be placed inside math mode. \trouble[math mode required]{siunitx=\pkg{siunitx}} -\trouble{siunitx>MathJax=\brand{MathJax}} -\trouble{MathJax=\brand{MathJax}>siunitx=\pkg{siunitx}} -\textred{NOTE: As of this writing, the \pkg{siunitx} extension -for \brand{MathJax} is not currently hosted at any public CDN, -thus \pkg{siunitx} is not usable with \brand{MathJax} unless a local copy -of this extension is created first. -See \cs{MathJaxFilename} to select a custom MathJax script.} - Tabular \texttt{S} columns are rendered as simple \texttt{c} columns, \trouble[\env{tabular}]{siunitx=\pkg{siunitx}>tabular S and s columns} and tabular \texttt{s} columns are not supported. These may be replaced by \texttt{c} columns with each cell contained in \cs{num} or \cs{si}. + +For math mode with \SVG\ display, the original \pkg{siunitx} code is used while +generating the \SVG\ image. +For text mode, \pkg{lwarp} uses an emulation which provides a very effective +\HTML\ interpretation of \pkg{siunitx}. +For math expressions while using \brand{MathJax}, +\trouble{siunitx=\pkg{siunitx}>MathJax=\brand{MathJax}} +\trouble[MathJax]{MathJax=\brand{MathJax}>siunitx=\pkg{siunitx}} +a limited emulation is used. +Most functions work reasonably well, but many options cannot be emulated. +\pkg{siunitx} macros with more than one optional value cannot absorb the second optional +value, and complicated parsing such as for \cs{ang} is not supported. +The result usually looks fine, and otherwise is enough to get the meaning across. + +\pkg{lwarp}'s \brand{MathJax} emulation for \pkg{siunitx} is meant to be a +stop-gap measure until an extension is included in \brand{MathJax}. +As of this writing, the third-party \pkg{siunitx} extension +for \brand{MathJax} is not currently hosted at any public CDN, +thus \pkg{siunitx} is not usable with this extension unless a local copy +of this extension is created first. +See \cs{MathJaxFilename} to select a custom MathJax script, but \pkg{lwarp}'s +emulation would have to be diabled as well. + +Document modifications required for \brand{MathJax}: +\begin{itemize} +\item Custom units may be added with \cs{CustomizeMathJax}. + \margintag{custom units} + See the \pkg{lwarp-siunitx} code for examples. +\item Units work better using \texttt{\textasciitilde} between units + \watchout[unit spacing] + instead of using periods. +\item To square or cube compound units, + \watchout[\cs{square}, \cs{cubic}] + enclose the following compound units in braces: + \begin{sourcedisplay} + \cs{cubic}\textred{\{}\cs{centi}\cs{meter}\textred{\}} + \end{sourcedisplay} + Single units do not require braces. +\end{itemize} + +Also see \nameref{sec:limitsmathjax}, \cref{sec:limitsmathjax}. } \newcommand{\limitsnicefrac}{% @@ -2497,6 +2612,34 @@ These may be replaced by \texttt{c} columns with each cell contained in 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. +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. +\item Many of the macros do not work with auto-detected delimiters. \watchout + Use the delimiter-specific versions instead. + Some macros do not even consider the following arguments, + so they may work as expected. +\item For \cs{Re} and \cs{Im}, the arguments must be in braces.\watchout +\item For \cs{functionalderivative}, for the example in the manual with $(E-TS)$, + enclose the parens in braces. +\item \cs{expectationvalue} requires and uses two mandatory arguments, \watchout + unlike the third-party \brand{MathJax} \pkg{physics} extension. +\item Each of \cs{matrixquantity}, \cs{smallmatrixquantity}, + and \cs{matrixdeterminant} work, + while \cs{identitymatrix} and the following simply print a place-holder, + and must be replaced by hand. +\end{itemize} +} + % \newcommand{\limitsbabelone}{% % If using \pkg{babel} with French, use @@ -2692,7 +2835,7 @@ This boolean may be tested by the user for later use. %<*package> % \fi % -% \CheckSum{33374} +% \CheckSum{36513} % % \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 @@ -2813,6 +2956,7 @@ This boolean may be tested by the user for later use. % \changes{v0.76}{2019/10/08}{\ 2019/10/08} % \changes{v0.77}{2019/10/15}{\ 2019/10/15} % \changes{v0.78}{2019/11/07}{\ 2019/11/07} +% \changes{v0.79}{2020/02/01}{\ 2020/02/01} @@ -2836,7 +2980,7 @@ This boolean may be tested by the user for later use. % % \fileversion{} \Dash \filedate % -% {\small\textcopyright{} 2016--2019} Brian Dunn\\ \small \texttt{bd@BDTechConcepts.com} +% {\small\textcopyright{} 2016--2020} Brian Dunn\\ \small \texttt{bd@BDTechConcepts.com} % % \end{center} % @@ -2878,8 +3022,9 @@ This boolean may be tested by the user for later use. % Supported classes and packages include \pkg{memoir} and \pkg{koma-script}, % \pkg{cleveref}, \pkg{caption}, \pkg{mdframed}, \pkg{siunitx}, % and many popular packages for tabulars, floats, graphics, theorems, the title page, -% bibliography, indexing, footnotes, and editorial work. -% +% bibliography, indexing, footnotes, and editorial work, as well as a number of CJK-related +% classes and packages. +% % \TeX\ is a self-modifying tokenized macro-expansion language. % Since \pkg{lwarp} is written directly in \LaTeX, it is able to interpret the document's % meaning at a deeper level than external conversions which merely approximate \TeX. @@ -3033,6 +3178,42 @@ This boolean may be tested by the user for later use. % % \begin{description} % \needspace{2\baselineskip} +% \item[v0.79:] \brand{MathJax}, nested \env{tabular}. +% \begin{itemize} +% \item Added or improved \brand{MathJax} emulation for +% \margintag{\brand{MathJax}} +% \pkg{amsmath}, \pkg{ar}, \pkg{arydshln}, \pkg{bm}, +% \pkg{bigdelim}, \pkg{bigstrut}, \pkg{booktabs}, \pkg{braket}, +% \pkg{mathtools}, \pkg{multirow}, \pkg{physics}, \pkg{siunitx}, \pkg{slashed}, +% \pkg{unicode-math}, \pkg{xfakebold}. +% \item Warn if using certain packages not supported by \brand{MathJax}. +% \item \env{tabular}: Now may be nested. +% \margintag{core} +% \item \env{minipage}, \cs{parbox}, \env{fminipage}, +% \cs{makebox}, \cs{framebox}: Fix: Adjust for virtual page size. +% \item Uses new \pkg{iftex}. +% \item \pkg{graphicx}: Fix: Negative angles. +% \margintag{packages} +% \item \pkg{caption}: Fix: \cs{captionlistentry} with \pkg{longtable}. +% \item \pkg{multirow}: Fix: Centered vertical alignment. +% \item \pkg{siunitx}: Fix: \cs{square}, \cs{cubed}. +% \item \pkg{booktabs}: Fix: \pkg{memoir} with \env{lateximage}. +% \item \pkg{babel} and \pkg{polyglossia}: Added troubleshooting warnings. +% \item \pkg{fontawesome}, \pkg{fontawesome5}: Supports text color and size. +% \item \pkg{transparent}: Fix: \env{lateximage}s. +% \item \pkg{epigraph}: Updated to v1.5e. +% \item \pkg{xurl}: Updated to v0.08. +% \item \pkg{subcaption}: Fixed with \pkg{memoir}. +% \item \pkg{floatrow}: Fix: \cs{linewidth}. No longer require \pkg{float}, \pkg{graphics}. +% \item \pkg{floatflt}, \pkg{wrapfig}, \pkg{niceframe}: Fix: Adjust for virtual page size. +% \item Added \pkg{widetable}, \pkg{witharrows}, \pkg{steinmetz}. +% \item Added \pkg{awesomebox}, \pkg{catoptions}. +% \item Added \pkg{svg}, supports \pkg{svg-extract}. +% \item Added \pkg{parcolumns}, \pkg{pdfcolparcolumns}, +% \item Added \pkg{parallel}, \pkg{pdfcolparallel}. +% \item Added \pkg{pdfcol}, \pkg{pdfcolfoot}, \pkg{pdfcolmk}. +% \end{itemize} +% \needspace{2\baselineskip} % \item[v0.78:] Fixes for support files, \attribute{alt} tags, hyperlinks, and the 2019/10 \LaTeX\ release. % \begin{itemize} % \item Docs: Improved documentation regarding package options. @@ -4722,6 +4903,7 @@ This boolean may be tested by the user for later use. % \Cref{tab:supported} lists some of the various \LaTeX{} features and packages % which may be used. % +% % Package names are colored according to their support level: % \begin{description} % \item[\spkg{name}:] Supported as-is. @@ -4729,6 +4911,7 @@ This boolean may be tested by the user for later use. % as print output in \SVG\ math or \env{lateximage} environments. % \item[\epkg{name}:] Emulated for \HTML\ output. % \item[\ipkg{name}:] Ignored for \HTML\ output, but provides source-level compatibility. +% \item[\sjax:] Emulated for \brand{MathJax}, subject to limitations. % \end{description} % % \renewcommand{\arraystretch}{1.5} @@ -4804,7 +4987,8 @@ This boolean may be tested by the user for later use. % \ipkg{grid}, \mpkg{grid-system}, \ipkg{gridset}, % \ipkg{layaureo}, \ipkg{layout}, \ipkg{layouts}, \ipkg{leading}, % \ipkg{ltxgrid}, \ipkg{nccfancyhdr}, \ipkg{notespages}, \ipkg{nowidow}, -% \ipkg{pagegrid}, \ipkg{pagesel}, \ipkg{pdfcrypt}, \ipkg{pdfprivacy}, +% \ipkg{pagegrid}, \ipkg{pagesel}, \epkg{parallel}, \epkg{parcolumns}, +% \ipkg{pdfcolparallel}, \ipkg{pdfcolparcolumns}, \ipkg{pdfcrypt}, \ipkg{pdfprivacy}, % \ipkg{preview}, \epkg{ragged2e}, \ipkg{rmpage}, % \epkg{scrlayer-scrpage}, \epkg{scrpage2}, \epkg{setspace}, % \ipkg{textarea}, \ipkg{threadcol}, @@ -4867,7 +5051,7 @@ This boolean may be tested by the user for later use. % \epkg{footmisc}, \mpkg{footnote}, \ipkg{footnotebackref}, % \mpkg{footnoterange}, \ipkg{footnpag}, \epkg{manyfoot}, % \epkg{marginnote}, \spkg{nccfoots}, \spkg{pagenote}, -% \mpkg{parnotes}, \ipkg{pfnote}, \spkg{sepfootnotes}, +% \mpkg{parnotes}, \ipkg{pdfcolfoot}, \ipkg{pfnote}, \spkg{sepfootnotes}, % \mpkg{sidenotes}, \ipkg{tablefootnote}. % \\ % @@ -4876,7 +5060,7 @@ This boolean may be tested by the user for later use. % Math: & Converted to \SVG\ images with \HTML\ \element{alt} tags containing the % \LaTeX\ source for the math expression. % \brand{MathJax} supported as an alternative. -% \mpkg{amsmath}: \AmS\ environments are supported. +% \mpkg{amsmath}\sjax: \AmS\ environments are supported. % User-defined macros are available during converson, % due to native \LaTeX\ processing.\\ % @@ -4884,10 +5068,11 @@ This boolean may be tested by the user for later use. % \mpkg{amsthm}, \mpkg{ntheorem}, \mpkg{theorem}. \\ % % Additional math: & Math fonts via \SVG\ images, -% \spkg{amscd}, \ipkg{autonum}, \mpkg{backnaur}, \spkg{bm}, \spkg{braket}, +% \spkg{amscd}, \ipkg{autonum}, \mpkg{backnaur}, \mpkg{bm}\sjax, \spkg{braket}\sjax, % \mpkg{breqn}, \mpkg{cases}, \spkg{delarray}, \spkg{guass}, \spkg{jkmath}, -% \spkg{mathspec}, \mpkg{mathtools}, \spkg{nicematrix}, \spkg{pb-diagram}, -% \ipkg{resizegather}, \spkg{unicode-math}, \mpkg{xfakebold}, \mpkg{xy}. +% \spkg{mathspec}, \mpkg{mathtools}\sjax, \spkg{nicematrix}, \spkg{pb-diagram}, +% \ipkg{resizegather}, \spkg{unicode-math}\sjax, \mpkg{witharrows}\sjax, +% \mpkg{xfakebold}\sjax, \mpkg{xy}. % Many others work as-is. \\ % % Display math with \cs{displaymathother}: & % @@ -4896,8 +5081,8 @@ This boolean may be tested by the user for later use. % \midrule % % Units and fractions: & -% \mpkg{nicefrac}, \mpkg{SIunits}, \mpkg{siunitx}, -% \mpkg{units}, \mpkg{unitsdef}, \mpkg{xfrac}. \\ +% \mpkg{nicefrac}\sjax, \mpkg{SIunits}, \mpkg{siunitx}\sjax, +% \mpkg{units}\sjax, \mpkg{unitsdef}, \mpkg{xfrac}. \\ % % \midrule % @@ -4913,12 +5098,13 @@ This boolean may be tested by the user for later use. % \midrule % % Tabular: & -% \env{tabular} environment, \mpkg{array}, \epkg{arydshln}, -% \mpkg{bigdelim}, \mpkg{booktabs}, +% \env{tabular} environment, \mpkg{array}\sjax, \epkg{arydshln}\sjax, +% \mpkg{bigdelim}\sjax, \mpkg{bigstrut}\sjax, \mpkg{booktabs}\sjax, % \mpkg{colortbl}, \mpkg{ctable}, \mpkg{diagbox}, \epkg{longtable}, % \epkg{ltablex}, \epkg{ltxtable}, -% \mpkg{multirow}, \epkg{supertabular}, \epkg{tabularx}, \epkg{tabulary}, -% \epkg{threeparttable}, \mpkg{threeparttablex}, \epkg{xltabular}, \epkg{xtab}. \\ +% \mpkg{multirow}\sjax, \epkg{supertabular}, \epkg{tabularx}, \epkg{tabulary}, +% \epkg{threeparttable}, \mpkg{threeparttablex}, +% \epkg{widetable}, \epkg{xltabular}, \epkg{xtab}. \\ % % \midrule % @@ -4936,7 +5122,7 @@ This boolean may be tested by the user for later use. % \epkg{figsize}, \ipkg{fitbox}, % \spkg{grffile}, \epkg{media9}, \epkg{movie15}, \epkg{multimedia}, \mpkg{overpic}, % \mpkg{psfrag}, \mpkg{psfragx}, \mpkg{pst-eps}, \mpkg{pstool}, \mpkg{pstricks}, -% \spkg{rviewport}, \spkg{tikz-3dplot}. \\ +% \spkg{rviewport}, \mpkg{svg}, \spkg{svg-extract}, \spkg{tikz-3dplot}. \\ % % \midrule % @@ -4984,8 +5170,9 @@ This boolean may be tested by the user for later use. % \cs{bfseries}, etc.\ are only supported in some cases. % \mpkg{cancel}, \epkg{ellipsis}, \mpkg{embrac}, \spkg{enparen}, % \ipkg{hyphenat}, \epkg{lettrine}, \epkg{lips}, -% \ipkg{lua-check-hyphen}, \ipkg{luacolor}, -% \epkg{magaz}, \ipkg{pdfrender}, \epkg{realscripts}, \mpkg{relsize}, +% \ipkg{lua-check-hyphen}, \ipkg{luacolor}, \epkg{magaz}, \ipkg{normalcolor}, +% \ipkg{pdfcol}, \ipkg{pdfcolmk}, +% \ipkg{pdfrender}, \epkg{realscripts}, \mpkg{relsize}, % \ipkg{scalefnt}, \epkg{soul}, \epkg{soulpos}, \epkg{soulutf8}, \mpkg{stackengine}, % \epkg{textfit}, \epkg{thinsp}, \ipkg{trimclip}, \ipkg{truncate}, % \mpkg{ulem}, \mpkg{umoline}, \ipkg{underscore}, \ipkg{uspace}, @@ -5036,16 +5223,17 @@ This boolean may be tested by the user for later use. % \midrule % % Science and engineering: & -% \mpkg{algorithm2e}, \mpkg{algorithmicx}, \mpkg{ar}, \spkg{askmaps}, +% \mpkg{algorithm2e}, \mpkg{algorithmicx}, \mpkg{ar}\sjax, \spkg{askmaps}, % \mpkg{axodraw2}, \mpkg{bitpattern}, \spkg{blochsphere}, \spkg{bodegraph}, % \spkg{bohr}, \mpkg{bytefield}, % \mpkg{chemfig}, \mpkg{chemformula}, \mpkg{chemgreek}, % \mpkg{chemmacros}, \mpkg{chemnum}, % \spkg{circuitikz}, \spkg{elements}, \spkg{engtlc}, \spkg{fast-diagram}, % \spkg{hepnicenames}, \spkg{heppennames}, \spkg{karnaughmap}, \mpkg{karnaugh-map}, -% \mpkg{listings}, \spkg{linop}, \mpkg{mhchem}, \spkg{pgfgantt}, -% \mpkg{phfqit}, \spkg{physics}, \spkg{qcircuit}, \mpkg{register}, \spkg{simpler-wick}, -% \spkg{slashed}, \spkg{structmech}, \mpkg{struktex}. +% \mpkg{listings}, \spkg{linop}, \mpkg{mhchem}\sjax, \spkg{pgfgantt}, +% \mpkg{phfqit}, \spkg{physics}\sjax, \spkg{qcircuit}, +% \mpkg{register}, \spkg{simpler-wick}, +% \spkg{slashed}\sjax, \mpkg{steinmetz}\sjax, \spkg{structmech}, \mpkg{struktex}. % \spkg{tikz-karnaugh}, \spkg{tikzcodeblocks} \\ % % \midrule @@ -5058,7 +5246,7 @@ This boolean may be tested by the user for later use. % % \midrule % -% Admonitions: & \epkg{notes}. \\ +% Admonitions: & \epkg{awesomebox}, \epkg{notes}. \\ % % Editorial: & \ipkg{changebar}, \spkg{changelog}, \mpkg{changes}, % \mpkg{easy-todo}, \spkg{easyReview}, \mpkg{ed}, \mpkg{errata}, \mpkg{fixme}, @@ -5073,6 +5261,8 @@ This boolean may be tested by the user for later use. % % \midrule % +% Package handling: & \spkg{catoptions}. \\ +% % Debug: & \ipkg{chkfloat}, \ipkg{cmdtrack}, \ipkg{dprogress}, % \ipkg{lua-visual-debug}, \ipkg{refcheck}, % \ipkg{srcltx}, \ipkg{srctex}, \ipkg{vpe}, \ipkg{xbmks}. \\ @@ -7631,14 +7821,14 @@ This boolean may be tested by the user for later use. % \osportabilityusage % % -% \subsection{Selecting actions for print or \HTML\ output} +% \subsection{Selecting actions for print, \HTML, or \brand{MathJax} output} % \label{sec:selectingoutput} % \gindex{settings>selecting output} % \changes{v0.15}{2016/04/05}{Docs: Clarify print/\HTML\ output.} % % The following environments and macros are used to select actions which only apply % to either traditional \LaTeX{} print-formatted \PDF\ generation, -% or to \HTML\ generation. +% or to \HTML\ generation, or to \HTML\ with \brand{MathJax}. % % For most of built-in \LaTeX\ and many additional packages % there is user-level source code support or emulation, @@ -7651,8 +7841,8 @@ This boolean may be tested by the user for later use. % the titlepage for print and another for \HTML. % \DescribeEnv{warpHTML} -% Anything which is to be done only for \HTMLfive{} output -% is surrounded by a |warpHTML| environment: +% Anything which is to be done only for \HTMLfive\ output +% is surrounded by a \env{warpHTML} environment: % \begin{Verbatim}[gobble=2,frame=lines,obeytabs,tabsize=4] % \begin{warpHTML} % ... something to be done only during \HTML\ generation @@ -7664,7 +7854,7 @@ This boolean may be tested by the user for later use. % % \DescribeEnv{warpprint} % Anything which is to be done only for print output -% is surrounded by a |warpprint| environment: +% is surrounded by a \env{warpprint} environment: % \begin{Verbatim}[gobble=2,frame=lines,obeytabs,tabsize=4] % \begin{warpprint} % ... something to be done only during traditional \PDF\ generation @@ -7675,7 +7865,7 @@ This boolean may be tested by the user for later use. % % \DescribeEnv{warpall} % Anything which is to be done for any output -% may be surrounded by a |warpall| environment. Doing so is optional. +% may be surrounded by a \env{warpall} environment. Doing so is optional. % \begin{Verbatim}[gobble=2,frame=lines,obeytabs,tabsize=4] % \begin{warpall} % ... something to be done during print \PDF\ or \HTML\ output @@ -7694,6 +7884,10 @@ This boolean may be tested by the user for later use. % % Performs the given actions only when \HTML\ output is being generated. % +% \DescribeEnv{warpMathJax} +% Anything which is to be done only while using \HTML\ output with \brand{MathJax} +% is surrounded by a \env{warpMathJax} environment. +% Usually, this is \cs{CustomizeMathJax}, used to add emulation macros. % % % \subsection{Commands to be placed into the \env{warpprint} environment} @@ -9089,12 +9283,19 @@ This boolean may be tested by the user for later use. % % \limitsmathdisplay % +% % \subsubsection{\pkg{ntheorem} package} % % \DescribePackage{ntheorem} % \limitsntheorem % % +% \subsubsection{\pkg{mathtools} package} +% +% \DescribePackage{mathtools} +% \limitsmathtools +% +% % \subsubsection{\pkg{siunitx} package} % \label{sec:limitssiunitx} % @@ -9107,7 +9308,18 @@ This boolean may be tested by the user for later use. % \DescribePackage{units} % \DescribePackage{nicefrac} % \limitsnicefrac -% +% +% +% \subsubsection{\pkg{physics} package} +% \label{sec:limitsphysics} +% +% \trouble{MathJax=\brand{MathJax}>physics=\pkg{physics}} +% \trouble{physics=\pkg{physics}>MathJax=\brand{MathJax}} +% +% \DescribePackage{physics} +% \limitsphysics +% +% % % \subsubsection{\pkg{newtxmath} package} % @@ -9408,7 +9620,7 @@ This boolean may be tested by the user for later use. % % \subsubsection{\pkg{chemformula} package} % \limitschemformula -% \trouble{array>chemformula=\pkg{chemformula}} +% \trouble{array=\env{array}>chemformula=\pkg{chemformula}} % \trouble{math>chemformula=\pkg{chemformula}} % % @@ -9978,7 +10190,7 @@ This boolean may be tested by the user for later use. % % \begin{docsidebar}[\bool{WPMarkMath}] % \trouble{TeXMaths} -% \trouble{siunitx>with TeXMaths} +% \trouble{siunitx=\pkg{siunitx}>with \prog{TeXMaths}} % \margintag{siunitx} % \DescribeBoolean{WPMarkMath} \DescribeDefault{false} % \DescribeProgram{TeXMaths} @@ -10490,6 +10702,10 @@ This boolean may be tested by the user for later use. % of the package until \pkg{lwarp} is updated. % \item[\pkg{longtable}:] \pkg{lwarp}'s \pkg{longtable} package issues % detailed error messages regarding the use of the table headers and footers. +% \item[\pkg{polyglossia}:] If used, an informative message is printed to +% instruct the user to be sure to set a language, without which an error will occur. +% \item[\pkg{babel} or \pkg{polyglossia}:] An informative message is printed to +% note that not all langauges are supported by \pkg{cleveref}. % \end{description} % % \subsubsection{Compiling} @@ -10574,7 +10790,7 @@ This boolean may be tested by the user for later use. % % \item [``No room for a new \cs{write}.'':] Before |\usepackage{lwarp}|, add: % \trouble{No room for a new \cs{write}} -% \trouble{morewrites} +% \trouble{morewrites=\pkg{morewrites}} % \begin{sourcedisplay} % \cs{usepackage}\{morewrites\} \\ % \cs{morewritessetup}\{allocate=10\} @@ -10595,9 +10811,10 @@ This boolean may be tested by the user for later use. % \end{sourcedisplay} % \trouble{Label(s) may have changed} % -% \item [``Leaders not followed by proper glue'':] This can be caused by -% a missing |l@<floattype>| or |l@<sectiontype>| definition. -% See \pkg{lwarp}'s definitions for examples. +% \item [``Leaders not followed by proper glue'':] ~ \\ +% This can be caused by +% a missing |l@<floattype>| or |l@<sectiontype>| definition. +% See \pkg{lwarp}'s definitions for examples. % \trouble{Leaders not followed by proper glue} % % \item [``Improper \cs{prevdepth}'':] @@ -10627,7 +10844,7 @@ This boolean may be tested by the user for later use. % If using BibTeX, see \cref{sec:limitsbibtex}.\watchout[BibTeX] % % \item[``\texttt{!~Undefined control sequence. \dots\ \cs{@begindocumenthook}''}:] ~ -% \watchout[\pkg{polyglossia}] +% \watchout[\pkg{polyglossia}] \\ % See \cref{sec:limitspolyglossia} % if using \pkg{polyglossia}. % @@ -11085,9 +11302,14 @@ This boolean may be tested by the user for later use. % Detects \XeTeX{} and \LuaLaTeX: % \gindex{Xe\LaTeX>detection}\gindex{Lua\LaTeX>detection} % +% \changes{v0.63}{2018/11/25}{Added p\TeX support.} +% \changes{v0.79}{2020/01/05}{\pkg{luatex85}: Removed.} +% \changes{v0.79}{2020/01/05}{\pkg{ifpdf}, \pkg{ifptex}: Provided by \pkg{iftex}.} % \begin{macrocode} -\RequirePackage{iftex} +\RequirePackage{iftex}[2019/11/07] + \newif\ifxetexorluatex + \ifXeTeX \xetexorluatextrue \else @@ -11097,18 +11319,6 @@ This boolean may be tested by the user for later use. \xetexorluatexfalse \fi \fi - -\ifLuaTeX -\RequirePackage{luatex85}% until the geometry package is updated -\fi - -\RequirePackage{ifpdf} -% \end{macrocode} -% -% \changes{v0.63}{2018/11/25}{Added p\TeX support.} -% -% \begin{macrocode} -\RequirePackage{ifptex} % \end{macrocode} % % @@ -11281,7 +11491,7 @@ This boolean may be tested by the user for later use. {% Package #1 is not supported\MessageBreak by lwarp's HTML conversion.\MessageBreak - Package(s) #2 may be useful instead + Package(s) #2 may be useful instead% } {% Package #1 might conflict with lwarp in some way,\MessageBreak @@ -11317,22 +11527,13 @@ This boolean may be tested by the user for later use. % This version checks immediately for packages which may have been loaded before \pkg{lwarp}. % % \changes{v0.54}{2018/04/06}{Added.} +% \changes{v0.79}{2020/01/09}{Factored.} % % \begin{macrocode} \newcommand*{\LWR@earlyloadnever}[2]{% -\@ifpackageloaded{#1}{% -\PackageError{lwarp} -{% - Package #1 is not supported\MessageBreak - by lwarp's HTML conversion.\MessageBreak - Package(s) #2 may be useful instead -} -{% - Package #1 might conflict with lwarp in some way,\MessageBreak - or is superceded by another package.\MessageBreak - For a possible alternative, see package(s) #2. -} -}{}% + \@ifpackageloaded{#1}{% + \LWR@loadnever{#1}{#2}% + }{}% } % \end{macrocode} % \end{macro} @@ -11386,9 +11587,27 @@ This boolean may be tested by the user for later use. \LWR@earlyloadnever{aecc}{cm-super, lmodern} \LWR@earlyloadnever{alg}{algorithm2e, algorithmicx} \LWR@earlyloadnever{algorithmic}{algorithm2e, algorithmicx} +\LWR@earlyloadnever{bitfield}{bytefield} \LWR@earlyloadnever{boxedminipage}{boxedminipage2e} \LWR@earlyloadnever{caption2}{caption} % \LWR@earlyloadnever{ccaption}{caption}% might be preloaded by memoir +\LWR@earlyloadnever{colortab}{colortbl} +\LWR@earlyloadnever{doublespace}{setspace} +\LWR@earlyloadnever{epsf}{graphicx} +\LWR@earlyloadnever{fancyheadings}{fancyhdr} +\LWR@earlyloadnever{fncylab}{cleveref} +\LWR@earlyloadnever{glossary}{glossaries} +\LWR@earlyloadnever{hyper}{hyperref} +\LWR@earlyloadnever{newthm}{ntheorem} +\LWR@earlyloadnever{pdfcprot}{microtype} +\LWR@earlyloadnever{picinpar}{floatflt, wrapfig} +\LWR@earlyloadnever{picins}{floatflt, wrapfig} +\LWR@earlyloadnever{rplain}{fancyhdr} +\LWR@earlyloadnever{si}{siunitx} +\LWR@earlyloadnever{sistyle}{siunitx} +\LWR@earlyloadnever{t1enc}{fontenc, inputenc, inputenx} +\LWR@earlyloadnever{ucs}{inputenc, inputencx} +\LWR@earlyloadnever{wasysym}{textcomp, amssymb, amsfonts, mnsymbol, fdsymbol} % \end{macrocode} % The older \pkg{CJK} and \pkg{CJKutf8} only work with \pkg{xeCJK}: % \begin{macrocode} @@ -11405,22 +11624,6 @@ This boolean may be tested by the user for later use. % \begin{macrocode} \LWR@earlyloadnever{hangul}{kotex, xetexko, luatexko} % \end{macrocode} -% Others: -% \begin{macrocode} -\LWR@earlyloadnever{colortab}{colortbl} -\LWR@earlyloadnever{epsf}{graphicx} -\LWR@earlyloadnever{fancyheadings}{fancyhdr} -\LWR@earlyloadnever{fncylab}{cleveref} -\LWR@earlyloadnever{glossary}{glossaries} -\LWR@earlyloadnever{hyper}{hyperref} -\LWR@earlyloadnever{pdfcprot}{microtype} -\LWR@earlyloadnever{picinpar}{floatflt, wrapfig} -\LWR@earlyloadnever{picins}{floatflt, wrapfig} -\LWR@earlyloadnever{sistyle}{siunitx} -\LWR@earlyloadnever{t1enc}{fontenc, inputenc, inputenx} -\LWR@earlyloadnever{ucs}{inputenc, inputencx} -\LWR@earlyloadnever{wasysym}{textcomp, amssymb, amsfonts, mnsymbol, fdsymbol} -% \end{macrocode} % % % \subsection{Enforcing package loading after \pkg{lwarp}} @@ -11449,8 +11652,6 @@ This boolean may be tested by the user for later use. \LWR@loadafter{acronym} \LWR@loadafter{adjmulticol} \LWR@loadafter{addlines} -\LWR@loadafter{ae} -\LWR@loadafter{aecc} \LWR@loadafter{afterpage} \LWR@loadafter{algorithm2e} \LWR@loadafter{algorithmicx} @@ -11470,6 +11671,7 @@ This boolean may be tested by the user for later use. \LWR@loadafter{attachfile2} \LWR@loadafter{authblk} \LWR@loadafter{autonum} +\LWR@loadafter{awesomebox} \LWR@loadafter{axessibility} \LWR@loadafter{axodraw2} \LWR@loadafter{backnaur} @@ -11481,13 +11683,14 @@ This boolean may be tested by the user for later use. \LWR@loadafter{bigstrut} \LWR@loadafter{bitpattern} \LWR@loadafter{blowup} +\LWR@loadafter{bm} \LWR@loadafter{booklet} \LWR@loadafter{bookmark} \LWR@notmemoirloadafter{booktabs} \LWR@loadafter{bophook} \LWR@loadafter{bounddvi} -\LWR@loadafter{boxedminipage} \LWR@loadafter{boxedminipage2e} +\LWR@loadafter{braket} \LWR@loadafter{breakurl} \LWR@loadafter{breqn} \LWR@loadafter{bsheaders} @@ -11557,7 +11760,6 @@ This boolean may be tested by the user for later use. \LWR@loadafter{extramarks} \LWR@loadafter{fancybox} \LWR@loadafter{fancyhdr} -\LWR@loadafter{fancyheadings} \LWR@loadafter{fancyref} \LWR@loadafter{fancytabs} \LWR@loadafter{fancyvrb} @@ -11708,9 +11910,16 @@ This boolean may be tested by the user for later use. \LWR@notmemoirloadafter{pagenote} \LWR@loadafter{pagesel} \LWR@loadafter{paralist} +\LWR@loadafter{parallel} +\LWR@loadafter{parcolumns} \LWR@loadafter{parnotes} \LWR@notmemoirloadafter{parskip} \LWR@loadafter{pbox} +\LWR@loadafter{pdfcol} +\LWR@loadafter{pdfcolfoot} +\LWR@loadafter{pdfcolmk} +\LWR@loadafter{pdfcolparallel} +\LWR@loadafter{pdfcolparcolumns} \LWR@loadafter{pdfcomment} \LWR@loadafter{pdfcrypt} \LWR@loadafter{pdflscape} @@ -11724,6 +11933,7 @@ This boolean may be tested by the user for later use. \LWR@loadafter{perpage} \LWR@loadafter{pfnote} \LWR@loadafter{phfqit} +\LWR@loadafter{physics} \LWR@loadafter{pifont} \LWR@loadafter{placeins} \LWR@loadafter{plarray} @@ -11783,6 +11993,7 @@ This boolean may be tested by the user for later use. \LWR@loadafter{SIunits} \LWR@loadafter{siunitx} \LWR@loadafter{slantsc} +\LWR@loadafter{slashed} \LWR@loadafter{soul} \LWR@loadafter{soulpos} \LWR@loadafter{soulutf8} @@ -11791,12 +12002,14 @@ This boolean may be tested by the user for later use. \LWR@loadafter{srctex} \LWR@loadafter{stabular} \LWR@loadafter{stackengine} +\LWR@loadafter{steinmetz} \LWR@notltjloadafter{stfloats} \LWR@loadafter{struktex} \LWR@loadafter{subcaption} \LWR@loadafter{subfig} \LWR@loadafter{subfigure} \LWR@loadafter{supertabular} +\LWR@loadafter{svg} \LWR@loadafter{t1inc} \LWR@loadafter{tabfigures} \LWR@loadafter{tabls} @@ -11844,6 +12057,7 @@ This boolean may be tested by the user for later use. % \LWR@loadafter{ulem}% preloaded by ctexart and related classes \LWR@loadafter{umoline} \LWR@loadafter{underscore} +\LWR@loadafter{unicode-math} \LWR@loadafter{units} \LWR@loadafter{unitsdef} \LWR@loadafter{upref} @@ -11859,7 +12073,9 @@ This boolean may be tested by the user for later use. \LWR@loadafter{vwcol} \LWR@loadafter{wallpaper} \LWR@loadafter{watermark} +\LWR@loadafter{widetable} \LWR@loadafter{widows-and-orphans} +\LWR@loadafter{witharrows} \LWR@loadafter{wrapfig} \LWR@loadafter{xbmks} \LWR@loadafter{xcolor} @@ -11885,7 +12101,6 @@ This boolean may be tested by the user for later use. % % % -% % \section{MD5 hashing} % % The MD5 hash is used for \env{lateximage} filenames for \SVG\ math. @@ -11925,7 +12140,8 @@ This boolean may be tested by the user for later use. % % \section{pdf\LaTeX\ T1 and \UTF-8 encoding} % -% When using pdf\LaTeX, \pkg{lwarp} requires T1 encoding, and recommends \UTF-8 encoding. +% When using pdf\LaTeX, \pkg{lwarp} requires T1 font encoding, +% and recommends \UTF-8 input encoding. % % If some other input encoding is already defined, \pkg{lwarp} will % try to use it instead, and hope for the best. @@ -11987,7 +12203,7 @@ This boolean may be tested by the user for later use. \newunicodechar{⨯}{\texttimes} \ifPDFTeX% pdflatex or dvi latex -\newunicodechar{ff}{ff}% the first arguments are ligatures +\newunicodechar{ff}{ff}% Here, the first arguments are ligatures. \newunicodechar{fi}{fi} \newunicodechar{fl}{fl} \newunicodechar{ffi}{ffi} @@ -12055,8 +12271,11 @@ This boolean may be tested by the user for later use. % % % +% +% % \section{Miscellaneous tools} % +% % \subsection{Lengths and units} % % \begin{macro}{\LWR@providelength} \marg{\cs{lengthname}} @@ -12095,6 +12314,19 @@ This boolean may be tested by the user for later use. % \end{macro} +% \subsection{Counters} + +% \begin{macro}{\defaddtocounter} \marg{name} \marg{value} +% +% Locally add to a counter. +% \begin{macrocode} +\providecommand*{\defaddtocounter}[2]{% + \defcounter{#1}{\value{#1}+#2}% +} +% \end{macrocode} +% \end{macro} + + % \subsection{Patching} % \begin{macro}{\LWR@patcherror} \marg{packagename} \marg{macroname} @@ -12104,7 +12336,7 @@ This boolean may be tested by the user for later use. \newcommand*{\LWR@patcherror}[2]{% \PackageError{lwarp} {Unable to patch package #1, macro #2} -{Please contact the author of the lwarp package.} +{Please contact the author of the Lwarp package.} } % \end{macrocode} % \end{macro} @@ -12218,6 +12450,26 @@ This boolean may be tested by the user for later use. % \end{environment} % % +% \subsection{Converting a macro name to a cs name} +% +% \begin{macro}{\macrotocsname} \marg{macro name with backslash} +% +% Results in the macro name without the leading backslash. +% +% Ref: \href{https://tex.stackexchange.com/questions/42318/removing-a-backslash-from-a-character-sequence} +% {\texttt{https://tex.stackexchange.com/questions/42318/removing-a-backslash-from-a-character-sequence}} +% +% \changes{v0.79}{2020/01/18}{Added.} +% \begin{macrocode} +\newcommand*{\macrotocsname}[1]{% + \ifcat\relax\noexpand#1% + \expandafter\expandafter\expandafter\@gobble\expandafter\string + \fi + #1% +} +% \end{macrocode} +% \end{macro} +% % % \section{Operating-System portability} % \label{sec:OSportability} @@ -12977,34 +13229,53 @@ This boolean may be tested by the user for later use. % \end{environment} -% \begin{environment}{warpprint} % \begin{environment}{warpHTML} -% Anything in the |warpprint| environment will be generated for print output only. % % For \HTML\ output: % \begin{macrocode} \ifbool{warpingHTML} -{\includecomment{warpHTML}} -{\excludecomment{warpHTML}}% + {\includecomment{warpHTML}} + {\excludecomment{warpHTML}}% % \end{macrocode} +% \end{environment} +% \begin{environment}{warpprint} +% +% Anything in the |warpprint| environment will be generated for print output only. % \begin{macrocode} \ifbool{warpingprint} -{\includecomment{warpprint}} -{\excludecomment{warpprint}} + {\includecomment{warpprint}} + {\excludecomment{warpprint}} % \end{macrocode} - % \end{environment} + + +% \begin{environment}{warpMathJax} +% Only if \brand{MathJax} is being used along with \HTML. +% \changes{v0.79}{2020/01/26}{Added.} +% \begin{macrocode} +\begin{warpprint} +\excludecomment{warpMathJax} +\end{warpprint} + +\begin{warpHTML} +\ifbool{mathjax} + {\includecomment{warpMathJax}} + {\excludecomment{warpMathJax}} +\end{warpHTML} +% \end{macrocode} % \end{environment} +% \begin{environment}{LWR@creatinglwarpmk} % Optionally generate a local copy of \prog{lwarpmk}. % Default to no. % \begin{macrocode} \ifbool{LWR@creatinglwarpmk} -{\includecomment{LWR@createlwarpmk}} -{\excludecomment{LWR@createlwarpmk}} + {\includecomment{LWR@createlwarpmk}} + {\excludecomment{LWR@createlwarpmk}} % \end{macrocode} +% \end{environment} % % % @@ -13283,8 +13554,9 @@ This boolean may be tested by the user for later use. % \end{macrocode} % % The user's paper size is saved for later reuse, -% such as by the \pkg{pdfpages} package. -% \begin{macrocode} +% such as by the \pkg{pdfpages} or \pkg{parallel} packages. +% \changes{v0.79}{2019/12/29}{\pkg{geometry}: Also save \cs{textwidth}, \cs{textheight}.} +%% \begin{macrocode} \newlength{\LWR@userspaperwidth} \setlength{\LWR@userspaperwidth}{\paperwidth} @@ -13293,6 +13565,12 @@ This boolean may be tested by the user for later use. \newlength{\LWR@usersmarginparwidth} \setlength{\LWR@usersmarginparwidth}{\marginparwidth} + +\newlength{\LWR@userstextwidth} +\setlength{\LWR@userstextwidth}{\textwidth} + +\newlength{\LWR@userstextheight} +\setlength{\LWR@userstextwidth}{\textheight} % \end{macrocode} % % For \pkg{lwarp}, use a very large page and margins @@ -13585,15 +13863,15 @@ This boolean may be tested by the user for later use. % \changes{v0.49}{2018/02/19}{Fix: Group \pkg{printlen} changes.} % \begin{macrocode} \newrobustcmd*{\LWR@printlength}[1]{% -\begingroup% -\uselengthunit{PT}% -\renewcommand*{\unitspace}{}% -\ifdimless{#1}{10pt}{% - \printlength{#1}% -}{% - \rndprintlength{#1}% -}% -\endgroup% + \begingroup% + \uselengthunit{PT}% + \renewcommand*{\unitspace}{}% + \ifdimless{#1}{10pt}{% + \printlength{#1}% + }{% + \rndprintlength{#1}% + }% + \endgroup% } % \end{macrocode} % \end{macro} @@ -13692,18 +13970,20 @@ This boolean may be tested by the user for later use. % \changes{v0.66}{2019/01/04}{Prevented \pkg{colortab}, \pkg{epsf}, \pkg{hyper}, \pkg{picinpar}, % \pkg{picins}, \pkg{sistyle}, \pkg{ucs}.} % \changes{v0.68}{2019/02/26}{Prevented \pkg{alg}, \pkg{algorithmic}, \pkg{fncylab}, \pkg{pdfcprot}.} +% \changes{v0.79}{2020/01/09}{Prevented \pkg{bxcjkjatype}, \pkg{hangul}.} % % The following should never be loaded: % \begin{macrocode} \newcommand*{\LWR@checkloadfilename}[1]{% -\LWR@checkloadnever{#1}{ae}{latinmodern} -\LWR@checkloadnever{#1}{aecc}{latinmodern} +\LWR@checkloadnever{#1}{ae}{cm-super, lmodern} +\LWR@checkloadnever{#1}{aecc}{cm-super, lmodern} +\LWR@checkloadnever{#1}{aecompl}{cm-super, lmodern} \LWR@checkloadnever{#1}{alg}{algorithm2e, algorithmicx} \LWR@checkloadnever{#1}{algorithmic}{algorithm2e, algorithmicx} \LWR@checkloadnever{#1}{bitfield}{bytefield} \LWR@checkloadnever{#1}{boxedminipage}{boxedminipage2e} \LWR@checkloadnever{#1}{caption2}{caption} -\LWR@checkloadnever{#1}{ccaption}{caption} +\LWR@checkloadnever{#1}{ccaption}{caption}% might be preloaded by memoir \LWR@checkloadnever{#1}{colortab}{colortbl} \LWR@checkloadnever{#1}{doublespace}{setspace} \LWR@checkloadnever{#1}{epsf}{graphicx} @@ -13721,6 +14001,8 @@ This boolean may be tested by the user for later use. \LWR@checkloadnever{#1}{t1enc}{fontenc, inputenc, inputenx} \LWR@checkloadnever{#1}{ucs}{inputenc, inputencx} \LWR@checkloadnever{#1}{wasysym}{textcomp, amssymb, amsfonts, mnsymbol, fdsymbol} +\LWR@checkloadnever{#1}{bxcjkjatype}{upLaTeX, bxjsarticle, ujarticle, utarticle} +\LWR@checkloadnever{#1}{hangul}{kotex, xetexko, luatexko} % \end{macrocode} % % ^^A *loadbefore @@ -13895,27 +14177,48 @@ This boolean may be tested by the user for later use. % Uses the original package, including options. % \begin{macrocode} \NewDocumentCommand{\LWR@ProvidesPackagePass}{m o}{ -\PackageInfo{lwarp}{% - Using package `#1' and adding lwarp modifications,\MessageBreak - including options,}% -\IfValueTF{#2} - {\ProvidesPackage{lwarp-#1}[#2]} - {\ProvidesPackage{lwarp-#1}} -\DeclareOption*{% - \PassOptionsToPackage{\CurrentOption}{#1}% -} -\ProcessOptions\relax% -\IfValueTF{#2}% - {\LWR@origRequirePackage{#1}[#2]}% - {\LWR@origRequirePackage{#1}}% + \PackageInfo{lwarp}{% + Using package `#1' and adding lwarp modifications,\MessageBreak + including options,}% + \IfValueTF{#2}% + {\ProvidesPackage{lwarp-#1}[#2]}% + {\ProvidesPackage{lwarp-#1}}% + \DeclareOption*{% + \PassOptionsToPackage{\CurrentOption}{#1}% + }% + \ProcessOptions\relax% +% \end{macrocode} +% +% If using \pkg{catoptions}, an error occurs if a package is loaded with an option +% then loaded again with no options. \pkg{lwarp} does this if a package is preloaded +% then later patched. To avoid an error while using \pkg{catoptions}, +% if a package has already been loaded, it is loaded again with its original options. +% \changes{v0.79}{2019/12/31}{Fix: \pkg{catoptions}.} +% \begin{macrocode} + \@ifpackageloaded{#1}{% + \edef\LWR@tempone{\csuse{opt@#1.sty}}% + \IfValueTF{#2}% + {% + \expandafter\LWR@origRequirePackage% + \expandafter[\LWR@tempone]{#1}[#2]% + }% + {% + \expandafter\LWR@origRequirePackage% + \expandafter[\LWR@tempone]{#1}% + }% + }{% + \IfValueTF{#2}% + {\LWR@origRequirePackage{#1}[#2]}% + {\LWR@origRequirePackage{#1}}% + }% % \end{macrocode} % In some cases, the following seems to be required % to avoid an ``unknown option'' error, such % as when loading \pkg{xcolor} with options. % \changes{v0.62}{2018/11/11}{Fix: Unknown option error.} % \begin{macrocode} -\DeclareOption*{}% -\ProcessOptions\relax% + \DeclareOption*{}% + \ProcessOptions\relax% } % \end{macrocode} % \end{macro} @@ -15457,6 +15760,7 @@ This boolean may be tested by the user for later use. % \changes{v0.74}{2019/08/04}{\filenm{lwarp.css}: Added \pkg{lyluatex}.} % \changes{v0.75}{2019/09/22}{\filenm{lwarp.css}: Improved marginblock.} % \changes{v0.76}{2019/10/02}{\filenm{lwarp.css}: Fix for small caps.} +% \changes{v0.79}{2020/01/17}{\filenm{lwarp.css}: Fix: Nested \env{tabular}s.} % % ^^A *lwarp.css % @@ -15465,8 +15769,8 @@ This boolean may be tested by the user for later use. \begin{LWRwriteconf} \begin{filecontents*}[overwrite]{lwarp.css} /* - CSS stylesheet for the LaTeX lwarp package - Copyright 2016-2019 Brian Dunn — BD Tech Concepts LLC + CSS stylesheet for the LaTeX Lwarp package + Copyright 2016-2020 Brian Dunn — BD Tech Concepts LLC */ @@ -16453,7 +16757,7 @@ table { line-height: 1.3 ; } -tr.hline td {border-top: 1px solid #808080 ; margin-top: 0ex ; +table > tbody > tr.hline > td {border-top: 1px solid #808080 ; margin-top: 0ex ; margin-bottom: 0ex ; } /* for \hline */ tr.tbrule td {border-top: 1px solid black ; margin-top: 0ex ; @@ -18022,10 +18326,10 @@ src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.6/MathJax.js?config=TeX- \begin{filecontents*}[overwrite]{lwarpmk.lua} #!/usr/bin/env texlua --- Copyright 2016-2019 Brian Dunn +-- Copyright 2016-2020 Brian Dunn -printversion = "v0.78" +printversion = "v0.79" requiredconfversion = "2" -- also at *lwarpmk.conf function printhelp () @@ -18752,7 +19056,7 @@ else -- not --version -- print intro: -print ("lwarpmk: " .. printversion .. " Automated make for the LaTeX lwarp package.") +print ("lwarpmk: " .. printversion .. " Automated make for the LaTeX Lwarp package.") -- lwarpmk print: @@ -19198,15 +19502,16 @@ end -- not --version % % \begin{macro}{\LWR@setexparray} \marg{name} \marg{index} \marg{contents} % \changes{v0.66}{2018/12/31}{Fix with \cs{par}.} +% \changes{v0.79}{2020/01/18}{Fix: Nested \env{tabular}s.} % \begin{macrocode} \NewDocumentCommand{\LWR@setexparray}{m m m}{% - \begingroup% + \let\LWR@temp@par\par% \let\par\relax% - \xdef\LWR@thisexparrayname{#1#2}% + \edef\LWR@thisexparrayname{#1#2}% \ifstrempty{#3}% - {\csgdef{\LWR@thisexparrayname}{}}% - {\csxdef{\LWR@thisexparrayname}{#3}}% - \endgroup% + {\csdef{\LWR@thisexparrayname}{}}% + {\csedef{\LWR@thisexparrayname}{#3}}% + \let\par\LWR@temp@par% } % \end{macrocode} % \end{macro} @@ -19249,8 +19554,8 @@ end -- not --version % \changes{v0.33}{2017/06/20}{Add: Avoids error: \protect\texttt{Misplaced alignment tab character \&}.} % \begin{macrocode} \newcommand{\StartDefiningTabulars}{% -\LWR@traceinfo{StartDefiningTabulars}% -\warpHTMLonly{\catcode`\&=\active}% + \LWR@traceinfo{StartDefiningTabulars}% + \warpHTMLonly{\catcode`\&=\active}% } % \end{macrocode} % \end{macro} @@ -19258,8 +19563,8 @@ end -- not --version % \begin{macro}{\StopDefiningTabulars} Place after defining something with |&| in it. % \begin{macrocode} \newcommand{\StopDefiningTabulars}{% -\LWR@traceinfo{StopDefiningTabulars}% -\warpHTMLonly{\catcode`\&=4}% + \LWR@traceinfo{StopDefiningTabulars}% + \warpHTMLonly{\catcode`\&=4}% } % \end{macrocode} % \end{macro} @@ -19280,8 +19585,8 @@ end -- not --version % \changes{v0.57}{2018/05/23}{Added.} % \begin{macrocode} \newcommand{\StartDefiningMath}{% -\LWR@traceinfo{StartDefiningMath}% -\warpHTMLonly{\catcode`\$=\active}% + \LWR@traceinfo{StartDefiningMath}% + \warpHTMLonly{\catcode`\$=\active}% } % \end{macrocode} % \end{macro} @@ -19289,8 +19594,8 @@ end -- not --version % \begin{macro}{\StopDefiningMath} Place after defining something with |$| in it. % \begin{macrocode} \newcommand{\StopDefiningMath}{% -\LWR@traceinfo{StopDefiningMath}% -\warpHTMLonly{\catcode`\$=3}% math shift + \LWR@traceinfo{StopDefiningMath}% + \warpHTMLonly{\catcode`\$=3}% math shift } % \end{macrocode} % \end{macro} @@ -21607,7 +21912,7 @@ end -- not --version \expandafter\ifvoid\csname LWR@#1box\endcsname\else \LWR@forcenewpage \begin{BlockClass}{footnotes} - \LWR@origmedskip + \null \unvbox\csuse{LWR@#1box} \setbox\csuse{LWR@#1box}=\vbox{} \end{BlockClass} @@ -21658,7 +21963,7 @@ end -- not --version \ifvoid\LWR@mpfootnotes\else \LWR@forcenewpage \begin{BlockClass}{footnotes} - \LWR@print@vspace*{\baselineskip} + \null \unvbox\LWR@mpfootnotes \setbox\LWR@mpfootnotes=\vbox{} \end{BlockClass} @@ -22105,6 +22410,110 @@ end -- not --version % \end{macro} + +% \subsection{Sanitizing expressions for \HTML} + +% Math expressions are converted to |lateximage|s, +% and some math environments may contain +% |&|, |<|, or |>|, which should not be allowed +% inside an \HTML\ \element{alt} tag, so must convert them to \HTML\ entities. +% +% +% \begin{macro}{\LWR@subHTMLsanitize} +% +% \cs{LWR@strresult} must first be set by \cs{LWR@HTMLsanitize}, +% \cs{LWR@HTMLsanitizeexpand}, or \cs{CustomizeMathJax}. +% +% \changes{v0.36}{2017/08/16}{Fix for \pkg{babel-french}.} +% \changes{v0.51}{2018/03/07}{Fix: Escapes double quotes.} +% \changes{v0.79}{2020/01/27}{Fix: \cs{\&}. Factored.} +% \begin{macrocode} +\newcommand{\LWR@subHTMLsanitize}{% +% \end{macrocode} +% The |&|, |<|, and |>| may be interpreted by the browser: +% \begin{macrocode} + \protect\StrSubstitute{\detokenize\expandafter{\LWR@strresult}}% + {\detokenize{&}}{\detokenize{&}}[\LWR@strresult]% +% \end{macrocode} +% \begin{macrocode} + \protect\StrSubstitute{\detokenize\expandafter{\LWR@strresult}}% + {\detokenize{<}}{\detokenize{<}}[\LWR@strresult]% +% \end{macrocode} +% \begin{macrocode} + \protect\StrSubstitute{\detokenize\expandafter{\LWR@strresult}}% + {\detokenize{>}}{\detokenize{>}}[\LWR@strresult]% +% \end{macrocode} +% The double quote occasionally causes problems. +% \begin{macrocode} + \protect\StrSubstitute{\detokenize\expandafter{\LWR@strresult}}% + {\detokenize{"}}{\detokenize{"}}[\LWR@strresult]% +% \end{macrocode} +% MathJax allows expressions to be defined with \cs{newcommand}. +% These expressions would appear with |##| for each argument, +% and each must be changed to a single |#|. +% This must be done after all the above changes. +% Attempting another conversion after this causes an error upon further expansion. +% \begin{macrocode} + \protect\StrSubstitute{\detokenize\expandafter{\LWR@strresult}}% + {\detokenize{##}}{\LWR@origpound}[\LWR@strresult]% +% \end{macrocode} +% \begin{macrocode} +} +% \end{macrocode} +% \end{macro} + + +% \begin{macro}{\LWR@HTMLsanitize} \marg{text} +% +% \begin{macrocode} +\newrobustcmd{\LWR@HTMLsanitize}[1]{% +% \end{macrocode} +% Cancel French \pkg{babel} character handling, +% and fully expand the strings: +% \begin{macrocode} + \begingroup% + \LWR@FBcancel% + \fullexpandarg% + \protect\StrSubstitute{\detokenize{#1}}% + {\detokenize{\&}}{\detokenize{&}}[\LWR@strresult]% + \LWR@subHTMLsanitize% + \LWR@strresult% + \endgroup% +} +% \end{macrocode} +% \end{macro} + + +% \begin{macro}{\LWR@HTMLsanitizeexpand} \marg{text} +% +% This version expands the argument before sanitizing it. +% +% \changes{v0.36}{2017/08/16}{Fix for \pkg{babel-french}.} +% \changes{v0.51}{2018/03/07}{Fix: Escapes double quotes.} +% \changes{v0.79}{2020/01/27}{Fix: \cs{\&}.} +% \begin{macrocode} +\newrobustcmd{\LWR@HTMLsanitizeexpand}[1]{% +% \end{macrocode} +% Cancel French \pkg{babel} character handling, +% and fully expand the strings: +% \begin{macrocode} + \begingroup% + \LWR@FBcancel% + \fullexpandarg% +% \end{macrocode} +% The difference between this and \cs{LWR@HTMLsanitize} (without ``expand'') +% is the following \cs{expandafter}: +% \begin{macrocode} + \protect\StrSubstitute{\detokenize\expandafter{#1}}% + {\detokenize{\&}}{\detokenize{&}}[\LWR@strresult]% + \LWR@subHTMLsanitize% + \LWR@strresult% + \endgroup% +} +% \end{macrocode} +% \end{macro} + + % \subsection{Customizing \brand{MathJax}} % \begin{macro}{\LWR@customizedMathJax} @@ -22119,22 +22528,62 @@ end -- not --version % % \limitscustomizemathjax % +% % \changes{v0.52}{2018/03/31}{Added.} +% \changes{v0.79}{2020/01/22}{Fix: Sanitize for \HTML.} % \begin{macrocode} -\newcommand*{\CustomizeMathJax}[1]{% - \appto{\LWR@customizedMathJax}{% - \(#1\)\par +\newcommand*{\LWR@subcustomizedmathjax}[1]{% + \begingroup% + \LWR@FBcancel% + \fullexpandarg% + \protect\StrSubstitute{\detokenize{#1}}% + {\detokenize{\&}}{\detokenize{&}}[\LWR@strresult]% + \LWR@subHTMLsanitize% + \xdef\LWR@customizedMathJax{% + \LWR@customizedMathJax% + \LWR@strresult% }% + \endgroup% +} + +\newcommand*{\CustomizeMathJax}[1]{% + \appto\LWR@customizedMathJax{\LWRbackslash(}% + \LWR@subcustomizedmathjax{#1}% + \appto\LWR@customizedMathJax{\LWRbackslash)\par}% } % \end{macrocode} % \end{macro} +% +% +% Default customizations: +% +% \changes{v0.51}{2018/03/18}{MathJax: Nullifies \cs{ensuremath}.} +% \changes{v0.57}{2018/05/24}{MathJax: Supports \cs{footnote}, \cs{footnotemark}.} +% \changes{v0.79}{2020/01/24}{\brand{MathJax}: Additional macros.} +% \begin{macrocode} +\begin{warpMathJax} +\CustomizeMathJax{\newcommand\ensuremath[1]{#1}} +\CustomizeMathJax{\newcommand\footnote[2][]{\text{( Footnote #1 )}}} +\CustomizeMathJax{\newcommand\footnotemark[1][]{\text{( Footnote #1 )}}} +\CustomizeMathJax{% absorb two optional arguments + \newcommand{\LWRframebox}[2][]{\fbox{#2}} + \newcommand{\framebox}[1][]{\LWRframebox} +} +\CustomizeMathJax{\newcommand{\setlength}[2]{}} +\CustomizeMathJax{\newcommand{\addtolength}[2]{}} +\CustomizeMathJax{\newcommand{\setcounter}[2]{}} +\CustomizeMathJax{\newcommand{\addtocounter}[2]{}} +\CustomizeMathJax{\newcommand{\cline}[1]{}} +\CustomizeMathJax{\newcommand{\directlua}[1]{\text{(directlua)}}} +\CustomizeMathJax{\newcommand{\luatexdirectlua}[1]{\text{(directlua)}}} +\end{warpMathJax} +% \end{macrocode} % \begin{macro}{\LWR@customizeMathJax} % Prints MathJax commands to the \HTML\ output. % -% \changes{v0.51}{2018/03/18}{MathJax: Nullifies \cs{ensuremath}.} -% \changes{v0.57}{2018/05/24}{MathJax: Supports \cs{footnote}, \cs{footnotemark}.} +% \changes{v0.79}{2020/01/28}{MathJax: Hide definitions.} % \begin{macrocode} \newcommand{\LWR@customizeMathJax}{% \ifbool{mathjax}{ @@ -22142,17 +22591,13 @@ end -- not --version % ^^A \ifboolexpr{bool{mathjax} and not bool{mathKaTeX}}{ % \begin{macrocode} \LWR@stoppars -\LWR@htmlcomment{Nullify \textbackslash{}ensuremath, footnotes for MathJax:} - -\(\newcommand\ensuremath[1]{##1}\) - -\(\newcommand\footnote[2][]{\text{( Footnote ##1 )}}\) - -\(\newcommand\footnotemark[1][]{\text{( Footnote ##1 )}}\) - -\LWR@htmlcomment{Additional customizations for MathJax:} +\LWR@htmlcomment{MathJax customizations:} +\begin{BlockClass}{hidden} +\LWR@stoppars \LWR@customizedMathJax +\LWR@startpars +\end{BlockClass} \LWR@startpars }{} @@ -22490,10 +22935,7 @@ end -- not --version % \end{macrocode} % -% If using \brand{MathJax}, -% disable \cs{ensuremath} by printing a nullified -% definition at the start of each file, and add further customizations: -% \changes{v0.51}{2018/03/18}{MathJax: Nullifies \cs{ensuremath}.} +% If using \brand{MathJax}, print the customizations here. % \begin{macrocode} \LWR@customizeMathJax % \end{macrocode} @@ -23478,7 +23920,7 @@ end -- not --version \LWR@htmltag{% meta % space name=\LWR@orig@textquotedbl{}generator\LWR@orig@textquotedbl\ % space - content=\LWR@orig@textquotedbl{}LaTeX lwarp package\LWR@orig@textquotedbl\ /% + content=\LWR@orig@textquotedbl{}LaTeX Lwarp package\LWR@orig@textquotedbl\ /% }\LWR@orignewline% % \end{macrocode} % If there is a description, add it now: @@ -25540,7 +25982,7 @@ end -- not --version % \end{macrocode} % \end{macro} -% \cs{futurelet} copies the next token then executes a function to analyze +% \cs{futurelet} copies the next token then executes a function to analyze it. % \cs{LWR@futurenonspacelet} does the same, but ignores intervening white space @@ -25550,10 +25992,13 @@ end -- not --version % \begin{macrocode} \def\LWR@futurenonspacelet#1{\def\LWR@cs{#1}% \afterassignment\LWR@fnslone\let\nexttoken= } + \def\LWR@fnslone{\expandafter\futurelet\LWR@cs\LWR@fnsltwo} + \def\LWR@fnsltwo{% \expandafter\ifx\LWR@cs\@sptoken\let\next=\LWR@fnslthree% \else\let\next=\nexttoken\fi\next} + \def\LWR@fnslthree{\afterassignment\LWR@fnslone\let\next= } % \end{macrocode} % \end{macro} @@ -25562,15 +26007,19 @@ end -- not --version % Looks ahead and copies the next token into \cs{LWR@mynexttoken}. % \begin{macrocode} \newcommand*{\LWR@getmynexttoken}{% -\LWR@traceinfo{LWR@getmynexttoken}% + \LWR@traceinfo{LWR@getmynexttoken}% % nothing must follow this next line -\LWR@futurenonspacelet\LWR@mynexttoken\LWR@tabledatacolumntag + \LWR@futurenonspacelet\LWR@mynexttoken\LWR@tabledatacolumntag } % \end{macrocode} % \end{macro} % \subsection{Tabular variables} +% +% In order to support nested \env{tabular}s, each of these is used locally. +% For local counters, \pkg{etoolbox}'s \cs{defcounter} and +% \pkg{lwarp}'s new \cs{defaddtocounter} are used. % \DescribeBoolean{LWR@startedrow} % True if should print a row tag before this column. @@ -25677,6 +26126,40 @@ end -- not --version % \end{macrocode} +% \DescribeBoolean{LWR@exitingtabular} +% When \cs{end} is found, turns off the next opening data tag. +% \begin{macrocode} +\newbool{LWR@exitingtabular} +% \end{macrocode} + + +% \DescribeBoolean{LWR@tabularmutemods} +% Mutes \HTML\ output for |@|, |!|, |<| and |>|. +% +% This is used while printing the final row to generate \cs{bottomrule}s. +% \begin{macrocode} +\newbool{LWR@tabularmutemods} +% \end{macrocode} + + +% \DescribeBoolean{LWR@validtablecol} True if found a valid table column type. +% \begin{macrocode} +\newbool{LWR@validtablecol} +% \end{macrocode} +% +% +% \DescribeBoolean{LWR@opttablecol} True if found a table column optional argument. +% \begin{macrocode} +\newbool{LWR@opttablecol} +% \end{macrocode} + +% Used to add a style to a table data cell: +% \begin{macrocode} +\newbool{LWR@tdhavecellstyle} +% \end{macrocode} + + + % \DescribeCounter{LWR@tabularDepth} % Tracks whether |&| is being used inside a \env{tabular}. % \begin{macrocode} @@ -25788,6 +26271,57 @@ end -- not --version % \DescribeObject{LWR@colbarspec} A data array of specifications for vertical rules. + +% \DescribeCounter{LWR@cellcolordepth} +% Counts how many cell color \element{div}s were added to the current tabular data cell. +% \begin{macrocode} +\newcounter{LWR@cellcolordepth} +% \end{macrocode} + + + +% \subsubsection{Multicolumn variables} + +% \begin{macrocode} +\newcounter{LWR@tablemulticolswidth} +% \end{macrocode} +% +% Indexes into the multicolumn specification: +% \begin{macrocode} +\newcounter{LWR@tablemulticolspos} +% \end{macrocode} + +% Remembers multicolumn vertical rules if found in the column spec. +% \begin{macrocode} +\newcounter{LWR@mcolvertbarsl} +\newcounter{LWR@mcolvertbarsr} +\newcounter{LWR@mcolvertbarsldash} +\newcounter{LWR@mcolvertbarsrdash} +\newbool{LWR@mcolvertbaronleft} +% \end{macrocode} + + +% \subsubsection{Longtable variables} +% \DescribeBoolean{LWR@starredlongtable} +% Per the \pkg{caption} pacakge, step the counter if |longtable*|. +% +% \begin{macrocode} +\newbool{LWR@starredlongtable} +\boolfalse{LWR@starredlongtable} +% \end{macrocode} +% + +% \subsubsection{Midrule variables} + +% \DescribeCounter{LWR@midrulecounter} +% Indexes across the |LWR@midrules| and |LWR@trim<l/r>rules| data arrays. +% \begin{macrocode} +\newcounter{LWR@midrulecounter} +% \end{macrocode} + + + + % \subsection{Handling \&, @, !, and bar} % % \begin{minipage}{\linewidth} @@ -25800,12 +26334,12 @@ end -- not --version % \begin{macro}{\LWR@instertatbangcols} % \begin{macrocode} \newcommand*{\LWR@insertatbangcols}{% -\ifbool{LWR@skipatbang}% -{}% -{% - \LWR@printatbang{at}{\arabic{LWR@tableLaTeXcolindex}}% - \LWR@printatbang{bang}{\arabic{LWR@tableLaTeXcolindex}}% -}% + \ifbool{LWR@skipatbang}% + {}% + {% + \LWR@printatbang{at}{\arabic{LWR@tableLaTeXcolindex}}% + \LWR@printatbang{bang}{\arabic{LWR@tableLaTeXcolindex}}% + }% } % \end{macrocode} % \end{macro} @@ -25821,50 +26355,53 @@ end -- not --version % % \begin{macrocode} \newcommand*{\LWR@closetabledatacell}{% -\global\booltrue{LWR@intabularmetadata}% -\ifbool{LWR@exitingtabular}% -{% + \booltrue{LWR@intabularmetadata}% + \ifbool{LWR@exitingtabular}% + {% % \end{macrocode} % \changes{v0.71}{2019/04/27}{Fix: Tabular par tags.} % \begin{macrocode} - \LWR@stoppars% -}% -{% not exiting tabular - \ifboolexpr{bool{LWR@skippingmrowcell} or bool{LWR@skippingmcolrowcell}}% - {% + \LWR@stoppars% + }% + {% not exiting tabular + \ifboolexpr{bool{LWR@skippingmrowcell} or bool{LWR@skippingmcolrowcell}}% + {% % \end{macrocode} % \changes{v0.71}{2019/04/27}{Fix: Tabular par tags.} % \begin{macrocode} - \LWR@stoppars% + \LWR@stoppars% % \end{macrocode} % If not skipping a \cs{multicolumnrow} cell, % insert the |@| and |!| columns after this non-existant column. % \changes{v0.41}{2017/10/03}{Fix: At/bang column with \cs{multirow}.} % \begin{macrocode} - \ifbool{LWR@skippingmcolrowcell}% - {}% - {\LWR@insertatbangcols}% - }% - {% not skippingmrowcell + \ifbool{LWR@skippingmcolrowcell}% + {}% + {\LWR@insertatbangcols}% + }% + {% not skippingmrowcell % \end{macrocode} % Insert any |<| then any |@| and |!| column contents, unless muted % for the \cs{bottomrule} or a \cs{multicolumn}: % \changes{v0.41}{2017/10/02}{Fix: Cancel \progcode{\protect\textless} for \cs{multicolumn}.} % \begin{macrocode} - \unskip% - \ifboolexpr{% - bool{LWR@tabularmutemods} or - bool{LWR@skipatbang} or - bool{LWR@emptyatbang} - }% - {}% - {\LWR@getexparray{LWR@colafterspec}{\arabic{LWR@tableLaTeXcolindex}}}% + \unskip% + \ifboolexpr{% + bool{LWR@tabularmutemods} or + bool{LWR@skipatbang} or + bool{LWR@emptyatbang} + }% + {}% + {% + \LWR@getexparray{LWR@colafterspec}% + {\arabic{LWR@tableLaTeXcolindex}}% + }% % \end{macrocode} % Close paragraphs: % \changes{v0.71}{2019/04/27}{Fix: Tabular par tags.} % \begin{macrocode} - \LWR@stoppars% - \global\boolfalse{LWR@tableparcell}% + \LWR@stoppars% + \boolfalse{LWR@tableparcell}% % \end{macrocode} % % Close the table data cell. @@ -25872,28 +26409,29 @@ end -- not --version % Close any color \element{div}s. % \changes{v0.48}{2018/02/06}{\pkg{colortbl}: Added.} % \begin{macrocode} - \whileboolexpr{test {\ifnumcomp{\value{LWR@cellcolordepth}}{>}{0}}}{% - \LWR@htmltag{/div}\LWR@orignewline% - \addtocounter{LWR@cellcolordepth}{-1}% - }% + \whileboolexpr{test {\ifnumcomp{\value{LWR@cellcolordepth}}{>}{0}}}{% + \LWR@htmltag{/div}\LWR@orignewline% + \defaddtocounter{LWR@cellcolordepth}{-1}% + }% % \end{macrocode} % Skip the |@| and |!| cells if are closing a multicolumn cell. % \begin{macrocode} - \leavevmode\unskip\LWR@htmltag{/td}\LWR@orignewline% - \global\booltrue{LWR@tabularcelladded}% - \LWR@insertatbangcols% - }% not skipping mrowcell -}% not exiting tabular -\global\boolfalse{LWR@skippingmrowcell}% -\global\boolfalse{LWR@skippingmcolrowcell}% -\global\boolfalse{LWR@skipatbang}% + \leavevmode\unskip\LWR@htmltag{/td}\LWR@orignewline% + \global\booltrue{LWR@tabularcelladded}% + \LWR@insertatbangcols% + }% not skipping mrowcell + }% not exiting tabular + \boolfalse{LWR@skippingmrowcell}% + \boolfalse{LWR@skippingmcolrowcell}% + \boolfalse{LWR@skipatbang}% % \end{macrocode} % Color control. Column is set by |>{}| for each cell, so it must be cleared here. % \changes{v0.48}{2018/02/06}{\pkg{colortbl}: Added.} +% \changes{v0.79}{2020/01/18}{Fix: Nested \env{tabular}s.} % \begin{macrocode} -\gdef\LWR@cellHTMLcolor{} -\gdef\LWR@columnHTMLcolor{} -\setcounter{LWR@cellcolordepth}{0} + \def\LWR@cellHTMLcolor{}% + \def\LWR@columnHTMLcolor{}% + \defcounter{LWR@cellcolordepth}{0}% } % \end{macrocode} % \end{macro} @@ -25928,31 +26466,33 @@ end -- not --version % % \begin{macrocode} \newcommand*{\LWR@tabularampersand}{% -\LWR@traceinfo{LWR@tabularampersand}% -\ifnumcomp{\value{LWR@tabulardepth}}{>}{0}% -{% + \LWR@traceinfo{LWR@tabularampersand}% + \ifnumcomp{\value{LWR@tabulardepth}}{>}{0}% + {% % \end{macrocode} % If not skipping a multirow cell, close the current data cell. % \begin{macrocode} - \unskip% - \LWR@closetabledatacell% + \unskip% + \LWR@closetabledatacell% % \end{macrocode} % Move to the next column. % \begin{macrocode} - \addtocounter{LWR@tableLaTeXcolindex}{1}% + \defaddtocounter{LWR@tableLaTeXcolindex}{1}% % \end{macrocode} % Have not yet added data in this column: % \begin{macrocode} - \global\boolfalse{LWR@tabularcelladded}% + \global\boolfalse{LWR@tabularcelladded}% % \end{macrocode} % Look at the next token to decide multi or single column data tag. % \begin{macrocode} - \LWR@getmynexttoken% -}% + \LWR@getmynexttoken% + }% % \end{macrocode} % If not inside a tabular, performs the original action: % \begin{macrocode} -{\LWR@origampmacro}% + {% + \LWR@origampmacro% + }% } % \end{macrocode} % |&| is left with its original catcode for now. @@ -25984,14 +26524,14 @@ end -- not --version % If not exiting the tabular, or doing a rule, or have already started a row, % finish this row: % \begin{macrocode} -\ifboolexpr{% - not bool {LWR@exitingtabular} or% - bool{LWR@doingtbrule} or% - bool{LWR@doingcmidrule} or% - test{\ifnumcomp{\value{LWR@hlines}}{>}{0}} or% - test{\ifnumcomp{\value{LWR@hdashedlines}}{>}{0}} or% - bool{LWR@startedrow}% -}{% + \ifboolexpr{% + not bool {LWR@exitingtabular} or% + bool{LWR@doingtbrule} or% + bool{LWR@doingcmidrule} or% + test{\ifnumcomp{\value{LWR@hlines}}{>}{0}} or% + test{\ifnumcomp{\value{LWR@hdashedlines}}{>}{0}} or% + bool{LWR@startedrow}% + }{% % \end{macrocode} % To temporarily turn off |LWR@exitingtabular| so that % table data tags will still be generated: @@ -25999,60 +26539,63 @@ end -- not --version % If generating a final row for the \cs{bottomrule} borders, % turn off the |@|, |!|, |<|, and |>| column output: % \begin{macrocode} -\ifbool{LWR@exitingtabular}{% - \global\booltrue{LWR@tabularmutemods}% -}{% - \global\boolfalse{LWR@tabularmutemods}% -}% + \ifbool{LWR@exitingtabular}{% + \booltrue{LWR@tabularmutemods}% + }{% + \boolfalse{LWR@tabularmutemods}% + }% % \end{macrocode} % Locally reenable the table data tags until finished with the final row: % \begin{macrocode} -\global\boolfalse{LWR@exitingtabular}% + \boolfalse{LWR@exitingtabular}% % \end{macrocode} % Generate table data tags and ampersands until the right edge: % \begin{macrocode} -\whileboolexpr{% - test { - \ifnumcomp{\value{LWR@tableLaTeXcolindex}}{<}{\value{LWR@tabletotalLaTeXcols}} - } or % - (% - bool{LWR@intabularmetadata} and% - not bool{LWR@tabularcelladded} and% + \whileboolexpr{% test { - \ifnumcomp{\value{LWR@tableLaTeXcolindex}}{=}{\value{LWR@tabletotalLaTeXcols}} - }% - )% -}% -{% - \LWR@tabledatasinglecolumntag% + \ifnumcomp{\value{LWR@tableLaTeXcolindex}}{<} + {\value{LWR@tabletotalLaTeXcols}} + } or % + (% + bool{LWR@intabularmetadata} and% + not bool{LWR@tabularcelladded} and% + test { + \ifnumcomp{\value{LWR@tableLaTeXcolindex}}{=} + {\value{LWR@tabletotalLaTeXcols}} + }% + )% + }% + {% + \LWR@tabledatasinglecolumntag% % \end{macrocode} % The following is essentially \cs{LWR@tabularampersand} with % |LWR@emptyatbang| added to empty the following cells: % \begin{macrocode} - \LWR@closetabledatacell% - \addtocounter{LWR@tableLaTeXcolindex}{1}% - \global\boolfalse{LWR@tabularcelladded}% - \global\booltrue{LWR@emptyatbang}% + \LWR@closetabledatacell% + \defaddtocounter{LWR@tableLaTeXcolindex}{1}% + \global\boolfalse{LWR@tabularcelladded}% + \booltrue{LWR@emptyatbang}% % \end{macrocode} % Starts the next cell: % \begin{macrocode} - \ifnumcomp{\value{LWR@tableLaTeXcolindex}}{<}{\value{LWR@tabletotalLaTeXcols}}% - {\LWR@getmynexttoken}% - {}% -}% + \ifnumcomp{\value{LWR@tableLaTeXcolindex}}{<} + {\value{LWR@tabletotalLaTeXcols}}% + {\LWR@getmynexttoken}% + {}% + }% % \end{macrocode} % Reenable the original |LWR@exitingtabular| to close the entire table: % \begin{macrocode} -\ifbool{LWR@tabularmutemods}{% - \global\booltrue{LWR@exitingtabular}% -}{% - \global\boolfalse{LWR@exitingtabular}% -}% -\global\boolfalse{LWR@tabularmutemods}% + \ifbool{LWR@tabularmutemods}{% + \booltrue{LWR@exitingtabular}% + }{% + \boolfalse{LWR@exitingtabular}% + }% + \boolfalse{LWR@tabularmutemods}% % \end{macrocode} % \begin{macrocode} -\global\boolfalse{LWR@emptyatbang}% -}{}% ifboolexpr + \boolfalse{LWR@emptyatbang}% + }{}% ifboolexpr } % \end{macrocode} % \end{macro} @@ -26072,51 +26615,55 @@ end -- not --version % \end{macrocode} % Finish the row: % \begin{macrocode} -\ifnumcomp{\value{LWR@tableLaTeXcolindex}}{<}{\value{LWR@tabletotalLaTeXcols}}% - {\LWR@tabularfinishrow}% - {\LWR@closetabledatacell}% -\LWR@htmltag{/tr}\LWR@orignewline% + \ifnumcomp{\value{LWR@tableLaTeXcolindex}}{<} + {\value{LWR@tabletotalLaTeXcols}}% + {\LWR@tabularfinishrow}% + {\LWR@closetabledatacell}% + \LWR@htmltag{/tr}\LWR@orignewline% % \end{macrocode} % \pkg{xcolor} row color support: % \begin{macrocode} -\@rowc@lors% + \@rowc@lors% % \end{macrocode} % No longer inside a data cell: % \begin{macrocode} -\global\booltrue{LWR@intabularmetadata}% + \booltrue{LWR@intabularmetadata}% % \end{macrocode} % Not yet started a table row: % \begin{macrocode} -\global\boolfalse{LWR@startedrow}% + \boolfalse{LWR@startedrow}% % \end{macrocode} % Additional setup: % \begin{macrocode} -\setcounter{LWR@hlines}{0}% -\setcounter{LWR@hdashedlines}{0}% -\global\boolfalse{LWR@doingtbrule}% -\global\boolfalse{LWR@doingcmidrule}% -\LWR@clearmidrules% -\gdef\LWR@rowHTMLcolor{}% + \defcounter{LWR@hlines}{0}% + \defcounter{LWR@hdashedlines}{0}% + \boolfalse{LWR@doingtbrule}% + \boolfalse{LWR@doingcmidrule}% + \LWR@clearmidrules% +% \end{macrocode} +% \changes{v0.79}{2020/01/18}{Fix: Nested \env{tabular}s.} +% \begin{macrocode} + \def\LWR@rowHTMLcolor{}% % \end{macrocode} % Start at first column: % \begin{macrocode} -\setcounter{LWR@tableLaTeXcolindex}{1}% + \defcounter{LWR@tableLaTeXcolindex}{1}% % \end{macrocode} % Have not yet added data in this column: % \begin{macrocode} -\global\boolfalse{LWR@tabularcelladded}% + \global\boolfalse{LWR@tabularcelladded}% % \end{macrocode} % Allow \TeX\ to flush the pending paragraph. % Not doing so causes a slowdown for very large tables. % \changes{v0.60}{2018/09/17}{Fix: Slowdown for long tables.} % \begin{macrocode} -\LWR@stoppars -\LWR@origpar + \LWR@stoppars% + \LWR@origpar% % \end{macrocode} % Look at the next token to decide between single column data tag % or a special case: % \begin{macrocode} -\LWR@getmynexttoken% + \LWR@getmynexttoken% } % \end{macrocode} % \end{macro} @@ -26132,16 +26679,16 @@ end -- not --version % The |w| column alignment will be seen as a single unit such as |{c}|. % \begin{macrocode} \newcommand*{\LWR@columnspeclookahead}[1]{% -\setcounter{LWR@tempcountone}{\value{LWR@tablecolspecindex}}% -\addtocounter{LWR@tempcountone}{#1}% -\fullexpandarg% -\StrChar{\LWR@origcolspec}{\arabic{LWR@tempcountone}}[\LWR@strresulttwo]% + \setcounter{LWR@tempcountone}{\value{LWR@tablecolspecindex}}% + \addtocounter{LWR@tempcountone}{#1}% + \fullexpandarg% + \StrChar{\LWR@origcolspec}{\arabic{LWR@tempcountone}}[\LWR@strresulttwo]% % \end{macrocode} % Get the contents of the first group in \cs{LWR@strresulttwo}: % \begin{macrocode} -\exploregroups% -\StrChar{\LWR@strresulttwo}{1}[\LWR@strresulttwo]% -\noexploregroups% + \exploregroups% + \StrChar{\LWR@strresulttwo}{1}[\LWR@strresulttwo]% + \noexploregroups% } % \end{macrocode} % \end{macro} @@ -26155,6 +26702,7 @@ end -- not --version \newcommand*{\LWR@colparameter}{} % \end{macrocode} % +% % \begin{macro}{\LWR@parseatcolumn} % % Handles |@{text}| columns. @@ -26166,36 +26714,40 @@ end -- not --version % \end{macrocode} % Move to the next token after the '@': % \begin{macrocode} -\LWR@traceinfo{at column}% -\addtocounter{LWR@tablecolspecindex}{1}% + \LWR@traceinfo{at column}% + \defaddtocounter{LWR@tablecolspecindex}{1}% % \end{macrocode} % Read the next token into \cs{LWR@colparameter}, expanding once: % \begin{macrocode} -\LWR@traceinfo{about to read the next token:}% -\expandarg% -\StrChar{\LWR@origcolspec}% - {\arabic{LWR@tablecolspecindex}}[\LWR@colparameter] -\fullexpandarg% + \LWR@traceinfo{about to read the next token:}% + \expandarg% + \StrChar{\LWR@origcolspec}% + {\arabic{LWR@tablecolspecindex}}[\LWR@colparameter]% + \fullexpandarg% % \end{macrocode} % Store the result into a data array, expanding once out of \cs{LWR@colparameter}: -% \begin{macrocode} -\LWR@traceinfo{have now read the next token}% -\ifnumcomp{\value{LWR@tabletotalLaTeXcols}}{=}{0}% -{% left edge of the table: - \LWR@traceinfo{at the left edge}% - \LWR@setexparray{LWR@colatspec}{leftedge}{\LWR@colparameter}% - \LWR@traceinfo{at the left edge: % - \LWR@getexparray{LWR@colatspec}{leftedge}}% -}% -{% not at the left edge: - \LWR@traceinfo{not at the left edge}% - \LWR@setexparray{LWR@colatspec}% - {\arabic{LWR@tabletotalLaTeXcols}}{\LWR@colparameter}% - \LWR@traceinfo{at \arabic{LWR@tabletotalLaTeXcols}: % - \LWR@getexparray{LWR@colatspec}{\arabic{LWR@tabletotalLaTeXcols}}}% -}% -\let\LWR@colparameter\relax% -\global\booltrue{LWR@validtablecol}% +% \changes{v0.79}{2020/01/16}{Remove outermost braces.} +% \begin{macrocode} + \LWR@traceinfo{have now read the next token}% + \ifnumcomp{\value{LWR@tabletotalLaTeXcols}}{=}{0}% + {% left edge of the table: + \LWR@traceinfo{at the left edge}% + \LWR@setexparray{LWR@colatspec}% + {leftedge}% + {\expandafter\@firstofone\LWR@colparameter}% + \LWR@traceinfo{at the left edge: % + \LWR@getexparray{LWR@colatspec}{leftedge}}% + }% + {% not at the left edge: + \LWR@traceinfo{not at the left edge}% + \LWR@setexparray{LWR@colatspec}% + {\arabic{LWR@tabletotalLaTeXcols}}% + {\expandafter\@firstofone\LWR@colparameter}% + \LWR@traceinfo{at \arabic{LWR@tabletotalLaTeXcols}: % + \LWR@getexparray{LWR@colatspec}{\arabic{LWR@tabletotalLaTeXcols}}}% + }% + \let\LWR@colparameter\relax% + \booltrue{LWR@validtablecol}% } % \end{macrocode} % \end{macro} @@ -26211,34 +26763,38 @@ end -- not --version % \end{macrocode} % Move to the next token after the '!': % \begin{macrocode} -\LWR@traceinfo{bang column}% -\addtocounter{LWR@tablecolspecindex}{1}% + \LWR@traceinfo{bang column}% + \defaddtocounter{LWR@tablecolspecindex}{1}% % \end{macrocode} % Read the next token into \cs{LWR@colparameter}, expanding once: % \begin{macrocode} -\LWR@traceinfo{about to read the next token:}% -\expandarg% -\StrChar{\LWR@origcolspec}% - {\arabic{LWR@tablecolspecindex}}[\LWR@colparameter] -\fullexpandarg% + \LWR@traceinfo{about to read the next token:}% + \expandarg% + \StrChar{\LWR@origcolspec}% + {\arabic{LWR@tablecolspecindex}}[\LWR@colparameter]% + \fullexpandarg% % \end{macrocode} % Store the result into a data array, % expanding once out of \cs{LWR@colparameter}: -% \begin{macrocode} -\LWR@traceinfo{have now read the next token}% -\ifnumcomp{\value{LWR@tabletotalLaTeXcols}}{=}{0}% -{% left edge of the table: - \LWR@traceinfo{at the left edge}% - \LWR@setexparray{LWR@colbangspec}{leftedge}{\LWR@colparameter}% -}% -{% not at the left edge: - \LWR@traceinfo{not at the left edge}% - \LWR@setexparray{LWR@colbangspec}% - {\arabic{LWR@tabletotalLaTeXcols}}{\LWR@colparameter}% - \LWR@traceinfo{bang \arabic{LWR@tabletotalLaTeXcols}: \LWR@colparameter!}% -}% -\let\LWR@colparameter\relax% -\global\booltrue{LWR@validtablecol}% +% \changes{v0.79}{2020/01/16}{Remove outermost braces.} +% \begin{macrocode} + \LWR@traceinfo{have now read the next token}% + \ifnumcomp{\value{LWR@tabletotalLaTeXcols}}{=}{0}% + {% left edge of the table: + \LWR@traceinfo{at the left edge}% + \LWR@setexparray{LWR@colbangspec}% + {leftedge}% + {\expandafter\@firstofone\LWR@colparameter}% + }% + {% not at the left edge: + \LWR@traceinfo{not at the left edge}% + \LWR@setexparray{LWR@colbangspec}% + {\arabic{LWR@tabletotalLaTeXcols}}% + {\expandafter\@firstofone\LWR@colparameter}% + \LWR@traceinfo{bang \arabic{LWR@tabletotalLaTeXcols}: \LWR@colparameter!}% + }% + \let\LWR@colparameter\relax% + \booltrue{LWR@validtablecol}% } % \end{macrocode} % \end{macro} @@ -26254,21 +26810,23 @@ end -- not --version % \end{macrocode} % Move to the next token after the '>': % \begin{macrocode} -\addtocounter{LWR@tablecolspecindex}{1}% + \defaddtocounter{LWR@tablecolspecindex}{1}% % \end{macrocode} % Read the next token, expanding once into \cs{LWR@colparameter}: % \begin{macrocode} -\expandarg% -\StrChar{\LWR@origcolspec}% - {\arabic{LWR@tablecolspecindex}}[\LWR@colparameter]% -\fullexpandarg% + \expandarg% + \StrChar{\LWR@origcolspec}% + {\arabic{LWR@tablecolspecindex}}[\LWR@colparameter]% + \fullexpandarg% % \end{macrocode} % Store the result into a data array, expanding once out of \cs{LWR@colparameter}: +% \changes{v0.79}{2020/01/16}{Remove outermost braces.} % \begin{macrocode} -\LWR@setexparray{LWR@colbeforespec}% - {\arabic{LWR@tabletotalLaTeXcolsnext}}{\LWR@colparameter}% -\let\LWR@colparameter\relax% -\global\booltrue{LWR@validtablecol}% + \LWR@setexparray{LWR@colbeforespec}% + {\arabic{LWR@tabletotalLaTeXcolsnext}}% + {\expandafter\@firstofone\LWR@colparameter}% + \let\LWR@colparameter\relax% + \booltrue{LWR@validtablecol}% } % \end{macrocode} % \end{macro} @@ -26282,21 +26840,23 @@ end -- not --version % \end{macrocode} % Move to the next token after the '<': % \begin{macrocode} -\addtocounter{LWR@tablecolspecindex}{1}% + \defaddtocounter{LWR@tablecolspecindex}{1}% % \end{macrocode} % Read the next token, expanding once into \cs{LWR@colparameter}: % \begin{macrocode} -\expandarg% -\StrChar{\LWR@origcolspec}% - {\arabic{LWR@tablecolspecindex}}[\LWR@colparameter]% -\fullexpandarg% + \expandarg% + \StrChar{\LWR@origcolspec}% + {\arabic{LWR@tablecolspecindex}}[\LWR@colparameter]% + \fullexpandarg% % \end{macrocode} % Store the result into a data array, expanding once out of \cs{LWR@colparameter}: +% \changes{v0.79}{2020/01/16}{Remove outermost braces.} % \begin{macrocode} -\LWR@setexparray{LWR@colafterspec}% - {\arabic{LWR@tabletotalLaTeXcols}}{\LWR@colparameter}% -\let\LWR@colparameter\relax% -\global\booltrue{LWR@validtablecol}% + \LWR@setexparray{LWR@colafterspec}% + {\arabic{LWR@tabletotalLaTeXcols}}% + {\expandafter\@firstofone\LWR@colparameter}% + \let\LWR@colparameter\relax% + \booltrue{LWR@validtablecol}% } % \end{macrocode} % \end{macro} @@ -26309,32 +26869,32 @@ end -- not --version % % \begin{macrocode} \newcommand*{\LWR@parsebarcolumn}{% -\LWR@traceinfo{LWR@parsebarcolumn}% + \LWR@traceinfo{LWR@parsebarcolumn}% % \end{macrocode} % Remember the bar at this position: % \begin{macrocode} -\ifnumcomp{\value{LWR@tabletotalLaTeXcols}}{=}{0}% -{% left edge of the table: - \edef\LWR@tempone{\LWR@getexparray{LWR@colbarspec}{leftedge}}% - \ifdefstring{\LWR@tempone}{tvertbarl}% - {\LWR@setexparray{LWR@colbarspec}{leftedge}{tvertbarldouble}}% - {\LWR@setexparray{LWR@colbarspec}{leftedge}{tvertbarl}}% -}% -{% not at the left edge: - \edef\LWR@tempone{% - \LWR@getexparray{LWR@colbarspec}{\arabic{LWR@tabletotalLaTeXcols}}% - }% - \ifdefstring{\LWR@tempone}{tvertbarr}% - {% - \LWR@setexparray{LWR@colbarspec}% - {\arabic{LWR@tabletotalLaTeXcols}}{tvertbarrdouble}% + \ifnumcomp{\value{LWR@tabletotalLaTeXcols}}{=}{0}% + {% left edge of the table: + \edef\LWR@tempone{\LWR@getexparray{LWR@colbarspec}{leftedge}}% + \ifdefstring{\LWR@tempone}{tvertbarl}% + {\LWR@setexparray{LWR@colbarspec}{leftedge}{tvertbarldouble}}% + {\LWR@setexparray{LWR@colbarspec}{leftedge}{tvertbarl}}% }% - {% - \LWR@setexparray{LWR@colbarspec}% - {\arabic{LWR@tabletotalLaTeXcols}}{tvertbarr}% + {% not at the left edge: + \edef\LWR@tempone{% + \LWR@getexparray{LWR@colbarspec}{\arabic{LWR@tabletotalLaTeXcols}}% + }% + \ifdefstring{\LWR@tempone}{tvertbarr}% + {% + \LWR@setexparray{LWR@colbarspec}% + {\arabic{LWR@tabletotalLaTeXcols}}{tvertbarrdouble}% + }% + {% + \LWR@setexparray{LWR@colbarspec}% + {\arabic{LWR@tabletotalLaTeXcols}}{tvertbarr}% + }% }% -}% -\global\booltrue{LWR@validtablecol}% + \booltrue{LWR@validtablecol}% } % \end{macrocode} % \end{macro} @@ -26345,28 +26905,28 @@ end -- not --version % \changes{v0.56}{2018/05/04}{\pkg{arydshln}: Added.} % \begin{macrocode} \newcommand*{\LWR@parsecoloncolumn}{% -\LWR@traceinfo{LWR@parsecoloncolumn}% + \LWR@traceinfo{LWR@parsecoloncolumn}% % \end{macrocode} % Remember the bar at this position: % \begin{macrocode} -\ifnumcomp{\value{LWR@tabletotalLaTeXcols}}{=}{0}% -{% left edge of the table: - \edef\LWR@tempone{\LWR@getexparray{LWR@colbarspec}{leftedge}}% - \ifdefstring{\LWR@tempone}{tvertbarldash}% - {\LWR@setexparray{LWR@colbarspec}{leftedge}{tvertbarldoubledash}}% - {\LWR@setexparray{LWR@colbarspec}{leftedge}{tvertbarldash}}% -}% -{% not at the left edge: - \edef\LWR@tempone{% - \LWR@getexparray{LWR@colbarspec}{\arabic{LWR@tabletotalLaTeXcols}}% + \ifnumcomp{\value{LWR@tabletotalLaTeXcols}}{=}{0}% + {% left edge of the table: + \edef\LWR@tempone{\LWR@getexparray{LWR@colbarspec}{leftedge}}% + \ifdefstring{\LWR@tempone}{tvertbarldash}% + {\LWR@setexparray{LWR@colbarspec}{leftedge}{tvertbarldoubledash}}% + {\LWR@setexparray{LWR@colbarspec}{leftedge}{tvertbarldash}}% }% - \ifdefstring{\LWR@tempone}{tvertbarrdash}% - {\LWR@setexparray{LWR@colbarspec}% - {\arabic{LWR@tabletotalLaTeXcols}}{tvertbarrdoubledash}}% - {\LWR@setexparray{LWR@colbarspec}% - {\arabic{LWR@tabletotalLaTeXcols}}{tvertbarrdash}}% -}% -\global\booltrue{LWR@validtablecol}% + {% not at the left edge: + \edef\LWR@tempone{% + \LWR@getexparray{LWR@colbarspec}{\arabic{LWR@tabletotalLaTeXcols}}% + }% + \ifdefstring{\LWR@tempone}{tvertbarrdash}% + {\LWR@setexparray{LWR@colbarspec}% + {\arabic{LWR@tabletotalLaTeXcols}}{tvertbarrdoubledash}}% + {\LWR@setexparray{LWR@colbarspec}% + {\arabic{LWR@tabletotalLaTeXcols}}{tvertbarrdash}}% + }% + \booltrue{LWR@validtablecol}% } % \end{macrocode} % \end{macro} @@ -26380,11 +26940,11 @@ end -- not --version % \end{macrocode} % Treat |;| as a |:| column: % \begin{macrocode} -\LWR@parsecoloncolumn% + \LWR@parsecoloncolumn% % \end{macrocode} % Skip the following width token: % \begin{macrocode} -\addtocounter{LWR@tablecolspecindex}{1}% + \defaddtocounter{LWR@tablecolspecindex}{1}% } % \end{macrocode} % \end{macro} @@ -26398,21 +26958,21 @@ end -- not --version % and pre-clear another column of at, before, and after specs. % \begin{macrocode} \newcommand*{\LWR@parsenormalcolumn}[1]{% -\addtocounter{LWR@tabletotalLaTeXcols}{1}% -\addtocounter{LWR@tabletotalLaTeXcolsnext}{1}% + \defaddtocounter{LWR@tabletotalLaTeXcols}{1}% + \defaddtocounter{LWR@tabletotalLaTeXcolsnext}{1}% % \end{macrocode} % \changes{v0.60}{2018/09/17}{\env{tabular}: Improved memory management: Not using \pkg{xstring}.} % \begin{macrocode} -\LWR@setexparray{LWR@tablecolspec}{\arabic{LWR@tabletotalLaTeXcols}}{#1}% + \LWR@setexparray{LWR@tablecolspec}{\arabic{LWR@tabletotalLaTeXcols}}{#1}% % \end{macrocode} % \begin{macrocode} -\LWR@traceinfo{normal column \arabic{LWR@tabletotalLaTeXcols}: #1}% -\LWR@setexparray{LWR@colatspec}{\arabic{LWR@tabletotalLaTeXcolsnext}}{}% -\LWR@setexparray{LWR@colbangspec}{\arabic{LWR@tabletotalLaTeXcolsnext}}{}% -\LWR@setexparray{LWR@colbeforespec}{\arabic{LWR@tabletotalLaTeXcolsnext}}{}% -\LWR@setexparray{LWR@colafterspec}{\arabic{LWR@tabletotalLaTeXcolsnext}}{}% -\LWR@setexparray{LWR@colbarspec}{\arabic{LWR@tabletotalLaTeXcolsnext}}{}% -\global\booltrue{LWR@validtablecol}% + \LWR@traceinfo{normal column \arabic{LWR@tabletotalLaTeXcols}: #1}% + \LWR@setexparray{LWR@colatspec}{\arabic{LWR@tabletotalLaTeXcolsnext}}{}% + \LWR@setexparray{LWR@colbangspec}{\arabic{LWR@tabletotalLaTeXcolsnext}}{}% + \LWR@setexparray{LWR@colbeforespec}{\arabic{LWR@tabletotalLaTeXcolsnext}}{}% + \LWR@setexparray{LWR@colafterspec}{\arabic{LWR@tabletotalLaTeXcolsnext}}{}% + \LWR@setexparray{LWR@colbarspec}{\arabic{LWR@tabletotalLaTeXcolsnext}}{}% + \booltrue{LWR@validtablecol}% } % \end{macrocode} % \end{macro} @@ -26427,11 +26987,11 @@ end -- not --version % \end{macrocode} % Converts to the given column type: % \begin{macrocode} -\LWR@parsenormalcolumn{#1}% + \LWR@parsenormalcolumn{#1}% % \end{macrocode} % Skips the following width token: % \begin{macrocode} -\addtocounter{LWR@tablecolspecindex}{1}% + \defaddtocounter{LWR@tablecolspecindex}{1}% } % \end{macrocode} % \end{macro} @@ -26445,12 +27005,12 @@ end -- not --version \newcommand*{\LWR@parsewcolumn}{% % \end{macrocode} % \begin{macrocode} -\LWR@columnspeclookahead{1}% -\expandafter\LWR@parsenormalcolumn\expandafter{\LWR@strresulttwo}% + \LWR@columnspeclookahead{1}% + \expandafter\LWR@parsenormalcolumn\expandafter{\LWR@strresulttwo}% % \end{macrocode} % Skips the following width and alignment tokens: % \begin{macrocode} -\addtocounter{LWR@tablecolspecindex}{2}% + \defaddtocounter{LWR@tablecolspecindex}{2}% } % \end{macrocode} % \end{macro} @@ -26462,7 +27022,7 @@ end -- not --version % Star columns should already have been expanded, so this should never be used. % \begin{macrocode} \newcommand*{\LWR@parsestarcolumn}{% - \addtocounter{LWR@tablecolspecindex}{2}% + \defaddtocounter{LWR@tablecolspecindex}{2}% } % \end{macrocode} % \end{macro} @@ -26482,17 +27042,17 @@ end -- not --version % \end{macrocode} % Converts to the given column type. % \begin{macrocode} -\LWR@parsenormalcolumn{#1}% + \LWR@parsenormalcolumn{#1}% % \end{macrocode} % Skips the following three parameters. % \begin{macrocode} -\addtocounter{LWR@tablecolspecindex}{3}% + \defaddtocounter{LWR@tablecolspecindex}{3}% } % \end{macrocode} % \end{macro} -% \subsection{Expanding the star column specifiations} +% \subsection{Expanding the star column specifications} % \DescribeCounter{LWR@starcount} % Internal count for duplicating star columns. @@ -26670,17 +27230,6 @@ end -- not --version % \end{table} % % -% \DescribeBoolean{LWR@validtablecol} True if found a valid table column type. -% \begin{macrocode} -\newbool{LWR@validtablecol} -% \end{macrocode} -% -% -% \DescribeBoolean{LWR@opttablecol} True if found a table column optional argument. -% \begin{macrocode} -\newbool{LWR@opttablecol} -% \end{macrocode} -% % % \begin{macro}{\LWR@parsetablecols} \marg{colspecs} % @@ -26700,22 +27249,22 @@ end -- not --version % % \begin{macrocode} \newcommand*{\LWR@parsetablecols}[1]{% -\LWR@traceinfo{LWR@parsetablecols}% + \LWR@traceinfo{LWR@parsetablecols}% % \end{macrocode} % Remember the original supplied column spec: % \begin{macrocode} -\renewcommand*{\LWR@origcolspec}{#1}% + \renewcommand*{\LWR@origcolspec}{#1}% % \end{macrocode} % Remove spaces: % \changes{v0.43}{2017/11/01}{Ignore spaces in col spec.} % \begin{macrocode} -\expandarg% -\StrSubstitute{\LWR@origcolspec}{ }{}[\LWR@origcolspec]% + \expandarg% + \StrSubstitute{\LWR@origcolspec}{ }{}[\LWR@origcolspec]% % \end{macrocode} % % Expand any star columns: % \begin{macrocode} -\expandcolspec% + \expandcolspec% % \end{macrocode} % % The parsed column spec data array, |LWR@tablecolspec|, @@ -26724,123 +27273,123 @@ end -- not --version % Total number of columns found so far. % Also pre-initialize the first several columns of specs: % \begin{macrocode} -\setcounter{LWR@tabletotalLaTeXcols}{0}% -\setcounter{LWR@tabletotalLaTeXcolsnext}{1}% -\LWR@setexparray{LWR@colatspec}{leftedge}{}% -\LWR@setexparray{LWR@colatspec}{1}{}% -\LWR@setexparray{LWR@colatspec}{2}{}% -\LWR@setexparray{LWR@colatspec}{3}{}% -\LWR@setexparray{LWR@colbangspec}{leftedge}{}% -\LWR@setexparray{LWR@colbangspec}{1}{}% -\LWR@setexparray{LWR@colbangspec}{2}{}% -\LWR@setexparray{LWR@colbangspec}{3}{}% -\LWR@setexparray{LWR@colbeforespec}{1}{}% -\LWR@setexparray{LWR@colbeforespec}{2}{}% -\LWR@setexparray{LWR@colbeforespec}{3}{}% -\LWR@setexparray{LWR@colafterspec}{1}{}% -\LWR@setexparray{LWR@colafterspec}{2}{}% -\LWR@setexparray{LWR@colafterspec}{3}{}% -\LWR@setexparray{LWR@colbarspec}{leftedge}{}% -\LWR@setexparray{LWR@colbarspec}{1}{}% -\LWR@setexparray{LWR@colbarspec}{2}{}% -\LWR@setexparray{LWR@colbarspec}{3}{}% + \defcounter{LWR@tabletotalLaTeXcols}{0}% + \defcounter{LWR@tabletotalLaTeXcolsnext}{1}% + \LWR@setexparray{LWR@colatspec}{leftedge}{}% + \LWR@setexparray{LWR@colatspec}{1}{}% + \LWR@setexparray{LWR@colatspec}{2}{}% + \LWR@setexparray{LWR@colatspec}{3}{}% + \LWR@setexparray{LWR@colbangspec}{leftedge}{}% + \LWR@setexparray{LWR@colbangspec}{1}{}% + \LWR@setexparray{LWR@colbangspec}{2}{}% + \LWR@setexparray{LWR@colbangspec}{3}{}% + \LWR@setexparray{LWR@colbeforespec}{1}{}% + \LWR@setexparray{LWR@colbeforespec}{2}{}% + \LWR@setexparray{LWR@colbeforespec}{3}{}% + \LWR@setexparray{LWR@colafterspec}{1}{}% + \LWR@setexparray{LWR@colafterspec}{2}{}% + \LWR@setexparray{LWR@colafterspec}{3}{}% + \LWR@setexparray{LWR@colbarspec}{leftedge}{}% + \LWR@setexparray{LWR@colbarspec}{1}{}% + \LWR@setexparray{LWR@colbarspec}{2}{}% + \LWR@setexparray{LWR@colbarspec}{3}{}% % \end{macrocode} % Starting at the first column specification: % \begin{macrocode} -\setcounter{LWR@tablecolspecindex}{1}% + \defcounter{LWR@tablecolspecindex}{1}% % \end{macrocode} % Place the colspecs string length into \cs{LWR@strresult}, % and remember the number of characters in the column specification: % \begin{macrocode} -\expandarg% -\StrLen{\LWR@origcolspec}[\LWR@strresult]% -\fullexpandarg% -\LWR@traceinfo{original column spec length: \LWR@strresult}% -\setcounter{LWR@tablecolspecwidth}{\LWR@strresult}% + \expandarg% + \StrLen{\LWR@origcolspec}[\LWR@strresult]% + \fullexpandarg% + \LWR@traceinfo{original column spec length: \LWR@strresult}% + \defcounter{LWR@tablecolspecwidth}{\LWR@strresult}% % \end{macrocode} % Haven't seen any optional arguments so far % \begin{macrocode} -\global\boolfalse{LWR@opttablecol}% + \boolfalse{LWR@opttablecol}% % \end{macrocode} % Scan through the column specifications: % \begin{macrocode} -\whileboolexpr{% - not test{% - \ifnumcomp{\value{LWR@tablecolspecindex}}{>}% - {\value{LWR@tablecolspecwidth}}% + \whileboolexpr{% + not test{% + \ifnumcomp{\value{LWR@tablecolspecindex}}{>}% + {\value{LWR@tablecolspecwidth}}% + }% }% -}% -{% + {% % \end{macrocode} % Place the next single-character column type into \cs{LWR@strresult}: % \begin{macrocode} -\expandarg% -\StrChar{\LWR@origcolspec}{\arabic{LWR@tablecolspecindex}}[\LWR@strresult]% -\LWR@traceinfo{position \arabic{LWR@tablecolspecindex}: \LWR@strresult}% -\fullexpandarg% + \expandarg% + \StrChar{\LWR@origcolspec}{\arabic{LWR@tablecolspecindex}}[\LWR@strresult]% + \LWR@traceinfo{position \arabic{LWR@tablecolspecindex}: \LWR@strresult}% + \fullexpandarg% % \end{macrocode} % Not yet found a valid column type: % \begin{macrocode} -\global\boolfalse{LWR@validtablecol}% + \boolfalse{LWR@validtablecol}% % \end{macrocode} % % Skip over any optional arguments, such as \pkg{siunitx} |S| column: % \changes{v0.48}{2018/02/04}{Fix: Ignore optional tabular column arguments.} % \begin{macrocode} -\IfStrEq{\LWR@strresult}{[}{\global\booltrue{LWR@opttablecol}}{}% + \IfStrEq{\LWR@strresult}{[}{\booltrue{LWR@opttablecol}}{}% % \end{macrocode} % % Throw away anything found inside the optional argument: % \begin{macrocode} -\ifbool{LWR@opttablecol}% -{}% inside an optional argument -{% not an optional tabular argument + \ifbool{LWR@opttablecol}% + {}% inside an optional argument + {% not an optional tabular argument % \end{macrocode} % Not inside an optional argument, so consider the column type: % \begin{macrocode} -\IfStrEq{\LWR@strresult}{l}{\LWR@parsenormalcolumn{l}}{}% -\IfStrEq{\LWR@strresult}{c}{\LWR@parsenormalcolumn{c}}{}% -\IfStrEq{\LWR@strresult}{r}{\LWR@parsenormalcolumn{r}}{}% -\IfStrEq{\LWR@strresult}{L}{\LWR@parsenormalcolumn{l}}{}% -\IfStrEq{\LWR@strresult}{C}{\LWR@parsenormalcolumn{c}}{}% -\IfStrEq{\LWR@strresult}{R}{\LWR@parsenormalcolumn{r}}{}% -\IfStrEq{\LWR@strresult}{J}{\LWR@parsenormalcolumn{l}}{}% + \IfStrEq{\LWR@strresult}{l}{\LWR@parsenormalcolumn{l}}{}% + \IfStrEq{\LWR@strresult}{c}{\LWR@parsenormalcolumn{c}}{}% + \IfStrEq{\LWR@strresult}{r}{\LWR@parsenormalcolumn{r}}{}% + \IfStrEq{\LWR@strresult}{L}{\LWR@parsenormalcolumn{l}}{}% + \IfStrEq{\LWR@strresult}{C}{\LWR@parsenormalcolumn{c}}{}% + \IfStrEq{\LWR@strresult}{R}{\LWR@parsenormalcolumn{r}}{}% + \IfStrEq{\LWR@strresult}{J}{\LWR@parsenormalcolumn{l}}{}% % \end{macrocode} % \begin{macrocode} -\IfStrEq{\LWR@strresult}{S}{\LWR@parsenormalcolumn{c}}{}% -\IfStrEq{\LWR@strresult}{s}{\LWR@parsenormalcolumn{c}}{}% + \IfStrEq{\LWR@strresult}{S}{\LWR@parsenormalcolumn{c}}{}% + \IfStrEq{\LWR@strresult}{s}{\LWR@parsenormalcolumn{c}}{}% % \end{macrocode} % \begin{macrocode} -\IfStrEq{\LWR@strresult}{\detokenize{@}}{\LWR@parseatcolumn}{}% -\IfStrEq{\LWR@strresult}{!}{\LWR@parsebangcolumn}{}% -\IfStrEq{\LWR@strresult}{>}{\LWR@parsebeforecolumn}{}% -\IfStrEq{\LWR@strresult}{<}{\LWR@parseaftercolumn}{}% -\IfStrEq{\LWR@strresult}{|}{\LWR@parsebarcolumn}{}% -\IfStrEq{\LWR@strresult}{:}{\LWR@parsecoloncolumn}{}% -\IfStrEq{\LWR@strresult}{;}{\LWR@parsesemicoloncolumn}{}% + \IfStrEq{\LWR@strresult}{\detokenize{@}}{\LWR@parseatcolumn}{}% + \IfStrEq{\LWR@strresult}{!}{\LWR@parsebangcolumn}{}% + \IfStrEq{\LWR@strresult}{>}{\LWR@parsebeforecolumn}{}% + \IfStrEq{\LWR@strresult}{<}{\LWR@parseaftercolumn}{}% + \IfStrEq{\LWR@strresult}{|}{\LWR@parsebarcolumn}{}% + \IfStrEq{\LWR@strresult}{:}{\LWR@parsecoloncolumn}{}% + \IfStrEq{\LWR@strresult}{;}{\LWR@parsesemicoloncolumn}{}% % \end{macrocode} % \begin{macrocode} -\IfStrEq{\LWR@strresult}{p}{\LWR@parsepcolumn{p}}{}% -\IfStrEq{\LWR@strresult}{m}{\LWR@parsepcolumn{m}}{}% -\IfStrEq{\LWR@strresult}{b}{\LWR@parsepcolumn{b}}{}% + \IfStrEq{\LWR@strresult}{p}{\LWR@parsepcolumn{p}}{}% + \IfStrEq{\LWR@strresult}{m}{\LWR@parsepcolumn{m}}{}% + \IfStrEq{\LWR@strresult}{b}{\LWR@parsepcolumn{b}}{}% % \end{macrocode} % \changes{v0.56}{2018/05/10}{Added \pkg{array} \texttt{W} column.} % \begin{macrocode} -\IfStrEq{\LWR@strresult}{w}{\LWR@parsewcolumn}{}% -\IfStrEq{\LWR@strresult}{W}{\LWR@parsewcolumn}{}% + \IfStrEq{\LWR@strresult}{w}{\LWR@parsewcolumn}{}% + \IfStrEq{\LWR@strresult}{W}{\LWR@parsewcolumn}{}% % \end{macrocode} % A star column: % \begin{macrocode} -\IfStrEq{\LWR@strresult}{*}{\LWR@parsestarcolumn}{}% + \IfStrEq{\LWR@strresult}{*}{\LWR@parsestarcolumn}{}% % \end{macrocode} % From the \pkg{dcolumn} package: % \begin{macrocode} -\IfStrEq{\LWR@strresult}{D}{\LWR@parseDcolumn{c}}{}% + \IfStrEq{\LWR@strresult}{D}{\LWR@parseDcolumn{c}}{}% % \end{macrocode} % From the \pkg{tabularx} package. % X column has no parameter, but will be given paragraph tags. % \begin{macrocode} -\IfStrEq{\LWR@strresult}{X}{\LWR@parsenormalcolumn{X}}{}% + \IfStrEq{\LWR@strresult}{X}{\LWR@parsenormalcolumn{X}}{}% % \end{macrocode} % \begin{docsidebar} % \raggedright @@ -26851,26 +27400,26 @@ end -- not --version % \vspace{-\baselineskip} % \end{docsidebar} % \begin{macrocode} -\IfStrEq{\LWR@strresult}{P}{\LWR@parsepcolumn{P}}{}% -\IfStrEq{\LWR@strresult}{M}{\LWR@parsepcolumn{M}}{}% -\IfStrEq{\LWR@strresult}{B}{\LWR@parsepcolumn{B}}{}% + \IfStrEq{\LWR@strresult}{P}{\LWR@parsepcolumn{P}}{}% + \IfStrEq{\LWR@strresult}{M}{\LWR@parsepcolumn{M}}{}% + \IfStrEq{\LWR@strresult}{B}{\LWR@parsepcolumn{B}}{}% % \end{macrocode} % If this column was an invalid column type, convert it to an |l| column: % \begin{macrocode} -\ifbool{LWR@validtablecol}{}{% - \LWR@traceinfo{invalid column type: \LWR@strresult}% - \LWR@parsenormalcolumn{l}% -}% -}% not an optional column argument + \ifbool{LWR@validtablecol}{}{% + \LWR@traceinfo{invalid column type: \LWR@strresult}% + \LWR@parsenormalcolumn{l}% + }% + }% not an optional column argument % \end{macrocode} % If read the closing bracket, no longer inside the optional argument: % \begin{macrocode} -\IfStrEq{\LWR@strresult}{]}{\global\boolfalse{LWR@opttablecol}}{}% + \IfStrEq{\LWR@strresult}{]}{\boolfalse{LWR@opttablecol}}{}% % \end{macrocode} % Move to the next character: % \begin{macrocode} -\addtocounter{LWR@tablecolspecindex}{1}% -}% whiledo + \defaddtocounter{LWR@tablecolspecindex}{1}% + }% whiledo }% % \end{macrocode} % \end{macro} @@ -26979,42 +27528,42 @@ end -- not --version % \begin{macrocode} \newcommand*{\LWR@maybenewtablerow} {% -\ifbool{LWR@startedrow}% -{}% started the row -{% not started the row + \ifbool{LWR@startedrow}% + {}% started the row + {% not started the row % \end{macrocode} % Remember that now have started the row: % \begin{macrocode} - \global\booltrue{LWR@startedrow}% + \booltrue{LWR@startedrow}% % \end{macrocode} % Create the row tag, with a class if necessary. % \begin{macrocode} - \global\booltrue{LWR@intabularmetadata}% - \ifboolexpr{% - test{\ifnumcomp{\value{LWR@hlines}}{>}{0}} or% - test{\ifnumcomp{\value{LWR@hdashedlines}}{>}{0}}% - }% - {% - \LWR@htmltag{tr class="hline" }% - \LWR@orignewline% - }% - {% not doing hline - \ifbool{LWR@doingtbrule}% + \booltrue{LWR@intabularmetadata}% + \ifboolexpr{% + test{\ifnumcomp{\value{LWR@hlines}}{>}{0}} or% + test{\ifnumcomp{\value{LWR@hdashedlines}}{>}{0}}% + }% {% - \ifdefvoid{\LWR@ruleHTMLcolor}{% - \LWR@htmltag{tr class="tbrule"}% - }{% - \LWR@htmltag{% - tr class="tbrule" % space - style="border-top: 1px solid % space - \LWR@origpound\LWR@ruleHTMLcolor "% - }% - }% + \LWR@htmltag{tr class="hline" }% \LWR@orignewline% }% - {\LWR@htmltag{tr}\LWR@orignewline}% - }% end of not doing hline -}% end of not started the row + {% not doing hline + \ifbool{LWR@doingtbrule}% + {% + \ifdefvoid{\LWR@ruleHTMLcolor}{% + \LWR@htmltag{tr class="tbrule"}% + }{% + \LWR@htmltag{% + tr class="tbrule" % space + style="border-top: 1px solid % space + \LWR@origpound\LWR@ruleHTMLcolor "% + }% + }% + \LWR@orignewline% + }% + {\LWR@htmltag{tr}\LWR@orignewline}% + }% end of not doing hline + }% end of not started the row } % \end{macrocode} % \end{macro} @@ -27030,20 +27579,20 @@ end -- not --version % % \begin{macrocode} \newcommand*{\LWR@printbartag}[1]{% -\LWR@traceinfo{LWR@printbartag !#1!}% -\ifboolexpr{bool{LWR@tabularmutemods} or bool{LWR@emptyatbang}}% -{}% muting or empty -{% not muting - \edef\LWR@tempone{\LWR@getexparray{LWR@colbarspec}{#1}}% - \ifdefempty{\LWR@tempone}{}{ \LWR@tempone}% -}% not muting -\LWR@traceinfo{LWR@printbartag done}% + \LWR@traceinfo{LWR@printbartag !#1!}% + \ifboolexpr{bool{LWR@tabularmutemods} or bool{LWR@emptyatbang}}% + {}% muting or empty + {% not muting + \edef\LWR@tempone{\LWR@getexparray{LWR@colbarspec}{#1}}% + \ifdefempty{\LWR@tempone}{}{ \LWR@tempone}% + }% not muting + \LWR@traceinfo{LWR@printbartag done}% } % \end{macrocode} % \end{macro} -% \subsection{Printing at or bang tags} +% \subsection{Printing @ or ! tags} % \begin{macro}{\LWR@printatbang} \marg{at -or- bang} \marg{index} % @@ -27054,35 +27603,35 @@ end -- not --version % \end{macrocode} % Fetch the column at or bang spec: % \begin{macrocode} -\xdef\LWR@atbangspec{\LWR@getexparray{LWR@col#1spec}{#2}}% -\LWR@traceinfo{atbang: #2 !\LWR@atbangspec!}% + \xdef\LWR@atbangspec{\LWR@getexparray{LWR@col#1spec}{#2}}% + \LWR@traceinfo{atbang: #2 !\LWR@atbangspec!}% % \end{macrocode} % Only generate if is not empty; % \begin{macrocode} -\ifdefempty{\LWR@atbangspec}% -{}% -{% not empty - \LWR@htmltag{% - td class="td#1% - \LWR@subaddcmidruletrim{}{}% - \LWR@printbartag{#2}% - "% - \LWR@tdstartstyles% - \LWR@addcmidrulewidth% - \LWR@addcdashline% - \LWR@addtabularrulecolors% - \LWR@tdendstyles% - }% + \ifdefempty{\LWR@atbangspec}% + {}% + {% not empty + \LWR@htmltag{% + td class="td#1% + \LWR@subaddcmidruletrim{}{}% + \LWR@printbartag{#2}% + "% + \LWR@tdstartstyles% + \LWR@addcmidrulewidth% + \LWR@addcdashline% + \LWR@addtabularrulecolors% + \LWR@tdendstyles% + }% % \end{macrocode} % Create an empty cell if muting for the \cs{bottomrule}: % \begin{macrocode} - \ifboolexpr{bool{LWR@tabularmutemods} or bool{LWR@emptyatbang}}% - {}% - {\LWR@atbangspec}% + \ifboolexpr{bool{LWR@tabularmutemods} or bool{LWR@emptyatbang}}% + {}% + {\LWR@atbangspec}% % - \LWR@htmltag{/td}\LWR@orignewline% - \global\booltrue{LWR@tabularcelladded}% -}% not empty + \LWR@htmltag{/td}\LWR@orignewline% + \global\booltrue{LWR@tabularcelladded}% + }% not empty }% % \end{macrocode} % \end{macro} @@ -27091,9 +27640,9 @@ end -- not --version % \begin{macro}{\LWR@addleftmostbartag} % \begin{macrocode} \newcommand*{\LWR@addleftmostbartag}{% -\ifnumcomp{\value{LWR@tableLaTeXcolindex}}{=}{1}{% - \LWR@printbartag{leftedge}% -}{}% + \ifnumcomp{\value{LWR@tableLaTeXcolindex}}{=}{1}{% + \LWR@printbartag{leftedge}% + }{}% } % \end{macrocode} % \end{macro} @@ -27102,12 +27651,12 @@ end -- not --version % \begin{macro}{\LWR@tabularleftedge} % \begin{macrocode} \newcommand*{\LWR@tabularleftedge}{% -\ifnumcomp{\value{LWR@tableLaTeXcolindex}}{=}{1}% -{% - \LWR@printatbang{at}{leftedge}% - \LWR@printatbang{bang}{leftedge}% -}% left edge -{}% not left edge + \ifnumcomp{\value{LWR@tableLaTeXcolindex}}{=}{1}% + {% + \LWR@printatbang{at}{leftedge}% + \LWR@printatbang{bang}{leftedge}% + }% left edge + {}% not left edge } % \end{macrocode} % \end{macro} @@ -27134,102 +27683,104 @@ end -- not --version % \begin{macrocode} \newcommand*{\LWR@tabledatasinglecolumntag}% {% -\LWR@traceinfo{LWR@tabledatasinglecolumntag}% -\LWR@maybenewtablerow% + \LWR@traceinfo{LWR@tabledatasinglecolumntag}% + \LWR@maybenewtablerow% % \end{macrocode} % Don't start a new paragraph tag if have already started one: % \begin{macrocode} -\ifbool{LWR@intabularmetadata}% -{% + \ifbool{LWR@intabularmetadata}% + {% % \end{macrocode} % If have found the end of tabular command, do not create the next data cell: % \begin{macrocode} - \ifbool{LWR@exitingtabular}{}% - {% not exiting tabular + \ifbool{LWR@exitingtabular}{}% + {% not exiting tabular % \end{macrocode} % Print the |@| and |!| contents before first column: % \begin{macrocode} - \LWR@tabularleftedge% + \LWR@tabularleftedge% % \end{macrocode} % Fetch the current column's alignment character into \cs{LWR@strresult}: % \changes{v0.60}{2018/09/17}{\env{tabular}: Improved memory management: Not using \pkg{xstring}.} % \begin{macrocode} - \xdef\LWR@strresult{% - \LWR@getexparray{LWR@tablecolspec}{\arabic{LWR@tableLaTeXcolindex}}% - }% + \xdef\LWR@strresult{% + \LWR@getexparray{LWR@tablecolspec}{\arabic{LWR@tableLaTeXcolindex}}% + }% % \end{macrocode} % print the start of a new table data cell: % \begin{macrocode} -\LWR@traceinfo{LWR@tabledatasinglecolumntag: about to print td tag}% - \LWR@htmltag{td class="td% + \LWR@traceinfo{LWR@tabledatasinglecolumntag: about to print td tag}% + \LWR@htmltag{% + td class="td% % \end{macrocode} % append this column's spec: % \begin{macrocode} - \LWR@strresult% + \LWR@strresult% % \end{macrocode} % If this column has a cmidrule, add ``rule'' to the end of the \HTML\ class tag. % Also add vertical bar tags. % \begin{macrocode} - \LWR@addcmidruletrim% - \LWR@addleftmostbartag% - \LWR@printbartag{\arabic{LWR@tableLaTeXcolindex}}% - "% + \LWR@addcmidruletrim% + \LWR@addleftmostbartag% + \LWR@printbartag{\arabic{LWR@tableLaTeXcolindex}}% + "% % \end{macrocode} % Add styles for rules, alignment: % \changes{v0.42}{2017/10/26}{If \progcode{FormatWP} add cell alignment.} % \begin{macrocode} - \LWR@tdstartstyles% - \LWR@addcmidrulewidth% - \LWR@addcdashline% + \LWR@tdstartstyles% + \LWR@addcmidrulewidth% + \LWR@addcdashline% % \end{macrocode} % \changes{v0.60}{2018/09/17}{\env{tabular}: Improved memory management: Not using \pkg{xstring}.} % \begin{macrocode} - \xdef\LWR@thiscolspec{% - \LWR@getexparray{LWR@tablecolspec}{\arabic{LWR@tableLaTeXcolindex}}% - }% - \LWR@addformatwpalignment{\LWR@thiscolspec}% + \xdef\LWR@thiscolspec{% + \LWR@getexparray{LWR@tablecolspec}% + {\arabic{LWR@tableLaTeXcolindex}}% + }% + \LWR@addformatwpalignment{\LWR@thiscolspec}% % \end{macrocode} % Add styles for cell and rule colors: % \changes{v0.48}{2018/02/08}{\pkg{colortbl}: Added.} % \begin{macrocode} - \LWR@addtabularrowcolor% - \LWR@addtabularrulecolors% + \LWR@addtabularrowcolor% + \LWR@addtabularrulecolors% % \end{macrocode} % \begin{macrocode} - \LWR@tdendstyles% - }% HTML td - \LWR@traceinfo{LWR@tabledatasinglecolumntag: done printing td tag}% + \LWR@tdendstyles% + }% HTML td + \LWR@traceinfo{LWR@tabledatasinglecolumntag: done printing td tag}% % \end{macrocode} % If this is a |p|, |m|, |b|, or X column, allow paragraphs: % \begin{macrocode} - \ifboolexpr{% - test{ \ifdefstring{\LWR@strresult}{p} } or - test{ \ifdefstring{\LWR@strresult}{m} } or - test{ \ifdefstring{\LWR@strresult}{b} } or - test{ \ifdefstring{\LWR@strresult}{P} } or - test{ \ifdefstring{\LWR@strresult}{M} } or - test{ \ifdefstring{\LWR@strresult}{B} } or - test{ \ifdefstring{\LWR@strresult}{X} } - }% - {% allow pars - \LWR@traceinfo{LWR@tabledatasinglecolumntag: about to LWR@startpars}% - \global\booltrue{LWR@tableparcell}% - \LWR@startpars% - \LWR@traceinfo{LWR@tabledatasinglecolumntag: done with LWR@startpars}% - }% allow pars - {}% no pars + \ifboolexpr{% + test{ \ifdefstring{\LWR@strresult}{p} } or + test{ \ifdefstring{\LWR@strresult}{m} } or + test{ \ifdefstring{\LWR@strresult}{b} } or + test{ \ifdefstring{\LWR@strresult}{P} } or + test{ \ifdefstring{\LWR@strresult}{M} } or + test{ \ifdefstring{\LWR@strresult}{B} } or + test{ \ifdefstring{\LWR@strresult}{X} } + }% + {% allow pars + \LWR@traceinfo{LWR@tabledatasinglecolumntag: about to LWR@startpars}% + \booltrue{LWR@tableparcell}% + \LWR@startpars% + \LWR@traceinfo{LWR@tabledatasinglecolumntag: done with LWR@startpars}% + }% allow pars + {}% no pars % \end{macrocode} % Print the |>| contents unless muted for the \cs{bottomrule}: % \begin{macrocode} - \ifboolexpr{bool{LWR@tabularmutemods} or bool{LWR@emptyatbang}}% - {}% - {% - \LWR@getexparray{LWR@colbeforespec}{\arabic{LWR@tableLaTeXcolindex}}% - }% - \global\boolfalse{LWR@intabularmetadata}% - }% not exiting tabular -}{}% in tabular metadata -\LWR@traceinfo{LWR@tabledatasinglecolumntag: done}% + \ifboolexpr{bool{LWR@tabularmutemods} or bool{LWR@emptyatbang}}% + {}% + {% + \LWR@getexparray{LWR@colbeforespec}{\arabic{LWR@tableLaTeXcolindex}}% + }% + \boolfalse{LWR@intabularmetadata}% + }% not exiting tabular + }{}% in tabular metadata + \LWR@traceinfo{LWR@tabledatasinglecolumntag: done}% }% % \end{macrocode} % \end{macro} @@ -27256,13 +27807,6 @@ end -- not --version -% \DescribeCounter{LWR@midrulecounter} -% Indexes across the |LWR@midrules| and |LWR@trim<l/r>rules| data arrays. -% \begin{macrocode} -\newcounter{LWR@midrulecounter} -% \end{macrocode} - - % \DescribeLength{\LWR@heavyrulewidth} % The default width of the rule. @@ -27311,21 +27855,21 @@ end -- not --version % \begin{macrocode} \newcommand*{\LWR@clearmidrules} {% -\setcounter{LWR@midrulecounter}{1}% -\whileboolexpr{% - not test{% - \ifnumcomp{\value{LWR@midrulecounter}}{>}% - {\value{LWR@tabletotalLaTeXcols}}% + \defcounter{LWR@midrulecounter}{1}% + \whileboolexpr{% + not test{% + \ifnumcomp{\value{LWR@midrulecounter}}{>}% + {\value{LWR@tabletotalLaTeXcols}}% + }% + }% + {% + \LWR@setexparray{LWR@midrules}{\arabic{LWR@midrulecounter}}{0pt}% + \setlength{\LWR@thiscmidrulewidth}{\LWR@cmidrulewidth}% + \LWR@setexparray{LWR@trimlrules}{\arabic{LWR@midrulecounter}}{}% + \LWR@setexparray{LWR@trimrrules}{\arabic{LWR@midrulecounter}}{}% + \LWR@setexparray{LWR@cdashlines}{\arabic{LWR@midrulecounter}}{N}% + \defaddtocounter{LWR@midrulecounter}{1}% }% -}% -{% - \LWR@setexparray{LWR@midrules}{\arabic{LWR@midrulecounter}}{0pt}% - \setlength{\LWR@thiscmidrulewidth}{\LWR@cmidrulewidth}% - \LWR@setexparray{LWR@trimlrules}{\arabic{LWR@midrulecounter}}{}% - \LWR@setexparray{LWR@trimrrules}{\arabic{LWR@midrulecounter}}{}% - \LWR@setexparray{LWR@cdashlines}{\arabic{LWR@midrulecounter}}{N}% - \addtocounter{LWR@midrulecounter}{1}% -}% } % \end{macrocode} % \end{macro} @@ -27344,19 +27888,19 @@ end -- not --version % % \begin{macrocode} \newcommand*{\LWR@subcmidrule}[4]{% -\setcounter{LWR@midrulecounter}{#3}% -\whileboolexpr{% - not test {% - \ifnumcomp{\value{LWR@midrulecounter}}{>}{#4}% + \defcounter{LWR@midrulecounter}{#3}% + \whileboolexpr{% + not test {% + \ifnumcomp{\value{LWR@midrulecounter}}{>}{#4}% + }% }% -}% -{% - \LWR@setexparray{LWR@midrules}{\arabic{LWR@midrulecounter}}{#1}% - \addtocounter{LWR@midrulecounter}{1}% -}% whiledo -\IfSubStr{#2}{l}{\LWR@setexparray{LWR@trimlrules}{#3}{l}}{}% -\IfSubStr{#2}{r}{\LWR@setexparray{LWR@trimrrules}{#4}{r}}{}% -\global\booltrue{LWR@doingcmidrule}% + {% + \LWR@setexparray{LWR@midrules}{\arabic{LWR@midrulecounter}}{#1}% + \defaddtocounter{LWR@midrulecounter}{1}% + }% whiledo + \IfSubStr{#2}{l}{\LWR@setexparray{LWR@trimlrules}{#3}{l}}{}% + \IfSubStr{#2}{r}{\LWR@setexparray{LWR@trimrrules}{#4}{r}}{}% + \booltrue{LWR@doingcmidrule}% } % \end{macrocode} % \end{macro} @@ -27386,17 +27930,17 @@ end -- not --version % % \begin{macrocode} \newcommand*{\LWR@subcdashline}[2]{% -\setcounter{LWR@midrulecounter}{#1}% -\whileboolexpr{% - not test {% - \ifnumcomp{\value{LWR@midrulecounter}}{>}{#2}% + \defcounter{LWR@midrulecounter}{#1}% + \whileboolexpr{% + not test {% + \ifnumcomp{\value{LWR@midrulecounter}}{>}{#2}% + }% }% -}% -{% - \LWR@setexparray{LWR@cdashlines}{\arabic{LWR@midrulecounter}}{Y}% - \addtocounter{LWR@midrulecounter}{1}% -}% whiledo -\global\booltrue{LWR@doingcmidrule}% + {% + \LWR@setexparray{LWR@cdashlines}{\arabic{LWR@midrulecounter}}{Y}% + \defaddtocounter{LWR@midrulecounter}{1}% + }% whiledo + \booltrue{LWR@doingcmidrule}% } % \end{macrocode} % \end{macro} @@ -27427,15 +27971,10 @@ end -- not --version % \end{macrocode} -% Used to add a style to a table data cell: -% \begin{macrocode} -\newbool{LWR@tdhavecellstyle} -% \end{macrocode} - % \begin{macro}{\LWR@tdstartstyles} % Begins possibly adding a table data cell style. % \begin{macrocode} -\newcommand*{\LWR@tdstartstyles}{\global\boolfalse{LWR@tdhavecellstyle}} +\newcommand*{\LWR@tdstartstyles}{\boolfalse{LWR@tdhavecellstyle}} % \end{macrocode} % \end{macro} @@ -27443,10 +27982,10 @@ end -- not --version % Starts adding a table data cell style. % \begin{macrocode} \newcommand*{\LWR@tdaddstyle}{% -\ifbool{LWR@tdhavecellstyle}% -{; }% -{ style="}% -\booltrue{LWR@tdhavecellstyle}% + \ifbool{LWR@tdhavecellstyle}% + {; }% + { style="}% + \booltrue{LWR@tdhavecellstyle}% } % \end{macrocode} % \end{macro} @@ -27456,10 +27995,11 @@ end -- not --version % Prints the closing quote. % \begin{macrocode} \newcommand*{\LWR@tdendstyles}{% -\ifbool{LWR@tdhavecellstyle}{% - "% - \global\boolfalse{LWR@tdhavecellstyle}% -}{}% + \ifbool{LWR@tdhavecellstyle}% + {% + "% + \boolfalse{LWR@tdhavecellstyle}% + }{}% } % \end{macrocode} % \end{macro} @@ -27473,23 +28013,23 @@ end -- not --version % % \begin{macrocode} \newcommand*{\LWR@subaddcmidruletrim}[2]{% -\setlength{\LWR@templengthone}{% - \LWR@getexparray{LWR@midrules}{\arabic{LWR@tableLaTeXcolindex}}% -}% -\ifdimcomp{\LWR@templengthone}{>}{0pt}% -{% + \setlength{\LWR@templengthone}{% + \LWR@getexparray{LWR@midrules}{\arabic{LWR@tableLaTeXcolindex}}% + }% + \ifdimcomp{\LWR@templengthone}{>}{0pt}% + {% % \end{macrocode} % Print the class with left and right trim letters appended: % \begin{macrocode} - \LWR@origtilde tdrule#1#2% + \LWR@origtilde tdrule#1#2% % \end{macrocode} % Remember the width of the rule: % \begin{macrocode} - \setlength{\LWR@thiscmidrulewidth}{\LWR@templengthone}% -}% -{% - \setlength{\LWR@thiscmidrulewidth}{0pt}% -}% + \setlength{\LWR@thiscmidrulewidth}{\LWR@templengthone}% + }% + {% + \setlength{\LWR@thiscmidrulewidth}{0pt}% + }% } % \end{macrocode} % \end{macro} @@ -27502,9 +28042,9 @@ end -- not --version % % \begin{macrocode} \newcommand*{\LWR@addcmidruletrim}{% -\LWR@subaddcmidruletrim% -{\LWR@getexparray{LWR@trimlrules}{\arabic{LWR@tableLaTeXcolindex}}}% -{\LWR@getexparray{LWR@trimrrules}{\arabic{LWR@tableLaTeXcolindex}}}% + \LWR@subaddcmidruletrim% + {\LWR@getexparray{LWR@trimlrules}{\arabic{LWR@tableLaTeXcolindex}}}% + {\LWR@getexparray{LWR@trimrrules}{\arabic{LWR@tableLaTeXcolindex}}}% } % \end{macrocode} % \end{macro} @@ -27525,42 +28065,42 @@ end -- not --version % Only add a custom width if |thiswidth| is different than the |defaultwidth|, % or if a color is being used: % \begin{macrocode} -\ifboolexpr{% - test{\ifdimcomp{#1}{=}{0pt}} or - ( - ( test{\ifdimcomp{#1}{=}{#2}} and not bool{FormatWP} ) - and ( test {\ifdefvoid{\LWR@ruleHTMLcolor}} ) - ) -}% -{}% default width and color -{% custom width and/or color + \ifboolexpr{% + test{\ifdimcomp{#1}{=}{0pt}} or + ( + ( test{\ifdimcomp{#1}{=}{#2}} and not bool{FormatWP} ) + and ( test {\ifdefvoid{\LWR@ruleHTMLcolor}} ) + ) + }% + {}% default width and color + {% custom width and/or color % \end{macrocode} % Ensure that the width is wide enough to display in the browser: % \begin{macrocode} - \LWR@forceminwidth{#1}% + \LWR@forceminwidth{#1}% % \end{macrocode} % Begin adding another style: % \begin{macrocode} - \LWR@tdaddstyle% + \LWR@tdaddstyle% % \end{macrocode} % The style itself: % \begin{macrocode} - border-top:\LWR@printlength{\LWR@atleastonept} solid % + border-top:\LWR@printlength{\LWR@atleastonept} solid % space % \end{macrocode} % If default gray, the darkness of the color depends on the thickness of the rule: % \begin{macrocode} - \ifdefvoid{\LWR@ruleHTMLcolor}{% - \ifdimcomp{#1}{<}{\LWR@lightrulewidth}% - {\LWR@origpound{}A0A0A0}% - {% lightrule or heaver - \ifdimcomp{#1}{<}{\LWR@heavyrulewidth}% - {\LWR@origpound{}808080}% - {black}% - }% lightrule or heavier - }{% - \LWR@origpound\LWR@ruleHTMLcolor% - } -}% custom width and/or color + \ifdefvoid{\LWR@ruleHTMLcolor}{% + \ifdimcomp{#1}{<}{\LWR@lightrulewidth}% + {\LWR@origpound{}A0A0A0}% + {% lightrule or heaver + \ifdimcomp{#1}{<}{\LWR@heavyrulewidth}% + {\LWR@origpound{}808080}% + {black}% + }% lightrule or heavier + }{% + \LWR@origpound\LWR@ruleHTMLcolor% + }% + }% custom width and/or color } % \end{macrocode} % \end{macro} @@ -27572,7 +28112,7 @@ end -- not --version % Must be placed between \cs{LWR@tdstartstyles} and \cs{LWR@tdendstyles}. % \begin{macrocode} \newcommand{\LWR@addcmidrulewidth}{% -\LWR@addrulewidth{\LWR@thiscmidrulewidth}{\LWR@cmidrulewidth}% + \LWR@addrulewidth{\LWR@thiscmidrulewidth}{\LWR@cmidrulewidth}% } % \end{macrocode} % \end{macro} @@ -27585,16 +28125,16 @@ end -- not --version % \changes{v0.56}{2018/05/04}{\pkg{arydshln}: Added.} % \begin{macrocode} \newcommand{\LWR@addcdashline}{% -\edef\LWR@tempone{% - \LWR@getexparray{LWR@cdashlines}{\arabic{LWR@tableLaTeXcolindex}}% -}% -\ifdefstring{\LWR@tempone}{Y}{% - \LWR@tdaddstyle% - border-top: 1pt dashed % - \ifdefvoid{\LWR@ruleHTMLcolor}% - {black}% - {\LWR@origpound\LWR@ruleHTMLcolor}% -}{}% + \edef\LWR@tempone{% + \LWR@getexparray{LWR@cdashlines}{\arabic{LWR@tableLaTeXcolindex}}% + }% + \ifdefstring{\LWR@tempone}{Y}{% + \LWR@tdaddstyle% + border-top: 1pt dashed % + \ifdefvoid{\LWR@ruleHTMLcolor}% + {black}% + {\LWR@origpound\LWR@ruleHTMLcolor}% + }{}% } % \end{macrocode} % \end{macro} @@ -27604,8 +28144,8 @@ end -- not --version % \changes{v0.47}{2018/01/26}{Fix: Line wrap at \HTML\ hyphen.} % \begin{macrocode} \newcommand*{\LWR@WPcell}[2]{% -\LWR@tdaddstyle% -\LWR@print@mbox{text-align:#1}; \LWR@print@mbox{vertical-align:#2}% + \LWR@tdaddstyle% + \LWR@print@mbox{text-align:#1}; \LWR@print@mbox{vertical-align:#2}% } % \end{macrocode} % \end{macro} @@ -27620,17 +28160,17 @@ end -- not --version % \changes{v0.44}{2017/11/08}{Fix for multicolumn alignment if \progcode{FormatWP}.} % \begin{macrocode} \newcommand*{\LWR@addformatwpalignment}[1]{% -\ifbool{FormatWP}{% -\IfSubStr{#1}{l}{\LWR@WPcell{left}{middle}}{}% -\IfSubStr{#1}{c}{\LWR@WPcell{center}{middle}}{}% -\IfSubStr{#1}{r}{\LWR@WPcell{right}{middle}}{}% -\IfSubStr{#1}{p}{\LWR@WPcell{left}{bottom}}{}% -\IfSubStr{#1}{m}{\LWR@WPcell{left}{middle}}{}% -\IfSubStr{#1}{b}{\LWR@WPcell{left}{top}}{}% -\IfSubStr{#1}{P}{\LWR@WPcell{center}{bottom}}{}% -\IfSubStr{#1}{M}{\LWR@WPcell{center}{middle}}{}% -\IfSubStr{#1}{B}{\LWR@WPcell{center}{top}}{}% -}{}% + \ifbool{FormatWP}{% + \IfSubStr{#1}{l}{\LWR@WPcell{left}{middle}}{}% + \IfSubStr{#1}{c}{\LWR@WPcell{center}{middle}}{}% + \IfSubStr{#1}{r}{\LWR@WPcell{right}{middle}}{}% + \IfSubStr{#1}{p}{\LWR@WPcell{left}{bottom}}{}% + \IfSubStr{#1}{m}{\LWR@WPcell{left}{middle}}{}% + \IfSubStr{#1}{b}{\LWR@WPcell{left}{top}}{}% + \IfSubStr{#1}{P}{\LWR@WPcell{center}{bottom}}{}% + \IfSubStr{#1}{M}{\LWR@WPcell{center}{middle}}{}% + \IfSubStr{#1}{B}{\LWR@WPcell{center}{top}}{}% + }{}% } % \end{macrocode} % \end{macro} @@ -27646,19 +28186,19 @@ end -- not --version % % \begin{macrocode} \newcommand*{\LWR@addtabularrowcolor}{% -\ifbool{LWR@tabularmutemods}{}{% - \ifdefvoid{\LWR@rowHTMLcolor}{% - \ifdefvoid{\LWR@xcolorrowHTMLcolor}{}% - {% xcolor row color + \ifbool{LWR@tabularmutemods}{}{% + \ifdefvoid{\LWR@rowHTMLcolor}{% + \ifdefvoid{\LWR@xcolorrowHTMLcolor}{}% + {% xcolor row color + \LWR@tdaddstyle% + background:\LWR@origpound\LWR@xcolorrowHTMLcolor% + }% + }% + {% explicit row color \LWR@tdaddstyle% - background:\LWR@origpound\LWR@xcolorrowHTMLcolor% + background:\LWR@origpound\LWR@rowHTMLcolor% }% }% - {% explicit row color - \LWR@tdaddstyle% - background:\LWR@origpound\LWR@rowHTMLcolor% - }% -}% } % \end{macrocode} % \end{macro} @@ -27674,60 +28214,60 @@ end -- not --version % \end{macrocode} % If either form of horizontal rule is requested: % \begin{macrocode} -\ifboolexpr{% - test{\ifnumcomp{\value{LWR@hlines}}{>}{0}} or% - test{\ifnumcomp{\value{LWR@hdashedlines}}{>}{0}} or% - bool{LWR@doingtbrule}% -}{% + \ifboolexpr{% + test{\ifnumcomp{\value{LWR@hlines}}{>}{0}} or% + test{\ifnumcomp{\value{LWR@hdashedlines}}{>}{0}} or% + bool{LWR@doingtbrule}% + }{% % \end{macrocode} % If there is a no custom color: % \begin{macrocode} - \ifdefvoid{\LWR@ruleHTMLcolor}% - {% - \ifnumcomp{\value{LWR@hlines}}{>}{1}% - {% - \LWR@tdaddstyle% - border-top: 4px double% - }{% else - \ifnumcomp{\value{LWR@hdashedlines}}{>}{1}% + \ifdefvoid{\LWR@ruleHTMLcolor}% {% - \LWR@tdaddstyle% - border-top: 2px dashed% - }{% else - \ifnumcomp{\value{LWR@hdashedlines}}{=}{1}% - {% - \LWR@tdaddstyle% - border-top: 1px dashed% - }{}}}% + \ifnumcomp{\value{LWR@hlines}}{>}{1}% + {% + \LWR@tdaddstyle% + border-top: 4px double% + }{% else + \ifnumcomp{\value{LWR@hdashedlines}}{>}{1}% + {% + \LWR@tdaddstyle% + border-top: 2px dashed% + }{% else + \ifnumcomp{\value{LWR@hdashedlines}}{=}{1}% + {% + \LWR@tdaddstyle% + border-top: 1px dashed% + }{}}}% % \end{macrocode} % If no color and not doubled or dashed, then add nothing, since % a simpler rule is the default. % \begin{macrocode} - }% + }% % \end{macrocode} % If there is a custom color: % \begin{macrocode} - {% - \ifnumcomp{\value{LWR@hlines}}{>}{1}% - {% - \LWR@tdaddstyle% - border-top: 4px double \LWR@origpound\LWR@ruleHTMLcolor% - }{% else - \ifnumcomp{\value{LWR@hdashedlines}}{>}{1}% {% - \LWR@tdaddstyle% - border-top: 2px dashed \LWR@origpound\LWR@ruleHTMLcolor% - }{% else - \ifnumcomp{\value{LWR@hdashedlines}}{=}{1}% - {% - \LWR@tdaddstyle% - border-top: 1px dashed \LWR@origpound\LWR@ruleHTMLcolor% - }{% else - \LWR@tdaddstyle% - border-top: 1px solid \LWR@origpound\LWR@ruleHTMLcolor% - }}}% - }% -}{}% + \ifnumcomp{\value{LWR@hlines}}{>}{1}% + {% + \LWR@tdaddstyle% + border-top: 4px double \LWR@origpound\LWR@ruleHTMLcolor% + }{% else + \ifnumcomp{\value{LWR@hdashedlines}}{>}{1}% + {% + \LWR@tdaddstyle% + border-top: 2px dashed \LWR@origpound\LWR@ruleHTMLcolor% + }{% else + \ifnumcomp{\value{LWR@hdashedlines}}{=}{1}% + {% + \LWR@tdaddstyle% + border-top: 1px dashed \LWR@origpound\LWR@ruleHTMLcolor% + }{% else + \LWR@tdaddstyle% + border-top: 1px solid \LWR@origpound\LWR@ruleHTMLcolor% + }}}% + }% + }{}% } % \end{macrocode} % \end{macro} @@ -27746,88 +28286,81 @@ end -- not --version % \end{macrocode} % Custom horizonal rule color: % \begin{macrocode} -\LWR@addtabularhrulecolor% + \LWR@addtabularhrulecolor% % \end{macrocode} % No vertical rules if finishing the \env{tabular} with a row of empty cells: % \begin{macrocode} -\ifbool{LWR@tabularmutemods}{}{% + \ifbool{LWR@tabularmutemods}{}{% % \end{macrocode} % If at the leftmost cell, possibly add a leftmost vertical rule: % \begin{macrocode} - \ifnumequal{\value{LWR@tableLaTeXcolindex}}{1}{% + \ifnumequal{\value{LWR@tableLaTeXcolindex}}{1}{% % \end{macrocode} % Fetch the left edge's vertical bar specification: % \begin{macrocode} - \edef\LWR@tempone{\LWR@getexparray{LWR@colbarspec}{leftedge}}% + \edef\LWR@tempone{\LWR@getexparray{LWR@colbarspec}{leftedge}}% +% \end{macrocode} +% Add a custom style if a vertical bar was requested: +% \begin{macrocode} + \ifdefstring{\LWR@tempone}{tvertbarl}{% + \LWR@tdaddstyle% + border-left: 1px solid % space + \LWR@vertruleHTMLcolor% + }{}% + \ifdefstring{\LWR@tempone}{tvertbarldouble}{% + \LWR@tdaddstyle% + border-left: 4px double % space + \LWR@vertruleHTMLcolor% + }{}% + \ifdefstring{\LWR@tempone}{tvertbarldash}{% + \LWR@tdaddstyle% + border-left: 1px dashed % space + \LWR@vertruleHTMLcolor% + }{}% + \ifdefstring{\LWR@tempone}{tvertbarldoubledash}{% + \LWR@tdaddstyle% + border-left: 2px dashed % space + \LWR@vertruleHTMLcolor% + }{}% + }{}% +% \end{macrocode} +% Possibly add a right vertical rule for this cell: +% \begin{macrocode} + \edef\LWR@tempone{% + \LWR@getexparray{LWR@colbarspec}{\arabic{LWR@tableLaTeXcolindex}}% + }% + \ifdefstring{\LWR@tempone}{tvertbarr}{% % \end{macrocode} % Add a custom style if a vertical bar was requested: % \begin{macrocode} - \ifdefstring{\LWR@tempone}{tvertbarl}{% \LWR@tdaddstyle% - border-left: 1px solid % space - \LWR@vertruleHTMLcolor% + border-right: 1px solid \LWR@vertruleHTMLcolor% }{}% - \ifdefstring{\LWR@tempone}{tvertbarldouble}{% + \ifdefstring{\LWR@tempone}{tvertbarrdouble}{% \LWR@tdaddstyle% - border-left: 4px double % space - \LWR@vertruleHTMLcolor% + border-right: 4px double \LWR@vertruleHTMLcolor% }{}% - \ifdefstring{\LWR@tempone}{tvertbarldash}{% + \ifdefstring{\LWR@tempone}{tvertbarrdash}{% \LWR@tdaddstyle% - border-left: 1px dashed % space - \LWR@vertruleHTMLcolor% + border-right: 1px dashed \LWR@vertruleHTMLcolor% }{}% - \ifdefstring{\LWR@tempone}{tvertbarldoubledash}{% + \ifdefstring{\LWR@tempone}{tvertbarrdoubledash}{% \LWR@tdaddstyle% - border-left: 2px dashed % space - \LWR@vertruleHTMLcolor% + border-right: 2px dashed \LWR@vertruleHTMLcolor% }{}% - }{}% -% \end{macrocode} -% Possibly add a right vertical rule for this cell: -% \begin{macrocode} - \edef\LWR@tempone{% - \LWR@getexparray{LWR@colbarspec}{\arabic{LWR@tableLaTeXcolindex}}% }% - \ifdefstring{\LWR@tempone}{tvertbarr}{% -% \end{macrocode} -% Add a custom style if a vertical bar was requested: -% \begin{macrocode} - \LWR@tdaddstyle% - border-right: 1px solid \LWR@vertruleHTMLcolor% - }{}% - \ifdefstring{\LWR@tempone}{tvertbarrdouble}{% - \LWR@tdaddstyle% - border-right: 4px double \LWR@vertruleHTMLcolor% - }{}% - \ifdefstring{\LWR@tempone}{tvertbarrdash}{% - \LWR@tdaddstyle% - border-right: 1px dashed \LWR@vertruleHTMLcolor% - }{}% - \ifdefstring{\LWR@tempone}{tvertbarrdoubledash}{% - \LWR@tdaddstyle% - border-right: 2px dashed \LWR@vertruleHTMLcolor% - }{}% -}% } % \end{macrocode} % \end{macro} -% \DescribeCounter{LWR@cellcolordepth} -% Counts how many cell color \element{div}s were added to the current tabular data cell. -% \begin{macrocode} -\newcounter{LWR@cellcolordepth} -% \end{macrocode} - - % \begin{macro}{\LWR@subaddtabularcellcolor} \marg{\HTML\ color} % \begin{macrocode} \newcommand*{\LWR@subaddtabularcellcolor}[1]{% -\LWR@htmltag{div class="cellcolor" style="% - background:\LWR@origpound{}{}#1 % -" }% -\addtocounter{LWR@cellcolordepth}{1}% + \LWR@htmltag{div class="cellcolor" style="% + background:\LWR@origpound{}{}#1 % + " }% + \defaddtocounter{LWR@cellcolordepth}{1}% } % \end{macrocode} % \end{macro} @@ -27837,21 +28370,21 @@ end -- not --version % \changes{v0.49}{2018/02/18}{\pkg{xcolor}: Added tabular row colors.} % \begin{macrocode} \newcommand*{\LWR@addtabularcellcolor}{% -\ifdefvoid{\LWR@cellHTMLcolor}% -{% - \ifdefvoid{\LWR@rowHTMLcolor}% + \ifdefvoid{\LWR@cellHTMLcolor}% {% - \ifdefvoid{\LWR@xcolorrowHTMLcolor}% + \ifdefvoid{\LWR@rowHTMLcolor}% {% - \ifdefvoid{\LWR@columnHTMLcolor}% - {}% - {\LWR@subaddtabularcellcolor{\LWR@columnHTMLcolor}}% + \ifdefvoid{\LWR@xcolorrowHTMLcolor}% + {% + \ifdefvoid{\LWR@columnHTMLcolor}% + {}% + {\LWR@subaddtabularcellcolor{\LWR@columnHTMLcolor}}% + }% + {\LWR@subaddtabularcellcolor{\LWR@xcolorrowHTMLcolor}}% }% - {\LWR@subaddtabularcellcolor{\LWR@xcolorrowHTMLcolor}}% + {\LWR@subaddtabularcellcolor{\LWR@rowHTMLcolor}}% }% - {\LWR@subaddtabularcellcolor{\LWR@rowHTMLcolor}}% -}% -{\LWR@subaddtabularcellcolor{\LWR@cellHTMLcolor}}% + {\LWR@subaddtabularcellcolor{\LWR@cellHTMLcolor}}% } % \end{macrocode} % \end{macro} @@ -27861,24 +28394,6 @@ end -- not --version % \subsubsection{Parsing multicolumns} -% \begin{macrocode} -\newcounter{LWR@tablemulticolswidth} -% \end{macrocode} -% -% Indexes into the multicolumn specification: -% \begin{macrocode} -\newcounter{LWR@tablemulticolspos} -% \end{macrocode} - -% Remembers multicolumn vertical rules if found in the column spec. -% \begin{macrocode} -\newcounter{LWR@mcolvertbarsl} -\newcounter{LWR@mcolvertbarsr} -\newcounter{LWR@mcolvertbarsldash} -\newcounter{LWR@mcolvertbarsrdash} -\newbool{LWR@mcolvertbaronleft}% -% \end{macrocode} - % \begin{macro}{\LWR@printmccoltype} \marg{colspec} % Print any valid column type found. Does not print |@|, |!|, |>|, or |<| columns % or their associated tokens. @@ -27886,64 +28401,64 @@ end -- not --version % This is printed as part of the table data tag's |class|. % \begin{macrocode} \newcommand*{\LWR@printmccoltype}[1]{% -\LWR@traceinfo{lwr@printmccoltype -#1-}% + \LWR@traceinfo{lwr@printmccoltype -#1-}% % \end{macrocode} % Get one token of the column spec: % \begin{macrocode} -\StrChar{#1}{\arabic{LWR@tablemulticolspos}}[\LWR@strresult]% + \StrChar{#1}{\arabic{LWR@tablemulticolspos}}[\LWR@strresult]% % \end{macrocode} % Add to the \HTML\ tag depending on which column type is found: % \begin{macrocode} -\IfStrEq{\LWR@strresult}{l}{l}{}% -\IfStrEq{\LWR@strresult}{c}{c}{}% -\IfStrEq{\LWR@strresult}{r}{r}{}% -\IfStrEq{\LWR@strresult}{p}{p}{}% -\IfStrEq{\LWR@strresult}{m}{m}{}% -\IfStrEq{\LWR@strresult}{b}{b}{}% -\IfStrEq{\LWR@strresult}{P}{P}{}% -\IfStrEq{\LWR@strresult}{M}{M}{}% -\IfStrEq{\LWR@strresult}{B}{B}{}% + \IfStrEq{\LWR@strresult}{l}{l}{}% + \IfStrEq{\LWR@strresult}{c}{c}{}% + \IfStrEq{\LWR@strresult}{r}{r}{}% + \IfStrEq{\LWR@strresult}{p}{p}{}% + \IfStrEq{\LWR@strresult}{m}{m}{}% + \IfStrEq{\LWR@strresult}{b}{b}{}% + \IfStrEq{\LWR@strresult}{P}{P}{}% + \IfStrEq{\LWR@strresult}{M}{M}{}% + \IfStrEq{\LWR@strresult}{B}{B}{}% % \end{macrocode} % \changes{v0.56}{2018/05/10}{Added \pkg{array} \texttt{W} column.} % \begin{macrocode} -\IfStrEq{\LWR@strresult}{w}{w}{}% -\IfStrEq{\LWR@strresult}{W}{W}{}% + \IfStrEq{\LWR@strresult}{w}{w}{}% + \IfStrEq{\LWR@strresult}{W}{W}{}% % \end{macrocode} % \begin{macrocode} -\IfStrEq{\LWR@strresult}{S}{c}{}% -\IfStrEq{\LWR@strresult}{s}{c}{}% + \IfStrEq{\LWR@strresult}{S}{c}{}% + \IfStrEq{\LWR@strresult}{s}{c}{}% % \end{macrocode} % \begin{macrocode} -\IfStrEq{\LWR@strresult}{X}{p}{}% + \IfStrEq{\LWR@strresult}{X}{p}{}% % \end{macrocode} % \changes{v0.43}{2017/11/07}{Added vertical rules.} % \changes{v0.56}{2018/04/30}{Adds support for double vertical rules.} % \changes{v0.56}{2018/05/05}{Adds support for dashed vertical rules.} % \begin{macrocode} -\IfStrEq{\LWR@strresult}{|}% -{% - \ifbool{LWR@mcolvertbaronleft}% - {\addtocounter{LWR@mcolvertbarsl}{1}}% left edge - {\addtocounter{LWR@mcolvertbarsr}{1}}% not left edge -}% -{% - \IfStrEq{\LWR@strresult}{:}% + \IfStrEq{\LWR@strresult}{|}% {% \ifbool{LWR@mcolvertbaronleft}% - {\addtocounter{LWR@mcolvertbarsldash}{1}}% left edge - {\addtocounter{LWR@mcolvertbarsrdash}{1}}% not left edge + {\defaddtocounter{LWR@mcolvertbarsl}{1}}% left edge + {\defaddtocounter{LWR@mcolvertbarsr}{1}}% not left edge }% {% - \IfStrEq{\LWR@strresult}{;}% + \IfStrEq{\LWR@strresult}{:}% {% \ifbool{LWR@mcolvertbaronleft}% - {\addtocounter{LWR@mcolvertbarsldash}{1}}% left edge - {\addtocounter{LWR@mcolvertbarsrdash}{1}}% not left edge + {\defaddtocounter{LWR@mcolvertbarsldash}{1}}% left edge + {\defaddtocounter{LWR@mcolvertbarsrdash}{1}}% not left edge + }% + {% + \IfStrEq{\LWR@strresult}{;}% + {% + \ifbool{LWR@mcolvertbaronleft}% + {\defaddtocounter{LWR@mcolvertbarsldash}{1}}% left edge + {\defaddtocounter{LWR@mcolvertbarsrdash}{1}}% not left edge + }% + {\boolfalse{LWR@mcolvertbaronleft}}% }% - {\boolfalse{LWR@mcolvertbaronleft}}% }% -}% -\LWR@traceinfo{lwr@printmccoltype done}% + \LWR@traceinfo{lwr@printmccoltype done}% } % \end{macrocode} % \end{macro} @@ -27953,10 +28468,10 @@ end -- not --version % \changes{v0.56}{2018/05/12}{Fix: \cs{multicolumn} parameters.} % \begin{macrocode} \newcommand*{\LWR@multicolpartext}[1]{% -\LWR@startpars% -\LWR@multicoltext% -\addtocounter{LWR@tablemulticolspos}{#1}% -\LWR@stoppars% + \LWR@startpars% + \LWR@multicoltext% + \defaddtocounter{LWR@tablemulticolspos}{#1}% + \LWR@stoppars% } % \end{macrocode} % \end{macro} @@ -27965,13 +28480,13 @@ end -- not --version % For |@|, |!|, |>|, |<|, print the next token without paragraph tags: % \begin{macrocode} \newcommand*{\LWR@multicolother}[1]{% -\addtocounter{LWR@tablemulticolspos}{1}% -\StrChar{#1}{\arabic{LWR@tablemulticolspos}}[\LWR@strresult]% -\LWR@strresult% + \defaddtocounter{LWR@tablemulticolspos}{1}% + \StrChar{#1}{\arabic{LWR@tablemulticolspos}}[\LWR@strresult]% + \LWR@strresult% % \end{macrocode} % A valid column data type was found: % \begin{macrocode} -\global\booltrue{LWR@validtablecol}% + \booltrue{LWR@validtablecol}% } % \end{macrocode} % \end{macro} @@ -27983,7 +28498,7 @@ end -- not --version % \end{macrocode} % A valid column data type was found: % \begin{macrocode} -\global\booltrue{LWR@validtablecol}% + \booltrue{LWR@validtablecol}% } % \end{macrocode} % \end{macro} @@ -27998,66 +28513,67 @@ end -- not --version % % \begin{macrocode} \newcommand*{\LWR@printmccoldata}[1]{% -\LWR@traceinfo{lwr@printmccoldata -#1}% + \LWR@traceinfo{lwr@printmccoldata -#1}% % \end{macrocode} % Not yet found a valid column type: % \begin{macrocode} -\global\boolfalse{LWR@validtablecol}% + \boolfalse{LWR@validtablecol}% % \end{macrocode} -% Get one token of the column spec: +% Get one token of the column spec, into a local copy in case nested. % \begin{macrocode} -\StrChar{#1}{\arabic{LWR@tablemulticolspos}}[\LWR@strresult]% + \StrChar{#1}{\arabic{LWR@tablemulticolspos}}[\LWR@strresult]% + \edef\LWR@printmccoldatatoken{\LWR@strresult}% % \end{macrocode} % Print the text depending on which column type is found. % Also handles |@|, |>|, |<| as it comes to them. % \begin{macrocode} -\IfStrEq{\LWR@strresult}{l}{\LWR@multicoltext}{}% -\IfStrEq{\LWR@strresult}{c}{\LWR@multicoltext}{}% -\IfStrEq{\LWR@strresult}{r}{\LWR@multicoltext}{}% -\IfStrEq{\LWR@strresult}{D}{% -\addtocounter{LWR@tablemulticolspos}{3}% skip parameters -\LWR@multicoltext% -}{}% + \IfStrEq{\LWR@printmccoldatatoken}{l}{\LWR@multicoltext}{}% + \IfStrEq{\LWR@printmccoldatatoken}{c}{\LWR@multicoltext}{}% + \IfStrEq{\LWR@printmccoldatatoken}{r}{\LWR@multicoltext}{}% + \IfStrEq{\LWR@printmccoldatatoken}{D}{% + \defaddtocounter{LWR@tablemulticolspos}{3}% skip parameters + \LWR@multicoltext% + }{}% % \end{macrocode} % \changes{v0.56}{2018/05/12}{Fix: \cs{multicolumn} parameters.} % \changes{v0.72}{2019/06/07}{Fix: \cs{multicolumn} parameters.} % \begin{macrocode} -\IfStrEq{\LWR@strresult}{p}{\LWR@multicolpartext{2}}{}% -\IfStrEq{\LWR@strresult}{m}{\LWR@multicolpartext{2}}{}% -\IfStrEq{\LWR@strresult}{b}{\LWR@multicolpartext{2}}{}% -\IfStrEq{\LWR@strresult}{P}{\LWR@multicolpartext{2}}{}% -\IfStrEq{\LWR@strresult}{M}{\LWR@multicolpartext{2}}{}% -\IfStrEq{\LWR@strresult}{B}{\LWR@multicolpartext{2}}{}% + \IfStrEq{\LWR@printmccoldatatoken}{p}{\LWR@multicolpartext{2}}{}% + \IfStrEq{\LWR@printmccoldatatoken}{m}{\LWR@multicolpartext{2}}{}% + \IfStrEq{\LWR@printmccoldatatoken}{b}{\LWR@multicolpartext{2}}{}% + \IfStrEq{\LWR@printmccoldatatoken}{P}{\LWR@multicolpartext{2}}{}% + \IfStrEq{\LWR@printmccoldatatoken}{M}{\LWR@multicolpartext{2}}{}% + \IfStrEq{\LWR@printmccoldatatoken}{B}{\LWR@multicolpartext{2}}{}% % \end{macrocode} % \changes{v0.56}{2018/05/10}{Added \pkg{array} \texttt{W} column.} % \begin{macrocode} -\IfStrEq{\LWR@strresult}{w}{\LWR@multicolpartext{3}}{}% -\IfStrEq{\LWR@strresult}{W}{\LWR@multicolpartext{3}}{}% + \IfStrEq{\LWR@printmccoldatatoken}{w}{\LWR@multicolpartext{3}}{}% + \IfStrEq{\LWR@printmccoldatatoken}{W}{\LWR@multicolpartext{3}}{}% % \end{macrocode} % \begin{macrocode} -\IfStrEq{\LWR@strresult}{S}{\LWR@multicoltext}{}% -\IfStrEq{\LWR@strresult}{s}{\LWR@multicoltext}{}% + \IfStrEq{\LWR@printmccoldatatoken}{S}{\LWR@multicoltext}{}% + \IfStrEq{\LWR@printmccoldatatoken}{s}{\LWR@multicoltext}{}% % \end{macrocode} % \begin{macrocode} -\IfStrEq{\LWR@strresult}{X}{\LWR@multicolpartext{1}}{}% -\IfStrEq{\LWR@strresult}{|}{\LWR@multicolskip}{}% -\IfStrEq{\LWR@strresult}{:}{\LWR@multicolskip}{}% -\IfStrEq{\LWR@strresult}{;}{% - \LWR@multicolskip% - \addtocounter{LWR@tablemulticolspos}{1}% skip parameter -}{}% -\IfStrEq{\LWR@strresult}{\detokenize{@}}{\LWR@multicolother{#1}}{}% -\IfStrEq{\LWR@strresult}{\detokenize{!}}{\LWR@multicolother{#1}}{}% -\IfStrEq{\LWR@strresult}{\detokenize{>}}{\LWR@multicolother{#1}}{}% -\IfStrEq{\LWR@strresult}{\detokenize{<}}{\LWR@multicolother{#1}}{}% + \IfStrEq{\LWR@printmccoldatatoken}{X}{\LWR@multicolpartext{1}}{}% + \IfStrEq{\LWR@printmccoldatatoken}{|}{\LWR@multicolskip}{}% + \IfStrEq{\LWR@printmccoldatatoken}{:}{\LWR@multicolskip}{}% + \IfStrEq{\LWR@printmccoldatatoken}{;}{% + \LWR@multicolskip% + \defaddtocounter{LWR@tablemulticolspos}{1}% skip parameter + }{}% + \IfStrEq{\LWR@printmccoldatatoken}{\detokenize{@}}{\LWR@multicolother{#1}}{}% + \IfStrEq{\LWR@printmccoldatatoken}{\detokenize{!}}{\LWR@multicolother{#1}}{}% + \IfStrEq{\LWR@printmccoldatatoken}{\detokenize{>}}{\LWR@multicolother{#1}}{}% + \IfStrEq{\LWR@printmccoldatatoken}{\detokenize{<}}{\LWR@multicolother{#1}}{}% % \end{macrocode} % If an invalid column type: % \begin{macrocode} -\ifbool{LWR@validtablecol}{}{\LWR@multicoltext}% + \ifbool{LWR@validtablecol}{}{\LWR@multicoltext{}}% % \end{macrocode} % Tracing: % \begin{macrocode} -\LWR@traceinfo{lwr@printmccoldata done}% + \LWR@traceinfo{lwr@printmccoldata done}% } % \end{macrocode} % \end{macro} @@ -28075,28 +28591,28 @@ end -- not --version % which will NOT match |l|, |c|, |r|, or |p|. % \begin{macrocode} \newcommand*{\LWR@parsemulticolumnalignment}[2]{% -\setcounter{LWR@tablemulticolspos}{1}% -\StrLen{#1}[\LWR@strresult]% -\setcounter{LWR@tablemulticolswidth}{\LWR@strresult}% + \defcounter{LWR@tablemulticolspos}{1}% + \StrLen{#1}[\LWR@strresult]% + \defcounter{LWR@tablemulticolswidth}{\LWR@strresult}% % \end{macrocode} % Scan across the tokens in the column spec: % \begin{macrocode} -\whileboolexpr{% - not test {% - \ifnumcomp{\value{LWR@tablemulticolspos}}{>}% - {\value{LWR@tablemulticolswidth}}% + \whileboolexpr{% + not test {% + \ifnumcomp{\value{LWR@tablemulticolspos}}{>}% + {\value{LWR@tablemulticolswidth}}% + }% }% -}% -{% + {% % \end{macrocode} % Execute the assigned print function for each token in the column spec: % \begin{macrocode} -#2{#1}% + #2{#1}% % \end{macrocode} % Move to the next token in the column spec: % \begin{macrocode} -\addtocounter{LWR@tablemulticolspos}{1}% -}% + \defaddtocounter{LWR@tablemulticolspos}{1}% + }% } % \end{macrocode} % \end{macro} @@ -28113,46 +28629,46 @@ end -- not --version % \end{macrocode} % No vertical rules if finishing the \env{tabular} with a row of empty cells: % \begin{macrocode} -\ifbool{LWR@tabularmutemods}{}{% + \ifbool{LWR@tabularmutemods}{}{% % \end{macrocode} % Left side: % \begin{macrocode} - \ifnumcomp{\value{LWR@mcolvertbarsl}}{=}{1}{% - \LWR@tdaddstyle% - border-left: 1px solid \LWR@vertruleHTMLcolor% - }{}% - \ifnumcomp{\value{LWR@mcolvertbarsl}}{>}{1}{% - \LWR@tdaddstyle% - border-left: 4px double \LWR@vertruleHTMLcolor% - }{}% - \ifnumcomp{\value{LWR@mcolvertbarsldash}}{=}{1}{% - \LWR@tdaddstyle% - border-left: 1px dashed \LWR@vertruleHTMLcolor% - }{}% - \ifnumcomp{\value{LWR@mcolvertbarsldash}}{>}{1}{% - \LWR@tdaddstyle% - border-left: 2px dashed \LWR@vertruleHTMLcolor% - }{}% + \ifnumcomp{\value{LWR@mcolvertbarsl}}{=}{1}{% + \LWR@tdaddstyle% + border-left: 1px solid \LWR@vertruleHTMLcolor% + }{}% + \ifnumcomp{\value{LWR@mcolvertbarsl}}{>}{1}{% + \LWR@tdaddstyle% + border-left: 4px double \LWR@vertruleHTMLcolor% + }{}% + \ifnumcomp{\value{LWR@mcolvertbarsldash}}{=}{1}{% + \LWR@tdaddstyle% + border-left: 1px dashed \LWR@vertruleHTMLcolor% + }{}% + \ifnumcomp{\value{LWR@mcolvertbarsldash}}{>}{1}{% + \LWR@tdaddstyle% + border-left: 2px dashed \LWR@vertruleHTMLcolor% + }{}% % \end{macrocode} % Right side: % \begin{macrocode} - \ifnumcomp{\value{LWR@mcolvertbarsr}}{=}{1}{% - \LWR@tdaddstyle% - border-right: 1px solid \LWR@vertruleHTMLcolor% - }{}% - \ifnumcomp{\value{LWR@mcolvertbarsr}}{>}{1}{% - \LWR@tdaddstyle% - border-right: 4px double \LWR@vertruleHTMLcolor% - }{}% - \ifnumcomp{\value{LWR@mcolvertbarsrdash}}{=}{1}{% - \LWR@tdaddstyle% - border-right: 1px dashed \LWR@vertruleHTMLcolor% - }{}% - \ifnumcomp{\value{LWR@mcolvertbarsrdash}}{>}{1}{% - \LWR@tdaddstyle% - border-right: 2px dashed \LWR@vertruleHTMLcolor% - }{}% -}% + \ifnumcomp{\value{LWR@mcolvertbarsr}}{=}{1}{% + \LWR@tdaddstyle% + border-right: 1px solid \LWR@vertruleHTMLcolor% + }{}% + \ifnumcomp{\value{LWR@mcolvertbarsr}}{>}{1}{% + \LWR@tdaddstyle% + border-right: 4px double \LWR@vertruleHTMLcolor% + }{}% + \ifnumcomp{\value{LWR@mcolvertbarsrdash}}{=}{1}{% + \LWR@tdaddstyle% + border-right: 1px dashed \LWR@vertruleHTMLcolor% + }{}% + \ifnumcomp{\value{LWR@mcolvertbarsrdash}}{>}{1}{% + \LWR@tdaddstyle% + border-right: 2px dashed \LWR@vertruleHTMLcolor% + }{}% + }% } % \end{macrocode} % \end{macro} @@ -28178,67 +28694,76 @@ end -- not --version % % \begin{macrocode} \NewDocumentCommand{\LWR@domulticolumn}{o o m m m +m}{% -\LWR@traceinfo{LWR@domulticolumn -#1- -#2- -#4- -#5-}% + \LWR@traceinfo{LWR@domulticolumn -#1- -#2- -#4- -#5-}% % \end{macrocode} % Remember the text to be inserted, and % remember that a valid column type was found: % \begin{macrocode} -\renewcommand{\LWR@multicoltext}{% -#6% -\global\booltrue{LWR@validtablecol}% -}% + \renewcommand{\LWR@multicoltext}{% + #6% + \booltrue{LWR@validtablecol}% + }% % \end{macrocode} % Compute the rightmost column to be included. % This is used to create the right trim. % \changes{v0.43}{2017/11/07}{Fix: Multicolumn trim.} % \begin{macrocode} -\setcounter{LWR@lastmulticolumn}{\value{LWR@tableLaTeXcolindex}}% -\addtocounter{LWR@lastmulticolumn}{#3}% -\addtocounter{LWR@lastmulticolumn}{-1}% + \defcounter{LWR@lastmulticolumn}{\value{LWR@tableLaTeXcolindex}}% + \defaddtocounter{LWR@lastmulticolumn}{#3}% + \defaddtocounter{LWR@lastmulticolumn}{-1}% % \end{macrocode} % Row processing: % \begin{macrocode} -\LWR@maybenewtablerow% + \LWR@maybenewtablerow% % \end{macrocode} % Begin the opening table data tag: % \begin{macrocode} -\LWR@htmltag{td colspan="#4" % + \LWR@htmltag{% + td colspan="#4" % % \end{macrocode} % % \begin{macrocode} -\IfValueT{#2}{ % rows? -rowspan="#2" % + \IfValueT{#2}{ % rows? + rowspan="#2" % % \end{macrocode} % % \changes{v0.47}{2018/01/26}{Fix: Line wrap at \HTML\ hyphen.} % \begin{macrocode} -\IfValueT{#1}{% vpos? -\ifstrequal{#1}{b}{style="\LWR@print@mbox{vertical-align:bottom}" }{}% -\ifstrequal{#1}{t}{style="\LWR@print@mbox{vertical-align:top}" }{}% -}% vpos? -}% rows? + \IfValueT{#1}{% vpos? + \ifstrequal{#1}{b}% + {style="\LWR@print@mbox{vertical-align:bottom}" }{}% + \ifstrequal{#1}{t}% + {style="\LWR@print@mbox{vertical-align:top}" }{}% + }% vpos? + }% rows? % \end{macrocode} % % \begin{macrocode} - class="td% + class="td% % \end{macrocode} % Print the column type and vertical bars: % \begin{macrocode} -\setcounter{LWR@mcolvertbarsl}{0}% -\setcounter{LWR@mcolvertbarsr}{0}% -\setcounter{LWR@mcolvertbarsldash}{0}% -\setcounter{LWR@mcolvertbarsrdash}{0}% -\booltrue{LWR@mcolvertbaronleft}% -\LWR@parsemulticolumnalignment{#5}{\LWR@printmccoltype}% + \defcounter{LWR@mcolvertbarsl}{0}% + \defcounter{LWR@mcolvertbarsr}{0}% + \defcounter{LWR@mcolvertbarsldash}{0}% + \defcounter{LWR@mcolvertbarsrdash}{0}% + \booltrue{LWR@mcolvertbaronleft}% + \LWR@parsemulticolumnalignment{#5}{\LWR@printmccoltype}% % \end{macrocode} % If this column has a cmidrule, add ``rule'' to the end of the \HTML\ class tag. % % If this position had a ``Y'' then add ``rule'' for a horizontal rule: % \changes{v0.43}{2017/11/07}{Fix: Multicolumn trim.} % \begin{macrocode} -\LWR@subaddcmidruletrim% -{\LWR@getexparray{LWR@trimlrules}{\arabic{LWR@tableLaTeXcolindex}}}% -{\LWR@getexparray{LWR@trimrrules}{\arabic{LWR@lastmulticolumn}}}% + \LWR@subaddcmidruletrim% + {% + \LWR@getexparray{LWR@trimlrules}% + {\arabic{LWR@tableLaTeXcolindex}}% + }% + {% + \LWR@getexparray{LWR@trimrrules}% + {\arabic{LWR@lastmulticolumn}}% + }% % \end{macrocode} % Also add vertical bar class. % \changes{v0.41}{2017/10/07}{Added vertical rules.} @@ -28246,38 +28771,39 @@ rowspan="#2" % % \changes{v0.56}{2018/04/30}{Adds support for double vertical rules.} % \changes{v0.56}{2018/05/05}{Adds support for dashed vertical rules.} % \begin{macrocode} -\ifnumcomp{\value{LWR@mcolvertbarsl}}{=}{1}{ tvertbarl}{}% -\ifnumcomp{\value{LWR@mcolvertbarsl}}{>}{1}{ tvertbarldouble}{}% -\ifnumcomp{\value{LWR@mcolvertbarsr}}{=}{1}{ tvertbarr}{}% -\ifnumcomp{\value{LWR@mcolvertbarsr}}{>}{1}{ tvertbarrdouble}{}% -\ifnumcomp{\value{LWR@mcolvertbarsldash}}{=}{1}{ tvertbarldash}{}% -\ifnumcomp{\value{LWR@mcolvertbarsldash}}{>}{1}{ tvertbarldoubledash}{}% -\ifnumcomp{\value{LWR@mcolvertbarsrdash}}{=}{1}{ tvertbarrdash}{}% -\ifnumcomp{\value{LWR@mcolvertbarsrdash}}{>}{1}{ tvertbarrdoubledash}{}% + \ifnumcomp{\value{LWR@mcolvertbarsl}}{=}{1}{ tvertbarl}{}% + \ifnumcomp{\value{LWR@mcolvertbarsl}}{>}{1}{ tvertbarldouble}{}% + \ifnumcomp{\value{LWR@mcolvertbarsr}}{=}{1}{ tvertbarr}{}% + \ifnumcomp{\value{LWR@mcolvertbarsr}}{>}{1}{ tvertbarrdouble}{}% + \ifnumcomp{\value{LWR@mcolvertbarsldash}}{=}{1}{ tvertbarldash}{}% + \ifnumcomp{\value{LWR@mcolvertbarsldash}}{>}{1}% + { tvertbarldoubledash}{}% + \ifnumcomp{\value{LWR@mcolvertbarsrdash}}{=}{1}{ tvertbarrdash}{}% + \ifnumcomp{\value{LWR@mcolvertbarsrdash}}{>}{1}% + { tvertbarrdoubledash}{}% % \end{macrocode} % Close the class tag's opening quote: -"% NOT A TYPO % \begin{macrocode} -% + "% % \end{macrocode} % \changes{v0.42}{2017/10/26}{If \progcode{FormatWP} add cell alignment.} % \begin{macrocode} -\LWR@tdstartstyles% + \LWR@tdstartstyles% % \end{macrocode} % \changes{v0.49}{2018/02/18}{\pkg{xcolor}: Added tabular row colors.} % \begin{macrocode} -\LWR@addtabularrowcolor% + \LWR@addtabularrowcolor% % \end{macrocode} % \begin{macrocode} -\LWR@addcmidrulewidth% -\LWR@addcdashline% -\LWR@addtabularhrulecolor% -\LWR@addmulticolvertrulecolor% -\LWR@addformatwpalignment{#5}% -\LWR@tdendstyles% -}% end of the opening table data tag -\global\boolfalse{LWR@intabularmetadata}% -\LWR@parsemulticolumnalignment{#5}{\LWR@printmccoldata}% + \LWR@addcmidrulewidth% + \LWR@addcdashline% + \LWR@addtabularhrulecolor% + \LWR@addmulticolvertrulecolor% + \LWR@addformatwpalignment{#5}% + \LWR@tdendstyles% + }% end of the opening table data tag + \boolfalse{LWR@intabularmetadata}% + \LWR@parsemulticolumnalignment{#5}{\LWR@printmccoldata}% } % \end{macrocode} % \end{macro} @@ -28292,20 +28818,20 @@ rowspan="#2" % % \end{macrocode} % Figure out how many extra \HTML\ columns to add for |@| and |!| columns: % \begin{macrocode} -\LWR@tabularhtmlcolumns{\arabic{LWR@tableLaTeXcolindex}}{#1} + \LWR@tabularhtmlcolumns{\arabic{LWR@tableLaTeXcolindex}}{#1}% % \end{macrocode} % Create the multicolumn tag: % \begin{macrocode} -\LWR@domulticolumn{#1}{\arabic{LWR@tabhtmlcoltotal}}{#2}{#3}% + \LWR@domulticolumn{#1}{\arabic{LWR@tabhtmlcoltotal}}{#2}{#3}% % \end{macrocode} % Move to the next \LaTeX\ column: % \begin{macrocode} -\addtocounter{LWR@tableLaTeXcolindex}{#1}% -\addtocounter{LWR@tableLaTeXcolindex}{-1}% + \defaddtocounter{LWR@tableLaTeXcolindex}{#1}% + \defaddtocounter{LWR@tableLaTeXcolindex}{-1}% % \end{macrocode} % Skip any trailing |@| or |!| columns for this cell: % \begin{macrocode} -\global\booltrue{LWR@skipatbang}% + \booltrue{LWR@skipatbang}% } % \end{macrocode} % \end{macro} @@ -28317,14 +28843,6 @@ rowspan="#2" % % % \pkg{longtable} captions use \cs{multicolumn}. -% \DescribeBoolean{LWR@starredlongtable} -% Per the \pkg{caption} pacakge, step the counter if |longtable*|. -% -% \begin{macrocode} -\newbool{LWR@starredlongtable} -\boolfalse{LWR@starredlongtable} -% \end{macrocode} -% % % Per the \pkg{caption} package. User-redefinable float type. % \begin{macrocode} @@ -28342,109 +28860,108 @@ rowspan="#2" % % \end{macrocode} % Remember the latest name for \cs{nameref}: % \begin{macrocode} -\IfValueTF{#2}{% optional given? - \ifblank{#2}% optional empty? - {\LWR@setlatestname{#3}}% empty - {\LWR@setlatestname{#2}}% given and non-empty -}% optional given -{\LWR@setlatestname{#3}}% no optional + \IfValueTF{#2}{% optional given? + \ifblank{#2}% optional empty? + {\LWR@setlatestname{#3}}% empty + {\LWR@setlatestname{#2}}% given and non-empty + }% optional given + {\LWR@setlatestname{#3}}% no optional % \end{macrocode} % Create a multicolumn across all the columns: % % Figure out how many extra \HTML\ columns to add for |@| and |!| columns % found between the first and the last column: % \begin{macrocode} -\LWR@tabularhtmlcolumns{1}{\arabic{LWR@tabletotalLaTeXcols}} + \LWR@tabularhtmlcolumns{1}{\arabic{LWR@tabletotalLaTeXcols}}% % \end{macrocode} % Create the multicolumn tag: % \begin{macrocode} -\LWR@domulticolumn{\arabic{LWR@tabletotalLaTeXcols}}% - {\arabic{LWR@tabhtmlcoltotal}}% - {P}% -{% \LWR@domulticolumn -\IfBooleanTF{#1}% star? + \LWR@domulticolumn{\arabic{LWR@tabletotalLaTeXcols}}% + {\arabic{LWR@tabhtmlcoltotal}}% + {P}% + {% \LWR@domulticolumn + \IfBooleanTF{#1}% star? % \end{macrocode} % Star version, show a caption but do not make a LOT entry: % \begin{macrocode} -{% yes star - \LWR@figcaption% - \LWR@isolate{#3}% - \endLWR@figcaption% -}% -{% No star: + {% yes star + \LWR@figcaption% + \LWR@isolate{#3}% + \endLWR@figcaption% + }% + {% No star: % \end{macrocode} % Not the star version: % % Don't step the counter if |\caption[]{A caption.}| % \begin{macrocode} - \ifbool{LWR@starredlongtable}% - {% - \ifblank{#2}% TOC entry - {}% + \ifbool{LWR@starredlongtable}% {% - \refstepcounter{\LTcaptype}% - \protected@edef\@currentlabel{% - \@nameuse{p@\LTcaptype}\@nameuse{the\LTcaptype}% + \ifblank{#2}% TOC entry + {}% + {% + \refstepcounter{\LTcaptype}% + \protected@edef\@currentlabel{% + \@nameuse{p@\LTcaptype}\@nameuse{the\LTcaptype}% + }% }% - }% - }{}% + }{}% % \end{macrocode} % Create an \HTML\ caption. Afterwards, maybe make a LOT entry. % \begin{macrocode} - \LWR@figcaption% - \LWR@isolate{\@nameuse{fnum@\LTcaptype}}% - \CaptionSeparator% - \LWR@isolate{#3}% - \endLWR@figcaption% + \LWR@figcaption% + \LWR@isolate{\@nameuse{fnum@\LTcaptype}}% + \CaptionSeparator% + \LWR@isolate{#3}% + \endLWR@figcaption% % \end{macrocode} % See if an optional caption was given: % \begin{macrocode} - \ifblank{#2}% TOC entry empty + \ifblank{#2}% TOC entry empty % \end{macrocode} % if the optional caption was given, but empty, do not form a \TOC\ entry % \begin{macrocode} - {}% + {}% % \end{macrocode} % If the optional caption was given, but might only be |[]|: % \begin{macrocode} - {% TOC entry not empty - \IfNoValueTF{#2}% No TOC entry? + {% TOC entry not empty + \IfNoValueTF{#2}% No TOC entry? % \end{macrocode} % The optional caption is |[]|: % \begin{macrocode} - {% No TOC entry - \addcontentsline% - {\@nameuse{ext@\LTcaptype}}% - {\LTcaptype}% - {% - \protect\numberline% - {\LWR@isolate{\@nameuse{p@\LTcaptype}}\@nameuse{the\LTcaptype}}% - {\ignorespaces \LWR@isolate{#3}\protect\relax}% - }% - }% end of No TOC entry + {% No TOC entry + \addcontentsline% + {\@nameuse{ext@\LTcaptype}}% + {\LTcaptype}% + {% + \protect\numberline% + {\LWR@isolate{\@nameuse{p@\LTcaptype}}\@nameuse{the\LTcaptype}}% + {\ignorespaces \LWR@isolate{#3}\protect\relax}% + }% + }% end of No TOC entry % \end{macrocode} % The optional caption has text enclosed: % \begin{macrocode} - {% yes TOC entry - \addcontentsline% - {\@nameuse{ext@\LTcaptype}}% - {\LTcaptype}% - {% - \protect\numberline% - {\LWR@isolate{\@nameuse{p@\LTcaptype}}\@nameuse{the\LTcaptype}}% - {\ignorespaces \LWR@isolate{#2}\protect\relax}% - }% - }% end of yes TOC entry - }% end of TOC entry not empty -}% end of no star + {% yes TOC entry + \addcontentsline% + {\@nameuse{ext@\LTcaptype}}% + {\LTcaptype}% + {% + \protect\numberline% + {\LWR@isolate{\@nameuse{p@\LTcaptype}}\@nameuse{the\LTcaptype}}% + {\ignorespaces \LWR@isolate{#2}\protect\relax}% + }% + }% end of yes TOC entry + }% end of TOC entry not empty + }% end of no star % \end{macrocode} % Skip any trailing |@| or |!| columns for this cell: % \begin{macrocode} -\global\booltrue{LWR@skipatbang}% -}% end of \LWR@domulticolumn - -\addtocounter{LWR@tableLaTeXcolindex}{\arabic{LWR@tabletotalLaTeXcols}} -\addtocounter{LWR@tableLaTeXcolindex}{-1} + \booltrue{LWR@skipatbang}% + }% end of \LWR@domulticolumn + \defaddtocounter{LWR@tableLaTeXcolindex}{\value{LWR@tabletotalLaTeXcols}}% + \defaddtocounter{LWR@tableLaTeXcolindex}{-1} } % \end{macrocode} @@ -28486,14 +29003,14 @@ rowspan="#2" % % \begin{macrocode} \ifdefempty{\LWR@atbangspec}% {}% - {\addtocounter{LWR@tabhtmlcoltotal}{1}}% + {\defaddtocounter{LWR@tabhtmlcoltotal}{1}}% % \end{macrocode} % Likewise for the |!| columns: % \begin{macrocode} \edef\LWR@atbangspec{\LWR@getexparray{LWR@colbangspec}{#1}}% \ifdefempty{\LWR@atbangspec}% {}% - {\addtocounter{LWR@tabhtmlcoltotal}{1}}% + {\defaddtocounter{LWR@tabhtmlcoltotal}{1}}% } % \end{macrocode} % \end{macro} @@ -28512,28 +29029,28 @@ rowspan="#2" % % and begin with the count being the \LaTeX\ span, to which additional |@| and |!| % columns may be added: % \begin{macrocode} -\setcounter{LWR@tabhtmlcolindex}{#1}% -\setcounter{LWR@tabhtmlcoltotal}{#2}% -\setcounter{LWR@tabhtmlcolend}{#1}% -\addtocounter{LWR@tabhtmlcolend}{#2}% + \defcounter{LWR@tabhtmlcolindex}{#1}% + \defcounter{LWR@tabhtmlcoltotal}{#2}% + \defcounter{LWR@tabhtmlcolend}{#1}% + \defaddtocounter{LWR@tabhtmlcolend}{#2}% % \end{macrocode} % If at the left edge, add the at/bang columns for the left edge: % \begin{macrocode} -\ifnumcomp{\value{LWR@tabhtmlcolindex}}{=}{1}{% - \LWR@subtabularhtmlcolumns{leftedge}% -}{}% + \ifnumcomp{\value{LWR@tabhtmlcolindex}}{=}{1}{% + \LWR@subtabularhtmlcolumns{leftedge}% + }{}% % \end{macrocode} % Walk across the \LaTeX\ columns looking for |@| and |!| columns: % \begin{macrocode} -\whileboolexpr{% - test {% - \ifnumcomp{\value{LWR@tabhtmlcolindex}}{<}{\value{LWR@tabhtmlcolend}}% + \whileboolexpr{% + test {% + \ifnumcomp{\value{LWR@tabhtmlcolindex}}{<}{\value{LWR@tabhtmlcolend}}% + }% }% -}% -{% - \LWR@subtabularhtmlcolumns{\arabic{LWR@tabhtmlcolindex}}% - \addtocounter{LWR@tabhtmlcolindex}{1}% -}% whiledo + {% + \LWR@subtabularhtmlcolumns{\arabic{LWR@tabhtmlcolindex}}% + \defaddtocounter{LWR@tabhtmlcolindex}{1}% + }% whiledo } % \end{macrocode} % \end{macro} @@ -28721,9 +29238,9 @@ rowspan="#2" % % \begin{macrocode} \newcommand*{\ResumeTabular}{% -\global\boolfalse{LWR@exitingtabular}% -\global\boolfalse{LWR@tabularmutemods}% -\LWR@getmynexttoken% + \boolfalse{LWR@exitingtabular}% + \boolfalse{LWR@tabularmutemods}% + \LWR@getmynexttoken% } % \end{macrocode} % \end{macro} @@ -28758,20 +29275,6 @@ rowspan="#2" % % \end{macrocode} -% \DescribeBoolean{LWR@exitingtabular} -% When \cs{end} is found, turns off the next opening data tag. -% \begin{macrocode} -\newbool{LWR@exitingtabular} -% \end{macrocode} - - -% \DescribeBoolean{LWR@tabularmutemods} -% Mutes \HTML\ output for |@|, |!|, |<| and |>|. -% -% This is used while printing the final row to generate \cs{bottomrule}s. -% \begin{macrocode} -\newbool{LWR@tabularmutemods} -% \end{macrocode} @@ -28786,141 +29289,141 @@ rowspan="#2" % % \begin{macrocode} \newcommand*{\LWR@tabledatacolumntag}% {% -\LWR@traceinfo{LWR@tabledatacolumntag}% + \LWR@traceinfo{LWR@tabledatacolumntag}% % \end{macrocode} % \hspace*{.5in} |\show\LWR@mynexttoken| to see what tokens to look for % \begin{macrocode} % \end{macrocode} % If not any of the below, start a new table cell: % \begin{macrocode} -\global\let\LWR@mynextaction\LWR@tabledatasinglecolumntag% + \global\let\LWR@mynextaction\LWR@tabledatasinglecolumntag% % \end{macrocode} % If exiting the tabular: % \begin{macrocode} -\ifdefequal{\LWR@mynexttoken}{\end}% - {\global\booltrue{LWR@exitingtabular}}{}% + \ifdefequal{\LWR@mynexttoken}{\end}% + {\booltrue{LWR@exitingtabular}}{}% % \end{macrocode} % \env{longtable} can have a caption in a cell % \begin{macrocode} -\ifdefequal{\LWR@mynexttoken}{\caption}% - {\global\let\LWR@mynextaction\LWR@donothing}{}% + \ifdefequal{\LWR@mynexttoken}{\caption}% + {\global\let\LWR@mynextaction\LWR@donothing}{}% % \end{macrocode} % Look for other things which would not start a table cell: % \begin{macrocode} -\ifdefequal{\LWR@mynexttoken}{\multicolumn}% - {\global\let\LWR@mynextaction\LWR@donothing}{}% -\ifdefequal{\LWR@mynexttoken}{\multirow}% - {\global\let\LWR@mynextaction\LWR@donothing}{}% -\ifdefequal{\LWR@mynexttoken}{\multicolumnrow}% - {\global\let\LWR@mynextaction\LWR@donothing}{}% -\ifdefequal{\LWR@mynexttoken}{\noalign}% - {\global\let\LWR@mynextaction\LWR@donothing}{}% + \ifdefequal{\LWR@mynexttoken}{\multicolumn}% + {\global\let\LWR@mynextaction\LWR@donothing}{}% + \ifdefequal{\LWR@mynexttoken}{\multirow}% + {\global\let\LWR@mynextaction\LWR@donothing}{}% + \ifdefequal{\LWR@mynexttoken}{\multicolumnrow}% + {\global\let\LWR@mynextaction\LWR@donothing}{}% + \ifdefequal{\LWR@mynexttoken}{\noalign}% + {\global\let\LWR@mynextaction\LWR@donothing}{}% % \end{macrocode} % If an \cs{mrowcell}, this is a cell to be skipped over: % \begin{macrocode} -\ifdefequal{\LWR@mynexttoken}{\mrowcell}% - {\global\let\LWR@mynextaction\LWR@donothing}{}% + \ifdefequal{\LWR@mynexttoken}{\mrowcell}% + {\global\let\LWR@mynextaction\LWR@donothing}{}% % \end{macrocode} % If an \cs{mcolrowcell}, this is a cell to be skipped over: % \begin{macrocode} -\ifdefequal{\LWR@mynexttoken}{\mcolrowcell}% - {\global\let\LWR@mynextaction\LWR@donothing}{}% + \ifdefequal{\LWR@mynexttoken}{\mcolrowcell}% + {\global\let\LWR@mynextaction\LWR@donothing}{}% % \end{macrocode} % \begin{macrocode} -\ifdefequal{\LWR@mynexttoken}{\TabularMacro}% - {\global\let\LWR@mynextaction\LWR@donothing}{}% + \ifdefequal{\LWR@mynexttoken}{\TabularMacro}% + {\global\let\LWR@mynextaction\LWR@donothing}{}% % \end{macrocode} % \begin{macrocode} -\ifdefequal{\LWR@mynexttoken}{\hline}% - {\global\let\LWR@mynextaction\LWR@donothing}{}% + \ifdefequal{\LWR@mynexttoken}{\hline}% + {\global\let\LWR@mynextaction\LWR@donothing}{}% % \end{macrocode} % \begin{macrocode} -\ifdefequal{\LWR@mynexttoken}{\firsthline}% - {\global\let\LWR@mynextaction\LWR@donothing}{}% + \ifdefequal{\LWR@mynexttoken}{\firsthline}% + {\global\let\LWR@mynextaction\LWR@donothing}{}% % \end{macrocode} % \begin{macrocode} -\ifdefequal{\LWR@mynexttoken}{\lasthline}% - {\global\let\LWR@mynextaction\LWR@donothing}{}% + \ifdefequal{\LWR@mynexttoken}{\lasthline}% + {\global\let\LWR@mynextaction\LWR@donothing}{}% % \end{macrocode} % \begin{macrocode} -\ifdefequal{\LWR@mynexttoken}{\toprule}% - {\global\let\LWR@mynextaction\LWR@donothing}{}% + \ifdefequal{\LWR@mynexttoken}{\toprule}% + {\global\let\LWR@mynextaction\LWR@donothing}{}% % \end{macrocode} % \begin{macrocode} -\ifdefequal{\LWR@mynexttoken}{\midrule}% - {\global\let\LWR@mynextaction\LWR@donothing}{}% + \ifdefequal{\LWR@mynexttoken}{\midrule}% + {\global\let\LWR@mynextaction\LWR@donothing}{}% % \end{macrocode} % \begin{macrocode} -\ifdefequal{\LWR@mynexttoken}{\cmidrule}% - {\global\let\LWR@mynextaction\LWR@donothing}{}% + \ifdefequal{\LWR@mynexttoken}{\cmidrule}% + {\global\let\LWR@mynextaction\LWR@donothing}{}% % \end{macrocode} % \changes{v0.56}{2018/05/02}{Fix: \cs{morecmidrules}} % \begin{macrocode} -\ifdefequal{\LWR@mynexttoken}{\morecmidrules}% - {\global\let\LWR@mynextaction\LWR@donothing}{}% + \ifdefequal{\LWR@mynexttoken}{\morecmidrules}% + {\global\let\LWR@mynextaction\LWR@donothing}{}% % \end{macrocode} % \begin{macrocode} -\ifdefequal{\LWR@mynexttoken}{\specialrule}% - {\global\let\LWR@mynextaction\LWR@donothing}{}% + \ifdefequal{\LWR@mynexttoken}{\specialrule}% + {\global\let\LWR@mynextaction\LWR@donothing}{}% % \end{macrocode} % \begin{macrocode} -\ifdefequal{\LWR@mynexttoken}{\cline}% - {\global\let\LWR@mynextaction\LWR@donothing}{}% + \ifdefequal{\LWR@mynexttoken}{\cline}% + {\global\let\LWR@mynextaction\LWR@donothing}{}% % \end{macrocode} % \begin{macrocode} -\ifdefequal{\LWR@mynexttoken}{\bottomrule}% - {\global\let\LWR@mynextaction\LWR@donothing}{}% + \ifdefequal{\LWR@mynexttoken}{\bottomrule}% + {\global\let\LWR@mynextaction\LWR@donothing}{}% % \end{macrocode} % \begin{macrocode} -\ifdefequal{\LWR@mynexttoken}{\rowcolor}% - {\global\let\LWR@mynextaction\LWR@donothing}{}% + \ifdefequal{\LWR@mynexttoken}{\rowcolor}% + {\global\let\LWR@mynextaction\LWR@donothing}{}% % \end{macrocode} % \begin{macrocode} -\ifdefequal{\LWR@mynexttoken}{\arrayrulecolor}% - {\global\let\LWR@mynextaction\LWR@donothing}{}% + \ifdefequal{\LWR@mynexttoken}{\arrayrulecolor}% + {\global\let\LWR@mynextaction\LWR@donothing}{}% % \end{macrocode} % \begin{macrocode} -\ifdefequal{\LWR@mynexttoken}{\doublerulesepcolor}% - {\global\let\LWR@mynextaction\LWR@donothing}{}% + \ifdefequal{\LWR@mynexttoken}{\doublerulesepcolor}% + {\global\let\LWR@mynextaction\LWR@donothing}{}% % \end{macrocode} % \begin{macrocode} -\ifdefequal{\LWR@mynexttoken}{\warpprintonly}% - {\global\let\LWR@mynextaction\LWR@donothing}{}% + \ifdefequal{\LWR@mynexttoken}{\warpprintonly}% + {\global\let\LWR@mynextaction\LWR@donothing}{}% % \end{macrocode} % \begin{macrocode} -\ifdefequal{\LWR@mynexttoken}{\warpHTMLonly}% - {\global\let\LWR@mynextaction\LWR@donothing}{}% + \ifdefequal{\LWR@mynexttoken}{\warpHTMLonly}% + {\global\let\LWR@mynextaction\LWR@donothing}{}% % \end{macrocode} % \begin{macrocode} -\ifdefequal{\LWR@mynexttoken}{\ldelim}% - {\global\let\LWR@mynextaction\LWR@donothing}{}% + \ifdefequal{\LWR@mynexttoken}{\ldelim}% + {\global\let\LWR@mynextaction\LWR@donothing}{}% % \end{macrocode} % \begin{macrocode} -\ifdefequal{\LWR@mynexttoken}{\rdelim}% - {\global\let\LWR@mynextaction\LWR@donothing}{}% + \ifdefequal{\LWR@mynexttoken}{\rdelim}% + {\global\let\LWR@mynextaction\LWR@donothing}{}% % \end{macrocode} % For \pkg{arydshln}: % \begin{macrocode} -\ifdefequal{\LWR@mynexttoken}{\hdashline}% - {\global\let\LWR@mynextaction\LWR@donothing}{}% + \ifdefequal{\LWR@mynexttoken}{\hdashline}% + {\global\let\LWR@mynextaction\LWR@donothing}{}% % \end{macrocode} % \begin{macrocode} -\ifdefequal{\LWR@mynexttoken}{\cdashline}% - {\global\let\LWR@mynextaction\LWR@donothing}{}% + \ifdefequal{\LWR@mynexttoken}{\cdashline}% + {\global\let\LWR@mynextaction\LWR@donothing}{}% % \end{macrocode} % \begin{macrocode} -\ifdefequal{\LWR@mynexttoken}{\firsthdashline}% - {\global\let\LWR@mynextaction\LWR@donothing}{}% + \ifdefequal{\LWR@mynexttoken}{\firsthdashline}% + {\global\let\LWR@mynextaction\LWR@donothing}{}% % \end{macrocode} % \begin{macrocode} -\ifdefequal{\LWR@mynexttoken}{\lasthdashline}% - {\global\let\LWR@mynextaction\LWR@donothing}{}% + \ifdefequal{\LWR@mynexttoken}{\lasthdashline}% + {\global\let\LWR@mynextaction\LWR@donothing}{}% % \end{macrocode} % Ignore an empty line between rows: % \changes{v0.45}{2017/12/06}{Fix: Empty line between rows.} % \begin{macrocode} -\ifdefequal{\LWR@mynexttoken}{\par}% - {\global\let\LWR@mynextaction\LWR@donothing}{}% + \ifdefequal{\LWR@mynexttoken}{\par}% + {\global\let\LWR@mynextaction\LWR@donothing}{}% % \end{macrocode} % % No action for an \cs{end} token. @@ -28930,9 +29433,9 @@ rowspan="#2" % % % Start the new table cell if was not any of the above: % \begin{macrocode} -\LWR@traceinfo{LWR@tabledatacolumntag: about to do mynext}% -\LWR@mynextaction% -\LWR@traceinfo{LWR@tabledatacolumntag: done}% + \LWR@traceinfo{LWR@tabledatacolumntag: about to do mynext}% + \LWR@mynextaction% + \LWR@traceinfo{LWR@tabledatacolumntag: done}% } % \end{macrocode} % \end{macro} @@ -28996,43 +29499,37 @@ rowspan="#2" % % % These are default defininitions in case \pkg{booktabs} is not loaded, % and are not expected to used, but must exist as placeholders. -% They are pre-deleted in case \pkg{memoir} has already loaded \pkg{booktabs}. +% \pkg{memoir} may have already loaded \pkg{booktabs}. % % \changes{v0.34}{2017/08/08}{\pkg{booktabs}: Works inside \env{lateximage}.} % \changes{v0.58}{2018/06/21}{\pkg{memoir}: Fix for \pkg{booktabs}.} +% \changes{v0.79}{2019/12/09}{\pkg{booktabs}: Fix for \pkg{memoir} with \env{lateximage}.} % \begin{macrocode} -\LetLtxMacro\toprule\relax -\LetLtxMacro\midrule\relax -\LetLtxMacro\cmidrule\cline -\LetLtxMacro\bottomrule\relax -\LetLtxMacro\addlinespace\relax -\LetLtxMacro\morecmidrules\relax -\LetLtxMacro\specialrule\relax - -\newcommand*{\toprule}[1][]{\hline} -\newcommand*{\midrule}[1][]{\hline} -\LetLtxMacro\cmidrule\cline -\newcommand*{\bottomrule}[1][]{\hline} -\newcommand*{\addlinespace}[1][]{} -\newcommand*{\morecmidrules}{} -\newcommand*{\specialrule}[3]{\hline} +\providecommand*{\toprule}[1][]{\hline} +\providecommand*{\midrule}[1][]{\hline} +\providecommand*{\cmidrule}{\cline} +\providecommand*{\bottomrule}[1][]{\hline} +\providecommand*{\addlinespace}[1][]{} +\providecommand*{\morecmidrules}{} +\providecommand*{\specialrule}[3]{\hline} % \end{macrocode} % % % \begin{macro}{\noalign} \marg{text} % Redefined for use inside \env{tabular}. % \changes{v0.49}{2018/02/18}{Fix: \cs{noalign} inside \env{tabular}.} +% \changes{v0.79}{2020/01/18}{Fix: Nested \env{tabular}s.} % \begin{macrocode} \LetLtxMacro\LWR@orignoalign\noalign \newcommand{\LWR@tabularnoalign}[1]{% -\begingroup% -\global\advance\rownum\m@ne% -\renewcommand*{\LWR@xcolorrowHTMLcolor}{}% -\multicolumn{\value{LWR@tabletotalLaTeXcols}}{l}{#1} \\ -\endgroup% -% \@rowc@lors% -\LWR@getmynexttoken% + \advance\rownum\m@ne% + \LetLtxMacro\LWR@save@xcolorrowHTMLcolor\LWR@xcolorrowHTMLcolor% + \renewcommand*{\LWR@xcolorrowHTMLcolor}{}% + \multicolumn{\value{LWR@tabletotalLaTeXcols}}{l}{#1} \\ + \LetLtxMacro\LWR@xcolorrowHTMLcolor\LWR@save@xcolorrowHTMLcolor% + % \@rowc@lors% + \LWR@getmynexttoken% } % \end{macrocode} % \end{macro} @@ -29046,21 +29543,23 @@ rowspan="#2" % % % \begin{macrocode} \AtBeginDocument{ + \@ifpackageloaded{lwarp-tabls} { -\newcommand*{\LWR@HTMLhline}[1][]{% - \ifbool{FormatWP}% - {\LWR@docmidrule{1-\arabic{LWR@tabletotalLaTeXcols}}}% - {\addtocounter{LWR@hlines}{1}}% - \LWR@getmynexttoken}% + \newcommand*{\LWR@HTMLhline}[1][]{% + \ifbool{FormatWP}% + {\LWR@docmidrule{1-\arabic{LWR@tabletotalLaTeXcols}}}% + {\defaddtocounter{LWR@hlines}{1}}% + \LWR@getmynexttoken}% } { -\newcommand*{\LWR@HTMLhline}{% - \ifbool{FormatWP}% - {\LWR@docmidrule{1-\arabic{LWR@tabletotalLaTeXcols}}}% - {\addtocounter{LWR@hlines}{1}}% - \LWR@getmynexttoken}% + \newcommand*{\LWR@HTMLhline}{% + \ifbool{FormatWP}% + {\LWR@docmidrule{1-\arabic{LWR@tabletotalLaTeXcols}}}% + {\defaddtocounter{LWR@hlines}{1}}% + \LWR@getmynexttoken}% } + }% AtBeginDocument % \end{macrocode} % \end{macro} @@ -29069,7 +29568,7 @@ rowspan="#2" % % \begin{macro}{\LWR@HTMLcline} \marg{columns} % \begin{macrocode} \NewDocumentCommand{\LWR@HTMLcline}{m}% -{\LWR@docmidrule{#1}\LWR@getmynexttoken}% + {\LWR@docmidrule{#1}\LWR@getmynexttoken}% % \end{macrocode} % \end{macro} @@ -29129,8 +29628,9 @@ rowspan="#2" % \NewDocumentCommand{\LWR@HTML@@tabular}{d<> o m} {% -\LWR@traceinfo{LWR@HTML@@tabular started}% + \LWR@traceinfo{LWR@HTML@@tabular started}% % \end{macrocode} +% % In \LaTeX, a \env{tabular} may be placed inside a \env{minipage}, % \watchout[\element{table} inside \element{span}] % but in \HTML\ a \element{table} may not be inside a \element{span}. @@ -29146,28 +29646,28 @@ rowspan="#2" % % a warning is issued here instructing the user to please isolate the \element{span} % to print-only. % \begin{macrocode} -\ifnumcomp{\value{LWR@spandepth}}{>}{0}{% - \PackageWarning{lwarp}{% - A tabular is being used inside a span such as\MessageBreak - a minipage. Some formatting may not be correct\MessageBreak - in the tabular.\MessageBreak - It is recommended to use \protect\warpprintonly\space or the\MessageBreak - warpprint environment to isolate the span to\MessageBreak - print-only,% - } -}{}% -\addtocounter{LWR@tabulardepth}{1}% + \ifnumcomp{\value{LWR@spandepth}}{>}{0}{% + \PackageWarning{lwarp}{% + A tabular is being used inside a span such as\MessageBreak + a minipage. Some formatting may not be correct\MessageBreak + in the tabular.\MessageBreak + It is recommended to use \protect\warpprintonly\space or the\MessageBreak + warpprint environment to isolate the span to\MessageBreak + print-only,% + } + }{}% + \addtocounter{LWR@tabulardepth}{1}% % \end{macrocode} % Not yet started a table row: % \begin{macrocode} -\global\boolfalse{LWR@startedrow}% + \boolfalse{LWR@startedrow}% % \end{macrocode} % Not yet doing any rules: % \begin{macrocode} -\setcounter{LWR@hlines}{0}% -\setcounter{LWR@hdashedlines}{0}% -\global\boolfalse{LWR@doingtbrule}% -\global\boolfalse{LWR@doingcmidrule}% + \defcounter{LWR@hlines}{0}% + \defcounter{LWR@hdashedlines}{0}% + \boolfalse{LWR@doingtbrule}% + \boolfalse{LWR@doingcmidrule}% % \end{macrocode} % % For \pkg{babel-french}, turn off auto spacing one time, then nullify @@ -29176,73 +29676,79 @@ rowspan="#2" % % \changes{v0.41}{2017/10/06}{Fix: \cs{NoAutoSpacing} in a tabular % with \pkg{babel-french}.} % \begin{macrocode} -\LWR@nullifyNoAutoSpacing% + \LWR@nullifyNoAutoSpacing% % \end{macrocode} % % Have not yet found the end of tabular command. % Unmute the |@| and |!| columns. % \begin{macrocode} -\global\boolfalse{LWR@exitingtabular}% -\global\boolfalse{LWR@tabularmutemods}% + \boolfalse{LWR@exitingtabular}% + \boolfalse{LWR@tabularmutemods}% % \end{macrocode} % % Error if failed to use \cs{mrowcell} or \cs{mcolrowcell} when needed. % \changes{v0.69}{2019/03/07}{Error if \cs{multirow} without \cs{mrowcell}.} % \begin{macrocode} -\boolfalse{LWR@usedmultirow} -\boolfalse{LWR@foundmrowcell} + \boolfalse{LWR@usedmultirow}% + \boolfalse{LWR@foundmrowcell}% +% \end{macrocode} +% +% +% \begin{macrocode} + \renewcommand*{\LWR@multicoltext}{}% % \end{macrocode} % % Create the |table| tag: % \begin{macrocode} -\global\booltrue{LWR@intabularmetadata}% -\LWR@traceinfo{LWR@@tabular: About to LWR@forecenewpage.}% -\LWR@forcenewpage -\LWR@htmlblocktag{table}% + \booltrue{LWR@intabularmetadata}% + \LWR@traceinfo{LWR@@tabular: About to LWR@forecenewpage.}% + \LWR@forcenewpage + \LWR@htmlblocktag{table}% % \end{macrocode} % Parse the table columns: % \begin{macrocode} -\LWR@parsetablecols{#3}% + \LWR@parsetablecols{#3}% % \end{macrocode} % % Table col spec is: \cs{LWR@tablecolspec} which is a string of |llccrr|, etc. % % Do not place the table inside a paragraph: % \begin{macrocode} -\LWR@stoppars% + \LWR@stoppars% % \end{macrocode} % Track column \#: % \begin{macrocode} -\setcounter{LWR@tableLaTeXcolindex}{1}% + \defcounter{LWR@tableLaTeXcolindex}{1}% % \end{macrocode} % Have not yet added data in this column: % \begin{macrocode} -\global\boolfalse{LWR@tabularcelladded}% + \global\boolfalse{LWR@tabularcelladded}% % \end{macrocode} % Start looking for midrules: % \begin{macrocode} -\LWR@clearmidrules% + \LWR@clearmidrules% % \end{macrocode} % |\\| becomes a macro to end the table row: % \begin{macrocode} -\LetLtxMacro{\\}{\LWR@tabularendofline}% + \LetLtxMacro{\\}{\LWR@tabularendofline}% % \end{macrocode} % % \cs{warpprintonly} inside a \env{tabular} must grab the next token. % \changes{v0.68}{2019/03/01}{Fix: \cs{warpprintonly} inside \env{tabular}.} % \begin{macrocode} -\LetLtxMacro\warpprintonly\LWR@tabular@warpprintonly% + \LetLtxMacro\warpprintonly\LWR@tabular@warpprintonly% % \end{macrocode} % % The following adjust for \pkg{colortbl}. % \changes{v0.48}{2018/02/06}{\pkg{colortbl}: Added.} +% \changes{v0.79}{2020/01/18}{\pkg{colortbl}: Fix: Nested \env{tabular}s.} % \begin{macrocode} -\LetLtxMacro\arrayrulecolor\arrayrulecolornexttoken% -\LetLtxMacro\doublerulesepcolor\doublerulesepcolornexttoken% -\gdef\LWR@columnHTMLcolor{}% -\gdef\LWR@rowHTMLcolor{}% -\gdef\LWR@cellHTMLcolor{}% -\@rowcolors% + \LetLtxMacro\arrayrulecolor\arrayrulecolornexttoken% + \LetLtxMacro\doublerulesepcolor\doublerulesepcolornexttoken% + \def\LWR@columnHTMLcolor{}% + \def\LWR@rowHTMLcolor{}% + \def\LWR@cellHTMLcolor{}% + \@rowcolors% % \end{macrocode} % % The vertical rules are set to the color active at the start of the tabular. @@ -29250,14 +29756,14 @@ rowspan="#2" % % but not the vertical rules. % \changes{v0.65}{2018/12/19}{Fix: Rule color.} % \begin{macrocode} -\ifdefvoid{\LWR@ruleHTMLcolor}% - {\edef\LWR@vertruleHTMLcolor{black}}% - {\edef\LWR@vertruleHTMLcolor{\LWR@origpound\LWR@ruleHTMLcolor}}% + \ifdefvoid{\LWR@ruleHTMLcolor}% + {\edef\LWR@vertruleHTMLcolor{black}}% + {\edef\LWR@vertruleHTMLcolor{\LWR@origpound\LWR@ruleHTMLcolor}}% % \end{macrocode} % % Tracking the depth of cell color \element{div}s: % \begin{macrocode} -\setcounter{LWR@cellcolordepth}{0}% + \defcounter{LWR@cellcolordepth}{0}% % \end{macrocode} % % The following may appear before a data cell is created, @@ -29266,86 +29772,86 @@ rowspan="#2" % % % The optional parameter for \cs{hline} supports the \pkg{tabls} package. % \begin{macrocode} -\LWR@traceinfo{LWR@@HTML@tabular: redefining macros}% -\LetLtxMacro\noalign\LWR@tabularnoalign% -\LetLtxMacro\hline\LWR@HTMLhline% -\LetLtxMacro\cline\LWR@HTMLcline% + \LWR@traceinfo{LWR@@HTML@tabular: redefining macros}% + \LetLtxMacro\noalign\LWR@tabularnoalign% + \LetLtxMacro\hline\LWR@HTMLhline% + \LetLtxMacro\cline\LWR@HTMLcline% % \end{macrocode} % \begin{macrocode} -\DeclareDocumentCommand{\hdashline}{o}{% - \ifbool{FormatWP}% - {\LWR@docdashline{1-\arabic{LWR@tabletotalLaTeXcols}}}% - {\addtocounter{LWR@hdashedlines}{1}}% - \LWR@getmynexttoken% -}% + \DeclareDocumentCommand{\hdashline}{o}{% + \ifbool{FormatWP}% + {\LWR@docdashline{1-\arabic{LWR@tabletotalLaTeXcols}}}% + {\defaddtocounter{LWR@hdashedlines}{1}}% + \LWR@getmynexttoken% + }% % \end{macrocode} % \begin{macrocode} -\DeclareDocumentCommand{\cdashline}{m}{% - \LWR@docdashline{##1}\LWR@getmynexttoken% -}% + \DeclareDocumentCommand{\cdashline}{m}{% + \LWR@docdashline{##1}\LWR@getmynexttoken% + }% % \end{macrocode} % \begin{macrocode} -\DeclareDocumentCommand{\firsthdashline}{o}{% - \ifbool{FormatWP}% - {\LWR@docdashline{1-\arabic{LWR@tabletotalLaTeXcols}}}% - {\addtocounter{LWR@hdashedlines}{1}}% - \LWR@getmynexttoken% -}% + \DeclareDocumentCommand{\firsthdashline}{o}{% + \ifbool{FormatWP}% + {\LWR@docdashline{1-\arabic{LWR@tabletotalLaTeXcols}}}% + {\defaddtocounter{LWR@hdashedlines}{1}}% + \LWR@getmynexttoken% + }% % \end{macrocode} % \begin{macrocode} -\DeclareDocumentCommand{\lasthdashline}{o}{% - \ifbool{FormatWP}% - {\LWR@docdashline{1-\arabic{LWR@tabletotalLaTeXcols}}}% - {\addtocounter{LWR@hdashedlines}{1}}% - \LWR@getmynexttoken% -}% + \DeclareDocumentCommand{\lasthdashline}{o}{% + \ifbool{FormatWP}% + {\LWR@docdashline{1-\arabic{LWR@tabletotalLaTeXcols}}}% + {\defaddtocounter{LWR@hdashedlines}{1}}% + \LWR@getmynexttoken% + }% % \end{macrocode} % The following create data cells and will have no more data in this cell, % so we do not want to look ahead for a possible data cell, % so do not want to use \cs{LWR@getmynexttoken}. % \changes{v0.69}{2019/03/07}{Error if \cs{multirow} without \cs{mrowcell}.} % \begin{macrocode} -\renewcommand{\multicolumn}{\LWR@htmlmulticolumn}% -\renewcommand*{\mrowcell}{% - \LWR@maybenewtablerow% - \LWR@tabularleftedge% - \global\booltrue{LWR@skippingmrowcell}% - \booltrue{LWR@foundmrowcell}% -}% -\renewcommand*{\mcolrowcell}{% - \LWR@maybenewtablerow% - \global\booltrue{LWR@skippingmcolrowcell}% - \booltrue{LWR@foundmrowcell}% -}% -\LetLtxMacro\caption\LWR@longtabledatacaptiontag% + \renewcommand{\multicolumn}{\LWR@htmlmulticolumn}% + \renewcommand*{\mrowcell}{% + \LWR@maybenewtablerow% + \LWR@tabularleftedge% + \booltrue{LWR@skippingmrowcell}% + \booltrue{LWR@foundmrowcell}% + }% + \renewcommand*{\mcolrowcell}{% + \LWR@maybenewtablerow% + \booltrue{LWR@skippingmcolrowcell}% + \booltrue{LWR@foundmrowcell}% + }% + \LetLtxMacro\caption\LWR@longtabledatacaptiontag% % \end{macrocode} % Reset for new processing: % \begin{macrocode} -\global\boolfalse{LWR@tableparcell}% -\global\boolfalse{LWR@skippingmrowcell}% -\global\boolfalse{LWR@skippingmcolrowcell}% -\global\boolfalse{LWR@skipatbang}% -\global\boolfalse{LWR@emptyatbang}% + \boolfalse{LWR@tableparcell}% + \boolfalse{LWR@skippingmrowcell}% + \boolfalse{LWR@skippingmcolrowcell}% + \boolfalse{LWR@skipatbang}% + \boolfalse{LWR@emptyatbang}% % \end{macrocode} % Set |&| for its special meaning inside the tabular: % \begin{macrocode} -\StartDefiningTabulars% -\protected\gdef&{\LWR@tabularampersand}% + \StartDefiningTabulars% + \protected\gdef&{\LWR@tabularampersand}% % \end{macrocode} % Locally force any minipages to be fullwidth, until the end of the \env{tabular}: % \changes{v0.66}{2018/12/31}{Fix: Minipages inside \env{tabular}.} % \begin{macrocode} -\booltrue{LWR@forceminipagefullwidth} + \booltrue{LWR@forceminipagefullwidth}% % \end{macrocode} % Nest one level deeper of tabular paragraph handling: % \changes{v0.46}{2018/01/18}{Fix: Tabular empty lines.} % \begin{macrocode} -\addtocounter{LWR@tabularpardepth}{1}% + \addtocounter{LWR@tabularpardepth}{1}% % \end{macrocode} % Look ahead for a possible table data cell: % \begin{macrocode} -\LWR@traceinfo{LWR@@HTML@tabular: about to LWR@getmynexttoken}% -\LWR@getmynexttoken% + \LWR@traceinfo{LWR@@HTML@tabular: about to LWR@getmynexttoken}% + \LWR@getmynexttoken% }% % \end{macrocode} % @@ -29355,78 +29861,83 @@ rowspan="#2" % % \begin{macrocode} \newcommand*{\LWR@HTML@endtabular} {% -\LWR@traceinfo{LWR@HTML@endtabular}% + \LWR@traceinfo{LWR@HTML@endtabular}% % \end{macrocode} % Unnest one level of tabular paragraph handling: % \changes{v0.46}{2018/01/18}{Fix: Tabular empty lines.} % \begin{macrocode} -\addtocounter{LWR@tabularpardepth}{-1}% -\ifboolexpr{% - test {% - \ifnumcomp{\value{LWR@tableLaTeXcolindex}}{<}{\value{LWR@tabletotalLaTeXcols}} - } or % - (% - bool{LWR@intabularmetadata} and% - not bool{LWR@tabularcelladded} and% + \addtocounter{LWR@tabularpardepth}{-1}% + \ifboolexpr{% test {% - \ifnumcomp{\value{LWR@tableLaTeXcolindex}}{=}{\value{LWR@tabletotalLaTeXcols}}% - }% - )% -}% -{% - \LWR@tabularfinishrow% -}% -{% - \LWR@closetabledatacell% -}% -\LWR@htmlblocktag{/tr}% + \ifnumcomp{\value{LWR@tableLaTeXcolindex}}{<}% + {\value{LWR@tabletotalLaTeXcols}} + } or % + (% + bool{LWR@intabularmetadata} and% + not bool{LWR@tabularcelladded} and% + test {% + \ifnumcomp{\value{LWR@tableLaTeXcolindex}}{=}% + {\value{LWR@tabletotalLaTeXcols}}% + }% + )% + }% + {% + \LWR@tabularfinishrow% + }% + {% + \LWR@closetabledatacell% + }% + \LWR@htmlblocktag{/tr}% % \end{macrocode} % \pkg{xcolor} row color support: % \begin{macrocode} -\@rowc@lors% + \@rowc@lors% % \end{macrocode} % \begin{macrocode} -\LWR@htmlblocktag{/table}% -\global\boolfalse{LWR@intabularmetadata}% + \LWR@htmlblocktag{/table}% + \boolfalse{LWR@intabularmetadata}% % \end{macrocode} % % Unnest one level of tabular: % \begin{macrocode} -\addtocounter{LWR@tabulardepth}{-1}% + \addtocounter{LWR@tabulardepth}{-1}% % \end{macrocode} % % Restore |&| to its usual meaning: +% \changes{v0.79}{2020/01/18}{Fix: Nested \env{tabular}s.} % \begin{macrocode} -\protected\gdef&{\LWR@origampmacro}% -\StopDefiningTabulars% + \ifnumequal{\value{LWR@tabulardepth}}{0}{% + \protected\gdef&{\LWR@origampmacro}% + \StopDefiningTabulars% + }{}% % \end{macrocode} % % Error if used \cs{multirow} or \cs{multicolumnrow} without % using \cs{mrowcell} or \cs{mcolrowcell}. % \changes{v0.69}{2019/03/07}{Error if \cs{multirow} without \cs{mrowcell}.} % \begin{macrocode} -\ifbool{LWR@usedmultirow}{% - \ifbool{LWR@foundmrowcell}% - {}% - {% - \PackageError{lwarp}% - {% - When using \protect\multirow, \protect\multicolumnrow,\MessageBreak - or the bigdelim package,\MessageBreak - place \protect\mrowcell\space or \protect\mcolrowcell\MessageBreak - in empty cells which are to be skipped.\MessageBreak - See the lwarp package documentation:\MessageBreak - "Special cases and limitations" -> "Tabular" - }% + \ifbool{LWR@usedmultirow}{% + \ifbool{LWR@foundmrowcell}% + {}% {% - See the lwarp package documentation:\MessageBreak - "Special cases and limitations" -> "Tabular". + \PackageError{lwarp}% + {% + When using \protect\multirow, \protect\multicolumnrow,\MessageBreak + or the bigdelim package,\MessageBreak + place \protect\mrowcell\space or \protect\mcolrowcell\MessageBreak + in empty cells which are to be skipped.\MessageBreak + See the Lwarp package documentation:\MessageBreak + "Special cases and limitations" -> "Tabular" + }% + {% + See the Lwarp package documentation:\MessageBreak + "Special cases and limitations" -> "Tabular". + }% }% - }% -}{}% + }{}% % \end{macrocode} % \begin{macrocode} -\LWR@traceinfo{LWR@HTML@endtabular finished}% + \LWR@traceinfo{LWR@HTML@endtabular finished}% } \csletcs{LWR@HTML@endtabular*}{LWR@HTML@endtabular} @@ -29582,12 +30093,12 @@ rowspan="#2" % % Remove \cs{label} and other commands from the name, the strip any final period. % See \pkg{gettitlestring}. % \begin{macrocode} -\GetTitleStringExpand{#1}% -\edef\@currentlabelname{\detokenize\expandafter{\GetTitleStringResult}}% -\edef\@currentlabelname{% - \expandafter\LWR@stripperiod\@currentlabelname% - \ltx@empty.\ltx@empty\@nil% -}% + \GetTitleStringExpand{#1}% + \edef\@currentlabelname{\detokenize\expandafter{\GetTitleStringResult}}% + \edef\@currentlabelname{% + \expandafter\LWR@stripperiod\@currentlabelname% + \ltx@empty.\ltx@empty\@nil% + }% } % \end{macrocode} % \end{macro} @@ -29681,17 +30192,23 @@ rowspan="#2" % % \changes{v0.66}{2019/01/27}{No longer use \pkg{zref}.} % \begin{macrocode} \newcommand*{\LWR@lwarplabel}[1]{% -\LWR@traceinfo{LWR@lwarplabel !#1!}% -\LWR@setlatestname{\@currentlabelname}% - \@bsphack% - \protected@write\@auxout{}% - {\string\newlabel{#1@lwarp}{% - {\@currentlabelname}% - {\ifbool{FileSectionNames}{\LWR@thisfilename}{\arabic{LWR@htmlfilenumber}}}% - {\arabic{LWR@lateximagedepth}}% - {\arabic{LWR@lateximagenumber}}% - }}% - \@esphack% + \LWR@traceinfo{LWR@lwarplabel !#1!}% + \LWR@setlatestname{\@currentlabelname}% + \@bsphack% + \protected@write\@auxout{}% + {% + \string\newlabel{#1@lwarp}{% + {\@currentlabelname}% + {% + \ifbool{FileSectionNames}% + {\LWR@thisfilename}% + {\arabic{LWR@htmlfilenumber}}% + }% + {\arabic{LWR@lateximagedepth}}% + {\arabic{LWR@lateximagenumber}}% + }% + }% + \@esphack% } % \end{macrocode} % \end{macro} @@ -29710,36 +30227,39 @@ rowspan="#2" % % \changes{v0.45}{2017/12/29}{Fix: Labels with underscores.} % \begin{macrocode} \newcommand*{\LWR@sublabel}[1]{% -\LWR@traceinfo{LWR@sublabel !#1!}% + \LWR@traceinfo{LWR@sublabel !#1!}% % \end{macrocode} % Create an \HTML\ id tag unless are inside a lateximage, % since it would appear in the image: % \begin{macrocode} -\ifnumcomp{\value{LWR@lateximagedepth}}{>}{0}% -{}% -{% not lateximage + \ifnumcomp{\value{LWR@lateximagedepth}}{>}{0}% + {}% + {% not lateximage % \end{macrocode} % 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) % \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 -}% not lateximage + \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 + }% not lateximage } % \end{macrocode} % \end{macro} @@ -29762,24 +30282,31 @@ rowspan="#2" % % % \begin{macrocode} \NewDocumentCommand{\LWR@new@label}{d() m o}{% -\LWR@traceinfo{LWR@new@label: starting}% -\LWR@traceinfo{LWR@new@label: !#2!}% + \LWR@traceinfo{LWR@new@label: starting}% + \LWR@traceinfo{LWR@new@label: !#2!}% % \@bsphack% % \end{macrocode} % Create a traditional \LaTeX\ label, as modified by \pkg{cleveref}: % \begin{macrocode} -\LWR@orig@label{#2}% + \LWR@orig@label{#2}% % \end{macrocode} % Create a special label which holds the section number, % |LWR@htmlfilenumber|, |LWR@lateximagedepth|, and |LWR@lateximagenumber|: % \begin{macrocode} -\LWR@traceinfo{LWR@new@label: filesectionnames is \ifbool{FileSectionNames}{true}{false}}% -\LWR@traceinfo{LWR@new@label: LWR@thisfilename is !\LWR@thisfilename!}% -\LWR@traceinfo{LWR@new@label: LWR@htmlfilenumber is \arabic{LWR@htmlfilenumber}}% -\LWR@lwarplabel{#2}% -\LWR@sublabel{#2}% -% \@esphack% -\LWR@traceinfo{LWR@new@label: done}% + \LWR@traceinfo{% + LWR@new@label: filesectionnames is % + \ifbool{FileSectionNames}{true}{false}% + }% + \LWR@traceinfo{% + LWR@new@label: LWR@thisfilename is !\LWR@thisfilename!% + }% + \LWR@traceinfo{% + LWR@new@label: LWR@htmlfilenumber is \arabic{LWR@htmlfilenumber}% + }% + \LWR@lwarplabel{#2}% + \LWR@sublabel{#2}% + % \@esphack% + \LWR@traceinfo{LWR@new@label: done}% } % \end{macrocode} % \end{macro} @@ -29815,61 +30342,61 @@ rowspan="#2" % % \begin{macrocode} \newcommand*{\LWR@startref}[1] {% -\LWR@sanitize{#1}% -\LWR@traceinfo{LWR@startref A: !#1!}% + \LWR@sanitize{#1}% + \LWR@traceinfo{LWR@startref A: !#1!}% % \end{macrocode} % Create the filename part of the link: % \begin{macrocode} -\LWR@htmltag{a href="% -\LWR@traceinfo{LWR@startref B}% -\LWR@print@mbox{\LWR@htmlrefsectionfilename{#1}}% -\LWR@traceinfo{LWR@startref C}% -\LWR@origpound% + \LWR@htmltag{a href="% + \LWR@traceinfo{LWR@startref B}% + \LWR@print@mbox{\LWR@htmlrefsectionfilename{#1}}% + \LWR@traceinfo{LWR@startref C}% + \LWR@origpound% % \end{macrocode} % Create the destination id: % % See if |LWR@lateximagedepth| is unknown: % \begin{macrocode} -\LWR@traceinfo{LWR@startref D: !#1!}% -\ifcsundef{r@#1@lwarp}% + \LWR@traceinfo{LWR@startref D: !#1!}% + \ifcsundef{r@#1@lwarp}% % \end{macrocode} % ``|??|'' if |LWR@lateximagedepth| is unknown, % so create a link with an unknown destination: % \begin{macrocode} -{% - \LWR@traceinfo{LWR@startref D0: ??}% - ??% -}% + {% + \LWR@traceinfo{LWR@startref D0: ??}% + ??% + }% % \end{macrocode} % If |LWR@lateximagedepth| is known. % Use a lateximage if the depth is greater than zero, % or a regular link otherwise: % \begin{macrocode} -{% - \ifthenelse{\cnttest{\LWR@lateximagedepthref{#1}}{>}{0}}% - {% - \LWR@ImagesName\LWR@lateximagenumberref{#1}% - }% - {% - \LWR@traceinfo{LWR@startref D3}% + {% + \ifthenelse{\cnttest{\LWR@lateximagedepthref{#1}}{>}{0}}% + {% + \LWR@ImagesName\LWR@lateximagenumberref{#1}% + }% + {% + \LWR@traceinfo{LWR@startref D3}% % \end{macrocode} % \cs{detokenize} is used to allow underscores in the labels: % \changes{v0.45}{2017/12/01}{Fix: Labels with underscores.} % \begin{macrocode} - \LWR@print@mbox{\LWR@sanitized}% - }% -}% -\LWR@traceinfo{LWR@startref E}% + \LWR@print@mbox{\LWR@sanitized}% + }% + }% + \LWR@traceinfo{LWR@startref E}% % \end{macrocode} % Closing quote: % \begin{macrocode} -"% + "% % \end{macrocode} % Maybe add a title: % \begin{macrocode} -\LWR@addlinktitle% -}% -\LWR@traceinfo{LWR@startref F}% + \LWR@addlinktitle% + }% + \LWR@traceinfo{LWR@startref F}% } % \end{macrocode} % \end{macro} @@ -29882,10 +30409,10 @@ rowspan="#2" % % but prints its own text, such as ``|1(b)|''. % \begin{macrocode} \NewDocumentCommand{\LWR@subnewref}{m m}{% -\LWR@traceinfo{LWR@subnewref #1 #2}% -\LWR@startref{#1}% -\LWR@print@ref{#2}% -\LWR@htmltag{/a}% + \LWR@traceinfo{LWR@subnewref #1 #2}% + \LWR@startref{#1}% + \LWR@print@ref{#2}% + \LWR@htmltag{/a}% } % \end{macrocode} % \end{macro} @@ -29901,10 +30428,10 @@ rowspan="#2" % % \changes{v0.58}{2018/06/07}{Improved print/\HTML\ output selection.} % \begin{macrocode} \NewDocumentCommand{\LWR@HTML@ref}{s m}{% -\LWR@traceinfo{LWR@HTML@ref !#2!}% -\IfBooleanTF{#1}% -{\LWR@print@ref{#2}}% -{\LWR@subnewref{#2}{#2}}% + \LWR@traceinfo{LWR@HTML@ref !#2!}% + \IfBooleanTF{#1}% + {\LWR@print@ref{#2}}% + {\LWR@subnewref{#2}{#2}}% } \LWR@formatted{ref} @@ -29942,9 +30469,9 @@ rowspan="#2" % % % \begin{macrocode} \NewDocumentCommand{\LWR@new@pageref}{s m}{% -\IfBooleanTF{#1}% -{(\pagerefPageFor\LWR@print@ref{#2})}% -{(\cpageref{#2})}% + \IfBooleanTF{#1}% + {(\pagerefPageFor\LWR@print@ref{#2})}% + {(\cpageref{#2})}% } % \end{macrocode} % \end{macro} @@ -29955,13 +30482,13 @@ rowspan="#2" % % \changes{v0.43}{2017/10/31}{Made robust.} % \begin{macrocode} \newrobustcmd*{\nameref}[1]{% -\LWR@traceinfo{nameref}% -\LWR@startref{#1}% -\LWR@traceinfo{nameref B}% -\LWR@nameref{#1}% -\LWR@traceinfo{nameref C}% -\LWR@htmltag{/a}% -\LWR@traceinfo{nameref: done}% + \LWR@traceinfo{nameref}% + \LWR@startref{#1}% + \LWR@traceinfo{nameref B}% + \LWR@nameref{#1}% + \LWR@traceinfo{nameref C}% + \LWR@htmltag{/a}% + \LWR@traceinfo{nameref: done}% } % \end{macrocode} % \end{macro} @@ -30005,9 +30532,11 @@ rowspan="#2" % % \changes{v0.45}{2018/01/14}{Added.} % \begin{macrocode} \AtBeginDocument{ + \def\@currentHref{% -autopage-\theLWR@currentautosec% + autopage-\theLWR@currentautosec% } + } % \end{macrocode} % \end{macro} @@ -30288,21 +30817,21 @@ autopage-\theLWR@currentautosec% % % \begin{macrocode} \NewDocumentCommand{\LWR@floatbegin}{m o}{% -\ifbool{FormatWP}{\newline}{}% -\LWR@stoppars + \ifbool{FormatWP}{\newline}{}% + \LWR@stoppars% % \end{macrocode} % There is a new float, so increment the unique float counter: % \begin{macrocode} -\addtocounter{LWR@thisautoid}{1}% -\booltrue{LWR@freezethisautoid}% + \addtocounter{LWR@thisautoid}{1}% + \booltrue{LWR@freezethisautoid}% % \end{macrocode} % % \begin{macrocode} -\begingroup% + \begingroup% % \end{macrocode} % Settings while inside the environment: % \begin{macrocode} -\LWR@print@raggedright% + \LWR@print@raggedright% % \end{macrocode} % Open an \HTML\ |figure| tag. % The figure is assigned a \attribute{class} equal to its type, @@ -30313,34 +30842,34 @@ autopage-\theLWR@currentautosec% % \changes{v0.47}{2018/01/26}{Fix: Line wrap at \HTML\ hyphen.} % \changes{v0.56}{2018/05/14}{Adds a \element{class} per \pkg{float} package style.} % \begin{macrocode} -\LWR@htmltag{% - figure id="\LWR@print@mbox{autoid-\arabic{LWR@thisautoid}}" % space - class="#1 \@nameuse{LWR@floatstyle@#1}"% -}% -\ifbool{FormatWP}{% - \LWR@orignewline% - \LWR@BlockClassWP{}{}{wp#1}% -}{}% + \LWR@htmltag{% + figure id="\LWR@print@mbox{autoid-\arabic{LWR@thisautoid}}" % space + class="#1 \@nameuse{LWR@floatstyle@#1}"% + }% + \ifbool{FormatWP}{% + \LWR@orignewline% + \LWR@BlockClassWP{}{}{wp#1}% + }{}% % \end{macrocode} % Update the caption type: % \begin{macrocode} -\renewcommand*{\@captype}{#1}% -\caption@settype{#1}% + \renewcommand*{\@captype}{#1}% + \caption@settype{#1}% % \end{macrocode} % Mark the float for a word processor conversion: % \begin{macrocode} -\LWR@startpars% -\ifboolexpr{bool{FormatWP} and bool{WPMarkFloats}}{% + \LWR@startpars% + \ifboolexpr{bool{FormatWP} and bool{WPMarkFloats}}{% -=== begin #1 === + === begin #1 === -}{}% + }{}% % \end{macrocode} % Look for \cs{centering}, etc: % \changes{v0.54}{2018/04/19}{Honor \cs{centering}, etc. in floats.} % \changes{v0.55}{2018/04/24}{Fix: Float optional args.} % \begin{macrocode} -\LWR@futurenonspacelet\LWR@mynexttoken\LWR@floatalignment% + \LWR@futurenonspacelet\LWR@mynexttoken\LWR@floatalignment% } % \end{macrocode} % \end{macro} @@ -30349,12 +30878,16 @@ autopage-\theLWR@currentautosec% % \changes{v0.55}{2018/04/25}{Fix: \cs{centering}, etc. for \pkg{koma-script}.} % \begin{macrocode} \AtBeginDocument{ + \@ifpackageloaded{tocbasic}{ + \appto\figure@atbegin{% -\LWR@futurenonspacelet\LWR@mynexttoken\LWR@floatalignment% -} -}{} + \LWR@futurenonspacelet\LWR@mynexttoken\LWR@floatalignment% } + +}{}% tocbasic + +}% AtBeginDocument % \end{macrocode} % % @@ -30378,26 +30911,26 @@ autopage-\theLWR@currentautosec% % If saw a \cs{centering}, finish the \env{center} environment: % \changes{v0.54}{2018/04/19}{Honor \cs{centering}, etc. in floats.} % \begin{macrocode} -\LWR@endfloatalignment% + \LWR@endfloatalignment% % \end{macrocode} % Mark the float end for a word processor conversion: % \begin{macrocode} -\ifboolexpr{bool{FormatWP} and bool{WPMarkFloats}}{% + \ifboolexpr{bool{FormatWP} and bool{WPMarkFloats}}{% -=== end === + === end === -}{}% -\LWR@stoppars% + }{}% + \LWR@stoppars% % \end{macrocode} % Close an \HTML\ |figure| tag: % \changes{v0.42}{2017/10/26}{If \progcode{FormatWP} add a text frame.} % \begin{macrocode} -\ifbool{FormatWP}{\endLWR@BlockClassWP}{}% -\LWR@htmlelementend{figure}% -\endgroup% -\boolfalse{LWR@freezethisautoid}% -\LWR@startpars% -\ifbool{FormatWP}{\newline}{}% + \ifbool{FormatWP}{\endLWR@BlockClassWP}{}% + \LWR@htmlelementend{figure}% + \endgroup% + \boolfalse{LWR@freezethisautoid}% + \LWR@startpars% + \ifbool{FormatWP}{\newline}{}% } % \end{macrocode} % \end{macro} @@ -30439,22 +30972,28 @@ autopage-\theLWR@currentautosec% \boolfalse{LWR@freezethisautoid} % \end{macrocode} -% \begin{macro}{\LWR@newautoidanchor} +% \begin{macro}{\LWR@forcenewautoidanchor} % Adds a new \element{autoid} anchor. +% \changes{v0.79}{2019/12/09}{Factored.} +% \begin{macrocode} +\newcommand*{\LWR@forcenewautoidanchor}{% + \addtocounter{LWR@thisautoid}{1}% + \LWR@htmltag{a id="\LWR@print@mbox{autoid-\arabic{LWR@thisautoid}}"}% + \LWR@htmltag{/a}% +} +% \end{macrocode} +% \end{macro} + +% \begin{macro}{\LWR@newautoidanchor} +% Sometimes adds a new \element{autoid} anchor. % \changes{v0.45}{2017/12/07}{Fix: No anchor if frozen autoid.} % \changes{v0.47}{2018/01/26}{Fix: Line wrap at \HTML\ hyphen.} % \changes{v0.51}{2018/03/16}{Fix: No autoid is inside a \env{lateximage}.} % \begin{macrocode} \newcommand*{\LWR@newautoidanchor}{% -\ifnumcomp{\value{LWR@lateximagedepth}}{>}{0}% -{}% -{% - \ifbool{LWR@freezethisautoid}{}{% - \addtocounter{LWR@thisautoid}{1}% - \LWR@htmltag{a id="\LWR@print@mbox{autoid-\arabic{LWR@thisautoid}}"}% - \LWR@htmltag{/a}% - }% -}% + \ifnumcomp{\value{LWR@lateximagedepth}}{>}{0}% + {}% + {\ifbool{LWR@freezethisautoid}{}{\LWR@forcenewautoidanchor}}% } % \end{macrocode} % \end{macro} @@ -30481,18 +31020,18 @@ autopage-\theLWR@currentautosec% % \changes{v0.54}{2018/04/19}{Honor \cs{centering}, etc. in floats.} % \begin{macrocode} \newcommand*{\LWR@floatalignment}{% -\ifdefstrequal{\LWR@mynexttoken}{\centering}{% - \center% - \renewcommand*{\LWR@floatalignmentname}{center}% -}{}% -\ifdefstrequal{\LWR@mynexttoken}{\raggedright}{% - \flushleft% - \renewcommand*{\LWR@floatalignmentname}{flushleft}% -}{}% -\ifdefstrequal{\LWR@mynexttoken}{\raggedleft}{% - \flushright% - \renewcommand*{\LWR@floatalignmentname}{flushright}% -}{}% + \ifdefstrequal{\LWR@mynexttoken}{\centering}{% + \center% + \renewcommand*{\LWR@floatalignmentname}{center}% + }{}% + \ifdefstrequal{\LWR@mynexttoken}{\raggedright}{% + \flushleft% + \renewcommand*{\LWR@floatalignmentname}{flushleft}% + }{}% + \ifdefstrequal{\LWR@mynexttoken}{\raggedleft}{% + \flushright% + \renewcommand*{\LWR@floatalignmentname}{flushright}% + }{}% } % \end{macrocode} % \end{macro} @@ -30502,8 +31041,10 @@ autopage-\theLWR@currentautosec% % \changes{v0.54}{2018/04/19}{Honor \cs{centering}, etc. in floats.} % \begin{macrocode} \newcommand*{\LWR@endfloatalignment}{% -\ifdefvoid{\LWR@floatalignmentname}{}{\@nameuse{end\LWR@floatalignmentname}}% -\renewcommand*{\LWR@floatalignmentname}{}% + \ifdefvoid{\LWR@floatalignmentname}% + {}% + {\@nameuse{end\LWR@floatalignmentname}}% + \renewcommand*{\LWR@floatalignmentname}{}% } % \end{macrocode} % \end{macro} @@ -30594,14 +31135,14 @@ autopage-\theLWR@currentautosec% % \changes{v0.65}{2018/12/21}{Uses \element{figurecaption} instead of \element{figcaption}.} % \begin{macrocode} \newenvironment*{LWR@figcaption} - { + {% \ifbool{FormatWP}{% - \BlockClass[font-style:italic]{figurecaption} + \BlockClass[font-style:italic]{figurecaption}% % \LWR@print@vspace*{\baselineskip} - }{ - \BlockClass{figurecaption} + }{% + \BlockClass{figurecaption}% }% - } + }% {\endBlockClass} % \end{macrocode} % \end{environment} @@ -30618,23 +31159,23 @@ autopage-\theLWR@currentautosec% % \begin{macrocode} \newcommand*{\LWR@HTML@caption@begin}[1] {% -\LWR@traceinfo{LWR@HTML@caption@begin}% + \LWR@traceinfo{LWR@HTML@caption@begin}% % \end{macrocode} % Keep par and minipage changes local: % \begin{macrocode} -\begingroup% + \begingroup% % \end{macrocode} % No need for a |minipage| or \cs{parbox} inside the caption: % \begin{macrocode} -\RenewDocumentEnvironment{minipage}{O{t} o O{t} m}{}{}% -\RenewDocumentCommand{\parbox}{O{t} O{} O{t} m +m}{##5}% + \RenewDocumentEnvironment{minipage}{O{t} o O{t} m}{}{}% + \RenewDocumentCommand{\parbox}{O{t} O{} O{t} m +m}{##5}% % \end{macrocode} % Enclose the original caption code inside an \HTML\ tag: % \begin{macrocode} -\LWR@figcaption% -\LWR@traceinfo{LWR@HTML@caption@begin: about to LWR@origcaption@begin}% -\LWR@print@caption@begin{#1}% -\LWR@traceinfo{LWR@HTML@caption@begin: done}% + \LWR@figcaption% + \LWR@traceinfo{LWR@HTML@caption@begin: about to LWR@origcaption@begin}% + \LWR@print@caption@begin{#1}% + \LWR@traceinfo{LWR@HTML@caption@begin: done}% } % \end{macrocode} % \end{macro} @@ -30645,15 +31186,15 @@ autopage-\theLWR@currentautosec% % \begin{macrocode} \newcommand*{\LWR@HTML@caption@end} {% -\LWR@traceinfo{LWR@HTML@caption@end}% -\LWR@print@caption@end% + \LWR@traceinfo{LWR@HTML@caption@end}% + \LWR@print@caption@end% % \end{macrocode} % Closing tag: % \begin{macrocode} -\endLWR@figcaption% -\endgroup% -% \leavevmode% avoid bad space factor (0) error -\LWR@traceinfo{LWR@HTML@caption@end: done}% + \endLWR@figcaption% + \endgroup% + % \leavevmode% avoid bad space factor (0) error + \LWR@traceinfo{LWR@HTML@caption@end: done}% } % \end{macrocode} % \end{macro} @@ -30682,18 +31223,24 @@ autopage-\theLWR@currentautosec% \let\LWR@origcaptionlistentry\captionlistentry \renewcommand*{\captionlistentry}{% -\LWR@ensuredoingapar% -\LWR@origcaptionlistentry% + \LWR@ensuredoingapar% + \LWR@origcaptionlistentry% } - +% \end{macrocode} +% +% \changes{v0.79}{2019/12/09}{Fix: Duplicate \attribute{auto-id}.} +% \begin{macrocode} \def\LWR@LTcaptionlistentry{% -\LWR@ensuredoingapar% -\LWR@htmltag{a id="\LWR@print@mbox{autoid-\arabic{LWR@thisautoid}}"}\LWR@htmltag{/a}% - \bgroup - \@ifstar{\egroup\LWR@LT@captionlistentry}% gobble * - {\egroup\LWR@LT@captionlistentry}}% + \LWR@ensuredoingapar% + \LWR@forcenewautoidanchor% + \bgroup + \@ifstar{\egroup\LWR@LT@captionlistentry}% gobble * + {\egroup\LWR@LT@captionlistentry}% +}% + \def\LWR@LT@captionlistentry#1{% - \caption@listentry\@firstoftwo[\LTcaptype]{#1}}% + \caption@listentry\@firstoftwo[\LTcaptype]{#1}% +}% % \end{macrocode} % \end{macro} @@ -30710,26 +31257,26 @@ autopage-\theLWR@currentautosec% \let\LWR@origaddcontentsline\addcontentsline \renewcommand*{\addcontentsline}[3]{% -\ifstrequal{#1}{toc}{}{% not TOC + \ifstrequal{#1}{toc}{}{% not TOC % \end{macrocode} % \changes{v0.51}{2018/03/11}{No anchor ID if inside \SVG\ image.} % \begin{macrocode} -\ifnumcomp{\value{LWR@lateximagedepth}}{>}{0}% - {}% - {\LWR@newautoidanchor}% + \ifnumcomp{\value{LWR@lateximagedepth}}{>}{0}% + {}% + {\LWR@newautoidanchor}% % \end{macrocode} % \changes{v0.51}{2018/03/11}{Add missing support for float mechanism if necessary.} % \begin{macrocode} - \ifcsvoid{ext@#2}{\csdef{ext@#2}{#1}}{}% + \ifcsvoid{ext@#2}{\csdef{ext@#2}{#1}}{}% % \end{macrocode} % \begin{macrocode} - \addtocontents{\@nameuse{ext@#2}}{% - \protect\LWRsetnextfloat% - {\arabic{LWR@latestautopage}}% - {\arabic{LWR@thisautoid}}% - }% -}% not TOC -\LWR@origaddcontentsline{#1}{#2}{#3}% + \addtocontents{\@nameuse{ext@#2}}{% + \protect\LWRsetnextfloat% + {\arabic{LWR@latestautopage}}% + {\arabic{LWR@thisautoid}}% + }% + }% not TOC + \LWR@origaddcontentsline{#1}{#2}{#3}% } % \end{macrocode} % \end{macro} @@ -30743,13 +31290,15 @@ autopage-\theLWR@currentautosec% % Patched to handle paragraph tags. % \begin{macrocode} \AtBeginDocument{ + \let\LWR@origcaptionof\captionof \renewcommand*{\captionof}{% -\LWR@stoppars% -\LWR@origcaptionof% -} + \LWR@stoppars% + \LWR@origcaptionof% } + +}% AtBeginDocument % \end{macrocode} % \end{macro} @@ -30795,29 +31344,29 @@ autopage-\theLWR@currentautosec% % the side\TOC\ may be referred to again in each \HTML\ page. % \begin{macrocode} \newcommand*{\LWR@myshorttoc}[1]{% -\LWR@traceinfo{LWR@myshorttoc: #1}% -\LWR@ensuredoingapar% + \LWR@traceinfo{LWR@myshorttoc: #1}% + \LWR@ensuredoingapar% % \end{macrocode} % Only if the file exists: % \begin{macrocode} -\IfFileExists{\jobname.#1}{% -\LWR@traceinfo{LWR@myshorttoc: loading}% + \IfFileExists{\jobname.#1}{% + \LWR@traceinfo{LWR@myshorttoc: loading}% % \end{macrocode} % % Many of the commands in the file will have |@| characters in them, so |@| % \watchout % must be made a regular letter. % \begin{macrocode} -\begingroup% -\makeatletter% + \begingroup% + \makeatletter% % \end{macrocode} % Read in the \TOC\ file: % \begin{macrocode} -\@input{\jobname.#1}% -\endgroup% -}% -{}% -\LWR@traceinfo{LWR@myshorttoc: done}% + \@input{\jobname.#1}% + \endgroup% + }% + {}% + \LWR@traceinfo{LWR@myshorttoc: done}% } % \end{macrocode} % \end{macro} @@ -30831,30 +31380,30 @@ autopage-\theLWR@currentautosec% % \end{macrocode} % Closes previous levels: % \begin{macrocode} -\@ifundefined{chapter} -{\LWR@closeprevious{section}} -{\LWR@closeprevious{chapter}} + \@ifundefined{chapter}% + {\LWR@closeprevious{section}}% + {\LWR@closeprevious{chapter}}% % \end{macrocode} % Prints any pending footnotes so that they appear above the potentially % large \TOC: % \begin{macrocode} -\LWR@printpendingfootnotes + \LWR@printpendingfootnotes% % \end{macrocode} % Place the list into its own chapter (if defined) or section: % \begin{macrocode} -\@ifundefined{chapter}{\section*{#2}}{\chapter*{#2}} + \@ifundefined{chapter}{\section*{#2}}{\chapter*{#2}}% % \end{macrocode} % Create a new \HTML\ |nav| containing the \TOC/\LOF/\LOT: % \begin{macrocode} -\LWR@htmlelementclass{nav}{#1} + \LWR@htmlelementclass{nav}{#1}% % \end{macrocode} % Create the actual list: % \begin{macrocode} -\LWR@myshorttoc{#1} + \LWR@myshorttoc{#1}% % \end{macrocode} % Close the |nav|: % \begin{macrocode} -\LWR@htmlelementclassend{nav}{#1} + \LWR@htmlelementclassend{nav}{#1}% } % \end{macrocode} % \end{macro} @@ -30866,9 +31415,9 @@ autopage-\theLWR@currentautosec% \let\LWR@orig@starttoc\@starttoc \renewcommand{\@starttoc}[1]{ -\LWR@htmlelementclass{nav}{#1} -\LWR@orig@starttoc{#1} -\LWR@htmlelementclassend{nav}{#1} + \LWR@htmlelementclass{nav}{#1}% + \LWR@orig@starttoc{#1}% + \LWR@htmlelementclassend{nav}{#1}% } % \end{macrocode} % \end{macro} @@ -30895,6 +31444,7 @@ autopage-\theLWR@currentautosec% % \changes{v0.45}{2017/12/09}{Fix: Empty sidetoc.} % \begin{macrocode} \AtBeginDocument{ + \let\LWR@origtableofcontents\tableofcontents \renewcommand*{\tableofcontents}{% @@ -30903,24 +31453,25 @@ autopage-\theLWR@currentautosec% % which will presumably auto-generate its own updated table of contents: % \changes{v0.42}{2017/10/18}{Added boolean \progcode{WPMarkTOC}.} % \begin{macrocode} -\ifboolexpr{bool{FormatWP} and bool{WPMarkTOC}}{ + \ifboolexpr{bool{FormatWP} and bool{WPMarkTOC}}{ -=== table of contents === + === table of contents === -} -{ + } + { % \end{macrocode} % Copy the |.toc| file to |.sidetoc| for printing the side\TOC. % The original |.toc| file is renewed when \cs{tableofcontents} is finished. % \begin{macrocode} - \ifbool{LWR@copiedsidetoc}{}{% - \LWR@copyfile{\jobname.toc}{\jobname.sidetoc}% - \booltrue{LWR@copiedsidetoc}% - }% - \LWR@printpendingfootnotes - \LWR@origtableofcontents -} + \ifbool{LWR@copiedsidetoc}{}{% + \LWR@copyfile{\jobname.toc}{\jobname.sidetoc}% + \booltrue{LWR@copiedsidetoc}% + }% + \LWR@printpendingfootnotes + \LWR@origtableofcontents + } }% \tableofcontents + }% AtBeginDocument % \end{macrocode} % \end{macro} @@ -30931,15 +31482,15 @@ autopage-\theLWR@currentautosec% \let\LWR@origlistoffigures\listoffigures \renewcommand*{\listoffigures}{ -\ifboolexpr{bool{FormatWP} and bool{WPMarkLOFT}}{ + \ifboolexpr{bool{FormatWP} and bool{WPMarkLOFT}}{ -=== list of figures === + === list of figures === -} -{ - \LWR@printpendingfootnotes - \LWR@origlistoffigures -} + } + { + \LWR@printpendingfootnotes + \LWR@origlistoffigures + } } % \end{macrocode} % \end{macro} @@ -30950,15 +31501,15 @@ autopage-\theLWR@currentautosec% \let\LWR@origlistoftables\listoftables \renewcommand*{\listoftables}{ -\ifboolexpr{bool{FormatWP} and bool{WPMarkLOFT}}{ + \ifboolexpr{bool{FormatWP} and bool{WPMarkLOFT}}{ -=== list of tables === + === list of tables === -} -{ - \LWR@printpendingfootnotes - \LWR@origlistoftables -} + } + { + \LWR@printpendingfootnotes + \LWR@origlistoftables + } } % \end{macrocode} % \end{macro} @@ -30977,13 +31528,13 @@ autopage-\theLWR@currentautosec% % \changes{v0.61}{2018/09/26}{Fix: \pkg{newfloat} lists.} % \begin{macrocode} \NewDocumentCommand{\listof}{m +m}{% -\@ifundefined{l@#1}{% - \csdef{l@#1}##1##2{\hypertocfloat{1}{#1}{\@nameuse{ext@#1}}{##1}{##2}}% -}{}% -\LWR@subtableofcontents{\@nameuse{ext@#1}}{#2} -\expandafter\newwrite\csname tf@\csname ext@#1\endcsname\endcsname -\immediate\openout \csname tf@\csname ext@#1\endcsname\endcsname - \jobname.\@nameuse{ext@#1}\relax + \@ifundefined{l@#1}{% + \csdef{l@#1}##1##2{\hypertocfloat{1}{#1}{\@nameuse{ext@#1}}{##1}{##2}}% + }{}% + \LWR@subtableofcontents{\@nameuse{ext@#1}}{#2}% + \expandafter\newwrite\csname tf@\csname ext@#1\endcsname\endcsname% + \immediate\openout \csname tf@\csname ext@#1\endcsname\endcsname% + \jobname.\@nameuse{ext@#1}\relax% } % \end{macrocode} % \end{macro} @@ -31058,36 +31609,36 @@ autopage-\theLWR@currentautosec% % \begin{macro}{\LWR@sidetoc} % Creates the actual side-TOC. % \begin{macrocode} -\newcommand*{\LWR@sidetoc}{ -\LWR@forcenewpage -\LWR@stoppars +\newcommand*{\LWR@sidetoc}{% + \LWR@forcenewpage + \LWR@stoppars % \end{macrocode} % The entire side\TOC\ is placed into a |nav| of class |sidetoc|. % \begin{macrocode} -\LWR@htmlelementclass{div}{sidetoccontainer} -\LWR@htmlelementclass{nav}{sidetoc} + \LWR@htmlelementclass{div}{sidetoccontainer} + \LWR@htmlelementclass{nav}{sidetoc} -\setcounter{tocdepth}{\value{SideTOCDepth}} + \setcounter{tocdepth}{\value{SideTOCDepth}} % \end{macrocode} % The title is placed into a \element{div} of class \attribute{sidetoctitle}, and may % contain paragraphs. % \begin{macrocode} -\begin{BlockClass}{sidetoctitle} -\ifcsvoid{thetitle}{}{\InlineClass{sidetocthetitle}{\thetitle}\par} -\sidetocname -\end{BlockClass} + \begin{BlockClass}{sidetoctitle} + \ifcsvoid{thetitle}{}{\InlineClass{sidetocthetitle}{\thetitle}\par} + \sidetocname + \end{BlockClass} % \end{macrocode} % The table of contents is placed into a \element{div} of class \attribute{sidetoccontents}. % \begin{macrocode} -\begin{BlockClass}{sidetoccontents} -\LinkHome + \begin{BlockClass}{sidetoccontents} + \LinkHome -\LWR@myshorttoc{sidetoc} -\end{BlockClass} -\LWR@htmlelementclassend{nav}{sidetoc} -\LWR@htmlelementclassend{div}{sidetoccontainer} + \LWR@myshorttoc{sidetoc} + \end{BlockClass} + \LWR@htmlelementclassend{nav}{sidetoc} + \LWR@htmlelementclassend{div}{sidetoccontainer} } % \end{macrocode} % \end{macro} @@ -31107,7 +31658,7 @@ autopage-\theLWR@currentautosec% % % \begin{macrocode} \newcommand*{\LWR@numberline}[1]{% -\LWR@sectionnumber{#1}\quad% + \LWR@sectionnumber{#1}\quad% } \LetLtxMacro\numberline\LWR@numberline @@ -31135,13 +31686,13 @@ autopage-\theLWR@currentautosec% % \end{description} % \begin{macrocode} \NewDocumentCommand{\hypertoc}{m m +m m}{% -\LWR@traceinfo{hypertoc !#1!#2!#3!#4!}% + \LWR@traceinfo{hypertoc !#1!#2!#3!#4!}% % \end{macrocode} % Respond to |tocdepth|: % \begin{macrocode} -\ifthenelse{\cnttest{#1}{<=}{\value{tocdepth}}}% - {% - \LWR@startpars% + \ifthenelse{\cnttest{#1}{<=}{\value{tocdepth}}}% + {% + \LWR@startpars% % \end{macrocode} % % Create an \HTML\ link to |<filename>#autosec-(page)|, with the name, @@ -31152,20 +31703,20 @@ autopage-\theLWR@currentautosec% % \changes{v0.47}{2018/01/26}{Fix: Line wrap at \HTML\ hyphen.} % \changes{v0.72}{2019/06/05}{Fix: References for \pkg{xr}, \pkg{xr-hyper}.} % \begin{macrocode} - \LWR@subhyperrefclass{% - \LWR@htmlrefsectionfilename{\BaseJobname-autopage-#4}% - \LWR@origpound\LWR@print@mbox{autosec-#4}% - }{#3}{toc#2}% + \LWR@subhyperrefclass{% + \LWR@htmlrefsectionfilename{\BaseJobname-autopage-#4}% + \LWR@origpound\LWR@print@mbox{autosec-#4}% + }{#3}{toc#2}% % \end{macrocode} % \changes{v0.69}{2019/03/21}{Added support for \pkg{tocdata}.} % \begin{macrocode} - \LWR@maybetocdata% + \LWR@maybetocdata% % \end{macrocode} % \begin{macrocode} - \LWR@stoppars% - }% - {}% -\LWR@traceinfo{hypertoc done}% + \LWR@stoppars% + }% + {}% + \LWR@traceinfo{hypertoc done}% } % \end{macrocode} % \end{macro} @@ -31173,16 +31724,16 @@ autopage-\theLWR@currentautosec% % \DescribeCounter{lofdepth} \TOC\ depth for figures. % \begin{macrocode} \@ifclassloaded{memoir}{}{ -\newcounter{lofdepth} -\setcounter{lofdepth}{1} + \newcounter{lofdepth} + \setcounter{lofdepth}{1} } % \end{macrocode} % \DescribeCounter{lotdepth} \TOC\ depth for tables. % \begin{macrocode} \@ifclassloaded{memoir}{}{ -\newcounter{lotdepth} -\setcounter{lotdepth}{1} + \newcounter{lotdepth} + \setcounter{lotdepth}{1} } % \end{macrocode} @@ -31202,22 +31753,22 @@ autopage-\theLWR@currentautosec% % % \begin{macrocode} \newcommand{\hypertocfloat}[5]{% -\LWR@startpars + \LWR@startpars% % \end{macrocode} % If some float-creation package has not yet defined % the float type's |lofdepth| counter, etc, define it here: % \begin{macrocode} -\@ifundefined{c@#3depth}{% -\newcounter{#3depth}% -\setcounter{#3depth}{1}% -}{}% + \@ifundefined{c@#3depth}{% + \newcounter{#3depth}% + \setcounter{#3depth}{1}% + }{}% % \end{macrocode} % Respond to |lofdepth|, etc.: % \begin{macrocode} -\LWR@traceinfo{hypertocfloat depth is #1 #3depth is \arabic{#3depth}}% -\ifthenelse{\cnttest{#1}{<=}{\arabic{#3depth}}}% - {% - \LWR@startpars% + \LWR@traceinfo{hypertocfloat depth is #1 #3depth is \arabic{#3depth}}% + \ifthenelse{\cnttest{#1}{<=}{\arabic{#3depth}}}% + {% + \LWR@startpars% % \end{macrocode} % % Create an \HTML\ link to @@ -31229,21 +31780,21 @@ autopage-\theLWR@currentautosec% % \changes{v0.47}{2018/01/26}{Fix: Line wrap at \HTML\ hyphen.} % \changes{v0.72}{2019/06/05}{Fix: References for \pkg{xr}, \pkg{xr-hyper}.} % \begin{macrocode} - \LWR@subhyperrefclass{% - \LWR@htmlrefsectionfilename{% - \BaseJobname-autopage-\arabic{LWR@nextautopage}% - }% - \LWR@origpound\LWR@print@mbox{autoid-\arabic{LWR@nextautoid}}}% - {#4}{toc#2}% + \LWR@subhyperrefclass{% + \LWR@htmlrefsectionfilename{% + \BaseJobname-autopage-\arabic{LWR@nextautopage}% + }% + \LWR@origpound\LWR@print@mbox{autoid-\arabic{LWR@nextautoid}}}% + {#4}{toc#2}% % \end{macrocode} % \changes{v0.69}{2019/03/21}{Added support for \pkg{tocdata}.} % \begin{macrocode} - \LWR@maybetocdata% + \LWR@maybetocdata% % \end{macrocode} % \begin{macrocode} - \LWR@stoppars% - }% - {}% + \LWR@stoppars% + }% + {}% } % \end{macrocode} % \end{macro} @@ -31363,16 +31914,19 @@ autopage-\theLWR@currentautosec% % \begin{environment}{theindex} % \begin{macrocode} \@ifundefined{chapter} -{\newcommand*{\LWR@indexsection}[1]{\section*{#1}}} -{\newcommand*{\LWR@indexsection}[1]{\chapter*{#1}}} + {\newcommand*{\LWR@indexsection}[1]{\section*{#1}}} + {\newcommand*{\LWR@indexsection}[1]{\chapter*{#1}}} + \AtBeginDocument{ + \renewenvironment*{theindex}{% \LWR@indexsection{\indexname}% \let\item\LWR@indexitem% \let\subitem\LWR@indexsubitem% \let\subsubitem\LWR@indexsubsubitem% }{} + }% AtBeginDocument % \end{macrocode} % \end{environment} @@ -31386,7 +31940,7 @@ autopage-\theLWR@currentautosec% % \begin{macrocode} \newcommand{\LWR@indexitem}[1][\@empty]{ -\InlineClass{indexitem}{\LWR@htmlcomment{}}#1% + \InlineClass{indexitem}{\LWR@htmlcomment{}}#1% } % \end{macrocode} % \end{macro} @@ -31396,7 +31950,7 @@ autopage-\theLWR@currentautosec% % \begin{macrocode} \newcommand{\LWR@indexsubitem}{ -\InlineClass{indexsubitem}{\LWR@htmlcomment{}} + \InlineClass{indexsubitem}{\LWR@htmlcomment{}}% } % \end{macrocode} % \end{macro} @@ -31406,7 +31960,7 @@ autopage-\theLWR@currentautosec% % \begin{macrocode} \newcommand{\LWR@indexsubsubitem}{ -\InlineClass{indexsubsubitem}{\LWR@htmlcomment{}} + \InlineClass{indexsubsubitem}{\LWR@htmlcomment{}}% } % \end{macrocode} % \end{macro} @@ -31417,12 +31971,13 @@ autopage-\theLWR@currentautosec% % \changes{v0.28}{2017/04/13}{Improved indexing.} % \begin{macrocode} \def\LWR@wrindex#1{% -\addtocounter{LWR@autoindex}{1}% -\LWR@new@label{LWRindex-\arabic{LWR@autoindex}}% -\protected@write\@indexfile{}% -{\string\indexentry{#1}{\arabic{LWR@autoindex}}}% -\endgroup -\@esphack} + \addtocounter{LWR@autoindex}{1}% + \LWR@new@label{LWRindex-\arabic{LWR@autoindex}}% + \protected@write\@indexfile{}% + {\string\indexentry{#1}{\arabic{LWR@autoindex}}}% + \endgroup% + \@esphack% +} \AtBeginDocument{ \let\@wrindex\LWR@wrindex @@ -31435,12 +31990,13 @@ autopage-\theLWR@currentautosec% % Redefined to write the |LWR@latestautopage| counter instead of |page|. % \begin{macrocode} \def\@wrglossary#1{% -\addtocounter{LWR@autoglossary}{1}% -\LWR@new@label{LWRglossary-\theLWR@autoglossary}% -\protected@write\@glossaryfile{}% -{\string\glossaryentry{#1}{\theLWR@autoglossary}}% -\endgroup -\@esphack} + \addtocounter{LWR@autoglossary}{1}% + \LWR@new@label{LWRglossary-\theLWR@autoglossary}% + \protected@write\@glossaryfile{}% + {\string\glossaryentry{#1}{\theLWR@autoglossary}}% + \endgroup% + \@esphack% +} % \end{macrocode} % \end{macro} @@ -31460,9 +32016,9 @@ autopage-\theLWR@currentautosec% % \changes{v0.58}{2018/06/17}{Adds support for \cs{see}, \cs{seealso}, \cs{emph}, \cs{textbf}, etc.} % \begin{macrocode} \newrobustcmd{\LWR@doindexentry}[1]{% -\IfInteger{#1}% - {\LWR@indexnameref{#1}}% - {#1}% + \IfInteger{#1}% + {\LWR@indexnameref{#1}}% + {#1}% } % \end{macrocode} % \end{macro} @@ -31484,19 +32040,19 @@ autopage-\theLWR@currentautosec% % \changes{v0.65}{2018/12/09}{Added \cs{textsi}.} % \begin{macrocode} \newcommand{\LWR@hyperindexrefnullified}{% -\renewrobustcmd{\emph}[1]{\LWR@HTML@emph{\LWR@doindexentry{##1}}}% -\renewrobustcmd{\textbf}[1]{\LWR@HTML@textbf{\LWR@doindexentry{##1}}}% -\renewrobustcmd{\texteb}[1]{\LWR@HTML@texteb{\LWR@doindexentry{##1}}}% -\renewrobustcmd{\textlg}[1]{\LWR@HTML@textlg{\LWR@doindexentry{##1}}}% -\renewrobustcmd{\textrm}[1]{\LWR@HTML@textrm{\LWR@doindexentry{##1}}}% -\renewrobustcmd{\textsf}[1]{\LWR@HTML@textsf{\LWR@doindexentry{##1}}}% -\renewrobustcmd{\texttt}[1]{\LWR@HTML@texttt{\LWR@doindexentry{##1}}}% -\renewrobustcmd{\textup}[1]{\LWR@HTML@textup{\LWR@doindexentry{##1}}}% -\renewrobustcmd{\textsc}[1]{\LWR@HTML@textsc{\LWR@doindexentry{##1}}}% -\renewrobustcmd{\textulc}[1]{\LWR@HTML@textulc{\LWR@doindexentry{##1}}}% -\renewrobustcmd{\textsi}[1]{\LWR@HTML@textsi{\LWR@doindexentry{##1}}}% -\renewrobustcmd{\textit}[1]{\LWR@HTML@textit{\LWR@doindexentry{##1}}}% -\renewrobustcmd{\textsl}[1]{\LWR@HTML@textsl{\LWR@doindexentry{##1}}}% + \renewrobustcmd{\emph}[1]{\LWR@HTML@emph{\LWR@doindexentry{##1}}}% + \renewrobustcmd{\textbf}[1]{\LWR@HTML@textbf{\LWR@doindexentry{##1}}}% + \renewrobustcmd{\texteb}[1]{\LWR@HTML@texteb{\LWR@doindexentry{##1}}}% + \renewrobustcmd{\textlg}[1]{\LWR@HTML@textlg{\LWR@doindexentry{##1}}}% + \renewrobustcmd{\textrm}[1]{\LWR@HTML@textrm{\LWR@doindexentry{##1}}}% + \renewrobustcmd{\textsf}[1]{\LWR@HTML@textsf{\LWR@doindexentry{##1}}}% + \renewrobustcmd{\texttt}[1]{\LWR@HTML@texttt{\LWR@doindexentry{##1}}}% + \renewrobustcmd{\textup}[1]{\LWR@HTML@textup{\LWR@doindexentry{##1}}}% + \renewrobustcmd{\textsc}[1]{\LWR@HTML@textsc{\LWR@doindexentry{##1}}}% + \renewrobustcmd{\textulc}[1]{\LWR@HTML@textulc{\LWR@doindexentry{##1}}}% + \renewrobustcmd{\textsi}[1]{\LWR@HTML@textsi{\LWR@doindexentry{##1}}}% + \renewrobustcmd{\textit}[1]{\LWR@HTML@textit{\LWR@doindexentry{##1}}}% + \renewrobustcmd{\textsl}[1]{\LWR@HTML@textsl{\LWR@doindexentry{##1}}}% } % \end{macrocode} % \end{macro} @@ -31521,24 +32077,24 @@ autopage-\theLWR@currentautosec% % If the first character is a space, remove it first. % ^^A Or use the trimspaces package. % \begin{macrocode} -\def\LWR@tempone{#1}% -\IfBeginWith{\LWR@tempone}{ }{% - \StrGobbleLeft{\LWR@tempone}{1}[\LWR@tempone]% -}{}% + \def\LWR@tempone{#1}% + \IfBeginWith{\LWR@tempone}{ }{% + \StrGobbleLeft{\LWR@tempone}{1}[\LWR@tempone]% + }{}% % \end{macrocode} % If a numeric entry, create a link. % If not numeric, such as \cs{see}, use the entry as-is. % \cs{emph}, \cs{textit}, etc. have been redefined above to create and % format the entry. % \begin{macrocode} -\IfInteger{\LWR@tempone}% - {\LWR@indexnameref{\LWR@tempone}}% - {% - \begingroup% - \LWR@hyperindexrefnullified - #1% - \endgroup% - }% + \IfInteger{\LWR@tempone}% + {\LWR@indexnameref{\LWR@tempone}}% + {% + \begingroup% + \LWR@hyperindexrefnullified% + #1% + \endgroup% + }% } % \end{macrocode} % \end{macro} @@ -31625,7 +32181,9 @@ autopage-\theLWR@currentautosec% % \changes{v0.45}{2018/01/13}{Patched to emphasize titles.} % \begin{macrocode} \AtBeginDocument{ + \AtBeginEnvironment{thebibliography}{ + \providecommand*{\LWR@newem}[1]{\textit{#1}} \renewrobustcmd{\em}{% @@ -31640,7 +32198,9 @@ autopage-\theLWR@currentautosec% \endgroup \LWR@em@after\egroup } + }% \AtBeginEnvironment{thebibliography} + }% \AtBeginDocument % \end{macrocode} % \end{environment} @@ -31683,82 +32243,82 @@ autopage-\theLWR@currentautosec% % \begin{macrocode} \newcommand*{\LWR@restoreorigformatting}{% -\LWR@traceinfo{LWR@restoreorigformatting}% + \LWR@traceinfo{LWR@restoreorigformatting}% % \end{macrocode} % Numerous macros change their print/\HTML\ meaning depending on \cs{LWR@formatting}: % \begin{macrocode} -\renewcommand*{\LWR@formatting}{print}% -\linespread{1}% + \renewcommand*{\LWR@formatting}{print}% + \linespread{1}% % \end{macrocode} % % \begin{macrocode} -\let\par\LWR@origpar% + \let\par\LWR@origpar% % \end{macrocode} % % \begin{macrocode} -\LWR@select@print@hspace% + \LWR@select@print@hspace% % \end{macrocode} % % \changes{v0.48}{2018/02/04}{Fix: Spacing in \SVG\ math, \env{lateximage}, \tikz.} % \begin{macrocode} -\LetLtxMacro\hfil\LWR@orighfil% -\let\hss\LWR@orighss% -\let\llap\LWR@origllap% -\let\rlap\LWR@origrlap% -\let\hfilneg\LWR@orighfilneg% + \LetLtxMacro\hfil\LWR@orighfil% + \let\hss\LWR@orighss% + \let\llap\LWR@origllap% + \let\rlap\LWR@origrlap% + \let\hfilneg\LWR@orighfilneg% % \end{macrocode} % \begin{macrocode} -\let\,\LWR@origcomma% disable HTML short unbreakable space -\let\thinspace\LWR@origthinspace% disable HTML short unbreakable space -\let\negthinspace\LWR@orignegthinspace% disable HTML negative short unbreakable space -\let\textellipsis\LWR@origtextellipsis% -\let\textless\LWR@origtextless% -\let\textgreater\LWR@origtextgreater% + \let\,\LWR@origcomma% disable HTML short unbreakable space + \let\thinspace\LWR@origthinspace% disable HTML short unbreakable space + \let\negthinspace\LWR@orignegthinspace% disable HTML negative short unbreakable space + \let\textellipsis\LWR@origtextellipsis% + \let\textless\LWR@origtextless% + \let\textgreater\LWR@origtextgreater% % \end{macrocode} % \changes{v0.70}{2019/03/28}{Fix: \cs{\&} in a lateximage.} % \begin{macrocode} -\let\&\LWR@origampersand% + \let\&\LWR@origampersand% % \end{macrocode} % \changes{v0.72}{2019/05/24}{Use \cs{LWR@formatted} for \cs{bfseries}, etc.} % \begin{macrocode} -\LetLtxMacro\em\LWR@origem% -\LetLtxMacro\normalfont\LWR@orignormalfont% -\let\sp\LWR@origsp% -\let\sb\LWR@origsb% -\LetLtxMacro\textsuperscript\LWR@origtextsuperscript% -\LetLtxMacro\@textsuperscript\LWR@orig@textsuperscript% -\LetLtxMacro\textsubscript\LWR@origtextsubscript% -\LetLtxMacro\@textsubscript\LWR@orig@textsubscript% -\LetLtxMacro\underline\LWR@origunderline% -\let~\LWR@origtilde% -\let\enskip\LWR@origenskip% -\let\quad\LWR@origquad% -\let\qquad\LWR@origqquad% + \LetLtxMacro\em\LWR@origem% + \LetLtxMacro\normalfont\LWR@orignormalfont% + \let\sp\LWR@origsp% + \let\sb\LWR@origsb% + \LetLtxMacro\textsuperscript\LWR@origtextsuperscript% + \LetLtxMacro\@textsuperscript\LWR@orig@textsuperscript% + \LetLtxMacro\textsubscript\LWR@origtextsubscript% + \LetLtxMacro\@textsubscript\LWR@orig@textsubscript% + \LetLtxMacro\underline\LWR@origunderline% + \let~\LWR@origtilde% + \let\enskip\LWR@origenskip% + \let\quad\LWR@origquad% + \let\qquad\LWR@origqquad% % \end{macrocode} % % \cs{endtabular} must be restored to its original, % instead of relying on \pkg{lwarp}'s \cs{LWR@formatted} mechanism: % \changes{v0.65}{2018/12/16}{Fix: \env{tabular*}.} % \begin{macrocode} -\LetLtxMacro\endtabular\LWR@origendtabular% -\csletcs{endtabular*}{LWR@origendtabular*}% + \LetLtxMacro\endtabular\LWR@origendtabular% + \csletcs{endtabular*}{LWR@origendtabular*}% % \end{macrocode} % \begin{macrocode} -\LetLtxMacro\noalign\LWR@orignoalign% -\LetLtxMacro\hline\LWR@orighline% + \LetLtxMacro\noalign\LWR@orignoalign% + \LetLtxMacro\hline\LWR@orighline% % \end{macrocode} % \begin{macrocode} -\let\newline\LWR@orignewline% -\LetLtxMacro\includegraphics\LWR@origincludegraphics% + \let\newline\LWR@orignewline% + \LetLtxMacro\includegraphics\LWR@origincludegraphics% % \end{macrocode} % \changes{v0.42}{2017/10/16}{Improved \cs{ensuremath}.} % \begin{macrocode} -\LetLtxMacro\@ensuredmath\LWR@origensuredmath% + \LetLtxMacro\@ensuredmath\LWR@origensuredmath% % -\LWR@restoreorigaccents% -\LWR@restoreoriglists% + \LWR@restoreorigaccents% + \LWR@restoreoriglists% % -\LWR@FBcancel% + \LWR@FBcancel% } % \end{macrocode} % \end{macro} @@ -31776,19 +32336,10 @@ autopage-\theLWR@currentautosec% % % \subsection{Limitations} % -% \limitsmath +% See \nameref{sec:limitsmath}, \cref{sec:limitsmath}. % -% \subsubsection{Catcode changes} -% \limitsmathcatcode % -% \subsubsection{Complicated inline math objects} -% \limitsmathinline -% -% \subsubsection{Complicated display math objects} % -% \limitsmathdisplay - - % \subsection{\HTML\ \attribute{alt} tag names} % % Redefinable names for the \HTML\ \attribute{alt} tags, @@ -31801,7 +32352,7 @@ autopage-\theLWR@currentautosec% % \begin{macro}{\AltTextOpen} The opening part of \HTML\ \attribute{alt} tag for -% an image. The default is a left parenthesis. +% an image. The default is a left parenthesis. \\ % \DescribeDefault{(} % \changes{v0.74}{2019/08/20}{Added.} % \begin{macrocode} @@ -31811,7 +32362,7 @@ autopage-\theLWR@currentautosec% % \begin{macro}{\AltTextClose} The closing part of \HTML\ \attribute{alt} tag for -% an image. The default is a right parenthesis. +% an image. The default is a right parenthesis. \\ % \DescribeDefault{(} % \changes{v0.74}{2019/08/20}{Added.} % \begin{macrocode} @@ -31976,9 +32527,9 @@ autopage-\theLWR@currentautosec% \let\LWR@origtextdollar\$ \renewcommand*{\$}{% -\ifnumcomp{\value{LWR@lateximagedepth}}{>}{0}% -{\LWR@origtextdollar}% -{\HTMLunicode{00024}}% + \ifnumcomp{\value{LWR@lateximagedepth}}{>}{0}% + {\LWR@origtextdollar}% + {\HTMLunicode{00024}}% } % \end{macrocode} @@ -32058,86 +32609,39 @@ autopage-\theLWR@currentautosec% % \end{macro} -% \begin{macro}{\LWR@subsingledollar} * \marg{2: alt text} \marg{3: add'l hashing} -% \marg{4: math expression} -% -% For inline math. -% Uses MathJax, or for \SVG\ math the image is measured and ajusted to the baseline -% of the \HTML\ output, and placed inside a \env{lateximage}. -% -% \describehashing -% -% \changes{v0.19}{2016/05/25}{\brand{MathJax} support.} -% \changes{v0.42}{2017/10/26}{If \progcode{FormatWP} print LaTeX expression.} -% \changes{v0.47}{2018/01/24}{Added \SVG\ math image baseline adjust and em sizing.} -% \changes{v0.50}{2018/02/23}{Fix: Use \env{lateximage} even if MathJax.} -% \changes{v0.50}{2018/02/24}{Improved \SVG\ math \attribute{alt} tags.} +% \DescribeBoolean{LWR@unknownmathsize} +% If \tikz\ or other objects are used inside math mode, the resulting +% image may exceed the \TeX\ box, resulting in an incorrect measurement of +% the size of the resulting image. If this is so, the \HTML\ styles for +% image size and depth will be neutralized. % \begin{macrocode} -\newlength{\LWR@singledollarwidth} -\newlength{\LWR@singledollarheight} -\newlength{\LWR@singledollardepth} +\newbool{LWR@unknownmathsize} +% \end{macrocode} -\newsavebox{\LWR@singledollarbox} -\NewDocumentCommand{\LWR@subsingledollar}{s m m m}{% -\LWR@traceinfo{LWR@subsingledollar}% -% \end{macrocode} -% \begin{macrocode} -\ifnumcomp{\value{LWR@lateximagedepth}}{>}{0}% -{% -\LWR@traceinfo{LWR@subsingledollar: already in a lateximage}% - #4% contents -}% -{% not in a lateximage -\begingroup% -% \end{macrocode} -% Support for \pkg{xfakebold}: -% \changes{v0.67}{2019/02/17}{\pkg{xfakebold}: Added support.} -% \begin{macrocode} -\LWR@applyxfakebold% -% \end{macrocode} -% MathJax cannot parse the often complicated \TeX\ expressions which -% appear in the various uses of \cs{ensuredmath}. -% \cs{ensuremath} forces the \attribute{alt} tag to ``|(math image)|'', as -% translated according to \cs{MathImageAltText}. -% If this is the case, force the use of a \env{lateximage} even if MathJax. -% Likewise for \pkg{siunitx} if |parse-numbers=false|. +% \begin{macro}{\LWR@singledollarmeasure} \marg{math expression} % -% If MathJax, or if formatting math for a word processor, and not \cs{ensuredmath}, -% and not a dynamic math expression, print the math expression: -% \changes{v0.51}{2018/03/11}{Fix: \cs{ensuredmath} inside \SVG\ image.} -% \changes{v0.57}{2018/05/23}{Fix: Dynamic inline math expressions.} -% \begin{macrocode} -\ifboolexpr{% - ( - bool{mathjax} or - ( bool{FormatWP} and bool{WPMarkMath} ) - ) and - ( not test { - \ifstrequal {#2} - {\AltTextOpen\MathImageAltText\AltTextClose} % from \ensuredmath - } - ) and - ( not bool{LWR@dynamicmath} ) -}% -% \end{macrocode} -% For \brand{MathJax}, print the math between |\(| and |\)|: -% \begin{macrocode} -{% - \LWR@traceinfo{LWR@subsingledollar: Mathjax}% - {\textbackslash(\LWR@HTMLsanitize{#4}\textbackslash)}% -}% mathjax -% \end{macrocode} -% For SVG, print the math inside a \env{lateximage}, -% with an \element{alt} tag of the \LaTeX\ code, -% and a \CSS\ style to control the baseline adjustment. -% \begin{macrocode} -{% not mathjax -\LWR@traceinfo{LWR@subsingledollar: NOT mathjax, or is ensuremath, or is dynamic}% -% \end{macrocode} -% Measure the depth, width, and height of the math image: -% \changes{v0.51}{2018/03/04}{Fix: SVG math with enclosed \env{lateximage}.} +% Measures the size of the image of the math expression. +% +% (In some circumstances \SVG\ math is used even if \brand{MathJax} is +% preferred.) +% +% \begin{description} +% \item [SVG math:] \cs{LWR@origensuredmath} is part of argument \#4. +% \item [SVG math \cs{ensuremath}:] \cs{LWR@origensuredmath} is part of argument \#4. +% \item [SVG dynamic math:] \cs{LWR@origensuredmath} is part of argument \#4. +% \item [Mathjax:] Argument \#4 is the contents of the math expression +% without \cs{LWR@origensuredmath}. This case is handled above. +% \item [Mathjax \cs{ensuremath}:] \cs{LWR@origensuredmath} is part of argument \#4. +% \item [Mathjax dynamic math:] Argument \#4 is the contents of the math expression +% without \cs{LWR@origensuredmath}, so \cs{LWR@origensuredmath} is added below.\ +% \item [\cs{ifmmode}:] Included ``just in case''. +% \end{description} +% +% Factored from \cs{LWR@subsingledollarsvg}. +% \changes{v0.79}{2019/12/14}{Factored.} % \begin{macrocode} +\newcommand*{\LWR@singledollarmeasure}[1]{% \begingroup% % \end{macrocode} % Temporarily disable formatting while measuring the image parameters: @@ -32158,34 +32662,28 @@ autopage-\theLWR@currentautosec% % \begin{macrocode} \global\advance\c@LWR@lateximagedepth 1\relax% % \end{macrocode} -% Typeset and save the contents, depending on how they were generated: -% \begin{description} -% \item [SVG math:] \cs{LWR@origensuredmath} is part of argument \#4. -% \item [SVG math \cs{ensuremath}:] \cs{LWR@origensuredmath} is part of argument \#4. -% \item [SVG dynamic math:] \cs{LWR@origensuredmath} is part of argument \#4. -% \item [Mathjax:] Argument \#4 is the contents of the math expression -% without \cs{LWR@origensuredmath}. This case is handled above. -% \item [Mathjax \cs{ensuremath}:] \cs{LWR@origensuredmath} is part of argument \#4. -% \item [Mathjax dynamic math:] Argument \#4 is the contents of the math expression -% without \cs{LWR@origensuredmath}, so \cs{LWR@origensuredmath} is added below.\ -% \item [\cs{ifmmode}:] Included ``just in case''. -% \end{description} +% +% Typeset the math in a box. +% While doing so, some macros or environments may set \bool{LWR@unknownmathsize}, +% in which case this will be used to cancel the \HTML\ styles being generated here. % % \changes{v0.51}{2018/03/07}{Fix: \env{lateximage} inside \AmS\ \cs{text}.} % \changes{v0.51}{2018/03/12}{Typeset \SVG\ math only once during measurement.} % \changes{v0.57}{2018/05/23}{Fix: Dynamic inline math expressions.} % \begin{macrocode} + \boolfalse{LWR@unknownmathsize}% \ifmmode% - \global\sbox{\LWR@singledollarbox}{#4}% + \global\sbox{\LWR@singledollarbox}{#1}% \else% \ifbool{LWR@dynamicmath}{% \ifbool{mathjax}{% - \global\sbox{\LWR@singledollarbox}{\LWR@origensuredmath{#4}}% + \global\sbox{\LWR@singledollarbox}% + {\LWR@origensuredmath{#1}}% }{% - \global\sbox{\LWR@singledollarbox}{#4}% + \global\sbox{\LWR@singledollarbox}{#1}% }% }{% - \global\sbox{\LWR@singledollarbox}{#4}% + \global\sbox{\LWR@singledollarbox}{#1}% }% \fi% % \end{macrocode} @@ -32238,6 +32736,30 @@ autopage-\theLWR@currentautosec% % \end{macrocode} % \begin{macrocode} \endgroup% +} +% \end{macrocode} +% \end{macro} + + +% \begin{macro}{\LWR@subsingledollarsvg} * \marg{2: alt text} \marg{3: add'l hashing} +% \marg{4: math expression} +% +% For inline math. +% Uses \SVG\ math. The image is measured and ajusted to the baseline +% of the \HTML\ output, and placed inside a \env{lateximage}. +% +% (In some circumstances \SVG\ math is used even if \brand{MathJax} is +% preferred.) +% +% Factored from \cs{LWR@subsingledollar}. +% \changes{v0.79}{2019/12/14}{Factored.} +% \begin{macrocode} +\newcommand*{\LWR@subsingledollarsvg}[4]{% +% \end{macrocode} +% Measure the depth, width, and height of the math image: +% \changes{v0.51}{2018/03/04}{Fix: SVG math with enclosed \env{lateximage}.} +% \begin{macrocode} + \LWR@singledollarmeasure{#4}% % \end{macrocode} % % Set a style for the the height or width. @@ -32290,6 +32812,18 @@ autopage-\theLWR@currentautosec% \def\LWR@singledollardepthstyle{}% }% % \end{macrocode} +% +% If using certain \tikz\ actions inside math, the resulting image may exceed the +% \TeX\ boundaries, so the \HTML\ size styles may be incorrect, and must +% be neutralized. +% \changes{v0.79}{2020/01/31}{Adjust for unknown size.} +% \begin{macrocode} + \ifbool{LWR@unknownmathsize}{% + \def\LWR@singledollarstyle{}% + \def\LWR@singledollardepthstyle{}% + }{}% +% \end{macrocode} +% % Create the \env{lateximage} using the alternate tag and the computed % size and depth. % The star causes \env{lateximage} to use an MD5 hash as the filename. @@ -32304,9 +32838,9 @@ autopage-\theLWR@currentautosec% [\MathImageAltText]% alt tag []% no add'l hashing [\LWR@singledollarstyle \LWR@singledollardepthstyle]% CSS - }{% + }{% not dynamic math \LWR@traceinfo{subsingledollar: static}% - \IfValueTF{#1}{% + \IfValueTF{#1}{% #1 True \LWR@findcurrenttextcolor% sets \LWR@tempcolor % \end{macrocode} % Support for \pkg{xfakebold}: @@ -32330,13 +32864,13 @@ autopage-\theLWR@currentautosec% FB\LWR@tempone% xfakebold ]% [\LWR@singledollarstyle \LWR@singledollardepthstyle]% CSS - }{% + }{% #1 False \begin{lateximage}% no hashing [#2]% alt []% no add'l hashing [\LWR@singledollarstyle \LWR@singledollardepthstyle]% CSS }% - }% + }% not dynamic math % \end{macrocode} % Place small and almost transparent markers on the baseline % at the left and right edges of the image. @@ -32366,15 +32900,110 @@ autopage-\theLWR@currentautosec% % \begin{macrocode} \end{lateximage}% % -}% not mathjax -\endgroup% -}% not in a lateximage +} +% \end{macrocode} +% \end{macro} + + +% \begin{macro}{\LWR@subsingledollar} * \marg{2: alt text} \marg{3: add'l hashing} +% \marg{4: math expression} +% +% For inline math. +% Uses MathJax, or for \SVG\ math the image is measured and ajusted to the baseline +% of the \HTML\ output, and placed inside a \env{lateximage}. +% +% \begin{description} +% \item [SVG math:] \cs{LWR@origensuredmath} is part of argument \#4. +% \item [SVG math \cs{ensuremath}:] \cs{LWR@origensuredmath} is part of argument \#4. +% \item [SVG dynamic math:] \cs{LWR@origensuredmath} is part of argument \#4. +% \item [Mathjax:] Argument \#4 is the contents of the math expression +% without \cs{LWR@origensuredmath}. This case is handled above. +% \item [Mathjax \cs{ensuremath}:] \cs{LWR@origensuredmath} is part of argument \#4. +% \item [Mathjax dynamic math:] Argument \#4 is the contents of the math expression +% without \cs{LWR@origensuredmath}, so \cs{LWR@origensuredmath} is added below.\ +% \end{description} +% +% \describehashing +% +% \changes{v0.19}{2016/05/25}{\brand{MathJax} support.} +% \changes{v0.42}{2017/10/26}{If \progcode{FormatWP} print LaTeX expression.} +% \changes{v0.47}{2018/01/24}{Added \SVG\ math image baseline adjust and em sizing.} +% \changes{v0.50}{2018/02/23}{Fix: Use \env{lateximage} even if MathJax.} +% \changes{v0.50}{2018/02/24}{Improved \SVG\ math \attribute{alt} tags.} +% \begin{macrocode} +\newlength{\LWR@singledollarwidth} +\newlength{\LWR@singledollarheight} +\newlength{\LWR@singledollardepth} + +\newsavebox{\LWR@singledollarbox} + +\NewDocumentCommand{\LWR@subsingledollar}{s m m m}{% + \LWR@traceinfo{LWR@subsingledollar}% +% \end{macrocode} +% \begin{macrocode} + \ifnumcomp{\value{LWR@lateximagedepth}}{>}{0}% + {% + \LWR@traceinfo{LWR@subsingledollar: already in a lateximage}% + #4% contents + }% + {% not in a lateximage + \begingroup% +% \end{macrocode} +% Support for \pkg{xfakebold}: +% \changes{v0.67}{2019/02/17}{\pkg{xfakebold}: Added support.} +% \begin{macrocode} + \LWR@applyxfakebold% +% \end{macrocode} +% MathJax cannot parse the often complicated \TeX\ expressions which +% appear in the various uses of \cs{ensuredmath}. +% \cs{ensuremath} forces the \attribute{alt} tag to ``|(math image)|'', as +% translated according to \cs{MathImageAltText}. +% If this is the case, force the use of a \env{lateximage} even if MathJax. +% Likewise for \pkg{siunitx} if |parse-numbers=false|. +% +% If MathJax, or if formatting math for a word processor, and not \cs{ensuredmath}, +% and not a dynamic math expression, print the math expression: +% \changes{v0.51}{2018/03/11}{Fix: \cs{ensuredmath} inside \SVG\ image.} +% \changes{v0.57}{2018/05/23}{Fix: Dynamic inline math expressions.} +% \begin{macrocode} + \ifboolexpr{% + ( + bool{mathjax} or + ( bool{FormatWP} and bool{WPMarkMath} ) + ) and + ( not test { + \ifstrequal {#2}% from \ensuredmath + {\AltTextOpen\MathImageAltText\AltTextClose} + } + ) and + ( not bool{LWR@dynamicmath} ) + }% +% \end{macrocode} +% For \brand{MathJax}, print the math between |\(| and |\)|: +% \begin{macrocode} + {% + \LWR@traceinfo{LWR@subsingledollar: Mathjax}% + {\textbackslash(\LWR@HTMLsanitize{#4}\textbackslash)}% + }% mathjax +% \end{macrocode} +% For SVG, print the math inside a \env{lateximage}, +% with an \element{alt} tag of the \LaTeX\ code, +% and a \CSS\ style to control the baseline adjustment. +% \begin{macrocode} + {% not mathjax + \LWR@traceinfo{% + LWR@subsingledollar: NOT mathjax, or is ensuremath, or is dynamic% + }% + \LWR@subsingledollarsvg{#1}{#2}{#3}{#4}% + }% not mathjax + \endgroup% + }% not in a lateximage % \end{macrocode} % Clear the single-use \attribute{alt} text: % \changes{v0.74}{2019/08/20}{Add \cs{ThisAltText}.} % \begin{macrocode} -\gdef\LWR@ThisAltText{}% -\LWR@traceinfo{LWR@subsingledollar: done}% + \gdef\LWR@ThisAltText{}% + \LWR@traceinfo{LWR@subsingledollar: done}% } % \end{macrocode} % \end{macro} @@ -32542,39 +33171,38 @@ autopage-\theLWR@currentautosec% \LetLtxMacro\LWR@origensuredmath\@ensuredmath \renewcommand{\@ensuredmath}[1]{% -\ifbool{mathjax}{% - \LWR@subsingledollar*{\AltTextOpen\MathImageAltText\AltTextClose}{% - \protect\LWR@HTMLsanitize{\detokenize\expandafter{#1}}% - }{\relax% - \LWR@origensuredmath{#1}% - }% -}{% SVG math + \ifbool{mathjax}{% + \LWR@subsingledollar*{\AltTextOpen\MathImageAltText\AltTextClose}{% + \protect\LWR@HTMLsanitize{\detokenize\expandafter{#1}}% + }{\relax% + \LWR@origensuredmath{#1}% + }% + }{% SVG math % \end{macrocode} % If already inside a \env{lateximage} in math mode, continue as-is. % \begin{macrocode} -\ifmmode% - \LWR@origensuredmath{#1}% -\else% + \ifmmode% + \LWR@origensuredmath{#1}% + \else% % \end{macrocode} % Create an inline math \env{lateximage} with a simple \attribute{alt} tag % and additional hashing according to the contents. % \begin{macrocode} - \ifnumcomp{\value{LWR@lateximagedepth}}{>}{0}% - {\LWR@origensuredmath{#1}}% - {% - \LWR@subsingledollar*{\AltTextOpen\MathImageAltText\AltTextClose}{% - \protect\LWR@HTMLsanitize{\detokenize\expandafter{#1}}% - }{% - \LWR@origensuredmath{#1}% - }% + \ifnumcomp{\value{LWR@lateximagedepth}}{>}{0}% + {\LWR@origensuredmath{#1}}% + {% + \LWR@subsingledollar*% + {\AltTextOpen\MathImageAltText\AltTextClose}% + {\protect\LWR@HTMLsanitize{\detokenize\expandafter{#1}}}% + {\LWR@origensuredmath{#1}}% + }% + \fi% }% -\fi% -}% % \end{macrocode} % Clear the single-use \attribute{alt} text: % \changes{v0.74}{2019/08/20}{Add \cs{ThisAltText}.} % \begin{macrocode} -\gdef\LWR@ThisAltText{}% + \gdef\LWR@ThisAltText{}% } % \end{macrocode} % \end{macro} @@ -32682,35 +33310,35 @@ autopage-\theLWR@currentautosec% % If using chapters, place the chapter number in front of the equation. % Otherwise, use the simple equation number. % \begin{macrocode} -\ifcsdef{thechapter}{ - \InlineClass{hidden}{ - \textbackslash( - \textbackslash{}seteqsection \{\thechapter\} - \textbackslash) + \ifcsdef{thechapter}{ + \InlineClass{hidden}{ + \textbackslash( + \textbackslash{}seteqsection \{\thechapter\} + \textbackslash) + } } -} -{}% not using chapters + {}% not using chapters % \end{macrocode} % \brand{MathJax} doesn't allow setting the equation number to 1: % \begin{macrocode} -\ifthenelse{\cnttest{\value{equation}}>0} -{ + \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} + \setcounter{LWR@nextequation}{\value{equation}} + \addtocounter{LWR@nextequation}{1} % \end{macrocode} % Place the \brand{MathJax} command inside ``\cs{(}'' and ``\cs{)}'' characters, % to be printed to \HTML, not interpreted by \LaTeX. % \begin{macrocode} - \InlineClass{hidden}{ - \textbackslash( - \textbackslash{}seteqnumber \{\arabic{LWR@nextequation}\} - \textbackslash) - } -}{}% not eq > 0 + \InlineClass{hidden}{ + \textbackslash( + \textbackslash{}seteqnumber \{\arabic{LWR@nextequation}\} + \textbackslash) + } + }{}% not eq > 0 } % \end{macrocode} % \end{macro} @@ -32725,19 +33353,19 @@ autopage-\theLWR@currentautosec% % \end{macrocode} % Stop \HTML\ paragraph handling and open an \HTML\ comment: % \begin{macrocode} -\LWR@stoppars -\LWR@htmlopencomment + \LWR@stoppars + \LWR@htmlopencomment % \end{macrocode} % Start the \LaTeX\ math environment inside the \HTML\ comment: % \begin{macrocode} -\begingroup -\@nameuse{LWR@orig#1} + \begingroup + \@nameuse{LWR@orig#1} % \end{macrocode} % While in the math environment, % restore various commands to their \LaTeX\ meanings. % \begin{macrocode} -\LWR@restoreorigformatting + \LWR@restoreorigformatting % \end{macrocode} % ^^A When a label is encountered, the \HTML\ comment is closed, % ^^A the label is generated in an \HTML-output context, @@ -32746,18 +33374,18 @@ autopage-\theLWR@currentautosec% % % Print the contents of the equation: % \begin{macrocode} -#2 + #2 % \end{macrocode} % End the \LaTeX{} math environment inside the \HTML\ comment: % \begin{macrocode} -\@nameuse{LWR@origend#1} -\endgroup + \@nameuse{LWR@origend#1} + \endgroup % \end{macrocode} % Close the \HTML\ comment and resume \HTML\ paragraph handling: % \begin{macrocode} -\LWR@htmlclosecomment -\LWR@startpars + \LWR@htmlclosecomment + \LWR@startpars } % \end{macrocode} % \end{macro} @@ -32773,17 +33401,17 @@ autopage-\theLWR@currentautosec% % \end{macrocode} % Enclose the \brand{MathJax} environment inside printed ``\cs{(}'' and ``\cs{)}'' characters. % \begin{macrocode} -\LWR@origtilde\LWR@orignewline -\textbackslash{}begin\{#1\} + \LWR@origtilde\LWR@orignewline + \textbackslash{}begin\{#1\} % \end{macrocode} % Print the contents, sanitizing for \HTML\ special characters. % \begin{macrocode} -\LWR@HTMLsanitizeexpand{\detokenize\expandafter{#2}} + \LWR@HTMLsanitizeexpand{\detokenize\expandafter{#2}} % \end{macrocode} % Close the \brand{MathJax} environment: % \begin{macrocode} -\textbackslash{}end\{#1\} -\LWR@orignewline + \textbackslash{}end\{#1\} + \LWR@orignewline } % \end{macrocode} % \end{macro} @@ -32826,75 +33454,75 @@ autopage-\theLWR@currentautosec% % 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} ) }% + \ifboolexpr{bool{mathjax} or ( bool{FormatWP} and bool{WPMarkMath} ) }% % \end{macrocode} % \brand{MathJax} output: % \begin{macrocode} -{ + { % \end{macrocode} % Print commands to syncronize \brand{MathJax}'s equation number and format % to the current \LaTeX\ chapter/section and equation number: % \begin{macrocode} - \LWR@syncmathjax + \LWR@syncmathjax % \end{macrocode} % Print the \LaTeX\ math inside an \HTML\ comment: % \begin{macrocode} - \LWR@hidelatexequation{#2}{#1} -} + \LWR@hidelatexequation{#2}{#1} + } % \end{macrocode} % SVG output: % Create the |lateximage| along with an \HTML\ \element{alt} tag % having an equation number, the \LaTeX{} equation environment % commmands, and the contents of the environment's \cs{BODY}. % \begin{macrocode} -{% not mathjax + {% not mathjax % \end{macrocode} % Begin the \env{lateximage} with an \element{alt} tag containing the math source: % \changes{v0.50}{2018/03/02}{Improved \SVG\ math display.} % \changes{v0.51}{2018/03/11}{Fix: \cs{addcontentsline} inside \SVG\ math. Provides an autoid anchor.} % \changes{v0.52}{2018/03/31}{Fix: \env{equation*} now based on \env{equation} instead of \env{displaymath}.} % \begin{macrocode} - \ifstrequal{#2}{equation*}{% - \begin{BlockClass}{displaymath}% - }{% - \begin{BlockClass}{displaymathnumbered}% - }% - \LWR@newautoidanchor% - \booltrue{LWR@indisplaymathimage}% - \begin{lateximage}[% \ifstrequal{#2}{equation*}{% - \ifdefequal{\LWR@equationtag}{\theequation}{% -% no tag was given - }{% - (\LWR@equationtag) % tag was given - }% + \begin{BlockClass}{displaymath}% }{% - (\LWR@equationtag) % automatic numbering + \begin{BlockClass}{displaymathnumbered}% }% - \textbackslash{begin\{#2\}} % extra space - \LWR@HTMLsanitizeexpand{\detokenize\expandafter{#1}} % extra space - \textbackslash{end\{#2\}}% - ]*% alt tag + \LWR@newautoidanchor% + \booltrue{LWR@indisplaymathimage}% + \begin{lateximage}[% + \ifstrequal{#2}{equation*}{% + \ifdefequal{\LWR@equationtag}{\theequation}{% + % no tag was given + }{% + (\LWR@equationtag) % tag was given + }% + }{% + (\LWR@equationtag) % automatic numbering + }% + \textbackslash{begin\{#2\}} % extra space + \LWR@HTMLsanitizeexpand{\detokenize\expandafter{#1}} % extra space + \textbackslash{end\{#2\}}% + ]*% alt tag % \end{macrocode} % Support for \pkg{xfakebold}: % \changes{v0.67}{2019/02/17}{\pkg{xfakebold}: Added support.} % \begin{macrocode} - \LWR@applyxfakebold% + \LWR@applyxfakebold% % \end{macrocode} % Create the actual \LaTeX-formatted equation inside % the |lateximage| using the contents of the environment. % \begin{macrocode} - \@nameuse{LWR@orig#2}% - #1% contents collected by \collect@body - \@nameuse{LWR@origend#2}% - \end{lateximage}% - \end{BlockClass}% -}% not mathjax + \@nameuse{LWR@orig#2}% + #1% contents collected by \collect@body + \@nameuse{LWR@origend#2}% + \end{lateximage}% + \end{BlockClass}% + }% not mathjax % \end{macrocode} % Clear the single-use \attribute{alt} text: % \changes{v0.74}{2019/08/20}{Add \cs{ThisAltText}.} % \begin{macrocode} -\gdef\LWR@ThisAltText{}% + \gdef\LWR@ThisAltText{}% } % \end{macrocode} % @@ -32912,7 +33540,7 @@ autopage-\theLWR@currentautosec% % Clear the single-use \attribute{alt} text: % \changes{v0.74}{2019/08/20}{Add \cs{ThisAltText}.} % \begin{macrocode} -\gdef\LWR@ThisAltText{}% + \gdef\LWR@ThisAltText{}% } % \end{macrocode} % \end{macro} @@ -32936,13 +33564,15 @@ autopage-\theLWR@currentautosec% % macro called \cs{BODY}. % \begin{macrocode} \AtBeginDocument{ + \NewEnviron{equation}% -{\LWR@doequation{\BODY}{equation}}% -[\LWR@doendequation{equation}] + {\LWR@doequation{\BODY}{equation}}% + [\LWR@doendequation{equation}] \LetLtxMacro\LWR@equationnormal\equation \LetLtxMacro\endLWR@equationnormal\endequation -} + +}% AtBeginDocument % \end{macrocode} % \end{environment} @@ -32950,13 +33580,15 @@ autopage-\theLWR@currentautosec% % \begin{environment}{equation*} % \begin{macrocode} \AtBeginDocument{ + \NewEnviron{equation*}% -{\LWR@doequation{\BODY}{equation*}}% -[\LWR@doendequation{equation*}] + {\LWR@doequation{\BODY}{equation*}}% + [\LWR@doendequation{equation*}] \csletcs{LWR@equationnormalstar}{equation*} \csletcs{LWR@endequationnormalstar}{endequation*} -} + +}% AtBeginDocument % \end{macrocode} % \end{environment} @@ -32984,15 +33616,15 @@ autopage-\theLWR@currentautosec% % \changes{v0.51}{2018/03/21}{Processing for complicated display math.} % \begin{macrocode} \newcommand*{\displaymathnormal}{% -\ifbool{LWR@origmathjax}{\booltrue{mathjax}}{\boolfalse{mathjax}}% -\LetLtxMacro\[\LWR@openbracketnormal% -\LetLtxMacro\]\LWR@closebracketnormal% -\LetLtxMacro\displaymath\LWR@displaymathnormal% -\LetLtxMacro\enddisplaymath\endLWR@displaymathnormal% -\LetLtxMacro\equation\LWR@equationnormal% -\LetLtxMacro\endequation\endLWR@equationnormal% -\csletcs{equation*}{LWR@equationnormalstar}% -\csletcs{endequation*}{LWR@endequationnormalstar}% + \ifbool{LWR@origmathjax}{\booltrue{mathjax}}{\boolfalse{mathjax}}% + \LetLtxMacro\[\LWR@openbracketnormal% + \LetLtxMacro\]\LWR@closebracketnormal% + \LetLtxMacro\displaymath\LWR@displaymathnormal% + \LetLtxMacro\enddisplaymath\endLWR@displaymathnormal% + \LetLtxMacro\equation\LWR@equationnormal% + \LetLtxMacro\endequation\endLWR@equationnormal% + \csletcs{equation*}{LWR@equationnormalstar}% + \csletcs{endequation*}{LWR@endequationnormalstar}% } % \end{macrocode} % \end{macro} @@ -33005,15 +33637,15 @@ autopage-\theLWR@currentautosec% % \changes{v0.51}{2018/03/21}{Processing for complicated display math.} % \begin{macrocode} \newcommand*{\displaymathother}{% -\boolfalse{mathjax}% -\LetLtxMacro\displaymath\LWR@displaymathother% -\LetLtxMacro\enddisplaymath\endLWR@displaymathother% -\LetLtxMacro\[\LWR@displaymathother% -\LetLtxMacro\]\endLWR@displaymathother% -\LetLtxMacro\equation\LWR@equationother% -\LetLtxMacro\endequation\endLWR@equationother% -\csletcs{equation*}{displaymath}% -\csletcs{endequation*}{enddisplaymath}% + \boolfalse{mathjax}% + \LetLtxMacro\displaymath\LWR@displaymathother% + \LetLtxMacro\enddisplaymath\endLWR@displaymathother% + \LetLtxMacro\[\LWR@displaymathother% + \LetLtxMacro\]\endLWR@displaymathother% + \LetLtxMacro\equation\LWR@equationother% + \LetLtxMacro\endequation\endLWR@equationother% + \csletcs{equation*}{displaymath}% + \csletcs{endequation*}{enddisplaymath}% } % \end{macrocode} % \end{macro} @@ -33075,22 +33707,22 @@ autopage-\theLWR@currentautosec% % then by \pkg{cleveref}. % \begin{macrocode} \newcommand*{\LWR@htmlmathlabel}[1]{% -\LWR@traceinfo{LWR@htmlmathlabelb #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} ) }% -{% + \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{% + \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@}}% + \ifbool{LWR@amsmultline}{}{\hspace*{\totwidth@}}% % \end{macrocode} % Temporarily end the \HTML\ comment, % insert the \LaTeX{} \& \HTML\ label, then @@ -33098,14 +33730,14 @@ autopage-\theLWR@currentautosec% % \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}% -}% + \LWR@htmlclosecomment% + \LWR@origltx@label{#1}% + \LWR@htmlopencomment% + }% text + }% mathjax + {% + \LWR@origltx@label{#1}% + }% } % \end{macrocode} % \end{macro} @@ -33116,12 +33748,12 @@ autopage-\theLWR@currentautosec% % Starts hiding \LaTeX\ math inside an \HTML\ comment. % \begin{macrocode} \newcommand*{\LWR@beginhideamsmath}{ -\LWR@stoppars -\LWR@origtilde\LWR@orignewline -\LWR@htmlopencomment + \LWR@stoppars + \LWR@origtilde\LWR@orignewline + \LWR@htmlopencomment -\begingroup -\LWR@restoreorigformatting + \begingroup + \LWR@restoreorigformatting } % \end{macrocode} % \end{macro} @@ -33130,11 +33762,11 @@ autopage-\theLWR@currentautosec% % Ends hiding \LaTeX\ math inside an \HTML\ comment. % \begin{macrocode} \newcommand*{\LWR@endhideamsmath}{ -\endgroup + \endgroup -\LWR@htmlclosecomment -\LWR@orignewline -\LWR@startpars + \LWR@htmlclosecomment + \LWR@orignewline + \LWR@startpars } % \end{macrocode} % \end{macro} @@ -33190,44 +33822,44 @@ autopage-\theLWR@currentautosec% % 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} ) }% -{% + \ifboolexpr{bool{mathjax} or ( bool{FormatWP} and bool{WPMarkMath} ) }% + {% % \end{macrocode} % % If \brand{MathJax}, the environment contents (the \cs{BODY}) are executed in a % \HTML\ comment to trigger the correct equation number increment (if not starred), % then are included verbatim in the output for \brand{MathJax} to interpret: % \begin{macrocode} - \LWR@syncmathjax - \boolfalse{LWR@amsmultline} - \ifbool{LWR@numbereqnarray} - { + \LWR@syncmathjax% + \boolfalse{LWR@amsmultline}% + \ifbool{LWR@numbereqnarray}% + {% % \end{macrocode} % % If numbering the equations, execute a copy inside an \HTML\ comment block: % \begin{macrocode} - \LWR@beginhideamsmath - \LWR@origeqnarray - \BODY - \LWR@origendeqnarray - \LWR@endhideamsmath + \LWR@beginhideamsmath% + \LWR@origeqnarray% + \BODY% + \LWR@origendeqnarray% + \LWR@endhideamsmath% % \end{macrocode} % % Then print the (sanitized) contents to the output for \brand{MathJax} to interpret: % \begin{macrocode} - \LWR@addmathjax{eqnarray}{\BODY} - }% - {% not LWR@numbereqnarray + \LWR@addmathjax{eqnarray}{\BODY}% + }% + {% not LWR@numbereqnarray % \end{macrocode} % % If not numbering equations, just create the contents for \brand{MathJax}: % \begin{macrocode} - \LWR@addmathjax{eqnarray*}{\BODY} - }% LWR@numbereqnarray -}% mathjax -{% not mathjax - \ifbool{LWR@numbereqnarray} - { + \LWR@addmathjax{eqnarray*}{\BODY}% + }% LWR@numbereqnarray + }% mathjax + {% not mathjax + \ifbool{LWR@numbereqnarray}% + {% % \end{macrocode} % % For numbered \SVG\ equations, first create a \env{lateximage} with @@ -33236,60 +33868,60 @@ autopage-\theLWR@currentautosec% % \changes{v0.50}{2018/03/02}{Improved \SVG\ math display.} % \changes{v0.51}{2018/03/11}{Fix: \cs{addcontentsline} inside \SVG\ math. Provides an autoid anchor.} % \begin{macrocode} - \begin{BlockClass}{displaymathnumbered}% - \LWR@newautoidanchor% - \booltrue{LWR@indisplaymathimage}% - \begin{lateximage}[(\LWR@startingequationtag--\LWR@equationtag) - \LWR@addmathjax{eqnarray}{\BODY}]* + \begin{BlockClass}{displaymathnumbered}% + \LWR@newautoidanchor% + \booltrue{LWR@indisplaymathimage}% + \begin{lateximage}[(\LWR@startingequationtag--\LWR@equationtag)% + \LWR@addmathjax{eqnarray}{\BODY}]*% % \end{macrocode} % Support for \pkg{xfakebold}: % \changes{v0.67}{2019/02/17}{\pkg{xfakebold}: Added support.} % \begin{macrocode} - \LWR@applyxfakebold% + \LWR@applyxfakebold% % \end{macrocode} % Create the image contents using an actual \env{eqnarray}: % \begin{macrocode} - \LWR@origeqnarray - \BODY - \LWR@origendeqnarray - \end{lateximage} - \end{BlockClass} - }% - {% not LWR@numbereqnarray + \LWR@origeqnarray% + \BODY% + \LWR@origendeqnarray% + \end{lateximage}% + \end{BlockClass}% + }% + {% not LWR@numbereqnarray % \end{macrocode} % If not numbered, do the same, but an extra \cs{nonumber} seems to be required: % \changes{v0.50}{2018/03/02}{Improved \SVG\ math display.} % \changes{v0.51}{2018/03/11}{Fix: \cs{addcontentsline} inside \SVG\ math. Provides an autoid anchor.} % \begin{macrocode} - \begin{BlockClass}{displaymath} - \LWR@newautoidanchor% - \booltrue{LWR@indisplaymathimage}% - \begin{lateximage}[\LWR@addmathjax{eqnarray*}{\BODY}]* + \begin{BlockClass}{displaymath}% + \LWR@newautoidanchor% + \booltrue{LWR@indisplaymathimage}% + \begin{lateximage}[\LWR@addmathjax{eqnarray*}{\BODY}]*% % \end{macrocode} % Support for \pkg{xfakebold}: % \changes{v0.67}{2019/02/17}{\pkg{xfakebold}: Added support.} % \begin{macrocode} - \LWR@applyxfakebold% + \LWR@applyxfakebold% % \end{macrocode} % \begin{macrocode} - \LWR@origeqnarray - \BODY - \nonumber - \LWR@origendeqnarray - \end{lateximage} - \end{BlockClass} - }% LWR@numbereqnarray -}% not mathjax + \LWR@origeqnarray% + \BODY% + \nonumber% + \LWR@origendeqnarray% + \end{lateximage}% + \end{BlockClass}% + }% LWR@numbereqnarray + }% not mathjax % \end{macrocode} % % Default to number equations in the future: % \begin{macrocode} -\booltrue{LWR@numbereqnarray} + \booltrue{LWR@numbereqnarray}% % \end{macrocode} % Clear the single-use \attribute{alt} text: % \changes{v0.74}{2019/08/20}{Add \cs{ThisAltText}.} % \begin{macrocode} -\gdef\LWR@ThisAltText{}% + \gdef\LWR@ThisAltText{}% } % \end{macrocode} % @@ -33443,115 +34075,14 @@ autopage-\theLWR@currentautosec% % \end{macrocode} -% \subsection{Sanitizing math expressions for \HTML} + +% \subsection{Equation numbers} % \codehtml % \begin{macrocode} \begin{warpHTML} % \end{macrocode} -% \begin{macro}{\LWR@HTMLsanitize} \marg{text} -% -% Math expressions are converted to |lateximage|s, -% and some math environments may contain -% |&|, |<|, or |>|, which should not be allowed -% inside an \HTML\ \element{alt} tag, so must convert them to \HTML\ entities. -% -% Two versions follow, depending on expansion needs. -% There may be a better way\dots -% -% \changes{v0.36}{2017/08/16}{Fix for \pkg{babel-french}.} -% \changes{v0.51}{2018/03/07}{Fix: Escapes double quotes.} -% \begin{macrocode} -\newrobustcmd{\LWR@HTMLsanitize}[1]{% -% \end{macrocode} -% Cancel French \pkg{babel} character handling, -% and fully expand the strings: -% \begin{macrocode} -\begingroup% -\LWR@FBcancel% -\fullexpandarg% -% \end{macrocode} -% The |&|, |<|, and |>| may be interpreted by the browser: -% \begin{macrocode} -\protect\StrSubstitute{\detokenize{#1}}% -{\detokenize{&}}{\detokenize{&}}[\LWR@strresult]% -% \end{macrocode} -% \begin{macrocode} -\protect\StrSubstitute{\detokenize\expandafter{\LWR@strresult}}% -{\detokenize{<}}{\detokenize{<}}[\LWR@strresult]% -% \end{macrocode} -% \begin{macrocode} -\protect\StrSubstitute{\detokenize\expandafter{\LWR@strresult}}% -{\detokenize{>}}{\detokenize{>}}[\LWR@strresult]% -% \end{macrocode} -% The double quote occasionally causes problems. -% \begin{macrocode} -\protect\StrSubstitute{\detokenize\expandafter{\LWR@strresult}}% -{\detokenize{"}}{\detokenize{"}}[\LWR@strresult]% -% \end{macrocode} -% MathJax allows expressions to be defined with \cs{newcommand}. -% These expressions would appear with |##| for each argument, -% and each must be changed to a single |#|. -% This must be done after all the above changes. -% Attempting another conversion after this causes an error upon further expansion. -% \begin{macrocode} -\protect\StrSubstitute{\detokenize\expandafter{\LWR@strresult}}% -{\detokenize{##}}{\LWR@origpound}[\LWR@strresult]% -% \end{macrocode} -% \begin{macrocode} -\LWR@strresult% -\endgroup% -} -% \end{macrocode} -% \end{macro} - - -% \begin{macro}{\LWR@HTMLsanitizeexpand} \marg{text} -% -% This version expands the argument before sanitizing it. -% -% \changes{v0.36}{2017/08/16}{Fix for \pkg{babel-french}.} -% \changes{v0.51}{2018/03/07}{Fix: Escapes double quotes.} -% \begin{macrocode} -\newrobustcmd{\LWR@HTMLsanitizeexpand}[1]{% -% \end{macrocode} -% Cancel French \pkg{babel} character handling, -% and fully expand the strings: -% \begin{macrocode} -\begingroup% -\LWR@FBcancel% -\fullexpandarg% -% \end{macrocode} -% The difference between this and \cs{LWR@HTMLsanitize} (without ``expand'') -% is the following \cs{expandafter}: -% \begin{macrocode} -\protect\StrSubstitute{\detokenize\expandafter{#1}}% -{\detokenize{&}}{\detokenize{&}}[\LWR@strresult]% -% \end{macrocode} -% \begin{macrocode} -\protect\StrSubstitute{\detokenize\expandafter{\LWR@strresult}}% -{\detokenize{<}}{\detokenize{<}}[\LWR@strresult]% -% \end{macrocode} -% \begin{macrocode} -\protect\StrSubstitute{\detokenize\expandafter{\LWR@strresult}}% -{\detokenize{>}}{\detokenize{>}}[\LWR@strresult]% -% \end{macrocode} -% \begin{macrocode} -\protect\StrSubstitute{\detokenize\expandafter{\LWR@strresult}}% -{\detokenize{"}}{\detokenize{"}}[\LWR@strresult]% -% \end{macrocode} -% \cs{LWR@HTMLsanitizeexpand} is not used for defining new MathJax macros, -% so the |##| conversion is not needed here. -% \begin{macrocode} -\LWR@strresult% -\endgroup% -} -% \end{macrocode} -% \end{macro} - - -% \subsection{Equation numbers} % \DescribeCounter{LWR@startingequation} % For use with |lateximage| and multi-line numbered equations. @@ -33566,13 +34097,13 @@ autopage-\theLWR@currentautosec% \@ifundefined{chapter} { \renewcommand{\theLWR@startingequation}{% -\arabic{LWR@startingequation}% + \arabic{LWR@startingequation}% } } {% chapter defined \renewcommand{\theLWR@startingequation}{% -\ifnumcomp{\value{chapter}}{>}{0}{\arabic{chapter}.}{}% -\arabic{LWR@startingequation}% + \ifnumcomp{\value{chapter}}{>}{0}{\arabic{chapter}.}{}% + \arabic{LWR@startingequation}% } } % \end{macrocode} @@ -33620,12 +34151,12 @@ autopage-\theLWR@currentautosec% % % \begin{macrocode} \NewDocumentCommand{\LWR@remembertag}{m}{% -\ifbool{LWR@isstartingequation}% -{% - \global\boolfalse{LWR@isstartingequation}% - \xdef\LWR@startingequationtag{#1}% -}{}% -\xdef\LWR@equationtag{#1}% + \ifbool{LWR@isstartingequation}% + {% + \global\boolfalse{LWR@isstartingequation}% + \xdef\LWR@startingequationtag{#1}% + }{}% + \xdef\LWR@equationtag{#1}% }% % \end{macrocode} % \end{macro} @@ -33647,9 +34178,9 @@ autopage-\theLWR@currentautosec% % \begin{macrocode} \newcommand*{\LWR@amsmathbody}[1] {% -\textbackslash\{begin\}\{#1\} % extra space -\LWR@HTMLsanitizeexpand{\detokenize\expandafter{\the\@envbody}}% -\textbackslash\{end\}\{#1\}% + \textbackslash\{begin\}\{#1\} % extra space + \LWR@HTMLsanitizeexpand{\detokenize\expandafter{\the\@envbody}}% + \textbackslash\{end\}\{#1\}% } % \end{macrocode} % \end{macro} @@ -33664,10 +34195,10 @@ autopage-\theLWR@currentautosec% % \begin{macrocode} \newcommand*{\LWR@amsmathbodynumbered}[1] {% -\ifnumcomp{\value{LWR@startingequation}}{=}{\value{equation}}% -{(\LWR@equationtag)}% -{(\LWR@startingequationtag--\LWR@equationtag)} % extra space -\LWR@amsmathbody{#1} % extra space + \ifnumcomp{\value{LWR@startingequation}}{=}{\value{equation}}% + {(\LWR@equationtag)}% + {(\LWR@startingequationtag--\LWR@equationtag)} % extra space + \LWR@amsmathbody{#1} % extra space } % \end{macrocode} % \end{macro} @@ -33796,7 +34327,7 @@ autopage-\theLWR@currentautosec% % printed in a multi-equation environment: % \changes{v0.42}{2017/10/12}{Fix: Numbering and naming AMS math environments.} % \begin{macrocode} -\LWR@traceinfo{lateximage: starting outer-most lateximage}% + \LWR@traceinfo{lateximage: starting outer-most lateximage}% \setcounter{LWR@startingequation}{\value{equation}}% \addtocounter{LWR@startingequation}{1}% \booltrue{LWR@isstartingequation}% @@ -33904,10 +34435,16 @@ autopage-\theLWR@currentautosec% \LWR@traceinfo{lateximage: about to create a new page}% \LWR@orignewpage% % \end{macrocode} -% Typeset the image in a ``standard'' width page and font size: +% If the current page is larger, +% typeset the image in a ``standard'' width page and font size: +% \changes{v0.79}{2020/01/05}{Improved \cs{linewidth}.} % \begin{macrocode} \LWR@traceinfo{lateximage: about to create minipage}% - \LWR@print@minipage{6in}% + \ifdimless{\linewidth}{6in}{% + \LWR@print@minipage{\linewidth}% + }{% + \LWR@print@minipage{6in}% + }% \@nameuse{LWR@print@\LateximageFontSizeName}% % \end{macrocode} % Temporarily restore formatting to its \PDF\ definitions: @@ -34079,10 +34616,10 @@ autopage-\theLWR@currentautosec% % \begin{macrocode} \renewenvironment*{center} { -\LWR@forcenewpage -\ifbool{FormatWP} -{\BlockClass[\LWR@print@mbox{text-align:center}]{center}} -{\BlockClass{center}} + \LWR@forcenewpage + \ifbool{FormatWP} + {\BlockClass[\LWR@print@mbox{text-align:center}]{center}} + {\BlockClass{center}} } {\endBlockClass} % \end{macrocode} @@ -34094,10 +34631,10 @@ autopage-\theLWR@currentautosec% % \begin{macrocode} \renewenvironment*{flushright} { -\LWR@forcenewpage -\ifbool{FormatWP} -{\BlockClass[\LWR@print@mbox{text-align:right}]{flushright}} -{\BlockClass{flushright}} + \LWR@forcenewpage + \ifbool{FormatWP} + {\BlockClass[\LWR@print@mbox{text-align:right}]{flushright}} + {\BlockClass{flushright}} } {\endBlockClass} % \end{macrocode} @@ -34108,10 +34645,10 @@ autopage-\theLWR@currentautosec% % \begin{macrocode} \renewenvironment*{flushleft} { -\LWR@forcenewpage -\ifbool{FormatWP} -{\BlockClass[\LWR@print@mbox{text-align:left}]{flushleft}} -{\BlockClass{flushleft}} + \LWR@forcenewpage + \ifbool{FormatWP} + {\BlockClass[\LWR@print@mbox{text-align:left}]{flushleft}} + {\BlockClass{flushleft}} } {\endBlockClass} % \end{macrocode} @@ -34126,9 +34663,9 @@ autopage-\theLWR@currentautosec% % \changes{v0.54}{2018/04/19}{Added debug comment.} % \begin{macrocode} \newcommand*{\LWR@HTML@centering}{% -\ifbool{HTMLDebugComments}{% - \LWR@htmlcomment{centering}% -}{}% + \ifbool{HTMLDebugComments}{% + \LWR@htmlcomment{centering}% + }{}% } \LWR@formatted{centering} % \end{macrocode} @@ -34138,9 +34675,9 @@ autopage-\theLWR@currentautosec% % \changes{v0.54}{2018/04/19}{Added debug comment.} % \begin{macrocode} \newcommand*{\LWR@HTML@raggedleft}{% -\ifbool{HTMLDebugComments}{% - \LWR@htmlcomment{raggedleft}% -}{}% + \ifbool{HTMLDebugComments}{% + \LWR@htmlcomment{raggedleft}% + }{}% } \LWR@formatted{raggedleft} % \end{macrocode} @@ -34150,9 +34687,9 @@ autopage-\theLWR@currentautosec% % \changes{v0.54}{2018/04/19}{Added debug comment.} % \begin{macrocode} \newcommand*{\LWR@HTML@raggedright}{% -\ifbool{HTMLDebugComments}{% - \LWR@htmlcomment{raggedright}% -}{}% + \ifbool{HTMLDebugComments}{% + \LWR@htmlcomment{raggedright}% + }{}% } \LWR@formatted{raggedright} % \end{macrocode} @@ -34291,9 +34828,6 @@ autopage-\theLWR@currentautosec% - - - % \section{\pkg{siunitx}} % \label{sec:siunitx} @@ -34889,22 +35423,15 @@ autopage-\theLWR@currentautosec% \begin{warpHTML} % \end{macrocode} -% \subsection{Counters and lengths} - -% \DescribeCounter{LWR@minipagedepth} -% Used to only reset the line width at the outermost minipage. -% \begin{macrocode} -\newcounter{LWR@minipagedepth} -\setcounter{LWR@minipagedepth}{0} -% \end{macrocode} - +% \subsection{Computed lengths} % % \DescribeLength{\LWR@minipagewidth} % Used to convert the width into printable units. % \begin{macrocode} \newlength{\LWR@minipagewidth} % \end{macrocode} +% % \DescribeLength{\LWR@minipageheight} % Used to convert the height into printable units. % \begin{macrocode} @@ -34912,6 +35439,42 @@ autopage-\theLWR@currentautosec% % \end{macrocode} % % +% \subsection{Virtual page size} +% +% \DescribeCounter{LWR@virtualpagedepth} +% Used to only reset the line width at the outermost minipage. +% \begin{macrocode} +\newcounter{LWR@virtualpagedepth} +\setcounter{LWR@virtualpagedepth}{0} +% \end{macrocode} +% +% \begin{environment}{LWR@setvirtualpage} * \oarg{columns} +% +% If not nesting a minipage, adjust \cs{linewidth}, \cs{textwidth}, +% and \cs{textheight} for a virtual $6 \times 9$ page, and start on a new +% \PDF\ page to help prevent page overflows. +% +% If starred, force a new page in the \PDF\ before generating more \HTML. +% This may be done to reduce the chance of page overflow when starting a +% new minipage. +% +% The optional number of columns defaults to 1. +% +% \changes{v0.79}{2020/01/08}{Factored.} +% \begin{macrocode} +\NewDocumentEnvironment{LWR@setvirtualpage}{s O{1}}{% + \ifnumequal{\value{LWR@virtualpagedepth}}{0}{% + \IfBooleanT{#1}{\LWR@orignewpage}% + \setlength{\linewidth}{6in/#2}% + \setlength{\textwidth}{6in}% + \setlength{\textheight}{9in}% + }{}% + \addtocounter{LWR@virtualpagedepth}{1}% +} +{\addtocounter{LWR@virtualpagedepth}{-1}} +% \end{macrocode} +% \end{environment} +% % % \subsection{Footnote handling} % @@ -35019,42 +35582,31 @@ autopage-\theLWR@currentautosec% \LWR@traceinfo{minipage}% % \end{macrocode} % -% Temporarily open a group, in which width and height is +% Start an environment, in which width and height is % computed based on a virtual page size instead of % the extra-large \PDF\ page used during \HTML\ tag generation. % -% The following used to be an actual \LaTeX\ minipage. -% \changes{v0.45}{2017/12/01}{Fix: Improper \cs{prevdepth}.} +% \changes{v0.79}{2020/01/07}{Fix: Adjust for virtual page size.} % \begin{macrocode} -\begingroup% +\begin{LWR@setvirtualpage}*% % \end{macrocode} -% Compute width, adjusted for frames: +% +% Save the requested width now that \cs{linewidth}, etc. are adjusted to virtual size. +% \changes{v0.79}{2020/01/07}{Fix: Adjust for virtual page size.} % \begin{macrocode} \setlength{\LWR@minipagewidth}{#4}% -\ifthenelse{\cnttest{\value{LWR@minipagedepth}}{=}{0}}{% -% \end{macrocode} -% Only create a new page if not yet nested: -% \begin{macrocode} - \LWR@orignewpage% -% \end{macrocode} -% Adjust virtual page size: -% \begin{macrocode} +\ifnumequal{\value{LWR@virtualpagedepth}}{1}{% \addtolength{\LWR@minipagewidth}{3em}% room for frames - \setlength{\linewidth}{6in}% - \setlength{\textwidth}{6in}% - \setlength{\textheight}{9in}% }{}% \LWR@traceinfo{computed width is \LWR@printlength{\LWR@minipagewidth}}% % \end{macrocode} +% % Compute height: % \begin{macrocode} \setlength{\LWR@minipageheight}{\textheight}% default unless specified \ifblank{#2}{}{\setlength{\LWR@minipageheight}{#2}}% % \end{macrocode} -% Track nesting depth: -% \begin{macrocode} -\addtocounter{LWR@minipagedepth}{1}% -% \end{macrocode} +% % \LaTeX{} wants to start a paragraph for the virtual minipage, % then start a paragraph again for the contents of the minipage, % so cancel the paragraph tag handling until the minipage has begun. @@ -35062,6 +35614,7 @@ autopage-\theLWR@currentautosec% \ifbool{FormatWP}{\newline}{}% \LWR@stoppars% % \end{macrocode} +% % If |FormatWP|, add a text frame: % \changes{v0.42}{2017/10/26}{If \progcode{FormatWP} add a text frame.} % \changes{v0.47}{2018/01/26}{Fix: Line wrap at \HTML\ hyphen.} @@ -35076,6 +35629,7 @@ autopage-\theLWR@currentautosec% }{}% % \end{macrocode} +% % Create the \element{div} tag with optional alignment style: % \changes{v0.47}{2018/01/26}{Fix: Line wrap at \HTML\ hyphen.} % \begin{macrocode} @@ -35089,6 +35643,7 @@ autopage-\theLWR@currentautosec% \ifthenelse{\equal{#3}{b}}{\LWR@print@mbox{justify-content:flex-end} ; }{}% \ifthenelse{\equal{#3}{s}}{\LWR@print@mbox{justify-content:space-between} ; }{}% % \end{macrocode} +% % Print the width and optional height styles: % \changes{v0.66}{2018/12/31}{Honor \cs{LWR@forceminipagefullwidth}.} % \begin{macrocode} @@ -35108,11 +35663,13 @@ autopage-\theLWR@currentautosec% \ifblank{#2}{}{height:\LWR@printlength{\LWR@minipageheight} ; }% "}% % \end{macrocode} +% % Finish with an empty line to start the contents on a new line. % \begin{macrocode} % The preceding empty line is required. % \end{macrocode} +% % Set the user-accessible line and text width and height values % inside the virtual minipage. % These do not affect the actual size of the \PDF\ output, @@ -35122,22 +35679,26 @@ autopage-\theLWR@currentautosec% % which is restored here. This is done instead of settings back to \#4, % in case \#4 was \cs{linewidth}, which was changed to 6in above. % \changes{v0.75}{2019/09/17}{Fix: \cs{linewidth}.} +% \changes{v0.79}{2019/09/17}{Fix: \cs{linewidth} frame padding.} % \begin{macrocode} -\setlength{\linewidth}{\LWR@minipagewidth}% the padded width -\addtolength{\linewidth}{-3em}% the original width -\setlength{\textwidth}{6in}% -\setlength{\textheight}{9in}% +\ifnumequal{\value{LWR@virtualpagedepth}}{1}{% + \addtolength{\LWR@minipagewidth}{-3em}% undo frame padding +}{}% +\setlength{\linewidth}{\LWR@minipagewidth}% % \end{macrocode} +% % \cs{raggedright} cancels hyphenation, which will be done by \HTML\ instead. % \begin{macrocode} \LWR@print@raggedright% % \end{macrocode} +% % Set minipage footnotes: % \begin{macrocode} \def\@mpfn{mpfootnote}% \def\thempfn{\thempfootnote}\c@mpfootnote\z@% \let\@footnotetext\@mpfootnotetext% % \end{macrocode} +% % Resume paragraph tag handling for the contents of the minipage: % \changes{v0.42}{2017/10/18}{Added boolean \progcode{WPMarkMinipages}.} % \begin{macrocode} @@ -35151,11 +35712,13 @@ autopage-\theLWR@currentautosec% }% finished \minipage {% \endminipage % \end{macrocode} +% % Print pending minipage footnotes: % \changes{v0.45}{2017/12/01}{Fix: Improper \cs{prevdepth}.} % \begin{macrocode} \LWR@printpendingmpfootnotes% % \end{macrocode} +% % End the environment with closing tag: % \changes{v0.42}{2017/10/18}{Added boolean \progcode{WPMarkMinipages}.} % \begin{macrocode} @@ -35165,11 +35728,6 @@ autopage-\theLWR@currentautosec% }{}% \LWR@stoppars% -% \end{macrocode} -% The following used to be an actual \LaTeX\ minipage. -% \changes{v0.45}{2017/12/01}{Fix: Improper \cs{prevdepth}.} -% \begin{macrocode} -\endgroup% \ifbool{FormatWP}{% @@ -35178,10 +35736,11 @@ autopage-\theLWR@currentautosec% }{}% \LWR@htmldivclassend{minipage}% -\addtocounter{LWR@minipagedepth}{-1}% +\end{LWR@setvirtualpage}% \LWR@startpars% \ifbool{FormatWP}{\newline}{}% % \end{macrocode} +% % Prevent paragraph tags around horizontal white space % until the start of the next paragraph: % \begin{macrocode} @@ -35284,44 +35843,45 @@ autopage-\theLWR@currentautosec% % \changes{v0.70}{2019/04/02}{Fix: Accept long arg.} % \changes{v0.70}{2019/04/02}{Fix: No width given.} % \changes{v0.70}{2019/04/02}{Fix: Ignore width of 0pt.} +% \changes{v0.79}{2020/01/07}{Fix: Adjust for virtual page size.} % \begin{macrocode} \NewDocumentCommand{\LWR@HTML@makebox}{>{\SplitArgument{1}{,}}d() o o +m}{% % \end{macrocode} % % Build the style depending on arguments: % \begin{macrocode} -{% scope - \def\LWR@temptwo{}% - \IfValueTF{#1}% - {% (width,height) .. - \LWR@@makebox@paren #1% - \IfValueT{#2}% - {% (width,height) [posn] - \LWR@@makebox@align{#2}% + \begin{LWR@setvirtualpage}% + \def\LWR@temptwo{}% + \IfValueTF{#1}% + {% (width,height) .. + \LWR@@makebox@paren #1% + \IfValueT{#2}% + {% (width,height) [posn] + \LWR@@makebox@align{#2}% + }% }% - }% - {% [width] - \IfValueT{#2}% [width] - {% - \setlength{\LWR@tempwidth}{#2}% - \ifdimgreater{\LWR@tempwidth}{0pt}{% - \appto{\LWR@temptwo}{% - width:\LWR@printlength{\LWR@tempwidth} ; % space - }% - }{}% + {% [width] + \IfValueT{#2}% [width] + {% + \setlength{\LWR@tempwidth}{#2}% + \ifdimgreater{\LWR@tempwidth}{0pt}{% + \appto{\LWR@temptwo}{% + width:\LWR@printlength{\LWR@tempwidth} ; % space + }% + }{}% + }% }% - }% - \IfValueT{#3}% - {% [width] [posn] - \LWR@@makebox@align{#3}% - }% - \InlineClass[% - \LWR@print@mbox{display:inline-block} ; % - \LWR@temptwo% - ]% - {makebox}% - {#4}% -}% scope + \IfValueT{#3}% + {% [width] [posn] + \LWR@@makebox@align{#3}% + }% + \InlineClass[% + \LWR@print@mbox{display:inline-block} ; % + \LWR@temptwo% + ]% + {makebox}% + {#4}% + \end{LWR@setvirtualpage}% } \LWR@formatted{makebox} % \end{macrocode} @@ -35529,10 +36089,19 @@ color:\LWR@origpound\LWR@tempcolor% \NewDocumentEnvironment{LWR@HTML@fminipage}{O{t} o O{t} m} {% \LWR@traceinfo{fminipage #1 #2 #3 #4}% -\LWR@forceminwidth{\fboxrule}% +% \end{macrocode} +% +% Locally change to the virtual page size before processing the requested sizes: +% \changes{v0.79}{2020/01/07}{Fix: Adjust for virtual page size.} +% \begin{macrocode} +\begin{LWR@setvirtualpage}*% \setlength{\LWR@tempwidth}{#4}% \IfValueT{#2}{\setlength{\LWR@tempheight}{#2}}% % \end{macrocode} +% Use a rule of at least one pixel in width: +% \begin{macrocode} +\LWR@forceminwidth{\fboxrule}% +% \end{macrocode} % \changes{v0.62}{2018/11/11}{Fix: Horiz white space.} % \begin{macrocode} \LWR@stoppars% @@ -35556,7 +36125,9 @@ color:\LWR@origpound\LWR@tempcolor% } {% \end{BlockClass}% +\end{LWR@setvirtualpage}% % \end{macrocode} +% % Prevent paragraph tags around horizontal white space % until the start of the next paragraph: % \changes{v0.62}{2018/11/11}{Fix: Horiz white space.} @@ -36485,38 +37056,41 @@ color:\LWR@origpound\LWR@tempcolor% } % \end{macrocode} % -% Direct-formatting font sizes are ignored: +% Direct-formatting font sizes are remembered for future use: % % \changes{v0.58}{2018/06/07}{Improved print/\HTML\ output selection.} +% \changes{v0.79}{2020/01/01}{Remember \HTML\ font size.} % \begin{macrocode} -\newrobustcmd*{\LWR@HTML@normalsize}{} +\newcommand*{\LWR@font@size}{normalsize} + +\newrobustcmd*{\LWR@HTML@normalsize}{\renewcommand*{\LWR@font@size}{normalsize}} \LWR@formatted{normalsize} -\newrobustcmd*{\LWR@HTML@small}{} +\newrobustcmd*{\LWR@HTML@small}{\renewcommand*{\LWR@font@size}{small}} \LWR@formatted{small} -\newrobustcmd*{\LWR@HTML@footnotesize}{} +\newrobustcmd*{\LWR@HTML@footnotesize}{\renewcommand*{\LWR@font@size}{footnotesize}} \LWR@formatted{footnotesize} -\newrobustcmd*{\LWR@HTML@scriptsize}{} +\newrobustcmd*{\LWR@HTML@scriptsize}{\renewcommand*{\LWR@font@size}{scriptsize}} \LWR@formatted{scriptsize} -\newrobustcmd*{\LWR@HTML@tiny}{} +\newrobustcmd*{\LWR@HTML@tiny}{\renewcommand*{\LWR@font@size}{tiny}} \LWR@formatted{tiny} -\newrobustcmd*{\LWR@HTML@large}{} +\newrobustcmd*{\LWR@HTML@large}{\renewcommand*{\LWR@font@size}{large}} \LWR@formatted{large} -\newrobustcmd*{\LWR@HTML@Large}{} +\newrobustcmd*{\LWR@HTML@Large}{\renewcommand*{\LWR@font@size}{Large}} \LWR@formatted{Large} -\newrobustcmd*{\LWR@HTML@LARGE}{} +\newrobustcmd*{\LWR@HTML@LARGE}{\renewcommand*{\LWR@font@size}{LARGE}} \LWR@formatted{LARGE} -\newrobustcmd*{\LWR@HTML@huge}{} +\newrobustcmd*{\LWR@HTML@huge}{\renewcommand*{\LWR@font@size}{huge}} \LWR@formatted{huge} -\newrobustcmd*{\LWR@HTML@Huge}{} +\newrobustcmd*{\LWR@HTML@Huge}{\renewcommand*{\LWR@font@size}{Huge}} \LWR@formatted{Huge} % \end{macrocode} % @@ -37523,6 +38097,143 @@ color:\LWR@origpound\LWR@tempcolor% % \begin{macrocode} \end{warpHTML} % \end{macrocode} + + + + +% \section{\pkg{babel} and \pkg{polyglossia} warnings} +% \label{sec:languages} +% +% \changes{v0.79}{2019/12/15}{\pkg{babel} and \pkg{polyglossia}: Added info messages.} +% +% \pkg{lwarp} prints a message instructing the user how to avoid the following error. +% +% (These are not \cs{PackageWarning}s because there may not be a problem.) +% +% \limitspolyglossia +% +% \codehtml +% \begin{macrocode} +\begin{warpHTML} +\AtBeginDocument{ + +\@ifpackageloaded{polyglossia}{ + \PackageWarningNoLine{lwarp} + {% + Polyglossia has been loaded. Lwarp also uses cleveref.\MessageBreak + See the cleveref documentation regarding\MessageBreak + polyglossia support% + } + \typeout{If the error} + \typeout{\space\space``! Undefined control sequence. + \space ... \space \protect\@begindocumenthook''} + \typeout{occurs here, use the polyglossia macro:} + \typeout{\space\space\protect\setmainlanguage\protect{...\protect}} + \typeout{---} +}{ + \@ifpackageloaded{babel}{ + \PackageWarningNoLine{lwarp} + {% + Babel has been loaded. Lwarp also uses cleveref.\MessageBreak + See the cleveref documentation regarding\MessageBreak + babel support% + } + }{} +} + +} +\end{warpHTML} +% \end{macrocode} +% +% +% +% +% \section{\brand{MathJax} warnings} +% ^^A *mathjax +% +% \begin{macro}{\LWR@mathjaxwarn} \marg{packagename} \marg{More text.} +% +% To be done \cs{AtBeginDocument}. +% +% \changes{v0.79}{2020/01/18}{Warn if using packages not supported by \brand{MathJax}.} +% \begin{macrocode} +\newcommand*{\LWR@mathjaxwarn}[2]{% + \@ifpackageloaded{lwarp-#1}{% + \ifblank{#2}{% + \PackageWarningNoLine{lwarp} + {% + Lwarp provides emulation for MathJax when used\MessageBreak + with the #1 package% + } + }{% + \PackageWarningNoLine{lwarp} + {% + Lwarp provides emulation for MathJax when used\MessageBreak + with the #1 package.\MessageBreak + #2% + } + }% + }{}% +} + +\AtBeginDocument{ + \ifbool{mathjax}{ + \LWR@mathjaxwarn{arydshln} + {In a math array, do not use the optional argument\MessageBreak + for \protect\cdashline.\space\space + Furthermore, \protect\cline\space is not\MessageBreak + supported by MathJax} + \LWR@mathjaxwarn{autonum} + {MathJax does not support equation+.\MessageBreak + You may use the warpprint and warpHTML\MessageBreak + environments to isolate the package load\MessageBreak + and the equation+ environments} + \LWR@mathjaxwarn{backnaur} + {You may enclose its uses inside\MessageBreak + lateximage environments to force SVG output,\MessageBreak + but this also changes the print output} + \LWR@mathjaxwarn{bigdelim} + {Delimiters appear only of the first line} + \LWR@mathjaxwarn{booktabs} + {In a math array, do not use (trim) for \protect\cmidrule} + \LWR@mathjaxwarn{breqn} + {Each environment becomes an SVG image} + \LWR@mathjaxwarn{delarray} + {Enclose its uses inside lateximage\MessageBreak + 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 + \protect\multirow\space ignores all arguments except\MessageBreak + the text} + \LWR@mathjaxwarn{pb-diagram} + {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 + Use all mandatory arguments, adding empty as needed.\MessageBreak + See the Lwarp manual for details} + \LWR@mathjaxwarn{unicode-math} + {Not all characters are encoded correctly.\MessageBreak + Some symbol fonts are not supported by MathJax,\MessageBreak + and are only approximated} + \LWR@mathjaxwarn{witharrows} + {Arrows can only point to the next line.\MessageBreak + Text is only placed on a single line} + \LWR@mathjaxwarn{xy} + {xy works in text, but in math you must\MessageBreak + enclose its uses inside lateximage\MessageBreak + environments to force SVG output} + }{} +} +% \end{macrocode} +% \end{macro} % % % \iffalse @@ -38807,6 +39518,14 @@ span style="width:\LWR@printlength{\ALG@thistlm}; display:inline-block;"% }% not mathjax % \end{macrocode} % +% +% For nesting \AmS\ environments: +% \begin{macrocode} +\newcounter{LWR@amsmathdepth} +\setcounter{LWR@amsmathdepth}{0} +% \end{macrocode} +% +% % The following \AmS\ environments are patched in-place: % % \changes{v0.44}{2017/11/16}{AMS environments: Fix: Groups for \env{lateximage}s.} @@ -38835,24 +39554,28 @@ span style="width:\LWR@printlength{\ALG@thistlm}; display:inline-block;"% % \begin{noindmacro}{\LWR@amsmathenv@before} \marg{environment name} % % Embeds the environment with \brand{MathJax} or a \env{lateximage}. +% \changes{v0.79}{2020/01/31}{AMS environments: Fix: Nested.} % \begin{macrocode} \newcommand*{\LWR@amsmathenv@before}[1]{% - \LWR@stoppars% - \ifboolexpr{bool{mathjax} or ( bool{FormatWP} and bool{WPMarkMath} ) }% - { - \LWR@syncmathjax - \boolfalse{LWR@amsmultline} - \ifstrequal{#1}{multline}{\booltrue{LWR@amsmultline}}{} - \ifstrequal{#1}{multline*}{\booltrue{LWR@amsmultline}}{} + \ifnumequal{\value{LWR@amsmathdepth}}{0}{% + \LWR@stoppars% + \ifboolexpr{bool{mathjax} or ( bool{FormatWP} and bool{WPMarkMath} ) }% + { + \LWR@syncmathjax + \boolfalse{LWR@amsmultline} + \ifstrequal{#1}{multline}{\booltrue{LWR@amsmultline}}{} + \ifstrequal{#1}{multline*}{\booltrue{LWR@amsmultline}}{} % \end{macrocode} % \pkg{autonum}'s ``+'' environments are not supported by \brand{MathJax}. % \watchout % \begin{macrocode} - \LWR@beginhideamsmath - } - { - \LWR@amsmathenv@@before{#1} - } + \LWR@beginhideamsmath + } + { + \LWR@amsmathenv@@before{#1} + } + }{} + \addtocounter{LWR@amsmathdepth}{1} } % \end{macrocode} % \end{noindmacro} @@ -38862,6 +39585,7 @@ span style="width:\LWR@printlength{\ALG@thistlm}; display:inline-block;"% % % Embeds the environment inside a \env{lateximage}. % \changes{v0.73}{2019/06/25}{AMS environments: Fix: Paragraph tags.} +% \changes{v0.79}{2020/01/31}{AMS environments: Fix: Nested.} % \begin{macrocode} \newcommand*{\LWR@amsmathenv@@after}{% \end{lateximage}\end{BlockClass}\LWR@startpars% @@ -38875,18 +39599,21 @@ span style="width:\LWR@printlength{\ALG@thistlm}; display:inline-block;"% % Embeds the environment with \brand{MathJax} or a \env{lateximage}. % \begin{macrocode} \newcommand*{\LWR@amsmathenv@after}[1]{% - \ifboolexpr{bool{mathjax} or ( bool{FormatWP} and bool{WPMarkMath} ) }% - { - \LWR@endhideamsmath - \boolfalse{LWR@amsmultline} - \LWR@addmathjax{#1}{\the\@envbody} - } - {\LWR@amsmathenv@@after} + \ifnumequal{\value{LWR@amsmathdepth}}{1}{% + \ifboolexpr{bool{mathjax} or ( bool{FormatWP} and bool{WPMarkMath} ) }% + { + \LWR@endhideamsmath + \boolfalse{LWR@amsmultline} + \LWR@addmathjax{#1}{\the\@envbody} + } + {\LWR@amsmathenv@@after} % \end{macrocode} % Clear the single-use \attribute{alt} text: % \changes{v0.74}{2019/08/20}{Add \cs{ThisAltText}.} % \begin{macrocode} -\gdef\LWR@ThisAltText{}% + \gdef\LWR@ThisAltText{}% + }{} + \addtocounter{LWR@amsmathdepth}{-1} } % \end{macrocode} % \end{noindmacro} @@ -38982,6 +39709,15 @@ span style="width:\LWR@printlength{\ALG@thistlm}; display:inline-block;"% % \end{macrocode} % \end{environment} % +% +% For \brand{MathJax}: +% \changes{v0.79}{2020/01/27}{\pkg{amsmath}: Added \brand{MathJax} emulation.} +% \begin{macrocode} +\begin{warpMathJax} +\CustomizeMathJax{\newcommand{\intertext}[1]{\\ \text{#1}\notag \\}} +\end{warpMathJax} +% \end{macrocode} +% % \iffalse %</amsmath> % \fi @@ -39459,6 +40195,17 @@ span style="width:\LWR@printlength{\ALG@thistlm}; display:inline-block;"% \LWR@formatted{ARtt} % \end{macrocode} % +% +% For \brand{MathJax}: +% \changes{v0.79}{2020/01/30}{\pkg{ar}: Added \brand{MathJax} emulation.} +% \begin{macrocode} +\begin{warpMathJax} +\CustomizeMathJax{\newcommand{\AR}{\mathit{A\!\!R}}} +\CustomizeMathJax{\newcommand{\ARb}{\boldsymbol{A\!\!R}}} +\end{warpMathJax} +% \end{macrocode} +% +% % \iffalse %</ar> % \fi @@ -39535,6 +40282,13 @@ span style="width:\LWR@printlength{\ALG@thistlm}; display:inline-block;"% \LWR@formatted{tabularnewline} % \end{macrocode} % +% For \brand{MathJax}: +% \begin{macrocode} +\CustomizeMathJax{ +\newcommand{\multicolumn}[3]{#3}% only uses one cell +} +% \end{macrocode} +% % \iffalse %</array> % \fi @@ -39565,6 +40319,10 @@ span style="width:\LWR@printlength{\ALG@thistlm}; display:inline-block;"% % a single-dashed rule is displayed as a single-dashed border, and % a double-dashed rule is displayed as a thicker single-dashed border. % +% For \brand{MathJax}, limited emulation is provided for math mode. +% \trouble{arydshln=\pkg{arydshln}} +% \trouble{Mathjax=\brand{MathJax}>arydshln=\pkg{arydshln}} +% % \changes{v0.56}{2018/05/02}{\pkg{arydshln}: Added.} % % \codehtml @@ -39661,6 +40419,16 @@ span style="width:\LWR@printlength{\ALG@thistlm}; display:inline-block;"% \def\adl@inactivecdl[#1-#2][#3]{\ifnum0=`{\fi}\cline{#1-#2}} % \end{macrocode} + +% \changes{v0.79}{2020/01/30}{\pkg{arydshln}: Added \brand{MathJax} emulation.} +% \begin{macrocode} +\begin{warpMathJax} +\CustomizeMathJax{\newcommand{\firsthdashline}[1][]{\hdashline}} +\CustomizeMathJax{\let\lasthdashline\firsthdashline} +\CustomizeMathJax{\let\cdashline\cline} +\end{warpMathJax} +% \end{macrocode} + % \iffalse %</arydshln> % \fi @@ -40116,6 +40884,86 @@ span style="width:\LWR@printlength{\ALG@thistlm}; display:inline-block;"% % % % +% \iffalse +%<*awesomebox> +% \fi +% +% \part{lwarp-awesomebox.sty} +% +% \section{awesomebox} +% +% \credits{\'{E}tienne Deparis} +% +% \DescribePackage{awesomebox} +% \pkg{awesomebox} is patched for use by \pkg{lwarp}. +% +% \changes{v0.79}{2020/01/01}{\pkg{awesomebox}: Added.} +% +% \codehtml +% +% \begin{macrocode} +\LWR@ProvidesPackagePass{awesomebox}[2019/07/27] +% \end{macrocode} +% +% \begin{macrocode} +\newcommand*{\LWR@awesomebox@boxborders}{}% +\newcommand*{\LWR@awesomebox@contentsborders}{}% + +\newcommand*{\LWR@awesomebox@ruleborders}{% + border-top: 1px solid black ; + border-bottom: 1px solid black% +} + +% \awesomebox[1:vrulecolor][2:hrule][3:title]{4:vrulewidth}{5:icon}{6:iconcolor}{7:content} +\RenewDocumentCommand \awesomebox { O{abvrulecolor} O{} o m m m +m }{% + \begin{awesomeblock}[#1][#2][#3]{#4}{#5}{#6} + #7 + \end{awesomeblock} +} + +% \begin{awesomeblock}[1:vrulecolor][2:hrule][3:title]{4:vrulewidth}{5:icon}{6:iconcolor} +% <contents> +% \end{awesomeblock} +\RenewDocumentEnvironment{awesomeblock}{ O{abvrulecolor} O{} o m m m } +{% + \LWR@forceminwidth{#4}% + \convertcolorspec{named}{#1}{HTML}\LWR@tempcolor% + \renewcommand*{\LWR@awesomebox@boxborders}{}% + \renewcommand*{\LWR@awesomebox@contentsborders}{}% + \ifdefstrequal{\abShortLine}{#2}{% + \renewcommand*{\LWR@awesomebox@contentsborders}{\LWR@awesomebox@ruleborders}% + }{}% + \ifdefstrequal{\abLongLine}{#2}{% + \renewcommand*{\LWR@awesomebox@boxborders}{\LWR@awesomebox@ruleborders}% + }{}% + \begin{BlockClass}[\LWR@awesomebox@boxborders]{awesomebox} + \begin{BlockClass}[% + margin-left: 2\% ; + vertical-align: top + ]{minipage} + \color{#6}\Huge #5 + \end{BlockClass} + \begin{BlockClass}[% + width:75\% ; + vertical-align: top ; + padding-left: 1em ; + \LWR@awesomebox@contentsborders ; + border-left: \LWR@printlength{\LWR@atleastonept} % + solid \LWR@origpound\LWR@tempcolor% + ]{minipage} + \IfValueTF{#3}{#3\newline}{} +} +{% + \end{BlockClass} + \end{BlockClass} +} +% \end{macrocode} +% +% \iffalse +%</awesomebox> +% \fi +% +% % % \iffalse %<*axessibility> @@ -40756,6 +41604,22 @@ span style="width:\LWR@printlength{\ALG@thistlm}; display:inline-block;"% \LWR@formatted{rdelim} % \end{macrocode} + +% Limited emulation for \brand{MathJax}. +% The delimiter is printed on the first row, along with any optional text. +% \changes{v0.79}{2020/01/20}{\pkg{bigdelim}: Added \brand{MathJax} emulation.} +% \begin{macrocode} +\begin{warpMathJax} +\CustomizeMathJax{ +% \ldelim ( [n]{width}[text] + \newcommand{\LWRldelim}[1][]{\text{#1}~\LWRbigdelim} + \def\ldelim#1#2#3{\def\LWRbigdelim{#1}\LWRldelim} +% \rdelim ) [n]{width}[text] + \newcommand{\LWRrdelim}[1][]{\LWRbigdelim~\text{#1}} + \def\rdelim#1#2#3{\def\LWRbigdelim{#1}\LWRrdelim} +} +\end{warpMathJax} +% \end{macrocode} % % \iffalse %</bigdelim> @@ -40838,6 +41702,14 @@ span style="width:\LWR@printlength{\ALG@thistlm}; display:inline-block;"% \appto\LWR@restoreorigformatting{% \LetLtxMacro\bigstrut\LWR@origbigstrut% } + +% \end{macrocode} +% +% \changes{v0.79}{2020/01/20}{\pkg{bigstrut}: Added \brand{MathJax} emulation.} +% \begin{macrocode} +\CustomizeMathJax{ + \newcommand{\bigstrut}[1][]{} +} % \end{macrocode} % % @@ -40921,6 +41793,51 @@ span style="width:\LWR@printlength{\ALG@thistlm}; display:inline-block;"% % % % +% \iffalse +%<*bm> +% \fi +% +% \part{lwarp-bm.sty} +% +% \section{bm} +% +% \credits{David Carlisle, Frank Mittelbach} +% +% \DescribePackage{bm} +% \pkg{bm} is patched for use by \pkg{lwarp}. +% +% \changes{v0.79}{2020/02/18}{\pkg{bm}: Added.} +% +% \codehtml +% +% \begin{macrocode} +\LWR@ProvidesPackagePass{bm}[2019/07/24] +% \end{macrocode} +% +% \cs{DeclareBoldMathCommand} must only be used in the preamble, since it +% adds to the \brand{MathJax} setup code. +% +% \begin{macrocode} +\begin{warpMathJax} +\LetLtxMacro\LWR@orig@DeclareBoldMathCommand\DeclareBoldMathCommand + +\renewcommand\DeclareBoldMathCommand[3][bold]{% + \LWR@orig@DeclareBoldMathCommand[#1]{#2}{#3}% + \CustomizeMathJax{\newcommand{#2}{\boldsymbol{#3}}}% +} + +\@onlypreamble\DeclareBoldMathCommand + +\CustomizeMathJax{\newcommand{\bm}[1]{\boldsymbol{#1}}} +\end{warpMathJax} +% \end{macrocode} +% +% \iffalse +%</bm> +% \fi +% +% +% % % \iffalse %<*booklet> @@ -41022,20 +41939,34 @@ span style="width:\LWR@printlength{\ALG@thistlm}; display:inline-block;"% % \pkg{booktabs} is emulated during \HTML\ output, and % used as-is during print output and inside an \HTML\ \env{lateximage}. % +% For \brand{MathJax}, emulation is provided in math mode, but \watchout[\cs{cmidrule}] +% \trouble{booktabs=\pkg{booktabs}} +% \trouble{Mathjax=\brand{MathJax}>booktabs=\pkg{booktabs}} +% \cs{cmidrule} trim must not be used. +% % \changes{v0.34}{2017/08/08}{\pkg{booktabs}: Works inside \env{lateximage}.} % % \codehtml % -% First, forget the placeholder macros: +% If \pkg{booktabs} has already been loaded before \pkg{lwarp}, +% such as by \pkg{memoir}, use it as-is. +% If not, the \pkg{lwarp} core will have placed some dummy macros which should +% be removed before loading the actual \pkg{booktabs} definitions. +% \changes{v0.79}{2019/12/09}{\pkg{booktabs}: Fix for \pkg{memoir} with \env{lateximage}.} +% \begin{macrocode} +\@ifpackageloaded{booktabs}{}{ + \LetLtxMacro\toprule\relax + \LetLtxMacro\midrule\relax + \LetLtxMacro\cmidrule\cline + \LetLtxMacro\bottomrule\relax + \LetLtxMacro\addlinespace\relax + \LetLtxMacro\morecmidrules\relax + \LetLtxMacro\specialrule\relax +} +% \end{macrocode} +% +% Next, load the \pkg{booktabs} package: % \begin{macrocode} -\LetLtxMacro\toprule\relax -\LetLtxMacro\midrule\relax -\LetLtxMacro\cmidrule\cline -\LetLtxMacro\bottomrule\relax -\LetLtxMacro\addlinespace\relax -\LetLtxMacro\morecmidrules\relax -\LetLtxMacro\specialrule\relax - \LWR@ProvidesPackagePass{booktabs}[2019/10/08] % \end{macrocode} % @@ -41058,7 +41989,7 @@ span style="width:\LWR@printlength{\ALG@thistlm}; display:inline-block;"% {% \ifbool{FormatWP}% {\LWR@docmidrule[#1](){1-\arabic{LWR@tabletotalLaTeXcols}}}% - {\global\booltrue{LWR@doingtbrule}}% + {\booltrue{LWR@doingtbrule}}% }% \LWR@getmynexttoken} @@ -41071,7 +42002,7 @@ span style="width:\LWR@printlength{\ALG@thistlm}; display:inline-block;"% {% \ifbool{FormatWP}% {\LWR@docmidrule[#1](){1-\arabic{LWR@tabletotalLaTeXcols}}}% - {\addtocounter{LWR@hlines}{1}}% + {\defaddtocounter{LWR@hlines}{1}}% }% \LWR@getmynexttoken} @@ -41090,7 +42021,7 @@ span style="width:\LWR@printlength{\ALG@thistlm}; display:inline-block;"% {% \ifbool{FormatWP}% {\LWR@docmidrule[#1](){1-\arabic{LWR@tabletotalLaTeXcols}}}% - {\global\booltrue{LWR@doingtbrule}}% + {\booltrue{LWR@doingtbrule}}% }% \LWR@getmynexttoken% }% @@ -41111,6 +42042,22 @@ span style="width:\LWR@printlength{\ALG@thistlm}; display:inline-block;"% \LWR@expandableformatted{specialrule} % \end{macrocode} % +% +% For \brand{MathJax}: +% \changes{v0.79}{2020/01/30}{\pkg{booktabs}: Added \brand{MathJax} emulation.} +% \begin{macrocode} +\begin{warpMathJax} +\CustomizeMathJax{\newcommand{\toprule}[1][]{\hline}} +\CustomizeMathJax{\let\midrule\toprule} +\CustomizeMathJax{\let\bottomrule\toprule} +\CustomizeMathJax{\newcommand{\cmidrule}[2][]{}}% avoid (trim) +\CustomizeMathJax{\newcommand{\morecmidrules}{}} +\CustomizeMathJax{\newcommand{\specialrule}[3]{\hline}} +\CustomizeMathJax{\newcommand{\addlinespace}[1][]{}} +\end{warpMathJax} +% \end{macrocode} +% +% % \iffalse %</booktabs> % \fi @@ -41220,6 +42167,49 @@ span style="width:\LWR@printlength{\ALG@thistlm}; display:inline-block;"% % % % +% +% \iffalse +%<*braket> +% \fi +% +% \part{lwarp-braket.sty} +% +% \section{braket} +% +% \credits{Donald Arseneau} +% +% \DescribePackage{braket} +% \pkg{braket} works as-is for \HTML\ with \SVG\ math. +% For \brand{MathJax}, emulation is provided by \brand{MathJax} macros. +% +% \changes{v0.79}{2020/01/29}{\pkg{braket}: Added.} +% +% \codehtml +% +% \begin{macrocode} +\LWR@ProvidesPackagePass{braket}% No date is provided by the file. +% \end{macrocode} +% +% \begin{macrocode} +\begin{warpMathJax} +\CustomizeMathJax{\newcommand{\bra}[1]{\langle#1\vert}} +\CustomizeMathJax{\newcommand{\Bra}[1]{\left\langle#1\right\vert}} +\CustomizeMathJax{\newcommand{\ket}[1]{\vert#1\rangle}} +\CustomizeMathJax{\newcommand{\Ket}[1]{\left\vert#1\right\rangle}} +\CustomizeMathJax{\newcommand{\braket}[1]{\langle#1\rangle}} +\CustomizeMathJax{\newcommand{\Braket}[1]{\left\langle#1\right\rangle}} +\CustomizeMathJax{\newcommand{\set}[1]{\{#1\}}} +\CustomizeMathJax{\newcommand{\Set}[1]{\left\{#1\right\}}} +\end{warpMathJax} +% \end{macrocode} +% +% \iffalse +%</braket> +% \fi +% +% +% +% % \iffalse %<*breakurl> % \fi @@ -41283,12 +42273,12 @@ span style="width:\LWR@printlength{\ALG@thistlm}; display:inline-block;"% % \DescribePackage{breqn} % \pkg{breqn} is patched for use by \pkg{lwarp}. % -% \env{darray} is not supported. +% \env{darray} is not supported, and in fact does not work in +% the print version either. % \trouble[\env{darray}]{breqn=\pkg{breqn}>darray} % -% MathJax does not support \pkg{breqn}. -% \trouble[\brand{MathJax}]{breqn=\pkg{breqn}>MathJax=\brand{MathJax}} -% \trouble{MathJax=\brand{MathJax}>breqn=\pkg{breqn}} +% While using \brand{MathJax}, \pkg{breqn} objects are +% converted to \SVG\ images. % % \changes{v0.59}{2018/07/25}{\pkg{breqn}: Added.} % @@ -41597,8 +42587,8 @@ s% \typeout{---} \typeout{Packages lwarp and caption:} \typeout{If a ``Missing \protect\begin\protect{document\protect}'' error occurs here,} -\typeout{try using \space \protect\usepackage\protect{caption\protect}\space\protect\captionsetup{options}} -\typeout{instead of \protect\usepackage[options]\protect{caption\protect}.} +\typeout{try using: \space \protect\usepackage\protect{caption\protect}\space\protect\captionsetup{options}} +\typeout{instead of: \protect\usepackage[options]\protect{caption\protect}.} \typeout{---} \LWR@ProvidesPackagePass{caption}[2019/09/01] @@ -41813,10 +42803,7 @@ s% % \pkg{cases} is patched for use by \pkg{lwarp}. % % -% -% MathJax does not support \pkg{cases}. -% \trouble[\brand{MathJax}]{cases=\pkg{cases}>MathJax=\brand{MathJax}} -% \trouble{MathJax=\brand{MathJax}>cases=\pkg{cases}} +% While using \brand{MathJax}, \pkg{cases} objects are converted to \SVG\ math images. % % \changes{v0.58}{2018/06/08}{\pkg{cases}: Added.} % @@ -44133,8 +45120,8 @@ name = \chemmacros_translate:n {scheme-name} % \changes{v0.57}{2018/06/02}{\pkg{colortbl}: New system for switching print and \HTML\ outputs.} % \begin{macrocode} \NewDocumentCommand{\LWR@HTML@columncolor}{O{named} m o o}{% -\convertcolorspec{#1}{#2}{HTML}\LWR@columnHTMLcolor% -\LWR@addtabularcellcolor% + \convertcolorspec{#1}{#2}{HTML}\LWR@columnHTMLcolor% + \LWR@addtabularcellcolor% } \AtBeginDocument{\LWR@formatted{columncolor}} @@ -44151,8 +45138,8 @@ name = \chemmacros_translate:n {scheme-name} % \changes{v0.57}{2018/06/02}{\pkg{colortbl}: New system for switching print and \HTML\ outputs.} % \begin{macrocode} \NewDocumentCommand{\LWR@HTML@rowcolor}{O{named} m o o}{% -\convertcolorspec{#1}{#2}{HTML}\LWR@rowHTMLcolor% -\LWR@getmynexttoken% + \convertcolorspec{#1}{#2}{HTML}\LWR@rowHTMLcolor% + \LWR@getmynexttoken% } \AtBeginDocument{\LWR@expandableformatted{rowcolor}} @@ -44165,8 +45152,8 @@ name = \chemmacros_translate:n {scheme-name} % \changes{v0.57}{2018/06/02}{\pkg{colortbl}: New system for switching print and \HTML\ outputs.} % \begin{macrocode} \NewDocumentCommand{\LWR@HTML@cellcolor}{O{named} m o o}{% -\convertcolorspec{#1}{#2}{HTML}\LWR@cellHTMLcolor% -\LWR@addtabularcellcolor% + \convertcolorspec{#1}{#2}{HTML}\LWR@cellHTMLcolor% + \LWR@addtabularcellcolor% } \AtBeginDocument{\LWR@formatted{cellcolor}} @@ -44181,7 +45168,7 @@ name = \chemmacros_translate:n {scheme-name} % \changes{v0.57}{2018/06/02}{\pkg{colortbl}: New system for switching print and \HTML\ outputs.} % \begin{macrocode} \newcommand{\LWR@HTML@arrayrulecolor}[2][named]{% -\convertcolorspec{#1}{#2}{HTML}\LWR@ruleHTMLcolor% + \convertcolorspec{#1}{#2}{HTML}\LWR@ruleHTMLcolor% } \AtBeginDocument{\LWR@expandableformatted{arrayrulecolor}} @@ -44195,8 +45182,8 @@ name = \chemmacros_translate:n {scheme-name} % \changes{v0.57}{2018/06/02}{\pkg{colortbl}: New system for switching print and \HTML\ outputs.} % \begin{macrocode} \newcommand{\LWR@HTML@arrayrulecolornexttoken}[2][named]{% -\convertcolorspec{#1}{#2}{HTML}\LWR@ruleHTMLcolor% -\LWR@getmynexttoken% + \convertcolorspec{#1}{#2}{HTML}\LWR@ruleHTMLcolor% + \LWR@getmynexttoken% } \AtBeginDocument{\LWR@expandableformatted{arrayrulecolornexttoken}} @@ -45661,6 +46648,12 @@ name = \chemmacros_translate:n {scheme-name} \newcommand{\cleartoevenpage}[1][]{} % \end{macrocode} % +% \changes{v0.79}{2020/01/06}{\pkg{epigraph}: Updated to v1.5e.} +% \begin{macrocode} +\newif\ifepigraphnoindent +\newcommand\epigraphnoindent{\epigraphnoindenttrue} +% \end{macrocode} +% % \iffalse %</epigraph> % \fi @@ -47560,22 +48553,34 @@ solid {\FancyVerbRuleColor{\LWR@origpound\LWR@tempcolor}} ; % space % \begin{noindenvironment} \oarg{offset} \marg{type} \marg{width} % Borrowed from the \pkg{lwarp} version of \pkg{keyfloat}: % \changes{v0.42}{2017/10/26}{\pkg{floatflt}: Added width.} +% \changes{v0.79}{2020/01/08}{\pkg{floatflt}: Improved width control.} % \begin{macrocode} \NewDocumentEnvironment{KFLTfloatflt@marginfloat}{O{-1.2ex} m m} {% -\setlength{\LWR@templengthone}{#3}% -\LWR@BlockClassWP{% - float:right; % - width:\LWR@printlength{\LWR@templengthone}; % extra space - margin:10pt% -}{% - width:\LWR@printlength{\LWR@templengthone}% -}% -{marginblock}% -\captionsetup{type=#2}% + \begin{LWR@setvirtualpage}*% + \ifblank{#3}{% + \LWR@BlockClassWP{% + float:right; % + width: 1.5in; % reasonable dummy width for word processor + margin:10pt% + }{}% + {marginblock}% + }{% + \setlength{\LWR@templengthone}{#3}% + \LWR@BlockClassWP{% + float:right; % + width:\LWR@printlength{\LWR@templengthone}; % extra space + margin:10pt% + }{% + width:\LWR@printlength{\LWR@templengthone}% + }% + {marginblock}% + }% + \captionsetup{type=#2}% } {% -\endLWR@BlockClassWP% + \endLWR@BlockClassWP% + \end{LWR@setvirtualpage}% } % \end{macrocode} % \end{noindenvironment} @@ -47591,7 +48596,7 @@ solid {\FancyVerbRuleColor{\LWR@origpound\LWR@tempcolor}} ; % space % \begin{noindenvironment}{floatingtable} \oarg{placement} % \begin{macrocode} \DeclareDocumentEnvironment{floatingtable}{o} - {\begin{KFLTfloatflt@marginfloat}{table}{1.5in}} + {\begin{KFLTfloatflt@marginfloat}{table}{}} {\end{KFLTfloatflt@marginfloat}} % \end{macrocode} % \end{noindenvironment} @@ -47821,22 +48826,19 @@ solid {\FancyVerbRuleColor{\LWR@origpound\LWR@tempcolor}} ; % space % \begin{noindenvironment}{floatrow} \oarg{numfloats} % \changes{v0.20}{2016/08/20}{Fix: \cs{linewidth} in a floatrow.} +% \changes{v0.79}{2020/01/10}{Factored to \cs{LWR@setvirtualpage}.} +% \changes{v0.79}{2020/01/10}{Fix: Use full \cs{linewidth}.} % % The row of floats is placed into a \element{div} of class |floatrow|. % \begin{macrocode} \newenvironment*{floatrow}[1][2] -{ -\LWR@forcenewpage -\BlockClass{floatrow} -% \end{macrocode} -% While inside the floatrow, divide the \cs{linewidth} by the number of floats. -% \begin{macrocode} -\booltrue{LWR@infloatrow} -\setlength{\linewidth}{6in/#1} +{% + \begin{LWR@setvirtualpage}*% + \BlockClass{floatrow}% } { -\boolfalse{LWR@infloatrow} -\endBlockClass + \endBlockClass% + \end{LWR@setvirtualpage}% } % \end{macrocode} % \end{noindenvironment} @@ -47877,26 +48879,31 @@ solid {\FancyVerbRuleColor{\LWR@origpound\LWR@tempcolor}} ; % space \LWR@traceinfo{finished setkeys frowkeys}% % \end{macrocode} % Create a new float with optional [within]: +% \changes{v0.79}{2020/01/10}{Fix: Use \pkg{newfloat} instead of \pkg{float}.} % \begin{macrocode} \ifthenelse{\equal{\LWR@frowkeywithin}{}}% {% - \LWR@traceinfo{about to newfloat #1 \LWR@frowkeyplacement\ % - \LWR@frowkeyfileext}% - \newfloat{#1}{\LWR@frowkeyplacement}{\LWR@frowkeyfileext}% + \DeclareFloatingEnvironment[ + placement=\LWR@frowkeyplacement, + fileext=\LWR@frowkeyfileext + ]{#1}% }% {% - \LWR@traceinfo{about to newfloat #1\ \LWR@frowkeyplacement\ % - \LWR@frowkeyfileext\ \LWR@frowkeywithin}% - \newfloat{#1}{\LWR@frowkeyplacement}% - {\LWR@frowkeyfileext}[\LWR@frowkeywithin]% - \LWR@traceinfo{finished newfloat #1}% + \DeclareFloatingEnvironment[ + placement=\LWR@frowkeyplacement, + fileext=\LWR@frowkeyfileext, + within=\LWR@frowkeywithin + ]{#1}% +% \LWR@traceinfo{finished newfloat #1}% }% % \end{macrocode} % Rename the float if a name was given: % \begin{macrocode} \ifthenelse{\equal{\LWR@frowkeyname}{}}% {}% - {\floatname{#1}{\LWR@frowkeyname}}% + {% + \SetupFloatingEnvironment{#1}{name={\LWR@frowkeyname}}% + }% } % \end{macrocode} % \end{noindmacro} @@ -48258,6 +49265,8 @@ solid {\FancyVerbRuleColor{\LWR@origpound\LWR@tempcolor}} ; % space % For \XeLaTeX\ and \LuaLaTeX, the \attribute{alt} tag is generic. % % \changes{v0.67}{2019/02/22}{\pkg{fontawesome}: Added.} +% \changes{v0.79}{2020/01/01}{\pkg{fontawesome}: Supports font size, color.} +% \changes{v0.79}{2020/01/01}{\pkg{fontawesome}: Refactored with fix for \cs{FAthree}.} % % \codehtml % @@ -48273,12 +49282,12 @@ solid {\FancyVerbRuleColor{\LWR@origpound\LWR@tempcolor}} ; % space \newfontfamily{\LWR@orig@FA}{FontAwesome} \newcommand*{\LWR@fontawesome@xelatex@symbol}[1]{% -\begin{lateximage}*[icon][fontawesomexetex#1]% -\begingroup% -\LWR@orig@FA% -\LWR@orig@symbol{#1}% -\endgroup% -\end{lateximage}% + \LWR@findcurrenttextcolor% + \begin{lateximage}*[icon][fontawesomexetex#1SZ\LWR@font@size{}CL\LWR@tempcolor]% + \csuse{\LWR@font@size}% + \LWR@orig@FA% + \LWR@orig@symbol{#1}% + \end{lateximage}% } \RenewDocumentCommand{\FA}{}{% @@ -48287,31 +49296,25 @@ solid {\FancyVerbRuleColor{\LWR@origpound\LWR@tempcolor}} ; % space \else +\newcommand*{\LWR@fontawesome@symbolX}[2]{% + \LWR@findcurrenttextcolor% + \begin{lateximage}*[icon #1][fontawesome#2#1SZ\LWR@font@size{}CL\LWR@tempcolor]% + \csuse{\LWR@font@size}% + \fontencoding{U}\fontfamily{fontawesome#2}\selectfont% + \LWR@orig@symbol{#1}% + \end{lateximage}% +} + \newcommand*{\LWR@fontawesome@symbolone}[1]{% -\begin{lateximage}*[icon #1][fontawesomeone#1]% -\begingroup% -\fontencoding{U}\fontfamily{fontawesomeone}\selectfont% -\LWR@orig@symbol{#1}% -\endgroup% -\end{lateximage}% + \LWR@fontawesome@symbolX{#1}{one}% } \newcommand*{\LWR@fontawesome@symboltwo}[1]{% -\begin{lateximage}*[icon #1][fontawesometwo#1]% -\begingroup% -\fontencoding{U}\fontfamily{fontawesometwo}\selectfont% -\LWR@orig@symbol{#1}% -\endgroup% -\end{lateximage}% + \LWR@fontawesome@symbolX{#1}{two}% } \newcommand*{\LWR@fontawesome@symbolthree}[1]{% -\begin{lateximage}*[icon #1][fontawesomethree#1]% -\begingroup% -\fontencoding{U}\fontfamily{fontawesomeonethree}\selectfont% -\LWR@orig@symbol{#1}% -\endgroup% -\end{lateximage}% + \LWR@fontawesome@symbolX{#1}{three}% } \renewrobustcmd\FAone{% @@ -48354,6 +49357,7 @@ solid {\FancyVerbRuleColor{\LWR@origpound\LWR@tempcolor}} ; % space % The \attribute{alt} tag has the name of the icon. % % \changes{v0.67}{2019/02/22}{\pkg{fontawesome5}: Added.} +% \changes{v0.79}{2020/01/01}{\pkg{fontawesome5}: Supports font size, color.} % % \codehtml % @@ -48364,8 +49368,10 @@ solid {\FancyVerbRuleColor{\LWR@origpound\LWR@tempcolor}} ; % space % \begin{macrocode} \ExplSyntaxOn \cs_set:Nn\fontawesome_use_icon:nn{ + \LWR@findcurrenttextcolor \cs_if_exist:cTF{c__fontawesome_slot_#2_tl}{ - \begin{lateximage}*[#2][#1] + \begin{lateximage}*[#2][fontawesome5#1SZ\LWR@font@size{}CL\LWR@tempcolor] + \csuse{\LWR@font@size} \exp_last_unbraced:Nv \__fontawesome_icon_at:nnnn {c__fontawesome_slot_#2_tl} @@ -49584,7 +50590,7 @@ solid {\FancyVerbRuleColor{\LWR@origpound\LWR@tempcolor}} ; % space % % % Handle \optn{origin} key: -% \changes{v0.52}{2018/03/27}{pkg{graphics}: Added defaults.} +% \changes{v0.52}{2018/03/27}{\pkg{graphics}: Added defaults.} % \begin{macrocode} \define@key{igraph}{origin}[c]{% \renewcommand*{\LWR@igorigin}{#1}% @@ -49605,7 +50611,7 @@ solid {\FancyVerbRuleColor{\LWR@origpound\LWR@tempcolor}} ; % space % % Handle \optn{alt} key: % \changes{v0.65}{2018/12/19}{\pkg{graphics}: Added \cs{includegraphics} \attribute{alt} key.} -% \changes{v0.74}{2019/08/20}{Add \cs{ThisAltText}.} +% \changes{v0.74}{2019/08/20}{\pkg{graphics}: Add \cs{ThisAltText}.} % \begin{macrocode} \define@key{igraph}{alt}{\renewcommand*{\LWR@igalt}{#1}} % \end{macrocode} @@ -49630,7 +50636,7 @@ solid {\FancyVerbRuleColor{\LWR@origpound\LWR@tempcolor}} ; % space % \end{macrocode} % % Numerous ignored keys: -% \changes{v0.52}{2018/03/27}{pkg{graphics}: Added defaults.} +% \changes{v0.52}{2018/03/27}{\pkg{graphics}: Added defaults.} % \begin{macrocode} \define@key{igraph}{bb}{} \define@key{igraph}{bbllx}{} @@ -49652,7 +50658,7 @@ solid {\FancyVerbRuleColor{\LWR@origpound\LWR@tempcolor}} ; % space \define@key{igraph}{command}{} % \end{macrocode} % New in v1.1a: -% \changes{v0.52}{2018/03/27}{pkg{graphicx}: Updated for v1.1a.} +% \changes{v0.52}{2018/03/27}{\pkg{graphics}: Updated for v1.1a.} % \begin{macrocode} \define@key{igraph}{quite}{} \define@key{igraph}{page}{} @@ -49660,7 +50666,7 @@ solid {\FancyVerbRuleColor{\LWR@origpound\LWR@tempcolor}} ; % space \define@key{igraph}{interpolate}[true]{} % \end{macrocode} % New in v1.1b: -% \changes{v0.52}{2018/03/27}{pkg{graphicx}: Updated for v1.1b.} +% \changes{v0.52}{2018/03/27}{\pkg{graphics}: Updated for v1.1b.} % \begin{macrocode} \define@key{igraph}{decodearray}{} % \end{macrocode} @@ -49668,21 +50674,24 @@ solid {\FancyVerbRuleColor{\LWR@origpound\LWR@tempcolor}} ; % space % \subsection{Printing \HTML\ styles} -% \begin{macro}{\LWR@rotstyle} \marg{prefix} \marg{degrees} +% \begin{noindmacro}{\LWR@rotstyle} \marg{prefix} \marg{degrees} % % Prints the rotate style with the given prefix. % % |prefix| is |-ms-| or |-webkit-| or nothing, and is used to generate % three versions of the |transform:rotate| style. +% \changes{v0.79}{2019/12/05}{\pkg{graphics}: Fix for negative angles.} % \begin{macrocode} \newcommand*{\LWR@rotstyle}[2]{% - #1transform:rotate(-#2deg); + \edef\LWR@tempone{#2}% + \setcounter{LWR@tempcountone}{-1*\real{\LWR@tempone}} % space + #1transform:rotate(\arabic{LWR@tempcountone}deg); % space } % \end{macrocode} -% \end{macro} +% \end{noindmacro} -% \begin{macro}{\LWR@scalestyle} \marg{prefix} \marg{xscale} \marg{yscale} +% \begin{noindmacro}{\LWR@scalestyle} \marg{prefix} \marg{xscale} \marg{yscale} % % Prints the scale style with the given prefix. % @@ -49690,56 +50699,50 @@ solid {\FancyVerbRuleColor{\LWR@origpound\LWR@tempcolor}} ; % space % three versions of the |transform:scale| style. % \begin{macrocode} \newcommand*{\LWR@scalestyle}[3]{% - #1transform:scale(#2,#3); + #1transform:scale(#2,#3); } % \end{macrocode} -% \end{macro} +% \end{noindmacro} % \subsection{\cs{includegraphics}} -% \DescribeBoolean{LWR@infloatrow} -% Used to compute \cs{linewidth}. -% \begin{macrocode} -\newbool{LWR@infloatrow} -\boolfalse{LWR@infloatrow} -% \end{macrocode} -% \begin{macro}{\LWR@opacity} For \HTML, used only for \cs{includegraphics}. +% \begin{noindmacro}{\LWR@opacity} For \HTML, used only for \cs{includegraphics}. % % \cs{LWR@opacity} may be set by the \pkg{transparent} package. % \begin{macrocode} \def\LWR@opacity{1} % \end{macrocode} -% \end{macro} +% \end{noindmacro} -% \begin{macro}{\LWR@imagesizebox} +% \begin{noindmacro}{\LWR@imagesizebox} % Used to determine the actual image size if needed. % \begin{macrocode} \newsavebox{\LWR@imagesizebox} % \end{macrocode} -% \end{macro} +% \end{noindmacro} -% \begin{macro}{\LWR@HTML@Gin@setfile} \marg{w} \marg{h} \marg{filename} +% \begin{noindmacro}{\LWR@HTML@Gin@setfile} \marg{w} \marg{h} \marg{filename} % Sets the parsed filename for \HTML\ output. % \begin{macrocode} \newcommand*{\LWR@HTML@Gin@setfile}[3]{% \xdef\LWR@parsedfilename{#3}% } % \end{macrocode} -% \end{macro} +% \end{noindmacro} % \DescribeKey[Gin]{class} \CSS\ class for the image. % % Define the new class key for the print-mode version of \cs{includegraphics}, % which is enabled inside a \env{lateximage}. -% \changes{v0.42}{2017/10/24}{\pkg{includegraphics}: Fix: Class key.} +% \changes{v0.42}{2017/10/24}{\pkg{graphics}: Fix: Class key.} % \changes{v0.65}{2018/12/19}{\pkg{graphics}: Added \cs{includegraphics} \attribute{alt} key.} % \begin{macrocode} \AtBeginDocument{ @@ -49749,7 +50752,7 @@ solid {\FancyVerbRuleColor{\LWR@origpound\LWR@tempcolor}} ; % space % \end{macrocode} -% \begin{macro}{\LWR@replaceEPSSVG} +% \begin{noindmacro}{\LWR@replaceEPSSVG} % % Usually, references to \EPS\ files become \SVG\ files, % but if the \pkg{epstopdf} package is being used, it automatically @@ -49767,10 +50770,173 @@ solid {\FancyVerbRuleColor{\LWR@origpound\LWR@tempcolor}} ; % space }% } % \end{macrocode} -% \end{macro} +% \end{noindmacro} + + +% \begin{noindmacro}{\LWR@ig@wpimagesizes} * \oarg{2: options} \oarg{3: options} \marg{4: filename} +% +% If formatting for a word processor, find and set the actual image size, +% without rotation, using \PDF\ instead of \SVG\ to find the original bounding box: +% \changes{v0.42}{2017/10/24}{\pkg{graphics}: If \progcode{FormatWP}, use explicit size.} +% \changes{v0.61}{2018/10/06}{\pkg{graphics}: Fix: \EPS\ for \DVI\ \LaTeX.} +% \changes{v0.62}{2018/10/27}{\pkg{graphics}: Fix: \bool{FormatWP}.} +% \changes{v0.79}{2019/12/09}{\pkg{graphics}: Factored from \cs{LWR@includegraphicsb}.} +% \begin{macrocode} +\newcommand*{\LWR@ig@wpimagesizes}[4]{% + \ifbool{FormatWP}{% + \begingroup% + \LWR@restoreorigformatting% + \ifpdf% + \appto\LWR@restoreorigformatting{% + \DeclareGraphicsExtensions{% + .pdf,.PDF,.gif,.GIF,.png,.PNG,.jpg,.JPG,.jpeg,.JPEG% + }% + }% + \else% \ifpdf + \ifXeTeX% + \appto\LWR@restoreorigformatting{% + \DeclareGraphicsExtensions{% + .pdf,.PDF,.gif,.GIF,.png,.PNG,.jpg,.JPG,.jpeg,.JPEG% + }% + }% + \else% + \appto\LWR@restoreorigformatting{% + \DeclareGraphicsExtensions{% + .eps,.EPS,.gif,.GIF,.png,.PNG,.jpg,.JPG,.jpeg,.JPEG% + }% + }% + \fi% + \fi% \ifpdf + \define@key{Gin}{angle}{}% + \IfBooleanTF{#1}% + {% starred + \IfValueTF{#3}% + {% + \global\sbox{\LWR@imagesizebox}{% + \LWR@origincludegraphics*[#2][#3]{#4}% + }% + }% + {% + \IfValueTF{#2}% + {% + \global\sbox{\LWR@imagesizebox}{% + \LWR@origincludegraphics*[#2]{#4}% + }% + }{% + \global\sbox{\LWR@imagesizebox}{% + \LWR@origincludegraphics*{#4}% + }% + }% + }% + }% starred + {% not starred + \IfValueTF{#3}% + {% + \global\sbox{\LWR@imagesizebox}{% + \LWR@origincludegraphics[#2][#3]{#4}% + }% + }% + {% + \IfValueTF{#2}% + {% + \global\sbox{\LWR@imagesizebox}{% + \LWR@origincludegraphics[#2]{#4}% + }% + }{% + \global\sbox{\LWR@imagesizebox}{% + \LWR@origincludegraphics{#4}% + }% + }% + }% + }% not starred + \endgroup% + \settowidth{\LWR@igwidth}{\usebox{\LWR@imagesizebox}}% + \global\renewcommand*{\LWR@igwidthstyle}{% + width:\LWR@printlength{\LWR@igwidth}% + }% + \settoheight{\LWR@igheight}{\usebox{\LWR@imagesizebox}}% + \global\renewcommand*{\LWR@igheightstyle}{% + height:\LWR@printlength{\LWR@igheight}% + }% + }{}% FormatWP +} +% \end{macrocode} +% \end{noindmacro} + + +% \begin{noindmacro}{\LWR@ig@htmltag} +% For the \HTML\ reference, add the graphicspath, filename, extension, +% alt tag, style, and class. +% \changes{v0.79}{2019/12/09}{\pkg{graphics}: Factored from \cs{LWR@includegraphicsb}.} +% \begin{macrocode} +\newcommand*{\LWR@ig@htmltag}{% + img\LWR@indentHTML% + src="% +% \end{macrocode} +% \changes{v0.62}{2018/10/27}{\pkg{graphics}: Fix: Filename expansion.} +% \begin{macrocode} + \detokenize\expandafter{\LWR@parsedfilename}% +% \end{macrocode} +% \begin{macrocode} + "\LWR@indentHTML% +% \end{macrocode} +% Only include a style tag if a width, height, angle, or scale was given: +% \begin{macrocode} + \ifthenelse{ + \NOT\equal{\LWR@igwidthstyle}{} \OR + \NOT\equal{\LWR@igheightstyle}{} \OR + \NOT\equal{\LWR@igorigin}{} \OR + \NOT\equal{\LWR@igangle}{} \OR + \NOT\equal{\LWR@igxscale}{1} \OR + \NOT\equal{\LWR@igyscale}{1} + }% + {% + style="\LWR@indentHTML + \ifthenelse{\NOT\equal{\LWR@igwidthstyle}{}}% + {\LWR@igwidthstyle;\LWR@indentHTML}{}% + \ifthenelse{\NOT\equal{\LWR@igheightstyle}{}}% + {\LWR@igheightstyle;\LWR@indentHTML}{}% + \ifthenelse{\NOT\equal{\LWR@igorigin}{}}% + {% + transform-origin: \LWR@originnames{\LWR@igorigin};% + \LWR@indentHTML% + }{}% + \ifthenelse{\NOT\equal{\LWR@igangle}{}}% + {% + \LWR@rotstyle{-ms-}{\LWR@igangle}\LWR@indentHTML + \LWR@rotstyle{-webkit-}{\LWR@igangle}\LWR@indentHTML + \LWR@rotstyle{}{\LWR@igangle }\LWR@indentHTML + }{}% + \ifthenelse{% + \NOT\equal{\LWR@igxscale}{1}\OR% + \NOT\equal{\LWR@igyscale}{1}% + }% + {% + \LWR@scalestyle{-ms-}{\LWR@igxscale}{\LWR@igyscale}% + \LWR@indentHTML + \LWR@scalestyle{-webkit-}{\LWR@igxscale}{\LWR@igyscale}% + \LWR@indentHTML + \LWR@scalestyle{}{\LWR@igxscale}{\LWR@igyscale}% + \LWR@indentHTML + }{}% + % + \ifthenelse{\NOT\equal{\LWR@opacity}{1}}% + {opacity:\LWR@opacity;\LWR@indentHTML}{}% + % + "\LWR@indentHTML% + }{}% +% \end{macrocode} +% Set the class and alt tag: +% \changes{v0.65}{2018/12/19}{\pkg{graphics}: Added \cs{includegraphics} \attribute{alt} key.} +% \begin{macrocode} + class="\LWR@igclass"\LWR@indentHTML% + alt="\AltTextOpen\LWR@igalt\AltTextClose" \LWR@orignewline% +}% end of image tags +% \end{macrocode} +% \end{noindmacro} -% \begin{macro}{\LWR@includegraphicsb} * \oarg{2: options} \oarg{3: options} \marg{4: filename} +% \begin{noindmacro}{\LWR@includegraphicsb} * \oarg{2: options} \oarg{3: options} \marg{4: filename} % % \pkg{graphics} syntax is \cs{includegraphics} * \oarg{llx,lly} \oarg{urx,ury} \marg{file} % @@ -49782,246 +50948,121 @@ solid {\FancyVerbRuleColor{\LWR@origpound\LWR@tempcolor}} ; % space % |#4| will be \cs{LWR@epsfig@filename}, which will have been set by the |file| or |figure| keys. % Therefore, |#4| must not be used until after the keys have been processed. % -% \changes{v0.18}{2016/04/14}{Improved \HTML\ output linebreaks.} -% \changes{v0.18}{2016/05/17}{Fix: \cs{linewidth}, \cs{textwidth}, \cs{textheight} +% \changes{v0.18}{2016/04/14}{\pkg{graphics}: Improved \HTML\ output linebreaks.} +% \changes{v0.18}{2016/05/17}{\pkg{graphics}: Fix: \cs{linewidth}, \cs{textwidth}, \cs{textheight} % inside a minipage.} -% \changes{v0.18}{2016/05/17}{em, ex, \%, px dimensions preserved.} -% \changes{v0.18}{2016/05/17}{Add: svgz file extension.} -% \changes{v0.20}{2016/08/20}{Fix: \cs{linewidth} in a floatrow.} -% \changes{v0.20}{2017/01/12}{Fix: Expands filename.} -% \changes{v0.28}{2017/04/12}{Adapts to \pkg{graphics} syntax.} -% \changes{v0.29}{2017/04/15}{Fix: Error when no optional arguments.} -% \changes{v0.40}{2017/09/08}{Add: Full \cs{graphicspath} support.} -% \changes{v0.42}{2017/10/26}{Fix: Filename expansion.} -% \changes{v0.45}{2017/12/29}{Improved URLs with underscores.} -% \changes{v0.59}{2018/09/07}{Now works with \filenm{.pdf} and \filenm{.eps} +% \changes{v0.18}{2016/05/17}{\pkg{graphics}: em, ex, \%, px dimensions preserved.} +% \changes{v0.18}{2016/05/17}{\pkg{graphics}: Add: svgz file extension.} +% \changes{v0.20}{2016/08/20}{\pkg{graphics}: Fix: \cs{linewidth} in a floatrow.} +% \changes{v0.20}{2017/01/12}{\pkg{graphics}: Fix: Expands filename.} +% \changes{v0.28}{2017/04/12}{\pkg{graphics}: Adapts to \pkg{graphics} syntax.} +% \changes{v0.29}{2017/04/15}{\pkg{graphics}: Fix: Error when no optional arguments.} +% \changes{v0.40}{2017/09/08}{\pkg{graphics}: Add: Full \cs{graphicspath} support.} +% \changes{v0.42}{2017/10/26}{\pkg{graphics}: Fix: Filename expansion.} +% \changes{v0.45}{2017/12/29}{\pkg{graphics}: Improved URLs with underscores.} +% \changes{v0.59}{2018/09/07}{\pkg{graphics}: Now works with \filenm{.pdf} and \filenm{.eps} % filename extensions.} -% \changes{v0.66}{2019/02/02}{Improved \HTML\ formatting.} +% \changes{v0.66}{2019/02/02}{\pkg{graphics}: Improved \HTML\ formatting.} % \begin{macrocode} \NewDocumentCommand{\LWR@includegraphicsb}{s o o m} {% % \end{macrocode} % Start the image tag on a new line, allow \PDF\ output word wrap: % \begin{macrocode} -\LWR@origtilde \LWR@orignewline% + \LWR@origtilde \LWR@orignewline% % \end{macrocode} % Temporarily compute \cs{linewidth}, \cs{textwidth}, \cs{textheight} arguments with a 6x9 inch size % until the next \cs{endgroup}. -% \changes{v0.48}{2018/02/11}{Fix: Virtual page size limited to a group.} +% \changes{v0.48}{2018/02/11}{\pkg{graphics}: Fix: Virtual page size limited to a group.} +% \changes{v0.79}{2020/01/10}{Factored to \cs{LWR@setvirtualpage}.} % \begin{macrocode} -\begingroup% -\ifthenelse{\cnttest{\value{LWR@minipagedepth}}{=}{0}}% -{% - \ifbool{LWR@infloatrow}% - {} - {% not in a minipage or a floatrow: - \setlength{\linewidth}{6in}% - \setlength{\textwidth}{6in}% - \setlength{\textheight}{9in}% - }% -}{}% + \begin{LWR@setvirtualpage}% % \end{macrocode} % For correct em sizing during the width and height conversions: % \begin{macrocode} -\large% + \large% % \end{macrocode} % Reset some defaults, possibly will be changed below if options were given: % \begin{macrocode} -\setlength{\LWR@igwidth}{0pt}% -\setlength{\LWR@igheight}{0pt}% -\renewcommand*{\LWR@igwidthstyle}{}% -\renewcommand*{\LWR@igheightstyle}{}% -\renewcommand*{\LWR@igorigin}{}% -\renewcommand*{\LWR@igangle}{}% -\renewcommand*{\LWR@igxscale}{1}% -\renewcommand*{\LWR@igyscale}{1}% -\renewcommand*{\LWR@igclass}{inlineimage}% + \setlength{\LWR@igwidth}{0pt}% + \setlength{\LWR@igheight}{0pt}% + \renewcommand*{\LWR@igwidthstyle}{}% + \renewcommand*{\LWR@igheightstyle}{}% + \renewcommand*{\LWR@igorigin}{}% + \renewcommand*{\LWR@igangle}{}% + \renewcommand*{\LWR@igxscale}{1}% + \renewcommand*{\LWR@igyscale}{1}% + \renewcommand*{\LWR@igclass}{inlineimage}% % \end{macrocode} % \changes{v0.65}{2018/12/19}{\pkg{graphics}: Added \cs{includegraphics} \attribute{alt} key.} -% \changes{v0.74}{2019/08/20}{Add \cs{ThisAltText}.} -% \changes{v0.78}{2019/10/17}{Fix: \attribute{alt} tag expansion.} +% \changes{v0.74}{2019/08/20}{\pkg{graphics}: Add \cs{ThisAltText}.} +% \changes{v0.78}{2019/10/17}{\pkg{graphics}: Fix: \attribute{alt} tag expansion.} % \begin{macrocode} -\ifdefvoid{\LWR@ThisAltText}{% - \edef\LWR@igalt{\ImageAltText}% -}{% - \edef\LWR@igalt{\LWR@ThisAltText}% -}% + \ifdefvoid{\LWR@ThisAltText}{% + \edef\LWR@igalt{\ImageAltText}% + }{% + \edef\LWR@igalt{\LWR@ThisAltText}% + }% % \end{macrocode} % % If |#3| is empty, only one optional argument was given, thus \pkg{graphicx} syntax: % \begin{macrocode} -\IfValueF{#3}{% - \IfValueTF{#2}% - {\setkeys{igraph}{#2}}% - {\setkeys{igraph}{}}% -}% + \IfValueF{#3}{% + \IfValueTF{#2}% + {\setkeys{igraph}{#2}}% + {\setkeys{igraph}{}}% + }% % \end{macrocode} % % Fully expand and detokenize the filename, % changing the file extension to \filenm{.svg} if necessary. -% \changes{v0.59}{2018/08/28}{Fix: Expand filename.} -% \changes{v0.61}{2018/10/01}{Set keys before using filename, for \pkg{epsfig}.} +% \changes{v0.59}{2018/08/28}{\pkg{graphics}: Fix: Expand filename.} +% \changes{v0.61}{2018/10/01}{\pkg{graphics}: Set keys before using filename, for \pkg{epsfig}.} % \begin{macrocode} -\begingroup% -\LetLtxMacro\Gin@setfile\LWR@HTML@Gin@setfile% -\edef\LWR@tempone{#4}% -\StrSubstitute{\LWR@tempone}{.pdf}{.svg}[\LWR@tempone]% -\StrSubstitute{\LWR@tempone}{.PDF}{.SVG}[\LWR@tempone]% -\LWR@replaceEPSSVG% -\xdef\LWR@parsedfilename{\LWR@tempone}% -\Ginclude@graphics{\detokenize\expandafter{\LWR@tempone}}% -\endgroup% -\filename@parse{\LWR@parsedfilename}% -\LWR@traceinfo{LWR@parsedfilename is \LWR@parsedfilename}% + \begingroup% + \LetLtxMacro\Gin@setfile\LWR@HTML@Gin@setfile% + \edef\LWR@tempone{#4}% + \StrSubstitute{\LWR@tempone}{.pdf}{.svg}[\LWR@tempone]% + \StrSubstitute{\LWR@tempone}{.PDF}{.SVG}[\LWR@tempone]% + \LWR@replaceEPSSVG% + \xdef\LWR@parsedfilename{\LWR@tempone}% + \Ginclude@graphics{\detokenize\expandafter{\LWR@tempone}}% + \endgroup% + \filename@parse{\LWR@parsedfilename}% + \LWR@traceinfo{LWR@parsedfilename is \LWR@parsedfilename}% % \LWR@sanitize{\LWR@parsedfilename}% % \end{macrocode} % % If formatting for a word processor, find and set the actual image size, % without rotation, using \PDF\ instead of \SVG\ to find the original bounding box: -% \changes{v0.42}{2017/10/24}{If \progcode{FormatWP}, use explicit size.} -% \changes{v0.61}{2018/10/06}{Fix: \EPS\ for \DVI\ \LaTeX.} -% \changes{v0.62}{2018/10/27}{Fix: \bool{FormatWP}.} % \begin{macrocode} -\ifbool{FormatWP}{% - \begingroup% - \LWR@restoreorigformatting% - \ifpdf% - \appto\LWR@restoreorigformatting{% - \DeclareGraphicsExtensions{.pdf,.PDF,.gif,.GIF,.png,.PNG,.jpg,.JPG,.jpeg,.JPEG}% - }% - \else% \ifpdf - \ifXeTeX% - \appto\LWR@restoreorigformatting{% - \DeclareGraphicsExtensions{.pdf,.PDF,.gif,.GIF,.png,.PNG,.jpg,.JPG,.jpeg,.JPEG}% - }% - \else% - \appto\LWR@restoreorigformatting{% - \DeclareGraphicsExtensions{.eps,.EPS,.gif,.GIF,.png,.PNG,.jpg,.JPG,.jpeg,.JPEG}% - }% - \fi% - \fi% \ifpdf - \define@key{Gin}{angle}{}% - \IfBooleanTF{#1}% - {% starred - \IfValueTF{#3}% - {% - \global\sbox{\LWR@imagesizebox}{\LWR@origincludegraphics*[#2][#3]{#4}}% - }% - {% - \IfValueTF{#2}% - {% - \global\sbox{\LWR@imagesizebox}{\LWR@origincludegraphics*[#2]{#4}}% - }{% - \global\sbox{\LWR@imagesizebox}{\LWR@origincludegraphics*{#4}}% - }% - }% - }% starred - {% not starred - \IfValueTF{#3}% - {% - \global\sbox{\LWR@imagesizebox}{\LWR@origincludegraphics[#2][#3]{#4}}% - }% - {% - \IfValueTF{#2}% - {% - \global\sbox{\LWR@imagesizebox}{\LWR@origincludegraphics[#2]{#4}}% - }{% - \global\sbox{\LWR@imagesizebox}{\LWR@origincludegraphics{#4}}% - }% - }% - }% not starred - \endgroup% - \settowidth{\LWR@igwidth}{\usebox{\LWR@imagesizebox}}% - \global\renewcommand*{\LWR@igwidthstyle}{width:\LWR@printlength{\LWR@igwidth}}% - \settoheight{\LWR@igheight}{\usebox{\LWR@imagesizebox}}% - \global\renewcommand*{\LWR@igheightstyle}{height:\LWR@printlength{\LWR@igheight}}% -}{}% FormatWP + \LWR@ig@wpimagesizes{#1}{#2}{#3}{#4}% % \end{macrocode} % % Create the \HTML\ reference with the graphicspath, filename, extension, -% alt tag, style, and class. -% -% The \cs{LWR@origtilde} adds space between tags in case this -% is being done inside a \cs{savebox} where \cs{newline} has no effect. -% \begin{macrocode} -\LWR@traceinfo{LWR@includegraphicsb: about to create href}% -\href{\LWR@parsedfilename}% -{% start of href -\LWR@traceinfo{LWR@includegraphicsb: about to LWR@htmltag}% -\LWR@htmltag{% start of image tags -img\LWR@indentHTML% -src="% -% \end{macrocode} -% \changes{v0.62}{2018/10/27}{Fix: Filename expansion.} -% \begin{macrocode} -\detokenize\expandafter{\LWR@parsedfilename}% -% \end{macrocode} +% alt tag, style, and class: % \begin{macrocode} -"\LWR@indentHTML% -% \end{macrocode} -% Only include a style tag if a width, height, angle, or scale was given: -% \begin{macrocode} -\ifthenelse{ - \NOT\equal{\LWR@igwidthstyle}{} \OR - \NOT\equal{\LWR@igheightstyle}{} \OR - \NOT\equal{\LWR@igorigin}{} \OR - \NOT\equal{\LWR@igangle}{} \OR - \NOT\equal{\LWR@igxscale}{1} \OR - \NOT\equal{\LWR@igyscale}{1} -}% -{% - style="\LWR@indentHTML - \ifthenelse{\NOT\equal{\LWR@igwidthstyle}{}}% - {\LWR@igwidthstyle;\LWR@indentHTML}{}% - \ifthenelse{\NOT\equal{\LWR@igheightstyle}{}}% - {\LWR@igheightstyle;\LWR@indentHTML}{}% - \ifthenelse{\NOT\equal{\LWR@igorigin}{}}% - {% - transform-origin: \LWR@originnames{\LWR@igorigin};\LWR@indentHTML% - }{}% - \ifthenelse{\NOT\equal{\LWR@igangle}{}}% - {% - \LWR@rotstyle{-ms-}{\LWR@igangle}\LWR@indentHTML - \LWR@rotstyle{-webkit-}{\LWR@igangle}\LWR@indentHTML - \LWR@rotstyle{}{\LWR@igangle }\LWR@indentHTML - }{}% - \ifthenelse{% - \NOT\equal{\LWR@igxscale}{1}\OR% - \NOT\equal{\LWR@igyscale}{1}% - }% - {% - \LWR@scalestyle{-ms-}{\LWR@igxscale}{\LWR@igyscale}\LWR@indentHTML - \LWR@scalestyle{-webkit-}{\LWR@igxscale}{\LWR@igyscale}\LWR@indentHTML - \LWR@scalestyle{}{\LWR@igxscale}{\LWR@igyscale}\LWR@indentHTML - }{}% - % - \ifthenelse{\NOT\equal{\LWR@opacity}{1}}% - {opacity:\LWR@opacity;\LWR@indentHTML}{}% - % - "\LWR@indentHTML% -}{}% -% \end{macrocode} -% Set the class and alt tag: -% \changes{v0.65}{2018/12/19}{\pkg{graphics}: Added \cs{includegraphics} \attribute{alt} key.} -% \begin{macrocode} -class="\LWR@igclass"\LWR@indentHTML% -alt="\AltTextOpen\LWR@igalt\AltTextClose" \LWR@orignewline% -}% end of image tags -}% end of href + \LWR@traceinfo{LWR@includegraphicsb: about to create href}% + \href{\LWR@parsedfilename}% + {% start of href + \LWR@traceinfo{LWR@includegraphicsb: about to LWR@htmltag}% + \LWR@htmltag{\LWR@ig@htmltag}% + }% end of href % \end{macrocode} % Return to original page size and font size: -% \changes{v0.48}{2018/02/11}{Fix: Virtual page size limited to a group.} +% \changes{v0.48}{2018/02/11}{\pkg{graphics}: Fix: Virtual page size limited to a group.} % \begin{macrocode} -\endgroup + \end{LWR@setvirtualpage}% % \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{graphics}: Add \cs{ThisAltText}.} % \begin{macrocode} -\gdef\LWR@ThisAltText{}% -\LWR@traceinfo{LWR@includegraphicsb done}% + \gdef\LWR@ThisAltText{}% + \LWR@traceinfo{LWR@includegraphicsb done}% } % \end{macrocode} -% \end{macro} +% \end{noindmacro} + % \begin{macro}{\includegraphics} \oarg{key=val} \marg{filename} @@ -50053,14 +51094,14 @@ alt="\AltTextOpen\LWR@igalt\AltTextClose" \LWR@orignewline% % \subsection{Boxes} -% \begin{macro}{\LWR@rotboxorigin} Holds the origin key letters. +% \begin{noindmacro}{\LWR@rotboxorigin} Holds the origin key letters. % \begin{macrocode} \newcommand*{\LWR@rotboxorigin}{} % \end{macrocode} -% \end{macro} +% \end{noindmacro} % % -% \begin{macro}{\LWR@originname} \marg{letter} +% \begin{noindmacro}{\LWR@originname} \marg{letter} % % Given one \LaTeX{} origin key value, % translate into an \HTML\ origin word: @@ -50073,10 +51114,10 @@ alt="\AltTextOpen\LWR@igalt\AltTextClose" \LWR@orignewline% \ifthenelse{\equal{#1}{r}}{right}{}% } % \end{macrocode} -% \end{macro} +% \end{noindmacro} % % -% \begin{macro}{\LWR@originnames} \marg{letters} +% \begin{noindmacro}{\LWR@originnames} \marg{letters} % % Given one- or two-letter \LaTeX{} origin key values, % translate into \HTML\ origin words: @@ -50088,7 +51129,7 @@ alt="\AltTextOpen\LWR@igalt\AltTextClose" \LWR@orignewline% \LWR@originname{\LWR@strresult} } % \end{macrocode} -% \end{macro} +% \end{noindmacro} % % % Handle the \optn{origin} key for \cs{rotatebox}: @@ -51995,6 +53036,7 @@ do not attempt to patch lwarp's version of `hyperref'.)\MessageBreak} } % \end{macrocode} + % After \pkg{keyfloat} has loaded: % \begin{macrocode} \AtBeginDocument{ @@ -52018,18 +53060,7 @@ do not attempt to patch lwarp's version of `hyperref'.)\MessageBreak} % % \changes{v0.75}{2019/09/12}{\pkg{keyfloat}: Fix: \cs{normalcolor}.} % \begin{macrocode} -\providecommand*{\KFLT@LWR@hook@keysubfloats}{} -\renewcommand*{\KFLT@LWR@hook@keysubfloats}{% - \ifbool{KFLT@keywrap}{% - }{% - \ifnumequal{\value{KFLT@keyfloatdepth}}{0}{% - \setlength{\linewidth}{6in}% - \setlength{\textwidth}{6in}% - \setlength{\textheight}{9in}% - }{}% - }% - \normalcolor% -} +\LetLtxMacro\KFLT@LWR@hook@keysubfloats\KFLT@LWR@hook@boxouter \let\KFLT@LWR@hook@keyfloatsminipage\relax \let\endKFLT@LWR@hook@keyfloatsminipage\relax @@ -52038,18 +53069,7 @@ do not attempt to patch lwarp's version of `hyperref'.)\MessageBreak} % % \changes{v0.75}{2019/09/12}{\pkg{keyfloat}: Fix: \cs{normalcolor}.} % \begin{macrocode} -\providecommand*{\KFLT@LWR@hook@keyfloats}{} -\renewcommand*{\KFLT@LWR@hook@keyfloats}{% - \ifbool{KFLT@keywrap}{% - }{% - \ifnumequal{\value{KFLT@keyfloatdepth}}{0}{% - \setlength{\linewidth}{6in}% - \setlength{\textwidth}{6in}% - \setlength{\textheight}{9in}% - }{}% - }% - \normalcolor% -} +\LetLtxMacro\KFLT@LWR@hook@keyfloats\KFLT@LWR@hook@boxouter \renewcommand*{\KFLT@maybeendfloatrow}{% \ifnumless{\value{KFLT@thiscol}}{\value{KFLT@numcols}}% @@ -52289,12 +53309,12 @@ do not attempt to patch lwarp's version of `hyperref'.)\MessageBreak} % \begin{noindenvironment}{keywrap} \marg{width} \marg{keyfloat} +% \changes{v0.79}{2020/01/10}{Factored to \cs{LWR@setvirtualpage}.} % ^^A % Modified to vertically align minipage for \HTML\ output: % \begin{macrocode} \DeclareDocumentEnvironment{keywrap}{m +m} {% - \LWR@ensuredoingapar% - \setlength{\linewidth}{6in}% in case #1 has \linewidth + \begin{LWR@setvirtualpage}* \setlength{\LWR@templengthone}{#1}% \begin{LWR@BlockClassWP}% {% @@ -52307,6 +53327,7 @@ do not attempt to patch lwarp's version of `hyperref'.)\MessageBreak} \booltrue{KFLT@keywrap}% #2% \end{LWR@BlockClassWP}% + \end{LWR@setvirtualpage}% } {} % \end{macrocode} @@ -53319,28 +54340,28 @@ do not attempt to patch lwarp's version of `hyperref'.)\MessageBreak} % Options [c], [l], and [r] are ignored. % \begin{macrocode} \newenvironment{longtable*}[2][]{% -\LWR@floatbegin{table}% -\setcaptiontype{\LTcaptype}% -\caption@setoptions{longtable}% -\caption@setoptions{@longtable}% -\caption@LT@setup% -\booltrue{LWR@starredlongtable}% -\boolfalse{LWR@longtable@havehead}% -\let\captionlistentry\LWR@LTcaptionlistentry% -\tabular{#2} + \LWR@floatbegin{table}% + \setcaptiontype{\LTcaptype}% + \caption@setoptions{longtable}% + \caption@setoptions{@longtable}% + \caption@LT@setup% + \booltrue{LWR@starredlongtable}% + \boolfalse{LWR@longtable@havehead}% + \let\captionlistentry\LWR@LTcaptionlistentry% + \tabular{#2}% } {\endtabular\LWR@floatend} \newenvironment{longtable}[2][]{% -\LWR@floatbegin{table}% -\setcaptiontype{\LTcaptype}% -\caption@setoptions{longtable}% -\caption@setoptions{@longtable}% -\caption@LT@setup% -\refstepcounter{\LTcaptype}% -\boolfalse{LWR@longtable@havehead}% -\let\captionlistentry\LWR@LTcaptionlistentry% -\tabular{#2} + \LWR@floatbegin{table}% + \setcaptiontype{\LTcaptype}% + \caption@setoptions{longtable}% + \caption@setoptions{@longtable}% + \caption@LT@setup% + \refstepcounter{\LTcaptype}% + \boolfalse{LWR@longtable@havehead}% + \let\captionlistentry\LWR@LTcaptionlistentry% + \tabular{#2}% } {\endtabular\LWR@floatend} % \end{macrocode} @@ -53373,9 +54394,9 @@ do not attempt to patch lwarp's version of `hyperref'.)\MessageBreak} \space \protect\insertTableNotes\space here, optionally with\MessageBreak \space \protect\UseMinipageWidths\space in front.\MessageBreak - See the lwarp documentation regarding longtables\MessageBreak + See the Lwarp documentation regarding longtables\MessageBreak and threeparttablex} - {See the lwarp documentation regading longtables and threeparttablex.} + {See the Lwarp documentation regading longtables and threeparttablex.} } % \end{macrocode} % @@ -53490,12 +54511,14 @@ do not attempt to patch lwarp's version of `hyperref'.)\MessageBreak} % \pkg{ltablex} is emulated by \pkg{lwarp}. % % \changes{v0.57}{2018/05/25}{\pkg{ltablex}: Added.} +% \changes{v0.79}{2020/01/18}{\pkg{ltablex}: Fix: Require \pkg{longtable}.} % % \codehtml % % Relies on \pkg{tabularx}. % % \begin{macrocode} +\RequirePackage{longtable} \RequirePackage{tabularx} \LWR@ProvidesPackageDrop{ltablex}[2014/08/13] @@ -53615,17 +54638,19 @@ do not attempt to patch lwarp's version of `hyperref'.)\MessageBreak} % \pkg{caption} package, while \pkg{lwarp} does. % % \changes{v0.44}{2017/11/15}{\pkg{ltxtable}: Added.} +% \changes{v0.79}{2020/01/18}{\pkg{ltxtable}: Fix: Required packages.} % % \codehtml % % \begin{macrocode} +\RequirePackage{tabularx,longtable} \LWR@ProvidesPackageDrop{ltxtable}[1995/12/11] % \end{macrocode} % % \begin{noindmacro}{\LTXtable} \marg{width} \marg{file} % \begin{macrocode} \newcommand*{\LTXtable}[2]{% -\input{#2}% + \input{#2}% } % \end{macrocode} % \end{noindmacro} @@ -54423,9 +55448,9 @@ do not attempt to patch lwarp's version of `hyperref'.)\MessageBreak} % % \DescribePackage{mathtools} % \pkg{mathtools} is patched for use by \pkg{lwarp}. +% Emulation macros are provided for \brand{MathJax}. % -% \optn{showonlyrefs} and \optn{mathic} are disabled. -% \trouble[numbering, italics]{mathtools=\pkg{mathtools}} +% \limitsmathtools % % \changes{v0.70}{2019/03/28}{\pkg{mathtools}: Added.} % @@ -54445,7 +55470,18 @@ do not attempt to patch lwarp's version of `hyperref'.)\MessageBreak} % Forces \optn{showonlyrefs} off because \pkg{lwarp} uses \pkg{cleveref}, % which is not compatible with \optn{showonlyrefs}. % \begin{macrocode} -\renewcommand*\MT_showonlyrefs_true:{\MT_showonlyrefs_false:} +\renewcommand*\MT_showonlyrefs_true:{% + \PackageWarningNoLine{lwarp} + {% + Mathtools \space showonlyrefs \space conflicts \space + with \space cleveref,\MessageBreak + which \space is \space used \space by \space lwarp, \space + so \space showonlyrefs \space is\MessageBreak + forced \space off. \space\space + Equation \space numbers \space may \space not \space match% + } + \MT_showonlyrefs_false: +} \mathtoolsset{showonlyrefs=false} % \end{macrocode} % @@ -54459,6 +55495,193 @@ do not attempt to patch lwarp's version of `hyperref'.)\MessageBreak} \MHInternalSyntaxOff % \end{macrocode} % +% +% For \brand{MathJax}: +% +% \changes{v0.79}{2020/01/26}{\pkg{mathtools}: Added \brand{MathJax} emulation.} +% \begin{macrocode} +\begin{warpMathJax} +\CustomizeMathJax{\newcommand{\mathllap}[2][]{{#1#2}}} +\CustomizeMathJax{\newcommand{\mathrlap}[2][]{{#1#2}}} +\CustomizeMathJax{\newcommand{\mathclap}[2][]{{#1#2}}} +\CustomizeMathJax{\newcommand{\mathmbox}[1]{#1}} +\CustomizeMathJax{\newcommand{\clap}[1]{#1}} +\CustomizeMathJax{\newcommand{\LWRmathmakebox}[2][]{#2}} +\CustomizeMathJax{\newcommand{\mathmakebox}[1][]{\LWRmathmakebox}} +\CustomizeMathJax{\newcommand{\cramped}[2][]{{#1#2}}} +\CustomizeMathJax{\newcommand{\crampedllap}[2][]{{#1#2}}} +\CustomizeMathJax{\newcommand{\crampedrlap}[2][]{{#1#2}}} +\CustomizeMathJax{\newcommand{\crampedclap}[2][]{{#1#2}}} +\CustomizeMathJax{\newenvironment{crampedsubarray}[1]{}{}} +\CustomizeMathJax{\newcommand{\crampedsubstack}{}} +\CustomizeMathJax{\newcommand{\smashoperator}[2][]{#2}} +\CustomizeMathJax{\newcommand{\SwapAboveDisplaySkip}{}} + +\CustomizeMathJax{\require{extpfeil}} +\CustomizeMathJax{\Newextarrow\xleftrightarrow{10,10}{0x2194}} +\CustomizeMathJax{\Newextarrow\xLeftarrow{10,10}{0x21d0}} +\CustomizeMathJax{\Newextarrow\xhookleftarrow{10,10}{0x21a9}} +\CustomizeMathJax{\Newextarrow\xmapsto{10,10}{0x21a6}} +\CustomizeMathJax{\Newextarrow\xRightarrow{10,10}{0x21d2}} +\CustomizeMathJax{\Newextarrow\xLeftrightarrow{10,10}{0x21d4}} +\CustomizeMathJax{\Newextarrow\xhookrightarrow{10,10}{0x21aa}} +\CustomizeMathJax{\Newextarrow\xrightharpoondown{10,10}{0x21c1}} +\CustomizeMathJax{\Newextarrow\xleftharpoondown{10,10}{0x21bd}} +\CustomizeMathJax{\Newextarrow\xrightleftharpoons{10,10}{0x21cc}} +\CustomizeMathJax{\Newextarrow\xrightharpoonup{10,10}{0x21c0}} +\CustomizeMathJax{\Newextarrow\xleftharpoonup{10,10}{0x21bc}} +\CustomizeMathJax{\Newextarrow\xleftrightharpoons{10,10}{0x21cb}} + +\CustomizeMathJax{\newcommand{\LWRdounderbracket}[1]{\underline{#1}}} +\CustomizeMathJax{\newcommand{\LWRunderbracket}[2][]{\LWRdounderbracket{#2}}} +\CustomizeMathJax{\newcommand{\underbracket}[1][]{\LWRunderbracket}} +\CustomizeMathJax{\newcommand{\LWRdooverbracket}[1]{\overline{#1}}} +\CustomizeMathJax{\newcommand{\LWRoverbracket}[2][]{\LWRdooverbracket{#2}}} +\CustomizeMathJax{\newcommand{\overbracket}[1][]{\LWRoverbracket}} + +\CustomizeMathJax{\newcommand{\LaTeXunderbrace}[1]{\underbrace{#1}}} +\CustomizeMathJax{\newcommand{\LaTeXoverbrace}[1]{\overbrace{#1}}} + +\CustomizeMathJax{\newenvironment{matrix*}[1][]{\begin{matrix}}{\end{matrix}}} +\CustomizeMathJax{\newenvironment{pmatrix*}[1][]{\begin{pmatrix}}{\end{pmatrix}}} +\CustomizeMathJax{\newenvironment{bmatrix*}[1][]{\begin{bmatrix}}{\end{bmatrix}}} +\CustomizeMathJax{\newenvironment{Bmatrix*}[1][]{\begin{Bmatrix}}{\end{Bmatrix}}} +\CustomizeMathJax{\newenvironment{vmatrix*}[1][]{\begin{vmatrix}}{\end{vmatrix}}} +\CustomizeMathJax{\newenvironment{Vmatrix*}[1][]{\begin{Vmatrix}}{\end{Vmatrix}}} +\CustomizeMathJax{\newenvironment{smallmatrix*}[1][]{\begin{matrix}}{\end{matrix}}} +\CustomizeMathJax{\newenvironment{psmallmatrix*}[1][]{\begin{pmatrix}}{\end{pmatrix}}} +\CustomizeMathJax{\newenvironment{bsmallmatrix*}[1][]{\begin{bmatrix}}{\end{bmatrix}}} +\CustomizeMathJax{\newenvironment{Bsmallmatrix*}[1][]{\begin{Bmatrix}}{\end{Bmatrix}}} +\CustomizeMathJax{\newenvironment{vsmallmatrix*}[1][]{\begin{vmatrix}}{\end{vmatrix}}} +\CustomizeMathJax{\newenvironment{Vsmallmatrix*}[1][]{\begin{Vmatrix}}{\end{Vmatrix}}} +\CustomizeMathJax{\newenvironment{psmallmatrix}[1][]{\begin{pmatrix}}{\end{pmatrix}}} +\CustomizeMathJax{\newenvironment{bsmallmatrix}[1][]{\begin{bmatrix}}{\end{bmatrix}}} +\CustomizeMathJax{\newenvironment{Bsmallmatrix}[1][]{\begin{Bmatrix}}{\end{Bmatrix}}} +\CustomizeMathJax{\newenvironment{vsmallmatrix}[1][]{\begin{vmatrix}}{\end{vmatrix}}} +\CustomizeMathJax{\newenvironment{Vsmallmatrix}[1][]{\begin{Vmatrix}}{\end{Vmatrix}}} + + +\CustomizeMathJax{\newcommand{\LWRmultlined}[1][]{\begin{multline*}}} +\CustomizeMathJax{\newenvironment{multlined}[1][]{\LWRmultlined}{\end{multline*}}} + +\CustomizeMathJax{\let\LWRorigshoveleft\shoveleft} +\CustomizeMathJax{\renewcommand{\shoveleft}[1][]{\LWRorigshoveleft}} +\CustomizeMathJax{\let\LWRorigshoveright\shoveright} +\CustomizeMathJax{\renewcommand{\shoveright}[1][]{\LWRorigshoveright}} + +\CustomizeMathJax{\newenvironment{dcases}{\begin{cases}}{\end{cases}}} +\CustomizeMathJax{\newenvironment{dcases*}{\begin{cases}}{\end{cases}}} +\CustomizeMathJax{\newenvironment{rcases}{\begin{cases}}{\end{cases}}} +\CustomizeMathJax{\newenvironment{rcases*}{\begin{cases}}{\end{cases}}} +\CustomizeMathJax{\newenvironment{drcases}{\begin{cases}}{\end{cases}}} +\CustomizeMathJax{\newenvironment{drcases*}{\begin{cases}}{\end{cases}}} +\CustomizeMathJax{\newenvironment{cases*}{\begin{cases}}{\end{cases}}} + +\CustomizeMathJax{\newcommand{\MoveEqLeft}[1][]{}} + +\CustomizeMathJax{% special parsing to handle '&' in argument + \def\LWRAboxed#1!|!{\fbox{\(#1\)}&\fbox{\(#2\)}} + \newcommand{\Aboxed}[1]{\LWRAboxed#1&&!|!} +} + +\CustomizeMathJax{ + \newcommand{\ArrowBetweenLines}[1][\Updownarrow]{#1}% no starred +} + +\CustomizeMathJax{\newcommand{\shortintertext}[1]{\\ \text{#1}\notag \\}} + +\CustomizeMathJax{\newcommand{\vdotswithin}[1]{\hspace{.5em}\vdots}} +\CustomizeMathJax{\newcommand{\shortvdotswithin}[1]{ & \hspace{.5em}\vdots \\}} +\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}}} +} +\@onlypreamble\DeclareParedDelimiter + +% (\cs{DeclarePairedDelimiterX} is already defined to use \cs{\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} + \appto\LWR@customizedMathJax{\LWRbackslash(}% + \appto\LWR@customizedMathJax{% + \LWRbackslash{}newcommand\{\LWRbackslash\macrotocsname{#1}LWRsub\}% + }% + \appto\LWR@customizedMathJax{[#2]}% + \appto\LWR@customizedMathJax{\{\{\LWRbackslash{}delimsize}% + \LWR@subcustomizedmathjax{#3#4#7}% + \appto\LWR@customizedMathJax{\LWRbackslash{}delimsize}% + \LWR@subcustomizedmathjax{#5#6}% + \appto\LWR@customizedMathJax{\}\}}% + \appto\LWR@customizedMathJax{\LWRbackslash)\par}% + \appto\LWR@customizedMathJax{\LWRbackslash(}% + \appto\LWR@customizedMathJax{% + \LWRbackslash{}newcommand\{\LWRbackslash\macrotocsname{#1}\}[1][]% + }% + \appto\LWR@customizedMathJax{% + \{ + \LWRbackslash{}def\LWRbackslash{}delimsize\{\#1\} + \LWRbackslash\macrotocsname{#1}LWRsub + \}% + }% + \appto\LWR@customizedMathJax{\LWRbackslash)\par}% +} +\@onlypreamble\DeclareParedDelimiterXPP +\@onlypreamble\DeclareParedDelimiterX + +\CustomizeMathJax{\newcommand\lparen{(}} +\CustomizeMathJax{\newcommand\rparen{)}} +\CustomizeMathJax{\newcommand{\vcentcolon}{:}} +\CustomizeMathJax{\newcommand{\ordinarycolon}{:}} + +\CustomizeMathJax{\newcommand\dblcolon{\vcentcolon\vcentcolon}} +\CustomizeMathJax{\newcommand\coloneqq{\vcentcolon=}} +\CustomizeMathJax{\newcommand\Coloneqq{\dblcolon=}} +\CustomizeMathJax{\newcommand\coloneq{\vcentcolon{-}}} +\CustomizeMathJax{\newcommand\Coloneq{\dblcolon{-}}} + +\CustomizeMathJax{\newcommand\eqqcolon{=\vcentcolon}} +\CustomizeMathJax{\newcommand\Eqqcolon{=\dblcolon}} +\CustomizeMathJax{\newcommand\eqcolon{\mathrel{-}\vcentcolon}} +\CustomizeMathJax{\newcommand\Eqcolon{\mathrel{-}\dblcolon}} + +\CustomizeMathJax{\newcommand\colonapprox{\vcentcolon\approx}} +\CustomizeMathJax{\newcommand\Colonapprox{\dblcolon\approx}} +\CustomizeMathJax{\newcommand\colonsim{\vcentcolon\sim}} +\CustomizeMathJax{\newcommand\Colonsim{\dblcolon\sim}} + +\CustomizeMathJax{\newcommand{\nuparrow}{\cancel{\uparrow}}} +\CustomizeMathJax{\newcommand{\ndownarrow}{\cancel{\downarrow}}} +\CustomizeMathJax{\newcommand{\bigtimes}{{\Large\times}}} + +\CustomizeMathJax{\newcommand{\prescript}[3]{{}^{#1}_{#2}#3}} + + +\CustomizeMathJax{\newenvironment{lgathered}{\begin{gathered}}{\end{gathered}}} +\CustomizeMathJax{\newenvironment{rgathered}{\begin{gathered}}{\end{gathered}}} + +\LetLtxMacro\LWR@mathtools@orig@newgathered\newgathered +\renewcommand{\newgathered}[4]{% + \LWR@mathtools@orig@newgathered{#1}{#2}{#3}{#4}% + \appto\LWR@customizedMathJax{\LWRbackslash(}% + \LWR@subcustomizedmathjax{% + \newenvironment{#1}{\begin{gathered}}{\end{gathered}}% + }% + \appto\LWR@customizedMathJax{\LWRbackslash)}% +} +\@onlypreamble\newgathered + +\CustomizeMathJax{\newcommand{\splitfrac}[2]{{}^{#1}_{#2}}} +\CustomizeMathJax{\let\splitdfrac\splitfrac} +\end{warpMathJax} +% \end{macrocode} +% % \iffalse %</mathtools> % \fi @@ -56261,11 +57484,11 @@ background: \LWR@htmltag{td rowspan="#2" % % \end{macrocode} % The vertical alignment, if given: +% \changes{v0.79}{2020/01/17}{\pkg{multirow}: Fix: Centered vertical alignment.} % \begin{macrocode} -\IfValueT{#1}{% +\ifstrequal{#1}{c}{style="\LWR@print@mbox{vertical-align:middle}" }{}% \ifstrequal{#1}{b}{style="\LWR@print@mbox{vertical-align:bottom}" }{}% \ifstrequal{#1}{t}{style="\LWR@print@mbox{vertical-align:top}" }{}% -}% % \end{macrocode} % The left/right border, if given: % \begin{macrocode} @@ -56310,7 +57533,7 @@ class="td% % \begin{macrocode} \begingroup\LetLtxMacro{\\}{\LWR@endofline}#6\endgroup% \LWR@stoppars% -\global\boolfalse{LWR@intabularmetadata}% +\boolfalse{LWR@intabularmetadata}% \renewcommand{\LWR@multirowborder}{}% \LWR@traceinfo{*** LWR@HTML@multirow done}% }% @@ -56351,21 +57574,22 @@ class="td% % \begin{macrocode} \LWR@tabularhtmlcolumns{\arabic{LWR@tableLaTeXcolindex}}{#1} % \end{macrocode} -% Create the multicolumn/multirow tag: +% Create the multicolumn/multirow tag, temporarily redefining the end of line. +% (Using a group caused problems with a nested \env{tabular}. +% \changes{v0.79}{2020/01/18}{\pkg{multirow}: Fix: Nested \env{tabular}s.} % \begin{macrocode} -\begingroup% \LetLtxMacro{\\}{\LWR@endofline}% \LWR@domulticolumn[#3][#4]{#1}{\arabic{LWR@tabhtmlcoltotal}}{#2}{#8}% -\endgroup% +\LetLtxMacro{\\}{\LWR@tabularendofline}% % \end{macrocode} % Move to the next \LaTeX\ column: % \begin{macrocode} -\addtocounter{LWR@tableLaTeXcolindex}{#1}% -\addtocounter{LWR@tableLaTeXcolindex}{-1}% +\defaddtocounter{LWR@tableLaTeXcolindex}{#1}% +\defaddtocounter{LWR@tableLaTeXcolindex}{-1}% % \end{macrocode} % Skip any trailing |@| or |!| columns for this cell: % \begin{macrocode} -\global\booltrue{LWR@skipatbang}% +\booltrue{LWR@skipatbang}% } \LWR@expandableformatted{multicolumnrow} @@ -56375,6 +57599,23 @@ class="td% % \end{macro} % % +% For \brand{MathJax}. +% Only the text is used. All other parameters are ignored. +% \changes{v0.79}{2020/01/27}{\pkg{multirow}: Add: \brand{MathJax} emulation.} +% \begin{macrocode} +\begin{warpMathJax} +% \multirow[vpos]{num}[bigstruts]{width}[vmove]{text} +\CustomizeMathJax{\newcommand{\LWRsubmultirow}[2][]{#2}} +\CustomizeMathJax{\newcommand{\LWRmultirow}[2][]{\LWRsubmultirow}} +\CustomizeMathJax{\newcommand{\multirow}[2][]{\LWRmultirow}} +% +\CustomizeMathJax{\newcommand{\mrowcell}{}} +\CustomizeMathJax{\newcommand{\mcolrowcell}{}} +\CustomizeMathJax{\newcommand{\STneed}[1]{}} +\end{warpMathJax} +% \end{macrocode} +% +% % \iffalse %</multirow> % \fi @@ -57459,7 +58700,9 @@ do not attempt to patch lwarp's version of `nameref'.)\MessageBreak % % For Mathjax: % \begin{macrocode} +\begin{warpMathJax} \CustomizeMathJax{\newcommand{\nicefrac}[3][]{#2/#3}} +\end{warpMathJax} % \end{macrocode} % % ^^A For Ka\TeX: @@ -57494,12 +58737,15 @@ do not attempt to patch lwarp's version of `nameref'.)\MessageBreak \LWR@ProvidesPackageDrop{niceframe}% the original date is in yyyy/dd/mm format % \end{macrocode} % +% \changes{v0.79}{2020/01/07}{\pkg{niceframe}: Fix: Adjust for virtual page size.} % \begin{macrocode} -\newcommand{\LWR@niceframe}[3]{ - \setlength{\LWR@templengthone}{#1} - \begin{BlockClass}[max-width:\LWR@printlength{\LWR@templengthone}]{#3} +\newcommand{\LWR@niceframe}[3]{% + \begin{LWR@setvirtualpage}*% + \setlength{\LWR@templengthone}{#1}% + \begin{BlockClass}[max-width:\LWR@printlength{\LWR@templengthone}]{#3}% #2 - \end{BlockClass} + \end{BlockClass}% + \end{LWR@setvirtualpage}% } \newcommand{\niceframe}[2][\textwidth]{\LWR@niceframe{#1}{#2}{niceframe}} @@ -58750,6 +59996,248 @@ do not attempt to patch lwarp's version of `nameref'.)\MessageBreak % % % +% \iffalse +%<*parallel> +% \fi +% +% \part{lwarp-parallel.sty} +% +% \section{parallel} +% +% \credits{Matthias Eckermann} +% +% \DescribePackage{parallel} \pkg{parallel} is emulated. +% +% Package options are ignored. Footnotes are treated as normal \pkg{lwarp} footnotes. +% +% Environment option \optn{c} gives side-by-side \element{div}s +% of class \attribute{minipage}, each of whose width is a percent depending +% on the given left and right widths, proportional to \cs{linewidth}. +% +% Inside each environment, \cs{linewidth} and \cs{textwidth} are +% set for the print-output sizes. +% +% \changes{v0.79}{2019/12/29}{\pkg{parallel}: Added.} +% +% \codehtml +% +% Discard all options for \pkg{lwarp-parallel}: +% \begin{macrocode} +\LWR@ProvidesPackageDrop{parallel}[2003/04/13] +% \end{macrocode} +% +% +% \begin{macrocode} +\newcounter{LWR@parallel@Lwidth} +\newcounter{LWR@parallel@Rwidth} +\newcommand*{\LWR@parallel@border} + +\newenvironment*{Parallel}[3][]% + {% + \LWR@printpendingfootnotes% + \setlength{\linewidth}{\LWR@userstextwidth}% + \setlength{\textwidth}{\LWR@userstextwidth}% + \renewcommand*{\LWR@parallel@border}{}% + \ifstrequal{#1}{v}% + {% + \renewcommand*{\LWR@parallel@border}{ ; border-left: 2px solid black}% + }% + {}% + \ifblank{#2}{% + \ifblank{#3}{% {}{} + \setcounter{LWR@parallel@Lwidth}{45}% + \setcounter{LWR@parallel@Rwidth}{45}% + }% {}{} + {% {}{x} + \setlength{\LWR@templengthone}{\linewidth-#3}% + \setcounter{LWR@parallel@Lwidth}{% + 90*\ratio{\LWR@templengthone}{\linewidth}% + }% + \setcounter{LWR@parallel@Rwidth}{% + 90*\ratio{#3}{\linewidth}% + }% + }% {}{x} + }% #2 blank + {% #2 non-blank + \ifblank{#3}{% {x}{} + \setcounter{LWR@parallel@Lwidth}{% + 90*\ratio{#2}{\linewidth}% + }% + \setlength{\LWR@templengthone}{\linewidth-#2}% + \setcounter{LWR@parallel@Rwidth}{% + 90*\ratio{\LWR@templengthone}{\linewidth}% + }% + }% {x}{} + {% {x}{x} + \setcounter{LWR@parallel@Lwidth}{% + 90*\ratio{#2}{\linewidth}% + }% + \setcounter{LWR@parallel@Rwidth}{% + 90*\ratio{#3}{\linewidth}% + }% + }% {x}{x} + }% #2 non-blank + } + {% + \ParallelAtEnd% + \renewcommand*{\ParallelAtEnd}{}% + \LWR@printpendingfootnotes% + } + +\newcommand*{\ParallelLText}[1]{% + \begin{BlockClass}[% + width:\arabic{LWR@parallel@Lwidth}\% ; % space + padding: .5ex 1\% ; % space + ]{minipage}% + #1% + \end{BlockClass}% +} + +\newcommand*{\ParallelRText}[1]{% + \begin{BlockClass}[% + width:\arabic{LWR@parallel@Rwidth}\% ; % space + padding: .5ex 1\% ; % space + \LWR@parallel@border% + ]{minipage}% + #1% + \end{BlockClass}% +} + +\newcommand*{\ParallelPar}{\LWR@printpendingfootnotes} + +\newcommand*{\ParallelAtEnd}{} +% \end{macrocode} +% +% \iffalse +%</parallel> +% \fi +% +% +% +% +% +% +% +% \iffalse +%<*parcolumns> +% \fi +% +% \part{lwarp-parcolumns.sty} +% +% \section{parcolumns} +% +% \credits{Jonathan Sauer} +% +% \DescribePackage{parcolumns} \pkg{parcolumns} is emulated. +% +% \optn{rulebetween} is honored. The other keys are ignored, including \optn{colwidths}. +% +% Each column is placed inside a \element{div} of class \attribute{minipage}, +% each of whose width is fixed at 85\% divided by the number of columns. +% In most cases, this results in side-by-side minipages adapting to the browser width. +% Inside each minipage, \cs{linewidth}, \cs{textwidth}, and \cs{textheight} are +% set for a virtual $6\times9$ inch page, with \cs{linewidth} divided by the number +% of columns. +% +% \changes{v0.79}{2019/12/22}{\pkg{parcolumns}: Added.} +% +% \codehtml +% +% Discard all options for \pkg{lwarp-parcolumns}: +% \begin{macrocode} +\RequirePackage{keyval}% + +\LWR@ProvidesPackageDrop{parcolumns}[2004/11/25] +% \end{macrocode} +% +% \begin{macrocode} +\newcounter{LWR@parcolumns@numcols} +\newcounter{LWR@parcolumns@thiscol} +\newcounter{LWR@parcolumns@width} +\newbool{LWR@parcolumns@started} +\newbool{LWR@parcolumns@rule} + +\define@key{LWRparcols}{colwidths}{} +\define@key{LWRparcols}{distance}{} +\define@key{LWRparcols}{rulebetween}[true]{% + \setbool{LWR@parcolumns@rule}{#1}% +} +\define@key{LWRparcols}{nofirstindent}{} +\define@key{LWRparcols}{sloppy}{} +\define@key{LWRparcols}{sloppyspaces}{} + +\newenvironment*{parcolumns}[2][] + {% + \begin{LWR@setvirtualpage}*[#2]% + \setcounter{LWR@parcolumns@numcols}{#2}% + \setcounter{LWR@parcolumns@thiscol}{1}% + \boolfalse{LWR@parcolumns@started}% + \boolfalse{LWR@parcolumns@rule}% + \setcounter{LWR@parcolumns@width}{% + 85/#2 + }% + \setkeys{LWRparcols}{#1}% + } + {\end{LWR@setvirtualpage}} + +\newcommand{\LWR@parcolumns@onecol}[1]{% + \ifbool{LWR@parcolumns@started}% + {}% + {% + \LWR@htmldivclass{parcolumns}% + \booltrue{LWR@parcolumns@started}% + }% + \ifboolexpr{% + bool {LWR@parcolumns@rule} and + test {% + \ifnumgreater + {\value{LWR@parcolumns@thiscol}} + {1} + }% + }% + {\renewcommand{\LWR@tempone}{ ; border-left: 2px solid black}}% + {\renewcommand{\LWR@tempone}{}}% + \begin{BlockClass}[% + width:\arabic{LWR@parcolumns@width}\% ; % space + padding: .5ex 1\% ; % space + \LWR@tempone% + ]{minipage}% + #1% + \end{BlockClass}% + \addtocounter{LWR@parcolumns@thiscol}{1}% +} + +\newcommand{\colchunk}[2][\value{LWR@parcolumns@thiscol}]{% + \whileboolexpr{% + test {% + \ifnumcomp% + {\value{LWR@parcolumns@thiscol}} + {<} + {#1}% + }% + }{% + \LWR@parcolumns@onecol{}% + }% + \LWR@parcolumns@onecol{#2}% +} + +\newcommand*{\colplacechunks}{% + \ifbool{LWR@parcolumns@started}% + {% + \LWR@htmldivclassend{div}% + \boolfalse{LWR@parcolumns@started}% + }% + {}% + \setcounter{LWR@parcolumns@thiscol}{1}% +} +% \end{macrocode} +% +% \iffalse +%</parcolumns> +% \fi +% +% +% % % \iffalse %<*parnotes> @@ -58896,6 +60384,195 @@ do not attempt to patch lwarp's version of `nameref'.)\MessageBreak % % % +% \iffalse +%<*pdfcol> +% \fi +% +% \part{lwarp-pdfcol.sty} +% +% \section{pdfcol} +% +% \DescribePackage{pdfcol} +% \pkg{pdfcol} is ignored. +% +% \changes{v0.79}{2019/12/18}{\pkg{pdfcol}: Added.} +% +% \codehtml +% +% \begin{macrocode} +\LWR@ProvidesPackageDrop{pdfcol}[2018/11/01] + +\ltx@newif\ifpdfcolAvailable +\pdfcolAvailablefalse + +\def\pdfcolErrorNoStacks{ + \PackageInfo{lwarp-pdfcol}{Ignoring pdfcol for HTML output.} +} + +\def\pdfcolInitStack#1{}% + +\long\def\pdfcolIfStackExists#1#2#3{#3}% + +\def\pdfcolSwitchStack#1{}% + +\def\pdfcolSetCurrentColor{}% + +\def\pdfcolSetCurrent#1{}% +% \end{macrocode} +% +% \iffalse +%</pdfcol> +% \fi +% +% +% +% +% \iffalse +%<*pdfcolfoot> +% \fi +% +% \part{lwarp-pdfcolfoot.sty} +% +% \section{pdfcolfoot} +% +% \DescribePackage{pdfcolfoot} +% \pkg{pdfcolfoot} is ignored. +% +% \changes{v0.79}{2019/12/18}{\pkg{pdfcolfoot}: Added.} +% +% \codehtml +% +% \begin{macrocode} +\LWR@ProvidesPackageDrop{pdfcolfoot}[2016/05/16] + +\newcommand*{\pdfcolfoot@switch}{} + +\newcommand*{\pdfcolfoot@current}{} +% \end{macrocode} +% +% \iffalse +%</pdfcolfoot> +% \fi +% +% +% +% +% \iffalse +%<*pdfcolmk> +% \fi +% +% \part{lwarp-pdfcolmk.sty} +% +% \section{pdfcolmk} +% +% \DescribePackage{pdfcolmk} +% \pkg{pdfcolmk} is ignored. +% +% \changes{v0.79}{2019/11/18}{\pkg{pdfcolmk}: Added.} +% +% \codehtml +% +% \begin{macrocode} +\LWR@ProvidesPackageDrop{pdfcolmk}[2016/05/16] +% \end{macrocode} +% +% \iffalse +%</pdfcolmk> +% \fi +% +% +% +% +% \iffalse +%<*pdfcolparallel> +% \fi +% +% \part{lwarp-pdfcolparallel.sty} +% +% \section{pdfcolparallel} +% +% \DescribePackage{pdfcolparallel} +% \pkg{pdfcolparallel} is ignored. +% +% \changes{v0.79}{2019/12/29}{\pkg{pdfcolparallel}: Added.} +% +% \codehtml +% +% \begin{macrocode} +\RequirePackage{keyval}% + +\LWR@ProvidesPackageDropA{pdfcolparallel}{2016/05/16} +% \end{macrocode} +% Pass options to \pkg{parallel}: +% \begin{macrocode} +\DeclareOption*{% + \PassoptionsToPackage{\CurrentOption}{parallel}% +} +% \end{macrocode} +% Process the options: +% \begin{macrocode} +\LWR@ProvidesPackageDropB +% \end{macrocode} +% +% Require \pkg{parallel} with the given options: +% \begin{macrocode} +\RequirePackage{parallel}[2003/04/13] +% \end{macrocode} +% +% Ignore the new key: +% \begin{macrocode} +\define@key{parallel}{rulebetweencolor}{} +% \end{macrocode} +% +% \iffalse +%</pdfcolparallel> +% \fi +% +% +% +% +% \iffalse +%<*pdfcolparcolumns> +% \fi +% +% \part{lwarp-pdfcolparcolumns.sty} +% +% \section{pdfcolparcolumns} +% +% \DescribePackage{pdfcolparcolumns} +% \pkg{pdfcolparcolumns} is ignored. +% +% \changes{v0.79}{2019/12/22}{\pkg{pdfcolparcolumns}: Added.} +% +% \codehtml +% +% \begin{macrocode} +\LWR@ProvidesPackageDropA{pdfcolparcolumns}{2016/05/16} +% \end{macrocode} +% Pass options to \pkg{parcolumns}: +% \begin{macrocode} +\DeclareOption*{% + \PassoptionsToPackage{\CurrentOption}{parcolumns}% +} +% \end{macrocode} +% Process the options: +% \begin{macrocode} +\LWR@ProvidesPackageDropB +% \end{macrocode} +% Require \pkg{parcolumns} with the given options: +% \begin{macrocode} +\RequirePackage{parcolumns}[2004/11/25] +% \end{macrocode} +% +% Ignore the new key: +% \begin{macrocode} +\define@key{LWRparcols}{rulebetweencolor}{} +% \end{macrocode} +% +% \iffalse +%</pdfcolparcolumns> +% \fi +% % % % @@ -59528,6 +61205,318 @@ remember to convert PDF images to SVG using 'lwarpmk pdftosvg *-fig.pdf', % % % \iffalse +%<*physics> +% \fi +% +% \part{lwarp-physics.sty} +% +% \section{physics} +% +% \credits{Sergio C. de la Barrera} +% +% \DescribePackage{physics} +% \limitsphysics +% +% \changes{v0.79}{2020/01/29}{\pkg{physics}: Added.} +% +% \codehtml +% +% \begin{macrocode} +\LWR@ProvidesPackagePass{physics}% No date is provided by the package. +% \end{macrocode} +% +% \begin{macrocode} +% doesn't work with \big, etc: +\begin{warpMathJax} +\CustomizeMathJax{\newcommand{\quantity}{}} +\CustomizeMathJax{\let\qty\quantity} +\CustomizeMathJax{\newcommand{\pqty}[1]{\left(#1\right)}} +\CustomizeMathJax{\newcommand{\bqty}[1]{\left\lbrack#1\right\rbrack}} +\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}} +\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., 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, star +\CustomizeMathJax{\newcommand{\commutator}[2]{\left\lbrack#1,#2\right\rbrack}} +\CustomizeMathJax{\let\comm\commutator} + +% no \Big, star +\CustomizeMathJax{\newcommand{\anticommutator}[2]{% + \left\lbrace#1,#2\right\rbrace}% +} +\CustomizeMathJax{\let\acomm\anticommutator} + +% no \Big, star +\CustomizeMathJax{\let\poissonbracket\anticommutator} +\CustomizeMathJax{\let\pb\anticommutator} + +% no star +\CustomizeMathJax{\newcommand{\vectorbold}[1]{\mathbf{#1}}} +\CustomizeMathJax{\let\vb\vectorbold} + +% no star +\CustomizeMathJax{\newcommand{\vectorarrow}[1]{\vec{\mathbf{#1}}}} +\CustomizeMathJax{\let\va\vectorarrow} + +% no star +\CustomizeMathJax{\newcommand{\vectorunit}[1]{\mathbf{\hat{#1}}}} +\CustomizeMathJax{\let\va\vectorunit} + +\CustomizeMathJax{\newcommand{\dotproduct}{\boldsymbol\cdot}} +\CustomizeMathJax{\let\vdot\dotproduct} + +\CustomizeMathJax{\newcommand{\crossproduct}{\boldsymbol\times}} +\CustomizeMathJax{\let\cross\crossproduct} +\CustomizeMathJax{\let\cp\crossproduct} + +\CustomizeMathJax{\newcommand{\gradient}{\mathbf{\nabla}}} +\CustomizeMathJax{\let\grad\gradient} + +\CustomizeMathJax{\let\divisionsymbol\div} + +\CustomizeMathJax{\newcommand{\divergence}{\nabla\vdot}} +\CustomizeMathJax{\let\div\divergence} + +\CustomizeMathJax{\newcommand{\curl}{\nabla\cross}} + +\CustomizeMathJax{\newcommand{\laplacian}{\nabla^2}} + +% responds to notrig option +\ifx\trigopt 1 + \CustomizeMathJax{\DeclareMathOperator{\sine}{sin}} + \CustomizeMathJax{\DeclareMathOperator{\cosine}{cos}} + \CustomizeMathJax{\DeclareMathOperator{\tangent}{tan}} + \CustomizeMathJax{\DeclareMathOperator{\cosecant}{csc}} + \CustomizeMathJax{\DeclareMathOperator{\secant}{sec}} + \CustomizeMathJax{\DeclareMathOperator{\cotangent}{cot}} + \CustomizeMathJax{\DeclareMathOperator{\arcsine}{arcsin}} + \CustomizeMathJax{\DeclareMathOperator{\arccosine}{arccos}} + \CustomizeMathJax{\DeclareMathOperator{\arctangent}{arctan}} + \CustomizeMathJax{\DeclareMathOperator{\hypsine}{sinh}} + \CustomizeMathJax{\DeclareMathOperator{\hypcosine}{cosh}} + \CustomizeMathJax{\DeclareMathOperator{\hyptangent}{tanh}} + \CustomizeMathJax{\DeclareMathOperator{\hypcotangent}{coth}} + \CustomizeMathJax{\DeclareMathOperator{\exponential}{exp}} + \CustomizeMathJax{\DeclareMathOperator{\logarithm}{log}} + \CustomizeMathJax{\DeclareMathOperator{\naturallogarithm}{\ln}} + \CustomizeMathJax{\DeclareMathOperator{\determinant}{det}} + \CustomizeMathJax{\DeclareMathOperator{\Probability}{Pr}} + \CustomizeMathJax{\newcommand{\sin}[1][{}]{\mathrm{sin}^#1}} + \CustomizeMathJax{\newcommand{\sinh}[1][{}]{\mathrm{sinh}^#1}} + \CustomizeMathJax{\newcommand{\arcsin}[1][{}]{\mathrm{arcsin}^#1}} + \CustomizeMathJax{\newcommand{\asin}[1][{}]{\mathrm{asin}^#1}} + \CustomizeMathJax{\newcommand{\cos}[1][{}]{\mathrm{cos}^#1}} + \CustomizeMathJax{\newcommand{\cosh}[1][{}]{\mathrm{cosh}^#1}} + \CustomizeMathJax{\newcommand{\arccos}[1][{}]{\mathrm{arccos}^#1}} + \CustomizeMathJax{\newcommand{\acos}[1][{}]{\mathrm{acos}^#1}} + \CustomizeMathJax{\newcommand{\tan}[1][{}]{\mathrm{tan}^#1}} + \CustomizeMathJax{\newcommand{\tanh}[1][{}]{\mathrm{tanh}^#1}} + \CustomizeMathJax{\newcommand{\arctan}[1][{}]{\mathrm{arctan}^#1}} + \CustomizeMathJax{\newcommand{\atan}[1][{}]{\mathrm{atan}^#1}} + \CustomizeMathJax{\newcommand{\csc}[1][{}]{\mathrm{csc}^#1}} + \CustomizeMathJax{\newcommand{\csch}[1][{}]{\mathrm{csch}^#1}} + \CustomizeMathJax{\newcommand{\arccsc}[1][{}]{\mathrm{arccsc}^#1}} + \CustomizeMathJax{\newcommand{\acsc}[1][{}]{\mathrm{acsc}^#1}} + \CustomizeMathJax{\newcommand{\sec}[1][{}]{\mathrm{sec}^#1}} + \CustomizeMathJax{\newcommand{\sech}[1][{}]{\mathrm{sech}^#1}} + \CustomizeMathJax{\newcommand{\arcsec}[1][{}]{\mathrm{arcsec}^#1}} + \CustomizeMathJax{\newcommand{\asec}[1][{}]{\mathrm{asec}^#1}} + \CustomizeMathJax{\newcommand{\cot}[1][{}]{\mathrm{cot}^#1}} + \CustomizeMathJax{\newcommand{\coth}[1][{}]{\mathrm{coth}^#1}} + \CustomizeMathJax{\newcommand{\arccot}[1][{}]{\mathrm{arccot}^#1}} + \CustomizeMathJax{\newcommand{\acot}[1][{}]{\mathrm{acot}^#1}} +\else + \CustomizeMathJax{\DeclareMathOperator{\arccsc}{arccsc}} + \CustomizeMathJax{\DeclareMathOperator{\arcsec}{arcsec}} + \CustomizeMathJax{\DeclareMathOperator{\arccot}{arccot}} + \CustomizeMathJax{\DeclareMathOperator{\asin}{asin}} + \CustomizeMathJax{\DeclareMathOperator{\acos}{acos}} + \CustomizeMathJax{\DeclareMathOperator{\atan}{atan}} + \CustomizeMathJax{\DeclareMathOperator{\acsc}{acsc}} + \CustomizeMathJax{\DeclareMathOperator{\asec}{asec}} + \CustomizeMathJax{\DeclareMathOperator{\acot}{acot}} + \CustomizeMathJax{\DeclareMathOperator{\csch}{csch}} + \CustomizeMathJax{\DeclareMathOperator{\sech}{sech}} + \CustomizeMathJax{\newcommand{\tr}{\trace}} + \CustomizeMathJax{\newcommand{\Tr}{\Trace}} + \CustomizeMathJax{\newcommand{\Res}{\Residue}} +\fi + +\CustomizeMathJax{\DeclareMathOperator{\trace}{tr}} +\CustomizeMathJax{\let\tr\trace} +\CustomizeMathJax{\DeclareMathOperator{\Trace}{Tr}} +\CustomizeMathJax{\let\Tr\Trace} +\CustomizeMathJax{\DeclareMathOperator{\rank}{rank}} +\CustomizeMathJax{\DeclareMathOperator{\erf}{erf}} +\CustomizeMathJax{\DeclareMathOperator{\Residue}{Res}} +\CustomizeMathJax{\newcommand{\principalvalue}{\mathcal{P}}} +\CustomizeMathJax{\let\pv\principalvalue} +\CustomizeMathJax{\newcommand{\PV}{\text{P.V.}}} +\CustomizeMathJax{\newcommand{\real}{\mathcal{R}}} +\CustomizeMathJax{\newcommand{\imaginary}{\mathcal{I}}} + +% must be brace arguments +\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{\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}} + +\CustomizeMathJax{\newcommand{\differential}[1][]{\text{d}^{#1}}} +\CustomizeMathJax{\let\dd\differential} + +\CustomizeMathJax{\newcommand{\derivative}[3][]{% + \frac{\text{d}^{#1}#2}{\text{d}#3^{#1}}}% +} +\CustomizeMathJax{\let\dv\derivative} + +\CustomizeMathJax{\newcommand{\partialderivative}[3][]{% + \frac{\partial^{#1}#2}{\partial#3^{#1}}}% +} +\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][]{% + \frac{\delta^{#1}#2}{\delta#3^{#1}}}% +} +\CustomizeMathJax{\let\fdv\functionalderivative} + + +% use \braket to contract +\CustomizeMathJax{\newcommand{\bra}[1]{\langle{#1}\rvert}} +\CustomizeMathJax{\newcommand{\ket}[1]{\lvert{#1}\rangle}} + +% must have two args +\CustomizeMathJax{\newcommand{\innerproduct}[2]{% + \left\langle{#1}\middle\vert{#2}\right\rangle}% +} +\CustomizeMathJax{\let\braket\innerproduct} +\CustomizeMathJax{\let\ip\innerproduct} + +% must have two args +\CustomizeMathJax{\newcommand{\outerproduct}[2]{% + \left\lvert{#1}\middle\rangle\!\middle\langle#2\right\rvert}% +} +\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{\let\expval\expectationvalue} +\CustomizeMathJax{\let\ev\expectationvalue} + +\CustomizeMathJax{\newcommand{\matrixelement}[3]{% + \left\langle{#1}\middle\vert{#2}\middle\vert{#3}\right\rangle}% +} +\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}% +} +\CustomizeMathJax{\newcommand{\bmqty}[1]{\begin{bmatrix}#1\end{bmatrix}}} +\CustomizeMathJax{\newcommand{\vmqty}[1]{\begin{vmatrix}#1\end{vmatrix}}} + +\CustomizeMathJax{\newcommand{\smallmatrixquantity}[1]{% + \begin{smallmatrix}#1\end{smallmatrix}}% +} +\CustomizeMathJax{\let\smqty\smallmatrixquantity} +\CustomizeMathJax{\newcommand{\spmqty}[1]{% + \pqty{\begin{smallmatrix}#1\end{smallmatrix}}}% +} +\CustomizeMathJax{\newcommand{\sPmqty}[1]{% + \left\lgroup\begin{smallmatrix}#1\end{smallmatrix}\right\rgroup}% +} +\CustomizeMathJax{\newcommand{\sbmqty}[1]{% + \bqty{\begin{smallmatrix}#1\end{smallmatrix}}}% +} +\CustomizeMathJax{\newcommand{\svmqty}[1]{% + \vqty{\begin{smallmatrix}#1\end{smallmatrix}}}% +} + +\CustomizeMathJax{\let\matrixdeterminant\vmqty} +\CustomizeMathJax{\let\mdet\vmqty} +\CustomizeMathJax{\let\smdet\svmqty} + +\CustomizeMathJax{\newcommand{\identitymatrix}[1]{(\text{imat}\{#1\})}} +\CustomizeMathJax{\let\imat\identitymatrix} + +\CustomizeMathJax{\newcommand{\xmatrix}[3]{(\text{xmat}\{\}\{#2\}\{#3\})}} +\CustomizeMathJax{\let\xmat\xmatrix} + +\CustomizeMathJax{\newcommand{\zeromatrix}[2]{(\text{zmat}\{#1\}\{#2\})}} +\CustomizeMathJax{\let\zmat\zeromatrix} + +\CustomizeMathJax{\newcommand{\paulimatrix}[1]{(\text{pmat}\{#1\})}} +\CustomizeMathJax{\let\pmat\paulimatrix} + +\CustomizeMathJax{\newcommand{\diagonalmatrix}[2][]{% + \left(\text{dmat}\right)}% +} +\CustomizeMathJax{\let\dmat\diagonalmatrix} + +\CustomizeMathJax{\newcommand{\antidiagonalmatrix}[2][]{% + \left(\text{admat}\right)}% +} +\CustomizeMathJax{\let\admat\antidiagonalmatrix} +\end{warpMathJax} +% \end{macrocode} +% +% \iffalse +%</physics> +% \fi +% +% +% +% +% \iffalse %<*pifont> % \fi % @@ -62396,25 +64385,82 @@ remember to convert PDF images to SVG using 'lwarpmk pdftosvg *-fig.pdf', \__siunitx_number_output_parse:n {#1} } { - \__siunitx_unit_output_pre_print: % \end{macrocode} % For |parse-numbers=false|: % \changes{v0.48}{2018/02/14}{\pkg{siunitx}: Improved \SVG\ math.} % \changes{v0.50}{2018/02/24}{\pkg{siunitx}: Improved \SVG\ math \attribute{alt} tags.} +% \changes{v0.79}{2020/01/21}{\pkg{siunitx}: Improved \brand{MathJax}.} % \begin{macrocode} + \__siunitx_unit_output_pre_print: + \begingroup% lwarp + \boolfalse{mathjax}% lwarp % \__siunitx_print:nn { number } { \ensuremath {#1} } - \LWR@subsingledollar{% lwarp - \textbackslash( \LWR@HTMLsanitize{#1} \textbackslash)% lwarp - }{siunitx}{% - \__siunitx_print:nn { number } {% - \LWR@origensuredmath{#1}% - }% - }% lwarp + \LWR@subsingledollar{% lwarp + \textbackslash( \LWR@HTMLsanitize{#1} \textbackslash)% lwarp + }{siunitx}{% + \__siunitx_print:nn { number } {% + \LWR@origensuredmath{#1}% + }% + }% lwarp + \endgroup% lwarp + \__siunitx_unit_output_print: + } + \group_end:% lwarp +} +% \end{macrocode} +% +% For |parse-numbers=false|: +% \changes{v0.79}{2020/01/21}{\pkg{siunitx}: Improved \brand{MathJax}.} +% \begin{macrocode} +\cs_set_protected:Npn \__siunitx_range_numbers_aux:n #1 + { + \bool_if:NTF \l__siunitx_number_parse_bool + { + \tl_clear:N \l__siunitx_number_out_tl + \tl_clear:N \l__siunitx_number_out_saved_tl + \bool_set_false:N \l__siunitx_number_compound_bool + \__siunitx_number_output_parse:n {#1} + \bool_if:NT \l__siunitx_number_compound_bool + { \msg_error:nnx { siunitx } { multi-part-range } {#1} } + } + { + \__siunitx_unit_output_pre_print: + \begingroup% lwarp + \boolfalse{mathjax}% lwarp +% \__siunitx_print:nn { number } {#1} + \LWR@subsingledollar{% lwarp + \textbackslash( \LWR@HTMLsanitize{#1} \textbackslash)% lwarp + }{siunitx}{% + \__siunitx_print:nn { number } { + \LWR@origensuredmath{#1}% + } % lwarp + }% lwarp + \endgroup% lwarp + \__siunitx_unit_output_print: + } + } % \end{macrocode} +% +% For |parse-numbers=false|: +% \changes{v0.79}{2020/01/21}{\pkg{siunitx}: Improved \brand{MathJax}.} % \begin{macrocode} +\cs_set_protected:Npn \__siunitx_angle_print_direct_aux:nn #1#2 { + \tl_if_empty:nF {#1} + { + \tl_set:Nn \l__siunitx_unit_tl {#2} + \begingroup% lwarp + \boolfalse{mathjax}% lwarp +% \__siunitx_print:nn { number } {#1} + \LWR@subsingledollar{% lwarp + \textbackslash( \LWR@HTMLsanitize{#1} \textbackslash)% lwarp + }{siunitx}{% + \__siunitx_print:nn { number } { + \LWR@origensuredmath{#1}% + } % lwarp + }% lwarp + \endgroup% lwarp \__siunitx_unit_output_print: } - \group_end:% lwarp } % % \end{macrocode} @@ -62492,6 +64538,12 @@ remember to convert PDF images to SVG using 'lwarpmk pdftosvg *-fig.pdf', } % \end{macrocode} % +% \changes{v0.79}{2020/01/20}{\pkg{siunitx}: Fix: \cs{square}, \cs{cubed}.} +% \begin{macrocode} +\cs_undefine:N \__siunitx_textsuperscript:n +\cs_new_protected:Npn \__siunitx_textsuperscript:n #1 {\textsuperscript{#1}} +% \end{macrocode} +% % \begin{macrocode} \RenewDocumentCommand \num { o m } { \leavevmode @@ -62562,6 +64614,241 @@ remember to convert PDF images to SVG using 'lwarpmk pdftosvg *-fig.pdf', \ExplSyntaxOff % \end{macrocode} +% For \brand{MathJax}. +% (The following runs much faster as separate \cs{CusomizeMathJax} calls instead +% of one single call.) +% \begin{macrocode} +\begin{warpMathJax} +\CustomizeMathJax{\newcommand{\ang}[2][]{(\mathrm{#2})\degree}} +\CustomizeMathJax{\newcommand{\num}[2][]{\mathrm{#2}}} +\CustomizeMathJax{\newcommand{\si}[2][]{\mathrm{#2}}} +% +% \SI[opt]{num}[preunit]{unit} +\CustomizeMathJax{\newcommand{\LWRSI}[2][]{\mathrm{#1\LWRSInumber\,#2}}} +\CustomizeMathJax{\newcommand{\SI}[2][]{\def\LWRSInumber{#2}\LWRSI}} +% +\CustomizeMathJax{\newcommand{\numlist}[2][]{\mathrm{#2}}} +\CustomizeMathJax{\newcommand{\numrange}[3][]{\mathrm{#2~-- #3}}} +\CustomizeMathJax{\newcommand{\SIlist}[3][]{\mathrm{#2\,#3}}} +\CustomizeMathJax{\newcommand{\SIrange}[4][]{\mathrm{#2\,#4~-- #3\,#4}}} +\CustomizeMathJax{\newcommand{\tablenum}[2][]{\mathrm{#2}}} +% +\CustomizeMathJax{\newcommand{\ampere}{\mathrm{A}}} +\CustomizeMathJax{\newcommand{\candela}{\mathrm{cd}}} +\CustomizeMathJax{\newcommand{\kelvin}{\mathrm{K}}} +\CustomizeMathJax{\newcommand{\kilogram}{\mathrm{kg}}} +\CustomizeMathJax{\newcommand{\metre}{\mathrm{m}}} +\CustomizeMathJax{\newcommand{\mole}{\mathrm{mol}}} +\CustomizeMathJax{\newcommand{\second}{\mathrm{s}}} +% +\CustomizeMathJax{\newcommand{\becquerel}{\mathrm{Bq}}} +\CustomizeMathJax{\newcommand{\degreeCelsius}{\unicode{x2103}}} +\CustomizeMathJax{\newcommand{\coulomb}{\mathrm{C}}} +\CustomizeMathJax{\newcommand{\farad}{\mathrm{F}}} +\CustomizeMathJax{\newcommand{\gray}{\mathrm{Gy}}} +\CustomizeMathJax{\newcommand{\hertz}{\mathrm{Hz}}} +\CustomizeMathJax{\newcommand{\henry}{\mathrm{H}}} +\CustomizeMathJax{\newcommand{\joule}{\mathrm{J}}} +\CustomizeMathJax{\newcommand{\katal}{\mathrm{kat}}} +\CustomizeMathJax{\newcommand{\lumen}{\mathrm{lm}}} +\CustomizeMathJax{\newcommand{\lux}{\mathrm{lx}}} +\CustomizeMathJax{\newcommand{\newton}{\mathrm{N}}} +\CustomizeMathJax{\newcommand{\ohm}{\mathrm{\Omega}}} +\CustomizeMathJax{\newcommand{\pascal}{\mathrm{Pa}}} +\CustomizeMathJax{\newcommand{\radian}{\mathrm{rad}}} +\CustomizeMathJax{\newcommand{\siemens}{\mathrm{S}}} +\CustomizeMathJax{\newcommand{\sievert}{\mathrm{Sv}}} +\CustomizeMathJax{\newcommand{\steradian}{\mathrm{sr}}} +\CustomizeMathJax{\newcommand{\tesla}{\mathrm{T}}} +\CustomizeMathJax{\newcommand{\volt}{\mathrm{V}}} +\CustomizeMathJax{\newcommand{\watt}{\mathrm{W}}} +\CustomizeMathJax{\newcommand{\weber}{\mathrm{Wb}}} +\CustomizeMathJax{\newcommand{\day}{\mathrm{d}}} +\CustomizeMathJax{\newcommand{\degree}{\mathrm{^\circ}}} +\CustomizeMathJax{\newcommand{\hectare}{\mathrm{ha}}} +\CustomizeMathJax{\newcommand{\hour}{\mathrm{h}}} +\CustomizeMathJax{\newcommand{\litre}{\mathrm{l}}} +\CustomizeMathJax{\newcommand{\liter}{\mathrm{L}}} +\CustomizeMathJax{\newcommand{\arcminute}{^\prime}} +\CustomizeMathJax{\newcommand{\minute}{\mathrm{min}}} +\CustomizeMathJax{\newcommand{\arcsecond}{^{\prime\prime}}} +\CustomizeMathJax{\newcommand{\tonne}{\mathrm{t}}} +\CustomizeMathJax{\newcommand{\astronomicalunit}{au}} +\CustomizeMathJax{\newcommand{\atomicmassunit}{u}} +\CustomizeMathJax{\newcommand{\bohr}{\mathit{a}_0}} +\CustomizeMathJax{\newcommand{\clight}{\mathit{c}_0}} +\CustomizeMathJax{\newcommand{\dalton}{\mathrm{D}_\mathrm{a}}} +\CustomizeMathJax{\newcommand{\electronmass}{\mathit{m}_{\mathrm{e}}}} +\CustomizeMathJax{\newcommand{\electronvolt}{\mathrm{eV}}} +\CustomizeMathJax{\newcommand{\elementarycharge}{\mathit{e}}} +\CustomizeMathJax{\newcommand{\hartree}{\mathit{E}_{\mathrm{h}}}} +\CustomizeMathJax{\newcommand{\planckbar}{\mathit{\unicode{x0127}}}} +\CustomizeMathJax{\newcommand{\angstrom}{\mathrm{\unicode{x00C5}}}} +\CustomizeMathJax{\let\LWRorigbar\bar} +\CustomizeMathJax{\newcommand{\bar}{\mathrm{bar}}} +\CustomizeMathJax{\newcommand{\barn}{\mathrm{b}}} +\CustomizeMathJax{\newcommand{\bel}{\mathrm{B}}} +\CustomizeMathJax{\newcommand{\decibel}{\mathrm{dB}}} +\CustomizeMathJax{\newcommand{\knot}{\mathrm{kn}}} +\CustomizeMathJax{\newcommand{\mmHg}{\mathrm{mmHg}}} +\CustomizeMathJax{\newcommand{\nauticalmile}{\mathrm{M}}} +\CustomizeMathJax{\newcommand{\neper}{\mathrm{Np}}} +% +\CustomizeMathJax{\newcommand{\yocto}{\mathrm{y}}} +\CustomizeMathJax{\newcommand{\zepto}{\mathrm{z}}} +\CustomizeMathJax{\newcommand{\atto}{\mathrm{a}}} +\CustomizeMathJax{\newcommand{\femto}{\mathrm{f}}} +\CustomizeMathJax{\newcommand{\pico}{\mathrm{p}}} +\CustomizeMathJax{\newcommand{\nano}{\mathrm{n}}} +\CustomizeMathJax{\newcommand{\micro}{\mathrm{\unicode{x00B5}}}} +\CustomizeMathJax{\newcommand{\milli}{\mathrm{m}}} +\CustomizeMathJax{\newcommand{\centi}{\mathrm{c}}} +\CustomizeMathJax{\newcommand{\deci}{\mathrm{d}}} +\CustomizeMathJax{\newcommand{\deca}{\mathrm{da}}} +\CustomizeMathJax{\newcommand{\hecto}{\mathrm{h}}} +\CustomizeMathJax{\newcommand{\kilo}{\mathrm{k}}} +\CustomizeMathJax{\newcommand{\mega}{\mathrm{M}}} +\CustomizeMathJax{\newcommand{\giga}{\mathrm{G}}} +\CustomizeMathJax{\newcommand{\tera}{\mathrm{T}}} +\CustomizeMathJax{\newcommand{\peta}{\mathrm{P}}} +\CustomizeMathJax{\newcommand{\exa}{\mathrm{E}}} +\CustomizeMathJax{\newcommand{\zetta}{\mathrm{Z}}} +\CustomizeMathJax{\newcommand{\yotta}{\mathrm{Y}}} +% +\CustomizeMathJax{\newcommand{\percent}{\mathrm{\%}}} +% +\CustomizeMathJax{\newcommand{\meter}{\mathrm{m}}} +\CustomizeMathJax{\newcommand{\metre}{\mathrm{m}}} +% +\CustomizeMathJax{\newcommand{\gram}{\mathrm{g}}} +\CustomizeMathJax{\newcommand{\kg}{\kilo\gram}} +\CustomizeMathJax{\newcommand{\of}[1]{_{\mathrm{#1}}}} +\CustomizeMathJax{\newcommand{\squared}{^2}} +\CustomizeMathJax{\newcommand{\square}[1]{\mathrm{#1}^2}} +\CustomizeMathJax{\newcommand{\cubed}{^3}} +\CustomizeMathJax{\newcommand{\cubic}[1]{\mathrm{#1}^3}} +\CustomizeMathJax{\newcommand{\per}{/}} +\CustomizeMathJax{\newcommand{\celsius}{\unicode{x2103}}} +% +\CustomizeMathJax{\newcommand{\fg}{\femto\gram}} +\CustomizeMathJax{\newcommand{\pg}{\pico\gram}} +\CustomizeMathJax{\newcommand{\ng}{\nano\gram}} +\CustomizeMathJax{\newcommand{\ug}{\micro\gram}} +\CustomizeMathJax{\newcommand{\mg}{\milli\gram}} +\CustomizeMathJax{\newcommand{\g}{\gram}} +\CustomizeMathJax{\newcommand{\kg}{\kilo\gram}} +% +\CustomizeMathJax{\newcommand{\amu}{\mathrm{u}}} +% +\CustomizeMathJax{\newcommand{\pm}{\pico\metre}} +\CustomizeMathJax{\newcommand{\nm}{\nano\metre}} +\CustomizeMathJax{\newcommand{\um}{\micro\metre}} +\CustomizeMathJax{\newcommand{\mm}{\milli\metre}} +\CustomizeMathJax{\newcommand{\cm}{\centi\metre}} +\CustomizeMathJax{\newcommand{\dm}{\deci\metre}} +\CustomizeMathJax{\newcommand{\m}{\metre}} +\CustomizeMathJax{\newcommand{\km}{\kilo\metre}} +% +\CustomizeMathJax{\newcommand{\as}{\atto\second}} +\CustomizeMathJax{\newcommand{\fs}{\femto\second}} +\CustomizeMathJax{\newcommand{\ps}{\pico\second}} +\CustomizeMathJax{\newcommand{\ns}{\nano\second}} +\CustomizeMathJax{\newcommand{\us}{\micro\second}} +\CustomizeMathJax{\newcommand{\ms}{\milli\second}} +\CustomizeMathJax{\newcommand{\s}{\second}} +% +\CustomizeMathJax{\newcommand{\fmol}{\femto\mol}} +\CustomizeMathJax{\newcommand{\pmol}{\pico\mol}} +\CustomizeMathJax{\newcommand{\nmol}{\nano\mol}} +\CustomizeMathJax{\newcommand{\umol}{\micro\mol}} +\CustomizeMathJax{\newcommand{\mmol}{\milli\mol}} +\CustomizeMathJax{\newcommand{\mol}{\mol}} +\CustomizeMathJax{\newcommand{\kmol}{\kilo\mol}} +% +\CustomizeMathJax{\newcommand{\pA}{\pico\ampere}} +\CustomizeMathJax{\newcommand{\nA}{\nano\ampere}} +\CustomizeMathJax{\newcommand{\uA}{\micro\ampere}} +\CustomizeMathJax{\newcommand{\mA}{\milli\ampere}} +\CustomizeMathJax{\newcommand{\A}{\ampere}} +\CustomizeMathJax{\newcommand{\kA}{\kilo\ampere}} +% +\CustomizeMathJax{\newcommand{\ul}{\micro\litre}} +\CustomizeMathJax{\newcommand{\ml}{\milli\litre}} +\CustomizeMathJax{\newcommand{\l}{\litre}} +\CustomizeMathJax{\newcommand{\hl}{\hecto\litre}} +\CustomizeMathJax{\newcommand{\uL}{\micro\liter}} +\CustomizeMathJax{\newcommand{\mL}{\milli\liter}} +\CustomizeMathJax{\newcommand{\L}{\liter}} +\CustomizeMathJax{\newcommand{\hL}{\hecto\liter}} +% +\CustomizeMathJax{\newcommand{\mHz}{\milli\hertz}} +\CustomizeMathJax{\newcommand{\Hz}{\hertz}} +\CustomizeMathJax{\newcommand{\kHz}{\kilo\hertz}} +\CustomizeMathJax{\newcommand{\MHz}{\mega\hertz}} +\CustomizeMathJax{\newcommand{\GHz}{\giga\hertz}} +\CustomizeMathJax{\newcommand{\THz}{\tera\hertz}} +% +\CustomizeMathJax{\newcommand{\mN}{\milli\newton}} +\CustomizeMathJax{\newcommand{\N}{\newton}} +\CustomizeMathJax{\newcommand{\kN}{\kilo\newton}} +\CustomizeMathJax{\newcommand{\MN}{\mega\newton}} +% +\CustomizeMathJax{\newcommand{\Pa}{\pascal}} +\CustomizeMathJax{\newcommand{\kPa}{\kilo\pascal}} +\CustomizeMathJax{\newcommand{\MPa}{\mega\pascal}} +\CustomizeMathJax{\newcommand{\GPa}{\giga\pascal}} +% +\CustomizeMathJax{\newcommand{\mohm}{\milli\ohm}} +\CustomizeMathJax{\newcommand{\kohm}{\kilo\ohm}} +\CustomizeMathJax{\newcommand{\Mohm}{\mega\ohm}} +% +\CustomizeMathJax{\newcommand{\pV}{\pico\volt}} +\CustomizeMathJax{\newcommand{\nV}{\nano\volt}} +\CustomizeMathJax{\newcommand{\uV}{\micro\volt}} +\CustomizeMathJax{\newcommand{\mV}{\milli\volt}} +\CustomizeMathJax{\newcommand{\V}{\volt}} +\CustomizeMathJax{\newcommand{\kV}{\kilo\volt}} +% +\CustomizeMathJax{\newcommand{\W}{\watt}} +\CustomizeMathJax{\newcommand{\uW}{\micro\watt}} +\CustomizeMathJax{\newcommand{\mW}{\milli\watt}} +\CustomizeMathJax{\newcommand{\kW}{\kilo\watt}} +\CustomizeMathJax{\newcommand{\MW}{\mega\watt}} +\CustomizeMathJax{\newcommand{\GW}{\giga\watt}} +% +\CustomizeMathJax{\newcommand{\J}{\joule}} +\CustomizeMathJax{\newcommand{\uJ}{\micro\joule}} +\CustomizeMathJax{\newcommand{\mJ}{\milli\joule}} +\CustomizeMathJax{\newcommand{\kJ}{\kilo\joule}} +% +\CustomizeMathJax{\newcommand{\eV}{\electronvolt}} +\CustomizeMathJax{\newcommand{\meV}{\milli\electronvolt}} +\CustomizeMathJax{\newcommand{\keV}{\kilo\electronvolt}} +\CustomizeMathJax{\newcommand{\MeV}{\mega\electronvolt}} +\CustomizeMathJax{\newcommand{\GeV}{\giga\electronvolt}} +\CustomizeMathJax{\newcommand{\TeV}{\tera\electronvolt}} +% +\CustomizeMathJax{\newcommand{\kWh}{\kilo\watt\hour}} +% +\CustomizeMathJax{\newcommand{\F}{\farad}} +\CustomizeMathJax{\newcommand{\fF}{\femto\farad}} +\CustomizeMathJax{\newcommand{\pF}{\pico\farad}} +% +\CustomizeMathJax{\newcommand{\K}{\mathrm{K}}} +% +\CustomizeMathJax{\newcommand{\dB}{\mathrm{dB}}} +% +\CustomizeMathJax{\newcommand{\kibi}{\mathrm{Ki}}} +\CustomizeMathJax{\newcommand{\mebi}{\mathrm{Mi}}} +\CustomizeMathJax{\newcommand{\gibi}{\mathrm{Gi}}} +\CustomizeMathJax{\newcommand{\tebi}{\mathrm{Ti}}} +\CustomizeMathJax{\newcommand{\pebi}{\mathrm{Pi}}} +\CustomizeMathJax{\newcommand{\exbi}{\mathrm{Ei}}} +\CustomizeMathJax{\newcommand{\zebi}{\mathrm{Zi}}} +\CustomizeMathJax{\newcommand{\yobi}{\mathrm{Yi}}} +\end{warpMathJax} +% \end{macrocode} + % \iffalse %</siunitx> % \fi @@ -62609,6 +64896,41 @@ remember to convert PDF images to SVG using 'lwarpmk pdftosvg *-fig.pdf', % % % +% \iffalse +%<*slashed> +% \fi +% +% \part{lwarp-slashed.sty} +% +% \section{slashed} +% +% \credits{David Carlisle} +% +% \DescribePackage{slashed} +% \pkg{slashed} works as-s for \HTML\ \SVG\ math. +% For \brand{MathJax}, emulation is provided. +% +% \changes{v0.79}{2020/01/30}{\pkg{slashed}: Added.} +% +% \codehtml +% +% \begin{macrocode} +\LWR@ProvidesPackagePass{slashed}[1997/01/16] +% \end{macrocode} +% +% \begin{macrocode} +\begin{warpMathJax} +\CustomizeMathJax{\newcommand{\slashed}[1]{\cancel{#1}}} +\end{warpMathJax} +% \end{macrocode} +% +% \iffalse +%</slashed> +% \fi +% +% +% +% % % \iffalse %<*soul> @@ -63151,6 +65473,47 @@ remember to convert PDF images to SVG using 'lwarpmk pdftosvg *-fig.pdf', % % % +% \iffalse +%<*steinmetz> +% \fi +% +% \part{lwarp-steinmetz.sty} +% +% \section{steinmetz} +% +% \credits{Enrico Gregorio} +% +% \DescribePackage{steinmetz} +% \pkg{steinmetz} is patched for use by \pkg{lwarp}. +% Emulation is provided for \brand{MathJax} +% +% \changes{v0.79}{2020/01/31}{\pkg{steinmetz}: Added.} +% +% \codehtml +% +% \begin{macrocode} +\LWR@ProvidesPackagePass{steinmetz}[2009/06/14] +% \end{macrocode} +% +% \begin{macrocode} +\begin{warpHTML} +\renewcommand{\phase}[2][]{% + \begin{lateximage}*[steinmetz\{\detokenize{#2}\}] + \ensuremath{\underline{/#2}} + \end{lateximage} +} +\end{warpHTML} + +\begin{warpMathJax} +\CustomizeMathJax{\newcommand{\phase}[2][]{\underline{/#2}}} +\end{warpMathJax} +% \end{macrocode} +% +% \iffalse +%</steinmetz> +% \fi +% +% % % \iffalse %<*stfloats> @@ -63754,6 +66117,56 @@ remember to convert PDF images to SVG using 'lwarpmk pdftosvg *-fig.pdf', % % % +% \iffalse +%<*svg> +% \fi +% +% \part{lwarp-svg.sty} +% +% \section{svg} +% +% \credits{Philip Ilten, Falk Hanisch} +% +% \DescribePackage{svg} +% \pkg{svg} is patched for use by \pkg{lwarp}. +% +% \changes{v0.79}{2020/01/05}{\pkg{svg}: Added.} +% +% \codehtml +% +% \begin{macrocode} +\LWR@ProvidesPackagePass{svg}[2019/10/22] +% \end{macrocode} +% +% \begin{macrocode} +\xpretocmd{\includesvg}% + {\begin{lateximage}}% + {}% + {\LWR@patcherror{svg}{includesvg}} + +\xapptocmd{\includesvg}% + {\end{lateximage}}% + {}% + {\LWR@patcherror{svg}{includesvg}} + +\xpretocmd{\includeinkscape}% + {\begin{lateximage}}% + {}% + {\LWR@patcherror{svg}{includeinkscape}} + +\xapptocmd{\includeinkscape}% + {\end{lateximage}}% + {}% + {\LWR@patcherror{svg}{includeinkscape}} +% \end{macrocode} +% +% \iffalse +%</svg> +% \fi +% +% +% +% % % % \iffalse @@ -66951,23 +69364,29 @@ remember to convert PDF images to SVG using 'lwarpmk pdftosvg *-fig.pdf', % \trouble[Not \XeLaTeX!]{transparent=\pkg{transparent}} % % \changes{v0.36}{2017/08/09}{\pkg{transparent}: Added.} +% \changes{v0.79}{2020/01/05}{\pkg{transparent}: Supports \env{lateximage}s.} % % \codehtml % % Discard all options for \pkg{lwarp-transparent}: % \begin{macrocode} -\LWR@ProvidesPackageDrop{transparent}[2016/05/16] +\LWR@ProvidesPackagePass{transparent}[2019/11/29] % \end{macrocode} % % \begin{macrocode} -\newcommand*{\transparent}[1]{\edef\LWR@opacity{#1}} +\newcommand*{\LWR@HTML@transparent}[1]{\edef\LWR@opacity{#1}} + +\LWR@formatted{transparent} + -\newcommand*{\texttransparent}[2]{% +\newcommand*{\LWR@HTML@texttransparent}[2]{% \begingroup% \transparent{#1}% \InlineClass[opacity: #1]{transparent}{#2}% \endgroup% } + +\LWR@formatted{texttransparent} % \end{macrocode} % % \iffalse @@ -67513,6 +69932,76 @@ remember to convert PDF images to SVG using 'lwarpmk pdftosvg *-fig.pdf', % % % \iffalse +%<*unicode-math> +% \fi +% +% \part{lwarp-unicode-math.sty} +% +% \section{unicode-math} +% +% \credits{Will Robertson} +% +% \DescribePackage{unicode-math} +% \pkg{unicode-math} is supported as-is for \HTML\ with \SVG math. +% For \brand{MathJax}, many characters do not seem to be encoded correctly, +% and so are not read correctly by \prog{pdftotext} for \HTML. +% Symbol font commands are emulated, but not all combinations are +% supported by MathJax. +% +% \changes{v0.79}{2020/01/30}{\pkg{unicode-math}: Added.} +% +% \codehtml +% +% \begin{macrocode} +\LWR@ProvidesPackagePass{unicode-math}[2019/09/26] +% \end{macrocode} +% +% \begin{macrocode} +\begin{warpHTML} +% Not all are possible in MathJax. +\CustomizeMathJax{\let\symnormal\mathrm} +\CustomizeMathJax{\let\symliteral\mathrm} +\CustomizeMathJax{\let\symbb\mathbb} +\CustomizeMathJax{\let\symbbit\mathbb}% not italic +\CustomizeMathJax{\let\symcal\mathcal} +\CustomizeMathJax{\let\symscr\mathscr} +\CustomizeMathJax{\let\symfrak\mathfrak} +\CustomizeMathJax{\let\symsfup\mathsf}% not up +\CustomizeMathJax{\let\symsfit\mathit}% not sans +\CustomizeMathJax{\let\symbfsf\mathbf}% not sans +\CustomizeMathJax{\let\symbfup\mathbf}% not up +\CustomizeMathJax{\let\symbfit\mathit}% not bold +\CustomizeMathJax{\let\symbfcal\mathcal}% not bold +\CustomizeMathJax{\let\symbfscr\mathscr}% not bold +\CustomizeMathJax{\let\symbffrak\mathfrak}% not bold +\CustomizeMathJax{\let\symbfsfup\mathbf}% not sans +\CustomizeMathJax{\let\symbfsfit\mathit}% not bold nor sans +% Duplicates below are commented out. +\CustomizeMathJax{\let\symup\mathrm} +\CustomizeMathJax{\let\symbf\mathbf}% \symbfup defined above +\CustomizeMathJax{\let\symit\mathit} +% \CustomizeMathJax{\let\symbfit\mathit}% not bold +\CustomizeMathJax{\let\symsf\mathsf} +% \CustomizeMathJax{\let\symbfsfup\mathbf}% not sans +% \CustomizeMathJax{\let\symsfit\mathit}% not sans +% \CustomizeMathJax{\let\symbfsfit\mathit}% not bold nor sans +\CustomizeMathJax{\let\symtt\mathtt} +% \CustomizeMathJax{\let\symbb\mathbb} +% \CustomizeMathJax{\let\symbbit\mathbb}% not italic +% \CustomizeMathJax{\let\symscr\mathscr} +% \CustomizeMathJax{\let\symbfscr\mathscr}% not bold +% \CustomizeMathJax{\let\symfrak\mathfrak} +\CustomizeMathJax{\let\symbffrac\mathbffrac} +\end{warpHTML} +% \end{macrocode} +% +% \iffalse +%</unicode-math> +% \fi +% +% +% +% \iffalse %<*units> % \fi % @@ -67572,8 +70061,10 @@ remember to convert PDF images to SVG using 'lwarpmk pdftosvg *-fig.pdf', % % For Mathjax: % \begin{macrocode} +\begin{warpMathJax} \CustomizeMathJax{\newcommand{\unit}[2][]{#1 #2}} \CustomizeMathJax{\newcommand{\unitfrac}[3][]{#1 #2/#3}} +\end{warpMathJax} % \end{macrocode} % ^^A For Ka\TeX: @@ -68277,6 +70768,40 @@ remember to convert PDF images to SVG using 'lwarpmk pdftosvg *-fig.pdf', % % % +% +% +% \iffalse +%<*widetable> +% \fi +% +% \part{lwarp-widetable.sty} +% +% \section{widetable} +% +% \credits{Claudio Beccari} +% +% \DescribePackage{widetable} +% \pkg{widetable} is emulated. +% +% \changes{v0.79}{2020/01/07}{\pkg{widetable}: Added.} +% +% \codehtml +% +% \begin{macrocode} +\LWR@ProvidesPackageDrop{widetable}[2019-06-25] +% \end{macrocode} +% +% \begin{macrocode} +\newenvironment{widetable}{\begin{tabular*}}{\end{tabular*}} +% \end{macrocode} +% +% \iffalse +%</widetable> +% \fi +% +% +% +% % \iffalse %<*widows-and-orphans> % \fi @@ -68310,6 +70835,104 @@ remember to convert PDF images to SVG using 'lwarpmk pdftosvg *-fig.pdf', % % % \iffalse +%<*witharrows> +% \fi +% +% \part{lwarp-witharrows.sty} +% +% \section{witharrows} +% +% \credits{F. Pantigny} +% +% \DescribePackage{witharrows} +% \pkg{witharrows} is patched for use by \pkg{lwarp}. +% Emulation is provided for \brand{MathJax}. +% +% \changes{v0.79}{2020/01/31}{\pkg{witharrows}: Added.} +% +% \codehtml +% +% \begin{macrocode} +\LWR@ProvidesPackagePass{witharrows}[2019/12/27] +% \end{macrocode} +% +% \begin{macrocode} +\begin{warpHTML} +\makeatletter +\ifbool{mathjax}{ + % For the hidden print version in the HTML: + \newcommand{\Arrow}[2][]{} + \newcommand{\unicode}[1]{} + \NewDocumentEnvironment { DispWithArrows } { ! d < > ! O { } +b} + { + \IfValueTF{#1}{ + \begin{displaymath} + #1 \left\lbrace + \begin{align} + #3 + \end{align} + \right . + \end{displaymath} + }{ + \begin{displaymath} + \begin{align} + #3 + \end{align} + \end{displaymath} + } + } + {} + \NewDocumentEnvironment { DispWithArrows* } { ! d < > ! O { } +b} + { + \IfValueTF{#1}{ + \begin{displaymath} + #1 \left\lbrace + \begin{align*} + #3 + \end{align*} + \right . + \end{displaymath} + }{ + \begin{displaymath} + \begin{align*} + #3 + \end{align*} + \end{displaymath} + } + } + {} +}{ + % If not MathJax, use SVG images. + \BeforeBeginEnvironment{WithArrows}{\global\booltrue{LWR@unknownmathsize}} + \BeforeBeginEnvironment{DispWithArrows}{% + \begin{BlockClass}{displaymathnumbered}% + \begin{lateximage}% + } + \AfterEndEnvironment{DispWithArrows}{\end{lateximage}\end{BlockClass}} + \BeforeBeginEnvironment{DispWithArrows*}{% + \begin{BlockClass}{displaymath}% + \begin{lateximage}% + } + \AfterEndEnvironment{DispWithArrows*}{\end{lateximage}\end{BlockClass}} +} +\makeatother +\end{warpHTML} + +\begin{warpMathJax} +\CustomizeMathJax{\newenvironment{WithArrows}[1][]{\begin{aligned}}{\end{aligned}}} +% Unable to make a sized box. +\CustomizeMathJax{\newcommand{\Arrow}[2][]{&{\Large\unicode{x2938}}~\textit{#2}}} +\end{warpMathJax} +% \end{macrocode} +% +% \iffalse +%</witharrows> +% \fi +% +% +% +% +% \iffalse %<*wrapfig> % \fi @@ -68351,7 +70974,7 @@ remember to convert PDF images to SVG using 'lwarpmk pdftosvg *-fig.pdf', margin:10pt% }% {% - \LWR@wrapposition% + width:\LWR@printlength{\LWR@templengthone}; \LWR@wrapposition; % }% {marginblock}% % \end{macrocode} @@ -68363,31 +70986,37 @@ remember to convert PDF images to SVG using 'lwarpmk pdftosvg *-fig.pdf', \NewDocumentEnvironment{wrapfigure}{o m o m} {% +\begin{LWR@setvirtualpage}*% \LWR@subwrapfigure{#2}{#4}% \captionsetup{type=figure}% } {% \endLWR@BlockClassWP% +\end{LWR@setvirtualpage}% } \NewDocumentEnvironment{wraptable}{o m o m} {% +\begin{LWR@setvirtualpage}*% \LWR@subwrapfigure{#2}{#4}% \captionsetup{type=table}% } {% \endLWR@BlockClassWP% +\end{LWR@setvirtualpage}% } \NewDocumentEnvironment{wrapfloat}{m o m o m} {% +\begin{LWR@setvirtualpage}*% \LWR@subwrapfigure{#3}{#5}% \captionsetup{type=#1}% } {% \endLWR@BlockClassWP% +\end{LWR@setvirtualpage}% } \newlength{\wrapoverhang} @@ -69048,6 +71677,7 @@ height:\LWR@printlength{\LWR@tempheight}% % % \subsection{Row colors} % \changes{v0.49}{2018/02/17}{\pkg{xcolor}: Added tabular row colors.} +% \changes{v0.79}{2020/01/18}{\pkg{xcolor}: Fix: Nested \env{tabular}s.} % % \begin{noindmacro}{\rowc@l@rs} \oarg{cmds} \marg{startrow} \marg{odd color} \marg{even color} % \begin{macrocode} @@ -69055,8 +71685,8 @@ height:\LWR@printlength{\LWR@tempheight}% \def\rowc@l@rs[#1]#2#3#4% { -\global\rownum=1 - \global\@rowcolorstrue +\rownum=1% + \@rowcolorstrue% \@ifxempty{#3}% {\def\@oddrowcolor{\@norowcolor}}% {% @@ -69116,10 +71746,11 @@ height:\LWR@printlength{\LWR@tempheight}% % % \begin{noindmacro}{\@rowc@lors} Executed at the end of each row. +% \changes{v0.79}{2020/01/18}{\pkg{xcolor}: Fix: Nested \env{tabular}s.} % \begin{macrocode} \def\@rowc@lors{% % \noalign{% - \global\advance\rownum\@ne% + \advance\rownum\@ne% % }% \@rowcolors% } @@ -69303,6 +71934,14 @@ height:\LWR@printlength{\LWR@tempheight}% } % \end{macrocode} % +% For \brand{MathJax}, \pkg{xfakebold} is ignored. +% \begin{macrocode} +\begin{warpMathJax} +\CustomizeMathJax{\newcommand{\setBold}[1][]{}} +\CustomizeMathJax{\newcommand{\unsetBold}{}} +\end{warpMathJax} +% \end{macrocode} +% % \iffalse %</xfakebold> % \fi @@ -69503,6 +72142,7 @@ height:\LWR@printlength{\LWR@tempheight}% % \pkg{xltabular} is emulated by \pkg{lwarp}. % % \changes{v0.57}{2018/05/25}{\pkg{xltabular}: Added.} +% \changes{v0.79}{2020/01/18}{\pkg{xltabular}: Fix: Require \pkg{ltablex}.} % % \codehtml % @@ -69519,6 +72159,7 @@ height:\LWR@printlength{\LWR@tempheight}% % % \begin{macrocode} \RequirePackage{tabularx} +\RequirePackage{ltablex} \LWR@ProvidesPackageDrop{xltabular}[2018/05/23] @@ -69996,11 +72637,14 @@ height:\LWR@printlength{\LWR@tempheight}% % \pkg{xurl} is ignored. % % \changes{v0.47}{2018/01/25}{\pkg{xurl}: Added.} +% \changes{v0.79}{2020/01/16}{\pkg{xurl}: Updated to v0.08.} % % \codehtml % % \begin{macrocode} -\LWR@ProvidesPackageDrop{xurl}[2018/06/02] +\LWR@ProvidesPackageDrop{xurl}[2020/01/14] + +\def\useOriginalUrlSetting{} % \end{macrocode} % % \iffalse @@ -70288,9 +72932,9 @@ height:\LWR@printlength{\LWR@tempheight}% % The \cs{minisec} is placed inside a \element{div} of class \attribute{minisec}. % \begin{macrocode} \renewcommand*{\minisec}[1]{ -\begin{BlockClass}{minisec} -#1 -\end{BlockClass} + \begin{BlockClass}{minisec} + #1 + \end{BlockClass} } % \end{macrocode} % @@ -70298,13 +72942,13 @@ height:\LWR@printlength{\LWR@tempheight}% % \begin{macrocode} \@ifundefined{setpartpreamble}{}{ \RenewDocumentCommand{\setpartpreamble}{o o +m}{% -\renewcommand{\part@preamble}{#3}% + \renewcommand{\part@preamble}{#3}% } } \@ifundefined{setchapterpreamble}{}{ \RenewDocumentCommand{\setchapterpreamble}{o o +m}{% -\renewcommand{\chapter@preamble}{#3}% + \renewcommand{\chapter@preamble}{#3}% } } % \end{macrocode} @@ -70323,17 +72967,17 @@ height:\LWR@printlength{\LWR@tempheight}% \RenewDocumentEnvironment{captionbeside}{o m o o o s} {} {% -\IfValueTF{#1}% -{\caption[#1]{#2}}% -{\caption{#2}}% + \IfValueTF{#1}% + {\caption[#1]{#2}}% + {\caption{#2}}% } \RenewDocumentEnvironment{captionofbeside}{m o m o o o s} {} {% -\IfValueTF{#2}% -{\captionof{#1}[#2]{#3}}% -{\captionof{#1}{#3}}% + \IfValueTF{#2}% + {\captionof{#1}[#2]{#3}}% + {\captionof{#1}{#3}}% } \RenewDocumentCommand{\setcapindent}{s m}{} @@ -70415,9 +73059,25 @@ height:\LWR@printlength{\LWR@tempheight}% \RequirePackage{lwarp-parskip} \RequirePackage{lwarp-setspace}% req'd \RequirePackage{lwarp-showidx} -\RequirePackage{lwarp-subfigure}% red'q +% \end{macrocode} + +% Avoids a conflict with \pkg{memoir}: +% \changes{v0.79}{2020/01/06}{\pkg{subcaption}: Fix with \pkg{memoir}.} +% \begin{macrocode} +\AtBeginDocument{% + \@ifpackageloaded{subcaption}{}{ + \RequirePackage{lwarp-subfigure} + \let\subfigure\subbottom + \let\subtable\subtop + }% +}% +% \end{macrocode} +% +% ^^A Not sure why this is here: +% \begin{macrocode} \makeindex % \end{macrocode} +% % \pkg{subfigure} is emulated via \pkg{subfig}, which pre-defines % |subfigure| and |subtable|, but \pkg{memoir} does not, so % they must be tested for here: @@ -70641,11 +73301,12 @@ height:\LWR@printlength{\LWR@tempheight}% \newcommand{\titlingpageend}[2]{} \let\andnext\and \renewcommand*{\thanksmarkstyle}[1]{} + \renewcommand{\thanksfootmark}{% -\thanksscript{\tamark}% + \thanksscript{\tamark}% } -% \newlength{\thanksmarksep} +% \newlength{\thanksmarksep}% already provided by memoir % \end{macrocode} % % \subsection{Abstracts} @@ -70690,7 +73351,7 @@ height:\LWR@printlength{\LWR@tempheight}% } \DeclareDocumentCommand{\frontmatter}{s}{% -\boolfalse{LWR@mainmatter}% + \boolfalse{LWR@mainmatter}% } % \end{macrocode} % @@ -70812,17 +73473,17 @@ height:\LWR@printlength{\LWR@tempheight}% \RenewDocumentCommand{\plainbreak}{s m}{\begin{center}~\end{center}} \RenewDocumentCommand{\fancybreak}{s +m}{% -\begin{center}#2\end{center}% + \begin{center}#2\end{center}% } \RenewDocumentCommand{\plainfancybreak}{s m m +m}{% -\begin{center}#4\end{center}% + \begin{center}#4\end{center}% } \RenewDocumentCommand{\pfbreak}{s}{% -\begin{center} -\pfbreakdisplay -\end{center} + \begin{center} + \pfbreakdisplay + \end{center} } % \newlength{\pfbreakskip} @@ -70913,13 +73574,14 @@ height:\LWR@printlength{\LWR@tempheight}% \renewcommand*{\leftcenterright}{} \renewcommand{\leftspringright}[4]{% -\begin{minipage}{#1\linewidth}#3\end{minipage}\qquad% -\begin{minipage}{#2\linewidth}\begin{flushright}#4\end{flushright}\end{minipage}% + \begin{minipage}{#1\linewidth}#3\end{minipage}\qquad% + \begin{minipage}{#2\linewidth}\begin{flushright}#4\end{flushright}\end{minipage}% } \renewenvironment*{blockdescription} {\LWR@descriptionstart\LWR@origdescription} {\enddescription} + \renewcommand*{\blockdescriptionlabel}[1]{\textbf{#1}} \renewenvironment*{labelled}[1]{\begin{description}}{\end{description}} \renewenvironment*{flexlabelled}[6]{\begin{description}}{\end{description}} @@ -71190,17 +73852,17 @@ height:\LWR@printlength{\LWR@tempheight}% % \marg{3: ext} \marg{4: capname} % \begin{macrocode} \RenewDocumentCommand{\newfloat}{o m m m}{% -\IfValueTF{#1}% -{\DeclareFloatingEnvironment[fileext=#3,within=#1,name={#4}]{#2}}% -{\DeclareFloatingEnvironment[fileext=#3,name={#4}]{#2}}% + \IfValueTF{#1}% + {\DeclareFloatingEnvironment[fileext=#3,within=#1,name={#4}]{#2}}% + {\DeclareFloatingEnvironment[fileext=#3,name={#4}]{#2}}% % \end{macrocode} % \pkg{newfloat} package automatically creates the \cs{listof} command % for new floats, but \pkg{float} does not, % so remove \cs{listof} here in case it is manually created later. % ^^A *8* keep the following? % \begin{macrocode} -\cslet{listof#2s}\relax% -\cslet{listof#2es}\relax% + \cslet{listof#2s}\relax% + \cslet{listof#2es}\relax% } % \end{macrocode} % \end{noindmacro} @@ -71213,23 +73875,23 @@ height:\LWR@printlength{\LWR@tempheight}% % \begin{macrocode} \RenewDocumentCommand{\newlistof}{o m m m} {% -\IfValueTF{#1} -{\newlistentry[#1]{#2}{#3}{0}} -{\newlistentry{#2}{#3}{0}} -\@namedef{ext@#2}{#3}% -\@ifundefined{c@#3depth}{\newcounter{#3depth}}{}% -\setcounter{#3depth}{1}% -\@namedef{#3mark}{}% -\@namedef{#2}{\listof{#2}{#4}} -\@namedef{@cftmake#3title}{} -\@ifundefined{cftbefore#3titleskip}{ - \expandafter\newlength\csname cftbefore#3titleskip\endcsname - \expandafter\newlength\csname cftafter#3titleskip\endcsname -}{} -\@namedef{cft#3titlefont}{} -\@namedef{cftafter#3title}{} -\@namedef{cft#3prehook}{} -\@namedef{cft#3posthook}{} + \IfValueTF{#1}% + {\newlistentry[#1]{#2}{#3}{0}}% + {\newlistentry{#2}{#3}{0}}% + \@namedef{ext@#2}{#3}% + \@ifundefined{c@#3depth}{\newcounter{#3depth}}{}% + \setcounter{#3depth}{1}% + \@namedef{#3mark}{}% + \@namedef{#2}{\listof{#2}{#4}}% + \@namedef{@cftmake#3title}{}% + \@ifundefined{cftbefore#3titleskip}{% + \expandafter\newlength\csname cftbefore#3titleskip\endcsname% + \expandafter\newlength\csname cftafter#3titleskip\endcsname% + }{}% + \@namedef{cft#3titlefont}{}% + \@namedef{cftafter#3title}{}% + \@namedef{cft#3prehook}{}% + \@namedef{cft#3posthook}{}% } % \end{macrocode} % \end{noindmacro} @@ -71243,11 +73905,11 @@ height:\LWR@printlength{\LWR@tempheight}% % \begin{macrocode} \NewDocumentEnvironment{KFLTmemoir@marginfloat}{O{-1.2ex} m} {% start -\LWR@BlockClassWP{float:right; width:2in; margin:10pt}{}{marginblock}% -\captionsetup{type=#2}% + \LWR@BlockClassWP{float:right; width:2in; margin:10pt}{}{marginblock}% + \captionsetup{type=#2}% } {% -\endLWR@BlockClassWP% + \endLWR@BlockClassWP% } \DeclareDocumentEnvironment{marginfigure}{o} @@ -71279,7 +73941,7 @@ height:\LWR@printlength{\LWR@tempheight}% \renewcommand{\subcaption}[2][]{% -\ifblank{#1}{\subfloat[#2]{}}{\subfloat[#1][#2]{}}% + \ifblank{#1}{\subfloat[#2]{}}{\subfloat[#1][#2]{}}% } \renewcommand{\contsubcaption}{\ContinuedFloat\subcaption} @@ -71300,9 +73962,9 @@ height:\LWR@printlength{\LWR@tempheight}% \RenewDocumentEnvironment{sidecaption}{o m o} {} -{ -\IfValueTF{#1}{\caption[#1]{#2}}{\caption{#2}}% -\IfValueT{#3}{\label{#3}}% +{% + \IfValueTF{#1}{\caption[#1]{#2}}{\caption{#2}}% + \IfValueT{#3}{\label{#3}}% } % \newlength{\sidecapwidth} @@ -71316,26 +73978,26 @@ height:\LWR@printlength{\LWR@tempheight}% \RenewDocumentEnvironment{sidecontcaption}{m o} {} {% -\ContinuedFloat% -\caption{#1}% + \ContinuedFloat% + \caption{#1}% % \end{macrocode} % Without \cs{@captype}, the section is referred to instead. % \begin{macrocode} -\IfValueT{#2}{\label[\@captype]{#2}}% + \IfValueT{#2}{\label[\@captype]{#2}}% } % \end{macrocode} % \cs{sidenamedlegend} does not appear to use the \TOC\ argument. % \begin{macrocode} \renewenvironment{sidenamedlegend}[2][]{ -\begin{center} -\@nameuse{\@captype name}\CaptionSeparator#2 -\end{center} + \begin{center} + \@nameuse{\@captype name}\CaptionSeparator#2 + \end{center} } {} \renewenvironment{sidelegend}[1] {\begin{center} -#1 + #1 } {\end{center}} @@ -71349,11 +74011,11 @@ height:\LWR@printlength{\LWR@tempheight}% \LetLtxMacro\endctabular\endtabular \renewcommand{\autorows}[5][]{% -#5 + #5% } \renewcommand{\autocols}[5][]{% -#5 + #5% } % \end{macrocode} % @@ -71364,10 +74026,10 @@ height:\LWR@printlength{\LWR@tempheight}% \renewcommand*{\feetbelowfloat}{} \renewcommand*{\feetatbottom}{} -\renewcommand*{\verbfootnote}[2][]{ -\PackageError{lwarp,memoir} -{Verbatim footnotes are not yet supported by lwarp.} -{This may be improved some day.} +\renewcommand*{\verbfootnote}[2][]{% + \PackageError{lwarp,memoir}% + {Verbatim footnotes are not yet supported by lwarp.}% + {This may be improved some day.}% } \renewcommand*{\plainfootnotes}{} @@ -71376,10 +74038,10 @@ height:\LWR@printlength{\LWR@tempheight}% \renewcommand*{\paragraphfootnotes}{} \renewcommand*{\footfudgefiddle}{} -\renewcommand*{\newfootnoteseries}[1]{ -\PackageError{lwarp,memoir} -{Memoir footnote series are not yet supported by lwarp.} -{This may be improved some day.} +\renewcommand*{\newfootnoteseries}[1]{% + \PackageError{lwarp,memoir}% + {Memoir footnote series are not yet supported by lwarp.}% + {This may be improved some day.}% } \renewcommand*{\plainfootstyle}[1]{} @@ -71467,9 +74129,9 @@ height:\LWR@printlength{\LWR@tempheight}% % \renewcommand*{\linenumberfont}[1]{} \DeclareDocumentCommand{\PoemTitle}{s o o m}{% -\IfValueTF{#2}% -{\poemtitle[#2]{#4}}% -{\poemtitle{#4}}% + \IfValueTF{#2}% + {\poemtitle[#2]{#4}}% + {\poemtitle{#4}}% } \renewcommand*{\NumberPoemTitle}{} @@ -71710,12 +74372,12 @@ height:\LWR@printlength{\LWR@tempheight}% \renewcommand{\postcaption}[1]{} \renewcommand{\midbicaption}[1]{} \renewcommand{\contcaption}[1]{% -% \ContinuedFloat% -% \caption{#1}% -\begin{LWR@figcaption}% later becomes \caption* -\LWR@isolate{\@nameuse{\@captype name}}~% -\thechapter.\the\value{\@captype}\CaptionSeparator\LWR@isolate{#1}% -\end{LWR@figcaption} +% \ContinuedFloat% +% \caption{#1}% + \begin{LWR@figcaption}% later becomes \caption* + \LWR@isolate{\@nameuse{\@captype name}}~% + \thechapter.\the\value{\@captype}\CaptionSeparator\LWR@isolate{#1}% + \end{LWR@figcaption}% } % \end{macrocode} @@ -71731,11 +74393,11 @@ height:\LWR@printlength{\LWR@tempheight}% % \begin{macrocode} \renewcommand{\legend}[1]{\begin{center}#1\\\end{center}} -\renewcommand{\namedlegend}[2][]{ -\begin{center} -\@nameuse{fleg\@captype}\CaptionSeparator#2\\ -\end{center} -\@nameuse{flegtoc\@captype}{#1} +\renewcommand{\namedlegend}[2][]{% + \begin{center} + \@nameuse{fleg\@captype}\CaptionSeparator#2\\ + \end{center} + \@nameuse{flegtoc\@captype}{#1} } \renewcommand{\newfixedcaption}[3][\caption]{% @@ -71746,31 +74408,32 @@ height:\LWR@printlength{\LWR@tempheight}% \providecommand{#2}{\def\@captype{#3}#1}} \renewcommand{\bitwonumcaption}[6][]{% -\ifblank{#2}{\caption{#3}}{\caption[#2]{#3}}% -\addtocounter{\@captype}{-1}% -\begingroup% -\csdef{\@captype name}{#4}% -\ifblank{#5}{\caption{#6}}{\caption[#5]{#6}}% -\endgroup% -\ifblank{#1}{}{\label{#1}}% + \ifblank{#2}{\caption{#3}}{\caption[#2]{#3}}% + \addtocounter{\@captype}{-1}% + \begingroup% + \csdef{\@captype name}{#4}% + \ifblank{#5}{\caption{#6}}{\caption[#5]{#6}}% + \endgroup% + \ifblank{#1}{}{\label{#1}}% } \LetLtxMacro\bionenumcaption\bitwonumcaption% todo \renewcommand{\bicaption}[5][]{% -\ifblank{#2}{\caption{#3}}{\caption[#2]{#3}}% -\begin{LWR@figcaption}% later becomes \caption* -\LWR@isolate{#4} \thechapter.\the\value{\@captype}\CaptionSeparator\LWR@isolate{#5}% -\end{LWR@figcaption} -\ifblank{#1}{}{\label{#1}}% + \ifblank{#2}{\caption{#3}}{\caption[#2]{#3}}% + \begin{LWR@figcaption}% later becomes \caption* + \LWR@isolate{#4} % space + \thechapter.\the\value{\@captype}\CaptionSeparator\LWR@isolate{#5}% + \end{LWR@figcaption}% + \ifblank{#1}{}{\label{#1}}% } \renewcommand{\bicontcaption}[3]{% -\contcaption{#1}% -\begingroup% -\csdef{\@captype name}{#2}% -\contcaption{#3}% -\endgroup% + \contcaption{#1}% + \begingroup% + \csdef{\@captype name}{#2}% + \contcaption{#3}% + \endgroup% } % \end{macrocode} % ^^A *8* todo: @@ -71781,26 +74444,25 @@ height:\LWR@printlength{\LWR@tempheight}% % \LetLtxMacro\longbicaption\bicaption% \RenewDocumentCommand{\subtop}{O{} O{} m}{% -\subfloat[#1][#2]{#3}% + \subfloat[#1][#2]{#3}% } \RenewDocumentCommand{\subbottom}{O{} O{} m}{% -\subfloat[#1][#2]{#3}% + \subfloat[#1][#2]{#3}% } \renewcommand{\contsubtop}{% -\ContinuedFloat\addtocounter{\@captype}{1}% -\subtop} + \ContinuedFloat\addtocounter{\@captype}{1}% + \subtop% +} \renewcommand{\contsubbottom}{% -\ContinuedFloat\addtocounter{\@captype}{1}% -\subbottom} + \ContinuedFloat\addtocounter{\@captype}{1}% + \subbottom% +} \renewcommand{\subconcluded}{} -\let\subfigure\subbottom -\let\subtable\subtop - \let\contsubtable\contsubtop \let\contsubfigure\contsubbottom % \end{macrocode} diff --git a/macros/latex/contrib/lwarp/lwarp.ins b/macros/latex/contrib/lwarp/lwarp.ins index 055804e0cd..b251ada07c 100644 --- a/macros/latex/contrib/lwarp/lwarp.ins +++ b/macros/latex/contrib/lwarp/lwarp.ins @@ -20,7 +20,7 @@ %% \usedir{tex/latex/ package } \preamble This is a generated file. -Copyright 2016-2019 Brian Dunn +Copyright 2016-2020 Brian Dunn This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3 @@ -65,6 +65,7 @@ version 2005/12/01 or later. \file{lwarp-attachfile2.sty}{\from{lwarp.dtx}{attachfile2}} \file{lwarp-authblk.sty}{\from{lwarp.dtx}{authblk}} \file{lwarp-autonum.sty}{\from{lwarp.dtx}{autonum}} +\file{lwarp-awesomebox.sty}{\from{lwarp.dtx}{awesomebox}} \file{lwarp-axessibility.sty}{\from{lwarp.dtx}{axessibility}} \file{lwarp-axodraw2.sty}{\from{lwarp.dtx}{axodraw2}} \file{lwarp-backnaur.sty}{\from{lwarp.dtx}{backnaur}} @@ -78,12 +79,14 @@ version 2005/12/01 or later. \file{lwarp-bigstrut.sty}{\from{lwarp.dtx}{bigstrut}} \file{lwarp-bitpattern.sty}{\from{lwarp.dtx}{bitpattern}} \file{lwarp-blowup.sty}{\from{lwarp.dtx}{blowup}} +\file{lwarp-bm.sty}{\from{lwarp.dtx}{bm}} \file{lwarp-booklet.sty}{\from{lwarp.dtx}{booklet}} \file{lwarp-bookmark.sty}{\from{lwarp.dtx}{bookmark}} \file{lwarp-booktabs.sty}{\from{lwarp.dtx}{booktabs}} \file{lwarp-bophook.sty}{\from{lwarp.dtx}{bophook}} \file{lwarp-bounddvi.sty}{\from{lwarp.dtx}{bounddvi}} \file{lwarp-boxedminipage2e.sty}{\from{lwarp.dtx}{boxedminipage2e}} +\file{lwarp-braket.sty}{\from{lwarp.dtx}{braket}} \file{lwarp-breakurl.sty}{\from{lwarp.dtx}{breakurl}} \file{lwarp-breqn.sty}{\from{lwarp.dtx}{breqn}} \file{lwarp-bsheaders.sty}{\from{lwarp.dtx}{bsheaders}} @@ -298,9 +301,16 @@ version 2005/12/01 or later. \file{lwarp-pagenote.sty}{\from{lwarp.dtx}{pagenote}} \file{lwarp-pagesel.sty}{\from{lwarp.dtx}{pagesel}} \file{lwarp-paralist.sty}{\from{lwarp.dtx}{paralist}} +\file{lwarp-parallel.sty}{\from{lwarp.dtx}{parallel}} +\file{lwarp-parcolumns.sty}{\from{lwarp.dtx}{parcolumns}} \file{lwarp-parnotes.sty}{\from{lwarp.dtx}{parnotes}} \file{lwarp-parskip.sty}{\from{lwarp.dtx}{parskip}} \file{lwarp-pbox.sty}{\from{lwarp.dtx}{pbox}} +\file{lwarp-pdfcol.sty}{\from{lwarp.dtx}{pdfcol}} +\file{lwarp-pdfcolfoot.sty}{\from{lwarp.dtx}{pdfcolfoot}} +\file{lwarp-pdfcolmk.sty}{\from{lwarp.dtx}{pdfcolmk}} +\file{lwarp-pdfcolparallel.sty}{\from{lwarp.dtx}{pdfcolparallel}} +\file{lwarp-pdfcolparcolumns.sty}{\from{lwarp.dtx}{pdfcolparcolumns}} \file{lwarp-pdfcomment.sty}{\from{lwarp.dtx}{pdfcomment}} \file{lwarp-pdfcrypt.sty}{\from{lwarp.dtx}{pdfcrypt}} \file{lwarp-pdflscape.sty}{\from{lwarp.dtx}{pdflscape}} @@ -314,6 +324,7 @@ version 2005/12/01 or later. \file{lwarp-perpage.sty}{\from{lwarp.dtx}{perpage}} \file{lwarp-pfnote.sty}{\from{lwarp.dtx}{pfnote}} \file{lwarp-phfqit.sty}{\from{lwarp.dtx}{phfqit}} +\file{lwarp-physics.sty}{\from{lwarp.dtx}{physics}} \file{lwarp-pifont.sty}{\from{lwarp.dtx}{pifont}} \file{lwarp-placeins.sty}{\from{lwarp.dtx}{placeins}} \file{lwarp-plarydshln.sty}{\from{lwarp.dtx}{plarydshln}} @@ -371,6 +382,7 @@ version 2005/12/01 or later. \file{lwarp-SIunits.sty}{\from{lwarp.dtx}{SIunits}} \file{lwarp-siunitx.sty}{\from{lwarp.dtx}{siunitx}} \file{lwarp-slantsc.sty}{\from{lwarp.dtx}{slantsc}} +\file{lwarp-slashed.sty}{\from{lwarp.dtx}{slashed}} \file{lwarp-soul.sty}{\from{lwarp.dtx}{soul}} \file{lwarp-soulpos.sty}{\from{lwarp.dtx}{soulpos}} \file{lwarp-soulutf8.sty}{\from{lwarp.dtx}{soulutf8}} @@ -379,12 +391,14 @@ version 2005/12/01 or later. \file{lwarp-srctex.sty}{\from{lwarp.dtx}{srctex}} \file{lwarp-stabular.sty}{\from{lwarp.dtx}{stabular}} \file{lwarp-stackengine.sty}{\from{lwarp.dtx}{stackengine}} +\file{lwarp-steinmetz.sty}{\from{lwarp.dtx}{steinmetz}} \file{lwarp-stfloats.sty}{\from{lwarp.dtx}{stfloats}} \file{lwarp-struktex.sty}{\from{lwarp.dtx}{struktex}} \file{lwarp-subcaption.sty}{\from{lwarp.dtx}{subcaption}} \file{lwarp-subfig.sty}{\from{lwarp.dtx}{subfig}} \file{lwarp-subfigure.sty}{\from{lwarp.dtx}{subfigure}} \file{lwarp-supertabular.sty}{\from{lwarp.dtx}{supertabular}} +\file{lwarp-svg.sty}{\from{lwarp.dtx}{svg}} \file{lwarp-syntonly.sty}{\from{lwarp.dtx}{syntonly}} \file{lwarp-tabfigures.sty}{\from{lwarp.dtx}{tabfigures}} \file{lwarp-tablefootnote.sty}{\from{lwarp.dtx}{tablefootnote}} @@ -430,6 +444,7 @@ version 2005/12/01 or later. \file{lwarp-ulem.sty}{\from{lwarp.dtx}{ulem}} \file{lwarp-umoline.sty}{\from{lwarp.dtx}{umoline}} \file{lwarp-underscore.sty}{\from{lwarp.dtx}{underscore}} +\file{lwarp-unicode-math.sty}{\from{lwarp.dtx}{unicode-math}} \file{lwarp-units.sty}{\from{lwarp.dtx}{units}} \file{lwarp-unitsdef.sty}{\from{lwarp.dtx}{unitsdef}} \file{lwarp-upref.sty}{\from{lwarp.dtx}{upref}} @@ -444,7 +459,9 @@ version 2005/12/01 or later. \file{lwarp-vwcol.sty}{\from{lwarp.dtx}{vwcol}} \file{lwarp-wallpaper.sty}{\from{lwarp.dtx}{wallpaper}} \file{lwarp-watermark.sty}{\from{lwarp.dtx}{watermark}} +\file{lwarp-widetable.sty}{\from{lwarp.dtx}{widetable}} \file{lwarp-widows-and-orphans.sty}{\from{lwarp.dtx}{widows-and-orphans}} +\file{lwarp-witharrows.sty}{\from{lwarp.dtx}{witharrows}} \file{lwarp-wrapfig.sty}{\from{lwarp.dtx}{wrapfig}} \file{lwarp-xbmks.sty}{\from{lwarp.dtx}{xbmks}} \file{lwarp-xcolor.sty}{\from{lwarp.dtx}{xcolor}} diff --git a/macros/latex/contrib/lwarp/lwarp.pdf b/macros/latex/contrib/lwarp/lwarp.pdf Binary files differindex 1c3d9aec65..1f8251c97e 100644 --- a/macros/latex/contrib/lwarp/lwarp.pdf +++ b/macros/latex/contrib/lwarp/lwarp.pdf diff --git a/macros/latex/contrib/lwarp/lwarpmk.lua b/macros/latex/contrib/lwarp/lwarpmk.lua index 2ccc1fa5bd..f90499f916 100755 --- a/macros/latex/contrib/lwarp/lwarpmk.lua +++ b/macros/latex/contrib/lwarp/lwarpmk.lua @@ -1,8 +1,8 @@ #!/usr/bin/env texlua --- Copyright 2016-2019 Brian Dunn +-- Copyright 2016-2020 Brian Dunn -printversion = "v0.78" +printversion = "v0.79" requiredconfversion = "2" -- also at *lwarpmk.conf function printhelp () @@ -699,7 +699,7 @@ else -- not --version -- print intro: -print ("lwarpmk: " .. printversion .. " Automated make for the LaTeX lwarp package.") +print ("lwarpmk: " .. printversion .. " Automated make for the LaTeX Lwarp package.") -- lwarpmk print: diff --git a/macros/latex/contrib/polexpr/README.md b/macros/latex/contrib/polexpr/README.md index 29c0d2f5ab..a901b56adc 100644 --- a/macros/latex/contrib/polexpr/README.md +++ b/macros/latex/contrib/polexpr/README.md @@ -4,7 +4,7 @@ Package polexpr README License ------- -Copyright (C) 2018-2019 Jean-François Burnol +Copyright (C) 2018-2020 Jean-François Burnol See documentation of package [xint](http://www.ctan.org/pkg/xint) for contact information. @@ -81,8 +81,10 @@ Releases - 0.7.4 (2019/02/12) Bugfix: 20000000000 is too big for \numexpr, shouldn't I know that? Thanks to Jürgen Gilg for report. +- 0.7.5 (2020/01/31) + Synced with xint 1.4. Requires it. -Files of 0.7.4 release: +Files of 0.7.5 release: - README.md, - polexpr.sty (package file), diff --git a/macros/latex/contrib/polexpr/polexpr.html b/macros/latex/contrib/polexpr/polexpr.html index 6fc48c2dd6..7496332976 100644 --- a/macros/latex/contrib/polexpr/polexpr.html +++ b/macros/latex/contrib/polexpr/polexpr.html @@ -362,7 +362,7 @@ ul.auto-toc { <body> <div class="document" id="package-polexpr-documentation"> <h1 class="title">Package polexpr documentation</h1> -<h2 class="subtitle" id="id1">0.7.4 (2019/02/12)</h2> +<h2 class="subtitle" id="id1">0.7.5 (2020/01/31)</h2> <!-- comment: -*- fill-column: 72; mode: rst; -*- --> <div class="contents topic" id="contents"> @@ -2891,6 +2891,9 @@ Thanks to Jürgen Gilg for report.</li> </li> </ul> </li> +<li><p class="first">v0.7.5 (2020/01/31)</p> +<p>Synced with xint 1.4. Requires it.</p> +</li> </ul> </div> <div class="section" id="acknowledgments"> diff --git a/macros/latex/contrib/polexpr/polexpr.sty b/macros/latex/contrib/polexpr/polexpr.sty index e9509d8942..30fef28914 100644 --- a/macros/latex/contrib/polexpr/polexpr.sty +++ b/macros/latex/contrib/polexpr/polexpr.sty @@ -1,33 +1,178 @@ % author: Jean-François Burnol % License: LPPL 1.3c (author-maintained) \ProvidesPackage{polexpr}% - [2019/02/12 v0.7.4 Polynomial expressions with rational coefficients (JFB)]% -\RequirePackage{xintexpr}[2018/06/17]% xint 1.3c for \ifxintglobaldefs boolean -\edef\POL@restorecatcodes + [2020/01/31 v0.7.5 Polynomial expressions with rational coefficients (JFB)]% +\RequirePackage{xintexpr}[2020/01/31]% xint 1.4 +\edef\POL@restorecatcodes % TODO: think better about what is reasonable here {\catcode`\noexpand\_ \the\catcode`\_ % \catcode`\noexpand\! \the\catcode`\! % \catcode`\noexpand\* \the\catcode`\* % + \catcode`\noexpand\~ \the\catcode`\~ % + \catcode`\noexpand\: \the\catcode`\: % \catcode0 \the\catcode0\relax}% \catcode`\_ 11 \catcode0 12 \catcode`\* 12 \long\def\xint_stop_atfirstoftwo #1#2{ #1}% not yet in xint 1.3c \long\def\xint_stop_atsecondoftwo #1#2{ #2}% -%% PATCH xintexpr TO AUTHORIZE ' IN NAMES (0.5.1) -\catcode`\! 11 +%% 0.7.5 VERY SERIOUS TROUBLES TO GET polexpr TO WORK WITH xintexpr 1.4 + +%% I hesitated about incorporating it directly into xint 1.4 +%% Don't do this at home, only xint gurus are allowed. +\let\POL@originalXINT_expr_redefinemacros\XINT_expr_redefinemacros +\def\XINT_expr_redefinemacros +{% + \POL@originalXINT_expr_redefinemacros + \POL@activateNEhook +}% +%% Using \def's and not \let's to get better readable trace +%% in case I need to debug but this never happens +\def\POL@activateNEhook@xint % done in a group +{% + \def\POL@NEhook@polfunc{\POL@NE@polfunc}% +}% +\def\POL@activateNEhook@pol +{% + \def\POL@NEhook@polfunc{\POL@NP@polfunc}% +}% +\def\POL@activateNEhook{\POL@activateNEhook@xint}% +% +% +\catcode`~ 12 +\catcode`! 11 +\catcode`: 11 +% We drop consideration of \XINT_global matters +% because we have other more urgent and arduous problems +\def\POL@defpolfunc #1#2% +{% + \expandafter\POL@defpolfunc_a + \csname XINT_#2_func_#1\expandafter\endcsname + \csname XINT_#2_polfunc_#1\endcsname {#1}{#2}% +}% +\def\POL@defpolfunc_a #1#2#3#4% +{% + \protected % xintexpr 1.4 does things such as \expandafter\xintAdd\expanded + \expandafter\def\expandafter#2\expandafter##\expandafter1\expandafter + {% + #2{##1}% + }% + \def#1##1##2##3% + {% + % put it directly at the correct level of bracing + % don't worry for now about minimizing how many times ##3 is grabbed + \expandafter##1\expandafter##2\expandafter{\expandafter + {\romannumeral`^^@\POL@NEhook@polfunc{XINT_#4_polfunc_#3}#2{##3}}}% + }% +}% +% +\def\POL@polfunc@go #1#2#3{#2#3}% brace stripping intentional +\def\POL@NEhook@polfunc{\POL@polfunc@go}% default for pure numerics +% +% Hook for expansion in \poldef +\def\POL@NP@polfunc #1{% +\def\POL@NP@polfunc ##1##2##3% +{% + \if0\expandafter\XINT:NE:hastilde\detokenize{##3}~!\relax + \expandafter\XINT:NE:hashash\detokenize{##3}#1!\relax 0% + \expandafter\POL@polfunc@go + \else + \expandafter\POL:NP:polfunc:p + \fi {##1}{##2}{##3}% +}}\expandafter\POL@NP@polfunc\string#% +\def\POL:NP:polfunc:p #1#2#3% +{% + ~romannumeral~POL:usepolfunc:pol{#1}{#3}% +}% +\def\POL:usepolfunc:pol #1%#2% +{% +% Here we are in the core of \poldef and we really +% need to get rid of some \expanded tokens so +% we accept being exposed to \expanded but arrange to +% remain invariant. Then we will try to speed up +% polynomial composition (at this time the \#1 +% is a nested Horner type macro) by «pre-expanding» +% the argument, but this means using the \POL@get +% methods inside an \hbox +% +% \POL@applypolfunc will be defined \protected +% + \expandafter\xint_c_\expandafter\POL@applypolfunc +% This will be \protected + \csname#1\endcsname +% #2% brace stripping is deliberate +}% +% +% Hook for expansion in \xintexpr +\def\POL@NE@polfunc #1{% +\def\POL@NE@polfunc ##1##2##3% +{% + \if0\expandafter\XINT:NE:hastilde\detokenize{##3}~!\relax + \expandafter\XINT:NE:hashash\detokenize{##3}#1!\relax 0% + \expandafter\POL@polfunc@go + \else + \expandafter\POL:NE:polfunc:p + \fi {##1}{##2}{##3}% +}}\expandafter\POL@NE@polfunc\string#% +\def\POL:NE:polfunc:p #1#2#3% +{% + ~romannumeral~POL:usepolfunc:xint{#1}{#3}% +}% +\def\POL:usepolfunc:xint #1% +{% +% This is done to overcome \protected and is useful +% in case the polynomial function ends up nested +% in some non-polynomial user declared function +% as the latter (and other things) tries to pre-expand +% its arguments (as they may be used multiple time) +% using \expanded, but \#1 is protected. +% And this works recursively. We are inside braces. +% However we have a very big problem with constant +% polynomial functions. We have to handle them +% in a special way. + -`0\csname#1\expandafter\endcsname\expanded +}% +\catcode`~ 13 +\catcode`: 12 + + +%% Start defining some \protected ones here +\protected\def\POL@empty{}% +\newif\ifPOL@pol +\protected\def\POL@polglobaltrue {\global\let\ifPOL@pol\iftrue}% +\protected\def\POL@polglobalfalse{\global\let\ifPOL@pol\iffalse}% + + +%% Patch xintexpr to authorize ' in names (0.5.1) +%% Adapted 0.7.5 to follow-up on xintexpr 1.4 internal changes +%% (much simpler than previous stuff...) +%% This allows ' as a character in a polynomial name (not initial one) \def\POL@XINT_expr_scanfunc_b #1% {% - \ifx !#1\xint_dothis{(_}\fi - \ifcat \relax#1\xint_dothis{(_}\fi - \if (#1\xint_dothis{\xint_firstoftwo{(`}}\fi - \if '#1\xint_dothis \XINT_expr_scanfunc_a \fi - \if @#1\xint_dothis \XINT_expr_scanfunc_a \fi - \if _#1\xint_dothis \XINT_expr_scanfunc_a \fi - \ifnum \xint_c_ix<1\string#1 \xint_dothis \XINT_expr_scanfunc_a \fi - \ifcat a#1\xint_dothis \XINT_expr_scanfunc_a \fi - \xint_orthat {(_}% - #1% + \ifcat \relax#1\xint_dothis{\iffalse{\fi}(_#1}\fi + \if (#1\xint_dothis{\iffalse{\fi}(`}\fi + \if 1\ifcat a#10\fi + \ifnum\xint_c_ix<1\string#1 0\fi + \if @#10\fi + \if _#10\fi + \if '#10\fi + 1% + \xint_dothis{\iffalse{\fi}(_#1}\fi + \xint_orthat {#1\XINT_expr_scanfunc_a}% }% + +%% Activate polexp's modified xintexpr (only during definitions +%% of polynomials) +\def\POL@hackxintexpr {% + \let\POL@originalXINT_expr_scanfunc_b\XINT_expr_scanfunc_b + \let\XINT_expr_scanfunc_b\POL@XINT_expr_scanfunc_b + \def\POL@activateNEhook{\POL@activateNEhook@pol}% +}% +\def\POL@restorexintexpr {% + \let\XINT_expr_scanfunc_b\POL@originalXINT_expr_scanfunc_b + \def\POL@activateNEhook{\POL@activateNEhook@xint}% +}% + + %% AUXILIARIES \catcode`! 3 %% added at 0.7 @@ -46,7 +191,6 @@ \polexprsetup{norr=_norr, sqfnorr=_sqf_norr} \newcount\POL@count -\newif\ifPOL@pol \newif\ifxintveryverbose \newif\ifpoltypesetall \newif\ifPOL@tosturm@makefirstprimitive @@ -54,7 +198,7 @@ \newif\ifPOL@isolz@nextwillneedrefine \newif\ifpoltoexprall %% the main exchange structure (stored in macros \POLuserpol@<name>) -%% is: degree.\empty{coeff0}{coeff1}....{coeffN} +%% is: degree.\POL@empty{coeff0}{coeff1}....{coeffN} %% (degree=N except zero polynomial recognized from degree set to -1 %% but it has always the {0/1[0]} coeff0.) \def\POL@ifZero#1{\expandafter\POL@ifZero@aux#1;}% @@ -67,13 +211,17 @@ % \def\POL@resultfromarray #1{% ATTENTION, **MUST** be executed with % \count@ set to 1 + degree (\count@ = 0 for zero polynomial) - \edef\POL@result{\ifnum\count@>\z@ - \the\numexpr\count@-\@ne.\noexpand\empty +% Attention to the \protected here at 0.7.5 +% They are many all over the place + \protected\edef\POL@result{\ifnum\count@>\z@ + \the\numexpr\count@-\@ne.\POL@empty \xintiloop [1+1]% \expandafter\POL@braceit\csname POL@array#1\xintiloopindex\endcsname \ifnum\xintiloopindex<\count@ \repeat - \else-1.\noexpand\empty{0/1[0]}\fi}% +% Attention to this \protected\POL@empty +% They are many all over the place + \else-1.\POL@empty{0/1[0]}\fi}% }% \def\POL@braceit#1{{#1}}% needed as \xintiloopindex can not "see" through braces @@ -85,12 +233,11 @@ \POL@restoresemicolon \edef\POL@tmp{\ifxintverbose1\else0\fi}% \unless\ifxintveryverbose\xintverbosefalse\fi - \let\POL@originalXINT_expr_scanfunc_b\XINT_expr_scanfunc_b - \let\XINT_expr_scanfunc_b\POL@XINT_expr_scanfunc_b + \POL@hackxintexpr \xintdeffunc __pol(#2):=0+(#4);% force conversion to raw if a constant + \POL@restorexintexpr \if1\POL@tmp\xintverbosetrue\fi \edef\POL@polname{\xint_zapspaces #1 \xint_gobble_i}% - \let\XINT_expr_scanfunc_b\POL@originalXINT_expr_scanfunc_b \begingroup \setbox0\hbox{% \let\xintScalarAdd\xintAdd @@ -107,48 +254,79 @@ \def\xintSub ##1##2{\xintAdd{##1}{\xintOpp{##2}}}% % \xintAdd{0} to get \POL@result defined even if numerical only expression % I could also test \ifPOL@pol, but this is anyhow small overhead - \xintAdd{0}% - {\csname XINT_expr_userfunc___pol\endcsname - {\global\POL@poltrue\def\POL@result{1.\empty{0/1[0]}{1/1[0]}}}}% +% Attention that xintexpr 1.4 has braces all over the place + \expandafter\xintAdd\expandafter{\expandafter0\expandafter}% + \romannumeral0\csname XINT_expr_userfunc___pol\endcsname + {\POL@polglobaltrue\protected\def\POL@result{1.\POL@empty{0/1[0]}{1/1[0]}}}% \expandafter}\expandafter \endgroup\expandafter \def\csname POLuserpol@\POL@polname\expandafter\endcsname \expandafter{\POL@result}% \expandafter\POL@newpol\expandafter{\POL@polname}% }% -%% +% + + \def\POL@newpol#1{% - \expandafter\POL@ifZero\csname POLuserpol@#1\endcsname - {\@namedef{XINT_expr_userfunc_#1}##1{0/1[0]}}% - {\POL@newpolhorner{#1}}% - \expandafter\XINT_expr_defuserfunc - \csname XINT_expr_func_#1\endcsname{#1}{expr}% +%% We must handle specially constant polynomials because they must +%% be made to work expandably in \poldef of other polynomials due +%% to complicated matters having to do with the \POL@ifpol conditional + \ifnum\PolDegree{#1}<\@ne + % non-zero constant + % I am defining this one only for the Info message, no time now + \expandafter\edef\csname XINT_expr_polfunc_#1\endcsname + ##1{\PolNthCoeff{#1}{0}}% + % No hooks here! + \expandafter\edef\csname XINT_expr_func_#1\endcsname ##1##2##3% + {##1##2{{\PolNthCoeff{#1}{0}}}}% + \else + % polynomial of degree at least 1. This means that mechanism + % to get \POL@result will get activated and we must be very careful + % to never \edef when the Horner macro will be converted to + % a polynomial + \POL@newpolhorner{#1}% + \POL@defpolfunc{#1}{expr}% + \fi \expandafter\let\csname XINT_flexpr_func_#1\endcsname\@undefined \ifxintverbose\POL@info{#1}\fi }% \def\POL@newfloatpol#1{% - \expandafter\POL@ifZero\csname POLuserpol@#1\endcsname - {\@namedef{XINT_flexpr_userfunc_#1}##1{0[0]}}% - {\POL@newfloatpolhorner{#1}}% - \expandafter\XINT_expr_defuserfunc - \csname XINT_flexpr_func_#1\endcsname{#1}{flexpr}% +%% We must handle specially constant polynomials because they must +%% be made to work expandably in \poldef of other polynomials due +%% to complicated matters having to do with the \POL@ifpol conditional + \ifnum\PolDegree{#1}<\@ne + % non-zero constant + % I am defining this one only for the Info message, no time now + \expandafter\edef\csname XINT_flexpr_polfunc_#1\endcsname + ##1{\PolNthCoeff{#1}{0}}% + % No hooks here! + \expandafter\edef\csname XINT_flexpr_func_#1\endcsname ##1##2##3% + {##1##2{{\PolNthCoeff{#1}{0}}}}% + \else + % polynomial of degree at least 1. This means that mechanism + % to get \POL@result will get activated and we must be very careful + % to never \edef when the Horner macro will be converted to + % a polynomial + \POL@newfloatpolhorner{#1}% + \POL@defpolfunc{#1}{flexpr}% + \fi \ifxintverbose\POL@floatinfo{#1}\fi }% \def\POL@info #1{% \xintMessage {polexpr}{Info}% {Function #1 for the \string\xintexpr\space parser is - associated to \string\XINT_expr_userfunc_#1\space + associated to \string\XINT_expr_polfunc_#1\space whose meaning uses Horner scheme: \expandafter\meaning - \csname XINT_expr_userfunc_#1\endcsname}% + \csname XINT_expr_polfunc_#1\endcsname}% }% \def\POL@floatinfo #1{% \xintMessage {polexpr}{Info}% {Function #1 for the \string\xintfloatexpr\space parser is - associated to \string\XINT_flexpr_userfunc_#1\space + associated to \string\XINT_flexpr_polfunc_#1\space whose meaning uses Horner scheme: \expandafter\meaning - \csname XINT_flexpr_userfunc_#1\endcsname}% + \csname XINT_flexpr_polfunc_#1\endcsname}% }% % \def\POL@newpolhorner#1{% @@ -162,7 +340,7 @@ \expandafter\POL@newpol@horner\POL@var@coeffs\relax \expandafter \endgroup - \expandafter\def\csname XINT_expr_userfunc_#1\expandafter\endcsname + \expandafter\def\csname XINT_expr_polfunc_#1\expandafter\endcsname \expandafter##\expandafter1\expandafter{\POL@tmp{##1}}% }% \def\POL@newfloatpolhorner#1{% @@ -176,7 +354,7 @@ \expandafter\POL@newpol@floathorner\POL@var@coeffs\relax \expandafter \endgroup - \expandafter\def\csname XINT_flexpr_userfunc_#1\expandafter\endcsname + \expandafter\def\csname XINT_flexpr_polfunc_#1\expandafter\endcsname \expandafter##\expandafter1\expandafter{\POL@tmp{##1}}% }% \def\POL@newpol@horner#1{\let\xintAdd\relax\let\xintMul\relax @@ -211,10 +389,9 @@ \def\POL@let#1#2{% \expandafter\let\csname POLuserpol@#1\expandafter\endcsname \csname POLuserpol@#2\endcsname - \expandafter\let\csname XINT_expr_userfunc_#1\expandafter\endcsname - \csname XINT_expr_userfunc_#2\endcsname - \expandafter\XINT_expr_defuserfunc - \csname XINT_expr_func_#1\endcsname{#1}{expr}% + \expandafter\let\csname XINT_expr_polfunc_#1\expandafter\endcsname + \csname XINT_expr_polfunc_#2\endcsname + \POL@defpolfunc{#1}{expr}% \ifxintverbose\POL@info{#1}\fi }% \newcommand\PolGlobalLet[2]{\begingroup @@ -259,7 +436,7 @@ \def\POL@getfromarray#1#2{% \count@=#2{0} %<- intentional space \ifnum\count@=\z@ - \def\POL@result{-1.\empty{0/1[0]}}% 0.5 fix for empty array + \protected\def\POL@result{-1.\POL@empty{0/1[0]}}% 0.5 fix for empty array \else \xintloop \edef\POL@tmp{#2{\count@}}% @@ -283,7 +460,7 @@ \repeat \count@\count\tw@ \def\POL@tmp##1.{{\csname POL@tmparray##1\endcsname}}% - \edef\POL@result{\the\numexpr\count@-\@ne.\noexpand\empty + \protected\edef\POL@result{\the\numexpr\count@-\@ne.\POL@empty \xintiloop[1+1]% \expandafter\POL@tmp\xintiloopindex.% \ifnum\xintiloopindex<\count@ @@ -480,7 +657,7 @@ {\ifnum\POL@degB<\z@ \expandafter\xint_firstoftwo\else\expandafter\xint_secondoftwo \fi - {\def\POL@result{-1.\empty{0/1[0]}}}% + {\protected\def\POL@result{-1.\POL@empty{0/1[0]}}}% {\xintAssignArray\POL@polB\to\POL@arrayB \POL@normalize{B}% \POL@gcd@exit BA}}% @@ -606,11 +783,11 @@ \expandafter\expandafter\expandafter\POL@split \csname POLuserpol@#1\endcsname;\POL@var@deg\POL@var@coeffs \ifnum\POL@var@deg<\@ne - \@namedef{POLuserpol@#2}{-1.\empty{0/1[0]}}% + \@namedef{POLuserpol@#2}{-1.\POL@empty{0/1[0]}}% \else \edef\POL@var@coeffs{\expandafter\POL@diff\POL@var@coeffs\relax}% \expandafter\edef\csname POLuserpol@#2\endcsname - {\the\numexpr\POL@var@deg-\@ne.\noexpand\empty\POL@var@coeffs}% + {\the\numexpr\POL@var@deg-\@ne.\POL@empty\POL@var@coeffs}% \fi }% % lazy way but allows to share with AntiDiff @@ -666,11 +843,11 @@ \expandafter\expandafter\expandafter\POL@split \csname POLuserpol@#1\endcsname;\POL@var@deg\POL@var@coeffs \ifnum\POL@var@deg<\z@ - \@namedef{POLuserpol@#2}{-1.\empty{0/1[0]}}% + \@namedef{POLuserpol@#2}{-1.\POL@empty{0/1[0]}}% \else \edef\POL@var@coeffs{\expandafter\POL@antidiff\POL@var@coeffs\relax}% \expandafter\edef\csname POLuserpol@#2\endcsname - {\the\numexpr\POL@var@deg+\@ne.\noexpand\empty{0/1[0]}\POL@var@coeffs}% + {\the\numexpr\POL@var@deg+\@ne.\POL@empty{0/1[0]}\POL@var@coeffs}% \fi }% @@ -737,7 +914,7 @@ \POL@count\z@ % if I applied the same as for positive degree, I should make it -1 % if constant is negative. I also don't worry if polynomial is zero. - \@namedef{POLuserpol@\POL@sturmname _0}{0.\empty{1/1[0]}}% + \@namedef{POLuserpol@\POL@sturmname _0}{0.\POL@empty{1/1[0]}}% \else \ifPOL@tosturm@makefirstprimitive\POL@makeprimitive{\POL@sturmname _0_}\fi \POL@tosturm@dosturm @@ -793,7 +970,7 @@ \POL@mapcoeffs\POL@aux@toint{\POL@sturmname _\the\POL@count}% \ifnum\POL@count>\z@ \repeat - \@namedef{POLuserpol@\POL@sturmname _\POL@sturm@N}{0.\empty{1/1[0]}}% + \@namedef{POLuserpol@\POL@sturmname _\POL@sturm@N}{0.\POL@empty{1/1[0]}}% \else % they are already normalized \advance\POL@count\@ne % attention to include last one also \xintloop @@ -984,7 +1161,7 @@ \POL@findrat@xN\POL@findrat@xD\POl@_ % we can't move this to updatequotients because other branch will % need to do the division first anyhow - \edef\POLuserpol@_findrat@oneterm{1.\noexpand\empty + \edef\POLuserpol@_findrat@oneterm{1.\POL@empty {\xintiiOpp\POL@findrat@xN/1[0]}{\POL@findrat@xD/1[0]}}% \POL@divide{\POL@sturmname\POL@sqfnorr}{_findrat@oneterm}% the one without mult. %\expandafter\POL@split\POL@R;\POL@degR\POL@polR @@ -1118,7 +1295,7 @@ % zero should never occur here \POL@findrat@ifnegative{\edef\POL@findrat@x{-\POL@findrat@x}}{}% \POL@xintfrac@getNDE\POL@findrat@x\POL@findrat@xN\POL@findrat@xD\POL@_ - \edef\POLuserpol@_findrat@oneterm{1.\noexpand\empty + \edef\POLuserpol@_findrat@oneterm{1.\POL@empty {\xintiiOpp{\POL@findrat@xN}/1[0]}{\POL@findrat@xD/1[0]}}% \POL@divide{\POL@sturmname\POL@sqfnorr}{_findrat@oneterm}% the one without mult. \expandafter\POL@split\POL@R;\POL@degR\POL@polR @@ -1185,7 +1362,7 @@ % safer to do the edef as \POL@findrat@x used later in storeit \edef\POL@findrat@x{\xintIrr{\xintDiv\POL@findrat@Num\POL@findrat@D}[0]}% \POL@xintfrac@getNDE\POL@findrat@x\POL@findrat@xN\POL@findrat@xD\POL@_ - \edef\POLuserpol@_findrat@oneterm{1.\noexpand\empty + \edef\POLuserpol@_findrat@oneterm{1.\POL@empty {\xintiiOpp{\POL@findrat@xN}/1[0]}{\POL@findrat@xD/1[0]}}% \POL@divide{\POL@sturmname\POL@sqfnorr}{_findrat@oneterm}% the one without mult. \expandafter\POL@split\POL@R;\POL@degR\POL@polR @@ -1210,11 +1387,11 @@ \begingroup\xintglobaldefstrue % skip some overhead of \xintdefvar... \XINT_expr_defvar_one{\POL@sturmname L_\POL@findrat@index}% - {\csname .=\POL@findrat@x\endcsname}% + {\POL@findrat@x}% \XINT_expr_defvar_one{\POL@sturmname R_\POL@findrat@index}% - {\csname .=\POL@findrat@x\endcsname}% + {\POL@findrat@x}% \XINT_expr_defvar_one{\POL@sturmname Z_\POL@findrat@index _isknown}% - {\csname .=1\endcsname}% + {1}% \endgroup }% \def\POL@findrat@loop@updatequotients{% @@ -1326,7 +1503,7 @@ \xintloop % skip some overhead of \xintdefvar... \XINT_expr_defvar_one{\POL@sturmname M_\x}% - {\csname .=\csname POL_ZM\POL@sturmname*\x\endcsname\endcsname}% + {\csname POL_ZM\POL@sturmname*\x\endcsname}% \edef\x{\the\numexpr\x-\@ne}% \ifnum\x>\z@ \repeat @@ -1901,17 +2078,16 @@ \begingroup\xintglobaldefstrue % skip some overhead of \xintdefvar... \XINT_expr_defvar_one{\POL@sturmname L_\POL@isolz@IntervalIndex}% - {\csname .=\POL@IsoLeft@rawout\endcsname}% + {\POL@IsoLeft@rawout}% \XINT_expr_defvar_one{\POL@sturmname R_\POL@isolz@IntervalIndex}% - {\csname .=\POL@IsoRight@rawout\endcsname}% + {\POL@IsoRight@rawout}% % added at 0.7 \XINT_expr_defvar_one{\POL@sturmname Z_\POL@isolz@IntervalIndex _isknown}% - {\csname .=\ifnum\POL@IsoRightSign=\z@ 1\else 0\fi\endcsname}% + {\ifnum\POL@IsoRightSign=\z@ 1\else 0\fi}% \endgroup }% %% \PolRefineInterval -\def\POL@xintexprGetVar#1{\expandafter\expandafter\expandafter - \XINT_expr_unlock\csname XINT_expr_var_#1\endcsname}% +\def\POL@xintexprGetVar#1{\csname XINT_expr_varvalue_#1\endcsname}% % attention, also used by \POL@findrat@loop@a \def\POL@get@IsoLeft@rawin{% \edef\POL@IsoLeft@rawin @@ -2277,28 +2453,70 @@ %% The idea is to execute it with another meaning given to \xintAdd etc.., %% so that it operates on "polynomials". This is a mixture of expandable %% and non-expandable techniques. +%% +%% And it was complicated to let it work with xintexpr 1.4 +%% \def\POL@get#1#2#3{% - \global\POL@polfalse + \relax %!! part de la tambouille pour fonctionner en xint 1.4 + \POL@polglobalfalse \begingroup - \def\POL@result{#3}% + \protected\def\POL@result{#3}% #3% \expandafter \endgroup \expandafter\def\expandafter#1\expandafter{\POL@result}% \unless\ifPOL@pol % avoid expanding more than twice #3 + % #3 must be purely numerical or at least compatible with \edef + % this is why at 0.7.5 I had to handle especially constant + % polynomial functions to remove any protection from them + % (because the protection triggers the COMPOSITION when + % the polynomial is found as argument of another one and + % this is not expandable) \edef#1{#3}% \xintiiifZero{#1}% - {\def#1{-1.\empty{0/1[0]}}}% - {\edef#1{0.\noexpand\empty{#1}}}% + {\def#1{-1.\POL@empty{0/1[0]}}}% + {\edef#1{0.\POL@empty{#1}}}% \fi #2% }% + +%% COMPOSITION +%% This did not exist before 0.7.5 and is part of its adaptation to xint 1.4 +%% We thus took up this opportunity to speed up substantially composition. +%% Very serious difficulties with constant polynomials. Had to handle them +%% especially. +%% OK, that was really tough, but advantage now is that composition +%% at 0.7.5 should be more efficient than before. However when polynomials +%% become big via composition, coefficients also are big and the time +%% taken by arithmetic dominates. No time to test really, though, relieved +%% I can release xint 1.4 at last. My basic polexpr test suite passes, +%% but it goes back already to old releases. +\protected\def\POL@applypolfunc#1#2% +{% +% This #2 may be also invoing \POL@applypolfunc... + \POL@get\POL@A\POL@applypolfunc@b#2#1% +}% +\def\POL@applypolfunc@b #1% +{% +% and now the have our Horner scheme nested macro +% which hopefully will do its job with \POL@add, \POL@mul etc... + \POL@polglobalfalse + \expandafter#1\expanded + {{\POL@polglobaltrue\protected\def\noexpand\POL@result{\POL@A}}}% + \unless\ifPOL@pol + \odef\POL@result{#1{0}}% + \xintiiifZero{\POL@result}% + {\protected\def\POL@result{-1.\POL@empty{0/1[0]}}}% + {\protected\edef\POL@result{0.\POL@empty{\POL@result}}}% + \fi +}% + %% ADDITION \def\POL@add {\POL@get\POL@A\POL@add@b}% \def\POL@add@b{\POL@get\POL@B\POL@add@c}% \def\POL@add@c{% - \global\POL@poltrue + \POL@polglobaltrue \POL@ifZero\POL@A {\let\POL@result\POL@B}% {\POL@ifZero\POL@B @@ -2341,11 +2559,11 @@ \def\POL@mul {\POL@get\POL@A\POL@mul@b}% \def\POL@mul@b{\POL@get\POL@B\POL@mul@c}% \def\POL@mul@c{% - \global\POL@poltrue + \POL@polglobaltrue \POL@ifZero\POL@A - {\def\POL@result{-1.\empty{0/1[0]}}}% + {\protected\def\POL@result{-1.\POL@empty{0/1[0]}}}% {\POL@ifZero\POL@B - {\def\POL@result{-1.\empty{0/1[0]}}}% + {\protected\def\POL@result{-1.\POL@empty{0/1[0]}}}% {\POL@@mul}}% }% \def\POL@@mul{% @@ -2436,9 +2654,9 @@ %% POWERS (SCALAR EXPONENT...) \def\POL@pow #1#2{% - \global\POL@polfalse + \POL@polglobalfalse \begingroup - \def\POL@result{#1}% + \protected\def\POL@result{#1}% #1% \expandafter \endgroup @@ -2446,39 +2664,39 @@ \unless\ifPOL@pol \edef\POL@A{\xintScalarPow{#1}{#2}}% no error check \xintiiifZero{\POL@A}% - {\def\POL@result{-1.\empty{0/1[0]}}}% - {\edef\POL@result{0.\noexpand\empty{\POL@A}}}% + {\protected\def\POL@result{-1.\POL@empty{0/1[0]}}}% + {\protected\edef\POL@result{0.\POL@empty{\POL@A}}}% \else \edef\POL@B{\numexpr\xintNum{#2}\relax}% no check on exponent >= 0 \ifcase\POL@B - \def\POL@result{0.\empty{1/1[0]}}% + \protected\def\POL@result{0.\POL@empty{1/1[0]}}% \or \let\POL@result\POL@A \else \POL@@pow@check \fi \fi - \global\POL@poltrue + \POL@polglobaltrue }% \def\POL@@pow@check {% % no problem here with leftover tokens! % should I have used that I-don't-care technique more elsewhere? \ifnum\@ne>\POL@A - % polynomial is a constant, must get rid of dot and \empty + % polynomial is a constant, must get rid of dot and \empty (\POL@empty) \edef\POL@A{\expandafter\xintScalarPow\romannumeral`^^@% \expandafter\xint_gob_til_dot\POL@A{\POL@B}}% \xintiiifZero{\POL@A}% - {\def\POL@result{-1.\empty{0/1[0]}}}% - {\edef\POL@result{0.\noexpand\empty{\POL@A}}}% + {\protected\def\POL@result{-1.\POL@empty{0/1[0]}}}% + {\protected\edef\POL@result{0.\POL@empty{\POL@A}}}% \else \ifnum\@ne=\POL@A % perhaps a constant times X, check constant term \xintiiifZero {\expandafter\xint_firstoftwo\romannumeral`^^@% \expandafter\xint_gob_til_dot\POL@A} - {\edef\POL@result + {\protected\edef\POL@result {\the\POL@B.% here at least 2. - \noexpand\empty + \POL@empty \romannumeral\xintreplicate{\POL@B}{{0/1[0]}}% {\xintScalarPow {\expandafter\xint_secondoftwo\romannumeral`^^@% @@ -2531,8 +2749,8 @@ {#2}% \expandafter\POL@mul\expandafter {\expandafter\def\expandafter\POL@result\expandafter - {\POL@result}\global\POL@poltrue}% - {\def\POL@result{#1}\global\POL@poltrue}% + {\POL@result}\POL@polglobaltrue}% + {\protected\def\POL@result{#1}\POL@polglobaltrue}% }% %% DIVISION @@ -2540,7 +2758,7 @@ \def\POL@div {\POL@get\POL@A\POL@div@b}% \def\POL@div@b{\POL@get\POL@B\POL@div@c}% \def\POL@div@c{% - \global\POL@poltrue + \POL@polglobaltrue \expandafter\POL@split\POL@A;\POL@degA\POL@polA \expandafter\POL@split\POL@B;\POL@degB\POL@polB \ifnum\POL@degA<\POL@degB\space @@ -2599,9 +2817,9 @@ %% MINUS SIGN AS UNARY OPERATOR \def\POL@opp #1{% - \global\POL@polfalse + \POL@polglobalfalse \begingroup - \def\POL@result{#1}% + \protected\def\POL@result{#1}% #1% \expandafter \endgroup @@ -2609,13 +2827,13 @@ \unless\ifPOL@pol \edef\POL@A{\xintScalarOpp{#1}}% \xintiiifZero{\POL@A}% - {\def\POL@result{-1.\empty{0/1[0]}}}% - {\edef\POL@result{0.\noexpand\empty{\POL@A}}}% + {\protected\def\POL@result{-1.\POL@empty{0/1[0]}}}% + {\protected\edef\POL@result{0.\POL@empty{\POL@A}}}% \else - \edef\POL@B{0.\noexpand\empty{-1/1[0]}}% + \edef\POL@B{0.\POL@empty{-1/1[0]}}% \POL@@mul \fi - \global\POL@poltrue + \POL@polglobaltrue }% @@ -2626,9 +2844,9 @@ \At\PolEvalAtExpr\krof {#1}{#3}% }% \newcommand\PolEvalAt[2] - {\xintpraw{\csname XINT_expr_userfunc_#1\endcsname{#2}}}% + {\xintpraw{\csname XINT_expr_polfunc_#1\endcsname{#2}}}% \newcommand\POL@eval[2] - {\csname XINT_expr_userfunc_#1\endcsname{#2}}% + {\csname XINT_expr_polfunc_#1\endcsname{#2}}% \newcommand\PolEvalAtExpr[2]{\xinttheexpr #1(#2)\relax}% % \newcommand\PolEvalReduced[3]{\romannumeral`^^@\POL@eval@fork @@ -2637,11 +2855,11 @@ }% \newcommand\PolEvalReducedAt[2]{% \xintpraw % in order not to print denominator if the latter equals 1 - {\xintIrr{\csname XINT_expr_userfunc_#1\endcsname{#2}}[0]}% + {\xintIrr{\csname XINT_expr_polfunc_#1\endcsname{#2}}[0]}% }% \newcommand\PolEvalReducedAtExpr[2]{% \xintpraw - {\xintIrr{\romannumeral`^^@\xintthebareeval#1(#2)\relax}[0]}% + {\expandafter\xintIrr\romannumeral`^^@\xintthebareeval#1(#2)\relax[0]}% }% % \newcommand\PolFloatEval[3]{\romannumeral`^^@\POL@eval@fork @@ -2649,7 +2867,7 @@ \At\PolFloatEvalAtExpr\krof {#1}{#3}% }% \newcommand\PolFloatEvalAt[2] - {\xintpfloat{\csname XINT_flexpr_userfunc_#1\endcsname{#2}}}% + {\xintpfloat{\csname XINT_flexpr_polfunc_#1\endcsname{#2}}}% \newcommand\PolFloatEvalAtExpr[2]{\xintthefloatexpr #1(#2)\relax}% @@ -2898,12 +3116,12 @@ \expandafter#1% \fi {#3}#2}% % -\def\POL@toexprA #1#2\empty#3{% +\def\POL@toexprA #1#2\POL@empty#3{% \ifpoltoexprall\expandafter\POL@toexprall@b \else\expandafter\POL@toexpr@b \fi {#3}#2{0}1.% }% -\def\POL@toexprD #1#2#3\relax{% #3 has \empty to prevent brace removal +\def\POL@toexprD #1#2#3\relax{% #3 has \empty (\POL@empty) to prevent brace removal \expandafter\POL@toexprD@a\expandafter#2% \the\numexpr #1\expandafter.\romannumeral0\xintrevwithbraces{#3}\relax }% diff --git a/macros/latex/contrib/polexpr/polexpr.txt b/macros/latex/contrib/polexpr/polexpr.txt index 46ea7e32fa..898375926b 100644 --- a/macros/latex/contrib/polexpr/polexpr.txt +++ b/macros/latex/contrib/polexpr/polexpr.txt @@ -4,7 +4,7 @@ Package polexpr documentation =============================== -0.7.4 (2019/02/12) +0.7.5 (2020/01/31) ================== .. contents:: @@ -2567,6 +2567,11 @@ CHANGE LOG - 20000000000 is too big for ``\numexpr``, shouldn't I know that? Thanks to Jürgen Gilg for report. +- v0.7.5 (2020/01/31) + + Synced with xint 1.4. Requires it. + + Acknowledgments --------------- |