summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/lwarp/lwarp.dtx
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2022-06-25 03:01:31 +0000
committerNorbert Preining <norbert@preining.info>2022-06-25 03:01:31 +0000
commit7539b7b5d1fc836a31110d086fb5b9783033f327 (patch)
treec0d694d1c3a605112ee319ed0f9e6697c33798bc /macros/latex/contrib/lwarp/lwarp.dtx
parent1ef4c041ba74d4619dd62209ae48a2b24563954c (diff)
CTAN sync 202206250301
Diffstat (limited to 'macros/latex/contrib/lwarp/lwarp.dtx')
-rw-r--r--macros/latex/contrib/lwarp/lwarp.dtx440
1 files changed, 305 insertions, 135 deletions
diff --git a/macros/latex/contrib/lwarp/lwarp.dtx b/macros/latex/contrib/lwarp/lwarp.dtx
index c812a89da0..87eb2b4f55 100644
--- a/macros/latex/contrib/lwarp/lwarp.dtx
+++ b/macros/latex/contrib/lwarp/lwarp.dtx
@@ -16,7 +16,7 @@
% \iffalse
%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
%<package>\ProvidesPackage{lwarp}
-%<package> [2022/03/22 v0.905 Allows LaTeX to directly produce HTML5 output.]
+%<package> [2022/06/23 v0.906 Allows LaTeX to directly produce HTML5 output.]
%
%<*driver>
\documentclass{ltxdoc}
@@ -1177,6 +1177,40 @@ which defaults to:
\subsubsection{Math in section names}
\limitsmathinsectionnames
+
+\subsubsection{Math in custom environments}
+
+\trouble[math in environments]{math>custom environments}
+\trouble{mathjax=\MathJax>custom environments}
+To create an environment which places its contents inside math, instead of:
+\begin{sourcedisplay}
+ \cs{newenvironment}\{mymathenv\}\{ \textgreen{\cs{(}} starting math\}\{ending math \textgreen{\cs{)}} \}
+\end{sourcedisplay}
+use:
+\begin{sourcedisplay}
+ \cs{NewDocumentEnvironment}\{mymathenv\}\{b\} \\
+ \fquad \{ \\
+ \fqquad \textred{\cs{inlinemathother}} \\
+ \fqquad \textgreen{\cs{(}} starting math \textred{\#1} ending math \textgreen{\cs{)}} \\
+ \fqquad \textred{\cs{inlinemathnormal}} \\
+ \fquad \} \\
+ \fquad \{\}
+\end{sourcedisplay}
+or:
+\begin{sourcedisplay}
+ \cs{usepackage}\{environ\} \\
+ \cs{NewEnviron}\{mymathenv\}\{ \\
+ \fquad \textred{\cs{inlinemathother}} \\
+ \fquad \textgreen{\cs{(}} starting math
+ \textred{\cs{BODY}}
+ ending math \textgreen{\cs{)}} \\
+ \fquad \textred{\cs{inlinemathnormal}} \\
+ \}
+\end{sourcedisplay}
+
+For display math, use \cs{[}, \cs{]}, \cs{displaymathother}, and \cs{displaymathnormal}.
+
+
\subsubsection{Rendering tradeoffs}
Math may be rendered
@@ -3246,7 +3280,7 @@ This boolean may be tested by the user for later use.
%<*package>
% \fi
%
-% \CheckSum{55580}
+% \CheckSum{55578}
%
% \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
@@ -3396,6 +3430,7 @@ This boolean may be tested by the user for later use.
% \changes{v0.904a}{2022/03/16}{\ 2022/03/16}
% \changes{v0.904a}{2022/03/16}{Fixed missing \pkg{common-mathjax-siunitx}.}
% \changes{v0.905}{2022/03/22}{\ 2022/03/22}
+% \changes{v0.906}{2022/06/23}{\ 2022/06/23}
@@ -3629,6 +3664,18 @@ This boolean may be tested by the user for later use.
% see the end of the Change History on page \pageref{sec:changesend}.
%
% \begin{description}
+% \item[v0.906:] Screen readers
+% \begin{itemize}
+% \item For each \env{tabular}, add a hidden \HTML\ header cell to
+% convince screen readers that the tables are data not layout.
+% Also hide from the screen reader any final row
+% used only to produce bottom borders.
+% \item Adjusted \SVG\ math for a margin change in \prog{pdfcrop}.
+% \item Added \cs{Ref}.
+% \item Added docs regarding math in custom environments.
+% See \cref{sec:limitsmath}.
+% \end{itemize}
+% \needspace{2\baselineskip}
% \item[v0.905:] Bug fixes, internal improvements.
% \begin{itemize}
% \item Fixed conflict between \pkg{cleveref} and \pkg{splitidx}.
@@ -8463,7 +8510,7 @@ This boolean may be tested by the user for later use.
% \trouble{HTML>settings>changed}
% it is best to first:
% \begin{enumerate}
-% \item Clear all the \HTML, \PDF, and auxiliary files: \userentry{lwarpmk clearall}
+% \item Clear all the \HTML, \PDF, and auxiliary files: \userentry{lwarpmk cleanall}
% \item Recompile the print version in order to recreate
% the configuration files for \prog{lwarpmk}: \userentry{lwarpmk print}
% \item Finally, recompile the \HTML\ version with the new settings: \userentry{lwarpmk html}
@@ -10745,7 +10792,8 @@ This boolean may be tested by the user for later use.
%
% \subsection{Math}
%
-% \changes{v0.42}{2017/10/30}{Docs: Reorganized math limitations}
+% \changes{v0.42}{2017/10/30}{Docs: Reorganized math limitations.}
+% \changes{v0.906}{2022/05/12}{Docs: Math in custom environments.}
% \label{sec:limitsmath}
%
% \limitsmath
@@ -17372,7 +17420,8 @@ This boolean may be tested by the user for later use.
% Remember original definitions of formatting commands.
% Will be changed to \HTML\ commands for most uses.
-% Will be temporarily restored to original meaning inside any lateximage environment.
+% Will be temporarily restored to original meaning inside any \env{lateximage} environment
+% and inside a \env{tabbing} environment.
% Also nullify unused commands.
%
% Some packages redefine \cs{\#}, which is used to generate \HTML, so the original must
@@ -17384,12 +17433,7 @@ This boolean may be tested by the user for later use.
% \end{macrocode}
% \begin{macrocode}
\let\LWR@origcomma\,
-\let\LWR@origthinspace\thinspace
-\let\LWR@orignegthinspace\negthinspace
\let\LWR@origtilde~
-\let\LWR@origenskip\enskip
-\let\LWR@origquad\quad
-\let\LWR@origqquad\qquad
\let\LWR@orighfil\hfil
\let\LWR@orighss\hss
\let\LWR@origllap\llap
@@ -17401,12 +17445,6 @@ This boolean may be tested by the user for later use.
\let\LWR@origmedskip\medskip
\let\LWR@origbigskip\bigskip
-
-\let\LWR@origtextellipsis\textellipsis
-% \end{macrocode}
-% \changes{v0.88}{2020/07/03}{Added \cs{vdots}.}
-% \begin{macrocode}
-\let\LWR@origvdots\vdots
% \end{macrocode}
%
% \pkg{libertinus-otf} has too much kerning for \cs{textquotedbl},
@@ -20596,6 +20634,7 @@ page_compositor "."
% \changes{v0.50}{2018/02/27}{\filenm{lwarp_one_limage.txt}: Added.}
% \changes{v0.51}{2018/03/16}{\filenm{lwarp_one_limage.txt}: \prog{pdftocairo} \optn{-noshrink} added.}
% \changes{v0.66}{2019/01/30}{\filenm{lwarp_one_limage.txt}: Image directory and prefix.}
+% \changes{v0.906}{2022/05/02}{\filenm{lwarp_one_limage.txt}: Added \prog{pdfcrop} \optn{margin}.}
%
% ^^A *lwarp_one_limage.txt
%
@@ -20608,7 +20647,8 @@ page_compositor "."
\LWR@ImagesDirectory\OSPathSymbol lateximagetemp-\LWRpercent\LWRpercent d.pdf%
}
\immediate\write\LWR@quickfile{%
- pdfcrop --hires \LWR@ImagesDirectory\OSPathSymbol lateximagetemp-\LWRpercent 1.pdf %
+ pdfcrop --hires --margin \"0 1 0 0\"
+ \LWR@ImagesDirectory\OSPathSymbol lateximagetemp-\LWRpercent 1.pdf %
\LWR@ImagesDirectory\OSPathSymbol\LWRpercent 3.pdf%
}
\immediate\write\LWR@quickfile{%
@@ -21005,6 +21045,7 @@ MathJax = {
% \changes{v0.89}{2020/08/29}{\prog{lwarpmk}: \optn{clean} also removes \filenm{*.bbl}}
% \changes{v0.899}{2021/05/30}{\prog{lwarpmk}: Warn if \pkg{lwarp} package not detected.}
% \changes{v0.903}{2021/11/30}{\prog{lwarpmk}: Error if \prog{pdftotext} not available.}
+% \changes{v0.906}{2022/05/02}{\prog{lwarpmk}: Added \prog{pdfcrop} \optn{margin}.}
%
% The following is only generated if the \optn{lwarpmk} option
% was given to \pkg{lwarp}.
@@ -21020,7 +21061,7 @@ MathJax = {
-- Copyright 2016-2022 Brian Dunn
-printversion = "v0.905"
+printversion = "v0.906"
requiredconfversion = "2" -- also at *lwarpmk.conf
function printhelp ()
@@ -21554,7 +21595,7 @@ executecheckerror (
imagesdirectory .. dirslash .."lateximagetemp-%d" .. ".pdf" ..
seqname ..
-- Crop the image:
- "pdfcrop --hires " .. imagesdirectory .. dirslash .. "lateximagetemp-" ..
+ "pdfcrop --hires --margin \"0 1 0 0\" " .. imagesdirectory .. dirslash .. "lateximagetemp-" ..
lwimgpage .. ".pdf " ..
imagesdirectory .. dirslash .. lwimgname .. ".pdf" ..
seqname ..
@@ -27050,11 +27091,18 @@ end -- not --version
% for HTMLDebug comments.}
% \changes{v0.903}{2021/12/28}{Add: Sectioning \HTML\ comment divider.}
% \changes{v0.903}{2021/12/28}{Fix: Nullfiy footnotes in \HTML\ comment.}
+% \changes{v0.906}{2022/06/21}{Improved \HTML\ comment divider.}
% \begin{macrocode}
\begingroup%
\LWR@nullfonts%
\LWR@nullifyfootnotes%
-\LWR@htmlcomment{................................}%
+\LWR@htmlcomment{%
+ \LWR@orignewline%
+ \IfValueTF{#2}%
+ {...... #4 #2 ......}%
+ {...... #4 #3 ......}%
+ \LWR@orignewline%
+}%
\LWR@orignewline%
\ifbool{HTMLDebugComments}%
{%
@@ -29311,7 +29359,7 @@ end -- not --version
% Do not produce \HTML\ tags for \cs{hspace} inside a verse |par|.
% Restore plain \LaTeX{} \cs{hspace} functionality:
% \begin{macrocode}
-\LWR@select@print@hspace%
+\let\hspace\LWR@print@hspace%
}
% \end{macrocode}
% \end{macro}
@@ -29414,18 +29462,19 @@ end -- not --version
% \changes{v0.58}{2018/06/07}{Improved print/\HTML\ output selection.}
% \changes{v0.84}{2020/04/17}{Restore spacing.}
% \changes{v0.903}{2021/12/20}{Converted to env.}
+% \changes{v0.906}{2022/06/10}{Used \cs{LWR@formatted} for more items.}
% \begin{macrocode}
\newenvironment*{LWR@HTML@tabbing}
{%
\LWR@forcenewpage%
\LWR@atbeginverbatim{tabbing}%
- \let\enskip\LWR@origenskip%
- \let\quad\LWR@origquad%
- \let\qquad\LWR@origqquad%
+ \let\enskip\LWR@print@enskip%
+ \let\quad\LWR@print@quad%
+ \let\qquad\LWR@print@qquad%
\let~\LWR@origtilde%
\let\,\LWR@origcomma%
- \let\thinspace\LWR@origthinspace%
- \let\negthinspace\LWR@orignegthinspace%
+ \let\thinspace\LWR@print@thinspace%
+ \let\negthinspace\LWR@print@negthinspace%
\LWR@print@tabbing%
}
{%
@@ -29887,7 +29936,7 @@ end -- not --version
\LWR@orig@desc@makelabel{#1}%
\LWR@htmltag{/dt}%
}
- \LWR@select@html@nohspace%
+ \RenewDocumentCommand{\hspace}{s m}{}%
\LWR@origitem[#1]%
\endgroup%
\LWR@orignewline%
@@ -30215,6 +30264,15 @@ end -- not --version
% \end{macrocode}
+% \DescribeBoolean{LWR@tabularfinalrow}
+% Used to set \attribute{aria-hidden} if adding a final row for the purpose
+% of adding the bottom border.
+% \changes{v0.906}{2022/05/28}{Added \attribute{aria-hidden}.}
+% \begin{macrocode}
+\newbool{LWR@tabularfinalrow}
+% \end{macrocode}
+
+
% \DescribeBoolean{LWR@validtablecol} True if found a valid table column type.
% \begin{macrocode}
\newbool{LWR@validtablecol}
@@ -30593,6 +30651,7 @@ end -- not --version
% \begin{macrocode}
\newcommand*{\LWR@tabularfinishrow}{%
% \end{macrocode}
+%
% If not exiting the tabular, or doing a rule, or have already started a row,
% finish this row:
% \begin{macrocode}
@@ -30605,8 +30664,9 @@ end -- not --version
bool{LWR@startedrow}%
}{%
% \end{macrocode}
-% To temporarily turn off |LWR@exitingtabular| so that
-% table data tags will still be generated:
+%
+% Temporarily turn off |LWR@exitingtabular| so that
+% table data tags will still be generated.
%
% If generating a final row for the \cs{bottomrule} borders,
% turn off the |@|, |!|, |<|, and |>| column output:
@@ -30617,10 +30677,12 @@ end -- not --version
\boolfalse{LWR@tabularmutemods}%
}%
% \end{macrocode}
+%
% Locally reenable the table data tags until finished with the final row:
% \begin{macrocode}
\boolfalse{LWR@exitingtabular}%
% \end{macrocode}
+%
% Generate table data tags and ampersands until the right edge:
% \begin{macrocode}
\whileboolexpr{%
@@ -30640,6 +30702,7 @@ end -- not --version
{%
\LWR@tabledatasinglecolumntag%
% \end{macrocode}
+%
% The following is essentially \cs{LWR@tabularampersand} with
% |LWR@emptyatbang| added to empty the following cells:
% \begin{macrocode}
@@ -30648,6 +30711,7 @@ end -- not --version
\global\boolfalse{LWR@tabularcelladded}%
\booltrue{LWR@emptyatbang}%
% \end{macrocode}
+%
% Starts the next cell:
% \begin{macrocode}
\ifnumcomp{\value{LWR@tableLaTeXcolindex}}{<}
@@ -30656,6 +30720,7 @@ end -- not --version
{}%
}%
% \end{macrocode}
+%
% Reenable the original |LWR@exitingtabular| to close the entire table:
% \begin{macrocode}
\ifbool{LWR@tabularmutemods}{%
@@ -30685,6 +30750,7 @@ end -- not --version
% \begin{macrocode}
\NewDocumentCommand{\LWR@tabularendofline}{s o}{%
% \end{macrocode}
+%
% Finish the row:
% \begin{macrocode}
\ifnumcomp{\value{LWR@tableLaTeXcolindex}}{<}
@@ -30693,18 +30759,22 @@ end -- not --version
{\LWR@closetabledatacell}%
\LWR@htmltag{/tr}\LWR@orignewline%
% \end{macrocode}
+%
% \pkg{xcolor} row color support:
% \begin{macrocode}
\@rowc@lors%
% \end{macrocode}
+%
% No longer inside a data cell:
% \begin{macrocode}
\booltrue{LWR@intabularmetadata}%
% \end{macrocode}
+%
% Not yet started a table row:
% \begin{macrocode}
\boolfalse{LWR@startedrow}%
% \end{macrocode}
+%
% Additional setup:
% \begin{macrocode}
\defcounter{LWR@hlines}{0}%
@@ -30713,25 +30783,30 @@ end -- not --version
\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}
\defcounter{LWR@tableLaTeXcolindex}{1}%
% \end{macrocode}
+%
% Have not yet added data in this column:
% \begin{macrocode}
\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@forceemptyline%
% \end{macrocode}
+%
% Look at the next token to decide between single column data tag
% or a special case:
% \begin{macrocode}
@@ -31538,10 +31613,12 @@ end -- not --version
\LWR@setexparray{LWR@coladdclass}{2}{}%
\LWR@setexparray{LWR@coladdclass}{3}{}%
% \end{macrocode}
+%
% Starting at the first column specification:
% \begin{macrocode}
\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}
@@ -31551,10 +31628,12 @@ end -- not --version
\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}
\boolfalse{LWR@opttablecol}%
% \end{macrocode}
+%
% Scan through the column specifications:
% \begin{macrocode}
\whileboolexpr{%
@@ -31565,6 +31644,7 @@ end -- not --version
}%
{%
% \end{macrocode}
+%
% Place the next single-character column type into \cs{LWR@strresult}:
% \begin{macrocode}
\expandarg%
@@ -31572,6 +31652,7 @@ end -- not --version
\LWR@traceinfo{position \arabic{LWR@tablecolspecindex}: \LWR@strresult}%
\fullexpandarg%
% \end{macrocode}
+%
% Not yet found a valid column type:
% \begin{macrocode}
\boolfalse{LWR@validtablecol}%
@@ -31589,6 +31670,7 @@ end -- not --version
{}% inside an optional argument
{% not an optional tabular argument
% \end{macrocode}
+%
% Not inside an optional argument, so consider the column type:
% \changes{v0.901}{2021/08/12}{Improved \cs{newcolumntype} emulation.}
% \begin{macrocode}
@@ -31596,6 +31678,7 @@ end -- not --version
{\csuse{LWR@columntype@\LWR@strresult}}%
{}%
% \end{macrocode}
+%
% If an unknown column type, use |l|:
% \begin{macrocode}
\ifbool{LWR@validtablecol}{}{%
@@ -31604,6 +31687,7 @@ end -- not --version
}%
}% not an optional column argument
% \end{macrocode}
+%
% If read the closing bracket, no longer inside the optional argument:
% \begin{macrocode}
\IfStrEq{\LWR@strresult}{]}{\boolfalse{LWR@opttablecol}}{}%
@@ -31717,6 +31801,9 @@ end -- not --version
% If have not yet started a new table row, begin one now.
% Creates a new row tag, adding a class for |hline| or |tbrule| if
% necessary.
+%
+% \changes{v0.906}{2022/05/28}{Removed final empty row if no border.}
+%
% \begin{macrocode}
\newcommand*{\LWR@maybenewtablerow}
{%
@@ -31724,37 +31811,94 @@ end -- not --version
{}% started the row
{% not started the row
% \end{macrocode}
-% Remember that now have started the row:
+%
+% Pre-compute the \attribute{aria-hidden} attribute,
+% used to hide from screen readers the final row if
+% it is only used to create the bottom border:
+% \changes{v0.906}{2022/05/28}{Added \attribute{aria-hidden}.}
% \begin{macrocode}
- \booltrue{LWR@startedrow}%
+ \ifbool{LWR@tabularfinalrow}%
+ {%
+ \renewcommand*{\LWR@tempone}%
+ { aria-hidden=\textquotedbl{}true\textquotedbl}%
+ }%
+ {%
+ \renewcommand*{\LWR@tempone}{}%
+ }%
% \end{macrocode}
-% Create the row tag, with a class if necessary.
-% \changes{v0.895}{2021/01/14}{Improved \HTML\ quotes.}
+%
+% Start a new row if doing \cs{hline}:
% \begin{macrocode}
- \booltrue{LWR@intabularmetadata}%
\ifboolexpr{%
test{\ifnumcomp{\value{LWR@hlines}}{>}{0}} or%
test{\ifnumcomp{\value{LWR@hdashedlines}}{>}{0}}%
}%
{%
- \LWR@htmltag{tr class=\textquotedbl{}hline\textquotedbl }%
+ \LWR@htmltag{%
+ tr %
+ class=\textquotedbl{}hline\textquotedbl%
+ \LWR@tempone% aria-hidden
+ }%
\LWR@orignewline%
+% \end{macrocode}
+%
+% Remember that now have started the row,
+% and create the row tag, with a class if necessary.
+% \changes{v0.895}{2021/01/14}{Improved \HTML\ quotes.}
+% \begin{macrocode}
+ \booltrue{LWR@startedrow}%
+ \booltrue{LWR@intabularmetadata}%
}%
+% \end{macrocode}
+%
+% If not doing \cs{hline}, start a row if doing a top or bottom rule:
+% \begin{macrocode}
{% not doing hline
\ifbool{LWR@doingtbrule}%
{%
\ifdefvoid{\LWR@ruleHTMLcolor}{%
- \LWR@htmltag{tr class=\textquotedbl{}tbrule\textquotedbl}%
+ \LWR@htmltag{%
+ tr %
+ class=\textquotedbl{}tbrule\textquotedbl%
+ \LWR@tempone% aria-hidden
+ }%
}{%
\LWR@htmltag{%
tr class=\textquotedbl{}tbrule\textquotedbl\ % space
style=\textquotedbl{}border-top: 1px solid % space
\LWR@origpound\LWR@ruleHTMLcolor \textquotedbl{}%
+ \LWR@tempone% aria-hidden
}%
}%
\LWR@orignewline%
+% \end{macrocode}
+%
+% Remember that now have started the row,
+% and create the row tag, with a class if necessary.
+% \changes{v0.895}{2021/01/14}{Improved \HTML\ quotes.}
+% \begin{macrocode}
+ \booltrue{LWR@startedrow}%
+ \booltrue{LWR@intabularmetadata}%
+ }%
+ {%
+% \end{macrocode}
+%
+% If not the final row, start a new row:
+% \begin{macrocode}
+ \ifbool{LWR@tabularfinalrow}%
+ {}%
+ {%
+ \LWR@htmltag{tr}\LWR@orignewline%
+% \end{macrocode}
+%
+% Remember that now have started the row,
+% and create the row tag, with a class if necessary.
+% \changes{v0.895}{2021/01/14}{Improved \HTML\ quotes.}
+% \begin{macrocode}
+ \booltrue{LWR@startedrow}%
+ \booltrue{LWR@intabularmetadata}%
+ }%
}%
- {\LWR@htmltag{tr}\LWR@orignewline}%
}% end of not doing hline
}% end of not started the row
}
@@ -33505,6 +33649,7 @@ end -- not --version
\newcommand*{\ResumeTabular}{%
\boolfalse{LWR@exitingtabular}%
\boolfalse{LWR@tabularmutemods}%
+ \boolfalse{LWR@tabularfinalrow}%
\LWR@getmynexttoken%
}
% \end{macrocode}
@@ -33566,10 +33711,14 @@ end -- not --version
\global\let\LWR@mynextaction\LWR@tabledatasinglecolumntag%
% \end{macrocode}
%
-% If exiting the tabular:
+% If find \cs{end}, exit the tabular:
+% \changes{v0.906}{2022/05/28}{Added \attribute{aria-hidden}.}
% \begin{macrocode}
\ifdefequal{\LWR@mynexttoken}{\end}%
- {\booltrue{LWR@exitingtabular}}{}%
+ {%
+ \booltrue{LWR@tabularfinalrow}%
+ \booltrue{LWR@exitingtabular}%
+ }{}%
% \end{macrocode}
%
% \env{longtable} can have a caption in a cell
@@ -33844,9 +33993,14 @@ end -- not --version
% \begin{macro}{\LWR@HTMLcline} \marg{columns}
+% \changes{v0.906}{2022/06/21}{Fix: \cs{cline} at end of tabular.}
% \begin{macrocode}
\NewDocumentCommand{\LWR@HTMLcline}{m}%
- {\LWR@docmidrule{#1}\LWR@getmynexttoken}%
+{%
+ \LWR@docmidrule{#1}%
+ \LWR@maybenewtablerow%
+ \LWR@getmynexttoken%
+}%
% \end{macrocode}
% \end{macro}
@@ -33955,6 +34109,12 @@ end -- not --version
\boolfalse{LWR@tabularmutemods}%
% \end{macrocode}
%
+% Not adding final row for the lower border:
+% \changes{v0.906}{2022/05/28}{Added \attribute{aria-hidden}.}
+% \begin{macrocode}
+ \boolfalse{LWR@tabularfinalrow}%
+% \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}
@@ -33986,6 +34146,7 @@ end -- not --version
% \begin{macrocode}
\LWR@htmlblocktag{table}%
% \end{macrocode}
+%
% Parse the table columns:
% \begin{macrocode}
\LWR@parsetablecols{#3}%
@@ -33997,6 +34158,21 @@ end -- not --version
% \begin{macrocode}
\LWR@stoppars%
% \end{macrocode}
+%
+% Without at least one header cell, some screen readers think that the
+% table is just for page layout, and do not read it as data.
+% Add a hidden row with a single non-empty header cell to tell
+% the screen readers that this is a table of data for the user.
+%
+% \changes{v0.906}{2022/05/01}{Add empty header.}
+% \begin{macrocode}
+ \LWR@htmltag{tr style="display:none"}%
+ \LWR@htmltag{th}.\LWR@htmltag{/th}%
+ \LWR@htmltag{/tr}%
+ \LWR@orignewline%
+ \LWR@forceemptyline%
+% \end{macrocode}
+%
% Track column \#:
% \begin{macrocode}
\defcounter{LWR@tableLaTeXcolindex}{1}%
@@ -34144,10 +34320,15 @@ end -- not --version
{%
\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}%
+% \end{macrocode}
+%
+% Finish a row which is not yet done:
+% \begin{macrocode}
\ifboolexpr{%
test {%
\ifnumcomp{\value{LWR@tableLaTeXcolindex}}{<}%
@@ -34163,13 +34344,22 @@ end -- not --version
)%
}%
{%
+% \end{macrocode}
+%
+% \changes{v0.906}{2022/05/28}{Added \attribute{aria-hidden}.}
+% \begin{macrocode}
+ \booltrue{LWR@tabularfinalrow}%
\LWR@tabularfinishrow%
+ \boolfalse{LWR@tabularfinalrow}%
}%
{%
\LWR@closetabledatacell%
}%
- \LWR@htmlblocktag{/tr}%
+ \ifbool{LWR@startedrow}%
+ {\LWR@htmltag{/tr}\LWR@orignewline}%
+ {}%
% \end{macrocode}
+%
% \pkg{xcolor} row color support:
% \begin{macrocode}
\@rowc@lors%
@@ -34784,6 +34974,7 @@ end -- not --version
% \cs{ref} is redefined to \cs{LWR@HTML@ref},
% except inside the text part of a \cs{hyperref},
% where it is redefined to \cs{LWR@ref@ignorestar}.
+%
% \begin{macro}{\LWR@HTML@ref} * \marg{label}
% Create an internal document reference link,
% or without a link if starred per \pkg{hyperref}.
@@ -34792,13 +34983,14 @@ end -- not --version
% Since \pkg{hyperref} is only emulated, the starred version is
% defined here for print mode, in case \cs{ref} is used inside
% \SVG\ math:
-% \changes{v0.88}{2020/07/05}{Fixed: Starred.}
+% \changes{v0.88}{2020/07/05}{Fixed: Starred \cs{ref}.}
% \begin{macrocode}
\LWR@absorbstar{ref}%
% \end{macrocode}
%
% The \HTML\ version:
% \changes{v0.58}{2018/06/07}{Improved print/\HTML\ output selection.}
+% \changes{v0.906}{2022/05/02}{Added \cs{Ref}.}
% \begin{macrocode}
\NewDocumentCommand{\LWR@HTML@ref}{s m}{%
\LWR@traceinfo{LWR@HTML@ref !#2!}%
@@ -34808,6 +35000,16 @@ end -- not --version
}
\LWR@formatted{ref}
+
+
+\NewDocumentCommand{\LWR@HTML@Ref}{s m}{%
+ \LWR@traceinfo{LWR@HTML@Ref !#2!}%
+ \IfBooleanTF{#1}%
+ {\LWR@print@Ref{#2}}%
+ {\LWR@subnewref{#2}{#2}}%
+}
+
+\LWR@formatted{Ref}
% \end{macrocode}
%
%
@@ -37194,10 +37396,6 @@ end -- not --version
\setbool{LWR@doingparhooks}{false}%
% \end{macrocode}
%
-% \begin{macrocode}
- \LWR@select@print@hspace%
-% \end{macrocode}
-%
% \changes{v0.903}{2021/12/13}{Par handling.}
% \begin{macrocode}
\def\color@endgroup{\endgraf\endgroup}%
@@ -37213,15 +37411,6 @@ end -- not --version
% \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%
-% \end{macrocode}
-% \changes{v0.88}{2020/07/03}{Added \cs{vdots}.}
-% \begin{macrocode}
- \let\vdots\LWR@origvdots%
-% \end{macrocode}
-% \begin{macrocode}
\let\textless\LWR@origtextless%
\let\textgreater\LWR@origtextgreater%
% \end{macrocode}
@@ -37237,9 +37426,6 @@ end -- not --version
\let\sb\LWR@origsb%
\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,
@@ -39089,9 +39275,13 @@ end -- not --version
% \end{macrocode}
% Print-mode versions:
+% \changes{v0.906}{2022/05/07}{Added \cs{theMathJaxsection}, etc.}
% \begin{macrocode}
\newcommand*{\displaymathnormal}{}
\newcommand*{\displaymathother}{}
+\newcommand*{\theMathJaxsubequations}{0}
+\newcommand*{\theMathJaxsection}{}
+\newcommand*{\theMathJaxequation}{\arabic{equation}}
% \end{macrocode}
% \begin{macrocode}
@@ -42354,14 +42544,19 @@ color:\LWR@origpound\LWR@tempcolor%
% \changes{v0.56}{2018/05/09}{Added \cs{thinspace}.}
% \changes{v0.61}{2018/09/23}{Spaces redefined \cs{AtBeginDocument}.}
% \changes{v0.88}{2020/07/03}{Added \cs{vdots}.}
+% \changes{v0.906}{2022/06/10}{Used \cs{LWR@formatted} for more items.}
% \begin{macrocode}
-\AtBeginDocument{
-\renewrobustcmd*{\,}{\HTMLunicode{202f}} % HTML thin non-breakable space
-\renewrobustcmd*{\thinspace}{\HTMLunicode{202f}} % HTML thin non-breakable space
-\renewrobustcmd*{\negthinspace}{\HTMLunicode{202f}} % HTML thin non-breakable space
-\renewrobustcmd*{~}{\HTMLentity{nbsp}}
-\renewrobustcmd*{\textellipsis}{\HTMLunicode{2026}}
-\renewrobustcmd*{\vdots}{\HTMLunicode{22EE}}
+\AtBeginDocument{%
+\renewrobustcmd*{\,}{\HTMLunicode{202f}}% HTML thin non-breakable space, not using LWR@formatted
+\newrobustcmd*{\LWR@HTML@thinspace}{\HTMLunicode{202f}}% HTML thin non-breakable space
+\LWR@formatted{thinspace}
+\newrobustcmd*{\LWR@HTML@negthinspace}{\HTMLunicode{202f}} % HTML thin non-breakable space
+\LWR@formatted{negthinspace}
+\renewrobustcmd*{~}{\HTMLentity{nbsp}}% cannot use \LWR@formatted
+\newrobustcmd*{\LWR@HTML@textellipsis}{\HTMLunicode{2026}}
+\LWR@formatted{textellipsis}
+\newrobustcmd*{\LWR@HTML@vdots}{\HTMLunicode{22EE}}
+\LWR@formatted{vdots}
}
% \end{macrocode}
%
@@ -42561,20 +42756,24 @@ color:\LWR@origpound\LWR@tempcolor%
% Uses |2003 EM SPACE| to pass validation.
% \changes{v0.64}{2018/12/08}{Made robust.}
% \changes{v0.65}{2018/12/22}{Changed to Unicode EM SPACE.}
+% \changes{v0.906}{2022/06/10}{\cs{LWR@formatted}.}
% \begin{macrocode}
-\renewrobustcmd*{\quad}{%
+\newrobustcmd*{\LWR@HTML@quad}{%
\LWR@minipagestoppars%
\HTMLunicode{2003}%
\LWR@minipagestartpars%
}
+\LWR@formatted{quad}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\qquad}
% Handles special minipage \& horizontal space interactions.
% \changes{v0.64}{2018/12/08}{Made robust.}
+% \changes{v0.906}{2022/06/10}{\cs{LWR@formatted}.}
% \begin{macrocode}
-\renewrobustcmd*{\qquad}{\quad\quad}
+\newrobustcmd*{\LWR@HTML@qquad}{\quad\quad}
+\LWR@formatted{qquad}
% \end{macrocode}
% \end{macro}
@@ -42582,12 +42781,14 @@ color:\LWR@origpound\LWR@tempcolor%
% Handles special minipage \& horizontal space interactions.
% \changes{v0.64}{2018/12/08}{Made robust.}
% \changes{v0.65}{2018/12/22}{Changed to Unicode EN SPACE.}
+% \changes{v0.906}{2022/06/10}{\cs{LWR@formatted}.}
% \begin{macrocode}
-\renewrobustcmd*{\enskip}{%
+\newrobustcmd*{\LWR@HTML@enskip}{%
\LWR@minipagestoppars%
\HTMLunicode{2002}%
\LWR@minipagestartpars%
}
+\LWR@formatted{enskip}
% \end{macrocode}
% \end{macro}
@@ -42603,8 +42804,6 @@ color:\LWR@origpound\LWR@tempcolor%
% \end{macrocode}
%
-% \begin{macro}{\LWR@select@html@hspace}
-%
% \begin{macro}{\hspace} * \marg{length} * \marg{length}
%
% Handles special minipage \& horizontal space interactions.
@@ -42613,14 +42812,14 @@ color:\LWR@origpound\LWR@tempcolor%
% \changes{v0.20}{2016/08/22}{Add: Supports \HTML\ thin breakable space.}
% \changes{v0.24}{2017/03/14}{Add: \cs{hspace} \cs{fill} converts to 2em}
% \changes{v0.74}{2019/08/04}{Ignore negative space.}
+% \changes{v0.906}{2022/06/10}{\cs{LWR@formatted}.}
%
% Prints a span of a given width. Ignores the optional star.
%
% |\hspace{\fill}| is converted to |\hspace{2em}|, equal to \cs{qquad}.
% \begin{macrocode}
-\newcommand{\LWR@select@html@hspace}{%
-\RenewDocumentCommand{\hspace}{s m}{%
-\setlength{\LWR@tempwidth}{##2}%
+\NewDocumentCommand{\LWR@HTML@hspace}{s m}{%
+\setlength{\LWR@tempwidth}{#2}%
% \end{macrocode}
% If \cs{fill}, change to \cs{qquad}:
% \begin{macrocode}
@@ -42682,42 +42881,10 @@ color:\LWR@origpound\LWR@tempcolor%
\LWR@minipagestartpars%
}{}% width greater than 0
}%
-}
+\LWR@formatted{hspace}
% \end{macrocode}
% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\LWR@select@html@nohspace}
-%
-% \begin{macro}{\hspace} * \marg{length}
%
-% Used to disable \cs{hspace} while creating |description| \cs{item}s.
-% \begin{macrocode}
-\newcommand{\LWR@select@html@nohspace}{%
- \RenewDocumentCommand{\hspace}{s m}{}%
-}
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-
-% \begin{macro}{\LWR@select@print@hspace}
-% \begin{macrocode}
-\newcommand*{\LWR@select@print@hspace}{%
- \renewrobustcmd\hspace{\@ifstar\@hspacer\@hspace}%
-}
-% \end{macrocode}
-% \end{macro}
-
-
-%
-%
-% \begin{macro}{\hspace} * \marg{length}
-%
-% Handles special minipage \& horizontal space interactions.
-% \begin{macrocode}
-\LWR@select@html@hspace
-% \end{macrocode}
-% \end{macro}
% \begin{macro}{\LWR@vspace} * \marg{length} Nullified vspace.
@@ -48473,8 +48640,8 @@ color:\LWR@origpound\LWR@tempcolor%
{\LWR@docmidrule[#1](){1-\arabic{LWR@tabletotalLaTeXcols}}}%
{%
\ifbool{FormatWP}%
- {\LWR@docmidrule[#1](){1-\arabic{LWR@tabletotalLaTeXcols}}}%
- {\booltrue{LWR@doingtbrule}}%
+ {\LWR@docmidrule[#1](){1-\arabic{LWR@tabletotalLaTeXcols}}}%
+ {\booltrue{LWR@doingtbrule}}%
}%
\LWR@getmynexttoken}
@@ -48486,8 +48653,8 @@ color:\LWR@origpound\LWR@tempcolor%
{\LWR@docmidrule[#1](){1-\arabic{LWR@tabletotalLaTeXcols}}}%
{%
\ifbool{FormatWP}%
- {\LWR@docmidrule[#1](){1-\arabic{LWR@tabletotalLaTeXcols}}}%
- {\defaddtocounter{LWR@hlines}{1}}%
+ {\LWR@docmidrule[#1](){1-\arabic{LWR@tabletotalLaTeXcols}}}%
+ {\defaddtocounter{LWR@hlines}{1}}%
}%
\LWR@getmynexttoken}
@@ -48505,8 +48672,8 @@ color:\LWR@origpound\LWR@tempcolor%
{\LWR@docmidrule[#1](){1-\arabic{LWR@tabletotalLaTeXcols}}}%
{%
\ifbool{FormatWP}%
- {\LWR@docmidrule[#1](){1-\arabic{LWR@tabletotalLaTeXcols}}}%
- {\booltrue{LWR@doingtbrule}}%
+ {\LWR@docmidrule[#1](){1-\arabic{LWR@tabletotalLaTeXcols}}}%
+ {\booltrue{LWR@doingtbrule}}%
}%
\LWR@getmynexttoken%
}%
@@ -51018,18 +51185,19 @@ test {\ifnumgreater{\csuse{Changes@In########1}}{0}}%
\fi
}
}
+% \end{macrocode}
-\LetLtxMacro\LWR@chemmacros@origchemprime\chemprime
-
-\protected\def\chemprime { \HTMLunicode{2032} }
+% \changes{v0.906}{2022/06/10}{\pkg{chemmacros}: \cs{chemprime} \cs{LWR@formatted}.}
+% \begin{macrocode}
-\appto\LWR@restoreorigformatting{%
-\LetLtxMacro\chemprime\LWR@chemmacros@origchemprime%
+\hook_gput_code:nnn {begindocument/end} {chemmacros}
+{
+\protected\def\LWR@HTML@chemprime { \HTMLunicode{2032} }
+\LWR@formatted{chemprime}
}
% \end{macrocode}
%
-% ^^A \RenewChemIUPAC \chemprime { \HTMLunicode{2032} }
%
% \begin{macrocode}
\cs_gset_protected:Npn \__chemmacros_cip:n #1
@@ -63655,7 +63823,7 @@ do not attempt to patch lwarp's version of `hyperref'.)\MessageBreak}
\renewcommand*{\jb@biblaw@item}{%
\hspace{0.5em}%
% $\triangleright$
- \HTMLunicode{25B7}% lwarp
+ \HTMLunicode{25B7}% lwarp%
\hspace{0.5em}%
}
@@ -68901,7 +69069,7 @@ border-radius: \LWR@mdfprintlength{roundcorner} ; \LWR@orignewline
% \env{mdframed} environment may not work with the \HTML\ versions of the following,
% so restore them to their originals while inside \env{mdframed}:
% \begin{macrocode}
-\LWR@select@print@hspace%
+\let\hspace\LWR@print@hspace%
\renewcommand*{\rule}{\LWR@print@rule}
\LetLtxMacro\makebox\LWR@print@makebox%
% \end{macrocode}
@@ -86425,7 +86593,7 @@ remember to convert PDF images to SVG using 'lwarpmk pdftosvg *-fig.pdf',
\InlineClass{thmboxproofname}{\proofname\ #1\unskip\,:}
}
{%
- \qquad\HTMLunicode{220E}% end of proof symbol
+ \qquad\HTMLunicode{220E}
\end{BlockClass}
}
@@ -88536,7 +88704,7 @@ remember to convert PDF images to SVG using 'lwarpmk pdftosvg *-fig.pdf',
\renewcommand\todoitem[2]{%
\refstepcounter{todo}%
\item[%
- \HTMLunicode{2610} \quad
+ \HTMLunicode{2610} \quad%
\ref{todopage:\thetodo}
] : {\todoformat\ifx#1\todomark\else\textbf{#1} \fi}#2%
\label{todolbl:\thetodo}%
@@ -88545,7 +88713,7 @@ remember to convert PDF images to SVG using 'lwarpmk pdftosvg *-fig.pdf',
\renewcommand\doneitem[2]{%
\stepcounter{todo}%
\item[%
- \HTMLunicode{2611} \quad
+ \HTMLunicode{2611} \quad%
\ref{todopage:\thetodo}
] \@nameuse{@done\the\c@todo}:
{\todoformat\ifx#1\todomark\else\textbf{#1} \fi}#2%
@@ -89836,6 +90004,7 @@ remember to convert PDF images to SVG using 'lwarpmk pdftosvg *-fig.pdf',
% \pkg{unitsdef} is patched for use by \pkg{lwarp}.
%
% \changes{v0.62}{2018/11/11}{\pkg{unitsdef}: Added.}
+% \changes{v0.906}{2022/06/10}{\pkg{unitsdef}: \cs{LWR@formatted}.}
%
% \codehtml
%
@@ -89844,29 +90013,30 @@ remember to convert PDF images to SVG using 'lwarpmk pdftosvg *-fig.pdf',
% \end{macrocode}
%
% \begin{macrocode}
-\renewcommand{\unitvaluesep}{\,}
+\newcommand{\LWR@HTML@unitvaluesep}{\,}
+\LWR@formatted{unitvaluesep}
-\renewcommand{\unittimes}{\@@setunitsepfalse\HTMLunicode{22c5}}% \cdot
+\newcommand{\LWR@HTML@unittimes}{\@@setunitsepfalse\HTMLunicode{22c5}}% \cdot
+\LWR@formatted{unittimes}
-\renewunit{\arcmin}{%
- \ifnumcomp{\value{LWR@lateximagedepth}}{>}{0}%
- {\ensuremath{{}^\prime}}%
- {\HTMLunicode{2032}}% prime
+\newunit{\LWR@HTML@arcmin}{%
+ \HTMLunicode{2032}% prime
}
+\LWR@formatted{arcmin}
-\renewunit{\arcsec}{%
- \ifnumcomp{\value{LWR@lateximagedepth}}{>}{0}%
- {\ensuremath{{}^{\prime\prime}}}%
- {\HTMLunicode{2033}}% dbl prime
+\newunit{\LWR@HTML@arcsec}{%
+ \HTMLunicode{2033}% dbl prime
}
+\LWR@formatted{arcsec}
-\renewrobustcmd{\SI}[2]{%
+\newrobustcmd{\LWR@HTML@SI}[2]{%
\begingroup%
\let\unit@@xspace\relax%
\unitSIdef\selectfont%
\LWR@textcurrentfont{#1#2}% lwarp
\endgroup%
}
+\LWR@formatted{SI}
% \end{macrocode}
%
% \iffalse