texlive[46638] trunk: lwarp (14feb18)

commits+karl at tug.org commits+karl at tug.org
Wed Feb 14 22:33:06 CET 2018


Revision: 46638
          http://tug.org/svn/texlive?view=revision&revision=46638
Author:   karl
Date:     2018-02-14 22:33:05 +0100 (Wed, 14 Feb 2018)
Log Message:
-----------
lwarp (14feb18)

Modified Paths:
--------------
    trunk/Build/source/texk/texlive/linked_scripts/lwarp/lwarpmk.lua
    trunk/Master/texmf-dist/doc/latex/lwarp/README.txt
    trunk/Master/texmf-dist/doc/latex/lwarp/lwarp.pdf
    trunk/Master/texmf-dist/doc/latex/lwarp/lwarp_tutorial.txt
    trunk/Master/texmf-dist/scripts/lwarp/lwarpmk.lua
    trunk/Master/texmf-dist/source/latex/lwarp/lwarp.dtx
    trunk/Master/texmf-dist/source/latex/lwarp/lwarp.ins
    trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-adjmulticol.sty
    trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-array.sty
    trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-caption.sty
    trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-epigraph.sty
    trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-fancyref.sty
    trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-graphics.sty
    trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-hang.sty
    trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-hanging.sty
    trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-hyperref.sty
    trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-luatodonotes.sty
    trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-midpage.sty
    trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-multirow.sty
    trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-ntheorem.sty
    trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-realscripts.sty
    trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-scrextend.sty
    trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-siunitx.sty
    trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-titling.sty
    trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-todonotes.sty
    trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-ulem.sty
    trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-xfrac.sty
    trunk/Master/texmf-dist/tex/latex/lwarp/lwarp.sty

Added Paths:
-----------
    trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-acro.sty
    trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-acronym.sty
    trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-chapterbib.sty
    trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-colortbl.sty
    trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-fancyheadings.sty
    trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-hypcap.sty
    trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-hypernat.sty
    trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-stfloats.sty
    trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-vmargin.sty

Modified: trunk/Build/source/texk/texlive/linked_scripts/lwarp/lwarpmk.lua
===================================================================
--- trunk/Build/source/texk/texlive/linked_scripts/lwarp/lwarpmk.lua	2018-02-14 21:32:33 UTC (rev 46637)
+++ trunk/Build/source/texk/texlive/linked_scripts/lwarp/lwarpmk.lua	2018-02-14 21:33:05 UTC (rev 46638)
@@ -4,7 +4,7 @@
 
 -- Print the usage of the lwarpmk command:
 
-printversion = "v0.47"
+printversion = "v0.48"
 
 function printhelp ()
 print ("lwarpmk: Use lwarpmk -h or lwarpmk --help for help.") ;

Modified: trunk/Master/texmf-dist/doc/latex/lwarp/README.txt
===================================================================
--- trunk/Master/texmf-dist/doc/latex/lwarp/README.txt	2018-02-14 21:32:33 UTC (rev 46637)
+++ trunk/Master/texmf-dist/doc/latex/lwarp/README.txt	2018-02-14 21:33:05 UTC (rev 46638)
@@ -1,5 +1,5 @@
 
-LaTeX lwarp package v0.47   README.txt
+LaTeX lwarp package v0.48   README.txt
 
 Files included are:
 

Modified: trunk/Master/texmf-dist/doc/latex/lwarp/lwarp.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/lwarp/lwarp_tutorial.txt
===================================================================
--- trunk/Master/texmf-dist/doc/latex/lwarp/lwarp_tutorial.txt	2018-02-14 21:32:33 UTC (rev 46637)
+++ trunk/Master/texmf-dist/doc/latex/lwarp/lwarp_tutorial.txt	2018-02-14 21:33:05 UTC (rev 46638)
@@ -26,6 +26,8 @@
 ]{lwarp}
 % \boolfalse{FileSectionNames}  % If false, numbers the files.
 
+% --- LOAD PDFLATEX MATH FONTS HERE ---
+
 % --- OTHER PACKAGES ARE LOADED AFTER LWARP ---
 \usepackage{makeidx} \makeindex
 \usepackage{xcolor}             % (Demonstration purposes only.)

Modified: trunk/Master/texmf-dist/scripts/lwarp/lwarpmk.lua
===================================================================
--- trunk/Master/texmf-dist/scripts/lwarp/lwarpmk.lua	2018-02-14 21:32:33 UTC (rev 46637)
+++ trunk/Master/texmf-dist/scripts/lwarp/lwarpmk.lua	2018-02-14 21:33:05 UTC (rev 46638)
@@ -4,7 +4,7 @@
 
 -- Print the usage of the lwarpmk command:
 
-printversion = "v0.47"
+printversion = "v0.48"
 
 function printhelp ()
 print ("lwarpmk: Use lwarpmk -h or lwarpmk --help for help.") ;

Modified: trunk/Master/texmf-dist/source/latex/lwarp/lwarp.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/lwarp/lwarp.dtx	2018-02-14 21:32:33 UTC (rev 46637)
+++ trunk/Master/texmf-dist/source/latex/lwarp/lwarp.dtx	2018-02-14 21:33:05 UTC (rev 46638)
@@ -16,7 +16,7 @@
 % \iffalse
 %<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
 %<package>\ProvidesPackage{lwarp}
-%<package>    [2018/01/30 v0.47  Allows LaTeX to directly produce HTML5 output.]
+%<package>    [2018/02/14 v0.48  Allows LaTeX to directly produce HTML5 output.]
 %
 %<*driver>
 \documentclass{ltxdoc}
@@ -27,7 +27,7 @@
 % \usepackage[varqu,varl]{inconsolata} % typewriter
 % \usepackage{roboto}
 % \usepackage{cabin}
-\usepackage[tabular]{sourcesanspro}
+\usepackage[tabular,semibold]{sourcesanspro}
 
 
 \usepackage[T1]{fontenc}
@@ -275,7 +275,11 @@
 \providerobustcmd*{\env}[1]{\texttt{#1}}
 \providerobustcmd*{\ctr}[1]{\texttt{#1}}
 \providerobustcmd*{\pkg}[1]{\textsf{#1}}
-\providerobustcmd*{\prog}[1]{\texttt{#1}}
+\providerobustcmd*{\prog}[1]{\textsf{#1}}
+
+
+\providerobustcmd*{\brand}[1]{\textsc{#1}}
+
 \newrobustcmd{\acro}[1]{\textsc{\lowercase{#1}}}
 \newrobustcmd{\element}[1]{\texttt{<#1>}}
 \newrobustcmd{\attribute}[1]{\texttt{#1}}
@@ -368,8 +372,8 @@
 % \makeatother
 
 \newcommand{\pdflatexonly}{
-\textcolor{red}{Only pre-loaded if \texttt{pdflatex} is being used.}
-\marginpar{\raggedleft\textcolor{blue!70!black}{\texttt{pdflatex} only:}}
+\textcolor{red}{Only pre-loaded if \prog{pdflatex} is being used.}
+\marginpar{\raggedleft\textcolor{blue!70!black}{\prog{pdflatex} only:}}
 }
 
 % \newcommand{\margintag}[1]{%
@@ -484,13 +488,13 @@
 \newcommand{\limitsindexlanguage}{%
 The \pkg{lwarp} package takes an option
 \DescribeOption{IndexLanguage}
-\texttt{IndexLanguage=english} to set the language used by \texttt{xindy}.
-This is passed to \texttt{xindy} using its \texttt{-L} option, and is
+\texttt{IndexLanguage=english} to set the language used by \prog{xindy}.
+This is passed to \prog{xindy} using its \texttt{-L} option, and is
 used for both index and glossary generation.
 }
 
 \newcommand{\limitsglossaries}{%
-\texttt{xindy} is required for \pkg{glossaries}.
+\prog{xindy} is required for \pkg{glossaries}.
 
 The default \texttt{style=item} option for \pkg{glossaries} conflicts
 with \pkg{lwarp}, so the style is forced to \texttt{index} instead.
@@ -531,9 +535,9 @@
 
 \DescribeOption[lwarpmk]{printglossary}
 \DescribeOption[lwarpmk]{htmlglossary}
-\texttt{lwarpmk} has the commands \texttt{lwarpmk printglossary} and
+\prog{lwarpmk} has the commands \texttt{lwarpmk printglossary} and
 \texttt{lwarpmk htmlglossary} to process the glossaries created by
-\pkg{glossaries} using \texttt{xindy}.
+\pkg{glossaries} using \prog{xindy}.
 }
 
 
@@ -663,7 +667,8 @@
 
 \DescribeMacro{\kern}%
 \DescribeMacro{\hskip}%
-\cs{kern} and \cs{hskip} are treated as a single normal space.
+\cs{kern} and \cs{hskip} are entered into the \HTML\ \PDF\ output as-is,
+then interpreted by \prog{pdftotext}, and thus usually appear as a single space.
 }
 
 \newcommand{\limitstextcomp}{%
@@ -766,7 +771,7 @@
 The \env{verbatim} environment does not yet support the \pkg{memoir} enhancements.
 It is currently recommended to load and use \pkg{fancyvrb} instead.
 
-The \pkg{memoir} glossary system is not yet supported by \texttt{lwarpmk}.
+The \pkg{memoir} glossary system is not yet supported by \prog{lwarpmk}.
 The \pkg{glossaries} package may be used instead,
 but does require the glossary entries be
 changed from the \pkg{memoir} syntax to the \pkg{glossaries} syntax.
@@ -804,7 +809,7 @@
 \cs{HTMLleftmargini} should be set to a wide enough length to contain ``Chorus''.
 The default is wide enough for a stanza number.
 
-Horizontal spacing relies on \texttt{pdftotext}'s ability to discern the layout
+Horizontal spacing relies on \prog{pdftotext}'s ability to discern the layout
 \watchout[spacing]
 (\texttt{-layout} option) of the
 text in the \HTML-tagged \PDF\ output.  For some settings of
@@ -832,7 +837,7 @@
 
 Math may be rendered
 \margintag{Math rendering}
-as \SVG\ graphics or using the \textsc{MathJax} JavaScript display engine.
+as \SVG\ graphics or using the \brand{MathJax} JavaScript display engine.
 \index{JavaScript>MathJax}
 
 In its current implementation,
@@ -861,7 +866,7 @@
 among other things allowing a more compact representation of math than \SVG\ drawings.
 Problems with \MathML\ include limited browser support and some
 issues with the fine control of the appearance of the result.
-Also see \cref{sec:epub} regarding \EPUB\ output with MathJax.
+Also see \cref{sec:epub} regarding \EPUB\ output with \brand{MathJax}.
 
 \subsubsection{SVG option}
 
@@ -894,27 +899,27 @@
 \watchout[SVG math in \TeX\ boxes]
 before and after each image.
 
-\subsubsection{MathJax option}
+\subsubsection{\brand{MathJax} option}
 
-The popular MathJax alternative (\url{mathjax.org}) may be used to display math.
-\margintag{MathJax math option}
+The popular \brand{MathJax} alternative (\url{mathjax.org}) may be used to display math.
+\margintag{\brand{MathJax} math option}
 \DescribeProgram{MathJax}
 \index{math>MathJax summary}
 \index{MathJax>summary}
 
-When MathJax is enabled, math is rendered twice:
+When \brand{MathJax} is enabled, math is rendered twice:
 \begin{enumerate}
 \item As regular \LaTeX\ \PDF\ output placed inside an \HTML\ comment, allowing
 equation numbering and cross referencing to be almost entirely under the control of \LaTeX, and
 \item As detokenized printed \LaTeX{} commands placed directly into the \HTML\ output
-for interpretation by the MathJax display scripts.  An additional script is used to
+for interpretation by the \brand{MathJax} display scripts.  An additional script is used to
 pre-set the equation number format and value according to the current \LaTeX\ values,
-and the MathJax cross-referencing system is ignored in favor of the \LaTeX\ internal system,
+and the \brand{MathJax} cross-referencing system is ignored in favor of the \LaTeX\ internal system,
 seamlessly integrating with the rest of the \LaTeX\ code.
 \end{enumerate}
 
-Limitations when using MathJax include:
-\margintag{MathJax limitations}
+Limitations when using \brand{MathJax} include:
+\margintag{\brand{MathJax} limitations}
 \DescribeProgram{MathJax}
 \begin{itemize}
 \item In document classes which have chapters,
@@ -923,27 +928,27 @@
     \index{tagged equations>Mathjax}%
     \cs{tag}ged equations have the chapter number prepended in \HTML\ output, unlike \LaTeX.
     \cs{tag*} equations (correctly) do not.
-    This may be improved with future versions of the MathJax support script.
+    This may be improved with future versions of the \brand{MathJax} support script.
 
     \href{https://groups.google.com/forum/\#!topic/mathjax-users/jUtewUcE2bY}
         {\texttt{https://groups.google.com/forum/\#!topic/\\
             \hspace*{2em}mathjax-users/jUtewUcE2bY}}
 
-\item MathJax itself does not support subequations.
+\item \brand{MathJax} itself does not support subequations.
     \margintag{subequations}
 \index{MathJax>subequations}%
 \index{subequations>MathJax}%
     This may be improved by parsing the \LaTeX{}
     math expression to manually insert tags, but this has not yet been done.
-\item Footnotes inside equations are not yet supported while using MathJax.
+\item Footnotes inside equations are not yet supported while using \brand{MathJax}.
     \margintag{footnotes in math}
 \item Math appearing inside a lateximage,
     \margintag{lateximage}
     and therefore also inside a \tikz{} or \env{picture}
-    environment, is rendered as SVG math even if MathJax is used in the rest of the document.
+    environment, is rendered as SVG math even if \brand{MathJax} is used in the rest of the document.
 \item Usage of \pkg{siunitx} inside a math equation
     \margintag{siunitx}
-    is supported via a third-party MathJax extension.
+    is supported via a third-party \brand{MathJax} extension.
     While inside a math expression, do not use \cs{SI} or \cs{si} inside \cs{text},
     where it will be rendered as normal text.
     \watchout[siunitx inside an equation]
@@ -955,15 +960,15 @@
 
 \item A \env{tabbing} environment is emulated
     using an \HTML\ \element{pre}.\margintag{tabbing}
-    While MathJax is enabled inside \env{tabbing}, the browser may not correctly
+    While \brand{MathJax} is enabled inside \env{tabbing}, the browser may not correctly
     render the horizontal alignment of the math and text following after on the same line.
 
-\item Other math-related macros and packages are not supported by MathJax,
+\item Other math-related macros and packages are not supported by \brand{MathJax},
     \watchout[other macros and packages]
     including \cs{ensuremath}, \pkg{bigdelim}, \pkg{units}, and \pkg{nicefrac},
     along with occasionally-used macros such as \cs{footnote} and \cs{relax}.
 
-\item MathJax does not automatically support custom \LaTeX{} macros,
+\item \brand{MathJax} does not automatically support custom \LaTeX{} macros,
     \margintag{custom MathJax macros}
     \index{MathJax>custom macros}
     but they may be created by the user inside a math expression:
@@ -1065,7 +1070,7 @@
 For fixed-sized images, use
 \texttt{cm}, \texttt{mm}, \texttt{in}, \texttt{pt}, or \texttt{pc}.
 Use the keys \cmds{width=.5\lmacro{linewidth}},
-or similar for \cmds{\lmacro{textwidth}} or \cmds{\lmacro{textheight}}
+or similar for \cs{textwidth} or \cs{textheight}
 to give fixed-sized images proportional to a 6 by 9 inch text area.
 
 \cs{includegraphics} accepts \texttt{width} and \texttt{height},
@@ -1113,7 +1118,7 @@
 reusing the same file each time the same expression occurs, so each
 time \texttt{\$x\$} is used, for example, yet another file is created.
 For a document with a large amount of math,
-see \cref{sec:tutorialmathjax} to use MathJax instead.
+see \cref{sec:tutorialmathjax} to use \brand{MathJax} instead.
 }
 
 \newcommand{\limitsgrffile}{%
@@ -1323,6 +1328,10 @@
         Keep the \cs{endfirsthead} row unchanged, as it is still relevent to \HTML\ output.
     \end{itemize}
 
+\item[\pkg{colortbl}:] \
+
+    \limitscolortbl
+
 \needspace{3\baselineskip}
 \item[Other:] \
     \begin{itemize}
@@ -1429,6 +1438,8 @@
     \cs{begin}\{warpprint\} \ldots\  \cs{end}\{warpprint\}
     \end{sourcedisplay}
 or place it inside \cs{warpingprintonly}.
+
+\pkg{longtable} is not supported inside a \env{lateximage}.\watchout[lateximage]
 }
 
 \newcommand{\limitssupertabular}{%
@@ -1441,6 +1452,9 @@
 \textcolor{red}{\cs{EndDefiningTabulars}}
 \end{sourcedisplay}
 See \cref{sec:limitstabular}.
+
+\pkg{supertabular} and \pkg{xtab} are not supported
+inside a \env{lateximage}.\watchout[lateximage]
 }
 
 \newcommand{\limitsbigdelim}{%
@@ -1468,6 +1482,27 @@
 \end{sourcedisplay}
 }
 
+\newcommand{\limitscolortbl}{%
+Only use \cs{rowcolor} and \cs{cellcolor} at the start of a row,
+in that order.\watchout[row/cell color]
+
+\pkg{colortbl} ignores the overhang arguments.
+}
+
+
+\newcommand{\limitsmakelabel}{%
+While inside a list environment, \pkg{lwarp} nullifies a number of
+\TeX\ horizontal skip and fill commands, allowing the user to define
+\cs{makelabel} for print mode while \HTML\ mode ignores those commands.
+
+When defining \cs{makelabel} in a \env{list} environment, use
+\watchout[label font]
+\cs{textbf} etc. instead of \cs{bfseries}.
+}
+
+\newcommand{\limitslists}{%
+}
+
 \newcommand{\limitsmarginpars}{%
 \DescribeMacro{\marginpar} \oarg{left} \marg{right}
 \qquad
@@ -1603,7 +1638,7 @@
 
 \env{LVerbatim}, \cs{LVerbatimInput}, and \cs{LUseVerbatim} indent with horizontal
 \margintag{indented alignment}
-space which may not line up exactly with what \texttt{pdftotext} detects.
+space which may not line up exactly with what \prog{pdftotext} detects.
 Some lines may be off slightly in their left edge.
 }
 
@@ -1729,22 +1764,22 @@
 }
 
 \newcommand{\limitssiunitx}{%
-Do not use \cmds{per-mode=fraction},
-\watchout[per-mode]
-which cannot be seen by the final \cmds{pdftotext} conversion.
+Due to \prog{pdftolatex} limitations, fraction output is replaced by symbol
+\margintag{fractions}
+output for \texttt{per-mode} and \texttt{quotient-mode}.
 
 Some units will require that the expression be placed inside math mode.
 \watchout[math mode required]
 
 \textcolor{red}{NOTE: As of this writing, the \pkg{siunitx} extension
-for MathJax is not currently hosted at any public CDN,
-thus \pkg{siunitx} is not usable with MathJax unless a local copy
+for \brand{MathJax} is not currently hosted at any public CDN,
+thus \pkg{siunitx} is not usable with \brand{MathJax} unless a local copy
 of this extension is created first.}
 }
 
 \newcommand{\limitsnicefrac}{%
 \pkg{units} and \pkg{nicefrac} work as-is with \pkg{lwarp}, but
-MathJax does not have an extension for \pkg{units} or \pkg{nicefrac}.
+\brand{MathJax} does not have an extension for \pkg{units} or \pkg{nicefrac}.
 These packages do work with \pkg{lwarp}'s option \texttt{svgmath}.
 }
 
@@ -1841,11 +1876,11 @@
 \newcommand{\osportabilityusage}{%
 \pkg{lwarp} tries to detect which operating system is being used.
 \DescribeProgram{Unix}\DescribeProgram{Mac OS}\DescribeProgram{Linux}
-\textsc{Unix}~/ \textsc{Mac~OS}~/ \textsc{Linux} is the default
-(collectively referred to as ``\textsc{Unix}'' in the configuration files),
-and \textsc{MS-Windows} is supported as well.
+\brand{Unix}~/ \brand{Mac~OS}~/ \brand{Linux} is the default
+(collectively referred to as ``\brand{Unix}'' in the configuration files),
+and \brand{MS-Windows} is supported as well.
 
-If \textsc{Windows} is not correctly detected,
+If \brand{MS-Windows} is not correctly detected,
 \DescribeProgram{MS-Windows} \DescribeProgram{Windows}
 use the \pkg{lwarp} option \texttt{OSWindows}.
 \DescribeOption{OSWindows}
@@ -1878,7 +1913,7 @@
 %<*package>
 % \fi
 %
-% \CheckSum{19653}
+% \CheckSum{20535}
 %
 % \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
@@ -1900,7 +1935,7 @@
 % \changes{v0.10}{2016/03/08}{\ 2016/03/08 Initial version}
 % \changes{v0.11}{2016/03/11}{\ 2016/03/11}
 % \changes{v0.11}{2016/03/10}{Test Suite: limages and index in README.txt}
-% \changes{v0.11}{2016/03/11}{Test Suite: MS-Windows in README.txt}
+% \changes{v0.11}{2016/03/11}{Test Suite: \brand{MS-Windows} in README.txt}
 % \changes{v0.12}{2016/03/14}{\ 2016/03/14}
 % \changes{v0.12}{2016/03/14}{Global: Uses \textbackslash{}p@(type) in float captions.}
 % \changes{v0.12}{2016/03/14}{Test Suite: Sub-figures}
@@ -1967,6 +2002,7 @@
 % \changes{v0.45}{2018/01/14}{\ 2018/01/14}
 % \changes{v0.46}{2018/01/23}{\ 2018/01/23}
 % \changes{v0.47}{2018/01/30}{\ 2018/01/30}
+% \changes{v0.48}{2018/02/14}{\ 2018/02/14}
 
 
 
@@ -2015,11 +2051,11 @@
 % \noindent
 % The \pkg{lwarp} package allows \LaTeX\ to directly produce \HTMLfive\ output,
 % using external utility programs only for the final conversion of text and images.
-% Math may be represented by \SVG\ files or MathJax.
+% Math may be represented by \SVG\ files or \brand{MathJax}.
 %
 % Documents may be produced by pdf\LaTeX, \LuaLaTeX, or \XeLaTeX.
-% A |texlua| script removes the need for system utilities such as |make| and |gawk|,
-% and also supports |xindy| and |latexmk|.  Configuration is automatic at the
+% A \prog{texlua} script removes the need for system utilities such as \prog{make} and \prog{gawk},
+% and also supports \prog{xindy} and \prog{latexmk}.  Configuration is automatic at the
 % first manual compile.
 %
 % Print and \HTML\ versions of each document may coexist, each with its own
@@ -2151,6 +2187,8 @@
 % \section{Updates}
 % \label{sec:updates}
 %
+% ^^A *updates
+%
 % The following is intended for those updating existing projects which use
 % \pkg{lwarp}, highlighting any special changes which must be made due
 % to improvements or modifications in \pkg{lwarp} itself.
@@ -2158,14 +2196,47 @@
 % For a detailed list of changes, see the Change History on page \pageref{sec:changehistory}.
 %
 % \begin{description}
+% \item[v0.48:] \
+%   \begin{itemize}
+%       \item Added some documentation
+%           \margintag{docs}
+%           regarding converting an existing document.  See \cref{sec:convertexisting}.
+%       \item Updated compatibility for new \pkg{cleveref} v0.21.\margintag{\pkg{cleveref}}
+%       \item Fix: Ignores optional tabular column arguments.\margintag{tabular}
+%       \item Added \cs{leftline}, \cs{centerline},
+%           \cs{rightline}.\margintag{minor updates}
+%       \item Lists have improved font control via \cs{makelabel}.
+%       \item Print-mode \env{lateximage} now boxed to the natural width of its
+%           multiline contents.
+%       \item \env{abstract} now allows an optional name, as required by some classes.
+%       \item Fix: Improved spacing, \cs{mbox}, and font sizes
+%           with \SVG\ math, \tikz.\margintag{math}
+%       \item \pkg{siunitx}: Improved \SVG\ math, fraction compatibility, color output.
+%       \item Fix: LOF/LOT links.\margintag{misc. fixes}
+%       \item Fix: Virtual page size grouping caused excessive \PDF\ page breaks.
+%       \item Fix: Parsing similar package names in a
+%           single \cs{usepackage}.
+%       \item Fix: Adapts to classes without \cs{part}.
+%       \item Fix: \cs{newline} in \cs{title} was causing |<br>| in window title.
+%       \item Fix: \cs{maketitle} with \cs{cr}, \cs{crcr}, \cs{noalign},
+%                   for \pkg{IEEEtran} class.
+%       \item Fix: \pkg{xfrac} neutralized \env{BlockClass} and others.
+%       \item Fix: \pkg{todonotes} and \pkg{luatodonotes}: Improved \cs{todototoc}.
+%       \item Added \pkg{colortbl}, \margintag{packages}
+%                   \pkg{chapterbib}, \pkg{acro}, \pkg{acronym},
+%                   \pkg{hypernat}, \pkg{hypcap}, \pkg{stfloats},
+%                   \pkg{vmargin}, \pkg{fancyheadings}.
+%       \item \pkg{fancyref}: Now directly supported.
+%   \end{itemize}
 % \item[v0.47:] \
 %   \begin{itemize}
-%       \item Improved \SVG\ math baseline and sizing.
+%       \item Improved \SVG\ math baseline and sizing.\margintag{math}
 %       \item Fixes: \SVG math in captions, subcaptions, \cs{nameref}.
 %       \item Fixes: Line wrap at hyphen in \HTML\ output.
 %       \item Added \pkg{endheads}, \pkg{multitoc}, \pkg{sectionbreak},
-%           \pkg{blowup}, \pkg{xurl}.
+%           \pkg{blowup}, \pkg{xurl}.\margintag{packages}
 %   \end{itemize}
+% \needspace{2\baselineskip}
 % \item[v0.46:] \
 %   \begin{itemize}
 %       \item \cs{PrintStack} changed to \cs{LWRPrintStack}.\watchout[name change]
@@ -2173,8 +2244,9 @@
 %       \item Fix: Stack unnesting.
 %       \item Fix: SVG math and \env{lateximage}s in numerous situations.
 %       \item Fix: Spaces in \cs{usepackage}.
-%       \item Fix: Now allows MathJax inside \env{verse}.
+%       \item Fix: Now allows \brand{MathJax} inside \env{verse}.
 %   \end{itemize}
+% \needspace{2\baselineskip}
 % \item[v0.45:] \
 %   \begin{itemize}
 %       \item Improved MikTeX install instructions.\margintag{docs}
@@ -2184,7 +2256,7 @@
 %               See \cref{sec:limitsmemoir}.\margintag{memoir}
 %       \item Fix: Now allows underscores in labels.\margintag{cross-references}
 %       \item Fix: \cs{\_} and |\<blank>| in section/file names.
-%       \item Fix: Now allows MathJax inside \env{tabbing}.\margintag{math}
+%       \item Fix: Now allows \brand{MathJax} inside \env{tabbing}.\margintag{math}
 %       \item Fix: Bibliography \cs{em} names.\margintag{bibliography}
 %       \item Added \pkg{cite}, \pkg{natbib}, \pkg{backref}.
 %               (Also works as-is with \pkg{biblatex}.)
@@ -2214,7 +2286,7 @@
 %           Fixed web page title if \cs{HTMLTitle} empty and no \cs{title} given and
 %           not using \pkg{titling} package.
 %       \item Fixed web page author if \cs{HTMLauthor} is empty and \cs{author} is not given.
-%       \item If using |pdflatex|, automatically loads T1 and UTF8 encodings.
+%       \item If using \prog{pdflatex}, automatically loads T1 and UTF8 encodings.
 %           \margintag{encodings}
 %           (Additional \pkg{fontenc} encodings may be loaded after \pkg{lwarp}.)
 %       \item Added \env{list} and \env{trivlist} environments, \pkg{hang}.\margintag{lists}
@@ -2221,7 +2293,7 @@
 %       \item Fix: \cs{multicolumn} alignment if formatting for a word processor.
 %           \margintag{tabular}
 %       \item Added \pkg{ltxtable}.
-%       \item Fix: MathJax combined with \env{lateximage}s.\margintag{math}
+%       \item Fix: \brand{MathJax} combined with \env{lateximage}s.\margintag{math}
 %       \item \pkg{algorithmicx}: Improved comment symbol and floating.
 %       \item Completed \pkg{todonotes} and \pkg{luatodonotes}.
 %           \margintag{\pkg{packages}}
@@ -2288,7 +2360,7 @@
 %       \item Fix: Text copy/paste of \AmS\ math environment numbers and names.
 %           \margintag{math}
 %       \item Improved \cs{ensuremath}.
-%       \item MathJax with \pkg{siunitx}: Updated script and documentation.
+%       \item \brand{MathJax} with \pkg{siunitx}: Updated script and documentation.
 %       \item \pkg{textcomp}: Improved \cs{interrobangdown}.
 %           \margintag{symbols}
 %       \item \pkg{realscripts}: Fix for subscripts in a \env{lateximage}.
@@ -2409,7 +2481,7 @@
 %       \margintag{front \& back matter}
 %       See \cref{sec:frontbackmatter}.
 %   \item Fix: \pkg{color} requests \pkg{xcolor}.
-%   \item Fix: \cs{part} for |article| class.
+%   \item Fix: \cs{part} for \pkg{article} class.
 %   \end{itemize}
 % \needspace{2\baselineskip}
 % \item[v0.37:] \
@@ -2418,8 +2490,8 @@
 %       \margintag{\cs{include} for \HTML}
 %       for \HTML\ versions.
 %   \item \pkg{comment}, used by \pkg{lwarp}, now maintains
-%       \margintag{\texttt{latexmk}}
-%       independent cut files for print and \HTML\ versions, helping |latexmk| to
+%       \margintag{\prog{latexmk}}
+%       independent cut files for print and \HTML\ versions, helping \prog{latexmk} to
 %       better know whether to recompile.
 %   \item Improved support for \LaTeX\ accents,
 %       \margintag{accents and symbols}
@@ -2444,10 +2516,10 @@
 %       \margintag{footnotes}
 %       \env{lateximage} footnotes now appear as regular footnotes to match
 %       the numbering of the print version.
-%       Also fixed a regression with MathJax.
+%       Also fixed a regression with \brand{MathJax}.
 %   \item Improved \pkg{siunitx} units.
 %       \margintag{\pkg{siunitx}}
-%   \item Fix for filenames while using MathJax.
+%   \item Fix for filenames while using \brand{MathJax}.
 %   \item Fix for \cs{rule} when \pkg{xcolor} is not loaded.
 %	\item Added \pkg{transparent}, \pkg{upref}.
 %	\end{itemize}
@@ -2488,7 +2560,7 @@
 %		and draws a framed minipage in print output.
 %		See \cref{sec:framedminipages}.
 %		\cs{fbox} and minipages now often work in \SVG\ math and \env{lateximage}s.
-%		MathJax supports \cs{fbox}, but not \cs{fboxBlock} nor \env{fminipage}.
+%		\brand{MathJax} supports \cs{fbox}, but not \cs{fboxBlock} nor \env{fminipage}.
 %	\item Improved compatibility between \env{lateximage} and
 %		\margintag{\env{lateximage}, \SVG\ math, \env{tabular}}
 %		\env{minipage}, \cs{parbox}, \cs{makebox}, \cs{fbox}, \cs{framebox},
@@ -2533,7 +2605,7 @@
 %	\end{itemize}
 % \item[v0.32:] Bug fixes; no source changes needed:
 %	\begin{itemize}
-%	\item |lwarpmk| has been adjusted to work with the latest |luatex|.
+%	\item \prog{lwarpmk} has been adjusted to work with the latest \prog{luatex}.
 %	\item Spaces in the \cs{usepackage} and \cs{RequirePackage} package lists are now accepted and ignored.
 %	\item Fix for the \pkg{glossaries} package and \cs{glo at name}.
 %	\end{itemize}
@@ -2606,16 +2678,16 @@
 %		\end{enumerate}
 %
 %	\item The new \pkg{lwarp} package option |xdyFilename| may be used to tell
-%	|lwarpmk| to use a custom |.xdy| file instead of |lwarp.xdy|.
+%	\prog{lwarpmk} to use a custom |.xdy| file instead of |lwarp.xdy|.
 %	See \cref{sec:modifyxindy}.
 %
 %	\item Improvements in index processing:
 %		\begin{itemize}
-%		\item |xindy|'s language is now used for index processing
+%		\item \prog{xindy}'s language is now used for index processing
 %			as well as glossary.
-%		\item Print mode without |latexmk| now uses |xindy| instead of |makeindex|.
-%		\item |texindy|/|xindy| usage depends on |pdflatex| vs |xelatex|, |lualatex|.
-%		\item For |pdflatex| and |texindy|, the |-C utf8| option is used.  This is
+%		\item Print mode without \prog{latexmk} now uses \prog{xindy} instead of \prog{makeindex}.
+%		\item \prog{texindy}/\prog{xindy} usage depends on \prog{pdflatex} vs \prog{xelatex}, \prog{lualatex}.
+%		\item For \prog{pdflatex} and \prog{texindy}, the |-C utf8| option is used.  This is
 %			supported in modern distributions, but a customized |lwarpmk.lua| may
 %			need to be created for use with older distributions.
 %		\end{itemize}
@@ -2648,18 +2720,18 @@
 %		|FormatWordProcessor|.  These make it easier to identify float boundaries,
 %		which are to be manually converted to word-processor frames.
 %       Name changed to |WPMarkFloats| as of v0.42.
-%	\item Updated for the new MathJax \acro{CDN} repository.
+%	\item Updated for the new \brand{MathJax} \acro{CDN} repository.
 %	\item Adds \pkg{tabulary}.
 %	\item Supports the options syntax for \pkg{graphics}.
 %	\item Improved index references, now pointing exactly to their target.
 %	\item Adds \pkg{glossaries}.
-%		|lwarpmk| is modified to add |printglosssary| and |htmlglossary| actions.
+%		\prog{lwarpmk} is modified to add |printglosssary| and |htmlglossary| actions.
 %	\end{itemize}
 %
 % ^^A	\needspace{2\baselineskip}
 % ^^A  \item[v0.27:] \
 % ^^A 	\begin{itemize}
-% ^^A 	\item Improved documentation for MacOS install.
+% ^^A 	\item Improved documentation for \brand{MacOS} install.
 % ^^A 	\item Fix for \pkg{microtype} with \XeLaTeX\ and \LuaLaTeX.
 % ^^A 	\item Fix for table footnote paragraph tags.
 % ^^A 	\item Adds \pkg{lettrine}, \pkg{ulem}, and \pkg{soul}.
@@ -2668,7 +2740,7 @@
 % ^^A  \item[v0.26:] \
 % ^^A 	\begin{itemize}
 % ^^A 	\item Improved installation instructions for MiK\TeX\ regarding generating
-% ^^A 		the |lwarpmk| executable.
+% ^^A 		the \prog{lwarpmk} executable.
 % ^^A 	\item Footnotes are now supported by \LaTeX\ boxes instead of pagenotes.
 % ^^A 		\pkg{pagenote} now works as per the print version.
 % ^^A 		\pkg{footnote}, \pkg{footnotehyper}, \pkg{footmisc}, \pkg{endnotes},
@@ -2701,12 +2773,12 @@
 % ^^A 	\end{itemize}
 % ^^A  \item[v0.21:] \
 % ^^A 	\begin{itemize}
-% ^^A 	\item Documentation for installing on Windows has been updated and improved.
-% ^^A 	\item For Windows compatibility, the |lateximages| shell script
+% ^^A 	\item Documentation for installing on \brand{Windows} has been updated and improved.
+% ^^A 	\item For \brand{Windows} compatibility, the |lateximages| shell script
 % ^^A 		has been replaced with a |lateximages.txt| file, which is parsed
-% ^^A 		by |lwarpmk| to generate lateximages.
+% ^^A 		by \prog{lwarpmk} to generate lateximages.
 % ^^A 		This does not require any changes in the user's code.
-% ^^A 	\item Windows |lwarpmk again| now functions.
+% ^^A 	\item \brand{Windows} |lwarpmk again| now functions.
 % ^^A 	\item For improved error handling, \pkg{lwarp} now verifies the
 % ^^A 		order in which packages are loaded, and signals an error for misplaced packages.
 % ^^A 		\pkg{inputenc}, \pkg{fontenc}, \pkg{newunicode}, and \pkg{fontspec}
@@ -2717,7 +2789,7 @@
 % ^^A  \item[v0.20:] \
 % ^^A 	\begin{itemize}
 % ^^A 	\item The |makefile| and related infrastructure
-% ^^A 		has been replaced by the |lwarpmk| utility.
+% ^^A 		has been replaced by the \prog{lwarpmk} utility.
 % ^^A 		This provides increased portability, reduced dependencies,
 % ^^A 		and much simpler installation and setup.
 % ^^A 	\item The |lwarp-newproject| package is now used to locally create
@@ -2745,7 +2817,7 @@
 % ^^A 		|HTMLFilename|.)
 % ^^A 	\item \pkg{lwarp} now tries to auto-detect the operating system,
 % ^^A 		and \cs{warpOSwindows} is only needed if the auto-detection
-% ^^A 		fails to detect Windows. (As of v0.30, \cs{warpOSwindows} has been converted to
+% ^^A 		fails to detect \brand{Windows}. (As of v0.30, \cs{warpOSwindows} has been converted to
 % ^^A 		the |OSWindows| option.)
 % ^^A 	\item Tabular column types |@|, |>|, and |<| are now supported.
 % ^^A 	\item |BlockClass| and \cs{InlineClass} add an optional style.
@@ -2755,9 +2827,9 @@
 % ^^A 	\needspace{2\baselineskip}
 % ^^A  \item[v0.19:] \
 % ^^A 	\begin{itemize}
-% ^^A 	\item \textsc{MathJax} now may be used to display math via the |mathjax| option.
+% ^^A 	\item \brand{MathJax} now may be used to display math via the |mathjax| option.
 % ^^A 		See \cref{sec:loading,sec:limitsmath}.
-% ^^A 	To use MathJax with a pre-existing project,
+% ^^A 	To use \brand{MathJax} with a pre-existing project,
 % ^^A 	\watchout
 % ^^A 	copy or link the file |lwarp_mathjax.txt| to the project's directory.
 % ^^A 	\item \cs{rule} added, supporting width, height, raise, \cs{textcolor}.
@@ -2800,7 +2872,7 @@
 %
 % \section{Introduction}
 % \label{sec:introduction}
-% \changes{v0.19}{2016/05/25}{Introduction: MathJax support mentioned.}
+% \changes{v0.19}{2016/05/25}{Introduction: \brand{MathJax} support mentioned.}
 %
 % The \pkg{lwarp} project aims to allow a rich \LaTeX{} document
 % to be converted to a reasonable \HTMLfive\
@@ -2812,7 +2884,7 @@
 %
 % Several ``modern'' features of \HTMLfive, \CSSthree, and \SVG\
 % are employed to allow a fairly feature-rich document
-% without relying on the use of Javascript.
+% without relying on the use of \brand{Javascript}.
 % Limited testing on older browsers shows that these new features
 % degrade gracefully.
 %
@@ -2853,7 +2925,7 @@
 %
 % \rulebreak
 %
-% |pdflatex|, |xelatex|, or |lualatex| may be used,
+% \prog{pdflatex}, \prog{xelatex}, or \prog{lualatex} may be used,
 % allowing \pkg{lwarp} to process the usual image formats.
 % While generating \HTML\ output, \SVG\ files are used in place of \PDF.
 % Other formats such as \JPG\ are used as-is.
@@ -2876,20 +2948,20 @@
 % Custom \LaTeX{} macros may be used as-is in math expressions, since the math is evaluated
 % entirely inside \LaTeX.
 %
-% The \textsc{MathJax} JavaScript display engine may be selected
+% The \brand{MathJax} JavaScript display engine may be selected
 % for math display instead of using \SVG\ images.
 % Subject to browser support and Internet access,
-% MathJax allows an \HTML\ page to display
+% \brand{MathJax} allows an \HTML\ page to display
 % math without relying on a large number of external image files.\footnote{One \SVG\ image
 % file per math expression.  A commmon scientific paper can easily run into several thousand
 % files, depending on how often something like \$x\$ is used.
 % In testing one sample document it appears that hashing would only reduce the number in half.}
 % \pkg{lwarp} maintains \LaTeX\ control for cross-referencing
-% and equation numbering, and attempts to force MathJax to tag equations accordingly.
+% and equation numbering, and attempts to force \brand{MathJax} to tag equations accordingly.
 %
 % \rulebreak
 %
-% A |texlua| program called |lwarpmk| is used to process either the print or \HTML\
+% A \prog{texlua} program called \prog{lwarpmk} is used to process either the print or \HTML\
 % version of the document.  A few external utility programs are used to finish
 % the conversion from a \LaTeX{}-generated \PDF\ file which happens to have \HTMLfive\ tags,
 % to a number of \HTMLfive\ plain-text files and accompanying images.
@@ -2896,7 +2968,7 @@
 %
 % \pkg{lwarp} automatically generates the extra files necessary for
 % the \HTML\ conversion, such as \CSS\ and |.xdy| files, and configuration files
-% for the utility |lwarpmk|.
+% for the utility \prog{lwarpmk}.
 % Also included is a parallel version of the user's source document,
 % |<sourcename>-html.tex|, which selects \HTML\ output and then inputs the user's own source.
 % This process allows both the printed and \HTML\ versions to co-exist side-by-side,
@@ -2903,7 +2975,7 @@
 % each with their own auxiliary files.
 %
 % When requesting packages during \HTML\ conversion,
-% |lwarp| first looks to see if it has its own modified version
+% \pkg{lwarp} first looks to see if it has its own modified version
 % to use instead of the standard \LaTeX\ version.
 % These |lwarp-packagename.sty| files contain
 % code used to emulate or replace functions for \HTML\ output.
@@ -2926,6 +2998,8 @@
 % \setlength{\parindent}{0em}
 % \setlength{\parskip}{2ex}
 %
+% ^^A *supported functions
+%
 % \begin{longtable}{>{\raggedright}m{.3\linewidth}m{.6\linewidth}}
 % \caption{\protect\LaTeX--HTML generation ---
 % \pkg{lwarp} package ---
@@ -2954,7 +3028,7 @@
 % \midrule
 %
 % Page layout: & Emulates \pkg{geometry}, \pkg{fancyhdr}, \pkg{titleps},
-%       \pkg{scrlayer-scrpage}, \pkg{typearea},
+%       \pkg{scrlayer-scrpage}, \pkg{typearea}, \pkg{vmargin},
 %       \pkg{addlines}, \pkg{anysize}, \pkg{a4}, \pkg{a4wide}, \pkg{a5comb},
 %       \pkg{textarea}, \pkg{zwpagelayout}, \pkg{ebook},
 %       \pkg{preview},
@@ -2977,11 +3051,12 @@
 %
 % Front \&\ back matter: & \pkg{abstract}, \pkg{appendix}. \\
 %
-% Indexing: & \cmds{texindy} is used, with hyperlinks. \pkg{idxlayout} is emulated. \\
+% Indexing: & \prog{texindy} is used, with hyperlinks. \pkg{idxlayout} is emulated. \\
 %
-% Glossary: & \pkg{glossaries} and \cmds{xindy} are used. \\
+% Glossary: & \pkg{glossaries} and \prog{xindy} are used. \\
 %
-% Bibliography: & \pkg{cite}, \pkg{natbib}, \pkg{biblatex}, \pkg{backref}. \\
+% Bibliography: & \pkg{cite}, \pkg{natbib}, \pkg{biblatex},
+%   \pkg{chapterbib}, \pkg{backref}, \pkg{hypernat}. \\
 %
 % \midrule
 %
@@ -3003,11 +3078,11 @@
 % \midrule
 %
 % Math: & Supported.  Converted to \SVG\ images with \HTML\ \element{alt} tags containing the
-% 	\LaTeX{} source for the math expression.
-%	MathJax supported as an alternative.
-% 	\AmS{} environments are supported.
+% 	\LaTeX\ source for the math expression.
+%	\brand{MathJax} supported as an alternative.
+% 	\AmS\ environments are supported.
 % 	User-defined macros are available during converson,
-% 	due to native \LaTeX{} processing.\\
+% 	due to native \LaTeX\ processing.\\
 %
 % Theorems: & Support for native \LaTeX\ theorems, plus
 %	\pkg{theorem}, \pkg{amsthm}, \pkg{ntheorem}. \\
@@ -3022,7 +3097,7 @@
 %	\pkg{float}, \pkg{rotfloat}, \pkg{newfloat}, \pkg{caption} and \pkg{subcaption},
 %	\pkg{subfig}, \pkg{subfigure}, \pkg{capt-of}, \pkg{placeins}, \pkg{trivfloat}, \pkg{floatrow},
 %	\pkg{subfloat}, \pkg{keyfloat}, \pkg{wrapfig}, \pkg{cutwin}, \pkg{floatflt},
-%   \pkg{flafter}, \pkg{fltrace}, \pkg{endfloat}. \\
+%   \pkg{flafter}, \pkg{fltrace}, \pkg{endfloat}, \pkg{hypcap}, \pkg{stfloats}. \\
 %
 % \midrule
 %
@@ -3030,7 +3105,7 @@
 %   \env{tabular} environment, \pkg{array}, \pkg{tabularx}, \pkg{tabulary},
 %   \pkg{threeparttable}, \pkg{multirow},
 %   \pkg{longtable}, \pkg{supertabular}, \pkg{xtab}, \pkg{ltxtable},
-%   \pkg{booktabs}. \\
+%   \pkg{booktabs}, \pkg{colortbl}.\\
 %
 % \midrule
 %
@@ -3082,6 +3157,8 @@
 %
 % \midrule
 %
+% Acronyms: & \pkg{acro}, \pkg{acronym}. \\
+%
 % Todo notes: & \pkg{todo}, \pkg{todonotes}, \pkg{easy-todo},
 %   \pkg{fixmetodonotes}, \pkg{fixme}, \pkg{changebar}. \\
 %
@@ -3145,7 +3222,7 @@
 %
 % \subsection{Internet class}
 %
-% \changes{v0.21}{2017/02/15}{Docs: Added \protect\texttt{internet} class.}
+% \changes{v0.21}{2017/02/15}{Docs: Added \pkg{internet} class.}
 %
 % The closest to \pkg{lwarp} in design principle is the
 % \DescribeClass{internet}
@@ -3313,7 +3390,7 @@
 %
 % \begin{description}
 %
-% \item[\LaTeX:] |pdflatex|, |xelatex|, or |lualatex|.
+% \item[\LaTeX:] \prog{pdflatex}, \prog{xelatex}, or \prog{lualatex}.
 %	\DescribeProgram[requirement]{pdfLaTeX}
 %	\DescribeProgram[requirement]{XeLaTeX}
 %	\DescribeProgram[requirement]{LuaLaTeX}
@@ -3320,38 +3397,38 @@
 %
 % \item[The \pkg{lwarp} package:] This package.
 %
-% \item[The |lwarpmk| utility:] Provided along with this package.  This
+% \item[The \prog{lwarpmk} utility:] Provided along with this package.  This
 %	should be an operating-system executable in the same way that
-%	|pdflatex| or |latexmk| is.  It is possible to have the
-%	\pkg{lwarp} package generate a local copy of |lwarpmk|
+%	\prog{pdflatex} or \prog{latexmk} is.  It is possible to have the
+%	\pkg{lwarp} package generate a local copy of \prog{lwarpmk}
 %	called |lwarpmk.lua|.
 %	See \cref{sec:genlatexmk}.
 %
-% \item[luatex:] Used by the |lwarpmk| program to simplify and automate document generation.
+% \item[\prog{luatex}:] Used by the \prog{lwarpmk} program to simplify and automate document generation.
 %
-% \item [xindy:] The \pkg{xindy} package is used by \pkg{lwarp} to create
+% \item [\prog{xindy}:] The \prog{xindy} program is used by \pkg{lwarp} to create
 %	indexes.  On a MiK\TeX\ system this may have to be acquired separately,
 %	but it is part of the regular installer as of mid 2015.
 %
-% \item[latexmk:] Optionally used by |lwarpmk| to compile \LaTeX\ code.
-%	On a MiK\TeX\ system, Perl may need to be installed first.
+% \item[\prog{latexmk}:] Optionally used by \prog{lwarpmk} to compile \LaTeX\ code.
+%	On a MiK\TeX\ system, \prog{Perl} may need to be installed first.
 %
-% \item[pdfcrop:] Used to pull images out of the \LaTeX{} \PDF.
+% \item[\prog{pdfcrop}:] Used to pull images out of the \LaTeX{} \PDF.
 %	\DescribeProgram[requirement]{pdfcrop}
 %
 % \end{description}
 %
-% \item[Poppler PDF utilities:] \
+% \item[\brand{Poppler} \PDF\ utilities:] \
 %
 % \begin{description}
 %
-% \item[pdftotext:] Used to convert \PDF\ to text.
+% \item[\prog{pdftotext}:] Used to convert \PDF\ to text.
 %	\DescribeProgram[requirement]{pdftotext}\index{Poppler}
 %
-% \item[pdfseparate:] Used to pull images out of the \LaTeX{} \PDF.
+% \item[\prog{pdfseparate}:] Used to pull images out of the \LaTeX{} \PDF.
 %	\DescribeProgram[requirement]{pdfseparate}
 %
-% \item[pdftocairo:] Used to convert images to \SVG.
+% \item[\prog{pdftocairo}:] Used to convert images to \SVG.
 %	\DescribeProgram[requirement]{pdftocairo}
 %
 % \end{description}
@@ -3358,20 +3435,20 @@
 %
 %	These might be provided by your operating-system package manager.
 %
-%	From Poppler: \url{poppler.freedesktop.org}.
+%	From \brand{Poppler}: \url{poppler.freedesktop.org}.
 %
-%	For MacOS\textregistered, see
-%		\url{https://brew.sh/}, install Homebrew, then
+%	For \brand{MacOS}\textregistered, see
+%		\url{https://brew.sh/}, install \prog{Homebrew}, then
 %		\userentry{brew install poppler}
 %
-%	For Windows, see: \\
+%	For \brand{Windows}, see: \\
 %		\url{https://sourceforge.net/projects/poppler-win32/} \quad and: \\
 %		\url{http://blog.alivate.com.au/poppler-windows/}
 %
-% \item[Perl:] \
+% \item[\prog{Perl}:] \
 %
 % This may be provided by your operating-system package manager, and is
-% required for some of the Poppler \PDF\ utilities.
+% required for some of the \brand{Poppler} \PDF\ utilities.
 %
 % \url{strawberryperl.com} (recommended), \url{perl.org}
 %
@@ -3378,7 +3455,7 @@
 % \item[Automatically downloaded from the internet as required:] \
 % \begin{description}
 %
-% \item[MathJax:] Optionally used to display math.
+% \item[\brand{MathJax}:] Optionally used to display math.
 %	From: \url{mathjax.org}
 %	\DescribeProgram[requirement]{MathJax}
 %
@@ -3404,7 +3481,7 @@
 %   you may skip to the next section.
 %
 % \item [\TeX\ Live:] If using a \TeX\ Live distribution,
-%	try installing via |tlmgr|:
+%	try installing via \prog{tlmgr}:
 %	\userentry{tlmgr install lwarp}
 %
 % \item [MiK\TeX:] If using MiK\TeX:
@@ -3412,14 +3489,14 @@
 %   \item  To install \pkg{lwarp} the first time,
 %       use the \pkg{MikTeX Package Manager (Admin)}.
 %   \item To update \pkg{lwarp}, use \pkg{MikTeX Update (Admin)}.
-%	\item Either way, also update the package |miktex-misc|, which will install and
-%       update the |lwarpmk| executable.
+%	\item Either way, also update the package \pkg{miktex-misc}, which will install and
+%       update the \prog{lwarpmk} executable.
 %   \end{enumerate}
 % \changes{v0.26}{2017/03/23}{Docs: Improved MiK\TeX\ install instructions.}
 % \changes{v0.45}{2017/11/30}{Docs: Improved MiK\TeX\ install instructions.}
 %
 % \item [Operating-system package:] The operating-system package manager may
-%	already have |lwarp|, perhaps as part of a set of \TeX-related packages.
+%	already have \pkg{lwarp}, perhaps as part of a set of \TeX-related packages.
 %
 % \item [CTAN TDS archive:] \pkg{lwarp} may be downloaded from the Comprehensive \TeX\ Archive:
 %	\begin{enumerate}
@@ -3443,7 +3520,7 @@
 %		\userentry{mktexlsr} \quad —\,or\,—
 %		\userentry{texhash}
 %
-%		Or, for Windows MiK\TeX, start the program called |MiKTeX Settings (Admin)|
+%		Or, for \brand{Windows} MiK\TeX, start the program called \prog{MiKTeX Settings (Admin)}
 %		and click on the button called \textsf{Refresh FNDB}.
 %	\end{enumerate}
 %
@@ -3472,10 +3549,10 @@
 %		\userentry{mktexlsr} \quad —\,or\,—
 %		\userentry{texhash}
 %
-%		Or, for Windows MiK\TeX, start the program called |MiKTeX Settings (Admin)|
+%		Or, for \brand{Windows} MiK\TeX, start the program called \prog{MiKTeX Settings (Admin)}
 %		and click on the button called \textsf{Refresh FNDB}.
 %
-%	\item See \cref{sec:locallwarpmk} to generate your local copy of |lwarpmk|.
+%	\item See \cref{sec:locallwarpmk} to generate your local copy of \prog{lwarpmk}.
 %	\item Once the local version of |lwarpmk.lua| is installed, it may be made
 %		available system-wide as per \cref{sec:installlwarpmk}.
 %	\end{enumerate}
@@ -3489,27 +3566,27 @@
 %		\pkg{lwarp} before deciding whether to permanently install it.
 % \end{description}
 %
-% \subsection{Installing the \protect\texttt{lwarpmk} utility}
+% \subsection{Installing the \prog{lwarpmk} utility}
 % \label{sec:installlwarpmk}
 %
-% \changes{v0.21}{2017/02/22}{Docs: Installing on Windows.}
+% \changes{v0.21}{2017/02/22}{Docs: Installing on \brand{Windows}.}
 %
 % {\small
-% (Note: If |lwarpmk| is not already installed,
+% (Note: If \prog{lwarpmk} is not already installed,
 % it is easiest to use a local copy instead of installing it system-wide.
 % See \cref{sec:locallwarpmk}.)
 % }
 %
 % After the \pkg{lwarp} package is installed,
-% you may need to setup the |lwarpmk| utility:
+% you may need to setup the \prog{lwarpmk} utility:
 % \begin{enumerate}
-% \item At a command line, try executing |lwarpmk|.  If the |lwarpmk| help message
-%	appears, then |lwarpmk| is already set up.
+% \item At a command line, try executing \prog{lwarpmk}.  If the \prog{lwarpmk} help message
+%	appears, then \prog{lwarpmk} is already set up.
 %	If not, it is easiest to generate and use a local copy.
 %	See \cref{sec:locallwarpmk}.
 %
-% \item For MiK\TeX, try updating the |miktex-misc| package.  This may install
-% the |lwarpmk| executable for you.
+% \item For MiK\TeX, try updating the \pkg{miktex-misc} package.  This may install
+% the \prog{lwarpmk} executable for you.
 % \changes{v0.26}{2017/03/23}{Docs: Improved MiK\TeX\ install instructions.}
 %
 %	Otherwise, continue with the following:
@@ -3521,7 +3598,7 @@
 %	(If the file is not found, you may also generate a local copy and use it instead.
 %	See \cref{sec:locallwarpmk}.)
 %
-% \item Create |lwarpmk|:
+% \item Create \prog{lwarpmk}:
 %	\begin{description}
 %	\item [Unix:] Create a symbolic link and make it executable:
 %		\begin{enumerate}
@@ -3537,7 +3614,7 @@
 %			|/usr/local/texlive/<year>/bin/<architecture>/|
 %		\end{sourcedisplay}
 %			In this directory you will find programs
-%			such as |pdflatex| and |makeindex|.
+%			such as \prog{pdflatex} and \prog{makeindex}.
 %		\item In the binaries directory,
 %			create a new symbolic link from the binaries directory to |lwarpmk.lua|:
 %			\userentry{ln -s <pathtolwarpmk.lua> lwarpmk}
@@ -3544,7 +3621,7 @@
 %		\item Make the link executable:
 %			\userentry{chmod 0755 lwarpmk}
 %		\end{enumerate}
-%	\item [Windows \TeX\ Live:] Create a new |lwarpmk.exe| file:
+%	\item [\brand{Windows} \TeX\ Live:] Create a new |lwarpmk.exe| file:
 %		\begin{enumerate}
 %		\item Locate the \TeX\ Live binaries as shown above for Unix.
 %		\item In the binaries directory, make a \emph{copy} of |runscript.exe|
@@ -3552,7 +3629,7 @@
 %			This will call the copy of |lwarpmk.lua|
 %			which is in the |scripts| directory of the distribution.
 %		\end{enumerate}
-%	\item [Windows MiK\TeX:] Create a new |lwarpmk.bat| file:
+%	\item [\brand{Windows} MiK\TeX:] Create a new |lwarpmk.bat| file:
 %		\begin{enumerate}
 %		\item Locate the binaries.  These will be in a directory such as:
 %		\begin{sourcedisplay}
@@ -3571,16 +3648,16 @@
 %	\end{description}
 % \end{enumerate}
 %
-% \subsubsection{Using a local copy of \pkg{lwarpmk}}
+% \subsubsection{Using a local copy of \prog{lwarpmk}}
 % \label{sec:locallwarpmk}
-% It is also possible to use a local version of |lwarpmk|:
+% It is also possible to use a local version of \prog{lwarpmk}:
 % \begin{enumerate}
 % \item When compiling the tutorial in \cref{sec:tutorial},
-%	use the |lwarpmk| option for the \pkg{lwarp} package:
+%	use the \prog{lwarpmk} option for the \pkg{lwarp} package:
 %	\begin{sourcedisplay}
 %	|\usepackage[lwarpmk]{lwarp}|
 %	\end{sourcedisplay}
-% \item When the tutorial is compiled with |pdflatex|, the file |lwarpmk.lua|
+% \item When the tutorial is compiled with \prog{pdflatex}, the file |lwarpmk.lua|
 %	will be generated along with the other configuration files.
 % \item |lwarpmk.lua| may be used for this project:
 %	\begin{description}
@@ -3592,7 +3669,7 @@
 %				\userentry{./lwarpmk.lua print} \quad etc.
 %			\item It may be useful to rename or link to a version without the |.lua| suffix.
 %			\end{enumerate}
-%		\item[Windows:] \
+%		\item[\brand{Windows}:] \
 %
 %			Compile documents with either of the following, depending
 %			on which command shell is being used:
@@ -3609,7 +3686,7 @@
 %
 % \subsection{Installing additional utilities}
 %
-% \changes{v0.27}{2017/04/02}{Docs: Installing utilities for MacOS.}
+% \changes{v0.27}{2017/04/02}{Docs: Installing utilities for \brand{MacOS}.}
 %
 % \begin{description}
 % \item [To test for the existence of the additional utilities:] \
@@ -3628,11 +3705,11 @@
 %	\userentry{pdftocairo -v}
 % \changes{v0.45}{2017/11/30}{Docs: Fix for double hyphens.}
 %
-% \item [To install |xindy|, |latexmk|, and |pdfcrop|:] \
+% \item [To install \prog{xindy}, \prog{latexmk}, and \prog{pdfcrop}:] \
 %
-% The \TeX\ utilities |xindy|, |latexmk|, and |pdfcrop| may be installed
-% in TexLive with |tlmgr|, installed by MikTeX, provided by
-% your operating system's package manager, or downloaded from the \CTAN\ archive:
+% The \TeX\ utilities \prog{xindy}, \prog{latexmk}, and \prog{pdfcrop} may be installed
+% in \prog{TexLive} with \prog{tlmgr}, installed by \prog{MikTeX}, provided by
+% your operating system's package manager, or downloaded from the \prog{CTAN} archive:
 % \changes{v0.45}{2017/11/30}{Docs: Improved install instructions.}
 %	\begin{sourcedisplay}
 % \url{http://ctan.org/pkg/xindy} \\
@@ -3641,30 +3718,30 @@
 %	\end{sourcedisplay}
 %
 %
-% \item [To install the Poppler utilities to a Unix/Linux system:] \
+% \item [To install the \brand{Poppler} utilities to a Unix/Linux system:] \
 %	\DescribeProgram[requirement]{pdftotext}\index{Poppler}
 %	\DescribeProgram[requirement]{pdfseparate}
 %	\DescribeProgram[requirement]{pdftocairo}
 %
-% The tools from the \textsc{Poppler} project should be provided by your
+% The tools from the \brand{Poppler} project should be provided by your
 % operating system's package manager.
 %
 %
-% \item [To install the Poppler utilities to a MacOS machine:] \
+% \item [To install the \brand{Poppler} utilities to a \brand{MacOS} machine:] \
 %	\begin{enumerate}
-%	\item Install Homebrew from \url{https://brew.sh/}:
+%	\item Install \prog{Homebrew} from \url{https://brew.sh/}:
 %		\userentry{\small~ \\ \hspace*{-2in}/usr/bin/ruby -e "\$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"}
-%	\item Install the Poppler utilities:
+%	\item Install the \brand{Poppler} utilities:
 %		\userentry{brew install poppler}
 %	\end{enumerate}
 %
 %
-% \item [To install the Poppler utilities to a Windows machine:] \
+% \item [To install the \brand{Poppler} utilities to a \brand{Windows} machine:] \
 %
 % \begin{enumerate}
 % \item See \cref{tab:utility} on \cpageref{tab:utility}.
-% \item Download and extract the Poppler utilities |pdftotext|, |pdfseparate|,
-% and |pdftocairo| to a directory, such as |Poppler|.
+% \item Download and extract the \brand{Poppler} utilities \prog{pdftotext}, \prog{pdfseparate},
+% and \prog{pdfseparate} to a directory, such as |Poppler|.
 % \item In the Start window, type "Path" to search for results
 % related to Path.  Or, open the control panel and search for "Path".
 % \item Choose "Edit the system environment variables" in the control panel.
@@ -3671,7 +3748,7 @@
 % \item Choose the "Environment Variables" button.
 % \item Choose the "Path" variable, then the "Edit" button.
 % \item Choose the "New" button to make an additional entry.
-% \item Enter the |bin| directory of the Poppler utilities, such as:
+% \item Enter the |bin| directory of the \brand{Poppler} utilities, such as:
 %	\begin{sourcedisplay}
 %	|C:\Users\<myname>\Desktop\Poppler\poppler-0.5_x86\poppler-0.5\bin|
 %	\end{sourcedisplay}
@@ -3681,13 +3758,13 @@
 % \end{enumerate}
 %
 % \needspace{2\baselineskip}
-% \item [To install Perl to a Windows machine:] \
+% \item [To install \prog{Perl} to a \brand{Windows} machine:] \
 % \DescribeProgram[requirement]{perl}\index{Perl}
 % \begin{enumerate}
-% \item Download and install a version of Perl, such as Straweberry Perl,
+% \item Download and install a version of \prog{Perl}, such as \brand{Straweberry Perl},
 %	to a directory without a space in its name, such as |C:\Strawberry|.
-% \item Edit the Path as seen above for the Poppler utilities.
-% \item Enter the |bin| directory of the Perl utility, such as:
+% \item Edit the Path as seen above for the \brand{Poppler} utilities.
+% \item Enter the |bin| directory of the \prog{Perl} utility, such as:
 %	\begin{sourcedisplay}
 %	|C:\Strawberry\perl\bin|
 %	\end{sourcedisplay}
@@ -3744,7 +3821,7 @@
 %	renamed as |tutorial.tex|.
 %	\end{description}
 %
-%	\emph{When using Windows, use an editor other than Notepad,
+%	\emph{When using \brand{Windows}, use an editor other than Notepad,
 %	\watchout[Bad formatting!]
 %	since Notepad does not accept the end-of-line from a Unix text file.}
 %
@@ -3751,7 +3828,7 @@
 % \item Compile the project: \userentry{pdflatex tutorial.tex}
 %				\quad (several times)
 %
-% (|xelatex| or |lualatex| may be used as well.)
+% (\prog{xelatex} or \prog{lualatex} may be used as well.)
 %
 % \item View the resulting |tutorial.pdf| with a \PDF\ viewer.
 %
@@ -3762,12 +3839,12 @@
 % shown in \cref{fig:newprojectfiles}.  These files are created by
 % the |lwarp| package.
 %
-% (Two of the new files are configuration files for the helper program |lwarpmk|.
+% (Two of the new files are configuration files for the helper program \prog{lwarpmk}.
 % Whenever a print version of the document is created,
-% the configuration files for |lwarpmk| are updated to
-% record the operating system, \LaTeX\ program (|pdflatex|, |xelatex|, or |lualatex|),
+% the configuration files for \prog{lwarpmk} are updated to
+% record the operating system, \LaTeX\ program (\prog{pdflatex}, \prog{xelatex}, or \prog{lualatex}),
 % the filenames of the source code and \HTML\ output, and whether
-% the additional helper program |latexmk| will be used to compile the document.)
+% the additional helper program \prog{latexmk} will be used to compile the document.)
 %
 %
 %
@@ -3816,11 +3893,11 @@
 %	When an \HTML\ version of the document is created, |_html| versions
 %	of the auxiliary files will also be generated.
 %
-% \item [|lwarpmk.conf|:] A configuration file for |lwarpmk|,
+% \item [|lwarpmk.conf|:] A configuration file for \prog{lwarpmk},
 %	which is used to automate the compilation of \PDF\ or \HTML\
 %	versions of the document.
 %
-% \item [|tutorial.lwarpmkconf|:] Another configuration file used by |lwarpmk|,
+% \item [|tutorial.lwarpmkconf|:] Another configuration file used by \prog{lwarpmk},
 %	which is only useful if you wish to have several projects
 %	residing in the same directory.
 %
@@ -3836,7 +3913,7 @@
 %	A custom file may be used instead, if necessary.
 %
 % \item [|lwarp\_mathjax.txt|:] Inserted into the \HTML\ files when
-%	|MathJax| is used to display math.
+%	\brand{MathJax} is used to display math.
 %	This file should not be modified by the user.
 %
 % \item [|comment.cut|:] A temporary file used by \pkg{lwarp} to
@@ -3845,9 +3922,9 @@
 %
 % \hrule \medskip
 % \label{sec:genlatexmk}
-% When the |lwarpmk| option is given to the \pkg{lwarp} package:
+% When the \prog{lwarpmk} option is given to the \pkg{lwarp} package:
 % \begin{description}
-% \item [|lwarpmk.lua|:] A local copy of the |lwarpmk| utility.
+% \item [|lwarpmk.lua|:] A local copy of the \prog{lwarpmk} utility.
 %
 %	On Unix-related operating systems this file must be made executable:
 %	\begin{sourcedisplay}
@@ -3862,9 +3939,9 @@
 %
 % \clearpage
 %
-% \subsection{Compiling the print version with \texttt{lwarpmk}}
+% \subsection{Compiling the print version with \prog{lwarpmk}}
 %
-% The |lwarpmk| utility program is used to compile either the printed or
+% The \prog{lwarpmk} utility program is used to compile either the printed or
 % the \HTML\ version of the document.
 %
 % |lwarpmk print| is used to recompile a printed version of the document.
@@ -3873,9 +3950,9 @@
 %
 % \item Re-compile the print version: \userentry{lwarpmk print}
 %
-%	|lwarpmk| prints an introduction then checks to see if the document
+%	\prog{lwarpmk} prints an introduction then checks to see if the document
 %	must be recompiled.  If it seems that the files are up-to-date, then
-%	|lwarpmk| informs you of that fact and then exits.
+%	\prog{lwarpmk} informs you of that fact and then exits.
 %
 % \item Make a small change in the original document,
 %	such as adding a space character.
@@ -3891,7 +3968,7 @@
 %
 % |lwarpmk again| updates the date code for the file,
 %	triggering a recompile the next time the document is made.\footnote{
-%	Although, when using the utility |latexmk| (introduced later), the changed date is
+%	Although, when using the utility \prog{latexmk} (introduced later), the changed date is
 %	ignored and an actual change in contents must occur to cause a recompile.}
 %
 % \item Process the index.\index{index>processing}\footnote{A \texttt{lwarpmk printglossary} command is also
@@ -3913,7 +3990,7 @@
 %
 % \clearpage
 %
-% \subsection{Compiling the HTML version with \texttt{lwarpmk}}
+% \subsection{Compiling the HTML version with \prog{lwarpmk}}
 %
 % |lwarpmk html| is used to recompile an \HTML\ version of the document.
 %
@@ -3922,13 +3999,13 @@
 %	\userentry{lwarpmk html}
 %
 %	\begin{enumerate}
-%	\item |lwarpmk| uses \LaTeX\ to process |tutorial_html.tex|
+%	\item \prog{lwarpmk} uses \LaTeX\ to process |tutorial_html.tex|
 %		to create \\
 %		|tutorial_html.pdf|.
-%	\item |pdftotext| is then used to convert to the file |tutorial_html.html|.
+%	\item \prog{pdftotext} is then used to convert to the file |tutorial_html.html|.
 %		This file is a plain-text file containing \HTML\ tags and
 %		content for the entire document.
-%	\item |lwarpmk| manually splits |tutorial_html.html| into
+%	\item \prog{lwarpmk} manually splits |tutorial_html.html| into
 %		individual \HTML\ files according to the \HTML\ settings.
 %		For this tutorial, the result is |tutorial.html| (the home page),
 %		along with |First-chapter.html|\footnote{
@@ -3949,7 +4026,7 @@
 %	\margintag{math}
 %	until the
 %	images of the math expressions have been generated.  Math may be
-%	displayed as \SVG\ images or by a MathJax script, as seen in
+%	displayed as \SVG\ images or by a \brand{MathJax} script, as seen in
 %	\cref{sec:tutorialsvgmath,sec:tutorialmathjax}.
 %
 % \item Force a recompile:
@@ -3985,7 +4062,7 @@
 % the math displays as it was drawn by \LaTeX, and the \LaTeX\ source
 % may be copied and pasted into some other document.
 %
-% \pkg{lwarp} uses the same mechanism for |picture| and \tikz\ environments.
+% \pkg{lwarp} uses the same mechanism for \env{picture} and \tikz\ environments.
 % \margintag{\env{picture} and \tikz}
 %
 % \begin{enumerate}
@@ -4005,11 +4082,11 @@
 %
 % \clearpage
 %
-% \subsection{Using MathJax for math}
+% \subsection{Using \brand{MathJax} for math}
 % \label{sec:tutorialmathjax}
 %
-% Math may also be represented using the MathJax Javascript project.
-% \margintag{math with MathJax}
+% Math may also be represented using the \brand{MathJax} \brand{Javascript} project.
+% \margintag{math with \brand{MathJax}}
 %
 % \begin{enumerate}
 % \item In the tutorial's source code, uncomment the |mathjax| package option for \pkg{lwarp}:
@@ -4022,13 +4099,13 @@
 % \item Reload the math page.
 % \end{enumerate}
 %
-% MathJax requires web access unless a local copy of MathJax is available,
-% \watchout[MathJax requirements]
-% and it also requires that Javascript is enabled for the web page.
-% The math is rendered by MathJax.  Right-click on math to see several
+% \brand{MathJax} requires web access unless a local copy of \brand{MathJax} is available,
+% \watchout[\brand{MathJax} requirements]
+% and it also requires that \brand{Javascript} is enabled for the web page.
+% The math is rendered by \brand{MathJax}.  Right-click on math to see several
 % options for rendering, and for copying the \LaTeX\ source.
 %
-% While using MathJax has many advantages, it may not be able to represent
+% While using \brand{MathJax} has many advantages, it may not be able to represent
 % complex expressions or spacing adjustments as well as \LaTeX, and it
 % may not support some math-related packages.
 %
@@ -4067,9 +4144,9 @@
 %
 % \clearpage
 %
-% \subsection{Using \texttt{latexmk}}
+% \subsection{Using \prog{latexmk}}
 %
-% |latexmk| is a \LaTeX\ utility used to monitor changes in source files
+% \prog{latexmk} is a \LaTeX\ utility used to monitor changes in source files
 % and recompile as needed.
 %
 % \begin{enumerate}
@@ -4085,8 +4162,8 @@
 %	\begin{sloppy}
 %	\pkg{lwarp} updates its own configuration files (|lwarpmk.conf| and \newline
 %	|tutorial.lwarpmkconf|) whenever the printed version of the document
-%	is compiled.  These configuration files remember that |lwarpmk| should
-%	use |latexmk| to compile the document.
+%	is compiled.  These configuration files remember that \prog{lwarpmk} should
+%	use \prog{latexmk} to compile the document.
 %	\end{sloppy}
 %
 % \item Recompile the document.
@@ -4096,8 +4173,8 @@
 %
 % Changes are detected by comparing checksums
 % rather than modification times, so |lwarpmk again| will not trigger a
-% recompile, but |latexmk| has a much better awareness of changes than
-% the |lwarpmk| utility does and it is likely to correctly know when to
+% recompile, but \prog{latexmk} has a much better awareness of changes than
+% the \prog{lwarpmk} utility does and it is likely to correctly know when to
 % recompile.  A recompile may be forced by making a small change to the source.
 %
 % A single recompile may be forced with:
@@ -4117,14 +4194,14 @@
 % \item Remove the auxiliary files for the project:
 %	\userentry{lwarpmk cleanall}
 %
-% \item Use |xelatex| or |lualatex| to recompile the printed version.
+% \item Use \prog{xelatex} or \prog{lualatex} to recompile the printed version.
 %	\userentry{xelatex tutorial.tex} \quad -or-
 %	\userentry{lualatex tutorial.tex}
 %
 %	When the recompile occurs,
-%	the configuration files for |lwarpmk| are modified to remember
+%	the configuration files for \prog{lwarpmk} are modified to remember
 %	which \TeX\ engine was used.  \XeLaTeX\ or \LuaLaTeX\ will be used for
-%	future runs of |lwarpmk|.
+%	future runs of \prog{lwarpmk}.
 %
 % \item To recompile the document:
 %	\userentry{lwarpmk print} \quad -and-
@@ -4187,7 +4264,7 @@
 % \subsection{Processing multiple projects in the same directory}
 %
 % It is possible to have several projects in the same directory.
-% |lwarpmk| has an optional parameter which is the document to compile.
+% \prog{lwarpmk} has an optional parameter which is the document to compile.
 %
 % To create each project:
 % \userentry{pdflatex project\_a}
@@ -4205,17 +4282,57 @@
 %
 % \subsection{Using the \texttt{make} utility}
 %
-% |lwarpmk| has an action which may be useful for integration with the
-% common |make| utility:
+% \prog{lwarpmk} has an action which may be useful for integration with the
+% common \prog{make} utility:
 %	\begin{sourcedisplay}
 %	|lwarpmk pdftohtml [project]|
 %	\end{sourcedisplay}
 %
-% |make| may be used to compile the code to \PDF\ with \HTML\
-% tags (|project_html.pdf|), then |lwarpmk| may be used to
+% \prog{make} may be used to compile the code to \PDF\ with \HTML\
+% tags (|project_html.pdf|), then \prog{lwarpmk} may be used to
 % convert each target to \HTML\ files.
 %
 %
+% \subsection{Converting an existing document}
+% \label{sec:convertexisting}
+%
+% \index{modifying>document}
+% \index{adapting>document}
+% \index{converting>document}
+% \index{document>convert existing}
+%
+% \changes{v0.48}{2018/02/05}{Docs: Converting an existing document.}
+%
+% To convert an existing document for use with \pkg{lwarp}:
+% \begin{enumerate}
+% \item Arrange the document in the following order:
+% \begin{enumerate}
+%   \item Declare the \cs{documentclass}.
+%   \item Load text fonts.
+%   \item Load \pkg{inputenc}, \pkg{fontenc}, and/or \pkg{fontspec}.
+%   \item Load \pkg{lwarp}.
+%   \item Load remaining packages.
+% \end{enumerate}
+% \item Also modify the document:
+% \begin{enumerate}
+%   \item Change \cs{includegraphics} \PDF\ filenames
+%       from |filename.pdf| to |filename| without a suffix.
+%       Other image formats may be left unmodified,
+%           or may be loaded without a file suffix.
+%   \item Possible changes to \env{tabular} environments:
+%       |*| columns, \pkg{multirow}, \pkg{longtable}, \pkg{supertabular}, \pkg{xtab},
+%       \pkg{bigdelim}.  See \cref{sec:limitstabular}.
+%   \item Possible option clashes with \pkg{memoir}.  See \cref{sec:limitsmemoir}.
+%   \item Other changes as per \cref{sec:limitations}.
+% \end{enumerate}
+% \item Create an SVG version of any PDF image.
+% \item Manually compile print version with \prog{pdflatex},
+%           \prog{lualatex}, or \prog{xelatex}.
+% \item |lwarpmk print| to finish the print version.
+% \item |lwarpmk html| to create the \HTML\ version.
+% \item |lwarpmk limages| to create the \SVG\ images of any \SVG\ math, \env{lateximage}, \tikz, etc.
+% \end{enumerate}
+%
 % \clearpage
 %
 % \section{Additional details}
@@ -4232,19 +4349,19 @@
 % \changes{v0.16}{2016/04/08}{Docs: Font and UTF-8 support.}
 % \changes{v0.16}{2016/04/08}{Lwarp no longer selects fonts.}
 %
-% \pkg{lwarp} uses |pdftotext| to convert \PDF\ output into UTF-8-encoded
+% \pkg{lwarp} uses \prog{pdftotext} to convert \PDF\ output into UTF-8-encoded
 % text.  This process requires that UTF-8 information be embedded in the \PDF\
 % file, which usually prevents the use of older bit-mapped fonts.
 % \index{font>bitmapped}
 %
-% While using |pdflatex|,
+% While using \prog{pdflatex},
 % \margintag{pdflatex, T1, UTF8}
-% \pkg{fontspec} is automatically loaded with T1 encoding,
+% \pkg{fontenc} is automatically loaded with T1 encoding,
 % and \pkg{inputenc} is automatically loaded with UTF8 encoding, each of which
 % is required for the conversion process.
-% \pkg{fontspec} may be loaded with an additional encoding after \pkg{lwarp}.
+% \pkg{fontenc} may be loaded with an additional encoding after \pkg{lwarp}.
 %
-% While using |pdflatex|, if no font-related package is specified, the default
+% While using \prog{pdflatex}, if no font-related package is specified, the default
 % \margintag{vector fonts}
 % bit-mapped Computer Modern font is used,
 % \margintag{Computer Modern}%
@@ -4271,7 +4388,7 @@
 % Do NOT use \pkg{fontenc}!
 %
 % Place \pkg{fontspec} or \pkg{fontenc} and other font and UTF-8 related commands
-% after the |\documentclass| command and before |\usepackage{lwarp}|:
+% after the \cs{documentclass} command and before |\usepackage{lwarp}|:
 %
 % \begin{enumerate}
 % \item |documentclass{article/book/report}| goes here, followed by any of:
@@ -4296,7 +4413,7 @@
 % \defaultfontfeatures[\ttfamily]{Ligatures=NoCommon}
 % \end{Verbatim}
 % \end{itemize}
-% \item For |pdflatex|:
+% \item For \prog{pdflatex}:
 % \begin{itemize}
 % \item \pkg{lmodern} or other font-related packages
 %	\DescribePackage{lmodern}
@@ -4325,6 +4442,9 @@
 % \end{itemize}
 % \end{itemize}
 % \item |\usepackage{lwarp}| (\cref{sec:loading}) goes after any of the above, followed by:
+% \item |\usepackage{newtxmath}| or other math-related font packages.
+%       Many of these load \pkg{amsmath}, which must be loaded after \pkg{lwarp},
+%       so they must also be loaded after \pkg{lwarp}.
 % \item \ldots{} the rest of the preamble and the main document.
 % \end{enumerate}
 %
@@ -4333,12 +4453,12 @@
 % \index{UTF-8>index}
 % \index{index>UTF-8}
 %
-% \pkg{lwarp} uses the |xindy| program to processes indexes.
+% \pkg{lwarp} uses the \prog{xindy} program to processes indexes.
 %
-% While using |xelatex| or |lualatex|, |xindy| is used for the index.
+% While using \prog{xelatex} or \prog{lualatex}, \prog{xindy} is used for the index.
 % Everything is handled in UTF-8 encoding, and should work as expected.
 %
-% While using |pdflatex|, the |texindy| program is used with the |-C utf8| option,
+% While using \prog{pdflatex}, the \prog{texindy} program is used with the |-C utf8| option,
 % which is newly supported in recent distributions of \LaTeX.  This option correctly
 % sorts index entries into headings while using Latin languages, but will not work
 % well with others.  \XeLaTeX\ or \LuaLaTeX\ are recommended for non-Latin languages.
@@ -4362,16 +4482,16 @@
 % warpprint & Generate print output, and also generate configuration files. \\
 % warpHTML & Generate \HTML\ output. \\
 % mathsvg & Show math using \SVG\ images. \\
-% mathjax & Show math using MathJax. \\
-% OSWindows & Force compatibility with MS-Windows. \\
+% mathjax & Show math using \brand{MathJax}. \\
+% OSWindows & Force compatibility with \brand{MS-Windows}. \\
 % BaseJobname & The \cs{jobname} to use.
 %   Set to the \cs{jobname} of the printed version even while generating \HTML. \\
 % HomeHTMLFilename & The filename of the home page. \\
 % HTMLFilename & A prefix for the filenames of the remaining web pages. \\
-% IndexLanguage & The |xindy| language option used for index and glossary generation. \\
-% latexmk & Boolean for |lwarpmk| to use |latexmk| for compiling documents. \\
+% IndexLanguage & The \prog{xindy} language option used for index and glossary generation. \\
+% latexmk & Boolean for \prog{lwarpmk} to use \prog{latexmk} for compiling documents. \\
 % lwarpmk & Generate a local copy of |lwarpmk.lua|. \\
-% xdyFilename & Set a custom filename for |xindy|. \\
+% xdyFilename & Set a custom filename for \prog{xindy}. \\
 % \bottomrule
 % \end{tabular}
 % \end{table}
@@ -4388,11 +4508,11 @@
 %
 % \DescribeOption{warpprint}
 % \DescribeOption{warpHTML}
-% Usually controlled by |lwarpmk|, and not set in the document.
+% Usually controlled by \prog{lwarpmk}, and not set in the document.
 % Select the |warpprint| option to generate print output (default),
 % or the |warpHTML| option to generate \HTMLfive{} output.
 % The default is print output, so the print version may be
-% compiled with the usual |pdflatex|, etc.
+% compiled with the usual \prog{pdflatex}, etc.
 % When \pkg{lwarp} is loaded in print mode, it creates
 % |<project>_html.tex|, which sets the |warpHTML| option before calling
 % the user's source code |<project>.tex|.  In this way, |<project>.tex|
@@ -4404,7 +4524,7 @@
 % For math display, select |mathsvg| (default), or |mathjax|.
 % For more information about the math options, see \cref{sec:limitsmath}.
 % 
-% \DescribeOption{OSWindows} See \cref{sec:OSportabilityusage} if using Windows.
+% \DescribeOption{OSWindows} See \cref{sec:OSportabilityusage} if using \brand{Windows}.
 %
 % \DescribeOption{BaseJobname}  Not intended for the user.
 %   Used internally by \pkg{lwarp} when
@@ -4418,17 +4538,17 @@
 % \DescribeOption{IndexLanguage} If using an index or glossary,
 %   see \cref{sec:handlingpackageoptions}.
 %
-% \DescribeOption{latexmk} Has |lwarpmk| use |latexmk| to recompile the
+% \DescribeOption{latexmk} Has \prog{lwarpmk} use \prog{latexmk} to recompile the
 %   document several times if necessary.
-%   Otherwise, |lwarpmk| attempts to determing for itself whether to recompile.
+%   Otherwise, \prog{lwarpmk} attempts to determing for itself whether to recompile.
 %   See \cref{sec:htmlsettings}.
 %
 % \DescribeOption{lwarpmk}  If you wish to have \pkg{lwarp} generate a local
 %   copy of |lwarpmk.lua| for archival or local-installation purposes,
-%   compile the print version with the |lwarpmk| option set.
+%   compile the print version with the \prog{lwarpmk} option set.
 %   See \cref{sec:handlingpackageoptions}.
 %
-% \DescribeOption{xdyFilename} The default |xindy| filename is |lwarp.xdy|.
+% \DescribeOption{xdyFilename} The default \prog{xindy} filename is |lwarp.xdy|.
 %   If you wish to use a custom |.xdy| file for
 %   index generation, see \cref{sec:handlingpackageoptions}.
 %
@@ -4475,7 +4595,7 @@
 % \begin{enumerate}
 % \item Clear all the \HTML, \PDF, and auxiliary files: \userentry{lwarpmk clearall}
 % \item Recompile the print version in order to recreate
-%   the configuration files for |lwarpmk|: \userentry{lwarpmk print}
+%   the configuration files for \prog{lwarpmk}: \userentry{lwarpmk print}
 % \item Finally, recompile the \HTML\ version with the new settings: \userentry{lwarpmk html}
 % \end{enumerate}
 %
@@ -4511,8 +4631,8 @@
 %   See \cref{sec:filenameexamples} for examples of naming and numbering \HTML\ files.
 %
 % \ItemDescribeOption{latexmk} \DescribeDefault{false}
-%   Controls whether \pkg{lwarp} uses |latexmk| to
-%   compile the document.  This setting is written to |lwarpmk|'s configuration
+%   Controls whether \pkg{lwarp} uses \prog{latexmk} to
+%   compile the document.  This setting is written to \prog{lwarpmk}'s configuration
 %   files.
 %
 % \ItemDescribeOption{mathsvg} \DescribeDefault{true}
@@ -4519,7 +4639,7 @@
 %   Selects \SVG\ display for math output.  (The default.)
 %
 % \ItemDescribeOption{mathjax} \DescribeDefault{false}
-%   Selects MathJax for math output.
+%   Selects \brand{MathJax} for math output.
 %
 %   \end{description} \bigskip
 %
@@ -4685,7 +4805,7 @@
 %   A user-definable custom action applied to
 %   the top of pages other than the home page.   Useful for logos, etc.
 %   Defaults empty.
-%   |\LinkHome| may be used to place a link back to the homepage.
+%   \cs{LinkHome} may be used to place a link back to the homepage.
 %   Ignored in print output.
 %
 % \ItemDescribeMacro{\HTMLPageBottom}  \marg{contents}  \DescribeDefault{<empty>} \quad
@@ -4693,7 +4813,7 @@
 %   bottom of each web page.
 %   Useful for authors, copyright notices, contact information, etc.
 %   Defaults empty.
-%   |\LinkHome| may be used to place a link back to the homepage.
+%   \cs{LinkHome} may be used to place a link back to the homepage.
 %   Ignored in print output.
 %
 % \end{description}
@@ -4956,13 +5076,13 @@
 % \end{Verbatim}
 % 
 % The title is used in the meta tags in the \HTML\ files,
-% unless overridden by \cs{HTMLTitle}, and the rest are used in |\maketitle|.
+% unless overridden by \cs{HTMLTitle}, and the rest are used in \cs{maketitle}.
 % To use a \cs{subtitle} or \cs{published} field, see \cref{sec:publishedsubtitle}.
 %
 %
 % \DescribeMacro{\maketitle}
-% Use |\maketitle| just after the |\begin{document}|, as this will establish
-% the title of the homepage.  Optionally, use a |titlepage| environment instead.
+% Use \cs{maketitle} just after the |\begin{document}|, as this will establish
+% the title of the homepage.  Optionally, use a \env{titlepage} environment instead.
 %
 % \DescribeEnv{titlepage}
 % The \env{titlepage} environment may be used to hold a custom title page.
@@ -4975,10 +5095,10 @@
 %
 % \DescribeMacro{\title} \marg{title}
 % 
-% Avoid newlines in the |\title|; these will interfere with the
+% Avoid newlines in the \cs{title}; these will interfere with the
 % file break and \CSS\ detection.
 % \watchout
-% Use a |\subtitle| command instead (\cref{sec:publishedsubtitle}).
+% Use a \cs{subtitle} command instead (\cref{sec:publishedsubtitle}).
 % The title will appear in the document \cs{maketitle} as a heading \element{h1}.
 % The \HTML\ meta |title| tag will also have this title, unless \cs{HTMLTitle}
 % is used to set the meta title to something else instead.
@@ -4985,7 +5105,7 @@
 %
 % \DescribeMacro{\author} \marg{author}
 %
-% In |\author|, use |\protect| before formatting commands such as |\textsc|.
+% In \cs{author}, use \cs{protect} before formatting commands such as \cs{textsc}.
 % \watchout
 % In \HTML, the author will appear in a \element{div} of class |author| in the
 % \cs{maketitle}.
@@ -4996,7 +5116,7 @@
 %
 % \DescribeMacro{\date} \marg{date}
 %
-% |\date| works as expected.
+% \cs{date} works as expected.
 % In \HTML, this will appear in a \element{div} class |titledate|.
 %
 %
@@ -5064,12 +5184,12 @@
 % \cs{HTMLAuthor} may be used to set the meta tag to a simple list of names.
 %
 %
-% \subsection{Modifying \protect\texttt{xindy} index processing}
+% \subsection{Modifying \prog{xindy} index processing}
 % \label{sec:modifyxindy}
 %
 % \DescribeProgram{xindy}
 % \DescribeFile{lwarp.xdy}
-% \pkg{lwarpmk} uses the file |lwarp.xdy| to process the index.
+% \prog{lwarpmk} uses the file |lwarp.xdy| to process the index.
 % \index{lwarp.xdy>customizing}
 % \index{xindy>customizing}
 % This file is over-written by \pkg{lwarp} whenever a print version of
@@ -5095,7 +5215,7 @@
 %	\end{Verbatim}
 % \item Recompile the print version, which causes
 %	\pkg{lwarp} to rewrite the |lwarpmk.conf| configuration file.
-%	This tells |lwarpmk| to use the custom |projectname.xdy| file instead of |lwarp.xdy|.
+%	This tells \prog{lwarpmk} to use the custom |projectname.xdy| file instead of |lwarp.xdy|.
 % \end{enumerate}
 %
 %
@@ -5743,19 +5863,19 @@
 % Once these settings have been made, the \pkg{lwarp}-generated \HTML\ files
 % may be loaded by Calibre, and then converted to an \EPUB.
 %
-% \begin{docsidebar}[MathJax support]
-% MathJax may be used in \EPUB\ documents.
-% Some e-readers include MathJax, but any given reader
+% \begin{docsidebar}[\brand{MathJax} support]
+% \brand{MathJax} may be used in \EPUB\ documents.
+% Some e-readers include \brand{MathJax}, but any given reader
 % may or may not have a recent version, and may or may not include
 % extensions such as support for \pkg{siunitx}.
 %
 % \pkg{lwarp} adds some modifications to \MathML\ to support equations numbered
 % by chapter.  These modifications may not be compatible with the e-reader's
-% version of MathJax, so \pkg{lwarp} requests that a known version be loaded
+% version of \brand{MathJax}, so \pkg{lwarp} requests that a known version be loaded
 % instead.  In some cases chapter numbering of equations still doesn't work.
 %
 % Until math support in \EPUB\ documents is improved, it is recommended to use
-% \SVG\ images instead of MathJax, especially for equations numbered by chapter,
+% \SVG\ images instead of \brand{MathJax}, especially for equations numbered by chapter,
 % or where \pkg{siunitx} support is important.
 % \end{docsidebar}
 %
@@ -5946,7 +6066,7 @@
 %
 % \newcommand{\describeWPMarkMath}{
 %   While formatting for word processors,
-%   prints math as \LaTeX\ code instead of creating \SVG\ images or MathJax.
+%   prints math as \LaTeX\ code instead of creating \SVG\ images or \brand{MathJax}.
 %   This is useful for cut/paste into the LibreOffice Writer TeXMaths extension.
 % }
 %
@@ -6124,8 +6244,21 @@
 % \watchout[\TeX\ boxes]
 % require \cs{newpage}, which will not work in a \TeX\ box.
 %
-% \subsection{Creating an \pkg{lwarp} version of a package}
 %
+% \subsection{Modifying a package for \pkg{lwarp}}
+%
+% \index{package>modifying for \pkg{lwarp}}
+% \index{modifying>package}
+% \index{adapting>package}
+% \index{converting>package}
+%
+% If a class loads additional packages, it will be required to modify the
+% class for \pkg{lwarp}, since \pkg{lwarp} must be loaded before most other packages.
+%
+% To work with \pkg{lwarp}, a class must first set up anything which replicates
+% the functions of the basic \LaTeX\ classes, load any required fonts,
+% then load \pkg{lwarp}, then finally load and adjust any other required packages.
+%
 % When creating \HTML,
 % \pkg{lwarp} redefines the \cs{usepackage} and \cs{RequirePackage}
 % macros such that it first looks to see if a |lwarp-<packagename>.sty|
@@ -6177,6 +6310,7 @@
 % For a case where the original package is usable without changes, there is no
 % need to create a |lwarp-| version.
 %
+%
 % \subsubsection{Adding a package to the \pkg{lwarp.dtx} file}
 %
 % When adding a package to |lwarp.dtx| for permanent inclusing in \pkg{lwarp},
@@ -6189,6 +6323,21 @@
 % an error if \pkg{packagename} is loaded before \pkg{lwarp}.
 %
 %
+% \subsection{Modifying a class for \pkg{lwarp}}
+%
+% \index{class>modifying for \pkg{lwarp}}
+% \index{modifying>class}
+% \index{adapting>class}
+% \index{converting>class}
+%
+% If a class loads additional packages, it will be required to modify the
+% class for \pkg{lwarp}, since \pkg{lwarp} must be loaded before most other packages.
+%
+% To work with \pkg{lwarp}, a class must first set up anything which replicates
+% the functions of the basic \LaTeX\ classes, load any required fonts,
+% then load \pkg{lwarp}, then finally load and adjust any other required packages.
+%
+%
 % \subsection{Testing \pkg{lwarp}}
 %
 % \changes{v0.25}{2017/03/22}{Docs: Testing \pkg{lwarp}.}
@@ -6209,7 +6358,7 @@
 % of \HTML\ and \CSS\ code.
 %
 %
-% \subsection{Modifying \protect\texttt{lwarpmk}}
+% \subsection{Modifying \prog{lwarpmk}}
 % \label{sec:modifylwarpmk}
 %
 % \changes{v0.28}{2017/04/14}{Docs: Modfying lwarpmk and index processing.}
@@ -6555,6 +6704,9 @@
 % 
 % 
 % \section{Source Code}
+%
+% ^^A *source
+%
 % This is where the documented source code for \pkg{lwarp} begins,
 % continuing through the following sections all the way to the
 % change log and index at the end of this document.
@@ -6611,7 +6763,7 @@
 %
 % \codeall
 %
-% If using |pdflatex|, convert a minimal set of Unicode characters.
+% If using \prog{pdflatex}, convert a minimal set of Unicode characters.
 % Additional characters may be defined by the user, as needed.
 %
 % A commonly-used multiply symbol is declared to be \cs{texttimes}.
@@ -6663,7 +6815,7 @@
 %
 %
 % Prints a length in the given units, without printing the unit itself.
-% \begin{macro}{LWR at convertto} \marg{dest unit} \marg{length}
+% \begin{macro}{\LWR at convertto} \marg{dest unit} \marg{length}
 %    \begin{macrocode}
 \newcommand*{\LWR at convertto}[2]{\strip at pt\dimexpr #2*65536/\number\dimexpr 1#1}
 %    \end{macrocode}
@@ -6674,7 +6826,7 @@
 % \section{Early package requirements}
 %
 % \DescribePackage{etoolbox}
-% Provides |\ifbool| and other functions.
+% Provides \cs{ifbool} and other functions.
 %
 % \DescribePackage{xpatch}
 % Patches macros with optional arguments.
@@ -6686,7 +6838,7 @@
 
 % \DescribePackage{ifplatform}
 % Provides \cs{ifwindows} to try to automatically detect
-% Windows OS.
+% \brand{Windows} OS.
 %
 %    \begin{macrocode}
 \RequirePackage{ifplatform}% sense op-system platform
@@ -6733,15 +6885,15 @@
 % \end{macro}
 
 
-% \subsection{MS-Windows}
+% \subsection{\brand{MS-Windows}}
 
-% For MS-Windows:
+% For \brand{MS-Windows}:
 %
 % \begin{macro}{\LWR at setOSWindows}
-% Set defaults for the MS-Windows operating system.
+% Set defaults for the \brand{MS-Windows} operating system.
 % \pkg{lwarp} attempts to auto-detect the operatings system,
 % and the |OSWindows| option may also be used to force
-% MS-Windows compatibility.
+% \brand{MS-Windows} compatibility.
 %
 % \changes{v0.20}{2016/12/19}{Auto-detects operating system.}
 %
@@ -6807,7 +6959,7 @@
 %
 % \DescribeOption{warpprint}
 % If the |warpprint| option is given, boolean |warpingprint| is true and boolean |warpingHTML| is false,
-% and may be used for |\ifbool| tests.
+% and may be used for \cs{ifbool} tests.
 %
 %
 %    \begin{macrocode}
@@ -6823,7 +6975,7 @@
 %
 % \DescribeOption{warpHTML}
 % If the |warpHTML| option is given, boolean |warpingHTML| is true and boolean |warpingprint| is false,
-% and may be used for |\ifbool| tests.
+% and may be used for \cs{ifbool} tests.
 %
 %    \begin{macrocode}
 \DeclareVoidOption{warpHTML}{%
@@ -6844,7 +6996,7 @@
 % Option |mathsvg| selects \SVG\ math display:
 % \index{math>mathsvg option}
 % \index{SVG>mathsvg option}
-% If the |mathsvg| option is given, boolean |mathjax| is false, and may be used for |\ifbool| tests.
+% If the |mathsvg| option is given, boolean |mathjax| is false, and may be used for \cs{ifbool} tests.
 %    \begin{macrocode}
 \DeclareVoidOption{mathsvg}{%
 \PackageInfo{lwarp}{Using option 'mathsvg'}
@@ -6853,10 +7005,10 @@
 %    \end{macrocode}
 %
 % \DescribeOption{mathjax}
-% Option |mathjax| selects MathJax math display:
+% Option |mathjax| selects \brand{MathJax} math display:
 % \index{math>mathjax option}
 % \index{MathJax>mathjax option}
-% If the |mathjax| option is given, boolean |mathjax| is true, may be used for |\ifbool| tests.
+% If the |mathjax| option is given, boolean |mathjax| is true, may be used for \cs{ifbool} tests.
 %    \begin{macrocode}
 \DeclareVoidOption{mathjax}{%
 \PackageInfo{lwarp}{Using option 'mathjax'}
@@ -6880,7 +7032,7 @@
 
 
 % \DescribeOption{IndexLanguage} Sets the language to be assigned
-%	in |lwarpmk|'s configuration files.  This is then used by |lwarpmk| while
+%	in \prog{lwarpmk}'s configuration files.  This is then used by \prog{lwarpmk} while
 %	processing the index and glossary.
 %
 % \changes{v0.29}{2017/04/15}{Add: \protect\texttt{lwarpmklang} option for \pkg{lwarp}.}
@@ -6909,9 +7061,9 @@
 
 
 % \DescribeOption{lwarpmk} Tells \pkg{lwarp} to
-%	generate a local copy of |lwarpmk| called |lwarpmk.lua|.
+%	generate a local copy of \prog{lwarpmk} called |lwarpmk.lua|.
 %	Useful for archiving for future use.
-%	This file may be made executable and acts just like |lwarpmk|.
+%	This file may be made executable and acts just like \prog{lwarpmk}.
 %
 % If |lwarpmk| option, creates a local copy of |lwarpmk.lua|:
 %    \begin{macrocode}
@@ -6926,7 +7078,7 @@
 
 
 
-% \DescribeOption{OSWindows} Tells \pkg{lwarp} to use MS-Windows compatibility.
+% \DescribeOption{OSWindows} Tells \pkg{lwarp} to use \brand{MS-Windows} compatibility.
 % Auto-detection of the operating system is attempted, and this option is only
 % necessary if the auto-detection fails.
 % See the automatically-generated |lwarpmk.conf| file to find out
@@ -6970,9 +7122,9 @@
 
 
 % \DescribeOption{latexmk}
-% Option |latexmk| tells |lwarpmk| to use |latexmk| when compiling documents.
+% Option |latexmk| tells \prog{lwarpmk} to use \prog{latexmk} when compiling documents.
 %
-% \changes{v0.30}{2017/04/29}{Option \protect\texttt{latexmk} replaces macro \cs{UseLatexmk}.}
+% \changes{v0.30}{2017/04/29}{Option \prog{latexmk} replaces macro \cs{UseLatexmk}.}
 %
 %    \begin{macrocode}
 \DeclareBoolOption[false]{latexmk}
@@ -7038,7 +7190,7 @@
 
 % Use |comment_print.cut| for print mode, and
 % |comment_html.cut| for \HTML\ mode.
-% This helps |latexmk| to more reliably know whether to recompile.
+% This helps \prog{latexmk} to more reliably know whether to recompile.
 %
 % \changes{v0.37}{2017/08/19}{\pkg{comment}: Maintains independent
 %   cutfiles for print, \protect\HTML.}
@@ -7091,7 +7243,7 @@
 % \end{environment}
 
 
-% Optionally generate a local copy of |lwarpmk|.
+% Optionally generate a local copy of \prog{lwarpmk}.
 % Default to no.
 %    \begin{macrocode}
 \ifbool{LWR at creatinglwarpmk}
@@ -7213,11 +7365,14 @@
 % \changes{v0.45}{2017/12/03}{Allows \pkg{memoir}'s preloaded packages.}
 %
 % The following packages must be loaded after \pkg{lwarp}:
+% ^^A *loadafter
 %    \begin{macrocode}
 \LWR at loadafter{a4}
 \LWR at loadafter{a4wide}
 \LWR at loadafter{a5comb}
 \LWR at notmemoirloadafter{abstract}
+\LWR at loadafter{acro}
+\LWR at loadafter{acronym}
 \LWR at loadafter{adjmulticol}
 \LWR at loadafter{addlines}
 \LWR at loadafter{afterpage}
@@ -7230,7 +7385,7 @@
 \LWR at notmemoirloadafter{appendix}
 \LWR at loadafter{arabicfront}
 \LWR at notmemoirloadafter{array}
-\LWR at loadafter{atbegshi}
+% \LWR at loadafter{atbegshi}% used by morewrites
 \LWR at loadafter{authblk}
 \LWR at loadafter{backref}
 \LWR at loadafter{balance}
@@ -7249,8 +7404,10 @@
 \LWR at notmemoirloadafter{changepage}
 \LWR at notmemoirloadafter{chngpage}
 \LWR at loadafter{chappg}
+\LWR at loadafter{chapterbib}
 \LWR at loadafter{cite}
 \LWR at loadafter{color}
+\LWR at loadafter{colortbl}
 \LWR at loadafter{continue}
 \LWR at notmemoirloadafter{crop}
 \LWR at loadafter{cuted}
@@ -7307,6 +7464,8 @@
 \LWR at loadafter{grffile}
 \LWR at loadafter{hang}
 \LWR at loadafter{hanging}
+\LWR at loadafter{hypcap}
+\LWR at loadafter{hypernat}
 \LWR at loadafter{hyperref}
 \LWR at loadafter{hyperxmp}
 \LWR at loadafter{idxlayout}
@@ -7392,6 +7551,7 @@
 \LWR at loadafter{soulpos}
 \LWR at loadafter{soulutf8}
 \LWR at loadafter{stabular}
+\LWR at loadafter{stfloats}
 \LWR at loadafter{subfig}
 \LWR at loadafter{subfigure}
 \LWR at loadafter{supertabular}
@@ -7424,8 +7584,9 @@
 % \LWR at loadafter{typearea}% preloaded by koma-script classes
 \LWR at loadafter{ulem}
 \LWR at loadafter{upref}
-\LWR at loadafter{varioref}
+\LWR at loadafter{varioref}% no lwarp package provided
 \LWR at notmemoirloadafter{verse}
+\LWR at loadafter{vmargin}
 \LWR at loadafter{wallpaper}
 \LWR at loadafter{watermark}
 \LWR at loadafter{wrapfig}
@@ -7444,7 +7605,7 @@
 
 % \section{Required packages}
 % \label{sec:requiredpackages}
-% \index{packages>required}
+% \index{package>required}
 % \changes{v0.16}{2016/04/08}{Lwarp no longer selects fonts.}
 
 % These packages are automatically loaded by \pkg{lwarp} when generating
@@ -7522,8 +7683,8 @@
 \defaultfontfeatures[\ttfamily]{Ligatures=NoCommon}
 \else
 %    \end{macrocode}
-% ^^A % For |pdflatex|, use \pkg{fontenc} and \pkg{lmodern}:
-% ^^A % \marginpar{\textcolor{blue}{|pdflatex| only:}}
+% ^^A % For \prog{pdflatex}, use \pkg{fontenc} and \pkg{lmodern}:
+% ^^A % \marginpar{\textcolor{blue}{\prog{pdflatex} only:}}
 % ^^A % \index{Unicode>pdfLaTeX}
 % ^^A % \index{pdfLaTeX>Unicode support}
 % ^^A %    \begin{macrocode}
@@ -7541,7 +7702,7 @@
 % ^^A %
 % ^^A % \pdflatexonly
 % ^^A %
-% ^^A % |pdftotext| works better with a vector font.
+% ^^A % \prog{pdftotext} works better with a vector font.
 % ^^A % This font choice does not control the \HTML\ file, but it does appear in the
 % ^^A % images generated from math expressions.
 % ^^A %    \begin{macrocode}
@@ -7640,7 +7801,7 @@
 %    \begin{macrocode}
 \fi
 %    \end{macrocode}
-% ^^A % \marginpar{\textcolor{blue}{End of \XeLaTeX, \LuaLaTeX, |pdflatex| choices.}}
+% ^^A % \marginpar{\textcolor{blue}{End of \XeLaTeX, \LuaLaTeX, \pdfLaTeX\ choices.}}
 % ^^A 
 %    \begin{macrocode}
 \end{warpHTML}
@@ -7928,8 +8089,22 @@
 
 
 
+% \codeprint
+%    \begin{macrocode}
+\begin{warpprint}
+%    \end{macrocode}
 
+% Used for print-mode \env{lateximage}:
+%    \begin{macrocode}
+\RequirePackage{varwidth}
+%    \end{macrocode}
 
+%    \begin{macrocode}
+\end{warpprint}
+%    \end{macrocode}
+
+
+
 % \section{Loading packages}
 %
 %
@@ -7943,12 +8118,24 @@
 \LetLtxMacro{\LWR at origRequirePackage}{\RequirePackage}
 %    \end{macrocode}
 
-% \begin{macro}{\LWR at requirepackagenames} Stores the list of required package names.
+% \begin{macro}{\LWR at requirepackagenames}
+%       Stores the list of required package names.
 %    \begin{macrocode}
 \newcommand*{\LWR at requirepackagenames}{}
 %    \end{macrocode}
 % \end{macro}
 
+% \begin{macro}{\LWR at parsedrequirepackagenames}
+%       Stores the parsed list of required package names
+%       after spaces are removed and |lwarp-| is prepended.
+% \changes{v0.48}{2018/02/03}{Fix: Parsing similar package names.}
+%    \begin{macrocode}
+\newcommand*{\LWR at parsedrequirepackagenames}{}
+%    \end{macrocode}
+% \end{macro}
+
+
+
 % \begin{macro}{\LWR at findword} \oarg{1: separator} \marg{2: list}
 %								\marg{3: index} \oarg{4: destination}
 %
@@ -7961,12 +8148,17 @@
 % \end{macro}
 % 
 % \begin{macro}{\LWR at lookforpackagename} \marg{index}
+%
 % If this is a package name, re-direct it to the \pkg{lwarp} version
 % by renaming it |lwarp-| followed by the original name.
+%
+% Looks |index| deep into the list of package names, \cs{LWR at requirepackagenames}, and
+% builds \cs{LWR at parsedrequirepackagenames} which is the modified list of names.
+% \changes{v0.48}{2018/02/03}{Fix: Parsing similar package names.}
 %    \begin{macrocode}
 \newcommand*{\LWR at lookforpackagename}[1]{%
 %    \end{macrocode}
-% Find the n'th package name from the list:
+% Find the |index|'th package name from the list:
 %    \begin{macrocode}
 \LWR at findword{\LWR at requirepackagenames}{#1}[\LWR at strresult]%
 %    \end{macrocode}
@@ -7979,27 +8171,34 @@
 % See if the package name was found:
 %    \begin{macrocode}
 \IfStrEq{\LWR at strresulttwo}{}%
-{}% no filename
+{%
+}% no filename
 {% yes filename
 %    \end{macrocode}
 % If found, and if an \pkg{lwarp}-equivalent name exists, use |lwarp-|* instead.
 %    \begin{macrocode}
-\IfFileExists{lwarp-\LWR at strresulttwo.sty}%
-{% lwarp-* file found
-        \StrSubstitute%
-            {\LWR at requirepackagenames}%
-            {\LWR at strresult}%
-            {lwarp-\LWR at strresulttwo}[\LWR at requirepackagenames]%
-}%
-{
+    \IfFileExists{lwarp-\LWR at strresulttwo.sty}%
+    {% lwarp-* file found
+        \ifdefvoid{\LWR at parsedrequirepackagenames}{%
+            \edef\LWR at parsedrequirepackagenames{lwarp-\LWR at strresulttwo}%
+        }{%
+            \edef\LWR at parsedrequirepackagenames{%
+                \LWR at parsedrequirepackagenames,lwarp-\LWR at strresulttwo%
+            }%
+        }%
+    }%
+    {%
 %    \end{macrocode}
 % \changes{v0.46}{2018/01/23}{Fix: Spaces in \cs{usepackage}.}
 %    \begin{macrocode}
-        \StrSubstitute%
-            {\LWR at requirepackagenames}%
-            {\LWR at strresult}%
-            {\LWR at strresulttwo}[\LWR at requirepackagenames]%
-}% no lwarp-* file
+        \ifdefvoid{\LWR at parsedrequirepackagenames}{%
+            \edef\LWR at parsedrequirepackagenames{\LWR at strresulttwo}%
+        }{%
+            \edef\LWR at parsedrequirepackagenames{%
+                \LWR at parsedrequirepackagenames,\LWR at strresulttwo%
+            }%
+        }%
+    }% no lwarp-* file
 }% yes filename
 }
 %    \end{macrocode}
@@ -8019,31 +8218,32 @@
 %    \end{macrocode}
 % Redirect up to nine names:
 %    \begin{macrocode}
-\renewcommand*{\LWR at requirepackagenames}{#2}
-\LWR at lookforpackagename{1}
-\LWR at lookforpackagename{2}
-\LWR at lookforpackagename{3}
-\LWR at lookforpackagename{4}
-\LWR at lookforpackagename{5}
-\LWR at lookforpackagename{6}
-\LWR at lookforpackagename{7}
-\LWR at lookforpackagename{8}
-\LWR at lookforpackagename{9}
+\renewcommand*{\LWR at requirepackagenames}{#2}%
+\renewcommand*{\LWR at parsedrequirepackagenames}{}%
+\LWR at lookforpackagename{1}%
+\LWR at lookforpackagename{2}%
+\LWR at lookforpackagename{3}%
+\LWR at lookforpackagename{4}%
+\LWR at lookforpackagename{5}%
+\LWR at lookforpackagename{6}%
+\LWR at lookforpackagename{7}%
+\LWR at lookforpackagename{8}%
+\LWR at lookforpackagename{9}%
 %    \end{macrocode}
 % \cs{RequirePackage} depending on the options and version:
 %    \begin{macrocode}
-\IfValueTF{#1}
+\IfValueTF{#1}%
 {% options given
     \IfValueTF{#3}% version given?
-    {\LWR at origRequirePackage[#1]{\LWR at requirepackagenames}[#3]}
-    {\LWR at origRequirePackage[#1]{\LWR at requirepackagenames}}
-}
+    {\LWR at origRequirePackage[#1]{\LWR at parsedrequirepackagenames}[#3]}%
+    {\LWR at origRequirePackage[#1]{\LWR at parsedrequirepackagenames}}%
+}%
 {% no options given
     \IfValueTF{#3}% version given?
-    {\LWR at origRequirePackage{\LWR at requirepackagenames}[#3]}
-    {\LWR at origRequirePackage{\LWR at requirepackagenames}}
+    {\LWR at origRequirePackage{\LWR at parsedrequirepackagenames}[#3]}%
+    {\LWR at origRequirePackage{\LWR at parsedrequirepackagenames}}%
+}%
 }
-}
 \LetLtxMacro{\usepackage}{\RequirePackage}
 %    \end{macrocode}
 % \end{macro}
@@ -8062,7 +8262,6 @@
 {\ProvidesPackage{lwarp-#1}}
 \DeclareOption*{\PassOptionsToPackage{\CurrentOption}{#1}}
 \ProcessOptions\relax
-
 \IfValueTF{#2}
 {\LWR at origRequirePackage{#1}[#2]}
 {\LWR at origRequirePackage{#1}}
@@ -8081,8 +8280,20 @@
 \IfValueTF{#2}
 {\ProvidesPackage{lwarp-#1}[#2]}
 {\ProvidesPackage{lwarp-#1}}
+%    \end{macrocode}
+% Ignore all options.
+%    \begin{macrocode}
 \DeclareOption*{}
-\ProcessOptions\relax
+%    \end{macrocode}
+% Nullifies then processes the options.
+% Seems to be required when options contain curly braces, which were causing
+% ``|Missing \begin{document}|''.
+% \changes{v0.48}{2018/02/04}{Fix: Options with braces.}
+%    \begin{macrocode}
+% \ProcessOptions\relax% original LaTeX code
+\let\ds@\@empty%         from the original \ProcessOptions
+\edef\@curroptions{}%    lwarp modification to \ProcessOptions
+\@process at ptions\relax%  from the original \ProcessOptions
 }
 %    \end{macrocode}
 % \end{macro}
@@ -8536,6 +8747,44 @@
 % Will be temporarily restored to original meaning inside any lateximage environment.
 % Also nullify unused commands.
 %    \begin{macrocode}
+\LetLtxMacro\LWR at origmbox\mbox
+\LetLtxMacro\LWR at origmakebox\makebox
+
+\let\LWR at origcomma\,
+\let\LWR at origtilde~
+\let\LWR at origenskip\enskip
+\let\LWR at origquad\quad
+\let\LWR at origqquad\qquad
+
+\let\LWR at orighspace\hspace
+\let\LWR at orighfill\hfill
+\let\LWR at orighfil\hfil
+\let\LWR at origvspace\vspace
+\let\LWR at orighss\hss
+\let\LWR at origllap\llap
+\let\LWR at origrlap\rlap
+\let\LWR at orighfilneg\hfilneg
+
+\let\LWR at origrule\rule
+\let\LWR at orighrulefill\hrulefill
+\let\LWR at origdotfill\dotfill
+
+\let\LWR at origmedskip\medskip
+\let\LWR at origbigskip\bigskip
+
+\let\LWR at origtextellipsis\textellipsis
+
+\let\LWR at orignormalsize\normalsize
+\let\LWR at origsmall\small
+\let\LWR at origfootnotesize\footnotesize
+\let\LWR at origscriptsize\scriptsize
+\let\LWR at origtiny\tiny
+\let\LWR at origlarge\large
+\let\LWR at origLarge\Large
+\let\LWR at origLARGE\LARGE
+\let\LWR at orighuge\huge
+\let\LWR at origHuge\Huge
+
 \LetLtxMacro{\LWR at origtextrm}{\textrm}
 \LetLtxMacro{\LWR at origtextsf}{\textsf}
 \LetLtxMacro{\LWR at origtexttt}{\texttt}
@@ -8567,14 +8816,14 @@
 \let\LWR at origsb\sb
 \LetLtxMacro\LWR at origtextsuperscript\textsuperscript
 \LetLtxMacro\LWR at orig@textsuperscript\@textsuperscript
+
 \AtBeginDocument{
 \LetLtxMacro\LWR at origtextsubscript\textsubscript
 \LetLtxMacro\LWR at orig@textsubscript\@textsubscript
 }
+
 \LetLtxMacro\LWR at origunderline\underline
 
-\let\LWR at origscriptsize\scriptsize
-
 \let\LWR at orignewpage\newpage
 
 \let\LWR at origpagestyle\pagestyle
@@ -8587,16 +8836,23 @@
 
 \let\LWR at orignewline\newline
 
-\LetLtxMacro\LWR at origitem\item
 
-
 \AtBeginDocument{% in case packages change definition
-\LetLtxMacro{\LWR at origitemize}{\itemize}
-\LetLtxMacro{\LWR at endorigitemize}{\enditemize}
-\LetLtxMacro{\LWR at origenumerate}{\enumerate}
-\LetLtxMacro{\LWR at endorigenumerate}{\endenumerate}
-\LetLtxMacro{\LWR at origdescription}{\description}
-\LetLtxMacro{\LWR at endorigdescription}{\enddescription}
+\let\LWR at orig@trivlist\@trivlist
+\let\LWR at origtrivlist\trivlist
+\let\LWR at origendtrivlist\endtrivlist
+\LetLtxMacro\LWR at origitem\item
+\LetLtxMacro\LWR at origitemize\itemize
+\LetLtxMacro\LWR at endorigitemize\enditemize
+\LetLtxMacro\LWR at origenumerate\enumerate
+\LetLtxMacro\LWR at endorigenumerate\endenumerate
+\LetLtxMacro\LWR at origdescription\description
+\LetLtxMacro\LWR at endorigdescription\enddescription
+\let\LWR at orig@mklab\@mklab
+\let\LWR at origmakelabel\makelabel
+\let\LWR at orig@donoparitem\@donoparitem
+\LetLtxMacro\LWR at orig@item\@item
+\let\LWR at orig@nbitem\@nbitem
 }
 
 \let\LWR at origpar\par
@@ -8605,6 +8861,12 @@
 \let\LWR at orig@mpfootnotetext\@mpfootnotetext
 
 \let\LWR at origclearpage\clearpage
+
+
+\AtBeginDocument{% in case packages change definition
+\LetLtxMacro\LWR at orighline\hline%
+\LetLtxMacro\LWR at origcline\cline%
+}
 %    \end{macrocode}
 
 %    \begin{macrocode}
@@ -8744,9 +9006,9 @@
 % |lwarpmk.conf| is automatically (re-)created by the \pkg{lwarp} package when
 % executing\\
 % \hspace*{2ex} |pdflatex <project.tex>|,\\
-% or similar for |xelatex| or |lualatex|, in print-document generation mode,
+% or similar for \prog{xelatex} or \prog{lualatex}, in print-document generation mode,
 % which is the default unless the |warpHTML| option is given.
-% |lwarpmk.conf| is then used by the utility |lwarpmk|.
+% |lwarpmk.conf| is then used by the utility \prog{lwarpmk}.
 %
 % An example |lwarpmk.conf|:
 % \begin{Verbatim}[gobble=2,frame=lines,obeytabs,tabsize=4,formatcom={\unskip}]
@@ -8794,7 +9056,7 @@
 
 % \subsection{project.lwarpmkconf}
 %
-% \DescribeFile{project.lwarpmkconf} A project-specific configuration file for |lwarpmk|.
+% \DescribeFile{project.lwarpmkconf} A project-specific configuration file for \prog{lwarpmk}.
 %
 % \changes{v0.29}{2017/04/15}{File \protect\texttt{*.lwarpmkconf}: Add: \protect\texttt{language} option for config files.}
 %
@@ -9700,7 +9962,7 @@
 tr.tbrule td {border-top: 1px solid black ; margin-top: 0ex ;
     margin-bottom: 0ex ; } /* for \toprule, \bottomrule */
 
-td {padding: 1ex .5em 1ex .5em ;}
+td {padding: .5ex .5em .5ex .5em ;}
 
 table td.tdl { text-align: left ; vertical-align: middle ; }
 table td.tdc { text-align: center ; vertical-align: middle ; }
@@ -9769,6 +10031,14 @@
 .tnoteitemheader {margin-right: 1em;}
 
 
+/* for colortbl and cell color */
+div.cellcolor {
+    width: 100% ;
+    padding: .5ex .5em .5ex .5em ;
+    margin: -.5ex -.5em -.5ex -.5em ;
+}
+
+
 /* for bigdelim */
 .ldelim, .rdelim { font-size: 200% }
 
@@ -10751,7 +11021,7 @@
 % \subsection{lwarp\_mathjax.txt}
 
 % \DescribeFile{lwarp_mathjax.txt}
-% Used by \pkg{lwarp} when using MathJax.
+% Used by \pkg{lwarp} when using \brand{MathJax}.
 %
 % This must be present when compiling the project,
 % but does not need to be present when distributing
@@ -10761,8 +11031,8 @@
 % \changes{v0.30}{2017/04/26}{Fix: \protect\texttt{lwarp\_mathjax.txt}: Only written in print mode.}
 % \changes{v0.34}{2017/07/27}{File: \protect\texttt{lwarp\_mathjax.txt}: Version change.}
 % \changes{v0.42}{2017/10/16}{File: \protect\texttt{lwarp\_mathjax.txt}: Updated \pkg{siunitx} script.}
-% \changes{v0.45}{2017/12/21}{File: \protect\texttt{lwarp\_mathjax.txt}: Allow MathJax inside \env{tabbing}.}
-% \changes{v0.45}{2018/01/23}{File: \protect\texttt{lwarp\_mathjax.txt}: Allow MathJax inside \env{verse}.}
+% \changes{v0.45}{2017/12/21}{File: \protect\texttt{lwarp\_mathjax.txt}: Allow \brand{MathJax} inside \env{tabbing}.}
+% \changes{v0.45}{2018/01/23}{File: \protect\texttt{lwarp\_mathjax.txt}: Allow \brand{MathJax} inside \env{verse}.}
 %
 %
 % ^^A *lwarp_mathjax.txt
@@ -10882,23 +11152,23 @@
 \begin{LWR at createlwarpmk}
 %    \end{macrocode}
 
-% \DescribeProgram{lwarpmk} Creates a local copy of |lwarpmk|:
+% \DescribeProgram{lwarpmk} Creates a local copy of \prog{lwarpmk}:
 %
-% \changes{v0.21}{2017/02/11}{\protect\texttt{lwarpmk}: Fix: \protect\texttt{lwarpmk again} for Windows.}
-% \changes{v0.21}{2017/02/22}{\protect\texttt{lwarpmk}: Fix: \protect\texttt{lwarpmk limages} for Windows.}
-% \changes{v0.21}{2017/02/22}{\protect\texttt{lwarpmk}: Fix: \protect\texttt{lwarpmk} uses \texttt{lateximages} text file instead of shell script.}
-% \changes{v0.28}{2017/04/14}{\protect\texttt{lwarpmk}: Add: \protect\texttt{printglossary} and \protect\texttt{htmlglossary} commands.}
-% \changes{v0.29}{2017/04/15}{\protect\texttt{lwarpmk}: Add: \protect\texttt{language} option for config files.}
-% \changes{v0.30}{2017/04/22}{\protect\texttt{lwarpmk}: \protect\texttt{language} now used for both index and glossary generation.}
-% \changes{v0.30}{2017/04/22}{\protect\texttt{lwarpmk}: Fix: \protect\texttt{xindy} now used for print index generation with \protect\texttt{latexmk}.}
-% \changes{v0.30}{2017/04/28}{\protect\texttt{lwarpmk}: Fix: \protect\texttt{xindy} and \protect\texttt{texindy}
-%		adjusted for \protect\texttt{pdflatex}, \protect\texttt{xelatex} and \protect\texttt{lualatex}.}
-% \changes{v0.30}{2017/04/28}{\protect\texttt{lwarpmk}: Add: \protect\texttt{xdyfile} configuration option.}
-% \changes{v0.32}{2017/06/08}{\protect\texttt{lwarpmk}: Fix: \protect\texttt{io.lines()} changed to \protect\texttt{file:lines()}
-%		due to \protect\texttt{luatex} changes.}
-% \changes{v0.37}{2017/08/19}{\protect\texttt{lwarpmk}: Removes additional \HTML\ \protect\texttt{aux} files.}
-% \changes{v0.38}{2017/08/24}{\protect\texttt{lwarpmk}: Added print1 and html1 actions.}
-% \changes{v0.47}{2018/01/24}{\protect\texttt{lwarpmk}: pdfcrop: Removed hires option for improved crop accuracy.}
+% \changes{v0.21}{2017/02/11}{\prog{lwarpmk}: Fix: \protect\texttt{lwarpmk again} for \brand{Windows}.}
+% \changes{v0.21}{2017/02/22}{\prog{lwarpmk}: Fix: \protect\texttt{lwarpmk limages} for \brand{Windows}.}
+% \changes{v0.21}{2017/02/22}{\prog{lwarpmk}: Fix: \prog{lwarpmk} uses \texttt{lateximages} text file instead of shell script.}
+% \changes{v0.28}{2017/04/14}{\prog{lwarpmk}: Add: \protect\texttt{printglossary} and \protect\texttt{htmlglossary} commands.}
+% \changes{v0.29}{2017/04/15}{\prog{lwarpmk}: Add: \protect\texttt{language} option for config files.}
+% \changes{v0.30}{2017/04/22}{\prog{lwarpmk}: \protect\texttt{language} now used for both index and glossary generation.}
+% \changes{v0.30}{2017/04/22}{\prog{lwarpmk}: Fix: \prog{xindy} now used for print index generation with \prog{latexmk}.}
+% \changes{v0.30}{2017/04/28}{\prog{lwarpmk}: Fix: \prog{xindy} and \prog{texindy}
+%		adjusted for \prog{pdflatex}, \prog{xelatex} and \prog{lualatex}.}
+% \changes{v0.30}{2017/04/28}{\prog{lwarpmk}: Add: \protect\texttt{xdyfile} configuration option.}
+% \changes{v0.32}{2017/06/08}{\prog{lwarpmk}: Fix: \protect\texttt{io.lines()} changed to \protect\texttt{file:lines()}
+%		due to \prog{luatex} changes.}
+% \changes{v0.37}{2017/08/19}{\prog{lwarpmk}: Removes additional \HTML\ \protect\texttt{aux} files.}
+% \changes{v0.38}{2017/08/24}{\prog{lwarpmk}: Added print1 and html1 actions.}
+% \changes{v0.47}{2018/01/24}{\prog{lwarpmk}: pdfcrop: Removed hires option for improved crop accuracy.}
 %
 % ^^A *lwarpmk.lua
 %    \begin{macrocode}
@@ -10909,7 +11179,7 @@
 
 -- Print the usage of the lwarpmk command:
 
-printversion = "v0.47"
+printversion = "v0.48"
 
 function printhelp ()
 print ("lwarpmk: Use lwarpmk -h or lwarpmk --help for help.") ;
@@ -11470,7 +11740,7 @@
 % Note that starting a new section may close several levels of previously
 % \watchout
 % nested items at the same time.
-% For example, starting a new |\section| would close any currently open
+% For example, starting a new \cs{section} would close any currently open
 % subsection, subsubsection, and paragraph.
 % General environments are not nested on the stack since they have their own close
 % mechanism.  List environments are nested, and items inside those environments
@@ -11498,11 +11768,11 @@
 \newcommand*{\LWR at depthparagraph}{4}
 \newcommand*{\LWR at depthsubparagraph}{5}
 %    \end{macrocode}
-% used by |\itemize|, |\enumerate|, |\description|:
+% used by \cs{itemize}, \cs{enumerate}, \cs{description}:
 %    \begin{macrocode}
 \newcommand*{\LWR at depthlist}{6}
 %    \end{macrocode}
-% used by |\item|:
+% used by \cs{item}:
 %    \begin{macrocode}
 \newcommand*{\LWR at depthlistitem}{7}
 %    \end{macrocode}
@@ -11511,7 +11781,7 @@
 
 % 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 |\pushclose| and |\popclose| as well.
+% adding to \cs{pushclose} and \cs{popclose} as well.
 %    \begin{macrocode}
 \newcommand*{\LWR at closeone}{}% top of the stack
 \newcommand*{\LWR at closetwo}{}
@@ -11645,7 +11915,7 @@
 % that \cs{LWR at setexparray}'s argument is expanded only once when assigned.
 %
 % |name| has no backslash, |index| can be a number or a text name,
-% and an empty |value| must be |\relax| instead of empty.
+% and an empty |value| must be \cs{relax} instead of empty.
 %
 % To assign an empty value:
 %	\begin{sourcedisplay}
@@ -11948,7 +12218,7 @@
 
 
 % \begin{macro}{\LinkHome}
-% |\LinkHome| may be used wherever you wish to place a link back to the homepage.
+% May be used wherever you wish to place a link back to the homepage.
 % The filename must be detokenized for underscores.
 %    \begin{macrocode}
 \newcommand*{\LinkHome}{%
@@ -11991,7 +12261,7 @@
 
 % Diagnostics tool:
 % Prints the \LaTeX\ nesting depth values for the stack levels.
-% |\LWR at startpars| is used before printing the stack, so that |\LWRPrintStack| may
+% \cs{LWR at startpars} is used before printing the stack, so that \cs{LWRPrintStack} may
 % \watchout
 % be called from anywhere in the normal text flow.
 
@@ -12234,7 +12504,7 @@
 % \changes{v0.45}{2017/12/29}{\pkg{babel-french}: Robust commands.}
 %
 % Adjust \pkg{babel-french} for \HTML\ spaces.
-% So far, this only works for |pdflatex| and |xelatex|.
+% So far, this only works for \prog{pdflatex} and \prog{xelatex}.
 %
 % \credits{Daniel Flipo}
 %
@@ -12297,7 +12567,7 @@
 % \begin{macro}{\LWR at htmltagc} \marg{tag}
 % Break ligatures and use upright apostrophes in \HTML\ tags.
 %
-%|\protect| is in case the tag appears in TOC, LOF, LOT.
+% \cs{protect} is in case the tag appears in TOC, LOF, LOT.
 %    \begin{macrocode}
 \newcommand*{\LWR at htmltagc}[1]{%
 {%
@@ -12425,7 +12695,7 @@
 
 % \subsection{Block tags and comments}
 
-% In the following, |\origttfamily| breaks ligatures, which may not be used for \HTML\ codes:
+% In the following, \cs{origttfamily} breaks ligatures, which may not be used for \HTML\ codes:
 %
 % \begin{macro}{\LWR at htmlopencomment}
 % \begin{macro}{\LWR at htmlclosecomment}
@@ -12437,7 +12707,7 @@
 \begingroup%
 \LWR at FBcancel%
 \ifmmode\else\protect\LWR at origttfamily\fi%
-\mbox{\LWR at origtextless{}!{-}{-}}%
+\LWR at origmbox{\LWR at origtextless{}!{-}{-}}%
 \endgroup%
 }%
 }
@@ -12448,7 +12718,7 @@
 \begingroup%
 \LWR at FBcancel%
 \ifmmode\else\protect\LWR at origttfamily\fi%
-\mbox{{-}{-}\LWR at origtextgreater}%
+\LWR at origmbox{{-}{-}\LWR at origtextgreater}%
 \endgroup%
 }%
 }
@@ -12715,7 +12985,7 @@
     \addtocounter{LWR at thisautoidWP}{1}%
     \LWR at htmltag{%
         div class="#3" %
-        id="\mbox{autoidWP-\arabic{LWR at thisautoidWP}}"%
+        id="\LWR at origmbox{autoidWP-\arabic{LWR at thisautoidWP}}"%
         \ifblank{#1}{}{ style="#1"}%
     }%
 }% FormatWP
@@ -12790,6 +13060,8 @@
 
 
 
+
+
 % \section{Paragraph handling}
 % \label{sec:parhanding}
 %
@@ -12906,6 +13178,7 @@
 %    \begin{macrocode}
 \newcommand*{\LWR at closeparagraph}
 {%
+\LWR at traceinfo{LWR at closeparagraph}%
 %    \end{macrocode}
 % See if paragraph handling is enabled:
 %    \begin{macrocode}
@@ -13000,7 +13273,7 @@
 % the tags.
 %
 % The |everyhook| package is used to generate the opening
-% paragraph tags.  The closing tags are generated by |\par|.
+% paragraph tags.  The closing tags are generated by \cs{par}.
 
 % \codehtml
 %    \begin{macrocode}
@@ -13526,6 +13799,7 @@
 % \begin{macro}{\@mpfootnotetext} \marg{text}
 %    \begin{macrocode}
 \long\def\@mpfootnotetext#1{%
+\LWR at traceinfo{@mpfootnotetext}%
 \global\setbox\LWR at mpfootnotes\vbox{%
     \unvbox\LWR at mpfootnotes
     \reset at font\footnotesize
@@ -13559,6 +13833,7 @@
     }%
     \color at endgroup%
 }% vbox
+\LWR at traceinfo{@mpfootnotetext: done}%
 }
 %    \end{macrocode}
 % \end{macro}
@@ -13565,6 +13840,19 @@
 %
 %
 %
+% \begin{macro}{\thempfootnote} Redefined to remove the \cs{itshape}, which caused
+%   an obscure compiling error in some situations.
+% \changes{v0.48}{2018/02/11}{Removed \cs{itshape}.}
+%    \begin{macrocode}
+\AtBeginDocument{
+\def\thempfootnote{\@alph\c at mpfootnote}
+}
+%    \end{macrocode}
+% \end{macro}
+%
+%
+%
+%
 % \subsection{Printing pending footnotes}
 %
 % \begin{macro}{\LWR at printpendingfootnotes}
@@ -13794,7 +14082,7 @@
 % Be sure that this does not result in filename collisions!
 % \watchout
 % Use the optional TOC caption entry parameter for formatting.
-% Remember to |\protect| \LaTeX{} commands which appear in
+% Remember to \cs{protect} \LaTeX\ commands which appear in
 % section names and TOC captions.
 %    \begin{macrocode}
 \newcommand*{\LWR at filenamenoblanks}[1]{%
@@ -13900,8 +14188,29 @@
 % \end{macro}
 
 
+% \DescribeCounter{LWR at previousautopagelabel} Remembers which autopage label
+% was most recently generated.  Used to avoid duplicates.
+%    \begin{macrocode}
+\newcounter{LWR at previousautopagelabel}
+\setcounter{LWR at previousautopagelabel}{-1}
+%    \end{macrocode}
 
 
+% \begin{macro}{\LWR at newautopagelabel} \marg{pagenumber counter}
+% \changes{v0.48}{2018/02/11}{Fix: TOC, LOF, LOT links.}
+%    \begin{macrocode}
+\newcommand*{\LWR at newautopagelabel}[1]{%
+\ifnumequal{\value{LWR at previousautopagelabel}}{\value{page}}%
+{}% no action if this autopage label has already been defined
+{%
+    \label{autopage-\arabic{#1}}%
+    \setcounter{LWR at previousautopagelabel}{\value{page}}
+}%
+}
+%    \end{macrocode}
+% \end{macro}
+
+
 % \begin{macro}{\LWR at newhtmlfile} \marg{section name}
 % \changes{v0.18}{2016/04/23}{side\TOC\ after title, improving responsive design.}
 % \changes{v0.21}{2017/02/22}{Skip title if not given.}
@@ -13991,6 +14300,13 @@
 
 %    \end{macrocode}
 %
+% Track the page numbers:
+% \changes{v0.48}{2018/02/11}{Fix: TOC, LOF, LOT links.}
+%    \begin{macrocode}
+\setcounter{LWR at latestautopage}{\value{page}}%
+\LWR at newautopagelabel{LWR at latestautopage}%
+%    \end{macrocode}
+%
 % No navigation between files if formatting for an \EPUB\ or word processor:
 %    \begin{macrocode}
 \ifthenelse{\boolean{FormatEPUB}\OR\boolean{FormatWP}}
@@ -14041,10 +14357,7 @@
 \LWR at stoppars
 
 %    \end{macrocode}
-%
-% Track the page numbers:
 %    \begin{macrocode}
-\setcounter{LWR at latestautopage}{\value{page}}
 \LWR at traceinfo{LWR at newhtmlfile: done}
 }
 %    \end{macrocode}
@@ -14068,11 +14381,11 @@
 % Section names and the resulting filenames with accented characters
 % \margintag{Unicode}
 % are partially supported, depending on the ability of
-% |pdflatex| to generate characters and |pdftotext| to read them.
+% \prog{pdflatex} to generate characters and \prog{pdftotext} to read them.
 % If extra symbols appear in the text,
 % \watchout
-% it may be that |pdflatex| is actually producing a symbol over or under a
-% character, resulting in |pdftotext| picking up the accent symbol separately.
+% it may be that \prog{pdflatex} is actually producing a symbol over or under a
+% character, resulting in \prog{pdftotext} picking up the accent symbol separately.
 %
 % \XeLaTeX{} and \LuaLaTeX{} directly support accented section and file names.
 % \index{accents}\index{Unicode>file \& section names}\index{UTF-8>file \& section names}
@@ -14214,7 +14527,7 @@
 % \changes{v0.47}{2018/01/26}{Fix: Line wrap at \HTML\ hyphen.}
 %    \begin{macrocode}
 \newcommand*{\LWR at createautosec}[1]{%
-\LWR at htmltag{#1 id="\mbox{autosec-\arabic{page}}"}%
+\LWR at htmltag{#1 id="\LWR at origmbox{autosec-\arabic{page}}"}%
 }
 %    \end{macrocode}
 % \end{macro}
@@ -14226,7 +14539,7 @@
 % Stacks the new sectioning level's closing tag,
 % to be used when this section is closed some time later.
 %
-% |\LWR at stoppars| must be executed first.
+% \cs{LWR at stoppars} must be executed first.
 % \watchout
 %    \begin{macrocode}
 \NewDocumentCommand{\LWR at pushoneclose}{m m}{%
@@ -14243,7 +14556,7 @@
 % then opens the new nesting level by saving this new sectioning
 % level's closing tag for later use.
 %
-% |\LWR at stoppars| must be executed first.
+% \cs{LWR at stoppars} must be executed first.
 % \watchout
 %    \begin{macrocode}
 \NewDocumentCommand{\LWR at startnewdepth}{m m}{%
@@ -14531,9 +14844,10 @@
 %    \end{macrocode}
 % Generate a \LaTeX{} label:
 % \changes{v0.43}{2017/11/01}{Fix: Math in section name.}
+% \changes{v0.48}{2018/02/11}{Fix: TOC, LOF, LOT links.}
 %    \begin{macrocode}
 \LWR at traceinfo{LWR at section: about to create the LaTeX label}%
-\label{autopage-\theLWR at currentautosec}%
+\LWR at newautopagelabel{LWR at currentautosec}%
 %    \end{macrocode}
 % Start paragraph handing unless is an inline paragraph or subparagraph:
 %    \begin{macrocode}
@@ -14856,7 +15170,7 @@
 link rel="stylesheet" type="text/css" href="\LWR at currentcss" /}%
 \LWR at orignewline
 %    \end{macrocode}
-% Optional MathJax support.  The \HTML\ tags must be turned off
+% Optional \brand{MathJax} support.  The \HTML\ tags must be turned off
 % during the verbatim input, and the paragraph handling which was
 % turned on at the end of verbatim input must be immediately turned off
 % again.
@@ -14946,11 +15260,11 @@
 \LWR at origraggedright%
 \LetLtxMacro{\\}{\LWR at endofline}%
 %    \end{macrocode}
-% Spread the lines for |pdftotext| to read them well:
+% Spread the lines for \prog{pdftotext} to read them well:
 %    \begin{macrocode}
 \linespread{1.3}%
 %    \end{macrocode}
-% For |pdftotext| to reliably identify paragraph splits:
+% For \prog{pdftotext} to reliably identify paragraph splits:
 %    \begin{macrocode}
 \setlength{\parindent}{0pt}
 \setlength{\parskip}{2ex}
@@ -14961,9 +15275,11 @@
 \immediate\openout\LWR at lateximagesfile=lateximages.txt
 %    \end{macrocode}
 %
-% Removes space after the caption in the \HTML:
+% Removes space around the caption in the \HTML:
+% \changes{v0.48}{2018/02/13}{Adjusted space around captions.}
 %    \begin{macrocode}
-\setlength{\belowcaptionskip}{-3ex}
+\setlength{\belowcaptionskip}{0ex}
+\setlength{\abovecaptionskip}{0ex}
 %    \end{macrocode}
 % Redefine the plain page style to be empty when used by index pages:
 %    \begin{macrocode}
@@ -15524,7 +15840,7 @@
 %
 % An \HTML\ \element{div} of class \attribute{titlepage} is used.
 %
-% |\thanks| are a form of footnotes used in the title page.
+% \cs{thanks} are a form of footnotes used in the title page.
 % See \cref{sec:footnotes} for other kinds of footnotes.
 %
 % See |\thanksmarkseries{series}|, below, to set the style of the footnote marks.
@@ -15641,7 +15957,7 @@
 %    \begin{macrocode}
 \@maketitle
 %    \end{macrocode}
-% Immediately generate any |\thanks| footnotes:
+% Immediately generate any \cs{thanks} footnotes:
 %    \begin{macrocode}
 \@thanks
 %    \end{macrocode}
@@ -15679,6 +15995,15 @@
     \@title
     \LWR at htmltag{\LWR at tagtitleend}\LWR at startpars
     \begin{BlockClass}{author}
+%    \end{macrocode}
+% For \pkg{IEEEtran} class:
+% \changes{v0.48}{2018/02/04}{Fix: Errors with \pkg{IEEEtran} class.}
+%    \begin{macrocode}
+    \renewcommand*{\cr}{}
+    \renewcommand*{\crcr}{}
+    \renewcommand*{\noalign}{}
+%    \end{macrocode}
+%    \begin{macrocode}
         \renewcommand{\and}{
             \end{BlockClass}
             \begin{BlockClass}{oneauthor}
@@ -15713,7 +16038,7 @@
 %    \begin{macrocode}
 \@maketitle
 %    \end{macrocode}
-% Immediately generate any |\thanks| footnotes:
+% Immediately generate any \cs{thanks} footnotes:
 %    \begin{macrocode}
 \@thanks
 }
@@ -15829,13 +16154,15 @@
 %    \end{macrocode}
 % \end{macro}
 %
+% Some classes allow an optional name, so it is allowed here.
 % \begin{environment}{abstract}
+% \changes{v0.48}{2018/02/05}{Allow optional name.}
 %    \begin{macrocode}
-\DeclareDocumentEnvironment{abstract}{}
+\DeclareDocumentEnvironment{abstract}{O{\abstractname}}
 {
 \LWR at forcenewpage
 \BlockClass{abstract}
-\BlockClassSingle{abstracttitle}{\abstractname}
+\BlockClassSingle{abstracttitle}{#1}
 }
 {
 \endBlockClass
@@ -16019,7 +16346,7 @@
 %    \end{macrocode}
 % Create a new |pre| of the given class.
 % The tags may temporarily be turned off for internal use, such
-% as loading the MathJax script.
+% as loading the \brand{MathJax} script.
 %    \begin{macrocode}
 \ifbool{LWR at verbtags}{%
     \LWR at htmltag{pre class="#2"
@@ -16196,6 +16523,8 @@
 
 % \section{Lists}
 %
+% \limitslists
+%
 % ^^A \limitsbabelone
 %
 % The environments |itemize|, |enumerate|, and |description| are patched
@@ -16225,6 +16554,11 @@
 %     \end{itemize}
 %\end{Verbatim}
 %
+%
+%
+% \DescribeMacro{\makelabel}
+% \limitsmakelabel
+%
 % \changes{v0.34}{2017/07/27}{Lists refactored to remove \pkg{enumitem} requirement.}
 %
 % \subsection{List environment}
@@ -16246,26 +16580,20 @@
 % May be locally redefined by \env{enumerate} or \env{description}.
 % \changes{v0.47}{2018/01/26}{Fix: Line wrap at \HTML\ hyphen.}
 %    \begin{macrocode}
-\newcommand*{\LWR at printopenlist}{ul style="\mbox{list-style-type:none}"}
+\newcommand*{\LWR at printopenlist}{ul style="\LWR at origmbox{list-style-type:none}"}
 %    \end{macrocode}
 % \end{macro}
 
-
-% ^^A \begin{macro}{\LWR@@labels} \pkg{lwarp} replacement for \cs{\@labels}.
-% ^^A \changes{v0.45}{2018/01/11}{Added.}
-% ^^A    \begin{macrocode}
-% ^^A \newcommand{\LWR@@labels}{}% no longer needed
-% ^^A    \end{macrocode}
-% ^^A \end{macro}
-
-
 % \begin{macro}{\@mklab}
 % Removes \PDF\ spacing.
 % \changes{v0.45}{2018/01/11}{Modified for \HTML.}
 %    \begin{macrocode}
+\AtBeginDocument{
 \def\@mklab#1{%
 %     \hfil %
     #1}
+\let\makelabel\@mklab
+}
 %    \end{macrocode}
 % \end{macro}
 
@@ -16297,8 +16625,10 @@
 % Modified for \HTML\ output by replacing \TeX\ boxes with plain text.
 % Also removes \PDF\ spacing.
 % \changes{v0.45}{2018/01/11}{Modified for \HTML.}
+% \changes{v0.48}{2018/02/02}{Honors \cs{makelabel}.}
 %    \begin{macrocode}
-\def\@item[#1]{%
+\def\LWR at HTML@item[#1]{%
+\LWR at traceinfo{@item}
   \if at noparitem
     \@donoparitem
   \else
@@ -16340,8 +16670,6 @@
 %    \end{macrocode}
 %
 %    \begin{macrocode}
-%         \LWR@@labels
-%         \renewcommand{\LWR@@labels}{}
 %       \box\@labels
 %       \penalty\z@
 %     \fi
@@ -16366,9 +16694,7 @@
   \fi
 %    \end{macrocode}
 %    \begin{macrocode}
-%     \appto{\LWR@@labels}{\makelabel{#1}}%
-%     \makelabel{#1}
-        #1
+    \makelabel{#1}%
 %   \sbox\@tempboxa{\makelabel{#1}%
 %   \global\setbox\@labels\hbox{%
 %     \unhbox\@labels
@@ -16419,6 +16745,21 @@
 %    \end{macrocode}
 % \end{macro}
 
+
+% \begin{macro}{\LWR at nulllistfills} Nullifies various \TeX\ fill commands,
+% in case they are used inside \cs{makelabel}.
+%    \begin{macrocode}
+\newcommand*{\LWR at nulllistfills}{%
+\renewcommand*{\hss}{}%
+\renewcommand*{\llap}[1]{##1}%
+\renewcommand*{\rlap}[1]{##1}%
+\renewcommand*{\hfil}{}%
+\renewcommand*{\hfilneg}{}%
+\renewcommand*{\hfill}{}%
+}
+%    \end{macrocode}
+% \end{macro}
+
 % \begin{environment}{list} \marg{label} \marg{commands}
 % \changes{v0.44}{2017/11/15}{Added \env{list} and \env{trivlist}.}
 %    \begin{macrocode}
@@ -16437,6 +16778,7 @@
 \setlength{\listparindent}{0pt}%
 \setlength{\itemindent}{0pt}%
 \setlength{\labelsep}{1em}%
+\LWR at nulllistfills%
 }
 %    \end{macrocode}
 % \changes{v0.46}{2018/01/21}{Fix: Stack unnesting.}
@@ -16455,9 +16797,9 @@
 
 % \begin{macro}{\LWR at itemizeitem} \oarg{label}
 %
-% Handles |\item| inside an itemize or enumerate.
+% Handles \cs{item} inside an itemize or enumerate.
 %
-% See |\LWR at openparagraph| where extra |\hspace| is used to
+% See \cs{LWR at openparagraph} where extra \cs{hspace} is used to
 % leave room for the label while inside a list during paragraph construction.
 %    \begin{macrocode}
 \newcommand*{\LWR at itemizeitem}{%
@@ -16475,8 +16817,9 @@
 %    \begin{macrocode}
 \newcommand*{\LWR at itemizestart}{%
 \renewcommand*{\LWR at printcloselist}{\LWR at printcloseitemize}
-\renewcommand*{\LWR at printopenlist}{ul style="\mbox{list-style-type:none}"}
+\renewcommand*{\LWR at printopenlist}{ul style="\LWR at origmbox{list-style-type:none}"}
 \let\item\LWR at itemizeitem%
+\LWR at nulllistfills%
 }
 %    \end{macrocode}
 % \end{environment}
@@ -16492,8 +16835,9 @@
 %    \begin{macrocode}
 \newcommand*{\LWR at enumeratestart}{%
 \renewcommand*{\LWR at printcloselist}{\LWR at printcloseitemize}
-\renewcommand*{\LWR at printopenlist}{ul style="\mbox{list-style-type:none}"}
+\renewcommand*{\LWR at printopenlist}{ul style="\LWR at origmbox{list-style-type:none}"}
 \let\item\LWR at itemizeitem%
+\LWR at nulllistfills%
 }
 %    \end{macrocode}
 % \end{environment}
@@ -16502,7 +16846,7 @@
 % \subsection{Description}
 
 % \begin{macro}{\LWR at descitem} \oarg{label}
-% Handles an |\item| inside a description.
+% Handles an \cs{item} inside a description.
 %    \begin{macrocode}
 \newcommand*{\LWR at descitem}[1][]%
 {%
@@ -16538,6 +16882,7 @@
 \renewcommand*{\LWR at printcloselist}{\LWR at printclosedescription}
 \renewcommand*{\LWR at printopenlist}{dl}
 \let\item\LWR at descitem%
+\LWR at nulllistfills%
 }
 %    \end{macrocode}
 % \end{environment}
@@ -16545,12 +16890,6 @@
 
 % \subsection{Patching the lists}
 
-%    \begin{macrocode}
-\let\LWR at orig@trivlist\@trivlist
-\let\LWR at origtrivlist\trivlist
-\let\LWR at origendtrivlist\endtrivlist
-%    \end{macrocode}
-
 % \begin{macro}{\LWR at patchlists} Patches list environments.
 %
 % \cs{LWr at patchlists} remembers \cs{item} as defined by whatever packages have
@@ -16563,7 +16902,8 @@
 %
 %    \begin{macrocode}
 \newcommand*{\LWR at patchlists}{%
-    \let\item\LWR at listitem%
+    \LetLtxMacro\item\LWR at listitem%
+    \LetLtxMacro\@item\LWR at HTML@item%
     \renewcommand*{\@trivlist}{%
         \LWR at traceinfo{@trivlist start}%
         \LWR at liststart%
@@ -16570,22 +16910,24 @@
         \LWR at orig@trivlist%
         \LWR at traceinfo{@trivlist done}%
     }%
+    \renewcommand*{\trivlist}{%
+        \LWR at traceinfo{trivlist}%
+        \LWR at origtrivlist%
+    }%
     \renewcommand*{\endtrivlist}{%
         \LWR at traceinfo{endtrivlist start}%
         \LWR at origendtrivlist\LWR at listend%
         \LWR at traceinfo{endtrivlist done}%
     }%
-    \renewcommand*{\trivlist}{%
-        \LWR at traceinfo{trivlist}%
-        \LWR at origtrivlist%
-        \def\makelabel####1{\LWR at orighspace{3em}####1}%
+    \renewcommand*{\itemize}{%
+        \LWR at itemizestart\LWR at origitemize%
     }%
-    \renewcommand*{\itemize}{\LWR at itemizestart\LWR at origitemize}%
-    \renewcommand*{\enumerate}{\LWR at enumeratestart\LWR at origenumerate}%
-    \renewcommand*{\description}{\LWR at descriptionstart\LWR at origdescription}%
-%     \AtBeginEnvironment{itemize}{\LWR at itemizestart}%
-%     \AtBeginEnvironment{enumerate}{\LWR at enumeratestart}%
-%     \AtBeginEnvironment{description}{\LWR at descriptionstart}%
+    \renewcommand*{\enumerate}{%
+        \LWR at enumeratestart\LWR at origenumerate%
+    }%
+    \renewcommand*{\description}{%
+        \LWR at descriptionstart\LWR at origdescription%
+    }%
 }
 %    \end{macrocode}
 % \end{macro}
@@ -16593,10 +16935,12 @@
 % \begin{macro}{\LWR at restoreoriglists} Restores the original \env{trivlist} environment.
 %    \begin{macrocode}
 \newcommand*{\LWR at restoreoriglists}{%
+\LWR at traceinfo{LWR at restoreoriglists}%
+\LetLtxMacro\item\LWR at origitem%
+\LetLtxMacro\@item\LWR at orig@item%
 \let\@trivlist\LWR at orig@trivlist%
 \let\trivlist\LWR at origtrivlist%
 \let\endtrivlist\LWR at origendtrivlist%
-\LetLtxMacro\item\LWR at origitem%
 \LetLtxMacro\itemize\LWR at origitemize%
 \LetLtxMacro\enditemize\LWR at endorigitemize%
 \LetLtxMacro\enumerate\LWR at origenumerate%
@@ -16603,6 +16947,10 @@
 \LetLtxMacro\endenumerate\LWR at endorigenumerate%
 \LetLtxMacro\description\LWR at origdescription%
 \LetLtxMacro\enddescription\LWR at endorigdescription%
+\let\@mklab\LWR at orig@mklab%
+\let\makelabel\LWR at origmakelabel%
+\let\@donoparitem\LWR at orig@donoparitem%
+\let\@nbitem\LWR at orig@nbitem%
 }
 %    \end{macrocode}
 % \end{macro}
@@ -16633,7 +16981,7 @@
 %
 % \subsection{Token lookahead}
 
-% Used by |\LWR at futurenonspacelet| to look at the next token.
+% Used by \cs{LWR at futurenonspacelet} to look at the next token.
 
 % \codehtml
 %    \begin{macrocode}
@@ -16646,9 +16994,9 @@
 %    \end{macrocode}
 % \end{macro}
 
-% |\futurelet| copies the next token then executes a function to analyze
+% \cs{futurelet} copies the next token then executes a function to analyze
 
-% |\LWR at futurenonspacelet| does the same, but ignores intervening white space
+% \cs{LWR at futurenonspacelet} does the same, but ignores intervening white space
 
 % Based on the \pkg{booktabs} style:
 
@@ -16665,7 +17013,7 @@
 % \end{macro}
 
 % \begin{macro}{\LWR at getmynexttoken}
-% Looks ahead and copies the next token into |\LWR at mynexttoken|.
+% Looks ahead and copies the next token into \cs{LWR at mynexttoken}.
 %    \begin{macrocode}
 \newcommand*{\LWR at getmynexttoken}{%
 \LWR at traceinfo{LWR at getmynexttoken}%
@@ -16947,7 +17295,17 @@
         \ifbool{LWR at tableparcell}{\LWR at stoppars}{}%
         \global\boolfalse{LWR at tableparcell}%
 %    \end{macrocode}
+%
 % Close the table data cell.
+%
+% Close any color \element{div}s.
+% \changes{v0.48}{2018/02/06}{\pkg{colortbl}: Added.}
+%    \begin{macrocode}
+        \whileboolexpr{test {\ifnumcomp{\value{LWR at cellcolordepth}}{>}{0}}}{%
+            \LWR at htmltag{/div}\LWR at orignewline%
+            \addtocounter{LWR at cellcolordepth}{-1}%
+        }%
+%    \end{macrocode}
 % Skip the |@| and |!| cells if are closing a multicolumn cell.
 %    \begin{macrocode}
         \leavevmode\unskip\LWR at htmltag{/td}\LWR at orignewline%
@@ -16958,6 +17316,13 @@
 \global\boolfalse{LWR at skippingmrowcell}%
 \global\boolfalse{LWR at skippingmcolrowcell}%
 \global\boolfalse{LWR at skipatbang}%
+%    \end{macrocode}
+% Color control.  Column is set by |>{}| for each cell, so it must be cleared here.
+% \changes{v0.48}{2018/02/06}{\pkg{colortbl}: Added.}
+%    \begin{macrocode}
+\renewcommand*{\LWR at cellHTMLcolor}{}
+\renewcommand*{\LWR at columnHTMLcolor}{}
+\setcounter{LWR at cellcolordepth}{0}
 }
 %    \end{macrocode}
 % \end{macro}
@@ -17188,6 +17553,7 @@
 \global\boolfalse{LWR at doingtbrule}%
 \global\boolfalse{LWR at doingcmidrule}%
 \LWR at clearmidrules%
+\renewcommand*{\LWR at rowHTMLcolor}{}
 %    \end{macrocode}
 % Start at first column:
 %    \begin{macrocode}
@@ -17500,7 +17866,7 @@
 % \item [b:] With paragraph tags, \CSS\ |vertical-align:top| so that the bottom of the
 % text is closest to the middle of the text line.
 % \item [P, M, B:] Horizontally-centered versions.
-% \item [S:] Converted to 'r'.  From the \pkg{siunitx} package.
+% \item [S:] Converted to 'r'.  Ignores optional argument.  From the \pkg{siunitx} package.
 % \item [D:] Converted to 'c'.  From the \pkg{dcolumn} package.
 % \item [@, !, \textgreater{}, \textless{}:] One each, in that order.
 % \item [\textbar:] Vertical rule.
@@ -17517,7 +17883,13 @@
 %    \end{macrocode}
 %
 %
+% \DescribeBoolean{LWR at opttablecol} True if found a table column optional argument.
+%    \begin{macrocode}
+\newbool{LWR at opttablecol}
+%    \end{macrocode}
 %
+%
+%
 % \begin{macro}{\LWR at parsetablecols} \marg{colspecs}
 %
 % Scans the column specification left to right.
@@ -17534,7 +17906,7 @@
 %
 %    \begin{macrocode}
 \newcommand*{\LWR at parsetablecols}[1]{%
-\LWR at traceinfo{LWR at parsetablecols started}%
+\LWR at traceinfo{LWR at parsetablecols}%
 %    \end{macrocode}
 % Remember the original supplied column spec:
 %    \begin{macrocode}
@@ -17581,13 +17953,16 @@
 % Place the colspecs string length into \cs{LWR at strresult},
 % and remember the number of characters in the column specification:
 %    \begin{macrocode}
-\LWR at traceinfo{about to StrLen}%
 \expandarg%
 \StrLen{\LWR at origcolspec}[\LWR at strresult]%
 \fullexpandarg%
-\LWR at traceinfo{finished StrLen}%
+\LWR at traceinfo{original column spec length: \LWR at strresult}%
 \setcounter{LWR at tablecolspecwidth}{\LWR at strresult}%
 %    \end{macrocode}
+% Haven't seen any optional arguments so far
+%    \begin{macrocode}
+\boolfalse{LWR at opttablecol}%
+%    \end{macrocode}
 % Scan through the column specifications:
 %    \begin{macrocode}
 \whileboolexpr{%
@@ -17604,13 +17979,25 @@
 \LWR at traceinfo{position \arabic{LWR at tablecolspecindex}: \LWR at strresult}%
 \fullexpandarg%
 %    \end{macrocode}
-% Not yet found a valid column type
+% Not yet found a valid column type:
 %    \begin{macrocode}
 \boolfalse{LWR at validtablecol}%
 %    \end{macrocode}
-% Note that the parameter for a |p{spec}| column is a token list which will NOT match l,c,r,p.
-% \watchout
+%
+% Skip over any optional arguments, such as \pkg{siunitx} |S| column:
+% \changes{v0.48}{2018/02/04}{Fix: Ignore optional tabular column arguments.}
 %    \begin{macrocode}
+\IfStrEq{\LWR at strresult}{[}{\booltrue{LWR at opttablecol}}{}%
+%    \end{macrocode}
+%
+% Throw away anything found inside the optional argument:
+%    \begin{macrocode}
+\ifbool{LWR at opttablecol}%
+{}% inside an optional argument
+{% not an optional tabular argument
+%    \end{macrocode}
+% Not inside an optional argument, so consider the column type:
+%    \begin{macrocode}
 \IfStrEq{\LWR at strresult}{l}{\LWR at parsenormalcolumn{l}}{}%
 \IfStrEq{\LWR at strresult}{c}{\LWR at parsenormalcolumn{c}}{}%
 \IfStrEq{\LWR at strresult}{r}{\LWR at parsenormalcolumn{r}}{}%
@@ -17653,13 +18040,121 @@
     \LWR at traceinfo{invalid column type: \LWR at strresult}%
     \LWR at parsenormalcolumn{l}%
 }%
+}% not an optional column argument
+%    \end{macrocode}
+% If read the closing bracket, no longer inside the optional argument:
+%    \begin{macrocode}
+\IfStrEq{\LWR at strresult}{]}{\boolfalse{LWR at opttablecol}}{}%
+%    \end{macrocode}
+% Move to the next character:
+%    \begin{macrocode}
 \addtocounter{LWR at tablecolspecindex}{1}%
 }% whiledo
+\LWR at traceinfo{LWR at parsetablecols: done}%
 }%
 %    \end{macrocode}
 % \end{macro}
 
 
+% \subsection{\pkg{colortbl} support}
+%
+% \changes{v0.48}{2018/02/06}{\pkg{colortbl}: Added.}
+%
+% These macros provide a minimal emulation of some \pkg{colortbl} macros
+% which might appear between table cells.
+% If \pkg{colortbl} is loaded, these macros will be replaced with
+% functional versions.
+
+% For each of the HTML colors below, the text for the \HTML\ color is
+% set if requested, but the macro is empty if none has been set.
+%
+% \begin{macro}{\LWR at columnHTMLcolor} \HTML style code for the column color.
+%    \begin{macrocode}
+\newcommand{\LWR at columnHTMLcolor}{}
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\LWR at rowHTMLcolor} \HTML style code for the row color.
+%    \begin{macrocode}
+\newcommand{\LWR at rowHTMLcolor}{}
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\LWR at cellHTMLcolor} \HTML style code for the cell color.
+%    \begin{macrocode}
+\newcommand{\LWR at cellHTMLcolor}{}
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\LWR at ruleHTMLcolor} \HTML style code for the cell color.
+%    \begin{macrocode}
+\newcommand{\LWR at ruleHTMLcolor}{}
+%    \end{macrocode}
+% \end{macro}
+%
+% Inside an \HTML\ \env{tabular}, each of \cs{columncolor} etc. is \cs{let} to
+% the \cs{LWR at HTML} versions below.  When \pkg{colortbl} is loaded,
+% its definitions override the following.
+%
+% \begin{macro}{\columncolor} \oarg{model} \marg{color} \oarg{left overhang} \oarg{right overhang}
+% \begin{macro}{\LWR at HTMLcolumncolor} \oarg{model} \marg{color} \oarg{left overhang} \oarg{right overhang}
+%    \begin{macrocode}
+\NewDocumentCommand{\LWR at HTMLcolumncolor}{O{named} m o o}{}
+%    \end{macrocode}
+% \end{macro}
+% \end{macro}
+
+% \begin{macro}{\rowcolor} \oarg{model} \marg{color} \oarg{left overhang} \oarg{right overhang}
+% \begin{macro}{\LWR at HTMLrowcolor} \oarg{model} \marg{color} \oarg{left overhang} \oarg{right overhang}
+% Used before starting a tabular data cell, thus \cs{LWR at getmynexttoken}.
+%    \begin{macrocode}
+\NewDocumentCommand{\LWR at HTMLrowcolor}{O{named} m o o}{\LWR at getmynexttoken}
+%    \end{macrocode}
+% \end{macro}
+% \end{macro}
+
+% \begin{macro}{\cellcolor} \oarg{model} \marg{color} \oarg{left overhang} \oarg{right overhang}
+% \begin{macro}{\LWR at HTMLcellcolor} \oarg{model} \marg{color} \oarg{left overhang} \oarg{right overhang}
+%    \begin{macrocode}
+\NewDocumentCommand{\LWR at HTMLcellcolor}{O{named} m o o}{}
+%    \end{macrocode}
+% \end{macro}
+% \end{macro}
+
+% \begin{macro}{\arrayrulecolor} \oarg{model} \marg{color}
+%
+% The version for use outside a \env{tabular}.
+%    \begin{macrocode}
+\newcommand{\arrayrulecolor}[2][named]{}
+%    \end{macrocode}
+% \end{macro}
+
+% \begin{macro}{\LWR at HTMLarrayrulecolor} \oarg{model} \marg{color}
+%
+% The version for use inside a \env{tabular}.
+%    \begin{macrocode}
+\newcommand{\LWR at HTMLarrayrulecolor}[2][named]{\LWR at getmynexttoken}
+%    \end{macrocode}
+% \end{macro}
+
+% \begin{macro}{\doublerulesepcolor} \oarg{model} \marg{color}
+%
+% The version for use outside a \env{tabular}.
+%    \begin{macrocode}
+\newcommand{\doublerulesepcolor}[2][named]{}
+%    \end{macrocode}
+% \end{macro}
+
+% \begin{macro}{\LWR at HTMLdoublerulesepcolor} \oarg{model} \marg{color}
+%
+% The version for use inside a \env{tabular}.
+%    \begin{macrocode}
+\newcommand{\LWR at HTMLdoublerulesepcolor}[2][named]{\LWR at getmynexttoken}
+%    \end{macrocode}
+% \end{macro}
+
+
+
 % \subsection{Starting a new row}
 
 % \begin{macro}{\LWR at maybenewtablerow}
@@ -17683,13 +18178,27 @@
     \global\booltrue{LWR at intabularmetadata}%
     \ifbool{LWR at doinghline}%
     {%
-        \LWR at htmltag{tr class="hline" }%
+        \ifdefvoid{\LWR at ruleHTMLcolor}{%
+            \LWR at htmltag{tr class="hline" }%
+        }{%
+            \LWR at htmltag{%
+                tr class="hline" %
+                style="border-top: 1px solid \#\LWR at ruleHTMLcolor "%
+            }%
+        }%
         \LWR at orignewline%
     }%
     {% not doing hline
         \ifbool{LWR at doingtbrule}%
         {%
-            \LWR at htmltag{tr class="tbrule"}%
+            \ifdefvoid{\LWR at ruleHTMLcolor}{%
+                \LWR at htmltag{tr class="tbrule"}%
+            }{%
+                \LWR at htmltag{%
+                    tr class="tbrule" %
+                    style="border-top: 1px solid \#\LWR at ruleHTMLcolor "%
+                }%
+            }%
             \LWR at orignewline%
         }%
         {\LWR at htmltag{tr}\LWR at orignewline}%
@@ -17749,6 +18258,7 @@
         "%
         \LWR at tdstartstyles%
         \LWR at addcmidrulewidth%
+        \LWR at addtabularrulecolors%
         \LWR at tdendstyles%
     }%
 %    \end{macrocode}
@@ -17803,7 +18313,7 @@
 
 
 % \begin{macro}{\LWR at tabledatasinglecolumntag}
-% Print a table data opening tag with style for alignment
+% Print a table data opening tag with style for alignment and color.
 %
 % \changes{v0.33}{2017/06/22}{Fix: Macros in tabular could cause extra data cell.}
 % \changes{v0.41}{2017/09/28}{Add: \cs{cmidrule} trims.}
@@ -17829,7 +18339,7 @@
 %    \begin{macrocode}
         \LWR at tabularleftedge%
 %    \end{macrocode}
-% Fetch the current column's alignment character into |\LWR at strresult|:
+% Fetch the current column's alignment character into \cs{LWR at strresult}:
 %    \begin{macrocode}
         \StrChar{\LWR at tablecolspec}{\arabic{LWR at tablecolindex}}[\LWR at strresult]%
 %    \end{macrocode}
@@ -17850,6 +18360,7 @@
         \LWR at printbartag{\arabic{LWR at tablecolindex}}%
         "%
 %    \end{macrocode}
+% Add styles for rules, alignment:
 % \changes{v0.42}{2017/10/26}{If \protect\texttt{FormatWP} add cell alignment.}
 %    \begin{macrocode}
         \LWR at tdstartstyles%
@@ -17856,9 +18367,17 @@
         \LWR at addcmidrulewidth%
         \StrChar{\LWR at tablecolspec}{\arabic{LWR at tablecolindex}}[\LWR at thiscolspec]%
         \LWR at addformatwpalignment{\LWR at thiscolspec}%
+%    \end{macrocode}
+% Add styles for cell and rule colors:
+% \changes{v0.48}{2018/02/08}{\pkg{colortbl}: Added.}
+%    \begin{macrocode}
+        \LWR at addtabularrowcolor%
+        \LWR at addtabularrulecolors%
+%    \end{macrocode}
+%    \begin{macrocode}
         \LWR at tdendstyles%
         }%
-\LWR at traceinfo{LWR at tabledatasinglecolumntag: done printing td tag}%
+        \LWR at traceinfo{LWR at tabledatasinglecolumntag: done printing td tag}%
 %    \end{macrocode}
 % If this is a p, m, b, or X column, allow paragraphs:
 %    \begin{macrocode}
@@ -17958,7 +18477,7 @@
 % \begin{macro}{\LWR at clearmidrules}
 % Start new midrules.  Called at beginning of tabular and also at |\\|.
 %
-% Clears all |LWR at midrules| and |LWR at trimruels| markers for this line.
+% Clears all |LWR at midrules| and |LWR at trimrules| markers for this line.
 %
 % \changes{v0.41}{2017/09/28}{Add: \cs{cmidrule} trims.}
 %    \begin{macrocode}
@@ -18015,7 +18534,7 @@
 
 % \begin{macro}{\LWR at docmidrule} \oarg{width} \marg{trim} \marg{leftcolumn-rightcolumn}
 %
-% Marks |LWR at midrules| array elements to be ``Y'' from left to right columns.
+% Marks |LWR at midrules| array elements to be a non-zero width from left to right columns.
 % Also marks trimming for the L and/or R columns.
 %
 %    \begin{macrocode}
@@ -18080,7 +18599,9 @@
 %
 %    \begin{macrocode}
 \newcommand*{\LWR at subaddcmidruletrim}[2]{%
-\setlength{\LWR at templengthone}{\LWR at getexparray{LWR at midrules}{\arabic{LWR at tablecolindex}}}%
+\setlength{\LWR at templengthone}{%
+        \LWR at getexparray{LWR at midrules}{\arabic{LWR at tablecolindex}}%
+}%
 \ifdimcomp{\LWR at templengthone}{>}{0pt}%
 {%
 %    \end{macrocode}
@@ -18127,20 +18648,24 @@
 %    \begin{macrocode}
 \newcommand{\LWR at addrulewidth}[2]{%
 %    \end{macrocode}
-% Only add a custom width if |thiswidth| is different than the |defaultwidth|:
+% Only add a custom width if |thiswidth| is different than the |defaultwidth|,
+% or if a color is being used:
 %    \begin{macrocode}
 \ifboolexpr{%
-    test{\ifdimcomp{#1}{=}{0pt}}%
-    or ( test{\ifdimcomp{#1}{=}{#2}} and not bool{FormatWP} )%
+    test{\ifdimcomp{#1}{=}{0pt}} or
+    (
+        ( test{\ifdimcomp{#1}{=}{#2}} and not bool{FormatWP} )
+        and ( test {\ifdefvoid{\LWR at ruleHTMLcolor}} )
+    )
 }%
-{}% default width
-{% custom width
+{}% default width and color
+{% custom width and/or color
 %    \end{macrocode}
 % Ensure that the width is wide enough to display in the browser:
 %    \begin{macrocode}
     \LWR at forceminwidth{#1}%
 %    \end{macrocode}
-% Begin adding a style:
+% Begin adding another style:
 %    \begin{macrocode}
     \LWR at tdaddstyle%
 %    \end{macrocode}
@@ -18149,16 +18674,20 @@
     \uselengthunit{PT}%
     border-top:\rndprintlength{\LWR at atleastonept} solid %
 %    \end{macrocode}
-% The darkness of the color depends on the thickness of the rule:
+% If default gray, the darkness of the color depends on the thickness of the rule:
 %    \begin{macrocode}
-    \ifdimcomp{#1}{<}{\LWR at lightrulewidth}%
-    {\#A0A0A0}%
-    {% lightrule or heaver
-        \ifdimcomp{#1}{<}{\LWR at heavyrulewidth}%
-        {\#808080}%
-        {black}%
-    }% lightrule or heavier
-}% custom width
+    \ifdefvoid{\LWR at ruleHTMLcolor}{%
+        \ifdimcomp{#1}{<}{\LWR at lightrulewidth}%
+        {\#A0A0A0}%
+        {% lightrule or heaver
+            \ifdimcomp{#1}{<}{\LWR at heavyrulewidth}%
+            {\#808080}%
+            {black}%
+        }% lightrule or heavier
+    }{%
+        \#\LWR at ruleHTMLcolor%
+    }
+}% custom width and/or color
 }
 %    \end{macrocode}
 % \end{macro}
@@ -18176,13 +18705,12 @@
 % \end{macro}
 
 
-
 % \begin{macro}{\LWR at WPcell} \marg{text-align} \marg{vertical-align}
 % \changes{v0.47}{2018/01/26}{Fix: Line wrap at \HTML\ hyphen.}
 %    \begin{macrocode}
 \newcommand*{\LWR at WPcell}[2]{%
 \LWR at tdaddstyle%
-\mbox{text-align:#1}; \mbox{vertical-align:#2}%
+\LWR at origmbox{text-align:#1}; \LWR at origmbox{vertical-align:#2}%
 }
 %    \end{macrocode}
 % \end{macro}
@@ -18213,6 +18741,141 @@
 % \end{macro}
 
 
+% \subsection{Cell colors}
+
+% \changes{v0.48}{2018/02/06}{\pkg{colortbl}: Added.}
+%
+% \begin{macro}{\LWR at addtabularrowcolor} Adds a cell's row color style, if needed.
+%
+% No color is added for the final row of empty cells which finishes each \env{tabular}.
+%
+%    \begin{macrocode}
+\newcommand*{\LWR at addtabularrowcolor}{%
+\ifbool{LWR at tabularmutemods}{}{%
+    \ifdefvoid{\LWR at rowHTMLcolor}{}%
+    {% row color
+        \LWR at tdaddstyle%
+        background:\#\LWR at rowHTMLcolor%
+    }% row color
+}%
+}
+%    \end{macrocode}
+% \end{macro}
+
+
+%
+% \begin{macro}{\LWR at addtabularhrulecolor} Adds a cell's horizontal rule color style, if needed.
+% \changes{v0.48}{2018/02/08}{\pkg{colortbl}: Added.}
+%    \begin{macrocode}
+\newcommand*{\LWR at addtabularhrulecolor}{%
+%    \end{macrocode}
+% If either form of horizontal rule is requested:
+%    \begin{macrocode}
+\ifboolexpr {
+    bool{LWR at doinghline} or
+    bool{LWR at doingtbrule}
+}{%
+%    \end{macrocode}
+% And if there is a custom horizontal color:
+%    \begin{macrocode}
+    \ifdefvoid{\LWR at ruleHTMLcolor}{}%
+    {%
+        \LWR at tdaddstyle%
+        border-top: 1px solid \#\LWR at ruleHTMLcolor%
+    }{}%
+}{}%
+}
+%    \end{macrocode}
+% \end{macro}
+
+
+%
+% \begin{macro}{\LWR at addtabularrulecolors} Adds a cell's rule color styles, if needed.
+% \changes{v0.48}{2018/02/08}{\pkg{colortbl}: Added.}
+%
+% No color is added for the final row of empty cells which finishes each \env{tabular}.
+%
+%    \begin{macrocode}
+\newcommand*{\LWR at addtabularrulecolors}{%
+%    \end{macrocode}
+% Custom horizonal rule color:
+%    \begin{macrocode}
+\LWR at addtabularhrulecolor%
+%    \end{macrocode}
+% No vertical rules if finishing the \env{tabular} with a row of empty cells:
+%    \begin{macrocode}
+\ifbool{LWR at tabularmutemods}{}{%
+%    \end{macrocode}
+% If at the leftmost cell, possibly add a leftmost vertical rule:
+%    \begin{macrocode}
+    \ifnumequal{\value{LWR at tablecolindex}}{1}{%
+%    \end{macrocode}
+% Fetch the left edge's vertical bar specification:
+%    \begin{macrocode}
+        \edef\LWR at tempone{\LWR at getexparray{LWR at colbarspec}{leftedge}}%
+%    \end{macrocode}
+% Add a custom style if a vertical bar was requested:
+%    \begin{macrocode}
+        \ifdefstring{\LWR at tempone}{tvertbarl}{%
+                \LWR at tdaddstyle%
+                border-left: 1px solid \#\LWR at vertruleHTMLcolor%
+        }{}%
+    }{}%
+%    \end{macrocode}
+% Possibly add a right vertical rule for this cell:
+%    \begin{macrocode}
+    \edef\LWR at tempone{\LWR at getexparray{LWR at colbarspec}{\arabic{LWR at tablecolindex}}}%
+    \ifdefstring{\LWR at tempone}{tvertbarr}{%
+%    \end{macrocode}
+% Add a custom style if a vertical bar was requested:
+%    \begin{macrocode}
+            \LWR at tdaddstyle%
+            border-right: 1px solid \#\LWR at vertruleHTMLcolor%
+    }{}%
+}%
+}
+%    \end{macrocode}
+% \end{macro}
+
+
+% \DescribeCounter{LWR at cellcolordepth}
+% Counts how many cell color \element{div}s were added to the current tabular data cell.
+%    \begin{macrocode}
+\newcounter{LWR at cellcolordepth}
+%    \end{macrocode}
+
+
+% \begin{macro}{\LWR at subaddtabularcellcolor} \marg{HTML color}
+%    \begin{macrocode}
+\newcommand*{\LWR at subaddtabularcellcolor}[1]{%
+\LWR at htmltag{div class="cellcolor" style="%
+    background:\#{}#1 %
+" }%
+\addtocounter{LWR at cellcolordepth}{1}%
+}
+%    \end{macrocode}
+% \end{macro}
+
+
+% \begin{macro}{\LWR at addtabularcellcolor} Adds a cell color style, if needed.
+%    \begin{macrocode}
+\newcommand*{\LWR at addtabularcellcolor}{%
+\ifdefvoid{\LWR at cellHTMLcolor}%
+{%
+    \ifdefvoid{\LWR at rowHTMLcolor}%
+    {%
+        \ifdefvoid{\LWR at columnHTMLcolor}%
+        {}%
+        {\LWR at subaddtabularcellcolor{\LWR at columnHTMLcolor}}%
+    }%
+    {\LWR at subaddtabularcellcolor{\LWR at rowHTMLcolor}}%
+}%
+{\LWR at subaddtabularcellcolor{\LWR at cellHTMLcolor}}%
+}
+%    \end{macrocode}
+% \end{macro}
+
+
 % \subsection{Multicolumns}
 
 % \subsubsection{Parsing multicolumns}
@@ -18262,9 +18925,9 @@
 % \changes{v0.43}{2017/11/07}{Added vertical rules.}
 %    \begin{macrocode}
 \IfStrEq{\LWR at strresult}{|}{%
-    \ifnumcomp{\value{LWR at tablemulticolspos}}{=}{1}%
-        {\booltrue{LWR at mcolvertbarl}}%
-        {\booltrue{LWR at mcolvertbarr}}%
+    \ifnumcomp{\value{LWR at tablemulticolspos}}{=}{1}% left edge?
+        {\booltrue{LWR at mcolvertbarl}}% left edge
+        {\booltrue{LWR at mcolvertbarr}}% not left edge
 }{}%
 \LWR at traceinfo{lwr at printmccoltype done}%
 }
@@ -18406,7 +19069,33 @@
 
 % \subsubsection{Multicolumn factored code}
 
+% \begin{macro}{\LWR at addmulticolvertrulecolor}
+%    \begin{macrocode}
+\newcommand*{\LWR at addmulticolvertrulecolor}{%
+%    \end{macrocode}
+% No vertical rules if finishing the \env{tabular} with a row of empty cells:
+%    \begin{macrocode}
+\ifbool{LWR at tabularmutemods}{}{%
+%    \end{macrocode}
+% Left side:
+%    \begin{macrocode}
+    \ifbool{LWR at mcolvertbarl}{%
+        \LWR at tdaddstyle%
+        border-left: 1px solid \#\LWR at vertruleHTMLcolor%
+    }{}%
+%    \end{macrocode}
+% Right side:
+%    \begin{macrocode}
+    \ifbool{LWR at mcolvertbarr}{%
+        \LWR at tdaddstyle%
+        border-right: 1px solid \#\LWR at vertruleHTMLcolor%
+    }{}%
+}%
+}
+%    \end{macrocode}
+% \end{macro}
 
+
 %    \begin{macrocode}
 \newcommand{\LWR at multicoltext}{}
 %    \end{macrocode}
@@ -18462,8 +19151,8 @@
 % \changes{v0.47}{2018/01/26}{Fix: Line wrap at \HTML\ hyphen.}
 %    \begin{macrocode}
 \IfValueT{#1}{% vpos?
-\ifstrequal{#1}{b}{style="\mbox{vertical-align:bottom}" }{}%
-\ifstrequal{#1}{t}{style="\mbox{vertical-align:top}" }{}%
+\ifstrequal{#1}{b}{style="\LWR at origmbox{vertical-align:bottom}" }{}%
+\ifstrequal{#1}{t}{style="\LWR at origmbox{vertical-align:top}" }{}%
 }% vpos?
 }% rows?
 %    \end{macrocode}
@@ -18501,6 +19190,8 @@
 %    \begin{macrocode}
 \LWR at tdstartstyles%
 \LWR at addcmidrulewidth%
+\LWR at addtabularhrulecolor%
+\LWR at addmulticolvertrulecolor%
 \LWR at addformatwpalignment{#5}%
 \LWR at tdendstyles%
 }% end of the opening table data tag
@@ -18976,7 +19667,7 @@
 
 % \begin{macro}{\LWR at tabledatacolumntag}
 % Open a new \HTML\ table cell unless the next token is for a macro
-% which does not create data, such as |\hline|, |\toprule|, etc:
+% which does not create data, such as \cs{hline}, \cs{toprule}, etc:
 %
 % \changes{v0.34}{2017/08/08}{\pkg{booktabs}: Works inside \env{lateximage}.}
 % \changes{v0.39}{2017/08/29}{Don't start a data cell if see \cs{TabularMacro}.}
@@ -19013,12 +19704,12 @@
 \ifdefequal{\LWR at mynexttoken}{\multicolumnrow}%
     {\let\mynext\LWR at donothing}{}%
 %    \end{macrocode}
-% If an |\mrowcell|, this is a cell to be skipped over:
+% If an \cs{mrowcell}, this is a cell to be skipped over:
 %    \begin{macrocode}
 \ifdefequal{\LWR at mynexttoken}{\mrowcell}%
     {\let\mynext\LWR at donothing}{}%
 %    \end{macrocode}
-% If an |\mcolrowcell|, this is a cell to be skipped over:
+% If an \cs{mcolrowcell}, this is a cell to be skipped over:
 %    \begin{macrocode}
 \ifdefequal{\LWR at mynexttoken}{\mcolrowcell}%
     {\let\mynext\LWR at donothing}{}%
@@ -19053,6 +19744,15 @@
 \ifdefequal{\LWR at mynexttoken}{\bottomrule}%
     {\let\mynext\LWR at donothing}{}%
 %
+\ifdefequal{\LWR at mynexttoken}{\rowcolor}%
+    {\let\mynext\LWR at donothing}{}%
+%
+\ifdefequal{\LWR at mynexttoken}{\arrayrulecolor}%
+    {\let\mynext\LWR at donothing}{}%
+%
+\ifdefequal{\LWR at mynexttoken}{\doublerulesepcolor}%
+    {\let\mynext\LWR at donothing}{}%
+%
 \ifdefequal{\LWR at mynexttoken}{\warpprintonly}%
     {\let\mynext\LWR at donothing}{}%
 %
@@ -19071,7 +19771,7 @@
 \ifdefequal{\LWR at mynexttoken}{\par}%
     {\let\mynext\LWR at donothing}{}%
 %    \end{macrocode}
-% no action for an |\end| token
+% no action for an \cs{end} token
 %
 % Add similar to the above for any other non-data tokens
 % which might appear in the table.
@@ -19098,7 +19798,7 @@
 %    \end{macrocode}
 
 % \begin{macro}{\mrowcell}
-% The user must insert |\mrowcell| into any \cs{multirow} cells which must be skipped.
+% The user must insert \cs{mrowcell} into any \cs{multirow} cells which must be skipped.
 % This command has no action during print output.
 % \watchout
 %    \begin{macrocode}
@@ -19119,7 +19819,7 @@
 %    \end{macrocode}
 
 % \begin{macro}{\mcolrowcell}
-% The user must insert |\mcolrowcell| into any \cs{multicolumnrow} cells
+% The user must insert \cs{mcolrowcell} into any \cs{multicolumnrow} cells
 % which must be skipped.
 % This command has no action during print output.
 % \watchout
@@ -19150,10 +19850,10 @@
 %
 % \changes{v0.34}{2017/08/08}{\pkg{booktabs}: Works inside \env{lateximage}.}
 %    \begin{macrocode}
-\newcommand*{\LWR at origtoprule}[1]{\hline}
-\newcommand*{\LWR at origmidrule}[1]{\hline}
+\newcommand*{\LWR at origtoprule}[1][]{\hline}
+\newcommand*{\LWR at origmidrule}[1][]{\hline}
 \LetLtxMacro\LWR at origcmidrule\cline
-\newcommand*{\LWR at origbottomrule}[1]{\hline}
+\newcommand*{\LWR at origbottomrule}[1][]{\hline}
 \newcommand*{\LWR at origaddlinespace}[1][]{}
 \newcommand*{\LWR at origmorecmidrules}{}
 \newcommand*{\LWR at origspecialrule}[3]{\hline}
@@ -19160,7 +19860,7 @@
 %    \end{macrocode}
 %
 %
-% \begin{macro}{\LWR at hline}
+% \begin{macro}{\LWR at HTMLhline}
 % The definition of \cs{hline} depends on whether \pkg{tabls} has been loaded.
 % If so, optional space below the line may be specified, but will be ignored.
 %
@@ -19171,7 +19871,7 @@
 \AtBeginDocument{
 \@ifpackageloaded{lwarp-tabls}
 {
-\newcommand*{\LWR at hline}[1][]{%
+\newcommand*{\LWR at HTMLhline}[1][]{%
     \ifbool{FormatWP}%
     {\LWR at docmidrule{1-\arabic{LWR at tabletotalcols}}}%
     {\booltrue{LWR at doinghline}}%
@@ -19178,7 +19878,7 @@
     \LWR at getmynexttoken}%
 }
 {
-\newcommand*{\LWR at hline}{%
+\newcommand*{\LWR at HTMLhline}{%
     \ifbool{FormatWP}%
     {\LWR at docmidrule{1-\arabic{LWR at tabletotalcols}}}%
     {\booltrue{LWR at doinghline}}%
@@ -19187,9 +19887,16 @@
 }% AtBeginDocument
 %    \end{macrocode}
 % \end{macro}
-%
-%
 
+
+% \begin{macro}{\LWR at HTMLcline} \marg{columns}
+%    \begin{macrocode}
+\NewDocumentCommand{\LWR at HTMLcline}{m}%
+{\LWR at docmidrule{#1}\LWR at getmynexttoken}%
+%    \end{macrocode}
+% \end{macro}
+
+
 % \begin{macro}{\LWR at nullifyNoAutoSpacing}
 % For \pkg{babel-french}, turn off auto spacing at the start of the tabular,
 % then nullify the autospacing commands inside the tabular,
@@ -19217,7 +19924,7 @@
 %
 % \begin{environment}{LWR at tabular} \oarg{vertposition} \marg{colspecs}
 %
-% The new tabular environment will be |\let| in |\LWR at LwarpStart|,
+% The new tabular environment will be \cs{let} in \cs{LWR at LwarpStart},
 % since \pkg{siunitx} might redefine tabular in the user's document.
 %
 % \changes{v0.34}{2017/08/08}{\pkg{booktabs}: Works inside \env{lateximage}.}
@@ -19289,17 +19996,39 @@
 %    \begin{macrocode}
 \LetLtxMacro{\\}{\LWR at tabularendofline}%
 %    \end{macrocode}
+%
+% The following adjust for \pkg{colortbl}:
+% \changes{v0.48}{2018/02/06}{\pkg{colortbl}: Added.}
+%    \begin{macrocode}
+\LetLtxMacro\columncolor\LWR at HTMLcolumncolor
+\LetLtxMacro\rowcolor\LWR at HTMLrowcolor
+\LetLtxMacro\cellcolor\LWR at HTMLcellcolor
+\LetLtxMacro\arrayrulecolor\LWR at HTMLarrayrulecolor
+\LetLtxMacro\doublerulesepcolor\LWR at HTMLdoublerulesepcolor
+\renewcommand*{\LWR at columnHTMLcolor}{}
+\renewcommand*{\LWR at rowHTMLcolor}{}
+\renewcommand*{\LWR at cellHTMLcolor}{}
+%    \end{macrocode}
+% The vertical rules are set to the color active at the start of the tabular.
+% \cs{arrayrulecolor} will then affect horizontal rules inside the tabular,
+% but not the vertical rules.
+%    \begin{macrocode}
+\edef\LWR at vertruleHTMLcolor{\LWR at ruleHTMLcolor}
+%    \end{macrocode}
+% Tracking the depth of cell color \element{div}s:
+%    \begin{macrocode}
+\setcounter{LWR at cellcolordepth}{0}
+%    \end{macrocode}
+%
 % The following may appear before a data cell is created,
-% so after doing their actions, we look ahead with |\LWR at getmynextoken|
+% so after doing their actions, we look ahead with \cs{LWR at getmynextoken}
 % to see if the next token might create a new data cell:
 %
 % The optional parameter for \cs{hline} supports the \pkg{tabls} package.
 %    \begin{macrocode}
 \LWR at traceinfo{LWR at tabular: redefining macros}%
-\renewcommand*{\hline}{\LWR at hline}%
-%
-\RenewDocumentCommand{\cline}{m}%
-{\LWR at docmidrule{##1}\LWR at getmynexttoken}%
+\LetLtxMacro\hline\LWR at HTMLhline%
+\LetLtxMacro\cline\LWR at HTMLcline%
 %    \end{macrocode}
 % \changes{v0.41}{2017/10/03}{Improved rules.}
 % \changes{v0.42}{2017/10/19}{If \protect\texttt{FormatWP} force explicit border.}
@@ -19347,7 +20076,7 @@
 %    \end{macrocode}
 % The following create data cells and will have no more data in this cell,
 % so we do not want to look ahead for a possible data cell,
-% so do not want to use |\LWR at getmynexttoken|.
+% so do not want to use \cs{LWR at getmynexttoken}.
 %    \begin{macrocode}
 \renewcommand{\multicolumn}{\LWR at htmlmulticolumn}%
 \renewcommand*{\mrowcell}{%
@@ -19359,7 +20088,7 @@
     \LWR at maybenewtablerow%
     \global\booltrue{LWR at skippingmcolrowcell}%
 }%
-\LetLtxMacro{\caption}{\LWR at longtabledatacaptiontag}%
+\LetLtxMacro\caption\LWR at longtabledatacaptiontag%
 %    \end{macrocode}
 % Reset for new processing:
 %    \begin{macrocode}
@@ -19711,16 +20440,16 @@
     {% pars allowed
         \ifbool{LWR at doingapar}%
         {% par started
-            \LWR at htmltag{a \mbox{id="\LWR at sanitized"}}\LWR at htmltag{/a}%
+            \LWR at htmltag{a \LWR at origmbox{id="\LWR at sanitized"}}\LWR at htmltag{/a}%
         }% par started
         {% par not started
             \LWR at stoppars%
-            \LWR at htmltag{a \mbox{id="\LWR at sanitized"}}\LWR at htmltag{/a}%
+            \LWR at htmltag{a \LWR at origmbox{id="\LWR at sanitized"}}\LWR at htmltag{/a}%
             \LWR at startpars%
         }% par not started
     }% pars allowed
     {% pars not allowed
-        \LWR at htmltag{a \mbox{id="\LWR at sanitized"}}\LWR at htmltag{/a}%
+        \LWR at htmltag{a \LWR at origmbox{id="\LWR at sanitized"}}\LWR at htmltag{/a}%
     }% pars not allowed
 }% not lateximage
 }
@@ -19730,7 +20459,7 @@
 %
 % \begin{macro}{\LWR at newlabel} \parg{bookmark} \marg{label} \oarg{type}
 %
-% \cs{label} during \HTML\ output when not in math mode,
+% \cs{label} during \HTML\ output when not in \SVG\ math mode,
 % removing extra spaces around the label, as done by regular \LaTeX\ \cs{label}.
 %
 % \pkg{clevereref} later encases this to add its own cross-referencing.
@@ -19769,7 +20498,7 @@
 % \label{sec:references}
 
 % \begin{macro}{\LWR at startref} \marg{label} \quad
-% (Common code for |\ref| and |\nameref|.)
+% (Common code for \cs{ref} and \cs{nameref}.)
 %
 % Open an \HTML\ tag reference to a filename, \# character, and a label.
 %
@@ -19787,7 +20516,7 @@
 %    \begin{macrocode}
 \LWR at htmltag{a href="%
 \LWR at traceinfo{LWR at startref B}%
-\mbox{\LWR at htmlrefsectionfilename{#1}}%
+\LWR at origmbox{\LWR at htmlrefsectionfilename{#1}}%
 \LWR at traceinfo{LWR at startref C}%
 \#%
 %    \end{macrocode}
@@ -19823,7 +20552,7 @@
 % \cs{detokenize} is used to allow underscores in the labels:
 % \changes{v0.45}{2017/12/01}{Fix: Labels with underscores.}
 %    \begin{macrocode}
-        \mbox{\LWR at sanitized}%
+        \LWR at origmbox{\LWR at sanitized}%
     }%
 }%
 \LWR at traceinfo{LWR at startref E}%
@@ -20098,8 +20827,8 @@
 %	Prints the number of the [within] figure, etc.
 % \item [\cs{fnum@<type>}:] Prints the figure number for the caption. \\
 %	\cs{<type>name}~\cs{the<type>}, ``Figure 123''.
-% \item [\cs{<type>}:] Starts the float environment. |\figure| or \cs{begin}|{figure}|
-% \item [\cs{end<type>}:] Ends the float environment. |\endfigure| or \cs{end}|{figure}|
+% \item [\cs{<type>}:] Starts the float environment. |\figure| or |\begin{figure}|
+% \item [\cs{end<type>}:] Ends the float environment. |\endfigure| or |\end{figure}|
 % \item [\cs{tf@<ext>}:] The \LaTeX{} file identifier for the output file.
 % \item [\texttt{LWR at have<type>}:] A boolean rememebering whether a \cs{listof} was
 %	requested for a float of this type.
@@ -20153,7 +20882,7 @@
 % \changes{v0.42}{2017/10/26}{If \protect\texttt{FormatWP} add a text frame.}
 % \changes{v0.47}{2018/01/26}{Fix: Line wrap at \HTML\ hyphen.}
 %    \begin{macrocode}
-\LWR at htmltag{figure id="\mbox{autoid-\arabic{LWR at thisautoid}}" class="#1"}%
+\LWR at htmltag{figure id="\LWR at origmbox{autoid-\arabic{LWR at thisautoid}}" class="#1"}%
 \ifbool{FormatWP}{%
     \LWR at orignewline%
     \LWR at BlockClassWP{}{}{wp#1}%
@@ -20252,7 +20981,7 @@
 \newcommand*{\LWR at newautoidanchor}{%
 \ifbool{LWR at freezethisautoid}{}{%
     \addtocounter{LWR at thisautoid}{1}%
-    \LWR at htmltag{a id="\mbox{autoid-\arabic{LWR at thisautoid}}"}\LWR at htmltag{/a}%
+    \LWR at htmltag{a id="\LWR at origmbox{autoid-\arabic{LWR at thisautoid}}"}\LWR at htmltag{/a}%
 }%
 }
 %    \end{macrocode}
@@ -20306,7 +21035,7 @@
 % \DescribeCounter{LWR at nextautoid} Tracks |autoid| for floats.
 % \DescribeCounter{LWR at nextautopage} Tracks |autopage| for floats.
 %
-% These are updated per float as the |.lof| file is read.
+% These are updated per float as the |.lof|, |.lot| file is read.
 %    \begin{macrocode}
 \newcounter{LWR at nextautoid}
 \newcounter{LWR at nextautopage}
@@ -20315,7 +21044,7 @@
 %
 % \begin{macro}{\LWRsetnextfloat} \marg{autopage} \marg{autoid}
 %
-% This is written to the |.lof| file just before each float's usual entry.
+% This is written to the |.lof|, |.lot| file just before each float's usual entry.
 % The |autopage| and |autoid| are remembered for \cs{l at figure} to use when
 % creating the \HTML\ links.
 %
@@ -20345,7 +21074,7 @@
 \newenvironment*{LWR at figcaption}
 {%
 \LWR at traceinfo{LWR at figcaption env start}%
-\LWR at htmlblocktag{figcaption}
+\LWR at htmlblocktag{figcaption}%
 \ifbool{FormatWP}{%
 \begin{BlockClass}[font-style:italic]{italic}
 \LWR at origvspace*{\baselineskip}
@@ -20361,12 +21090,13 @@
 %    \end{macrocode}
 % \end{environment}
 
-
-
+%
+% After packages have loaded, remember the print-mode version of the following:
 %    \begin{macrocode}
-\let\LWR at origcaption@begin\caption at begin
-\let\LWR at origcaption@end\caption at end
-\let\LWR at orig@@par\@@par
+\AtBeginDocument{
+\LetLtxMacro\LWR at origcaption@begin\caption at begin
+\LetLtxMacro\LWR at origcaption@end\caption at end
+}
 %    \end{macrocode}
 
 % \begin{macro}{\LWR at caption@begin}
@@ -20383,7 +21113,7 @@
 %    \end{macrocode}
 % The \pkg{caption} code was not allowing the closing |par| tag:
 %    \begin{macrocode}
-\renewcommand{\@@par}{\LWR at closeparagraph\LWR at orig@@par}%
+\@setpar{\LWR at closeparagraph\@@par}%
 %    \end{macrocode}
 % No need for a |minipage| or \cs{parbox} inside the caption:
 %    \begin{macrocode}
@@ -20408,10 +21138,6 @@
 \LWR at traceinfo{LWR at caption@end}%
 \LWR at origcaption@end%
 %    \end{macrocode}
-% Subcaptions were being over-written by the closing \HTML\ tag:
-%    \begin{macrocode}
-\LWR at origvspace*{\baselineskip}%
-%    \end{macrocode}
 % Closing tag:
 %    \begin{macrocode}
 \endLWR at figcaption%
@@ -20449,7 +21175,7 @@
 
 \def\LWR at LTcaptionlistentry{%
 \LWR at ensuredoingapar%
-\LWR at htmltag{a id="\mbox{autoid-\arabic{LWR at thisautoid}}"}\LWR at htmltag{/a}%
+\LWR at htmltag{a id="\LWR at origmbox{autoid-\arabic{LWR at thisautoid}}"}\LWR at htmltag{/a}%
   \bgroup
   \@ifstar{\egroup\LWR at LT@captionlistentry}% gobble *
           {\egroup\LWR at LT@captionlistentry}}%
@@ -20559,7 +21285,7 @@
 % \watchout
 % must be made a regular letter.
 %
-% For |pdflatex|, also change to |latin1| encoding.
+% For \prog{pdflatex}, also change to |latin1| encoding.
 % When reading back a file with accented characters,
 % \watchout[disabled]
 % the encoding change seems to be required, rather than leaving it |utf8|.
@@ -20881,7 +21607,7 @@
 % \changes{v0.47}{2018/01/26}{Fix: Line wrap at \HTML\ hyphen.}
 %    \begin{macrocode}
     \LWR at subhyperrefclass{%
-        \LWR at htmlrefsectionfilename{autopage-#4}\#\mbox{autosec-#4}%
+        \LWR at htmlrefsectionfilename{autopage-#4}\#\LWR at origmbox{autosec-#4}%
     }{#3}{toc#2}%
     \LWR at stoppars%
 }
@@ -20946,7 +21672,7 @@
 %    \begin{macrocode}
     \LWR at subhyperrefclass{%
     \LWR at htmlrefsectionfilename{autopage-\arabic{LWR at nextautopage}}%
-    \#\mbox{autoid-\arabic{LWR at nextautoid}}}%
+    \#\LWR at origmbox{autoid-\arabic{LWR at nextautoid}}}%
     {#4}{toc#2}%
     \LWR at stoppars%
 }{}%
@@ -20954,20 +21680,66 @@
 %    \end{macrocode}
 % \end{macro}
 
-% Automatically called by |\contentsline|:
+% Automatically called by \cs{contentsline}:
+% \begin{macro}{\l at part} \marg{name} \marg{page}
+%
+% Uses \cs{DeclareDocumentCommand} in case the class does not happen to have a \cs{part}.
+% \changes{v0.48}{2018/02/03}{Adapts to classes without \cs{part}.}
 %    \begin{macrocode}
-\renewcommand{\l at part}[2]{\hypertoc{-1}{part}{#1}{#2}}
+\DeclareDocumentCommand{\l at part}{m m}{\hypertoc{-1}{part}{#1}{#2}}
+%    \end{macrocode}
+% \end{macro}
+
+% \begin{macro}{\l at chapter} \marg{name} \marg{page}
+%
+% Uses \cs{DeclareDocumentCommand} in case the class does not happen to have a \cs{chapter}.
+%    \begin{macrocode}
 \DeclareDocumentCommand{\l at chapter}{m m}
     {\hypertoc{0}{chapter}{#1}{#2}}
+%    \end{macrocode}
+% \end{macro}
+
+% \begin{macro}{\l at section} \marg{name} \marg{page}
+%    \begin{macrocode}
 \renewcommand{\l at section}[2]{\hypertoc{1}{section}{#1}{#2}}
+%    \end{macrocode}
+% \end{macro}
+
+% \begin{macro}{\l at subsection} \marg{name} \marg{page}
+%    \begin{macrocode}
 \renewcommand{\l at subsection}[2]{\hypertoc{2}{subsection}{#1}{#2}}
-\renewcommand{\l at subsubsection}[2]
-    {\hypertoc{3}{subsubsection}{#1}{#2}}
+%    \end{macrocode}
+% \end{macro}
+
+% \begin{macro}{\l at subsubsection} \marg{name} \marg{page}
+%    \begin{macrocode}
+\renewcommand{\l at subsubsection}[2]{\hypertoc{3}{subsubsection}{#1}{#2}}
+%    \end{macrocode}
+% \end{macro}
+
+% \begin{macro}{\l at paragraph} \marg{name} \marg{page}
+%    \begin{macrocode}
 \renewcommand{\l at paragraph}[2]{\hypertoc{4}{paragraph}{#1}{#2}}
+%    \end{macrocode}
+% \end{macro}
+
+% \begin{macro}{\l at subparagraph} \marg{name} \marg{page}
+%    \begin{macrocode}
 \renewcommand{\l at subparagraph}[2]{\hypertoc{5}{subparagraph}{#1}{#2}}
+%    \end{macrocode}
+% \end{macro}
+
+% \begin{macro}{\l at figure} \marg{name} \marg{page}
+%    \begin{macrocode}
 \renewcommand{\l at figure}[2]{\hypertocfloat{1}{figure}{lof}{#1}{#2}}
+%    \end{macrocode}
+% \end{macro}
+
+% \begin{macro}{\l at table} \marg{name} \marg{page}
+%    \begin{macrocode}
 \renewcommand{\l at table}[2]{\hypertocfloat{1}{table}{lot}{#1}{#2}}
 %    \end{macrocode}
+% \end{macro}
 
 %    \begin{macrocode}
 \end{warpHTML}
@@ -21142,6 +21914,34 @@
 \begin{warpHTML}
 %    \end{macrocode}
 %
+%
+% \begin{macro}{\bibliography} \marg{filenames}
+%
+% Modified to use the base jobname instead of the |_html| jobname.
+% \changes{v0.48}{2018/02/04}{Fix: \cs{BaseJobname} for bibliography.}
+%    \begin{macrocode}
+\def\bibliography#1{%
+    \if at filesw
+    \immediate\write\@auxout{\string\bibdata{#1}}%
+    \fi
+%     \@input@{\jobname.bbl}% original
+    \@input@{\BaseJobname.bbl}% lwarp
+}
+%    \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\@biblabel} \marg{text-refnumber}
+%
+% Modified to use the base jobname instead of the |_html| jobname.
+% \changes{v0.48}{2018/02/04}{Improved bibliography label.}
+%    \begin{macrocode}
+\renewcommand{\@biblabel}[1]{[#1]\quad}
+%    \end{macrocode}
+% \end{macro}
+%
+%
+%
 % \begin{environment}{thebibliography}
 % \changes{v0.45}{2018/01/13}{Patched to emphasize titles.}
 %
@@ -21217,14 +22017,50 @@
 \LWR at traceinfo{LWR at restoreorigformatting}%
 \linespread{1}%
 %    \end{macrocode}
+%
+%    \begin{macrocode}
+\LetLtxMacro\caption at begin\LWR at origcaption@begin%
+\LetLtxMacro\caption at end\LWR at origcaption@end%
+\let\par\LWR at origpar%
+%    \end{macrocode}
+%
 % \changes{v0.43}{2017/10/31}{Fix: \cs{ref} in math or lateximage.}
 %    \begin{macrocode}
 \LetLtxMacro\ref\LWR at origref%{} syntax highlighting
+%    \end{macrocode}
+% \changes{v0.48}{2018/02/04}{Fix: Font sizes in \SVG\ math, \env{lateximage}, \tikz.}
+%    \begin{macrocode}
+\let\normalsize\LWR at orignormalsize%
+\let\small\LWR at origsmall%
+\let\footnotesize\LWR at origfootnotesize%
+\let\scriptsize\LWR at origscriptsize%
+\let\tiny\LWR at origtiny%
+\let\large\LWR at origlarge%
+\let\Large\LWR at origLarge%
+\let\LARGE\LWR at origLARGE%
+\let\huge\LWR at orighuge%
+\let\Huge\LWR at origHuge%
+%    \end{macrocode}
+%    \begin{macrocode}
 \RenewDocumentCommand{\InlineClass}{o m +m}{##3}%
 \RenewDocumentEnvironment{BlockClass}{o m}{}{}%
 \renewcommand{\BlockClassSingle}[2]{##2}%
 \LetLtxMacro{\hspace}{\LWR at orighspace}%
+%    \end{macrocode}
+% \changes{v0.48}{2018/02/04}{Fix: Spacing in \SVG\ math, \env{lateximage}, \tikz.}
+%    \begin{macrocode}
+\LetLtxMacro\hfill\LWR at orighfill%
+\LetLtxMacro\hfil\LWR at orighfil%
 \LetLtxMacro\rule\LWR at origrule%
+\LetLtxMacro\hrulefill\LWR at orighrulefill%
+\LetLtxMacro\dotfill\LWR at origdotfill%
+\let\vspace\LWR at origvspace%
+\let\hss\LWR at orighss%
+\let\llap\LWR at origllap%
+\let\rlap\LWR at origrlap%
+\let\hfilneg\LWR at orighfilneg%
+%    \end{macrocode}
+%    \begin{macrocode}
 \let\,\LWR at origcomma% disable HTML short unbreakable space
 \let\textellipsis\LWR at origtextellipsis%
 \let\textless\LWR at origtextless%
@@ -21262,8 +22098,9 @@
 \let\enskip\LWR at origenskip%
 \let\quad\LWR at origquad%
 \let\qquad\LWR at origqquad%
-\LetLtxMacro{\tabular}{\LWR at origtabular}%
-\LetLtxMacro{\endtabular}{\LWR at origendtabular}%
+\LetLtxMacro\tabular\LWR at origtabular%
+\LetLtxMacro\endtabular\LWR at origendtabular%
+\LetLtxMacro\hline\LWR at orighline%
 \LetLtxMacro\toprule\LWR at origtoprule%
 \LetLtxMacro\midrule\LWR at origmidrule%
 \LetLtxMacro\cmidrule\LWR at origcmidrule%
@@ -21279,6 +22116,12 @@
 \let\reflectbox\LWR at origreflectbox%
 \LetLtxMacro\resizebox\LWR at origresizebox%
 \let\framebox\LWR at origframebox%
+%    \end{macrocode}
+% \changes{v0.48}{2018/02/05}{Fix: \cs{mbox} in \SVG\ math, \env{lateximage}, \tikz.}
+%    \begin{macrocode}
+\LetLtxMacro\mbox\LWR at origmbox%
+%    \end{macrocode}
+%    \begin{macrocode}
 \let\makebox\LWR at origmakebox%
 \let\fbox\LWRprint at fbox%
 \let\fboxBlock\LWRprint at fbox%
@@ -21337,11 +22180,11 @@
 
 % \DescribeMacro{\$}
 %	Plain dollar signs appearing in the \HTML\ output may be interpreted
-%	by MathJax to be math shifts.
+%	by \brand{MathJax} to be math shifts.
 %	For a plain text dollar |\$|, print it inside a span to avoid
-%	it being interpreted by MathJax, unless are inside a lateximage,
-%	in which case it will not be seen by MathJax.
-% \changes{v0.19}{2016/06/08}{Avoids MathJax.}
+%	it being interpreted by \brand{MathJax}, unless are inside a lateximage,
+%	in which case it will not be seen by \brand{MathJax}.
+% \changes{v0.19}{2016/06/08}{Avoids \brand{MathJax}.}
 % \changes{v0.26}{2017/03/30}{Dollar span avoided in a lateximage.}
 %    \begin{macrocode}
 \let\LWR at origtextdollar\$
@@ -21378,7 +22221,7 @@
 
 % \DescribeObject{\$}
 % \DescribeObject{\$\$}
-% Redefine the dollar sign to place math inside a \env{lateximage}, or use MathJax:
+% Redefine the dollar sign to place math inside a \env{lateximage}, or use \brand{MathJax}:
 %    \begin{macrocode}
 \begingroup
 \catcode`\$=\active%
@@ -21388,20 +22231,20 @@
 
 % \begin{macro}{\LWR at doubledollar}
 %
-% \changes{v0.19}{2016/05/25}{MathJax support.}
+% \changes{v0.19}{2016/05/25}{\brand{MathJax} support.}
 % \changes{v0.42}{2017/10/16}{Improved \cs{ensuremath}.}
 % \changes{v0.42}{2017/10/16}{Improved line spacing with mathjax.}
 %
-% Redefine the double dollar sign to place math inside a \env{lateximage}, or use MathJax:
+% Redefine the double dollar sign to place math inside a \env{lateximage}, or use \brand{MathJax}:
 %    \begin{macrocode}
 \protected\gdef\LWR at doubledollar$#1$${
 %    \end{macrocode}
-% If MathJax or formatting for a word processor, print the \LaTeX\ expression:
+% If \brand{MathJax} or formatting for a word processor, print the \LaTeX\ expression:
 % \changes{v0.42}{2017/10/26}{If \protect\texttt{FormatWP} print LaTeX expression.}
 %    \begin{macrocode}
 \ifboolexpr{bool{mathjax} or ( bool{FormatWP} and bool{WPMarkMath} ) }%
 %    \end{macrocode}
-% For MathJax, print the math between |\[| and |\]|:
+% For \brand{MathJax}, print the math between |\[| and |\]|:
 %    \begin{macrocode}
 {
 
@@ -21429,9 +22272,9 @@
 %
 %
 % \begin{macro}{\LWR at singledollar}
-% Redefine the single dollar sign to place math inside a \env{lateximage}, or use MathJax:
+% Redefine the single dollar sign to place math inside a \env{lateximage}, or use \brand{MathJax}:
 %
-% \changes{v0.19}{2016/05/25}{MathJax support.}
+% \changes{v0.19}{2016/05/25}{\brand{MathJax} support.}
 % \changes{v0.42}{2017/10/26}{If \protect\texttt{FormatWP} print LaTeX expression.}
 % \changes{v0.47}{2018/01/24}{Added \SVG\ math image baseline adjust and em sizing.}
 %    \begin{macrocode}
@@ -21444,7 +22287,7 @@
 \normalsize%
 \ifboolexpr{bool{mathjax} or ( bool{FormatWP} and bool{WPMarkMath} ) }%
 %    \end{macrocode}
-% For MathJax, print the math between |\(| and |\)|:
+% For \brand{MathJax}, print the math between |\(| and |\)|:
 %    \begin{macrocode}
 {%
     {\textbackslash(\LWR at HTMLsanitize{#1}\textbackslash)}%
@@ -21511,7 +22354,7 @@
 %    \begin{macrocode}
     \ifdimgreater{\LWR at singledollardepth}{0.01em}{%
         \def\LWR at singledollardepthstyle{%
-            \ ; \mbox{vertical-align:-\LWR at convertto{em}{\the\LWR at singledollardepth} em} %
+            \ ; \LWR at origmbox{vertical-align:-\LWR at convertto{em}{\the\LWR at singledollardepth} em} %
         }%
     }{%
         \def\LWR at singledollardepthstyle{}%
@@ -21594,8 +22437,8 @@
 
 
 
-% \subsection{MathJax support}
-% \changes{v0.19}{2016/05/25}{MathJax support added.}
+% \subsection{\brand{MathJax} support}
+% \changes{v0.19}{2016/05/25}{\brand{MathJax} support added.}
 %
 % \DescribeCounter{LWR at nextequation} Used to add one to compute the next equation number.
 %    \begin{macrocode}
@@ -21604,10 +22447,10 @@
 %
 %
 %
-% \begin{macro}{\LWR at syncmathjax} Sets the MathJax equation format
+% \begin{macro}{\LWR at syncmathjax} Sets the \brand{MathJax} equation format
 % and number for the following equations.
 %
-% These MathJax commands are printed inside ``\cs{(}'' and ``\cs{)}'' characters.
+% These \brand{MathJax} commands are printed inside ``\cs{(}'' and ``\cs{)}'' characters.
 % They are printed to \HTML\ output, not interpreted by \LaTeX.
 %    \begin{macrocode}
 \newcommand*{\LWR at syncmathjax}{%
@@ -21624,18 +22467,18 @@
 }
 {}% not using chapters
 %    \end{macrocode}
-% MathJax doesn't allow setting the equation number to 1:
+% \brand{MathJax} doesn't allow setting the equation number to 1:
 %    \begin{macrocode}
 \ifthenelse{\cnttest{\value{equation}}>0}
 {
 %    \end{macrocode}
-% Tell MathJax that the next set of equations begins with the current \LaTeX{} equation
+% Tell \brand{MathJax} that the next set of equations begins with the current \LaTeX{} equation
 % number, plus one.
 %    \begin{macrocode}
     \setcounter{LWR at nextequation}{\value{equation}}
     \addtocounter{LWR at nextequation}{1}
 %    \end{macrocode}
-% Place the MathJax command inside ``\cs{(}'' and ``\cs{)}'' characters,
+% Place the \brand{MathJax} command inside ``\cs{(}'' and ``\cs{)}'' characters,
 % to be printed to \HTML, not interpreted by \LaTeX.
 %    \begin{macrocode}
     \InlineClass{hidden}{
@@ -21700,12 +22543,12 @@
 % \begin{macro}{\LWR at addmathjax} \marg{environment} \marg{contents}
 %
 % Given the name of a math environment and its contents,
-% create a MathJax instance.
+% create a \brand{MathJax} instance.
 % The contents are printed to \HTML\ output, not interpreted by \LaTeX.
 %    \begin{macrocode}
 \NewDocumentCommand{\LWR at addmathjax}{m +m}{%
 %    \end{macrocode}
-% Enclose the MathJax environment inside printed ``\cs{(}'' and ``\cs{)}'' characters.
+% Enclose the \brand{MathJax} environment inside printed ``\cs{(}'' and ``\cs{)}'' characters.
 %    \begin{macrocode}
 \LWR at origtilde\LWR at orignewline
 \textbackslash{}begin\{#1\}
@@ -21714,7 +22557,7 @@
 %    \begin{macrocode}
 \LWR at HTMLsanitizeexpand{\detokenize\expandafter{#2}}
 %    \end{macrocode}
-% Close the MathJax environment:
+% Close the \brand{MathJax} environment:
 %    \begin{macrocode}
 \textbackslash{}end\{#1\}
 \LWR at orignewline
@@ -21739,7 +22582,7 @@
 
 
 % \begin{environment}{equation}
-% \changes{v0.19}{2016/05/25}{MathJax support.}
+% \changes{v0.19}{2016/05/25}{\brand{MathJax} support.}
 % The new \env{equation} environment is created with
 % \cs{NewEnviron} (from the \pkg{environ} package),
 % which stores the contents of its environment in a
@@ -21751,11 +22594,11 @@
 % containing a detokenized copy of the \LaTeX\ source for
 % the math.
 %
-% For MathJax output, the contents are typeset in an
+% For \brand{MathJax} output, the contents are typeset in an
 % original \env{equation} environment placed inside a \HTML\
 % comment, with special processing for \cs{label}s.
 % The contents are also printed to the \HTML\ output
-% for processing by the MathJax script.
+% for processing by the \brand{MathJax} script.
 %    \begin{macrocode}
 \NewEnviron{equation}{%
 
@@ -21765,11 +22608,11 @@
 %    \begin{macrocode}
 \ifboolexpr{bool{mathjax} or ( bool{FormatWP} and bool{WPMarkMath} ) }%
 %    \end{macrocode}
-% MathJax output:
+% \brand{MathJax} output:
 %    \begin{macrocode}
 {
 %    \end{macrocode}
-% Print commands to syncronize MathJax's equation number and format
+% Print commands to syncronize \brand{MathJax}'s equation number and format
 % to the current \LaTeX\ chapter/section and equation number:
 %    \begin{macrocode}
     \LWR at syncmathjax
@@ -21802,8 +22645,8 @@
 }% not mathjax
 
 %    \end{macrocode}
-% After the environment, if MathJax, print the math to the \HTML\ output
-% for MathJax processing:
+% After the environment, if \brand{MathJax}, print the math to the \HTML\ output
+% for \brand{MathJax} processing:
 %    \begin{macrocode}
 }[%
     \ifboolexpr{bool{mathjax} or ( bool{FormatWP} and bool{WPMarkMath} ) }%
@@ -21830,7 +22673,7 @@
 
 
 % \subsection{AMS Math environments}
-% \changes{v0.19}{2016/05/25}{MathJax support added.}
+% \changes{v0.19}{2016/05/25}{\brand{MathJax} support added.}
 %
 % \subsubsection{Support macros}
 % \label{sec:amsmathsupport}
@@ -21928,7 +22771,7 @@
 
 % \subsubsection{Environment patches}
 %
-% \changes{v0.19}{2016/05/25}{MathJax support added.}
+% \changes{v0.19}{2016/05/25}{\brand{MathJax} support added.}
 % \changes{v0.33}{2017/06/20}{Fix: Incorrectly-inline math environments.}
 % \changes{v0.34}{2017/07/29}{Fix: Added the \protect\texttt{eqnarray} environments.}
 %
@@ -21943,9 +22786,9 @@
 % the environment's contents which
 % were automatically captured by the \AmS{} environment.
 %
-% For MathJax: Each environment is syched with \LaTeX's equation numbers,
+% For \brand{MathJax}: Each environment is syched with \LaTeX's equation numbers,
 % typeset with \LaTeX\ inside an \HTML\ comment, then
-% printed to \HTML\ output for MathJax to process.
+% printed to \HTML\ output for \brand{MathJax} to process.
 %
 
 
@@ -21978,9 +22821,9 @@
 {%
 %    \end{macrocode}
 %
-% If MathJax, the environment contents (the \cs{BODY}) are executed in a
+% If \brand{MathJax}, the environment contents (the \cs{BODY}) are executed in a
 % \HTML\ comment to trigger the correct equation number increment (if not starred),
-% then are included verbatim in the output for MathJax to interpret:
+% then are included verbatim in the output for \brand{MathJax} to interpret:
 %    \begin{macrocode}
     \LWR at syncmathjax
     \boolfalse{LWR at amsmultline}
@@ -21997,7 +22840,7 @@
         \LWR at endhideamsmath
 %    \end{macrocode}
 %
-% Then print the (sanitized) contents to the output for MathJax to interpret:
+% Then print the (sanitized) contents to the output for \brand{MathJax} to interpret:
 %    \begin{macrocode}
         \LWR at addmathjax{eqnarray}{\BODY}
     }%
@@ -22004,7 +22847,7 @@
     {% not LWR at numbereqnarray
 %    \end{macrocode}
 %
-% If not numbering equations, just create the contents for MathJax:
+% If not numbering equations, just create the contents for \brand{MathJax}:
 %    \begin{macrocode}
     \LWR at addmathjax{eqnarray*}{\BODY}
     }% LWR at numbereqnarray
@@ -22328,12 +23171,12 @@
 %
 % A \env{lateximage} is typeset on its own \PDF\ page inside an \HTML\ comment
 % which starts on the preceeding page and ends on following page, and instructions are written to
-% |lateximage.txt| for |lwarpmk| to extract the |\lateximage| from the page of the \PDF\ file
+% |lateximage.txt| for \prog{lwarpmk} to extract the \env{lateximage} from the page of the \PDF\ file
 % then generate an accompanying |.svg| file image file.  Meanwhile, instructions to
 % show this image are placed into the \HTML\ file after the comment.
 %
 % An \HTML\ \element{span} is created to hold both the \HTML\ comment,
-% which will have the |pdftotext| conversion,
+% which will have the \prog{pdftotext} conversion,
 % and also the link to the final |.svg| image.
 %
 % A \LaTeX\ label is used to remember which \PDF\ page has the image.
@@ -22359,7 +23202,7 @@
 \setcounter{LWR at lateximagenumber}{0}
 %    \end{macrocode}
 % \DescribeCounter{LWR at lateximagedepth}
-% Do not create |\lateximage| inside of |\lateximage|.
+% Do not create \cs{lateximage} inside of \cs{lateximage}.
 %    \begin{macrocode}
 \newcounter{LWR at lateximagedepth}
 \setcounter{LWR at lateximagedepth}{0}
@@ -22393,7 +23236,7 @@
 
 % \begin{macro}{\LateximageFontSizeName}
 % \changes{v0.19}{2016/05/29}{Add: User-adjustable math/lateximage font size.}
-% Declares how large to write text in the |\lateximage|.  The |.svg| file text size
+% Declares how large to write text in the \cs{lateximage}.  The |.svg| file text size
 % should blend well with the surrounding \HTML\ text size.
 %
 % \emph{Do not include the leading backslash in the name.}
@@ -22687,7 +23530,7 @@
     \setcounterpageref{LWR at LIpage}{LWRlateximage\arabic{LWR at lateximagenumber}}%
     \LWR at traceinfo{lateximage: LWR at LIpage is \arabic{LWR at LIpage}}%
 %    \end{macrocode}
-% Create an \HTML\ span which will hold the comment which contains the |pdftotext| translation
+% Create an \HTML\ span which will hold the comment which contains the \prog{pdftotext} translation
 % of the image's page, and also will hold the link to the |.svg| file:
 %    \begin{macrocode}
     \LWR at htmltag{span id="lateximage\arabic{LWR at lateximagenumber}" %
@@ -22696,11 +23539,13 @@
 % Write instructions to the |lateximages.txt| file:
 %    \begin{macrocode}
     \LWR at traceinfo{lateximage: about to write to lateximages.txt}%
-    \immediate\write\LWR at lateximagesfile{|\arabic{LWR at LIpage}|\arabic{LWR at externalfilecnt}|}%
+    \immediate\write\LWR at lateximagesfile{%
+        |\arabic{LWR at LIpage}|\arabic{LWR at externalfilecnt}|%
+    }%
 %    \end{macrocode}
 % Place an open comment tag.
 % This will hide any traces of the lateximage \PDF\ page which were picked up by
-% |pdftotext|.
+% \prog{pdftotext}.
 %    \begin{macrocode}
     \LWR at traceinfo{lateximage: about to create open comment}%
     \LWR at htmlopencomment%
@@ -22777,7 +23622,7 @@
     \LWR at orignewpage%
     \LWR at origscriptsize%
 %    \end{macrocode}
-% Close the \HTML\ comment which encapsulated any traces of the lateximage picked up by |pdftotext|:
+% Close the \HTML\ comment which encapsulated any traces of the lateximage picked up by \prog{pdftotext}:
 %    \begin{macrocode}
     \LWR at origvspace*{.5\baselineskip}%
     \LWR at htmlclosecomment%
@@ -22787,13 +23632,13 @@
 % \changes{v0.47}{2018/01/26}{Fix: Line wrap at \HTML\ hyphen.}
 %    \begin{macrocode}
     \LWR at subinlineimage[#1]{lateximage}%
-    {lateximages\OSPathSymbol{}\mbox{lateximage-\theLWR at externalfilecnt}}{svg}{#2}%
+    {lateximages\OSPathSymbol{}\LWR at origmbox{lateximage-\theLWR at externalfilecnt}}{svg}{#2}%
 %    \end{macrocode}
 % Be sure that are doing a paragraph:
 %    \begin{macrocode}
     \LWR at ensuredoingapar%
 %    \end{macrocode}
-% Close the \HTML\ span which has the |pdftotext| comment and also the link to the |.svg| image:
+% Close the \HTML\ span which has the \prog{pdftotext} comment and also the link to the |.svg| image:
 %    \begin{macrocode}
     \LWR at htmltag{/span}%
     \ifbool{HTMLDebugComments}{%
@@ -22810,18 +23655,32 @@
 \catcode`\$=3% math shift
 \end{warpHTML}
 %    \end{macrocode}
+% \end{environment}
 
 % \codeprint
 %    \begin{macrocode}
 \begin{warpprint}
-\NewDocumentEnvironment{lateximage}{O{image}O{}}{}{}
-\end{warpprint}
 %    \end{macrocode}
+
+% \begin{environment}{lateximage} \oarg{\element{alt} tag} \oarg{CSS style}
+%
+% \env{varwidth} is used to create a box of the natural width of its contents.
+%
+% \changes{v0.48}{2018/02/02}{Print mode boxed to natural width.}
+%    \begin{macrocode}
+\NewDocumentEnvironment{lateximage}{o o}
+    {\begin{varwidth}[b]{\linewidth}}
+    {\end{varwidth}}
+%    \end{macrocode}
 % \end{environment}
 
+%    \begin{macrocode}
+\end{warpprint}
+%    \end{macrocode}
 
 
 
+
 % \section{\env{center}, \env{flushleft}, \env{flushright}}
 
 % \codehtml
@@ -22838,7 +23697,7 @@
 {
 \LWR at forcenewpage
 \ifbool{FormatWP}
-{\BlockClass[\mbox{text-align:center}]{center}}
+{\BlockClass[\LWR at origmbox{text-align:center}]{center}}
 {\BlockClass{center}}
 }
 {\endBlockClass}
@@ -22853,7 +23712,7 @@
 {
 \LWR at forcenewpage
 \ifbool{FormatWP}
-{\BlockClass[\mbox{text-align:right}]{flushright}}
+{\BlockClass[\LWR at origmbox{text-align:right}]{flushright}}
 {\BlockClass{flushright}}
 }
 {\endBlockClass}
@@ -22867,7 +23726,7 @@
 {
 \LWR at forcenewpage
 \ifbool{FormatWP}
-{\BlockClass[\mbox{text-align:left}]{flushleft}}
+{\BlockClass[\LWR at origmbox{text-align:left}]{flushleft}}
 {\BlockClass{flushleft}}
 }
 {\endBlockClass}
@@ -22875,7 +23734,29 @@
 % \end{environment}
 
 
+% \begin{macro}{\leftline} \marg{text}
+% \changes{v0.48}{2018/02/03}{Added.}
 %    \begin{macrocode}
+\renewcommand{\leftline}[1]{\begin{flushleft}#1\end{flushleft}}
+%    \end{macrocode}
+% \end{macro}
+
+% \begin{macro}{\centerline} \marg{text}
+% \changes{v0.48}{2018/02/03}{Added.}
+%    \begin{macrocode}
+\renewcommand{\centerline}[1]{\begin{center}#1\end{center}}
+%    \end{macrocode}
+% \end{macro}
+
+% \begin{macro}{\rightline} \marg{text}
+% \changes{v0.48}{2018/02/03}{Added.}
+%    \begin{macrocode}
+\renewcommand{\rightline}[1]{\begin{flushright}#1\end{flushright}}
+%    \end{macrocode}
+% \end{macro}
+
+
+%    \begin{macrocode}
 \end{warpHTML}
 %    \end{macrocode}
 
@@ -22989,11 +23870,6 @@
 %    \end{macrocode}
 
 
-
-
-
-
-
 % \section{Xcolor boxes}
 %
 % \label{sec:xcolorpatches}
@@ -23070,6 +23946,9 @@
 %    \end{macrocode}
 % Sort out the various optional arguments and the background color of |none|.
 % In each case, the LRbox is placed inside a \cs{fcolorbox}.
+%
+% The current color is remembered, then set to the frame, then the current
+% color is used for the contents.
 %    \begin{macrocode}
 \ifthenelse{\equal{#4}{none}}%
 {% #4 none
@@ -23140,6 +24019,9 @@
 %    \end{macrocode}
 % Sort out the various optional arguments and the background color of |none|.
 % In each case, the LRbox is placed inside a \cs{fcolorbox}.
+%
+% The current color is remembered, then set to the frame, then the current
+% color is used for the contents.
 %    \begin{macrocode}
 \ifthenelse{\equal{#4}{none}}%
 {% #4 none
@@ -23252,11 +24134,14 @@
 %    \end{macrocode}
 %
 %
-% \changes{v0.20}{2017/01/05}{\pkg{cleveref} and referencing patches: Applied \cs{AfterEndPreamble}.}
+% \changes{v0.20}{2017/01/05}{\pkg{cleveref} and referencing patches:
+%   Applied \cs{AfterEndPreamble}.}
 %
 % \begin{flushleft}
 % The following patches are applied after \pkg{cleveref} has loaded,
-% and after \cs{AtBeginDocument}:
+% and after \cs{AtBeginDocument}.  Print-mode versions are not required
+% since they all come down to \cs{ref} eventually, and \cs{ref} has a print-mode
+% version.
 % \end{flushleft}
 %    \begin{macrocode}
 \AfterEndPreamble{
@@ -23263,27 +24148,54 @@
 \LWR at traceinfo{Patching cleveref.}
 %    \end{macrocode}
 
-% \begin{macro}{\@@setcref} \marg{kindofref} \marg{label}
+% \begin{macro}{\@@@setcref} \marg{kindofref} \marg{label}
+%
+% \cs{@templabel} becomes the section number.
+%
+% \changes{v0.48}{2018/02/10}{Fix for new v0.21 of \pkg{cleveref}.}
+%    \begin{macrocode}
+\def\LWR at orig@@@setcref#1#2{\cref at getlabel{#2}{\@templabel}#1{\@templabel}{}{}}%
 
-% ^^A |\@templabel| becomes the section number
-
-% ^^A original: \def\@@setcref#1#2{\cref at getlabel{#2}{\@templabel}#1{\@templabel}{}{}}
-
-%    \begin{macrocode}
-\renewcommand*{\@@setcref}[2]{#1{\ref{#2}}{}{}}
+\ifdefequal{\@@setcref}{\LWR at orig@@@setcref}{% before v0.21
+    \renewcommand*{\@@setcref}[2]{#1{\ref{#2}}{}{}}
+}{
+    \ifdefequal{\@@@setcref}{\LWR at orig@@@setcref}{% as of v0.21
+        \renewcommand*{\@@@setcref}[2]{#1{\ref{#2}}{}{}}
+    }{
+        \PackageWarning{lwarp-cleveref}{
+            Unknown verison of cleveref.
+            \protect\cref\space will fail.
+        }%
+    }
+}
 %    \end{macrocode}
 % \end{macro}
 
-% ^^A orig:
-% ^^A  \def\@@setcrefrange#1#2#3{%
-% ^^A    \cref at getlabel{#2}{\@labela}%
-% ^^A    \cref at getlabel{#3}{\@labelb}%
-% ^^A    #1{\@labela}{\@labelb}{}{}{}{}}
+%\begin{macro}{\@@@setcrefrange} \marg{text} \marg{label} \marg{label}
+% \changes{v0.48}{2018/02/10}{Fix for new v0.21 of \pkg{cleveref}.}
+%    \begin{macrocode}
+\def\LWR at orig@@@setcrefrange#1#2#3{%
+  \cref at getlabel{#2}{\@labela}%
+  \cref at getlabel{#3}{\@labelb}%
+  #1{\@labela}{\@labelb}{}{}{}{}}%
 
-%\begin{macro}{\@@setcrefrange} \marg{text} \marg{label} \marg{label}
-%    \begin{macrocode}
-\renewcommand{\@@setcrefrange}[3]{%
-#1{\ref{#2}}{\ref{#3}}{}{}{}{}}
+\ifdefequal{\@@setcrefrange}{\LWR at orig@@@setcrefrange}{
+    \renewcommand{\@@setcrefrange}[3]{%
+        #1{\ref{#2}}{\ref{#3}}{}{}{}{}%
+    }
+}{
+    \ifdefequal{\@@@setcrefrange}{\LWR at orig@@@setcrefrange}{
+        \renewcommand{\@@@setcrefrange}[3]{%
+            #1{\ref{#2}}{\ref{#3}}{}{}{}{}%
+        }
+    }{
+        \PackageWarning{lwarp-cleveref}{
+            Unknown verison of cleveref.
+            \protect\crefrange\space will fail.
+        }
+    }
+}
+
 %    \end{macrocode}
 % \end{macro}
 
@@ -23302,12 +24214,33 @@
 %    \end{macrocode}
 % \end{macro}
 
-% \begin{macro}{\@@setcpageref} \marg{typeofref} \marg{label},
+% \begin{macro}{\@@@setcpageref} \marg{typeofref} \marg{label},
 % where typeofref is ``page'' or ``pages''
 %
+% \changes{v0.48}{2018/02/10}{Fix for new v0.21 of \pkg{cleveref}.}
 %    \begin{macrocode}
-\renewcommand*{\@@setcpageref}[2]{%
-#1{\cpagerefFor\ \cref{#2}}{}{}%
+\def\LWR at orig@@setcpageref#1#2{% before v0.21
+  \cref at getpageref{#2}{\@temppage}#1{\@temppage}{}{}}%
+
+\def\LWR at orig@@@setcpageref#1#2{% as of v0.21
+  \cpageref at getlabel{#2}{\@temppage}#1{\@temppage}{}{}}%
+
+\ifdefequal{\@@setcpageref}{\LWR at orig@@setcpageref}{
+    \renewcommand*{\@@setcpageref}[2]{%
+        #1{\cpagerefFor\ \cref{#2}}{}{}%
+    }
+}{
+    \ifdefequal{\@@@setcpageref}{\LWR at orig@@@setcpageref}{
+        \renewcommand*{\@@@setcpageref}[2]{%
+            #1{\cpagerefFor\ \cref{#2}}{}{}%
+        }
+    }
+    {
+        \PackageWarning{lwarp-cleveref}{
+            Unknown verison of cleveref.
+            \protect\cpageref\space will fail.
+        }
+    }
 }
 %    \end{macrocode}
 % \end{macro}
@@ -23320,8 +24253,34 @@
 % ^^A    #1{\@pagea}{\@pageb}{}{}{}{}}
 
 %    \begin{macrocode}
-\renewcommand{\@@setcpagerefrange}[3]{%
-#1{\cpagerefFor\ \cref{#2}}{\cref{#3}}{}{}{}{}}
+\def\LWR at orig@@setcpagerefrange#1#2#3{% before v0.21
+  \cref at getpageref{#2}{\@pagea}%
+  \cref at getpageref{#3}{\@pageb}%
+  #1{\@pagea}{\@pageb}{}{}{}{}}%
+
+\def\LWR at orig@@@setcpagerefrange#1#2#3{% as of v0.21
+  \cpageref at getlabel{#2}{\@pagea}%
+  \cpageref at getlabel{#3}{\@pageb}%
+  #1{\@pagea}{\@pageb}{}{}{}{}}%
+
+\ifdefequal{\@@setcpagerefrange}{\LWR at orig@@setcpagerefrange}{
+    \renewcommand*{\@@setcpagerefrange}[3]{%
+        #1{\cpagerefFor\ \cref{#2}}{\cref{#3}}{}{}{}{}%
+    }
+}{
+    \ifdefequal{\@@@setcpagerefrange}{\LWR at orig@@@setcpagerefrange}{
+        \renewcommand*{\@@@setcpagerefrange}[3]{%
+            #1{\cpagerefFor\ \cref{#2}}{\cref{#3}}{}{}{}{}%
+        }
+    }
+    {
+        \PackageWarning{lwarp-cleveref}{
+            Unknown verison of cleveref.
+            \protect\cpagerefrange\space will fail.
+        }
+    }
+}
+
 }% AfterEndPreamble
 %    \end{macrocode}
 
@@ -23476,7 +24435,7 @@
 % The vertical positions may be 'c', 't', or 'b'.
 % The inner position may also be 's'.
 %
-% When using |\linewidth|, |\textwidth|, or |\textheight|, these are scaled proportionally to a
+% When using \cs{linewidth}, \cs{textwidth}, or \cs{textheight}, these are scaled proportionally to a
 % 6\texttimes{}9 inch text area.
 %
 %    \begin{macrocode}
@@ -23537,7 +24496,7 @@
 \ifbool{FormatWP}{%
 
 \addtocounter{LWR at thisautoidWP}{1}%
-\LWR at htmltag{div id="\mbox{autoidWP-\arabic{LWR at thisautoidWP}}" class="wpminipage"}%
+\LWR at htmltag{div id="\LWR at origmbox{autoidWP-\arabic{LWR at thisautoidWP}}" class="wpminipage"}%
 
 }{}%
 %    \end{macrocode}
@@ -23546,13 +24505,13 @@
 %    \begin{macrocode}
 \LWR at traceinfo{minipage: creating div class}%
 \LWR at htmltag{div class="minipage" style="%
-\ifthenelse{\equal{#1}{t}}{\mbox{vertical-align:bottom} ; }{}%
-\ifthenelse{\equal{#1}{c}}{\mbox{vertical-align:middle} ; }{}%
-\ifthenelse{\equal{#1}{b}}{\mbox{vertical-align:top} ; }{}%
-\ifthenelse{\equal{#3}{t}}{\mbox{justify-content:flex-start} ; }{}%
-\ifthenelse{\equal{#3}{c}}{\mbox{justify-content:center} ; }{}%
-\ifthenelse{\equal{#3}{b}}{\mbox{justify-content:flex-end} ; }{}%
-\ifthenelse{\equal{#3}{s}}{\mbox{justify-content:space-between} ; }{}%
+\ifthenelse{\equal{#1}{t}}{\LWR at origmbox{vertical-align:bottom} ; }{}%
+\ifthenelse{\equal{#1}{c}}{\LWR at origmbox{vertical-align:middle} ; }{}%
+\ifthenelse{\equal{#1}{b}}{\LWR at origmbox{vertical-align:top} ; }{}%
+\ifthenelse{\equal{#3}{t}}{\LWR at origmbox{justify-content:flex-start} ; }{}%
+\ifthenelse{\equal{#3}{c}}{\LWR at origmbox{justify-content:center} ; }{}%
+\ifthenelse{\equal{#3}{b}}{\LWR at origmbox{justify-content:flex-end} ; }{}%
+\ifthenelse{\equal{#3}{s}}{\LWR at origmbox{justify-content:space-between} ; }{}%
 %    \end{macrocode}
 % Print the width and optional height styles:
 %    \begin{macrocode}
@@ -23584,7 +24543,7 @@
 \setlength{\textwidth}{6in}%
 \setlength{\textheight}{9in}%
 %    \end{macrocode}
-% |\raggedright| cancels hyphenation, which will be done by \HTML\ instead.
+% \cs{raggedright} cancels hyphenation, which will be done by \HTML\ instead.
 %    \begin{macrocode}
 \LWR at origraggedright%
 %    \end{macrocode}
@@ -23634,7 +24593,6 @@
 }{}%
 \LWR at htmldivclassend{minipage}%
 
-\LWR at origvspace{1\baselineskip}% required for subcaption
 \addtocounter{LWR at minipagedepth}{-1}%
 \LWR at startpars%
 \ifbool{FormatWP}{\newline}{}%
@@ -23648,7 +24606,7 @@
 % \end{environment}
 %
 %
-% \subsection{Parbox, makebox, framebox, fbox, raisebox}
+% \subsection{Parbox, mbox, makebox, framebox, fbox, raisebox}
 %
 % \codehtml
 %
@@ -23667,13 +24625,22 @@
 % \end{macro}
 %
 %
+%
+% \begin{macro}{\mbox} \marg{text}
+%   \qquad Nullified for \HTML.
+% \changes{v0.48}{2018/02/04}{Nullified for \HTML.}
+%    \begin{macrocode}
+\renewcommand*{\mbox}[1]{#1}
+%    \end{macrocode}
+% \end{macro}
+%
+%
+%
 % \begin{macro}{\makebox} \parg(posn) \oarg{width} \oarg{pos} \marg{text}
 %
 % \changes{v0.34}{2017/07/31}{Fix: Handles paren arg.}
 % \changes{v0.36}{2017/08/15}{Fix: Handles width and horiz position.}
 %    \begin{macrocode}
-\LetLtxMacro\LWR at origmakebox\makebox
-
 \RenewDocumentCommand{\makebox}{d() o o m}{%
 %    \end{macrocode}
 % Check for the optional width:
@@ -23700,8 +24667,8 @@
 %    \begin{macrocode}
     \uselengthunit{PT}%
     \InlineClass[%
-        \mbox{display:inline-block} ; %
-        \mbox{text-align}:\LWR at align\ ; %
+        \LWR at origmbox{display:inline-block} ; %
+        \LWR at origmbox{text-align}:\LWR at align\ ; %
         width:\rndprintlength{\LWR at tempwidth}%
     ]%
     {makebox}%
@@ -24001,6 +24968,7 @@
 %   \cs{textsc}, etc.}
 
 
+
 % \begin{macro}{\LWR at HTMLtextstyle} \marg{FormatWP style} \marg{class} \marg{text}
 %
 % If |FormatWP|, adds an explicit style to the text span class.
@@ -24152,9 +25120,10 @@
 
 % \begin{macro}{\LWR at nullfonts} Removes formatting during filename operations.
 % \changes{v0.34}{2017/08/05}{Improved font control.}
-% \changes{v0.36}{2017/08/15}{Fix: Filenames while using MathJax.}
+% \changes{v0.36}{2017/08/15}{Fix: Filenames while using \brand{MathJax}.}
 % \changes{v0.40}{2017/09/21}{Fix: Long arguments for expandable command.}
 % \changes{v0.43}{2017/10/31}{Fix: Nullify dollar inside filesnames.}
+% \changes{v0.48}{2018/02/04}{Fix: \cs{newline} in title.}
 %    \begin{macrocode}
 \newcommand*{\LWR at nullfonts}{%
 \LetLtxMacro{\emph}{\LWR at nullemph}%
@@ -24195,62 +25164,92 @@
 \DeclareExpandableDocumentCommand{\InlineClass}{+o +m +m}{##3}%
 \DeclareRobustCommand{\LWR at HTMLtextstyle}[3]{##3}%
 \DeclareRobustCommand{\LWR at subsingledollar}[1]{}%
+\renewcommand*{\newline}{ }%
 }
 %    \end{macrocode}
 % \end{macro}
 
 
+
+% \changes{v0.48}{2018/02/02}{Improved font control.}
+
+% Remembers the current font family, series, and shape.
+%    \begin{macrocode}
+\newcommand*{\LWR at f@family}{rm}
+\newcommand*{\LWR at f@series}{md}
+\newcommand*{\LWR at f@shape}{up}
+%    \end{macrocode}
+
+% \begin{macro}{\LWR at textcurrentfont} \marg{text}
+%
+% Prints the text with the current font choices.
+%
+% \changes{v0.48}{2018/02/02}{Added.  Improves font control.}
+%    \begin{macrocode}
+\newcommand*{\LWR at textcurrentfont}[1]{%
+\csuse{text\LWR at f@family}{%
+\csuse{text\LWR at f@series}{%
+\csuse{text\LWR at f@shape}{%
+#1%
+}%
+}%
+}%
+}
+%    \end{macrocode}
+% \end{macro}
+
+% \changes{v0.48}{2018/02/02}{Improved font control.}
 % \begin{macro}{\mdseries}
 %    \begin{macrocode}
-\renewcommand*{\mdseries}{}
+\renewcommand*{\mdseries}{\renewcommand*{\LWR at f@series}{md}}
 %    \end{macrocode}
 % \end{macro}
 
 % \begin{macro}{\bfseries}
 %    \begin{macrocode}
-\renewcommand*{\bfseries}{}
+\renewcommand*{\bfseries}{\renewcommand*{\LWR at f@series}{bf}}
 %    \end{macrocode}
 % \end{macro}
 
 % \begin{macro}{\rmfamily}
 %    \begin{macrocode}
-\renewcommand*{\rmfamily}{}
+\renewcommand*{\rmfamily}{\renewcommand*{\LWR at f@family}{rm}}
 %    \end{macrocode}
 % \end{macro}
+
 % \begin{macro}{\sffamily}
-
 %    \begin{macrocode}
-\renewcommand*{\sffamily}{}
+\renewcommand*{\sffamily}{\renewcommand*{\LWR at f@family}{sf}}
 %    \end{macrocode}
 % \end{macro}
 
 % \begin{macro}{\ttfamily}
 %    \begin{macrocode}
-\renewcommand*{\ttfamily}{}
+\renewcommand*{\ttfamily}{\renewcommand*{\LWR at f@family}{tt}}
 %    \end{macrocode}
 % \end{macro}
 
 % \begin{macro}{\upshape}
 %    \begin{macrocode}
-\renewcommand*{\upshape}{}
+\renewcommand*{\upshape}{\renewcommand*{\LWR at f@shape}{up}}
 %    \end{macrocode}
 % \end{macro}
 
 % \begin{macro}{\itshape}
 %    \begin{macrocode}
-\renewcommand*{\itshape}{}
+\renewcommand*{\itshape}{\renewcommand*{\LWR at f@shape}{it}}
 %    \end{macrocode}
 % \end{macro}
 
 % \begin{macro}{\scshape}
 %    \begin{macrocode}
-\renewcommand*{\scshape}{}
+\renewcommand*{\scshape}{\renewcommand*{\LWR at f@shape}{sc}}
 %    \end{macrocode}
 % \end{macro}
 
 % \begin{macro}{\normalfont}
 %    \begin{macrocode}
-\renewcommand*{\normalfont}{}
+\renewcommand*{\normalfont}{\rmfamily\mdseries\upshape}
 %    \end{macrocode}
 % \end{macro}
 
@@ -24340,31 +25339,7 @@
 % \end{macro}
 
 
-
-% \begin{macro}{\hfill}
-% \changes{v0.20}{2016/12/12}{Inserts a \cs{qquad}.}
 %    \begin{macrocode}
-\renewcommand*{\hfill}{\qquad}
-%    \end{macrocode}
-% \end{macro}
-
-% \begin{macro}{\hrulefill}
-% \changes{v0.20}{2017/01/19}{Inserts a short rule.}
-%    \begin{macrocode}
-\renewcommand*{\hrulefill}{\rule{1in}{1pt}}
-%    \end{macrocode}
-% \end{macro}
-
-% \begin{macro}{\dotfill}
-% \changes{v0.20}{2017/01/19}{Inserts an ellipsis.}
-%    \begin{macrocode}
-\renewcommand*{\dotfill}{\dots}
-%    \end{macrocode}
-% \end{macro}
-
-
-
-%    \begin{macrocode}
 \end{warpHTML}
 %    \end{macrocode}
 
@@ -24380,19 +25355,6 @@
 %    \end{macrocode}
 
 % |\,| must be redefined after |\RequirePackage{printlen}|
-%    \begin{macrocode}
-\let\LWR at origcomma\,
-\let\LWR at origtilde~
-\let\LWR at origenskip\enskip
-\let\LWR at origquad\quad
-\let\LWR at origqquad\qquad
-\let\LWR at orighspace\hspace
-\let\LWR at origvspace\vspace
-\let\LWR at origrule\rule
-\let\LWR at origmedskip\medskip
-\let\LWR at origbigskip\bigskip
-\let\LWR at origtextellipsis\textellipsis
-%    \end{macrocode}
 
 % \changes{v0.45}{2017/12/29}{Improved: Robust \cs{\,}, \cs{~}, and \cs{textellipsis} commands.}
 % Direct-formatting space commands become \HTML\ entities:
@@ -24409,16 +25371,6 @@
 %    \end{macrocode}
 % Direct-formatting font sizes are ignored:
 %    \begin{macrocode}
-\let\LWR at orignormalsize\normalsize
-\let\LWR at origsmall\small
-\let\LWR at origfootnotesize\footnotesize
-\let\LWR at origscriptsize\scriptsize
-\let\LWR at origtiny\tiny
-\let\LWR at origlarge\large
-\let\LWR at origLarge\Large
-\let\LWR at origLARGE\LARGE
-\let\LWR at orighuge\huge
-\let\LWR at origHuge\Huge
 \renewcommand*{\normalsize}{}
 \renewcommand*{\small}{}
 \renewcommand*{\footnotesize}{}
@@ -24440,7 +25392,28 @@
 %    \end{macrocode}
 
 
+% \begin{macro}{\hfill}
+% \changes{v0.20}{2016/12/12}{Inserts a \cs{qquad}.}
+%    \begin{macrocode}
+\renewcommand*{\hfill}{\qquad}
+%    \end{macrocode}
+% \end{macro}
 
+% \begin{macro}{\hrulefill}
+% \changes{v0.20}{2017/01/19}{Inserts a short rule.}
+%    \begin{macrocode}
+\renewcommand*{\hrulefill}{\rule{1in}{1pt}}
+%    \end{macrocode}
+% \end{macro}
+
+% \begin{macro}{\dotfill}
+% \changes{v0.20}{2017/01/19}{Inserts an ellipsis.}
+%    \begin{macrocode}
+\renewcommand*{\dotfill}{\dots}
+%    \end{macrocode}
+% \end{macro}
+
+
 % \begin{macro}{\newpage}
 % \changes{v0.45}{2018/01/12}{Added.}
 %    \begin{macrocode}
@@ -24874,7 +25847,7 @@
 %    \end{macrocode}
 
 % \begin{macro}{\phantomsection}
-% Emulate the hyperref |\phantomsection| command,
+% Emulate the hyperref \cs{phantomsection} command,
 % often used to insert the bibliography into table of contents:
 %    \begin{macrocode}
 \DeclareDocumentCommand{\phantomsection}{}{%
@@ -24898,7 +25871,7 @@
 %
 % Some of these logos may be redefined in a later package,
 % so after loading other packages, and at the beginning of the document, their definitions
-% are finally |\let| in |\LWR at LwarpStart|.
+% are finally \cs{let} in \cs{LWR at LwarpStart}.
 %
 % For \CSS\ conversions, see: \\
 % \url{http://edward.oconnor.cx/2007/08/tex-poshlet} \\
@@ -25146,18 +26119,18 @@
 %
 % \begin{itemize}
 % \item \TeX\ is a trademark of American Mathematical Society.
-% \item Adobe®  and Adobe Framemaker® are either registered trademarks or
-%	trademarks of Adobe Systems Incorporated in the United States and/or other countries.
-% \item Linux® is the registered trademark of Linus Torvalds in the U.S.\ and other countries.
-% \item Mac\,OS® is a trademark of Apple Inc.
-% \item MadCap Flare™ is the property of MadCap Software, Inc.
-% \item MathJax is copyright 2009 and later.
-%	The MathJax Consortium is a joint venture of the American Mathematical Society (AMS)
-%	and the Society for Industrial and Applied Mathematics (SIAM)
+% \item \brand{Adobe}®  and \brand{Adobe Framemaker}® are either registered trademarks or
+%	trademarks of \brand{Adobe Systems Incorporated} in the United States and/or other countries.
+% \item \brand{Linux}® is the registered trademark of Linus Torvalds in the U.S.\ and other countries.
+% \item \brand{Mac\,OS}® is a trademark of \brand{Apple Inc.}
+% \item \brand{MadCap Flare}™ is the property of \brand{MadCap Software, Inc.}
+% \item \brand{MathJax} is copyright 2009 and later.
+%	The \brand{MathJax Consortium} is a joint venture of the \brand{American Mathematical Society} (AMS)
+%	and the \brand{Society for Industrial and Applied Mathematics} (SIAM)
 %	to advance mathematical and scientific content on the web.
-% \item Microsoft®, Encarta, MSN, and Windows® are either registered trademarks or
-%	trademarks of Microsoft Corporation in the United States and/or other countries.
-% \item UNIX® is a registered trademark of The Open Group.
+% \item \brand{Microsoft}®, \brand{Encarta}, \brand{MSN}, and \brand{Windows}® are either registered trademarks or
+%	trademarks of \brand{Microsoft Corporation} in the United States and/or other countries.
+% \item \brand{UNIX}® is a registered trademark of \brand{The Open Group}.
 % \end{itemize}
 
 % \iffalse
@@ -25423,6 +26396,193 @@
 %
 %
 % \iffalse
+%<*acro>
+% \fi
+%
+% \part{lwarp-acro.sty}
+
+% \section{acro}
+%
+% \credits{Clemens Niederberger}
+%
+% \DescribePackage{acro}
+% \pkg{acro} is patched for use by \pkg{lwarp}.
+%
+% \changes{v0.48}{2018/02/02}{\pkg{acro}: Added.}
+%
+% \codehtml
+%
+%    \begin{macrocode}
+\LWR at ProvidesPackagePass{acro}
+%    \end{macrocode}
+
+
+% \cs{DeclareAcronym} is used in the preamble,
+% where \pkg{lwarp} has not yet made the dollar active,
+% so temporarily enable \pkg{lwarp} math catcode just for this
+% definition:
+%    \begin{macrocode}
+\ExplSyntaxOn
+\NewDocumentCommand \LWR at DeclareAcronym {mm}
+{
+    \acro_declare_acronym:nn {#1} {#2}
+    \catcode`\$=3% lwarp
+}
+\ExplSyntaxOff
+
+\RenewDocumentCommand{\DeclareAcronym}{}{
+    \catcode`\$=\active% lwarp
+    \LWR at DeclareAcronym
+}
+%    \end{macrocode}
+
+% Modified to activate the current font:
+%    \begin{macrocode}
+\ExplSyntaxOn
+\cs_gset_protected:Npn \acro_write_short:nn #1#2
+  {
+    \mode_if_horizontal:F { \leavevmode }
+    \group_begin:
+      \bool_if:NTF \l__acro_custom_format_bool
+        { \l__acro_custom_format_tl }
+        { \l__acro_short_format_tl }
+      {\LWR at textcurrentfont{#2}}% lwarp
+    \group_end:
+  }
+
+\cs_gset_protected:Npn \acro_write_alt:nn #1#2
+  {
+    \mode_if_horizontal:F { \leavevmode }
+    \group_begin:
+      \bool_if:NTF \l__acro_custom_format_bool
+        { \l__acro_custom_format_tl }
+        { \l__acro_alt_format_tl }
+      {\LWR at textcurrentfont{#2}}% lwarp
+    \group_end:
+  }
+
+\cs_gset_protected:Npn \acro_write_long:nn #1#2
+  {
+    \mode_if_horizontal:F { \leavevmode }
+    \group_begin:
+      \bool_if:NTF \l__acro_custom_long_format_bool
+        { \l__acro_custom_long_format_tl }
+        { \use:n }
+      {
+        \use:x
+          {
+            \exp_not:n {#1}
+            {
+              \bool_if:NTF \l__acro_first_upper_bool
+                { \exp_not:N \__acro_first_upper_case:n { \exp_not:n {
+                    \LWR at textcurrentfont{#2}% lwarp
+                } } }
+                { \exp_not:n {\LWR at textcurrentfont{#2}} }% lwarp
+            }
+          }
+      }
+    \group_end:
+  }
+\ExplSyntaxOff
+%    \end{macrocode}
+
+% \iffalse
+%</acro>
+% \fi
+%
+%
+%
+%
+% \iffalse
+%<*acronym>
+% \fi
+%
+% \part{lwarp-acronym.sty}
+
+% \section{acronym}
+%
+% \credits{Tobias Oetiker}
+%
+% \DescribePackage{acronym}
+% \pkg{acronym} is patched for use by \pkg{lwarp}.
+%
+% \cs{acresetall} does not work with \pkg{cleveref},
+% \watchout
+% causing multiply-defined labels.
+% \pkg{lwarp} patches \pkg{acronym} for \HTML, but not for print mode.
+%
+% \changes{v0.48}{2018/02/02}{\pkg{acronym}: Added.}
+%
+% \codehtml
+%
+%    \begin{macrocode}
+\LWR at ProvidesPackagePass{acronym}
+%    \end{macrocode}
+
+% Uses \cs{textit} instead of \cs{itshape}:
+%    \begin{macrocode}
+\renewcommand{\acfia}[1]{%
+  {\textit{\AC at acl{#1}}} (\ifAC at starred\acs*{#1}\else\acs{#1}\fi)}
+%    \end{macrocode}
+
+
+% Removes the mbox to allow math inside:
+%    \begin{macrocode}
+\renewcommand*\AC at acs[1]{%
+%     \mbox{
+ \expandafter\AC at get\csname fn@#1\endcsname\@firstoftwo{#1}}
+% }
+%    \end{macrocode}
+
+% Modified for \pkg{cleveref} and \pkg{zref}:
+%    \begin{macrocode}
+\renewcommand*\AC at und@newl at bel[3]{%
+    \@ifundefined{#1@#3}%
+    {%
+        \global\expandafter\let\csname#2@#3\endcsname\@nnil
+        \global\expandafter\let\csname#2@#3 at cref\endcsname\@nnil% lwarp
+    }%
+    {%
+        \global\expandafter\let\csname#1@#3\endcsname\relax
+        \global\expandafter\let\csname#1@#3 at cref\endcsname\relax% lwarp
+        \global\expandafter\let\csname Z at R@#3\endcsname\relax% lwarp
+    }%
+}%
+%    \end{macrocode}
+
+% Modified for \pkg{cleveref} and \pkg{zref}:
+%    \begin{macrocode}
+\renewcommand*\AC at testdef[3]{%
+\ifstrequal{#1}{Z at R}{}{% lwarp
+  \@ifundefined{s@#2}\@secondoftwo\@firstofone
+  {%
+    \expandafter\ifx\csname s@#2\endcsname\empty
+      \expandafter\@firstofone
+    \else
+      \expandafter\xdef\csname s@#2\endcsname{%
+        \expandafter\expandafter
+        \expandafter\@gobble
+        \csname s@#2\endcsname
+      }%
+      \expandafter\@gobble
+    \fi
+  }%
+  {%
+    \@testdef{#1}{#2}{#3}%
+  }%
+}% lwarp
+}%
+%    \end{macrocode}
+
+% \iffalse
+%</acronym>
+% \fi
+%
+%
+%
+%
+%
+% \iffalse
 %<*adjmulticol>
 % \fi
 %
@@ -25484,8 +26644,8 @@
 % \changes{v0.47}{2018/01/26}{\pkg{adjmulticol}: Fix: Line wrap at \HTML\ hyphen.}
 %    \begin{macrocode}
 \BlockClass[%
-\mbox{margin-left:\rndprintlength{\LWR at templengthone}} ; %
-\mbox{margin-right:\rndprintlength{\LWR at templengthtwo}}%
+\LWR at origmbox{margin-left:\rndprintlength{\LWR at templengthone}} ; %
+\LWR at origmbox{margin-right:\rndprintlength{\LWR at templengthtwo}}%
 ]{\LWR at mcolstype}%
 }
 {\endBlockClass}
@@ -26079,8 +27239,8 @@
 \let\lasthline\LWR at origlasthline%
 }
 
-\renewcommand*{\firsthline}{\LWR at hline}%
-\renewcommand*{\lasthline}{\LWR at hline}%
+\renewcommand*{\firsthline}{\LWR at HTMLhline}%
+\renewcommand*{\lasthline}{\LWR at HTMLhline}%
 %    \end{macrocode}
 %
 % \iffalse
@@ -26807,8 +27967,7 @@
     \let\caption at lsep\@empty
     \let\caption at tfmt\@firstofone
   }%
-%   \@setpar{\@@par\caption@@par}\caption@@par
-    \renewcommand{\@@par}{\LWR at closeparagraph\LWR at orig@@par}% lwarp
+  \@setpar{\LWR at closeparagraph\@@par}% lwarp
   \caption at applyfont
   \caption at fmt
     {\ifcaption at star\else
@@ -27075,8 +28234,40 @@
 %
 %
 %
+% \iffalse
+%<*chapterbib>
+% \fi
 %
+% \part{lwarp-chapterbib.sty}
+
+% \section{chapterbib}
+%
+% \credits{Donald Arseneau}
+%
+% \DescribePackage{chapterbib}
+% \pkg{chapterbib} is patched for use by \pkg{lwarp}.
+%
+% \changes{v0.48}{2018/02/05}{\pkg{chapterbib}: Added.}
+%
+% \codehtml
+%
+%    \begin{macrocode}
+\LWR at ProvidesPackagePass{chapterbib}
+%    \end{macrocode}
+
+%    \begin{macrocode}
+\xdef\@savedjobname{\BaseJobname}
+\let\@currentipfile\@savedjobname
+%    \end{macrocode}
+
 % \iffalse
+%</chapterbib>
+% \fi
+%
+%
+%
+%
+% \iffalse
 %<*cite>
 % \fi
 %
@@ -27151,8 +28342,126 @@
 %
 %
 %
+% \iffalse
+%<*colortbl>
+% \fi
 %
+% \part{lwarp-colortbl.sty}
+%
+% \section{colortbl}
+%
+% \DescribePackage{colortbl}
+% \pkg{colortbl} is emulated.
+%
+% \changes{v0.48}{2018/02/05}{\pkg{colortbl}: Added.}
+%
+% \limitscolortbl
+%
+%
+% \codehtml
+%
+%    \begin{macrocode}
+\LWR at ProvidesPackagePass{colortbl}
+%    \end{macrocode}
+
+% Remember the print-mode definitions:
+%    \begin{macrocode}
+\LetLtxMacro\LWR at origcolumncolor\columncolor
+\LetLtxMacro\LWR at origrowcolor\rowcolor
+\LetLtxMacro\LWR at origcellcolor\cellcolor
+\LetLtxMacro\LWR at origarrayrulecolor\arrayrulecolor
+\LetLtxMacro\LWR at origdoublerulesepcolor\doublerulesepcolor
+
+\appto{\LWR at restoreorigformatting}{%
+\LetLtxMacro\columncolor\LWR at origcolumncolor
+\LetLtxMacro\rowcolor\LWR at origrowcolor
+\LetLtxMacro\cellcolor\LWR at origcellcolor
+\LetLtxMacro\arrayrulecolor\LWR at origarrayrulecolor
+\LetLtxMacro\doublerulesepcolor\LWR at origdoublerulesepcolor
+}
+%    \end{macrocode}
+
+%
+% The following \cs{LWR at HTML} versions are used inside an \HTML\ \env{tabular}.
+%
+% \begin{noindmacro}{\columncolor} \oarg{model} \marg{color} \oarg{left overhang} \oarg{right overhang}
+%
+% \cs{LWR at getmynexttoken} is not used here because \cs{columncolor} is not used
+% inside the data area of the tabular.
+%    \begin{macrocode}
+\RenewDocumentCommand{\LWR at HTMLcolumncolor}{O{named} m o o}{%
+\convertcolorspec{#1}{#2}{HTML}\LWR at columnHTMLcolor%
+\LWR at addtabularcellcolor%
+}
+%    \end{macrocode}
+% \end{noindmacro}
+%
+% \cs{LWR at getmynexttoken} is used for \cs{rowcolor} because it is used
+% inside the data area of the tabular.
+%
+% \begin{noindmacro}{\rowcolor} \oarg{model} \marg{color} \oarg{left overhang} \oarg{right overhang}
+%    \begin{macrocode}
+\RenewDocumentCommand{\LWR at HTMLrowcolor}{O{named} m o o}{%
+\convertcolorspec{#1}{#2}{HTML}\LWR at rowHTMLcolor%
+\LWR at getmynexttoken%
+}
+%    \end{macrocode}
+% \end{noindmacro}
+
+% \begin{noindmacro}{\cellcolor} \oarg{model} \marg{color} \oarg{left overhang} \oarg{right overhang}
+%    \begin{macrocode}
+\RenewDocumentCommand{\LWR at HTMLcellcolor}{O{named} m o o}{%
+\convertcolorspec{#1}{#2}{HTML}\LWR at cellHTMLcolor%
+\LWR at addtabularcellcolor%
+}
+%    \end{macrocode}
+% \end{noindmacro}
+
+% \begin{noindmacro}{\arrayrulecolor} \oarg{model} \marg{color}
+%
+% The version for use outside a \env{tabular}.
+%    \begin{macrocode}
+\renewcommand{\arrayrulecolor}[2][named]{%
+\convertcolorspec{#1}{#2}{HTML}\LWR at ruleHTMLcolor%
+}
+%    \end{macrocode}
+% \end{noindmacro}
+
+% \begin{noindmacro}{\LWR at arrayrulecolor} \oarg{model} \marg{color}
+%
+% The version for use inside a \env{tabular}.
+%    \begin{macrocode}
+\renewcommand{\LWR at HTMLarrayrulecolor}[2][named]{%
+\convertcolorspec{#1}{#2}{HTML}\LWR at ruleHTMLcolor%
+\LWR at getmynexttoken%
+}
+%    \end{macrocode}
+% \end{noindmacro}
+
+% \begin{noindmacro}{\doublerulesepcolor} \oarg{model} \marg{color}
+%
+% The version for use outside a \env{tabular}.
+%    \begin{macrocode}
+\renewcommand{\doublerulesepcolor}[2][named]{}
+%    \end{macrocode}
+% \end{noindmacro}
+
+% \begin{noindmacro}{\LWR at doublerulesepcolor} \oarg{model} \marg{color}
+%
+% The version for use inside a \env{tabular}.
+%    \begin{macrocode}
+\renewcommand{\LWR at HTMLdoublerulesepcolor}[2][named]{\LWR at getmynexttoken}
+%    \end{macrocode}
+% \end{noindmacro}
+
 % \iffalse
+%</colortbl>
+% \fi
+%
+%
+%
+%
+% \iffalse
 %<*continue>
 % \fi
 %
@@ -27868,13 +29177,13 @@
 %    \begin{macrocode}
 \DeclareDocumentCommand{\epigraph}{m m}
 {
-\begin{LWR at BlockClassWP}{\mbox{text-align:right}}{}{epigraph}
+\begin{LWR at BlockClassWP}{\LWR at origmbox{text-align:right}}{}{epigraph}
 \qitem{#1}{#2}
 \end{LWR at BlockClassWP}
 }
 
 \DeclareDocumentEnvironment{epigraphs}{}
-{\LWR at BlockClassWP{\mbox{text-align:right}}{}{epigraph}}
+{\LWR at BlockClassWP{\LWR at origmbox{text-align:right}}{}{epigraph}}
 {\endLWR at BlockClassWP}
 %    \end{macrocode}
 %
@@ -28154,7 +29463,7 @@
 \def\endSbox{\endLWR at nestspan\LWR at origendSbox}
 %    \end{macrocode}
 %
-% \env{Beqnarray} is adapted for MathJax or enclosed inside a \env{lateximage}:
+% \env{Beqnarray} is adapted for \brand{MathJax} or enclosed inside a \env{lateximage}:
 %
 %    \begin{macrocode}
 \RenewEnviron{Beqnarray}
@@ -28270,9 +29579,32 @@
 %
 %
 %
+% \iffalse
+%<*fancyheadings>
+% \fi
 %
+% \part{lwarp-fancyheadings.sty}
 %
+% \section{fancyheadings}
+%
+% \DescribePackage{fancyheadings}
+% \pkg{fancyheadings} is superceded by \pkg{fancyhdr}.
+%
+% \changes{v0.48}{2018/02/07}{\pkg{fancyheadings}: Prevented.}
+%
+% \codehtml
+%    \begin{macrocode}
+\LWR at loadnever{fancyheadings}{fancyhdr}
+%    \end{macrocode}
+%
 % \iffalse
+%</fancyheadings>
+% \fi
+%
+%
+%
+%
+% \iffalse
 %<*fancyhdr>
 % \fi
 
@@ -28335,64 +29667,56 @@
 % \pkg{fancyref} is emulated.
 %
 % \changes{v0.44}{2017/11/22}{\pkg{fancyref}: Added.}
+% \changes{v0.48}{2018/02/04}{\pkg{fancyref}: Now directly supported.}
 %
 % \codehtml
 %
 %    \begin{macrocode}
-\LWR at ProvidesPackageDrop{fancyref}
+\LWR at ProvidesPackagePass{fancyref}
 %    \end{macrocode}
 %
+% To remove the |margin| option, if \cs{fancyrefhook} is anything
+% other than the |paren| option, then force it to the default instead.
+% (Comparing to the |margin| option was not possible since \pkg{lwarp} has
+% revised the meaning of \cs{mbox} so the comparison failed.)
 %    \begin{macrocode}
-\newcommand*{\fancyrefhook}[1]{#1}
-\newcommand*{\fref}[2][]{\cref{#2}}
-\newcommand*{\Fref}[2][]{\Cref{#2}}
-\newcommand*{\fancyrefchaplabelprefix}{chap}
-\newcommand*{\fancyrefenumlabelprefix}{enum}
-\newcommand*{\fancyrefeqlabelprefix}{eq}
-\newcommand*{\fancyreffiglabelprefix}{fig}
-\newcommand*{\fancyreffnlabelprefix}{fn}
-\newcommand*{\fancyrefseclabelprefix}{sec}
-\newcommand*{\fancyreftablabelprefix}{tab}
-\newcommand*{\fancyrefchangeprefix}[2]{}
-\newcommand*{\fancyrefargdelim}{:}
-\newcommand*{\fancyrefloosespacing}{~}
-\newcommand*{\fancyreftightspacing}{\,}
-\newcommand*{\fancyrefdefaultspacing}{\fancyrefloosespacing}
-\providecommand*{\chaptername}{Chapter}
-\providecommand*{\figurename}{Figure}
-\providecommand*{\pagename}{Page}
-\providecommand*{\tablename}{Table}
-\renewcommand*{\Frefchapname}{\chaptername}
-\renewcommand*{\Frefenumname}{Item}
-\renewcommand*{\Frefeqname}{Equation}
-\renewcommand*{\Freffigname}{\figurename}
-\renewcommand*{\Freffnname}{Footnote}
-\renewcommand*{\Frefonname}{On}
-\renewcommand*{\Frefpgname}{\pagename}
-\renewcommand*{\Frefsecname}{Section}
-\renewcommand*{\Frefseename}{See}
-\renewcommand*{\Freftabname}{\tablename}
-\renewcommand*{\Freffigshortname}{Fig.}
-\renewcommand*{\Frefpgshortname}{P.}
-\renewcommand*{\Freftabshortname}{Tab.}
-\renewcommand*{\frefchapname}{\MakeLowercase{\Frefchapname}}
-\renewcommand*{\frefenumname}{\MakeLowercase{\Frefenumname}}
-\renewcommand*{\frefeqname}{\MakeLowercase{\Frefeqname}}
-\renewcommand*{\freffigname}{\MakeLowercase{\Freffigname}}
-\renewcommand*{\freffnname}{\MakeLowercase{\Freffnname}}
-\renewcommand*{\frefonname}{\MakeLowercase{\Frefonname}}
-\renewcommand*{\frefpgname}{\MakeLowercase{\Frefpgname}}
-\renewcommand*{\frefsecname}{\MakeLowercase{\Frefsecname}}
-\renewcommand*{\frefseename}{\MakeLowercase{\Frefseename}}
-\renewcommand*{\freftabname}{\MakeLowercase{\Freftabname}}
-\renewcommand*{\freffigshortname}{\MakeLowercase{\Freffigshortname}}
-\renewcommand*{\frefpgshortname}{\MakeLowercase{\Frefpgshortname}}
-\renewcommand*{\freftabshortname}{\MakeLowercase{\Freftabshortname}}
-\newcommand*{\fancyrefaddcaptions}[2]{}
-\newcommand*{\fancyrefdefaultformat}{\@empty}
-\newcommand{\frefformat}[3]{}
-\newcommand{\Frefformat}[3]{}
+\newcommand*{\LWRfref at parenfancyrefhook}[1]{(#1)}
+
+\ifdefstrequal{\fancyrefhook}{\LWRfref at parenfancyrefhook}
+{}{
+    \renewcommand*{\fancyrefhook}[1]{#1}%
+}
 %    \end{macrocode}
+
+% Modified to ignore the page number and \pkg{varioref}.
+%    \begin{macrocode}
+\renewcommand*{\@f at ref}[4]{%
+  \@ifundefined{#1r@#2@#3}{%
+    \PackageError{fancyref}{%
+      \backslashchar#1ref\space format ``#2''
+      undefined\MessageBreak
+      for label type ``#3''%
+    }{%
+      The format ``#2'' was not defined for the label type
+      ``#3''\MessageBreak
+      and the \backslashchar#1ref\space command.  Perhaps
+      you have only misspelled its name.\MessageBreak
+      Otherwise you will have to define it with
+      \protect\new#1refformat\MessageBreak
+      prior to using it.%
+    }%
+  }{%
+    \fancyrefhook{%
+      \@nameuse{#1r@#2@#3}%
+        {\ref{#3\fancyrefargdelim#4}}%
+%         {\pageref{#3\fancyrefargdelim#4}}% original
+%         {\@fancyref at page@ref{#3\fancyrefargdelim#4}}% original
+        {}% lwarp
+        {}% lwarp
+    }%
+  }%
+}%
+%    \end{macrocode}
 %
 % \iffalse
 %</fancyref>
@@ -30610,9 +31934,11 @@
 %    \begin{macrocode}
 \LWR at origtilde \LWR at orignewline%
 %    \end{macrocode}
-% Temporarily compute |\linewidth|, |\textwidth|, |\textheight| arguments with a 6x9 inch size
-% until the next |\endgroup|.
+% Temporarily compute \cs{linewidth}, \cs{textwidth}, \cs{textheight} arguments with a 6x9 inch size
+% until the next \cs{endgroup}.
+% \changes{v0.48}{2018/02/11}{Fix: Virtual page size limited to a group.}
 %    \begin{macrocode}
+\begingroup%
 \ifthenelse{\cnttest{\value{LWR at minipagedepth}}{=}{0}}%
 {%
     \ifbool{LWR at infloatrow}%
@@ -30767,9 +32093,10 @@
 }% end of image tags
 }% end of href
 %    \end{macrocode}
-% Return to small-sized output:
+% Return to original page size and font size:
+% \changes{v0.48}{2018/02/11}{Fix: Virtual page size limited to a group.}
 %    \begin{macrocode}
-\LWR at origscriptsize
+\endgroup
 \LWR at traceinfo{LWR at includegraphicsb done}%
 }
 %    \end{macrocode}
@@ -31070,8 +32397,8 @@
     \LWR at findhangingleftmargin%
     \uselengthunit{PT}%
     \BlockClass[%
-        \mbox{margin-left:\rndprintlength{\LWR at templengthone}} ; %
-        \mbox{text-indent:-\rndprintlength{\hangingindent}}%
+        \LWR at origmbox{margin-left:\rndprintlength{\LWR at templengthone}} ; %
+        \LWR at origmbox{text-indent:-\rndprintlength{\hangingindent}}%
     ]%
     {hangingpar}%
 }
@@ -31083,9 +32410,9 @@
     \renewcommand*{\LWR at printopenlist}{%
         \LWR at findhangingleftmargin%
         \uselengthunit{PT}%
-        ul style="\mbox{list-style-type:none;} %
-        \mbox{margin-left:\rndprintlength{\LWR at templengthone}} ; %
-        \mbox{text-indent:-\rndprintlength{\hangingindent}}"%
+        ul style="\LWR at origmbox{list-style-type:none;} %
+        \LWR at origmbox{margin-left:\rndprintlength{\LWR at templengthone}} ; %
+        \LWR at origmbox{text-indent:-\rndprintlength{\hangingindent}}"%
     }%
     \let\item\LWR at itemizeitem%
     \list{}{}%
@@ -31104,8 +32431,8 @@
     \BlockClass[%
         \LWR at findhangingleftmargin%
         \uselengthunit{PT}%
-        \mbox{margin-left:\rndprintlength{\LWR at templengthone}} ; %
-        \mbox{text-indent:-\rndprintlength{\hangingindent}}%
+        \LWR at origmbox{margin-left:\rndprintlength{\LWR at templengthone}} ; %
+        \LWR at origmbox{text-indent:-\rndprintlength{\hangingindent}}%
     ]{labeledpar}#2%
 }
 {\endBlockClass}
@@ -31171,8 +32498,8 @@
 {%
     \uselengthunit{PT}%
     \BlockClass[%
-        \mbox{margin-left:\rndprintlength{#1}} ; %
-        \mbox{text-indent:-\rndprintlength{#1}}%
+        \LWR at origmbox{margin-left:\rndprintlength{#1}} ; %
+        \LWR at origmbox{text-indent:-\rndprintlength{#1}}%
     ]%
     {hangingpar}%
 }
@@ -31201,8 +32528,67 @@
 %
 %
 %
+% \iffalse
+%<*hypcap>
+% \fi
 %
+% \part{lwarp-hypcap.sty}
+%
+% \section{hypcap}
+%
+% \DescribePackage{hypcap}
+% \pkg{hypcap} is ignored.
+%
+% \changes{v0.48}{2018/02/07}{\pkg{hypcap}: Added.}
+%
+% \codehtml
+%
+%    \begin{macrocode}
+\LWR at ProvidesPackageDrop{hypcap}
+%    \end{macrocode}
+%
+%    \begin{macrocode}
+\newcommand*{\capstart}{}
+\newcommand*{\hypcapspace}{}
+\newcommand*{\hypcapredef}[1]{}
+\newcommand*{\capstartfalse}{}
+\newcommand*{\capstarttrue}{}
+%    \end{macrocode}
+%
 % \iffalse
+%</hypcap>
+% \fi
+%
+%
+%
+%
+% \iffalse
+%<*hypernat>
+% \fi
+%
+% \part{lwarp-hypernat.sty}
+%
+% \section{hypernat}
+%
+% \DescribePackage{hypernat}
+% \pkg{hypernat} is ignored.
+%
+% \changes{v0.48}{2018/02/07}{\pkg{hypernat}: Added.}
+%
+% \codehtml
+%
+%    \begin{macrocode}
+\LWR at ProvidesPackageDrop{hypernat}
+%    \end{macrocode}
+%
+% \iffalse
+%</hypernat>
+% \fi
+%
+%
+%
+%
+% \iffalse
 %<*hyperref>
 % \fi
 
@@ -31411,8 +32797,9 @@
 
 % \begin{noindmacro}{\texorpdfstring} \marg{\TeX{}string} \marg{PDFstring}
 %
+% \changes{v0.48}{2018/02/02}{\pkg{hyperref}: \cs{texorpdfstring} now uses the \TeX\ string.}
 %    \begin{macrocode}
-\newcommand{\texorpdfstring}[2]{#2}
+\newcommand{\texorpdfstring}[2]{#1}
 %    \end{macrocode}
 % \end{noindmacro}
 
@@ -32632,8 +34019,18 @@
 \newcommand{\ext at todo}{tdo}
 
 \renewcommand{\l at todo}[2]{\hypertocfloat{1}{todo}{ldo}{#1}{#2}}
+%    \end{macrocode}
+%
+% \changes{v0.48}{2018/02/12}{\pkg{luatodonotes}: Improved \cs{todototoc}.}
+%    \begin{macrocode}
+\let\LWRTODONOTES at orig@todototoc\todototoc
 
+\renewcommand*{\todototoc}{%
+\phantomsection%
+\LWRTODONOTES at orig@todototoc%
+}
 
+
 \renewcommand{\@todonotes at drawMarginNoteWithLine}{%
 \fcolorbox
     {\@todonotes at currentbordercolor}
@@ -33666,7 +35063,7 @@
 % \changes{v0.47}{2018/01/26}{\pkg{midpage}: Fix: Line wrap at \HTML\ hyphen.}
 %    \begin{macrocode}
 \newenvironment{midpage}
-{\begin{BlockClass}[\mbox{margin-top:6ex} ; \mbox{margin-bottom:6ex}]{midpage}}
+{\begin{BlockClass}[\LWR at origmbox{margin-top:6ex} ; \LWR at origmbox{margin-bottom:6ex}]{midpage}}
 {\end{BlockClass}}
 %    \end{macrocode}
 %
@@ -34013,15 +35410,15 @@
 % The vertical alignment, if given:
 %    \begin{macrocode}
 \IfValueT{#1}{%
-\ifstrequal{#1}{b}{style="\mbox{vertical-align:bottom}" }{}%
-\ifstrequal{#1}{t}{style="\mbox{vertical-align:top}" }{}%
+\ifstrequal{#1}{b}{style="\LWR at origmbox{vertical-align:bottom}" }{}%
+\ifstrequal{#1}{t}{style="\LWR at origmbox{vertical-align:top}" }{}%
 }%
 %    \end{macrocode}
 % The left/right border, if given:
 %    \begin{macrocode}
 \ifdefvoid{\LWR at multirowborder}{}{%
-style="\mbox{border-\LWR at multirowborder:} 2px dotted black ; %
-\mbox{padding-\LWR at multirowborder:} 2px" %
+style="\LWR at origmbox{border-\LWR at multirowborder:} 2px dotted black ; %
+\LWR at origmbox{padding-\LWR at multirowborder:} 2px" %
 }%
 %    \end{macrocode}
 % A class adds the column spec and the rule:
@@ -34045,6 +35442,7 @@
 %    \begin{macrocode}
 \LWR at tdstartstyles%
 \LWR at addcmidrulewidth%
+\LWR at addtabularrulecolors%
 \LWR at tdendstyles%
 }%
 %    \end{macrocode}
@@ -34743,7 +36141,7 @@
 \newcommand{\LWR at inctheorem}{%
 \addtocounter{LWR at thisautoid}{1}%
 \LWR at stoppars%
-\LWR at htmltag{a id="\mbox{autoid-\arabic{LWR at thisautoid}}"}\LWR at htmltag{/a}%
+\LWR at htmltag{a id="\LWR at origmbox{autoid-\arabic{LWR at thisautoid}}"}\LWR at htmltag{/a}%
 \LWR at startpars%
 }
 %    \end{macrocode}
@@ -35750,8 +37148,8 @@
 
 \newcommand*{\LWR at setrealscriptsalign}[1]{%
 \renewcommand*{\LWR at realscriptsalign}{}%
-\ifthenelse{\equal{#1}{c}}{\renewcommand{\LWR at realscriptsalign}{\mbox{text-align:center} ; }}{}%
-\ifthenelse{\equal{#1}{r}}{\renewcommand{\LWR at realscriptsalign}{\mbox{text-align:right} ; }}{}%
+\ifthenelse{\equal{#1}{c}}{\renewcommand{\LWR at realscriptsalign}{\LWR at origmbox{text-align:center} ; }}{}%
+\ifthenelse{\equal{#1}{r}}{\renewcommand{\LWR at realscriptsalign}{\LWR at origmbox{text-align:right} ; }}{}%
 }
 
 \DeclareDocumentCommand \textsubsuperscript {s O{l} mm} {%
@@ -36178,12 +37576,12 @@
 \DeclareDocumentCommand{\raggedfootnote}{}{}
 
 \DeclareDocumentCommand{\dictum}{o m}{
-\begin{LWR at BlockClassWP}{\mbox{text-align:right}}{}{dictum}
+\begin{LWR at BlockClassWP}{\LWR at origmbox{text-align:right}}{}{dictum}
     #2
     \IfValueT{#1}
     {
         \ifbool{FormatWP}
-        {\begin{BlockClass}[\mbox{border-top:} 1px solid gray]{dictumauthor}}
+        {\begin{BlockClass}[\LWR at origmbox{border-top:} 1px solid gray]{dictumauthor}}
         {\begin{BlockClass}{dictumauthor}}
         \dictumauthorformat{#1}
         \end{BlockClass}
@@ -36224,15 +37622,15 @@
 \ifblank{#2}
 {
     \begin{BlockClass}[
-        \mbox{margin-left:\rndprintlength{\LWR at templengthtwo}} ;
-        \mbox{margin-right:\rndprintlength{\LWR at templengthtwo}}
+        \LWR at origmbox{margin-left:\rndprintlength{\LWR at templengthtwo}} ;
+        \LWR at origmbox{margin-right:\rndprintlength{\LWR at templengthtwo}}
     ]{addmargin}
 }
 {
     \setlength{\LWR at templengthone}{#2}
     \begin{BlockClass}[
-        \mbox{margin-left:\rndprintlength{\LWR at templengthone}} ;
-        \mbox{margin-right:\rndprintlength{\LWR at templengthtwo}}
+        \LWR at origmbox{margin-left:\rndprintlength{\LWR at templengthone}} ;
+        \LWR at origmbox{margin-right:\rndprintlength{\LWR at templengthtwo}}
     ]{addmargin}
 }
 }
@@ -37027,19 +38425,62 @@
 \DeclareSIUnit\hartree{\textit{E}\textsubscript{h}}
 }% AtBeginDocument
 %    \end{macrocode}
-
-% \changes{v0.42}{2017/10/16}{\pkg{siunitx}: Improved \cs{ensuremath}.}
-% The following is executed by \pkg{siunitx} at the end of \cs{document}.
+%
 % \cs{@ensuredmath} is not supported inside an \cs{hbox}, so it must
 % temporarily be restored to its original.
+% Similar for \cs{mbox}.
+% SVG math is created explicitly when necessary, using \cs{LWR at subsingledollar}.
+%
+% \changes{v0.42}{2017/10/16}{\pkg{siunitx}: Improved \cs{ensuremath}.}
+% \changes{v0.48}{2018/02/13}{\pkg{siunitx}: Improved \SVG\ math.}
 %    \begin{macrocode}
+
 \ExplSyntaxOn
+%
+%    \end{macrocode}
+% Modified to set set \HTML\ \cs{textcolor} if not black:
+% \changes{v0.48}{2018/02/14}{\pkg{siunitx}: Improved color output.}
+%    \begin{macrocode}
+\cs_undefine:N \__siunitx_print_aux:
+\cs_new_protected:Npn \__siunitx_print_aux:
+  {
+    \text
+      {
+        \__siunitx_ensure_ltr:n
+          {
+            \color at begingroup
+            \__siunitx_print_color:
+            \__siunitx_font_shape:
+            \__siunitx_font_weight:
+            \use:c
+              {
+                @@_ \l__siunitx_print_type_tl _
+                text \l__siunitx_font_family_tl :
+              }
+            \bool_if:NTF \l__siunitx_font_math_mode_bool
+              { \__siunitx_print_math: }
+              {
+                \LWR at findcurrenttextcolor% lwarp
+                \ifdefstring{\LWR at tempcolor}{000000}% lwarp
+                {\__siunitx_print_text:}% lwarp
+                {% lwarp
+                    \LWR at textcurrentcolor{% lwarp
+                        \__siunitx_print_text:
+                    }% lwarp
+                }% lwarp
+              }
+            \color at endgroup
+          }
+      }
+  }
+
+
 \cs_undefine:N \__siunitx_set_math_fam:n
 \cs_new_protected:Npn \__siunitx_set_math_fam:n #1 {
-    \LWR at traceinfo{sunitx set math fam}
   \int_new:c { c__siunitx_math #1 _int }
-  \group_begin:
-    \LetLtxMacro\@ensuredmath\LWR at origensuredmath
+  \group_begin:% lwarp
+    \LetLtxMacro\@ensuredmath\LWR at origensuredmath% lwarp
+    \LetLtxMacro\mbox\LWR at origmbox% lwarp
     \hbox_set:Nn \l__siunitx_tmp_box
       {
         \ensuremath
@@ -37050,14 +38491,14 @@
               }
           }
       }
-  \group_end:
-    \LWR at traceinfo{sunitx set math fam: done}
+  \group_end:% lwarp
 }
 
 \cs_undefine:N \__siunitx_combined_output:n
 \cs_new_protected:Npn \__siunitx_combined_output:n #1 {
-    \group_begin:
-    \LetLtxMacro\@ensuredmath\LWR at origensuredmath
+    \group_begin:% lwarp
+    \LetLtxMacro\@ensuredmath\LWR at origensuredmath% lwarp
+    \LetLtxMacro\mbox\LWR at origmbox% lwarp
   \bool_if:NTF \l__siunitx_number_parse_bool
     {
       \tl_clear:N \l__siunitx_number_out_tl
@@ -37066,12 +38507,123 @@
     }
     {
       \__siunitx_unit_output_pre_print:
-      \__siunitx_print:nn { number } { \ensuremath {#1} }
+%    \end{macrocode}
+% For |parse-numbers=false|, since \cs{ensuredmath} was restored to its original:
+% \changes{v0.48}{2018/02/14}{\pkg{siunitx}: Improved \SVG\ math.}
+%    \begin{macrocode}
+%       \__siunitx_print:nn { number } { \ensuremath {#1} }
+      \LWR at subsingledollar{\__siunitx_print:nn { number } { #1 }}% lwarp
+%    \end{macrocode}
+%    \begin{macrocode}
       \__siunitx_unit_output_print:
     }
-    \group_end:
+    \group_end:% lwarp
 }
+%
+%    \end{macrocode}
+% For quotients, the fraction code is replaced by the symbol code:
+% \changes{v0.48}{2018/02/14}{\pkg{siunitx}: Changes fraction to symbol.}
+%    \begin{macrocode}
+\cs_undefine:N \__siunitx_number_output_quotient_fraction:
+\cs_new_protected:Npn \__siunitx_number_output_quotient_fraction: {
+  \bool_set_true:N \l__siunitx_number_compound_bool
+  \__siunitx_number_output_quotient_aux_i:
+  \tl_set_eq:NN \l__siunitx_number_out_tl
+    \l__siunitx_number_numerator_tl
+  \tl_put_right:NV \l__siunitx_number_out_tl \l__siunitx_output_quotient_tl
+  \tl_put_right:NV \l__siunitx_number_out_tl
+    \l__siunitx_number_denominator_tl
+  \__siunitx_number_output_single_aux:
+}
+%
+%    \end{macrocode}
+% For units, the fraction code is replaced by the symbol code:
+% \changes{v0.48}{2018/02/14}{\pkg{siunitx}: Changes fraction to symbol.}
+%    \begin{macrocode}
+\cs_undefine:N \__siunitx_unit_format_fraction_fraction:
+\cs_new_protected:Npn \__siunitx_unit_format_fraction_fraction: {
+  \__siunitx_unit_format_fraction_symbol_aux:
+  \int_compare:nNnT { \l__siunitx_unit_denominator_int } > { 1 }
+    {
+      \bool_if:NT \l__siunitx_unit_denominator_bracket_bool
+        {
+          \tl_put_left:NV \l__siunitx_unit_denominator_tl \l__siunitx_bracket_open_tl
+          \tl_put_right:NV \l__siunitx_unit_denominator_tl \l__siunitx_bracket_close_tl
+        }
+    }
+  \tl_set_eq:NN \l__siunitx_unit_tl \l__siunitx_unit_numerator_tl
+  \tl_put_right:NV \l__siunitx_unit_tl \l__siunitx_per_symbol_tl
+  \tl_put_right:NV \l__siunitx_unit_tl \l__siunitx_unit_denominator_tl
+}
 
+
+
+\RenewDocumentCommand \num { o m } {
+  \leavevmode
+  \group_begin:% lwarp
+    \LetLtxMacro\@ensuredmath\LWR at origensuredmath% lwarp
+    \LetLtxMacro\mbox\LWR at origmbox% lwarp
+    \bool_set_false:N \l__siunitx_font_set_bool
+    \IfNoValueF {#1}
+      { \keys_set:nn { siunitx } {#1} }
+    \__siunitx_number_output:n {#2}
+  \group_end:% lwarp
+}
+
+\RenewDocumentCommand \numrange { o m m } {
+  \leavevmode
+  \group_begin:% lwarp
+    \LetLtxMacro\@ensuredmath\LWR at origensuredmath% lwarp
+    \LetLtxMacro\mbox\LWR at origmbox% lwarp
+    \bool_set_false:N \l__siunitx_font_set_bool
+    \IfNoValueF {#1}
+      { \keys_set:nn { siunitx } {#1} }
+    \__siunitx_range_numbers:nn {#2} {#3}
+  \group_end:% lwarp
+}
+
+\RenewDocumentCommand \ang { o > { \SplitArgument { 2 } { ; } } m } {
+  \group_begin:% lwarp
+    \LetLtxMacro\@ensuredmath\LWR at origensuredmath% lwarp
+    \LetLtxMacro\mbox\LWR at origmbox% lwarp
+    \IfNoValueF {#1}
+      { \keys_set:nn { siunitx } {#1} }
+    \__siunitx_angle_output:nnn #2
+  \group_end:% lwarp
+}
+
+\RenewDocumentCommand \si { o m } {
+  \leavevmode
+  \group_begin:% lwarp
+    \LetLtxMacro\@ensuredmath\LWR at origensuredmath% lwarp
+    \LetLtxMacro\mbox\LWR at origmbox% lwarp
+    \bool_set_false:N \l__siunitx_font_set_bool
+    \IfNoValueTF {#1}
+      { \__siunitx_unit_output:nn {#2} { } }
+      {
+        \keys_set:nn { siunitx } {#1}
+        \__siunitx_unit_output:nn {#2} {#1}
+      }
+  \group_end:% lwarp
+}
+
+
+\RenewDocumentCommand{\SIrange}{o m m m}
+{%
+  \leavevmode
+  \group_begin:% lwarp
+    \LetLtxMacro\@ensuredmath\LWR at origensuredmath% lwarp
+    \LetLtxMacro\mbox\LWR at origmbox% lwarp
+    \bool_set_false:N \l__siunitx_font_set_bool
+    \IfNoValueTF {#1}
+      { \__siunitx_range_unit:nnnn {#4} { } {#2} {#3} }
+      {
+        \keys_set:nn { siunitx } {#1}
+        \__siunitx_range_unit:nnnn {#4} {#1} {#2} {#3}
+      }
+  \group_end:% lwarp
+}
+
 \ExplSyntaxOff
 %    \end{macrocode}
 
@@ -37341,8 +38893,41 @@
 %
 %
 %
+% \iffalse
+%<*stfloats>
+% \fi
 %
+% \part{lwarp-stfloats.sty}
+%
+% \section{stfloats}
+%
+% \DescribePackage{stfloats}
+% \pkg{stfloats} is ignored.
+%
+% \changes{v0.48}{2018/02/07}{\pkg{stfloats}: Added.}
+%
+% \codehtml
+%
+%    \begin{macrocode}
+\LWR at ProvidesPackageDrop{stfloats}
+%    \end{macrocode}
+%
+%    \begin{macrocode}
+\newcommand*{\fnbelowfloat}{}
+\newcommand*{\fnunderfloat}{}
+\newcommand*{\setbaselinefloat}{}
+\newcommand*{\setbaselinefixed}{}
+%    \end{macrocode}
+%
 % \iffalse
+%</stfloats>
+% \fi
+%
+%
+%
+%
+%
+% \iffalse
 %<*subfig>
 % \fi
 
@@ -38660,7 +40245,7 @@
 
 
 % \begin{environment}{tikzpicture}
-% |tikzpicture| environment is enclosed inside a |\lateximage|.
+% |tikzpicture| environment is enclosed inside a \cs{lateximage}.
 % May be used as-is, and its contents will be converted to an image.
 %
 % \changes{v0.13}{2016/03/23}{Fix dollar-redefined bug for newer package.}
@@ -39411,7 +40996,7 @@
 % Print the text:
 %    \begin{macrocode}
 ##1%
-}%
+}% \@makefntext
 }
 %    \end{macrocode}
 % \end{macro}
@@ -39444,7 +41029,7 @@
 %    \begin{macrocode}
 \@maketitle
 %    \end{macrocode}
-% Immediately generate any |\thanks| footnotes:
+% Immediately generate any \cs{thanks} footnotes:
 %    \begin{macrocode}
 \@thanks
 %    \end{macrocode}
@@ -39521,7 +41106,7 @@
 %    \begin{macrocode}
 \@maketitle
 %    \end{macrocode}
-% Immediately generate any |\thanks| footnotes:
+% Immediately generate any \cs{thanks} footnotes:
 %    \begin{macrocode}
 \@thanks
 %    \end{macrocode}
@@ -39537,7 +41122,7 @@
 % \begin{macro}{\thanksmarkseries} \marg{series}
 % \changes{v0.39}{2017/09/03}{Removed minipage footnotes.}
 %
-% Sets the type of footnote marks used by |\thanks|,
+% Sets the type of footnote marks used by \cs{thanks},
 % where type is `arabic', `roman', `fnsymbol', etc.
 %    \begin{macrocode}
 \renewcommand{\thanksmarkseries}[1]{%
@@ -40252,7 +41837,16 @@
 \newcommand{\ext at todo}{tdo}
 
 \renewcommand{\l at todo}[2]{\hypertocfloat{1}{todo}{ldo}{#1}{#2}}
+%    \end{macrocode}
+%
+% \changes{v0.48}{2018/02/12}{\pkg{todonotes}: Improved \cs{todototoc}.}
+%    \begin{macrocode}
+\let\LWRTODONOTES at orig@todototoc\todototoc
 
+\renewcommand*{\todototoc}{%
+\phantomsection%
+\LWRTODONOTES at orig@todototoc%
+}
 
 \renewcommand{\@todonotes at drawMarginNoteWithLine}{
 \fcolorbox
@@ -40572,6 +42166,13 @@
 %
 % \codehtml
 %
+%
+% Emulate the original package:
+%    \begin{macrocode}
+\ProvidesPackage{lwarp-ulem}
+%    \end{macrocode}
+%
+%
 % Original \pkg{lwarp} definitions:
 %    \begin{macrocode}
 \LetLtxMacro\LWR at ulemorigemph\emph
@@ -40672,12 +42273,11 @@
 \DeclareOption{ULforem}{\ULforem}
 \DeclareOption{normalbf}{}
 \DeclareOption{UWforbf}{\useunder{\uwave}{\bf}{\textbf}}
+
+\DeclareOption*{}
+\ProcessOptions\relax% original LaTeX code
 %    \end{macrocode}
 %
-% Emulate the original package:
-%    \begin{macrocode}
-\LWR at ProvidesPackageDrop{ulem}
-%    \end{macrocode}
 %
 % \iffalse
 %</ulem>
@@ -40765,7 +42365,7 @@
 % \DescribePackage{verse}\DescribeClass{memoir}\index{memoir>verse}
 % The \pkg{verse} or \pkg{memoir} packages can place stanza numbers to the left
 % with their \cs{flagverse} command. \DescribeMacro{\flagverse}
-% Do not allow them to go into the left margin, which would cause |pdfcrop|
+% Do not allow them to go into the left margin, which would cause \prog{pdfcrop}
 % to crop the entire page further to the left:
 % \DescribeLength{vleftskip}
 %    \begin{macrocode}
@@ -40808,8 +42408,50 @@
 %
 %
 %
+% \iffalse
+%<*vmargin>
+% \fi
 %
+% \part{lwarp-vmargin.sty}
+%
+% \section{vmargin}
+%
+% \DescribePackage{vmargin}
+% \pkg{vmargin} is ignored.
+%
+% \changes{v0.48}{2018/02/07}{\pkg{vmargin}: Added.}
+%
+% \codehtml
+%
+%    \begin{macrocode}
+\LWR at ProvidesPackageDrop{vmargin}
+%    \end{macrocode}
+%
+%    \begin{macrocode}
+\newcommand*{\LWRVM at customsize}[2]{}
+\newcommand*{\setpapersize}[2][]{\ifstrequal{#2}{custom}{\LWRVM at customsize}{}}
+\newcommand*{\setmargins}[8]{}
+\newcommand*{\setmarginsrb}[8]{}
+\newcommand*{\setmargnohf}[4]{}
+\newcommand*{\setmargnohfrb}[4]{}
+\newcommand*{\setmarg}[4]{}
+\newcommand*{\setmargrb}[4]{}
+\newlength{\PaperWidth}
+\setlength{\PaperWidth}{8.5in}
+\newlength{\PaperHeight}
+\setlength{\PaperHeight}{11in}
+\newif\ifLandscape
+%    \end{macrocode}
+%
 % \iffalse
+%</vmargin>
+% \fi
+%
+%
+%
+%
+%
+% \iffalse
 %<*wallpaper>
 % \fi
 
@@ -41052,7 +42694,7 @@
 % \item [\cs{color}:] \
 %	\begin{description}
 %		\item [Print:] Used as-is.
-%		\item [HTML:] Ignored by |pdftotext|, and will not appear.
+%		\item [HTML:] Ignored by \prog{pdftotext}, and will not appear.
 %		\item [HTML \env{lateximage}:] Colors will appear in a \env{lateximage}.
 %	\end{description}
 %
@@ -41221,8 +42863,7 @@
 % \end{noindmacro}
 %
 %
-% \begin{noindmacro}{\LWR at colorstyle}
-% \marg{1: styletext} \marg{2: model} \marg{3: color}
+% \begin{noindmacro}{\LWR at colorstyle} \marg{2: model} \marg{3: color}
 %
 % \changes{v0.19}{2016/06/01}{Supports colored \cs{rule}.}
 % \changes{v0.36}{2017/08/11}{\pkg{xcolor}: Refactored \cs{LWR at colorstyle}.}
@@ -41288,12 +42929,12 @@
 %
 % \DescribeMacro{\color}
 % \cs{color} appears in the \LaTeX{} \PDF\ output,
-% but is ignored by |pdftotext| and thus is ignored in the \HTML\ file.
+% but is ignored by \prog{pdftotext} and thus is ignored in the \HTML\ file.
 % Text styling by local group is not yet supported.
 %
 %
 %
-% Each of the following macros is given a temporary name, and is |\let| to the final
+% Each of the following macros is given a temporary name, and is \cs{let} to the final
 % name once the \HTML\ conversion starts.
 %
 % \label{sec:textcolor}
@@ -41317,7 +42958,7 @@
 % \begin{macro}{\pagecolor}
 % \oarg{model} \marg{color}
 %
-% Ignored.  Use |\CSSFilename| instead.
+% Ignored.  Use \CSS\ instead.
 %    \begin{macrocode}
 \renewcommand*{\pagecolor}[2][named]{}
 %    \end{macrocode}
@@ -41555,8 +43196,8 @@
 % \watchout[font size]
 % During \HTML\ conversion, this font is used by \pkg{lwarp}
 % to generate its initial \PDF\ output containing \HTML\ tags,
-% later to be converted by |pdftotext| to a plain text file.
-% While the text may be in any font which |pdftotext| can read, the math is
+% later to be converted by \prog{pdftotext} to a plain text file.
+% While the text may be in any font which \prog{pdftotext} can read, the math is
 % directly converted into \SVG\ images using this same user-selected font.
 % |xfrac| below is set for the Latin Modern (lmr) font.
 % If another font is used, it may be desirable to redefine
@@ -41630,17 +43271,25 @@
 %
 % Scaling is turned off so that \cmds{pdftotext} correctly reads the result.
 %
-% \changes{v0.16}{2016/04/07}{xfrac: Adjusted for the use of any font:}
+% \changes{v0.16}{2016/04/07}{\pkg{xfrac}: Adjusted for the use of any font:}
+% \changes{v0.48}{2018/02/13}{\pkg{xfrac}: Fix: Added groups around super/subscripts
+%           to localize \env{LWR at nestspan} changes.}
 %    \begin{macrocode}
 \DeclareInstance{xfrac}{default}{text}{
 numerator-format = {%
+\begingroup%
 \LetLtxMacro{\scalebox}{\LWR at noscalebox}%
-\LWR at htmlsmallfontstart\textsuperscript{#1}\,\LWR at htmlsmallfontend},
+\LWR at htmlsmallfontstart\textsuperscript{#1}\,\LWR at htmlsmallfontend%
+\endgroup%
+},
 denominator-format = {%
+\begingroup%
 \LetLtxMacro{\scalebox}{\LWR at noscalebox}%
-\LWR at htmlsmallfontstart{}\,#1\LWR at htmlsmallfontend},
+\LWR at htmlsmallfontstart{}\,#1\LWR at htmlsmallfontend%
+\endgroup%
+},
 %    \end{macrocode}
-% For |pdftotext|, do not scale the text:
+% For \prog{pdftotext}, do not scale the text:
 %    \begin{macrocode}
 scaling = false
 }
@@ -41647,13 +43296,19 @@
 
 \DeclareInstance{xfrac}{lmr}{text}{
 numerator-format = {%
+\begingroup%
 \LetLtxMacro{\scalebox}{\LWR at noscalebox}%
-\LWR at htmlsmallfontstart\textsuperscript{#1}\,\LWR at htmlsmallfontend},
+\LWR at htmlsmallfontstart\textsuperscript{#1}\,\LWR at htmlsmallfontend%
+\endgroup%
+},
 denominator-format = {%
+\begingroup%
 \LetLtxMacro{\scalebox}{\LWR at noscalebox}%
-\LWR at htmlsmallfontstart{}\,#1\LWR at htmlsmallfontend},
+\LWR at htmlsmallfontstart{}\,#1\LWR at htmlsmallfontend%
+\endgroup%
+},
 %    \end{macrocode}
-% For |pdftotext|, do not scale the text:
+% For \prog{pdftotext}, do not scale the text:
 %    \begin{macrocode}
 scaling = false
 }
@@ -41660,13 +43315,19 @@
 
 \DeclareInstance{xfrac}{lmss}{text}{
 numerator-format = {%
+\begingroup%
 \LetLtxMacro{\scalebox}{\LWR at noscalebox}%
-\LWR at htmlsmallfontstart\textsuperscript{#1}\,\LWR at htmlsmallfontend},
+\LWR at htmlsmallfontstart\textsuperscript{#1}\,\LWR at htmlsmallfontend%
+\endgroup%
+},
 denominator-format = {%
+\begingroup%
 \LetLtxMacro{\scalebox}{\LWR at noscalebox}%
-\LWR at htmlsmallfontstart{}\,#1\LWR at htmlsmallfontend},
+\LWR at htmlsmallfontstart{}\,#1\LWR at htmlsmallfontend%
+\endgroup%
+},
 %    \end{macrocode}
-% For |pdftotext|, do not scale the text:
+% For \prog{pdftotext}, do not scale the text:
 %    \begin{macrocode}
 scaling = false
 }
@@ -41673,19 +43334,30 @@
 
 \DeclareInstance{xfrac}{lmtt}{text}{
 numerator-format = {%
+\begingroup%
 \LetLtxMacro{\scalebox}{\LWR at noscalebox}%
-\LWR at htmlsmallfontstart\textsuperscript{#1}\,\LWR at htmlsmallfontend},
+\LWR at htmlsmallfontstart\textsuperscript{#1}\,\LWR at htmlsmallfontend%
+\endgroup%
+},
 denominator-format = {%
+\begingroup%
 \LetLtxMacro{\scalebox}{\LWR at noscalebox}%
-\LWR at htmlsmallfontstart{}\,#1\LWR at htmlsmallfontend},
+\LWR at htmlsmallfontstart{}\,#1\LWR at htmlsmallfontend%
+\endgroup%
+},
 %    \end{macrocode}
-% For |pdftotext|, do not scale the text:
+% For \prog{pdftotext}, do not scale the text:
 %    \begin{macrocode}
 scaling = false
 }
 %    \end{macrocode}
-%
+
+
 %    \begin{macrocode}
+%    \end{macrocode}
+
+
+%    \begin{macrocode}
 \end{warpHTML}
 %    \end{macrocode}
 %

Modified: trunk/Master/texmf-dist/source/latex/lwarp/lwarp.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/lwarp/lwarp.ins	2018-02-14 21:32:33 UTC (rev 46637)
+++ trunk/Master/texmf-dist/source/latex/lwarp/lwarp.ins	2018-02-14 21:33:05 UTC (rev 46638)
@@ -37,6 +37,8 @@
 \file{lwarp-a4wide.sty}{\from{lwarp.dtx}{a4wide}}
 \file{lwarp-a5comb.sty}{\from{lwarp.dtx}{a5comb}}
 \file{lwarp-abstract.sty}{\from{lwarp.dtx}{abstract}}
+\file{lwarp-acro.sty}{\from{lwarp.dtx}{acro}}
+\file{lwarp-acronym.sty}{\from{lwarp.dtx}{acronym}}
 \file{lwarp-adjmulticol.sty}{\from{lwarp.dtx}{adjmulticol}}
 \file{lwarp-addlines.sty}{\from{lwarp.dtx}{addlines}}
 \file{lwarp-afterpage.sty}{\from{lwarp.dtx}{afterpage}}
@@ -68,8 +70,10 @@
 \file{lwarp-changepage.sty}{\from{lwarp.dtx}{changepage}}
 \file{lwarp-chngpage.sty}{\from{lwarp.dtx}{chngpage}}
 \file{lwarp-chappg.sty}{\from{lwarp.dtx}{chappg}}
+\file{lwarp-chapterbib.sty}{\from{lwarp.dtx}{chapterbib}}
 \file{lwarp-cite.sty}{\from{lwarp.dtx}{cite}}
 \file{lwarp-color.sty}{\from{lwarp.dtx}{color}}
+\file{lwarp-colortbl.sty}{\from{lwarp.dtx}{colortbl}}
 \file{lwarp-continue.sty}{\from{lwarp.dtx}{continue}}
 \file{lwarp-crop.sty}{\from{lwarp.dtx}{crop}}
 \file{lwarp-cuted.sty}{\from{lwarp.dtx}{cuted}}
@@ -92,6 +96,7 @@
 \file{lwarp-everyshi.sty}{\from{lwarp.dtx}{everyshi}}
 \file{lwarp-extramarks.sty}{\from{lwarp.dtx}{extramarks}}
 \file{lwarp-fancybox.sty}{\from{lwarp.dtx}{fancybox}}
+\file{lwarp-fancyheadings.sty}{\from{lwarp.dtx}{fancyheadings}}
 \file{lwarp-fancyhdr.sty}{\from{lwarp.dtx}{fancyhdr}}
 \file{lwarp-fancyref.sty}{\from{lwarp.dtx}{fancyref}}
 \file{lwarp-fancyvrb.sty}{\from{lwarp.dtx}{fancyvrb}}
@@ -126,6 +131,8 @@
 \file{lwarp-grffile.sty}{\from{lwarp.dtx}{grffile}}
 \file{lwarp-hang.sty}{\from{lwarp.dtx}{hang}}
 \file{lwarp-hanging.sty}{\from{lwarp.dtx}{hanging}}
+\file{lwarp-hypcap.sty}{\from{lwarp.dtx}{hypcap}}
+\file{lwarp-hypernat.sty}{\from{lwarp.dtx}{hypernat}}
 \file{lwarp-hyperref.sty}{\from{lwarp.dtx}{hyperref}}
 \file{lwarp-hyperxmp.sty}{\from{lwarp.dtx}{hyperxmp}}
 \file{lwarp-idxlayout.sty}{\from{lwarp.dtx}{idxlayout}}
@@ -210,6 +217,7 @@
 \file{lwarp-soulpos.sty}{\from{lwarp.dtx}{soulpos}}
 \file{lwarp-soulutf8.sty}{\from{lwarp.dtx}{soulutf8}}
 \file{lwarp-stabular.sty}{\from{lwarp.dtx}{stabular}}
+\file{lwarp-stfloats.sty}{\from{lwarp.dtx}{stfloats}}
 \file{lwarp-subfig.sty}{\from{lwarp.dtx}{subfig}}
 \file{lwarp-subfigure.sty}{\from{lwarp.dtx}{subfigure}}
 \file{lwarp-supertabular.sty}{\from{lwarp.dtx}{supertabular}}
@@ -242,6 +250,7 @@
 \file{lwarp-ulem.sty}{\from{lwarp.dtx}{ulem}}
 \file{lwarp-upref.sty}{\from{lwarp.dtx}{upref}}
 \file{lwarp-verse.sty}{\from{lwarp.dtx}{verse}}
+\file{lwarp-vmargin.sty}{\from{lwarp.dtx}{vmargin}}
 \file{lwarp-wallpaper.sty}{\from{lwarp.dtx}{wallpaper}}
 \file{lwarp-watermark.sty}{\from{lwarp.dtx}{watermark}}
 \file{lwarp-wrapfig.sty}{\from{lwarp.dtx}{wrapfig}}

Added: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-acro.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-acro.sty	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-acro.sty	2018-02-14 21:33:05 UTC (rev 46638)
@@ -0,0 +1,83 @@
+%%
+%% This is file `lwarp-acro.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% lwarp.dtx  (with options: `acro')
+%% This is a generated file.
+%% Copyright 2016-2018 Brian Dunn
+%% 
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%%   http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+
+\LWR at ProvidesPackagePass{acro}
+
+\ExplSyntaxOn
+\NewDocumentCommand \LWR at DeclareAcronym {mm}
+{
+    \acro_declare_acronym:nn {#1} {#2}
+    \catcode`\$=3% lwarp
+}
+\ExplSyntaxOff
+
+\RenewDocumentCommand{\DeclareAcronym}{}{
+    \catcode`\$=\active% lwarp
+    \LWR at DeclareAcronym
+}
+
+\ExplSyntaxOn
+\cs_gset_protected:Npn \acro_write_short:nn #1#2
+  {
+    \mode_if_horizontal:F { \leavevmode }
+    \group_begin:
+      \bool_if:NTF \l__acro_custom_format_bool
+        { \l__acro_custom_format_tl }
+        { \l__acro_short_format_tl }
+      {\LWR at textcurrentfont{#2}}% lwarp
+    \group_end:
+  }
+
+\cs_gset_protected:Npn \acro_write_alt:nn #1#2
+  {
+    \mode_if_horizontal:F { \leavevmode }
+    \group_begin:
+      \bool_if:NTF \l__acro_custom_format_bool
+        { \l__acro_custom_format_tl }
+        { \l__acro_alt_format_tl }
+      {\LWR at textcurrentfont{#2}}% lwarp
+    \group_end:
+  }
+
+\cs_gset_protected:Npn \acro_write_long:nn #1#2
+  {
+    \mode_if_horizontal:F { \leavevmode }
+    \group_begin:
+      \bool_if:NTF \l__acro_custom_long_format_bool
+        { \l__acro_custom_long_format_tl }
+        { \use:n }
+      {
+        \use:x
+          {
+            \exp_not:n {#1}
+            {
+              \bool_if:NTF \l__acro_first_upper_bool
+                { \exp_not:N \__acro_first_upper_case:n { \exp_not:n {
+                    \LWR at textcurrentfont{#2}% lwarp
+                } } }
+                { \exp_not:n {\LWR at textcurrentfont{#2}} }% lwarp
+            }
+          }
+      }
+    \group_end:
+  }
+\ExplSyntaxOff
+
+\endinput
+%%
+%% End of file `lwarp-acro.sty'.


Property changes on: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-acro.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-acronym.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-acronym.sty	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-acronym.sty	2018-02-14 21:33:05 UTC (rev 46638)
@@ -0,0 +1,63 @@
+%%
+%% This is file `lwarp-acronym.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% lwarp.dtx  (with options: `acronym')
+%% This is a generated file.
+%% Copyright 2016-2018 Brian Dunn
+%% 
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%%   http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+
+\LWR at ProvidesPackagePass{acronym}
+
+\renewcommand{\acfia}[1]{%
+  {\textit{\AC at acl{#1}}} (\ifAC at starred\acs*{#1}\else\acs{#1}\fi)}
+
+\renewcommand*\AC at acs[1]{%
+ \expandafter\AC at get\csname fn@#1\endcsname\@firstoftwo{#1}}
+
+\renewcommand*\AC at und@newl at bel[3]{%
+    \@ifundefined{#1@#3}%
+    {%
+        \global\expandafter\let\csname#2@#3\endcsname\@nnil
+        \global\expandafter\let\csname#2@#3 at cref\endcsname\@nnil% lwarp
+    }%
+    {%
+        \global\expandafter\let\csname#1@#3\endcsname\relax
+        \global\expandafter\let\csname#1@#3 at cref\endcsname\relax% lwarp
+        \global\expandafter\let\csname Z at R@#3\endcsname\relax% lwarp
+    }%
+}%
+
+\renewcommand*\AC at testdef[3]{%
+\ifstrequal{#1}{Z at R}{}{% lwarp
+  \@ifundefined{s@#2}\@secondoftwo\@firstofone
+  {%
+    \expandafter\ifx\csname s@#2\endcsname\empty
+      \expandafter\@firstofone
+    \else
+      \expandafter\xdef\csname s@#2\endcsname{%
+        \expandafter\expandafter
+        \expandafter\@gobble
+        \csname s@#2\endcsname
+      }%
+      \expandafter\@gobble
+    \fi
+  }%
+  {%
+    \@testdef{#1}{#2}{#3}%
+  }%
+}% lwarp
+}%
+
+\endinput
+%%
+%% End of file `lwarp-acronym.sty'.


Property changes on: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-acronym.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-adjmulticol.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-adjmulticol.sty	2018-02-14 21:32:33 UTC (rev 46637)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-adjmulticol.sty	2018-02-14 21:33:05 UTC (rev 46638)
@@ -29,8 +29,8 @@
 \LWR at forcenewpage%
 \uselengthunit{PT}%
 \BlockClass[%
-\mbox{margin-left:\rndprintlength{\LWR at templengthone}} ; %
-\mbox{margin-right:\rndprintlength{\LWR at templengthtwo}}%
+\LWR at origmbox{margin-left:\rndprintlength{\LWR at templengthone}} ; %
+\LWR at origmbox{margin-right:\rndprintlength{\LWR at templengthtwo}}%
 ]{\LWR at mcolstype}%
 }
 {\endBlockClass}

Modified: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-array.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-array.sty	2018-02-14 21:32:33 UTC (rev 46637)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-array.sty	2018-02-14 21:33:05 UTC (rev 46638)
@@ -24,8 +24,8 @@
 \let\lasthline\LWR at origlasthline%
 }
 
-\renewcommand*{\firsthline}{\LWR at hline}%
-\renewcommand*{\lasthline}{\LWR at hline}%
+\renewcommand*{\firsthline}{\LWR at HTMLhline}%
+\renewcommand*{\lasthline}{\LWR at HTMLhline}%
 \endinput
 %%
 %% End of file `lwarp-array.sty'.

Modified: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-caption.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-caption.sty	2018-02-14 21:32:33 UTC (rev 46637)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-caption.sty	2018-02-14 21:33:05 UTC (rev 46638)
@@ -91,7 +91,7 @@
     \let\caption at lsep\@empty
     \let\caption at tfmt\@firstofone
   }%
-    \renewcommand{\@@par}{\LWR at closeparagraph\LWR at orig@@par}% lwarp
+  \@setpar{\LWR at closeparagraph\@@par}% lwarp
   \caption at applyfont
   \caption at fmt
     {\ifcaption at star\else

Added: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-chapterbib.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-chapterbib.sty	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-chapterbib.sty	2018-02-14 21:33:05 UTC (rev 46638)
@@ -0,0 +1,26 @@
+%%
+%% This is file `lwarp-chapterbib.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% lwarp.dtx  (with options: `chapterbib')
+%% This is a generated file.
+%% Copyright 2016-2018 Brian Dunn
+%% 
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%%   http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+
+\LWR at ProvidesPackagePass{chapterbib}
+
+\xdef\@savedjobname{\BaseJobname}
+\let\@currentipfile\@savedjobname
+
+\endinput
+%%
+%% End of file `lwarp-chapterbib.sty'.


Property changes on: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-chapterbib.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-colortbl.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-colortbl.sty	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-colortbl.sty	2018-02-14 21:33:05 UTC (rev 46638)
@@ -0,0 +1,63 @@
+%%
+%% This is file `lwarp-colortbl.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% lwarp.dtx  (with options: `colortbl')
+%% This is a generated file.
+%% Copyright 2016-2018 Brian Dunn
+%% 
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%%   http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+\LWR at ProvidesPackagePass{colortbl}
+
+\LetLtxMacro\LWR at origcolumncolor\columncolor
+\LetLtxMacro\LWR at origrowcolor\rowcolor
+\LetLtxMacro\LWR at origcellcolor\cellcolor
+\LetLtxMacro\LWR at origarrayrulecolor\arrayrulecolor
+\LetLtxMacro\LWR at origdoublerulesepcolor\doublerulesepcolor
+
+\appto{\LWR at restoreorigformatting}{%
+\LetLtxMacro\columncolor\LWR at origcolumncolor
+\LetLtxMacro\rowcolor\LWR at origrowcolor
+\LetLtxMacro\cellcolor\LWR at origcellcolor
+\LetLtxMacro\arrayrulecolor\LWR at origarrayrulecolor
+\LetLtxMacro\doublerulesepcolor\LWR at origdoublerulesepcolor
+}
+
+\RenewDocumentCommand{\LWR at HTMLcolumncolor}{O{named} m o o}{%
+\convertcolorspec{#1}{#2}{HTML}\LWR at columnHTMLcolor%
+\LWR at addtabularcellcolor%
+}
+\RenewDocumentCommand{\LWR at HTMLrowcolor}{O{named} m o o}{%
+\convertcolorspec{#1}{#2}{HTML}\LWR at rowHTMLcolor%
+\LWR at getmynexttoken%
+}
+
+\RenewDocumentCommand{\LWR at HTMLcellcolor}{O{named} m o o}{%
+\convertcolorspec{#1}{#2}{HTML}\LWR at cellHTMLcolor%
+\LWR at addtabularcellcolor%
+}
+
+\renewcommand{\arrayrulecolor}[2][named]{%
+\convertcolorspec{#1}{#2}{HTML}\LWR at ruleHTMLcolor%
+}
+
+\renewcommand{\LWR at HTMLarrayrulecolor}[2][named]{%
+\convertcolorspec{#1}{#2}{HTML}\LWR at ruleHTMLcolor%
+\LWR at getmynexttoken%
+}
+
+\renewcommand{\doublerulesepcolor}[2][named]{}
+
+\renewcommand{\LWR at HTMLdoublerulesepcolor}[2][named]{\LWR at getmynexttoken}
+
+\endinput
+%%
+%% End of file `lwarp-colortbl.sty'.


Property changes on: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-colortbl.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-epigraph.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-epigraph.sty	2018-02-14 21:32:33 UTC (rev 46637)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-epigraph.sty	2018-02-14 21:33:05 UTC (rev 46638)
@@ -34,13 +34,13 @@
 
 \DeclareDocumentCommand{\epigraph}{m m}
 {
-\begin{LWR at BlockClassWP}{\mbox{text-align:right}}{}{epigraph}
+\begin{LWR at BlockClassWP}{\LWR at origmbox{text-align:right}}{}{epigraph}
 \qitem{#1}{#2}
 \end{LWR at BlockClassWP}
 }
 
 \DeclareDocumentEnvironment{epigraphs}{}
-{\LWR at BlockClassWP{\mbox{text-align:right}}{}{epigraph}}
+{\LWR at BlockClassWP{\LWR at origmbox{text-align:right}}{}{epigraph}}
 {\endLWR at BlockClassWP}
 \newenvironment*{flushepinormal}{}{}
 \@ifclassloaded{memoir}{

Added: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-fancyheadings.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-fancyheadings.sty	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-fancyheadings.sty	2018-02-14 21:33:05 UTC (rev 46638)
@@ -0,0 +1,21 @@
+%%
+%% This is file `lwarp-fancyheadings.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% lwarp.dtx  (with options: `fancyheadings')
+%% This is a generated file.
+%% Copyright 2016-2018 Brian Dunn
+%% 
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%%   http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+\LWR at loadnever{fancyheadings}{fancyhdr}
+\endinput
+%%
+%% End of file `lwarp-fancyheadings.sty'.


Property changes on: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-fancyheadings.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-fancyref.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-fancyref.sty	2018-02-14 21:32:33 UTC (rev 46637)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-fancyref.sty	2018-02-14 21:33:05 UTC (rev 46638)
@@ -15,56 +15,38 @@
 %%   http://www.latex-project.org/lppl.txt
 %% and version 1.3 or later is part of all distributions of LaTeX
 %% version 2005/12/01 or later.
-\LWR at ProvidesPackageDrop{fancyref}
-\newcommand*{\fancyrefhook}[1]{#1}
-\newcommand*{\fref}[2][]{\cref{#2}}
-\newcommand*{\Fref}[2][]{\Cref{#2}}
-\newcommand*{\fancyrefchaplabelprefix}{chap}
-\newcommand*{\fancyrefenumlabelprefix}{enum}
-\newcommand*{\fancyrefeqlabelprefix}{eq}
-\newcommand*{\fancyreffiglabelprefix}{fig}
-\newcommand*{\fancyreffnlabelprefix}{fn}
-\newcommand*{\fancyrefseclabelprefix}{sec}
-\newcommand*{\fancyreftablabelprefix}{tab}
-\newcommand*{\fancyrefchangeprefix}[2]{}
-\newcommand*{\fancyrefargdelim}{:}
-\newcommand*{\fancyrefloosespacing}{~}
-\newcommand*{\fancyreftightspacing}{\,}
-\newcommand*{\fancyrefdefaultspacing}{\fancyrefloosespacing}
-\providecommand*{\chaptername}{Chapter}
-\providecommand*{\figurename}{Figure}
-\providecommand*{\pagename}{Page}
-\providecommand*{\tablename}{Table}
-\renewcommand*{\Frefchapname}{\chaptername}
-\renewcommand*{\Frefenumname}{Item}
-\renewcommand*{\Frefeqname}{Equation}
-\renewcommand*{\Freffigname}{\figurename}
-\renewcommand*{\Freffnname}{Footnote}
-\renewcommand*{\Frefonname}{On}
-\renewcommand*{\Frefpgname}{\pagename}
-\renewcommand*{\Frefsecname}{Section}
-\renewcommand*{\Frefseename}{See}
-\renewcommand*{\Freftabname}{\tablename}
-\renewcommand*{\Freffigshortname}{Fig.}
-\renewcommand*{\Frefpgshortname}{P.}
-\renewcommand*{\Freftabshortname}{Tab.}
-\renewcommand*{\frefchapname}{\MakeLowercase{\Frefchapname}}
-\renewcommand*{\frefenumname}{\MakeLowercase{\Frefenumname}}
-\renewcommand*{\frefeqname}{\MakeLowercase{\Frefeqname}}
-\renewcommand*{\freffigname}{\MakeLowercase{\Freffigname}}
-\renewcommand*{\freffnname}{\MakeLowercase{\Freffnname}}
-\renewcommand*{\frefonname}{\MakeLowercase{\Frefonname}}
-\renewcommand*{\frefpgname}{\MakeLowercase{\Frefpgname}}
-\renewcommand*{\frefsecname}{\MakeLowercase{\Frefsecname}}
-\renewcommand*{\frefseename}{\MakeLowercase{\Frefseename}}
-\renewcommand*{\freftabname}{\MakeLowercase{\Freftabname}}
-\renewcommand*{\freffigshortname}{\MakeLowercase{\Freffigshortname}}
-\renewcommand*{\frefpgshortname}{\MakeLowercase{\Frefpgshortname}}
-\renewcommand*{\freftabshortname}{\MakeLowercase{\Freftabshortname}}
-\newcommand*{\fancyrefaddcaptions}[2]{}
-\newcommand*{\fancyrefdefaultformat}{\@empty}
-\newcommand{\frefformat}[3]{}
-\newcommand{\Frefformat}[3]{}
+\LWR at ProvidesPackagePass{fancyref}
+\newcommand*{\LWRfref at parenfancyrefhook}[1]{(#1)}
+
+\ifdefstrequal{\fancyrefhook}{\LWRfref at parenfancyrefhook}
+{}{
+    \renewcommand*{\fancyrefhook}[1]{#1}%
+}
+
+\renewcommand*{\@f at ref}[4]{%
+  \@ifundefined{#1r@#2@#3}{%
+    \PackageError{fancyref}{%
+      \backslashchar#1ref\space format ``#2''
+      undefined\MessageBreak
+      for label type ``#3''%
+    }{%
+      The format ``#2'' was not defined for the label type
+      ``#3''\MessageBreak
+      and the \backslashchar#1ref\space command.  Perhaps
+      you have only misspelled its name.\MessageBreak
+      Otherwise you will have to define it with
+      \protect\new#1refformat\MessageBreak
+      prior to using it.%
+    }%
+  }{%
+    \fancyrefhook{%
+      \@nameuse{#1r@#2@#3}%
+        {\ref{#3\fancyrefargdelim#4}}%
+        {}% lwarp
+        {}% lwarp
+    }%
+  }%
+}%
 \endinput
 %%
 %% End of file `lwarp-fancyref.sty'.

Modified: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-graphics.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-graphics.sty	2018-02-14 21:32:33 UTC (rev 46637)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-graphics.sty	2018-02-14 21:33:05 UTC (rev 46638)
@@ -141,6 +141,7 @@
 {%
 \LWR at traceinfo{LWR at includegraphicsb #4}%
 \LWR at origtilde \LWR at orignewline%
+\begingroup%
 \ifthenelse{\cnttest{\value{LWR at minipagedepth}}{=}{0}}%
 {%
     \ifbool{LWR at infloatrow}%
@@ -256,7 +257,7 @@
 \LWR at origtilde{} class="\LWR at igclass" \LWR at orignewline%
 }% end of image tags
 }% end of href
-\LWR at origscriptsize
+\endgroup
 \LWR at traceinfo{LWR at includegraphicsb done}%
 }
 

Modified: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-hang.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-hang.sty	2018-02-14 21:32:33 UTC (rev 46637)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-hang.sty	2018-02-14 21:33:05 UTC (rev 46638)
@@ -31,8 +31,8 @@
     \LWR at findhangingleftmargin%
     \uselengthunit{PT}%
     \BlockClass[%
-        \mbox{margin-left:\rndprintlength{\LWR at templengthone}} ; %
-        \mbox{text-indent:-\rndprintlength{\hangingindent}}%
+        \LWR at origmbox{margin-left:\rndprintlength{\LWR at templengthone}} ; %
+        \LWR at origmbox{text-indent:-\rndprintlength{\hangingindent}}%
     ]%
     {hangingpar}%
 }
@@ -44,9 +44,9 @@
     \renewcommand*{\LWR at printopenlist}{%
         \LWR at findhangingleftmargin%
         \uselengthunit{PT}%
-        ul style="\mbox{list-style-type:none;} %
-        \mbox{margin-left:\rndprintlength{\LWR at templengthone}} ; %
-        \mbox{text-indent:-\rndprintlength{\hangingindent}}"%
+        ul style="\LWR at origmbox{list-style-type:none;} %
+        \LWR at origmbox{margin-left:\rndprintlength{\LWR at templengthone}} ; %
+        \LWR at origmbox{text-indent:-\rndprintlength{\hangingindent}}"%
     }%
     \let\item\LWR at itemizeitem%
     \list{}{}%
@@ -65,8 +65,8 @@
     \BlockClass[%
         \LWR at findhangingleftmargin%
         \uselengthunit{PT}%
-        \mbox{margin-left:\rndprintlength{\LWR at templengthone}} ; %
-        \mbox{text-indent:-\rndprintlength{\hangingindent}}%
+        \LWR at origmbox{margin-left:\rndprintlength{\LWR at templengthone}} ; %
+        \LWR at origmbox{text-indent:-\rndprintlength{\hangingindent}}%
     ]{labeledpar}#2%
 }
 {\endBlockClass}

Modified: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-hanging.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-hanging.sty	2018-02-14 21:32:33 UTC (rev 46637)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-hanging.sty	2018-02-14 21:33:05 UTC (rev 46638)
@@ -29,8 +29,8 @@
 {%
     \uselengthunit{PT}%
     \BlockClass[%
-        \mbox{margin-left:\rndprintlength{#1}} ; %
-        \mbox{text-indent:-\rndprintlength{#1}}%
+        \LWR at origmbox{margin-left:\rndprintlength{#1}} ; %
+        \LWR at origmbox{text-indent:-\rndprintlength{#1}}%
     ]%
     {hangingpar}%
 }

Added: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-hypcap.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-hypcap.sty	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-hypcap.sty	2018-02-14 21:33:05 UTC (rev 46638)
@@ -0,0 +1,26 @@
+%%
+%% This is file `lwarp-hypcap.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% lwarp.dtx  (with options: `hypcap')
+%% This is a generated file.
+%% Copyright 2016-2018 Brian Dunn
+%% 
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%%   http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+\LWR at ProvidesPackageDrop{hypcap}
+\newcommand*{\capstart}{}
+\newcommand*{\hypcapspace}{}
+\newcommand*{\hypcapredef}[1]{}
+\newcommand*{\capstartfalse}{}
+\newcommand*{\capstarttrue}{}
+\endinput
+%%
+%% End of file `lwarp-hypcap.sty'.


Property changes on: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-hypcap.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-hypernat.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-hypernat.sty	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-hypernat.sty	2018-02-14 21:33:05 UTC (rev 46638)
@@ -0,0 +1,21 @@
+%%
+%% This is file `lwarp-hypernat.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% lwarp.dtx  (with options: `hypernat')
+%% This is a generated file.
+%% Copyright 2016-2018 Brian Dunn
+%% 
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%%   http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+\LWR at ProvidesPackageDrop{hypernat}
+\endinput
+%%
+%% End of file `lwarp-hypernat.sty'.


Property changes on: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-hypernat.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-hyperref.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-hyperref.sty	2018-02-14 21:32:33 UTC (rev 46637)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-hyperref.sty	2018-02-14 21:33:05 UTC (rev 46638)
@@ -90,7 +90,7 @@
 
 \newcommand{\belowpdfbookmark}[2]{}
 
-\newcommand{\texorpdfstring}[2]{#2}
+\newcommand{\texorpdfstring}[2]{#1}
 
 \def\hypercalcbp#1{%
 \strip at pt\dimexpr 0.99626401\dimexpr(#1)\relax\relax

Modified: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-luatodonotes.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-luatodonotes.sty	2018-02-14 21:32:33 UTC (rev 46637)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-luatodonotes.sty	2018-02-14 21:33:05 UTC (rev 46638)
@@ -23,7 +23,13 @@
 \newcommand{\ext at todo}{tdo}
 
 \renewcommand{\l at todo}[2]{\hypertocfloat{1}{todo}{ldo}{#1}{#2}}
+\let\LWRTODONOTES at orig@todototoc\todototoc
 
+\renewcommand*{\todototoc}{%
+\phantomsection%
+\LWRTODONOTES at orig@todototoc%
+}
+
 \renewcommand{\@todonotes at drawMarginNoteWithLine}{%
 \fcolorbox
     {\@todonotes at currentbordercolor}

Modified: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-midpage.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-midpage.sty	2018-02-14 21:32:33 UTC (rev 46637)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-midpage.sty	2018-02-14 21:33:05 UTC (rev 46638)
@@ -17,7 +17,7 @@
 %% version 2005/12/01 or later.
 \LWR at ProvidesPackageDrop{midpage}
 \newenvironment{midpage}
-{\begin{BlockClass}[\mbox{margin-top:6ex} ; \mbox{margin-bottom:6ex}]{midpage}}
+{\begin{BlockClass}[\LWR at origmbox{margin-top:6ex} ; \LWR at origmbox{margin-bottom:6ex}]{midpage}}
 {\end{BlockClass}}
 \endinput
 %%

Modified: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-multirow.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-multirow.sty	2018-02-14 21:32:33 UTC (rev 46637)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-multirow.sty	2018-02-14 21:33:05 UTC (rev 46638)
@@ -27,12 +27,12 @@
 \LWR at tabularleftedge%
 \LWR at htmltag{td rowspan="#2" %
 \IfValueT{#1}{%
-\ifstrequal{#1}{b}{style="\mbox{vertical-align:bottom}" }{}%
-\ifstrequal{#1}{t}{style="\mbox{vertical-align:top}" }{}%
+\ifstrequal{#1}{b}{style="\LWR at origmbox{vertical-align:bottom}" }{}%
+\ifstrequal{#1}{t}{style="\LWR at origmbox{vertical-align:top}" }{}%
 }%
 \ifdefvoid{\LWR at multirowborder}{}{%
-style="\mbox{border-\LWR at multirowborder:} 2px dotted black ; %
-\mbox{padding-\LWR at multirowborder:} 2px" %
+style="\LWR at origmbox{border-\LWR at multirowborder:} 2px dotted black ; %
+\LWR at origmbox{padding-\LWR at multirowborder:} 2px" %
 }%
 class="td%
 \StrChar{\LWR at tablecolspec}{\arabic{LWR at tablecolindex}}%
@@ -42,6 +42,7 @@
 "%
 \LWR at tdstartstyles%
 \LWR at addcmidrulewidth%
+\LWR at addtabularrulecolors%
 \LWR at tdendstyles%
 }%
 \LWR at getexparray{LWR at colbeforespec}{\arabic{LWR at tablecolindex}}%

Modified: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-ntheorem.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-ntheorem.sty	2018-02-14 21:32:33 UTC (rev 46637)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-ntheorem.sty	2018-02-14 21:33:05 UTC (rev 46638)
@@ -180,7 +180,7 @@
 \newcommand{\LWR at inctheorem}{%
 \addtocounter{LWR at thisautoid}{1}%
 \LWR at stoppars%
-\LWR at htmltag{a id="\mbox{autoid-\arabic{LWR at thisautoid}}"}\LWR at htmltag{/a}%
+\LWR at htmltag{a id="\LWR at origmbox{autoid-\arabic{LWR at thisautoid}}"}\LWR at htmltag{/a}%
 \LWR at startpars%
 }
 \gdef\newtheoremstyle#1#2#3{%

Modified: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-realscripts.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-realscripts.sty	2018-02-14 21:32:33 UTC (rev 46637)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-realscripts.sty	2018-02-14 21:33:05 UTC (rev 46638)
@@ -28,8 +28,8 @@
 
 \newcommand*{\LWR at setrealscriptsalign}[1]{%
 \renewcommand*{\LWR at realscriptsalign}{}%
-\ifthenelse{\equal{#1}{c}}{\renewcommand{\LWR at realscriptsalign}{\mbox{text-align:center} ; }}{}%
-\ifthenelse{\equal{#1}{r}}{\renewcommand{\LWR at realscriptsalign}{\mbox{text-align:right} ; }}{}%
+\ifthenelse{\equal{#1}{c}}{\renewcommand{\LWR at realscriptsalign}{\LWR at origmbox{text-align:center} ; }}{}%
+\ifthenelse{\equal{#1}{r}}{\renewcommand{\LWR at realscriptsalign}{\LWR at origmbox{text-align:right} ; }}{}%
 }
 
 \DeclareDocumentCommand \textsubsuperscript {s O{l} mm} {%

Modified: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-scrextend.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-scrextend.sty	2018-02-14 21:32:33 UTC (rev 46637)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-scrextend.sty	2018-02-14 21:33:05 UTC (rev 46638)
@@ -78,12 +78,12 @@
 \DeclareDocumentCommand{\raggedfootnote}{}{}
 
 \DeclareDocumentCommand{\dictum}{o m}{
-\begin{LWR at BlockClassWP}{\mbox{text-align:right}}{}{dictum}
+\begin{LWR at BlockClassWP}{\LWR at origmbox{text-align:right}}{}{dictum}
     #2
     \IfValueT{#1}
     {
         \ifbool{FormatWP}
-        {\begin{BlockClass}[\mbox{border-top:} 1px solid gray]{dictumauthor}}
+        {\begin{BlockClass}[\LWR at origmbox{border-top:} 1px solid gray]{dictumauthor}}
         {\begin{BlockClass}{dictumauthor}}
         \dictumauthorformat{#1}
         \end{BlockClass}
@@ -124,15 +124,15 @@
 \ifblank{#2}
 {
     \begin{BlockClass}[
-        \mbox{margin-left:\rndprintlength{\LWR at templengthtwo}} ;
-        \mbox{margin-right:\rndprintlength{\LWR at templengthtwo}}
+        \LWR at origmbox{margin-left:\rndprintlength{\LWR at templengthtwo}} ;
+        \LWR at origmbox{margin-right:\rndprintlength{\LWR at templengthtwo}}
     ]{addmargin}
 }
 {
     \setlength{\LWR at templengthone}{#2}
     \begin{BlockClass}[
-        \mbox{margin-left:\rndprintlength{\LWR at templengthone}} ;
-        \mbox{margin-right:\rndprintlength{\LWR at templengthtwo}}
+        \LWR at origmbox{margin-left:\rndprintlength{\LWR at templengthone}} ;
+        \LWR at origmbox{margin-right:\rndprintlength{\LWR at templengthtwo}}
     ]{addmargin}
 }
 }

Modified: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-siunitx.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-siunitx.sty	2018-02-14 21:32:33 UTC (rev 46637)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-siunitx.sty	2018-02-14 21:33:05 UTC (rev 46638)
@@ -27,12 +27,45 @@
 }% AtBeginDocument
 
 \ExplSyntaxOn
+\cs_undefine:N \__siunitx_print_aux:
+\cs_new_protected:Npn \__siunitx_print_aux:
+  {
+    \text
+      {
+        \__siunitx_ensure_ltr:n
+          {
+            \color at begingroup
+            \__siunitx_print_color:
+            \__siunitx_font_shape:
+            \__siunitx_font_weight:
+            \use:c
+              {
+                @@_ \l__siunitx_print_type_tl _
+                text \l__siunitx_font_family_tl :
+              }
+            \bool_if:NTF \l__siunitx_font_math_mode_bool
+              { \__siunitx_print_math: }
+              {
+                \LWR at findcurrenttextcolor% lwarp
+                \ifdefstring{\LWR at tempcolor}{000000}% lwarp
+                {\__siunitx_print_text:}% lwarp
+                {% lwarp
+                    \LWR at textcurrentcolor{% lwarp
+                        \__siunitx_print_text:
+                    }% lwarp
+                }% lwarp
+              }
+            \color at endgroup
+          }
+      }
+  }
+
 \cs_undefine:N \__siunitx_set_math_fam:n
 \cs_new_protected:Npn \__siunitx_set_math_fam:n #1 {
-    \LWR at traceinfo{sunitx set math fam}
   \int_new:c { c__siunitx_math #1 _int }
-  \group_begin:
-    \LetLtxMacro\@ensuredmath\LWR at origensuredmath
+  \group_begin:% lwarp
+    \LetLtxMacro\@ensuredmath\LWR at origensuredmath% lwarp
+    \LetLtxMacro\mbox\LWR at origmbox% lwarp
     \hbox_set:Nn \l__siunitx_tmp_box
       {
         \ensuremath
@@ -43,14 +76,14 @@
               }
           }
       }
-  \group_end:
-    \LWR at traceinfo{sunitx set math fam: done}
+  \group_end:% lwarp
 }
 
 \cs_undefine:N \__siunitx_combined_output:n
 \cs_new_protected:Npn \__siunitx_combined_output:n #1 {
-    \group_begin:
-    \LetLtxMacro\@ensuredmath\LWR at origensuredmath
+    \group_begin:% lwarp
+    \LetLtxMacro\@ensuredmath\LWR at origensuredmath% lwarp
+    \LetLtxMacro\mbox\LWR at origmbox% lwarp
   \bool_if:NTF \l__siunitx_number_parse_bool
     {
       \tl_clear:N \l__siunitx_number_out_tl
@@ -59,12 +92,103 @@
     }
     {
       \__siunitx_unit_output_pre_print:
-      \__siunitx_print:nn { number } { \ensuremath {#1} }
+      \LWR at subsingledollar{\__siunitx_print:nn { number } { #1 }}% lwarp
       \__siunitx_unit_output_print:
     }
-    \group_end:
+    \group_end:% lwarp
 }
+\cs_undefine:N \__siunitx_number_output_quotient_fraction:
+\cs_new_protected:Npn \__siunitx_number_output_quotient_fraction: {
+  \bool_set_true:N \l__siunitx_number_compound_bool
+  \__siunitx_number_output_quotient_aux_i:
+  \tl_set_eq:NN \l__siunitx_number_out_tl
+    \l__siunitx_number_numerator_tl
+  \tl_put_right:NV \l__siunitx_number_out_tl \l__siunitx_output_quotient_tl
+  \tl_put_right:NV \l__siunitx_number_out_tl
+    \l__siunitx_number_denominator_tl
+  \__siunitx_number_output_single_aux:
+}
+\cs_undefine:N \__siunitx_unit_format_fraction_fraction:
+\cs_new_protected:Npn \__siunitx_unit_format_fraction_fraction: {
+  \__siunitx_unit_format_fraction_symbol_aux:
+  \int_compare:nNnT { \l__siunitx_unit_denominator_int } > { 1 }
+    {
+      \bool_if:NT \l__siunitx_unit_denominator_bracket_bool
+        {
+          \tl_put_left:NV \l__siunitx_unit_denominator_tl \l__siunitx_bracket_open_tl
+          \tl_put_right:NV \l__siunitx_unit_denominator_tl \l__siunitx_bracket_close_tl
+        }
+    }
+  \tl_set_eq:NN \l__siunitx_unit_tl \l__siunitx_unit_numerator_tl
+  \tl_put_right:NV \l__siunitx_unit_tl \l__siunitx_per_symbol_tl
+  \tl_put_right:NV \l__siunitx_unit_tl \l__siunitx_unit_denominator_tl
+}
 
+\RenewDocumentCommand \num { o m } {
+  \leavevmode
+  \group_begin:% lwarp
+    \LetLtxMacro\@ensuredmath\LWR at origensuredmath% lwarp
+    \LetLtxMacro\mbox\LWR at origmbox% lwarp
+    \bool_set_false:N \l__siunitx_font_set_bool
+    \IfNoValueF {#1}
+      { \keys_set:nn { siunitx } {#1} }
+    \__siunitx_number_output:n {#2}
+  \group_end:% lwarp
+}
+
+\RenewDocumentCommand \numrange { o m m } {
+  \leavevmode
+  \group_begin:% lwarp
+    \LetLtxMacro\@ensuredmath\LWR at origensuredmath% lwarp
+    \LetLtxMacro\mbox\LWR at origmbox% lwarp
+    \bool_set_false:N \l__siunitx_font_set_bool
+    \IfNoValueF {#1}
+      { \keys_set:nn { siunitx } {#1} }
+    \__siunitx_range_numbers:nn {#2} {#3}
+  \group_end:% lwarp
+}
+
+\RenewDocumentCommand \ang { o > { \SplitArgument { 2 } { ; } } m } {
+  \group_begin:% lwarp
+    \LetLtxMacro\@ensuredmath\LWR at origensuredmath% lwarp
+    \LetLtxMacro\mbox\LWR at origmbox% lwarp
+    \IfNoValueF {#1}
+      { \keys_set:nn { siunitx } {#1} }
+    \__siunitx_angle_output:nnn #2
+  \group_end:% lwarp
+}
+
+\RenewDocumentCommand \si { o m } {
+  \leavevmode
+  \group_begin:% lwarp
+    \LetLtxMacro\@ensuredmath\LWR at origensuredmath% lwarp
+    \LetLtxMacro\mbox\LWR at origmbox% lwarp
+    \bool_set_false:N \l__siunitx_font_set_bool
+    \IfNoValueTF {#1}
+      { \__siunitx_unit_output:nn {#2} { } }
+      {
+        \keys_set:nn { siunitx } {#1}
+        \__siunitx_unit_output:nn {#2} {#1}
+      }
+  \group_end:% lwarp
+}
+
+\RenewDocumentCommand{\SIrange}{o m m m}
+{%
+  \leavevmode
+  \group_begin:% lwarp
+    \LetLtxMacro\@ensuredmath\LWR at origensuredmath% lwarp
+    \LetLtxMacro\mbox\LWR at origmbox% lwarp
+    \bool_set_false:N \l__siunitx_font_set_bool
+    \IfNoValueTF {#1}
+      { \__siunitx_range_unit:nnnn {#4} { } {#2} {#3} }
+      {
+        \keys_set:nn { siunitx } {#1}
+        \__siunitx_range_unit:nnnn {#4} {#1} {#2} {#3}
+      }
+  \group_end:% lwarp
+}
+
 \ExplSyntaxOff
 
 \endinput

Added: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-stfloats.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-stfloats.sty	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-stfloats.sty	2018-02-14 21:33:05 UTC (rev 46638)
@@ -0,0 +1,25 @@
+%%
+%% This is file `lwarp-stfloats.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% lwarp.dtx  (with options: `stfloats')
+%% This is a generated file.
+%% Copyright 2016-2018 Brian Dunn
+%% 
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%%   http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+\LWR at ProvidesPackageDrop{stfloats}
+\newcommand*{\fnbelowfloat}{}
+\newcommand*{\fnunderfloat}{}
+\newcommand*{\setbaselinefloat}{}
+\newcommand*{\setbaselinefixed}{}
+\endinput
+%%
+%% End of file `lwarp-stfloats.sty'.


Property changes on: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-stfloats.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-titling.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-titling.sty	2018-02-14 21:32:33 UTC (rev 46637)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-titling.sty	2018-02-14 21:33:05 UTC (rev 46638)
@@ -55,7 +55,7 @@
 \long\def\@makefntext##1{%
 \makethanksmark~%
 ##1%
-}%
+}% \@makefntext
 }
 \renewcommand*{\maketitle}{%
 \begin{titlepage}

Modified: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-todonotes.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-todonotes.sty	2018-02-14 21:32:33 UTC (rev 46637)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-todonotes.sty	2018-02-14 21:33:05 UTC (rev 46638)
@@ -22,7 +22,13 @@
 \newcommand{\ext at todo}{tdo}
 
 \renewcommand{\l at todo}[2]{\hypertocfloat{1}{todo}{ldo}{#1}{#2}}
+\let\LWRTODONOTES at orig@todototoc\todototoc
 
+\renewcommand*{\todototoc}{%
+\phantomsection%
+\LWRTODONOTES at orig@todototoc%
+}
+
 \renewcommand{\@todonotes at drawMarginNoteWithLine}{
 \fcolorbox
     {\@todonotes at currentbordercolor}

Modified: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-ulem.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-ulem.sty	2018-02-14 21:32:33 UTC (rev 46637)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-ulem.sty	2018-02-14 21:33:05 UTC (rev 46638)
@@ -15,6 +15,7 @@
 %%   http://www.latex-project.org/lppl.txt
 %% and version 1.3 or later is part of all distributions of LaTeX
 %% version 2005/12/01 or later.
+\ProvidesPackage{lwarp-ulem}
 \LetLtxMacro\LWR at ulemorigemph\emph
 \LetLtxMacro\LWR at ulemorigtextbf\textbf
 \NewDocumentCommand{\uline}{+m}{%
@@ -88,7 +89,9 @@
 \DeclareOption{ULforem}{\ULforem}
 \DeclareOption{normalbf}{}
 \DeclareOption{UWforbf}{\useunder{\uwave}{\bf}{\textbf}}
-\LWR at ProvidesPackageDrop{ulem}
+
+\DeclareOption*{}
+\ProcessOptions\relax% original LaTeX code
 \endinput
 %%
 %% End of file `lwarp-ulem.sty'.

Added: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-vmargin.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-vmargin.sty	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-vmargin.sty	2018-02-14 21:33:05 UTC (rev 46638)
@@ -0,0 +1,34 @@
+%%
+%% This is file `lwarp-vmargin.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% lwarp.dtx  (with options: `vmargin')
+%% This is a generated file.
+%% Copyright 2016-2018 Brian Dunn
+%% 
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%%   http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+\LWR at ProvidesPackageDrop{vmargin}
+\newcommand*{\LWRVM at customsize}[2]{}
+\newcommand*{\setpapersize}[2][]{\ifstrequal{#2}{custom}{\LWRVM at customsize}{}}
+\newcommand*{\setmargins}[8]{}
+\newcommand*{\setmarginsrb}[8]{}
+\newcommand*{\setmargnohf}[4]{}
+\newcommand*{\setmargnohfrb}[4]{}
+\newcommand*{\setmarg}[4]{}
+\newcommand*{\setmargrb}[4]{}
+\newlength{\PaperWidth}
+\setlength{\PaperWidth}{8.5in}
+\newlength{\PaperHeight}
+\setlength{\PaperHeight}{11in}
+\newif\ifLandscape
+\endinput
+%%
+%% End of file `lwarp-vmargin.sty'.


Property changes on: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-vmargin.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-xfrac.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-xfrac.sty	2018-02-14 21:32:33 UTC (rev 46637)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-xfrac.sty	2018-02-14 21:33:05 UTC (rev 46638)
@@ -42,43 +42,69 @@
 
 \DeclareInstance{xfrac}{default}{text}{
 numerator-format = {%
+\begingroup%
 \LetLtxMacro{\scalebox}{\LWR at noscalebox}%
-\LWR at htmlsmallfontstart\textsuperscript{#1}\,\LWR at htmlsmallfontend},
+\LWR at htmlsmallfontstart\textsuperscript{#1}\,\LWR at htmlsmallfontend%
+\endgroup%
+},
 denominator-format = {%
+\begingroup%
 \LetLtxMacro{\scalebox}{\LWR at noscalebox}%
-\LWR at htmlsmallfontstart{}\,#1\LWR at htmlsmallfontend},
+\LWR at htmlsmallfontstart{}\,#1\LWR at htmlsmallfontend%
+\endgroup%
+},
 scaling = false
 }
 
 \DeclareInstance{xfrac}{lmr}{text}{
 numerator-format = {%
+\begingroup%
 \LetLtxMacro{\scalebox}{\LWR at noscalebox}%
-\LWR at htmlsmallfontstart\textsuperscript{#1}\,\LWR at htmlsmallfontend},
+\LWR at htmlsmallfontstart\textsuperscript{#1}\,\LWR at htmlsmallfontend%
+\endgroup%
+},
 denominator-format = {%
+\begingroup%
 \LetLtxMacro{\scalebox}{\LWR at noscalebox}%
-\LWR at htmlsmallfontstart{}\,#1\LWR at htmlsmallfontend},
+\LWR at htmlsmallfontstart{}\,#1\LWR at htmlsmallfontend%
+\endgroup%
+},
 scaling = false
 }
 
 \DeclareInstance{xfrac}{lmss}{text}{
 numerator-format = {%
+\begingroup%
 \LetLtxMacro{\scalebox}{\LWR at noscalebox}%
-\LWR at htmlsmallfontstart\textsuperscript{#1}\,\LWR at htmlsmallfontend},
+\LWR at htmlsmallfontstart\textsuperscript{#1}\,\LWR at htmlsmallfontend%
+\endgroup%
+},
 denominator-format = {%
+\begingroup%
 \LetLtxMacro{\scalebox}{\LWR at noscalebox}%
-\LWR at htmlsmallfontstart{}\,#1\LWR at htmlsmallfontend},
+\LWR at htmlsmallfontstart{}\,#1\LWR at htmlsmallfontend%
+\endgroup%
+},
 scaling = false
 }
 
 \DeclareInstance{xfrac}{lmtt}{text}{
 numerator-format = {%
+\begingroup%
 \LetLtxMacro{\scalebox}{\LWR at noscalebox}%
-\LWR at htmlsmallfontstart\textsuperscript{#1}\,\LWR at htmlsmallfontend},
+\LWR at htmlsmallfontstart\textsuperscript{#1}\,\LWR at htmlsmallfontend%
+\endgroup%
+},
 denominator-format = {%
+\begingroup%
 \LetLtxMacro{\scalebox}{\LWR at noscalebox}%
-\LWR at htmlsmallfontstart{}\,#1\LWR at htmlsmallfontend},
+\LWR at htmlsmallfontstart{}\,#1\LWR at htmlsmallfontend%
+\endgroup%
+},
 scaling = false
 }
+
+
 \end{warpHTML}
 \endinput
 %%

Modified: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp.sty	2018-02-14 21:32:33 UTC (rev 46637)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp.sty	2018-02-14 21:33:05 UTC (rev 46638)
@@ -17,7 +17,7 @@
 %% version 2005/12/01 or later.
 \NeedsTeXFormat{LaTeX2e}[1999/12/01]
 \ProvidesPackage{lwarp}
-    [2018/01/30 v0.47  Allows LaTeX to directly produce HTML5 output.]
+    [2018/02/14 v0.48  Allows LaTeX to directly produce HTML5 output.]
 
 
 
@@ -210,6 +210,8 @@
 \LWR at loadafter{a4wide}
 \LWR at loadafter{a5comb}
 \LWR at notmemoirloadafter{abstract}
+\LWR at loadafter{acro}
+\LWR at loadafter{acronym}
 \LWR at loadafter{adjmulticol}
 \LWR at loadafter{addlines}
 \LWR at loadafter{afterpage}
@@ -222,7 +224,6 @@
 \LWR at notmemoirloadafter{appendix}
 \LWR at loadafter{arabicfront}
 \LWR at notmemoirloadafter{array}
-\LWR at loadafter{atbegshi}
 \LWR at loadafter{authblk}
 \LWR at loadafter{backref}
 \LWR at loadafter{balance}
@@ -241,8 +242,10 @@
 \LWR at notmemoirloadafter{changepage}
 \LWR at notmemoirloadafter{chngpage}
 \LWR at loadafter{chappg}
+\LWR at loadafter{chapterbib}
 \LWR at loadafter{cite}
 \LWR at loadafter{color}
+\LWR at loadafter{colortbl}
 \LWR at loadafter{continue}
 \LWR at notmemoirloadafter{crop}
 \LWR at loadafter{cuted}
@@ -295,6 +298,8 @@
 \LWR at loadafter{grffile}
 \LWR at loadafter{hang}
 \LWR at loadafter{hanging}
+\LWR at loadafter{hypcap}
+\LWR at loadafter{hypernat}
 \LWR at loadafter{hyperref}
 \LWR at loadafter{hyperxmp}
 \LWR at loadafter{idxlayout}
@@ -374,6 +379,7 @@
 \LWR at loadafter{soulpos}
 \LWR at loadafter{soulutf8}
 \LWR at loadafter{stabular}
+\LWR at loadafter{stfloats}
 \LWR at loadafter{subfig}
 \LWR at loadafter{subfigure}
 \LWR at loadafter{supertabular}
@@ -400,8 +406,9 @@
 \LWR at loadafter{turnthepage}
 \LWR at loadafter{ulem}
 \LWR at loadafter{upref}
-\LWR at loadafter{varioref}
+\LWR at loadafter{varioref}% no lwarp package provided
 \LWR at notmemoirloadafter{verse}
+\LWR at loadafter{vmargin}
 \LWR at loadafter{wallpaper}
 \LWR at loadafter{watermark}
 \LWR at loadafter{wrapfig}
@@ -536,6 +543,12 @@
 
 \end{warpHTML}
 
+\begin{warpprint}
+
+\RequirePackage{varwidth}
+
+\end{warpprint}
+
 \begin{warpHTML}
 
 \LetLtxMacro{\LWR at origRequirePackage}{\RequirePackage}
@@ -542,6 +555,8 @@
 
 \newcommand*{\LWR at requirepackagenames}{}
 
+\newcommand*{\LWR at parsedrequirepackagenames}{}
+
 \newcommand*\LWR at findword[3][,]{%
     \StrBetween[#3,\numexpr#3+1]{#1#2#1}{#1}{#1}%
 }
@@ -549,46 +564,54 @@
 \LWR at findword{\LWR at requirepackagenames}{#1}[\LWR at strresult]%
 \StrSubstitute[100]{\LWR at strresult}{ }{}[\LWR at strresulttwo]%
 \IfStrEq{\LWR at strresulttwo}{}%
-{}% no filename
+{%
+}% no filename
 {% yes filename
-\IfFileExists{lwarp-\LWR at strresulttwo.sty}%
-{% lwarp-* file found
-        \StrSubstitute%
-            {\LWR at requirepackagenames}%
-            {\LWR at strresult}%
-            {lwarp-\LWR at strresulttwo}[\LWR at requirepackagenames]%
-}%
-{
-        \StrSubstitute%
-            {\LWR at requirepackagenames}%
-            {\LWR at strresult}%
-            {\LWR at strresulttwo}[\LWR at requirepackagenames]%
-}% no lwarp-* file
+    \IfFileExists{lwarp-\LWR at strresulttwo.sty}%
+    {% lwarp-* file found
+        \ifdefvoid{\LWR at parsedrequirepackagenames}{%
+            \edef\LWR at parsedrequirepackagenames{lwarp-\LWR at strresulttwo}%
+        }{%
+            \edef\LWR at parsedrequirepackagenames{%
+                \LWR at parsedrequirepackagenames,lwarp-\LWR at strresulttwo%
+            }%
+        }%
+    }%
+    {%
+        \ifdefvoid{\LWR at parsedrequirepackagenames}{%
+            \edef\LWR at parsedrequirepackagenames{\LWR at strresulttwo}%
+        }{%
+            \edef\LWR at parsedrequirepackagenames{%
+                \LWR at parsedrequirepackagenames,\LWR at strresulttwo%
+            }%
+        }%
+    }% no lwarp-* file
 }% yes filename
 }
 \RenewDocumentCommand{\RequirePackage}{o m o}{%
-\renewcommand*{\LWR at requirepackagenames}{#2}
-\LWR at lookforpackagename{1}
-\LWR at lookforpackagename{2}
-\LWR at lookforpackagename{3}
-\LWR at lookforpackagename{4}
-\LWR at lookforpackagename{5}
-\LWR at lookforpackagename{6}
-\LWR at lookforpackagename{7}
-\LWR at lookforpackagename{8}
-\LWR at lookforpackagename{9}
-\IfValueTF{#1}
+\renewcommand*{\LWR at requirepackagenames}{#2}%
+\renewcommand*{\LWR at parsedrequirepackagenames}{}%
+\LWR at lookforpackagename{1}%
+\LWR at lookforpackagename{2}%
+\LWR at lookforpackagename{3}%
+\LWR at lookforpackagename{4}%
+\LWR at lookforpackagename{5}%
+\LWR at lookforpackagename{6}%
+\LWR at lookforpackagename{7}%
+\LWR at lookforpackagename{8}%
+\LWR at lookforpackagename{9}%
+\IfValueTF{#1}%
 {% options given
     \IfValueTF{#3}% version given?
-    {\LWR at origRequirePackage[#1]{\LWR at requirepackagenames}[#3]}
-    {\LWR at origRequirePackage[#1]{\LWR at requirepackagenames}}
-}
+    {\LWR at origRequirePackage[#1]{\LWR at parsedrequirepackagenames}[#3]}%
+    {\LWR at origRequirePackage[#1]{\LWR at parsedrequirepackagenames}}%
+}%
 {% no options given
     \IfValueTF{#3}% version given?
-    {\LWR at origRequirePackage{\LWR at requirepackagenames}[#3]}
-    {\LWR at origRequirePackage{\LWR at requirepackagenames}}
+    {\LWR at origRequirePackage{\LWR at parsedrequirepackagenames}[#3]}%
+    {\LWR at origRequirePackage{\LWR at parsedrequirepackagenames}}%
+}%
 }
-}
 \LetLtxMacro{\usepackage}{\RequirePackage}
 
 \NewDocumentCommand{\LWR at ProvidesPackagePass}{m o}{
@@ -598,7 +621,6 @@
 {\ProvidesPackage{lwarp-#1}}
 \DeclareOption*{\PassOptionsToPackage{\CurrentOption}{#1}}
 \ProcessOptions\relax
-
 \IfValueTF{#2}
 {\LWR at origRequirePackage{#1}[#2]}
 {\LWR at origRequirePackage{#1}}
@@ -610,7 +632,9 @@
 {\ProvidesPackage{lwarp-#1}[#2]}
 {\ProvidesPackage{lwarp-#1}}
 \DeclareOption*{}
-\ProcessOptions\relax
+\let\ds@\@empty%         from the original \ProcessOptions
+\edef\@curroptions{}%    lwarp modification to \ProcessOptions
+\@process at ptions\relax%  from the original \ProcessOptions
 }
 
 \end{warpHTML}
@@ -821,6 +845,44 @@
 
 \begin{warpHTML}
 
+\LetLtxMacro\LWR at origmbox\mbox
+\LetLtxMacro\LWR at origmakebox\makebox
+
+\let\LWR at origcomma\,
+\let\LWR at origtilde~
+\let\LWR at origenskip\enskip
+\let\LWR at origquad\quad
+\let\LWR at origqquad\qquad
+
+\let\LWR at orighspace\hspace
+\let\LWR at orighfill\hfill
+\let\LWR at orighfil\hfil
+\let\LWR at origvspace\vspace
+\let\LWR at orighss\hss
+\let\LWR at origllap\llap
+\let\LWR at origrlap\rlap
+\let\LWR at orighfilneg\hfilneg
+
+\let\LWR at origrule\rule
+\let\LWR at orighrulefill\hrulefill
+\let\LWR at origdotfill\dotfill
+
+\let\LWR at origmedskip\medskip
+\let\LWR at origbigskip\bigskip
+
+\let\LWR at origtextellipsis\textellipsis
+
+\let\LWR at orignormalsize\normalsize
+\let\LWR at origsmall\small
+\let\LWR at origfootnotesize\footnotesize
+\let\LWR at origscriptsize\scriptsize
+\let\LWR at origtiny\tiny
+\let\LWR at origlarge\large
+\let\LWR at origLarge\Large
+\let\LWR at origLARGE\LARGE
+\let\LWR at orighuge\huge
+\let\LWR at origHuge\Huge
+
 \LetLtxMacro{\LWR at origtextrm}{\textrm}
 \LetLtxMacro{\LWR at origtextsf}{\textsf}
 \LetLtxMacro{\LWR at origtexttt}{\texttt}
@@ -852,14 +914,14 @@
 \let\LWR at origsb\sb
 \LetLtxMacro\LWR at origtextsuperscript\textsuperscript
 \LetLtxMacro\LWR at orig@textsuperscript\@textsuperscript
+
 \AtBeginDocument{
 \LetLtxMacro\LWR at origtextsubscript\textsubscript
 \LetLtxMacro\LWR at orig@textsubscript\@textsubscript
 }
+
 \LetLtxMacro\LWR at origunderline\underline
 
-\let\LWR at origscriptsize\scriptsize
-
 \let\LWR at orignewpage\newpage
 
 \let\LWR at origpagestyle\pagestyle
@@ -872,15 +934,22 @@
 
 \let\LWR at orignewline\newline
 
+\AtBeginDocument{% in case packages change definition
+\let\LWR at orig@trivlist\@trivlist
+\let\LWR at origtrivlist\trivlist
+\let\LWR at origendtrivlist\endtrivlist
 \LetLtxMacro\LWR at origitem\item
-
-\AtBeginDocument{% in case packages change definition
-\LetLtxMacro{\LWR at origitemize}{\itemize}
-\LetLtxMacro{\LWR at endorigitemize}{\enditemize}
-\LetLtxMacro{\LWR at origenumerate}{\enumerate}
-\LetLtxMacro{\LWR at endorigenumerate}{\endenumerate}
-\LetLtxMacro{\LWR at origdescription}{\description}
-\LetLtxMacro{\LWR at endorigdescription}{\enddescription}
+\LetLtxMacro\LWR at origitemize\itemize
+\LetLtxMacro\LWR at endorigitemize\enditemize
+\LetLtxMacro\LWR at origenumerate\enumerate
+\LetLtxMacro\LWR at endorigenumerate\endenumerate
+\LetLtxMacro\LWR at origdescription\description
+\LetLtxMacro\LWR at endorigdescription\enddescription
+\let\LWR at orig@mklab\@mklab
+\let\LWR at origmakelabel\makelabel
+\let\LWR at orig@donoparitem\@donoparitem
+\LetLtxMacro\LWR at orig@item\@item
+\let\LWR at orig@nbitem\@nbitem
 }
 
 \let\LWR at origpar\par
@@ -890,6 +959,11 @@
 
 \let\LWR at origclearpage\clearpage
 
+\AtBeginDocument{% in case packages change definition
+\LetLtxMacro\LWR at orighline\hline%
+\LetLtxMacro\LWR at origcline\cline%
+}
+
 \end{warpHTML}
 
 \begin{warpHTML}
@@ -1825,7 +1899,7 @@
 tr.tbrule td {border-top: 1px solid black ; margin-top: 0ex ;
     margin-bottom: 0ex ; } /* for \toprule, \bottomrule */
 
-td {padding: 1ex .5em 1ex .5em ;}
+td {padding: .5ex .5em .5ex .5em ;}
 
 table td.tdl { text-align: left ; vertical-align: middle ; }
 table td.tdc { text-align: center ; vertical-align: middle ; }
@@ -1890,6 +1964,13 @@
 
 .tnoteitemheader {margin-right: 1em;}
 
+/* for colortbl and cell color */
+div.cellcolor {
+    width: 100% ;
+    padding: .5ex .5em .5ex .5em ;
+    margin: -.5ex -.5em -.5ex -.5em ;
+}
+
 /* for bigdelim */
 .ldelim, .rdelim { font-size: 200% }
 
@@ -2860,7 +2941,7 @@
 
 -- Print the usage of the lwarpmk command:
 
-printversion = "v0.47"
+printversion = "v0.48"
 
 function printhelp ()
 print ("lwarpmk: Use lwarpmk -h or lwarpmk --help for help.") ;
@@ -3844,7 +3925,7 @@
 \begingroup%
 \LWR at FBcancel%
 \ifmmode\else\protect\LWR at origttfamily\fi%
-\mbox{\LWR at origtextless{}!{-}{-}}%
+\LWR at origmbox{\LWR at origtextless{}!{-}{-}}%
 \endgroup%
 }%
 }
@@ -3854,7 +3935,7 @@
 \begingroup%
 \LWR at FBcancel%
 \ifmmode\else\protect\LWR at origttfamily\fi%
-\mbox{{-}{-}\LWR at origtextgreater}%
+\LWR at origmbox{{-}{-}\LWR at origtextgreater}%
 \endgroup%
 }%
 }
@@ -3966,7 +4047,7 @@
     \addtocounter{LWR at thisautoidWP}{1}%
     \LWR at htmltag{%
         div class="#3" %
-        id="\mbox{autoidWP-\arabic{LWR at thisautoidWP}}"%
+        id="\LWR at origmbox{autoidWP-\arabic{LWR at thisautoidWP}}"%
         \ifblank{#1}{}{ style="#1"}%
     }%
 }% FormatWP
@@ -4053,6 +4134,7 @@
 
 \newcommand*{\LWR at closeparagraph}
 {%
+\LWR at traceinfo{LWR at closeparagraph}%
 \ifbool{LWR at doingapar}%
 {% handling pars
     \ifboolexpr{
@@ -4256,6 +4338,7 @@
 \let\@footnotetext\LWR at footnotetext
 \newbox\LWR at mpfootnotes
 \long\def\@mpfootnotetext#1{%
+\LWR at traceinfo{@mpfootnotetext}%
 \global\setbox\LWR at mpfootnotes\vbox{%
     \unvbox\LWR at mpfootnotes
     \reset at font\footnotesize
@@ -4281,7 +4364,11 @@
     }%
     \color at endgroup%
 }% vbox
+\LWR at traceinfo{@mpfootnotetext: done}%
 }
+\AtBeginDocument{
+\def\thempfootnote{\@alph\c at mpfootnote}
+}
 \newcommand*{\LWR at printpendingfootnotes}{%
 \ifvoid\LWR at footnotes\else
     \LWR at forcenewpage
@@ -4436,6 +4523,18 @@
 \endgroup
 }
 
+\newcounter{LWR at previousautopagelabel}
+\setcounter{LWR at previousautopagelabel}{-1}
+
+\newcommand*{\LWR at newautopagelabel}[1]{%
+\ifnumequal{\value{LWR at previousautopagelabel}}{\value{page}}%
+{}% no action if this autopage label has already been defined
+{%
+    \label{autopage-\arabic{#1}}%
+    \setcounter{LWR at previousautopagelabel}{\value{page}}
+}%
+}
+
 \newcommand*{\LWR at newhtmlfile}[1]{
 \LWR at traceinfo{LWR at newhtmlfile: !#1!}
 
@@ -4478,6 +4577,8 @@
 
 \LWR at filestart{ — #1}% there is an EMdash in front of the #1
 
+\setcounter{LWR at latestautopage}{\value{page}}%
+\LWR at newautopagelabel{LWR at latestautopage}%
 \ifthenelse{\boolean{FormatEPUB}\OR\boolean{FormatWP}}
 {}
 {\LWR at topnavigation}
@@ -4504,7 +4605,6 @@
 
 \LWR at stoppars
 
-\setcounter{LWR at latestautopage}{\value{page}}
 \LWR at traceinfo{LWR at newhtmlfile: done}
 }
 
@@ -4547,7 +4647,7 @@
 }
 
 \newcommand*{\LWR at createautosec}[1]{%
-\LWR at htmltag{#1 id="\mbox{autosec-\arabic{page}}"}%
+\LWR at htmltag{#1 id="\LWR at origmbox{autosec-\arabic{page}}"}%
 }
 
 \NewDocumentCommand{\LWR at pushoneclose}{m m}{%
@@ -4684,7 +4784,7 @@
 \LWR at traceinfo{LWR at section: about to close the heading tag}%
 \LWR at htmltag{\csuse{LWR at tag#4end}}%
 \LWR at traceinfo{LWR at section: about to create the LaTeX label}%
-\label{autopage-\theLWR at currentautosec}%
+\LWR at newautopagelabel{LWR at currentautosec}%
 \ifthenelse{%
     \cnttest{\csuse{LWR at depth#4}}{<}{\LWR at depthparagraph}%
 }%
@@ -4894,7 +4994,8 @@
 \setlength{\parindent}{0pt}
 \setlength{\parskip}{2ex}
 \immediate\openout\LWR at lateximagesfile=lateximages.txt
-\setlength{\belowcaptionskip}{-3ex}
+\setlength{\belowcaptionskip}{0ex}
+\setlength{\abovecaptionskip}{0ex}
 \renewcommand{\ps at plain}{}
 \renewcommand*{\centering}{}
 \renewcommand*{\raggedleft}{}
@@ -5112,6 +5213,9 @@
     \@title
     \LWR at htmltag{\LWR at tagtitleend}\LWR at startpars
     \begin{BlockClass}{author}
+    \renewcommand*{\cr}{}
+    \renewcommand*{\crcr}{}
+    \renewcommand*{\noalign}{}
         \renewcommand{\and}{
             \end{BlockClass}
             \begin{BlockClass}{oneauthor}
@@ -5175,11 +5279,11 @@
 \begin{warpHTML}
 
 \providecommand*{\abstractname}{Abstract}
-\DeclareDocumentEnvironment{abstract}{}
+\DeclareDocumentEnvironment{abstract}{O{\abstractname}}
 {
 \LWR at forcenewpage
 \BlockClass{abstract}
-\BlockClassSingle{abstracttitle}{\abstractname}
+\BlockClassSingle{abstracttitle}{#1}
 }
 {
 \endBlockClass
@@ -5331,16 +5435,19 @@
 
 \newcommand*{\LWR at printcloselist}{\LWR at printcloseitemize}
 
-\newcommand*{\LWR at printopenlist}{ul style="\mbox{list-style-type:none}"}
+\newcommand*{\LWR at printopenlist}{ul style="\LWR at origmbox{list-style-type:none}"}
 
-
+\AtBeginDocument{
 \def\@mklab#1{%
     #1}
+\let\makelabel\@mklab
+}
 
 \def\@donoparitem{%
   \@noparitemfalse
 }
-\def\@item[#1]{%
+\def\LWR at HTML@item[#1]{%
+\LWR at traceinfo{@item}
   \if at noparitem
     \@donoparitem
   \else
@@ -5365,7 +5472,7 @@
       \refstepcounter\@listctr
     \fi
   \fi
-        #1
+    \makelabel{#1}%
   \ignorespaces%
 }
 
@@ -5380,6 +5487,15 @@
 \LWR at origitem%
 }
 
+\newcommand*{\LWR at nulllistfills}{%
+\renewcommand*{\hss}{}%
+\renewcommand*{\llap}[1]{##1}%
+\renewcommand*{\rlap}[1]{##1}%
+\renewcommand*{\hfil}{}%
+\renewcommand*{\hfilneg}{}%
+\renewcommand*{\hfill}{}%
+}
+
 \newcommand*{\LWR at liststart}{%
 \LWR at traceinfo{LWR at liststart}%
 \LWR at stoppars%
@@ -5395,6 +5511,7 @@
 \setlength{\listparindent}{0pt}%
 \setlength{\itemindent}{0pt}%
 \setlength{\labelsep}{1em}%
+\LWR at nulllistfills%
 }
 \newcommand*{\LWR at listend}{%
 \LWR at traceinfo{LWR at listend}%
@@ -5414,8 +5531,9 @@
 
 \newcommand*{\LWR at itemizestart}{%
 \renewcommand*{\LWR at printcloselist}{\LWR at printcloseitemize}
-\renewcommand*{\LWR at printopenlist}{ul style="\mbox{list-style-type:none}"}
+\renewcommand*{\LWR at printopenlist}{ul style="\LWR at origmbox{list-style-type:none}"}
 \let\item\LWR at itemizeitem%
+\LWR at nulllistfills%
 }
 
 
@@ -5422,8 +5540,9 @@
 
 \newcommand*{\LWR at enumeratestart}{%
 \renewcommand*{\LWR at printcloselist}{\LWR at printcloseitemize}
-\renewcommand*{\LWR at printopenlist}{ul style="\mbox{list-style-type:none}"}
+\renewcommand*{\LWR at printopenlist}{ul style="\LWR at origmbox{list-style-type:none}"}
 \let\item\LWR at itemizeitem%
+\LWR at nulllistfills%
 }
 
 
@@ -5445,15 +5564,13 @@
 \renewcommand*{\LWR at printcloselist}{\LWR at printclosedescription}
 \renewcommand*{\LWR at printopenlist}{dl}
 \let\item\LWR at descitem%
+\LWR at nulllistfills%
 }
 
 
-\let\LWR at orig@trivlist\@trivlist
-\let\LWR at origtrivlist\trivlist
-\let\LWR at origendtrivlist\endtrivlist
-
 \newcommand*{\LWR at patchlists}{%
-    \let\item\LWR at listitem%
+    \LetLtxMacro\item\LWR at listitem%
+    \LetLtxMacro\@item\LWR at HTML@item%
     \renewcommand*{\@trivlist}{%
         \LWR at traceinfo{@trivlist start}%
         \LWR at liststart%
@@ -5460,26 +5577,33 @@
         \LWR at orig@trivlist%
         \LWR at traceinfo{@trivlist done}%
     }%
+    \renewcommand*{\trivlist}{%
+        \LWR at traceinfo{trivlist}%
+        \LWR at origtrivlist%
+    }%
     \renewcommand*{\endtrivlist}{%
         \LWR at traceinfo{endtrivlist start}%
         \LWR at origendtrivlist\LWR at listend%
         \LWR at traceinfo{endtrivlist done}%
     }%
-    \renewcommand*{\trivlist}{%
-        \LWR at traceinfo{trivlist}%
-        \LWR at origtrivlist%
-        \def\makelabel####1{\LWR at orighspace{3em}####1}%
+    \renewcommand*{\itemize}{%
+        \LWR at itemizestart\LWR at origitemize%
     }%
-    \renewcommand*{\itemize}{\LWR at itemizestart\LWR at origitemize}%
-    \renewcommand*{\enumerate}{\LWR at enumeratestart\LWR at origenumerate}%
-    \renewcommand*{\description}{\LWR at descriptionstart\LWR at origdescription}%
+    \renewcommand*{\enumerate}{%
+        \LWR at enumeratestart\LWR at origenumerate%
+    }%
+    \renewcommand*{\description}{%
+        \LWR at descriptionstart\LWR at origdescription%
+    }%
 }
 
 \newcommand*{\LWR at restoreoriglists}{%
+\LWR at traceinfo{LWR at restoreoriglists}%
+\LetLtxMacro\item\LWR at origitem%
+\LetLtxMacro\@item\LWR at orig@item%
 \let\@trivlist\LWR at orig@trivlist%
 \let\trivlist\LWR at origtrivlist%
 \let\endtrivlist\LWR at origendtrivlist%
-\LetLtxMacro\item\LWR at origitem%
 \LetLtxMacro\itemize\LWR at origitemize%
 \LetLtxMacro\enditemize\LWR at endorigitemize%
 \LetLtxMacro\enumerate\LWR at origenumerate%
@@ -5486,6 +5610,10 @@
 \LetLtxMacro\endenumerate\LWR at endorigenumerate%
 \LetLtxMacro\description\LWR at origdescription%
 \LetLtxMacro\enddescription\LWR at endorigdescription%
+\let\@mklab\LWR at orig@mklab%
+\let\makelabel\LWR at origmakelabel%
+\let\@donoparitem\LWR at orig@donoparitem%
+\let\@nbitem\LWR at orig@nbitem%
 }
 
 \end{warpHTML}
@@ -5599,6 +5727,10 @@
         {\LWR at getexparray{LWR at colafterspec}{\arabic{LWR at tablecolindex}}}%
         \ifbool{LWR at tableparcell}{\LWR at stoppars}{}%
         \global\boolfalse{LWR at tableparcell}%
+        \whileboolexpr{test {\ifnumcomp{\value{LWR at cellcolordepth}}{>}{0}}}{%
+            \LWR at htmltag{/div}\LWR at orignewline%
+            \addtocounter{LWR at cellcolordepth}{-1}%
+        }%
         \leavevmode\unskip\LWR at htmltag{/td}\LWR at orignewline%
         \global\booltrue{LWR at tabularcelladded}%
         \LWR at insertatbangcols%
@@ -5607,6 +5739,9 @@
 \global\boolfalse{LWR at skippingmrowcell}%
 \global\boolfalse{LWR at skippingmcolrowcell}%
 \global\boolfalse{LWR at skipatbang}%
+\renewcommand*{\LWR at cellHTMLcolor}{}
+\renewcommand*{\LWR at columnHTMLcolor}{}
+\setcounter{LWR at cellcolordepth}{0}
 }
 \let\LWR at origampmacro&
 
@@ -5690,6 +5825,7 @@
 \global\boolfalse{LWR at doingtbrule}%
 \global\boolfalse{LWR at doingcmidrule}%
 \LWR at clearmidrules%
+\renewcommand*{\LWR at rowHTMLcolor}{}
 \setcounter{LWR at tablecolindex}{1}%
 \boolfalse{LWR at tabularcelladded}%
 \LWR at getmynexttoken%
@@ -5795,8 +5931,9 @@
 
 
 \newbool{LWR at validtablecol}
+\newbool{LWR at opttablecol}
 \newcommand*{\LWR at parsetablecols}[1]{%
-\LWR at traceinfo{LWR at parsetablecols started}%
+\LWR at traceinfo{LWR at parsetablecols}%
 \renewcommand*{\LWR at origcolspec}{#1}%
 \expandarg%
 \StrSubstitute{\LWR at origcolspec}{ }{}[\LWR at origcolspec]%
@@ -5822,12 +5959,12 @@
 \LWR at setexparray{LWR at colbarspec}{2}{}%
 \LWR at setexparray{LWR at colbarspec}{3}{}%
 \setcounter{LWR at tablecolspecindex}{1}%
-\LWR at traceinfo{about to StrLen}%
 \expandarg%
 \StrLen{\LWR at origcolspec}[\LWR at strresult]%
 \fullexpandarg%
-\LWR at traceinfo{finished StrLen}%
+\LWR at traceinfo{original column spec length: \LWR at strresult}%
 \setcounter{LWR at tablecolspecwidth}{\LWR at strresult}%
+\boolfalse{LWR at opttablecol}%
 \whileboolexpr{%
     not test{%
         \ifnumcomp{\value{LWR at tablecolspecindex}}{>}{\value{LWR at tablecolspecwidth}}%
@@ -5839,6 +5976,10 @@
 \LWR at traceinfo{position \arabic{LWR at tablecolspecindex}: \LWR at strresult}%
 \fullexpandarg%
 \boolfalse{LWR at validtablecol}%
+\IfStrEq{\LWR at strresult}{[}{\booltrue{LWR at opttablecol}}{}%
+\ifbool{LWR at opttablecol}%
+{}% inside an optional argument
+{% not an optional tabular argument
 \IfStrEq{\LWR at strresult}{l}{\LWR at parsenormalcolumn{l}}{}%
 \IfStrEq{\LWR at strresult}{c}{\LWR at parsenormalcolumn{c}}{}%
 \IfStrEq{\LWR at strresult}{r}{\LWR at parsenormalcolumn{r}}{}%
@@ -5864,11 +6005,33 @@
     \LWR at traceinfo{invalid column type: \LWR at strresult}%
     \LWR at parsenormalcolumn{l}%
 }%
+}% not an optional column argument
+\IfStrEq{\LWR at strresult}{]}{\boolfalse{LWR at opttablecol}}{}%
 \addtocounter{LWR at tablecolspecindex}{1}%
 }% whiledo
+\LWR at traceinfo{LWR at parsetablecols: done}%
 }%
 
 
+\newcommand{\LWR at columnHTMLcolor}{}
+\newcommand{\LWR at rowHTMLcolor}{}
+\newcommand{\LWR at cellHTMLcolor}{}
+\newcommand{\LWR at ruleHTMLcolor}{}
+\NewDocumentCommand{\LWR at HTMLcolumncolor}{O{named} m o o}{}
+
+\NewDocumentCommand{\LWR at HTMLrowcolor}{O{named} m o o}{\LWR at getmynexttoken}
+
+\NewDocumentCommand{\LWR at HTMLcellcolor}{O{named} m o o}{}
+
+\newcommand{\arrayrulecolor}[2][named]{}
+
+\newcommand{\LWR at HTMLarrayrulecolor}[2][named]{\LWR at getmynexttoken}
+
+\newcommand{\doublerulesepcolor}[2][named]{}
+
+\newcommand{\LWR at HTMLdoublerulesepcolor}[2][named]{\LWR at getmynexttoken}
+
+
 \newcommand*{\LWR at maybenewtablerow}
 {%
 \ifbool{LWR at startedrow}%
@@ -5878,13 +6041,27 @@
     \global\booltrue{LWR at intabularmetadata}%
     \ifbool{LWR at doinghline}%
     {%
-        \LWR at htmltag{tr class="hline" }%
+        \ifdefvoid{\LWR at ruleHTMLcolor}{%
+            \LWR at htmltag{tr class="hline" }%
+        }{%
+            \LWR at htmltag{%
+                tr class="hline" %
+                style="border-top: 1px solid \#\LWR at ruleHTMLcolor "%
+            }%
+        }%
         \LWR at orignewline%
     }%
     {% not doing hline
         \ifbool{LWR at doingtbrule}%
         {%
-            \LWR at htmltag{tr class="tbrule"}%
+            \ifdefvoid{\LWR at ruleHTMLcolor}{%
+                \LWR at htmltag{tr class="tbrule"}%
+            }{%
+                \LWR at htmltag{%
+                    tr class="tbrule" %
+                    style="border-top: 1px solid \#\LWR at ruleHTMLcolor "%
+                }%
+            }%
             \LWR at orignewline%
         }%
         {\LWR at htmltag{tr}\LWR at orignewline}%
@@ -5918,6 +6095,7 @@
         "%
         \LWR at tdstartstyles%
         \LWR at addcmidrulewidth%
+        \LWR at addtabularrulecolors%
         \LWR at tdendstyles%
     }%
     \ifboolexpr{bool{LWR at tabularmutemods} or bool{LWR at emptyatbang}}%
@@ -5967,9 +6145,11 @@
         \LWR at addcmidrulewidth%
         \StrChar{\LWR at tablecolspec}{\arabic{LWR at tablecolindex}}[\LWR at thiscolspec]%
         \LWR at addformatwpalignment{\LWR at thiscolspec}%
+        \LWR at addtabularrowcolor%
+        \LWR at addtabularrulecolors%
         \LWR at tdendstyles%
         }%
-\LWR at traceinfo{LWR at tabledatasinglecolumntag: done printing td tag}%
+        \LWR at traceinfo{LWR at tabledatasinglecolumntag: done printing td tag}%
         \ifboolexpr{%
             test{ \ifdefstring{\LWR at strresult}{p} } or
             test{ \ifdefstring{\LWR at strresult}{m} } or
@@ -6073,7 +6253,9 @@
 }
 
 \newcommand*{\LWR at subaddcmidruletrim}[2]{%
-\setlength{\LWR at templengthone}{\LWR at getexparray{LWR at midrules}{\arabic{LWR at tablecolindex}}}%
+\setlength{\LWR at templengthone}{%
+        \LWR at getexparray{LWR at midrules}{\arabic{LWR at tablecolindex}}%
+}%
 \ifdimcomp{\LWR at templengthone}{>}{0pt}%
 {%
     \LWR at origtilde tdrule#1#2%
@@ -6092,23 +6274,30 @@
 
 \newcommand{\LWR at addrulewidth}[2]{%
 \ifboolexpr{%
-    test{\ifdimcomp{#1}{=}{0pt}}%
-    or ( test{\ifdimcomp{#1}{=}{#2}} and not bool{FormatWP} )%
+    test{\ifdimcomp{#1}{=}{0pt}} or
+    (
+        ( test{\ifdimcomp{#1}{=}{#2}} and not bool{FormatWP} )
+        and ( test {\ifdefvoid{\LWR at ruleHTMLcolor}} )
+    )
 }%
-{}% default width
-{% custom width
+{}% default width and color
+{% custom width and/or color
     \LWR at forceminwidth{#1}%
     \LWR at tdaddstyle%
     \uselengthunit{PT}%
     border-top:\rndprintlength{\LWR at atleastonept} solid %
-    \ifdimcomp{#1}{<}{\LWR at lightrulewidth}%
-    {\#A0A0A0}%
-    {% lightrule or heaver
-        \ifdimcomp{#1}{<}{\LWR at heavyrulewidth}%
-        {\#808080}%
-        {black}%
-    }% lightrule or heavier
-}% custom width
+    \ifdefvoid{\LWR at ruleHTMLcolor}{%
+        \ifdimcomp{#1}{<}{\LWR at lightrulewidth}%
+        {\#A0A0A0}%
+        {% lightrule or heaver
+            \ifdimcomp{#1}{<}{\LWR at heavyrulewidth}%
+            {\#808080}%
+            {black}%
+        }% lightrule or heavier
+    }{%
+        \#\LWR at ruleHTMLcolor%
+    }
+}% custom width and/or color
 }
 
 \newcommand{\LWR at addcmidrulewidth}{%
@@ -6117,7 +6306,7 @@
 
 \newcommand*{\LWR at WPcell}[2]{%
 \LWR at tdaddstyle%
-\mbox{text-align:#1}; \mbox{vertical-align:#2}%
+\LWR at origmbox{text-align:#1}; \LWR at origmbox{vertical-align:#2}%
 }
 
 \newcommand*{\LWR at addformatwpalignment}[1]{%
@@ -6135,7 +6324,72 @@
 }
 
 
+\newcommand*{\LWR at addtabularrowcolor}{%
+\ifbool{LWR at tabularmutemods}{}{%
+    \ifdefvoid{\LWR at rowHTMLcolor}{}%
+    {% row color
+        \LWR at tdaddstyle%
+        background:\#\LWR at rowHTMLcolor%
+    }% row color
+}%
+}
 
+\newcommand*{\LWR at addtabularhrulecolor}{%
+\ifboolexpr {
+    bool{LWR at doinghline} or
+    bool{LWR at doingtbrule}
+}{%
+    \ifdefvoid{\LWR at ruleHTMLcolor}{}%
+    {%
+        \LWR at tdaddstyle%
+        border-top: 1px solid \#\LWR at ruleHTMLcolor%
+    }{}%
+}{}%
+}
+
+\newcommand*{\LWR at addtabularrulecolors}{%
+\LWR at addtabularhrulecolor%
+\ifbool{LWR at tabularmutemods}{}{%
+    \ifnumequal{\value{LWR at tablecolindex}}{1}{%
+        \edef\LWR at tempone{\LWR at getexparray{LWR at colbarspec}{leftedge}}%
+        \ifdefstring{\LWR at tempone}{tvertbarl}{%
+                \LWR at tdaddstyle%
+                border-left: 1px solid \#\LWR at vertruleHTMLcolor%
+        }{}%
+    }{}%
+    \edef\LWR at tempone{\LWR at getexparray{LWR at colbarspec}{\arabic{LWR at tablecolindex}}}%
+    \ifdefstring{\LWR at tempone}{tvertbarr}{%
+            \LWR at tdaddstyle%
+            border-right: 1px solid \#\LWR at vertruleHTMLcolor%
+    }{}%
+}%
+}
+
+\newcounter{LWR at cellcolordepth}
+
+\newcommand*{\LWR at subaddtabularcellcolor}[1]{%
+\LWR at htmltag{div class="cellcolor" style="%
+    background:\#{}#1 %
+" }%
+\addtocounter{LWR at cellcolordepth}{1}%
+}
+
+\newcommand*{\LWR at addtabularcellcolor}{%
+\ifdefvoid{\LWR at cellHTMLcolor}%
+{%
+    \ifdefvoid{\LWR at rowHTMLcolor}%
+    {%
+        \ifdefvoid{\LWR at columnHTMLcolor}%
+        {}%
+        {\LWR at subaddtabularcellcolor{\LWR at columnHTMLcolor}}%
+    }%
+    {\LWR at subaddtabularcellcolor{\LWR at rowHTMLcolor}}%
+}%
+{\LWR at subaddtabularcellcolor{\LWR at cellHTMLcolor}}%
+}
+
+
+
 \newcounter{LWR at tablemulticolswidth}
 \newcounter{LWR at tablemulticolspos}
 
@@ -6157,9 +6411,9 @@
 \IfStrEq{\LWR at strresult}{S}{r}{}%
 \IfStrEq{\LWR at strresult}{X}{p}{}%
 \IfStrEq{\LWR at strresult}{|}{%
-    \ifnumcomp{\value{LWR at tablemulticolspos}}{=}{1}%
-        {\booltrue{LWR at mcolvertbarl}}%
-        {\booltrue{LWR at mcolvertbarr}}%
+    \ifnumcomp{\value{LWR at tablemulticolspos}}{=}{1}% left edge?
+        {\booltrue{LWR at mcolvertbarl}}% left edge
+        {\booltrue{LWR at mcolvertbarr}}% not left edge
 }{}%
 \LWR at traceinfo{lwr at printmccoltype done}%
 }
@@ -6225,6 +6479,19 @@
 }
 
 
+\newcommand*{\LWR at addmulticolvertrulecolor}{%
+\ifbool{LWR at tabularmutemods}{}{%
+    \ifbool{LWR at mcolvertbarl}{%
+        \LWR at tdaddstyle%
+        border-left: 1px solid \#\LWR at vertruleHTMLcolor%
+    }{}%
+    \ifbool{LWR at mcolvertbarr}{%
+        \LWR at tdaddstyle%
+        border-right: 1px solid \#\LWR at vertruleHTMLcolor%
+    }{}%
+}%
+}
+
 \newcommand{\LWR at multicoltext}{}
 
 \newcounter{LWR at lastmulticolumn}
@@ -6243,8 +6510,8 @@
 \IfValueT{#2}{ % rows?
 rowspan="#2" %
 \IfValueT{#1}{% vpos?
-\ifstrequal{#1}{b}{style="\mbox{vertical-align:bottom}" }{}%
-\ifstrequal{#1}{t}{style="\mbox{vertical-align:top}" }{}%
+\ifstrequal{#1}{b}{style="\LWR at origmbox{vertical-align:bottom}" }{}%
+\ifstrequal{#1}{t}{style="\LWR at origmbox{vertical-align:top}" }{}%
 }% vpos?
 }% rows?
  class="td%
@@ -6259,6 +6526,8 @@
 "%
 \LWR at tdstartstyles%
 \LWR at addcmidrulewidth%
+\LWR at addtabularhrulecolor%
+\LWR at addmulticolvertrulecolor%
 \LWR at addformatwpalignment{#5}%
 \LWR at tdendstyles%
 }% end of the opening table data tag
@@ -6481,6 +6750,12 @@
     {\let\mynext\LWR at donothing}{}%
 \ifdefequal{\LWR at mynexttoken}{\bottomrule}%
     {\let\mynext\LWR at donothing}{}%
+\ifdefequal{\LWR at mynexttoken}{\rowcolor}%
+    {\let\mynext\LWR at donothing}{}%
+\ifdefequal{\LWR at mynexttoken}{\arrayrulecolor}%
+    {\let\mynext\LWR at donothing}{}%
+\ifdefequal{\LWR at mynexttoken}{\doublerulesepcolor}%
+    {\let\mynext\LWR at donothing}{}%
 \ifdefequal{\LWR at mynexttoken}{\warpprintonly}%
     {\let\mynext\LWR at donothing}{}%
 \ifdefequal{\LWR at mynexttoken}{\warpHTMLonly}%
@@ -6514,10 +6789,10 @@
 
 
 \begin{warpHTML}
-\newcommand*{\LWR at origtoprule}[1]{\hline}
-\newcommand*{\LWR at origmidrule}[1]{\hline}
+\newcommand*{\LWR at origtoprule}[1][]{\hline}
+\newcommand*{\LWR at origmidrule}[1][]{\hline}
 \LetLtxMacro\LWR at origcmidrule\cline
-\newcommand*{\LWR at origbottomrule}[1]{\hline}
+\newcommand*{\LWR at origbottomrule}[1][]{\hline}
 \newcommand*{\LWR at origaddlinespace}[1][]{}
 \newcommand*{\LWR at origmorecmidrules}{}
 \newcommand*{\LWR at origspecialrule}[3]{\hline}
@@ -6524,7 +6799,7 @@
 \AtBeginDocument{
 \@ifpackageloaded{lwarp-tabls}
 {
-\newcommand*{\LWR at hline}[1][]{%
+\newcommand*{\LWR at HTMLhline}[1][]{%
     \ifbool{FormatWP}%
     {\LWR at docmidrule{1-\arabic{LWR at tabletotalcols}}}%
     {\booltrue{LWR at doinghline}}%
@@ -6531,7 +6806,7 @@
     \LWR at getmynexttoken}%
 }
 {
-\newcommand*{\LWR at hline}{%
+\newcommand*{\LWR at HTMLhline}{%
     \ifbool{FormatWP}%
     {\LWR at docmidrule{1-\arabic{LWR at tabletotalcols}}}%
     {\booltrue{LWR at doinghline}}%
@@ -6539,6 +6814,9 @@
 }
 }% AtBeginDocument
 
+\NewDocumentCommand{\LWR at HTMLcline}{m}%
+{\LWR at docmidrule{#1}\LWR at getmynexttoken}%
+
 \AtBeginDocument{
 \@ifundefined{frenchbsetup}%
 {% no babel-french
@@ -6575,10 +6853,19 @@
 \boolfalse{LWR at tabularcelladded}%
 \LWR at clearmidrules%
 \LetLtxMacro{\\}{\LWR at tabularendofline}%
+\LetLtxMacro\columncolor\LWR at HTMLcolumncolor
+\LetLtxMacro\rowcolor\LWR at HTMLrowcolor
+\LetLtxMacro\cellcolor\LWR at HTMLcellcolor
+\LetLtxMacro\arrayrulecolor\LWR at HTMLarrayrulecolor
+\LetLtxMacro\doublerulesepcolor\LWR at HTMLdoublerulesepcolor
+\renewcommand*{\LWR at columnHTMLcolor}{}
+\renewcommand*{\LWR at rowHTMLcolor}{}
+\renewcommand*{\LWR at cellHTMLcolor}{}
+\edef\LWR at vertruleHTMLcolor{\LWR at ruleHTMLcolor}
+\setcounter{LWR at cellcolordepth}{0}
 \LWR at traceinfo{LWR at tabular: redefining macros}%
-\renewcommand*{\hline}{\LWR at hline}%
-\RenewDocumentCommand{\cline}{m}%
-{\LWR at docmidrule{##1}\LWR at getmynexttoken}%
+\LetLtxMacro\hline\LWR at HTMLhline%
+\LetLtxMacro\cline\LWR at HTMLcline%
 \DeclareDocumentCommand{\toprule}{o d()}
     {%
         \IfValueTF{##1}%
@@ -6625,7 +6912,7 @@
     \LWR at maybenewtablerow%
     \global\booltrue{LWR at skippingmcolrowcell}%
 }%
-\LetLtxMacro{\caption}{\LWR at longtabledatacaptiontag}%
+\LetLtxMacro\caption\LWR at longtabledatacaptiontag%
 \global\boolfalse{LWR at tableparcell}%
 \global\boolfalse{LWR at skippingmrowcell}%
 \global\boolfalse{LWR at skippingmcolrowcell}%
@@ -6730,16 +7017,16 @@
     {% pars allowed
         \ifbool{LWR at doingapar}%
         {% par started
-            \LWR at htmltag{a \mbox{id="\LWR at sanitized"}}\LWR at htmltag{/a}%
+            \LWR at htmltag{a \LWR at origmbox{id="\LWR at sanitized"}}\LWR at htmltag{/a}%
         }% par started
         {% par not started
             \LWR at stoppars%
-            \LWR at htmltag{a \mbox{id="\LWR at sanitized"}}\LWR at htmltag{/a}%
+            \LWR at htmltag{a \LWR at origmbox{id="\LWR at sanitized"}}\LWR at htmltag{/a}%
             \LWR at startpars%
         }% par not started
     }% pars allowed
     {% pars not allowed
-        \LWR at htmltag{a \mbox{id="\LWR at sanitized"}}\LWR at htmltag{/a}%
+        \LWR at htmltag{a \LWR at origmbox{id="\LWR at sanitized"}}\LWR at htmltag{/a}%
     }% pars not allowed
 }% not lateximage
 }
@@ -6763,7 +7050,7 @@
 \LWR at traceinfo{LWR at startref A: !#1!}%
 \LWR at htmltag{a href="%
 \LWR at traceinfo{LWR at startref B}%
-\mbox{\LWR at htmlrefsectionfilename{#1}}%
+\LWR at origmbox{\LWR at htmlrefsectionfilename{#1}}%
 \LWR at traceinfo{LWR at startref C}%
 \#%
 \LWR at traceinfo{LWR at startref D: !#1!}%
@@ -6781,7 +7068,7 @@
     }%
     {%
         \LWR at traceinfo{LWR at startref D3}%
-        \mbox{\LWR at sanitized}%
+        \LWR at origmbox{\LWR at sanitized}%
     }%
 }%
 \LWR at traceinfo{LWR at startref E}%
@@ -6897,7 +7184,7 @@
 \booltrue{LWR at freezethisautoid}%
 \begingroup%
 \LWR at origraggedright%
-\LWR at htmltag{figure id="\mbox{autoid-\arabic{LWR at thisautoid}}" class="#1"}%
+\LWR at htmltag{figure id="\LWR at origmbox{autoid-\arabic{LWR at thisautoid}}" class="#1"}%
 \ifbool{FormatWP}{%
     \LWR at orignewline%
     \LWR at BlockClassWP{}{}{wp#1}%
@@ -6940,7 +7227,7 @@
 \newcommand*{\LWR at newautoidanchor}{%
 \ifbool{LWR at freezethisautoid}{}{%
     \addtocounter{LWR at thisautoid}{1}%
-    \LWR at htmltag{a id="\mbox{autoid-\arabic{LWR at thisautoid}}"}\LWR at htmltag{/a}%
+    \LWR at htmltag{a id="\LWR at origmbox{autoid-\arabic{LWR at thisautoid}}"}\LWR at htmltag{/a}%
 }%
 }
 
@@ -6970,7 +7257,7 @@
 \newenvironment*{LWR at figcaption}
 {%
 \LWR at traceinfo{LWR at figcaption env start}%
-\LWR at htmlblocktag{figcaption}
+\LWR at htmlblocktag{figcaption}%
 \ifbool{FormatWP}{%
 \begin{BlockClass}[font-style:italic]{italic}
 \LWR at origvspace*{\baselineskip}
@@ -6984,15 +7271,16 @@
 \LWR at traceinfo{LWR at figcaption env end: done}%
 }
 
-\let\LWR at origcaption@begin\caption at begin
-\let\LWR at origcaption@end\caption at end
-\let\LWR at orig@@par\@@par
+\AtBeginDocument{
+\LetLtxMacro\LWR at origcaption@begin\caption at begin
+\LetLtxMacro\LWR at origcaption@end\caption at end
+}
 
 \newcommand{\LWR at caption@begin}[1]
 {
 \LWR at traceinfo{LWR at caption@begin}%
 \begingroup%
-\renewcommand{\@@par}{\LWR at closeparagraph\LWR at orig@@par}%
+\@setpar{\LWR at closeparagraph\@@par}%
 \RenewDocumentEnvironment{minipage}{O{t} o O{t} m}{}{}%
 \RenewDocumentCommand{\parbox}{O{t} o O{t} m +m}{##5}%
 \LWR at figcaption%
@@ -7005,7 +7293,6 @@
 {%
 \LWR at traceinfo{LWR at caption@end}%
 \LWR at origcaption@end%
-\LWR at origvspace*{\baselineskip}%
 \endLWR at figcaption%
 \endgroup%
 \LWR at traceinfo{LWR at caption@end: done}%
@@ -7025,7 +7312,7 @@
 
 \def\LWR at LTcaptionlistentry{%
 \LWR at ensuredoingapar%
-\LWR at htmltag{a id="\mbox{autoid-\arabic{LWR at thisautoid}}"}\LWR at htmltag{/a}%
+\LWR at htmltag{a id="\LWR at origmbox{autoid-\arabic{LWR at thisautoid}}"}\LWR at htmltag{/a}%
   \bgroup
   \@ifstar{\egroup\LWR at LT@captionlistentry}% gobble *
           {\egroup\LWR at LT@captionlistentry}}%
@@ -7197,7 +7484,7 @@
 \ifthenelse{\cnttest{#1}{<=}{\value{tocdepth}}}{%
     \LWR at startpars%
     \LWR at subhyperrefclass{%
-        \LWR at htmlrefsectionfilename{autopage-#4}\#\mbox{autosec-#4}%
+        \LWR at htmlrefsectionfilename{autopage-#4}\#\LWR at origmbox{autosec-#4}%
     }{#3}{toc#2}%
     \LWR at stoppars%
 }
@@ -7226,22 +7513,29 @@
     \LWR at startpars%
     \LWR at subhyperrefclass{%
     \LWR at htmlrefsectionfilename{autopage-\arabic{LWR at nextautopage}}%
-    \#\mbox{autoid-\arabic{LWR at nextautoid}}}%
+    \#\LWR at origmbox{autoid-\arabic{LWR at nextautoid}}}%
     {#4}{toc#2}%
     \LWR at stoppars%
 }{}%
 }
 
-\renewcommand{\l at part}[2]{\hypertoc{-1}{part}{#1}{#2}}
+\DeclareDocumentCommand{\l at part}{m m}{\hypertoc{-1}{part}{#1}{#2}}
+
 \DeclareDocumentCommand{\l at chapter}{m m}
     {\hypertoc{0}{chapter}{#1}{#2}}
+
 \renewcommand{\l at section}[2]{\hypertoc{1}{section}{#1}{#2}}
+
 \renewcommand{\l at subsection}[2]{\hypertoc{2}{subsection}{#1}{#2}}
-\renewcommand{\l at subsubsection}[2]
-    {\hypertoc{3}{subsubsection}{#1}{#2}}
+
+\renewcommand{\l at subsubsection}[2]{\hypertoc{3}{subsubsection}{#1}{#2}}
+
 \renewcommand{\l at paragraph}[2]{\hypertoc{4}{paragraph}{#1}{#2}}
+
 \renewcommand{\l at subparagraph}[2]{\hypertoc{5}{subparagraph}{#1}{#2}}
+
 \renewcommand{\l at figure}[2]{\hypertocfloat{1}{figure}{lof}{#1}{#2}}
+
 \renewcommand{\l at table}[2]{\hypertocfloat{1}{table}{lot}{#1}{#2}}
 
 \end{warpHTML}
@@ -7321,6 +7615,13 @@
 \providecommand{\glo at name}{}
 \end{warpall}
 \begin{warpHTML}
+\def\bibliography#1{%
+    \if at filesw
+    \immediate\write\@auxout{\string\bibdata{#1}}%
+    \fi
+    \@input@{\BaseJobname.bbl}% lwarp
+}
+\renewcommand{\@biblabel}[1]{[#1]\quad}
 \AtBeginDocument{
 \AtBeginEnvironment{thebibliography}{
 \providecommand*{\LWR at newem}[1]{\textit{#1}}
@@ -7346,12 +7647,34 @@
 \newcommand*{\LWR at restoreorigformatting}{%
 \LWR at traceinfo{LWR at restoreorigformatting}%
 \linespread{1}%
+\LetLtxMacro\caption at begin\LWR at origcaption@begin%
+\LetLtxMacro\caption at end\LWR at origcaption@end%
+\let\par\LWR at origpar%
 \LetLtxMacro\ref\LWR at origref%{} syntax highlighting
+\let\normalsize\LWR at orignormalsize%
+\let\small\LWR at origsmall%
+\let\footnotesize\LWR at origfootnotesize%
+\let\scriptsize\LWR at origscriptsize%
+\let\tiny\LWR at origtiny%
+\let\large\LWR at origlarge%
+\let\Large\LWR at origLarge%
+\let\LARGE\LWR at origLARGE%
+\let\huge\LWR at orighuge%
+\let\Huge\LWR at origHuge%
 \RenewDocumentCommand{\InlineClass}{o m +m}{##3}%
 \RenewDocumentEnvironment{BlockClass}{o m}{}{}%
 \renewcommand{\BlockClassSingle}[2]{##2}%
 \LetLtxMacro{\hspace}{\LWR at orighspace}%
+\LetLtxMacro\hfill\LWR at orighfill%
+\LetLtxMacro\hfil\LWR at orighfil%
 \LetLtxMacro\rule\LWR at origrule%
+\LetLtxMacro\hrulefill\LWR at orighrulefill%
+\LetLtxMacro\dotfill\LWR at origdotfill%
+\let\vspace\LWR at origvspace%
+\let\hss\LWR at orighss%
+\let\llap\LWR at origllap%
+\let\rlap\LWR at origrlap%
+\let\hfilneg\LWR at orighfilneg%
 \let\,\LWR at origcomma% disable HTML short unbreakable space
 \let\textellipsis\LWR at origtextellipsis%
 \let\textless\LWR at origtextless%
@@ -7389,8 +7712,9 @@
 \let\enskip\LWR at origenskip%
 \let\quad\LWR at origquad%
 \let\qquad\LWR at origqquad%
-\LetLtxMacro{\tabular}{\LWR at origtabular}%
-\LetLtxMacro{\endtabular}{\LWR at origendtabular}%
+\LetLtxMacro\tabular\LWR at origtabular%
+\LetLtxMacro\endtabular\LWR at origendtabular%
+\LetLtxMacro\hline\LWR at orighline%
 \LetLtxMacro\toprule\LWR at origtoprule%
 \LetLtxMacro\midrule\LWR at origmidrule%
 \LetLtxMacro\cmidrule\LWR at origcmidrule%
@@ -7406,6 +7730,7 @@
 \let\reflectbox\LWR at origreflectbox%
 \LetLtxMacro\resizebox\LWR at origresizebox%
 \let\framebox\LWR at origframebox%
+\LetLtxMacro\mbox\LWR at origmbox%
 \let\makebox\LWR at origmakebox%
 \let\fbox\LWRprint at fbox%
 \let\fboxBlock\LWRprint at fbox%
@@ -7503,7 +7828,7 @@
     {}%
     \ifdimgreater{\LWR at singledollardepth}{0.01em}{%
         \def\LWR at singledollardepthstyle{%
-            \ ; \mbox{vertical-align:-\LWR at convertto{em}{\the\LWR at singledollardepth} em} %
+            \ ; \LWR at origmbox{vertical-align:-\LWR at convertto{em}{\the\LWR at singledollardepth} em} %
         }%
     }{%
         \def\LWR at singledollardepthstyle{}%
@@ -8065,7 +8390,9 @@
     \LWR at htmltag{span id="lateximage\arabic{LWR at lateximagenumber}" %
     class="lateximagesource"}%
     \LWR at traceinfo{lateximage: about to write to lateximages.txt}%
-    \immediate\write\LWR at lateximagesfile{|\arabic{LWR at LIpage}|\arabic{LWR at externalfilecnt}|}%
+    \immediate\write\LWR at lateximagesfile{%
+        |\arabic{LWR at LIpage}|\arabic{LWR at externalfilecnt}|%
+    }%
     \LWR at traceinfo{lateximage: about to create open comment}%
     \LWR at htmlopencomment%
     \addtocounter{LWR at lateximagedepth}{1}%
@@ -8103,7 +8430,7 @@
     \LWR at htmlclosecomment%
     \LWR at traceinfo{lateximage: The page after the image is \arabic{page}}%
     \LWR at subinlineimage[#1]{lateximage}%
-    {lateximages\OSPathSymbol{}\mbox{lateximage-\theLWR at externalfilecnt}}{svg}{#2}%
+    {lateximages\OSPathSymbol{}\LWR at origmbox{lateximage-\theLWR at externalfilecnt}}{svg}{#2}%
     \LWR at ensuredoingapar%
     \LWR at htmltag{/span}%
     \ifbool{HTMLDebugComments}{%
@@ -8117,7 +8444,11 @@
 \end{warpHTML}
 
 \begin{warpprint}
-\NewDocumentEnvironment{lateximage}{O{image}O{}}{}{}
+
+\NewDocumentEnvironment{lateximage}{o o}
+    {\begin{varwidth}[b]{\linewidth}}
+    {\end{varwidth}}
+
 \end{warpprint}
 
 
@@ -8127,7 +8458,7 @@
 {
 \LWR at forcenewpage
 \ifbool{FormatWP}
-{\BlockClass[\mbox{text-align:center}]{center}}
+{\BlockClass[\LWR at origmbox{text-align:center}]{center}}
 {\BlockClass{center}}
 }
 {\endBlockClass}
@@ -8136,7 +8467,7 @@
 {
 \LWR at forcenewpage
 \ifbool{FormatWP}
-{\BlockClass[\mbox{text-align:right}]{flushright}}
+{\BlockClass[\LWR at origmbox{text-align:right}]{flushright}}
 {\BlockClass{flushright}}
 }
 {\endBlockClass}
@@ -8145,11 +8476,17 @@
 {
 \LWR at forcenewpage
 \ifbool{FormatWP}
-{\BlockClass[\mbox{text-align:left}]{flushleft}}
+{\BlockClass[\LWR at origmbox{text-align:left}]{flushleft}}
 {\BlockClass{flushleft}}
 }
 {\endBlockClass}
 
+\renewcommand{\leftline}[1]{\begin{flushleft}#1\end{flushleft}}
+
+\renewcommand{\centerline}[1]{\begin{center}#1\end{center}}
+
+\renewcommand{\rightline}[1]{\begin{flushright}#1\end{flushright}}
+
 \end{warpHTML}
 
 \begin{warpHTML}
@@ -8306,25 +8643,100 @@
 \AfterEndPreamble{
 \LWR at traceinfo{Patching cleveref.}
 
+\def\LWR at orig@@@setcref#1#2{\cref at getlabel{#2}{\@templabel}#1{\@templabel}{}{}}%
 
+\ifdefequal{\@@setcref}{\LWR at orig@@@setcref}{% before v0.21
+    \renewcommand*{\@@setcref}[2]{#1{\ref{#2}}{}{}}
+}{
+    \ifdefequal{\@@@setcref}{\LWR at orig@@@setcref}{% as of v0.21
+        \renewcommand*{\@@@setcref}[2]{#1{\ref{#2}}{}{}}
+    }{
+        \PackageWarning{lwarp-cleveref}{
+            Unknown verison of cleveref.
+            \protect\cref\space will fail.
+        }%
+    }
+}
 
+\def\LWR at orig@@@setcrefrange#1#2#3{%
+  \cref at getlabel{#2}{\@labela}%
+  \cref at getlabel{#3}{\@labelb}%
+  #1{\@labela}{\@labelb}{}{}{}{}}%
 
-\renewcommand*{\@@setcref}[2]{#1{\ref{#2}}{}{}}
+\ifdefequal{\@@setcrefrange}{\LWR at orig@@@setcrefrange}{
+    \renewcommand{\@@setcrefrange}[3]{%
+        #1{\ref{#2}}{\ref{#3}}{}{}{}{}%
+    }
+}{
+    \ifdefequal{\@@@setcrefrange}{\LWR at orig@@@setcrefrange}{
+        \renewcommand{\@@@setcrefrange}[3]{%
+            #1{\ref{#2}}{\ref{#3}}{}{}{}{}%
+        }
+    }{
+        \PackageWarning{lwarp-cleveref}{
+            Unknown verison of cleveref.
+            \protect\crefrange\space will fail.
+        }
+    }
+}
 
 
-\renewcommand{\@@setcrefrange}[3]{%
-#1{\ref{#2}}{\ref{#3}}{}{}{}{}}
 
-
 \newcommand*{\cpagerefFor}{for}
 
-\renewcommand*{\@@setcpageref}[2]{%
-#1{\cpagerefFor\ \cref{#2}}{}{}%
+\def\LWR at orig@@setcpageref#1#2{% before v0.21
+  \cref at getpageref{#2}{\@temppage}#1{\@temppage}{}{}}%
+
+\def\LWR at orig@@@setcpageref#1#2{% as of v0.21
+  \cpageref at getlabel{#2}{\@temppage}#1{\@temppage}{}{}}%
+
+\ifdefequal{\@@setcpageref}{\LWR at orig@@setcpageref}{
+    \renewcommand*{\@@setcpageref}[2]{%
+        #1{\cpagerefFor\ \cref{#2}}{}{}%
+    }
+}{
+    \ifdefequal{\@@@setcpageref}{\LWR at orig@@@setcpageref}{
+        \renewcommand*{\@@@setcpageref}[2]{%
+            #1{\cpagerefFor\ \cref{#2}}{}{}%
+        }
+    }
+    {
+        \PackageWarning{lwarp-cleveref}{
+            Unknown verison of cleveref.
+            \protect\cpageref\space will fail.
+        }
+    }
 }
 
 
-\renewcommand{\@@setcpagerefrange}[3]{%
-#1{\cpagerefFor\ \cref{#2}}{\cref{#3}}{}{}{}{}}
+\def\LWR at orig@@setcpagerefrange#1#2#3{% before v0.21
+  \cref at getpageref{#2}{\@pagea}%
+  \cref at getpageref{#3}{\@pageb}%
+  #1{\@pagea}{\@pageb}{}{}{}{}}%
+
+\def\LWR at orig@@@setcpagerefrange#1#2#3{% as of v0.21
+  \cpageref at getlabel{#2}{\@pagea}%
+  \cpageref at getlabel{#3}{\@pageb}%
+  #1{\@pagea}{\@pageb}{}{}{}{}}%
+
+\ifdefequal{\@@setcpagerefrange}{\LWR at orig@@setcpagerefrange}{
+    \renewcommand*{\@@setcpagerefrange}[3]{%
+        #1{\cpagerefFor\ \cref{#2}}{\cref{#3}}{}{}{}{}%
+    }
+}{
+    \ifdefequal{\@@@setcpagerefrange}{\LWR at orig@@@setcpagerefrange}{
+        \renewcommand*{\@@@setcpagerefrange}[3]{%
+            #1{\cpagerefFor\ \cref{#2}}{\cref{#3}}{}{}{}{}%
+        }
+    }
+    {
+        \PackageWarning{lwarp-cleveref}{
+            Unknown verison of cleveref.
+            \protect\cpagerefrange\space will fail.
+        }
+    }
+}
+
 }% AfterEndPreamble
 
 \LetLtxMacro\LWR at origlabel\label
@@ -8387,18 +8799,18 @@
 \ifbool{FormatWP}{%
 
 \addtocounter{LWR at thisautoidWP}{1}%
-\LWR at htmltag{div id="\mbox{autoidWP-\arabic{LWR at thisautoidWP}}" class="wpminipage"}%
+\LWR at htmltag{div id="\LWR at origmbox{autoidWP-\arabic{LWR at thisautoidWP}}" class="wpminipage"}%
 
 }{}%
 \LWR at traceinfo{minipage: creating div class}%
 \LWR at htmltag{div class="minipage" style="%
-\ifthenelse{\equal{#1}{t}}{\mbox{vertical-align:bottom} ; }{}%
-\ifthenelse{\equal{#1}{c}}{\mbox{vertical-align:middle} ; }{}%
-\ifthenelse{\equal{#1}{b}}{\mbox{vertical-align:top} ; }{}%
-\ifthenelse{\equal{#3}{t}}{\mbox{justify-content:flex-start} ; }{}%
-\ifthenelse{\equal{#3}{c}}{\mbox{justify-content:center} ; }{}%
-\ifthenelse{\equal{#3}{b}}{\mbox{justify-content:flex-end} ; }{}%
-\ifthenelse{\equal{#3}{s}}{\mbox{justify-content:space-between} ; }{}%
+\ifthenelse{\equal{#1}{t}}{\LWR at origmbox{vertical-align:bottom} ; }{}%
+\ifthenelse{\equal{#1}{c}}{\LWR at origmbox{vertical-align:middle} ; }{}%
+\ifthenelse{\equal{#1}{b}}{\LWR at origmbox{vertical-align:top} ; }{}%
+\ifthenelse{\equal{#3}{t}}{\LWR at origmbox{justify-content:flex-start} ; }{}%
+\ifthenelse{\equal{#3}{c}}{\LWR at origmbox{justify-content:center} ; }{}%
+\ifthenelse{\equal{#3}{b}}{\LWR at origmbox{justify-content:flex-end} ; }{}%
+\ifthenelse{\equal{#3}{s}}{\LWR at origmbox{justify-content:space-between} ; }{}%
 \LWR at traceinfo{minipage: about to print the width of \rndprintlength{\LWR at minipagewidth}}%
 \uselengthunit{PT}%
 \ifbool{LWR at minipagefullwidth}%
@@ -8444,7 +8856,6 @@
 }{}%
 \LWR at htmldivclassend{minipage}%
 
-\LWR at origvspace{1\baselineskip}% required for subcaption
 \addtocounter{LWR at minipagedepth}{-1}%
 \LWR at startpars%
 \ifbool{FormatWP}{\newline}{}%
@@ -8457,8 +8868,7 @@
 #5
 \end{minipage}%
 }
-\LetLtxMacro\LWR at origmakebox\makebox
-
+\renewcommand*{\mbox}[1]{#1}
 \RenewDocumentCommand{\makebox}{d() o o m}{%
 \IfValueTF{#2}%
 {%
@@ -8470,8 +8880,8 @@
     \setlength{\LWR at tempwidth}{#2}%
     \uselengthunit{PT}%
     \InlineClass[%
-        \mbox{display:inline-block} ; %
-        \mbox{text-align}:\LWR at align\ ; %
+        \LWR at origmbox{display:inline-block} ; %
+        \LWR at origmbox{text-align}:\LWR at align\ ; %
         width:\rndprintlength{\LWR at tempwidth}%
     ]%
     {makebox}%
@@ -8702,27 +9112,43 @@
 \DeclareExpandableDocumentCommand{\InlineClass}{+o +m +m}{##3}%
 \DeclareRobustCommand{\LWR at HTMLtextstyle}[3]{##3}%
 \DeclareRobustCommand{\LWR at subsingledollar}[1]{}%
+\renewcommand*{\newline}{ }%
 }
 
-\renewcommand*{\mdseries}{}
 
-\renewcommand*{\bfseries}{}
+\newcommand*{\LWR at f@family}{rm}
+\newcommand*{\LWR at f@series}{md}
+\newcommand*{\LWR at f@shape}{up}
 
-\renewcommand*{\rmfamily}{}
+\newcommand*{\LWR at textcurrentfont}[1]{%
+\csuse{text\LWR at f@family}{%
+\csuse{text\LWR at f@series}{%
+\csuse{text\LWR at f@shape}{%
+#1%
+}%
+}%
+}%
+}
 
-\renewcommand*{\sffamily}{}
+\renewcommand*{\mdseries}{\renewcommand*{\LWR at f@series}{md}}
 
-\renewcommand*{\ttfamily}{}
+\renewcommand*{\bfseries}{\renewcommand*{\LWR at f@series}{bf}}
 
-\renewcommand*{\upshape}{}
+\renewcommand*{\rmfamily}{\renewcommand*{\LWR at f@family}{rm}}
 
-\renewcommand*{\itshape}{}
+\renewcommand*{\sffamily}{\renewcommand*{\LWR at f@family}{sf}}
 
-\renewcommand*{\scshape}{}
+\renewcommand*{\ttfamily}{\renewcommand*{\LWR at f@family}{tt}}
 
-\renewcommand*{\normalfont}{}
+\renewcommand*{\upshape}{\renewcommand*{\LWR at f@shape}{up}}
 
+\renewcommand*{\itshape}{\renewcommand*{\LWR at f@shape}{it}}
 
+\renewcommand*{\scshape}{\renewcommand*{\LWR at f@shape}{sc}}
+
+\renewcommand*{\normalfont}{\rmfamily\mdseries\upshape}
+
+
 \renewcommand{\sp}[1]{\text{<sup>#1</sup>}{}}
 
 
@@ -8750,28 +9176,11 @@
     {underline}{#1}%
 }
 
-\renewcommand*{\hfill}{\qquad}
-
-\renewcommand*{\hrulefill}{\rule{1in}{1pt}}
-
-\renewcommand*{\dotfill}{\dots}
-
 \end{warpHTML}
 
 
 \begin{warpHTML}
 
-\let\LWR at origcomma\,
-\let\LWR at origtilde~
-\let\LWR at origenskip\enskip
-\let\LWR at origquad\quad
-\let\LWR at origqquad\qquad
-\let\LWR at orighspace\hspace
-\let\LWR at origvspace\vspace
-\let\LWR at origrule\rule
-\let\LWR at origmedskip\medskip
-\let\LWR at origbigskip\bigskip
-\let\LWR at origtextellipsis\textellipsis
 
 \renewrobustcmd*{\,}{\HTMLunicode{202f}} % HTML thin non-breakable space
 
@@ -8778,16 +9187,6 @@
 \renewrobustcmd*{~}{\HTMLentity{nbsp}}
 
 \renewrobustcmd*{\textellipsis}{\HTMLunicode{2026}}
-\let\LWR at orignormalsize\normalsize
-\let\LWR at origsmall\small
-\let\LWR at origfootnotesize\footnotesize
-\let\LWR at origscriptsize\scriptsize
-\let\LWR at origtiny\tiny
-\let\LWR at origlarge\large
-\let\LWR at origLarge\Large
-\let\LWR at origLARGE\LARGE
-\let\LWR at orighuge\huge
-\let\LWR at origHuge\Huge
 \renewcommand*{\normalsize}{}
 \renewcommand*{\small}{}
 \renewcommand*{\footnotesize}{}
@@ -8807,6 +9206,12 @@
 
 }
 
+\renewcommand*{\hfill}{\qquad}
+
+\renewcommand*{\hrulefill}{\rule{1in}{1pt}}
+
+\renewcommand*{\dotfill}{\dots}
+
 \renewcommand*{\newpage}{
 
 }



More information about the tex-live-commits mailing list