texlive[47225] trunk: lwarp (2apr18)

commits+karl at tug.org commits+karl at tug.org
Mon Apr 2 00:24:05 CEST 2018


Revision: 47225
          http://tug.org/svn/texlive?view=revision&revision=47225
Author:   karl
Date:     2018-04-02 00:24:04 +0200 (Mon, 02 Apr 2018)
Log Message:
-----------
lwarp (2apr18)

Modified Paths:
--------------
    trunk/Build/source/texk/texlive/linked_scripts/lwarp/lwarpmk.lua
    trunk/Build/source/texk/texlive/linked_scripts/ptex-fontmaps/kanji-config-updmap.pl
    trunk/Build/source/texk/texlive/linked_scripts/ptex-fontmaps/kanji-fontmap-creator.pl
    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-breakurl.sty
    trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-chemformula.sty
    trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-chemgreek.sty
    trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-chemmacros.sty
    trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-chemnum.sty
    trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-endfloat.sty
    trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-fancybox.sty
    trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-fancyvrb.sty
    trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-footmisc.sty
    trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-graphics.sty
    trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-hyperref.sty
    trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-longtable.sty
    trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-nameref.sty
    trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-siunitx.sty
    trunk/Master/texmf-dist/tex/latex/lwarp/lwarp.sty

Added Paths:
-----------
    trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-nicefrac.sty
    trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-url.sty

Modified: trunk/Build/source/texk/texlive/linked_scripts/lwarp/lwarpmk.lua
===================================================================
--- trunk/Build/source/texk/texlive/linked_scripts/lwarp/lwarpmk.lua	2018-04-01 22:21:24 UTC (rev 47224)
+++ trunk/Build/source/texk/texlive/linked_scripts/lwarp/lwarpmk.lua	2018-04-01 22:24:04 UTC (rev 47225)
@@ -4,7 +4,7 @@
 
 -- Print the usage of the lwarpmk command:
 
-printversion = "v0.51"
+printversion = "v0.52"
 
 function printhelp ()
 print ("lwarpmk: Use lwarpmk -h or lwarpmk --help for help.") ;
@@ -95,7 +95,7 @@
 -- Default configuration filename:
 local conffile = "lwarpmk.conf"
 -- Optional configuration filename:
-if arg[2] ~= nil then conffile = arg[2]..".lwarpmkconf" end
+if ( arg[2] ~= nil ) then conffile = arg[2]..".lwarpmkconf" end
 -- Default language:
 language = "english"
 -- Default xdyfile:
@@ -105,7 +105,9 @@
     -- file not exists
     print ("lwarpmk: ===")
     print ("lwarpmk: " .. conffile .." does not exist.")
-    print ("lwarpmk: " .. arg[2] .. " does not appear to be a project name.\n")
+    if ( arg[2] ~= nil ) then
+        print ("lwarpmk: " .. arg[2] .. " does not appear to be a project name.\n")
+    end
     print ("lwarpmk: ===")
     printhelp () ;
     os.exit(1) -- exit the entire lwarpmk script
@@ -286,10 +288,9 @@
 end
 
 -- Remove auxiliary files:
-
+-- All aux files are removed since there may be many bbl*.aux files.
 function removeaux ()
-os.execute ( rmname .. " " ..
-    sourcename ..".aux " .. sourcename .. "_html.aux " ..
+os.execute ( rmname .. " *.aux " ..
     sourcename ..".toc " .. sourcename .. "_html.toc " ..
     sourcename ..".lof " .. sourcename .. "_html.lof " ..
     sourcename ..".lot " .. sourcename .. "_html.lot " ..
@@ -297,7 +298,7 @@
     sourcename ..".ind " .. sourcename .. "_html.ind " ..
     sourcename ..".log " .. sourcename .. "_html.log " ..
     sourcename ..".gl* " .. sourcename .. "_html.gl* " ..
-    "*_html_inc.*"
+    " *_html_inc.* "
     )
 end
 
@@ -332,6 +333,8 @@
         os.exit(1) ;
     end
 end -- create lwarp_one_limage.cmd
+-- Track the number of parallel processes
+numimageprocesses = 0
 -- Scan lateximages.txt
 for line in limagesfile:lines() do
 -- lwimgpage is the page number in the PDF which has the image
@@ -340,6 +343,8 @@
 i,j,lwimgpage,lwimghash,lwimgname = string.find (line,"|(.*)|(.*)|(.*)|")
 -- For each entry:
 if ( (i~=nil) ) then
+-- Skip if the page number is 0:
+if ( lwimgpage ~= "0" ) then
 -- Skip is this image is hashed and already exists:
 local lwimgfullname = "lateximages" .. dirslash .. lwimgname .. ".svg"
 if (
@@ -361,7 +366,6 @@
 if opsystem=="Unix" then
 -- For Unix / Linux / Mac OS:
 err = os.execute(
--- print (
 cmdgroupopenname ..
 "pdfseparate -f " .. lwimgpage .. " -l " .. lwimgpage .. " " ..
     sourcename .."_html.pdf " ..
@@ -380,10 +384,29 @@
 rmname .. " lateximages" .. dirslash .. "lateximagetemp-" .. lwimgpage .. ".pdf" ..
 cmdgroupclosename .. " >/dev/null " .. bgname
 )
+-- Every 32 images, wait for completion at below normal priority,
+--  allowing other image tasks to catch up.
+numimageprocesses = numimageprocesses + 1
+if ( numimageprocesses > 32 ) then
+    numimageprocesses = 0
+    print ( "lwarpmk: waiting" )
+    err = os.execute ( "wait" )
+end
 elseif opsystem=="Windows" then
 -- For Windows
+-- Every 32 images, wait for completion at below normal priority,
+--  allowing other image tasks to catch up.
+numimageprocesses = numimageprocesses + 1
+if ( numimageprocesses > 32 ) then
+    numimageprocesses = 0
+    thiswaitcommand = "/WAIT /BELOWNORMAL"
+    print ( "lwarpmk: waiting" )
+else
+    thiswaitcommand = ""
+end
+-- Execute the image generation command
 err = os.execute (
-    "start /b \"\" lwarp_one_limage " ..
+    "start /B " .. thiswaitcommand .. " \"\" lwarp_one_limage " ..
     lwimgpage .. " " ..
     lwimghash .. " " ..
     lwimgname .. " " ..
@@ -397,6 +420,7 @@
     os.exit(1)
 end
 end -- not hashed or not exists
+end -- not page 0
 end -- not nil
 end -- do
 io.close(limagesfile)
@@ -575,16 +599,12 @@
 print ("lwarpmk: Done.")
 
 -- lwarpmk limages:
--- Scan the lateximages.txt file to create lateximages,
--- then touch the source to trigger a recompile.
+-- Scan the lateximages.txt file to create lateximages.
 
 elseif arg[1] == "limages" then
 loadconf ()
 print ("lwarpmk: Processing images.")
 createlateximages ()
-print ("lwarpmk: Forcing an update of " .. sourcename ..".tex.")
-refreshdate ()
-print ("lwarpmk: " .. sourcename ..".tex is ready to be recompiled.")
 print ("lwarpmk: Done.")
 
 -- lwarpmk again:

Modified: trunk/Build/source/texk/texlive/linked_scripts/ptex-fontmaps/kanji-config-updmap.pl
===================================================================
--- trunk/Build/source/texk/texlive/linked_scripts/ptex-fontmaps/kanji-config-updmap.pl	2018-04-01 22:21:24 UTC (rev 47224)
+++ trunk/Build/source/texk/texlive/linked_scripts/ptex-fontmaps/kanji-config-updmap.pl	2018-04-01 22:24:04 UTC (rev 47225)
@@ -1,6 +1,6 @@
 #!/usr/bin/env perl
 # kanji-config-updmap: setup Japanese font embedding
-# Version 20180306.0
+# Version 20180328.0
 #
 # formerly known as updmap-setup-kanji
 #
@@ -22,7 +22,7 @@
 use strict;
 
 my $prg = "kanji-config-updmap";
-my $version = '20180306.0';
+my $version = '20180328.0';
 
 my $updmap_real = "updmap";
 my $updmap = $updmap_real;
@@ -132,11 +132,29 @@
 #
 my %representatives;
 my @databaselist = "ptex-fontmaps-data.dat";
-push @databaselist, "ptex-fontmaps-macos-data.dat";
+push @databaselist, "ptex-fontmaps-macos-data.dat" if (macosx_new());
 
 
 main(@ARGV);
 
+sub macosx { return ($^O=~/^darwin$/i); }
+
+sub macosx_new {
+  if (macosx()) {
+    my $macos_ver = `sw_vers -productVersion`;
+    my $macos_ver_major = $macos_ver;
+    $macos_ver_major =~ s/^(\d+)\.(\d+).*/$1/;
+    my $macos_ver_minor = $macos_ver;
+    $macos_ver_minor =~ s/^(\d+)\.(\d+).*/$2/;
+    if ($macos_ver_major==10) {
+      if ($macos_ver_minor>=11) {
+        return 1;
+      }
+    }
+  }
+  return 0;
+}
+
 sub version {
   my $ret = sprintf "%s version %s\n", $prg, $version;
   return $ret;

Modified: trunk/Build/source/texk/texlive/linked_scripts/ptex-fontmaps/kanji-fontmap-creator.pl
===================================================================
--- trunk/Build/source/texk/texlive/linked_scripts/ptex-fontmaps/kanji-fontmap-creator.pl	2018-04-01 22:21:24 UTC (rev 47224)
+++ trunk/Build/source/texk/texlive/linked_scripts/ptex-fontmaps/kanji-fontmap-creator.pl	2018-04-01 22:24:04 UTC (rev 47225)
@@ -2,7 +2,7 @@
 #
 # kanji-fontmap-creator
 # (c) 2012-2014 Norbert Preining
-# Version: 20180306.0
+# Version: 20180328.0
 # Licenced under the GPLv2 or any higher version
 #
 # gui to create map files for (kanji-config-)updmap
@@ -41,7 +41,7 @@
 my $opt_version = 0;
 
 my $prg = "kanji-fontmap-creator";
-my $version = "20180306.0";
+my $version = "20180328.0";
 
 #
 # global vars configuring operation

Modified: trunk/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl
===================================================================
--- trunk/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl	2018-04-01 22:21:24 UTC (rev 47224)
+++ trunk/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl	2018-04-01 22:24:04 UTC (rev 47225)
@@ -1,12 +1,12 @@
 #!/usr/bin/env perl
-# $Id: tlmgr.pl 47092 2018-03-23 22:22:46Z preining $
+# $Id: tlmgr.pl 47132 2018-03-26 17:19:25Z karl $
 #
 # Copyright 2008-2018 Norbert Preining
 # This file is licensed under the GNU General Public License version 2
 # or any later version.
 
-my $svnrev = '$Revision: 47092 $';
-my $datrev = '$Date: 2018-03-23 23:22:46 +0100 (Fri, 23 Mar 2018) $';
+my $svnrev = '$Revision: 47132 $';
+my $datrev = '$Date: 2018-03-26 19:19:25 +0200 (Mon, 26 Mar 2018) $';
 my $tlmgrrevision;
 my $tlmgrversion;
 my $prg;
@@ -1086,7 +1086,7 @@
   # if --all is given, pass on to uninstall_texlive
   if ($opts{'all'}) {
     if (@ARGV) {
-      tlwarn("$prg: No additional arguments allowed with --all\n");
+      tlwarn("$prg: No additional arguments allowed with --all: @ARGV\n");
       return($F_ERROR);
     }
     exit(uninstall_texlive());
@@ -7951,6 +7951,10 @@
 The C<remove> argument requires a key id and removes the requested id
 from the local keyring.
 
+=head2 list
+
+Synonym for L<info>.
+
 =head2 option
 
 =over 4
@@ -8233,7 +8237,8 @@
 
 =item B<--all>
 
-Uninstalls all of TeX Live.
+Uninstalls all of TeX Live, asking for confirmation unless C<--force> is
+also specified.
 
 =item B<--backup>
 
@@ -8469,9 +8474,268 @@
 
 =back
 
+ym.
+
+=head2 print-platform-info
+
+Print the TeX Live platform identifier, TL platform long name, and
+original output from guess.
+
+=head2 remove [I<option>]... I<pkg>...
+
+Remove each I<pkg> specified.  Removing a collection removes all package
+dependencies (unless C<--no-depends> is specified), but not any
+collection dependencies of that collection.  However, when removing a
+package, dependencies are never removed.  Options:
+
+=over 4
+
+=item B<--all>
+
+Uninstalls all of TeX Live, asking for confirmation unless C<--force> is
+also specified.
+
+=item B<--backup>
+
+=item B<--backupdir> I<directory>
+
+These options behave just as with the L</update> action (q.v.), except
+they apply to making backups of packages before they are removed.  The
+default is to make such a backup, that is, to save a copy of packages
+before removal.
+
+See L</update> action for more.
+
+neither option is given, no backup will be made. If C<--backupdir> is
+given and specifies a writable directory then a backup will be made in
+that location. If only C<--backup> is given, then a backup will be made
+to the directory previously set via the C<option> action (see below). If
+both are given then a backup will be made to the specified I<directory>.
+
+You can set options via the C<option> action to automatically make
+backups for all packages, and/or keep only a certain number of backups.
+Please see the C<option> action for details. The default is to make one
+backup.
+
+The C<restore> action explains how to restore from a backup.
+
+=item B<--no-depends>
+
+Do not remove dependent packages.
+
+=item B<--no-depends-at-all>
+
+See above under B<install> (and beware).
+
+=item B<--force>
+
+By default, removal of a package or collection that is a dependency of
+another collection or scheme is not allowed.  With this option, the
+package will be removed unconditionally.  Use with care.
+
+A package that has been removed using the C<--force> option because it
+is still listed in an installed collection or scheme will not be
+updated, and will be mentioned as B<forcibly removed> in the output of
+B<tlmgr update --list>.
+
+=item B<--dry-run>
+
+Nothing is actually removed; instead, the actions to be performed are
+written to the terminal.
+
+=back
+
+=head2 repository
+
+=over 4
+
+=item B<repository list>
+
+=item B<repository list I<path|tag>>
+
+=item B<repository add I<path> [I<tag>]>
+
+=item B<repository remove I<path|tag>>
+
+=item B<repository set I<path>[#I<tag>] [I<path>[#I<tag>] ...]>
+
+This action manages the list of repositories.  See L</MULTIPLE
+REPOSITORIES> below for detailed explanations.
+
+The first form (C<list>) lists all configured repositories and the
+respective tags if set. If a path, url, or tag is given after the
+C<list> keyword, it is interpreted as source from where to 
+initialize a TeX Live Database and lists the contained packages.
+This can also be an up-to-now not used repository, both locally
+and remote. If one pass in addition C<--with-platforms>, for each
+package the available platforms (if any) are listed, too.
+
+The third form (C<add>) adds a repository
+(optionally attaching a tag) to the list of repositories.  The forth
+form (C<remove>) removes a repository, either by full path/url, or by
+tag.  The last form (C<set>) sets the list of repositories to the items
+given on the command line, not keeping previous settings
+
+In all cases, one of the repositories must be tagged as C<main>;
+otherwise, all operations will fail!
+
+=back
+
+=head2 restore [--json] [--backupdir I<dir>] [--all | I<pkg> [I<rev>]]
+
+Restore a package from a previously-made backup.
+
+If C<--all> is given, try to restore the latest revision of all 
+package backups found in the backup directory.
+
+Otherwise, if neither I<pkg> nor I<rev> are given, list the available
+backup revisions for all packages.  With I<pkg> given but no I<rev>,
+list all available backup revisions of I<pkg>.
+
+When listing available packages, C<tlmgr> shows the revision, and in
+parenthesis the creation time if available (in format yyyy-mm-dd hh:mm).
+
+If (and only if) both I<pkg> and a valid revision number I<rev> are
+specified, try to restore the package from the specified backup.
+
+Options:
+
+=over 4
+
+=item B<--all>
+
+Try to restore the latest revision of all package backups found in the
+backup directory. Additional non-option arguments (like I<pkg>) are not
+allowed.
+
+=item B<--backupdir> I<directory>
+
+Specify the directory where the backups are to be found. If not given it
+will be taken from the configuration setting in the TLPDB.
+
+=item B<--dry-run>
+
+Nothing is actually restored; instead, the actions to be performed are
+written to the terminal.
+
+=item B<--force>
+
+Don't ask questions.
+
+=item B<--json>
+
+When listing backups, the option C<--json> turn on JSON output.
+The format is an array of JSON objects (C<name>, C<rev>, C<date>).
+For details see C<tlpkg/doc/JSON-formats.txt>, format definition: C<TLBACKUPS>.
+If both C<--json> and C<--data> are given, C<--json> takes precedence.
+
+=back
+
+=head2 search [I<option>...] I<what>
+
+=head3 search [I<option>...] --file I<what>
+
+=head3 search [I<option>...] --all I<what>
+
+By default, search the names, short descriptions, and long descriptions
+of all locally installed packages for the argument I<what>, interpreted
+as a (Perl) regular expression.
+
+Options:
+
+=over 4
+
+=item B<--file>
+
+List all filenames containing I<what>.
+
+=item B<--all>
+
+Search everything: package names, descriptions and filenames.
+
+=item B<--global>
+
+Search the TeX Live Database of the installation medium, instead of the
+local installation.
+
+=item B<--word>
+
+Restrict the search of package names and descriptions (but not
+filenames) to match only full words.  For example, searching for
+C<table> with this option will not output packages containing the word
+C<tables> (unless they also contain the word C<table> on its own).
+
+=back
+
+=head2 shell
+
+Starts an interactive mode, where tlmgr prompts for commands. This can
+be used directly, or for scripting. The first line of output is
+C<protocol> I<n>, where I<n> is an unsigned number identifying the
+protocol version (currently 1).
+
+In general, tlmgr actions that can be given on the command line
+translate to commands in this shell mode.  For example, you can say
+C<update --list> to see what would be updated. The TLPDB is loaded the
+first time it is needed (not at the beginning), and used for the rest of
+the session.
+
+Besides these actions, a few commands are specific to shell mode:
+
+=over 4
+
+=item protocol
+
+Print C<protocol I<n>>, the current protocol version.
+
+=item help
+
+Print pointers to this documentation.
+
+=item version
+
+Print tlmgr version information.
+
+=item quit, end, bye, byebye, EOF
+
+Exit.
+
+=item restart
+
+Restart C<tlmgr shell> with the original command line; most useful when
+developing C<tlmgr>.
+
+=item load [local|remote]
+
+Explicitly load the local or remote, respectively, TLPDB.
+
+=item save
+
+Save the local TLPDB, presumably after other operations have changed it.
+
+=item get [I<var>]
+=item set [I<var> [I<val>]]
+
+Get the value of I<var>, or set it to I<val>.  Possible I<var> names:
+C<debug-translation>, C<machine-readable>, C<no-execute-actions>,
+C<require-verification>, C<verify-downloads>, C<repository>, and
+C<prompt>. All except C<repository> and C<prompt> are booleans, taking
+values 0 and 1, and behave like the corresponding command line option.
+The C<repository> variable takes a string, and sets the remote
+repository location. The C<prompt> variable takes a string, and sets the
+current default prompt.
+
+If I<var> or then I<val> is not specified, it is prompted for.
+
+=back
+
+=head2 show
+
+Synonym for L<info>.
+
 =head2 uninstall
 
-Synonym for C<remove>.
+Synonym for L<remove>.
 
 =head2 update [I<option>]... [I<pkg>]...
 
@@ -9356,7 +9620,7 @@
 distribution (L<http://tug.org/texlive>) and both are licensed under the
 GNU General Public License Version 2 or later.
 
-$Id: tlmgr.pl 47092 2018-03-23 22:22:46Z preining $
+$Id: tlmgr.pl 47132 2018-03-26 17:19:25Z karl $
 =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	2018-04-01 22:21:24 UTC (rev 47224)
+++ trunk/Master/texmf-dist/doc/latex/lwarp/README.txt	2018-04-01 22:24:04 UTC (rev 47225)
@@ -1,5 +1,5 @@
 
-LaTeX lwarp package v0.51   README.txt
+LaTeX lwarp package v0.52   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	2018-04-01 22:21:24 UTC (rev 47224)
+++ trunk/Master/texmf-dist/scripts/lwarp/lwarpmk.lua	2018-04-01 22:24:04 UTC (rev 47225)
@@ -4,7 +4,7 @@
 
 -- Print the usage of the lwarpmk command:
 
-printversion = "v0.51"
+printversion = "v0.52"
 
 function printhelp ()
 print ("lwarpmk: Use lwarpmk -h or lwarpmk --help for help.") ;
@@ -95,7 +95,7 @@
 -- Default configuration filename:
 local conffile = "lwarpmk.conf"
 -- Optional configuration filename:
-if arg[2] ~= nil then conffile = arg[2]..".lwarpmkconf" end
+if ( arg[2] ~= nil ) then conffile = arg[2]..".lwarpmkconf" end
 -- Default language:
 language = "english"
 -- Default xdyfile:
@@ -105,7 +105,9 @@
     -- file not exists
     print ("lwarpmk: ===")
     print ("lwarpmk: " .. conffile .." does not exist.")
-    print ("lwarpmk: " .. arg[2] .. " does not appear to be a project name.\n")
+    if ( arg[2] ~= nil ) then
+        print ("lwarpmk: " .. arg[2] .. " does not appear to be a project name.\n")
+    end
     print ("lwarpmk: ===")
     printhelp () ;
     os.exit(1) -- exit the entire lwarpmk script
@@ -286,10 +288,9 @@
 end
 
 -- Remove auxiliary files:
-
+-- All aux files are removed since there may be many bbl*.aux files.
 function removeaux ()
-os.execute ( rmname .. " " ..
-    sourcename ..".aux " .. sourcename .. "_html.aux " ..
+os.execute ( rmname .. " *.aux " ..
     sourcename ..".toc " .. sourcename .. "_html.toc " ..
     sourcename ..".lof " .. sourcename .. "_html.lof " ..
     sourcename ..".lot " .. sourcename .. "_html.lot " ..
@@ -297,7 +298,7 @@
     sourcename ..".ind " .. sourcename .. "_html.ind " ..
     sourcename ..".log " .. sourcename .. "_html.log " ..
     sourcename ..".gl* " .. sourcename .. "_html.gl* " ..
-    "*_html_inc.*"
+    " *_html_inc.* "
     )
 end
 
@@ -332,6 +333,8 @@
         os.exit(1) ;
     end
 end -- create lwarp_one_limage.cmd
+-- Track the number of parallel processes
+numimageprocesses = 0
 -- Scan lateximages.txt
 for line in limagesfile:lines() do
 -- lwimgpage is the page number in the PDF which has the image
@@ -340,6 +343,8 @@
 i,j,lwimgpage,lwimghash,lwimgname = string.find (line,"|(.*)|(.*)|(.*)|")
 -- For each entry:
 if ( (i~=nil) ) then
+-- Skip if the page number is 0:
+if ( lwimgpage ~= "0" ) then
 -- Skip is this image is hashed and already exists:
 local lwimgfullname = "lateximages" .. dirslash .. lwimgname .. ".svg"
 if (
@@ -361,7 +366,6 @@
 if opsystem=="Unix" then
 -- For Unix / Linux / Mac OS:
 err = os.execute(
--- print (
 cmdgroupopenname ..
 "pdfseparate -f " .. lwimgpage .. " -l " .. lwimgpage .. " " ..
     sourcename .."_html.pdf " ..
@@ -380,10 +384,29 @@
 rmname .. " lateximages" .. dirslash .. "lateximagetemp-" .. lwimgpage .. ".pdf" ..
 cmdgroupclosename .. " >/dev/null " .. bgname
 )
+-- Every 32 images, wait for completion at below normal priority,
+--  allowing other image tasks to catch up.
+numimageprocesses = numimageprocesses + 1
+if ( numimageprocesses > 32 ) then
+    numimageprocesses = 0
+    print ( "lwarpmk: waiting" )
+    err = os.execute ( "wait" )
+end
 elseif opsystem=="Windows" then
 -- For Windows
+-- Every 32 images, wait for completion at below normal priority,
+--  allowing other image tasks to catch up.
+numimageprocesses = numimageprocesses + 1
+if ( numimageprocesses > 32 ) then
+    numimageprocesses = 0
+    thiswaitcommand = "/WAIT /BELOWNORMAL"
+    print ( "lwarpmk: waiting" )
+else
+    thiswaitcommand = ""
+end
+-- Execute the image generation command
 err = os.execute (
-    "start /b \"\" lwarp_one_limage " ..
+    "start /B " .. thiswaitcommand .. " \"\" lwarp_one_limage " ..
     lwimgpage .. " " ..
     lwimghash .. " " ..
     lwimgname .. " " ..
@@ -397,6 +420,7 @@
     os.exit(1)
 end
 end -- not hashed or not exists
+end -- not page 0
 end -- not nil
 end -- do
 io.close(limagesfile)
@@ -575,16 +599,12 @@
 print ("lwarpmk: Done.")
 
 -- lwarpmk limages:
--- Scan the lateximages.txt file to create lateximages,
--- then touch the source to trigger a recompile.
+-- Scan the lateximages.txt file to create lateximages.
 
 elseif arg[1] == "limages" then
 loadconf ()
 print ("lwarpmk: Processing images.")
 createlateximages ()
-print ("lwarpmk: Forcing an update of " .. sourcename ..".tex.")
-refreshdate ()
-print ("lwarpmk: " .. sourcename ..".tex is ready to be recompiled.")
 print ("lwarpmk: Done.")
 
 -- lwarpmk again:

Modified: trunk/Master/texmf-dist/source/latex/lwarp/lwarp.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/lwarp/lwarp.dtx	2018-04-01 22:21:24 UTC (rev 47224)
+++ trunk/Master/texmf-dist/source/latex/lwarp/lwarp.dtx	2018-04-01 22:24:04 UTC (rev 47225)
@@ -16,7 +16,7 @@
 % \iffalse
 %<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
 %<package>\ProvidesPackage{lwarp}
-%<package>    [2018/03/24 v0.51  Allows LaTeX to directly produce HTML5 output.]
+%<package>    [2018/04/01 v0.52  Allows LaTeX to directly produce HTML5 output.]
 %
 %<*driver>
 \documentclass{ltxdoc}
@@ -361,19 +361,24 @@
 }
 {\smallskip\hrule\endminipage\hspace*{\fill}\bigskip}
 
-% \makeatletter
-% \newcommand{\watchout}[1][]{%
-% \@bsphack%
-% \marginpar{\raggedleft\textcolor{blue!70!black}{#1} \quad \includegraphics[height=3ex]{symbol_warning.pdf}}
-% \@esphack%
-% }
-% \makeatother
-
 \newcommand{\pdflatexonly}{
 \textcolor{red}{Only pre-loaded if \prog{pdflatex} is being used.}
 \marginpar{\raggedleft\textcolor{blue!70!black}{\prog{pdflatex} only:}}
 }
 
+% From package dtxdescribe:
+% \makeatletter
+% \renewcommand{\watchout}[1][]{%
+% \@ifundefined{@captype}{% not float?
+% % \@bsphack%
+% \marginpar{\raggedleft%
+% \textcolor{red!50!black}{\warningsign\normalsize\quad#1}}%
+% % \@esphack%
+% \ignorespaces%
+% }{}% not float?
+% }
+% \makeatother
+
 % \newcommand{\margintag}[1]{%
 % \marginpar{\raggedleft\textcolor{blue!70!black}{#1}}%
 % }
@@ -456,6 +461,10 @@
 \pkg{lwarp} emulates \pkg{hyperref}, including the creation of active hyperlinks,
 but does not require that \pkg{hyperref} be loaded by the document.
 
+Do not place a \texttt{\%} character between arguments for \cs{hyperref}, etc.,
+\watchout[comment character \%]
+as this is one of the characters which is neutralized for inclusion in \HTML\ \acro{URL}s.
+
 \pkg{lwarp} can also load \pkg{url}, but \pkg{url} should not be used at the
 same time as \pkg{hyperref}, since they both define the \cs{url} command.
 \pkg{lwarp} does not (yet) attempt to convert \pkg{url} links into hyperlinks
@@ -736,11 +745,44 @@
 
 \newcommand{\limitsfootnotes}{
 \pkg{lwarp} uses native \LaTeX\ footnote code, although with its own
-\cs{box} to avoid the \LaTeX\ output routine.  The usual functions work as-is.
+\cs{box} to avoid the \LaTeX\ output routine.  The usual functions mostly work as-is.
 
-\limitspfnote
+The \pkg{footmisc} \optn{stable} option is emulated by \pkg{lwarp}.
+
+When using footnotes in sectioning commands, \watchout[sectioning commands]
+to generate consistent results between print and \HTML, use
+the \pkg{footmisc} package with the \optn{stable} option,
+provide a short \TOC\ entry, and \cs{protect} the \cs{footnote}:
+\begin{sourcedisplay}
+\cs{usepackage}[\textcolor{red}{stable}]\{footmisc\}\\
+\dots\\
+\cs{subsection}\textcolor{red}{[Subsection Name]}\\
+\hspace*{2em}\{Subsection Name\textcolor{red}{\cs{protect}}\cs{footnote}\{A footnote.\}\}
+\end{sourcedisplay}
+
+Do not use a starred sectioning command.  As an alternative, it may be possible to
+adjust \cs{secnumdepth} instead.
+% Attempting to use \cs{footnotemark} instead
+% of \cs{footnote} may result in misnumbered footnotes in the print document.
 }
 
+\newcommand{\limitsverbatimfootnotes}{%
+If using \pkg{fancybox} or \pkg{fancyvrb} with \cs{VerbatimFootnotes},
+\watchout[\cs{VerbatimFootnotes}]
+and using footnotes in a sectioning command or display math,
+\watchout[sectioning or displaymath]
+use \cs{footnotemark} and \cs{footnotetext}:
+\begin{sourcedisplay}
+\cs{subsection}[Subsection Name]\\
+\hspace*{2em}\{Subsection Name\cs{protect}\textcolor{red}{\cs{footnotemark}}\} \\
+\textcolor{red}{\cs{footnotetext}}\{A footnote with \cs{verb}+verbtim+.\} \\
+\end{sourcedisplay}
+and likewise for equations or display math.
+
+At present there is a bug such that paragraph closing tags are not present in
+footnotes when \cs{VerbatimFootnotes} are selected.  The browser usually compensates.
+}
+
 \newcommand{\limitskomascript}{
 Many features are ignored during the \HTML\ conversion.
 The goal is source-level compatibility.
@@ -839,8 +881,17 @@
 \index{font>size --- math, SVG}%
 \index{math>font size --- SVG}%
 \index{lateximages>font size}%
-by setting \cs{LateximageFontSizeName} to a font size name --- \emph{without the backslash}, for ex: \\
-\hspace*{.5in}\texttt{\cs{renewcommand}\{\cs{LateximageFontSizeName}\}\{\textcolor{red}{large}\}}
+by setting \cs{LateximageFontSizeName} to a font size name --- \emph{without the backslash},
+which defaults to:
+\begin{sourcedisplay}
+\cs{renewcommand}\{\cs{LateximageFontSizeName}\}\{\textcolor{red}{large}\}
+\end{sourcedisplay}
+
+For inline \SVG\ math, font size is instead controlled by \cs{LateximageFontScale},
+which defaults to:
+\begin{sourcedisplay}
+\cs{newcommand}*\{\cs{LateximageFontScale}\}\{\textcolor{red}{.75}\}
+\end{sourcedisplay}
 }
 
 
@@ -867,6 +918,25 @@
 }
 
 
+\newcommand{\limitscustomizemathjax}{%
+\brand{MathJax} does not have preexisting support every possible math function.
+Additional \brand{MathJax} function definitions may be
+defined.  These will be declared at the start of each \HTML\ page,
+and thus will have a global effect.
+
+Examples:
+\begin{sourcedisplay}
+\cs{CustomizeMathJax}\{ \\
+    \hspace*{2em}\cs{newcommand}\{\cs{expval}\}[1]\{\cs{langle}\#1\cs{rangle}\} \\
+    \hspace*{2em}\cs{newcommand}\{\cs{abs}\}[1]\{\cs{lvert}\#1\cs{rvert}\} \\
+\} \\
+\cs{CustomizeMathJax}\{\cs{newcommand}\{\cs{arsinh}\}\{\cs{text}\{arsinh\}\}\} \\
+\cs{CustomizeMathJax}\{\cs{newcommand}\{\cs{arcosh}\}\{\cs{text}\{arcosh\}\}\}
+\cs{CustomizeMathJax}\{\cs{newcommand}\{\cs{NN}\}\{\cs{mathbb}\{N\}\}\}
+\end{sourcedisplay}
+}
+
+
 \newcommand{\limitsmath}{%
 
 \subsubsection{Rendering tradeoffs}
@@ -950,6 +1020,12 @@
 seamlessly integrating with the rest of the \LaTeX\ code.
 \end{enumerate}
 
+\subsubsection{Customizing \brand{MathJax}}
+\index{MathJax>custom functions}
+\index{math>MathJax custom functions}
+\limitscustomizemathjax
+
+\subsubsection{\brand{MathJax} limitations}
 Limitations when using \brand{MathJax} include:
 \margintag{\brand{MathJax} limitations}
 \DescribeProgram{MathJax}
@@ -999,26 +1075,6 @@
     \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 \brand{MathJax} does not automatically support custom \LaTeX{} macros,
-    \margintag{custom MathJax macros}
-    \index{MathJax>custom macros}
-    but they may be created by the user inside a math expression:
-    \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}
 }
 
@@ -1257,6 +1313,11 @@
 \newcommand{\limitstabbing}{%
 The \env{tabbing} environment works, except that \SVG\ math and \env{lateximage}s
 do not yet work inside the environment.
+
+If math is used inside \env{tabbing}, \margintag{math in \env{tabbing}}
+place \env{tabbing} inside
+a \env{lateximage} environment, which will render the entire environment as
+a single \SVG\ image.
 }
 
 \newcommand{\limitstabular}{%
@@ -1845,7 +1906,7 @@
 }
 
 \newcommand{\limitsnicefrac}{%
-\pkg{units} and \pkg{nicefrac} work as-is with \pkg{lwarp}, but
+\pkg{units} and \pkg{nicefrac} work with \pkg{lwarp}, but
 \brand{MathJax} does not have an extension for \pkg{units} or \pkg{nicefrac}.
 These packages do work with \pkg{lwarp}'s option \optn{svgmath}.
 }
@@ -2001,7 +2062,7 @@
 %<*package>
 % \fi
 %
-% \CheckSum{22904}
+% \CheckSum{23333}
 %
 % \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
@@ -2094,6 +2155,7 @@
 % \changes{v0.49}{2018/02/19}{\ 2018/02/19}
 % \changes{v0.50}{2018/03/03}{\ 2018/03/03}
 % \changes{v0.51}{2018/03/24}{\ 2018/03/24}
+% \changes{v0.52}{2018/04/01}{\ 2018/04/01}
 
 
 
@@ -2286,9 +2348,50 @@
 % see the end of the Change History on page \pageref{sec:changesend}.
 %
 % \begin{description}
+% \needspace{2\baselineskip}
+% \item[v0.52:] \
+%   \begin{itemize}
+%       \item Improved install instructions regarding \filenm{lwarp\_baseline\_marker.png}.
+%           \margintag{documentation}
+%       \item Added documentation regarding footnotes in section headings,
+%           and footnotes with \cs{VerbatimFootnotes}
+%           from \pkg{fancybox}, \pkg{fancyvrb}.  See \cref{sec:limitsfootnotes}.
+%       \item Added documentation regarding font selection when using
+%           \XeLaTeX\ or \LuaLaTeX\ with \pkg{fontspec} and traditional font packages.
+%           See \cref{sec:fonts}.
+%       \item Fix: Limit the number of background tasks
+%           \margintag{SVG math}
+%           when generating \env{lateximage}s.
+%       \item Added user-adjustable \SVG\ math font scaling.  See \cref{sec:mathfontscale}.
+%       \item Added warnings if \filenm{lwarp\_baseline\_marker.png} is not present, or
+%               if \pkg{graphicx} or \pkg{graphics} is not loaded.
+%       \item Improved \cs{ensuremath} hashing expansion.
+%       \item Fix: \env{equation*} with \env{split}.
+%       \item \env{tabbing} now works inside a \env{lateximage}.  Use for math in \env{tabbing}.
+%       \item Fix: MathJax script was not executing in some conditions.
+%               \margintag{MathJax}
+%       \item Added \cs{CustomizeMathJax} to add custom functions.
+%               See \cref{sec:limitsmath}.
+%       \item Fix: Footnote numbering when using \progcode{HTMLDebugComments}.
+%               \margintag{footnotes}
+%       \item Fix: Footnote paragraph tags.
+%       \item Fix: \progcode{FootnoteDepth} defaults to \cs{subsubsection}.
+%       \item Fix: \cs{kill} in a \env{lateximage}. \margintag{misc. fixes}
+%       \item Fix: \cs{FileDepth}, misc. others, when input encoding is not \optn{utf8}.
+%       \item Fix: \cs{texorpdfstring} in a section name.
+%       \item \pkg{hyperref} emulation: Fix for \progcode{\#}, \progcode{\%}, \margintag{packages}
+%                   \progcode{\&}, \progcode{\~}, \progcode{\_} characters in \acro{URL}s.
+%       \item \pkg{fancybox}, \pkg{fancyvrb}: Initial support for \cs{VerbatimFootnotes}.
+%       \item \pkg{nicefrac}: Added with fix for \cs{ensuremath}.
+%       \item \pkg{graphicx}: Fix for option defaults.  Added v1.1a/b options.
+%       \item \pkg{endfloat}: Updated for v2.6.
+%       \item \pkg{url}: Fixes for active characters.
+%   \end{itemize}
+% \needspace{2\baselineskip}
 % \item[v0.51:] \
 %   \begin{itemize}
 %       \item Docs: Added \nameref{sec:thingstoavoid}.
+%           \margintag{documentation}
 %       \item Docs: Added to \nameref{sec:convertexisting}.
 %       \item Docs: Multiple authors and affiliations with custom classes.
 %           See \cref{sec:authorsaffils}.
@@ -2311,6 +2414,7 @@
 %           \pkg{chemfig}, \pkg{chemformula}, \pkg{chemmacros}, \pkg{chemnum}, \pkg{chemgreek},
 %           \pkg{epstopdf-base}, \pkg{grid}, \pkg{ltxgrid}.
 %   \end{itemize}
+% \needspace{2\baselineskip}
 % \item[v0.50:] \
 %   \begin{itemize}
 %       \item \SVG\ math and other \env{lateximage}s now are
@@ -2342,6 +2446,7 @@
 %           \pkg{schemata},
 %           \pkg{dblfloatfix}, \pkg{nonfloat}, \pkg{morefloats}.
 %   \end{itemize}
+% \needspace{2\baselineskip}
 % \item[v0.49:] \
 %   \begin{itemize}
 %       \item Added \pkg{xcolor} \cs{rowcolors}.\margintag{tabular}
@@ -2358,7 +2463,7 @@
 % \item[v0.48:] \
 %   \begin{itemize}
 %       \item Added some documentation
-%           \margintag{docs}
+%           \margintag{documentation}
 %           regarding converting an existing document.  See \cref{sec:convertexisting}.
 %       \item Updated compatibility for new \pkg{cleveref} v0.21.\margintag{\pkg{cleveref}}
 %       \item Fix: Ignores optional tabular column arguments.\margintag{tabular}
@@ -2409,7 +2514,8 @@
 % \needspace{2\baselineskip}
 % \item[v0.45:] \
 %   \begin{itemize}
-%       \item Improved \prog{MikTeX} install instructions.\margintag{docs}
+%       \item Improved \prog{MikTeX} install instructions.
+%           \margintag{documentation}
 %       \item Improved graphics and \pkg{epstopdf} instructions.
 %       \item Updates to the \nameref{sec:introduction}.
 %       \item Added \pkg{memoir}, \pkg{memhfixc}.
@@ -2468,7 +2574,7 @@
 %   \begin{itemize}
 %       \item Docs: Reorganized \HTML\ customization, added an \HTML\ settings table.
 %           See \cref{sec:htmlsettings}.
-%       \item Added |FootnoteDepth| to control the placement
+%       \item Added \progcode{FootnoteDepth} to control the placement
 %           \margintag{footnotes}
 %           of pending footnotes before section breaks.
 %           By default, pending footnotes are printed before
@@ -3073,10 +3179,11 @@
 % an uncounted number more work as-is.
 %
 % Packages have been selected according to several criteria: perceived importance,
-% popularity lists, recent CTAN updates, CTAN topics, mention in other packages, support by other
-% \HTML\ conversion methods,
-% and from sample documents taken from public archives\footnote{An amazing number of
-% decades-old packages are still in use today.}.
+% popularity lists, recent CTAN updates, CTAN topics, mention in other packages,
+% support by other \HTML\ conversion methods,
+% and from sample documents taken from public archives.
+% These include some ``obsolete'' packages as well.\footnote{An amazing number of
+% decades-old packages are still in use today.}
 %
 % \rulebreak
 %
@@ -3255,8 +3362,9 @@
 % Theorems: & Native \LaTeX\ theorems,
 %	\pkg{theorem}, \pkg{amsthm}, \pkg{ntheorem}. \\
 %
-% Additional math: & Math fonts via \SVG\ images, \pkg{resizegather}.
-%   As-is: \pkg{delarray}, \pkg{bm}, \pkg{braket}, \pkg{tikz-cd}, etc. \\
+% Additional math: & Math fonts via \SVG\ images, \pkg{resizegather}, \pkg{xy}.
+%   As-is: \pkg{delarray}, \pkg{bm}, \pkg{braket},
+%   \pkg{amscd}, \pkg{pb-diagram}, \pkg{tikz-cd}, etc. \\
 %
 % Display math with \cs{displaymathother}: & %
 %   Complicated math objects in display math, such as \pkg{tikz-cd}, etc. \\
@@ -3268,10 +3376,10 @@
 % Science and engineering: &
 %   \pkg{listings}, \pkg{algorithmicx}, \pkg{bytefield}, \pkg{axodraw2},
 %   \pkg{phfqit}, \pkg{mhchem},
-%   \pkg{chemfig}, \pkg{chemformula}, \pkg{chemmacros}, \pkg{chemnum}. \pkg{chemgreek}, 
+%   \pkg{chemfig}, \pkg{chemformula}, \pkg{chemmacros}, \pkg{chemnum}. \pkg{chemgreek}.
 %   Tested to work with \SVG\ math: \pkg{physics}, \pkg{slashed},
 %       \pkg{heppennames}, \pkg{hepnicenames},
-%       \pkg{simpler-wick}, \pkg{linop}, \pkg{blochsphere}, \pkg{elements}, etc.
+%       \pkg{simpler-wick}, \pkg{linop}, \pkg{blochsphere}, \pkg{bohr}, \pkg{elements}, etc.
 %       \emph{(Math-mode packages generally work as-is with \SVG\ math.)} \\
 %
 % \midrule
@@ -3715,14 +3823,14 @@
 %	\end{enumerate}
 %
 % \item[CTAN \filenm{.dtx} and \filenm{.ins} files:] Another form of \TeX\ package
-%	is the |.dtx| and |.ins| source files.  These files are used to create
+%	is |.dtx| and |.ins| source files.  These files are used to create
 %	the documentation and |.sty| files.
 %
 %	\begin{enumerate}
 %	\item See \url{http://ctan.org/pkg/lwarp} for the \pkg{lwarp} package.
-%	\item Download the zip archive |lwarp.zip| into your own |lwarp| directory.
-%	\item Unpack |lwarp.zip|.
-%	\item Locate the contents |lwarp.dtx| and |lwarp.ins|
+%	\item Download the zip archive \filenm{lwarp.zip} into your own \filenm{lwarp} directory.
+%	\item Unpack \filenm{lwarp.zip}.
+%	\item Locate the contents \filenm{lwarp.dtx} and \filenm{lwarp.ins}
 %	\item Create the documentation: \userentry{pdflatex lwarp.dtx} (several times)
 %	\item Create the |.sty| files: \userentry{pdflatex lwarp.ins}
 %	\item Copy the |.sty| files somewhere such as the \TeX\ Live local tree
@@ -3730,7 +3838,10 @@
 %		\begin{sourcedisplay}
 %		|<texlocal>/tex/latex/local/lwarp|
 %		\end{sourcedisplay}
-%	\item Copy the documentation |lwarp.pdf| to a |source| directory in the local tree,
+%   \item Copy \filenm{lwarp\_baseline\_marker.png} to the same place
+%       as the \filenm{.sty} files.
+% \changes{v0.52}{2018/03/24}{Docs: Improved install instructions.}
+%	\item Copy the documentation \filenm{lwarp.pdf} to a \filenm{source} directory in the local tree,
 %		such as:
 %		\begin{sourcedisplay}
 %		|<texlocal>/doc/local/lwarp|
@@ -3751,7 +3862,10 @@
 %		directory, then compiled right there, alongside the
 %		document source files.  The resultant |*.sty| and \filenm{lwarpmk.lua} files
 %		may be used as-is, so long as they are in the same directory
-%		as the document source.  This approach is especially useful if
+%		as the document source.
+%       The file \filenm{lwarp\_baseline\_marker.png} must also be copied as well.
+% \changes{v0.52}{2018/03/24}{Docs: Improved install instructions.}
+%       This approach is especially useful if
 %		you would like to temporarily test\margintag{Just testing!}\
 %		\pkg{lwarp} before deciding whether to permanently install it.
 % \end{description}
@@ -4564,10 +4678,9 @@
 %
 % While using \prog{pdflatex},
 % \margintag{pdflatex, T1, UTF8}
-% \pkg{fontenc} is automatically loaded with T1 encoding,
-% and \pkg{inputenc} is automatically loaded with UTF8 encoding, each of which
-% is required for the conversion process.
+% \pkg{fontenc} is automatically loaded with T1 encoding.
 % \pkg{fontenc} may be loaded with an additional encoding after \pkg{lwarp}.
+% \pkg{inputenc} is automatically loaded with UTF8 encoding if if has not yet been loaded.
 %
 % While using \prog{pdflatex}, if no font-related package is specified, the default
 % \margintag{vector fonts}
@@ -4596,7 +4709,9 @@
 % Do NOT use \pkg{fontenc}!
 %
 % Place \pkg{fontspec} or \pkg{fontenc} and other font and UTF-8 related commands
-% after the \cs{documentclass} command and before |\usepackage{lwarp}|:
+% after the \cs{documentclass} command and before |\usepackage{lwarp}|.
+% In some cases, a package conflict may require that a font package be loaded
+% after \pkg{lwarp}, which should work as well.
 %
 % \begin{enumerate}
 % \item |documentclass{article/book/report}| goes here, followed by any of:
@@ -4653,6 +4768,14 @@
 % \item |\usepackage{newtxmath}| or other math-related font packages.
 %       Many of these load \pkg{amsmath}, which must be loaded after \pkg{lwarp},
 %       so they must also be loaded after \pkg{lwarp}.
+% \item |\setmonofont{TeX Gyre Cursor}| or similar may be required if using
+%       \watchout[\pkg{fontspec} with traditional font packages]
+%       \XeLaTeX\ or \LuaLaTeX\ and \pkg{fontspec} along with
+%       traditional font packages such as \pkg{txfonts}, \pkg{newtxtext}, etc.
+%       This is required to turn off the monospaced font's ligatures
+%       with \pkg{fontspec} after loading the traditional font packages.
+%       Monospaced output ligatures must be turned off
+%       to produce the correct \HTML\ characters.
 % \item \ldots{} the rest of the preamble and the main document.
 % \end{enumerate}
 %
@@ -4951,9 +5074,9 @@
 %   so the rest of the filename must be sufficiently unique to avoid name collisions.
 %   \index{file>unique names}
 %
-% \ItemDescribeCounter{FootnoteDepth} \DescribeDefault{5}
+% \ItemDescribeCounter{FootnoteDepth} \DescribeDefault{3}
 %   Determines where to place pending footnotes.
-%   |5| places footnotes before each break down to the \cs{subparagraph} level.
+%   |3| places footnotes before each break down to the \cs{subsubsection} level.
 %   |1| places footnotes before each \cs{section} break.
 %   Any pending footnotes are also placed at the bottom of each page
 %   before each file break.
@@ -5685,11 +5808,24 @@
 %
 %
 % \subsubsection{Footnotes and page notes}
+% \label{sec:limitsfootnotes}
 %
+% \index{footnotes>misnumbered}
+% \index{footnotes>in sectioning commands}
+%
 % \limitsfootnotes
 %
+% \index{footnotes>verbatim}
+% \index{verbatim>footnotes}
+% \index{footnotes>in sectioning commands}
+% \index{footnotes>in math}
+% \index{math>footnotes}
+% \limitsverbatimfootnotes
 %
+% \limitspfnote
 %
+%
+%
 % \subsection{Front and back matter}
 % \label{sec:frontbackmatter}
 %
@@ -5828,7 +5964,7 @@
 % \index{display math>complicated objects}
 % \index{math>display with complicated objects}
 % \index{tikz>in display math}
-% \index{math>with \tikz}\index{equation>with \tikz}
+% \index{math>\tikz}\index{equation>with \tikz}
 % \index{MathJax>errors}\index{HTML>alt tags}\index{alt tags}
 %
 % \describedisplaymathother
@@ -5836,8 +5972,8 @@
 % \subsubsection{\pkg{chemformula} package}
 % \limitschemformula
 % \index{chemformula>troubleshooting}
-% \index{array>and chemformula}
-% \index{math>and chemformula}
+% \index{array>\pkg{chemformula}}
+% \index{math>\pkg{chemformula}}
 %
 % \subsubsection{\pkg{mhchem} package}
 %
@@ -5917,6 +6053,8 @@
 %
 % \subsection{Tabbing}
 % \limitstabbing
+% \index{tabbing>and math}
+% \index{math>\env{tabbing}}
 %
 %
 % \subsection{Tabular}
@@ -6774,13 +6912,12 @@
 %   See \cref{sec:displaymathother}.
 %
 % \needspace{3\baselineskip}
-% \item [Missing sections:] ~
-%	\begin{itemize}
-%	\item See \cref{sec:filedepth} regarding the
+% \item [Missing sections:] See \cref{sec:filedepth} regarding the
 %		|FileDepth| and |SideTOCDepth| counters,
 %		and the use of \cs{tableofcontents} in the home page.
-%	\end{itemize}
 %
+% \item [Misnumbered footnotes from section headings:] See \cref{sec:limitsfootnotes}.
+%
 % \item [Missing HTML files:] \
 %   \begin{itemize}
 %	\item See the warning regarding changes to the \HTML\ settings
@@ -6798,6 +6935,11 @@
 %	\item \limitscpageref
 %	\end{itemize}
 %
+% \item [Malformed URLs:] Do not use the \texttt{\%} character between
+%   \index{hyperref>incorrect links}
+%   arguments of \cs{hyperref}, etc., as this character is among those which
+%   is neutralized for inclusion in \HTML\ \acro{URL}s.
+%
 % \item [Em-dashes or En-dashes in listing captions and titles:] \
 %
 %	Use	\XeLaTeX\ or \LuaLaTeX.
@@ -7098,14 +7240,20 @@
 %
 % When using pdf\LaTeX, \pkg{lwarp} required T1 and UTF8 encoding.
 %
+% If some other input encoding is already defined, try to use it instead, and
+% hope for the best.
+%
 % \XeLaTeX\ and Lua\LaTeX\ are both UTF8 by nature.
 %
 % \changes{v0.44}{2017/11/16}{If pdfLaTeX, require T1 and UTF8 encoding.}
+% \changes{v0.52}{2018/03/26}{If pdfLaTeX, allow other input encoding.}
 %
 %    \begin{macrocode}
 \ifPDFTeX
 \RequirePackage[T1]{fontenc}
+\@ifpackageloaded{inputenc}{}{
 \RequirePackage[utf8]{inputenc}
+}
 \fi
 %    \end{macrocode}
 %
@@ -7890,6 +8038,7 @@
 \LWR at loadafter{newtxmath}
 % newunicodechar must be loaded before lwarp
 \LWR at notmemoirloadafter{nextpage}
+\LWR at loadafter{nicefrac}
 \LWR at loadafter{nonfloat}
 \LWR at loadafter{nonumonpart}
 \LWR at loadafter{nopageno}
@@ -7975,6 +8124,7 @@
 % \LWR at loadafter{typearea}% preloaded by koma-script classes
 \LWR at loadafter{ulem}
 \LWR at loadafter{upref}
+\LWR at loadafter{url}
 \LWR at loadafter{varioref}% no lwarp package provided
 \LWR at notmemoirloadafter{verse}
 \LWR at loadafter{vertbars}
@@ -7996,7 +8146,7 @@
 
 
 
-
+% ^^A *required
 % \section{Required packages}
 % \label{sec:requiredpackages}
 % \index{package>required}
@@ -8185,12 +8335,13 @@
 % \changes{v0.20}{2017/01/12}{Page geometry set to 6in wide with large margins.}
 % \changes{v0.27}{2017/04/04}{Page geometry modified to reduce line overflow.}
 % \changes{v0.28}{2017/04/13}{Forced oneside to maintain large right margin.}
+% \changes{v0.52}{2018/03/31}{Fix: MathJax script line wraps.  Reduced right margin.}
 %
 % \codehtml
 %    \begin{macrocode}
 \begin{warpHTML}
 \RequirePackage[paperheight=190in,paperwidth=20in,%
-left=2in,right=12in,%
+left=2in,right=6in,%
 top=1in,bottom=1in,%
 ]{geometry}
 \@twosidefalse
@@ -8312,8 +8463,6 @@
 }
 %    \end{macrocode}
 
-
-
 %    \begin{macrocode}
 \end{warpall}
 %    \end{macrocode}
@@ -8337,7 +8486,7 @@
 %    \end{macrocode}
 
 
-% \DescribePackage{xstring}
+% \DescribePackage{verbatim}
 %    \begin{macrocode}
 \RequirePackage{verbatim}
 %    \end{macrocode}
@@ -10532,10 +10681,14 @@
     font-size: .85em ;
 }
 
+span.verbatim {
+    font-family: "DejaVu Mono", "Bitstream Vera Mono", "Lucida Console",
+        "Nimbus Mono L", "Liberation Mono", "FreeMono", "Andale Mono",
+        "Courier New", monospace;
+}
 
 
 
-
 div.published
 {
     text-align: center ;
@@ -11640,14 +11793,27 @@
 
 % \subsection{lwarpmk option}
 
-% The following is only generated if the \optn{lwarpmk} option
-%	was given to \pkg{lwarp}.
-%    \begin{macrocode}
-\begin{LWR at createlwarpmk}
-%    \end{macrocode}
-
-% \DescribeProgram{lwarpmk} Creates a local copy of \prog{lwarpmk}:
+% \DescribeOption{lwarpmk} Creates a local copy of \prog{lwarpmk}.
 %
+% \DescribeProgram{lwarpmk} Command-line utility to process \pkg{lwarp} files and images.
+%
+% \env{lateximage}s and \SVG\ math images are generated using
+% \margintag{parallel processing}
+% \index{images>processing}
+% \index{lateximages>processing}
+% \index{SVG>image processing}
+% multiple processes in parallel.
+% For \brand{Unix} and \brand{Linux}, every 32 images the |wait| command is
+% issued to wait for the previous batch of images to finish processing before
+% starting a new batch.
+% For \brand{Windows}, every 32 images one task is dispatched with
+% \begin{sourcedisplay}
+% START /B /WAIT /BELOWNORMAL
+% \end{sourcedisplay}
+% which causes the operating system to wait until this lesser-priority tasks finishes,
+% hopefully also waiting for the normal priority tasks which were already in
+% progress to also complete.  Afterwards, the next batch of images is started.
+%
 % \changes{v0.21}{2017/02/11}{\prog{lwarpmk}: Fix: \cmds{lwarpmk again} for \brand{Windows}.}
 % \changes{v0.21}{2017/02/22}{\prog{lwarpmk}: Fix: \cmds{lwarpmk limages} for \brand{Windows}.}
 % \changes{v0.21}{2017/02/22}{\prog{lwarpmk}: Fix: \prog{lwarpmk} uses \filenm{lateximages} text file instead of shell script.}
@@ -11670,7 +11836,15 @@
 % \changes{v0.50}{2018/02/28}{\prog{lwarpmk}: Improved error messages.}
 % \changes{v0.51}{2018/03/14}{\prog{lwarpmk}: \prog{pdfcrop}: Restored \optn{hires} option.}
 % \changes{v0.51}{2018/03/16}{\prog{lwarpmk}: \prog{pdftocairo} \optn{-noshrink} added.}
+% \changes{v0.52}{2018/03/31}{\prog{lwarpmk}: Fix: Memory overflow when spawning tasks.}
+% \changes{v0.52}{2018/04/01}{\prog{lwarpmk}: Fix: Skip image generation if from page 0.}
 %
+% The following is only generated if the \optn{lwarpmk} option
+%   was given to \pkg{lwarp}.
+%    \begin{macrocode}
+\begin{LWR at createlwarpmk}
+%    \end{macrocode}
+%
 % ^^A *lwarpmk.lua
 %    \begin{macrocode}
 \begin{filecontents*}{lwarpmk.lua}
@@ -11680,7 +11854,7 @@
 
 -- Print the usage of the lwarpmk command:
 
-printversion = "v0.51"
+printversion = "v0.52"
 
 function printhelp ()
 print ("lwarpmk: Use lwarpmk -h or lwarpmk --help for help.") ;
@@ -11772,7 +11946,7 @@
 -- Default configuration filename:
 local conffile = "lwarpmk.conf"
 -- Optional configuration filename:
-if arg[2] ~= nil then conffile = arg[2]..".lwarpmkconf" end
+if ( arg[2] ~= nil ) then conffile = arg[2]..".lwarpmkconf" end
 -- Default language:
 language = "english"
 -- Default xdyfile:
@@ -11782,7 +11956,9 @@
     -- file not exists
     print ("lwarpmk: ===")
     print ("lwarpmk: " .. conffile .." does not exist.")
-    print ("lwarpmk: " .. arg[2] .. " does not appear to be a project name.\n")
+    if ( arg[2] ~= nil ) then
+        print ("lwarpmk: " .. arg[2] .. " does not appear to be a project name.\n")
+    end
     print ("lwarpmk: ===")
     printhelp () ;
     os.exit(1) -- exit the entire lwarpmk script
@@ -11969,10 +12145,9 @@
 
 
 -- Remove auxiliary files:
-
+-- All aux files are removed since there may be many bbl*.aux files.
 function removeaux ()
-os.execute ( rmname .. " " ..
-    sourcename ..".aux " .. sourcename .. "_html.aux " ..
+os.execute ( rmname .. " *.aux " ..
     sourcename ..".toc " .. sourcename .. "_html.toc " ..
     sourcename ..".lof " .. sourcename .. "_html.lof " ..
     sourcename ..".lot " .. sourcename .. "_html.lot " ..
@@ -11980,7 +12155,7 @@
     sourcename ..".ind " .. sourcename .. "_html.ind " ..
     sourcename ..".log " .. sourcename .. "_html.log " ..
     sourcename ..".gl* " .. sourcename .. "_html.gl* " ..
-    "*_html_inc.*"
+    " *_html_inc.* "
     )
 end
 
@@ -12015,6 +12190,8 @@
         os.exit(1) ;
     end
 end -- create lwarp_one_limage.cmd
+-- Track the number of parallel processes
+numimageprocesses = 0
 -- Scan lateximages.txt
 for line in limagesfile:lines() do
 -- lwimgpage is the page number in the PDF which has the image
@@ -12023,6 +12200,8 @@
 i,j,lwimgpage,lwimghash,lwimgname = string.find (line,"|(.*)|(.*)|(.*)|")
 -- For each entry:
 if ( (i~=nil) ) then
+-- Skip if the page number is 0:
+if ( lwimgpage ~= "0" ) then
 -- Skip is this image is hashed and already exists:
 local lwimgfullname = "lateximages" .. dirslash .. lwimgname .. ".svg"
 if (
@@ -12044,7 +12223,6 @@
 if opsystem=="Unix" then
 -- For Unix / Linux / Mac OS:
 err = os.execute(
--- print (
 cmdgroupopenname ..
 "pdfseparate -f " .. lwimgpage .. " -l " .. lwimgpage .. " " .. 
     sourcename .."_html.pdf " ..
@@ -12063,10 +12241,29 @@
 rmname .. " lateximages" .. dirslash .. "lateximagetemp-" .. lwimgpage .. ".pdf" ..
 cmdgroupclosename .. " >/dev/null " .. bgname
 )
+-- Every 32 images, wait for completion at below normal priority,
+--  allowing other image tasks to catch up.
+numimageprocesses = numimageprocesses + 1
+if ( numimageprocesses > 32 ) then
+    numimageprocesses = 0
+    print ( "lwarpmk: waiting" )
+    err = os.execute ( "wait" )
+end
 elseif opsystem=="Windows" then
 -- For Windows
+-- Every 32 images, wait for completion at below normal priority,
+--  allowing other image tasks to catch up.
+numimageprocesses = numimageprocesses + 1
+if ( numimageprocesses > 32 ) then
+    numimageprocesses = 0
+    thiswaitcommand = "/WAIT /BELOWNORMAL"
+    print ( "lwarpmk: waiting" )
+else
+    thiswaitcommand = ""
+end
+-- Execute the image generation command
 err = os.execute (
-    "start /b \"\" lwarp_one_limage " ..
+    "start /B " .. thiswaitcommand .. " \"\" lwarp_one_limage " ..
     lwimgpage .. " " ..
     lwimghash .. " " ..
     lwimgname .. " " ..
@@ -12080,6 +12277,7 @@
     os.exit(1)
 end
 end -- not hashed or not exists
+end -- not page 0
 end -- not nil
 end -- do
 io.close(limagesfile)
@@ -12261,16 +12459,12 @@
 print ("lwarpmk: Done.")
 
 -- lwarpmk limages:
--- Scan the lateximages.txt file to create lateximages,
--- then touch the source to trigger a recompile.
+-- Scan the lateximages.txt file to create lateximages.
 
 elseif arg[1] == "limages" then
 loadconf ()
 print ("lwarpmk: Processing images.")
 createlateximages ()
-print ("lwarpmk: Forcing an update of " .. sourcename ..".tex.")
-refreshdate ()
-print ("lwarpmk: " .. sourcename ..".tex is ready to be recompiled.")
 print ("lwarpmk: Done.")
 
 -- lwarpmk again:
@@ -13186,7 +13380,6 @@
 % \cs{protect} is in case the tag appears in TOC, LOF, LOT.
 %    \begin{macrocode}
 \newcommand*{\LWR at htmltagc}[1]{%
-{%
 \LWR at traceinfo{LWR at htmltagc !\detokenize{#1}!}%
 \begingroup%
 \LWR at FBcancel%
@@ -13195,8 +13388,7 @@
 #1%
 \protect\LWR at origtextgreater%
 \endgroup%
-\LWR at traceinfo{LWR at htmltagc: done}%
-}%
+% \LWR at traceinfo{LWR at htmltagc: done}%
 }
 %    \end{macrocode}
 % \end{macro}
@@ -13799,7 +13991,7 @@
 %    \begin{macrocode}
 \newcommand*{\LWR at closeparagraph}
 {%
-\LWR at traceinfo{LWR at closeparagraph}%
+% \LWR at traceinfo{LWR at closeparagraph}%
 %    \end{macrocode}
 % See if paragraph handling is enabled:
 %    \begin{macrocode}
@@ -13908,7 +14100,7 @@
 %    \begin{macrocode}
 \newcommand*{\LWR at startpars}%
 {%
-\LWR at traceinfo{LWR at startpars}%
+% \LWR at traceinfo{LWR at startpars}%
 %    \end{macrocode}
 % Ignore if inside a span:
 %    \begin{macrocode}
@@ -13947,7 +14139,7 @@
 %    \begin{macrocode}
     \global\boolfalse{LWR at doingapar}%
 }% nestspan
-\LWR at traceinfo{LWR at startpars: done}%
+% \LWR at traceinfo{LWR at startpars: done}%
 }
 %    \end{macrocode}
 % \end{macro}
@@ -14254,7 +14446,8 @@
 %
 % \subsection{Regular page footnotes}
 % In \HTML\ documents, footnotes are placed at the
-% bottom of the web page using the \LaTeX\ box \cs{LWR at footnotes}.
+% bottom of the web page or the section, depending on \progcode{FootnoteDepth},
+% using the \LaTeX\ box \cs{LWR at footnotes}.
 % Using this instead of the original \cs{footins} box
 % avoids having footnotes be printed by the output routine,
 % since footnotes should be printed per \HTML\ page
@@ -14279,14 +14472,15 @@
 \begin{warpall}
 %    \end{macrocode}
 
-% \DescribeCounter{FootnoteDepth} \DescribeDefault{5} Determines how deeply
+% \DescribeCounter{FootnoteDepth} \DescribeDefault{3} Determines how deeply
 % to place footnotes in the \HTML\ files, similar to |tocdepth|.
-% The default of |5| places footnotes before each \cs{subparagraph} or higher.
+% The default of |3| places footnotes before each \cs{subsubsection} or higher.
 % See \cref{tab:depthsheadings} for a table of \LaTeX\ section headings.
 % \changes{v0.43}{2017/11/08}{Added \progcode{FootnoteDepth}.}
+% \changes{v0.52}{2018/03/28}{Changed \progcode{FootnoteDepth} default to \cs{subsbusection}.}
 %    \begin{macrocode}
 \newcounter{FootnoteDepth}
-\setcounter{FootnoteDepth}{5}
+\setcounter{FootnoteDepth}{3}
 %    \end{macrocode}
 
 %    \begin{macrocode}
@@ -14319,7 +14513,9 @@
 %
 % \begin{macro}{\@makefnmark}
 %    \begin{macrocode}
-\def\@makefnmark{\hbox{\textsuperscript{\@thefnmark}}}
+\def\@makefnmark{%
+    \textsuperscript{\@thefnmark}%
+}
 %    \end{macrocode}
 % \end{macro}
 %
@@ -14361,7 +14557,7 @@
 %    \begin{macrocode}
     \color at begingroup%
 %    \end{macrocode}
-% Use \HTML\ superscripts even inside a \env{lateximage}:
+% Use \HTML\ superscripts in the footnote even inside a \env{lateximage}:
 % \changes{v0.50}{2018/02/20}{Robustify macros.}
 %    \begin{macrocode}
     \renewrobustcmd{\textsuperscript}[1]{\LWR at htmlspan{sup}{##1}}%
@@ -14395,6 +14591,11 @@
 %    \begin{macrocode}
     \color at endgroup%
 }% vbox
+%    \end{macrocode}
+% Paragraph handling:
+% \changes{v0.52}{2018/03/28}{Fix: Paragraph handling.}
+%    \begin{macrocode}
+\LWR at ensuredoingapar%
 }%
 %    \end{macrocode}
 % \end{macro}
@@ -14401,7 +14602,7 @@
 
 % \begin{macro}{\@footnotetext} \marg{text}
 %    \begin{macrocode}
-\let\@footnotetext\LWR at footnotetext
+\LetLtxMacro\@footnotetext\LWR at footnotetext
 %    \end{macrocode}
 % \end{macro}
 %
@@ -14423,13 +14624,13 @@
 \long\def\@mpfootnotetext#1{%
 \LWR at traceinfo{@mpfootnotetext}%
 \global\setbox\LWR at mpfootnotes\vbox{%
-    \unvbox\LWR at mpfootnotes
-    \reset at font\footnotesize
-    \hsize\columnwidth
-    \@parboxrestore
-    \protected at edef\@currentlabel
-    {\csname p at mpfootnote\endcsname\@thefnmark}%
-    \color at begingroup
+    \unvbox\LWR at mpfootnotes%
+    \reset at font\footnotesize%
+    \hsize\columnwidth%
+    \@parboxrestore%
+    \protected at edef\@currentlabel%
+        {\csname p at mpfootnote\endcsname\@thefnmark}%
+    \color at begingroup%
 %    \end{macrocode}
 % Use paragraph tags if in a tabular data cell or a \env{lateximage}:
 %    \begin{macrocode}
@@ -14455,6 +14656,11 @@
     }%
     \color at endgroup%
 }% vbox
+%    \end{macrocode}
+% Paragraph handling:
+% \changes{v0.52}{2018/03/28}{Fix: Paragraph handling.}
+%    \begin{macrocode}
+\LWR at ensuredoingapar%
 \LWR at traceinfo{@mpfootnotetext: done}%
 }
 %    \end{macrocode}
@@ -14720,7 +14926,6 @@
 %
 % Replaces common symbols and short words with hyphens:
 %    \begin{macrocode}
-% \LWR at traceinfo{LWR at filenamenoblanks \#1: !#1!}%
 \edef\LWR at thisnewfilename{#1}%
 \LWR at traceinfo{LWR at filenamenoblanks edef: !\LWR at thisnewfilename!}%
 \fullexpandarg%
@@ -14799,12 +15004,27 @@
 \StrSubstitute{\LWR at thisnewfilename}{----}{-}[\LWR at thisnewfilename]
 \StrSubstitute{\LWR at thisnewfilename}{---}{-}[\LWR at thisnewfilename]
 \StrSubstitute{\LWR at thisnewfilename}{--}{-}[\LWR at thisnewfilename]
+%    \end{macrocode}
+% If pdf\LaTeX\ and not \optn{utf8} encoding, don't try to convert emdash, endash:
+% \changes{v0.52}{2018/04/01}{Fix: \cs{FileDepth} with non-utf8 encoding.}
+%    \begin{macrocode}
+\ifPDFTeX%
+\ifdefstring{\inputencodingname}{utf8}{%
 \StrSubstitute{\LWR at thisnewfilename}{—}{-}[\LWR at thisnewfilename]
 %     emdash
 \StrSubstitute{\LWR at thisnewfilename}{–}{-}[\LWR at thisnewfilename]
 %     endash
+}{}%
+\else% not PDFTeX
+\StrSubstitute{\LWR at thisnewfilename}{—}{-}[\LWR at thisnewfilename]
+\StrSubstitute{\LWR at thisnewfilename}{–}{-}[\LWR at thisnewfilename]
+\fi%
+%    \end{macrocode}
+% Return the result:
+%    \begin{macrocode}
 \global\let\LWR at thisfilename\LWR at thisnewfilename% return a global result
-\endgroup
+\endgroup%
+\LWR at traceinfo{LWR at filenamenoblanks: result is \LWR at thisfilename}%
 }
 %    \end{macrocode}
 % \end{macro}
@@ -14833,17 +15053,42 @@
 % \end{macro}
 
 
-% \begin{macro}{\LWR at nullifymathjaxensuremath}
+% \begin{macro}{\LWR at customizedMathJax}
+% Additional \brand{MathJax} definitions to be added to the start of each \HTML\ page.
+% \changes{v0.52}{2018/03/31}{Added.}
+%    \begin{macrocode}
+\newcommand*{\LWR at customizedMathJax}{}
+%    \end{macrocode}
+% \end{macro}
+
+% \begin{macro}{\CustomizeMathJax}
+%
+% \limitscustomizemathjax
+%
+% \changes{v0.52}{2018/03/31}{Added.}
+%    \begin{macrocode}
+\newcommand*{\CustomizeMathJax}[1]{%
+    \appto{\LWR at customizedMathJax}{%
+        \(#1\)\par
+    }%
+}
+%    \end{macrocode}
+% \end{macro}
+
+% \begin{macro}{\LWR at customizeMathJax}
 % \changes{v0.51}{2018/03/18}{MathJax: Nullifies \cs{ensuremath}.}
 %    \begin{macrocode}
-\newcommand{\LWR at nullifymathjaxensuremath}{%
+\newcommand{\LWR at customizeMathJax}{%
 \ifbool{mathjax}{
 \LWR at stoppars
 \LWR at htmlcomment{Nullify \textbackslash{}ensuremath for MathJax:}
 
-\(
-\newcommand\ensuremath[1]{##1}
-\)
+\(\newcommand\ensuremath[1]{##1}\)
+
+\LWR at htmlcomment{Additional customizations for MathJax:}
+
+\LWR at customizedMathJax
+
 \LWR at startpars
 }{}
 }
@@ -14850,7 +15095,34 @@
 %    \end{macrocode}
 % \end{macro}
 
+%    \begin{macrocode}
+\end{warpHTML}
+%    \end{macrocode}
 
+
+% \codeprint
+%    \begin{macrocode}
+\begin{warpprint}
+%    \end{macrocode}
+
+% \begin{macro}{\CustomizeMathJax}
+% The print-mode version:
+%    \begin{macrocode}
+\newcommand*{\CustomizeMathJax}[1]{}
+%    \end{macrocode}
+% \end{macro}
+
+%    \begin{macrocode}
+\end{warpprint}
+%    \end{macrocode}
+
+
+
+% \codehtml
+%    \begin{macrocode}
+\begin{warpHTML}
+%    \end{macrocode}
+
 % \begin{macro}{\LWR at newhtmlfile} \marg{section name}
 % \changes{v0.18}{2016/04/23}{side\TOC\ after title, improving responsive design.}
 % \changes{v0.21}{2017/02/22}{Skip title if not given.}
@@ -14942,9 +15214,18 @@
 
 %    \end{macrocode}
 %
-%
+% If pdf\LaTeX\ and not \optn{utf8} encoding, use a hyphen instead of an emdash:
+% \changes{v0.52}{2018/04/01}{Fix: \cs{FileDepth} with non-utf8 encoding.}
 %    \begin{macrocode}
+\ifPDFTeX%
+\ifdefstring{\inputencodingname}{utf8}{%
 \LWR at filestart{ — #1}% there is an EMdash in front of the #1
+}{
+\LWR at filestart{ - #1}% hyphen
+}
+\else%
+\LWR at filestart{ — #1}% there is an EMdash in front of the #1
+\fi%
 
 %    \end{macrocode}
 %
@@ -15007,10 +15288,10 @@
 %    \end{macrocode}
 %
 % If using MathJax, disable \cs{ensuremath} by printing a nullified
-% definition at the start of each file:
+% definition at the start of each file, and add further customizations:
 % \changes{v0.51}{2018/03/18}{MathJax: Nullifies \cs{ensuremath}.}
 %    \begin{macrocode}
-\LWR at nullifymathjaxensuremath
+\LWR at customizeMathJax
 %    \end{macrocode}
 %
 %    \begin{macrocode}
@@ -15373,13 +15654,25 @@
 %    \end{macrocode}
 % Print an opening comment with the level and the name;
 % ex: ``section'' ``Introduction''
+% Footnotes may be used in section names, which would also appear in the
+% \HTML\ section opening comments, so the short \TOC\ entry is used if possible,
+% and a limited opening comment is made if the sectional unit is starred.
 % \changes{v0.43}{2017/10/31}{Fix: Nullify fonts inside HTML comment.}
+% \changes{v0.52}{2018/03/28}{Fix: Footnote numbering: Limited \HTML\ comment if starred.}
+% \changes{v0.52}{2018/03/28}{Fix: Footnote numbering: Use short TOC entry
+%                                       for HTMLDebug comments.}
 %    \begin{macrocode}
 
 \ifbool{HTMLDebugComments}{%
     \begingroup%
     \LWR at nullfonts%
-    \LWR at htmlcomment{Opening #4 ``#3''{}}%
+    \IfBooleanTF{#1}% starred
+    {\LWR at htmlcomment{Opening #4*}}%
+    {%
+        \IfNoValueTF{#2}% short TOC
+            {\LWR at htmlcomment{Opening #4 ``#3''}}%
+            {\LWR at htmlcomment{Opening #4 ``#2''}}%
+    }
     \endgroup%
 }{}%
 
@@ -15745,7 +16038,7 @@
 %
 %    \begin{macrocode}
 \newcommand*{\LWR at filestart}[1]{
-\LWR at traceinfo{LWR at filestart}
+\LWR at traceinfo{LWR at filestart !#1!}
 %    \end{macrocode}
 % Locally temporarily disable direct-formatting commands:
 %    \begin{macrocode}
@@ -16034,10 +16327,10 @@
 %    \end{macrocode}
 %
 % If using MathJax, disable \cs{ensuremath} by printing a nullified
-% definition at the start of each file:
+% definition at the start of each file, and add further customizations:
 % \changes{v0.51}{2018/03/18}{MathJax: Nullifies \cs{ensuremath}.}
 %    \begin{macrocode}
-\LWR at nullifymathjaxensuremath
+\LWR at customizeMathJax
 %    \end{macrocode}
 %
 %    \begin{macrocode}
@@ -16869,15 +17162,29 @@
 % \subsection{Citations and attributions}
 
 % \begin{macro}{\attribution}
-% for use inside quote, quotation, verse:
-
-% ex: |\attribution{author name} --- \citetitle{book name}|
-
+% For use inside quote, quotation, verse:
+%
+% Fx: |\attribution{author name} --- \citetitle{book name}|
+%
+% \changes{v0.52}{2018/04/01}{Fix: Non-utf8 encoding.}
 % \codehtml
 %    \begin{macrocode}
 \begin{warpHTML}
+\ifPDFTeX%
+\ifdefstring{\inputencodingname}{utf8}{%
 \newcommand{\attribution}[1]{%
-\InlineClass{attribution}{—\,#1}}% emdash
+    \InlineClass{attribution}{—\,#1}% emdash
+}
+}{
+\newcommand{\attribution}[1]{%
+    \InlineClass{attribution}{---\,#1}%
+}
+}
+\else%
+\newcommand{\attribution}[1]{%
+    \InlineClass{attribution}{—\,#1}% emdash
+}
+\fi%
 \end{warpHTML}
 %    \end{macrocode}
 % \codeprint
@@ -16891,11 +17198,25 @@
 % \begin{macro}{\citetitle}
 % for use inside quote, quotation, verse:
 %
+% \changes{v0.52}{2018/04/01}{Fix: Non-utf8 encoding.}
 % \codehtml
 %    \begin{macrocode}
 \begin{warpHTML}
+\ifPDFTeX%
+\ifdefstring{\inputencodingname}{utf8}{%
 \newcommand{\citetitle}[1]{%
-\InlineClass{citetitle}{—\,#1}}% emdash
+    \InlineClass{citetitle}{—\,#1}%
+}%
+}{
+\newcommand{\citetitle}[1]{%
+    \InlineClass{citetitle}{---\,#1}%
+}%
+}
+\else%
+\newcommand{\citetitle}[1]{%
+    \InlineClass{citetitle}{—\,#1}%
+}%
+\fi%
 \end{warpHTML}
 %    \end{macrocode}
 %
@@ -17139,22 +17460,35 @@
 % \limitstabbing
 %
 % \changes{v0.42}{2017/10/13}{Added.}
+% \changes{v0.52}{2018/03/27}{Fix to allow inside \env{lateximage}.}
 %
 %    \begin{macrocode}
-\AfterEndPreamble{
-\LWR at traceinfo{Patching tabbing.}
-\AtBeginEnvironment{tabbing}{%
-\LWR at forcenewpage
+\LetLtxMacro\LWR at origtabbing\tabbing
+\LetLtxMacro\LWR at origendtabbing\endtabbing
+
+\renewcommand*{\tabbing}{%
+\LWR at forcenewpage%
 \LWR at atbeginverbatim{3.5}{tabbing}%
+\LWR at origtabbing%
 }
-\AfterEndEnvironment{tabbing}{%
+
+\renewcommand*{\endtabbing}{%
+    \LWR at origendtabbing%
     \unskip\LWR at origvspace*{-\baselineskip}\LWR at afterendverbatim%
 }
+%    \end{macrocode}
+%
+% \cs{AtBeginDocument} because \cs{LWR at restoreorigformatting} has not yet been defined:
+%    \begin{macrocode}
+\AtBeginDocument{
+\appto\LWR at restoreorigformatting{%
+\LetLtxMacro\tabbing\LWR at origtabbing%
+\LetLtxMacro\endtabbing\LWR at origendtabbing%
 }
+}
 %    \end{macrocode}
 % \end{environment}
 
-
 %    \begin{macrocode}
 \end{warpHTML}
 %    \end{macrocode}
@@ -21476,9 +21810,6 @@
 \LWR at sanitize{#1}%
 \LWR at htmltag{%
     a href="\LWR at sanitized" %
-%     a href="%
-%         \begingroup\@sanitize#1\endgroup%
-%     " %
     target="\_{}blank"\LWR at orignewline%
 }%
 #2%
@@ -21493,9 +21824,7 @@
 % \changes{v0.45}{2017/12/29}{Improved URLs with underscores.}
 %    \begin{macrocode}
 \NewDocumentCommand{\LWR at subhyperrefclass}{m +m m}{%
-% \LWR at sanitize{#1}%
 \LWR at htmltag{%
-%     a href="\LWR at sanitized"
     a href="%
         \begingroup\@sanitize#1\endgroup%
     " %
@@ -21516,11 +21845,23 @@
 %
 % \changes{v0.43}{2017/10/31}{Made robust.}
 % \changes{v0.49}{2018/02/18}{Fix: Adapt to classes.}
+% \changes{v0.52}{2018/03/26}{Fix: \progcode{\#}, \progcode{\%}, \progcode{\&}, \progcode{\~}, \progcode{\_} in \acro{URL}.}
 %    \begin{macrocode}
-\DeclareDocumentCommand{\href}{O{} m +m}{%
+\DeclareDocumentCommand{\LWR at hrefb}{O{} m +m}{%
 \LWR at ensuredoingapar%
 \LWR at subhyperref{#2}{#3}%
+\endgroup%
 }
+
+\newrobustcmd*{\href}{%
+\begingroup%
+\catcode`\#=12
+\catcode`\%=12
+\catcode`\&=12
+\catcode`\~=12
+\catcode`\_=12
+\LWR at hrefb%
+}
 %    \end{macrocode}
 % \end{macro}
 
@@ -21528,14 +21869,26 @@
 %
 % Print the name of the link without creating the link:
 % \changes{v0.43}{2017/10/31}{Made robust.}
-% \changes{v0.45}{2017/12/29}{Improved URLs with underscores.}
+% \changes{v0.45}{2017/12/29}{Fix: Underscore in \acro{URL}.}
+% \changes{v0.52}{2018/03/26}{Fix: \progcode{\#}, \progcode{\%}, \progcode{\&}, \progcode{\~}, \progcode{\_} in \acro{URL}.}
 %    \begin{macrocode}
-\newcommand*{\nolinkurl}[1]{%
+\newcommand*{\LWR at nolinkurlb}[1]{%
 \LWR at ensuredoingapar%
 \def\LWR at templink{#1}%
 \@onelevel at sanitize\LWR at templink%
 \LWR at templink%
+\endgroup%
 }
+
+\newrobustcmd*{\nolinkurl}{%
+\begingroup%
+\catcode`\#=12
+\catcode`\%=12
+\catcode`\&=12
+\catcode`\~=12
+\catcode`\_=12
+\LWR at nolinkurlb%
+}
 %    \end{macrocode}
 % \end{macro}
 
@@ -21543,6 +21896,7 @@
 % \begin{macro}{\url} \marg{URL}
 %
 % Create a link whose text name is the address of the link.
+%
 % The \pkg{url} package may redefine \cs{url}, so it is \cs{let} to \cs{LWR at urla}here
 % and also redefined by \pkg{lwarp-url}.
 %
@@ -21549,13 +21903,25 @@
 % \changes{v0.43}{2017/10/31}{Made robust.}
 % \changes{v0.45}{2017/12/29}{Improved URLs with underscores.}
 % \changes{v0.49}{2018/02/18}{Fix: Adapt to classes.}
+% \changes{v0.52}{2018/03/26}{Fix: \progcode{\#}, \progcode{\%}, \progcode{\&}, \progcode{\~}, \progcode{\_} in \acro{URL}.}
 %    \begin{macrocode}
-\DeclareDocumentCommand{\url}{m}{%
+\DeclareDocumentCommand{\LWR at urlb}{m}{%
 \LWR at ensuredoingapar%
 \def\LWR at templink{#1}%
 \@onelevel at sanitize\LWR at templink%
 \href{\LWR at templink}{\LWR at templink}%
+\endgroup%
 }
+
+\newrobustcmd*{\url}{%
+\begingroup%
+\catcode`\#=12
+\catcode`\%=12
+\catcode`\&=12
+\catcode`\~=12
+\catcode`\_=12
+\LWR at urlb%
+}
 %    \end{macrocode}
 % \end{macro}
 
@@ -22719,6 +23085,7 @@
     \fi
 %     \@input@{\jobname.bbl}% original
     \@input@{\BaseJobname.bbl}% lwarp
+    \DeclareDocumentCommand{\etalchar}{m}{\textsuperscript{#1}}% lwarp
 }
 %    \end{macrocode}
 % \end{macro}
@@ -22736,8 +23103,6 @@
 %
 %
 % \begin{environment}{thebibliography}
-% \changes{v0.45}{2018/01/13}{Patched to emphasize titles.}
-%
 % To emphasize document titles in the bibliography,
 % the following redefines \cs{em} inside \env{thebibliography}
 % to gather everything until the next closing brace,
@@ -22744,10 +23109,13 @@
 % then display these tokens with \cs{textit}.
 %
 % {
-%   \footnotesize\itshape
-%   Adapted from |embracedef.sty|, which is by \textup{\textsc{Takayuki YATO}}: \\
+%   \footnotesize
+%   \textit{Adapted from |embracedef.sty|, which is by \textup{\textsc{Takayuki YATO}}:} \\
 %   \hspace*{2em}\url{https://gist.github.com/zr-tex8r/b72555e3e7ad2f0a37f1}
 % }
+%
+% \changes{v0.45}{2018/01/13}{Patched to emphasize titles.}
+%
 %    \begin{macrocode}
 \AtBeginDocument{
 \AtBeginEnvironment{thebibliography}{
@@ -22765,7 +23133,15 @@
   \endgroup
   \LWR at em@after\egroup
 }
+\DeclareDocumentCommand{\etalchar}{m}{\textsuperscript{#1}}
 }% \AtBeginEnvironment{thebibliography}
+%    \end{macrocode}
+% Patch for \pkg{babelbib}:
+% \changes{v0.52}{2018/03/30}{Fix for \pkg{babelbib} \cs{etalchar}.}
+%    \begin{macrocode}
+\BeforeBeginEnvironment{thebibliography}{%
+\DeclareDocumentCommand{\etalchar}{m}{\textsuperscript{#1}}
+}% \BeforeBeginEnvironment
 }% \AtBeginDocument
 %    \end{macrocode}
 % \end{environment}
@@ -23040,25 +23416,38 @@
 % image.
 % If neither is loaded, no marker is used.
 % \changes{v0.51}{2018/03/16}{Improved \SVG\ math baseline.}
+% \changes{v0.52}{2018/03/24}{Warnings if \filenm{lwarp\_baseline\_marker.png} is not present
+%               or if graphicx/s not loaded.}
 %    \begin{macrocode}
 \AtBeginDocument{
 
-\@ifpackageloaded{graphicx}{
-    \newcommand*{\LWR at addbaselinemarker}{%
-        \LWR at origincludegraphics[%
-            width=10sp,height=10sp%
-        ]{lwarp_baseline_marker.png}%
-    }
-}{
-    \@ifpackageloaded{graphics}{
+\IfFileExists{lwarp_baseline_marker.png}%
+{
+    \@ifpackageloaded{graphicx}{
         \newcommand*{\LWR at addbaselinemarker}{%
-            \LWR at origincludegraphics{lwarp_baseline_marker.png}%
+            \LWR at origincludegraphics[%
+                width=10sp,height=10sp%
+            ]{lwarp_baseline_marker.png}%
         }
     }{
-        \newcommand*{\LWR at addbaselinemarker}{%
-            \hspace*{10sp}%
+        \@ifpackageloaded{graphics}{
+            \newcommand*{\LWR at addbaselinemarker}{%
+                \LWR at origincludegraphics{lwarp_baseline_marker.png}%
+            }
+        }{
+            \PackageWarning{lwarp}{Load graphicx or graphics
+                for improved SVG math baselines,}
+            \newcommand*{\LWR at addbaselinemarker}{%
+                \hspace*{10sp}%
+            }
         }
     }
+}{% lwarp_baseline_marker.png not present
+    \PackageWarning{lwarp}{File lwarp_baseline_marker.png is not installed alongside
+        the lwarp-*.sty files, so SVG math baselines may not be accurate,}
+    \newcommand*{\LWR at addbaselinemarker}{%
+        \hspace*{10sp}%
+    }
 }
 
 }% AtBeginDocument
@@ -23088,10 +23477,12 @@
 \newsavebox{\LWR at singledollarbox}
 
 \NewDocumentCommand{\LWR at subsingledollar}{s m m m}{%
+\LWR at traceinfo{LWR at subsingledollar}%
 %    \end{macrocode}
 %    \begin{macrocode}
 \ifnumcomp{\value{LWR at lateximagedepth}}{>}{0}%
 {%
+\LWR at traceinfo{LWR at subsingledollar: already in a lateximage}%
     #4% contents
 }%
 {% not in a lateximage
@@ -23126,6 +23517,7 @@
 % and a \CSS\ style to control the baseline adjustment.
 %    \begin{macrocode}
 {% not mathjax
+\LWR at traceinfo{LWR at subsingledollar: not mathjax}%
 %    \end{macrocode}
 % Measure the depth, width, and height of the math image:
 % \changes{v0.51}{2018/03/04}{Fix: SVG math with enclosed \env{lateximage}.}
@@ -23141,8 +23533,11 @@
 % Temporarily set font for the \HTML\ \PDF\ output:
 % \changes{v0.51}{2018/03/14}{Fix: Honors text font around \SVG\ math.}
 %    \begin{macrocode}
+    \LWR at traceinfo{Using font family \LWR at f@family}%
     \csuse{LWR at orig\LWR at f@family family}%
+    \LWR at traceinfo{Using font series \LWR at f@series}%
     \csuse{LWR at orig\LWR at f@series series}%
+    \LWR at traceinfo{Using font shape \LWR at f@shape}%
     \csuse{LWR at orig\LWR at f@shape shape}%
 %    \end{macrocode}
 % |lateximagedepth| must be nested to avoid generating paragraph tags.
@@ -23178,8 +23573,11 @@
     \global\advance\c at LWR@lateximagedepth -1\relax% Due to AmS \text macro.
 %    \end{macrocode}
 % Measure the depth:
+% \changes{v0.52}{2018/03/24}{Added user-adjustable \SVG\ math font scaling.}
 %    \begin{macrocode}
-    \setlength{\LWR at singledollardepth}{.70\dp\LWR at singledollarbox}%
+    \setlength{\LWR at singledollardepth}{%
+        \LateximageFontScale\dp\LWR at singledollarbox%
+    }%
 %    \end{macrocode}
 % Make the length a global change:
 %    \begin{macrocode}
@@ -23187,13 +23585,19 @@
 %    \end{macrocode}
 % Likewise for width:
 %    \begin{macrocode}
-    \setlength{\LWR at singledollarwidth}{.70\wd\LWR at singledollarbox}%
+    \setlength{\LWR at singledollarwidth}{%
+        \LateximageFontScale\wd\LWR at singledollarbox%
+    }%
     \global\LWR at singledollarwidth=\LWR at singledollarwidth%
 %    \end{macrocode}
 % Likewise for total height:
 %    \begin{macrocode}
-    \setlength{\LWR at singledollarheight}{.70\ht\LWR at singledollarbox}%
-    \addtolength{\LWR at singledollarheight}{.70\dp\LWR at singledollarbox}%
+    \setlength{\LWR at singledollarheight}{%
+        \LateximageFontScale\ht\LWR at singledollarbox%
+    }%
+    \addtolength{\LWR at singledollarheight}{%
+        \LateximageFontScale\dp\LWR at singledollarbox%
+    }%
     \global\LWR at singledollarheight=\LWR at singledollarheight%
 %    \end{macrocode}
 %    \begin{macrocode}
@@ -23303,6 +23707,7 @@
 }% not mathjax
 \endgroup%
 }% not in a lateximage
+\LWR at traceinfo{LWR at subsingledollar: done}%
 }
 %    \end{macrocode}
 % \end{macro}
@@ -23391,7 +23796,7 @@
 %    \begin{macrocode}
 \protected\gdef\LWR at singledollar#1${%
 \ifbool{mathjax}{%
-\LWR at subsingledollar*%
+    \LWR at subsingledollar*%
     {% alt tag
         \textbackslash( %
         \LWR at HTMLsanitize{#1} % extra space
@@ -23400,7 +23805,7 @@
     {singledollar}% add'l hashing
     {#1}% contents
 }{% not mathjax
-\LWR at subsingledollar*%
+    \LWR at subsingledollar*%
     {% alt tag
         \textbackslash( %
         \LWR at HTMLsanitize{#1} % extra space
@@ -23432,22 +23837,24 @@
 
 % \begin{macro}{\@ensuredmath} \marg{expression}
 %
+% If MathJax, a \env{lateximage} is used, since \cs{ensuremath} is
+% often used for complex \TeX\ expressions which MathJax may not render.
+% If \SVG\ math, a hashed file is used with a simple \attribute{alt} tag, but
+% additional hashing provided by the contents.
+%
+% \changes{v0.51}{2018/02/24}{Hashes \cs{ensuremath}.}
 % \changes{v0.42}{2017/10/16}{Improved \cs{ensuremath}.}
 % \changes{v0.50}{2018/02/23}{Fix: Use \env{lateximage} even if MathJax.}
 % \changes{v0.50}{2018/02/24}{Improved \SVG\ math \attribute{alt} tags.}
+% \changes{v0.52}{2018/03/25}{Improved hashing expansion.}
 %    \begin{macrocode}
 \LetLtxMacro\LWR at origensuredmath\@ensuredmath
 
 \renewcommand{\@ensuredmath}[1]{%
 \ifbool{mathjax}{%
-%    \end{macrocode}
-% If MathJax, a \env{lateximage} is used, since \cs{ensuremath} is
-% often used for complex \TeX\ expressions which MathJax may not render.
-% If \SVG\ math, a hashed file is used with a simple \attribute{alt} tag, but
-% additional hashing provided by the contents.
-% \changes{v0.51}{2018/02/24}{Hashes \cs{ensuremath}.}
-%    \begin{macrocode}
-    \LWR at subsingledollar*{(math image)}{\LWR at HTMLsanitize{#1}}{\relax%
+    \LWR at subsingledollar*{(math image)}{%
+           \protect\LWR at HTMLsanitize{\detokenize\expandafter{#1}}%
+    }{\relax%
         \LWR at origensuredmath{#1}%
     }%
 }{% SVG math
@@ -23464,7 +23871,9 @@
     \ifnumcomp{\value{LWR at lateximagedepth}}{>}{0}%
     {\LWR at origensuredmath{#1}}%
     {%
-        \LWR at subsingledollar*{(math image)}{\LWR at HTMLsanitize{#1}}{%
+        \LWR at subsingledollar*{(math image)}{%
+           \protect\LWR at HTMLsanitize{\detokenize\expandafter{#1}}%
+        }{%
             \LWR at origensuredmath{#1}%
         }%
     }%
@@ -23690,21 +24099,14 @@
 %    \begin{macrocode}
 \let\LWR at origequation\equation
 \let\LWR at origendequation\endequation
+\csletcs{LWR at origequation*}{equation*}
+\csletcs{LWR at origendequation*}{endequation*}
 %    \end{macrocode}
 %
-% Remove existing \env{equation} environment:
-%    \begin{macrocode}
-\let\equation\relax
-\let\endequation\relax
-%    \end{macrocode}
-
-
-% \begin{environment}{equation}
+%
+% \begin{macro}{\LWR at doequation}
 % \changes{v0.19}{2016/05/25}{\brand{MathJax} support.}
-% The new \env{equation} environment is created with
-% \cs{NewEnviron} (from the \pkg{environ} package),
-% which stores the contents of its environment in a
-% macro called \cs{BODY}.
+% \changes{v0.52}{2018/03/28}{Fix: \env{equation*} with \env{split}.}
 %
 % For \SVG\ math output, 
 % the contents are typeset using the original \env{equation}
@@ -23718,7 +24120,7 @@
 % The contents are also printed to the \HTML\ output
 % for processing by the \brand{MathJax} script.
 %    \begin{macrocode}
-\NewEnviron{equation}{%
+\newcommand*{\LWR at doequation}[2]{%
 
 %    \end{macrocode}
 % If |mathjax| or |FormatWP|, print the \LaTeX\ expression:
@@ -23737,7 +24139,7 @@
 %    \end{macrocode}
 % Print the \LaTeX\ math inside an \HTML\ comment:
 %    \begin{macrocode}
-    \LWR at hidelatexequation{equation}{\BODY}
+    \LWR at hidelatexequation{#2}{#1}
 }
 %    \end{macrocode}
 % SVG output:
@@ -23750,38 +24152,78 @@
 % Begin the \env{lateximage} with an \element{alt} tag containing the math source:
 % \changes{v0.50}{2018/03/02}{Improved \SVG\ math display.}
 % \changes{v0.51}{2018/03/11}{Fix: \cs{addcontentsline} inside \SVG\ math.  Provides an autoid anchor.}
+% \changes{v0.52}{2018/03/31}{Fix: \env{equation*} now based on \env{equation} instead of \env{displaymath}.}
 %    \begin{macrocode}
-    \begin{BlockClass}{displaymathnumbered}
+    \ifstrequal{#2}{equation*}{%
+        \begin{BlockClass}{displaymath}%
+    }{%
+        \begin{BlockClass}{displaymathnumbered}%
+    }%
     \LWR at newautoidanchor%
     \booltrue{LWR at indisplaymathimage}%
     \begin{lateximage}[%
-        (\LWR at equationtag) \textbackslash{begin\{equation\}} % extra space
-        \LWR at HTMLsanitizeexpand{\detokenize\expandafter{\BODY}} % extra space
-        \textbackslash{end\{equation\}}%
+        \ifstrequal{#2}{equation*}{%
+            \ifdefequal{\LWR at equationtag}{\theequation}{%
+%                                   no tag was given
+            }{%
+                (\LWR at equationtag) % tag was given
+            }%
+        }{%
+            (\LWR at equationtag) % automatic numbering
+        }%
+        \textbackslash{begin\{#2\}} % extra space
+        \LWR at HTMLsanitizeexpand{\detokenize\expandafter{#1}} % extra space
+        \textbackslash{end\{#2\}}%
     ]% alt tag
 %    \end{macrocode}
 % Create the actual \LaTeX-formatted equation inside
 % the |lateximage| using the contents of the environment.
 %    \begin{macrocode}
-    \LWR at origequation
-    \BODY% contents collected by NewEnviron
-    \LWR at origendequation
+    \csuse{LWR at orig#2}
+    #1% contents collected by \collect at body
+    \csuse{LWR at origend#2}
     \end{lateximage}%
     \end{BlockClass}
 }% not mathjax
-
+}
 %    \end{macrocode}
+%
+%
 % After the environment, if \brand{MathJax}, print the math to the \HTML\ output
 % for \brand{MathJax} processing:
 %    \begin{macrocode}
-}[%
+\newcommand*{\LWR at doendequation}[1]{%
     \ifboolexpr{bool{mathjax} or ( bool{FormatWP} and bool{WPMarkMath} ) }%
     {%
-        \LWR at addmathjax{equation}{\BODY}%
+        \LWR at addmathjax{#1}{\BODY}%
     }{}%
 
-]
+}
+%    \end{macrocode}
+% \end{macro}
 
+
+% Remove existing \env{equation} environment:
+%    \begin{macrocode}
+\let\equation\relax
+\let\endequation\relax
+\csletcs{equation*}{relax}
+\csletcs{endequation*}{relax}
+%    \end{macrocode}
+
+
+% \begin{environment}{equation}
+% The new \env{equation} environment is created with
+% \cs{NewEnviron} (from the \pkg{environ} package),
+% which stores the contents of its environment in a
+% macro called \cs{BODY}.
+%    \begin{macrocode}
+\NewEnviron{equation}
+{
+\LWR at doequation{\BODY}{equation}
+}
+[\LWR at doendequation{equation}]
+
 \LetLtxMacro\LWR at equationnormal\equation
 \LetLtxMacro\LWR at endequationnormal\endequation
 %    \end{macrocode}
@@ -23790,13 +24232,10 @@
 
 % \begin{environment}{equation*}
 %    \begin{macrocode}
-\csletcs{LWR at origequationstar}{equation*}
-\csletcs{LWR at origendequationstar}{endequation*}
+\NewEnviron{equation*}
+{\LWR at doequation{\BODY}{equation*}}
+[\LWR at doendequation{equation*}]
 
-\renewenvironment*{equation*}
-{\displaymath}
-{\enddisplaymath}
-
 \csletcs{LWR at equationnormalstar}{equation*}
 \csletcs{LWR at endequationnormalstar}{endequation*}
 %    \end{macrocode}
@@ -24545,7 +24984,8 @@
 
 
 % \subsection{Font size}
-
+% \label{sec:mathfontscale}
+%
 % \codeall
 %    \begin{macrocode}
 \begin{warpall}
@@ -24553,7 +24993,7 @@
 
 % \begin{macro}{\LateximageFontSizeName}
 % \changes{v0.19}{2016/05/29}{Add: User-adjustable math/lateximage font size.}
-% Declares how large to write text in the \cs{lateximage}.  The |.svg| file text size
+% Declares how large to write text in \cs{lateximage}s.  The |.svg| file text size
 % should blend well with the surrounding \HTML\ text size.
 %
 % \emph{Do not include the leading backslash in the name.}
@@ -24564,7 +25004,19 @@
 %    \end{macrocode}
 % \end{macro}
 
+% \begin{macro}{\LateximageFontScale}
+% \changes{v0.52}{2018/03/24}{Added user-adjustable \SVG\ math font scaling.}
+% Declares how large to scale inline \SVG\ math images.  The |.svg| file text size
+% should blend well with the surrounding \HTML\ text size.
+% The default is .75, but it may be redefined as needed depending on the
+% \HTML\ font.
+%
 %    \begin{macrocode}
+\newcommand*{\LateximageFontScale}{.75}
+%    \end{macrocode}
+% \end{macro}
+
+%    \begin{macrocode}
 \end{warpall}
 %    \end{macrocode}
 
@@ -24719,8 +25171,11 @@
 
 % \begin{macro}{\LWR at equationtag} \quad
 %   Prints the ending equation number or tag.
+%
+% This is reset by \env{lateximage},
+% may be temporarily overwritten by \cs{tag} calling \cs{LWR at remembertag}.
 %    \begin{macrocode}
-\let\LWR at equationtag\theequation
+\newcommand*{\LWR at equationtag}{}
 %    \end{macrocode}
 % \end{macro}
 
@@ -24747,8 +25202,7 @@
 {%
     \global\boolfalse{LWR at isstartingequation}%
     \xdef\LWR at startingequationtag{#1}%
-}%
-{}%
+}{}%
 \xdef\LWR at equationtag{#1}%
 }%
 %    \end{macrocode}
@@ -24870,6 +25324,9 @@
     \addtocounter{LWR at startingequation}{1}%
     \booltrue{LWR at isstartingequation}%
     \let\LWR at startingequationtag\theLWR at startingequation%
+%    \end{macrocode}
+% The default equation tag, unless overwritten by \cs{tag}:
+%    \begin{macrocode}
     \let\LWR at equationtag\theequation%
 %    \end{macrocode}
 % Starting a new lateximage:
@@ -24909,16 +25366,28 @@
     \LWR at traceinfo{lateximage: about to write to lateximages.txt}%
     \IfBooleanTF{#1}% starred
     {% hash
-        \LWR at traceinfo{lateximage: hash true, adding !#2!#3!}%
+        \LWR at traceinfo{lateximage: hash true, adding %
+            !\detokenize\expandafter{#2}!\detokenize\expandafter{#3}!}%
+%    \end{macrocode}
+% Compute and save the hashed file name for later use:
+% \changes{v0.52}{2018/03/25}{Fix for hash expansion.}
+%    \begin{macrocode}
         \edef\LWR at hashedname{%
             \LWR at mdfive{\detokenize\expandafter{#2}-!-#3}%
+%             \LWR at mdfive{\detokenize\expandafter{#2}-!-\detokenize\expandafter{#3}}%
         }%
         \LWR at traceinfo{lateximage: hash is \LWR at hashedname}%
+%    \end{macrocode}
+% Write the page, hashing, and hashed name:
+%    \begin{macrocode}
         \immediate\write\LWR at lateximagesfile{%
             |\arabic{LWR at LIpage}|true|\LWR at hashedname|%
         }%
     }% hash
     {% no hash
+%    \end{macrocode}
+% No hash, so write the page, no hashing, and the image number:
+%    \begin{macrocode}
         \LWR at traceinfo{lateximage: hash false}%
         \immediate\write\LWR at lateximagesfile{%
             |\arabic{LWR at LIpage}|false|lateximage-\arabic{LWR at externalfilecnt}|%
@@ -24960,7 +25429,7 @@
 %    \begin{macrocode}
     \def\@mpfn{footnote}%
     \def\thempfn{\thefootnote}%
-    \let\@footnotetext\LWR at footnotetext%
+    \LetLtxMacro\@footnotetext\LWR at footnotetext%
 %    \end{macrocode}
 % Create the |LWRlateximage<number>| label:
 %    \begin{macrocode}
@@ -24984,8 +25453,8 @@
         \LetLtxMacro\]\LWR at origclosebracket%
         \let\equation\LWR at origequation%
         \let\endequation\LWR at origendequation%
-        \csletcs{equation*}{LWR at origequationstar}%
-        \csletcs{endequation*}{LWR at origendequationstar}%
+        \csletcs{equation*}{LWR at origequation*}%
+        \csletcs{endequation*}{LWR at origendequation*}%
     }% not in display math
 %    \end{macrocode}
 % For \pkg{chemformula}:
@@ -26669,6 +27138,12 @@
 \def\(##1\){}%
 \def\[##1\]{}%
 \RenewDocumentCommand{\LWR at subsingledollar}{s m m m}{}
+%    \end{macrocode}
+% Use the simpler form with \cs{texorpdfstring}:
+% \changes{v0.52}{2018/03/31}{Fix: \cs{texorpdfstring} in section names.}
+%    \begin{macrocode}
+\let\texorpdfstring\relax%
+\newcommand{\texorpdfstring}[2]{##2}%
 }
 %    \end{macrocode}
 % \end{macro}
@@ -29326,7 +29801,8 @@
 % \pkg{breakurl} is emulated.
 %
 % \changes{v0.43}{2017/10/31}{\pkg{breakurl}: Added.}
-% \changes{v0.45}{2017/12/29}{Improved URLs with underscores.}
+% \changes{v0.45}{2017/12/29}{\pkg{breakurl}: Fix: Underscore in \acro{URL}.}
+% \changes{v0.52}{2018/03/26}{\pkg{breakurl}: Fix: \progcode{\#}, \progcode{\%}, \progcode{\&}, \progcode{\~}, \progcode{\_} in \acro{URL}.}
 %
 % \codehtml
 %
@@ -29337,7 +29813,7 @@
 %    \begin{macrocode}
 \LetLtxMacro\burl\url
 
-\NewDocumentCommand{\burlalt}{O{} +m m}{%
+\NewDocumentCommand{\LWR at burlaltb}{O{} +m m}{%
 \LWR at ensuredoingapar%
 \def\LWR at templink{#2}%
 \@onelevel at sanitize\LWR at templink%
@@ -29345,8 +29821,19 @@
 \@onelevel at sanitize\LWR at templinktwo%
 \LWR at subhyperref{\LWR at templink}{\LWR at templinktwo}%
 \LWR at ensuredoingapar%
+\endgroup%
 }
 
+\newrobustcmd*{\burlalt}{%
+\begingroup%
+\catcode`\#=12
+\catcode`\%=12
+\catcode`\&=12
+\catcode`\~=12
+\catcode`\_=12
+\LWR at burlaltb%
+}
+
 \LetLtxMacro\urlalt\burlalt
 %    \end{macrocode}
 %
@@ -30016,7 +30503,7 @@
         \LWR at subsingledollar*{% lwarp
             \textbackslash{}ch\{\LWR at HTMLsanitize{#2}\}% alt text
         }{%
-            \LWR at HTMLsanitize{#1}% add'l hashing
+           \protect\LWR at HTMLsanitize{\detokenize\expandafter{#1}}% add'l hashing
         }%
         {%
             \chemformula_ch:nn {#1} {#2}%   original
@@ -30037,7 +30524,7 @@
     \LWR at subsingledollar*{% lwarp
         \textbackslash{}chcpd\{\LWR at HTMLsanitize{#2}\}%
     }{%
-        \LWR at HTMLsanitize{#1}%
+        \protect\LWR at HTMLsanitize{\detokenize\expandafter{#1}}%
     }{% original
     \group_begin:
       \tl_if_blank:nF {#2}
@@ -30095,7 +30582,10 @@
   {
     \begingroup%
     \boolfalse{mathjax}%
-    \LWR at subsingledollar*{\textbackslash{}chlewis\{#2\}\{#3\}}{#1}{
+    \LWR at subsingledollar*{\textbackslash{}chlewis\{#2\}\{#3\}}%
+    {
+        \protect\LWR at HTMLsanitize{\detokenize\expandafter{#1}}%
+    }{
         \chemformula_lewis:nnn {#1} {#2} {#3}
     }
     \endgroup%
@@ -30292,9 +30782,7 @@
 %    \begin{macrocode}
 \ExplSyntaxOn
 
-\cs_undefine:N \chemgreek_text:n
-
-\cs_new_protected:Npn \chemgreek_text:n #1
+\cs_gset_protected:Npn \chemgreek_text:n #1
   { { \text {#1} } }
 
 \appto\LWR at restoreorigformatting{%
@@ -30431,7 +30919,7 @@
     \LWR at subsingledollar*{
         \textbackslash{}p\{\LWR at HTMLsanitize{#1}\}
     }{
-        chemmacrosp\LWR at HTMLsanitize{#1}
+        chemmacrosp\protect\LWR at HTMLsanitize{\detokenize\expandafter{#1}}%
     }{
     \group_begin:
       \mbox
@@ -30982,7 +31470,7 @@
         \LWR at subsingledollar*{% yes hash
             \textbackslash{}ox*\{\LWR at HTMLsanitize{#3}\}% alt
         }{%
-            star \LWR at HTMLsanitize{#2}% addl' hashing with star
+            star \protect\LWR at HTMLsanitize{\detokenize\expandafter{#2}}%
         }{%
             \LWR at chemmacros@ox* {#2} {#3}% contents
         }%
@@ -30991,7 +31479,7 @@
         \LWR at subsingledollar*{% yes hash
             \textbackslash{}ox*\{\LWR at HTMLsanitize{#3}\}% alt
         }{%
-            \LWR at HTMLsanitize{#2}% addl' hashing without star
+            \protect\LWR at HTMLsanitize{\detokenize\expandafter{#2}}%
         }{%
             \LWR at chemmacros@ox {#2} {#3}% contents
         }%
@@ -31386,8 +31874,7 @@
 %    \begin{macrocode}
 \ExplSyntaxOn
 
-\cs_undefine:N \chemnum_compound_write:n
-\cs_new_protected:Npn \chemnum_compound_write:n #1
+\cs_gset_protected:Npn \chemnum_compound_write:n #1
   {
     \chemnum_get_compound_property:nn {#1} {pre-main-label-code}
     \group_begin:
@@ -31403,8 +31890,7 @@
     \chemnum_get_compound_property:nn {#1} {post-main-label-code}
   }
 
-\cs_undefine:N \chemnum_subcompound_write:nn
-\cs_new_protected:Npn \chemnum_subcompound_write:nn #1#2
+\cs_gset_protected:Npn \chemnum_subcompound_write:nn #1#2
   {
     \group_begin:
       \bool_if:NTF \l__chemnum_compound_local_bool
@@ -32213,6 +32699,7 @@
 % \pkg{endfloat} is ignored.
 %
 % \changes{v0.45}{2017/12/19}{\pkg{endfloat}: Added.}
+% \changes{v0.52}{2018/03/26}{\pkg{endfloat}: Updated for v2.6.}
 %
 % \codehtml
 %
@@ -32233,6 +32720,10 @@
 \newcommand{\AtBeginDelayedFloats}[1]{}
 \newcommand*{\processdelayedfloats}{}
 \newcommand*{\efloatseparator}{}
+\def\efloattype{}
+\providecommand\efloatheading[1]{}
+\providecommand\efloatpreamble{}
+\providecommand\efloatpostamble{}
 %    \end{macrocode}
 %
 % \iffalse
@@ -32783,22 +33274,81 @@
 %
 % \limitsfancybox
 %
+% \limitsverbatimfootnotes
 %
 % \changes{v0.34}{2017/07/27}{\pkg{fancybox}: Added.}
 % \changes{v0.42}{2017/10/27}{\pkg{fancybox}: If \progcode{FormatWP} add HTML styles.}
+% \changes{v0.52}{2018/03/29}{\pkg{fancyvrb}: Initial support for \cs{VerbatimFootnotes}.}
 %
-% \codehtml
 %    \begin{macrocode}
-\begin{warpHTML}
+\LWR at ProvidesPackagePass{fancybox}
 %    \end{macrocode}
 %
+% After the preamble is loaded, after any patches to \env{Verbatim}:
 %    \begin{macrocode}
-\LWR at ProvidesPackagePass{fancybox}
+\AfterEndPreamble{
+\LWR at traceinfo{Patching fancybox.}
 %    \end{macrocode}
 %
+% \begin{noindmacro}{\VerbatimFootnotes}
+% Patched to use the new version.
+%    \begin{macrocode}
+\def\VerbatimFootnotes{%
+\let\@footnotetext\V at footnotetext%
+\let\LWR at footnotetext\V at footnotetext% lwarp
+}
+%    \end{macrocode}
+% \end{noindmacro}
 %
+% \begin{noindmacro}{\V@@footnotetext}
+% Patches in a subset of \pkg{lwarp}'s \cs{LWR at footnotetext} to the
+% \pkg{fancyvrb} version of \cs{V@@footnotetext}.
+%    \begin{macrocode}
+\def\V@@footnotetext{%
+\LWR at traceinfo{V at footnotetext}%
+\global\setbox\LWR at footnotes=\vbox\bgroup%
+%    \end{macrocode}
+% Add to any current footnotes:
+%    \begin{macrocode}
+    \unvbox\LWR at footnotes%
+%    \end{macrocode}
+% Remember the footnote number for \cs{ref}:
+%    \begin{macrocode}
+    \protected at edef\@currentlabel{%
+        \csname p at footnote\endcsname\@thefnmark%
+    }% @currentlabel
+%    \end{macrocode}
+% Use \HTML\ superscripts in the footnote even inside a \env{lateximage}:
+%    \begin{macrocode}
+    \renewrobustcmd{\textsuperscript}[1]{\LWR at htmlspan{sup}{##1}}%
+%    \end{macrocode}
+% Use paragraph tags if in a tabular data cell or a \env{lateximage}:
+%    \begin{macrocode}
+    \ifthenelse{%
+        \boolean{LWR at doingstartpars} \AND%
+        \cnttest{\value{LWR at lateximagedepth}}{=}{0}%
+    }%
+    {}%
+    {\LWR at htmltagc{\LWR at tagregularparagraph}}%
+%    \end{macrocode}
+% Append the footnote to the list:
+%    \begin{macrocode}
+    \@makefntext{}%
+%    \end{macrocode}
+%    \begin{macrocode}
+  \bgroup%
+  \aftergroup{\V@@@footnotetext}%
+  \ignorespaces%
+}%
+%    \end{macrocode}
+% \end{noindmacro}
 %
 %    \begin{macrocode}
+}% AfterEndPreamble
+%    \end{macrocode}
+%
+%
+%    \begin{macrocode}
 \renewcommand*{\@shadowbox}[1]{%
 \ifbool{FormatWP}%
 {\InlineClass[border:1px solid black]{shadowbox}{#1}}%
@@ -32970,10 +33520,6 @@
 }
 %    \end{macrocode}
 %
-%    \begin{macrocode}
-\end{warpHTML}
-%    \end{macrocode}
-%
 % \iffalse
 %</fancybox>
 % \fi
@@ -33143,11 +33689,13 @@
 % \DescribePackage{fancyvrb}
 % \pkg{fancyvrb} is supported with some patches.
 %
+% \limitsverbatimfootnotes
 %
 % \changes{v0.34}{2017/07/27}{\pkg{fancyvrb}: Added, no longer required.}
 % \changes{v0.45}{2018/01/07}{\pkg{fancyvrb}: Improvements.}
+% \changes{v0.52}{2018/03/29}{\pkg{fancyvrb}: Initial support for \cs{VerbatimFootnotes}.}
 %
-% \codehtml
+%
 %    \begin{macrocode}
 \RequirePackage{xcolor}% for \convertcolorspec
 
@@ -33154,32 +33702,71 @@
 \LWR at ProvidesPackagePass{fancyvrb}
 %    \end{macrocode}
 %
-% \codehtml
+% Initial default patch for fancyvrb:
 %    \begin{macrocode}
-\begin{warpHTML}
+\fvset{frame=none}%
 %    \end{macrocode}
 %
-
-% Initial default patch for fancyvrb:
+% After the preamble is loaded, after any patches to \env{Verbatim}:
 %    \begin{macrocode}
-\fvset{frame=none}%
+\AfterEndPreamble{
+\LWR at traceinfo{Patching fancyvrb.}
 %    \end{macrocode}
-
-% For \cs{VerbatimFootnotes}:
+%
+%
+% \begin{noindmacro}{\VerbatimFootnotes}
+% Patched to use the new version.
 %    \begin{macrocode}
-\renewcommand{\VerbatimFootnotes}{
-\PackageError{lwarp}
-{Verbatim footnotes are not yet supported by lwarp.}
-{This may be improved some day.}
+\def\VerbatimFootnotes{%
+\let\@footnotetext\V at footnotetext%
+\let\footnote\V at footnote%
+\let\LWR at footnotetext\V at footnotetext% lwarp
 }
 %    \end{macrocode}
-
-
-% After the preamble is loaded, after any patches to \env{Verbatim}:
+% \end{noindmacro}
+%
+% \begin{noindmacro}{\V@@footnotetext}
+% Patches in a subset of \pkg{lwarp}'s \cs{LWR at footnotetext} to the
+% \pkg{fancyvrb} version of \cs{V@@footnotetext}.
 %    \begin{macrocode}
-\AfterEndPreamble{
-\LWR at traceinfo{Patching Verbatim.}
+\def\V@@footnotetext{%
+\LWR at traceinfo{V at footnotetext}%
+\global\setbox\LWR at footnotes=\vbox\bgroup%
 %    \end{macrocode}
+% Add to any current footnotes:
+%    \begin{macrocode}
+    \unvbox\LWR at footnotes%
+%    \end{macrocode}
+% Remember the footnote number for \cs{ref}:
+%    \begin{macrocode}
+    \protected at edef\@currentlabel{%
+        \csname p at footnote\endcsname\@thefnmark%
+    }% @currentlabel
+%    \end{macrocode}
+% Use \HTML\ superscripts in the footnote even inside a \env{lateximage}:
+%    \begin{macrocode}
+    \renewrobustcmd{\textsuperscript}[1]{\LWR at htmlspan{sup}{##1}}%
+%    \end{macrocode}
+% Use paragraph tags if in a tabular data cell or a \env{lateximage}:
+%    \begin{macrocode}
+    \ifthenelse{%
+        \boolean{LWR at doingstartpars} \AND%
+        \cnttest{\value{LWR at lateximagedepth}}{=}{0}%
+    }%
+    {}%
+    {\LWR at htmltagc{\LWR at tagregularparagraph}}%
+%    \end{macrocode}
+% Append the footnote to the list:
+%    \begin{macrocode}
+    \@makefntext{}%
+%    \end{macrocode}
+%    \begin{macrocode}
+  \bgroup%
+  \aftergroup{\V@@@footnotetext}%
+  \ignorespaces%
+}%
+%    \end{macrocode}
+% \end{noindmacro}
 %
 %
 % \changes{v0.45}{2018/01/07}{\pkg{fancyvrb}: Improvements.}
@@ -33435,10 +34022,6 @@
 } % \AfterEndPreamble
 %    \end{macrocode}
 
-%    \begin{macrocode}
-\end{warpHTML}
-%    \end{macrocode}
-%
 % \iffalse
 %</fancyvrb>
 % \fi
@@ -34535,6 +35118,8 @@
 % \DescribePackage{footmisc}
 % \pkg{footmisc} is emulated.
 %
+% \pkg{lwarp} incidentally happens to emulate the \optn{stable} option.
+%
 %    \begin{macrocode}
 \LWR at ProvidesPackageDrop{footmisc}
 %    \end{macrocode}
@@ -34568,19 +35153,19 @@
 %    \begin{macrocode}
 \newcommand\mpfootnotemark{%
   \@ifnextchar[%
-    \@xmpfootnotemark
+    \@xmpfootnotemark%
     {%
-      \stepcounter\@mpfn
+      \stepcounter\@mpfn%
       \protected at xdef\@thefnmark{\thempfn}%
-      \@footnotemark
+      \@footnotemark%
     }%
 }
 \def\@xmpfootnotemark[#1]{%
-  \begingroup
-    \csname c@\@mpfn\endcsname #1\relax
+  \begingroup%
+    \csname c@\@mpfn\endcsname #1\relax%
     \unrestored at protected@xdef\@thefnmark{\thempfn}%
-  \endgroup
-  \@footnotemark
+  \endgroup%
+  \@footnotemark%
 }
 %    \end{macrocode}
 %
@@ -35253,8 +35838,9 @@
 %
 %
 % Handle origin key:
+% \changes{v0.52}{2018/03/27}{pkg{graphics}: Added defaults.}
 %    \begin{macrocode}
-\define at key{igraph}{origin}{%
+\define at key{igraph}{origin}[c]{%
 \renewcommand*{\LWR at igorigin}{#1}%
 }
 %    \end{macrocode}
@@ -35282,6 +35868,7 @@
 %    \end{macrocode}
 %
 % Numerous ignored keys:
+% \changes{v0.52}{2018/03/27}{pkg{graphics}: Added defaults.}
 %    \begin{macrocode}
 \define at key{igraph}{bb}{}
 \define at key{igraph}{bbllx}{}
@@ -35290,18 +35877,31 @@
 \define at key{igraph}{bbury}{}
 \define at key{igraph}{natwidth}{}
 \define at key{igraph}{natheight}{}
-\define at key{igraph}{hiresbb}{}
+\define at key{igraph}{hiresbb}[true]{}
 \define at key{igraph}{viewport}{}
 \define at key{igraph}{trim}{}
 \define at key{igraph}{totalheight}{}
-\define at key{igraph}{keepaspectratio}{}
-\define at key{igraph}{clip}{}
-\define at key{igraph}{draft}{}
+\define at key{igraph}{keepaspectratio}[true]{}
+\define at key{igraph}{clip}[true]{}
+\define at key{igraph}{draft}[true]{}
 \define at key{igraph}{type}{}
 \define at key{igraph}{ext}{}
 \define at key{igraph}{read}{}
 \define at key{igraph}{command}{}
 %    \end{macrocode}
+% New in v1.1a:
+% \changes{v0.52}{2018/03/27}{pkg{graphicx}: Updated for v1.1a.}
+%    \begin{macrocode}
+\define at key{igraph}{quite}{}
+\define at key{igraph}{page}{}
+\define at key{igraph}{pagebox}{}
+\define at key{igraph}{interpolate}[true]{}
+%    \end{macrocode}
+% New in v1.1b:
+% \changes{v0.52}{2018/03/27}{pkg{graphicx}: Updated for v1.1b.}
+%    \begin{macrocode}
+\define at key{igraph}{decodearray}{}
+%    \end{macrocode}
 
 
 % \subsection{Printing HTML styles}
@@ -36137,7 +36737,7 @@
 % \codehtml
 %    \begin{macrocode}
 % \LWR at ProvidesPackageDrop{hyperref}
-\typeout{Using the lwarp html version of package `hyperref' — discarding options.}
+\typeout{Using the lwarp html version of package `hyperref', discarding options.}
 \typeout{    Are not using ProvidesPackage, so that other packages}
 \typeout{    do not attempt to patch lwarp's version of `hyperref'.}
 % \ProvidesPackage{lwarp-#1-#2}
@@ -36152,20 +36752,33 @@
 
 
 
-% \begin{noindmacro}{\hyperimage} \marg{url} \marg{alt text}
+% \begin{noindmacro}{\hyperimage} \marg{URL} \marg{alt text}
 %
 % Insert an image with alt text:
 %
 % \changes{v0.43}{2017/10/31}{\pkg{hyperref}: Made robust.}
-% \changes{v0.45}{2017/12/29}{Improved filenames with underscores.}
+% \changes{v0.45}{2017/12/29}{\pkg{hyperref}: Fix: Underscore in \acro{URL}.}
+% \changes{v0.52}{2018/03/26}{\pkg{hyperref}: Fix: \progcode{\#}, \progcode{\%}, \progcode{\&}, \progcode{\~}, \progcode{\_} in \acro{URL}.}
 %    \begin{macrocode}
-\NewDocumentCommand{\hyperimage}{m +m}{%
+\NewDocumentCommand{\LWR at hyperimageb}{m +m}{%
 \LWR at ensuredoingapar%
 \def\LWR at templink{#1}%
 \@onelevel at sanitize\LWR at templink%
 \LWR at htmltag{img src="\LWR at templink" alt="#2" class="hyperimage"}%
 \LWR at ensuredoingapar%
+\endgroup%
 }
+
+\newrobustcmd*{\hyperimage}{%
+\begingroup%
+\catcode`\#=12
+\catcode`\%=12
+\catcode`\&=12
+\catcode`\~=12
+\catcode`\_=12
+\LWR at hyperimageb%
+}
+
 %    \end{macrocode}
 % \end{noindmacro}
 %
@@ -36175,12 +36788,25 @@
 %
 % Creates an \HTML\ anchor to |category.name| with the given text.
 %
+% \changes{v0.52}{2018/03/26}{\pkg{hyperref}: Fix: \progcode{\#}, \progcode{\%}, \progcode{\&}, \progcode{\~}, \progcode{\_} in \acro{URL}.}
 %    \begin{macrocode}
-\NewDocumentCommand{\hyperdef}{m m +m}{%
+\NewDocumentCommand{\LWR at hyperdefb}{m m +m}{%
 \LWR at ensuredoingapar%
 \LWR at sublabel{#1.#2}%
 #3%
+\endgroup%
 }
+
+\newcommand*{\hyperdef}{%
+\begingroup%
+\catcode`\#=12
+\catcode`\%=12
+\catcode`\&=12
+\catcode`\~=12
+\catcode`\_=12
+\LWR at hyperdefb%
+}
+
 %    \end{macrocode}
 % \end{noindmacro}
 %
@@ -36187,11 +36813,13 @@
 %
 % \begin{noindmacro}{\LWR at hyperrefb} \marg{1: URL} \marg{2: category}
 %							\marg{3: name} \marg{4: text}
-% \changes{v0.45}{2018/01/02}{\pkg{hyperref}: Fix for underscores in \cs{hyperref}.}
+% \changes{v0.45}{2018/01/02}{\pkg{hyperref}: Fix: Underscore in \acro{URL}.}
+% \changes{v0.52}{2018/03/26}{\pkg{hyperref}: Fix: \progcode{\#}, \progcode{\%}, \progcode{\&}, \progcode{\~}, \progcode{\_} in \acro{URL}.}
 %
 % Creates an \HTML\ link to |URL#category.name| with the given text.
 %    \begin{macrocode}
-\NewDocumentCommand{\LWR at hyperrefb}{m m m +m}{%
+% \NewDocumentCommand{\LWR at hyperrefb}{m m m +m}{%
+\NewDocumentCommand{\LWR at hyperrefbb}{m m m +m}{%
 \def\LWR at templink{#1}%
 \@onelevel at sanitize\LWR at templink%
 \def\LWR at templinktwo{#2}%
@@ -36203,7 +36831,18 @@
 }%
 #4%
 \LWR at htmltag{/a}%
+\endgroup%
 }
+
+\newrobustcmd*{\LWR at hyperrefb}{%
+\begingroup%
+\catcode`\#=12
+\catcode`\%=12
+\catcode`\&=12
+\catcode`\~=12
+\catcode`\_=12
+\LWR at hyperrefbb%
+}
 %    \end{macrocode}
 % \end{noindmacro}
 
@@ -36211,11 +36850,22 @@
 %
 % Creates text as an \HTML\ link to the \LaTeX\ label.
 %    \begin{macrocode}
-\NewDocumentCommand{\LWR at hyperrefc}{O{label} +m}{
+\NewDocumentCommand{\LWR at hyperrefcb}{O{label} +m}{
 \LWR at startref{#1}%
 #2%
 \LWR at htmltag{/a}%
+\endgroup%
 }
+
+\newcommand*{\LWR at hyperrefc}{%
+\begingroup%
+\catcode`\#=12
+\catcode`\%=12
+\catcode`\&=12
+\catcode`\~=12
+\catcode`\_=12
+\LWR at hyperrefcb%
+}
 %    \end{macrocode}
 % \end{noindmacro}
 
@@ -36238,11 +36888,23 @@
 %
 % Creates an anchor to |name| with the given text.
 %
+% \changes{v0.52}{2018/03/26}{\pkg{hyperref}: Fix: \progcode{\#}, \progcode{\%}, \progcode{\&}, \progcode{\~}, \progcode{\_} in \acro{URL}.}
 %    \begin{macrocode}
-\NewDocumentCommand{\hypertarget}{m +m}{%
+\NewDocumentCommand{\LWR at hypertargetb}{m +m}{%
 \label{#1}%
 #2%
+\endgroup%
 }
+
+\newcommand*{\hypertarget}{%
+\begingroup%
+\catcode`\#=12
+\catcode`\%=12
+\catcode`\&=12
+\catcode`\~=12
+\catcode`\_=12
+\LWR at hypertargetb%
+}
 %    \end{macrocode}
 % \end{noindmacro}
 
@@ -36253,10 +36915,23 @@
 % with the given link text.
 %
 % Declared because also defined by \pkg{memoir}.
+%
+% \changes{v0.52}{2018/03/26}{\pkg{hyperref}: Fix: \progcode{\#}, \progcode{\%}, \progcode{\&}, \progcode{\~}, \progcode{\_} in \acro{URL}.}
 %    \begin{macrocode}
-\DeclareDocumentCommand{\hyperlink}{m +m}{%
+\DeclareDocumentCommand{\LWR at hyperlinkb}{m +m}{%
 \hyperref[#1]{#2}%
+\endgroup%
 }
+
+\newcommand*{\hyperlink}{%
+\begingroup%
+\catcode`\#=12
+\catcode`\%=12
+\catcode`\&=12
+\catcode`\~=12
+\catcode`\_=12
+\LWR at hyperlinkb%
+}
 %    \end{macrocode}
 % \end{noindmacro}
 
@@ -37607,8 +38282,13 @@
 \newlength{\LTcapwidth}
 %    \end{macrocode}
 %
+% \changes{v0.52}{2018/03/27}{Restore \cs{kill} in a \env{lateximage}.}
 %    \begin{macrocode}
+\LetLtxMacro\LWR at origkill\kill
 \renewcommand*{\kill}{\LWR at tabularendofline}
+\appto\LWR at restoreorigformatting{%
+\LetLtxMacro\kill\LWR at origkill%
+}
 %    \end{macrocode}
 
 % \iffalse
@@ -38782,8 +39462,8 @@
 % When producing \HTML\ output, \pkg{lwarp} does not support \watchout[nested math]
 % the use of nested dollar signs in \pkg{mhchem} expressions.
 % \index{mhchem>troubleshooting}
-% \index{array>and mhchem}
-% \index{math>and mhchem}
+% \index{array>\pkg{mhchem}}
+% \index{math>\pkg{mhchem}}
 %
 % For some examples from the \pkg{mhchem} manual, change as follows:
 % \begin{Verbatim}[gobble=2,frame=leftline, xleftmargin=.5in,obeytabs,tabsize=4]
@@ -39551,7 +40231,7 @@
 %
 % Discard all options for \pkg{lwarp-nameref}:
 %    \begin{macrocode}
-\typeout{Using the lwarp html version of package `nameref' — discarding options.}
+\typeout{Using the lwarp html version of package `nameref', discarding options.}
 \typeout{    Are not using ProvidesPackage, so that other packages}
 \typeout{    do not attempt to patch lwarp's version of `nameref'.}
 \DeclareOption*{}
@@ -39759,8 +40439,47 @@
 %
 %
 %
+% \iffalse
+%<*nicefrac>
+% \fi
 %
+% \part{lwarp-nicefrac.sty}
+
+% \section{nicefrac}
+%
+% \credits{Axel Reichert}
+%
+% \DescribePackage{nicefrac}
+% \pkg{nicefrac} is patched for use by \pkg{lwarp}.
+%
+% \changes{v0.52}{2018/03/25}{\pkg{nicefrac}: Added.}
+%
+% \codehtml
+%
+%    \begin{macrocode}
+\LWR at ProvidesPackagePass{nicefrac}
+%    \end{macrocode}
+%
+% \pkg{nicefrac} uses \TeX\ boxes, so \cs{@ensuredmath} must be restored temporarily:
+%    \begin{macrocode}
+\LetLtxMacro\LWR at origUnitsNiceFrac\@UnitsNiceFrac
+
+\DeclareRobustCommand*{\@UnitsNiceFrac}[3][]{%
+\begingroup%
+\LetLtxMacro\@ensuredmath\LWR at origensuredmath%
+\LWR at origUnitsNiceFrac[#1]{#2}{#3}%
+\endgroup%
+}
+%    \end{macrocode}
+
 % \iffalse
+%</nicefrac>
+% \fi
+%
+%
+%
+%
+% \iffalse
 %<*nonfloat>
 % \fi
 %
@@ -42755,9 +43474,11 @@
 %       \__siunitx_print:nn { number } { \ensuremath {#1} }
         \LWR at subsingledollar{% lwarp
             \textbackslash( \LWR at HTMLsanitize{#1} \textbackslash)% lwarp
-        }{siunitx}{\__siunitx_print:nn { number } {
-            \LWR at origensuredmath{#1}
-        }}% lwarp
+        }{siunitx}{%
+            \__siunitx_print:nn { number } {%
+                \LWR at origensuredmath{#1}%
+            }%
+        }% lwarp
 %    \end{macrocode}
 %    \begin{macrocode}
       \__siunitx_unit_output_print:
@@ -46618,8 +47339,48 @@
 %
 %
 %
+% \iffalse
+%<*url>
+% \fi
 %
+% \part{lwarp-url.sty}
+
+% \section{url}
+%
+% \credits{Donald Arseneau}
+%
+% \DescribePackage{url}
+% \pkg{url} is patched for use by \pkg{lwarp}.
+%
+% \changes{v0.52}{2018/03/29}{\pkg{url}: Added.}
+%
+% \codehtml
+%
+%    \begin{macrocode}
+\LWR at ProvidesPackagePass{url}
+%    \end{macrocode}
+
+% \pkg{url} uses math mode to print its string inside a group, so the original meaning
+% of math is restored first.
+%    \begin{macrocode}
+\LetLtxMacro\LWR at url@origUrl at FormatString\Url at FormatString
+
+\renewcommand*{\Url at FormatString}{%
+    \InlineClass{verbatim}{%
+        \LWR at restoreorigformatting%
+        \LWR at url@origUrl at FormatString%
+    }%
+}
+%    \end{macrocode}
+
 % \iffalse
+%</url>
+% \fi
+%
+%
+%
+%
+% \iffalse
 %<*verse>
 % \fi
 %

Modified: trunk/Master/texmf-dist/source/latex/lwarp/lwarp.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/lwarp/lwarp.ins	2018-04-01 22:21:24 UTC (rev 47224)
+++ trunk/Master/texmf-dist/source/latex/lwarp/lwarp.ins	2018-04-01 22:24:04 UTC (rev 47225)
@@ -193,6 +193,7 @@
 \file{lwarp-newclude.sty}{\from{lwarp.dtx}{newclude}}
 \file{lwarp-newunicodechar.sty}{\from{lwarp.dtx}{newunicodechar}}
 \file{lwarp-nextpage.sty}{\from{lwarp.dtx}{nextpage}}
+\file{lwarp-nicefrac.sty}{\from{lwarp.dtx}{nicefrac}}
 \file{lwarp-nonfloat.sty}{\from{lwarp.dtx}{nonfloat}}
 \file{lwarp-nonumonpart.sty}{\from{lwarp.dtx}{nonumonpart}}
 \file{lwarp-nopageno.sty}{\from{lwarp.dtx}{nopageno}}
@@ -277,6 +278,7 @@
 \file{lwarp-typearea.sty}{\from{lwarp.dtx}{typearea}}
 \file{lwarp-ulem.sty}{\from{lwarp.dtx}{ulem}}
 \file{lwarp-upref.sty}{\from{lwarp.dtx}{upref}}
+\file{lwarp-url.sty}{\from{lwarp.dtx}{url}}
 \file{lwarp-verse.sty}{\from{lwarp.dtx}{verse}}
 \file{lwarp-vertbars.sty}{\from{lwarp.dtx}{vertbars}}
 \file{lwarp-vmargin.sty}{\from{lwarp.dtx}{vmargin}}

Modified: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-breakurl.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-breakurl.sty	2018-04-01 22:21:24 UTC (rev 47224)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-breakurl.sty	2018-04-01 22:24:04 UTC (rev 47225)
@@ -18,7 +18,7 @@
 \LWR at ProvidesPackageDrop{breakurl}
 \LetLtxMacro\burl\url
 
-\NewDocumentCommand{\burlalt}{O{} +m m}{%
+\NewDocumentCommand{\LWR at burlaltb}{O{} +m m}{%
 \LWR at ensuredoingapar%
 \def\LWR at templink{#2}%
 \@onelevel at sanitize\LWR at templink%
@@ -26,8 +26,19 @@
 \@onelevel at sanitize\LWR at templinktwo%
 \LWR at subhyperref{\LWR at templink}{\LWR at templinktwo}%
 \LWR at ensuredoingapar%
+\endgroup%
 }
 
+\newrobustcmd*{\burlalt}{%
+\begingroup%
+\catcode`\#=12
+\catcode`\%=12
+\catcode`\&=12
+\catcode`\~=12
+\catcode`\_=12
+\LWR at burlaltb%
+}
+
 \LetLtxMacro\urlalt\burlalt
 \endinput
 %%

Modified: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-chemformula.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-chemformula.sty	2018-04-01 22:21:24 UTC (rev 47224)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-chemformula.sty	2018-04-01 22:24:04 UTC (rev 47225)
@@ -31,7 +31,7 @@
         \LWR at subsingledollar*{% lwarp
             \textbackslash{}ch\{\LWR at HTMLsanitize{#2}\}% alt text
         }{%
-            \LWR at HTMLsanitize{#1}% add'l hashing
+           \protect\LWR at HTMLsanitize{\detokenize\expandafter{#1}}% add'l hashing
         }%
         {%
             \chemformula_ch:nn {#1} {#2}%   original
@@ -46,7 +46,7 @@
     \LWR at subsingledollar*{% lwarp
         \textbackslash{}chcpd\{\LWR at HTMLsanitize{#2}\}%
     }{%
-        \LWR at HTMLsanitize{#1}%
+        \protect\LWR at HTMLsanitize{\detokenize\expandafter{#1}}%
     }{% original
     \group_begin:
       \tl_if_blank:nF {#2}
@@ -86,7 +86,10 @@
   {
     \begingroup%
     \boolfalse{mathjax}%
-    \LWR at subsingledollar*{\textbackslash{}chlewis\{#2\}\{#3\}}{#1}{
+    \LWR at subsingledollar*{\textbackslash{}chlewis\{#2\}\{#3\}}%
+    {
+        \protect\LWR at HTMLsanitize{\detokenize\expandafter{#1}}%
+    }{
         \chemformula_lewis:nnn {#1} {#2} {#3}
     }
     \endgroup%

Modified: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-chemgreek.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-chemgreek.sty	2018-04-01 22:21:24 UTC (rev 47224)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-chemgreek.sty	2018-04-01 22:24:04 UTC (rev 47225)
@@ -20,9 +20,7 @@
 
 \ExplSyntaxOn
 
-\cs_undefine:N \chemgreek_text:n
-
-\cs_new_protected:Npn \chemgreek_text:n #1
+\cs_gset_protected:Npn \chemgreek_text:n #1
   { { \text {#1} } }
 
 \appto\LWR at restoreorigformatting{%

Modified: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-chemmacros.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-chemmacros.sty	2018-04-01 22:21:24 UTC (rev 47224)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-chemmacros.sty	2018-04-01 22:24:04 UTC (rev 47225)
@@ -43,7 +43,7 @@
     \LWR at subsingledollar*{
         \textbackslash{}p\{\LWR at HTMLsanitize{#1}\}
     }{
-        chemmacrosp\LWR at HTMLsanitize{#1}
+        chemmacrosp\protect\LWR at HTMLsanitize{\detokenize\expandafter{#1}}%
     }{
     \group_begin:
       \mbox
@@ -528,7 +528,7 @@
         \LWR at subsingledollar*{% yes hash
             \textbackslash{}ox*\{\LWR at HTMLsanitize{#3}\}% alt
         }{%
-            star \LWR at HTMLsanitize{#2}% addl' hashing with star
+            star \protect\LWR at HTMLsanitize{\detokenize\expandafter{#2}}%
         }{%
             \LWR at chemmacros@ox* {#2} {#3}% contents
         }%
@@ -537,7 +537,7 @@
         \LWR at subsingledollar*{% yes hash
             \textbackslash{}ox*\{\LWR at HTMLsanitize{#3}\}% alt
         }{%
-            \LWR at HTMLsanitize{#2}% addl' hashing without star
+            \protect\LWR at HTMLsanitize{\detokenize\expandafter{#2}}%
         }{%
             \LWR at chemmacros@ox {#2} {#3}% contents
         }%

Modified: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-chemnum.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-chemnum.sty	2018-04-01 22:21:24 UTC (rev 47224)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-chemnum.sty	2018-04-01 22:24:04 UTC (rev 47225)
@@ -20,8 +20,7 @@
 
 \ExplSyntaxOn
 
-\cs_undefine:N \chemnum_compound_write:n
-\cs_new_protected:Npn \chemnum_compound_write:n #1
+\cs_gset_protected:Npn \chemnum_compound_write:n #1
   {
     \chemnum_get_compound_property:nn {#1} {pre-main-label-code}
     \group_begin:
@@ -37,8 +36,7 @@
     \chemnum_get_compound_property:nn {#1} {post-main-label-code}
   }
 
-\cs_undefine:N \chemnum_subcompound_write:nn
-\cs_new_protected:Npn \chemnum_subcompound_write:nn #1#2
+\cs_gset_protected:Npn \chemnum_subcompound_write:nn #1#2
   {
     \group_begin:
       \bool_if:NTF \l__chemnum_compound_local_bool

Modified: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-endfloat.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-endfloat.sty	2018-04-01 22:21:24 UTC (rev 47224)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-endfloat.sty	2018-04-01 22:24:04 UTC (rev 47225)
@@ -28,6 +28,10 @@
 \newcommand{\AtBeginDelayedFloats}[1]{}
 \newcommand*{\processdelayedfloats}{}
 \newcommand*{\efloatseparator}{}
+\def\efloattype{}
+\providecommand\efloatheading[1]{}
+\providecommand\efloatpreamble{}
+\providecommand\efloatpostamble{}
 \endinput
 %%
 %% End of file `lwarp-endfloat.sty'.

Modified: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-fancybox.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-fancybox.sty	2018-04-01 22:21:24 UTC (rev 47224)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-fancybox.sty	2018-04-01 22:24:04 UTC (rev 47225)
@@ -15,8 +15,33 @@
 %%   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.
-\begin{warpHTML}
 \LWR at ProvidesPackagePass{fancybox}
+\AfterEndPreamble{
+\LWR at traceinfo{Patching fancybox.}
+\def\VerbatimFootnotes{%
+\let\@footnotetext\V at footnotetext%
+\let\LWR at footnotetext\V at footnotetext% lwarp
+}
+\def\V@@footnotetext{%
+\LWR at traceinfo{V at footnotetext}%
+\global\setbox\LWR at footnotes=\vbox\bgroup%
+    \unvbox\LWR at footnotes%
+    \protected at edef\@currentlabel{%
+        \csname p at footnote\endcsname\@thefnmark%
+    }% @currentlabel
+    \renewrobustcmd{\textsuperscript}[1]{\LWR at htmlspan{sup}{##1}}%
+    \ifthenelse{%
+        \boolean{LWR at doingstartpars} \AND%
+        \cnttest{\value{LWR at lateximagedepth}}{=}{0}%
+    }%
+    {}%
+    {\LWR at htmltagc{\LWR at tagregularparagraph}}%
+    \@makefntext{}%
+  \bgroup%
+  \aftergroup{\V@@@footnotetext}%
+  \ignorespaces%
+}%
+}% AfterEndPreamble
 \renewcommand*{\@shadowbox}[1]{%
 \ifbool{FormatWP}%
 {\InlineClass[border:1px solid black]{shadowbox}{#1}}%
@@ -125,7 +150,6 @@
 \LWRFB at UseVerbatim{#2}%
 \LWR at afterendverbatim%
 }
-\end{warpHTML}
 \endinput
 %%
 %% End of file `lwarp-fancybox.sty'.

Modified: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-fancyvrb.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-fancyvrb.sty	2018-04-01 22:21:24 UTC (rev 47224)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-fancyvrb.sty	2018-04-01 22:24:04 UTC (rev 47225)
@@ -18,18 +18,33 @@
 \RequirePackage{xcolor}% for \convertcolorspec
 
 \LWR at ProvidesPackagePass{fancyvrb}
-\begin{warpHTML}
-
 \fvset{frame=none}%
-
-\renewcommand{\VerbatimFootnotes}{
-\PackageError{lwarp}
-{Verbatim footnotes are not yet supported by lwarp.}
-{This may be improved some day.}
+\AfterEndPreamble{
+\LWR at traceinfo{Patching fancyvrb.}
+\def\VerbatimFootnotes{%
+\let\@footnotetext\V at footnotetext%
+\let\footnote\V at footnote%
+\let\LWR at footnotetext\V at footnotetext% lwarp
 }
-
-\AfterEndPreamble{
-\LWR at traceinfo{Patching Verbatim.}
+\def\V@@footnotetext{%
+\LWR at traceinfo{V at footnotetext}%
+\global\setbox\LWR at footnotes=\vbox\bgroup%
+    \unvbox\LWR at footnotes%
+    \protected at edef\@currentlabel{%
+        \csname p at footnote\endcsname\@thefnmark%
+    }% @currentlabel
+    \renewrobustcmd{\textsuperscript}[1]{\LWR at htmlspan{sup}{##1}}%
+    \ifthenelse{%
+        \boolean{LWR at doingstartpars} \AND%
+        \cnttest{\value{LWR at lateximagedepth}}{=}{0}%
+    }%
+    {}%
+    {\LWR at htmltagc{\LWR at tagregularparagraph}}%
+    \@makefntext{}%
+  \bgroup%
+  \aftergroup{\V@@@footnotetext}%
+  \ignorespaces%
+}%
 \preto\FVB at Verbatim{\LWR at forcenewpage}
 \preto\FVB at LVerbatim{\LWR at forcenewpage}
 \def\FV at BeginListFrame@Single{%
@@ -217,7 +232,6 @@
 
 } % \AfterEndPreamble
 
-\end{warpHTML}
 \endinput
 %%
 %% End of file `lwarp-fancyvrb.sty'.

Modified: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-footmisc.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-footmisc.sty	2018-04-01 22:21:24 UTC (rev 47224)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-footmisc.sty	2018-04-01 22:24:04 UTC (rev 47225)
@@ -35,19 +35,19 @@
 \providecommand*{\footref}[1]{\labelcref{#1}}
 \newcommand\mpfootnotemark{%
   \@ifnextchar[%
-    \@xmpfootnotemark
+    \@xmpfootnotemark%
     {%
-      \stepcounter\@mpfn
+      \stepcounter\@mpfn%
       \protected at xdef\@thefnmark{\thempfn}%
-      \@footnotemark
+      \@footnotemark%
     }%
 }
 \def\@xmpfootnotemark[#1]{%
-  \begingroup
-    \csname c@\@mpfn\endcsname #1\relax
+  \begingroup%
+    \csname c@\@mpfn\endcsname #1\relax%
     \unrestored at protected@xdef\@thefnmark{\thempfn}%
-  \endgroup
-  \@footnotemark
+  \endgroup%
+  \@footnotemark%
 }
 \endinput
 %%

Modified: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-graphics.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-graphics.sty	2018-04-01 22:21:24 UTC (rev 47224)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-graphics.sty	2018-04-01 22:24:04 UTC (rev 47225)
@@ -80,7 +80,7 @@
     {}% not px
 }{}% end of length > 0pt
 }
-\define at key{igraph}{origin}{%
+\define at key{igraph}{origin}[c]{%
 \renewcommand*{\LWR at igorigin}{#1}%
 }
 \define at key{igraph}{angle}{\renewcommand*{\LWR at igangle}{#1}}
@@ -96,17 +96,22 @@
 \define at key{igraph}{bbury}{}
 \define at key{igraph}{natwidth}{}
 \define at key{igraph}{natheight}{}
-\define at key{igraph}{hiresbb}{}
+\define at key{igraph}{hiresbb}[true]{}
 \define at key{igraph}{viewport}{}
 \define at key{igraph}{trim}{}
 \define at key{igraph}{totalheight}{}
-\define at key{igraph}{keepaspectratio}{}
-\define at key{igraph}{clip}{}
-\define at key{igraph}{draft}{}
+\define at key{igraph}{keepaspectratio}[true]{}
+\define at key{igraph}{clip}[true]{}
+\define at key{igraph}{draft}[true]{}
 \define at key{igraph}{type}{}
 \define at key{igraph}{ext}{}
 \define at key{igraph}{read}{}
 \define at key{igraph}{command}{}
+\define at key{igraph}{quite}{}
+\define at key{igraph}{page}{}
+\define at key{igraph}{pagebox}{}
+\define at key{igraph}{interpolate}[true]{}
+\define at key{igraph}{decodearray}{}
 
 
 \newcommand*{\LWR at rotstyle}[2]{%

Modified: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-hyperref.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-hyperref.sty	2018-04-01 22:21:24 UTC (rev 47224)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-hyperref.sty	2018-04-01 22:24:04 UTC (rev 47225)
@@ -18,7 +18,7 @@
 
 
 
-\typeout{Using the lwarp html version of package `hyperref' — discarding options.}
+\typeout{Using the lwarp html version of package `hyperref', discarding options.}
 \typeout{    Are not using ProvidesPackage, so that other packages}
 \typeout{    do not attempt to patch lwarp's version of `hyperref'.}
 \DeclareOption*{}
@@ -27,19 +27,43 @@
 \newcommand*{\hypersetup}[1]{}
 \newcommand*{\hyperbaseurl}[1]{}
 
-\NewDocumentCommand{\hyperimage}{m +m}{%
+\NewDocumentCommand{\LWR at hyperimageb}{m +m}{%
 \LWR at ensuredoingapar%
 \def\LWR at templink{#1}%
 \@onelevel at sanitize\LWR at templink%
 \LWR at htmltag{img src="\LWR at templink" alt="#2" class="hyperimage"}%
 \LWR at ensuredoingapar%
+\endgroup%
 }
-\NewDocumentCommand{\hyperdef}{m m +m}{%
+
+\newrobustcmd*{\hyperimage}{%
+\begingroup%
+\catcode`\#=12
+\catcode`\%=12
+\catcode`\&=12
+\catcode`\~=12
+\catcode`\_=12
+\LWR at hyperimageb%
+}
+
+\NewDocumentCommand{\LWR at hyperdefb}{m m +m}{%
 \LWR at ensuredoingapar%
 \LWR at sublabel{#1.#2}%
 #3%
+\endgroup%
 }
-\NewDocumentCommand{\LWR at hyperrefb}{m m m +m}{%
+
+\newcommand*{\hyperdef}{%
+\begingroup%
+\catcode`\#=12
+\catcode`\%=12
+\catcode`\&=12
+\catcode`\~=12
+\catcode`\_=12
+\LWR at hyperdefb%
+}
+
+\NewDocumentCommand{\LWR at hyperrefbb}{m m m +m}{%
 \def\LWR at templink{#1}%
 \@onelevel at sanitize\LWR at templink%
 \def\LWR at templinktwo{#2}%
@@ -51,28 +75,72 @@
 }%
 #4%
 \LWR at htmltag{/a}%
+\endgroup%
 }
 
-\NewDocumentCommand{\LWR at hyperrefc}{O{label} +m}{
+\newrobustcmd*{\LWR at hyperrefb}{%
+\begingroup%
+\catcode`\#=12
+\catcode`\%=12
+\catcode`\&=12
+\catcode`\~=12
+\catcode`\_=12
+\LWR at hyperrefbb%
+}
+
+\NewDocumentCommand{\LWR at hyperrefcb}{O{label} +m}{
 \LWR at startref{#1}%
 #2%
 \LWR at htmltag{/a}%
+\endgroup%
 }
 
+\newcommand*{\LWR at hyperrefc}{%
+\begingroup%
+\catcode`\#=12
+\catcode`\%=12
+\catcode`\&=12
+\catcode`\~=12
+\catcode`\_=12
+\LWR at hyperrefcb%
+}
+
 \DeclareRobustCommand*{\hyperref}{%
 \LWR at ensuredoingapar%
 \@ifnextchar[\LWR at hyperrefc\LWR at hyperrefb%
 }
 
-\NewDocumentCommand{\hypertarget}{m +m}{%
+\NewDocumentCommand{\LWR at hypertargetb}{m +m}{%
 \label{#1}%
 #2%
+\endgroup%
 }
 
-\DeclareDocumentCommand{\hyperlink}{m +m}{%
+\newcommand*{\hypertarget}{%
+\begingroup%
+\catcode`\#=12
+\catcode`\%=12
+\catcode`\&=12
+\catcode`\~=12
+\catcode`\_=12
+\LWR at hypertargetb%
+}
+
+\DeclareDocumentCommand{\LWR at hyperlinkb}{m +m}{%
 \hyperref[#1]{#2}%
+\endgroup%
 }
 
+\newcommand*{\hyperlink}{%
+\begingroup%
+\catcode`\#=12
+\catcode`\%=12
+\catcode`\&=12
+\catcode`\~=12
+\catcode`\_=12
+\LWR at hyperlinkb%
+}
+
 \NewDocumentCommand{\autoref}{s m}{%
 \IfBooleanTF{#1}{\ref{#2}}{\cref{#2}}%
 }

Modified: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-longtable.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-longtable.sty	2018-04-01 22:21:24 UTC (rev 47224)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-longtable.sty	2018-04-01 22:24:04 UTC (rev 47225)
@@ -56,7 +56,11 @@
 \newlength{\LTpre}
 \newlength{\LTpost}
 \newlength{\LTcapwidth}
+\LetLtxMacro\LWR at origkill\kill
 \renewcommand*{\kill}{\LWR at tabularendofline}
+\appto\LWR at restoreorigformatting{%
+\LetLtxMacro\kill\LWR at origkill%
+}
 
 \endinput
 %%

Modified: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-nameref.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-nameref.sty	2018-04-01 22:21:24 UTC (rev 47224)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-nameref.sty	2018-04-01 22:24:04 UTC (rev 47225)
@@ -17,7 +17,7 @@
 %% version 2005/12/01 or later.
 
 
-\typeout{Using the lwarp html version of package `nameref' — discarding options.}
+\typeout{Using the lwarp html version of package `nameref', discarding options.}
 \typeout{    Are not using ProvidesPackage, so that other packages}
 \typeout{    do not attempt to patch lwarp's version of `nameref'.}
 \DeclareOption*{}

Added: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-nicefrac.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-nicefrac.sty	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-nicefrac.sty	2018-04-01 22:24:04 UTC (rev 47225)
@@ -0,0 +1,31 @@
+%%
+%% This is file `lwarp-nicefrac.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% lwarp.dtx  (with options: `nicefrac')
+%% This is a generated file.
+%% Copyright 2016-2018 Brian Dunn
+%% 
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%%   http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+
+\LWR at ProvidesPackagePass{nicefrac}
+\LetLtxMacro\LWR at origUnitsNiceFrac\@UnitsNiceFrac
+
+\DeclareRobustCommand*{\@UnitsNiceFrac}[3][]{%
+\begingroup%
+\LetLtxMacro\@ensuredmath\LWR at origensuredmath%
+\LWR at origUnitsNiceFrac[#1]{#2}{#3}%
+\endgroup%
+}
+
+\endinput
+%%
+%% End of file `lwarp-nicefrac.sty'.


Property changes on: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-nicefrac.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-siunitx.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-siunitx.sty	2018-04-01 22:21:24 UTC (rev 47224)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-siunitx.sty	2018-04-01 22:24:04 UTC (rev 47225)
@@ -97,9 +97,11 @@
       \__siunitx_unit_output_pre_print:
         \LWR at subsingledollar{% lwarp
             \textbackslash( \LWR at HTMLsanitize{#1} \textbackslash)% lwarp
-        }{siunitx}{\__siunitx_print:nn { number } {
-            \LWR at origensuredmath{#1}
-        }}% lwarp
+        }{siunitx}{%
+            \__siunitx_print:nn { number } {%
+                \LWR at origensuredmath{#1}%
+            }%
+        }% lwarp
       \__siunitx_unit_output_print:
     }
     \group_end:% lwarp

Added: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-url.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-url.sty	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-url.sty	2018-04-01 22:24:04 UTC (rev 47225)
@@ -0,0 +1,32 @@
+%%
+%% This is file `lwarp-url.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% lwarp.dtx  (with options: `url')
+%% This is a generated file.
+%% Copyright 2016-2018 Brian Dunn
+%% 
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%%   http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+
+\LWR at ProvidesPackagePass{url}
+
+\LetLtxMacro\LWR at url@origUrl at FormatString\Url at FormatString
+
+\renewcommand*{\Url at FormatString}{%
+    \InlineClass{verbatim}{%
+        \LWR at restoreorigformatting%
+        \LWR at url@origUrl at FormatString%
+    }%
+}
+
+\endinput
+%%
+%% End of file `lwarp-url.sty'.


Property changes on: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp-url.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/tex/latex/lwarp/lwarp.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/lwarp/lwarp.sty	2018-04-01 22:21:24 UTC (rev 47224)
+++ trunk/Master/texmf-dist/tex/latex/lwarp/lwarp.sty	2018-04-01 22:24:04 UTC (rev 47225)
@@ -17,7 +17,7 @@
 %% version 2005/12/01 or later.
 \NeedsTeXFormat{LaTeX2e}[1999/12/01]
 \ProvidesPackage{lwarp}
-    [2018/03/24 v0.51  Allows LaTeX to directly produce HTML5 output.]
+    [2018/04/01 v0.52  Allows LaTeX to directly produce HTML5 output.]
 
 
 
@@ -61,7 +61,9 @@
 \fi
 \ifPDFTeX
 \RequirePackage[T1]{fontenc}
+\@ifpackageloaded{inputenc}{}{
 \RequirePackage[utf8]{inputenc}
+}
 \fi
 
 \RequirePackage{newunicodechar}
@@ -390,6 +392,7 @@
 \LWR at notmemoirloadafter{needspace}
 \LWR at loadafter{newtxmath}
 \LWR at notmemoirloadafter{nextpage}
+\LWR at loadafter{nicefrac}
 \LWR at loadafter{nonfloat}
 \LWR at loadafter{nonumonpart}
 \LWR at loadafter{nopageno}
@@ -468,6 +471,7 @@
 \LWR at loadafter{turnthepage}
 \LWR at loadafter{ulem}
 \LWR at loadafter{upref}
+\LWR at loadafter{url}
 \LWR at loadafter{varioref}% no lwarp package provided
 \LWR at notmemoirloadafter{verse}
 \LWR at loadafter{vertbars}
@@ -512,7 +516,7 @@
 
 \begin{warpHTML}
 \RequirePackage[paperheight=190in,paperwidth=20in,%
-left=2in,right=12in,%
+left=2in,right=6in,%
 top=1in,bottom=1in,%
 ]{geometry}
 \@twosidefalse
@@ -2114,6 +2118,12 @@
     font-size: .85em ;
 }
 
+span.verbatim {
+    font-family: "DejaVu Mono", "Bitstream Vera Mono", "Lucida Console",
+        "Nimbus Mono L", "Liberation Mono", "FreeMono", "Andale Mono",
+        "Courier New", monospace;
+}
+
 div.published
 {
     text-align: center ;
@@ -3058,7 +3068,6 @@
 
 
 \begin{LWR at createlwarpmk}
-
 \begin{filecontents*}{lwarpmk.lua}
 #!/usr/bin/env texlua
 
@@ -3066,7 +3075,7 @@
 
 -- Print the usage of the lwarpmk command:
 
-printversion = "v0.51"
+printversion = "v0.52"
 
 function printhelp ()
 print ("lwarpmk: Use lwarpmk -h or lwarpmk --help for help.") ;
@@ -3157,7 +3166,7 @@
 -- Default configuration filename:
 local conffile = "lwarpmk.conf"
 -- Optional configuration filename:
-if arg[2] ~= nil then conffile = arg[2]..".lwarpmkconf" end
+if ( arg[2] ~= nil ) then conffile = arg[2]..".lwarpmkconf" end
 -- Default language:
 language = "english"
 -- Default xdyfile:
@@ -3167,7 +3176,9 @@
     -- file not exists
     print ("lwarpmk: ===")
     print ("lwarpmk: " .. conffile .." does not exist.")
-    print ("lwarpmk: " .. arg[2] .. " does not appear to be a project name.\n")
+    if ( arg[2] ~= nil ) then
+        print ("lwarpmk: " .. arg[2] .. " does not appear to be a project name.\n")
+    end
     print ("lwarpmk: ===")
     printhelp () ;
     os.exit(1) -- exit the entire lwarpmk script
@@ -3348,10 +3359,9 @@
 end
 
 -- Remove auxiliary files:
-
+-- All aux files are removed since there may be many bbl*.aux files.
 function removeaux ()
-os.execute ( rmname .. " " ..
-    sourcename ..".aux " .. sourcename .. "_html.aux " ..
+os.execute ( rmname .. " *.aux " ..
     sourcename ..".toc " .. sourcename .. "_html.toc " ..
     sourcename ..".lof " .. sourcename .. "_html.lof " ..
     sourcename ..".lot " .. sourcename .. "_html.lot " ..
@@ -3359,7 +3369,7 @@
     sourcename ..".ind " .. sourcename .. "_html.ind " ..
     sourcename ..".log " .. sourcename .. "_html.log " ..
     sourcename ..".gl* " .. sourcename .. "_html.gl* " ..
-    "*_html_inc.*"
+    " *_html_inc.* "
     )
 end
 
@@ -3394,6 +3404,8 @@
         os.exit(1) ;
     end
 end -- create lwarp_one_limage.cmd
+-- Track the number of parallel processes
+numimageprocesses = 0
 -- Scan lateximages.txt
 for line in limagesfile:lines() do
 -- lwimgpage is the page number in the PDF which has the image
@@ -3402,6 +3414,8 @@
 i,j,lwimgpage,lwimghash,lwimgname = string.find (line,"|(.*)|(.*)|(.*)|")
 -- For each entry:
 if ( (i~=nil) ) then
+-- Skip if the page number is 0:
+if ( lwimgpage ~= "0" ) then
 -- Skip is this image is hashed and already exists:
 local lwimgfullname = "lateximages" .. dirslash .. lwimgname .. ".svg"
 if (
@@ -3423,7 +3437,6 @@
 if opsystem=="Unix" then
 -- For Unix / Linux / Mac OS:
 err = os.execute(
--- print (
 cmdgroupopenname ..
 "pdfseparate -f " .. lwimgpage .. " -l " .. lwimgpage .. " " ..
     sourcename .."_html.pdf " ..
@@ -3442,10 +3455,29 @@
 rmname .. " lateximages" .. dirslash .. "lateximagetemp-" .. lwimgpage .. ".pdf" ..
 cmdgroupclosename .. " >/dev/null " .. bgname
 )
+-- Every 32 images, wait for completion at below normal priority,
+--  allowing other image tasks to catch up.
+numimageprocesses = numimageprocesses + 1
+if ( numimageprocesses > 32 ) then
+    numimageprocesses = 0
+    print ( "lwarpmk: waiting" )
+    err = os.execute ( "wait" )
+end
 elseif opsystem=="Windows" then
 -- For Windows
+-- Every 32 images, wait for completion at below normal priority,
+--  allowing other image tasks to catch up.
+numimageprocesses = numimageprocesses + 1
+if ( numimageprocesses > 32 ) then
+    numimageprocesses = 0
+    thiswaitcommand = "/WAIT /BELOWNORMAL"
+    print ( "lwarpmk: waiting" )
+else
+    thiswaitcommand = ""
+end
+-- Execute the image generation command
 err = os.execute (
-    "start /b \"\" lwarp_one_limage " ..
+    "start /B " .. thiswaitcommand .. " \"\" lwarp_one_limage " ..
     lwimgpage .. " " ..
     lwimghash .. " " ..
     lwimgname .. " " ..
@@ -3459,6 +3491,7 @@
     os.exit(1)
 end
 end -- not hashed or not exists
+end -- not page 0
 end -- not nil
 end -- do
 io.close(limagesfile)
@@ -3637,16 +3670,12 @@
 print ("lwarpmk: Done.")
 
 -- lwarpmk limages:
--- Scan the lateximages.txt file to create lateximages,
--- then touch the source to trigger a recompile.
+-- Scan the lateximages.txt file to create lateximages.
 
 elseif arg[1] == "limages" then
 loadconf ()
 print ("lwarpmk: Processing images.")
 createlateximages ()
-print ("lwarpmk: Forcing an update of " .. sourcename ..".tex.")
-refreshdate ()
-print ("lwarpmk: " .. sourcename ..".tex is ready to be recompiled.")
 print ("lwarpmk: Done.")
 
 -- lwarpmk again:
@@ -4083,7 +4112,6 @@
 
 
 \newcommand*{\LWR at htmltagc}[1]{%
-{%
 \LWR at traceinfo{LWR at htmltagc !\detokenize{#1}!}%
 \begingroup%
 \LWR at FBcancel%
@@ -4092,8 +4120,6 @@
 #1%
 \protect\LWR at origtextgreater%
 \endgroup%
-\LWR at traceinfo{LWR at htmltagc: done}%
-}%
 }
 
 \newcommand*{\LWR at nestspanitem}{%
@@ -4376,7 +4402,6 @@
 
 \newcommand*{\LWR at closeparagraph}
 {%
-\LWR at traceinfo{LWR at closeparagraph}%
 \ifbool{LWR at doingapar}%
 {% handling pars
     \ifboolexpr{
@@ -4428,7 +4453,6 @@
 
 \newcommand*{\LWR at startpars}%
 {%
-\LWR at traceinfo{LWR at startpars}%
 \ifnumcomp{\value{LWR at spandepth}}{>}{0}%
 {}%
 {%
@@ -4442,7 +4466,6 @@
     \global\setbool{LWR at doingstartpars}{true}%
     \global\boolfalse{LWR at doingapar}%
 }% nestspan
-\LWR at traceinfo{LWR at startpars: done}%
 }
 
 \newcommand*{\LWR at stoppars}%
@@ -4539,7 +4562,7 @@
 \begin{warpall}
 
 \newcounter{FootnoteDepth}
-\setcounter{FootnoteDepth}{5}
+\setcounter{FootnoteDepth}{3}
 
 \end{warpall}
 
@@ -4547,7 +4570,9 @@
 
 \newbox\LWR at footnotes
 \long\def\@makefntext#1{\textsuperscript{\@thefnmark}~#1}
-\def\@makefnmark{\hbox{\textsuperscript{\@thefnmark}}}
+\def\@makefnmark{%
+    \textsuperscript{\@thefnmark}%
+}
 \long\def\LWR at footnotetext#1{%
 \LWR at traceinfo{LWR at footnotetext}%
 \global\setbox\LWR at footnotes=\vbox{%
@@ -4575,20 +4600,21 @@
     }%
     \color at endgroup%
 }% vbox
+\LWR at ensuredoingapar%
 }%
 
-\let\@footnotetext\LWR at footnotetext
+\LetLtxMacro\@footnotetext\LWR at footnotetext
 \newbox\LWR at mpfootnotes
 \long\def\@mpfootnotetext#1{%
 \LWR at traceinfo{@mpfootnotetext}%
 \global\setbox\LWR at mpfootnotes\vbox{%
-    \unvbox\LWR at mpfootnotes
-    \reset at font\footnotesize
-    \hsize\columnwidth
-    \@parboxrestore
-    \protected at edef\@currentlabel
-    {\csname p at mpfootnote\endcsname\@thefnmark}%
-    \color at begingroup
+    \unvbox\LWR at mpfootnotes%
+    \reset at font\footnotesize%
+    \hsize\columnwidth%
+    \@parboxrestore%
+    \protected at edef\@currentlabel%
+        {\csname p at mpfootnote\endcsname\@thefnmark}%
+    \color at begingroup%
     \ifthenelse{%
         \boolean{LWR at doingstartpars} \AND%
         \cnttest{\value{LWR at lateximagedepth}}{=}{0}%
@@ -4606,6 +4632,7 @@
     }%
     \color at endgroup%
 }% vbox
+\LWR at ensuredoingapar%
 \LWR at traceinfo{@mpfootnotetext: done}%
 }
 \AtBeginDocument{
@@ -4757,10 +4784,18 @@
 \StrSubstitute{\LWR at thisnewfilename}{----}{-}[\LWR at thisnewfilename]
 \StrSubstitute{\LWR at thisnewfilename}{---}{-}[\LWR at thisnewfilename]
 \StrSubstitute{\LWR at thisnewfilename}{--}{-}[\LWR at thisnewfilename]
+\ifPDFTeX%
+\ifdefstring{\inputencodingname}{utf8}{%
 \StrSubstitute{\LWR at thisnewfilename}{—}{-}[\LWR at thisnewfilename]
 \StrSubstitute{\LWR at thisnewfilename}{–}{-}[\LWR at thisnewfilename]
+}{}%
+\else% not PDFTeX
+\StrSubstitute{\LWR at thisnewfilename}{—}{-}[\LWR at thisnewfilename]
+\StrSubstitute{\LWR at thisnewfilename}{–}{-}[\LWR at thisnewfilename]
+\fi%
 \global\let\LWR at thisfilename\LWR at thisnewfilename% return a global result
-\endgroup
+\endgroup%
+\LWR at traceinfo{LWR at filenamenoblanks: result is \LWR at thisfilename}%
 }
 
 \newcounter{LWR at previousautopagelabel}
@@ -4775,18 +4810,39 @@
 }%
 }
 
-\newcommand{\LWR at nullifymathjaxensuremath}{%
+\newcommand*{\LWR at customizedMathJax}{}
+
+\newcommand*{\CustomizeMathJax}[1]{%
+    \appto{\LWR at customizedMathJax}{%
+        \(#1\)\par
+    }%
+}
+
+\newcommand{\LWR at customizeMathJax}{%
 \ifbool{mathjax}{
 \LWR at stoppars
 \LWR at htmlcomment{Nullify \textbackslash{}ensuremath for MathJax:}
 
-\(
-\newcommand\ensuremath[1]{##1}
-\)
+\(\newcommand\ensuremath[1]{##1}\)
+
+\LWR at htmlcomment{Additional customizations for MathJax:}
+
+\LWR at customizedMathJax
+
 \LWR at startpars
 }{}
 }
 
+\end{warpHTML}
+
+\begin{warpprint}
+
+\newcommand*{\CustomizeMathJax}[1]{}
+
+\end{warpprint}
+
+\begin{warpHTML}
+
 \newcommand*{\LWR at newhtmlfile}[1]{
 \LWR at traceinfo{LWR at newhtmlfile}
 
@@ -4830,7 +4886,15 @@
 
 \LWR at stoppars
 
+\ifPDFTeX%
+\ifdefstring{\inputencodingname}{utf8}{%
 \LWR at filestart{ — #1}% there is an EMdash in front of the #1
+}{
+\LWR at filestart{ - #1}% hyphen
+}
+\else%
+\LWR at filestart{ — #1}% there is an EMdash in front of the #1
+\fi%
 
 \setcounter{LWR at latestautopage}{\value{page}}%
 \LWR at newautopagelabel{LWR at latestautopage}%
@@ -4860,7 +4924,7 @@
 
 \LWR at stoppars
 
-\LWR at nullifymathjaxensuremath
+\LWR at customizeMathJax
 \LWR at traceinfo{LWR at newhtmlfile: done}
 }
 
@@ -4968,7 +5032,13 @@
 \ifbool{HTMLDebugComments}{%
     \begingroup%
     \LWR at nullfonts%
-    \LWR at htmlcomment{Opening #4 ``#3''{}}%
+    \IfBooleanTF{#1}% starred
+    {\LWR at htmlcomment{Opening #4*}}%
+    {%
+        \IfNoValueTF{#2}% short TOC
+            {\LWR at htmlcomment{Opening #4 ``#3''}}%
+            {\LWR at htmlcomment{Opening #4 ``#2''}}%
+    }
     \endgroup%
 }{}%
 
@@ -5173,7 +5243,7 @@
 
 
 \newcommand*{\LWR at filestart}[1]{
-\LWR at traceinfo{LWR at filestart}
+\LWR at traceinfo{LWR at filestart !#1!}
 \begingroup
 \LWR at nullfonts
 \LWR at htmltag{!DOCTYPE html}\LWR at orignewline
@@ -5286,7 +5356,7 @@
 \immediate\write\@mainaux{\catcode`\string$\active}%
 \LetLtxMacro\LWR at syntaxhighlightone$% balance for editor syntax highlighting
 \LWR at startpars
-\LWR at nullifymathjaxensuremath
+\LWR at customizeMathJax
 \LWR at traceinfo{LWR at lwarpStart: done}
 }
 \catcode`\$=3% math shift until lwarp starts
@@ -5550,11 +5620,22 @@
 
 
 
-
-
 \begin{warpHTML}
+\ifPDFTeX%
+\ifdefstring{\inputencodingname}{utf8}{%
 \newcommand{\attribution}[1]{%
-\InlineClass{attribution}{—\,#1}}% emdash
+    \InlineClass{attribution}{—\,#1}% emdash
+}
+}{
+\newcommand{\attribution}[1]{%
+    \InlineClass{attribution}{---\,#1}%
+}
+}
+\else%
+\newcommand{\attribution}[1]{%
+    \InlineClass{attribution}{—\,#1}% emdash
+}
+\fi%
 \end{warpHTML}
 \begin{warpprint}
 \newcommand{\attribution}[1]{\textsc{---\,#1}}
@@ -5561,8 +5642,21 @@
 \end{warpprint}
 
 \begin{warpHTML}
+\ifPDFTeX%
+\ifdefstring{\inputencodingname}{utf8}{%
 \newcommand{\citetitle}[1]{%
-\InlineClass{citetitle}{—\,#1}}% emdash
+    \InlineClass{citetitle}{—\,#1}%
+}%
+}{
+\newcommand{\citetitle}[1]{%
+    \InlineClass{citetitle}{---\,#1}%
+}%
+}
+\else%
+\newcommand{\citetitle}[1]{%
+    \InlineClass{citetitle}{—\,#1}%
+}%
+\fi%
 \end{warpHTML}
 \begin{warpprint}
 \newcommand{\citetitle}[1]{\textsl{---\,#1}}
@@ -5657,16 +5751,25 @@
 }
 }
 
-\AfterEndPreamble{
-\LWR at traceinfo{Patching tabbing.}
-\AtBeginEnvironment{tabbing}{%
-\LWR at forcenewpage
+\LetLtxMacro\LWR at origtabbing\tabbing
+\LetLtxMacro\LWR at origendtabbing\endtabbing
+
+\renewcommand*{\tabbing}{%
+\LWR at forcenewpage%
 \LWR at atbeginverbatim{3.5}{tabbing}%
+\LWR at origtabbing%
 }
-\AfterEndEnvironment{tabbing}{%
+
+\renewcommand*{\endtabbing}{%
+    \LWR at origendtabbing%
     \unskip\LWR at origvspace*{-\baselineskip}\LWR at afterendverbatim%
 }
+\AtBeginDocument{
+\appto\LWR at restoreorigformatting{%
+\LetLtxMacro\tabbing\LWR at origtabbing%
+\LetLtxMacro\endtabbing\LWR at origendtabbing%
 }
+}
 
 \end{warpHTML}
 
@@ -7433,25 +7536,58 @@
 \LWR at ensuredoingapar%
 }
 
-\DeclareDocumentCommand{\href}{O{} m +m}{%
+\DeclareDocumentCommand{\LWR at hrefb}{O{} m +m}{%
 \LWR at ensuredoingapar%
 \LWR at subhyperref{#2}{#3}%
+\endgroup%
 }
 
-\newcommand*{\nolinkurl}[1]{%
+\newrobustcmd*{\href}{%
+\begingroup%
+\catcode`\#=12
+\catcode`\%=12
+\catcode`\&=12
+\catcode`\~=12
+\catcode`\_=12
+\LWR at hrefb%
+}
+
+\newcommand*{\LWR at nolinkurlb}[1]{%
 \LWR at ensuredoingapar%
 \def\LWR at templink{#1}%
 \@onelevel at sanitize\LWR at templink%
 \LWR at templink%
+\endgroup%
 }
 
-\DeclareDocumentCommand{\url}{m}{%
+\newrobustcmd*{\nolinkurl}{%
+\begingroup%
+\catcode`\#=12
+\catcode`\%=12
+\catcode`\&=12
+\catcode`\~=12
+\catcode`\_=12
+\LWR at nolinkurlb%
+}
+
+\DeclareDocumentCommand{\LWR at urlb}{m}{%
 \LWR at ensuredoingapar%
 \def\LWR at templink{#1}%
 \@onelevel at sanitize\LWR at templink%
 \href{\LWR at templink}{\LWR at templink}%
+\endgroup%
 }
 
+\newrobustcmd*{\url}{%
+\begingroup%
+\catcode`\#=12
+\catcode`\%=12
+\catcode`\&=12
+\catcode`\~=12
+\catcode`\_=12
+\LWR at urlb%
+}
+
 \newcommand*{\LWR at subinlineimage}[5][]{%
 \ifblank{#1}%
 {\LWR at htmltag{img src="#3.#4" alt="#3" style="#5" class="#2"}}%
@@ -7917,6 +8053,7 @@
     \immediate\write\@auxout{\string\bibdata{#1}}%
     \fi
     \@input@{\BaseJobname.bbl}% lwarp
+    \DeclareDocumentCommand{\etalchar}{m}{\textsuperscript{#1}}% lwarp
 }
 \renewcommand{\@biblabel}[1]{[#1]\quad}
 \AtBeginDocument{
@@ -7935,7 +8072,11 @@
   \endgroup
   \LWR at em@after\egroup
 }
+\DeclareDocumentCommand{\etalchar}{m}{\textsuperscript{#1}}
 }% \AtBeginEnvironment{thebibliography}
+\BeforeBeginEnvironment{thebibliography}{%
+\DeclareDocumentCommand{\etalchar}{m}{\textsuperscript{#1}}
+}% \BeforeBeginEnvironment
 }% \AtBeginDocument
 
 \end{warpHTML}
@@ -8066,22 +8207,33 @@
 
 \AtBeginDocument{
 
-\@ifpackageloaded{graphicx}{
-    \newcommand*{\LWR at addbaselinemarker}{%
-        \LWR at origincludegraphics[%
-            width=10sp,height=10sp%
-        ]{lwarp_baseline_marker.png}%
-    }
-}{
-    \@ifpackageloaded{graphics}{
+\IfFileExists{lwarp_baseline_marker.png}%
+{
+    \@ifpackageloaded{graphicx}{
         \newcommand*{\LWR at addbaselinemarker}{%
-            \LWR at origincludegraphics{lwarp_baseline_marker.png}%
+            \LWR at origincludegraphics[%
+                width=10sp,height=10sp%
+            ]{lwarp_baseline_marker.png}%
         }
     }{
-        \newcommand*{\LWR at addbaselinemarker}{%
-            \hspace*{10sp}%
+        \@ifpackageloaded{graphics}{
+            \newcommand*{\LWR at addbaselinemarker}{%
+                \LWR at origincludegraphics{lwarp_baseline_marker.png}%
+            }
+        }{
+            \PackageWarning{lwarp}{Load graphicx or graphics
+                for improved SVG math baselines,}
+            \newcommand*{\LWR at addbaselinemarker}{%
+                \hspace*{10sp}%
+            }
         }
     }
+}{% lwarp_baseline_marker.png not present
+    \PackageWarning{lwarp}{File lwarp_baseline_marker.png is not installed alongside
+        the lwarp-*.sty files, so SVG math baselines may not be accurate,}
+    \newcommand*{\LWR at addbaselinemarker}{%
+        \hspace*{10sp}%
+    }
 }
 
 }% AtBeginDocument
@@ -8093,8 +8245,10 @@
 \newsavebox{\LWR at singledollarbox}
 
 \NewDocumentCommand{\LWR at subsingledollar}{s m m m}{%
+\LWR at traceinfo{LWR at subsingledollar}%
 \ifnumcomp{\value{LWR at lateximagedepth}}{>}{0}%
 {%
+\LWR at traceinfo{LWR at subsingledollar: already in a lateximage}%
     #4% contents
 }%
 {% not in a lateximage
@@ -8110,12 +8264,16 @@
     {\textbackslash(\LWR at HTMLsanitize{#4}\textbackslash)}%
 }% mathjax
 {% not mathjax
+\LWR at traceinfo{LWR at subsingledollar: not mathjax}%
     \begingroup%
     \LWR at restoreorigformatting%
     \RenewDocumentEnvironment{lateximage}{s o o o}{}{}% inside group
     \LWR at orignormalsize%
+    \LWR at traceinfo{Using font family \LWR at f@family}%
     \csuse{LWR at orig\LWR at f@family family}%
+    \LWR at traceinfo{Using font series \LWR at f@series}%
     \csuse{LWR at orig\LWR at f@series series}%
+    \LWR at traceinfo{Using font shape \LWR at f@shape}%
     \csuse{LWR at orig\LWR at f@shape shape}%
     \global\advance\c at LWR@lateximagedepth 1\relax%
     \global\sbox{\LWR at singledollarbox}{#4}%
@@ -8127,12 +8285,20 @@
         }%
     }%
     \global\advance\c at LWR@lateximagedepth -1\relax% Due to AmS \text macro.
-    \setlength{\LWR at singledollardepth}{.70\dp\LWR at singledollarbox}%
+    \setlength{\LWR at singledollardepth}{%
+        \LateximageFontScale\dp\LWR at singledollarbox%
+    }%
     \global\LWR at singledollardepth=\LWR at singledollardepth%
-    \setlength{\LWR at singledollarwidth}{.70\wd\LWR at singledollarbox}%
+    \setlength{\LWR at singledollarwidth}{%
+        \LateximageFontScale\wd\LWR at singledollarbox%
+    }%
     \global\LWR at singledollarwidth=\LWR at singledollarwidth%
-    \setlength{\LWR at singledollarheight}{.70\ht\LWR at singledollarbox}%
-    \addtolength{\LWR at singledollarheight}{.70\dp\LWR at singledollarbox}%
+    \setlength{\LWR at singledollarheight}{%
+        \LateximageFontScale\ht\LWR at singledollarbox%
+    }%
+    \addtolength{\LWR at singledollarheight}{%
+        \LateximageFontScale\dp\LWR at singledollarbox%
+    }%
     \global\LWR at singledollarheight=\LWR at singledollarheight%
     \endgroup%
     \ifdimgreater{\LWR at singledollarwidth}{.7\LWR at singledollarheight}{%
@@ -8195,6 +8361,7 @@
 }% not mathjax
 \endgroup%
 }% not in a lateximage
+\LWR at traceinfo{LWR at subsingledollar: done}%
 }
 
 \LetLtxMacro\LWR at origdollar$
@@ -8237,7 +8404,7 @@
 }%
 \protected\gdef\LWR at singledollar#1${%
 \ifbool{mathjax}{%
-\LWR at subsingledollar*%
+    \LWR at subsingledollar*%
     {% alt tag
         \textbackslash( %
         \LWR at HTMLsanitize{#1} % extra space
@@ -8246,7 +8413,7 @@
     {singledollar}% add'l hashing
     {#1}% contents
 }{% not mathjax
-\LWR at subsingledollar*%
+    \LWR at subsingledollar*%
     {% alt tag
         \textbackslash( %
         \LWR at HTMLsanitize{#1} % extra space
@@ -8269,7 +8436,9 @@
 
 \renewcommand{\@ensuredmath}[1]{%
 \ifbool{mathjax}{%
-    \LWR at subsingledollar*{(math image)}{\LWR at HTMLsanitize{#1}}{\relax%
+    \LWR at subsingledollar*{(math image)}{%
+           \protect\LWR at HTMLsanitize{\detokenize\expandafter{#1}}%
+    }{\relax%
         \LWR at origensuredmath{#1}%
     }%
 }{% SVG math
@@ -8279,7 +8448,9 @@
     \ifnumcomp{\value{LWR at lateximagedepth}}{>}{0}%
     {\LWR at origensuredmath{#1}}%
     {%
-        \LWR at subsingledollar*{(math image)}{\LWR at HTMLsanitize{#1}}{%
+        \LWR at subsingledollar*{(math image)}{%
+           \protect\LWR at HTMLsanitize{\detokenize\expandafter{#1}}%
+        }{%
             \LWR at origensuredmath{#1}%
         }%
     }%
@@ -8374,50 +8545,69 @@
 
 \let\LWR at origequation\equation
 \let\LWR at origendequation\endequation
-\let\equation\relax
-\let\endequation\relax
+\csletcs{LWR at origequation*}{equation*}
+\csletcs{LWR at origendequation*}{endequation*}
+\newcommand*{\LWR at doequation}[2]{%
 
-\NewEnviron{equation}{%
-
 \ifboolexpr{bool{mathjax} or ( bool{FormatWP} and bool{WPMarkMath} ) }%
 {
     \LWR at syncmathjax
-    \LWR at hidelatexequation{equation}{\BODY}
+    \LWR at hidelatexequation{#2}{#1}
 }
 {% not mathjax
-    \begin{BlockClass}{displaymathnumbered}
+    \ifstrequal{#2}{equation*}{%
+        \begin{BlockClass}{displaymath}%
+    }{%
+        \begin{BlockClass}{displaymathnumbered}%
+    }%
     \LWR at newautoidanchor%
     \booltrue{LWR at indisplaymathimage}%
     \begin{lateximage}[%
-        (\LWR at equationtag) \textbackslash{begin\{equation\}} % extra space
-        \LWR at HTMLsanitizeexpand{\detokenize\expandafter{\BODY}} % extra space
-        \textbackslash{end\{equation\}}%
+        \ifstrequal{#2}{equation*}{%
+            \ifdefequal{\LWR at equationtag}{\theequation}{%
+            }{%
+                (\LWR at equationtag) % tag was given
+            }%
+        }{%
+            (\LWR at equationtag) % automatic numbering
+        }%
+        \textbackslash{begin\{#2\}} % extra space
+        \LWR at HTMLsanitizeexpand{\detokenize\expandafter{#1}} % extra space
+        \textbackslash{end\{#2\}}%
     ]% alt tag
-    \LWR at origequation
-    \BODY% contents collected by NewEnviron
-    \LWR at origendequation
+    \csuse{LWR at orig#2}
+    #1% contents collected by \collect at body
+    \csuse{LWR at origend#2}
     \end{lateximage}%
     \end{BlockClass}
 }% not mathjax
-
-}[%
+}
+\newcommand*{\LWR at doendequation}[1]{%
     \ifboolexpr{bool{mathjax} or ( bool{FormatWP} and bool{WPMarkMath} ) }%
     {%
-        \LWR at addmathjax{equation}{\BODY}%
+        \LWR at addmathjax{#1}{\BODY}%
     }{}%
 
-]
+}
 
+\let\equation\relax
+\let\endequation\relax
+\csletcs{equation*}{relax}
+\csletcs{endequation*}{relax}
+
+\NewEnviron{equation}
+{
+\LWR at doequation{\BODY}{equation}
+}
+[\LWR at doendequation{equation}]
+
 \LetLtxMacro\LWR at equationnormal\equation
 \LetLtxMacro\LWR at endequationnormal\endequation
 
-\csletcs{LWR at origequationstar}{equation*}
-\csletcs{LWR at origendequationstar}{endequation*}
+\NewEnviron{equation*}
+{\LWR at doequation{\BODY}{equation*}}
+[\LWR at doendequation{equation*}]
 
-\renewenvironment*{equation*}
-{\displaymath}
-{\enddisplaymath}
-
 \csletcs{LWR at equationnormalstar}{equation*}
 \csletcs{LWR at endequationnormalstar}{endequation*}
 
@@ -8842,11 +9032,12 @@
 \newcounter{LWR at LIpage}
 \end{warpHTML}
 
-
 \begin{warpall}
 
 \newcommand*{\LateximageFontSizeName}{large}
 
+\newcommand*{\LateximageFontScale}{.75}
+
 \end{warpall}
 
 
@@ -8906,7 +9097,7 @@
 
 \let\LWR at startingequationtag\theLWR at startingequation
 
-\let\LWR at equationtag\theequation
+\newcommand*{\LWR at equationtag}{}
 
 \AtBeginDocument{
 
@@ -8917,8 +9108,7 @@
 {%
     \global\boolfalse{LWR at isstartingequation}%
     \xdef\LWR at startingequationtag{#1}%
-}%
-{}%
+}{}%
 \xdef\LWR at equationtag{#1}%
 }%
 
@@ -8985,7 +9175,8 @@
     \LWR at traceinfo{lateximage: about to write to lateximages.txt}%
     \IfBooleanTF{#1}% starred
     {% hash
-        \LWR at traceinfo{lateximage: hash true, adding !#2!#3!}%
+        \LWR at traceinfo{lateximage: hash true, adding %
+            !\detokenize\expandafter{#2}!\detokenize\expandafter{#3}!}%
         \edef\LWR at hashedname{%
             \LWR at mdfive{\detokenize\expandafter{#2}-!-#3}%
         }%
@@ -9012,7 +9203,7 @@
     \LWR at restoreorigformatting%
     \def\@mpfn{footnote}%
     \def\thempfn{\thefootnote}%
-    \let\@footnotetext\LWR at footnotetext%
+    \LetLtxMacro\@footnotetext\LWR at footnotetext%
     \LWR at traceinfo{lateximage: about to create label}%
     \LWR at origlabel{LWRlateximage\arabic{LWR at lateximagenumber}}%
     \LWR at traceinfo{lateximage: finished creating the label}%
@@ -9025,8 +9216,8 @@
         \LetLtxMacro\]\LWR at origclosebracket%
         \let\equation\LWR at origequation%
         \let\endequation\LWR at origendequation%
-        \csletcs{equation*}{LWR at origequationstar}%
-        \csletcs{endequation*}{LWR at origendequationstar}%
+        \csletcs{equation*}{LWR at origequation*}%
+        \csletcs{endequation*}{LWR at origendequation*}%
     }% not in display math
     \LetLtxMacro\LWR at newsingledollar$%
     \LetLtxMacro\LWR at newsingledollar$% syntax highlighting
@@ -9775,6 +9966,8 @@
 \def\(##1\){}%
 \def\[##1\]{}%
 \RenewDocumentCommand{\LWR at subsingledollar}{s m m m}{}
+\let\texorpdfstring\relax%
+\newcommand{\texorpdfstring}[2]{##2}%
 }
 
 



More information about the tex-live-commits mailing list