texlive[45648] trunk: lwarp (30oct17)

commits+karl at tug.org commits+karl at tug.org
Mon Oct 30 21:40:38 CET 2017


Revision: 45648
          http://tug.org/svn/texlive?view=revision&revision=45648
Author:   karl
Date:     2017-10-30 21:40:38 +0100 (Mon, 30 Oct 2017)
Log Message:
-----------
lwarp (30oct17)

Modified Paths:
--------------
    trunk/Build/source/texk/texlive/linked_scripts/lwarp/lwarpmk.lua
    trunk/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl
    trunk/Master/texmf-dist/doc/latex/lwarp/README.txt
    trunk/Master/texmf-dist/doc/latex/lwarp/lwarp.pdf
    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-algorithmicx.sty
    trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-epigraph.sty
    trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-fancybox.sty
    trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-floatflt.sty
    trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-graphics.sty
    trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-keyfloat.sty
    trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-mdframed.sty
    trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-moreverb.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-sidenotes.sty
    trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-siunitx.sty
    trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-soul.sty
    trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-subfig.sty
    trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-textcomp.sty
    trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-theorem.sty
    trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-titleps.sty
    trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-titlesec.sty
    trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-titletoc.sty
    trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-titling.sty
    trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-tocloft.sty
    trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-ulem.sty
    trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-verse.sty
    trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-wrapfig.sty
    trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-xcolor.sty
    trunk/Master/texmf-dist/tex/latex/lwarp/lwarp.sty

Added Paths:
-----------
    trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-morewrites.sty
    trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-overpic.sty

Modified: trunk/Build/source/texk/texlive/linked_scripts/lwarp/lwarpmk.lua
===================================================================
--- trunk/Build/source/texk/texlive/linked_scripts/lwarp/lwarpmk.lua	2017-10-30 20:40:11 UTC (rev 45647)
+++ trunk/Build/source/texk/texlive/linked_scripts/lwarp/lwarpmk.lua	2017-10-30 20:40:38 UTC (rev 45648)
@@ -4,7 +4,7 @@
 
 -- Print the usage of the lwarpmk command:
 
-printversion = "v0.41"
+printversion = "v0.42"
 
 function printhelp ()
 print ("lwarpmk: Use lwarpmk -h or lwarpmk --help for help.") ;

Modified: trunk/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl
===================================================================
--- trunk/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl	2017-10-30 20:40:11 UTC (rev 45647)
+++ trunk/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl	2017-10-30 20:40:38 UTC (rev 45648)
@@ -1,5 +1,5 @@
 #!/usr/bin/env perl
-# $Id: tlmgr.pl 45613 2017-10-26 23:18:10Z preining $
+# $Id: tlmgr.pl 45623 2017-10-27 14:41:58Z preining $
 #
 # Copyright 2008-2017 Norbert Preining
 # This file is licensed under the GNU General Public License version 2
@@ -6,8 +6,8 @@
 # or any later version.
 #
 
-my $svnrev = '$Revision: 45613 $';
-my $datrev = '$Date: 2017-10-27 01:18:10 +0200 (Fri, 27 Oct 2017) $';
+my $svnrev = '$Revision: 45623 $';
+my $datrev = '$Date: 2017-10-27 16:41:58 +0200 (Fri, 27 Oct 2017) $';
 my $tlmgrrevision;
 my $prg;
 if ($svnrev =~ m/: ([0-9]+) /) {
@@ -104,7 +104,7 @@
 use TeXLive::TLConfFile;
 use TeXLive::TLCrypto;
 TeXLive::TLUtils->import(qw(member info give_ctan_mirror win32 dirname
-                            mkdirhier copy debug tlcmp));
+                            mkdirhier copy debug tlcmp repository_to_array));
 use TeXLive::TLPaper;
 
 #
@@ -1419,7 +1419,7 @@
       if ($^O =~ /^MSWin/i) {
         # that should not happen, we are shipping Tk!!
         require Win32;
-        my $msg = "Cannot load JSON:PP, that should not happen as we ship it!\n(Error message: $@)\n";
+        my $msg = "Cannot load JSON, that should not happen as we ship it!\n(Error message: $@)\n";
         Win32::MsgBox($msg, 1|Win32::MB_ICONSTOP(), "Warning");
       } else {
         printf STDERR "
@@ -3643,7 +3643,9 @@
     #return($F_WARNING);
     return($F_OK);
   }
-  my $tlp = ($is_available ? $remtlp : $loctlp);
+  # prefer local TLPs as they have RELOC replaced by proper paths
+  my $tlp = ($is_installed ? $loctlp : $remtlp);
+  #my $tlp = ($is_available ? $remtlp : $loctlp);
   # add available, installed, lrev, rrev fields and remove revision field
   my $str = $tlp->as_json(available => ($is_available ? $JSON::true : $JSON::false), 
                           installed => ($is_installed ? $JSON::true : $JSON::false),
@@ -4154,30 +4156,6 @@
   }
   return "@ret";
 }
-sub repository_to_array {
-  my $r = shift;
-  my %r;
-  my @repos = split ' ', $r;
-  if ($#repos == 0) {
-    # only one repo, this is the main one!
-    $r{'main'} = $repos[0];
-    return %r;
-  }
-  for my $rr (@repos) {
-    my $tag;
-    my $url;
-    # decode spaces and % in reverse order
-    $rr =~ s/%20/ /g;
-    $rr =~ s/%25/%/g;
-    $tag = $url = $rr;
-    if ($rr =~ m/^([^#]+)#(.*)$/) {
-      $tag = $2;
-      $url = $1;
-    }
-    $r{$tag} = $url;
-  }
-  return %r;
-}
 sub merge_sub_packages {
   my %pkgs;
   for my $p (@_) {
@@ -5918,29 +5896,29 @@
   info(give_version());
   info("==================== executables found by searching PATH =================\n");
   info("PATH: $PATH\n");
-  for my $cmd (qw/kpsewhich updmap fmtutil tlmgr tex pdftex luatex xetex
-                  mktexpk dvips dvipdfmx/) {
+  for my $cmd (sort(qw/kpsewhich updmap fmtutil tlmgr tex pdftex luatex xetex
+                  mktexpk dvips dvipdfmx/)) {
     info(sprintf("%-10s %s\n", "$cmd:", TeXLive::TLUtils::which($cmd)));
   }
   info("=========================== active config files ==========================\n");
+  for my $m (sort(qw/fmtutil.cnf config.ps mktex.cnf pdftexconfig.tex/)) {
+    info(sprintf("%-17s %s", "$m:", `kpsewhich $m`));
+  }
   for my $m (qw/texmf.cnf updmap.cfg/) {
     for my $f (`kpsewhich -all $m`) {
       info(sprintf("%-17s %s", "$m:", $f));
     }
   }
-  for my $m (qw/fmtutil.cnf config.ps mktex.cnf pdftexconfig.tex/) {
-    info(sprintf("%-17s %s", "$m:", `kpsewhich $m`));
-  }
 
   #tlwarn("$prg: missing finding of XDvi, config!\n");
 
   info("============================= font map files =============================\n");
-  for my $m (qw/psfonts.map pdftex.map ps2pk.map kanjix.map/) {
+  for my $m (sort(qw/psfonts.map pdftex.map ps2pk.map kanjix.map/)) {
     info(sprintf("%-12s %s", "$m:", `kpsewhich $m`));
   }
 
   info("=========================== kpathsea variables ===========================\n");
-  for my $v (qw/TEXMFMAIN TEXMFDIST TEXMFLOCAL TEXMFSYSVAR TEXMFSYSCONFIG TEXMFVAR TEXMFCONFIG TEXMFHOME VARTEXFONTS TEXMF SYSTEXMF TEXMFDBS WEB2C TEXPSHEADERS TEXCONFIG ENCFONTS TEXFONTMAPS/) {
+  for my $v (sort(qw/TEXMFMAIN TEXMFDIST TEXMFLOCAL TEXMFSYSVAR TEXMFSYSCONFIG TEXMFVAR TEXMFCONFIG TEXMFHOME VARTEXFONTS TEXMF SYSTEXMF TEXMFDBS WEB2C TEXPSHEADERS TEXCONFIG ENCFONTS TEXFONTMAPS/)) {
     info("$v=" . `kpsewhich -var-value=$v`);
   }
 
@@ -6752,7 +6730,7 @@
   }
 
   # check for being frozen
-  if ($remotetlpdb->option("frozen")) {
+  if ($remotetlpdb->config_frozen) {
     my $frozen_msg = <<FROZEN;
 TeX Live $TeXLive::TLConfig::ReleaseYear is frozen forever and will no
 longer be updated.  This happens in preparation for a new release.
@@ -7500,7 +7478,8 @@
 =item B<--json>
 
 Instead of dumping the actual content, the database is dumped as
-JSON.
+JSON. For the format of JSON output see C<tlpkg/doc/JSON-formats.txt>,
+format definition C<TLPDB>.
 
 =back
 
@@ -7693,7 +7672,8 @@
 
 In case the only value passed to C<--data> is C<json>, the output is a
 JSON encoded array where each array element is the JSON representation of
-the internal object.
+a single C<TLPOBJ> but with additional information. For details see
+C<tlpkg/doc/JSON-formats.txt>, format definition: C<TLPOBJINFO>.
 
 
 =back
@@ -9166,7 +9146,7 @@
 distribution (L<http://tug.org/texlive>) and both are licensed under the
 GNU General Public License Version 2 or later.
 
-$Id: tlmgr.pl 45613 2017-10-26 23:18:10Z preining $
+$Id: tlmgr.pl 45623 2017-10-27 14:41:58Z preining $
 =cut
 
 # to remake HTML version: pod2html --cachedir=/tmp tlmgr.pl >/tmp/tlmgr.html

Modified: trunk/Master/texmf-dist/doc/latex/lwarp/README.txt
===================================================================
--- trunk/Master/texmf-dist/doc/latex/lwarp/README.txt	2017-10-30 20:40:11 UTC (rev 45647)
+++ trunk/Master/texmf-dist/doc/latex/lwarp/README.txt	2017-10-30 20:40:38 UTC (rev 45648)
@@ -1,5 +1,5 @@
 
-LaTeX lwarp package v0.41   README.txt
+LaTeX lwarp package v0.42   README.txt
 
 Files included are:
 

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

Modified: trunk/Master/texmf-dist/scripts/lwarp/lwarpmk.lua
===================================================================
--- trunk/Master/texmf-dist/scripts/lwarp/lwarpmk.lua	2017-10-30 20:40:11 UTC (rev 45647)
+++ trunk/Master/texmf-dist/scripts/lwarp/lwarpmk.lua	2017-10-30 20:40:38 UTC (rev 45648)
@@ -4,7 +4,7 @@
 
 -- Print the usage of the lwarpmk command:
 
-printversion = "v0.41"
+printversion = "v0.42"
 
 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	2017-10-30 20:40:11 UTC (rev 45647)
+++ trunk/Master/texmf-dist/source/latex/lwarp/lwarp.dtx	2017-10-30 20:40:38 UTC (rev 45648)
@@ -16,7 +16,7 @@
 % \iffalse
 %<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
 %<package>\ProvidesPackage{lwarp}
-%<package>    [2017/10/07 v0.41  Allows LaTeX to directly produce HTML5 output.]
+%<package>    [2017/10/30 v0.42  Allows LaTeX to directly produce HTML5 output.]
 %
 %<*driver>
 \documentclass{ltxdoc}
@@ -74,6 +74,7 @@
 \newunicodechar{₦}{\textnaira}
 \newunicodechar{₱}{\textpeso}
 \newunicodechar{℞}{\textrecipe}
+\newunicodechar{⸘}{\textinterrobangdown}
 \newunicodechar{‱}{\textpertenthousand}
 \newunicodechar{฿}{\textbaht}
 \newunicodechar{℠}{\textservicemark}
@@ -89,6 +90,8 @@
 
 
 \usepackage{titlesec}
+% \usepackage[nobottomtitles*]{titlesec}
+% \renewcommand{\bottomtitlespace}{.\textheight}
 
 \titleformat{\part}[hang]
     {\LARGE\ttfamily\bfseries}{}{0pt}{}[\marginpar{\hfill{}File\,\thepart}]
@@ -116,6 +119,7 @@
 \usepackage{array}
 \usepackage{longtable}
 \usepackage{booktabs}
+\usepackage{threeparttable}
 \usepackage{multirow}
 \usepackage{bigdelim}
 
@@ -141,6 +145,7 @@
 \setlength{\cftsubsubsecindent}{2.8em}
 \setlength{\cftsubsubsecnumwidth}{4em}
 
+\usepackage[notbib,notindex,nottoc]{tocbibind}
 
 \usepackage{titleps}
 
@@ -241,6 +246,7 @@
 \newrobustcmd{\acro}[1]{\textsc{\lowercase{#1}}}
 \newrobustcmd{\element}[1]{\texttt{<#1>}}
 \newrobustcmd{\attribute}[1]{\texttt{#1}}
+\newrobustcmd{\UI}[1]{\textbf{\textsf{#1}}}
 
 \newrobustcmd{\TOC}{\acro{TOC}}
 \newrobustcmd{\LOF}{\acro{LOF}}
@@ -247,9 +253,9 @@
 \newrobustcmd{\LOT}{\acro{LOT}}
 
 \newrobustcmd{\HTML}{\acro{HTML}}
-\newrobustcmd{\HTMLfive}{\HTML\oldstylenums{5}}
+\newrobustcmd{\HTMLfive}{\HTML\textsc{5}}
 \newrobustcmd{\CSS}{\acro{CSS}}
-\newrobustcmd{\CSSthree}{\CSS\oldstylenums{3}}
+\newrobustcmd{\CSSthree}{\CSS\textsc{3}}
 \newrobustcmd{\EPUB}{\acro{EPUB}}
 \newrobustcmd{\SVG}{\acro{SVG}}
 \newrobustcmd{\PNG}{\acro{PNG}}
@@ -443,7 +449,7 @@
 
 The glossaries may be placed in a numbered or unnumbered section, given
 \margintag{placement and \acro{TOC} options}
-a \acro{TOC} entry, and placed inline or on their own \HTML page:
+a \acro{TOC} entry, and placed inline or on their own \HTML\ page:
 \begin{description}
 
 \item [Numbered section, on its own \HTML\ page:]
@@ -574,9 +580,20 @@
 }
 
 
-\newcommand{\limitstext}{\cs{textbf}, etc.\ are supported,
-but \cs{bfseries}, etc.\ are not yet supported.}
+\newcommand{\limitstext}{%
+\cs{textbf}, etc.\ are supported,
+\watchout[\cs{bfseries}, etc.]
+but \cs{bfseries}, etc.\ are not yet supported.
 
+\texttt{\&}, \texttt{\textless}, and \texttt{\textgreater}
+\watchout[HTML special chars]
+have special meanings in \HTML.
+If \cs{\&}, \cs{textless}, and \cs{textgreater} are used, the proper result
+should occur in \HTML, but there may be \HTML\ parsing problems
+if these special characters occur unescaped in program listings
+or other verbatim text.
+}
+
 \newcommand{\limitshspace}{%
 \DescribeMacro{\hspace}%
 \index{space>horizontal}%
@@ -703,7 +720,7 @@
 
 \newcommand{\limitsmath}{%
 
-\limitsntheoremnumbering
+\subsubsection{Rendering tradeoffs}
 
 Math may be rendered
 \margintag{Math rendering}
@@ -710,6 +727,36 @@
 as \SVG\ graphics or using the \textsc{MathJax} JavaScript display engine.
 \index{JavaScript>MathJax}
 
+In its current implementation,
+\margintag{SVG files}
+rendering math as images creates a new \SVG\ file for each expression.
+In text with many references to math variables,
+this can result in a large number of files with
+duplicate content.
+In the future, some method of content-based naming and check-summing
+may be used to remove the need for duplicate files.
+
+Another approach could be
+\margintag{SVG inline}
+to in-line the \SVG\ files directly into the \HTML.
+This may reduce the number of files and potentially speed loading the images,
+but slows the display of the rest of the document before the images are loaded.
+
+Others converters have used \PNG\ files,
+\margintag{PNG files}
+sometimes pre-scaled for print resolution but displayed
+on-screen at a scaled down size.  This allows high-quality print output at the expense
+of larger files, but \SVG\ files are the preferred approach for scalable graphics.
+
+Conversion to \MathML\ might be a better approach,
+\margintag{MathML}
+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.
+
+\subsubsection{SVG option}
+
 For \SVG\ math,
 \margintag{SVG math option}
 math is rendered as usual by \LaTeX{} into the initial \PDF\ file using the
@@ -726,34 +773,17 @@
 
 \limitslateximagefontsize
 
-As currently implemented,
-\margintag{SVG files}
-each instance of math creates a new \SVG\ file.  In text with
-many references to math variables, this can result in a large number of files with
-duplicate content.  In the future, some method of content-based naming and checksumming
-may be used to remove the need for duplicate files.
+For \SVG\ math, text copy/paste from the \HTML\ \element{alt} tags lists the
+\margintag{SVG math copy/paste}
+equation number or tag for single equations, along with the \LaTeX\ code
+for the math expression.
+For \AmS\ environments with multiple numbers in the same environment,
+only the first and last is copy/pasted, as a range.
+No tags are listed inside a starred \AmS\ environment, although the \cs{tag}
+macro will still appear inside the \LaTeX\ math expression.
 
-Another approach would be
-\margintag{SVG inline}
-to in-line the \SVG\ files directly into the \HTML.
-This avoids having a large number of files and potentially speeds loading the images,
-but dis-allows the possibility of sharing one file among many instances without
-user intervention.
+\subsubsection{MathJax option}
 
-Others have used \PNG\ files,
-\margintag{PNG files}
-sometimes pre-scaled for print resolution but displayed
-on-screen at a scaled down size.  This allows high-quality print output at the expense
-of larger files, but \SVG\ files are also larger as well.
-
-Conversion to \MathML\ might be a better approach,
-\margintag{MathML}
-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.
-
 The popular MathJax alternative (\url{mathjax.org}) may be used to display math.
 \margintag{MathJax math option}
 \DescribeProgram{MathJax}
@@ -806,13 +836,35 @@
     where it will be rendered as normal text.
     \watchout[siunitx inside an equation]
 
-    \href{https://github.com/mathjax/MathJax-third-party-extensions/tree/master/siunitx}
-        {\texttt{https://github.com/mathjax/MathJax-third-party-extensions/\\
-        \hspace*{2em}tree/master/siunitx}}
+    \href{https://github.com/burnpanck/MathJax-siunitx}
+        {\texttt{https://github.com/burnpanck/MathJax-siunitx}}
 
+    Also see \cref{sec:limitssiunitx}.
+
+\item Other math-related macros and packages are not supported by 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,
-    \margintag{\LaTeX{} macros}
-    but they may be set up by the user.
+    \margintag{custom MathJax macros}
+    \index{MathJax>custom macros}
+    but they may be created by the user inside a math expression:
+    \begin{sourcedisplay}
+    \cs{begin}\{document\}\\
+    \textrm{(\dots)} \\
+    \cs{begin}\{warpHTML\}  \% Only for HTML output, \\
+    \cs{ifbool}\{mathjax\}  \% and only for MathJax output: \\
+    \{ \\
+    \hspace*{2em}\% New macros for MathJax are \\
+    \hspace*{2em}\% placed inside a math expression: \\
+    \hspace*{2em}\cs{(} \\
+        \hspace*{4em}\cs{newcommand}\{\cs{expval}\}[1]\{\cs{langle}\#1\cs{rangle}\} \\
+        \hspace*{4em}\cs{newcommand}\{\cs{abs}\}[1]\{\cs{lvert}\#1\cs{rvert}\} \\
+    \hspace*{2em}\cs{)} \\
+    \}\{\} \\
+    \cs{end}\{warpHTML\} \\
+    \end{sourcedisplay}
 \end{itemize}
 }
 
@@ -981,6 +1033,15 @@
 \margintag{\cs{color} and \cs{pagecolor}}
 }
 
+\newcommand{\limitsoverpic}{%
+The macros \cs{overpicfontsize} and \cs{overpicfontskip} are used during
+\watchout[scaling]
+\HTML\ generation.  These are sent to \cs{fontsize} to adjust the font
+size for scaling differences between the print and \HTML\ versions of the
+document.  Renew these macros before using the \env{overpic} and \env{Overpic}
+environments.
+}
+
 \newcommand{\limitstabular}{%
 Tabular mostly works as expected, but pay special attention to the
 following, especially if working with environments, macros inside tabulars,
@@ -1242,10 +1303,10 @@
 \begin{sourcedisplay}
 \hrule\smallskip
 \cs{begin}\{tabular\}\{lll\} \\
-\textcolor{green}{<empty>} \& a \& b \textbackslash\textbackslash \\
+\textcolor{green!50!black}{<empty>} \& a \& b \textbackslash\textbackslash \\
 \cs{ldelim}\{\textbackslash\{\}\{2\}\{.25in\}[left ] \& c \& d \textbackslash\textbackslash \\
 \textcolor{red}{\cs{mrowcell}} \& e \& f \textbackslash\textbackslash \\
-\textcolor{green}{<empty>} \& g \& h \textbackslash\textbackslash \\
+\textcolor{green!50!black}{<empty>} \& g \& h \textbackslash\textbackslash \\
 \cs{end}\{tabular\}
 \smallskip\hrule
 \begin{tabular}{lll}
@@ -1479,11 +1540,27 @@
 \end{itemize}
 }
 
+\newcommand{\limitskeyfloat}{%
+If placing a \cs{keyfig}[H] inside a \env{keywrap},
+\watchout[\env{keywrap}]
+use an absolute width for
+\cs{keyfig}, instead of \texttt{lw}-proportional widths.
+(The [H] option forces the use of a minipage, which internally adjusts for
+a virtual 6-inch wide minipage, which then corrupts the \texttt{lw} option.)
+}
+
 \newcommand{\limitssiunitx}{%
-Do not use \cmds{per-mode=fraction}, which cannot be seen by the final \cmds{pdftotext} conversion.
+Do not use \cmds{per-mode=fraction},
 \watchout[per-mode]
+which cannot be seen by the final \cmds{pdftotext} conversion.
 
 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
+of this extension is created first.}
 }
 
 \newcommand{\limitsnicefrac}{%
@@ -1541,14 +1618,14 @@
 \newcommand{\limitsnewtxmath}{%
 The proper load order is:
 \watchout[loading sequence]
-\begin{enumerate}
-\item \dots
-\item \texttt{\cs{usepackage}\{lwarp\}}
-\item \dots
-\item \texttt{\cs{usepackage}\{amsthm\}}
-\item \texttt{\cs{usepackage}\{newtxmath\}}
-\item \dots
-\end{enumerate}
+\begin{sourcedisplay}
+\textrm{\dots} \\
+\cs{usepackage}\{lwarp\} \\
+\textrm{\dots} \\
+\cs{usepackage}\{amsthm\} \\
+\cs{usepackage}\{newtxmath\} \\
+\textrm{\dots} \\
+\end{sourcedisplay}
 }
 
 
@@ -1595,7 +1672,7 @@
 %<*package>
 % \fi
 %
-% \CheckSum{14314}
+% \CheckSum{14824}
 %
 % \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
@@ -1678,6 +1755,7 @@
 % \changes{v0.39}{2017/09/05}{\ 2017/09/05}
 % \changes{v0.40}{2017/09/25}{\ 2017/09/25}
 % \changes{v0.41}{2017/10/07}{\ 2017/10/07}
+% \changes{v0.42}{2017/10/30}{\ 2017/10/30}
 
 
 
@@ -1700,7 +1778,7 @@
 %
 % {\Huge The \textbf{lwarp} package}
 %
-% {\Large \textup{\LaTeX{} to \HTMLfive}}
+% {\Large \textup{\LaTeX{} to HTML}}
 %
 % \bigskip
 %
@@ -1787,8 +1865,60 @@
 % \end{center}
 %
 % \clearpage
+% 
+% \section{Supporting \protect\TeX\ development}
+% \changes{v0.42}{2017/10/30}{Docs: Added support page.}
+% 
+% \TeX\ development:
+% \begin{itemize}[nosep]
+% \item is mostly open-sourced and a volunteer effort;
+% \item benefits students, academics, scientists, engineers, and businesses;
+% \item helps drive education, public and private research, and commercial activity;
+% \item is used in the fields of mathematics, science, engineering, and the humanities;
+% \item spans decades of development;
+% \item is enduring --- many older packages are still actively used and maintained;
+% \item is largely backwards compatible;
+% \item is portable across all the major computing platforms;
+% \item is usable even on older computers and away from internet access;
+% \item requires no yearly subscription fees;
+% \item is supported by an active community of knowledgeable volunteers;
+% \item and is continuing to maintain relevance with modern improvements.
+% \end{itemize}
+% 
+% Please consider helping by joining and/or contributing to the \TeX\ Users Group,
+% a United States 501(c)(3) tax-exempt charitable organization.
+% Contributions are accepted by credit card, check, or Pay Pal, via the United Way,
+% or by USA or European bank transfer.
+% Membership in TUG supports the development of \TeX{}Live, the major \TeX\ distribution.
+% 
+% Donations may be directed towards individual projects:
+% \begin{description}[nosep]
+% \item[TUG Bursary Fund:] Assistance for attending annual TUG meetings.
+% \item[CTAN:] The Comprehensive \TeX\ Archive Network --- Central storage for \TeX.
+% \item[TeX Development Fund:] Support for specific projects.
+% \item[EduTeX:] Teaching and using \TeX\ in schools and universities.
+% \item[GUST e-foundry fonts:] Enhanced for math and additional language groups.
+% \item[LaTeX Project:] Modernizing the \LaTeX\ core.
+% \item[Libre Font Fund:] Fonts, tools (FontForge), and distribution (the Open Font Library).
+% \item[LuaTeX:] Combining the pdf\TeX\ engine and the Lua language.
+% \item[MetaPost:] Postscript graphics.
+% \item[MacTeX:] \TeX\ for Mac.
+% \item[PDF Accessibility:] Modern PDF standards.
+% \item[Other:] Additional projects may be specified.
+% \end{description}
 %
+% To make a contribution: \hfill
+% \href{https://www.tug.org/donate.html}{\texttt{https://www.tug.org/donate.html}}
 %
+% For users of MiK\TeX: \hfill
+% \href{https://miktex.org/donations.html}{\texttt{https://miktex.org/donations.html}}
+%
+% For country-specific \TeX\ users groups: \hfill
+% \href{http://tug.org/usergroups.html}{\texttt{http://tug.org/usergroups.html}}
+%
+% \clearpage
+%
+%
 % \tableofcontents
 %
 % \clearpage
@@ -1800,8 +1930,6 @@
 %
 % \clearpage
 %
-% \part{lwarp.sty}
-%
 % \section{Updates}
 % \label{sec:updates}
 %
@@ -1812,6 +1940,42 @@
 % For a detailed list of changes, see the Change History on page \pageref{sec:changehistory}.
 %
 % \begin{description}
+% \item[v0.42:] \
+%   \begin{itemize}
+%       \item Improved assitance for word-processor conversions when
+%           \margintag{word-processor conversion}
+%           boolean |FormatWP| is set |true|.
+%           See \cref{sec:wordprocessorconversion}.
+%           \begin{itemize}
+%           \item \textcolor{red}{The} \watchout[name change]
+%               \textcolor{red}{boolean |FormatWordProcessor| has
+%               been renamed |FormatWP|.}
+%           \item \textcolor{red}{The} \watchout[name change]
+%               \textcolor{red}{boolean |HTMLMarkFloats| has
+%               been renamed |WPMarkFloats|.}
+%           \item New booleans control whether to place additional
+%               marks around minipages, at the table of contents,
+%               at the \acro{LOF} and \acro{LOT}, and whether to
+%               print math as \LaTeX\ source for copy/paste into the
+%               LibreOffice Writer TeXMaths extension.
+%           \item Improved formatting for numerous objects.
+%               See \cref{sec:wordprocessorconversion}.
+%           \end{itemize}
+%       \item Add: \env{tabbing} environment.
+%           \margintag{\env{tabbing}}
+%       \item Add: \pkg{overpic} package.  See \cref{sec:overpic}.
+%           \margintag{\pkg{overpic}}
+%       \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 \pkg{textcomp}: Improved \cs{interrobangdown}.
+%           \margintag{symbols}
+%       \item \pkg{realscripts}: Fix for subscripts in a \env{lateximage}.
+%       \item \pkg{morewrites}: Enforces loading before \pkg{lwarp}.
+%           \margintag{load order}
+%   \end{itemize}
+% \needspace{2\baselineskip}
 % \item[v0.41:] \
 %   \begin{itemize}
 %       \item Added tabular vertical rules, subject to some limitations.
@@ -2159,9 +2323,11 @@
 %	\item Boolean |FormatWordProcessor| changes \HTML\ output for easier conversion
 %		by a word processor.  Removes headers and nav, prints footnotes per section,
 %		and also forces single-file output and turns off \HTML\ debug comments.
+%       Name changed to |FormatWP| as of v0.42.
 %	\item Boolean |HTMLMarkFloats| adds text marks around floats only if
 %		|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 Adds \pkg{tabulary}.
 %	\item Supports the options syntax for \pkg{graphics}.
@@ -2344,7 +2510,7 @@
 %
 % Furthermore, \SVG\ images allow math to be presented with
 % the same precise formatting as in the print version.
-% Math is accompanied by ALT tags holding the \LaTeX{} source for the expression, allowing it to be
+% Math is accompanied by \element{alt} tags holding the \LaTeX{} source for the expression, allowing it to be
 % copy/pasted into other documents.\footnote{There seems to be some debate as to whether
 % \MathML\ is actually an improvement over \LaTeX{} for sharing math.  The author has no
 % particular opinion on the matter, except to say that in this case \LaTeX{} is much easier to implement!}
@@ -2472,7 +2638,7 @@
 %
 % \midrule
 %
-% Math: & Supported.  Converted to \SVG\ images with \HTML\ \cmds{ALT} tags containing the
+% 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.
@@ -2509,12 +2675,11 @@
 %   References to \PDF\ files are changed to \SVG, other image types
 %   are accepted as well.
 %   \cs{rotatebox} and \cs{scalebox} are supported as well as \HTML\ can handle.
-%   \pkg{grffile} is supported. \\
+%   \pkg{rotating} is emulated but all objects are unrotated.
+%   \pkg{picture} and \pkg{tikz} are converted to an \SVG\ image.
+%   \pkg{grffile} and \pkg{overpic} are supported. \\
 %
-% \pkg{rotating}: & Emulated.  All objects are displayed unrotated. \\
 %
-% \pkg{picture} and \pkg{tikz}: & Converted to an \SVG\ image. \\
-%
 % \midrule
 %
 % \pkg{xcolor}: & \textcolor{DarkGreen}{Supported}.
@@ -4747,13 +4912,11 @@
 %
 %
 % \subsection{Math}
+%
+% \changes{v0.42}{2017/10/30}{Docs: Reorganized math limitations}
 % \label{sec:limitsmath}
-%
 % \limitsmath
 %
-% For an example of using custom \LaTeX\ macros with MathJax,
-% \margintag{custom MathJax macros}
-% see page \pageref{ex:mathjaxmacros}.
 %
 %
 % \subsubsection{\pkg{ntheorem} package}
@@ -4762,6 +4925,7 @@
 %
 %
 % \subsubsection{\pkg{siunitx} package}
+% \label{sec:limitssiunitx}
 %
 % \DescribePackage{siunitx}
 % \limitssiunitx
@@ -4800,7 +4964,11 @@
 %
 % \limitsxcolor
 %
+% \subsubsection{\pkg{overpic} package}
 %
+% \limitsoverpic
+%
+%
 % \subsection{Tabular}
 % \label{sec:limitstabular}
 % \changes{v0.39}{2017/08/30}{Docs: Reorganized tabular discussion.}
@@ -4845,6 +5013,11 @@
 % \limitsfloatrow
 %
 %
+% \subsubsection{\pkg{keyfloat} package}
+%
+% \limitskeyfloat
+%
+%
 % \subsection{Miscellaneous}
 %
 %
@@ -4898,7 +5071,7 @@
 % converting \pkg{lwarp} \HTML\ output to \EPUB:
 %
 % \DescribeBoolean{FormatEPUB}
-% \begin{docsidebar}
+% \begin{docsidebar}[\texttt{FormatEPUB}]
 %	\raggedright
 %	Default false.
 %	|FormatEPUB| changes \HTML\ output for easy \EPUB\ conversion
@@ -4914,8 +5087,10 @@
 %	\end{sourcedisplay}
 % to the project's source preamble after |\usepackage{lwarp}|.
 % The \EPUB\ version of the document cannot co-exist with the
-% regular \HTML\ version, so \userentry{lwarpmk cleanall} then
+% regular \HTML\ version, so
+% \userentry{lwarpmk cleanall}
 % \userentry{lwarpmk html}
+% \userentry{lwarpmk limages}
 % to recompile with the |FormatEPUB| boolean turned on.
 % Several changes are then made to the \HTML\ output:
 %	\begin{itemize}
@@ -4955,7 +5130,7 @@
 % \begin{UIdisplay}
 %	Match HTML tags with tag name:
 % \end{UIdisplay}
-% to \element{h4}.  (Or \element{h3} for document classes with \cs{chapter}s.)
+% to ``h4''.  (Or ``h3'' for document classes with \cs{chapter}s.)
 % The \textsf{Detect chapters at} field should then show
 % \begin{UIdisplay}
 %	//h:h4 \qquad \textrm{---\,or\,---} \qquad //h:h3
@@ -4989,6 +5164,11 @@
 % \clearpage
 %
 % \section{Word-processor conversion}
+% \label{sec:wordprocessorconversion}
+%   \index{word processor>HTML conversion settings}
+%   \index{HTML>conversion settings>word processor}
+%   \index{LibreOffice>import into}
+%   \index{export>to word processor}
 %
 % \pkg{lwarp} may be told to modify its \HTML\ output to make it
 % easier to import the \HTML\ document into a word processor.
@@ -5000,11 +5180,13 @@
 % as shown below.
 %
 %
+% \subsection{Activating word-processor conversion}
+%
 % A special boolean is provided to simplify the process of
 % converting \pkg{lwarp} \HTML\ output to \EPUB:
 %
-% \DescribeBoolean{FormatWordProcessor}
-% \begin{docsidebar}
+% \DescribeBoolean{FormatWP}
+% \begin{docsidebar}[\texttt{FormatWP}]
 %	\raggedright
 %	Default false.
 %	Changes \HTML\ output for easier conversion
@@ -5012,18 +5194,25 @@
 %	Removes headers and nav, prints footnotes per section,
 %	and also forces single-file output and turns off \HTML\ debug
 %	comments.
+%   Additionally, honors the booleans |WPMarkFloats|, |WPMarkMinipages|,
+%   |WPMarkTOC|, and |WPMarkLOFT|.
 %	\end{docsidebar}
-%	\index{word processor>HTML conversion settings}
-%	\index{HTML>conversion settings>word processor}
 %
 % To help modify \pkg{lwarp} \HTML\ output for easier
 % import to a word processor, add
 %	\begin{sourcedisplay}
-%	|\booltrue{FormatWordProcessor}|
+%	|\booltrue{FormatWP}|
 %	\end{sourcedisplay}
 % to the project's source preamble after \pkg{lwarp} is loaded.
-% Several changes are then made to the \HTML\ output:
+% The following changes are then made to the \HTML\ output:
+% \margintag{formatting adjustments}
 %	\begin{itemize}
+%   \item If using a class without chapters, \cs{section} and lower are
+%       shifted up in level for the \HTML\ heading tags.  The \CSS\ has
+%       not been changed, so the section heading formats will not match the normal
+%       \HTML\ output, but when imported to LibreOffice Writer the higher
+%       section headings will import as \UI{Heading~1} for the title, \UI{Heading~2}
+%       for \cs{section}, etc.
 %	\item Headers, footers, and navigation are removed at file splits.
 %	\item Any accumulated footnotes are printed at the bottom of each file split.
 %		These will have to be manually moved to their proper place in
@@ -5036,42 +5225,288 @@
 %		marking the opening/closing of sections and \element{div}s,
 %		but they are no longer useful when the document has been
 %		imported into a word processor.
+%   \item An additional \element{div} with an \attribute{id} encapsulates
+%       each float and minipage, which on import into LibreOffice Writer
+%       causes a thin frame to appear around the text block for each.
+%   \item Float captions are given an explicit italic formatting.
+%   \item Tabular rule borders are made explicit for LibreOffice Writer.
+%       LibreOffice displays a light border around each cell while editing,
+%       even those which have no border when printed,
+%       and \pkg{lwarp} also uses a light border for thin rules,
+%       so it will be best to judge the results using
+%       the print preview instead of while editing in LibreOffice.
+%   \item \cs{includegraphics} and \SVG\ math width and height
+%       are made explicit for LibreOffice.
+%   \item \cs{hspace} is approximated by a number of \cs{quad}s,
+%       and rules are approximated by a number of underscores.
+%   \item Explicit \HTML\ styles are given to:
+%       \begin{itemize}
+%       \item \cs{textsc}, etc.
+%       \item \cs{underline}, \pkg{soul} and \pkg{ulem} markup.
+%       \item \env{center}, \env{flushleft}, \env{flushright}.
+%       \item \cs{marginpar}, \pkg{keyfloat}, \pkg{sidenotes}, \pkg{floatflt},
+%           and \pkg{wrapfig}.
+%       \item \pkg{fancybox} \cs{shadowbox}, etc.
+%       \item The \LaTeX\ and \TeX\ logos.
+%       \end{itemize}
+%   \item Honors several booleans:
+%       \begin{description}
+%       \item[\texttt{WPMarkFloats}:] Marks the begin and end of floats.
+%       \item[\texttt{WPMarkMinipages}:] Marks the begin and end of minipages.
+%       \item[\texttt{WPMarkTOC}:] Marks the location of the Table of Contents.
+%       \item[\texttt{WPMarkLOFT}:] Marks the locations of the List of Figures/Tables.
+%       \item[\texttt{WPMarkMath}:] Prints \LaTeX\ math instead of using images.
+%       \item[\texttt{WPTitleHeading}:] Adjusts title and section headings.
+%       \end{description}
+%       Several of these may be used to add markers to the HTML text
+%       which help determine where to adjust the word processor document after
+%       import.
+
 %	\end{itemize}
 %
-% An additional boolean may be set to help mark float boundaries:
 %
-% \newcommand{\describeHTMLMarkFloats}{
-%   Default true.
+% \subsection{Additional modifications}
+%
+% \newcommand{\describeWPMarkFloats}{
+%   Default |false|.
 %   Adds
 %   \begin{sourcedisplay}
-%   === table begin \\
+%   === begin table === \\
 %   \dots \\
-%   === end
+%   === end ===
 %   \end{sourcedisplay}
 %   or
 %   \begin{sourcedisplay}
-%   === figure begin \\
+%   === begin figure === \\
 %   \dots \\
-%   === end
+%   === end ===
 %   \end{sourcedisplay}
 %   around floats while formatting for word processors.
 %   This helps identify boundaries of floats to be manually converted
-%   to word-processor frames.
+%   to word-processor frames and captions.
 % }
 %
-% \DescribeBoolean{HTMLMarkFloats}
-%	\begin{docsidebar}
+% \DescribeBoolean{WPMarkFloats}
+%	\begin{docsidebar}[\texttt{WPMarkFloats}]
 %	\raggedright
-%   \describeHTMLMarkFloats
+%   \describeWPMarkFloats
 %	\end{docsidebar}
-%	\index{word processor>HTML conversion settings}
-%	\index{HTML>conversion settings>word processor}
 %
-% When enabled, markers are placed around each float, helping the
-% user to identify float boundaries for further conversion to
-% word processor frames and captions.
 %
+% \newcommand{\describeWPMarkMinipages}{
+%   Default |false|.
+%   Adds
+%   \begin{sourcedisplay}
+%   === begin minipage === \\
+%   \dots \\
+%   === end minipage ===
+%   \end{sourcedisplay}
+%   around minipages while formatting for word processors.
+%   This helps identify boundaries of minipages to be manually converted
+%   to word-processor frames.
+% }
 %
+% \DescribeBoolean{WPMarkMinipages}
+%   \begin{docsidebar}[\texttt{WPMarkMinipages}]
+%   \raggedright
+%   \describeWPMarkMinipages
+%   \end{docsidebar}
+%
+%
+% \newcommand{\describeWPMarkTOC}{
+%   Default |true|.
+%   While formatting for word processors, adds
+%   \begin{sourcedisplay}
+%   === table of contents === \\
+%   \end{sourcedisplay}
+%   where the Table of Contents would have been.
+%   This helps identify where to insert the actual \acro{TOC}.
+%
+%   \emph{If set |false|, the actual \acro{TOC} is printed instead.}
+% }
+%
+% \DescribeBoolean{WPMarkTOC}
+%   \begin{docsidebar}[\texttt{WPMarkTOC}]
+%   \raggedright
+%   \describeWPMarkTOC
+%   \end{docsidebar}
+%
+%
+% \newcommand{\describeWPMarkLOFT}{
+%   Default |false|.
+%   While formatting for word processors, adds
+%   \begin{sourcedisplay}
+%   === list of figures === \quad \textrm{\textit{and\,/\,or}} \\
+%   === list of tables === \\
+%   \end{sourcedisplay}
+%   where each of these lists would have been.
+%   This helps identify where to insert the actual lists.
+%
+%   \emph{If set |false|, the actual lists are printed instead.}
+% }
+%
+% \DescribeBoolean{WPMarkLOFT}
+%   \begin{docsidebar}[\texttt{WPMarkLOFT}]
+%   \raggedright
+%   \describeWPMarkLOFT
+%   \end{docsidebar}
+%
+%
+% \newcommand{\describeWPMarkMath}{
+%   Default |false|.
+%   While formatting for word processors,
+%   prints math as \LaTeX\ code instead of creating \SVG\ images or MathJax.
+%   This is useful for cut/paste into the LibreOffice Writer TeXMaths extension.
+% }
+%
+% \DescribeBoolean{WPMarkMath}
+% \DescribeProgram{TeXMaths}
+%   \margintag{siunitx}
+%   \begin{docsidebar}[\texttt{WPMarkMath}]
+%   \raggedright
+%   \describeWPMarkMath
+%
+%   When using the \pkg{siunitx} package, enter
+%   \begin{sourcedisplay}
+%   \cs{usepackage}\{siunitx\}
+%   \end{sourcedisplay}
+%   in the TeXMaths preamble.
+%   Equation numbering is problematic for \AmS\ math environments.
+%   \end{docsidebar}
+%   \index{siunitx>with TeXMaths}
+%   \index{math>word processor conversion}
+%
+%
+% \newcommand*{\describeWPTitleHeading}{
+%   Default |false|.
+%   While formatting for word processors,
+%   |true| sets the document title to \element{h1}, which is expected for \HTML\ documents,
+%   but also causes the lower-level section headings to start at \UI{Heading 2} when
+%   imported into LibreOffice.
+%   Set to |false| to cause the title to be plain text, and the section headings
+%   to begin at \UI{Heading 1}.
+%
+%   See \cref{tab:WPsectionheadings} on \cpageref{tab:WPsectionheadings}.
+% }
+%
+% \DescribeBoolean{WPTitleHeading}
+%   \margintag{section headings}
+%   \begin{docsidebar}[\texttt{WPTitleHeading}]
+%   \raggedright
+%   \describeWPTitleHeading
+%   \end{docsidebar}
+% \index{section>heading, word processor}
+% \index{heading, word processor}
+% \index{word processor>section headings}
+% \index{LibreOffice>section headings}
+%
+% \begin{table}
+% \centering
+% \begin{threeparttable}
+% \caption{Section HTML headings for word-processor conversion}
+% \label{tab:WPsectionheadings}
+% \begin{tabular}{lcccc}
+% \toprule
+% ~ & \multicolumn{4}{c}{HTML headings\tnote{\textasteriskcentered}} \\
+% \cmidrule{2-5}
+% ~ & \multicolumn{2}{c}{With \cs{chapter}} & \multicolumn{2}{c}{Without \cs{chapter}} \\
+% \cmidrule(r){2-3} \cmidrule(l){4-5}
+% ~ & \multicolumn{2}{c}{|WPTitleHeading|} & \multicolumn{2}{c}{|WPTitleHeading|} \\
+% Section & |true| & |false| & |true| & |false| \\
+% \midrule
+% Title & \element{h1} & plain & \element{h1} & plain \\
+% \cs{part} & \element{h2} & \element{h1} & \element{h2} & \element{h1} \\
+% \cs{chapter} & \element{h3} & \element{h2} & --- & --- \\
+% \cs{section} & \element{h4} & \element{h3} & \element{h3} & \element{h2} \\
+% \cs{subsection} & \element{h5} & \element{h4} & \element{h4} & \element{h3} \\
+% \cs{paragraph} & \element{h6} & \element{h5} & \element{h5} & \element{h4} \\
+% \cs{subparagraph} & span & \element{h6} & \element{h6} & \element{h5} \\
+% \bottomrule
+% \end{tabular}
+% \begin{tablenotes}
+% \footnotesize
+% \item[\textasteriskcentered] For default depths when not |FormatWP|,
+%   see \cref{tab:depthsheadings} on \cpageref{tab:depthsheadings}.
+% \end{tablenotes}
+% \end{threeparttable}
+% \smallskip\hrule
+% \end{table}
+%
+% \subsection{Recommendations}
+%   \index{word processor>conversion recommendations}
+%   \index{LibreOffice>conversion recommendations}
+%
+% For use with LibreOffice Writer, it is recommended to:
+% \margintag{TOC, LOF, LOT}
+% \begin{enumerate}[nosep]
+% \item Set \cs{booltrue}\{FormatWP\}.
+% \item Set \cs{booltrue}\{WPMarkTOC\} and \cs{boolfalse}\{WPMarkLOFT\}.
+% \item Use \pkg{lwarp} to generate the \HTML\ document.
+% \item Copy/paste from the \HTML\ document into an empty LibreOffice Writer document.
+% \item Manually insert a LibreOffice \acro{TOC} in the LibreOffice document.
+% \item Manually add frames around each float, adding a caption which is cut/pasted from
+%   each float's simulated caption.
+% \item Manually create cross references.
+% \end{enumerate}
+% This process yields a document with an actual LibreOffice Table of Contents,
+% but a simulated List of Figures and List of Tables.
+%
+% For \pkg{siunitx}, remember to adjust the preamble as mentioned above.
+% \margintag{siunitx}
+%
+% LibreOffice has options in the View menu to turn on/off the display of
+% \margintag{LO view border options}
+% thin borders around table cells and text objects.
+%
+%
+% \subsection{Limitations}
+%
+% Floats and captions are not explicitly converted to LibreOffice floats with their
+% own captions.  Floats are surrounded by a thin frame in the LibreOffice editor,
+% and may be marked with |WPMarkFloats|, but are not given a proper LibreOffice
+% object frame.
+% Captions are given an explicit italic formatting,
+% but not a proper LibreOffice paragraph style.
+%
+% Cross references are not actual LibreOffice linked cross references.
+%
+% The List of Figures and List of Tables are not linked.
+% The pasted pseudo \acro{LOF} and \acro{LOT} match the numbering
+% of the \LaTeX\ and \HTML\ versions.
+%
+% Equation numbering is not automatic, but the equation numbers in \SVG\ math
+% will match the \LaTeX\ and \HTML\ output.
+% SVG math is recommended when using the \AmS\ environments, which may have
+% multiple numbered equations per object.
+%
+% As of when last checked, LibreOffice ignores the following:
+% \begin{itemize}
+% \item Minipage alignment.
+% \item Tabular cell vertical alignment.
+% \item Image rotation and scaling.
+% \item Rounded border corners, which are also used by:
+%   \begin{itemize}
+%   \item \cs{textcircled}
+%   \item \pkg{booktabs} trim
+%   \end{itemize}
+% \item \cs{hspace} and rules, also used by \pkg{algorithmic}.
+% \item Coloring of text decorations, used by \pkg{soul} and \pkg{ulem}.
+% \item Overline text decoration, used by \pkg{romanbar}.
+% \end{itemize}
+%
+% Libreoffice also has limitations with frames and backgrounds:
+% \begin{itemize}
+% \item Multiple lines in an object are framed individually instead of as a whole.
+% \item Nested frames are not handled correctly.
+% \item Images inside boxes are not framed correctly.
+% \item Spans with background colors and frames are not displayed correctly.
+% \end{itemize}
+%
+%
+%
+%
+%
+%
 % \clearpage
 %
 % \section{Modifying \protect\pkg{lwarp}}
@@ -5219,12 +5654,12 @@
 %
 % Also see: \\
 % \Cref{sec:printcommands}: \nameref{sec:printcommands} \\
-% \Cref{sec:successfulcommands}: \nameref{sec:successfulcommands} \\
 % \Cref{sec:limitations}: \nameref{sec:limitations}
 %
 % \changes{v0.14}{2016/03/26}{Docs: Troubleshooting cross-references.}
 % \changes{v0.16}{2016/04/08}{Docs: Text not converting.}
 % \changes{v0.34}{2017/08/08}{Docs: Misplaced alignment character.}
+% \changes{v0.42}{2017/10/13}{Docs: Improper \cs{prevdepth}.}
 %
 % \begin{description}
 %
@@ -5247,8 +5682,22 @@
 %	\item Be sure that a print version of the document compiles and
 %		that your document's \LaTeX{} code is correct, before attempting
 %		to generate an \HTML\ version.
-%	\end{itemize}
 %
+%   \begin{description}
+%         \item [``Leaders not followed by proper glue'':] This can be caused by
+%         a missing |l@<floattype>| or |l@<sectiontype>| definition.
+%         See \pkg{lwarp}'s definitions for examples.
+% 
+%         \item [``Improper \cs{prevdepth}'':] Something tried to use
+%         \cs{ensuremath} where \pkg{lwarp} then tries to create a \env{lateximage}.
+%         If you can locate what used \cs{ensuremath}, have it temporarily set:
+%         \begin{sourcedisplay}
+%         \cs{LetLtxMacro}\cs{@ensuredmath}\cs{LWR at origensuredmath}
+%         \end{sourcedisplay}
+%         inside a group first.
+%   \end{description}
+%   \end{itemize}
+%
 % \item [Missing sections:] ~
 %	\begin{itemize}
 %	\item See \cref{sec:filedepth} regarding the
@@ -5257,8 +5706,10 @@
 %	\end{itemize}
 %
 % \item [Missing HTML files:] \
+%   \begin{itemize}
 %	\item See the warning regarding changes to the \HTML\ settings
 %		at \cref{sec:htmlsettings}.
+%   \end{itemize}
 %
 % \item [Missing / incorrect cross-references:] ~
 % \index{cross-references>missing or incorrect}
@@ -5300,13 +5751,11 @@
 %	\item |lwarpmk limages| to refresh the |lateximage| images.
 %	\end{itemize}
 %
-% \item[SVG images:] \limitssvgimages
+% \item[SVG images:] \
 %
-% \item [``Leaders not followed by proper glue'':] This can be caused by
-%	a missing |l@<floattype>| or |l@<sectiontype>| definition.
-%	See \pkg{lwarp}'s definitions for examples.
+% \limitssvgimages
 %
-% \item [Plain-looking document:] ~
+% \item [Plain-looking document:] \
 %	\begin{itemize}
 %	\item The document's \CSS\ stylesheet may not be available, or may be
 %		linked incorrectly.  Verify any \cs{CSSFilename} statements point to
@@ -5386,7 +5835,9 @@
 % 
 %
 %
+% \part{lwarp.sty}
 %
+%
 % \section{Implementation}
 %
 %
@@ -5420,7 +5871,7 @@
 % Testing has primarily been done with the Iceweasel/Firefox browser.
 %
 %
-% \section{Stack depths}
+% \section{Section depths and HTML headings}
 % \label{sec:stackdepths}
 % \index{HTML>headings}
 % \index{section>depths}\index{stack depths}
@@ -5436,10 +5887,13 @@
 % sections and lists of a deeper level to keep the \HTML\ tags nested correctly.
 %
 % \begin{table}
+% \centering
+% \begin{threeparttable}
 % \caption{Section depths and HTML headings\label{tab:depthsheadings}}
 % \begin{tabular}{lcl}
 % \toprule
-% Section & \parbox[c]{.35in}{\LaTeX{} depth} & \HTML\ headings \\
+% Section & \parbox[b]{.35in}{\centering\LaTeX\ depth} &
+%   HTML headings \tnote{\textasteriskcentered} \\
 % \midrule
 % title of the entire website & & \element{h1} \\
 % none			& -5	& new for this package \\
@@ -5454,6 +5908,15 @@
 % listitem		& 7		& new for this package, used for list items \\
 % \bottomrule
 % \end{tabular}
+% \begin{tablenotes}
+% \footnotesize 
+% \item{\textasteriskcentered} If |FormatWP| is true,
+% section headings may be adjusted, depending on |WPTitleHeading|.
+% See \cref{tab:WPsectionheadings} on \cpageref{tab:WPsectionheadings}.
+% \end{tablenotes}
+% \end{threeparttable}
+% \smallskip
+% \hrule
 % \end{table}
 %
 % Support for the \pkg{memoir} package will require the addition of a |book|
@@ -6122,6 +6585,8 @@
 \LWR at loadafter{flushend}
 \LWR at loadafter{fncychap}
 \LWR at loadafter{fnpos}
+% fontenc must be loaded before lwarp
+% fontspec must be loaded before lwarp
 \LWR at loadafter{ftnright}
 \LWR at loadafter{fullpage}
 \LWR at loadafter{fullwidth}
@@ -6134,6 +6599,7 @@
 \LWR at loadafter{hyperxmp}
 \LWR at loadafter{idxlayout}
 \LWR at loadafter{indentfirst}
+% inputenc must be loaded before lwarp
 \LWR at loadafter{keyfloat}
 \LWR at loadafter{layout}
 \LWR at loadafter{letterspace}
@@ -6152,17 +6618,21 @@
 \LWR at loadafter{microtype}
 \LWR at loadafter{midfloat}
 \LWR at loadafter{moreverb}
+% morewrites must be loaded before lwarp
 \LWR at loadafter{mparhack}
 %\LWR at loadafter{multicol}% loaded by ltxdoc
 \LWR at loadafter{multirow}
 \LWR at loadafter{nameref}
 \LWR at loadafter{needspace}
+% newclude must be loaded before lwarp
 \LWR at loadafter{newtxmath}
+% newunicodechar must be loaded before lwarp
 \LWR at loadafter{nextpage}
 \LWR at loadafter{nonumonpart}
 \LWR at loadafter{nopageno}
 \LWR at loadafter{nowidow}
 \LWR at loadafter{ntheorem}
+\LWR at loadafter{overpic}
 \LWR at loadafter{pagenote}
 \LWR at loadafter{paralist}
 \LWR at loadafter{parskip}
@@ -6655,7 +7125,7 @@
 
 % \DescribePackage{environ}
 %
-% Used to encapsulate math environments for re-use in \HTML\ ALT text.
+% Used to encapsulate math environments for re-use in \HTML\ \element{alt} text.
 %
 %    \begin{macrocode}
 \RequirePackage{environ}
@@ -7018,6 +7488,7 @@
 
 % \section{Debugging messages}
 
+% \codeall
 %    \begin{macrocode}
 \begin{warpall}
 %    \end{macrocode}
@@ -7076,15 +7547,25 @@
 }
 %    \end{macrocode}
 
+%    \begin{macrocode}
+\end{warpall}
+%    \end{macrocode}
 
 
 
+
 % \section{HTML-conversion output modifications}
 %
 % These booleans modify the \HTML\ output in various ways
 % to improve conversion to \EPUB\ or word processor imports.
 %
+% \codeall
+%    \begin{macrocode}
+\begin{warpall}
+%    \end{macrocode}
 %
+% \subsection{User-level controls}
+%
 % \DescribeBoolean{FormatEPUB}  Default false.
 %	Changes \HTML\ output for easy \EPUB\ conversion
 %	via an external program. Removes per-file headers, footers, and nav.
@@ -7100,7 +7581,7 @@
 %    \end{macrocode}
 %
 %
-% \DescribeBoolean{FormatWordProcessor} Default false.
+% \DescribeBoolean{FormatWP} Default false.
 %	Changes \HTML\ output for easier conversion
 %	by a word processor.
 %	Removes headers and nav, prints footnotes per section,
@@ -7109,34 +7590,162 @@
 %	\index{word processor>HTML conversion settings}
 %	\index{HTML>conversion settings>word processor}
 %
-% \changes{v0.28}{2017/04/09}{Added boolean \texttt{FormatWordProcessor}.}
+% \changes{v0.28}{2017/04/09}{Added boolean \texttt{FormatWP}.}
 %
 %    \begin{macrocode}
-\newbool{FormatWordProcessor}
-\boolfalse{FormatWordProcessor}
+\newbool{FormatWP}
+\boolfalse{FormatWP}
 %    \end{macrocode}
 %
 %
-% \DescribeBoolean{HTMLMarkFloats}
-% \describeHTMLMarkFloats
+% \DescribeBoolean{WPMarkFloats}
+% \describeWPMarkFloats
 %	\footnote{Perhaps some day word processors will have \HTML\ import options
-%	for identifying \element{div} classes for figures and tables,
-%   along with the associated captions.}
+%	for identifying \element{figure} and \element{figcaption} tags
+%   for figures and tables.}
 %	\index{word processor>HTML conversion settings}
 %	\index{HTML>conversion settings>word processor}
 %
-% \changes{v0.28}{2017/04/09}{Added boolean \texttt{HTMLMarkFloats}}
+% \changes{v0.28}{2017/04/09}{Added boolean \protect\texttt{HTMLMarkFloats}, changed
+%   to \protect\texttt{WPMarkFloats} as of v0.42.}
 %
 %    \begin{macrocode}
-\newbool{HTMLMarkFloats}
-\booltrue{HTMLMarkFloats}
+\newbool{WPMarkFloats}
+\boolfalse{WPMarkFloats}
 %    \end{macrocode}
 
+% \DescribeBoolean{WPMarkMinipages}
+% \changes{v0.42}{2017/10/18}{Added boolean \protect\texttt{WPMarkMinipages}.}
+% \describeWPMarkMinipages
 %    \begin{macrocode}
+\newbool{WPMarkMinipages}
+\boolfalse{WPMarkMinipages}
+%    \end{macrocode}
+
+% \DescribeBoolean{WPMarkTOC}
+% \changes{v0.42}{2017/10/18}{Added boolean \protect\texttt{WPMarkTOC}.}
+% \describeWPMarkTOC
+%    \begin{macrocode}
+\newbool{WPMarkTOC}
+\booltrue{WPMarkTOC}
+%    \end{macrocode}
+
+
+% \DescribeBoolean{WPMarkLOFT}
+% \changes{v0.42}{2017/10/19}{Added boolean \protect\texttt{WPMarkLOFT}.}
+% \describeWPMarkLOFT
+%    \begin{macrocode}
+\newbool{WPMarkLOFT}
+\boolfalse{WPMarkLOFT}
+%    \end{macrocode}
+
+
+% \DescribeBoolean{WPMarkMath}
+% \changes{v0.42}{2017/10/19}{Added boolean \protect\texttt{WPMarkMath}.}
+% \describeWPMarkMath
+%    \begin{macrocode}
+\newbool{WPMarkMath}
+\boolfalse{WPMarkMath}
+%    \end{macrocode}
+
+
+% \DescribeBoolean{WPTitleHeading}
+% \changes{v0.42}{2017/10/19}{Added boolean \protect\texttt{WPTitleHeading}.}
+% \describeWPTitleHeading
+%    \begin{macrocode}
+\newbool{WPTitleHeading}
+\boolfalse{WPTitleHeading}
+%    \end{macrocode}
+
+%    \begin{macrocode}
 \end{warpall}
 %    \end{macrocode}
 
+%
+% \subsection{Heading adjustments}
+%
+% \changes{v0.42}{2017/10/19}{If \protect\texttt{FormatWP},
+%                       shift section headings.}
+% If formatting the \HTML\ for a word processor, adjust heading levels.
+%
+% If |WPTitleHeading| is true, adjust so that |part| is \UI{Heading~1}.
+%
+% If |WPTitleHeading| is false, use \element{h1} for the title,
+%    and set |part| to \UI{Heading~2}.
+%
+%
+% \codehtml
+%    \begin{macrocode}
+\begin{warpHTML}
+%    \end{macrocode}
+%
+%    \begin{macrocode}
+\AtBeginDocument{
+\ifbool{FormatWP}{
+\@ifundefined{chapter}{
+\ifbool{WPTitleHeading}{% part and section starting at h2
+\renewcommand*{\LWR at tagtitle}{h1}
+\renewcommand*{\LWR at tagtitleend}{/h1}
+\renewcommand*{\LWR at tagpart}{h2}
+\renewcommand*{\LWR at tagpartend}{/h2}
+\renewcommand*{\LWR at tagsection}{h3}
+\renewcommand*{\LWR at tagsectionend}{/h3}
+\renewcommand*{\LWR at tagsubsection}{h4}
+\renewcommand*{\LWR at tagsubsectionend}{/h4}
+\renewcommand*{\LWR at tagsubsubsection}{h5}
+\renewcommand*{\LWR at tagsubsubsectionend}{/h5}
+\renewcommand*{\LWR at tagparagraph}{h6}
+\renewcommand*{\LWR at tagparagraphend}{/h6}
+\renewcommand*{\LWR at tagsubparagraph}{span class="subparagraph"{}}
+\renewcommand*{\LWR at tagsubparagraphend}{/span}
+}% WPTitleHeading
+{% not WPTitleHeading, part and section starting at h1
+\renewcommand*{\LWR at tagtitle}{div class="title"}
+\renewcommand*{\LWR at tagtitleend}{/div}
+\renewcommand*{\LWR at tagpart}{h1}
+\renewcommand*{\LWR at tagpartend}{/h1}
+\renewcommand*{\LWR at tagsection}{h2}
+\renewcommand*{\LWR at tagsectionend}{/h2}
+\renewcommand*{\LWR at tagsubsection}{h3}
+\renewcommand*{\LWR at tagsubsectionend}{/h3}
+\renewcommand*{\LWR at tagsubsubsection}{h4}
+\renewcommand*{\LWR at tagsubsubsectionend}{/h4}
+\renewcommand*{\LWR at tagparagraph}{h5}
+\renewcommand*{\LWR at tagparagraphend}{/h5}
+\renewcommand*{\LWR at tagsubparagraph}{h6}
+\renewcommand*{\LWR at tagsubparagraphend}{/h6}
+}% not WPTitleHeading
+}% chapter undefined
+{% chapter defined
+\ifbool{WPTitleHeading}{}
+{% not WPTitleHeading, part and chapter starting at h1
+\renewcommand*{\LWR at tagtitle}{div class="title"}
+\renewcommand*{\LWR at tagtitleend}{/div}
+\renewcommand*{\LWR at tagpart}{h1}
+\renewcommand*{\LWR at tagpartend}{/h1}
+\renewcommand*{\LWR at tagchapter}{h2}
+\renewcommand*{\LWR at tagchapterend}{/h2}
+\renewcommand*{\LWR at tagsection}{h3}
+\renewcommand*{\LWR at tagsectionend}{/h3}
+\renewcommand*{\LWR at tagsubsection}{h4}
+\renewcommand*{\LWR at tagsubsectionend}{/h4}
+\renewcommand*{\LWR at tagsubsubsection}{h5}
+\renewcommand*{\LWR at tagsubsubsectionend}{/h5}
+\renewcommand*{\LWR at tagparagraph}{h6}
+\renewcommand*{\LWR at tagparagraphend}{/h6}
+\renewcommand*{\LWR at tagsubparagraph}{span class="subparagraph"{}}
+\renewcommand*{\LWR at tagsubparagraphend}{/span}
+}% not WPTitleHeading
+}% chapter defined
+}{}% FormatWP
+}% AtBeginDocument
+%    \end{macrocode}
 
+%    \begin{macrocode}
+\end{warpHTML}
+%    \end{macrocode}
+
+
 % \section{Remembering original formatting macros}
 
 % \codehtml
@@ -7179,8 +7788,12 @@
 
 \let\LWR at origsp\sp
 \let\LWR at origsb\sb
-\let\LWR at origtextsuperscript\textsuperscript
-\let\LWR at origtextsubscript\textsubscript
+\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
@@ -7589,6 +8202,13 @@
   font-size: 120% ; font-weight: bold;
 }
 
+pre.tabbing {
+    font-family: "Linux Libertine Mono O", "Lucida Console",
+        "Droid Sans Mono", "DejaVu Mono", "Bitstream Vera Mono",
+        "Liberation Mono", "FreeMono", "Andale Mono",
+        "Nimbus Mono L", "Courier New", monospace;
+}
+
 blockquote {
     margin-left: 0px ;
     margin-right: 0px ;
@@ -7986,9 +8606,14 @@
 div.doublespace { line-height: 2 ; }
 
 
+/* Word processor format output: */
+div.wpfigure { border: 1px solid red ; margin: .5ex ; padding: .5ex ; }
+div.wptable { border: 1px solid blue ; margin: .5ex ; padding: .5ex ; }
+div.wpminipage { border: 1px solid green ; margin: .5ex ; padding: .5ex ;}
 
 
 
+
 /* Minipage environments, vertically aligned to top, center, bottom: */
 .minipage, .fminipage, .fcolorminipage {
     /* display: inline-block ; */
@@ -9319,8 +9944,9 @@
 % the resulting \HTML\ files.
 %
 % \changes{v0.28}{2017/04/11}{File \protect\texttt{lwarp\_mathjax.txt}: Updated \protect\acro{CDN} repository.}
-% \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.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.}
 %
 %
 %    \begin{macrocode}
@@ -9387,15 +10013,16 @@
     "https://cdn.mathjax.org/mathjax/contrib";
 </script>
 
-<!-- https://github.com/mathjax/MathJax-third-party-extensions/
-                                           tree/master/siunitx -->
+<!-- https://github.com/burnpanck/MathJax-siunitx -->
+
 <script type="text/x-mathjax-config">
  MathJax.Hub.Config({
-   extensions: ["tex2jax.js","[Contrib]/siunitx/siunitx.js"],
+   extensions: ["tex2jax.js","[siunitx]/siunitx.js"],
    jax: ["input/TeX","output/HTML-CSS"],
    tex2jax: {inlineMath: [["$","$"],["\\(","\\)"]]},
    TeX: {extensions: ["AMSmath.js","AMSsymbols.js", "sinuitx.js"]}
  });
+ MathJax.Ajax.config.path['siunitx']  = 'http://rawgit.com/burnpanck/MathJax-siunitx/master/';
  </script>
 
 <script type="text/x-mathjax-config">
@@ -9460,7 +10087,7 @@
 
 -- Print the usage of the lwarpmk command:
 
-printversion = "v0.41"
+printversion = "v0.42"
 
 function printhelp ()
 print ("lwarpmk: Use lwarpmk -h or lwarpmk --help for help.") ;
@@ -10212,7 +10839,7 @@
 %    \begin{macrocode}
 \NewDocumentCommand{\LWR at setexparray}{m m m}{%
 \ifthenelse{\isempty{#3}}%
-{\csdef{#1#2}{}}
+{\csdef{#1#2}{}}%
 {\expandafter\edef\csname #1#2\endcsname{\expandonce#3}}%
 }
 %    \end{macrocode}
@@ -10677,6 +11304,8 @@
 % \subsection{Mapping \LaTeX{} Sections to HTML Sections}
 
 %    \begin{macrocode}
+\newcommand*{\LWR at tagtitle}{h1}
+\newcommand*{\LWR at tagtitleend}{/h1}
 \newcommand*{\LWR at tagpart}{h2}
 \newcommand*{\LWR at tagpartend}{/h2}
 \newcommand*{\LWR at tagchapter}{h3}
@@ -11188,6 +11817,51 @@
 % \end{macro}
 
 
+% \begin{environment}{LWR at BlockClassWP} \marg{WPstyle} \marg{HTMLstyle} \marg{class} \quad
+% Low-level interface for \element{div} classes with an automatic float ID.
+% These are often used when |\ifbool{FormatWP}|.
+%
+% \changes{v0.42}{2017/10/26}{Added to factor code.}
+%
+% \codehtml
+%    \begin{macrocode}
+\begin{warpHTML}
+\NewDocumentEnvironment{LWR at BlockClassWP}{m m m}%
+{%
+\LWR at stoppars%
+\ifbool{FormatWP}%
+{%
+    \LWR at maybeincthisfloat%
+    \LWR at htmltag{%
+        div class="#3" %
+        id="autofloat-\arabic{LWR at thisfloat}"%
+        \ifblank{#1}{}{ style="#1"}%
+    }%
+}% FormatWP
+{% not FormatWP
+    \LWR at htmltag{%
+        div class="#3"%
+        \ifblank{#2}{}{ style="#2"}%
+    }%
+}% not FormatWP
+\LWR at startpars%
+}
+{\LWR at htmldivclassend{#3}}
+\end{warpHTML}
+%    \end{macrocode}
+% 
+% \codeprint
+%    \begin{macrocode}
+\begin{warpprint}
+\NewDocumentEnvironment{LWR at BlockClassWP}{m m m}{}{}%
+\end{warpprint}
+%    \end{macrocode}
+% \end{environment}
+% 
+% 
+
+
+
 % \subsection{Closing HTML tags}
 
 % \codehtml
@@ -11972,7 +12646,7 @@
 % Used to print footnotes before sections only if formatting for an \EPUB\ or word processor:
 %    \begin{macrocode}
 \newcommand*{\LWR at epubprintpendingfootnotes}{%
-\ifthenelse{\boolean{FormatEPUB}\OR\boolean{FormatWordProcessor}}%
+\ifthenelse{\boolean{FormatEPUB}\OR\boolean{FormatWP}}%
 {\LWR at printpendingfootnotes}%
 {}%
 }
@@ -11996,10 +12670,17 @@
 % \begin{macro}{\marginpar} \oarg{left} \marg{right}
 %
 % \changes{v0.21}{2017/02/11}{Fixed source listing.}
+% \changes{v0.42}{2017/10/26}{If \protect\texttt{FormatWP} emulate a wrapfig.}
 %
 %    \begin{macrocode}
 \renewcommand{\marginpar}[2][]{%
-\LWR at htmlspanclass{marginpar}{#2}%
+\ifbool{FormatWP}%
+{%
+\begin{LWR at BlockClassWP}{width:2in; float:right; margin:10pt}{}{marginblock}
+#2
+\end{LWR at BlockClassWP}
+}%
+{\LWR at htmlspanclass{marginpar}{#2}}%
 }
 %    \end{macrocode}
 % \end{macro}
@@ -12105,7 +12786,7 @@
 \StrSubstitute{\LWR at thisnewfilename}{,}{-}[\LWR at thisnewfilename]
 \StrSubstitute{\LWR at thisnewfilename}{'}{-}[\LWR at thisnewfilename]
 \StrSubstitute{\LWR at thisnewfilename}%
-{\LWR at origampersand}{-}[\LWR at thisnewfilename]
+    {\LWR at origampersand}{-}[\LWR at thisnewfilename]
 \StrSubstitute{\LWR at thisnewfilename}{+}{-}[\LWR at thisnewfilename]
 \StrSubstitute{\LWR at thisnewfilename}{,}{-}[\LWR at thisnewfilename]
 \StrSubstitute{\LWR at thisnewfilename}{/}{-}[\LWR at thisnewfilename]
@@ -12116,9 +12797,9 @@
 \StrSubstitute{\LWR at thisnewfilename}{@}{-}[\LWR at thisnewfilename]
 \StrSubstitute{\LWR at thisnewfilename}{"}{-}[\LWR at thisnewfilename]
 \StrSubstitute{\LWR at thisnewfilename}%
-{\textless}{-}[\LWR at thisnewfilename]
+    {\textless}{-}[\LWR at thisnewfilename]
 \StrSubstitute{\LWR at thisnewfilename}%
-{\textgreater}{-}[\LWR at thisnewfilename]
+    {\textgreater}{-}[\LWR at thisnewfilename]
 \StrSubstitute{\LWR at thisnewfilename}{\#}{-}[\LWR at thisnewfilename]
 \StrSubstitute{\LWR at thisnewfilename}{\%}{-}[\LWR at thisnewfilename]
 \StrSubstitute{\LWR at thisnewfilename}{\{}{-}[\LWR at thisnewfilename]
@@ -12125,7 +12806,7 @@
 \StrSubstitute{\LWR at thisnewfilename}{\}}{-}[\LWR at thisnewfilename]
 \StrSubstitute{\LWR at thisnewfilename}{|}{-}[\LWR at thisnewfilename]
 \StrSubstitute{\LWR at thisnewfilename}%
-{\textbackslash}{-}[\LWR at thisnewfilename]
+    {\textbackslash}{-}[\LWR at thisnewfilename]
 \StrSubstitute{\LWR at thisnewfilename}{^}{-}[\LWR at thisnewfilename]
 \StrSubstitute{\LWR at thisnewfilename}{~{}}{-}[\LWR at thisnewfilename]
 %     "~{}" for babel
@@ -12212,7 +12893,7 @@
 % No bottom navigation if are finishing the home page or
 % formatting for \EPUB\ or a word-processor.
 %    \begin{macrocode}
-\ifthenelse{\boolean{FormatEPUB}\OR\boolean{FormatWordProcessor}}
+\ifthenelse{\boolean{FormatEPUB}\OR\boolean{FormatWP}}
 {}
 {\ifnumcomp{\value{LWR at htmlfilenumber}}{>}{0}{\LWR at botnavigation}{}}
 %    \end{macrocode}
@@ -12262,7 +12943,7 @@
 %
 % No navigation between files if formatting for an \EPUB\ or word processor:
 %    \begin{macrocode}
-\ifthenelse{\boolean{FormatEPUB}\OR\boolean{FormatWordProcessor}}
+\ifthenelse{\boolean{FormatEPUB}\OR\boolean{FormatWP}}
 {}
 {\LWR at topnavigation}
 
@@ -12270,7 +12951,7 @@
 %
 % No header if between files if formatting for an \EPUB\ or word processor:
 %    \begin{macrocode}
-\ifthenelse{\boolean{FormatEPUB}\OR\boolean{FormatWordProcessor}}
+\ifthenelse{\boolean{FormatEPUB}\OR\boolean{FormatWP}}
 {}
 {
     \LWR at htmlelement{header}
@@ -12285,7 +12966,7 @@
 % Print title only if there is one.
 % Skip if formatting for an \EPUB\ or word processor:
 %    \begin{macrocode}
-\ifthenelse{\boolean{FormatEPUB}\OR\boolean{FormatWordProcessor}}
+\ifthenelse{\boolean{FormatEPUB}\OR\boolean{FormatWP}}
 {}
 {\ifcsvoid{thetitle}{}{\LWR at printthetitle}}
 
@@ -12293,7 +12974,7 @@
 %
 % No side\TOC\ if formatting for an \EPUB\ or word processor:
 %    \begin{macrocode}
-\ifthenelse{\boolean{FormatEPUB}\OR\boolean{FormatWordProcessor}}
+\ifthenelse{\boolean{FormatEPUB}\OR\boolean{FormatWP}}
 {}
 {\LWR at sidetoc}
 
@@ -13132,7 +13813,7 @@
 %	force filedepth to single-file only,
 %	force \HTML\ debug comments off.
 %    \begin{macrocode}
-\ifbool{FormatWordProcessor}{%
+\ifbool{FormatWP}{%
     \setcounter{FileDepth}{-5}%
     \boolfalse{HTMLDebugComments}%
 }{}
@@ -13273,13 +13954,6 @@
 %    \end{macrocode}
 % \end{macro}
 
-% ^^A % Not yet working:
-% ^^A %    \begin{macrocode}
-% ^^A % \AfterEndPreamble{
-% ^^A % \LWR at traceinfo{Patching @ensuredmath}% *8*
-% ^^A % \let\@ensuredmath\LWR at ensuredmath
-% ^^A % }
-% ^^A %    \end{macrocode}
 
 %    \begin{macrocode}
 \end{warpHTML}
@@ -13347,7 +14021,7 @@
 %
 % Presumably has a table-of-contents.
 %    \begin{macrocode}
-\ifthenelse{\boolean{FormatEPUB}\OR\boolean{FormatWordProcessor}}
+\ifthenelse{\boolean{FormatEPUB}\OR\boolean{FormatWP}}
 {}
 {
     \ifnumcomp{\value{LWR at htmlfilenumber}}{>}{0}{\LWR at botnavigation}{}
@@ -13618,9 +14292,9 @@
 \newcommand*{\printtitle}
 {
 \LWR at stoppars
-\LWR at htmltag{h1}%
+\LWR at htmltag{\LWR at tagtitle}%
 \@title%
-\LWR at htmltag{/h1}
+\LWR at htmltag{\LWR at tagtitleend}
 \LWR at startpars
 }
 %    \end{macrocode}
@@ -13633,9 +14307,9 @@
 \newcommand*{\LWR at printthetitle}
 {
 \LWR at stoppars
-\LWR at htmltag{h1}%
+\LWR at htmltag{\LWR at tagtitle}%
 \thetitle%
-\LWR at htmltag{/h1}
+\LWR at htmltag{\LWR at tagtitleend}
 \LWR at startpars
 }
 %    \end{macrocode}
@@ -13879,9 +14553,9 @@
 %
 %    \begin{macrocode}
 \DeclareDocumentCommand{\@maketitle}{}{%
-    \LWR at stoppars\LWR at htmltag{h1}
+    \LWR at stoppars\LWR at htmltag{\LWR at tagtitle}
     \@title
-    \LWR at htmltag{/h1}\LWR at startpars
+    \LWR at htmltag{\LWR at tagtitleend}\LWR at startpars
     \begin{BlockClass}{author}
         \renewcommand{\and}{
             \end{BlockClass}
@@ -14170,7 +14844,7 @@
 
 
 
-% \section{Verbatim}
+% \section{Verbatim and tabbing}
 
 % \changes{v0.34}{2017/07/27}{Verbatim refactored to
 %		remove \protect\pkg{fancyvrb} requirement.}
@@ -14303,12 +14977,34 @@
 \LWR at forcenewpage
 \LWR at atbeginverbatim{verbatim}\unskip\LWR at origvspace*{-\baselineskip}%
 }
-\AfterEndEnvironment{verbatim}{\unskip\LWR at origvspace*{-\baselineskip}\LWR at afterendverbatim}
+\AfterEndEnvironment{verbatim}{%
+    \unskip\LWR at origvspace*{-\baselineskip}\LWR at afterendverbatim%
 }
+}
 %    \end{macrocode}
 % \end{environment}
 
+
+% \begin{environment}{tabbing}
+%
+% \changes{v0.42}{2017/10/13}{Added.}
+%
 %    \begin{macrocode}
+\AfterEndPreamble{
+\LWR at traceinfo{Patching tabbing.}
+\AtBeginEnvironment{tabbing}{%
+\LWR at forcenewpage
+\LWR at atbeginverbatim{tabbing}\unskip\LWR at origvspace*{-\baselineskip}%
+}
+\AfterEndEnvironment{tabbing}{%
+    \unskip\LWR at origvspace*{-\baselineskip}\LWR at afterendverbatim%
+}
+}
+%    \end{macrocode}
+% \end{environment}
+
+
+%    \begin{macrocode}
 \end{warpHTML}
 %    \end{macrocode}
 
@@ -15365,7 +16061,7 @@
 % converted to \HTML.
 %
 % \begin{table}
-% \caption{Tabular \HTML\ column conversions\label{tab:columnconversions}}
+% \caption{Tabular HTML column conversions\label{tab:columnconversions}}
 % \index{tabular>HTML colummn conversion}
 % \index{HTML>tabular column conversion}
 %
@@ -15394,6 +16090,7 @@
 % \item [S:] Converted to 'r'.  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.
 % \item [Unknown:] Converted to 'l'.
 % \item [\cs{newcolumn}:] Currently treated as unknown.
 % \end{description}
@@ -15590,16 +16287,10 @@
 %    \begin{macrocode}
 \newcommand*{\LWR at printbartag}[1]{%
 \ifboolexpr{bool{LWR at tabularmutemods} or bool{LWR at emptyatbang}}%
-{%
-}%
-{ % not muting
-    \ifstrequal{#1}{leftedge}{%
-            \LWR at getexparray{LWR at colbarspec}{leftedge} %
-    }%
-    {
-        \LWR at getexparray{LWR at colbarspec}{#1} %
-        \edef\LWR at tempone{\LWR at getexparray{LWR at colbarspec}{#1}}%
-    } %
+{}% muting or empty
+{% not muting
+    \edef\LWR at tempone{\LWR at getexparray{LWR at colbarspec}{#1}}%
+    \ifdefempty{\LWR at tempone}{}{ \LWR at tempone}%
 }% not muting
 }
 %    \end{macrocode}
@@ -15630,7 +16321,9 @@
         \LWR at subaddcmidruletrim{}{}%
         \LWR at printbartag{#2}%
         "%
+        \LWR at tdstartstyles%
         \LWR at addcmidrulewidth%
+        \LWR at tdendstyles%
     }%
 %    \end{macrocode}
 % Create an empty cell if muting for the \cs{bottomrule}:
@@ -15719,7 +16412,13 @@
         \LWR at addleftmostbartag%
         \LWR at printbartag{\theLWR at tablecolspos}%
         "%
+%    \end{macrocode}
+% \changes{v0.42}{2017/10/26}{If \protect\texttt{FormatWP} add cell alignment.}
+%    \begin{macrocode}
+        \LWR at tdstartstyles%
         \LWR at addcmidrulewidth%
+        \LWR at addformatwpalignment%
+        \LWR at tdendstyles%
         }%
 %    \end{macrocode}
 % If this is a p, m, b, or X column, allow paragraphs:
@@ -15800,9 +16499,9 @@
 
 
 % \DescribeLength{\LWR at thiscmidrulewidth}
-% The width of the next rule, defaulting to \cs{lightrulewidth}.
+% The width of the next rule, defaulting to \cs{LWR at cmidrulewidth}.
 %
-% If not \cs{lightrulewidth}, a style will be used to generate
+% If not \cs{LWR at cmidrulewidth}, a style will be used to generate
 % the custom width.
 %
 % Assigned from the |LWR at midrules| array.
@@ -15877,7 +16576,7 @@
 
 
 
-% Used to compute margins, tabular trims
+% Used to compute margins, tabular trims:
 %    \begin{macrocode}
 \newlength{\LWR at templengthone}%
 \newlength{\LWR at templengthtwo}%
@@ -15884,10 +16583,49 @@
 %    \end{macrocode}
 
 
+% Used to add a style to a table data cell:
+%    \begin{macrocode}
+\newboolean{LWR at tdhavecellstyle}
+%    \end{macrocode}
+
+% \begin{macro}{\LWR at tdstartstyles}
+% Begins possibly adding a table data cell style.
+%    \begin{macrocode}
+\newcommand*{\LWR at tdstartstyles}{\global\boolfalse{LWR at tdhavecellstyle}}
+%    \end{macrocode}
+% \end{macro}
+
+% \begin{macro}{\LWR at tdaddstyle}
+% Starts adding a table data cell style.
+%    \begin{macrocode}
+\newcommand*{\LWR at tdaddstyle}{%
+\ifbool{LWR at tdhavecellstyle}%
+{; }%
+{ style="}%
+\booltrue{LWR at tdhavecellstyle}%
+}
+%    \end{macrocode}
+% \end{macro}
+
+% \begin{macro}{\LWR at tdendstyles}
+% Finishes possibly adding a table data cell style.
+% Prints the closing quote.
+%    \begin{macrocode}
+\newcommand*{\LWR at tdendstyles}{%
+\ifbool{LWR at tdhavecellstyle}{%
+    "%
+    \global\boolfalse{LWR at tdhavecellstyle}%
+}{}%
+}
+%    \end{macrocode}
+% \end{macro}
+
+
 % \begin{macro}{\LWR at subaddcmidruletrim} \marg{lefttrim} \marg{righttrim}
 % Adds a \cs{cmidrule} with optional trim.
 %
 % \changes{v0.41}{2017/10/05}{Added.}
+% \changes{v0.42}{2017/10/19}{0pt if no rule given.}
 %
 %    \begin{macrocode}
 \newcommand*{\LWR at subaddcmidruletrim}[2]{%
@@ -15902,7 +16640,10 @@
 %   Remember the width of the rule:
 %    \begin{macrocode}
     \setlength{\LWR at thiscmidrulewidth}{\LWR at templengthone}%
-}{}%
+}%
+{%
+    \setlength{\LWR at thiscmidrulewidth}{0pt}%
+}%
 }
 %    \end{macrocode}
 % \end{macro}
@@ -15927,12 +16668,20 @@
 %
 % If not default width, add a custom style with width and color
 % depending on |thiswidth|.
+%
+% Must be placed between \cs{LWR at tdstartstyles} and \cs{LWR at tdendstyles}.
+%
+% \changes{v0.42}{2017/10/10}{If \protect\texttt{FormatWP} force explicit border.}
+%
 %    \begin{macrocode}
 \newcommand{\LWR at addrulewidth}[2]{%
 %    \end{macrocode}
 % Only add a custom width if |thiswidth| is different than the |defaultwidth|:
 %    \begin{macrocode}
-\ifdimcomp{#1}{=}{#2}%
+\ifboolexpr{%
+    test{\ifdimcomp{#1}{=}{0pt}}%
+    or ( test{\ifdimcomp{#1}{=}{#2}} and not bool{FormatWP} )%
+}%
 {}% default width
 {% custom width
 %    \end{macrocode}
@@ -15939,9 +16688,16 @@
 % Ensure that the width is wide enough to display in the browser:
 %    \begin{macrocode}
     \LWR at forceminwidth{#1}%
-    \uselengthunit{PT} % explicit space
-    style="border-top:\rndprintlength{\LWR at atleastonept} solid %
 %    \end{macrocode}
+% Begin adding a style:
+%    \begin{macrocode}
+    \LWR at tdaddstyle%
+%    \end{macrocode}
+% The style itself:
+%    \begin{macrocode}
+    \uselengthunit{PT}%
+    border-top:\rndprintlength{\LWR at atleastonept} solid %
+%    \end{macrocode}
 % The darkness of the color depends on the thickness of the rule:
 %    \begin{macrocode}
     \ifdimcomp{#1}{<}{\LWR at lightrulewidth}%
@@ -15951,7 +16707,6 @@
         {\#808080}%
         {black}%
     }% lightrule or heavier
-    "%
 }% custom width
 }
 %    \end{macrocode}
@@ -15959,6 +16714,9 @@
 
 
 % \begin{macro}{\LWR at addcmidrulewidth}
+% Adds a \attribute{style} for the rule width.
+%
+% Must be placed between \cs{LWR at tdstartstyles} and \cs{LWR at tdendstyles}.
 %    \begin{macrocode}
 \newcommand{\LWR at addcmidrulewidth}{%
 \LWR at addrulewidth{\LWR at thiscmidrulewidth}{\LWR at cmidrulewidth}%
@@ -15968,6 +16726,41 @@
 
 
 
+% \begin{macro}{\LWR at WPcell} \marg{text-align} \marg{vertical-align}
+%    \begin{macrocode}
+\newcommand*{\LWR at WPcell}[2]{%
+\LWR at tdaddstyle%
+text-align:#1; vertical-align:#2%
+}
+%    \end{macrocode}
+% \end{macro}
+
+% \begin{macro}{\LWR at addformatwpalignment}
+% If |FormatWP|, adds a \attribute{style} for the alignment.
+%
+% Must be placed between \cs{LWR at tdstartstyles} and \cs{LWR at tdendstyles}.
+%
+% \changes{v0.42}{2017/10/26}{If \protect\texttt{FormatWP} add explicit style
+%   for cell alignment.}
+%    \begin{macrocode}
+\newcommand*{\LWR at addformatwpalignment}{%
+\ifbool{FormatWP}{%
+\StrChar{\LWR at tablecolspec}{\theLWR at tablecolspos}[\LWR at strresult]%
+\ifdefstring{\LWR at strresult}{l}{\LWR at WPcell{left}{middle}}{}%
+\ifdefstring{\LWR at strresult}{c}{\LWR at WPcell{center}{middle}}{}%
+\ifdefstring{\LWR at strresult}{r}{\LWR at WPcell{right}{middle}}{}%
+\ifdefstring{\LWR at strresult}{p}{\LWR at WPcell{left}{bottom}}{}%
+\ifdefstring{\LWR at strresult}{m}{\LWR at WPcell{left}{middle}}{}%
+\ifdefstring{\LWR at strresult}{b}{\LWR at WPcell{left}{top}}{}%
+\ifdefstring{\LWR at strresult}{P}{\LWR at WPcell{center}{bottom}}{}%
+\ifdefstring{\LWR at strresult}{M}{\LWR at WPcell{center}{middle}}{}%
+\ifdefstring{\LWR at strresult}{B}{\LWR at WPcell{center}{top}}{}%
+}{}%
+}
+%    \end{macrocode}
+% \end{macro}
+
+
 % \subsection{Multicolumns}
 
 % \subsubsection{Parsing multicolumns}
@@ -16214,7 +17007,13 @@
 % Close the class tag's opening quote:
 %    \begin{macrocode}
 "%
+%    \end{macrocode}
+% \changes{v0.42}{2017/10/26}{If \protect\texttt{FormatWP} add cell alignment.}
+%    \begin{macrocode}
+\LWR at tdstartstyles%
 \LWR at addcmidrulewidth%
+\LWR at addformatwpalignment%
+\LWR at tdendstyles%
 }% end of the opening table data tag
 \global\boolfalse{LWR at intabularmetadata}%
 \LWR at parsemulticolumnalignment{#4}{\LWR at printmccoldata}%
@@ -16304,9 +17103,9 @@
 % Star version, show a caption but do not make a LOT entry:
 %    \begin{macrocode}
 {% yes star
-    \LWR at htmlblocktag{figcaption}%
+    \LWR at figcaption%
     #3%
-    \LWR at htmlblocktag{/figcaption}%
+    \endLWR at figcaption%
 }%
 {% No star:
 %    \end{macrocode}
@@ -16327,9 +17126,9 @@
 %    \end{macrocode}
 % Create an \HTML\ caption.  Afterwards, maybe make a LOT entry.
 %    \begin{macrocode}
-    \LWR at htmlblocktag{figcaption}%
+    \LWR at figcaption%
     \csuse{fnum@\LTcaptype}\CaptionSeparator#3%
-    \LWR at htmlblocktag{/figcaption}%
+    \endLWR at figcaption%
 %    \end{macrocode}
 % See if an optional caption was given:
 %    \begin{macrocode}
@@ -16843,16 +17642,25 @@
 % If so, optional space below the line may be specified, but will be ignored.
 %
 % \changes{v0.40}{2017/09/06}{Added.}
+% \changes{v0.42}{2017/10/19}{If \protect\texttt{FormatWP} force explicit border.}
 %
 %    \begin{macrocode}
 \AtBeginDocument{
 \@ifpackageloaded{lwarp-tabls}
-{\newcommand*{\LWR at hline}[1][]{%
-    \booltrue{LWR at doinghline}%
-    \LWR at getmynexttoken}}
-{\newcommand*{\LWR at hline}{%
-    \booltrue{LWR at doinghline}%
-    \LWR at getmynexttoken}}
+{
+\newcommand*{\LWR at hline}[1][]{%
+    \ifbool{FormatWP}%
+    {\LWR at docmidrule{1-\theLWR at tabletotalcols}}%
+    {\booltrue{LWR at doinghline}}%
+    \LWR at getmynexttoken}%
+}
+{
+\newcommand*{\LWR at hline}{%
+    \ifbool{FormatWP}%
+    {\LWR at docmidrule{1-\theLWR at tabletotalcols}}%
+    {\booltrue{LWR at doinghline}}%
+    \LWR at getmynexttoken}%
+}
 }% AtBeginDocument
 %    \end{macrocode}
 % \end{macro}
@@ -16967,12 +17775,17 @@
 {\LWR at docmidrule{##1}\LWR at getmynexttoken}%
 %    \end{macrocode}
 % \changes{v0.41}{2017/10/03}{Improved rules.}
+% \changes{v0.42}{2017/10/19}{If \protect\texttt{FormatWP} force explicit border.}
 %    \begin{macrocode}
 \DeclareDocumentCommand{\toprule}{o d()}
     {%
         \IfValueTF{##1}%
             {\LWR at docmidrule[##1](){1-\theLWR at tabletotalcols}}%
-            {\booltrue{LWR at doingtbrule}}%
+            {%
+                \ifbool{FormatWP}%
+                {\LWR at docmidrule[##1](){1-\theLWR at tabletotalcols}}%
+                {\booltrue{LWR at doingtbrule}}%
+            }%
     \LWR at getmynexttoken}%
 %
 \DeclareDocumentCommand{\midrule}{o d()}%
@@ -16979,7 +17792,11 @@
     {%
         \IfValueTF{##1}%
             {\LWR at docmidrule[##1](){1-\theLWR at tabletotalcols}}%
-            {\booltrue{LWR at doinghline}}%
+            {%
+                \ifbool{FormatWP}%
+                {\LWR at docmidrule[##1](){1-\theLWR at tabletotalcols}}%
+                {\booltrue{LWR at doinghline}}%
+            }%
     \LWR at getmynexttoken}%
 %
 \DeclareDocumentCommand{\cmidrule}{O{\LWR at cmidrulewidth} d() m}%
@@ -16989,7 +17806,11 @@
     {%
         \IfValueTF{##1}%
             {\LWR at docmidrule[##1](){1-\theLWR at tabletotalcols}}%
-            {\booltrue{LWR at doingtbrule}}%
+            {%
+                \ifbool{FormatWP}%
+                {\LWR at docmidrule[##1](){1-\theLWR at tabletotalcols}}%
+                {\booltrue{LWR at doingtbrule}}%
+            }%
     \LWR at getmynexttoken}%
 %
 \DeclareDocumentCommand{\addlinespace}{o}{}%
@@ -17708,13 +18529,10 @@
 % \begin{macro}{\LWR at floatbegin} \marg{type} \oarg{placement}
 %
 % Begins a \cs{newfloat} environment.
+%
 %    \begin{macrocode}
 \NewDocumentCommand{\LWR at floatbegin}{m o}{%
-\ifthenelse{\boolean{FormatWordProcessor}\AND\boolean{HTMLMarkFloats}}{%
-
-=== #1 begin
-
-}{}%
+\ifbool{FormatWP}{\newline}{}%
 \LWR at stoppars
 %    \end{macrocode}
 % There is a new float, so increment the unique float counter:
@@ -17724,20 +18542,30 @@
 %    \end{macrocode}
 %
 %    \begin{macrocode}
-\begingroup
+\begingroup%
 %    \end{macrocode}
 % Settings while inside the environment:
 %    \begin{macrocode}
-\LWR at origraggedright
+\LWR at origraggedright%
 %    \end{macrocode}
 % Open an \HTML\ |figure| tag:
+% \changes{v0.42}{2017/10/26}{If \protect\texttt{FormatWP} add a text frame.}
 %    \begin{macrocode}
-\LWR at htmltag{figure id="autofloat-\arabic{LWR at thisfloat}" class="#1"}
+\LWR at htmltag{figure id="autofloat-\arabic{LWR at thisfloat}" class="#1"}%
+\ifbool{FormatWP}{%
+    \LWR at orignewline%
+    \LWR at BlockClassWP{}{}{wp#1}%
+}{}%
 %    \end{macrocode}
 %    \begin{macrocode}
-\renewcommand*{\@captype}{#1}
-\caption at settype{#1}
-\LWR at startpars
+\renewcommand*{\@captype}{#1}%
+\caption at settype{#1}%
+\LWR at startpars%
+\ifboolexpr{bool{FormatWP} and bool{WPMarkFloats}}{%
+
+=== begin #1 ===
+
+}{}%
 }
 %    \end{macrocode}
 % \end{macro}
@@ -17758,16 +18586,22 @@
 % Ends a \cs{newfloat} environment.
 %    \begin{macrocode}
 \newcommand*{\LWR at floatend}{%
+\ifboolexpr{bool{FormatWP} and bool{WPMarkFloats}}{%
+
+=== end ===
+
+}{}%
 \LWR at stoppars%
+%    \end{macrocode}
+% Close an \HTML\ |figure| tag:
+% \changes{v0.42}{2017/10/26}{If \protect\texttt{FormatWP} add a text frame.}
+%    \begin{macrocode}
+\ifbool{FormatWP}{\endLWR at BlockClassWP}{}%
 \LWR at htmlelementend{figure}%
 \endgroup%
 \boolfalse{LWR at freezethisfloat}%
 \LWR at startpars%
-\ifthenelse{\boolean{FormatWordProcessor}\AND\boolean{HTMLMarkFloats}}{%
-
-=== end
-
-}{}%
+\ifbool{FormatWP}{\newline}{}%
 }
 %    \end{macrocode}
 % \end{macro}
@@ -17881,7 +18715,30 @@
 \setcounter{LWR at latestautopage}{1}
 %    \end{macrocode}
 
+
+% \begin{environment}{LWR at figcaption}
+%   \qquad Encapsulates a caption inside \element{figcaption},
+%   and if |FormatWP| then also a \element{div} with an italic style.
+% \changes{v0.42}{2017/10/20}{If \protect\texttt{FormatWP} forces italic captions.}
 %    \begin{macrocode}
+\newenvironment*{LWR at figcaption}
+{%
+\LWR at htmlblocktag{figcaption}
+\ifbool{FormatWP}{%
+\begin{BlockClass}[font-style:italic]{italic}
+\LWR at origvspace*{\baselineskip}
+}{}%
+}
+{%
+\ifbool{FormatWP}{\end{BlockClass}}{}%
+\LWR at htmlblocktag{/figcaption}%
+}
+%    \end{macrocode}
+% \end{environment}
+
+
+
+%    \begin{macrocode}
 \let\LWR at origcaption@begin\caption at begin
 \let\LWR at origcaption@end\caption at end
 \let\LWR at orig@@par\@@par
@@ -17909,7 +18766,7 @@
 %    \end{macrocode}
 % Enclose the original caption code inside an \HTML\ tag:
 %    \begin{macrocode}
-\LWR at htmlblocktag{figcaption}%
+\LWR at figcaption%
 \LWR at origcaption@begin%
 }
 %    \end{macrocode}
@@ -17928,7 +18785,7 @@
 %    \end{macrocode}
 % Closing tag:
 %    \begin{macrocode}
-\LWR at htmlblocktag{/figcaption}%
+\endLWR at figcaption%
 \endgroup%
 % \leavevmode% avoid bad space factor (0) error
 \LWR at traceinfo{LWR at caption@end: done}%
@@ -18129,6 +18986,7 @@
 %    \end{macrocode}
 % \end{macro}
 
+% \begin{macro}{\@starttoc} \marg{ext}
 %
 % Patch \cs{@starttoc} to encapsulate the \TOC\ inside \HTML\ tags:
 %    \begin{macrocode}
@@ -18140,20 +18998,26 @@
 \LWR at htmlelementclassend{nav}{#1}
 }
 %    \end{macrocode}
+% \end{macro}
 %
+% \begin{macro}{\tableofcontents}
 % Patch \cs{tableofcontents}, etc. to print footnotes first.
 % \pkg{newfloat} uses \cs{listoffigures} for all future float types.
 %    \begin{macrocode}
 \let\LWR at origtableofcontents\tableofcontents
-\let\LWR at origlistoffigures\listoffigures
-\let\LWR at origlistoftables\listoftables
 
 \renewcommand*{\tableofcontents}{%
 %    \end{macrocode}
 % Do not print the table of contents if formatting for a word processor,
 % which will presumably auto-generate its own updated table of contents:
+% \changes{v0.42}{2017/10/18}{Added boolean \protect\texttt{WPMarkTOC}.}
 %    \begin{macrocode}
-\ifbool{FormatWordProcessor}{}{
+\ifboolexpr{bool{FormatWP} and bool{WPMarkTOC}}{
+
+=== table of contents ===
+
+}
+{
 %    \end{macrocode}
 % Copy the |.toc| file to |.sidetoc| for printing the side\TOC.
 % The original |.toc| file is renewed when \cs{tableofcontents} is finished.
@@ -18163,20 +19027,46 @@
     \LWR at origtableofcontents
 }
 }
+%    \end{macrocode}
+% \end{macro}
+
+% \begin{macro}{\listoffigures}
+% \changes{v0.42}{2017/10/18}{Added boolean \protect\texttt{WPMarkLOFT}.}
+%    \begin{macrocode}
+\let\LWR at origlistoffigures\listoffigures
+
 \renewcommand*{\listoffigures}{
-\ifbool{FormatWordProcessor}{}{
+\ifboolexpr{bool{FormatWP} and bool{WPMarkLOFT}}{
+
+=== list of figures ===
+
+}
+{
     \LWR at printpendingfootnotes
     \LWR at origlistoffigures
 }
 }
+%    \end{macrocode}
+% \end{macro}
 
+% \begin{macro}{\listoftables}
+% \changes{v0.42}{2017/10/18}{Added boolean \protect\texttt{WPMarkLOFT}.}
+%    \begin{macrocode}
+\let\LWR at origlistoftables\listoftables
+
 \renewcommand*{\listoftables}{
-\ifbool{FormatWordProcessor}{}{
+\ifboolexpr{bool{FormatWP} and bool{WPMarkLOFT}}{
+
+=== list of tables ===
+
+}
+{
     \LWR at printpendingfootnotes
     \LWR at origlistoftables
 }
 }
 %    \end{macrocode}
+% \end{macro}
 
 
 % \subsection{High-level TOC commands}
@@ -18575,30 +19465,128 @@
 
 
 
+% \section{Restoring original formatting}
+%
+%
+% \begin{macro}{\LWR at restoreorigformatting}
+% Used to temporarily restore
+% the print-mode meaing of a number of formatting, graphics, and symbols-related
+% macros while generating \SVG\ math or a \env{lateximage}.
+% A number of packages will \cs{appto} additional actions to this macro.
+%
+% Various packages add to this macro using \cs{appto}.
+%
+% \label{sec:restoreorigformatting}
+%
+% \changes{v0.34}{2017/08/05}{Improved font control.}
+% \changes{v0.34}{2017/08/08}{\pkg{booktabs}: Works inside \env{lateximage}.}
+% \changes{v0.36}{2017/08/16}{\pkg{siunitx}: Improved super/subscripts in a \env{lateximage}.}
+% \changes{v0.39}{2017/09/01}{Appended with \cs{appto} instead of calling various macros.}
+% \changes{v0.40}{2017/09/09}{Improved symbols inside a \env{lateximage}.}
+% \changes{v0.40}{2017/09/09}{Improved \protect\LaTeX\ logos inside a \env{lateximage}.}
+% \changes{v0.40}{2017/09/09}{Nullified \cs{InlineClass}, etc. inside a \env{lateximage}.}
+% \changes{v0.42}{2017/10/16}{Improved \cs{ensuremath}.}
+%
+%    \begin{macrocode}
+\newcommand*{\LWR at restoreorigformatting}{%
+\LWR at traceinfo{LWR at restoreorigformatting}%
+\linespread{1}%
+\RenewDocumentCommand{\InlineClass}{o m +m}{##3}%
+\RenewDocumentEnvironment{BlockClass}{o m}{}{}%
+\renewcommand{\BlockClassSingle}[2]{##2}%
+\LetLtxMacro{\hspace}{\LWR at orighspace}%
+\LetLtxMacro\rule\LWR at origrule%
+\let\,\LWR at origcomma% disable HTML short unbreakable space
+\let\textellipsis\LWR at origtextellipsis%
+\let\textless\LWR at origtextless%
+\let\textgreater\LWR at origtextgreater%
+\LetLtxMacro{\textrm}{\LWR at origtextrm}%
+\LetLtxMacro{\textsf}{\LWR at origtextsf}%
+\LetLtxMacro{\texttt}{\LWR at origtexttt}%
+\LetLtxMacro{\textbf}{\LWR at origtextbf}%
+\LetLtxMacro{\textmd}{\LWR at origtextmd}%
+\LetLtxMacro{\textit}{\LWR at origtextit}%
+\LetLtxMacro{\textsl}{\LWR at origtextsl}%
+\LetLtxMacro{\textsc}{\LWR at origtextsc}%
+\LetLtxMacro{\textup}{\LWR at origtextup}%
+\LetLtxMacro{\textnormal}{\LWR at origtextnormal}%
+\LetLtxMacro{\emph}{\LWR at origemph}%
+\LetLtxMacro{\rmfamily}{\LWR at origrmfamily}%
+\LetLtxMacro{\sffamily}{\LWR at origsffamily}%
+\LetLtxMacro{\ttfamily}{\LWR at origttfamily}%
+\LetLtxMacro{\bfseries}{\LWR at origbfseries}%
+\LetLtxMacro{\mdseries}{\LWR at origmdseries}%
+\LetLtxMacro{\upshape}{\LWR at origupshape}%
+\LetLtxMacro{\slshape}{\LWR at origslshape}%
+\LetLtxMacro{\scshape}{\LWR at origscshape}%
+\LetLtxMacro{\itshape}{\LWR at origitshape}%
+\LetLtxMacro{\em}{\LWR at origem}%
+\LetLtxMacro{\normalfont}{\LWR at orignormalfont}%
+\let\sp\LWR at origsp%
+\let\sb\LWR at origsb%
+\LetLtxMacro\textsuperscript\LWR at origtextsuperscript%
+\LetLtxMacro\@textsuperscript\LWR at orig@textsuperscript%
+\LetLtxMacro\textsubscript\LWR at origtextsubscript%
+\LetLtxMacro\@textsubscript\LWR at orig@textsubscript%
+\LetLtxMacro\underline\LWR at origunderline%
+\let~\LWR at origtilde%
+\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\toprule\LWR at origtoprule%
+\LetLtxMacro\midrule\LWR at origmidrule%
+\LetLtxMacro\cmidrule\LWR at origcmidrule%
+\LetLtxMacro\bottomrule\LWR at origbottomrule%
+\LetLtxMacro\addlinespace\LWR at origaddlinespace%
+\LetLtxMacro\morecmidrules\LWR at origmorecmidrules%
+\LetLtxMacro\specialrule\LWR at origspecialrule%
+\let\newline\LWR at orignewline%
+\LetLtxMacro{\raisebox}{\LWR at origraisebox}%
+\LetLtxMacro\includegraphics\LWR at origincludegraphics%
+\LetLtxMacro{\scalebox}{\LWR at origscalebox}%
+\LetLtxMacro{\rotatebox}{\LWR at origrotatebox}%
+\let\reflectbox\LWR at origreflectbox%
+\LetLtxMacro\resizebox\LWR at origresizebox%
+\let\framebox\LWR at origframebox%
+\let\makebox\LWR at origmakebox%
+\let\fbox\LWRprint at fbox%
+\let\fboxBlock\LWRprint at fbox%
+\LetLtxMacro{\fminipage}{\LWRprint at fminipage}%
+\LetLtxMacro{\endfminipage}{\endLWRprint at fminipage}%
+\LetLtxMacro{\minipage}{\LWR at origminipage}%
+\let\endminipage\LWR at endminipage%
+\LetLtxMacro{\parbox}{\LWR at origparbox}%
+\let\TeX\LWR at origTeX%
+\let\LaTeX\LWR at origLaTeX%
+\let\LaTeXe\LWR at origLaTeXe%
+\renewcommand*{\Xe}{X\textsubscript{E}}%
+\LetLtxMacro\@ensuredmath\LWR at origensuredmath%
+%
+\LWR at restoreorigaccents%
+%
+\LWR at FBcancel%
+}
+%    \end{macrocode}
+% \end{macro}
+
+
+
 % \section{Math}
 % \label{sec:math}
 %
+%
+%
+% \subsection{Limitations}
+%
 % \limitsmath
 %
 %
-% \label{ex:mathjaxmacros}
-% As an example of using custom \LaTeX\ macros with MathJax,
-% \margintag{custom MathJax macros}
-% place the following at the start of the document,
-% after |\begin{document}|:
-% \begin{Verbatim}[gobble=2,frame=lines,obeytabs,tabsize=4]
-% \begin{warpHTML}  % Only for HTML output,
-% \ifbool{mathjax}  % and only for MathJax output:
-% {
-% \(  % New macros for MathJax are placed inside a math expression:
-% \newcommand{\expval}[1]{\langle#1\rangle}
-% \newcommand{\abs}[1]{\lvert#1\rvert}
-% \)
-% }{}
-% \end{warpHTML}
-% \end{Verbatim}
-
-
+%
+% \subsection{Inline and display math}
+%
+%
 % \codehtml
 %    \begin{macrocode}
 \begin{warpHTML}
@@ -18605,7 +19593,6 @@
 %    \end{macrocode}
 
 
-
 % \DescribeMacro{\$}
 %	Plain dollar signs appearing in the \HTML\ output may be interpreted
 %	by MathJax to be math shifts.
@@ -18635,8 +19622,6 @@
 
 
 
-% \subsection{Inline and display math}
-
 %    \begin{macrocode}
 \LetLtxMacro\LWR at origdollar$
 \LetLtxMacro\LWR at secondorigdollar$% balance for editor syntax highlighting
@@ -18660,48 +19645,70 @@
 
 
 % \begin{macro}{\LWR at doubledollar}
+%
 % \changes{v0.19}{2016/05/25}{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:
 %    \begin{macrocode}
 \gdef\LWR at doubledollar$#1$${
-\ifbool{mathjax}%
 %    \end{macrocode}
+% If 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 |\]|:
 %    \begin{macrocode}
-{\textbackslash[\LWR at HTMLsanitize{#1}\textbackslash]}
+{
+
+        \textbackslash[%
+        \LWR at HTMLsanitize{#1}%
+        \textbackslash]
+
+}% mathjax
 %    \end{macrocode}
-% For SVG, print the math inside a \env{lateximage}, with an ALT tag of the \LaTeX\ code:
+% For SVG, print the math inside a \env{lateximage},
+%   with an \element{alt} tag of the \LaTeX\ code:
 %    \begin{macrocode}
 {% not mathjax
 
-\begin{lateximage}%
-[\textbackslash{[} \LWR at HTMLsanitize{#1} \textbackslash{]}]%
-\LWR at origdollar\LWR at origdollar#1\LWR at origdollar\LWR at origdollar%
-\end{lateximage}
+        \begin{lateximage}%
+        [\textbackslash{[} \LWR at HTMLsanitize{#1} \textbackslash{]}]%
+        \LWR at origdollar\LWR at origdollar#1\LWR at origdollar\LWR at origdollar%
+        \end{lateximage}%
 
-}
+}% not mathjax
 }%
 %    \end{macrocode}
 % \end{macro}
-
+%
+%
 % \begin{macro}{\LWR at singledollar}
+%
 % \changes{v0.19}{2016/05/25}{MathJax support.}
+%
 % Redefine the single dollar sign to place math inside a \env{lateximage}, or use MathJax:
+%
+% \changes{v0.42}{2017/10/26}{If \protect\texttt{FormatWP} print LaTeX expression.}
 %    \begin{macrocode}
 \gdef\LWR at subsingledollar#1{%
-\ifbool{mathjax}%
+\ifboolexpr{bool{mathjax} or ( bool{FormatWP} and bool{WPMarkMath} ) }%
 %    \end{macrocode}
 % For MathJax, print the math between |\(| and |\)|:
 %    \begin{macrocode}
-{\textbackslash(\LWR at HTMLsanitize{#1}\textbackslash)}
+{%
+        {\textbackslash(\LWR at HTMLsanitize{#1}\textbackslash)}%
+}% mathjax
 %    \end{macrocode}
-% For SVG, print the math inside a \env{lateximage}, with an ALT tag of the \LaTeX\ code:
+% For SVG, print the math inside a \env{lateximage}, with an \element{alt} tag of the \LaTeX\ code:
 %    \begin{macrocode}
 {% not mathjax
-    \begin{lateximage}%
-    [\textbackslash( \LWR at HTMLsanitize{#1} \textbackslash)]%
-    \LWR at origdollar#1\LWR at origdollar%
-    \end{lateximage}%
+        \begin{lateximage}%
+        [\textbackslash( \LWR at HTMLsanitize{#1} \textbackslash)]%
+        \LWR at origdollar#1\LWR at origdollar%
+        \end{lateximage}%
 }%
 }
 
@@ -18731,12 +19738,17 @@
 
 % \begin{macro}{\@ensuredmath} \marg{expression} Not yet adapted to \pkg{lwarp}.
 %
+% \changes{v0.42}{2017/10/16}{Improved \cs{ensuremath}.}
+%
 %    \begin{macrocode}
-\let\LWR at orig@ensuredmath\@ensuredmath
+\LetLtxMacro\LWR at origensuredmath\@ensuredmath
 
-\newcommand*{\LWR at ensuredmath}[1]{%
-\LWR at traceinfo{@ensuredmath: page \thepage: \detokenize{#1}}%
-\LWR at subsingledollar{#1}%
+\renewcommand{\@ensuredmath}[1]{%
+\ifmmode%
+    \LWR at origensuredmath{#1}%
+\else%
+    \LWR at subsingledollar{\relax#1}%
+\fi%
 }
 %    \end{macrocode}
 % \end{macro}
@@ -18823,105 +19835,6 @@
 % \end{macro}
 %
 %
-%
-%
-% \begin{macro}{\LWR at restoreorigformatting}
-% While producing \SVG\ math or a \env{lateximage},
-%	use regular \LaTeX\ formatting instead of \HTML\ tags.
-%
-% Various packages add to this macro using \cs{appto}.
-%
-% \label{sec:restoreorigformatting}
-%
-% \changes{v0.34}{2017/08/05}{Improved font control.}
-% \changes{v0.34}{2017/08/08}{\pkg{booktabs}: Works inside \env{lateximage}.}
-% \changes{v0.36}{2017/08/16}{\pkg{siunitx}: Improved super/subscripts in a \env{lateximage}.}
-% \changes{v0.39}{2017/09/01}{Appended with \cs{appto} instead of calling various macros.}
-% \changes{v0.40}{2017/09/09}{Improved symbols inside a \env{lateximage}.}
-% \changes{v0.40}{2017/09/09}{Improved \protect\LaTeX\ logos inside a \env{lateximage}.}
-% \changes{v0.40}{2017/09/09}{Nullified \cs{InlineClass}, etc. inside a \env{lateximage}.}
-%
-%    \begin{macrocode}
-\newcommand*{\LWR at restoreorigformatting}{%
-\LWR at traceinfo{LWR at restoreorigformatting}%
-\RenewDocumentCommand{\InlineClass}{o m +m}{##3}%
-\RenewDocumentEnvironment{BlockClass}{o m}{}{}%
-\renewcommand{\BlockClassSingle}[2]{##2}%
-\LetLtxMacro{\hspace}{\LWR at orighspace}%
-\LetLtxMacro\rule\LWR at origrule%
-\let\,\LWR at origcomma% disable HTML short unbreakable space
-\let\textellipsis\LWR at origtextellipsis%
-\let\textless\LWR at origtextless%
-\let\textgreater\LWR at origtextgreater%
-\LetLtxMacro{\textrm}{\LWR at origtextrm}%
-\LetLtxMacro{\textsf}{\LWR at origtextsf}%
-\LetLtxMacro{\texttt}{\LWR at origtexttt}%
-\LetLtxMacro{\textbf}{\LWR at origtextbf}%
-\LetLtxMacro{\textmd}{\LWR at origtextmd}%
-\LetLtxMacro{\textit}{\LWR at origtextit}%
-\LetLtxMacro{\textsl}{\LWR at origtextsl}%
-\LetLtxMacro{\textsc}{\LWR at origtextsc}%
-\LetLtxMacro{\textup}{\LWR at origtextup}%
-\LetLtxMacro{\textnormal}{\LWR at origtextnormal}%
-\LetLtxMacro{\emph}{\LWR at origemph}%
-\LetLtxMacro{\rmfamily}{\LWR at origrmfamily}%
-\LetLtxMacro{\sffamily}{\LWR at origsffamily}%
-\LetLtxMacro{\ttfamily}{\LWR at origttfamily}%
-\LetLtxMacro{\bfseries}{\LWR at origbfseries}%
-\LetLtxMacro{\mdseries}{\LWR at origmdseries}%
-\LetLtxMacro{\upshape}{\LWR at origupshape}%
-\LetLtxMacro{\slshape}{\LWR at origslshape}%
-\LetLtxMacro{\scshape}{\LWR at origscshape}%
-\LetLtxMacro{\itshape}{\LWR at origitshape}%
-\LetLtxMacro{\em}{\LWR at origem}%
-\LetLtxMacro{\normalfont}{\LWR at orignormalfont}%
-\let\sp\LWR at origsp%
-\let\sb\LWR at origsb%
-\let\textsuperscript\LWR at origtextsuperscript%
-\let\textsubscript\LWR at origtextsubscript%
-\LetLtxMacro\underline\LWR at origunderline%
-\let~\LWR at origtilde%
-\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\toprule\LWR at origtoprule%
-\LetLtxMacro\midrule\LWR at origmidrule%
-\LetLtxMacro\cmidrule\LWR at origcmidrule%
-\LetLtxMacro\bottomrule\LWR at origbottomrule%
-\LetLtxMacro\addlinespace\LWR at origaddlinespace%
-\LetLtxMacro\morecmidrules\LWR at origmorecmidrules%
-\LetLtxMacro\specialrule\LWR at origspecialrule%
-\let\newline\LWR at orignewline%
-\LetLtxMacro{\raisebox}{\LWR at origraisebox}%
-\LetLtxMacro\includegraphics\LWR at origincludegraphics%
-\LetLtxMacro{\scalebox}{\LWR at origscalebox}%
-\LetLtxMacro{\rotatebox}{\LWR at origrotatebox}%
-\let\reflectbox\LWR at origreflectbox%
-\LetLtxMacro\resizebox\LWR at origresizebox%
-\let\framebox\LWR at origframebox%
-\let\makebox\LWR at origmakebox%
-\let\fbox\LWRprint at fbox%
-\let\fboxBlock\LWRprint at fbox%
-\LetLtxMacro{\fminipage}{\LWRprint at fminipage}%
-\LetLtxMacro{\endfminipage}{\endLWRprint at fminipage}%
-\LetLtxMacro{\minipage}{\LWR at origminipage}%
-\let\endminipage\LWR at endminipage%
-\LetLtxMacro{\parbox}{\LWR at origparbox}%
-\let\TeX\LWR at origTeX%
-\let\LaTeX\LWR at origLaTeX%
-\let\LaTeXe\LWR at origLaTeXe%
-\renewcommand*{\Xe}{X\textsubscript{E}}%
-%
-\LWR at restoreorigaccents%
-%
-\LWR at FBcancel%
-}
-%    \end{macrocode}
-% \end{macro}
-
-
 % \begin{macro}{\LWR at hidelatexequation} \marg{environment} \marg{contents}
 %
 % Creates the \LaTeX{} version of the equation
@@ -19020,7 +19933,7 @@
 %
 % For \SVG\ math output, 
 % the contents are typeset using the original \env{equation}
-% inside a \env{lateximage}, along with an ALT tag
+% inside a \env{lateximage}, along with an \element{alt} tag
 % containing a detokenized copy of the \LaTeX\ source for
 % the math.
 %
@@ -19032,8 +19945,12 @@
 %    \begin{macrocode}
 \NewEnviron{equation}{%
 
-\ifbool{mathjax}
 %    \end{macrocode}
+% If |mathjax| or |FormatWP|, 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}
 % MathJax output:
 %    \begin{macrocode}
 {
@@ -19049,16 +19966,16 @@
 }
 %    \end{macrocode}
 % SVG output:
-% Create the |lateximage| along with an \HTML\ ALT tag
+% Create the |lateximage| along with an \HTML\ \element{alt} tag
 % having an equation number, the \LaTeX{} equation environment
 % commmands, and the contents of the environment's \cs{BODY}.
 %    \begin{macrocode}
 {% not mathjax
 %    \end{macrocode}
-% Begin the \env{lateximage} with an ALT tag containing the math source:
+% Begin the \env{lateximage} with an \element{alt} tag containing the math source:
 %    \begin{macrocode}
-    \begin{lateximage}[(\theequation) \textbackslash{begin\{equation\}}%
-    \LWR at HTMLsanitizeexpand{\detokenize\expandafter{\BODY}}%
+    \begin{lateximage}[(\LWR at equationtag) \textbackslash{begin\{equation\}} %
+    \LWR at HTMLsanitizeexpand{\detokenize\expandafter{\BODY}} %
     \textbackslash{end\{equation\}}]% alt tag
 %    \end{macrocode}
 % Create the actual \LaTeX-formatted equation inside
@@ -19068,13 +19985,19 @@
     \BODY% contents collected by NewEnviron
     \LWR at origendequation
     \end{lateximage}%
-}
+}% not mathjax
 
 %    \end{macrocode}
 % After the environment, if MathJax, print the math to the \HTML\ output
 % for MathJax processing:
 %    \begin{macrocode}
-}[\ifbool{mathjax}{\LWR at addmathjax{equation}{\BODY}}{}]
+}[%
+    \ifboolexpr{bool{mathjax} or ( bool{FormatWP} and bool{WPMarkMath} ) }%
+    {%
+        \LWR at addmathjax{equation}{\BODY}%
+    }{}%
+
+]
 %    \end{macrocode}
 % \end{environment}
 
@@ -19111,8 +20034,13 @@
 %    \begin{macrocode}
 \newcommand*{\LWR at htmlmathlabel}[1]{%
 \LWR at traceinfo{LWR at htmlmathlabel #1}%
-\ifbool{mathjax}{%
 %    \end{macrocode}
+% If |mathjax| or |FormatWP|, 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}
 % The combined \LaTeX\ \& \HTML\ label is printed in a \cs{text} field:
 %    \begin{macrocode}
     \text{
@@ -19182,8 +20110,10 @@
 % and thus requires special handling.
 %
 % For \SVG\ math: Each envrionment is encapsulated inside a \env{lateximage} environment,
-% along with a special |LWRAMSMATHBODY| argument
-% telling \env{lateximage} to use as the \HTML\ ALT tag the environment's contents which
+% along with a special optional argument of \cs{LWR at amsmathbody}
+% or \cs{LWR at amsmathbodynumbered}
+% telling \env{lateximage} to use as the \HTML\ \element{alt} tag
+% the environment's contents which
 % were automatically captured by the \AmS{} environment.
 %
 % For MathJax: Each environment is syched with \LaTeX's equation numbers,
@@ -19214,10 +20144,11 @@
 \newcommand{\LWR at eqnarrayfactor}{%
 %    \end{macrocode}
 %
-% Different behavior depending on MathJax vs \SVG\ math:
+% If |mathjax| or |FormatWP|, print the \LaTeX\ expression:
+% \changes{v0.42}{2017/10/26}{If \protect\texttt{FormatWP} print LaTeX expression.}
 %    \begin{macrocode}
-\ifbool{mathjax}
-{
+\ifboolexpr{bool{mathjax} or ( bool{FormatWP} and bool{WPMarkMath} ) }%
+{%
 %    \end{macrocode}
 %
 % If MathJax, the environment contents (the \cs{BODY}) are executed in a
@@ -19258,8 +20189,10 @@
 %
 % For numbered \SVG\ equations, first create a \env{lateximage} with
 %	an \attribute{alt} attribute containing sanitized copy of the source code:
+% \changes{v0.42}{2017/10/12}{Fix: Numbering and naming AMS math environments.}
 %    \begin{macrocode}
-        \begin{lateximage}[\LWR at addmathjax{eqnarray}{\BODY}]
+        \begin{lateximage}[(\LWR at startingequationtag--\LWR at equationtag)
+            \LWR at addmathjax{eqnarray}{\BODY}]
 %    \end{macrocode}
 % Then create the image contents using an actual \env{eqnarray}:
 %    \begin{macrocode}
@@ -19312,7 +20245,7 @@
 %    \begin{macrocode}
 \BeforeBeginEnvironment{multline}{
 
-\ifbool{mathjax}
+\ifboolexpr{bool{mathjax} or ( bool{FormatWP} and bool{WPMarkMath} ) }%
 {
     \LWR at syncmathjax
     \booltrue{LWR at amsmultline}
@@ -19319,13 +20252,13 @@
     \LWR at beginhideamsmath
 }
 {
-    \lateximage[LWRAMSMATHBODY]
+    \lateximage[\LWR at amsmathbodynumbered{multline}]
 }
 }
 
 \AfterEndEnvironment{multline}{
 
-\ifbool{mathjax}
+\ifboolexpr{bool{mathjax} or ( bool{FormatWP} and bool{WPMarkMath} ) }%
 {
     \LWR at endhideamsmath
     \boolfalse{LWR at amsmultline}
@@ -19342,7 +20275,7 @@
 %    \begin{macrocode}
 \BeforeBeginEnvironment{multline*}{
 
-\ifbool{mathjax}
+\ifboolexpr{bool{mathjax} or ( bool{FormatWP} and bool{WPMarkMath} ) }%
 {
     \LWR at syncmathjax
     \booltrue{LWR at amsmultline}
@@ -19349,13 +20282,13 @@
     \LWR at beginhideamsmath
 }
 {
-    \lateximage[LWRAMSMATHBODY]
+    \lateximage[\LWR at amsmathbody{multline*}]
 }
 }
 
 \AfterEndEnvironment{multline*}{
 
-\ifbool{mathjax}
+\ifboolexpr{bool{mathjax} or ( bool{FormatWP} and bool{WPMarkMath} ) }%
 {
     \LWR at endhideamsmath
     \boolfalse{LWR at amsmultline}
@@ -19373,7 +20306,7 @@
 %    \begin{macrocode}
 \BeforeBeginEnvironment{gather}{
 
-\ifbool{mathjax}
+\ifboolexpr{bool{mathjax} or ( bool{FormatWP} and bool{WPMarkMath} ) }%
 {
     \LWR at syncmathjax
     \boolfalse{LWR at amsmultline}
@@ -19380,13 +20313,13 @@
     \LWR at beginhideamsmath
 }
 {
-    \lateximage[LWRAMSMATHBODY]
+    \lateximage[\LWR at amsmathbodynumbered{gather}]
 }
 }
 
 \AfterEndEnvironment{gather}{
 
-\ifbool{mathjax}
+\ifboolexpr{bool{mathjax} or ( bool{FormatWP} and bool{WPMarkMath} ) }%
 {
     \LWR at endhideamsmath
     \LWR at addmathjax{gather}{\the\@envbody}
@@ -19401,7 +20334,7 @@
 %    \begin{macrocode}
 \BeforeBeginEnvironment{gather*}{
 
-\ifbool{mathjax}
+\ifboolexpr{bool{mathjax} or ( bool{FormatWP} and bool{WPMarkMath} ) }%
 {
     \LWR at syncmathjax
     \boolfalse{LWR at amsmultline}
@@ -19408,13 +20341,13 @@
     \LWR at beginhideamsmath
 }
 {
-    \lateximage[LWRAMSMATHBODY]
+    \lateximage[\LWR at amsmathbody{gather*}]
 }
 }
 
 \AfterEndEnvironment{gather*}{
 
-\ifbool{mathjax}
+\ifboolexpr{bool{mathjax} or ( bool{FormatWP} and bool{WPMarkMath} ) }%
 {
     \LWR at endhideamsmath
     \LWR at addmathjax{gather*}{\the\@envbody}
@@ -19430,7 +20363,7 @@
 %    \begin{macrocode}
 \BeforeBeginEnvironment{align}{
 
-\ifbool{mathjax}
+\ifboolexpr{bool{mathjax} or ( bool{FormatWP} and bool{WPMarkMath} ) }%
 {
     \LWR at syncmathjax
     \boolfalse{LWR at amsmultline}
@@ -19437,13 +20370,13 @@
     \LWR at beginhideamsmath
 }
 {
-    \lateximage[LWRAMSMATHBODY]
+    \lateximage[\LWR at amsmathbodynumbered{align}]
 }
 }
 
 \AfterEndEnvironment{align}{
 
-\ifbool{mathjax}
+\ifboolexpr{bool{mathjax} or ( bool{FormatWP} and bool{WPMarkMath} ) }%
 {
     \LWR at endhideamsmath
     \LWR at addmathjax{align}{\the\@envbody}
@@ -19459,7 +20392,7 @@
 %    \begin{macrocode}
 \BeforeBeginEnvironment{align*}{
 
-\ifbool{mathjax}
+\ifboolexpr{bool{mathjax} or ( bool{FormatWP} and bool{WPMarkMath} ) }%
 {
     \LWR at syncmathjax
     \boolfalse{LWR at amsmultline}
@@ -19466,13 +20399,13 @@
     \LWR at beginhideamsmath
 }
 {
-    \lateximage[LWRAMSMATHBODY]
+    \lateximage[\LWR at amsmathbody{align*}]
 }
 }
 
 \AfterEndEnvironment{align*}{
 
-\ifbool{mathjax}
+\ifboolexpr{bool{mathjax} or ( bool{FormatWP} and bool{WPMarkMath} ) }%
 {
     \LWR at endhideamsmath
     \LWR at addmathjax{align*}{\the\@envbody}
@@ -19488,7 +20421,7 @@
 %    \begin{macrocode}
 \BeforeBeginEnvironment{flalign}{
 
-\ifbool{mathjax}
+\ifboolexpr{bool{mathjax} or ( bool{FormatWP} and bool{WPMarkMath} ) }%
 {
     \LWR at syncmathjax
     \boolfalse{LWR at amsmultline}
@@ -19495,13 +20428,13 @@
     \LWR at beginhideamsmath
 }
 {
-    \lateximage[LWRAMSMATHBODY]
+    \lateximage[\LWR at amsmathbodynumbered{flalign}]
 }
 }
 
 \AfterEndEnvironment{flalign}{
 
-\ifbool{mathjax}
+\ifboolexpr{bool{mathjax} or ( bool{FormatWP} and bool{WPMarkMath} ) }%
 {
     \LWR at endhideamsmath
     \LWR at addmathjax{flalign}{\the\@envbody}
@@ -19517,7 +20450,7 @@
 %    \begin{macrocode}
 \BeforeBeginEnvironment{flalign*}{
 
-\ifbool{mathjax}
+\ifboolexpr{bool{mathjax} or ( bool{FormatWP} and bool{WPMarkMath} ) }%
 {
     \LWR at syncmathjax
     \boolfalse{LWR at amsmultline}
@@ -19524,13 +20457,13 @@
     \LWR at beginhideamsmath
 }
 {
-    \lateximage[LWRAMSMATHBODY]
+    \lateximage[\LWR at amsmathbody{flalign*}]
 }
 }
 
 \AfterEndEnvironment{flalign*}{
 
-\ifbool{mathjax}
+\ifboolexpr{bool{mathjax} or ( bool{FormatWP} and bool{WPMarkMath} ) }%
 {
     \LWR at endhideamsmath
     \LWR at addmathjax{flalign*}{\the\@envbody}
@@ -19550,14 +20483,27 @@
 
 
 % \section{Lateximages}
-
-% A |\lateximage| is typeset on its own \PDF\ page inside an \HTML\ comment
+%
+% \subsection{Description}
+%
+% \DescribeEnv{lateximage}
+% A \env{lateximage} is a piece of the document which is typeset in
+% \LaTeX\ then included in the \HTML\ output as an image.
+% This is used for math if \SVG\ math is chosen, and also
+% for the \env{picture}, \env{tikzpicture}, and other environments.
+%
+% Before typesetting the \env{lateximage} a large number of formatting,
+% graphics, and symbols-related macros are temporarily restored
+% to their print-mode meaning by \cs{LWR at restoreorigformatting}.
+% (See \cref{sec:restoreorigformatting}.)
+%
+% 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
 % 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\ span is created to hold both the \HTML\ comment,
+% An \HTML\ \element{span} is created to hold both the \HTML\ comment,
 % which will have the |pdftotext| conversion,
 % and also the link to the final |.svg| image.
 %
@@ -19569,6 +20515,7 @@
 % \limitslateximagefontsize
 %
 %
+% \subsection{Support counters and macros}
 %
 % \codehtml
 %    \begin{macrocode}
@@ -19608,6 +20555,7 @@
 %    \end{macrocode}
 
 
+% \subsection{Font size}
 
 % \codeall
 %    \begin{macrocode}
@@ -19620,6 +20568,8 @@
 % should blend well with the surrounding \HTML\ text size.
 %
 % \emph{Do not include the leading backslash in the name.}
+% \watchout[no backslash]
+%
 %    \begin{macrocode}
 \newcommand*{\LateximageFontSizeName}{large}
 %    \end{macrocode}
@@ -19630,6 +20580,7 @@
 %    \end{macrocode}
 
 
+% \subsection{Sanitizing math expressions for HTML}
 
 % \codehtml
 %    \begin{macrocode}
@@ -19640,7 +20591,7 @@
 %
 % Math expressions are converted to |lateximage|s, and some math environments may contain
 % ``\&'', ``\textless'', or ``\textgreater'', which should not be allowed
-% inside an \HTML\ ALT tag, so must convert them to \HTML\ entities.
+% inside an \HTML\ \element{alt} tag, so must convert them to \HTML\ entities.
 %
 % Two versions follow, depending on expansion needs.
 % There may be a better way\dots
@@ -19701,9 +20652,144 @@
 % \end{macro}
 
 
+% \subsection{Equation numbers}
 
-% \begin{environment}{lateximage} \oarg{alttag}
+% \DescribeCounter{LWR at startingequation}
+%   For use with |lateximage| and multi-line numbered equations.
+%   Remembers the next equation number so that it may be printed
+%   in the alt tag.
 %
+% \changes{v0.42}{2017/10/12}{Fix: Numbering and naming AMS math environments.}
+%
+%    \begin{macrocode}
+\newcounter{LWR at startingequation}
+
+\@ifundefined{chapter}
+{
+\renewcommand{\theLWR at startingequation}{%
+\arabic{LWR at startingequation}%
+}
+}
+{% chapter defined
+\renewcommand{\theLWR at startingequation}{%
+\ifnumcomp{\value{chapter}}{>}{0}{\arabic{chapter}.}{}%
+\arabic{LWR at startingequation}%
+}
+}
+%    \end{macrocode}
+
+% \DescribeBoolean{LWR at isstartingequation}
+% True for the first equation tag, false for later tags in the same environment.
+%    \begin{macrocode}
+\newbool{LWR at isstartingequation}
+%    \end{macrocode}
+
+
+% \begin{macro}{\LWR at startingequationtag} \quad
+%   Prints the starting equation number or tag.
+%    \begin{macrocode}
+\let\LWR at startingequationtag\theLWR at startingequation
+%    \end{macrocode}
+% \end{macro}
+
+% \begin{macro}{\LWR at equationtag} \quad
+%   Prints the ending equation number or tag.
+%    \begin{macrocode}
+\let\LWR at equationtag\theequation
+%    \end{macrocode}
+% \end{macro}
+
+
+% Only if \SVG\ math, patch \cs{tag} after packages have loaded,
+% in case someone else modified \cs{tag}.
+%    \begin{macrocode}
+\AtBeginDocument{
+
+\ifbool{mathjax}{}{% not mathjax
+%    \end{macrocode}
+
+% \begin{macro}{\LWR at remembertag} \marg{tag}
+%
+% For use inside the math environments while using \SVG\ math.
+% Sets \cs{theLWR at startingequation} and \cs{theequation}
+% to the given tag.
+%
+% \changes{v0.42}{2017/10/12}{Fix: Numbering and naming AMS math environments.}
+%
+%    \begin{macrocode}
+\NewDocumentCommand{\LWR at remembertag}{m}{%
+\ifbool{LWR at isstartingequation}%
+{%
+    \global\boolfalse{LWR at isstartingequation}%
+    \xdef\LWR at startingequationtag{#1}%
+}%
+{}%
+\xdef\LWR at equationtag{#1}%
+}%
+%    \end{macrocode}
+% \end{macro}
+
+% Patches for \AmS\ math \cs{tag} macro to remember the first tag:
+%    \begin{macrocode}
+\LetLtxMacro\LWR at origmake@df at tag@@\make at df@tag@@
+\LetLtxMacro\LWR at origmake@df at tag@@@\make at df@tag@@@
+
+\renewcommand*{\make at df@tag@@}[1]{%
+\LWR at remembertag{#1}%
+\LWR at origmake@df at tag@@{#1}%
+}
+
+\renewcommand*{\make at df@tag@@@}[1]{%
+\LWR at remembertag{#1}%
+\LWR at origmake@df at tag@@@{#1}%
+}
+
+}% not mathjax
+}% AtBeginDocument
+%    \end{macrocode}
+
+
+% \subsection{HTML \element{alt} tags}
+
+% \begin{macro}{\LWR at amsmathbody} \marg{envname}
+%   For use inside the optional argument to a \env{lateximage}
+%   to add the contents of a AMS math environment to the \element{alt} tag.
+%
+% \changes{v0.42}{2017/10/12}{Fix: Numbering and naming AMS math environments.}
+%
+%    \begin{macrocode}
+\newcommand*{\LWR at amsmathbody}[1]
+{%
+\textbackslash\{begin\}\{#1\} %
+\LWR at HTMLsanitizeexpand{\detokenize\expandafter{\the\@envbody}}%
+\textbackslash\{end\}\{#1\}%
+}
+%    \end{macrocode}
+% \end{macro}
+
+% \begin{macro}{\LWR at amsmathbodynumbered} \marg{envname}
+%   For use inside the optional argument to a \env{lateximage}
+%   to add the contents of a AMS math environment to the \element{alt} tag,
+%   prefixed by the equation numbers.
+%
+% \changes{v0.42}{2017/10/12}{Fix: Numbering and naming AMS math environments.}
+%
+%    \begin{macrocode}
+\newcommand*{\LWR at amsmathbodynumbered}[1]
+{%
+\ifnumcomp{\value{LWR at startingequation}}{=}{\value{equation}}%
+{(\LWR at equationtag)}%
+{(\LWR at startingequationtag--\LWR at equationtag)} %
+\LWR at amsmathbody{#1} %
+}
+%    \end{macrocode}
+% \end{macro}
+
+
+% \subsection{\env{lateximage}}
+
+% \begin{environment}{lateximage} \oarg{\element{alt} tag}
+%
 % \changes{v0.18}{2016/05/18}{Surpress extra space.}
 % \changes{v0.18}{2016/05/18}{pdfcrop: -{}-hires added.}
 % \changes{v0.18}{2016/05/19}{Reorganize \cs{HomeHTMLFilename} logic.}
@@ -19718,9 +20804,13 @@
 %    \begin{macrocode}
 \catcode`\$=\active%
 
+
 \NewDocumentEnvironment{lateximage}{O{image}}
 {%
 \LWR at traceinfo{lateximage: starting on page \arabic{page}}%
+%    \end{macrocode}
+% Nested |lateximage|s remain one large |lateximage|:
+%    \begin{macrocode}
 \ifthenelse{\cnttest{\value{LWR at lateximagedepth}}{>}{0}}%
 %    \end{macrocode}
 % If nesting inside an already-existing lateximage, simply record one more level:
@@ -19733,6 +20823,16 @@
 %    \begin{macrocode}
 {% start of outer-most lateximage
 %    \end{macrocode}
+% Remember the next equation number to be allocated, in case it must be
+% printed in a multi-equation environment:
+% \changes{v0.42}{2017/10/12}{Fix: Numbering and naming AMS math environments.}
+%    \begin{macrocode}
+    \setcounter{LWR at startingequation}{\value{equation}}%
+    \addtocounter{LWR at startingequation}{1}%
+    \booltrue{LWR at isstartingequation}%
+    \let\LWR at startingequationtag\theLWR at startingequation%
+    \let\LWR at equationtag\theequation%
+%    \end{macrocode}
 % Starting a new lateximage:
 %    \begin{macrocode}
     \addtocounter{LWR at lateximagenumber}{1}%
@@ -19780,7 +20880,7 @@
 %    \end{macrocode}
 % Start the new \PDF\ page:
 %    \begin{macrocode}
-    \LWR at traceinfo{lateximage: about to create new page}%
+    \LWR at traceinfo{lateximage: about to create a new page}%
     \LWR at orignewpage%
 %    \end{macrocode}
 % Typeset the image in a ``standard'' width page and font size:
@@ -19816,7 +20916,6 @@
     \LetLtxMacro\)\LWR at origcloseparen%
     \LetLtxMacro\[\LWR at origopenbracket%
     \LetLtxMacro\]\LWR at origclosebracket%
-    \let\@ensuredmath\LWR at orig@ensuredmath%
 }% end of outer-most lateximage
 \LWR at traceinfo{lateximage: finished start of environment}%
 }% end of \begin{lateximage}
@@ -19823,6 +20922,7 @@
 %    \end{macrocode}
 %
 % When the environment closes:
+% \margintag{\cs{endlateximage}}
 %
 %    \begin{macrocode}
 {% start of \end{lateximage}
@@ -19852,25 +20952,9 @@
     \LWR at traceinfo{lateximage: The page after the image is \arabic{page}}%
 %    \end{macrocode}
 % Create a link to the lateximage, allowing its natural height:
-%
-% If the alt tag is given as ``LWRAMSMATHBODY'', then use the text collected by the
-% amsmath multline, gather, or align environments.
 %    \begin{macrocode}
-    \ifthenelse{\equal{#1}{LWRAMSMATHBODY}}%
-    {%
-    \LWR at subinlineimage[%
-    \LWR at HTMLsanitizeexpand{\detokenize\expandafter{\the\@envbody}}%
-    ]%
-    {lateximage}%
-    {lateximages\OSPathSymbol{}lateximage-\theLWR at externalfilecnt}%
-    {svg}%
-    {}%
-    }%
-    {%
     \LWR at subinlineimage[#1]{lateximage}%
     {lateximages\OSPathSymbol{}lateximage-\theLWR at externalfilecnt}{svg}{}%
-    }%
-% \LWR at orignewline% Removed to prevent extra space.
 %    \end{macrocode}
 % Be sure that are doing a paragraph:
 %    \begin{macrocode}
@@ -19915,22 +20999,28 @@
 
 % \begin{environment}{center}
 % Replace \env{center} functionality with \CSS\ tags:
+% \changes{v0.42}{2017/10/26}{If \protect\texttt{FormatWP} use explicit \attribute{text-align}.}
 %    \begin{macrocode}
 \renewenvironment*{center}
 {
 \LWR at forcenewpage
-\BlockClass{center}
+\ifbool{FormatWP}
+{\BlockClass[text-align:center]{center}}
+{\BlockClass{center}}
 }
 {\endBlockClass}
 %    \end{macrocode}
 % \end{environment}
 
+
 % \begin{environment}{flushright}
 %    \begin{macrocode}
 \renewenvironment*{flushright}
 {
 \LWR at forcenewpage
-\BlockClass{flushright}
+\ifbool{FormatWP}
+{\BlockClass[text-align:right]{flushright}}
+{\BlockClass{flushright}}
 }
 {\endBlockClass}
 %    \end{macrocode}
@@ -19941,7 +21031,9 @@
 \renewenvironment*{flushleft}
 {
 \LWR at forcenewpage
-\BlockClass{flushleft}
+\ifbool{FormatWP}
+{\BlockClass[text-align:left]{flushleft}}
+{\BlockClass{flushleft}}
 }
 {\endBlockClass}
 %    \end{macrocode}
@@ -20000,7 +21092,8 @@
 % \label{sec:siunitx}
 
 % \DescribePackage{siunitx}
-%
+% The \pkg{lwarp} core passes a few options to \pkg{siunitx}.
+
 % \limitssiunitx
 %
 % \changes{v0.36}{2017/08/16}{\pkg{siunitx}: Fix for \pkg{babel-french}.}
@@ -20030,18 +21123,16 @@
 
 
 
-
-% \section{Graphics}
-
-% \DescribePackage{graphics}
+% \section{Graphics print-mode modifications}
 %
-% \DescribePackage{graphicx}
-%
 % \index{images>graphicx package}
 %
+% \subsection{General limitations}
 % \limitsgraphics
 %
-
+% \subsection{Print-mode modifications}
+% \label{sec:graphicsprint}
+%
 % \codeprint
 %
 % For print output, accept and then discard the new |class| key:
@@ -20048,6 +21139,17 @@
 %    \begin{macrocode}
 \begin{warpprint}
 \define at key{Gin}{class}{}
+%    \end{macrocode}
+%
+% Print-mode additions for the \pkg{overpic} package.
+% See \cref{sec:overpic} for the \HTML\ version.
+%    \begin{macrocode}
+\AtBeginDocument{
+\@ifpackageloaded{overpic}{
+\newcommand*{\overpicfontsize}{12}
+\newcommand*{\overpicfontskip}{14}
+}{}
+}
 \end{warpprint}
 %    \end{macrocode}
 
@@ -20057,9 +21159,16 @@
 
 
 
-% \subsection{\protect\pkg{xcolor} print-mode additions}
+% \section{Xcolor boxes}
+%
 % \label{sec:xcolorpatches}
 %
+% \DescribePackage{xcolor}
+% A few new definitions are provided for enhanced \HTML\ colored boxes,
+% and \cs{fcolorbox} is slightly modified.
+% Print-mode version are also provided.
+%
+%
 % Print-mode versions of new \pkg{xcolor} defintions.
 % These are defined inside \env{warpall} because they are also used
 % for \HTML\ while inside a \env{lateximage}.
@@ -20591,7 +21700,13 @@
 %    \begin{macrocode}
 \RenewDocumentEnvironment{minipage}{O{t} o O{t} m}
 {%
-\uselengthunit{in}%
+%    \end{macrocode}
+% Units for printing dimensions to \HTML:
+%    \begin{macrocode}
+\uselengthunit{PT}%
+%    \end{macrocode}
+% Compute width, adjusted for frames:
+%    \begin{macrocode}
 \setlength{\LWR at minipagewidth}{#4}%
 \ifthenelse{\cnttest{\value{LWR at minipagedepth}}{=}{0}}{%
     \addtolength{\LWR at minipagewidth}{3em}% room for frames
@@ -20600,16 +21715,34 @@
     \setlength{\textheight}{9in}%
 }{}%
 \LWR at traceinfo{computed width is \rndprintlength{\LWR at minipagewidth}}
-\addtocounter{LWR at minipagedepth}{1}%
+%    \end{macrocode}
+% Compute height:
+%    \begin{macrocode}
 \setlength{\LWR at minipageheight}{\textheight}% default unless specified
 \IfValueT{#2}{\setlength{\LWR at minipageheight}{#2}}%
 %    \end{macrocode}
+% Track nesting depth:
+%    \begin{macrocode}
+\addtocounter{LWR at minipagedepth}{1}%
+%    \end{macrocode}
 % \LaTeX{} wants to start a paragraph for the new minipage, then start a paragraph again
 % for the contents of the minipage, so cancel the  paragraph tag handling
 % until the minipage has begun.
 %    \begin{macrocode}
+\ifbool{FormatWP}{\newline}{}%
 \LWR at stoppars%
 %    \end{macrocode}
+% If |FormatWP|, add a text frame:
+% \changes{v0.42}{2017/10/26}{If \protect\texttt{FormatWP} add a text frame.}
+%    \begin{macrocode}
+\ifbool{FormatWP}{%
+
+\addtocounter{LWR at thisfloat}{1}%
+\booltrue{LWR at freezethisfloat}%
+\LWR at htmltag{div id="autofloat-\arabic{LWR at thisfloat}" class="wpminipage"}%
+
+}{}%
+%    \end{macrocode}
 % Create the \element{div} tag with optional alignment style:
 %    \begin{macrocode}
 \LWR at traceinfo{minipage: creating div class}%
@@ -20658,21 +21791,41 @@
 \LWR at origraggedright%
 %    \end{macrocode}
 % Resume paragraph tag handling for the contents of the minipage:
+% \changes{v0.42}{2017/10/18}{Added boolean \protect\texttt{WPMarkMinipages}.}
 %    \begin{macrocode}
 \LWR at startpars%
+\ifboolexpr{bool{FormatWP} and bool{WPMarkMinipages}}{%
+
+=== begin minipage ===
+
+}{}%
 \LWR at traceinfo{minipage: finished starting the minipage}%
 }
 %    \end{macrocode}
 % End the environment with \LaTeX{} processing and closing tag:
+% \changes{v0.42}{2017/10/18}{Added boolean \protect\texttt{WPMarkMinipages}.}
 %    \begin{macrocode}
 {%
+\ifboolexpr{bool{FormatWP} and bool{WPMarkMinipages}}{%
+
+=== end minipage ===
+
+}{}%
 \LWR at stoppars%
 \LWR at endminipage% The following empty line is required:
 
+\ifbool{FormatWP}{%
+
+\LWR at htmlelementend{div}%
+\boolfalse{LWR at freezethisfloat}%
+
+}{}%
 \LWR at htmldivclassend{minipage}%
+
 \LWR at origvspace{1\baselineskip}% required for subcaption
 \addtocounter{LWR at minipagedepth}{-1}%
 \LWR at startpars%
+\ifbool{FormatWP}{\newline}{}%
 %    \end{macrocode}
 % Prevent paragraph tags around horizontal white space
 % until the start of the next paragraph:
@@ -20787,7 +21940,7 @@
 %
 
 % \begin{macro}{\LWR at blackborderpadding}
-% Prints the \HTML attributes for a black border and padding.
+% Prints the \HTML\ attributes for a black border and padding.
 %
 % \cs{LWR at forceminwidth} must be used first in order to set the border width.
 %
@@ -21025,7 +22178,26 @@
 
 % \changes{v0.34}{2017/08/05}{Improved font control.}
 % \changes{v0.35}{2017/08/08}{Fix: \cs{textbf} and related.}
+% \changes{v0.42}{2017/10/20}{\cs{textbf} and related: If \protect\texttt{FormatWP}, use explicit styles for
+%   \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.
+% This is used by LibreOffice to mark its imported text using the given style.
+% \changes{v0.42}{2017/10/20}{Added.}
+%    \begin{macrocode}
+\DeclareRobustCommand{\LWR at HTMLtextstyle}[3]{%
+\ifbool{FormatWP}%
+{\LWR at htmlspanclass[#1]{#2}{#3}}%
+{\LWR at htmlspanclass{#2}{#3}}%
+}
+%    \end{macrocode}
+% \end{macro}
+
+
+
 % \begin{macro}{\emph} \marg{text}
 %    \begin{macrocode}
 \DeclareRobustCommand{\LWR at HTMLemph}[1]{\LWR at htmlspan{em}{#1}}
@@ -21034,14 +22206,19 @@
 %    \end{macrocode}
 % \end{macro}
 
+
 % \begin{macro}{\textmd} \marg{text}
 %    \begin{macrocode}
-\DeclareRobustCommand{\LWR at HTMLtextmd}[1]{\LWR at htmlspanclass{textmd}{#1}}
+\DeclareRobustCommand{\LWR at HTMLtextmd}[1]{%
+\LWR at HTMLtextstyle{font-weight:normal}{textmd}{#1}%
+}
 \DeclareRobustCommand{\LWR at nulltextmd}[1]{#1}
+
 \LetLtxMacro{\textmd}{\LWR at HTMLtextmd}
 %    \end{macrocode}
 % \end{macro}
 
+
 % \begin{macro}{\textbf} \marg{text}
 %    \begin{macrocode}
 \DeclareRobustCommand{\LWR at HTMLtextbf}[1]{\LWR at htmlspan{b}{#1}}
@@ -21050,17 +22227,25 @@
 %    \end{macrocode}
 % \end{macro}
 
+
 % \begin{macro}{\textrm} \marg{text}
 %    \begin{macrocode}
-\DeclareRobustCommand{\LWR at HTMLtextrm}[1]{\LWR at htmlspanclass{textrm}{#1}}
+\DeclareRobustCommand{\LWR at HTMLtextrm}[1]{%
+\LWR at HTMLtextstyle{font-family:serif}{textrm}{#1}%
+}
+
 \DeclareRobustCommand{\LWR at nulltextrm}[1]{#1}
+
 \LetLtxMacro{\textrm}{\LWR at HTMLtextrm}
 %    \end{macrocode}
 % \end{macro}
 
+
 % \begin{macro}{\textsf} \marg{text}
 %    \begin{macrocode}
-\DeclareRobustCommand{\LWR at HTMLtextsf}[1]{\LWR at htmlspanclass{textsf}{#1}}
+\DeclareRobustCommand{\LWR at HTMLtextsf}[1]{%
+\LWR at HTMLtextstyle{font-family:sans}{textsf}{#1}%
+}
 \DeclareRobustCommand{\LWR at nulltextsf}[1]{#1}
 \LetLtxMacro{\textsf}{\LWR at HTMLtextsf}
 %    \end{macrocode}
@@ -21077,8 +22262,12 @@
 % \begin{macro}{\textup} \marg{text}
 % \changes{v0.28}{2017/04/13}{Fixed span class.}
 %    \begin{macrocode}
-\DeclareRobustCommand{\LWR at HTMLtextup}[1]{\LWR at htmlspanclass{textup}{#1}}
+\DeclareRobustCommand{\LWR at HTMLtextup}[1]{%
+\LWR at HTMLtextstyle{font-variant:normal}{textup}{#1}%
+}
+
 \DeclareRobustCommand{\LWR at nulltextup}[1]{#1}
+
 \LetLtxMacro{\textup}{\LWR at HTMLtextup}
 %    \end{macrocode}
 % \end{macro}
@@ -21093,8 +22282,12 @@
 
 % \begin{macro}{\textsc} \marg{text}
 %    \begin{macrocode}
-\DeclareRobustCommand{\LWR at HTMLtextsc}[1]{\LWR at htmlspanclass{textsc}{#1}}
+\DeclareRobustCommand{\LWR at HTMLtextsc}[1]{%
+\LWR at HTMLtextstyle{font-variant:small-caps}{textsc}{#1}%
+}
+
 \DeclareRobustCommand{\LWR at nulltextsc}[1]{#1}
+
 \LetLtxMacro{\textsc}{\LWR at HTMLtextsc}
 %    \end{macrocode}
 % \end{macro}
@@ -21101,12 +22294,18 @@
 
 % \begin{macro}{\textsl} \marg{text}
 %    \begin{macrocode}
-\DeclareRobustCommand{\LWR at HTMLtextsl}[1]{\LWR at htmlspanclass{testsl}{#1}}
+\DeclareRobustCommand{\LWR at HTMLtextsl}[1]{%
+\LWR at HTMLtextstyle{font-style:oblique}{textsl}{#1}%
+}
+
 \DeclareRobustCommand{\LWR at nulltextsl}[1]{#1}
+
 \LetLtxMacro{\textsl}{\LWR at HTMLtextsl}
 %    \end{macrocode}
 % \end{macro}
 
+
+
 % \begin{macro}{\textnormal} \marg{text}
 %    \begin{macrocode}
 \DeclareRobustCommand{\LWR at HTMLtextnormal}[1]{\textmd{\textrm{\textup{#1}}}}
@@ -21171,6 +22370,7 @@
 \LetLtxMacro\underline\LWR at origunderline%
 \RenewDocumentCommand{\LWR at htmlspanclass}{o m +m}{##3}%
 \DeclareExpandableDocumentCommand{\InlineClass}{+o +m +m}{##3}%
+\DeclareRobustCommand{\LWR at HTMLtextstyle}[3]{##3}%
 }
 %    \end{macrocode}
 % \end{macro}
@@ -21255,13 +22455,32 @@
 %    \end{macrocode}
 % \end{macro}
 
+% \begin{macro}{\@textsuperscript} \marg{text}
+% \changes{v0.42}{2017/10/16}{Added.}
+%    \begin{macrocode}
+\renewcommand{\@textsuperscript}[1]{\LWR at htmlspan{sup}{#1}}
+%    \end{macrocode}
+% \end{macro}
+
 % \begin{macro}{\textsubscript} \marg{text}
 %    \begin{macrocode}
+\AtBeginDocument{
 \renewcommand{\textsubscript}[1]{\LWR at htmlspan{sub}{#1}}
+}
 %    \end{macrocode}
 % \end{macro}
 
+% \begin{macro}{\@textsubscript} \marg{text}
+% \changes{v0.42}{2017/10/16}{Added.}
+%    \begin{macrocode}
+\AtBeginDocument{
+\renewcommand{\@textsubscript}[1]{\LWR at htmlspan{sub}{#1}}
+}
+%    \end{macrocode}
+% \end{macro}
 
+
+
 % \begin{macro}{\up} \marg{text} Prints superscript.
 %
 % This is \cs{let} at the beginning of the document in case some other package
@@ -21285,8 +22504,14 @@
 
 % \begin{macro}{\underline} \marg{text}
 % \changes{v0.40}{2017/09/12}{Added.}
+% \changes{v0.42}{2017/10/20}{If \protect\texttt{FormatWP}, use explicit styles for
+%   \cs{underline}, etc.}
 %    \begin{macrocode}
-\renewcommand{\underline}[1]{\InlineClass{underline}{#1}}
+\renewcommand{\underline}[1]{%
+\LWR at HTMLtextstyle%
+    {text-decoration:underline;text-decoration-skip}%
+    {underline}{#1}%
+}
 %    \end{macrocode}
 % \end{macro}
 
@@ -21542,18 +22767,34 @@
 %    \begin{macrocode}
     \ifthenelse{\dimtest{\LWR at tempwidth}{=}{.16667em}}
     {%
-    \HTMLunicode{2009}% thin breakable space
+        \HTMLunicode{2009}% thin breakable space
     }%
 %    \end{macrocode}
 % Print the span with the converted width.  Not rounded.
 %    \begin{macrocode}
     {%
-    \uselengthunit{PT}%
-    \LWR at htmltagc{%
-    span style="width:\printlength{\LWR at tempwidth}; display:inline-block;"%
+        \uselengthunit{PT}%
+        \LWR at htmltagc{%
+            span style="width:\printlength{\LWR at tempwidth}; %
+                display:inline-block"%
+        }%
+%    \end{macrocode}
+% If formatting for a word processor, approximate with a number of \cs{quad}s,
+% in case a span of a given width is not supported:
+% \changes{v0.42}{2017/10/27}{If \protect\texttt{FormatWP} add \cs{quad}s.}
+%    \begin{macrocode}
+        \ifbool{FormatWP}{%
+            \setlength{\LWR at templengthone}{\LWR at tempwidth}%
+            \whiledo{\lengthtest{\LWR at templengthone>1em}}{%
+                \quad%
+                \addtolength{\LWR at templengthone}{-1em}%
+            }%
+        }{}%
+%    \end{macrocode}
+% Close the span:
+%    \begin{macrocode}
+        \LWR at htmltagc{/span}%
     }%
-    \LWR at htmltagc{/span}%
-    }%
 %    \end{macrocode}
 % If had a minipage this paragraph, try to inline the
 % white space without generating paragraph tags:
@@ -21705,7 +22946,7 @@
 % The background color is used to draw the filled rule.
 % The color may be changed by \cs{textcolor}.
 %    \begin{macrocode}
-    background:\LWR at currenttextcolor; %
+    \ifbool{FormatWP}{}{background:\LWR at currenttextcolor; }%
 %    \end{macrocode}
 % The width and height are printed, converted to PT:
 %    \begin{macrocode}
@@ -21737,6 +22978,21 @@
 %    \begin{macrocode}
     display:inline-block;"%
     }%
+%    \end{macrocode}
+% If formatting for a word processor, approximate with a number of underscores,
+% in case a span of a given width is not supported:
+% \changes{v0.42}{2017/10/27}{If \protect\texttt{FormatWP} add \cs{quad}s.}
+%    \begin{macrocode}
+        \ifbool{FormatWP}{%
+            \setlength{\LWR at templengthone}{\LWR at tempwidth}%
+            \whiledo{\lengthtest{\LWR at templengthone>1em}}{%
+                \_{}%
+                \addtolength{\LWR at templengthone}{-1em}%
+            }%
+        }{}%
+%    \end{macrocode}
+% Close the span:
+%    \begin{macrocode}
     \LWR at htmltagc{/span}%
 %    \end{macrocode}
 % If had a minipage this paragraph, try to inline the
@@ -21820,24 +23076,39 @@
 %
 % |latexlogofont| is a \CSS\ class used to select the font for the rest of the logo in
 % \LaTeX, \LuaTeX, \ConTeXt, etc.
+% \changes{v0.42}{2017/10/20}{If \protect\texttt{FormatWP} use explicit style.}
 %    \begin{macrocode}
 \let\LWR at origTeX\TeX
 
 \newcommand*{\LWR at TeX}
-{\InlineClass{latexlogofont}%
-{\InlineClass{latexlogo}{T\textsubscript{e}X}}}
+{%
+    \InlineClass{latexlogofont}%
+    {%
+        \LWR at HTMLtextstyle%
+            {text-transform:uppercase}%
+            {latexlogo}%
+        {T\textsubscript{e}X}%
+    }%
+}
 %    \end{macrocode}
 % \end{macro}
 %
 % \begin{macro}{\LaTeX}
+% \changes{v0.42}{2017/10/20}{If \protect\texttt{FormatWP} use explicit style.}
 % \begin{macro}{\LaTeXe} \LaTeX, \LaTeXe
 %    \begin{macrocode}
 \let\LWR at origLaTeX\LaTeX
 
 \newcommand*{\LWR at LaTeX}
-{\InlineClass{latexlogofont}%
-{\InlineClass{latexlogo}%
-{L\textsuperscript{a}T\textsubscript{e}X}}}
+{%
+    \InlineClass{latexlogofont}%
+    {%
+        \LWR at HTMLtextstyle%
+            {text-transform:uppercase}%
+            {latexlogo}%
+        {L\textsuperscript{a}T\textsubscript{e}X}%
+    }%
+}
 
 \let\LWR at origLaTeXe\LaTeXe
 
@@ -22002,9 +23273,10 @@
 %
 %
 %
-%
 % \changes{v0.20}{2016/12/12}{Code factored into independent \texttt{lwarp\_html} files.}
 %
+% The following adjustments apply to the lwarp-* package listings:
+%
 % \titleformat{\part}[hang]
 %     {\hrule\nopagebreak[4]\large\ttfamily\bfseries}{}{0pt}{}[\marginpar{\hfill{}File\,\thepart}]
 % \titlespacing*{\part}{0pt}{*4}{0ex}
@@ -22017,9 +23289,13 @@
 %     {\large\rmfamily\bfseries}{}{0pt}{}[\marginpar{\hfill\textsection\,\thesubsection}]
 % \titlespacing*{\subsection}{0pt}{0ex}{0ex}
 %
-% \renewcommand{\bottomtitlespace}{.5\textheight}
+% \titleformat{\subsubsection}[hang]
+%     {\normalsize\rmfamily\bfseries}{}{0pt}{}[\marginpar{\hfill\textsection\,\thesubsubsection}]
+% \titlespacing*{\subsection}{0pt}{0ex}{0ex}
 %
+% \renewcommand{\bottomtitlespace}{.2\textheight}
 %
+%
 % \clearpage
 %
 %
@@ -22200,7 +23476,6 @@
 
 %    \end{macrocode}
 
-
 % \iffalse
 %</abstract>
 % \fi
@@ -22368,6 +23643,8 @@
 %
 % \limitscombiningfloats
 %
+% \changes{v0.42}{2017/10/27}{\pkg{algorithmic}: If \protect\texttt{FormatWP} add \cs{quad}s.}
+%
 % \codehtml
 %    \begin{macrocode}
 \begin{warpHTML}
@@ -22384,6 +23661,13 @@
 \LWR at htmltagc{%
 span style="width:\rndprintlength{\ALG at thistlm}; display:inline-block;"%
 }%
+\ifbool{FormatWP}{%
+\setlength{\LWR at templengthone}{\the\ALG at thistlm}%
+\whiledo{\lengthtest{\LWR at templengthone>1em}}{%
+\quad%
+\addtolength{\LWR at templengthone}{-1em}%
+}%
+}{}%
 \LWR at htmltagc{/span}%
 }%
 %
@@ -22456,9 +23740,10 @@
 %
 % \changes{v0.25}{2017/03/15}{\pkg{amsthm}: Added.}
 %
+% \begin{table}[ht]
+% \hrule\smallskip
+% \caption{AMSthm package --- CSS styling of theorems and proofs}
 % \begin{description}
-% \item[CSS styling of theorems and proofs:] \
-% \begin{description}
 % \item [Theorem:] \element{div} of class |amsthmbody<theoremstyle>|
 % \item [Theorem Name:] \element{span} of class |amsthmname<theoremtyle>|
 % \item [Theorem Number:] \element{span} of class |amsthmnumber<theoremstyle>|
@@ -22467,7 +23752,9 @@
 % \item [Proof Name:] \element{span} of class |amsthmproofname|
 % \end{description}
 % where |<theoremstyle>| is |plain|, |definition|, etc.
-% \end{description}
+% \smallskip
+% \hrule
+% \end{table}
 % 
 %
 % \codehtml
@@ -22848,7 +24135,7 @@
 % The delimiter character is given a \element{span} class of \attribute{ldelim} or
 % \attribute{rdelim}, and the default \CSS\ sets this to \attribute{font-size:200\%}
 %
-% \limitsbigdelim
+% \limitsbigdelim\bigskip
 %
 % \changes{v0.39}{2017/08/31}{\pkg{bigdelim}: Added.}
 % \changes{v0.40}{2017/09/09}{\pkg{bigdelim}: Improved documentation.}
@@ -23753,7 +25040,9 @@
 % \DescribePackage{epigraph}
 % \pkg{epigraph} is emulated during \HTML\ output, and
 % the \pkg{epigraph} package is ignored.
-
+%
+% \changes{v0.42}{2017/10/27}{\pkg{epigraph}: If \protect\texttt{FormatWP} add HTML styles.}
+%
 % \codehtml
 
 %    \begin{macrocode}
@@ -23765,7 +25054,9 @@
 {
 \begin{BlockClass}{qitem}
 #1
-\begin{BlockClass}{epigraphsource}
+\ifbool{FormatWP}
+{\begin{BlockClass}[border-top:1px solid gray]{epigraphsource}}
+{\begin{BlockClass}{epigraphsource}}
 #2
 \end{BlockClass}
 \end{BlockClass}
@@ -23775,14 +25066,14 @@
 %    \begin{macrocode}
 \newcommand{\epigraph}[2]
 {
-\begin{BlockClass}{epigraph}
+\begin{LWR at BlockClassWP}{text-align:right}{}{epigraph}
 \qitem{#1}{#2}
-\end{BlockClass}
+\end{LWR at BlockClassWP}
 }
 
 \newenvironment*{epigraphs}
-{\BlockClass{epigraph}}
-{\endBlockClass}
+{\LWR at BlockClassWP{text-align:right}{}{epigraph}}
+{\endLWR at BlockClassWP}
 %    \end{macrocode}
 %
 % Use \CSS\ to format epigraphs.
@@ -23990,6 +25281,7 @@
 %
 %
 % \changes{v0.34}{2017/07/27}{\pkg{fancybox}: Added.}
+% \changes{v0.42}{2017/10/27}{\pkg{fancybox}: If \protect\texttt{FormatWP} add HTML styles.}
 %
 % \codehtml
 %    \begin{macrocode}
@@ -24003,14 +25295,26 @@
 %
 %
 %    \begin{macrocode}
-\renewcommand*{\@shadowbox}[1]{\InlineClass{shadowbox}{#1}}
+\renewcommand*{\@shadowbox}[1]{%
+\ifbool{FormatWP}%
+{\InlineClass[border:1px solid black]{shadowbox}{#1}}%
+{\InlineClass{shadowbox}{#1}}%
+}
 
-\renewcommand*{\@doublebox}[1]{\InlineClass{doublebox}{#1}}
+\renewcommand*{\@doublebox}[1]{%
+\ifbool{FormatWP}%
+{\InlineClass[border:1px double black]{doublebox}{#1}}%
+{\InlineClass{doublebox}{#1}}%
+}
 
 \renewcommand*{\@ovalbox}[2]{%
-\ifthenelse{\isequivalentto{#1}{\thinlines}}
-{\InlineClass{ovalbox}{#2}}
-{\InlineClass{Ovalbox}{#2}}
+\ifbool{FormatWP}%
+{\InlineClass[border:1px solid black; border-radius:1ex]{ovalbox}{#2}}%
+{%
+    \ifthenelse{\isequivalentto{#1}{\thinlines}}%
+    {\InlineClass{ovalbox}{#2}}%
+    {\InlineClass{Ovalbox}{#2}}%
+}%
 }
 %    \end{macrocode}
 %
@@ -24041,9 +25345,9 @@
 %
 %    \begin{macrocode}
 \renewcommand{\GenericCaption}[1]{%
-\LWR at htmlblocktag{figcaption}%
+\LWR at figcaption%
 #1%
-\LWR at htmlblocktag{/figcaption}%
+\endLWR at figcaption%
 }
 %    \end{macrocode}
 %
@@ -24688,29 +25992,45 @@
 %
 %
 %
+% \begin{noindenvironment} \oarg{offset} \marg{type} \marg{width}
 % Borrowed from the \pkg{lwarp} version of \pkg{keyfloat}:
+% \changes{v0.42}{2017/10/26}{\pkg{floatflt}: Added width.}
 %    \begin{macrocode}
-\NewDocumentEnvironment{KFLTfloatflt at marginfloat}{O{-1.2ex} m}
-{% start
-\LWR at maybeincthisfloat%
-\LWR at forcenewpage
-\LWR at stoppars%
-\LWR at htmltag{div class="marginblock" id="autofloat-\arabic{LWR at thisfloat}"}
-\LWR at startpars%
+\NewDocumentEnvironment{KFLTfloatflt at marginfloat}{O{-1.2ex} m m}
+{%
+\setlength{\LWR at templengthone}{#3}%
+\uselengthunit{PT}%
+\LWR at BlockClassWP{%
+    float:right; %
+    width:\rndprintlength{\LWR at templengthone}; %
+    margin:10pt%
+}{%
+    width:\rndprintlength{\LWR at templengthone}%
+}%
+{marginblock}%
 \captionsetup{type=#2}%
 }
-{
-\LWR at htmldivclassend{div}
+{%
+\endLWR at BlockClassWP%
 }
-
+%    \end{macrocode}
+% \end{noindenvironment}
+%
+% \begin{noindenvironment}{floatingfigure} \oarg{placement} \marg{width}
+%    \begin{macrocode}
 \DeclareDocumentEnvironment{floatingfigure}{o m}
-  {\begin{KFLTfloatflt at marginfloat}{figure}}
+  {\begin{KFLTfloatflt at marginfloat}{figure}{#2}}
   {\end{KFLTfloatflt at marginfloat}}
-
-\DeclareDocumentEnvironment{floatingtable}{o +m}
-  {\begin{KFLTfloatflt at marginfloat}{table}#2}
+%    \end{macrocode}
+% \end{noindenvironment}
+%
+% \begin{noindenvironment}{floatingtable} \oarg{placement}
+%    \begin{macrocode}
+\DeclareDocumentEnvironment{floatingtable}{o}
+  {\begin{KFLTfloatflt at marginfloat}{table}{1.5in}}
   {\end{KFLTfloatflt at marginfloat}}
 %    \end{macrocode}
+% \end{noindenvironment}
 %
 % \iffalse
 %</floatflt>
@@ -26005,6 +27325,8 @@
 %    \end{macrocode}
 
 
+% \subsection{Printing HTML styles}
+
 % \begin{macro}{\LWR at rotstyle} \marg{prefix} \marg{degrees}
 %
 % Prints the rotate style with the given prefix.
@@ -26051,6 +27373,27 @@
 %    \end{macrocode}
 
 
+% Used to determine the actual image size if needed:
+%    \begin{macrocode}
+\newsavebox{\LWR at imagesizebox}
+%    \end{macrocode}
+
+
+%    \begin{macrocode}
+\let\LWR at origGin@setfile\Gin at setfile
+%    \end{macrocode}
+
+
+% Define the new class key for the print-mode version of \cs{includegraphics},
+% which is enabled inside a \env{lateximage}.
+% \changes{v0.42}{2017/10/24}{\pkg{includegraphics}: Fix: Class key.}
+%    \begin{macrocode}
+\AtBeginDocument{
+\define at key{Gin}{class}{}
+}
+%    \end{macrocode}
+
+
 % \begin{macro}{\LWR at includegraphicsb} * \oarg{2: options} \oarg{3: options} \marg{4: filename}
 %
 % \pkg{graphics} syntax is \cs{includegraphics} * \oarg{llx,lly} \oarg{urx,ury} \marg{file}
@@ -26069,6 +27412,7 @@
 % \changes{v0.28}{2017/04/12}{Adapts to \pkg{graphics} syntax.}
 % \changes{v0.29}{2017/04/15}{Fix: Error when no optional arguments.}
 % \changes{v0.40}{2017/09/08}{Add: Full \cs{graphicspath} support.}
+% \changes{v0.42}{2017/10/26}{Fix: Filename expansion.}
 %    \begin{macrocode}
 \NewDocumentCommand{\LWR at includegraphicsb}{s o o m}
 {%
@@ -26093,11 +27437,13 @@
 }{}%
 %    \end{macrocode}
 %    \begin{macrocode}
+\begingroup%
 \renewcommand*{\Gin at setfile}[3]{%
 \LWR at traceinfo{Gin at setfile ##3}%
 \xdef\LWR at parsedfilename{##3}%
 }%
-\Ginclude at graphics{\detokenize{#4}}%
+\Ginclude at graphics{\detokenize\expandafter{#4}}%
+\endgroup%
 \filename at parse{\LWR at parsedfilename}%
 %    \end{macrocode}
 %
@@ -26126,6 +27472,53 @@
 {\setkeys{igraph}{}}%
 }%
 %    \end{macrocode}
+%
+% If formatting for a word processor, find and set the actual image size,
+% without rotation, using \PDF\ instead of \SVG\ to find the original bounding box:
+% \changes{v0.42}{2017/10/24}{If \protect\texttt{FormatWP}, use explicit size.}
+%    \begin{macrocode}
+\ifbool{FormatWP}{%
+    \begingroup%
+    \DeclareGraphicsExtensions{.pdf,.PDF,.gif,.GIF,.png,.PNG,.jpg,.JPG,.jpeg,.JPEG}%
+    \define at key{Gin}{angle}{}%
+    \IfBooleanTF{#1}%
+    {% starred
+        \IfValueTF{#3}%
+        {%
+            \global\sbox{\LWR at imagesizebox}{\LWR at origincludegraphics*[#2][#3]{#4}}%
+        }%
+        {%
+            \IfValueTF{#2}%
+            {%
+                \global\sbox{\LWR at imagesizebox}{\LWR at origincludegraphics*[#2]{#4}}%
+            }{%
+                \global\sbox{\LWR at imagesizebox}{\LWR at origincludegraphics*{#4}}%
+            }%
+        }%
+    }% starred
+    {% not starred
+        \IfValueTF{#3}%
+        {%
+            \global\sbox{\LWR at imagesizebox}{\LWR at origincludegraphics[#2][#3]{#4}}%
+        }%
+        {%
+            \IfValueTF{#2}%
+            {%
+                \global\sbox{\LWR at imagesizebox}{\LWR at origincludegraphics[#2]{#4}}%
+            }{%
+                \global\sbox{\LWR at imagesizebox}{\LWR at origincludegraphics{#4}}%
+            }%
+        }%
+    }% not starred
+    \endgroup%
+    \uselengthunit{PT}%
+    \settowidth{\LWR at igwidth}{\usebox{\LWR at imagesizebox}}%
+    \global\renewcommand*{\LWR at igwidthstyle}{width:\rndprintlength{\LWR at igwidth}}%
+    \settoheight{\LWR at igheight}{\usebox{\LWR at imagesizebox}}%
+    \global\renewcommand*{\LWR at igheightstyle}{height:\rndprintlength{\LWR at igheight}}%
+}{}%
+%    \end{macrocode}
+%
 % Create the \HTML\ reference with the graphicspath, filename, extension,
 % alt tag, style, and class.
 %
@@ -26199,9 +27592,12 @@
 % The user should always refer to |.pdf| in the document source.
 
 %    \begin{macrocode}
+\AtBeginDocument{
+
+\LWR at traceinfo{Patching includegraphics.}
+
 \LetLtxMacro\LWR at origincludegraphics\includegraphics
 
-\AtBeginDocument{
 \renewcommand*{\includegraphics}
 {%
 %    \end{macrocode}
@@ -26219,6 +27615,8 @@
 % \end{macro}
 
 
+% \subsection{Boxes}
+
 % \begin{macro}{\LWR at rotboxorigin} Holds the origin key letters.
 %    \begin{macrocode}
 \newcommand*{\LWR at rotboxorigin}{}
@@ -26371,8 +27769,6 @@
 }
 %    \end{macrocode}
 % \end{macro}
-
-
 %
 % \iffalse
 %</graphics>
@@ -26946,6 +28342,8 @@
 % \DescribePackage{keyfloat}
 % \pkg{keyfloat} is supported with minor adjustments.
 %
+% \limitskeyfloat
+%
 % \changes{v0.20}{2017/01/16}{\pkg{keyfloat}: Added.}
 % \changes{v0.31}{2017/05/12}{\pkg{keyfloat}: Improved compatibility.}
 %
@@ -27001,27 +28399,24 @@
 
 \NewEnviron{KFLT at boxinner}
 {%
-\LWR at traceinfo{kflt at boxinner}%
+\LWR at traceinfo{KFLT at boxinner}%
 \LWR at stoppars%
 \KFLT at frame{\BODY}%
 \LWR at startpars%
-\LWR at traceinfo{ended kflt at boxinner}%
+\LWR at traceinfo{KFLT at boxinner: done}%
 }
 %    \end{macrocode}
 
 
+% \changes{v0.42}{2017/10/26}{\pkg{keyfloat}: If \texttt{FormatWP} add explicit HTML style.}
 %    \begin{macrocode}
 \DeclareDocumentEnvironment{KFLT at marginfloat}{O{-1.2ex} m}
-{% start
-\LWR at maybeincthisfloat%
-\LWR at forcenewpage
-\LWR at stoppars%
-\LWR at htmltag{div class="marginblock" id="autofloat-\arabic{LWR at thisfloat}"}
-\LWR at startpars%
+{%
+\LWR at BlockClassWP{float:right; width:2in; margin:10pt}{}{marginblock}%
 \captionsetup{type=#2}%
 }
-{
-\LWR at htmldivclassend{div}
+{%
+\endLWR at BlockClassWP%
 }
 %    \end{macrocode}
 
@@ -27041,10 +28436,20 @@
 %    \begin{macrocode}
 \DeclareDocumentEnvironment{keywrap}{m +m}
 {%
-\begin{BlockClass}{marginblock}
-\setlength{\linewidth}{#1}
+\LWR at ensuredoingapar%
+\setlength{\LWR at templengthone}{#1}%
+\uselengthunit{PT}%
+\begin{LWR at BlockClassWP}{%
+    float:right; width:\rndprintlength{\LWR at templengthone}; %
+    margin:10pt%
+}%
+{%
+    width:\rndprintlength{\LWR at templengthone}%
+}%
+{marginblock}%
+\setlength{\linewidth}{.95\LWR at templengthone}%
 #2%
-\end{BlockClass}
+\end{LWR at BlockClassWP}%
 }
 {%
 }
@@ -27840,6 +29245,8 @@
 %
 % \changes{v0.17}{2016/04/14}{\pkg{mdframed}: Added.}
 %
+% \subsection{Package loading}
+%
 % \codehtml
 %    \begin{macrocode}
 \RequirePackage{xcolor}% for \convertcolorspec
@@ -27847,7 +29254,19 @@
 %    \end{macrocode}
 %
 %
+% \pkg{amsthm} must be loaded before \pkg{mdframed}
+%    \begin{macrocode}
+\LWR at origRequirePackage{amsthm}
+%    \end{macrocode}
 %
+% Do not require \tikz{} or pstricks:
+%    \begin{macrocode}
+\LWR at origRequirePackage[framemethod=none]{mdframed}
+%    \end{macrocode}
+%
+%
+% \subsection{Limitations}
+%
 % \limitsmdframed
 %
 % Environments created or encapsulated by \pkg{mdframed} are enclosed in a
@@ -27860,16 +29279,7 @@
 %
 % Pre-existing hooks are used to patch extra functions before and after the frames.
 %
-
-% \pkg{amsthm} must be loaded before \pkg{mdframed}
-%    \begin{macrocode}
-\LWR at origRequirePackage{amsthm}
-%    \end{macrocode}
 %
-% Do not require \tikz{} or pstricks:
-%    \begin{macrocode}
-\LWR at origRequirePackage[framemethod=none]{mdframed}
-%    \end{macrocode}
 %
 % ^^A \DescribeMacro{\mdfsetup}
 % To handle CSS and paragraphs,
@@ -27888,6 +29298,8 @@
 %    \end{macrocode}
 %
 %
+% \subsection{Color and length HTML conversion}
+%
 % \begin{noindmacro}{\LWR at mdfprintcolor} \marg{mdfcolorkey}
 %
 % Given the \pkg{mdframed} key, print the color.
@@ -27908,8 +29320,10 @@
 }
 %    \end{macrocode}
 % \end{noindmacro}
-
 %
+%
+% \subsection{Environment encapsulation}
+%
 % \begin{noindmacro}{\LWR at mdframedstart}
 % Actions before an mdframe starts.
 %
@@ -27993,6 +29407,8 @@
 % \end{noindmacro}
 %
 %
+% \subsection{Titles and subtitles}
+%
 % \begin{noindmacro}{\mdfframedtitleenv} \marg{title}
 %
 % Encapsulation of the original which places the title
@@ -28158,6 +29574,7 @@
 % \end{noindmacro}
 %
 %
+% \subsection{New environments}
 %
 % \begin{noindmacro}{\LWR at mdthisenv}
 % Stores the environment of the frame about to be created:
@@ -28474,6 +29891,7 @@
 %
 %
 % \changes{v0.34}{2017/08/02}{\pkg{moreverb}: Added.}
+% \changes{v0.42}{2017/10/27}{\pkg{moreverb}: Simplified formatting of listings.}
 %
 % \codehtml
 %    \begin{macrocode}
@@ -28524,22 +29942,29 @@
 % \unskip\LWR at origvspace*{-\baselineskip}%
 \LWR at afterendverbatim%
 }
+%    \end{macrocode}
 
-\renewcommand{\listinglabel}[1]{\InlineClass{listinglabel}{\the#1}}
+% ^^A UNNECESSARY, AND CAUSED PROBLEMS WITH FORMATTING FOR A WORD PROCESSOR:
+% ^^A \renewcommand{\listinglabel}[1]{%
+% ^^A \ifbool{FormatWP}
+% ^^A {\InlineClass{listinglabel}{\qquad\the#1\quad}}%
+% ^^A {\InlineClass{listinglabel}{\the#1}}%
+% ^^A }
+% 
+% ^^A \def\thelisting at line{%
+% ^^A \@tempcnta=\listing at line%
+% ^^A \divide\@tempcnta\listing at step \multiply\@tempcnta\listing at step%
+% ^^A \ifnum\listing at line=\@ne%
+% ^^A \listinglabel\listing at line%
+% ^^A \else%
+% ^^A \ifnum\@tempcnta=\listing at line%
+% ^^A \listinglabel\listing at line%
+% ^^A \else%
+% ^^A \InlineClass{listinglabel}{\ifbool{FormatWP}{\qquad\quad}{}}%
+% ^^A \fi%
+% ^^A \fi}
 
-\def\thelisting at line{%
-\@tempcnta=\listing at line%
-\divide\@tempcnta\listing at step \multiply\@tempcnta\listing at step%
-\ifnum\listing at line=\@ne%
-\listinglabel\listing at line%
-\else%
-\ifnum\@tempcnta=\listing at line%
-\listinglabel\listing at line%
-\else%
-\InlineClass{listinglabel}{}%
-\fi%
-\fi}
-
+%    \begin{macrocode}
 \LetLtxMacro\LWRMV@@listinginput\@listinginput
 
 \renewcommand{\@listinginput}[3][]{
@@ -28576,8 +30001,42 @@
 %
 %
 %
+% \iffalse
+%<*morewrites>
+% \fi
 %
+% \part{lwarp-morewrites.sty}
+%
+% \section{morewrites}
+%
+% \DescribePackage{morewrites}
+% Error if \pkg{morewrites} is loaded after \pkg{lwarp}.
+%
+% \changes{v0.42}{2017/10/19}{\pkg{morewrites}: Added.}
+%
+
+% Discard all options for \pkg{lwarp-morewrites}:
+
+% \codehtml
+%
+%    \begin{macrocode}
+\LWR at ProvidesPackageDrop{morewrites}
+%    \end{macrocode}
+
+%    \begin{macrocode}
+\LWR at loadbefore{morewrites}
+%    \end{macrocode}
+
 % \iffalse
+%</morewrites>
+% \fi
+%
+%
+%
+%
+%
+%
+% \iffalse
 %<*mparhack>
 % \fi
 %
@@ -28777,7 +30236,13 @@
 \LWR at addleftmostbartag%
 \LWR at printbartag{\theLWR at tablecolspos}%
 "%
+%    \end{macrocode}
+% \changes{v0.42}{2017/10/26}{\pkg{multirow}: If \protect\texttt{FormatWP} add cell alignment.}
+%    \begin{macrocode}
+\LWR at tdstartstyles%
 \LWR at addcmidrulewidth%
+\LWR at addformatwpalignment%
+\LWR at tdendstyles%
 }%
 %    \end{macrocode}
 % \changes{v0.41}{2017/10/05}{Fix: \protect\textless\ spec.}
@@ -29141,17 +30606,26 @@
 %
 % \changes{v0.25}{2017/03/22}{\pkg{ntheorem}: Added.}
 %
+% \begin{table}[ht]
+% \hrule
+% \smallskip
+% \caption{Ntheorem package --- CSS styling of theorems and proofs}\unskip
 % \begin{description}
-% \item[CSS styling of theorems and proofs:] \
-% \begin{description}
 % \item [Theorem:] \element{div} of class |theorembody<theoremstyle>|
 % \item [Theorem Header:] \element{span} of class |theoremheader<style>|
 % \end{description}
 % where |<theoremstyle>| is |plain|, |break|, etc.
-% \end{description}
+% \smallskip
+% \hrule
+% \end{table}
 %
+%
+% \subsection{Limitations}
+%
 % \limitsntheorem
 %
+% \subsection{Options}
+%
 % Options |amsthm| or |standard| choose which set of theorems and proofs
 % to initialize.
 %
@@ -29195,6 +30669,7 @@
 %    \end{macrocode}
 %
 %
+% \subsection{Remembering the theorem style}
 %
 % Storage for the style being used for new theorems.
 %    \begin{macrocode}
@@ -29215,7 +30690,8 @@
         }
 }
 %    \end{macrocode}
-
+%
+%
 % Patched to remember the style for this theorem type,
 % and set it later when the environment is started.
 %    \begin{macrocode}
@@ -29277,6 +30753,8 @@
 %    \end{macrocode}
 %
 %
+% \subsection{HTML cross-referencing}
+%
 % Mimics a float by incrementing the float counter and generating
 % an \HTML\ anchor.  These are used for list-of-theorem cross-references.
 %    \begin{macrocode}
@@ -29289,6 +30767,8 @@
 %    \end{macrocode}
 %
 %
+% \subsection{\cs{newtheoremstyle}}
+%
 % The following are patched for \CSS.
 %
 % These were in individual files |thp.sty| for plain,
@@ -29317,7 +30797,11 @@
 }%
 {\PackageError{\basename}{Theorem style #1 already defined}\@eha}
 }
-
+%    \end{macrocode}
+%
+% \subsection{Standard styles}
+%
+%    \begin{macrocode}
 \renewtheoremstyle{plain}%
   {\item[\hskip\labelsep \theorem at headerfont
     \InlineClass{theoremheaderplain}{##1\ ##2\theorem at separator}]}%
@@ -29334,7 +30818,8 @@
   {\item[
 % 		\rlap{\vbox{\hbox{
     \hskip\labelsep \theorem at headerfont
-    \InlineClass{theoremheaderbreak}{##1\ ##2\ (##3)\theorem at separator}\newline
+    \InlineClass{theoremheaderbreak}%
+        {##1\ ##2\ (##3)\theorem at separator}\newline
 % 		}\hbox{\strut}}}
     ]}
 
@@ -29349,14 +30834,16 @@
 \renewtheoremstyle{changebreak}%
   {\item[
 % 		\rlap{\vbox{\hbox{
-            \hskip\labelsep \theorem at headerfont
-            \InlineClass{theoremheaderchangebreak}{##2\ ##1\theorem at separator}\newline
+        \hskip\labelsep \theorem at headerfont
+        \InlineClass{theoremheaderchangebreak}%
+            {##2\ ##1\theorem at separator}\newline
 % 		}\hbox{\strut}}}
     ]}%
   {\item[
 % 		\rlap{\vbox{\hbox{
-            \hskip\labelsep \theorem at headerfont
-            \InlineClass{theoremheaderchangebreak}{##2\ ##1\ (##3)\theorem at separator}\newline
+        \hskip\labelsep \theorem at headerfont
+        \InlineClass{theoremheaderchangebreak}%
+            {##2\ ##1\ (##3)\theorem at separator}\newline
 % 		}\hbox{\strut}}}
     ]}
 
@@ -29370,10 +30857,12 @@
 
 \renewtheoremstyle{marginbreak}%
   {\item[\hskip\labelsep\theorem at headerfont
-    \InlineClass{theoremheadermarginbreak}{##2 \qquad ##1\theorem at separator}\newline
+    \InlineClass{theoremheadermarginbreak}%
+        {##2 \qquad ##1\theorem at separator}\newline
     ]}%
   {\item[\hskip\labelsep\theorem at headerfont
-    \InlineClass{theoremheadermarginbreak}{##2 \qquad ##1\ (##3)\theorem at separator}\newline
+    \InlineClass{theoremheadermarginbreak}%
+        {##2 \qquad ##1\ (##3)\theorem at separator}\newline
     ]}
 
 \renewtheoremstyle{nonumberplain}%
@@ -29407,6 +30896,9 @@
     \InlineClass{theoremheaderplain}{##3}] \ \newline}
 %    \end{macrocode}
 %
+%
+% \subsection{Additional objects}
+%
 % The following manually adjust the \CSS\ for the standard configuration
 % objects which are not a purely plain style:
 %    \begin{macrocode}
@@ -29424,10 +30916,15 @@
         \InlineClass{theoremheadersc}{##1\theorem at separator}]}%
     {\item[\theorem at headerfont\hskip \labelsep
         \InlineClass{theoremheadersc}{##1\ (##3)\theorem at separator}]}
+}% not amsthm
 %    \end{macrocode}
 %
+%
+% \subsection{Renewed standard configuration}
+%
 % The following standard configuration is renewed using the new \CSS:
 %    \begin{macrocode}
+\ifbool{LWR at ntheoremamsthm}{}{%
     \theoremstyle{plainupright}
     \theorembodyfont{\upshape}
     \theoremsymbol{\HTMLunicode{25A1}}% UTF-8 white box
@@ -29457,6 +30954,8 @@
 %    \end{macrocode}
 %
 %
+% \subsection{\protect\texttt{amsthm} option}
+%
 % Only if the |amsthm| option was given:
 %    \begin{macrocode}
 \ifbool{LWR at ntheoremamsthm}{
@@ -29618,6 +31117,9 @@
 }{}% amsthm option
 %    \end{macrocode}
 %
+%
+% \subsection{Ending a theorem}
+%
 % Patched for \CSS:
 %    \begin{macrocode}
 \let\LWR at origendtheorem\@endtheorem
@@ -29633,13 +31135,17 @@
 \endBlockClass%
 }
 %    \end{macrocode}
-
+%
+%
+% \subsection{\cs{NoEndMark}}
+%
 %    \begin{macrocode}
 \gdef\NoEndMark{\global\setendmarkfalse}
 %    \end{macrocode}
-
-
-
+%
+%
+% \subsection{List-of}
+%
 % Redefined to reuse the float mechanism to add list-of-theorem links:
 %
 % \cs{thm at thmline} \marg{1: printed type} \marg{2: \#} \marg{3: optional} \marg{4: page}
@@ -29658,8 +31164,8 @@
 %    \begin{macrocode}
 \def\thm@@thmline{\thm@@thmline at name}
 %    \end{macrocode}
-
-
+%
+%
 % Patch for \CSS:
 %    \begin{macrocode}
 \def\listtheorems#1{
@@ -29671,10 +31177,12 @@
 \LWR at htmlelementclassend{nav}{lothm}%
 }
 %    \end{macrocode}
-
+%
+%
+% \subsection{Symbols}
+%
 % Proof QED symbol:
 %    \begin{macrocode}
-
 \newcommand{\qed}{\qquad\the\qedsymbol}
 
 \AtBeginDocument{
@@ -29684,6 +31192,8 @@
 }
 %    \end{macrocode}
 %
+% \subsection{Cross-referencing}
+%
 % \cs{thref} \marg{label}
 %    \begin{macrocode}
 \newcommand*{\thref}[1]{\cref{#1}}
@@ -29697,8 +31207,60 @@
 %
 %
 %
+% \iffalse
+%<*overpic>
+% \fi
 %
+% \part{lwarp-overpic.sty}
+
+% \section{overpic}
+% \label{sec:overpic}
+%
+% \DescribePackage{overpic}
+% \pkg{overpic} is patched for use by \pkg{lwarp}.
+%
+% \changes{v0.42}{2017/10/16}{\pkg{overpic}: Added.}
+%
+% \limitsoverpic
+%
+% See \cref{sec:graphicsprint} for the print-mode version of
+% \cs{overpicfontsize} and \cs{overpicfontskip}.
+%
+% \codehtml
+%
+%    \begin{macrocode}
+\LWR at ProvidesPackagePass{overpic}
+%    \end{macrocode}
+
+%    \begin{macrocode}
+\newcommand*{\overpicfontsize}{12}
+\newcommand*{\overpicfontskip}{14}
+
+\BeforeBeginEnvironment{overpic}{%
+    \lateximage%
+    \fontsize{\overpicfontsize}{\overpicfontskip}%
+    \selectfont%
+}
+
+\AfterEndEnvironment{overpic}{\endlateximage}
+
+\BeforeBeginEnvironment{Overpic}{%
+    \lateximage%
+    \fontsize{\overpicfontsize}{\overpicfontskip}%
+    \selectfont%
+}
+
+\AfterEndEnvironment{Overpic}{\endlateximage}
+%    \end{macrocode}
+
 % \iffalse
+%</overpic>
+% \fi
+%
+%
+%
+%
+% \iffalse
 %<*pagenote>
 % \fi
 
@@ -30103,6 +31665,7 @@
 % See |lwarp.css| for the \element{span} of class \attribute{supsubscript}.
 %
 % \changes{v0.38}{2017/08/26}{\pkg{realscripts}: Added.}
+% \changes{v0.42}{2017/10/16}{\pkg{realscripts}: Fix for subscripts in a \env{lateximage}.}
 %
 % \codehtml
 %
@@ -30111,12 +31674,6 @@
 %    \end{macrocode}
 %
 %    \begin{macrocode}
-\let\LWR at origtextsuperscript\textsuperscript
-\let\LWR at origtextsubscript\textsubscript
-
-\RenewDocumentCommand{\textsuperscript}{s}{\LWR at origtextsuperscript}
-\RenewDocumentCommand{\textsubscript}{s}{\LWR at origtextsubscript}
-
 \let\realsuperscript\textsuperscript
 \let\realsubscript\textsubscript
 
@@ -30794,18 +32351,15 @@
 %
 %
 % Borrowed from the \pkg{lwarp} version of \pkg{keyfloat}:
+% \changes{v0.42}{2017/10/26}{\pkg{sidenotes}: If \texttt{FormatWP} add explicit HTML style.}
 %    \begin{macrocode}
 \NewDocumentEnvironment{KFLTsidenotes at marginfloat}{O{-1.2ex} m}
 {% start
-\LWR at maybeincthisfloat%
-\LWR at forcenewpage
-\LWR at stoppars%
-\LWR at htmltag{div class="marginblock" id="autofloat-\arabic{LWR at thisfloat}"}
-\LWR at startpars%
+\LWR at BlockClassWP{float:right; width:2in; margin:10pt}{}{marginblock}%
 \captionsetup{type=#2}%
 }
-{
-\LWR at htmldivclassend{div}
+{%
+\endLWR at BlockClassWP%
 }
 
 \RenewDocumentEnvironment{marginfigure}{o}
@@ -30871,7 +32425,53 @@
 \DeclareSIUnit\electronmass{\textit{m}\textsubscript{e}}
 \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.
+%    \begin{macrocode}
+\ExplSyntaxOn
+\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
+    \hbox_set:Nn \l__siunitx_tmp_box
+      {
+        \ensuremath
+          {
+            \use:c { math #1 }
+              {
+                \int_gset:cn { c__siunitx_math #1 _int } { \fam }
+              }
+          }
+      }
+  \group_end:
+    \LWR at traceinfo{sunitx set math fam: done}
+}
+
+\cs_undefine:N \__siunitx_combined_output:n
+\cs_new_protected:Npn \__siunitx_combined_output:n #1 {
+    \group_begin:
+    \LetLtxMacro\@ensuredmath\LWR at origensuredmath
+  \bool_if:NTF \l__siunitx_number_parse_bool
+    {
+      \tl_clear:N \l__siunitx_number_out_tl
+      \bool_set_false:N \l__siunitx_number_compound_bool
+      \__siunitx_number_output_parse:n {#1}
+    }
+    {
+      \__siunitx_unit_output_pre_print:
+      \__siunitx_print:nn { number } { \ensuremath {#1} }
+      \__siunitx_unit_output_print:
+    }
+    \group_end:
+}
+
+\ExplSyntaxOff
 %    \end{macrocode}
 
 % \iffalse
@@ -30896,6 +32496,7 @@
 % \DescribePackage{soul} Emulated.
 %
 % \changes{v0.27}{2017/04/02}{\pkg{soul}: Added.}
+% \changes{v0.42}{2017/10/20}{\pkg{soul}: If \protect\texttt{FormatWP}, add explicit styles.}
 %
 % \codehtml
 %
@@ -30915,34 +32516,56 @@
 \newcommand*{\LWR at soulhlcolor}{}
 %    \end{macrocode}
 %
+% \begin{noindmacro}{\so} \marg{text}
+%
 % Basic markup with \CSS:
 %    \begin{macrocode}
-\newcommand{\so}[1]{\InlineClass{letterspacing}{#1}}
-\newcommand{\caps}[1]{\InlineClass{capsspacing}{#1}}
+\newcommand{\so}[1]{%
+\LWR at HTMLtextstyle{letter-spacing:.2ex}{letterspacing}{#1}%
+}
 %    \end{macrocode}
+% \end{noindmacro}
+
+% \begin{noindmacro}{\caps} \marg{text}
+%    \begin{macrocode}
+\newcommand{\caps}[1]{%
+\LWR at HTMLtextstyle%
+    {font-variant:small-caps;letter-spacing:.1ex}%
+    {capsspacing}{#1}%
+}
+%    \end{macrocode}
+% \end{noindmacro}
 %
+% \begin{noindmacro}{\LWR at soulcolor}
+%   \marg{text} \marg{color} \marg{class} \marg{colorstyle} \marg{FormatWPstyle}
+%
 % Add colors if not empty:
 %    \begin{macrocode}
-\newcommand{\LWR at soulcolor}[4]{%
+\newcommand{\LWR at soulcolor}[5]{%
 \ifcsempty{#2}%
+{\LWR at HTMLtextstyle{#5}{#3}{#1}}%
 {%
-\InlineClass{#3}{#1}}%
-{%
-\convertcolorspec{named}{\csuse{#2}}{HTML}\LWR at tempcolor%
-\InlineClass[#4: \#\LWR at tempcolor]{#3}{#1}%
+    \convertcolorspec{named}{\csuse{#2}}{HTML}\LWR at tempcolor%
+    \LWR at HTMLtextstyle{#5;#4:\#\LWR at tempcolor}{#3}{#1}%
 }%
 }
+%    \end{macrocode}
+% \end{noindmacro}
 
+%    \begin{macrocode}
 \newcommand{\ul}[1]{%
 \LWR at soulcolor{#1}{LWR at soululcolor}{uline}{text-decoration-color}%
+    {text-decoration:underline;text-decoration-skip;}%
 }
 
 \newcommand{\st}[1]{
 \LWR at soulcolor{#1}{LWR at soulstcolor}{sout}{text-decoration-color}%
+    {text-decoration:line-through}%
 }
 
 \newcommand{\hl}[1]{
 \LWR at soulcolor{#1}{LWR at soulhlcolor}{highlight}{background-color}%
+    {background:\#F8E800}
 }
 %    \end{macrocode}
 %
@@ -31063,7 +32686,8 @@
 \LWR at ProvidesPackagePass{subfig}
 %    \end{macrocode}
 
-% \cs{sf@@@subfloat} \marg{1 type} \oarg{2 lof entry} \oarg{3 caption} \marg{4 contents}
+% \begin{noindmacro}{\sf@@@subfloat}
+%   \marg{1 type} \oarg{2 lof entry} \oarg{3 caption} \marg{4 contents}
 %
 % The outer minipage allows side-by-side subfloats with \cs{hfill} between.
 %    \begin{macrocode}
@@ -31154,8 +32778,10 @@
   \endgroup\ignorespaces%
 }%
 %    \end{macrocode}
+% \end{noindmacro}
 
-% \cs{sf at subcaption} \marg{1 type} \marg{2 lof entry} \marg{3 caption}
+% \begin{noindmacro}{\sf at subcaption}
+%   \marg{1 type} \marg{2 lof entry} \marg{3 caption}
 %    \begin{macrocode}
 \long\def\sf at subcaption#1#2#3{%
 \LWR at stoppars% new
@@ -31190,12 +32816,12 @@
         {
 % 			\parbox[t]{\the\@tempdima}{%
 \LWR at traceinfo{sfsubcap B1}% new
-            \LWR at htmlblocktag{figcaption}% new
+            \LWR at figcaption% new
             \caption at make
                 {\@nameuse{sub\@captype name}}%
                 {\@nameuse{thesub\@captype}}%
                 {#3}
-            \LWR at htmlblocktag{/figcaption}% new
+            \LWR at figcaption% new
 \LWR at traceinfo{sfsubcap B2}% new
 % 			}%
         }%
@@ -31235,8 +32861,10 @@
 \LWR at startpars% new
 }
 %    \end{macrocode}
+% \end{noindmacro}
 
-% \cs{caption@@@make} \marg{caption label} \marg{caption text}
+% \begin{noindmacro}{\caption@@@make}
+%   \marg{caption label} \marg{caption text}
 %    \begin{macrocode}
 \renewcommand\caption@@@make[2]{%
 \LWR at startpars% new
@@ -31278,8 +32906,9 @@
 \LWR at stoppars% new
 }
 %    \end{macrocode}
+% \end{noindmacro}
 
-
+% \begin{noindmacro}{\subfloat at label}
 % Patches for \cs{sf at sub@label}:
 %    \begin{macrocode}
 \def\subfloat at label{%
@@ -31291,11 +32920,12 @@
                    \@nameuse{p at sub\@captype}%
                    \@nameuse{thesub\@captype}.)}}
 %    \end{macrocode}
+% \end{noindmacro}
 
-
-
 % Patches for \cs{subref}.
 %
+% \begin{noindmacro}{\sf at subref} \marg{label}
+%
 % The unstarred version uses a \cs{ref} link whose printed text
 % comes from the |sub@<label>|:
 %    \begin{macrocode}
@@ -31303,13 +32933,21 @@
 \LWR at subnewref{#1}{sub@#1}%
 }
 %    \end{macrocode}
+% \end{noindmacro}
+%
+% \begin{noindmacro}{\sf@@subref} \marg{label}
+%
 % The starred version uses the printed |sub@<label>| which is stored as
 % if it were a page number:
 %    \begin{macrocode}
 \renewcommand{\sf@@subref}[1]{\LWR at origpageref{sub@#1}}
 %    \end{macrocode}
+% \end{noindmacro}
 %
+%
 % Defining new subfloats.  The |l at sub<type>| for each is redefined.
+%
+% \begin{noindmacro}{\@newsubfloat} \oarg{keys/values} \marg{float name}
 %    \begin{macrocode}
 \LetLtxMacro\LWR at orig@newsubfloat\@newsubfloat
 
@@ -31318,14 +32956,24 @@
 \renewcommand{\l at sub#2}[2]{\hypertocfloat{2}{sub#2}{\ext at sub#2}{##1}{##2}}
 }
 %    \end{macrocode}
+% \end{noindmacro}
 %
 % Pre-defined for figures and tables:
+%
+% \begin{noindmacro}{\l at subfigure} \marg{text} \marg{pagenum}
 %    \begin{macrocode}
 \renewcommand{\l at subfigure}[2]{\hypertocfloat{2}{subfigure}{lof}{#1}{#2}}
+%    \end{macrocode}
+% \end{noindmacro}
+%
+% \begin{noindmacro}{\l at subtable} \marg{text} \marg{pagenum}
+%    \begin{macrocode}
 \renewcommand{\l at subtable}[2]{\hypertocfloat{2}{subtable}{lot}{#1}{#2}}
-% \def\subfigure{\subfloat}
-% \def\subtable{\subfloat}
 %    \end{macrocode}
+% \end{noindmacro}
+%
+% ^^A \def\subfigure{\subfloat}
+% ^^A \def\subtable{\subfloat}
 
 
 % \iffalse
@@ -31628,12 +33276,18 @@
 % \DescribePackage{textcomp}
 % \pkg{textcomp} is patched for use by \pkg{lwarp}.
 %
+% \subsection{Limitations}
+%
 % \limitstextcomp
 %
+%
+% \subsection{Package loading}
+%
 % \changes{v0.37}{2017/08/18}{\pkg{textcomp}: Improved support.}
 % \changes{v0.38}{2017/08/21}{\pkg{textcomp}: Removed from \pkg{lwarp} core.}
 % \changes{v0.40}{2017/09/07}{\pkg{textcomp}: Additional symbols,
 %       improved XeLaTeX and LuaLaTeX support.}
+% \changes{v0.42}{2017/10/13}{\pkg{textcomp}: Improved \cs{interrobangdown}.}
 %
 % \codehtml
 %
@@ -31642,6 +33296,8 @@
 %    \end{macrocode}
 %
 %
+% \subsection{Remembering original defintions}
+%
 % The following are restored for print when inside a \env{lateximage}:
 %    \begin{macrocode}
 \let\LWR at origtextdegree\textdegree
@@ -31657,6 +33313,7 @@
 \let\LWR at origtextnaira\textnaira
 \let\LWR at origtextpeso\textpeso
 \let\LWR at origtextrecipe\textrecipe
+\let\LWR at origtextinterrobangdown\textinterrobangdown
 \let\LWR at origtextpertenthousand\textpertenthousand
 \let\LWR at origtextbaht\textbaht
 \let\LWR at origtextdiscount\textdiscount
@@ -31676,9 +33333,16 @@
 \LetLtxMacro\LWR at origcapitaldotaccent\capitaldotaccent
 \LetLtxMacro\LWR at origtextcircled\textcircled
 %    \end{macrocode}
+%
+%
+% \subsection{HTML symbols}
+%
 % For \HTML, use \HTML\ entities or direct Unicode, depending on the engine.
 %
 % \cs{AtBeginDocument} improves support for \LuaLaTeX\ and \XeLaTeX.
+%
+% \subsubsection{pdf\protect\LaTeX\ symbols}
+%
 %    \begin{macrocode}
 \AtBeginDocument{
 \ifPDFTeX
@@ -31695,6 +33359,7 @@
 \renewcommand*{\textnaira}{\HTMLunicode{20A6}}
 \renewcommand*{\textpeso}{\HTMLunicode{20B1}}
 \renewcommand*{\textrecipe}{\HTMLunicode{211E}}
+\renewcommand*{\textinterrobangdown}{\HTMLunicode{2E18}}
 \renewcommand*{\textpertenthousand}{\HTMLunicode{2031}}
 \renewcommand*{\textbaht}{\HTMLunicode{0E3F}}
 \renewcommand*{\textdiscount}{\%}
@@ -31701,6 +33366,9 @@
 \renewcommand*{\textservicemark}{\HTMLunicode{2120}}
 \else
 %    \end{macrocode}
+%
+% \subsubsection{\protect\XeLaTeX\ and \protect\LuaLaTeX\ symbols}
+%
 % NOTE: Some of the following do not print well in the listing.
 % Consult the .dtx or .sty file for the actual characters.
 %    \begin{macrocode}
@@ -31717,6 +33385,7 @@
 \renewcommand*{\textnaira}{₦}
 \renewcommand*{\textpeso}{₱}
 \renewcommand*{\textrecipe}{℞}
+\renewcommand*{\textinterrobangdown}{⸘}
 \renewcommand*{\textpertenthousand}{‱}
 \renewcommand*{\textbaht}{฿}
 \renewcommand*{\textdiscount}{\%}
@@ -31723,6 +33392,10 @@
 \renewcommand*{\textservicemark}{℠}
 \fi
 %    \end{macrocode}
+%
+%
+% \subsection{HTML dicritics}
+%
 % For \HTML, Unicode diacritical marks are used:
 %    \begin{macrocode}
 \renewcommand*{\capitalcedilla}[1]{#1\HTMLunicode{0327}}
@@ -31747,6 +33420,9 @@
 }% AtBeginDocument
 %    \end{macrocode}
 %
+%
+% \subsection{Inside a \env{lateximage}}
+%
 % When a \env{lateximage} is begun:
 %    \begin{macrocode}
 \appto{\LWR at restoreorigformatting}{%
@@ -31763,6 +33439,7 @@
 \let\textnaira\LWR at origtextnaira%
 \let\textpeso\LWR at origtextpeso%
 \let\textrecipe\LWR at origtextrecipe%
+\let\textinterrobangdown\LWR at origtextinterrobangdown%
 \let\textpertenthousand\LWR at origtextpertenthousand%
 \let\textbaht\LWR at origtextbaht%
 \let\textdiscount\LWR at origtextdiscount%
@@ -31858,14 +33535,18 @@
 %
 % \changes{v0.25}{2017/03/16}{\pkg{theorem}: Added.}
 %
+% \begin{table}[ht]
+% \hrule
+% \smallskip
+% \caption{Theorem package --- CSS styling of theorems and proofs}
 % \begin{description}
-% \item[CSS styling of theorems and proofs:] \
-% \begin{description}
 % \item [Theorem:] \element{div} of class |theorembody<theoremstyle>|
 % \item [Theorem Header:] \element{span} of class |theoremheader|
 % \end{description}
 % where |<theoremstyle>| is |plain|, |break|, etc.
-% \end{description}
+% \smallskip
+% \hrule
+% \end{table}
 %
 %
 % \codehtml
@@ -31874,6 +33555,9 @@
 \LWR at ProvidesPackagePass{theorem}
 %    \end{macrocode}
 
+
+% \subsection{Remembering the theorem style}
+
 % Storage for the style being used for new theorems:
 %    \begin{macrocode}
 \newcommand{\LWR at newtheoremstyle}{plain}
@@ -31948,6 +33632,8 @@
 %    \end{macrocode}
 %
 %
+% \subsection{CSS patches}
+%
 % The following are patched for \CSS.
 %
 % These were in individual files |thp.sty| for plain,
@@ -32259,22 +33945,28 @@
 % \cs{pagestyle} and \cs{thispagestyle} are already disabled in the \pkg{lwarp} code.
 %
 % \begin{noindmacro}{\newpagestyle} \marg{name} \oarg{style} \marg{commands}
+%    \begin{macrocode}
+\NewDocumentCommand{\newpagestyle}{m o m}{}
+%    \end{macrocode}
+% \end{noindmacro}
+
 % \begin{noindmacro}{\renewpagestyle} \marg{name} \oarg{style} \marg{commands}
 %    \begin{macrocode}
-\NewDocumentCommand{\newpagestyle}{m o m}{}
 \NewDocumentCommand{\renewpagestyle}{m o m}{}
 %    \end{macrocode}
 % \end{noindmacro}
+
+% \begin{noindmacro}{\sethead} \oarg{el} \oarg{ec} \oarg{er} \marg{ol} \marg{oc} \marg{or}
+%    \begin{macrocode}
+\NewDocumentCommand{\sethead}{o o o m m m}{}
+%    \end{macrocode}
 % \end{noindmacro}
 
-% \begin{noindmacro}{\sethead} \oarg{el} \oarg{ec} \oarg{er} \marg{ol} \marg{oc} \marg{or}
 % \begin{noindmacro}{\setfoot} \oarg{el} \oarg{ec} \oarg{er} \marg{ol} \marg{oc} \marg{or}
 %    \begin{macrocode}
-\NewDocumentCommand{\sethead}{o o o m m m}{}
 \NewDocumentCommand{\setfoot}{o o o m m m}{}
 %    \end{macrocode}
 % \end{noindmacro}
-% \end{noindmacro}
 
 % \begin{noindmacro}{\settitlemarks} * \marg{names}
 %    \begin{macrocode}
@@ -32283,31 +33975,40 @@
 % \end{noindmacro}
 
 % \begin{noindmacro}{\headrule}
+%    \begin{macrocode}
+\newcommand*{\headrule}{}
+%    \end{macrocode}
+% \end{noindmacro}
+
 % \begin{noindmacro}{\footrule}
 %    \begin{macrocode}
-\newcommand*{\headrule}{}
 \newcommand*{\footrule}{}
 %    \end{macrocode}
 % \end{noindmacro}
+
+% \begin{noindmacro}{\setheadrule} \marg{length}
+%    \begin{macrocode}
+\newcommand*{\setheadrule}[1]{}
+%    \end{macrocode}
 % \end{noindmacro}
 
-% \begin{noindmacro}{\setheadrule} \marg{length}
 % \begin{noindmacro}{\setfootrule} \marg{length}
 %    \begin{macrocode}
-\newcommand*{\setheadrule}[1]{}
 \newcommand*{\setfootrule}[1]{}
 %    \end{macrocode}
 % \end{noindmacro}
+
+% \begin{noindmacro}{\makeheadrule}
+%    \begin{macrocode}
+\newcommand*{\makeheadrule}{}
+%    \end{macrocode}
 % \end{noindmacro}
 
-% \begin{noindmacro}{\makeheadrule}
 % \begin{noindmacro}{\makefootrule}
 %    \begin{macrocode}
-\newcommand*{\makeheadrule}{}
 \newcommand*{\makefootrule}{}
 %    \end{macrocode}
 % \end{noindmacro}
-% \end{noindmacro}
 
 % \begin{noindmacro}{\setmarkboth} \marg{code}
 %    \begin{macrocode}
@@ -32322,25 +34023,40 @@
 % \end{noindmacro}
 
 % \begin{noindmacro}{\bottitlemarks}
+%    \begin{macrocode}
+\newcommand*{\bottitlemarks}{}
+%    \end{macrocode}
+% \end{noindmacro}
+
 % \begin{noindmacro}{\toptitlemarks}
+%    \begin{macrocode}
+\newcommand*{\toptitlemarks}{}
+%    \end{macrocode}
+% \end{noindmacro}
+
 % \begin{noindmacro}{\firsttitlemarks}
+%    \begin{macrocode}
+\newcommand*{\firsttitlemarks}{}
+%    \end{macrocode}
+% \end{noindmacro}
+
 % \begin{noindmacro}{\nexttitlemarks}
+%    \begin{macrocode}
+\newcommand*{\nexttoptitlemarks}{}
+%    \end{macrocode}
+% \end{noindmacro}
+
 % \begin{noindmacro}{\outertitlemarks}
+%    \begin{macrocode}
+\newcommand*{\outertitlemarks}{}
+%    \end{macrocode}
+% \end{noindmacro}
+
 % \begin{noindmacro}{\innertitlemarks}
 %    \begin{macrocode}
-\newcommand*{\bottitlemarks}{}
-\newcommand*{\toptitlemarks}{}
-\newcommand*{\firsttitlemarks}{}
-\newcommand*{\nexttoptitlemarks}{}
-\newcommand*{\outertitlemarks}{}
 \newcommand*{\innertitlemarks}{}
 %    \end{macrocode}
 % \end{noindmacro}
-% \end{noindmacro}
-% \end{noindmacro}
-% \end{noindmacro}
-% \end{noindmacro}
-% \end{noindmacro}
 
 % \begin{noindmacro}{\newtitlemark} * \marg{name}
 %    \begin{macrocode}
@@ -32361,22 +34077,28 @@
 % \end{noindmacro}
 
 % \begin{noindmacro}{\setfloathead} * \oarg{.} \oarg{.} \oarg{.} \marg{.} \marg{.} \marg{.} \marg{extra} \oarg{which}
+%    \begin{macrocode}
+\NewDocumentCommand{\setfloathead}{s o o o m m m m m}{}
+%    \end{macrocode}
+% \end{noindmacro}
+
 % \begin{noindmacro}{\setfloatfoot} * \oarg{.} \oarg{.} \oarg{.} \marg{.} \marg{.} \marg{.} \marg{extra} \oarg{which}
 %    \begin{macrocode}
-\NewDocumentCommand{\setfloathead}{s o o o m m m m m}{}
 \NewDocumentCommand{\setfloatfoot}{s o o o m m m m m}{}
 %    \end{macrocode}
 % \end{noindmacro}
+
+% \begin{noindmacro}{\nextfloathead} * \oarg{.} \oarg{.} \oarg{.} \marg{.} \marg{.} \marg{.} \marg{extra} \oarg{which}
+%    \begin{macrocode}
+\NewDocumentCommand{\nextfloathead}{s o o o m m m m m}{}
+%    \end{macrocode}
 % \end{noindmacro}
 
-% \begin{noindmacro}{\nextfloathead} * \oarg{.} \oarg{.} \oarg{.} \marg{.} \marg{.} \marg{.} \marg{extra} \oarg{which}
 % \begin{noindmacro}{\nextfloatfoot} * \oarg{.} \oarg{.} \oarg{.} \marg{.} \marg{.} \marg{.} \marg{extra} \oarg{which}
 %    \begin{macrocode}
-\NewDocumentCommand{\nextfloathead}{s o o o m m m m m}{}
 \NewDocumentCommand{\nextfloatfoot}{s o o o m m m m m}{}
 %    \end{macrocode}
 % \end{noindmacro}
-% \end{noindmacro}
 
 % \begin{noindmacro}{\newmarkset} \marg{markset}
 %    \begin{macrocode}
@@ -32391,25 +34113,40 @@
 % \end{noindmacro}
 
 % \begin{noindmacro}{\botextramarks} \marg{markset}
+%    \begin{macrocode}
+\newcommand{\botextramarks}[1]{}
+%    \end{macrocode}
+% \end{noindmacro}
+
 % \begin{noindmacro}{\topextramarks} \marg{markset}
+%    \begin{macrocode}
+\newcommand{\topextramarks}[1]{}
+%    \end{macrocode}
+% \end{noindmacro}
+
 % \begin{noindmacro}{\firstextramarks} \marg{markset}
+%    \begin{macrocode}
+\newcommand{\firstextramarks}[1]{}
+%    \end{macrocode}
+% \end{noindmacro}
+
 % \begin{noindmacro}{\nextextramarks} \marg{markset}
+%    \begin{macrocode}
+\newcommand{\nexttopextramarks}[1]{}
+%    \end{macrocode}
+% \end{noindmacro}
+
 % \begin{noindmacro}{\outerextramarks} \marg{markset}
+%    \begin{macrocode}
+\newcommand{\outerextramarks}[1]{}
+%    \end{macrocode}
+% \end{noindmacro}
+
 % \begin{noindmacro}{\innerextramarks} \marg{markset}
 %    \begin{macrocode}
-\newcommand{\botextramarks}[1]{}
-\newcommand{\topextramarks}[1]{}
-\newcommand{\firstextramarks}[1]{}
-\newcommand{\nexttopextramarks}[1]{}
-\newcommand{\outerextramarks}[1]{}
 \newcommand{\innerextramarks}[1]{}
 %    \end{macrocode}
 % \end{noindmacro}
-% \end{noindmacro}
-% \end{noindmacro}
-% \end{noindmacro}
-% \end{noindmacro}
-% \end{noindmacro}
 
 % \iffalse
 %</titleps>
@@ -32509,26 +34246,42 @@
 
 
 % \begin{noindmacro}{\filright}
+%    \begin{macrocode}
+\newcommand*{\filright}{}
+%    \end{macrocode}
+% \end{noindmacro}
+
 % \begin{noindmacro}{\filcenter}
+%    \begin{macrocode}
+\newcommand*{\filcenter}{}
+%    \end{macrocode}
+% \end{noindmacro}
+
 % \begin{noindmacro}{\filleft}
+%    \begin{macrocode}
+\newcommand*{\filleft}{}
+%    \end{macrocode}
+% \end{noindmacro}
+
 % \begin{noindmacro}{\fillast}
+%    \begin{macrocode}
+\newcommand*{\fillast}{}
+%    \end{macrocode}
+% \end{noindmacro}
+
 % \begin{noindmacro}{\filinner}
+%    \begin{macrocode}
+\newcommand*{\filinner}{}
+%    \end{macrocode}
+% \end{noindmacro}
+
 % \begin{noindmacro}{\filouter}
 %    \begin{macrocode}
-\newcommand*{\filright}{}
-\newcommand*{\filcenter}{}
-\newcommand*{\filleft}{}
-\newcommand*{\fillast}{}
-\newcommand*{\filinner}{}
 \newcommand*{\filouter}{}
 %    \end{macrocode}
 % \end{noindmacro}
-% \end{noindmacro}
-% \end{noindmacro}
-% \end{noindmacro}
-% \end{noindmacro}
-% \end{noindmacro}
 
+
 % \begin{noindmacro}{\wordsep}
 %    \begin{macrocode}
 \newcommand\wordsep{\fontdimen\tw@\font \@plus
@@ -32551,16 +34304,22 @@
 % \end{noindmacro}
 
 % \begin{noindmacro}{\iftitlemeasuring} \marg{true} \marg{false}
+%    \begin{macrocode}
+\newcommand{\iftitlemeasuring}[2]{#2}
+%    \end{macrocode}
+% \end{noindmacro}
+
 % \begin{noindmacro}{\assignpagestyle} \marg{command} \marg{pagestyle}
+%    \begin{macrocode}
+\newcommand{\assignpagestyle}[2]{#2}
+%    \end{macrocode}
+% \end{noindmacro}
+
 % \begin{noindmacro}{\titleclass} \marg{name} \oarg{startlevel} \marg{class} \oarg{cmd}
 %    \begin{macrocode}
-\newcommand{\iftitlemeasuring}[2]{#2}
-\newcommand{\assignpagestyle}[2]{#2}
 \NewDocumentCommand{\titleclass}{m o m o}
 %    \end{macrocode}
 % \end{noindmacro}
-% \end{noindmacro}
-% \end{noindmacro}
 
 % \iffalse
 %</titlesec>
@@ -32618,22 +34377,28 @@
 % \end{noindmacro}
 
 % \begin{noindmacro}{\thecontentslabel}
+%    \begin{macrocode}
+\newcommand*{\thecontentslabel}{thecontentslabel}
+%    \end{macrocode}
+% \end{noindmacro}
+
 % \begin{noindmacro}{\thecontentspage}
 %    \begin{macrocode}
-\newcommand*{\thecontentslabel}{thecontentslabel}
 \newcommand*{\thecontentspage}{thecontentspage}
 %    \end{macrocode}
 % \end{noindmacro}
+
+% \begin{noindmacro}{\contentslabel} \oarg{format} \marg{space}
+%    \begin{macrocode}
+\newcommand{\contentslabel}[2][]{\thecontentslabel}
+%    \end{macrocode}
 % \end{noindmacro}
 
-% \begin{noindmacro}{\contentslabel} \oarg{format} \marg{space}
 % \begin{noindmacro}{\contentspage} \oarg{format}
 %    \begin{macrocode}
-\newcommand{\contentslabel}[2][]{\thecontentslabel}
 \newcommand{\contentspage}[1][]{\thecontentspage}
 %    \end{macrocode}
 % \end{noindmacro}
-% \end{noindmacro}
 
 % \begin{noindmacro}{\contentspush} \marg{text}
 %    \begin{macrocode}
@@ -32648,16 +34413,22 @@
 % \end{noindmacro}
 
 % \begin{noindmacro}{\startcontents} \oarg{name}
+%    \begin{macrocode}
+\newcommand*{\startcontents}[1][]{}
+%    \end{macrocode}
+% \end{noindmacro}
+
 % \begin{noindmacro}{\stopcontents} \oarg{name}
+%    \begin{macrocode}
+\newcommand*{\stopcontents}[1][]{}
+%    \end{macrocode}
+% \end{noindmacro}
+
 % \begin{noindmacro}{\resumecontents} \oarg{name}
 %    \begin{macrocode}
-\newcommand*{\startcontents}[1][]{}
-\newcommand*{\stopcontents}[1][]{}
 \newcommand*{\resumecontents}[1][]{}
 %    \end{macrocode}
 % \end{noindmacro}
-% \end{noindmacro}
-% \end{noindmacro}
 
 % \begin{noindmacro}{\printcontents} \oarg{name} \marg{prefix} \marg{start} \marg{code}
 %    \begin{macrocode}
@@ -32666,16 +34437,22 @@
 % \end{noindmacro}
 
 % \begin{noindmacro}{\startlist} \oarg{name} \marg{list}
+%    \begin{macrocode}
+\newcommand{\startlist}[2][]{}
+%    \end{macrocode}
+% \end{noindmacro}
+
 % \begin{noindmacro}{\stoplist} \oarg{name} \marg{list}
+%    \begin{macrocode}
+\newcommand{\stoplist}[2][]{}
+%    \end{macrocode}
+% \end{noindmacro}
+
 % \begin{noindmacro}{\resumelist} \oarg{name} \marg{list}
 %    \begin{macrocode}
-\newcommand{\startlist}[2][]{}
-\newcommand{\stoplist}[2][]{}
 \newcommand{\resumelist}[2][]{}
 %    \end{macrocode}
 % \end{noindmacro}
-% \end{noindmacro}
-% \end{noindmacro}
 
 % \begin{noindmacro}{\printlist} \oarg{name} \marg{list} \marg{prefix} \marg{code}
 %    \begin{macrocode}
@@ -32897,9 +34674,9 @@
 \DeclareDocumentCommand{\@maketitle}{}{%
     \maketitlehooka
     {
-        \LWR at stoppars\LWR at htmltag{h1}
+        \LWR at stoppars\LWR at htmltag{\LWR at tagtitle}
         \@bspretitle \@title \@bsposttitle
-        \LWR at htmltag{/h1}\LWR at startpars
+        \LWR at htmltag{\LWR at tagtitleend}\LWR at startpars
     }
     \maketitlehookb
     {
@@ -33107,16 +34884,22 @@
 
 
 % \begin{noindmacro}{\cftmarktoc}
+%    \begin{macrocode}
+\newcommand*{\cftmarktoc}{}
+%    \end{macrocode}
+% \end{noindmacro}
+
 % \begin{noindmacro}{\cfttoctitlefont}
+%    \begin{macrocode}
+\newcommand*{\cfttoctitlefont}{}
+%    \end{macrocode}
+% \end{noindmacro}
+
 % \begin{noindmacro}{\cftaftertoctitle}
 %    \begin{macrocode}
-\newcommand*{\cftmarktoc}{}
-\newcommand*{\cfttoctitlefont}{}
 \newcommand*{\cftaftertoctitle}{}
 %    \end{macrocode}
 % \end{noindmacro}
-% \end{noindmacro}
-% \end{noindmacro}
 
 %    \begin{macrocode}
 \newlength{\cftbeforetoctitleskip}
@@ -33125,16 +34908,22 @@
 
 
 % \begin{noindmacro}{\cftmarklof}
+%    \begin{macrocode}
+\newcommand*{\cftmarklof}{}
+%    \end{macrocode}
+% \end{noindmacro}
+
 % \begin{noindmacro}{\cftloftitlefont}
+%    \begin{macrocode}
+\newcommand*{\cftloftitlefont}{}
+%    \end{macrocode}
+% \end{noindmacro}
+
 % \begin{noindmacro}{\cftafterloftitle}
 %    \begin{macrocode}
-\newcommand*{\cftmarklof}{}
-\newcommand*{\cftloftitlefont}{}
 \newcommand*{\cftafterloftitle}{}
 %    \end{macrocode}
 % \end{noindmacro}
-% \end{noindmacro}
-% \end{noindmacro}
 
 %    \begin{macrocode}
 \newlength{\cftbeforeloftitleskip}
@@ -33143,16 +34932,22 @@
 
 
 % \begin{noindmacro}{\cftmarklot}
+%    \begin{macrocode}
+\newcommand*{\cftmarklot}{}
+%    \end{macrocode}
+% \end{noindmacro}
+
 % \begin{noindmacro}{\cftlottitlefont}
+%    \begin{macrocode}
+\newcommand*{\cftlottitlefont}{}
+%    \end{macrocode}
+% \end{noindmacro}
+
 % \begin{noindmacro}{\cftafterlottitle}
 %    \begin{macrocode}
-\newcommand*{\cftmarklot}{}
-\newcommand*{\cftlottitlefont}{}
 \newcommand*{\cftafterlottitle}{}
 %    \end{macrocode}
 % \end{noindmacro}
-% \end{noindmacro}
-% \end{noindmacro}
 
 %    \begin{macrocode}
 \newlength{\cftbeforelottitleskip}
@@ -33161,16 +34956,22 @@
 
 
 % \begin{noindmacro}{\cftdot}
+%    \begin{macrocode}
+\newcommand*{\cftdot}{.}
+%    \end{macrocode}
+% \end{noindmacro}
+
 % \begin{noindmacro}{\cftdotsep}
+%    \begin{macrocode}
+\providecommand*{\cftdotsep}{1}
+%    \end{macrocode}
+% \end{noindmacro}
+
 % \begin{noindmacro}{\cftnodots}
 %    \begin{macrocode}
-\newcommand*{\cftdot}{.}
-\providecommand*{\cftdotsep}{1}
 \newcommand*{\cftnodots}{5000}
 %    \end{macrocode}
 % \end{noindmacro}
-% \end{noindmacro}
-% \end{noindmacro}
 
 % \begin{noindmacro}{\cftdotfill} \marg{sep}
 %    \begin{macrocode}
@@ -33179,13 +34980,16 @@
 % \end{noindmacro}
 
 % \begin{noindmacro}{\cftsetpnumwidth} \marg{length}
+%    \begin{macrocode}
+\newcommand*{\cftsetpnumwidth}[1]{}
+%    \end{macrocode}
+% \end{noindmacro}
+
 % \begin{noindmacro}{\cftsetrmarg} \marg{length}
 %    \begin{macrocode}
-\newcommand*{\cftsetpnumwidth}[1]{}
 \newcommand*{\cftsetrmarg}[1]{}
 %    \end{macrocode}
 % \end{noindmacro}
-% \end{noindmacro}
 
 % \begin{noindmacro}{\cftpnumalign} \marg{alignment}
 %    \begin{macrocode}
@@ -33389,8 +35193,7 @@
 %    \end{macrocode}
 % \end{noindmacro}
 
-
-% \cs{cftchapterprecis} from \pkg{tocloft}:
+% \begin{noindmacro}{\cftchapterprecis} \marg{text}
 %    \begin{macrocode}
 \newcommand{\cftchapterprecis}[1]{%
   \cftchapterprecishere{#1}
@@ -33404,6 +35207,7 @@
   }
 }
 %    \end{macrocode}
+% \end{noindmacro}
 
 % \iffalse
 %</tocloft>
@@ -33634,31 +35438,59 @@
 % Basic markup commands, using \CSS:
 %    \begin{macrocode}
 \NewDocumentCommand{\uline}{+m}{%
-\InlineClass{uline}{#1}%
+\LWR at HTMLtextstyle%
+    {text-decoration:underline;text-decoration-skip}%
+    {uline}{#1}%
 }
 
 \NewDocumentCommand{\uuline}{+m}{%
-\InlineClass{uuline}{#1}%
+\LWR at HTMLtextstyle%
+    {%
+        text-decoration:underline;text-decoration-skip;%
+        text-decoration-style:double%
+    }%
+    {uuline}{#1}%
 }
 
 \NewDocumentCommand{\uwave}{+m}{%
-\InlineClass{uwave}{#1}%
+\LWR at HTMLtextstyle%
+    {%
+        text-decoration:underline;text-decoration-skip;%
+        text-decoration-style:wavy%
+    }%
+    {uwave}{#1}%
 }
 
 \NewDocumentCommand{\sout}{+m}{%
-\InlineClass{sout}{#1}%
+\LWR at HTMLtextstyle%
+    {text-decoration:line-through}%
+    {sout}{#1}%
 }
 
 \NewDocumentCommand{\xout}{+m}{%
-\InlineClass{xout}{#1}%
+\LWR at HTMLtextstyle%
+    {text-decoration:line-through}%
+    {xout}{#1}%
 }
 
 \NewDocumentCommand{\dashuline}{+m}{%
-\InlineClass{dashuline}{#1}%
+\LWR at HTMLtextstyle%
+    {%
+        text-decoration:underline;%
+        text-decoration-skip;%
+        text-decoration-style:dashed%
+    }%
+    {dashuline}{#1}%
 }
 
 \NewDocumentCommand{\dotuline}{+m}{%
-\InlineClass{dotuline}{#1}%
+\LWR at HTMLtextstyle%
+    {%
+        text-decoration:underline;%
+        text-decoration-skip;%
+        text-decoration-style:dotted%
+    }%
+    {dotuline}{#1}%
 }
 %    \end{macrocode}
 %
@@ -33816,6 +35648,7 @@
  }
 }{}
 
+\LWR at traceinfo{Finished patching verse.}
 }% AfterEndPreamble
 %    \end{macrocode}
 % \end{environment}
@@ -33897,19 +35730,15 @@
 %    \begin{macrocode}
 \LWR at ProvidesPackageDrop{wrapfig}
 %    \end{macrocode}
-
-% Computed width of a wrapped object.
-%	Used to print the \HTML\ style.
+%
+%
+% \changes{v0.42}{2017/10/26}{\pkg{wrapfig}: If \texttt{FormatWP}
+%           add explicit HTML style.}
+%
 %    \begin{macrocode}
-\newlength{\LWR at wrapwidth}
-%    \end{macrocode}
-
-
-%    \begin{macrocode}
 \newcommand*{\LWR at wrapposition}{}
 
 \newcommand*{\LWR at subwrapfigure}[2]{%
-\LWR at maybeincthisfloat%
 \renewcommand*{\LWR at wrapposition}{}%
 \ifthenelse{%
     \equal{#1}{r}\OR\equal{#1}{R}\OR%
@@ -33917,16 +35746,16 @@
 }%
 {\renewcommand*{\LWR at wrapposition}{float:right}}%
 {\renewcommand*{\LWR at wrapposition}{float:left}}%
-\setlength{\LWR at wrapwidth}{#2}%
-\addtolength{\LWR at wrapwidth}{4em}%
+\setlength{\LWR at templengthone}{#2}%
 \uselengthunit{PT}%
-\LWR at forcenewpage
-\LWR at stoppars%
-\LWR at htmltag{div class="marginblock" id="autofloat-\arabic{LWR at thisfloat}"
-style="width:\rndprintlength{\LWR at wrapwidth} ; %
-\LWR at wrapposition"%
+\LWR at BlockClassWP{%
+    width:\rndprintlength{\LWR at templengthone}; \LWR at wrapposition; %
+    margin:10pt%
 }%
-\LWR at startpars
+{%
+    width:\rndprintlength{\LWR at templengthone}; \LWR at wrapposition%
+}%
+{marginblock}%
 }
 
 
@@ -33936,7 +35765,7 @@
 \captionsetup{type=figure}%
 }
 {%
-\LWR at htmldivclassend{div}
+\endLWR at BlockClassWP%
 }
 
 
@@ -33946,7 +35775,7 @@
 \captionsetup{type=table}%
 }
 {%
-\LWR at htmldivclassend{div}
+\endLWR at BlockClassWP%
 }
 
 
@@ -33956,7 +35785,7 @@
 \captionsetup{type=#1}%
 }
 {%
-\LWR at htmldivclassend{div}
+\endLWR at BlockClassWP%
 }
 
 \newlength{\wrapoverhang}
@@ -33982,8 +35811,6 @@
 % \DescribePackage{xcolor}
 % \pkg{xcolor} is supported by lwarp.
 %
-% \limitsxcolor
-%
 % \changes{v0.36}{2017/08/10}{\pkg{xcolor}: Uses \cs{fboxrule} and \cs{fboxsep}.}
 % \changes{v0.36}{2017/08/10}{\pkg{xcolor}: Added \cs{fcolorboxBlock}, \cs{colorboxBlock}.}
 % \changes{v0.36}{2017/08/10}{\pkg{xcolor}: Fix: Background \protect\texttt{none} in print mode.}
@@ -33990,7 +35817,11 @@
 % \changes{v0.36}{2017/08/12}{\pkg{xcolor}: \cs{fcolorbox} etc. now work inside \env{lateximage}.}
 %
 %
+% \subsection{Limitations}
 %
+% \limitsxcolor
+%
+%
 % \subsection{Xcolor definitions: location and timing}
 %
 % The \pkg{lwarp} core and its \pkg{lwarp-xcolor} package are tightly integrated
@@ -34109,7 +35940,7 @@
 % \end{description}
 %
 %
-% \subsection{Code}
+% \subsection{Package loading}
 %
 % \codehtml
 %    \begin{macrocode}
@@ -34119,7 +35950,10 @@
 %    \begin{macrocode}
 \begin{warpHTML}
 %    \end{macrocode}
-
+%
+%
+% \subsection{Remembering and restoring original definitions}
+%
 % Remember the following print-mode actions to be restored
 % when inside a \env{lateximage} environment:
 %    \begin{macrocode}
@@ -34147,6 +35981,9 @@
 }
 %    \end{macrocode}
 %
+%
+% \subsection{HTML color style}
+%
 % \begin{noindmacro}{\LWR at tempcolor}
 % The color converted to \HTML\ colorspace.
 %    \begin{macrocode}
@@ -34183,8 +36020,10 @@
 % \end{noindmacro}
 %
 %
+% \subsection{HTML border}
+%
 % \begin{noindmacro}{\LWR at borderpadding} \marg{colorstyle} \marg{color}
-% Prints the \HTML attributes for a black border and padding.
+% Prints the \HTML\ attributes for a black border and padding.
 %
 % \cs{LWR at forceminwidth} must be used first in order to set the border width.
 %
@@ -34198,8 +36037,8 @@
 % \end{noindmacro}
 %
 %
+% \subsection{High-level macros}
 %
-%
 % \DescribeMacro{\color}
 % \cs{color} appears in the \LaTeX{} \PDF\ output,
 % but is ignored by |pdftotext| and thus is ignored in the \HTML\ file.

Modified: trunk/Master/texmf-dist/source/latex/lwarp/lwarp.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/lwarp/lwarp.ins	2017-10-30 20:40:11 UTC (rev 45647)
+++ trunk/Master/texmf-dist/source/latex/lwarp/lwarp.ins	2017-10-30 20:40:38 UTC (rev 45648)
@@ -126,6 +126,7 @@
 \file{lwarp-midfloat.sty}{\from{lwarp.dtx}{midfloat}}
 \file{lwarp-metalogo.sty}{\from{lwarp.dtx}{metalogo}}
 \file{lwarp-moreverb.sty}{\from{lwarp.dtx}{moreverb}}
+\file{lwarp-morewrites.sty}{\from{lwarp.dtx}{morewrites}}
 \file{lwarp-mparhack.sty}{\from{lwarp.dtx}{mparhack}}
 \file{lwarp-multicol.sty}{\from{lwarp.dtx}{multicol}}
 \file{lwarp-multirow.sty}{\from{lwarp.dtx}{multirow}}
@@ -138,6 +139,7 @@
 \file{lwarp-nopageno.sty}{\from{lwarp.dtx}{nopageno}}
 \file{lwarp-nowidow.sty}{\from{lwarp.dtx}{nowidow}}
 \file{lwarp-ntheorem.sty}{\from{lwarp.dtx}{ntheorem}}
+\file{lwarp-overpic.sty}{\from{lwarp.dtx}{overpic}}
 \file{lwarp-pagenote.sty}{\from{lwarp.dtx}{pagenote}}
 \file{lwarp-paralist.sty}{\from{lwarp.dtx}{paralist}}
 \file{lwarp-parskip.sty}{\from{lwarp.dtx}{parskip}}

Modified: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-algorithmicx.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-algorithmicx.sty	2017-10-30 20:40:11 UTC (rev 45647)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-algorithmicx.sty	2017-10-30 20:40:38 UTC (rev 45648)
@@ -26,6 +26,13 @@
 \LWR at htmltagc{%
 span style="width:\rndprintlength{\ALG at thistlm}; display:inline-block;"%
 }%
+\ifbool{FormatWP}{%
+\setlength{\LWR at templengthone}{\the\ALG at thistlm}%
+\whiledo{\lengthtest{\LWR at templengthone>1em}}{%
+\quad%
+\addtolength{\LWR at templengthone}{-1em}%
+}%
+}{}%
 \LWR at htmltagc{/span}%
 }%
 \let\origComment\Comment%

Modified: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-epigraph.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-epigraph.sty	2017-10-30 20:40:11 UTC (rev 45647)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-epigraph.sty	2017-10-30 20:40:38 UTC (rev 45648)
@@ -18,7 +18,6 @@
 
 
 
-
 \LWR at ProvidesPackageDrop{epigraph}
 
 \newcommand{\qitem}[2]
@@ -25,7 +24,9 @@
 {
 \begin{BlockClass}{qitem}
 #1
-\begin{BlockClass}{epigraphsource}
+\ifbool{FormatWP}
+{\begin{BlockClass}[border-top:1px solid gray]{epigraphsource}}
+{\begin{BlockClass}{epigraphsource}}
 #2
 \end{BlockClass}
 \end{BlockClass}
@@ -33,14 +34,14 @@
 
 \newcommand{\epigraph}[2]
 {
-\begin{BlockClass}{epigraph}
+\begin{LWR at BlockClassWP}{text-align:right}{}{epigraph}
 \qitem{#1}{#2}
-\end{BlockClass}
+\end{LWR at BlockClassWP}
 }
 
 \newenvironment*{epigraphs}
-{\BlockClass{epigraph}}
-{\endBlockClass}
+{\LWR at BlockClassWP{text-align:right}{}{epigraph}}
+{\endLWR at BlockClassWP}
 \newlength{\epigraphwidth}
 \setlength{\epigraphwidth}{.5\linewidth}
 \newenvironment*{flushepinormal}{}{}

Modified: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-fancybox.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-fancybox.sty	2017-10-30 20:40:11 UTC (rev 45647)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-fancybox.sty	2017-10-30 20:40:38 UTC (rev 45648)
@@ -17,14 +17,26 @@
 %% version 2005/12/01 or later.
 \begin{warpHTML}
 \LWR at ProvidesPackagePass{fancybox}
-\renewcommand*{\@shadowbox}[1]{\InlineClass{shadowbox}{#1}}
+\renewcommand*{\@shadowbox}[1]{%
+\ifbool{FormatWP}%
+{\InlineClass[border:1px solid black]{shadowbox}{#1}}%
+{\InlineClass{shadowbox}{#1}}%
+}
 
-\renewcommand*{\@doublebox}[1]{\InlineClass{doublebox}{#1}}
+\renewcommand*{\@doublebox}[1]{%
+\ifbool{FormatWP}%
+{\InlineClass[border:1px double black]{doublebox}{#1}}%
+{\InlineClass{doublebox}{#1}}%
+}
 
 \renewcommand*{\@ovalbox}[2]{%
-\ifthenelse{\isequivalentto{#1}{\thinlines}}
-{\InlineClass{ovalbox}{#2}}
-{\InlineClass{Ovalbox}{#2}}
+\ifbool{FormatWP}%
+{\InlineClass[border:1px solid black; border-radius:1ex]{ovalbox}{#2}}%
+{%
+    \ifthenelse{\isequivalentto{#1}{\thinlines}}%
+    {\InlineClass{ovalbox}{#2}}%
+    {\InlineClass{Ovalbox}{#2}}%
+}%
 }
 \let\LWR at origSbox\Sbox
 
@@ -38,9 +50,9 @@
 
 \csgpreto{Beqnarray*}{\boolfalse{LWR at numbereqnarray}}
 \renewcommand{\GenericCaption}[1]{%
-\LWR at htmlblocktag{figcaption}%
+\LWR at figcaption%
 #1%
-\LWR at htmlblocktag{/figcaption}%
+\endLWR at figcaption%
 }
 \RenewDocumentEnvironment{Btrivlist}{m o}
 {\begin{BlockClass}{Btrivlist}\tabular{#1}}

Modified: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-floatflt.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-floatflt.sty	2017-10-30 20:40:11 UTC (rev 45647)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-floatflt.sty	2017-10-30 20:40:38 UTC (rev 45648)
@@ -16,25 +16,28 @@
 %% and version 1.3 or later is part of all distributions of LaTeX
 %% version 2005/12/01 or later.
 \LWR at ProvidesPackageDrop{floatflt}
-\NewDocumentEnvironment{KFLTfloatflt at marginfloat}{O{-1.2ex} m}
-{% start
-\LWR at maybeincthisfloat%
-\LWR at forcenewpage
-\LWR at stoppars%
-\LWR at htmltag{div class="marginblock" id="autofloat-\arabic{LWR at thisfloat}"}
-\LWR at startpars%
+\NewDocumentEnvironment{KFLTfloatflt at marginfloat}{O{-1.2ex} m m}
+{%
+\setlength{\LWR at templengthone}{#3}%
+\uselengthunit{PT}%
+\LWR at BlockClassWP{%
+    float:right; %
+    width:\rndprintlength{\LWR at templengthone}; %
+    margin:10pt%
+}{%
+    width:\rndprintlength{\LWR at templengthone}%
+}%
+{marginblock}%
 \captionsetup{type=#2}%
 }
-{
-\LWR at htmldivclassend{div}
+{%
+\endLWR at BlockClassWP%
 }
-
 \DeclareDocumentEnvironment{floatingfigure}{o m}
-  {\begin{KFLTfloatflt at marginfloat}{figure}}
+  {\begin{KFLTfloatflt at marginfloat}{figure}{#2}}
   {\end{KFLTfloatflt at marginfloat}}
-
-\DeclareDocumentEnvironment{floatingtable}{o +m}
-  {\begin{KFLTfloatflt at marginfloat}{table}#2}
+\DeclareDocumentEnvironment{floatingtable}{o}
+  {\begin{KFLTfloatflt at marginfloat}{table}{1.5in}}
   {\end{KFLTfloatflt at marginfloat}}
 \endinput
 %%

Modified: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-graphics.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-graphics.sty	2017-10-30 20:40:11 UTC (rev 45647)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-graphics.sty	2017-10-30 20:40:38 UTC (rev 45648)
@@ -114,6 +114,7 @@
 \define at key{igraph}{read}{}
 \define at key{igraph}{command}{}
 
+
 \newcommand*{\LWR at rotstyle}[2]{%
  #1transform:rotate(-#2deg);
 }
@@ -128,6 +129,14 @@
 
 \def\LWR at opacity{1}
 
+\newsavebox{\LWR at imagesizebox}
+
+\let\LWR at origGin@setfile\Gin at setfile
+
+\AtBeginDocument{
+\define at key{Gin}{class}{}
+}
+
 \NewDocumentCommand{\LWR at includegraphicsb}{s o o m}
 {%
 \LWR at traceinfo{LWR at includegraphicsb #4}%
@@ -142,11 +151,13 @@
         \setlength{\textheight}{9in}%
     }%
 }{}%
+\begingroup%
 \renewcommand*{\Gin at setfile}[3]{%
 \LWR at traceinfo{Gin at setfile ##3}%
 \xdef\LWR at parsedfilename{##3}%
 }%
-\Ginclude at graphics{\detokenize{#4}}%
+\Ginclude at graphics{\detokenize\expandafter{#4}}%
+\endgroup%
 \filename at parse{\LWR at parsedfilename}%
 \large%
 \setlength{\LWR at igwidth}{0pt}%
@@ -163,6 +174,46 @@
 {\setkeys{igraph}{#2}}%
 {\setkeys{igraph}{}}%
 }%
+\ifbool{FormatWP}{%
+    \begingroup%
+    \DeclareGraphicsExtensions{.pdf,.PDF,.gif,.GIF,.png,.PNG,.jpg,.JPG,.jpeg,.JPEG}%
+    \define at key{Gin}{angle}{}%
+    \IfBooleanTF{#1}%
+    {% starred
+        \IfValueTF{#3}%
+        {%
+            \global\sbox{\LWR at imagesizebox}{\LWR at origincludegraphics*[#2][#3]{#4}}%
+        }%
+        {%
+            \IfValueTF{#2}%
+            {%
+                \global\sbox{\LWR at imagesizebox}{\LWR at origincludegraphics*[#2]{#4}}%
+            }{%
+                \global\sbox{\LWR at imagesizebox}{\LWR at origincludegraphics*{#4}}%
+            }%
+        }%
+    }% starred
+    {% not starred
+        \IfValueTF{#3}%
+        {%
+            \global\sbox{\LWR at imagesizebox}{\LWR at origincludegraphics[#2][#3]{#4}}%
+        }%
+        {%
+            \IfValueTF{#2}%
+            {%
+                \global\sbox{\LWR at imagesizebox}{\LWR at origincludegraphics[#2]{#4}}%
+            }{%
+                \global\sbox{\LWR at imagesizebox}{\LWR at origincludegraphics{#4}}%
+            }%
+        }%
+    }% not starred
+    \endgroup%
+    \uselengthunit{PT}%
+    \settowidth{\LWR at igwidth}{\usebox{\LWR at imagesizebox}}%
+    \global\renewcommand*{\LWR at igwidthstyle}{width:\rndprintlength{\LWR at igwidth}}%
+    \settoheight{\LWR at igheight}{\usebox{\LWR at imagesizebox}}%
+    \global\renewcommand*{\LWR at igheightstyle}{height:\rndprintlength{\LWR at igheight}}%
+}{}%
 \LWR at traceinfo{LWR at includegraphicsb: about to create href}%
 \href{\LWR at parsedfilename}%
 {% start of href
@@ -212,9 +263,12 @@
 
 
 
+\AtBeginDocument{
+
+\LWR at traceinfo{Patching includegraphics.}
+
 \LetLtxMacro\LWR at origincludegraphics\includegraphics
 
-\AtBeginDocument{
 \renewcommand*{\includegraphics}
 {%
 \LWR at traceinfo{includegraphics}
@@ -225,6 +279,7 @@
 }% includegraphics
 }% AtBeginDocument
 
+
 \newcommand*{\LWR at rotboxorigin}{}
 \newcommand*{\LWR at originname}[1]{%
 \ifthenelse{\equal{#1}{t}}{top}{}%
@@ -292,7 +347,6 @@
 \AtBeginDocument{
 \renewcommand{\resizebox}[3]{#3}
 }
-
 \endinput
 %%
 %% End of file `lwarp-graphics.sty'.

Modified: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-keyfloat.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-keyfloat.sty	2017-10-30 20:40:11 UTC (rev 45647)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-keyfloat.sty	2017-10-30 20:40:38 UTC (rev 45648)
@@ -26,24 +26,20 @@
 
 \NewEnviron{KFLT at boxinner}
 {%
-\LWR at traceinfo{kflt at boxinner}%
+\LWR at traceinfo{KFLT at boxinner}%
 \LWR at stoppars%
 \KFLT at frame{\BODY}%
 \LWR at startpars%
-\LWR at traceinfo{ended kflt at boxinner}%
+\LWR at traceinfo{KFLT at boxinner: done}%
 }
 
 \DeclareDocumentEnvironment{KFLT at marginfloat}{O{-1.2ex} m}
-{% start
-\LWR at maybeincthisfloat%
-\LWR at forcenewpage
-\LWR at stoppars%
-\LWR at htmltag{div class="marginblock" id="autofloat-\arabic{LWR at thisfloat}"}
-\LWR at startpars%
+{%
+\LWR at BlockClassWP{float:right; width:2in; margin:10pt}{}{marginblock}%
 \captionsetup{type=#2}%
 }
-{
-\LWR at htmldivclassend{div}
+{%
+\endLWR at BlockClassWP%
 }
 
 \DeclareDocumentEnvironment{marginfigure}{o}
@@ -56,10 +52,20 @@
 
 \DeclareDocumentEnvironment{keywrap}{m +m}
 {%
-\begin{BlockClass}{marginblock}
-\setlength{\linewidth}{#1}
+\LWR at ensuredoingapar%
+\setlength{\LWR at templengthone}{#1}%
+\uselengthunit{PT}%
+\begin{LWR at BlockClassWP}{%
+    float:right; width:\rndprintlength{\LWR at templengthone}; %
+    margin:10pt%
+}%
+{%
+    width:\rndprintlength{\LWR at templengthone}%
+}%
+{marginblock}%
+\setlength{\linewidth}{.95\LWR at templengthone}%
 #2%
-\end{BlockClass}
+\end{LWR at BlockClassWP}%
 }
 {%
 }

Modified: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-mdframed.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-mdframed.sty	2017-10-30 20:40:11 UTC (rev 45647)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-mdframed.sty	2017-10-30 20:40:38 UTC (rev 45648)
@@ -19,7 +19,6 @@
 
 \RequirePackage{xcolor}% for \convertcolorspec
 \LWR at ProvidesPackageDrop{mdframed}
-
 \LWR at origRequirePackage{amsthm}
 \LWR at origRequirePackage[framemethod=none]{mdframed}
 \mdfsetup{
@@ -36,7 +35,6 @@
 \newcommand*{\LWR at mdfprintlength}[1]{%
 \rndprintlength{\csuse{mdf@#1 at length}}
 }
-
 \newcommand*{\LWR at mdframedstart}{%
 \LWR at stoppars%
 \uselengthunit{PT}%

Modified: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-moreverb.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-moreverb.sty	2017-10-30 20:40:11 UTC (rev 45647)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-moreverb.sty	2017-10-30 20:40:38 UTC (rev 45648)
@@ -52,21 +52,7 @@
 \LWR at afterendverbatim%
 }
 
-\renewcommand{\listinglabel}[1]{\InlineClass{listinglabel}{\the#1}}
 
-\def\thelisting at line{%
-\@tempcnta=\listing at line%
-\divide\@tempcnta\listing at step \multiply\@tempcnta\listing at step%
-\ifnum\listing at line=\@ne%
-\listinglabel\listing at line%
-\else%
-\ifnum\@tempcnta=\listing at line%
-\listinglabel\listing at line%
-\else%
-\InlineClass{listinglabel}{}%
-\fi%
-\fi}
-
 \LetLtxMacro\LWRMV@@listinginput\@listinginput
 
 \renewcommand{\@listinginput}[3][]{

Added: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-morewrites.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-morewrites.sty	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-morewrites.sty	2017-10-30 20:40:38 UTC (rev 45648)
@@ -0,0 +1,26 @@
+%%
+%% This is file `lwarp-morewrites.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% lwarp.dtx  (with options: `morewrites')
+%% This is a generated file.
+%% Copyright 2016-2017 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{morewrites}
+
+\LWR at loadbefore{morewrites}
+
+\endinput
+%%
+%% End of file `lwarp-morewrites.sty'.


Property changes on: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-morewrites.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-multirow.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-multirow.sty	2017-10-30 20:40:11 UTC (rev 45647)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-multirow.sty	2017-10-30 20:40:38 UTC (rev 45648)
@@ -40,7 +40,10 @@
 \LWR at addleftmostbartag%
 \LWR at printbartag{\theLWR at tablecolspos}%
 "%
+\LWR at tdstartstyles%
 \LWR at addcmidrulewidth%
+\LWR at addformatwpalignment%
+\LWR at tdendstyles%
 }%
 \LWR at getexparray{LWR at colbeforespec}{\theLWR at tablecolspos}%
 \begingroup\LetLtxMacro{\\}{\LWR at endofline}#6\endgroup%

Modified: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-ntheorem.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-ntheorem.sty	2017-10-30 20:40:11 UTC (rev 45647)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-ntheorem.sty	2017-10-30 20:40:38 UTC (rev 45648)
@@ -48,7 +48,6 @@
         }
 }
 
-
 \gdef\@xnthm#1#2[#3]{%
   \ifthm at tempif
      \csedef{LWR at thmstyle#1}{\LWR at newtheoremstyle}% new
@@ -126,7 +125,6 @@
 }%
 {\PackageError{\basename}{Theorem style #1 already defined}\@eha}
 }
-
 \renewtheoremstyle{plain}%
   {\item[\hskip\labelsep \theorem at headerfont
     \InlineClass{theoremheaderplain}{##1\ ##2\theorem at separator}]}%
@@ -140,7 +138,8 @@
     ]}%
   {\item[
     \hskip\labelsep \theorem at headerfont
-    \InlineClass{theoremheaderbreak}{##1\ ##2\ (##3)\theorem at separator}\newline
+    \InlineClass{theoremheaderbreak}%
+        {##1\ ##2\ (##3)\theorem at separator}\newline
     ]}
 
 \renewtheoremstyle{change}%
@@ -153,12 +152,14 @@
 
 \renewtheoremstyle{changebreak}%
   {\item[
-            \hskip\labelsep \theorem at headerfont
-            \InlineClass{theoremheaderchangebreak}{##2\ ##1\theorem at separator}\newline
+        \hskip\labelsep \theorem at headerfont
+        \InlineClass{theoremheaderchangebreak}%
+            {##2\ ##1\theorem at separator}\newline
     ]}%
   {\item[
-            \hskip\labelsep \theorem at headerfont
-            \InlineClass{theoremheaderchangebreak}{##2\ ##1\ (##3)\theorem at separator}\newline
+        \hskip\labelsep \theorem at headerfont
+        \InlineClass{theoremheaderchangebreak}%
+            {##2\ ##1\ (##3)\theorem at separator}\newline
     ]}
 
 \renewtheoremstyle{margin}%
@@ -171,10 +172,12 @@
 
 \renewtheoremstyle{marginbreak}%
   {\item[\hskip\labelsep\theorem at headerfont
-    \InlineClass{theoremheadermarginbreak}{##2 \qquad ##1\theorem at separator}\newline
+    \InlineClass{theoremheadermarginbreak}%
+        {##2 \qquad ##1\theorem at separator}\newline
     ]}%
   {\item[\hskip\labelsep\theorem at headerfont
-    \InlineClass{theoremheadermarginbreak}{##2 \qquad ##1\ (##3)\theorem at separator}\newline
+    \InlineClass{theoremheadermarginbreak}%
+        {##2 \qquad ##1\ (##3)\theorem at separator}\newline
     ]}
 
 \renewtheoremstyle{nonumberplain}%
@@ -214,6 +217,8 @@
         \InlineClass{theoremheadersc}{##1\theorem at separator}]}%
     {\item[\theorem at headerfont\hskip \labelsep
         \InlineClass{theoremheadersc}{##1\ (##3)\theorem at separator}]}
+}% not amsthm
+\ifbool{LWR at ntheoremamsthm}{}{%
     \theoremstyle{plainupright}
     \theorembodyfont{\upshape}
     \theoremsymbol{\HTMLunicode{25A1}}% UTF-8 white box
@@ -393,9 +398,7 @@
 \ifbool{LWR at ntheoremmarks}{\global\setendmarktrue}{}%
 \endBlockClass%
 }
-
 \gdef\NoEndMark{\global\setendmarkfalse}
-
 \renewcommand{\thm@@thmline at noname}[4]{%
 \hypertocfloat{1}{theorem}{thm}{#2 #3}{}%
 }
@@ -404,7 +407,6 @@
 \hypertocfloat{1}{theorem}{thm}{#1 #2 #3}{}%
 }
 \def\thm@@thmline{\thm@@thmline at name}
-
 \def\listtheorems#1{
 \LWR at htmlelementclass{nav}{lothm}%
 \begingroup
@@ -413,8 +415,6 @@
 \endgroup
 \LWR at htmlelementclassend{nav}{lothm}%
 }
-
-
 \newcommand{\qed}{\qquad\the\qedsymbol}
 
 \AtBeginDocument{

Added: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-overpic.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-overpic.sty	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-overpic.sty	2017-10-30 20:40:38 UTC (rev 45648)
@@ -0,0 +1,42 @@
+%%
+%% This is file `lwarp-overpic.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% lwarp.dtx  (with options: `overpic')
+%% This is a generated file.
+%% Copyright 2016-2017 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{overpic}
+
+\newcommand*{\overpicfontsize}{12}
+\newcommand*{\overpicfontskip}{14}
+
+\BeforeBeginEnvironment{overpic}{%
+    \lateximage%
+    \fontsize{\overpicfontsize}{\overpicfontskip}%
+    \selectfont%
+}
+
+\AfterEndEnvironment{overpic}{\endlateximage}
+
+\BeforeBeginEnvironment{Overpic}{%
+    \lateximage%
+    \fontsize{\overpicfontsize}{\overpicfontskip}%
+    \selectfont%
+}
+
+\AfterEndEnvironment{Overpic}{\endlateximage}
+
+\endinput
+%%
+%% End of file `lwarp-overpic.sty'.


Property changes on: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-overpic.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-realscripts.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-realscripts.sty	2017-10-30 20:40:11 UTC (rev 45647)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-realscripts.sty	2017-10-30 20:40:38 UTC (rev 45648)
@@ -16,12 +16,6 @@
 %% and version 1.3 or later is part of all distributions of LaTeX
 %% version 2005/12/01 or later.
 \LWR at ProvidesPackageDrop{realscripts}
-\let\LWR at origtextsuperscript\textsuperscript
-\let\LWR at origtextsubscript\textsubscript
-
-\RenewDocumentCommand{\textsuperscript}{s}{\LWR at origtextsuperscript}
-\RenewDocumentCommand{\textsubscript}{s}{\LWR at origtextsubscript}
-
 \let\realsuperscript\textsuperscript
 \let\realsubscript\textsubscript
 

Modified: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-sidenotes.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-sidenotes.sty	2017-10-30 20:40:11 UTC (rev 45647)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-sidenotes.sty	2017-10-30 20:40:38 UTC (rev 45648)
@@ -38,15 +38,11 @@
 }
 \NewDocumentEnvironment{KFLTsidenotes at marginfloat}{O{-1.2ex} m}
 {% start
-\LWR at maybeincthisfloat%
-\LWR at forcenewpage
-\LWR at stoppars%
-\LWR at htmltag{div class="marginblock" id="autofloat-\arabic{LWR at thisfloat}"}
-\LWR at startpars%
+\LWR at BlockClassWP{float:right; width:2in; margin:10pt}{}{marginblock}%
 \captionsetup{type=#2}%
 }
-{
-\LWR at htmldivclassend{div}
+{%
+\endLWR at BlockClassWP%
 }
 
 \RenewDocumentEnvironment{marginfigure}{o}

Modified: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-siunitx.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-siunitx.sty	2017-10-30 20:40:11 UTC (rev 45647)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-siunitx.sty	2017-10-30 20:40:38 UTC (rev 45648)
@@ -26,7 +26,47 @@
 \DeclareSIUnit\hartree{\textit{E}\textsubscript{h}}
 }% AtBeginDocument
 
+\ExplSyntaxOn
+\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
+    \hbox_set:Nn \l__siunitx_tmp_box
+      {
+        \ensuremath
+          {
+            \use:c { math #1 }
+              {
+                \int_gset:cn { c__siunitx_math #1 _int } { \fam }
+              }
+          }
+      }
+  \group_end:
+    \LWR at traceinfo{sunitx set math fam: done}
+}
 
+\cs_undefine:N \__siunitx_combined_output:n
+\cs_new_protected:Npn \__siunitx_combined_output:n #1 {
+    \group_begin:
+    \LetLtxMacro\@ensuredmath\LWR at origensuredmath
+  \bool_if:NTF \l__siunitx_number_parse_bool
+    {
+      \tl_clear:N \l__siunitx_number_out_tl
+      \bool_set_false:N \l__siunitx_number_compound_bool
+      \__siunitx_number_output_parse:n {#1}
+    }
+    {
+      \__siunitx_unit_output_pre_print:
+      \__siunitx_print:nn { number } { \ensuremath {#1} }
+      \__siunitx_unit_output_print:
+    }
+    \group_end:
+}
+
+\ExplSyntaxOff
+
 \endinput
 %%
 %% End of file `lwarp-siunitx.sty'.

Modified: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-soul.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-soul.sty	2017-10-30 20:40:11 UTC (rev 45647)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-soul.sty	2017-10-30 20:40:38 UTC (rev 45648)
@@ -22,28 +22,37 @@
 \newcommand*{\LWR at soulstcolor}{}
 
 \newcommand*{\LWR at soulhlcolor}{}
-\newcommand{\so}[1]{\InlineClass{letterspacing}{#1}}
-\newcommand{\caps}[1]{\InlineClass{capsspacing}{#1}}
-\newcommand{\LWR at soulcolor}[4]{%
+\newcommand{\so}[1]{%
+\LWR at HTMLtextstyle{letter-spacing:.2ex}{letterspacing}{#1}%
+}
+
+\newcommand{\caps}[1]{%
+\LWR at HTMLtextstyle%
+    {font-variant:small-caps;letter-spacing:.1ex}%
+    {capsspacing}{#1}%
+}
+\newcommand{\LWR at soulcolor}[5]{%
 \ifcsempty{#2}%
+{\LWR at HTMLtextstyle{#5}{#3}{#1}}%
 {%
-\InlineClass{#3}{#1}}%
-{%
-\convertcolorspec{named}{\csuse{#2}}{HTML}\LWR at tempcolor%
-\InlineClass[#4: \#\LWR at tempcolor]{#3}{#1}%
+    \convertcolorspec{named}{\csuse{#2}}{HTML}\LWR at tempcolor%
+    \LWR at HTMLtextstyle{#5;#4:\#\LWR at tempcolor}{#3}{#1}%
 }%
 }
 
 \newcommand{\ul}[1]{%
 \LWR at soulcolor{#1}{LWR at soululcolor}{uline}{text-decoration-color}%
+    {text-decoration:underline;text-decoration-skip;}%
 }
 
 \newcommand{\st}[1]{
 \LWR at soulcolor{#1}{LWR at soulstcolor}{sout}{text-decoration-color}%
+    {text-decoration:line-through}%
 }
 
 \newcommand{\hl}[1]{
 \LWR at soulcolor{#1}{LWR at soulhlcolor}{highlight}{background-color}%
+    {background:\#F8E800}
 }
 \newcommand*{\soulaccent}[1]{}
 \newcommand*{\soulregister}[2]{}

Modified: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-subfig.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-subfig.sty	2017-10-30 20:40:11 UTC (rev 45647)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-subfig.sty	2017-10-30 20:40:38 UTC (rev 45648)
@@ -119,12 +119,12 @@
     \@ifundefined{FBsc at max}%
         {
 \LWR at traceinfo{sfsubcap B1}% new
-            \LWR at htmlblocktag{figcaption}% new
+            \LWR at figcaption% new
             \caption at make
                 {\@nameuse{sub\@captype name}}%
                 {\@nameuse{thesub\@captype}}%
                 {#3}
-            \LWR at htmlblocktag{/figcaption}% new
+            \LWR at figcaption% new
 \LWR at traceinfo{sfsubcap B2}% new
         }%
         {\dimen@\ht0%

Modified: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-textcomp.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-textcomp.sty	2017-10-30 20:40:11 UTC (rev 45647)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-textcomp.sty	2017-10-30 20:40:38 UTC (rev 45648)
@@ -30,6 +30,7 @@
 \let\LWR at origtextnaira\textnaira
 \let\LWR at origtextpeso\textpeso
 \let\LWR at origtextrecipe\textrecipe
+\let\LWR at origtextinterrobangdown\textinterrobangdown
 \let\LWR at origtextpertenthousand\textpertenthousand
 \let\LWR at origtextbaht\textbaht
 \let\LWR at origtextdiscount\textdiscount
@@ -63,6 +64,7 @@
 \renewcommand*{\textnaira}{\HTMLunicode{20A6}}
 \renewcommand*{\textpeso}{\HTMLunicode{20B1}}
 \renewcommand*{\textrecipe}{\HTMLunicode{211E}}
+\renewcommand*{\textinterrobangdown}{\HTMLunicode{2E18}}
 \renewcommand*{\textpertenthousand}{\HTMLunicode{2031}}
 \renewcommand*{\textbaht}{\HTMLunicode{0E3F}}
 \renewcommand*{\textdiscount}{\%}
@@ -81,6 +83,7 @@
 \renewcommand*{\textnaira}{₦}
 \renewcommand*{\textpeso}{₱}
 \renewcommand*{\textrecipe}{℞}
+\renewcommand*{\textinterrobangdown}{⸘}
 \renewcommand*{\textpertenthousand}{‱}
 \renewcommand*{\textbaht}{฿}
 \renewcommand*{\textdiscount}{\%}
@@ -117,6 +120,7 @@
 \let\textnaira\LWR at origtextnaira%
 \let\textpeso\LWR at origtextpeso%
 \let\textrecipe\LWR at origtextrecipe%
+\let\textinterrobangdown\LWR at origtextinterrobangdown%
 \let\textpertenthousand\LWR at origtextpertenthousand%
 \let\textbaht\LWR at origtextbaht%
 \let\textdiscount\LWR at origtextdiscount%

Modified: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-theorem.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-theorem.sty	2017-10-30 20:40:11 UTC (rev 45647)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-theorem.sty	2017-10-30 20:40:38 UTC (rev 45648)
@@ -18,6 +18,7 @@
 
 \LWR at ProvidesPackagePass{theorem}
 
+
 \newcommand{\LWR at newtheoremstyle}{plain}
 
 \gdef\theoremstyle#1{%

Modified: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-titleps.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-titleps.sty	2017-10-30 20:40:11 UTC (rev 45647)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-titleps.sty	2017-10-30 20:40:38 UTC (rev 45648)
@@ -19,20 +19,25 @@
 
 \LWR at ProvidesPackageDrop{titleps}
 \NewDocumentCommand{\newpagestyle}{m o m}{}
+
 \NewDocumentCommand{\renewpagestyle}{m o m}{}
 
 \NewDocumentCommand{\sethead}{o o o m m m}{}
+
 \NewDocumentCommand{\setfoot}{o o o m m m}{}
 
 \NewDocumentCommand{\settitlemarks}{s m}{}
 
 \newcommand*{\headrule}{}
+
 \newcommand*{\footrule}{}
 
 \newcommand*{\setheadrule}[1]{}
+
 \newcommand*{\setfootrule}[1]{}
 
 \newcommand*{\makeheadrule}{}
+
 \newcommand*{\makefootrule}{}
 
 \newcommand{\setmarkboth}[1]{}
@@ -40,10 +45,15 @@
 \NewDocumentCommand{\widenhead}{s o o m m}{}
 
 \newcommand*{\bottitlemarks}{}
+
 \newcommand*{\toptitlemarks}{}
+
 \newcommand*{\firsttitlemarks}{}
+
 \newcommand*{\nexttoptitlemarks}{}
+
 \newcommand*{\outertitlemarks}{}
+
 \newcommand*{\innertitlemarks}{}
 
 \NewDocumentCommand{\newtitlemark}{s m}{}
@@ -53,9 +63,11 @@
 \newcommand{\ifsamemark}[4]{}
 
 \NewDocumentCommand{\setfloathead}{s o o o m m m m m}{}
+
 \NewDocumentCommand{\setfloatfoot}{s o o o m m m m m}{}
 
 \NewDocumentCommand{\nextfloathead}{s o o o m m m m m}{}
+
 \NewDocumentCommand{\nextfloatfoot}{s o o o m m m m m}{}
 
 \newcommand{\newmarkset}[1]{}
@@ -63,10 +75,15 @@
 \NewDocumentCommand{\newextramarkset}{s m m}{}
 
 \newcommand{\botextramarks}[1]{}
+
 \newcommand{\topextramarks}[1]{}
+
 \newcommand{\firstextramarks}[1]{}
+
 \newcommand{\nexttopextramarks}[1]{}
+
 \newcommand{\outerextramarks}[1]{}
+
 \newcommand{\innerextramarks}[1]{}
 
 \endinput

Modified: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-titlesec.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-titlesec.sty	2017-10-30 20:40:11 UTC (rev 45647)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-titlesec.sty	2017-10-30 20:40:38 UTC (rev 45648)
@@ -35,10 +35,15 @@
 \NewDocumentCommand{\titlespacing}{s m m m m o}{}
 
 \newcommand*{\filright}{}
+
 \newcommand*{\filcenter}{}
+
 \newcommand*{\filleft}{}
+
 \newcommand*{\fillast}{}
+
 \newcommand*{\filinner}{}
+
 \newcommand*{\filouter}{}
 
 \newcommand\wordsep{\fontdimen\tw@\font \@plus
@@ -51,7 +56,9 @@
 \newcommand*{\ttl at row}[2][]{}
 
 \newcommand{\iftitlemeasuring}[2]{#2}
+
 \newcommand{\assignpagestyle}[2]{#2}
+
 \NewDocumentCommand{\titleclass}{m o m o}
 
 \endinput

Modified: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-titletoc.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-titletoc.sty	2017-10-30 20:40:11 UTC (rev 45647)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-titletoc.sty	2017-10-30 20:40:38 UTC (rev 45648)
@@ -30,9 +30,11 @@
 \newcommand{\contentsmargin}[2][]{}
 
 \newcommand*{\thecontentslabel}{thecontentslabel}
+
 \newcommand*{\thecontentspage}{thecontentspage}
 
 \newcommand{\contentslabel}[2][]{\thecontentslabel}
+
 \newcommand{\contentspage}[1][]{\thecontentspage}
 
 \newcommand{\contentspush}[1]{}
@@ -40,13 +42,17 @@
 \newcommand{\contentsuse}[2]{}
 
 \newcommand*{\startcontents}[1][]{}
+
 \newcommand*{\stopcontents}[1][]{}
+
 \newcommand*{\resumecontents}[1][]{}
 
 \newcommand{\printcontents}[4][]{}
 
 \newcommand{\startlist}[2][]{}
+
 \newcommand{\stoplist}[2][]{}
+
 \newcommand{\resumelist}[2][]{}
 
 \newcommand{\printlist}[4][]{}

Modified: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-titling.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-titling.sty	2017-10-30 20:40:11 UTC (rev 45647)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-titling.sty	2017-10-30 20:40:38 UTC (rev 45648)
@@ -69,9 +69,9 @@
 \DeclareDocumentCommand{\@maketitle}{}{%
     \maketitlehooka
     {
-        \LWR at stoppars\LWR at htmltag{h1}
+        \LWR at stoppars\LWR at htmltag{\LWR at tagtitle}
         \@bspretitle \@title \@bsposttitle
-        \LWR at htmltag{/h1}\LWR at startpars
+        \LWR at htmltag{\LWR at tagtitleend}\LWR at startpars
     }
     \maketitlehookb
     {

Modified: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-tocloft.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-tocloft.sty	2017-10-30 20:40:11 UTC (rev 45647)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-tocloft.sty	2017-10-30 20:40:38 UTC (rev 45648)
@@ -23,7 +23,9 @@
 \newcommand{\tocloftpagestyle}[1]{}
 
 \newcommand*{\cftmarktoc}{}
+
 \newcommand*{\cfttoctitlefont}{}
+
 \newcommand*{\cftaftertoctitle}{}
 
 \newlength{\cftbeforetoctitleskip}
@@ -30,7 +32,9 @@
 \newlength{\cftaftertoctitleskip}
 
 \newcommand*{\cftmarklof}{}
+
 \newcommand*{\cftloftitlefont}{}
+
 \newcommand*{\cftafterloftitle}{}
 
 \newlength{\cftbeforeloftitleskip}
@@ -37,7 +41,9 @@
 \newlength{\cftafterloftitleskip}
 
 \newcommand*{\cftmarklot}{}
+
 \newcommand*{\cftlottitlefont}{}
+
 \newcommand*{\cftafterlottitle}{}
 
 \newlength{\cftbeforelottitleskip}
@@ -44,12 +50,15 @@
 \newlength{\cftafterlottitleskip}
 
 \newcommand*{\cftdot}{.}
+
 \providecommand*{\cftdotsep}{1}
+
 \newcommand*{\cftnodots}{5000}
 
 \providecommand{\cftdotfill}[1]{}
 
 \newcommand*{\cftsetpnumwidth}[1]{}
+
 \newcommand*{\cftsetrmarg}[1]{}
 
 \newcommand*{\cftpnumalign}[1]{}

Modified: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-ulem.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-ulem.sty	2017-10-30 20:40:11 UTC (rev 45647)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-ulem.sty	2017-10-30 20:40:38 UTC (rev 45648)
@@ -18,31 +18,59 @@
 \LetLtxMacro\LWR at ulemorigemph\emph
 \LetLtxMacro\LWR at ulemorigtextbf\textbf
 \NewDocumentCommand{\uline}{+m}{%
-\InlineClass{uline}{#1}%
+\LWR at HTMLtextstyle%
+    {text-decoration:underline;text-decoration-skip}%
+    {uline}{#1}%
 }
 
 \NewDocumentCommand{\uuline}{+m}{%
-\InlineClass{uuline}{#1}%
+\LWR at HTMLtextstyle%
+    {%
+        text-decoration:underline;text-decoration-skip;%
+        text-decoration-style:double%
+    }%
+    {uuline}{#1}%
 }
 
 \NewDocumentCommand{\uwave}{+m}{%
-\InlineClass{uwave}{#1}%
+\LWR at HTMLtextstyle%
+    {%
+        text-decoration:underline;text-decoration-skip;%
+        text-decoration-style:wavy%
+    }%
+    {uwave}{#1}%
 }
 
 \NewDocumentCommand{\sout}{+m}{%
-\InlineClass{sout}{#1}%
+\LWR at HTMLtextstyle%
+    {text-decoration:line-through}%
+    {sout}{#1}%
 }
 
 \NewDocumentCommand{\xout}{+m}{%
-\InlineClass{xout}{#1}%
+\LWR at HTMLtextstyle%
+    {text-decoration:line-through}%
+    {xout}{#1}%
 }
 
 \NewDocumentCommand{\dashuline}{+m}{%
-\InlineClass{dashuline}{#1}%
+\LWR at HTMLtextstyle%
+    {%
+        text-decoration:underline;%
+        text-decoration-skip;%
+        text-decoration-style:dashed%
+    }%
+    {dashuline}{#1}%
 }
 
 \NewDocumentCommand{\dotuline}{+m}{%
-\InlineClass{dotuline}{#1}%
+\LWR at HTMLtextstyle%
+    {%
+        text-decoration:underline;%
+        text-decoration-skip;%
+        text-decoration-style:dotted%
+    }%
+    {dotuline}{#1}%
 }
 \NewDocumentCommand{\ULthickness}{}{}
 \newlength{\ULdepth}

Modified: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-verse.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-verse.sty	2017-10-30 20:40:11 UTC (rev 45647)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-verse.sty	2017-10-30 20:40:38 UTC (rev 45648)
@@ -41,6 +41,7 @@
  }
 }{}
 
+\LWR at traceinfo{Finished patching verse.}
 }% AfterEndPreamble
 
 \endinput

Modified: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-wrapfig.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-wrapfig.sty	2017-10-30 20:40:11 UTC (rev 45647)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-wrapfig.sty	2017-10-30 20:40:38 UTC (rev 45648)
@@ -19,13 +19,9 @@
 
 
 \LWR at ProvidesPackageDrop{wrapfig}
-
-\newlength{\LWR at wrapwidth}
-
 \newcommand*{\LWR at wrapposition}{}
 
 \newcommand*{\LWR at subwrapfigure}[2]{%
-\LWR at maybeincthisfloat%
 \renewcommand*{\LWR at wrapposition}{}%
 \ifthenelse{%
     \equal{#1}{r}\OR\equal{#1}{R}\OR%
@@ -33,16 +29,16 @@
 }%
 {\renewcommand*{\LWR at wrapposition}{float:right}}%
 {\renewcommand*{\LWR at wrapposition}{float:left}}%
-\setlength{\LWR at wrapwidth}{#2}%
-\addtolength{\LWR at wrapwidth}{4em}%
+\setlength{\LWR at templengthone}{#2}%
 \uselengthunit{PT}%
-\LWR at forcenewpage
-\LWR at stoppars%
-\LWR at htmltag{div class="marginblock" id="autofloat-\arabic{LWR at thisfloat}"
-style="width:\rndprintlength{\LWR at wrapwidth} ; %
-\LWR at wrapposition"%
+\LWR at BlockClassWP{%
+    width:\rndprintlength{\LWR at templengthone}; \LWR at wrapposition; %
+    margin:10pt%
 }%
-\LWR at startpars
+{%
+    width:\rndprintlength{\LWR at templengthone}; \LWR at wrapposition%
+}%
+{marginblock}%
 }
 
 \NewDocumentEnvironment{wrapfigure}{o m o m}
@@ -51,7 +47,7 @@
 \captionsetup{type=figure}%
 }
 {%
-\LWR at htmldivclassend{div}
+\endLWR at BlockClassWP%
 }
 
 \NewDocumentEnvironment{wraptable}{o m o m}
@@ -60,7 +56,7 @@
 \captionsetup{type=table}%
 }
 {%
-\LWR at htmldivclassend{div}
+\endLWR at BlockClassWP%
 }
 
 \NewDocumentEnvironment{wrapfloat}{m o m o m}
@@ -69,7 +65,7 @@
 \captionsetup{type=#1}%
 }
 {%
-\LWR at htmldivclassend{div}
+\endLWR at BlockClassWP%
 }
 
 \newlength{\wrapoverhang}

Modified: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-xcolor.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-xcolor.sty	2017-10-30 20:40:11 UTC (rev 45647)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-xcolor.sty	2017-10-30 20:40:38 UTC (rev 45648)
@@ -20,7 +20,6 @@
 \LWR at ProvidesPackagePass{xcolor}
 
 \begin{warpHTML}
-
 \LetLtxMacro\LWRprint at textcolor\textcolor
 \LetLtxMacro\LWRprint at pagecolor\pagecolor
 \LetLtxMacro\LWRprint at nopagecolor\nopagecolor

Modified: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp.sty	2017-10-30 20:40:11 UTC (rev 45647)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp.sty	2017-10-30 20:40:38 UTC (rev 45648)
@@ -17,12 +17,13 @@
 %% version 2005/12/01 or later.
 \NeedsTeXFormat{LaTeX2e}[1999/12/01]
 \ProvidesPackage{lwarp}
-    [2017/10/07 v0.41  Allows LaTeX to directly produce HTML5 output.]
+    [2017/10/30 v0.42  Allows LaTeX to directly produce HTML5 output.]
 
 
 
 
 
+
 \RequirePackage{iftex}
 
 \ifLuaTeX
@@ -290,6 +291,7 @@
 \LWR at loadafter{nopageno}
 \LWR at loadafter{nowidow}
 \LWR at loadafter{ntheorem}
+\LWR at loadafter{overpic}
 \LWR at loadafter{pagenote}
 \LWR at loadafter{paralist}
 \LWR at loadafter{parskip}
@@ -644,16 +646,97 @@
 \LWR at traceinfo{AtBeginDocument}
 }
 
+\end{warpall}
+
+\begin{warpall}
 \newbool{FormatEPUB}
 \boolfalse{FormatEPUB}
-\newbool{FormatWordProcessor}
-\boolfalse{FormatWordProcessor}
-\newbool{HTMLMarkFloats}
-\booltrue{HTMLMarkFloats}
+\newbool{FormatWP}
+\boolfalse{FormatWP}
+\newbool{WPMarkFloats}
+\boolfalse{WPMarkFloats}
 
+\newbool{WPMarkMinipages}
+\boolfalse{WPMarkMinipages}
+
+\newbool{WPMarkTOC}
+\booltrue{WPMarkTOC}
+
+\newbool{WPMarkLOFT}
+\boolfalse{WPMarkLOFT}
+
+\newbool{WPMarkMath}
+\boolfalse{WPMarkMath}
+
+\newbool{WPTitleHeading}
+\boolfalse{WPTitleHeading}
+
 \end{warpall}
 
+\begin{warpHTML}
+\AtBeginDocument{
+\ifbool{FormatWP}{
+\@ifundefined{chapter}{
+\ifbool{WPTitleHeading}{% part and section starting at h2
+\renewcommand*{\LWR at tagtitle}{h1}
+\renewcommand*{\LWR at tagtitleend}{/h1}
+\renewcommand*{\LWR at tagpart}{h2}
+\renewcommand*{\LWR at tagpartend}{/h2}
+\renewcommand*{\LWR at tagsection}{h3}
+\renewcommand*{\LWR at tagsectionend}{/h3}
+\renewcommand*{\LWR at tagsubsection}{h4}
+\renewcommand*{\LWR at tagsubsectionend}{/h4}
+\renewcommand*{\LWR at tagsubsubsection}{h5}
+\renewcommand*{\LWR at tagsubsubsectionend}{/h5}
+\renewcommand*{\LWR at tagparagraph}{h6}
+\renewcommand*{\LWR at tagparagraphend}{/h6}
+\renewcommand*{\LWR at tagsubparagraph}{span class="subparagraph"{}}
+\renewcommand*{\LWR at tagsubparagraphend}{/span}
+}% WPTitleHeading
+{% not WPTitleHeading, part and section starting at h1
+\renewcommand*{\LWR at tagtitle}{div class="title"}
+\renewcommand*{\LWR at tagtitleend}{/div}
+\renewcommand*{\LWR at tagpart}{h1}
+\renewcommand*{\LWR at tagpartend}{/h1}
+\renewcommand*{\LWR at tagsection}{h2}
+\renewcommand*{\LWR at tagsectionend}{/h2}
+\renewcommand*{\LWR at tagsubsection}{h3}
+\renewcommand*{\LWR at tagsubsectionend}{/h3}
+\renewcommand*{\LWR at tagsubsubsection}{h4}
+\renewcommand*{\LWR at tagsubsubsectionend}{/h4}
+\renewcommand*{\LWR at tagparagraph}{h5}
+\renewcommand*{\LWR at tagparagraphend}{/h5}
+\renewcommand*{\LWR at tagsubparagraph}{h6}
+\renewcommand*{\LWR at tagsubparagraphend}{/h6}
+}% not WPTitleHeading
+}% chapter undefined
+{% chapter defined
+\ifbool{WPTitleHeading}{}
+{% not WPTitleHeading, part and chapter starting at h1
+\renewcommand*{\LWR at tagtitle}{div class="title"}
+\renewcommand*{\LWR at tagtitleend}{/div}
+\renewcommand*{\LWR at tagpart}{h1}
+\renewcommand*{\LWR at tagpartend}{/h1}
+\renewcommand*{\LWR at tagchapter}{h2}
+\renewcommand*{\LWR at tagchapterend}{/h2}
+\renewcommand*{\LWR at tagsection}{h3}
+\renewcommand*{\LWR at tagsectionend}{/h3}
+\renewcommand*{\LWR at tagsubsection}{h4}
+\renewcommand*{\LWR at tagsubsectionend}{/h4}
+\renewcommand*{\LWR at tagsubsubsection}{h5}
+\renewcommand*{\LWR at tagsubsubsectionend}{/h5}
+\renewcommand*{\LWR at tagparagraph}{h6}
+\renewcommand*{\LWR at tagparagraphend}{/h6}
+\renewcommand*{\LWR at tagsubparagraph}{span class="subparagraph"{}}
+\renewcommand*{\LWR at tagsubparagraphend}{/span}
+}% not WPTitleHeading
+}% chapter defined
+}{}% FormatWP
+}% AtBeginDocument
 
+\end{warpHTML}
+
+
 \begin{warpHTML}
 
 \LetLtxMacro{\LWR at origtextrm}{\textrm}
@@ -685,8 +768,12 @@
 
 \let\LWR at origsp\sp
 \let\LWR at origsb\sb
-\let\LWR at origtextsuperscript\textsuperscript
-\let\LWR at origtextsubscript\textsubscript
+\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
@@ -968,6 +1055,13 @@
   font-size: 120% ; font-weight: bold;
 }
 
+pre.tabbing {
+    font-family: "Linux Libertine Mono O", "Lucida Console",
+        "Droid Sans Mono", "DejaVu Mono", "Bitstream Vera Mono",
+        "Liberation Mono", "FreeMono", "Andale Mono",
+        "Nimbus Mono L", "Courier New", monospace;
+}
+
 blockquote {
     margin-left: 0px ;
     margin-right: 0px ;
@@ -1345,6 +1439,11 @@
 div.onehalfspace { line-height: 1.5 ; }
 div.doublespace { line-height: 2 ; }
 
+/* Word processor format output: */
+div.wpfigure { border: 1px solid red ; margin: .5ex ; padding: .5ex ; }
+div.wptable { border: 1px solid blue ; margin: .5ex ; padding: .5ex ; }
+div.wpminipage { border: 1px solid green ; margin: .5ex ; padding: .5ex ;}
+
 /* Minipage environments, vertically aligned to top, center, bottom: */
 .minipage, .fminipage, .fcolorminipage {
     /* display: inline-block ; */
@@ -2593,15 +2692,16 @@
     "https://cdn.mathjax.org/mathjax/contrib";
 </script>
 
-<!-- https://github.com/mathjax/MathJax-third-party-extensions/
-                                           tree/master/siunitx -->
+<!-- https://github.com/burnpanck/MathJax-siunitx -->
+
 <script type="text/x-mathjax-config">
  MathJax.Hub.Config({
-   extensions: ["tex2jax.js","[Contrib]/siunitx/siunitx.js"],
+   extensions: ["tex2jax.js","[siunitx]/siunitx.js"],
    jax: ["input/TeX","output/HTML-CSS"],
    tex2jax: {inlineMath: [["$","$"],["\\(","\\)"]]},
    TeX: {extensions: ["AMSmath.js","AMSsymbols.js", "sinuitx.js"]}
  });
+ MathJax.Ajax.config.path['siunitx']  = 'http://rawgit.com/burnpanck/MathJax-siunitx/master/';
  </script>
 
 <script type="text/x-mathjax-config">
@@ -2639,7 +2739,7 @@
 
 -- Print the usage of the lwarpmk command:
 
-printversion = "v0.41"
+printversion = "v0.42"
 
 function printhelp ()
 print ("lwarpmk: Use lwarpmk -h or lwarpmk --help for help.") ;
@@ -3272,7 +3372,7 @@
 \begin{warpHTML}
 \NewDocumentCommand{\LWR at setexparray}{m m m}{%
 \ifthenelse{\isempty{#3}}%
-{\csdef{#1#2}{}}
+{\csdef{#1#2}{}}%
 {\expandafter\edef\csname #1#2\endcsname{\expandonce#3}}%
 }
 \newcommand*{\LWR at getexparray}[2]{\csuse{#1#2}}
@@ -3438,6 +3538,8 @@
 \begin{warpHTML}
 
 
+\newcommand*{\LWR at tagtitle}{h1}
+\newcommand*{\LWR at tagtitleend}{/h1}
 \newcommand*{\LWR at tagpart}{h2}
 \newcommand*{\LWR at tagpartend}{/h2}
 \newcommand*{\LWR at tagchapter}{h3}
@@ -3720,7 +3822,34 @@
 \NewDocumentCommand{\InlineClass}{o m +m}{#3}%
 \end{warpprint}
 
+\begin{warpHTML}
+\NewDocumentEnvironment{LWR at BlockClassWP}{m m m}%
+{%
+\LWR at stoppars%
+\ifbool{FormatWP}%
+{%
+    \LWR at maybeincthisfloat%
+    \LWR at htmltag{%
+        div class="#3" %
+        id="autofloat-\arabic{LWR at thisfloat}"%
+        \ifblank{#1}{}{ style="#1"}%
+    }%
+}% FormatWP
+{% not FormatWP
+    \LWR at htmltag{%
+        div class="#3"%
+        \ifblank{#2}{}{ style="#2"}%
+    }%
+}% not FormatWP
+\LWR at startpars%
+}
+{\LWR at htmldivclassend{#3}}
+\end{warpHTML}
+\begin{warpprint}
+\NewDocumentEnvironment{LWR at BlockClassWP}{m m m}{}{}%
+\end{warpprint}
 
+
 \begin{warpHTML}
 
 \newcommand*{\LWR at printclosepart}
@@ -4019,7 +4148,7 @@
 \fi
 }
 \newcommand*{\LWR at epubprintpendingfootnotes}{%
-\ifthenelse{\boolean{FormatEPUB}\OR\boolean{FormatWordProcessor}}%
+\ifthenelse{\boolean{FormatEPUB}\OR\boolean{FormatWP}}%
 {\LWR at printpendingfootnotes}%
 {}%
 }
@@ -4029,7 +4158,13 @@
 \begin{warpHTML}
 
 \renewcommand{\marginpar}[2][]{%
-\LWR at htmlspanclass{marginpar}{#2}%
+\ifbool{FormatWP}%
+{%
+\begin{LWR at BlockClassWP}{width:2in; float:right; margin:10pt}{}{marginblock}
+#2
+\end{LWR at BlockClassWP}
+}%
+{\LWR at htmlspanclass{marginpar}{#2}}%
 }
 
 \end{warpHTML}
@@ -4062,7 +4197,7 @@
 \StrSubstitute{\LWR at thisnewfilename}{,}{-}[\LWR at thisnewfilename]
 \StrSubstitute{\LWR at thisnewfilename}{'}{-}[\LWR at thisnewfilename]
 \StrSubstitute{\LWR at thisnewfilename}%
-{\LWR at origampersand}{-}[\LWR at thisnewfilename]
+    {\LWR at origampersand}{-}[\LWR at thisnewfilename]
 \StrSubstitute{\LWR at thisnewfilename}{+}{-}[\LWR at thisnewfilename]
 \StrSubstitute{\LWR at thisnewfilename}{,}{-}[\LWR at thisnewfilename]
 \StrSubstitute{\LWR at thisnewfilename}{/}{-}[\LWR at thisnewfilename]
@@ -4073,9 +4208,9 @@
 \StrSubstitute{\LWR at thisnewfilename}{@}{-}[\LWR at thisnewfilename]
 \StrSubstitute{\LWR at thisnewfilename}{"}{-}[\LWR at thisnewfilename]
 \StrSubstitute{\LWR at thisnewfilename}%
-{\textless}{-}[\LWR at thisnewfilename]
+    {\textless}{-}[\LWR at thisnewfilename]
 \StrSubstitute{\LWR at thisnewfilename}%
-{\textgreater}{-}[\LWR at thisnewfilename]
+    {\textgreater}{-}[\LWR at thisnewfilename]
 \StrSubstitute{\LWR at thisnewfilename}{\#}{-}[\LWR at thisnewfilename]
 \StrSubstitute{\LWR at thisnewfilename}{\%}{-}[\LWR at thisnewfilename]
 \StrSubstitute{\LWR at thisnewfilename}{\{}{-}[\LWR at thisnewfilename]
@@ -4082,7 +4217,7 @@
 \StrSubstitute{\LWR at thisnewfilename}{\}}{-}[\LWR at thisnewfilename]
 \StrSubstitute{\LWR at thisnewfilename}{|}{-}[\LWR at thisnewfilename]
 \StrSubstitute{\LWR at thisnewfilename}%
-{\textbackslash}{-}[\LWR at thisnewfilename]
+    {\textbackslash}{-}[\LWR at thisnewfilename]
 \StrSubstitute{\LWR at thisnewfilename}{^}{-}[\LWR at thisnewfilename]
 \StrSubstitute{\LWR at thisnewfilename}{~{}}{-}[\LWR at thisnewfilename]
 \StrSubstitute{\LWR at thisnewfilename}{[}{-}[\LWR at thisnewfilename]
@@ -4132,7 +4267,7 @@
 
     \LWR at htmlelementend{footer}
 }
-\ifthenelse{\boolean{FormatEPUB}\OR\boolean{FormatWordProcessor}}
+\ifthenelse{\boolean{FormatEPUB}\OR\boolean{FormatWP}}
 {}
 {\ifnumcomp{\value{LWR at htmlfilenumber}}{>}{0}{\LWR at botnavigation}{}}
 
@@ -4156,11 +4291,11 @@
 
 \LWR at filestart{ — #1}% there is an EMdash in front of the #1
 
-\ifthenelse{\boolean{FormatEPUB}\OR\boolean{FormatWordProcessor}}
+\ifthenelse{\boolean{FormatEPUB}\OR\boolean{FormatWP}}
 {}
 {\LWR at topnavigation}
 
-\ifthenelse{\boolean{FormatEPUB}\OR\boolean{FormatWordProcessor}}
+\ifthenelse{\boolean{FormatEPUB}\OR\boolean{FormatWP}}
 {}
 {
     \LWR at htmlelement{header}
@@ -4170,11 +4305,11 @@
     \LWR at htmlelementend{header}
 }
 
-\ifthenelse{\boolean{FormatEPUB}\OR\boolean{FormatWordProcessor}}
+\ifthenelse{\boolean{FormatEPUB}\OR\boolean{FormatWP}}
 {}
 {\ifcsvoid{thetitle}{}{\LWR at printthetitle}}
 
-\ifthenelse{\boolean{FormatEPUB}\OR\boolean{FormatWordProcessor}}
+\ifthenelse{\boolean{FormatEPUB}\OR\boolean{FormatWP}}
 {}
 {\LWR at sidetoc}
 
@@ -4514,7 +4649,7 @@
 \newcommand*{\LWR at LwarpStart}
 {%
 \LWR at traceinfo{LWR at lwarpStart}
-\ifbool{FormatWordProcessor}{%
+\ifbool{FormatWP}{%
     \setcounter{FileDepth}{-5}%
     \boolfalse{HTMLDebugComments}%
 }{}
@@ -4571,7 +4706,6 @@
 }
 \catcode`\$=3% math shift until lwarp starts
 
-
 \end{warpHTML}
 
 
@@ -4599,7 +4733,7 @@
 
 \LWR at htmlelementend{footer}
 
-\ifthenelse{\boolean{FormatEPUB}\OR\boolean{FormatWordProcessor}}
+\ifthenelse{\boolean{FormatEPUB}\OR\boolean{FormatWP}}
 {}
 {
     \ifnumcomp{\value{LWR at htmlfilenumber}}{>}{0}{\LWR at botnavigation}{}
@@ -4650,17 +4784,17 @@
 \newcommand*{\printtitle}
 {
 \LWR at stoppars
-\LWR at htmltag{h1}%
+\LWR at htmltag{\LWR at tagtitle}%
 \@title%
-\LWR at htmltag{/h1}
+\LWR at htmltag{\LWR at tagtitleend}
 \LWR at startpars
 }
 \newcommand*{\LWR at printthetitle}
 {
 \LWR at stoppars
-\LWR at htmltag{h1}%
+\LWR at htmltag{\LWR at tagtitle}%
 \thetitle%
-\LWR at htmltag{/h1}
+\LWR at htmltag{\LWR at tagtitleend}
 \LWR at startpars
 }
 
@@ -4737,9 +4871,9 @@
 \global\let\and\relax
 }
 \DeclareDocumentCommand{\@maketitle}{}{%
-    \LWR at stoppars\LWR at htmltag{h1}
+    \LWR at stoppars\LWR at htmltag{\LWR at tagtitle}
     \@title
-    \LWR at htmltag{/h1}\LWR at startpars
+    \LWR at htmltag{\LWR at tagtitleend}\LWR at startpars
     \begin{BlockClass}{author}
         \renewcommand{\and}{
             \end{BlockClass}
@@ -4915,9 +5049,22 @@
 \LWR at forcenewpage
 \LWR at atbeginverbatim{verbatim}\unskip\LWR at origvspace*{-\baselineskip}%
 }
-\AfterEndEnvironment{verbatim}{\unskip\LWR at origvspace*{-\baselineskip}\LWR at afterendverbatim}
+\AfterEndEnvironment{verbatim}{%
+    \unskip\LWR at origvspace*{-\baselineskip}\LWR at afterendverbatim%
 }
+}
 
+\AfterEndPreamble{
+\LWR at traceinfo{Patching tabbing.}
+\AtBeginEnvironment{tabbing}{%
+\LWR at forcenewpage
+\LWR at atbeginverbatim{tabbing}\unskip\LWR at origvspace*{-\baselineskip}%
+}
+\AfterEndEnvironment{tabbing}{%
+    \unskip\LWR at origvspace*{-\baselineskip}\LWR at afterendverbatim%
+}
+}
+
 \end{warpHTML}
 
 
@@ -5406,16 +5553,10 @@
 
 \newcommand*{\LWR at printbartag}[1]{%
 \ifboolexpr{bool{LWR at tabularmutemods} or bool{LWR at emptyatbang}}%
-{%
-}%
-{ % not muting
-    \ifstrequal{#1}{leftedge}{%
-            \LWR at getexparray{LWR at colbarspec}{leftedge} %
-    }%
-    {
-        \LWR at getexparray{LWR at colbarspec}{#1} %
-        \edef\LWR at tempone{\LWR at getexparray{LWR at colbarspec}{#1}}%
-    } %
+{}% muting or empty
+{% not muting
+    \edef\LWR at tempone{\LWR at getexparray{LWR at colbarspec}{#1}}%
+    \ifdefempty{\LWR at tempone}{}{ \LWR at tempone}%
 }% not muting
 }
 
@@ -5431,7 +5572,9 @@
         \LWR at subaddcmidruletrim{}{}%
         \LWR at printbartag{#2}%
         "%
+        \LWR at tdstartstyles%
         \LWR at addcmidrulewidth%
+        \LWR at tdendstyles%
     }%
     \ifboolexpr{bool{LWR at tabularmutemods} or bool{LWR at emptyatbang}}%
     {}%
@@ -5471,7 +5614,10 @@
         \LWR at addleftmostbartag%
         \LWR at printbartag{\theLWR at tablecolspos}%
         "%
+        \LWR at tdstartstyles%
         \LWR at addcmidrulewidth%
+        \LWR at addformatwpalignment%
+        \LWR at tdendstyles%
         }%
         \ifthenelse{%
             \equal{\LWR at strresult}{p}\OR%
@@ -5545,6 +5691,24 @@
 \newlength{\LWR at templengthone}%
 \newlength{\LWR at templengthtwo}%
 
+\newboolean{LWR at tdhavecellstyle}
+
+\newcommand*{\LWR at tdstartstyles}{\global\boolfalse{LWR at tdhavecellstyle}}
+
+\newcommand*{\LWR at tdaddstyle}{%
+\ifbool{LWR at tdhavecellstyle}%
+{; }%
+{ style="}%
+\booltrue{LWR at tdhavecellstyle}%
+}
+
+\newcommand*{\LWR at tdendstyles}{%
+\ifbool{LWR at tdhavecellstyle}{%
+    "%
+    \global\boolfalse{LWR at tdhavecellstyle}%
+}{}%
+}
+
 \newcommand*{\LWR at subaddcmidruletrim}[2]{%
 \setlength{\LWR at templengthone}{\LWR at getexparray{LWR at midrules}{\theLWR at tablecolspos}}%
 \ifdimcomp{\LWR at templengthone}{>}{0pt}%
@@ -5551,7 +5715,10 @@
 {%
     \LWR at origtilde tdrule#1#2%
     \setlength{\LWR at thiscmidrulewidth}{\LWR at templengthone}%
-}{}%
+}%
+{%
+    \setlength{\LWR at thiscmidrulewidth}{0pt}%
+}%
 }
 
 \newcommand*{\LWR at addcmidruletrim}{%
@@ -5561,12 +5728,16 @@
 }
 
 \newcommand{\LWR at addrulewidth}[2]{%
-\ifdimcomp{#1}{=}{#2}%
+\ifboolexpr{%
+    test{\ifdimcomp{#1}{=}{0pt}}%
+    or ( test{\ifdimcomp{#1}{=}{#2}} and not bool{FormatWP} )%
+}%
 {}% default width
 {% custom width
     \LWR at forceminwidth{#1}%
-    \uselengthunit{PT} % explicit space
-    style="border-top:\rndprintlength{\LWR at atleastonept} solid %
+    \LWR at tdaddstyle%
+    \uselengthunit{PT}%
+    border-top:\rndprintlength{\LWR at atleastonept} solid %
     \ifdimcomp{#1}{<}{\LWR at lightrulewidth}%
     {\#A0A0A0}%
     {% lightrule or heaver
@@ -5574,7 +5745,6 @@
         {\#808080}%
         {black}%
     }% lightrule or heavier
-    "%
 }% custom width
 }
 
@@ -5582,8 +5752,28 @@
 \LWR at addrulewidth{\LWR at thiscmidrulewidth}{\LWR at cmidrulewidth}%
 }
 
+\newcommand*{\LWR at WPcell}[2]{%
+\LWR at tdaddstyle%
+text-align:#1; vertical-align:#2%
+}
 
+\newcommand*{\LWR at addformatwpalignment}{%
+\ifbool{FormatWP}{%
+\StrChar{\LWR at tablecolspec}{\theLWR at tablecolspos}[\LWR at strresult]%
+\ifdefstring{\LWR at strresult}{l}{\LWR at WPcell{left}{middle}}{}%
+\ifdefstring{\LWR at strresult}{c}{\LWR at WPcell{center}{middle}}{}%
+\ifdefstring{\LWR at strresult}{r}{\LWR at WPcell{right}{middle}}{}%
+\ifdefstring{\LWR at strresult}{p}{\LWR at WPcell{left}{bottom}}{}%
+\ifdefstring{\LWR at strresult}{m}{\LWR at WPcell{left}{middle}}{}%
+\ifdefstring{\LWR at strresult}{b}{\LWR at WPcell{left}{top}}{}%
+\ifdefstring{\LWR at strresult}{P}{\LWR at WPcell{center}{bottom}}{}%
+\ifdefstring{\LWR at strresult}{M}{\LWR at WPcell{center}{middle}}{}%
+\ifdefstring{\LWR at strresult}{B}{\LWR at WPcell{center}{top}}{}%
+}{}%
+}
 
+
+
 \newcounter{LWR at tablemulticolswidth}
 \newcounter{LWR at tablemulticolspos}
 
@@ -5687,7 +5877,10 @@
 \LWR at addleftmostbartag%
 \LWR at printbartag{\theLWR at tablecolspos}%
 "%
+\LWR at tdstartstyles%
 \LWR at addcmidrulewidth%
+\LWR at addformatwpalignment%
+\LWR at tdendstyles%
 }% end of the opening table data tag
 \global\boolfalse{LWR at intabularmetadata}%
 \LWR at parsemulticolumnalignment{#4}{\LWR at printmccoldata}%
@@ -5718,9 +5911,9 @@
 \LWR at domulticolumn{\theLWR at tabhtmlcoltotal}{P}{% \LWR at domulticolumn
 \IfBooleanTF{#1}% star?
 {% yes star
-    \LWR at htmlblocktag{figcaption}%
+    \LWR at figcaption%
     #3%
-    \LWR at htmlblocktag{/figcaption}%
+    \endLWR at figcaption%
 }%
 {% No star:
     \ifbool{LWR at starredlongtable}%
@@ -5733,9 +5926,9 @@
         \csuse{p@\LTcaptype}\csuse{the\LTcaptype}}%
     }%
     }{}%
-    \LWR at htmlblocktag{figcaption}%
+    \LWR at figcaption%
     \csuse{fnum@\LTcaptype}\CaptionSeparator#3%
-    \LWR at htmlblocktag{/figcaption}%
+    \endLWR at figcaption%
     \ifthenelse{\equal{#2}{}}% TOC entry empty
     {}%
     {% TOC entry not empty
@@ -5931,12 +6124,20 @@
 \newcommand*{\LWR at origspecialrule}[3]{\hline}
 \AtBeginDocument{
 \@ifpackageloaded{lwarp-tabls}
-{\newcommand*{\LWR at hline}[1][]{%
-    \booltrue{LWR at doinghline}%
-    \LWR at getmynexttoken}}
-{\newcommand*{\LWR at hline}{%
-    \booltrue{LWR at doinghline}%
-    \LWR at getmynexttoken}}
+{
+\newcommand*{\LWR at hline}[1][]{%
+    \ifbool{FormatWP}%
+    {\LWR at docmidrule{1-\theLWR at tabletotalcols}}%
+    {\booltrue{LWR at doinghline}}%
+    \LWR at getmynexttoken}%
+}
+{
+\newcommand*{\LWR at hline}{%
+    \ifbool{FormatWP}%
+    {\LWR at docmidrule{1-\theLWR at tabletotalcols}}%
+    {\booltrue{LWR at doinghline}}%
+    \LWR at getmynexttoken}%
+}
 }% AtBeginDocument
 
 \AtBeginDocument{
@@ -5982,13 +6183,21 @@
     {%
         \IfValueTF{##1}%
             {\LWR at docmidrule[##1](){1-\theLWR at tabletotalcols}}%
-            {\booltrue{LWR at doingtbrule}}%
+            {%
+                \ifbool{FormatWP}%
+                {\LWR at docmidrule[##1](){1-\theLWR at tabletotalcols}}%
+                {\booltrue{LWR at doingtbrule}}%
+            }%
     \LWR at getmynexttoken}%
 \DeclareDocumentCommand{\midrule}{o d()}%
     {%
         \IfValueTF{##1}%
             {\LWR at docmidrule[##1](){1-\theLWR at tabletotalcols}}%
-            {\booltrue{LWR at doinghline}}%
+            {%
+                \ifbool{FormatWP}%
+                {\LWR at docmidrule[##1](){1-\theLWR at tabletotalcols}}%
+                {\booltrue{LWR at doinghline}}%
+            }%
     \LWR at getmynexttoken}%
 \DeclareDocumentCommand{\cmidrule}{O{\LWR at cmidrulewidth} d() m}%
 {\LWR at docmidrule[##1](##2){##3}\LWR at getmynexttoken}%
@@ -5996,7 +6205,11 @@
     {%
         \IfValueTF{##1}%
             {\LWR at docmidrule[##1](){1-\theLWR at tabletotalcols}}%
-            {\booltrue{LWR at doingtbrule}}%
+            {%
+                \ifbool{FormatWP}%
+                {\LWR at docmidrule[##1](){1-\theLWR at tabletotalcols}}%
+                {\booltrue{LWR at doingtbrule}}%
+            }%
     \LWR at getmynexttoken}%
 \DeclareDocumentCommand{\addlinespace}{o}{}%
 \DeclareDocumentCommand{\morecmidrules}{}{}%
@@ -6258,34 +6471,41 @@
 \begin{warpHTML}
 
 \NewDocumentCommand{\LWR at floatbegin}{m o}{%
-\ifthenelse{\boolean{FormatWordProcessor}\AND\boolean{HTMLMarkFloats}}{%
+\ifbool{FormatWP}{\newline}{}%
+\LWR at stoppars
+\addtocounter{LWR at thisfloat}{1}%
+\booltrue{LWR at freezethisfloat}%
+\begingroup%
+\LWR at origraggedright%
+\LWR at htmltag{figure id="autofloat-\arabic{LWR at thisfloat}" class="#1"}%
+\ifbool{FormatWP}{%
+    \LWR at orignewline%
+    \LWR at BlockClassWP{}{}{wp#1}%
+}{}%
+\renewcommand*{\@captype}{#1}%
+\caption at settype{#1}%
+\LWR at startpars%
+\ifboolexpr{bool{FormatWP} and bool{WPMarkFloats}}{%
 
-=== #1 begin
+=== begin #1 ===
 
 }{}%
-\LWR at stoppars
-\addtocounter{LWR at thisfloat}{1}%
-\booltrue{LWR at freezethisfloat}%
-\begingroup
-\LWR at origraggedright
-\LWR at htmltag{figure id="autofloat-\arabic{LWR at thisfloat}" class="#1"}
-\renewcommand*{\@captype}{#1}
-\caption at settype{#1}
-\LWR at startpars
 }
 \let\@float\LWR at floatbegin
 \let\@dblfloat\LWR at floatbegin
 \newcommand*{\LWR at floatend}{%
+\ifboolexpr{bool{FormatWP} and bool{WPMarkFloats}}{%
+
+=== end ===
+
+}{}%
 \LWR at stoppars%
+\ifbool{FormatWP}{\endLWR at BlockClassWP}{}%
 \LWR at htmlelementend{figure}%
 \endgroup%
 \boolfalse{LWR at freezethisfloat}%
 \LWR at startpars%
-\ifthenelse{\boolean{FormatWordProcessor}\AND\boolean{HTMLMarkFloats}}{%
-
-=== end
-
-}{}%
+\ifbool{FormatWP}{\newline}{}%
 }
 \let\end at float\LWR at floatend
 \let\end at dblfloat\LWR at floatend
@@ -6317,6 +6537,19 @@
 \newcounter{LWR at latestautopage}
 \setcounter{LWR at latestautopage}{1}
 
+\newenvironment*{LWR at figcaption}
+{%
+\LWR at htmlblocktag{figcaption}
+\ifbool{FormatWP}{%
+\begin{BlockClass}[font-style:italic]{italic}
+\LWR at origvspace*{\baselineskip}
+}{}%
+}
+{%
+\ifbool{FormatWP}{\end{BlockClass}}{}%
+\LWR at htmlblocktag{/figcaption}%
+}
+
 \let\LWR at origcaption@begin\caption at begin
 \let\LWR at origcaption@end\caption at end
 \let\LWR at orig@@par\@@par
@@ -6328,7 +6561,7 @@
 \renewcommand{\@@par}{\LWR at closeparagraph\LWR at orig@@par}%
 \RenewDocumentEnvironment{minipage}{O{t} o O{t} m}{}{}%
 \RenewDocumentCommand{\parbox}{O{t} o O{t} m +m}{##5}%
-\LWR at htmlblocktag{figcaption}%
+\LWR at figcaption%
 \LWR at origcaption@begin%
 }
 
@@ -6336,7 +6569,7 @@
 {%
 \LWR at origcaption@end%
 \LWR at origvspace*{\baselineskip}%
-\LWR at htmlblocktag{/figcaption}%
+\endLWR at figcaption%
 \endgroup%
 \LWR at traceinfo{LWR at caption@end: done}%
 }
@@ -6426,25 +6659,43 @@
 \LWR at htmlelementclassend{nav}{#1}
 }
 \let\LWR at origtableofcontents\tableofcontents
-\let\LWR at origlistoffigures\listoffigures
-\let\LWR at origlistoftables\listoftables
 
 \renewcommand*{\tableofcontents}{%
-\ifbool{FormatWordProcessor}{}{
+\ifboolexpr{bool{FormatWP} and bool{WPMarkTOC}}{
+
+=== table of contents ===
+
+}
+{
     \LWR at copyfile{\jobname.toc}{\jobname.sidetoc}%
     \LWR at printpendingfootnotes
     \LWR at origtableofcontents
 }
 }
+
+\let\LWR at origlistoffigures\listoffigures
+
 \renewcommand*{\listoffigures}{
-\ifbool{FormatWordProcessor}{}{
+\ifboolexpr{bool{FormatWP} and bool{WPMarkLOFT}}{
+
+=== list of figures ===
+
+}
+{
     \LWR at printpendingfootnotes
     \LWR at origlistoffigures
 }
 }
 
+\let\LWR at origlistoftables\listoftables
+
 \renewcommand*{\listoftables}{
-\ifbool{FormatWordProcessor}{}{
+\ifboolexpr{bool{FormatWP} and bool{WPMarkLOFT}}{
+
+=== list of tables ===
+
+}
+{
     \LWR at printpendingfootnotes
     \LWR at origlistoftables
 }
@@ -6617,6 +6868,84 @@
 \providecommand{\glo at name}{}
 \end{warpall}
 
+\newcommand*{\LWR at restoreorigformatting}{%
+\LWR at traceinfo{LWR at restoreorigformatting}%
+\linespread{1}%
+\RenewDocumentCommand{\InlineClass}{o m +m}{##3}%
+\RenewDocumentEnvironment{BlockClass}{o m}{}{}%
+\renewcommand{\BlockClassSingle}[2]{##2}%
+\LetLtxMacro{\hspace}{\LWR at orighspace}%
+\LetLtxMacro\rule\LWR at origrule%
+\let\,\LWR at origcomma% disable HTML short unbreakable space
+\let\textellipsis\LWR at origtextellipsis%
+\let\textless\LWR at origtextless%
+\let\textgreater\LWR at origtextgreater%
+\LetLtxMacro{\textrm}{\LWR at origtextrm}%
+\LetLtxMacro{\textsf}{\LWR at origtextsf}%
+\LetLtxMacro{\texttt}{\LWR at origtexttt}%
+\LetLtxMacro{\textbf}{\LWR at origtextbf}%
+\LetLtxMacro{\textmd}{\LWR at origtextmd}%
+\LetLtxMacro{\textit}{\LWR at origtextit}%
+\LetLtxMacro{\textsl}{\LWR at origtextsl}%
+\LetLtxMacro{\textsc}{\LWR at origtextsc}%
+\LetLtxMacro{\textup}{\LWR at origtextup}%
+\LetLtxMacro{\textnormal}{\LWR at origtextnormal}%
+\LetLtxMacro{\emph}{\LWR at origemph}%
+\LetLtxMacro{\rmfamily}{\LWR at origrmfamily}%
+\LetLtxMacro{\sffamily}{\LWR at origsffamily}%
+\LetLtxMacro{\ttfamily}{\LWR at origttfamily}%
+\LetLtxMacro{\bfseries}{\LWR at origbfseries}%
+\LetLtxMacro{\mdseries}{\LWR at origmdseries}%
+\LetLtxMacro{\upshape}{\LWR at origupshape}%
+\LetLtxMacro{\slshape}{\LWR at origslshape}%
+\LetLtxMacro{\scshape}{\LWR at origscshape}%
+\LetLtxMacro{\itshape}{\LWR at origitshape}%
+\LetLtxMacro{\em}{\LWR at origem}%
+\LetLtxMacro{\normalfont}{\LWR at orignormalfont}%
+\let\sp\LWR at origsp%
+\let\sb\LWR at origsb%
+\LetLtxMacro\textsuperscript\LWR at origtextsuperscript%
+\LetLtxMacro\@textsuperscript\LWR at orig@textsuperscript%
+\LetLtxMacro\textsubscript\LWR at origtextsubscript%
+\LetLtxMacro\@textsubscript\LWR at orig@textsubscript%
+\LetLtxMacro\underline\LWR at origunderline%
+\let~\LWR at origtilde%
+\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\toprule\LWR at origtoprule%
+\LetLtxMacro\midrule\LWR at origmidrule%
+\LetLtxMacro\cmidrule\LWR at origcmidrule%
+\LetLtxMacro\bottomrule\LWR at origbottomrule%
+\LetLtxMacro\addlinespace\LWR at origaddlinespace%
+\LetLtxMacro\morecmidrules\LWR at origmorecmidrules%
+\LetLtxMacro\specialrule\LWR at origspecialrule%
+\let\newline\LWR at orignewline%
+\LetLtxMacro{\raisebox}{\LWR at origraisebox}%
+\LetLtxMacro\includegraphics\LWR at origincludegraphics%
+\LetLtxMacro{\scalebox}{\LWR at origscalebox}%
+\LetLtxMacro{\rotatebox}{\LWR at origrotatebox}%
+\let\reflectbox\LWR at origreflectbox%
+\LetLtxMacro\resizebox\LWR at origresizebox%
+\let\framebox\LWR at origframebox%
+\let\makebox\LWR at origmakebox%
+\let\fbox\LWRprint at fbox%
+\let\fboxBlock\LWRprint at fbox%
+\LetLtxMacro{\fminipage}{\LWRprint at fminipage}%
+\LetLtxMacro{\endfminipage}{\endLWRprint at fminipage}%
+\LetLtxMacro{\minipage}{\LWR at origminipage}%
+\let\endminipage\LWR at endminipage%
+\LetLtxMacro{\parbox}{\LWR at origparbox}%
+\let\TeX\LWR at origTeX%
+\let\LaTeX\LWR at origLaTeX%
+\let\LaTeXe\LWR at origLaTeXe%
+\renewcommand*{\Xe}{X\textsubscript{E}}%
+\LetLtxMacro\@ensuredmath\LWR at origensuredmath%
+\LWR at restoreorigaccents%
+\LWR at FBcancel%
+}
 
 \begin{warpHTML}
 
@@ -6630,7 +6959,6 @@
 
 \newcounter{LWR at externalfilecnt}
 
-
 \LetLtxMacro\LWR at origdollar$
 \LetLtxMacro\LWR at secondorigdollar$% balance for editor syntax highlighting
 
@@ -6644,26 +6972,33 @@
 \protected\gdef${\@ifnextchar$\LWR at doubledollar\LWR at singledollar}%
 
 \gdef\LWR at doubledollar$#1$${
-\ifbool{mathjax}%
-{\textbackslash[\LWR at HTMLsanitize{#1}\textbackslash]}
+\ifboolexpr{bool{mathjax} or ( bool{FormatWP} and bool{WPMarkMath} ) }%
+{
+
+        \textbackslash[%
+        \LWR at HTMLsanitize{#1}%
+        \textbackslash]
+
+}% mathjax
 {% not mathjax
 
-\begin{lateximage}%
-[\textbackslash{[} \LWR at HTMLsanitize{#1} \textbackslash{]}]%
-\LWR at origdollar\LWR at origdollar#1\LWR at origdollar\LWR at origdollar%
-\end{lateximage}
+        \begin{lateximage}%
+        [\textbackslash{[} \LWR at HTMLsanitize{#1} \textbackslash{]}]%
+        \LWR at origdollar\LWR at origdollar#1\LWR at origdollar\LWR at origdollar%
+        \end{lateximage}%
 
-}
+}% not mathjax
 }%
-
 \gdef\LWR at subsingledollar#1{%
-\ifbool{mathjax}%
-{\textbackslash(\LWR at HTMLsanitize{#1}\textbackslash)}
+\ifboolexpr{bool{mathjax} or ( bool{FormatWP} and bool{WPMarkMath} ) }%
+{%
+        {\textbackslash(\LWR at HTMLsanitize{#1}\textbackslash)}%
+}% mathjax
 {% not mathjax
-    \begin{lateximage}%
-    [\textbackslash( \LWR at HTMLsanitize{#1} \textbackslash)]%
-    \LWR at origdollar#1\LWR at origdollar%
-    \end{lateximage}%
+        \begin{lateximage}%
+        [\textbackslash( \LWR at HTMLsanitize{#1} \textbackslash)]%
+        \LWR at origdollar#1\LWR at origdollar%
+        \end{lateximage}%
 }%
 }
 
@@ -6677,11 +7012,14 @@
 \endgroup
 
 
-\let\LWR at orig@ensuredmath\@ensuredmath
+\LetLtxMacro\LWR at origensuredmath\@ensuredmath
 
-\newcommand*{\LWR at ensuredmath}[1]{%
-\LWR at traceinfo{@ensuredmath: page \thepage: \detokenize{#1}}%
-\LWR at subsingledollar{#1}%
+\renewcommand{\@ensuredmath}[1]{%
+\ifmmode%
+    \LWR at origensuredmath{#1}%
+\else%
+    \LWR at subsingledollar{\relax#1}%
+\fi%
 }
 
 \let\math\relax
@@ -6713,81 +7051,6 @@
     }
 }{}% not eq > 0
 }
-\newcommand*{\LWR at restoreorigformatting}{%
-\LWR at traceinfo{LWR at restoreorigformatting}%
-\RenewDocumentCommand{\InlineClass}{o m +m}{##3}%
-\RenewDocumentEnvironment{BlockClass}{o m}{}{}%
-\renewcommand{\BlockClassSingle}[2]{##2}%
-\LetLtxMacro{\hspace}{\LWR at orighspace}%
-\LetLtxMacro\rule\LWR at origrule%
-\let\,\LWR at origcomma% disable HTML short unbreakable space
-\let\textellipsis\LWR at origtextellipsis%
-\let\textless\LWR at origtextless%
-\let\textgreater\LWR at origtextgreater%
-\LetLtxMacro{\textrm}{\LWR at origtextrm}%
-\LetLtxMacro{\textsf}{\LWR at origtextsf}%
-\LetLtxMacro{\texttt}{\LWR at origtexttt}%
-\LetLtxMacro{\textbf}{\LWR at origtextbf}%
-\LetLtxMacro{\textmd}{\LWR at origtextmd}%
-\LetLtxMacro{\textit}{\LWR at origtextit}%
-\LetLtxMacro{\textsl}{\LWR at origtextsl}%
-\LetLtxMacro{\textsc}{\LWR at origtextsc}%
-\LetLtxMacro{\textup}{\LWR at origtextup}%
-\LetLtxMacro{\textnormal}{\LWR at origtextnormal}%
-\LetLtxMacro{\emph}{\LWR at origemph}%
-\LetLtxMacro{\rmfamily}{\LWR at origrmfamily}%
-\LetLtxMacro{\sffamily}{\LWR at origsffamily}%
-\LetLtxMacro{\ttfamily}{\LWR at origttfamily}%
-\LetLtxMacro{\bfseries}{\LWR at origbfseries}%
-\LetLtxMacro{\mdseries}{\LWR at origmdseries}%
-\LetLtxMacro{\upshape}{\LWR at origupshape}%
-\LetLtxMacro{\slshape}{\LWR at origslshape}%
-\LetLtxMacro{\scshape}{\LWR at origscshape}%
-\LetLtxMacro{\itshape}{\LWR at origitshape}%
-\LetLtxMacro{\em}{\LWR at origem}%
-\LetLtxMacro{\normalfont}{\LWR at orignormalfont}%
-\let\sp\LWR at origsp%
-\let\sb\LWR at origsb%
-\let\textsuperscript\LWR at origtextsuperscript%
-\let\textsubscript\LWR at origtextsubscript%
-\LetLtxMacro\underline\LWR at origunderline%
-\let~\LWR at origtilde%
-\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\toprule\LWR at origtoprule%
-\LetLtxMacro\midrule\LWR at origmidrule%
-\LetLtxMacro\cmidrule\LWR at origcmidrule%
-\LetLtxMacro\bottomrule\LWR at origbottomrule%
-\LetLtxMacro\addlinespace\LWR at origaddlinespace%
-\LetLtxMacro\morecmidrules\LWR at origmorecmidrules%
-\LetLtxMacro\specialrule\LWR at origspecialrule%
-\let\newline\LWR at orignewline%
-\LetLtxMacro{\raisebox}{\LWR at origraisebox}%
-\LetLtxMacro\includegraphics\LWR at origincludegraphics%
-\LetLtxMacro{\scalebox}{\LWR at origscalebox}%
-\LetLtxMacro{\rotatebox}{\LWR at origrotatebox}%
-\let\reflectbox\LWR at origreflectbox%
-\LetLtxMacro\resizebox\LWR at origresizebox%
-\let\framebox\LWR at origframebox%
-\let\makebox\LWR at origmakebox%
-\let\fbox\LWRprint at fbox%
-\let\fboxBlock\LWRprint at fbox%
-\LetLtxMacro{\fminipage}{\LWRprint at fminipage}%
-\LetLtxMacro{\endfminipage}{\endLWRprint at fminipage}%
-\LetLtxMacro{\minipage}{\LWR at origminipage}%
-\let\endminipage\LWR at endminipage%
-\LetLtxMacro{\parbox}{\LWR at origparbox}%
-\let\TeX\LWR at origTeX%
-\let\LaTeX\LWR at origLaTeX%
-\let\LaTeXe\LWR at origLaTeXe%
-\renewcommand*{\Xe}{X\textsubscript{E}}%
-\LWR at restoreorigaccents%
-\LWR at FBcancel%
-}
-
 \NewDocumentCommand{\LWR at hidelatexequation}{m +m}{%
 \LWR at stoppars
 \LWR at htmlopencomment
@@ -6818,29 +7081,36 @@
 
 \NewEnviron{equation}{%
 
-\ifbool{mathjax}
+\ifboolexpr{bool{mathjax} or ( bool{FormatWP} and bool{WPMarkMath} ) }%
 {
     \LWR at syncmathjax
     \LWR at hidelatexequation{equation}{\BODY}
 }
 {% not mathjax
-    \begin{lateximage}[(\theequation) \textbackslash{begin\{equation\}}%
-    \LWR at HTMLsanitizeexpand{\detokenize\expandafter{\BODY}}%
+    \begin{lateximage}[(\LWR at equationtag) \textbackslash{begin\{equation\}} %
+    \LWR at HTMLsanitizeexpand{\detokenize\expandafter{\BODY}} %
     \textbackslash{end\{equation\}}]% alt tag
     \LWR at origequation
     \BODY% contents collected by NewEnviron
     \LWR at origendequation
     \end{lateximage}%
-}
+}% not mathjax
 
-}[\ifbool{mathjax}{\LWR at addmathjax{equation}{\BODY}}{}]
+}[%
+    \ifboolexpr{bool{mathjax} or ( bool{FormatWP} and bool{WPMarkMath} ) }%
+    {%
+        \LWR at addmathjax{equation}{\BODY}%
+    }{}%
 
+]
+
 \newbool{LWR at amsmultline}
 \boolfalse{LWR at amsmultline}
 
 \newcommand*{\LWR at htmlmathlabel}[1]{%
 \LWR at traceinfo{LWR at htmlmathlabel #1}%
-\ifbool{mathjax}{%
+\ifboolexpr{bool{mathjax} or ( bool{FormatWP} and bool{WPMarkMath} ) }%
+{%
     \text{
     \ifbool{LWR at amsmultline}{}{\hspace*{\totwidth@}}
     \LWR at htmlclosecomment%
@@ -6876,8 +7146,8 @@
 \newbool{LWR at numbereqnarray}
 \booltrue{LWR at numbereqnarray}
 \newcommand{\LWR at eqnarrayfactor}{%
-\ifbool{mathjax}
-{
+\ifboolexpr{bool{mathjax} or ( bool{FormatWP} and bool{WPMarkMath} ) }%
+{%
     \LWR at syncmathjax
     \boolfalse{LWR at amsmultline}
     \ifbool{LWR at numbereqnarray}
@@ -6896,7 +7166,8 @@
 {% not mathjax
     \ifbool{LWR at numbereqnarray}
     {
-        \begin{lateximage}[\LWR at addmathjax{eqnarray}{\BODY}]
+        \begin{lateximage}[(\LWR at startingequationtag--\LWR at equationtag)
+            \LWR at addmathjax{eqnarray}{\BODY}]
         \LWR at origeqnarray
         \BODY
         \LWR at origendeqnarray
@@ -6922,7 +7193,7 @@
 \csgpreto{eqnarray*}{\boolfalse{LWR at numbereqnarray}}
 \BeforeBeginEnvironment{multline}{
 
-\ifbool{mathjax}
+\ifboolexpr{bool{mathjax} or ( bool{FormatWP} and bool{WPMarkMath} ) }%
 {
     \LWR at syncmathjax
     \booltrue{LWR at amsmultline}
@@ -6929,13 +7200,13 @@
     \LWR at beginhideamsmath
 }
 {
-    \lateximage[LWRAMSMATHBODY]
+    \lateximage[\LWR at amsmathbodynumbered{multline}]
 }
 }
 
 \AfterEndEnvironment{multline}{
 
-\ifbool{mathjax}
+\ifboolexpr{bool{mathjax} or ( bool{FormatWP} and bool{WPMarkMath} ) }%
 {
     \LWR at endhideamsmath
     \boolfalse{LWR at amsmultline}
@@ -6947,7 +7218,7 @@
 
 \BeforeBeginEnvironment{multline*}{
 
-\ifbool{mathjax}
+\ifboolexpr{bool{mathjax} or ( bool{FormatWP} and bool{WPMarkMath} ) }%
 {
     \LWR at syncmathjax
     \booltrue{LWR at amsmultline}
@@ -6954,13 +7225,13 @@
     \LWR at beginhideamsmath
 }
 {
-    \lateximage[LWRAMSMATHBODY]
+    \lateximage[\LWR at amsmathbody{multline*}]
 }
 }
 
 \AfterEndEnvironment{multline*}{
 
-\ifbool{mathjax}
+\ifboolexpr{bool{mathjax} or ( bool{FormatWP} and bool{WPMarkMath} ) }%
 {
     \LWR at endhideamsmath
     \boolfalse{LWR at amsmultline}
@@ -6973,7 +7244,7 @@
 
 \BeforeBeginEnvironment{gather}{
 
-\ifbool{mathjax}
+\ifboolexpr{bool{mathjax} or ( bool{FormatWP} and bool{WPMarkMath} ) }%
 {
     \LWR at syncmathjax
     \boolfalse{LWR at amsmultline}
@@ -6980,13 +7251,13 @@
     \LWR at beginhideamsmath
 }
 {
-    \lateximage[LWRAMSMATHBODY]
+    \lateximage[\LWR at amsmathbodynumbered{gather}]
 }
 }
 
 \AfterEndEnvironment{gather}{
 
-\ifbool{mathjax}
+\ifboolexpr{bool{mathjax} or ( bool{FormatWP} and bool{WPMarkMath} ) }%
 {
     \LWR at endhideamsmath
     \LWR at addmathjax{gather}{\the\@envbody}
@@ -6997,7 +7268,7 @@
 
 \BeforeBeginEnvironment{gather*}{
 
-\ifbool{mathjax}
+\ifboolexpr{bool{mathjax} or ( bool{FormatWP} and bool{WPMarkMath} ) }%
 {
     \LWR at syncmathjax
     \boolfalse{LWR at amsmultline}
@@ -7004,13 +7275,13 @@
     \LWR at beginhideamsmath
 }
 {
-    \lateximage[LWRAMSMATHBODY]
+    \lateximage[\LWR at amsmathbody{gather*}]
 }
 }
 
 \AfterEndEnvironment{gather*}{
 
-\ifbool{mathjax}
+\ifboolexpr{bool{mathjax} or ( bool{FormatWP} and bool{WPMarkMath} ) }%
 {
     \LWR at endhideamsmath
     \LWR at addmathjax{gather*}{\the\@envbody}
@@ -7021,7 +7292,7 @@
 
 \BeforeBeginEnvironment{align}{
 
-\ifbool{mathjax}
+\ifboolexpr{bool{mathjax} or ( bool{FormatWP} and bool{WPMarkMath} ) }%
 {
     \LWR at syncmathjax
     \boolfalse{LWR at amsmultline}
@@ -7028,13 +7299,13 @@
     \LWR at beginhideamsmath
 }
 {
-    \lateximage[LWRAMSMATHBODY]
+    \lateximage[\LWR at amsmathbodynumbered{align}]
 }
 }
 
 \AfterEndEnvironment{align}{
 
-\ifbool{mathjax}
+\ifboolexpr{bool{mathjax} or ( bool{FormatWP} and bool{WPMarkMath} ) }%
 {
     \LWR at endhideamsmath
     \LWR at addmathjax{align}{\the\@envbody}
@@ -7045,7 +7316,7 @@
 
 \BeforeBeginEnvironment{align*}{
 
-\ifbool{mathjax}
+\ifboolexpr{bool{mathjax} or ( bool{FormatWP} and bool{WPMarkMath} ) }%
 {
     \LWR at syncmathjax
     \boolfalse{LWR at amsmultline}
@@ -7052,13 +7323,13 @@
     \LWR at beginhideamsmath
 }
 {
-    \lateximage[LWRAMSMATHBODY]
+    \lateximage[\LWR at amsmathbody{align*}]
 }
 }
 
 \AfterEndEnvironment{align*}{
 
-\ifbool{mathjax}
+\ifboolexpr{bool{mathjax} or ( bool{FormatWP} and bool{WPMarkMath} ) }%
 {
     \LWR at endhideamsmath
     \LWR at addmathjax{align*}{\the\@envbody}
@@ -7069,7 +7340,7 @@
 
 \BeforeBeginEnvironment{flalign}{
 
-\ifbool{mathjax}
+\ifboolexpr{bool{mathjax} or ( bool{FormatWP} and bool{WPMarkMath} ) }%
 {
     \LWR at syncmathjax
     \boolfalse{LWR at amsmultline}
@@ -7076,13 +7347,13 @@
     \LWR at beginhideamsmath
 }
 {
-    \lateximage[LWRAMSMATHBODY]
+    \lateximage[\LWR at amsmathbodynumbered{flalign}]
 }
 }
 
 \AfterEndEnvironment{flalign}{
 
-\ifbool{mathjax}
+\ifboolexpr{bool{mathjax} or ( bool{FormatWP} and bool{WPMarkMath} ) }%
 {
     \LWR at endhideamsmath
     \LWR at addmathjax{flalign}{\the\@envbody}
@@ -7093,7 +7364,7 @@
 
 \BeforeBeginEnvironment{flalign*}{
 
-\ifbool{mathjax}
+\ifboolexpr{bool{mathjax} or ( bool{FormatWP} and bool{WPMarkMath} ) }%
 {
     \LWR at syncmathjax
     \boolfalse{LWR at amsmultline}
@@ -7100,13 +7371,13 @@
     \LWR at beginhideamsmath
 }
 {
-    \lateximage[LWRAMSMATHBODY]
+    \lateximage[\LWR at amsmathbody{flalign*}]
 }
 }
 
 \AfterEndEnvironment{flalign*}{
 
-\ifbool{mathjax}
+\ifboolexpr{bool{mathjax} or ( bool{FormatWP} and bool{WPMarkMath} ) }%
 {
     \LWR at endhideamsmath
     \LWR at addmathjax{flalign*}{\the\@envbody}
@@ -7117,7 +7388,6 @@
 
 \end{warpHTML}
 
-
 \begin{warpHTML}
 \newcounter{LWR at lateximagenumber}
 \setcounter{LWR at lateximagenumber}{0}
@@ -7129,6 +7399,7 @@
 \newcounter{LWR at LIpage}
 \end{warpHTML}
 
+
 \begin{warpall}
 
 \newcommand*{\LateximageFontSizeName}{large}
@@ -7135,6 +7406,7 @@
 
 \end{warpall}
 
+
 \begin{warpHTML}
 
 \newcommand{\LWR at HTMLsanitize}[1]{%
@@ -7178,6 +7450,75 @@
 \endgroup%
 }
 
+
+\newcounter{LWR at startingequation}
+
+\@ifundefined{chapter}
+{
+\renewcommand{\theLWR at startingequation}{%
+\arabic{LWR at startingequation}%
+}
+}
+{% chapter defined
+\renewcommand{\theLWR at startingequation}{%
+\ifnumcomp{\value{chapter}}{>}{0}{\arabic{chapter}.}{}%
+\arabic{LWR at startingequation}%
+}
+}
+
+\newbool{LWR at isstartingequation}
+
+\let\LWR at startingequationtag\theLWR at startingequation
+
+\let\LWR at equationtag\theequation
+
+\AtBeginDocument{
+
+\ifbool{mathjax}{}{% not mathjax
+
+\NewDocumentCommand{\LWR at remembertag}{m}{%
+\ifbool{LWR at isstartingequation}%
+{%
+    \global\boolfalse{LWR at isstartingequation}%
+    \xdef\LWR at startingequationtag{#1}%
+}%
+{}%
+\xdef\LWR at equationtag{#1}%
+}%
+
+\LetLtxMacro\LWR at origmake@df at tag@@\make at df@tag@@
+\LetLtxMacro\LWR at origmake@df at tag@@@\make at df@tag@@@
+
+\renewcommand*{\make at df@tag@@}[1]{%
+\LWR at remembertag{#1}%
+\LWR at origmake@df at tag@@{#1}%
+}
+
+\renewcommand*{\make at df@tag@@@}[1]{%
+\LWR at remembertag{#1}%
+\LWR at origmake@df at tag@@@{#1}%
+}
+
+}% not mathjax
+}% AtBeginDocument
+
+
+\newcommand*{\LWR at amsmathbody}[1]
+{%
+\textbackslash\{begin\}\{#1\} %
+\LWR at HTMLsanitizeexpand{\detokenize\expandafter{\the\@envbody}}%
+\textbackslash\{end\}\{#1\}%
+}
+
+\newcommand*{\LWR at amsmathbodynumbered}[1]
+{%
+\ifnumcomp{\value{LWR at startingequation}}{=}{\value{equation}}%
+{(\LWR at equationtag)}%
+{(\LWR at startingequationtag--\LWR at equationtag)} %
+\LWR at amsmathbody{#1} %
+}
+
+
 \catcode`\$=\active%
 
 \NewDocumentEnvironment{lateximage}{O{image}}
@@ -7188,6 +7529,11 @@
     \addtocounter{LWR at lateximagedepth}{1}%
 }%
 {% start of outer-most lateximage
+    \setcounter{LWR at startingequation}{\value{equation}}%
+    \addtocounter{LWR at startingequation}{1}%
+    \booltrue{LWR at isstartingequation}%
+    \let\LWR at startingequationtag\theLWR at startingequation%
+    \let\LWR at equationtag\theequation%
     \addtocounter{LWR at lateximagenumber}{1}%
     \LWR at traceinfo{lateximage: LWR at lateximagenumber is \arabic{LWR at lateximagenumber}}%
     \boolfalse{mathjax}
@@ -7203,7 +7549,7 @@
     \LWR at traceinfo{lateximage: about to create open comment}%
     \LWR at htmlopencomment%
     \addtocounter{LWR at lateximagedepth}{1}%
-    \LWR at traceinfo{lateximage: about to create new page}%
+    \LWR at traceinfo{lateximage: about to create a new page}%
     \LWR at orignewpage%
     \LWR at traceinfo{lateximage: about to create minipage}%
     \LWR at origminipage{6in}%
@@ -7222,7 +7568,6 @@
     \LetLtxMacro\)\LWR at origcloseparen%
     \LetLtxMacro\[\LWR at origopenbracket%
     \LetLtxMacro\]\LWR at origclosebracket%
-    \let\@ensuredmath\LWR at orig@ensuredmath%
 }% end of outer-most lateximage
 \LWR at traceinfo{lateximage: finished start of environment}%
 }% end of \begin{lateximage}
@@ -7236,20 +7581,8 @@
     \LWR at origscriptsize%
     \LWR at htmlclosecomment{}\LWR at orignewline%
     \LWR at traceinfo{lateximage: The page after the image is \arabic{page}}%
-    \ifthenelse{\equal{#1}{LWRAMSMATHBODY}}%
-    {%
-    \LWR at subinlineimage[%
-    \LWR at HTMLsanitizeexpand{\detokenize\expandafter{\the\@envbody}}%
-    ]%
-    {lateximage}%
-    {lateximages\OSPathSymbol{}lateximage-\theLWR at externalfilecnt}%
-    {svg}%
-    {}%
-    }%
-    {%
     \LWR at subinlineimage[#1]{lateximage}%
     {lateximages\OSPathSymbol{}lateximage-\theLWR at externalfilecnt}{svg}{}%
-    }%
     \LWR at ensuredoingapar%
     \LWR at htmltag{/span}%
     \ifbool{HTMLDebugComments}{%
@@ -7272,7 +7605,9 @@
 \renewenvironment*{center}
 {
 \LWR at forcenewpage
-\BlockClass{center}
+\ifbool{FormatWP}
+{\BlockClass[text-align:center]{center}}
+{\BlockClass{center}}
 }
 {\endBlockClass}
 
@@ -7279,7 +7614,9 @@
 \renewenvironment*{flushright}
 {
 \LWR at forcenewpage
-\BlockClass{flushright}
+\ifbool{FormatWP}
+{\BlockClass[text-align:right]{flushright}}
+{\BlockClass{flushright}}
 }
 {\endBlockClass}
 
@@ -7286,7 +7623,9 @@
 \renewenvironment*{flushleft}
 {
 \LWR at forcenewpage
-\BlockClass{flushleft}
+\ifbool{FormatWP}
+{\BlockClass[text-align:left]{flushleft}}
+{\BlockClass{flushleft}}
 }
 {\endBlockClass}
 
@@ -7309,6 +7648,7 @@
 
 
 
+
 \begin{warpHTML}
 
 \PassOptionsToPackage{
@@ -7319,10 +7659,14 @@
 
 \end{warpHTML}
 
-
-
 \begin{warpprint}
 \define at key{Gin}{class}{}
+\AtBeginDocument{
+\@ifpackageloaded{overpic}{
+\newcommand*{\overpicfontsize}{12}
+\newcommand*{\overpicfontskip}{14}
+}{}
+}
 \end{warpprint}
 
 \begin{warpall}
@@ -7530,7 +7874,7 @@
 \boolfalse{LWR at minipagethispar}
 \RenewDocumentEnvironment{minipage}{O{t} o O{t} m}
 {%
-\uselengthunit{in}%
+\uselengthunit{PT}%
 \setlength{\LWR at minipagewidth}{#4}%
 \ifthenelse{\cnttest{\value{LWR at minipagedepth}}{=}{0}}{%
     \addtolength{\LWR at minipagewidth}{3em}% room for frames
@@ -7539,10 +7883,18 @@
     \setlength{\textheight}{9in}%
 }{}%
 \LWR at traceinfo{computed width is \rndprintlength{\LWR at minipagewidth}}
-\addtocounter{LWR at minipagedepth}{1}%
 \setlength{\LWR at minipageheight}{\textheight}% default unless specified
 \IfValueT{#2}{\setlength{\LWR at minipageheight}{#2}}%
+\addtocounter{LWR at minipagedepth}{1}%
+\ifbool{FormatWP}{\newline}{}%
 \LWR at stoppars%
+\ifbool{FormatWP}{%
+
+\addtocounter{LWR at thisfloat}{1}%
+\booltrue{LWR at freezethisfloat}%
+\LWR at htmltag{div id="autofloat-\arabic{LWR at thisfloat}" class="wpminipage"}%
+
+}{}%
 \LWR at traceinfo{minipage: creating div class}%
 \LWR at orignewpage%
 \LWR at htmltag{div class="minipage" style="%
@@ -7572,16 +7924,34 @@
 \setlength{\textheight}{9in}%
 \LWR at origraggedright%
 \LWR at startpars%
+\ifboolexpr{bool{FormatWP} and bool{WPMarkMinipages}}{%
+
+=== begin minipage ===
+
+}{}%
 \LWR at traceinfo{minipage: finished starting the minipage}%
 }
 {%
+\ifboolexpr{bool{FormatWP} and bool{WPMarkMinipages}}{%
+
+=== end minipage ===
+
+}{}%
 \LWR at stoppars%
 \LWR at endminipage% The following empty line is required:
 
+\ifbool{FormatWP}{%
+
+\LWR at htmlelementend{div}%
+\boolfalse{LWR at freezethisfloat}%
+
+}{}%
 \LWR at htmldivclassend{minipage}%
+
 \LWR at origvspace{1\baselineskip}% required for subcaption
 \addtocounter{LWR at minipagedepth}{-1}%
 \LWR at startpars%
+\ifbool{FormatWP}{\newline}{}%
 \global\booltrue{LWR at minipagethispar}%
 }
 \RenewDocumentCommand{\parbox}{O{t} o O{t} m +m}
@@ -7717,12 +8087,21 @@
 \begin{warpHTML}
 
 
+\DeclareRobustCommand{\LWR at HTMLtextstyle}[3]{%
+\ifbool{FormatWP}%
+{\LWR at htmlspanclass[#1]{#2}{#3}}%
+{\LWR at htmlspanclass{#2}{#3}}%
+}
+
 \DeclareRobustCommand{\LWR at HTMLemph}[1]{\LWR at htmlspan{em}{#1}}
 \DeclareRobustCommand{\LWR at nullemph}[1]{#1}
 \LetLtxMacro{\emph}{\LWR at HTMLemph}
 
-\DeclareRobustCommand{\LWR at HTMLtextmd}[1]{\LWR at htmlspanclass{textmd}{#1}}
+\DeclareRobustCommand{\LWR at HTMLtextmd}[1]{%
+\LWR at HTMLtextstyle{font-weight:normal}{textmd}{#1}%
+}
 \DeclareRobustCommand{\LWR at nulltextmd}[1]{#1}
+
 \LetLtxMacro{\textmd}{\LWR at HTMLtextmd}
 
 \DeclareRobustCommand{\LWR at HTMLtextbf}[1]{\LWR at htmlspan{b}{#1}}
@@ -7729,11 +8108,17 @@
 \DeclareRobustCommand{\LWR at nulltextbf}[1]{#1}
 \LetLtxMacro{\textbf}{\LWR at HTMLtextbf}
 
-\DeclareRobustCommand{\LWR at HTMLtextrm}[1]{\LWR at htmlspanclass{textrm}{#1}}
+\DeclareRobustCommand{\LWR at HTMLtextrm}[1]{%
+\LWR at HTMLtextstyle{font-family:serif}{textrm}{#1}%
+}
+
 \DeclareRobustCommand{\LWR at nulltextrm}[1]{#1}
+
 \LetLtxMacro{\textrm}{\LWR at HTMLtextrm}
 
-\DeclareRobustCommand{\LWR at HTMLtextsf}[1]{\LWR at htmlspanclass{textsf}{#1}}
+\DeclareRobustCommand{\LWR at HTMLtextsf}[1]{%
+\LWR at HTMLtextstyle{font-family:sans}{textsf}{#1}%
+}
 \DeclareRobustCommand{\LWR at nulltextsf}[1]{#1}
 \LetLtxMacro{\textsf}{\LWR at HTMLtextsf}
 
@@ -7741,8 +8126,12 @@
 \DeclareRobustCommand{\LWR at nulltexttt}[1]{#1}
 \LetLtxMacro{\texttt}{\LWR at HTMLtexttt}
 
-\DeclareRobustCommand{\LWR at HTMLtextup}[1]{\LWR at htmlspanclass{textup}{#1}}
+\DeclareRobustCommand{\LWR at HTMLtextup}[1]{%
+\LWR at HTMLtextstyle{font-variant:normal}{textup}{#1}%
+}
+
 \DeclareRobustCommand{\LWR at nulltextup}[1]{#1}
+
 \LetLtxMacro{\textup}{\LWR at HTMLtextup}
 
 \DeclareRobustCommand{\LWR at HTMLtextit}[1]{\LWR at htmlspan{i}{#1}}
@@ -7749,12 +8138,20 @@
 \DeclareRobustCommand{\LWR at nulltextit}[1]{#1}
 \LetLtxMacro{\textit}{\LWR at HTMLtextit}
 
-\DeclareRobustCommand{\LWR at HTMLtextsc}[1]{\LWR at htmlspanclass{textsc}{#1}}
+\DeclareRobustCommand{\LWR at HTMLtextsc}[1]{%
+\LWR at HTMLtextstyle{font-variant:small-caps}{textsc}{#1}%
+}
+
 \DeclareRobustCommand{\LWR at nulltextsc}[1]{#1}
+
 \LetLtxMacro{\textsc}{\LWR at HTMLtextsc}
 
-\DeclareRobustCommand{\LWR at HTMLtextsl}[1]{\LWR at htmlspanclass{testsl}{#1}}
+\DeclareRobustCommand{\LWR at HTMLtextsl}[1]{%
+\LWR at HTMLtextstyle{font-style:oblique}{textsl}{#1}%
+}
+
 \DeclareRobustCommand{\LWR at nulltextsl}[1]{#1}
+
 \LetLtxMacro{\textsl}{\LWR at HTMLtextsl}
 
 \DeclareRobustCommand{\LWR at HTMLtextnormal}[1]{\textmd{\textrm{\textup{#1}}}}
@@ -7804,6 +8201,7 @@
 \LetLtxMacro\underline\LWR at origunderline%
 \RenewDocumentCommand{\LWR at htmlspanclass}{o m +m}{##3}%
 \DeclareExpandableDocumentCommand{\InlineClass}{+o +m +m}{##3}%
+\DeclareRobustCommand{\LWR at HTMLtextstyle}[3]{##3}%
 }
 
 \renewcommand*{\mdseries}{}
@@ -7832,13 +8230,25 @@
 
 \renewcommand{\textsuperscript}[1]{\LWR at htmlspan{sup}{#1}}
 
+\renewcommand{\@textsuperscript}[1]{\LWR at htmlspan{sup}{#1}}
+
+\AtBeginDocument{
 \renewcommand{\textsubscript}[1]{\LWR at htmlspan{sub}{#1}}
+}
 
+\AtBeginDocument{
+\renewcommand{\@textsubscript}[1]{\LWR at htmlspan{sub}{#1}}
+}
+
 \AtBeginDocument{\let\up\textsuperscript}
 
 \AtBeginDocument{\let\fup\textsuperscript}
 
-\renewcommand{\underline}[1]{\InlineClass{underline}{#1}}
+\renewcommand{\underline}[1]{%
+\LWR at HTMLtextstyle%
+    {text-decoration:underline;text-decoration-skip}%
+    {underline}{#1}%
+}
 
 \renewcommand*{\hfill}{\qquad}
 
@@ -7940,15 +8350,23 @@
     \LWR at minipagestoppars%
     \ifthenelse{\dimtest{\LWR at tempwidth}{=}{.16667em}}
     {%
-    \HTMLunicode{2009}% thin breakable space
+        \HTMLunicode{2009}% thin breakable space
     }%
     {%
-    \uselengthunit{PT}%
-    \LWR at htmltagc{%
-    span style="width:\printlength{\LWR at tempwidth}; display:inline-block;"%
+        \uselengthunit{PT}%
+        \LWR at htmltagc{%
+            span style="width:\printlength{\LWR at tempwidth}; %
+                display:inline-block"%
+        }%
+        \ifbool{FormatWP}{%
+            \setlength{\LWR at templengthone}{\LWR at tempwidth}%
+            \whiledo{\lengthtest{\LWR at templengthone>1em}}{%
+                \quad%
+                \addtolength{\LWR at templengthone}{-1em}%
+            }%
+        }{}%
+        \LWR at htmltagc{/span}%
     }%
-    \LWR at htmltagc{/span}%
-    }%
     \LWR at minipagestartpars%
 }% width not 0
 }
@@ -7992,7 +8410,7 @@
     \LWR at htmltagc{%
     span
     style="%
-    background:\LWR at currenttextcolor; %
+    \ifbool{FormatWP}{}{background:\LWR at currenttextcolor; }%
     width:\printlength{\LWR at tempwidth}; %
     height:\printlength{\LWR at tempheight}; %
     \IfValueT{#1}%
@@ -8009,6 +8427,13 @@
     }%
     display:inline-block;"%
     }%
+        \ifbool{FormatWP}{%
+            \setlength{\LWR at templengthone}{\LWR at tempwidth}%
+            \whiledo{\lengthtest{\LWR at templengthone>1em}}{%
+                \_{}%
+                \addtolength{\LWR at templengthone}{-1em}%
+            }%
+        }{}%
     \LWR at htmltagc{/span}%
     \LWR at minipagestartpars%
 }% non-zero width
@@ -8032,14 +8457,27 @@
 \let\LWR at origTeX\TeX
 
 \newcommand*{\LWR at TeX}
-{\InlineClass{latexlogofont}%
-{\InlineClass{latexlogo}{T\textsubscript{e}X}}}
+{%
+    \InlineClass{latexlogofont}%
+    {%
+        \LWR at HTMLtextstyle%
+            {text-transform:uppercase}%
+            {latexlogo}%
+        {T\textsubscript{e}X}%
+    }%
+}
 \let\LWR at origLaTeX\LaTeX
 
 \newcommand*{\LWR at LaTeX}
-{\InlineClass{latexlogofont}%
-{\InlineClass{latexlogo}%
-{L\textsuperscript{a}T\textsubscript{e}X}}}
+{%
+    \InlineClass{latexlogofont}%
+    {%
+        \LWR at HTMLtextstyle%
+            {text-transform:uppercase}%
+            {latexlogo}%
+        {L\textsuperscript{a}T\textsubscript{e}X}%
+    }%
+}
 
 \let\LWR at origLaTeXe\LaTeXe
 



More information about the tex-live-commits mailing list