From 86662024018682cdc86b1bd94ae021b0b39a23f8 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 11 Apr 2021 21:33:43 +0000 Subject: lwarp git-svn-id: svn://tug.org/texlive/trunk@58837 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/source/latex/lwarp/lwarp.dtx | 2155 ++++++++++++++++++------ Master/texmf-dist/source/latex/lwarp/lwarp.ins | 6 +- 2 files changed, 1674 insertions(+), 487 deletions(-) (limited to 'Master/texmf-dist/source/latex') diff --git a/Master/texmf-dist/source/latex/lwarp/lwarp.dtx b/Master/texmf-dist/source/latex/lwarp/lwarp.dtx index 51892df0c1b..bcd587f5522 100644 --- a/Master/texmf-dist/source/latex/lwarp/lwarp.dtx +++ b/Master/texmf-dist/source/latex/lwarp/lwarp.dtx @@ -16,7 +16,7 @@ % \iffalse %\NeedsTeXFormat{LaTeX2e}[1999/12/01] %\ProvidesPackage{lwarp} -% [2021/02/18 v0.895 Allows LaTeX to directly produce HTML5 output.] +% [2021/04/08 v0.896 Allows LaTeX to directly produce HTML5 output.] % %<*driver> \documentclass{ltxdoc} @@ -309,11 +309,11 @@ Keywords={LaTeX, HTML, conversion}% \newcommand{\spkg}[1]{\textcolor[Hsb]{120,1,.4}{\pkg{#1}}}% package supported as-is \newcommand{\mpkg}[1]{\textcolor[Hsb]{240,1,.4}{\pkg{#1}}}% package modified for HTML \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{\ipkg}[1]{\textcolor[Hsb]{0,0,.4}{\pkg{#1}}}% package ignored \newcommand{\wpkg}[1]{\textcolor[Hsb]{0,1,.5}{\pkg{#1}}}% package warning special case \newcommand{\sjax}{\textsuperscript{\textcolor[Hsb]{120,1,.4}{MJ}}} \newcommand{\ejax}{\textsuperscript{\textcolor[Hsb]{300,1,.5}{MJ}}} -\newcommand{\ijax}{\textsuperscript{\textcolor[Hsb]{0,0,.5}{MJ}}} +\newcommand{\ijax}{\textsuperscript{\textcolor[Hsb]{0,0,.4}{MJ}}} % green/cyan/blue/magenta % \newcommand{\spkg}[1]{\textcolor[Hsb]{120,1,.4}{\pkg{#1}}}% package supported as-is @@ -322,7 +322,7 @@ Keywords={LaTeX, HTML, conversion}% % \newcommand{\ipkg}[1]{\textcolor[Hsb]{300,1,.5}{\pkg{#1}}}% package ignored % \newcommand{\wpkg}[1]{\textcolor[Hsb]{0,1,.5}{\pkg{#1}}}% package warning special case - +\newcommand{\ARIA}{\acro{ARIA}} \newcommand{\pdflatexonly}{ \textred{Only pre-loaded if \prog{pdflatex} is being used.} @@ -871,6 +871,7 @@ the link will be empty. Index entries also use \cs{nameref} and have the same limitation. \trouble{index>empty link} \trouble{reference>empty link} +\trouble{link>empty} } \newcommand{\limitspfnote}{ @@ -908,16 +909,19 @@ due to the limited number of symbols which are available. \limitsperpage -If using \brand{MathJax}, after each math expression with a \cs{footnotemark}, -\watchout[MathJax, \cs{footnotemark}] -adjust the \ctr{footnote} counter by the number of \cs{footnotemark}s: -\begin{sourcedisplay} -\cs{[} (math expression with \textgreen{two} instances of \cs{footnotemark}) \cs{]} \\ -\textred{\cs{warpHTMLonly}\{}\cs{addtocounter}\{footnote\}\{\textgreen{2}\}\textred{\}} -\end{sourcedisplay} -Similarly for \pkg{endnotes}, but \emph{not} \pkg{sidenotes}. +% No longer true: +% If using \brand{MathJax}, \cs{footnote} and \cs{endnote} work, +% \watchout[MathJax, \cs{footnotemark}] +% but for \cs{footnotemark}, after each math expression with a \cs{footnotemark} +% adjust the \ctr{footnote} counter by the number of \cs{footnotemark}s: +% \begin{sourcedisplay} +% \cs{[} (math expression with \textgreen{two} instances of \cs{footnotemark}) \cs{]} \\ +% \textred{\cs{warpHTMLonly}\{}\cs{addtocounter}\{footnote\}\{\textgreen{2}\}\textred{\}} +% \end{sourcedisplay} +% Similarly for \pkg{endnotes}, but \emph{not} \pkg{sidenotes}. Also for \brand{MathJax}, \cs{footnotename} is used for a \cs{footnotemark} +\margintag{\brand{MathJax}} if the actual footnote number is not known. To redefine it, provide it before loading \pkg{lwarp}: \begin{sourcedisplay} @@ -1643,34 +1647,38 @@ While using \brand{Mathjax}, \cs{displaymathother} may also be used for other forms of display and inline math which contain \pkg{chemformula} expressions. } -\newcommand{\limitsntheorem}{% -This conversion is not total. -\trouble[Font control]{ntheorem=\pkg{ntheorem}>font} -Font control is via \CSS, and the custom \LaTeX\ font settings -are ignored. - +\newcommand{\limitstheorems}{% If the print version does not use \pkg{cleveref}, -\trouble[cref reference format undefined]{ntheorem=\pkg{ntheorem}>cref reference format} -\trouble{cref reference format} -\trouble{cleveref=\pkg{cleveref}>cref reference format} +\trouble[cref reference format undefined]{ntheorem=\pkg{ntheorem}>cref reference format undefined} +\trouble{cref reference format undefined} +\trouble{cleveref=\pkg{cleveref}>cref reference format undefined} +\trouble{theorem>cref reference format undefined} place all \cs{theoremstyle} and \cs{newtheorem} -declarations in the preamble inside \cs{AtBeginDocument}.\footnote{% +declarations in the preamble inside \cs{AtEndPreamble}.\footnote{% \pkg{lwarp} uses \pkg{cleveref} for the \HTML\ conversion, - and loads \pkg{cleveref} \cs{AtEndPreamble}, just before \cs{AtBeginDocument}.% + and loads \pkg{cleveref} \cs{AtEndPreamble}, just before \cs{AtBeginDocument}. + This is also before the \filenm{.aux} file is read. } -For some theorems, it may also be required to add inside \cs{AtBeginDocument} +For some theorems, it may also be required to add inside \cs{AtEndPreamble} something such as: \begin{sourcedisplay} -\cs{AtBeginDocument}\{ \% if not using cleveref package \\ +\cs{usepackage}\{etoolbox\} \% for \cs{ifdef}, \cs{AtEndPreamble} \\ +\cs{AtEndPreamble}\{ \% if not using cleveref package \\ \fquad \cs{theoremstyle}\{definition\} \\ \fquad \cs{newtheorem}\{dtheorem\}\{Definition\} \\ \fquad \dots \\ - \fquad \cs{usepackage}\{etoolbox\} \% for \cs{ifdef} \\ \fquad \cs{ifdef}\{\cs{cref}\}\{ \\ \fqquad \cs{crefname}\{Proof\}\{Proof\}\{Proofs\} \\ \fquad \}\{\} \\ \} \end{sourcedisplay} +} + +\newcommand{\limitsntheorem}{% +This conversion is not total. +\trouble[Font control]{ntheorem=\pkg{ntheorem}>font} +Font control is via \CSS, and the custom \LaTeX\ font settings +are ignored. \limitsntheoremnumbering } @@ -2911,8 +2919,8 @@ changes do not affect the \HTML\ output. } \newcommand{\limitspolyglossia}{% -\trouble{Undefined control sequence \dots begindocument>polyglossia=\pkg{polyglossia}} -\trouble{polyglossia=\pkg{polyglossia}>Undefined control sequence \dots begindocument} +\trouble{Undefined control seq \dots\ begindocument>polyglossia=\pkg{polyglossia}} +\trouble{polyglossia=\pkg{polyglossia}>Undefined control seq \dots\ begindocument} \pkg{lwarp} uses \pkg{cleveref}, which has some limitations when using \pkg{polyglossia}, possibly resulting in the error \begin{sourcedisplay} @@ -3053,7 +3061,7 @@ This boolean may be tested by the user for later use. %<*package> % \fi % -% \CheckSum{53146} +% \CheckSum{54091} % % \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 @@ -3190,6 +3198,7 @@ This boolean may be tested by the user for later use. % \changes{v0.893}{2020/11/26}{\ 2020/11/26} % \changes{v0.894}{2020/12/24}{\ 2020/12/24} % \changes{v0.895}{2021/02/18}{\ 2021/02/18} +% \changes{v0.896}{2021/04/08}{\ 2021/04/08} @@ -3413,6 +3422,41 @@ This boolean may be tested by the user for later use. % % \begin{description} % \needspace{2\baselineskip} +% \item[v0.896:] Back references, accessibility. +% \begin{itemize} +% \item \textred{Due to changes in cross referencing, \watchout +% execute \cmds{lwarpmk clean} before recompiling.} +% \item Increased sectioning nesting stack depth. Error if overflow stack. +% \item Fixed footnotes at the end of the document, +% or inside a \env{description} label. +% \item Added an error if using braces inside \cs{usepackage} options. +% \item Fixed footnotes in bracket display math with \brand{MathJax}. +% \margintag{\brand{MathJax}} +% \item \LaTeX\ theorems, \pkg{amsthm}, \pkg{ntheorem}, \pkg{theorem}: +% \margintag{theorems} +% Print theorem footnotes following theorems. +% \item Added \HTML\ \element{main} element to each page. +% \margintag{accessibility} +% \item Added \ARIA\ |math| role to \SVG\ math images, and |note| role to +% margin notes, footnotes, etc. +% \item Improved citation backreferences for various packages. +% \margintag{packages} +% \item \pkg{chemfig}: Updated to v1.6a. +% \item \pkg{bigdelim}: Updated to v2.8. +% \item \pkg{xetexko}: Updated to v3.1. +% \item \pkg{hyperxmp}: Fix: Accept and discard additional keys. +% \item \pkg{hyperef}: Fix: Added \cs{*autorefname} macros. +% \item \pkg{biblatex}: Fix: Back references. +% \item \pkg{tocloft}: Fix: \cs{cftpagenumbersoff}, \cs{cftpagenumberson}. +% \item \pkg{threeparttablex}: Fix: \cs{TPTL@tnotex}. +% \item \pkg{amsthm}: Fix: Footnotes inside environment optional argument. +% \item \pkg{listings}: Fixed labels. Accepts but ignores escapes w/o error. +% \item \pkg{pdflscape}: Fix: Added \env{landscape} environment. +% \item Added \pkg{ccicons}, \pkg{classicthesis}, \pkg{orcidlink}. +% \item Added \pkg{enotez}. +% \item Verified support for \pkg{doi}, \pkg{doipubmed}. +% \end{itemize} +% \needspace{2\baselineskip} % \item[v0.895:] Vector packages, greatly improved \brand{MathJax} for \pkg{siunitx}. % \begin{itemize} % \item Fixed quotes in \HTML\ tags while using old font packages with @@ -4544,33 +4588,33 @@ This boolean may be tested by the user for later use. % \item \pkg{endfloat}: Updated for v2.6. % \item \pkg{url}: Fixes for active characters. % \end{itemize} -% \needspace{2\baselineskip} -% \item[v0.51:] Improved \SVG\ math, added numerous chemistry packages. -% \begin{itemize} -% \item Docs: Added \nameref{sec:thingstoavoid}. -% \margintag{documentation} -% \item Docs: Added to \nameref{sec:convertexisting}. -% \item Docs: Multiple authors and affiliations with custom classes. -% See \cref{sec:authorsaffils}. -% \item Docs: \pkg{tikz} with matrices. See \cref{sec:limitstikz}. -% \item Improved \SVG\ math baseline.\margintag{SVG math} -% \item Improved \SVG\ math font and color. -% \item Faster \SVG\ math rendering. -% \item Improved support for display math containing complicated math objects, -% such as \pkg{tikz-cd}. See \cref{sec:displaymathother}. -% \item Fix: \cs{addcontentsline} inside \SVG\ math. -% \item Fix: \SVG\ math containing an embedded \env{lateximage}. -% \item \brand{MathJax} now handles \cs{ensuremath} in expressions.\margintag{MathJax} -% \item Fix: Added \env{alignat} environment. \margintag{misc. fixes} -% \item Fix: \pkg{afterpackage} no longer required, which conflicted with \pkg{scrlfile}. -% \item Fix: \pkg{titling} \cs{thanks} mark. -% \item Fix: \pkg{fancybox} improvements. -% \item Fix: \pkg{tikz} \cs{tikz} macro. (Previously only the \env{tikzpicture} environment worked.) -% \item Fix: \pkg{tikz} with optional argument. -% \item Added \pkg{mhchem}, \margintag{packages} -% \pkg{chemfig}, \pkg{chemformula}, \pkg{chemmacros}, \pkg{chemnum}, \pkg{chemgreek}, -% \pkg{epstopdf-base}, \pkg{grid}, \pkg{ltxgrid}. -% \end{itemize} +% ^^A % \needspace{2\baselineskip} +% ^^A % \item[v0.51:] Improved \SVG\ math, added numerous chemistry packages. +% ^^A % \begin{itemize} +% ^^A % \item Docs: Added \nameref{sec:thingstoavoid}. +% ^^A % \margintag{documentation} +% ^^A % \item Docs: Added to \nameref{sec:convertexisting}. +% ^^A % \item Docs: Multiple authors and affiliations with custom classes. +% ^^A % See \cref{sec:authorsaffils}. +% ^^A % \item Docs: \pkg{tikz} with matrices. See \cref{sec:limitstikz}. +% ^^A % \item Improved \SVG\ math baseline.\margintag{SVG math} +% ^^A % \item Improved \SVG\ math font and color. +% ^^A % \item Faster \SVG\ math rendering. +% ^^A % \item Improved support for display math containing complicated math objects, +% ^^A % such as \pkg{tikz-cd}. See \cref{sec:displaymathother}. +% ^^A % \item Fix: \cs{addcontentsline} inside \SVG\ math. +% ^^A % \item Fix: \SVG\ math containing an embedded \env{lateximage}. +% ^^A % \item \brand{MathJax} now handles \cs{ensuremath} in expressions.\margintag{MathJax} +% ^^A % \item Fix: Added \env{alignat} environment. \margintag{misc. fixes} +% ^^A % \item Fix: \pkg{afterpackage} no longer required, which conflicted with \pkg{scrlfile}. +% ^^A % \item Fix: \pkg{titling} \cs{thanks} mark. +% ^^A % \item Fix: \pkg{fancybox} improvements. +% ^^A % \item Fix: \pkg{tikz} \cs{tikz} macro. (Previously only the \env{tikzpicture} environment worked.) +% ^^A % \item Fix: \pkg{tikz} with optional argument. +% ^^A % \item Added \pkg{mhchem}, \margintag{packages} +% ^^A % \pkg{chemfig}, \pkg{chemformula}, \pkg{chemmacros}, \pkg{chemnum}, \pkg{chemgreek}, +% ^^A % \pkg{epstopdf-base}, \pkg{grid}, \pkg{ltxgrid}. +% ^^A % \end{itemize} % ^^A \needspace{2\baselineskip} % ^^A \item[v0.50:] Improved \SVG\ math. % ^^A \begin{itemize} @@ -5545,10 +5589,11 @@ This boolean may be tested by the user for later use. % \ipkg{fullminipage}, \ipkg{fullpage}, % \ipkg{fwlw}, \ipkg{geometry}, \ipkg{gmeometric}, % \ipkg{grid}, \mpkg{grid-system}, \ipkg{gridset}, -% \ipkg{layaureo}, \ipkg{layout}, \ipkg{layouts}, \ipkg{leading}, +% \ipkg{layaureo}, \ipkg{layout}, \ipkg{layouts}, \ipkg{leading}, \ipkg{lscape}, % \ipkg{ltxgrid}, \ipkg{nccfancyhdr}, \ipkg{notespages}, \ipkg{nowidow}, % \ipkg{pagegrid}, \ipkg{pagesel}, \epkg{parallel}, \epkg{parcolumns}, -% \ipkg{pdfcolparallel}, \ipkg{pdfcolparcolumns}, \ipkg{pdfcrypt}, \ipkg{pdfprivacy}, +% \ipkg{pdfcolparallel}, \ipkg{pdfcolparcolumns}, \ipkg{pdfcrypt}, +% \ipkg{pdflscape}, \ipkg{pdfprivacy}, % \ipkg{preview}, \epkg{ragged2e}, \ipkg{returntogrid}, \ipkg{rmpage}, % \epkg{scrlayer-scrpage}, \epkg{scrpage2}, \epkg{setspace}, \ipkg{selectp}, % \ipkg{textarea}, \ipkg{threadcol}, @@ -5616,7 +5661,7 @@ This boolean may be tested by the user for later use. % Footnotes: & Adds \progcode{FootnoteDepth} to print footnotes at section breaks. % \brand{MathJax} emulation for \cs{footnote}, and also as marked in the following: % \epkg{bigfoot}, \ipkg{dblfnote}, -% \ipkg{endheads}, \mpkg{endnotes}\ejax, \spkg{fixfoot}, +% \ipkg{endheads}, \mpkg{endnotes}\ejax, \mpkg{enotez}\ejax, \spkg{fixfoot}, % \ipkg{fnbreak}, \ipkg{fnpara}, \ipkg{fnpos}, % \epkg{footmisc}, \mpkg{footnote}, \ipkg{footnotebackref}, % \mpkg{footnoterange}, \ipkg{footnpag}, \epkg{manyfoot}, @@ -5733,8 +5778,8 @@ This boolean may be tested by the user for later use. % \midrule % % \mpkg{xcolor}: & \textcolor{DarkGreen}{Full package color names}, any color models, -% and \textcolor{Goldenrod}{mixing}. -% \textcolor{Maroon}{\cs{textcolor}}, +% and \textcolor{red!70!black}{mixing}. +% \textcolor{blue}{\cs{textcolor}}, % \colorbox{LightSteelBlue}{\cs{colorbox}}, % \fcolorbox{red}{NavajoWhite}{\cs{fcolorbox}}. % Enhanced for \HTML\ compatibility. \\ @@ -5821,7 +5866,7 @@ This boolean may be tested by the user for later use. % Also see the math section for math and \brand{MathJax} support for math font packages. \\ % % Symbols: & Native \LaTeX\ diacriticals, \mpkg{academicons}, \spkg{amssymb}\sjax, -% \mpkg{bbding}, +% \mpkg{bbding}, \mpkg{ccicons}, % \mpkg{chemgreek}, \mpkg{dingbat}, \spkg{euro}, \mpkg{eurosym}, % \mpkg{fontawesome}, \mpkg{fontawesome5}, \spkg{gensymb}\ejax, \spkg{latexsym}\sjax, % \mpkg{marvosym}, @@ -5872,7 +5917,8 @@ This boolean may be tested by the user for later use. % % \midrule % -% Calendars: & \mpkg{termcal} \\ +% Academic: & \mpkg{academicons}, \epkg{classicthesis}, \spkg{doi}, +% \spkg{doipubmed}, \mpkg{orcidlink}\ijax, \mpkg{termcal} \\ % % \midrule % @@ -6620,7 +6666,7 @@ This boolean may be tested by the user for later use. % own auxiliary files. In this way, both \PDF\ and \HTML\ % documents may co-exist side-by-side. % -% \item [Auxiliary files:] The usual \LaTeX\ files |.aux|, |.log|, |.out|, |.toc|, |.lof|, |.idx|. +% \item [Auxiliary files:] The usual \LaTeX\ files |.aux|, |.log|, |.out|, \filenm{.toc}, \filenm{.lof}, |.idx|. % When an \HTML\ version of the document is created, |_html| versions % of the auxiliary files will also be generated. % @@ -7012,7 +7058,7 @@ This boolean may be tested by the user for later use. % % \subsection{Cleaning auxiliary files} % -% To remove the auxiliary files |.aux|, |.toc|, |.lof|, |.lot|, |.idx|, |.ind|, |.log|, +% To remove the auxiliary files |.aux|, \filenm{.toc}, \filenm{.lof}, \filenm{.lot}, |.idx|, |.ind|, |.log|, % and |.gl*|, and a few others: % \userentry{lwarpmk clean} % @@ -7277,14 +7323,20 @@ This boolean may be tested by the user for later use. % \gindex{link>title=\attribute{title} text} % \gindex{hyperref=\pkg{hyperref}>title=\attribute{title} text} % \gindex{settings>accessibility} +% \gindex{ARIA=\acro{ARIA}} +% \gindex{roles>ARIA=\acro{ARIO}} % % \pkg{lwarp} provides several methods for improving access to % the document using tools such as text-only browsers, copy \Slash paste, % text-to-speech readers, or Braille readers. -% \HTML\ provides the \attribute{alt} text attribute for images, -% which is used by \pkg{lwarp} as describe below. -% \HTML\ also provides the \attribute{title} attribute, which usually +% \pkg{lwarp} can use the \HTML\ \attribute{alt} text attribute for images, +% as describe below. +% \pkg{lwarp} can also use the \HTML\ \attribute{title} attribute, which usually % generates a pop-up text. \pkg{lwarp} can add this to a reference or hyperlink. +% \pkg{lwarp} also uses standard \HTML5 elements which are pre-assigned +% \ARIA\ roles for increased accessibility, and \pkg{lwarp} assigns the |math| +% role for \SVG\ math images, and the |note| role for footnotes, end notes, +% margin paragraphs and notes, etc. % \brand{MathJax} also has provisions for improved accessibility % as well. See \cref{tab:accessibility}. % @@ -9613,7 +9665,7 @@ This boolean may be tested by the user for later use. % \cs{usepackage}[ \\ % \fqquad \textred{makeindex,} \\ % \fqquad \textred{makeindexStyle=gindex.ist,} \\ -% \fqquad \dots or \dots \\ +% \fqquad \dots\ or \dots \\ % \fqquad \textred{makeindexStyle=gindexh.ist,} \\ % \fqquad \textgreen{latexmk} \hfill \textrm{}\\ % ]\{\textblue{lwarp}\} @@ -10141,7 +10193,7 @@ This boolean may be tested by the user for later use. % \DescribeOption{makeindexStyle} % \begin{sourcedisplay} % \cs{usepackage}[ \\ -% \fquad \dots other options \dots \\ +% \fquad \dots\ other options \dots \\ % \fquad \textred{makeindex}, \\ % \fquad \textred{makeindexStyle=projectname.ist}, \\ % ]\{lwarp\} @@ -10200,7 +10252,7 @@ This boolean may be tested by the user for later use. % \DescribeOption{xindyStyle} % \begin{sourcedisplay} % \cs{usepackage}[ \\ -% \fquad \dots other options \dots \\ +% \fquad \dots\ other options \dots \\ % \fquad \textred{xindy}, \\ % \fquad \textred{xindyStyle=projectname.xdy}, \\ % ]\{lwarp\} @@ -10237,7 +10289,7 @@ This boolean may be tested by the user for later use. % \DescribeOption{xindexConfig} % \begin{sourcedisplay} % \cs{usepackage}[ \\ -% \fquad \dots other options \dots \\ +% \fquad \dots\ other options \dots \\ % \fquad \textred{xindex}, \\ % \fquad \textred{xindexConfig=projectname}, \quad \% \textgreen{(without xindex- or .lua)} \\ % ]\{lwarp\} @@ -10341,6 +10393,10 @@ This boolean may be tested by the user for later use. % \limitsmathdisplay % % +% \subsubsection{Theorems} +% \limitstheorems +% \changes{v0.896}{2021/03/25}{Docs: Theorem references.} +% % \subsubsection{\pkg{ntheorem} package} % % \DescribePackage{ntheorem} @@ -10890,8 +10946,8 @@ This boolean may be tested by the user for later use. % No attempt has yet been made to make \pkg{pythontex} robust with \HTML\ output. % Some math objects must be surrounded by % \trouble[``impure'' math]{pythontex=\pkg{pythontex}} -% \cs{displaymathother} \dots \cs{displaymathnormal}, -% or \cs{inlinemathother} \dots \cs{inlinemathnormal}. +% \cs{displaymathother} \dots\ \cs{displaymathnormal}, +% or \cs{inlinemathother} \dots\ \cs{inlinemathnormal}. % Displays of code may have to be % enclosed inside a \env{lateximage} environment % \watchout[HTML look-alike] @@ -11949,7 +12005,7 @@ This boolean may be tested by the user for later use. % \item [``Temporary page! LaTeX was unable to guess the total % number of pages \dots'':] \ % Harmless. Recompile the document one more time. -% \trouble{Temporary page \dots unable to guess \dots} +% \trouble{Temporary page \dots\ unable to guess \dots} % \trouble{LaTeX was unable to guess the total\dots} % % \item [``Leaders not followed by proper glue'':] ~ \\ @@ -12051,8 +12107,8 @@ This boolean may be tested by the user for later use. % \trouble{alt tags} % can also cause problems with \attribute{alt} tags, resulting in % very slow compilation, large \attribute{alt} tags, and possible -% crashes. Use \cs{inlinemathother} \dots \cs{inlinemathnormal} or -% \cs{displaymathother} \dots \cs{displaymathnormal} around the +% crashes. Use \cs{inlinemathother} \dots\ \cs{inlinemathnormal} or +% \cs{displaymathother} \dots\ \cs{displaymathnormal} around the % math expression. % \end{description} % @@ -12896,6 +12952,7 @@ This boolean may be tested by the user for later use. \LWR@loadafter{bussproofs} \LWR@loadafter{bxpapersize} \LWR@loadafter{bytefield} +\LWR@loadafter{ccicons} \LWR@loadafter{cancel} \LWR@loadafter{canoniclayout} \LWR@loadafter{caption} @@ -12920,6 +12977,7 @@ This boolean may be tested by the user for later use. \LWR@notmemoirloadafter{chngpage} \LWR@loadafter{cite} \LWR@loadafter{citeref} +\LWR@loadafter{classicthesis} \LWR@loadafter{cleveref} % cmbright may be preloaded \LWR@loadafter{cmdtrack} @@ -12957,6 +13015,7 @@ This boolean may be tested by the user for later use. \LWR@loadafter{endheads} \LWR@loadafter{endnotes} \LWR@loadafter{engtlc} +\LWR@loadafter{enotez} \LWR@notmemoirloadafter{enumerate} \LWR@loadafter{enumitem} \LWR@notmemoirloadafter{epigraph} @@ -13171,6 +13230,7 @@ This boolean may be tested by the user for later use. \LWR@loadafter{nowidow} \LWR@loadafter{ntheorem} \LWR@loadafter{octave} +\LWR@loadafter{orcidlink} \LWR@loadafter{overpic} \LWR@loadafter{pagegrid} \LWR@notmemoirloadafter{pagenote} @@ -13381,7 +13441,7 @@ This boolean may be tested by the user for later use. \LWR@loadafter{xcolor} \LWR@loadafter{xechangebar} \LWR@loadafter{xellipsis} -% xetexko-vertical must be loaded before lwarp +% xetexko must be loaded before lwarp \LWR@loadafter{xevlna} \LWR@loadafter{xfakebold} \LWR@loadafter{xfrac} @@ -13739,25 +13799,29 @@ This boolean may be tested by the user for later use. % % \subsection{Argument selection} % -% \begin{macro}{\LWR@firstoffour} \marg{first} \marg{second} \marg{third} \marg{fourth} +% \begin{macro}{\LWR@firstoffive} \marg{first} \marg{second} \marg{third} \marg{fourth} \marg{fifth} % \changes{v0.63}{2019/01/25}{Added.} -% \begin{macro}{\LWR@secondoffour} \marg{first} \marg{second} \marg{third} \marg{fourth} -% \begin{macro}{\LWR@thirdoffour} \marg{first} \marg{second} \marg{third} \marg{fourth} -% \begin{macro}{\LWR@fourthoffour} \marg{first} \marg{second} \marg{third} \marg{fourth} +% \changes{v0.896}{2021/04/05}{Changed to firstoffive instead of four.} +% \begin{macro}{\LWR@secondoffive} \marg{first} \marg{second} \marg{third} \marg{fourth} \marg{fifth} +% \begin{macro}{\LWR@thirdoffive} \marg{first} \marg{second} \marg{third} \marg{fourth} \marg{fifth} +% \begin{macro}{\LWR@fourthoffive} \marg{first} \marg{second} \marg{third} \marg{fourth} \marg{fifth} +% \begin{macro}{\LWR@fifthoffive} \marg{first} \marg{second} \marg{third} \marg{fourth} \marg{fifth} % -% Expands to the nth of the four arguments. +% Expands to the nth of the five arguments. % Used for extra cross referencing. % % \begin{macrocode} -\long\def\LWR@firstoffour#1#2#3#4{#1} -\long\def\LWR@secondoffour#1#2#3#4{#2} -\long\def\LWR@thirdoffour#1#2#3#4{#3} -\long\def\LWR@fourthoffour#1#2#3#4{#4} +\long\def\LWR@firstoffive#1#2#3#4#5{#1} +\long\def\LWR@secondoffive#1#2#3#4#5{#2} +\long\def\LWR@thirdoffive#1#2#3#4#5{#3} +\long\def\LWR@fourthoffive#1#2#3#4#5{#4} +\long\def\LWR@fifthoffive#1#2#3#4#5{#5} % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} % \end{macro} +% \end{macro} % % % \subsection{Inside boxes} @@ -15676,6 +15740,7 @@ This boolean may be tested by the user for later use. % \begin{macrocode} \RenewDocumentCommand{\RequirePackage}{o m o}{% % \end{macrocode} +% % Redirect up to twenty names:\footnote{This was originally nine names, but % then I came across a package which used twelve...} % \changes{v0.61}{2018/10/02}{Support up to 20 packages.} @@ -15703,6 +15768,31 @@ This boolean may be tested by the user for later use. \LWR@lookforpackagename{19}% \LWR@lookforpackagename{20}% % \end{macrocode} +% +% Error if braces are used in optional argument. +% This can cause an error, so tell how to avoid. +% \changes{v0.896}{2021/03/14}{Warn if package option has braces.} +% \begin{macrocode} +\IfSubStr{\detokenize\expandafter{#1}}{\LWRleftbrace}% + {% + \PackageError{lwarp}{% + You used:\MessageBreak + \protect\requirepackage[#1]{#2}\MessageBreak + Braces in the package options will fail with Lwarp.\MessageBreak + Instead, use:\MessageBreak + \protect\PassOptionsToPackage{#1}{#2}\MessageBreak + \protect\requirepackage{#2}\MessageBreak + near the line number given below.\MessageBreak + Enter 'h' for more info% + }% + {% + See the Lwarp manual troubleshooting index entry for\MessageBreak + ``package, options with braces''% + }% + }% + {}% no brace +% \end{macrocode} +% % \cs{RequirePackage} depending on the options and version: % \begin{macrocode} \IfValueTF{#1}% @@ -15967,7 +16057,7 @@ This boolean may be tested by the user for later use. % \begin{macro}{\LWR@copyfile} \marg{source filename} \marg{destination filename} % -% Used to copy the |.toc| file to |.sidetoc| to re-print the \TOC\ in +% Used to copy the \filenm{.toc} file to |.sidetoc| to re-print the \TOC\ in % the side\TOC\ navigation pane. % \begin{macrocode} \newwrite\LWR@copyoutfile % open the file to write to @@ -17389,6 +17479,7 @@ This boolean may be tested by the user for later use. % \changes{v0.88}{2020/07/14}{\filenm{lwarp.css}: Added \optn{indexheading} for \pkg{gindex}.} % \changes{v0.893}{2020/10/18}{\filenm{lwarp.css}: Added \pkg{keystroke}.} % \changes{v0.894}{2020/12/15}{\filenm{lwarp.css}: \TeX\ logos no longer below baseline.} +% \changes{v0.896}{2021/03/04}{\filenm{lwarp.css}: Added \element{main}, adjusted \element{sidetoccontainer} margin.} % % ^^A *lwarp.css % @@ -17888,12 +17979,12 @@ div.marginblock br , div.marginparblock br { margin-bottom: 2ex ; } -div.bodycontainer { +main.bodycontainer { float: left ; width: 80% ; } -div.bodywithoutsidetoc div.bodycontainer { +div.bodywithoutsidetoc main.bodycontainer { float: none ; width: 100% ; } @@ -18735,15 +18826,12 @@ img.lateximage{ } -/* The -1px right margin compensates for the 1px right border. */ -/* Without this -1px margin, the body container appears below instead */ -/* of floating to the side. */ div.sidetoccontainer { font-family: "DejaVu Serif", "Bitstream Vera Serif", "Lucida Bright", Georgia, serif; float: left ; - width: 20%; - margin: 0pt -1px 3ex 0pt ; + width: 19%; /* room for border-right next to 80% main */ + margin: 0pt 0em 3ex 0pt ; border-right: 1px solid silver; border-bottom: 1px solid silver; background: #FAF7F4 ; @@ -19097,7 +19185,7 @@ span.sidetocthetitle { display: none } span.sidetocthetitle { display: inline } nav.topnavigation { display:block } nav.botnavigation { display:block } - div.bodycontainer { width: 100% } + main.bodycontainer { width: 100% } .marginpar { max-width: 100%; float: none; @@ -19116,21 +19204,21 @@ span.sidetocthetitle { display: none } div.sidetoccontainer { display:none; } nav.topnavigation { display: none; } nav.botnavigation { display: none; } - div.bodycontainer { width: 100% } + main.bodycontainer { width: 100% } } @media handheld { div.sidetoccontainer { display:none; } nav.topnavigation { display:block } nav.botnavigation { display:block } - div.bodycontainer { width: 100% } + main.bodycontainer { width: 100% } } @media projection { div.sidetoccontainer { display:none; } nav.topnavigation { display:block } nav.botnavigation { display:block } - div.bodycontainer { width: 100% } + main.bodycontainer { width: 100% } } \end{filecontents*} % \end{Verbatim}% for syntax highlighting @@ -20192,7 +20280,7 @@ MathJax = { -- Copyright 2016-2021 Brian Dunn -printversion = "v0.895" +printversion = "v0.896" requiredconfversion = "2" -- also at *lwarpmk.conf function printhelp () @@ -21169,9 +21257,7 @@ end -- not --version % \begin{macrocode} \begin{warpHTML} % \end{macrocode} - - - +% % Stacks are used to remember how to close sections and list items. % Before a new section is started, previously nested sections and items must % be closed out (un-nested) in proper order. @@ -21224,6 +21310,7 @@ end -- not --version % A stack to record the action to take to close each nesting level: % Add more levels of stack if necessary for a very deeply nested document, % adding to \cs{pushclose} and \cs{popclose} as well. +% \changes{v0.896}{2021/03/15}{Stack 19 deep.} % \begin{macrocode} \newcommand*{\LWR@closeone}{}% top of the stack \newcommand*{\LWR@closetwo}{} @@ -21237,6 +21324,13 @@ end -- not --version \newcommand*{\LWR@closeten}{} \newcommand*{\LWR@closeeleven}{} \newcommand*{\LWR@closetwelve}{} +\newcommand*{\LWR@closethirteen}{} +\newcommand*{\LWR@closefourteen}{} +\newcommand*{\LWR@closefifteen}{} +\newcommand*{\LWR@closesixteen}{} +\newcommand*{\LWR@closeseventeen}{} +\newcommand*{\LWR@closeeighteen}{} +\newcommand*{\LWR@closenineteen}{} % \end{macrocode} % \subsection{Closing depths} @@ -21258,7 +21352,8 @@ end -- not --version % \end{Verbatim} % \vspace{-\baselineskip} % \end{docsidebar} - +% +% \changes{v0.896}{2021/03/15}{Stack 19 deep.} % \begin{macrocode} \newcommand*{\LWR@closedepthone}{\LWR@depthnone}% top of the stack \newcommand*{\LWR@closedepthtwo}{\LWR@depthnone} @@ -21272,6 +21367,13 @@ end -- not --version \newcommand*{\LWR@closedepthten}{\LWR@depthnone} \newcommand*{\LWR@closedeptheleven}{\LWR@depthnone} \newcommand*{\LWR@closedepthtwelve}{\LWR@depthnone} +\newcommand*{\LWR@closedepththirteen}{\LWR@depthnone} +\newcommand*{\LWR@closedepthfourteen}{\LWR@depthnone} +\newcommand*{\LWR@closedepthfifteen}{\LWR@depthnone} +\newcommand*{\LWR@closedepthsixteen}{\LWR@depthnone} +\newcommand*{\LWR@closedepthseventeen}{\LWR@depthnone} +\newcommand*{\LWR@closedeptheighteen}{\LWR@depthnone} +\newcommand*{\LWR@closedepthnineteen}{\LWR@depthnone} % \end{macrocode} % \subsection{Pushing and popping the stack} @@ -21280,9 +21382,17 @@ end -- not --version % Pushes one return action and its \LaTeX\ depth onto the stacks. % \changes{v0.46}{2018/01/18}{Fix: Stack unnesting.} +% \changes{v0.896}{2021/03/15}{Stack 19 deep.} % \begin{macrocode} \NewDocumentCommand{\LWR@pushclose}{m} {% +\global\let\LWR@closenineteen\LWR@closeeighteen% +\global\let\LWR@closeeighteen\LWR@closeseventeen% +\global\let\LWR@closeseventeen\LWR@closesixteen% +\global\let\LWR@closesixteen\LWR@closefifteen% +\global\let\LWR@closefifteen\LWR@closefourteen% +\global\let\LWR@closefourteen\LWR@closethirteen% +\global\let\LWR@closethirteen\LWR@closetwelve% \global\let\LWR@closetwelve\LWR@closeeleven% \global\let\LWR@closeeleven\LWR@closeten% \global\let\LWR@closeten\LWR@closenine% @@ -21295,6 +21405,13 @@ end -- not --version \global\let\LWR@closethree\LWR@closetwo% \global\let\LWR@closetwo\LWR@closeone% \global\csletcs{LWR@closeone}{LWR@printclose#1}% +\global\let\LWR@closedepthnineteen\LWR@closedeptheighteen% +\global\let\LWR@closedeptheighteen\LWR@closedepthseventeen% +\global\let\LWR@closedepthseventeen\LWR@closedepthsixteen% +\global\let\LWR@closedepthsixteen\LWR@closedepthfifteen% +\global\let\LWR@closedepthfifteen\LWR@closedepthfourteen% +\global\let\LWR@closedepthfourteen\LWR@closedepththirteen% +\global\let\LWR@closedepththirteen\LWR@closedepthtwelve% \global\let\LWR@closedepthtwelve\LWR@closedeptheleven% \global\let\LWR@closedeptheleven\LWR@closedepthten% \global\let\LWR@closedepthten\LWR@closedepthnine% @@ -21307,6 +21424,20 @@ end -- not --version \global\let\LWR@closedepththree\LWR@closedepthtwo% \global\let\LWR@closedepthtwo\LWR@closedepthone% \global\csletcs{LWR@closedepthone}{LWR@depth#1}% +% \end{macrocode} +% +% Error if the deepest depth is no longer \cs{LWR@depthnone}, +% which means that it somehow has been nested too deeply, +% or things are not being unnested correctly. +% \changes{v0.896}{2021/03/15}{Error if stack overflow.} +% \begin{macrocode} +\ifdefstring{\LWR@closedepthnineteen}{\LWR@depthnone}% + {}% + {% + \PackageError{lwarp}% + {The document is nested too deeply for Lwarp}% + {PLEASE inform the Lwarp maintainer!}% + }% } % \end{macrocode} % \end{macro} @@ -21316,6 +21447,7 @@ end -- not --version % Pops one action and its depth off the stacks. % \changes{v0.46}{2018/01/18}{Fix: Stack unnesting.} +% \changes{v0.896}{2021/03/15}{Stack 19 deep.} % \begin{macrocode} \newcommand*{\LWR@popclose} {% @@ -21330,6 +21462,13 @@ end -- not --version \global\let\LWR@closenine\LWR@closeten% \global\let\LWR@closeten\LWR@closeeleven% \global\let\LWR@closeeleven\LWR@closetwelve% +\global\let\LWR@closetwelve\LWR@closethirteen% +\global\let\LWR@closethirteen\LWR@closefourteen% +\global\let\LWR@closefourteen\LWR@closefifteen% +\global\let\LWR@closefifteen\LWR@closesixteen% +\global\let\LWR@closesixteen\LWR@closeseventeen% +\global\let\LWR@closeseventeen\LWR@closeeighteen% +\global\let\LWR@closeeighteen\LWR@closenineteen% \global\let\LWR@closedepthone\LWR@closedepthtwo% \global\let\LWR@closedepthtwo\LWR@closedepththree% \global\let\LWR@closedepththree\LWR@closedepthfour% @@ -21341,6 +21480,13 @@ end -- not --version \global\let\LWR@closedepthnine\LWR@closedepthten% \global\let\LWR@closedepthten\LWR@closedeptheleven% \global\let\LWR@closedeptheleven\LWR@closedepthtwelve% +\global\let\LWR@closedepthtwelve\LWR@closedepththirteen% +\global\let\LWR@closedepththirteen\LWR@closedepthfourteen% +\global\let\LWR@closedepthfourteen\LWR@closedepthfifteen% +\global\let\LWR@closedepthfifteen\LWR@closedepthsixteen% +\global\let\LWR@closedepthsixteen\LWR@closedepthseventeen% +\global\let\LWR@closedepthseventeen\LWR@closedeptheighteen% +\global\let\LWR@closedeptheighteen\LWR@closedepthnineteen% } % \end{macrocode} % \end{macro} @@ -21524,7 +21670,7 @@ end -- not --version \boolfalse{LWR@dynamicmath} % \end{macrocode} % -% \begin{macro}{\inlinemathother} Place before using |$| \dots\ |$| or \cs{(} \dots \cs{)} +% \begin{macro}{\inlinemathother} Place before using |$| \dots\ |$| or \cs{(} \dots\ \cs{)} % if the contents of the math are not static, depending on counters or dynamic macros. % \changes{v0.57}{2018/05/23}{Added.} % \changes{v0.61}{2018/09/20}{Changed name from \cs{StartDynamicMath} to \cs{inlinemathother}.} @@ -21536,7 +21682,7 @@ end -- not --version % \end{macrocode} % \end{macro} % -% \begin{macro}{\inlinemathnormal} Place after using |$| \dots\ |$| or \cs{(} \dots \cs{)} +% \begin{macro}{\inlinemathnormal} Place after using |$| \dots\ |$| or \cs{(} \dots\ \cs{)} % with dynamic contents. % \changes{v0.61}{2018/09/20}{Changed name from \cs{StopDynamicMath} to \cs{inlinemathnormal}.} % \begin{macrocode} @@ -22069,12 +22215,16 @@ end -- not --version % \begin{macro}{\LWRPrintStack} Prints the closedepth stack. % \changes{v0.46}{2018/01/15}{Name changed from \cs{PrintStack}.} +% \changes{v0.896}{2021/03/15}{Stack 19 deep.} % \begin{macrocode} \newcommand*{\LWR@subprintstack}{ \LWR@closedepthone\ \LWR@closedepthtwo\ \LWR@closedepththree\ \LWR@closedepthfour\ \LWR@closedepthfive\ \LWR@closedepthsix\ \LWR@closedepthseven\ \LWR@closedeptheight\ \LWR@closedepthnine\ \LWR@closedepthten\ \LWR@closedeptheleven\ \LWR@closedepthtwelve\ +\LWR@closedepththirteen\ \LWR@closedepthfourteen\ \LWR@closedepthfifteen\ +\LWR@closedepthsixteen\ \LWR@closedepthseventeen\ \LWR@closedeptheighteen\ +\LWR@closedepthnineteen\ } \newcommand*{\LWRPrintStack}{ @@ -22490,6 +22640,7 @@ end -- not --version % \changes{v0.73}{2019/06/23}{Fix: \env{quote}, \env{quotation} inside a span.} % \changes{v0.84}{2020/04/22}{Nullified \env{minipage}, \cs{parbox} inside a span.} % \changes{v0.84}{2020/04/22}{Issue warnings inside a span.} +% \changes{v0.896}{2021/03/05}{Issue \env{BlockClassWP} warning inside a span.} % % \begin{macrocode} \newcommand*{\LWR@nestspanitem}{% @@ -22518,6 +22669,9 @@ end -- not --version \RenewDocumentEnvironment{BlockClass}{o m}% {\LWR@spanwarnformat{multi-paragraph object}}% {}% + \RenewDocumentEnvironment{LWR@BlockClassWP}{m m D(){} m}% + {\LWR@spanwarnformat{multi-paragraph object}}% + {}% \renewcommand{\BlockClassSingle}[2]{% {\LWR@spanwarnformat{multi-paragraph object}}% ##2% @@ -22566,20 +22720,23 @@ end -- not --version % \end{macro} -% \begin{macro}{\LWR@htmlspanclass} \oarg{style} \marg{class} \marg{text} +% \begin{macro}{\LWR@htmlspanclass} +% \oarg{style} \parg{\ARIA\ role} \marg{class} \marg{text} % % \changes{v0.34}{2017/08/02}{Moved optional argument in front of mandatory.} -% +% \changes{v0.896}{2021/03/05}{Added \ARIA\ role.} % \begin{macrocode} -\NewDocumentCommand{\LWR@htmlspanclass}{o m +m}{% -\LWR@traceinfo{LWR@htmlspanclass |#1|#2|}% -\LWR@ensuredoingapar% -\LWR@subhtmlelementclass{span}[#1]{#2}% -\begin{LWR@nestspan}% -#3% -\LWR@htmltagc{/span}% -\LWR@traceinfo{LWR@htmlspanclass done}% -\end{LWR@nestspan}% +\NewDocumentCommand{\LWR@htmlspanclass}{o D(){} m +m}{% + \LWR@traceinfo{LWR@htmlspanclass |#1|#2|#3|}% + \LWR@ensuredoingapar% + \ifblank{#2}% + {\LWR@subhtmlelementclass{span}[#1]{#3}}% + {\LWR@subhtmlelementclass{span}[#1](#2){#3}}% + \begin{LWR@nestspan}% + #4% + \LWR@htmltagc{/span}% + \LWR@traceinfo{LWR@htmlspanclass done}% + \end{LWR@nestspan}% } % \end{macrocode} % \end{macro} @@ -22676,7 +22833,8 @@ end -- not --version % \subsection{Div class and element class} -% \begin{macro}{\LWR@subhtmlelementclass} \marg{element} \oarg{style} \marg{class} +% \begin{macro}{\LWR@subhtmlelementclass} +% \marg{element} \oarg{style} \parg{\ARIA\ role} \marg{class} % % Factored and reused in several places. % @@ -22690,21 +22848,24 @@ end -- not --version % \changes{v0.63}{2018/11/24}{Fix for \pkg{xeCJK}.} % \changes{v0.66}{2019/02/02}{Improved \HTML\ formatting.} % \changes{v0.892}{2020/10/03}{Ignore empty class.} +% \changes{v0.896}{2021/03/05}{Added \ARIA\ role.} % % \begin{macrocode} -\NewDocumentCommand{\LWR@subhtmlelementclass}{m O{} m}{% -\LWR@traceinfo{LWR@subhtmlelementclass !#1!#2!#3!}% +\NewDocumentCommand{\LWR@subhtmlelementclass}{m O{} D(){} m}{% +\LWR@traceinfo{LWR@subhtmlelementclass !#1!#2!#3!#4!}% \ifblank{#2}% {% empty style \LWR@htmltag{% #1% - \ifblank{#3}{}{ class=\textquotedbl#3\textquotedbl\ }% spaces + \ifblank{#3}{}{ role=\textquotedbl#3\textquotedbl}% spaces + \ifblank{#4}{}{ class=\textquotedbl#4\textquotedbl}% spaces }% }% {% non-empty style \LWR@htmltag{% #1\LWR@indentHTML% - \ifblank{#3}{}{class=\textquotedbl#3\textquotedbl\LWR@indentHTML}% + \ifblank{#3}{}{role=\textquotedbl#3\textquotedbl\LWR@indentHTML}% + \ifblank{#4}{}{class=\textquotedbl#4\textquotedbl\LWR@indentHTML}% style=\textquotedbl#2\textquotedbl\LWR@orignewline% }% }% @@ -22714,17 +22875,20 @@ end -- not --version % \end{macro} -% \begin{macro}{\LWR@htmlelementclass} \marg{element} \marg{class} \oarg{style} +% \begin{macro}{\LWR@htmlelementclass} \marg{element} \oarg{style} \marg{class} % % \changes{v0.20}{2017/01/17}{Added optional style.} % \changes{v0.34}{2017/08/02}{Moved optional argument in front of mandatory.} % \changes{v0.73}{2019/06/26}{Vertical space.} +% \changes{v0.896}{2021/03/05}{Added \ARIA\ role.} % \begin{macrocode} -\NewDocumentCommand{\LWR@htmlelementclass}{m o m}{% -\LWR@stoppars% -\LWR@forceemptyline% -\LWR@subhtmlelementclass{#1}[#2]{#3}% -\LWR@startpars% +\NewDocumentCommand{\LWR@htmlelementclass}{m o D(){} m}{% + \LWR@stoppars% + \LWR@forceemptyline% + \ifblank{#3}% + {\LWR@subhtmlelementclass{#1}[#2]{#4}}% + {\LWR@subhtmlelementclass{#1}[#2](#3){#4}}% + \LWR@startpars% } % \end{macrocode} % \end{macro} @@ -22733,24 +22897,27 @@ end -- not --version % \begin{macro}{\LWR@htmlelementclassend} \marg{element} \marg{class} % \begin{macrocode} \newcommand*{\LWR@htmlelementclassend}[2]{% -\LWR@stoppars% -\LWR@htmltag{/#1}% -\ifbool{HTMLDebugComments}{% - \LWR@htmlcomment{End of #1 ``#2''}% -}{}% -\LWR@startpars% + \LWR@stoppars% + \LWR@htmltag{/#1}% + \ifbool{HTMLDebugComments}{% + \LWR@htmlcomment{End of #1 ``#2''}% + }{}% + \LWR@startpars% } % \end{macrocode} % \end{macro} -% \begin{macro}{\LWR@htmldivclass} \oarg{style} \marg{class} +% \begin{macro}{\LWR@htmldivclass} \oarg{style} \parg{\ARIA\ role} \marg{class} % % \changes{v0.20}{2017/01/17}{Added optional style.} % \changes{v0.34}{2017/08/02}{Moved optional argument in front of mandatory.} +% \changes{v0.896}{2021/03/05}{Added \ARIA\ role.} % % \begin{macrocode} -\NewDocumentCommand{\LWR@htmldivclass}{o m}{% -\LWR@htmlelementclass{div}[#1]{#2}% +\NewDocumentCommand{\LWR@htmldivclass}{o D(){} m}{% + \ifblank{#2} + {\LWR@htmlelementclass{div}[#1]{#3}}% + {\LWR@htmlelementclass{div}[#1](#2){#3}}% } % \end{macrocode} % \end{macro} @@ -22758,7 +22925,7 @@ end -- not --version % \begin{macro}{\LWR@htmldivclassend} \marg{class} % \begin{macrocode} \newcommand*{\LWR@htmldivclassend}[1]{% -\LWR@htmlelementclassend{div}{#1}% + \LWR@htmlelementclassend{div}{#1}% } % \end{macrocode} % \end{macro} @@ -22825,7 +22992,7 @@ end -- not --version % For other direct-formatting commands, see \cref{sec:directformatting}. % % -% \begin{environment}{BlockClass} \oarg{style} \marg{class} \quad +% \begin{environment}{BlockClass} \oarg{style} \parg{\ARIA\ role} \marg{class} \quad % High-level interface for \element{div} classes. % % \qquad Ex: |\begin{BlockClass}{class}| text |\end{BlockClass}| @@ -22834,11 +23001,12 @@ end -- not --version % \changes{v0.20}{2017/01/17}{Added optional style.} % \changes{v0.34}{2017/08/02}{Moved optional argument in front of mandatory.} % \changes{v0.57}{2018/05/28}{Improved print/\HTML\ output selection.} +% \changes{v0.896}{2021/03/05}{Added \ARIA\ role.} % % \codeprint % \begin{macrocode} \begin{warpprint} -\NewDocumentEnvironment{BlockClass}{o m}{}{}% +\NewDocumentEnvironment{BlockClass}{o D(){} m}{}{} \end{warpprint} % \end{macrocode} % \end{environment} @@ -22847,11 +23015,11 @@ end -- not --version % \begin{macrocode} \begin{warpHTML} -\NewDocumentEnvironment{LWR@print@BlockClass}{o m}{}{}% +\NewDocumentEnvironment{LWR@print@BlockClass}{o D(){} m}{}{}% -\NewDocumentEnvironment{LWR@HTML@BlockClass}{o m}% - {\LWR@htmldivclass[#1]{#2}} - {\LWR@htmldivclassend{#2}} +\NewDocumentEnvironment{LWR@HTML@BlockClass}{o D(){} m}% + {\LWR@htmldivclass[#1](#2){#3}}% + {\LWR@htmldivclassend{#3}} \LWR@formattedenv{BlockClass} \end{warpHTML} @@ -22914,11 +23082,15 @@ end -- not --version \NewDocumentCommand{\LWR@print@InlineClass}{D{(}{)}{} o m +m}{#4}% \NewDocumentCommand{\LWR@HTML@InlineClass}{D{(}{)}{} o m +m}{% +\LWR@traceinfo{LWR@HTML@InlineClass #3}% \ifbool{FormatWP}{% + \LWR@traceinfo{LWR@HTML@InlineClass: FormatWP}% \LWR@htmlspanclass[#1]{#3}{#4}% }{% + \LWR@traceinfo{LWR@HTML@InlineClass: not FormatWP}% \LWR@htmlspanclass[#2]{#3}{#4}% }% +\LWR@traceinfo{LWR@HTML@InlineClass: done}% } \LWR@formatted{InlineClass} @@ -22926,7 +23098,8 @@ end -- not --version % \end{macrocode} -% \begin{environment}{LWR@BlockClassWP} \marg{WPstyle} \marg{HTMLstyle} \marg{class} \quad +% \begin{environment}{LWR@BlockClassWP} +% \marg{WPstyle} \marg{HTMLstyle} \parg{\ARIA\ role} \marg{class} \quad % Low-level interface for \element{div} classes with an automatic float ID. % These are often used when |\ifbool{FormatWP}|. % @@ -22937,11 +23110,12 @@ end -- not --version % \changes{v0.47}{2018/01/26}{Fix: Line wrap at \HTML\ hyphen.} % \changes{v0.57}{2018/05/28}{Improved print/\HTML\ output selection.} % \changes{v0.63}{2018/11/24}{Fix for \pkg{xeCJK}.} +% \changes{v0.896}{2021/03/05}{Added \ARIA\ role.} % % \codeprint % \begin{macrocode} \begin{warpprint} -\NewDocumentEnvironment{LWR@BlockClassWP}{m m m}{}{}% +\NewDocumentEnvironment{LWR@BlockClassWP}{m m D(){} m}{}{} \end{warpprint} % \end{macrocode} % \end{environment} @@ -22949,8 +23123,9 @@ end -- not --version % \codehtml % \begin{macrocode} \begin{warpHTML} -\NewDocumentEnvironment{LWR@print@LWR@BlockClassWP}{m m m}{}{}% -\NewDocumentEnvironment{LWR@HTML@LWR@BlockClassWP}{m m m}% +\NewDocumentEnvironment{LWR@print@LWR@BlockClassWP}{m m D(){} m}{}{}% + +\NewDocumentEnvironment{LWR@HTML@LWR@BlockClassWP}{m m D(){} m}% {% \LWR@stoppars% \ifbool{FormatWP}% @@ -22960,22 +23135,24 @@ end -- not --version % \changes{v0.65}{2018/12/21}{Fix space between class and id.} % \begin{macrocode} \LWR@htmltag{% - div class=\textquotedbl#3\textquotedbl\ % space + div class=\textquotedbl#4\textquotedbl\ % space id=\textquotedbl% \LWR@print@mbox{autoidWP-\arabic{LWR@thisautoidWP}}% \textquotedbl% + \ifblank{#3}{}{ role=\textquotedbl#3\textquotedbl}% \ifblank{#1}{}{ style=\textquotedbl#1\textquotedbl}% }% }% FormatWP {% not FormatWP \LWR@htmltag{% - div class=\textquotedbl#3\textquotedbl% + div class=\textquotedbl#4\textquotedbl% + \ifblank{#3}{}{ role=\textquotedbl#3\textquotedbl}% \ifblank{#2}{}{ style=\textquotedbl#2\textquotedbl}% }% }% not FormatWP \LWR@startpars% } -{\LWR@htmldivclassend{#3}} +{\LWR@htmldivclassend{#4}} \LWR@formattedenv{LWR@BlockClassWP} \end{warpHTML} @@ -23866,14 +24043,30 @@ end -- not --version % \changes{v0.36}{2017/08/15}{Extra \protect\HTML\ source space after paragraphs.} % \changes{v0.36}{2017/08/16}{Force \protect\HTML\ superscripts.} % \changes{v0.68}{2019/03/04}{Factored for multiple foot boxes.} +% \changes{v0.896}{2021/04/04}{Fix: \ctr{autopage} references in footnotes.} % % \begin{macrocode} \long\def\LWR@@footnotetext#1#2{% \LWR@traceinfo{LWR@footnotetext}% -\global\setbox\csname #2\endcsname=\vbox{% % \end{macrocode} -% Add to any current footnotes: +% +% Perhaps generate an autopage in the text to link a citation backreference +% closer to its usage. +% \begin{macrocode} +\LWR@newautopagelabel{page}% +% \end{macrocode} +% +% Locally disable auto page labels inside the footnote text. +% Footnotes are accumulated in the current page before finally being placed +% in a potentially later page, so the aotopages would be incorrect. +% \begin{macrocode} +\begingroup% +\let\LWR@newautopagelabel\LWR@null@newautopagelabel% +% \end{macrocode} +% +% Take the existing footnote box and add the new content: % \begin{macrocode} +\global\setbox\csname #2\endcsname=\vbox{% \unvbox\csname #2\endcsname% % \end{macrocode} % Remember the footnote number for \cs{ref}: @@ -23929,6 +24122,7 @@ end -- not --version % \begin{macrocode} \color@endgroup% }% vbox +\endgroup% % \end{macrocode} % Paragraph handling: % \changes{v0.52}{2018/03/28}{Fix: Paragraph handling.} @@ -23940,7 +24134,7 @@ end -- not --version % \begin{macro}{\LWR@footnotetext} \marg{text} % \begin{macrocode} -\long\def\LWR@footnotetext#1{\LWR@@footnotetext{#1}{LWR@footnotebox}} +\long\def\LWR@footnotetext#1{\LWR@@footnotetext{#1}{LWR@footnotebox}}% % \end{macrocode} % \end{macro} % @@ -24034,11 +24228,20 @@ end -- not --version % % % \begin{macro}{\LWR@@printpendingfootnotes} \marg{footnote counter name} +% \changes{v0.896}{2021/03/05}{Added \ARIA\ role.} +% \changes{v0.896}{2021/03/26}{Fix: Backref to footnote.} % \begin{macrocode} \newcommand*{\LWR@@printpendingfootnotes}[1]{% \expandafter\ifvoid\csname LWR@#1box\endcsname\else \LWR@forcenewpage - \begin{BlockClass}{footnotes} + \begin{BlockClass}(note){footnotes}% +% \end{macrocode} +% +% Create a new autopage in case citation back references occur inside the footnotes: +% \begin{macrocode} + \LWR@newautopagelabel{page}% +% \end{macrocode} +% \begin{macrocode} \null \unvbox\csuse{LWR@#1box} \setbox\csuse{LWR@#1box}=\vbox{} @@ -24085,11 +24288,12 @@ end -- not --version % \begin{macro}{\LWR@printpendingmpfootnotes} % Enclose the minipage footnotes in a class, print, then clear. % \changes{v0.45}{2018/01/10}{Added.} +% \changes{v0.896}{2021/03/05}{Added \ARIA\ role.} % \begin{macrocode} \newcommand*{\LWR@printpendingmpfootnotes}{% \ifvoid\LWR@mpfootnotes\else \LWR@forcenewpage - \begin{BlockClass}{footnotes} + \begin{BlockClass}(note){footnotes}% \null \unvbox\LWR@mpfootnotes \setbox\LWR@mpfootnotes=\vbox{} @@ -24122,17 +24326,17 @@ end -- not --version % % \changes{v0.21}{2017/02/11}{Fixed source listing.} % \changes{v0.42}{2017/10/26}{If \progcode{FormatWP} emulate a wrapfig.} -% +% \changes{v0.896}{2021/03/05}{Added \ARIA\ role.} % \begin{macrocode} \renewcommand{\marginpar}[2][]{% \ifbool{FormatWP}% {% -\begin{LWR@BlockClassWP}{width:2in; float:right; margin:10pt}{}{marginblock} +\begin{LWR@BlockClassWP}{width:2in; float:right; margin:10pt}{}(note){marginblock}% #2 -\end{LWR@BlockClassWP} +\end{LWR@BlockClassWP}% }% {% - \LWR@htmlspanclass{marginpar}{#2}% + \LWR@htmlspanclass(note){marginpar}{#2}% }% } % \end{macrocode} @@ -24149,17 +24353,17 @@ end -- not --version % \changes{v0.42}{2017/10/26}{If \progcode{FormatWP} emulate a wrapfig.} % \changes{v0.44}{2017/11/10}{Added.} % \changes{v0.73}{2019/06/25}{Fix: Paragraph tags.} -% +% \changes{v0.896}{2021/03/05}{Added \ARIA\ role.} % \begin{macrocode} \newcommand{\marginparBlock}[2][]{% \LWR@stoppars% \ifbool{FormatWP}% {% - \begin{LWR@BlockClassWP}{width:2in; float:right; margin:10pt}{}{marginblock} + \begin{LWR@BlockClassWP}{width:2in; float:right; margin:10pt}{}(note){marginblock}% #2 \end{LWR@BlockClassWP} }{% - \begin{BlockClass}[width:2in; float:right; margin:10pt]{marginparblock} + \begin{BlockClass}[width:2in; float:right; margin:10pt](note){marginparblock}% #2 \end{BlockClass} }% @@ -24213,6 +24417,122 @@ end -- not --version +% \section{Tracking internal cross references} +% +% Cross references are generated using the \PDF\ file's page number during +% \LaTeX\ compilation. +% Internal labels are generated which include these page numbers in the label. +% +% +% \DescribeFile{*_html.aux} +% A new entry in the \filenm{*_html.aux} file is used to help +% cross-references: +% \begin{sourceverb} +% \newlabel{autopage-}{{}{}} +% \end{sourceverb} +% +% +% \DescribeCounter{LWR@currentautosecpage} Records the page number when the section +% was created. (If a math expression is included in the section name, +% and \SVG\ math is used, the corresponding \env{lateximage} will cause the +% page number to change by the time the following autosec label is created, +% thus the initial page number is recorded here.) +% \ctr{LWR@currentautosecfloatpage} is updated +% more often than \ctr{LWR@currentautosecpage}. +% \changes{v0.43}{2017/11/01}{\ctr{LWR@currentautosecpage}: Added.} +% \changes{v0.66}{2019/01/28}{\ctr{LWR@currentautosecpage}: Fix for \LOF, \LOT float in home page.} +% \begin{macrocode} +\newcounter{LWR@currentautosecpage} +\setcounter{LWR@currentautosecpage}{1} +% \end{macrocode} +% +% +% \DescribeCounter{LWR@currentautosecfloatpage} +% The \HTML\ output's \PDF\ page number at the start of a new \HTML\ file, section, +% or float. +% Updated more often than \ctr{LWR@currentautosecpage}, such as when a new float occurs. +% Used only for table of contents, list of figures, list of tables, +% but not for general cross references such as \cs{label}, citation backlinks, etc. +% +% \cs{LWRsetnextfloat} is written with this and the |autoid| +% by the modified \cs{addcontentsline} just before each float's entry. +% \begin{macrocode} +\newcounter{LWR@currentautosecfloatpage} +\setcounter{LWR@currentautosecfloatpage}{1} +% \end{macrocode} +% +% +% \DescribeCounter{LWR@previousautopagelabel} Remembers which autopage label +% was most recently generated. Used to avoid duplicates. +% \begin{macrocode} +\newcounter{LWR@previousautopagelabel} +\setcounter{LWR@previousautopagelabel}{-1} +% \end{macrocode} +% +% +% \begin{macro}{\LWR@newautopagelabel} \marg{pagenumber counter} +% \changes{v0.48}{2018/02/11}{Fix: \TOC, \LOF, \LOT\ links.} +% \changes{v0.72}{2019/06/05}{Fix: References for \pkg{xr}, \pkg{xr-hyper}.} +% \changes{v0.896}{2021/03/26}{Fix: Refs if page changed.} +% +% \cs{BaseJobname} is added to the label in case \pkg{xr} or \pkg{xr-hyper} are used. +% \begin{macrocode} +\newcommand*{\LWR@newautopagelabel}[1]{% +% \end{macrocode} +% +% No action if this autopage label has already been defined: +% \begin{macrocode} +\ifnumequal{\value{LWR@previousautopagelabel}}{\value{page}}% + {}% +% \end{macrocode} +% +% If the \PDF\ page has changed, create a label using the desired counter. +% +% If the counter is \ctr{LWR@currentautosecpage}, that was the page number +% when the section generation began, +% but the current \PDF\ page may be different by now +% if the section name had an \SVG\ image, such as \SVG\ math. +% To allow the cross-reference to point just after the section heading, the +% label must be made after the section heading is complete, which may have +% generated a new \PDF\ page. +% Thus, the label is made with the given counter, which may be the \PDF\ page +% number where the section heading began, +% then if the \PDF\ page number has changed, +% another label is made for the current page number. +% \begin{macrocode} + {% + \label{\BaseJobname-autopage-\csuse{the#1}}% +% \end{macrocode} +% +% If there are intervening pages, such as an \SVG\ image, +% define another label for the new page: +% \begin{macrocode} + \ifnumequal{\value{#1}}{\value{page}}% + {}% + {\label{\BaseJobname-autopage-\csuse{thepage}}}% +% \end{macrocode} +% +% Remember the latest autopage label: +% \begin{macrocode} + \setcounter{LWR@previousautopagelabel}{\value{page}}% + }% +} +% \end{macrocode} +% \end{macro} + +% \begin{macro}{\LWR@null@newautopagelabel} \marg{pagenumber counter} +% \changes{v0.896}{2021/04/04}{Fix: Refs in footnotes.} +% +% Inside a footnote, the page numbers will be incorrect, +% so this is nullified. +% \begin{macrocode} +\newcommand*{\LWR@null@newautopagelabel}[1]{} +% \end{macrocode} +% \end{macro} + + + + % \section{Splitting \HTML\ files} % % \begin{itemize} @@ -24559,40 +24879,6 @@ end -- not --version % \end{macro} -% \DescribeCounter{LWR@previousautopagelabel} Remembers which autopage label -% was most recently generated. Used to avoid duplicates. -% \begin{macrocode} -\newcounter{LWR@previousautopagelabel} -\setcounter{LWR@previousautopagelabel}{-1} -% \end{macrocode} - - -% \DescribeFile{*_html.aux} -% A new entry in the \filenm{*_html.aux} file is used to help -% cross-references: -% \begin{sourceverb} -% \newlabel{autopage-}{{}{}} -% \end{sourceverb} -% -% \begin{macro}{\LWR@newautopagelabel} \marg{pagenumber counter} -% \changes{v0.48}{2018/02/11}{Fix: \TOC, \LOF, \LOT\ links.} -% \changes{v0.72}{2019/06/05}{Fix: References for \pkg{xr}, \pkg{xr-hyper}.} -% -% \cs{BaseJobname} is added to the label in case \pkg{xr} or \pkg{xr-hyper} are used. -% \begin{macrocode} -\newcommand*{\LWR@newautopagelabel}[1]{% -\ifnumequal{\value{LWR@previousautopagelabel}}{\value{page}}% -{}% no action if this autopage label has already been defined -{% - \label{\BaseJobname-autopage-\arabic{#1}}% - \setcounter{LWR@previousautopagelabel}{\value{page}} -}% -} -% \end{macrocode} -% \end{macro} - - - % \subsection{Sanitizing expressions for \HTML} % Math expressions are converted to |lateximage|s, @@ -25119,9 +25405,10 @@ end -- not --version % At the bottom of the ending file: % % \changes{v0.65}{2018/12/18}{Improved \CSS\ for page layout.} +% \changes{v0.896}{2021/03/04}{Added \element{main}.} % \begin{macrocode} \LWR@htmlelementclassend{section}{textbody} -\LWR@htmlelementclassend{div}{bodycontainer} +\LWR@htmlelementclassend{main}{bodycontainer} \LWR@htmlelementclassend{div}{bodyandsidetoc} \LWR@printpendingfootnotes @@ -25250,11 +25537,12 @@ end -- not --version % \end{macrocode} % -% Track the \PDF\ page numbers of the \HTML\ output: +% Track the \PDF\ page numbers of the \HTML\ output. +% This is updated more frequently than \ctr{LWR@currentautosecpage}. % \changes{v0.48}{2018/02/11}{Fix: \TOC, \LOF, \LOT\ links.} % \begin{macrocode} -\setcounter{LWR@latestautopage}{\value{page}}% -\LWR@newautopagelabel{LWR@latestautopage}% +\setcounter{LWR@currentautosecfloatpage}{\value{page}}% +\LWR@newautopagelabel{LWR@currentautosecfloatpage}% % \end{macrocode} % % @@ -25305,8 +25593,9 @@ end -- not --version % Start of the \element{textbody}: % \changes{v0.65}{2018/12/18}{Improved \CSS\ for page layout.} % \changes{v0.84}{2020/04/24}{Added prev/next links.} +% \changes{v0.896}{2021/03/04}{Added \element{main}.} % \begin{macrocode} -\LWR@htmlelementclass{div}{bodycontainer} +\LWR@htmlelementclass{main}{bodycontainer} \LWR@htmlelementclass{section}{textbody} % \end{macrocode} % @@ -25664,20 +25953,6 @@ end -- not --version % \end{macro} % % -% \DescribeCounter{LWR@currentautosec} Records the page number when the section -% was created. (If a math expression is included in the section name, -% and \SVG\ math is used, the corresponding \env{lateximage} will cause the -% page number to change by the time the following autosec label is created, -% thus the initial page number is recorded here.) -% \changes{v0.43}{2017/11/01}{\ctr{LWR@currentautosec}: Added.} -% \changes{v0.66}{2019/01/28}{\ctr{LWR@currentautosec}: Fix for \LOF, \LOT float in home page.} -% \begin{macrocode} -\newcounter{LWR@currentautosec} -\setcounter{LWR@currentautosec}{1} -% \end{macrocode} -% -% -% % \begin{macro}{\LWR@section} * \oarg{TOC name} \marg{name} \marg{sectiontype} % % \changes{v0.20}{2017/01/09}{Combined higher-level sections together into files.} @@ -25819,7 +26094,7 @@ end -- not --version % \end{macrocode} % \changes{v0.43}{2017/11/01}{Fix: Math in section name.} % \begin{macrocode} -\setcounter{LWR@currentautosec}{\value{page}}% +\setcounter{LWR@currentautosecpage}{\value{page}}% % \end{macrocode} % % Check if starred: @@ -25960,6 +26235,12 @@ end -- not --version % Generate a \LaTeX{} label. % % Track the \PDF\ page numbers of the \HTML\ output. +% A new autopage label may be generated for \ctr{LWR@currentautosecpage} +% for the start of the section, +% and also for the current page if it is different due to an \SVG\ image +% in the section name. +% Also, the final page after the section has been created is updated +% in \ctr{LWR@currentautosecfloatpage}. % % \changes{v0.43}{2017/11/01}{Fix: Math in section name.} % \changes{v0.48}{2018/02/11}{Fix: \TOC, \LOF, \LOT\ links.} @@ -25967,8 +26248,8 @@ end -- not --version % \changes{v0.66}{2019/02/02}{Improved \HTML\ formatting.} % \begin{macrocode} \LWR@traceinfo{LWR@section: about to create the LaTeX label}% -\setcounter{LWR@latestautopage}{\value{page}}% -\LWR@newautopagelabel{LWR@currentautosec}\LWR@orignewline% +\setcounter{LWR@currentautosecfloatpage}{\value{page}}% +\LWR@newautopagelabel{LWR@currentautosecpage}\LWR@orignewline% % \end{macrocode} % % If this is the first section found in this file, @@ -26665,9 +26946,10 @@ end -- not --version }% % \end{macrocode} % \changes{v0.65}{2018/12/18}{Improved \CSS\ for page layout.} +% \changes{v0.896}{2021/03/04}{Added \element{main}.} % \begin{macrocode} \LWR@htmlelementclass{div}{bodywithoutsidetoc} -\LWR@htmlelementclass{div}{bodycontainer} +\LWR@htmlelementclass{main}{bodycontainer} \LWR@traceinfo{LWR@lwarpStart: Generating textbody.} \LWR@htmlelementclass{section}{textbody} % \end{macrocode} @@ -26732,11 +27014,17 @@ end -- not --version % ^^A % \end{macrocode} % % -% First autopage label in case a figure occurs early. +% First autopage label in case a figure occurs early before the first section: +% A new autopage label may be generated for \ctr{LWR@currentautosecpage} +% for the start of the section, +% and also for the current page if it is different due to an \SVG\ image +% in the section name. +% Also, the final page after the section has been created is updated +% in \ctr{LWR@currentautosecfloatpage}. % \changes{v0.66}{2019/01/28}{Fix: \TOC, \LOF, \LOT\ links.} % \begin{macrocode} -\setcounter{LWR@latestautopage}{\value{page}}% -\LWR@newautopagelabel{LWR@currentautosec}% +\setcounter{LWR@currentautosecfloatpage}{\value{page}}% +\LWR@newautopagelabel{LWR@currentautosecpage}% % \end{macrocode} % % \begin{macrocode} @@ -26790,20 +27078,23 @@ end -- not --version \LWR@closeprevious{finished} % \end{macrocode} % At the bottom of the ending file: - +% +% Print any pending footnotes: +% \changes{v0.896}{2021/03/14}{Fix: Footnotes at end of document.} +% \begin{macrocode} +\LWR@printpendingfootnotes +% \end{macrocode} +% % Close the textbody: % \changes{v0.65}{2018/12/18}{Improved \CSS\ for page layout.} % \changes{v0.84}{2020/04/24}{Added prev/next links.} +% \changes{v0.896}{2021/03/04}{Added \element{main}.} % \begin{macrocode} \label{\BaseJobname-autofile-last} \LWR@htmlelementclassend{section}{textbody} -\LWR@htmlelementclassend{div}{bodycontainer} +\LWR@htmlelementclassend{main}{bodycontainer} \LWR@htmlelementclassend{div}{bodyandsidetoc} % \end{macrocode} -% Print any pending footnotes: -% \begin{macrocode} -\LWR@printpendingfootnotes -% \end{macrocode} % % Create the footer if not \EPUB\: % \changes{v0.84}{2020/04/24}{Fix: No footer for \EPUB} @@ -27360,7 +27651,9 @@ end -- not --version % % \begin{macrocode} \LWR@setfootnoteseries% -\def\@makefnmark{\textsuperscript{\thefootnote}} +\def\@makefnmark{% + \textsuperscript{\thefootnote}% +} % \end{macrocode} % % \begin{center} @@ -28107,6 +28400,12 @@ end -- not --version % \begin{macrocode} \renewcommand{\@begintheorem}[2]{% \LWR@forcenewpage +% \end{macrocode} +% \changes{v0.896}{2021/03/14}{Intersperse footnotes.} +% \begin{macrocode} + \LWR@printpendingfootnotes% lwarp +% \end{macrocode} +% \begin{macrocode} \BlockClass{theoremcontents} \trivlist \item[\InlineClass{theoremlabel}{#1\ #2\ }]\itshape @@ -28137,6 +28436,12 @@ end -- not --version % \begin{macrocode} \renewcommand*{\@endtheorem}{% \endtrivlist +% \end{macrocode} +% \changes{v0.896}{2021/03/14}{Intersperse footnotes.} +% \begin{macrocode} + \LWR@printpendingfootnotes% lwarp +% \end{macrocode} +% \begin{macrocode} \endBlockClass% theoremcontents } % \end{macrocode} @@ -28260,7 +28565,7 @@ end -- not --version % \changes{v0.48}{2018/02/02}{Honors \cs{makelabel}.} % \begin{macrocode} \def\LWR@HTML@item[#1]{% -\LWR@traceinfo{@item} +\LWR@traceinfo{@item}% \if@noparitem \@donoparitem \else @@ -28517,12 +28822,55 @@ end -- not --version % \end{macro} % \begin{environment}{description} \oarg{options} +% +% Footnotes are modified to correctly parse optional arguments. +% \changes{v0.896}{2021/03/14}{Fix: Footnotes inside \env{description} label.} % \begin{macrocode} \newcommand*{\LWR@descriptionstart}{% -\renewcommand*{\LWR@printcloselist}{\LWR@printclosedescription} -\renewcommand*{\LWR@printopenlist}{dl} -\let\item\LWR@descitem% -\LWR@nulllistfills% + \renewcommand*{\LWR@printcloselist}{\LWR@printclosedescription} + \renewcommand*{\LWR@printopenlist}{dl} + \let\item\LWR@descitem% + \LWR@nulllistfills% +% \end{macrocode} +% +% Footnotes are redefined to process optional arguments inside the \env{description} +% label. +% A \cs{footnote} is dropped, as it is in print mode. +% Using the optional arguments does not work in print mode, +% but for some reason they must be accepted as done here to work correctly +% even without the optional arguments. +% \begin{macrocode} + \renewcommand{\footnote}[2][]{% + \ifblank{##1}% + {% + \stepcounter\@mpfn + \protected@xdef\@thefnmark{\thempfn}% + \@footnotemark%\@footnotetext + }% + {% + \begingroup + \csname c@\@mpfn\endcsname ##1\relax + \unrestored@protected@xdef\@thefnmark{\thempfn}% + \endgroup + \@footnotemark%\@footnotetext + }% + }% + % + \renewcommand{\footnotemark}[1][]{% + \ifblank{##1}% + {% + \stepcounter{footnote}% + \protected@xdef\@thefnmark{\thefootnote}% + \@footnotemark% + }% + {% + \begingroup% + \c@footnote ##1\relax% + \unrestored@protected@xdef\@thefnmark{\thefootnote}% + \endgroup% + \@footnotemark% + }% + }% } % \end{macrocode} % \end{environment} @@ -29416,7 +29764,8 @@ end -- not --version \LWR@setexparray{LWR@colatspec}% {\arabic{LWR@tabletotalLaTeXcols}}% {\expandafter\@firstofone\LWR@colparameter}% - \LWR@traceinfo{at \arabic{LWR@tabletotalLaTeXcols}: % + \LWR@traceinfo{at \arabic{LWR@tabletotalLaTeXcols}% + : % space \LWR@getexparray{LWR@colatspec}{\arabic{LWR@tabletotalLaTeXcols}}}% }% \let\LWR@colparameter\relax% @@ -32690,7 +33039,8 @@ end -- not --version % \item [\cs{newlabel}:] Unchanged. When the |.aux| file is read, sets \cs{r@