diff options
26 files changed, 1954 insertions, 482 deletions
diff --git a/Build/source/texk/texlive/linked_scripts/lwarp/lwarpmk.lua b/Build/source/texk/texlive/linked_scripts/lwarp/lwarpmk.lua index 39ab4a71e61..99b5f4949fe 100755 --- a/Build/source/texk/texlive/linked_scripts/lwarp/lwarpmk.lua +++ b/Build/source/texk/texlive/linked_scripts/lwarp/lwarpmk.lua @@ -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 @@ function loadconf () -- 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 @@ if (lfs.attributes(conffile,"mode")==nil) then -- 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 @@ splitfile (homehtmlfilename .. ".html" , sourcename .. "_html.html") 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 @@ os.execute ( rmname .. " " .. sourcename ..".ind " .. sourcename .. "_html.ind " .. sourcename ..".log " .. sourcename .. "_html.log " .. sourcename ..".gl* " .. sourcename .. "_html.gl* " .. - "*_html_inc.*" + " *_html_inc.* " ) end @@ -332,6 +333,8 @@ if opsystem=="Windows" then 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 @@ for line in limagesfile:lines() do 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 @@ end 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 .. lwimgname .. ".pdf" .. seqname .. 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 @@ if ( err ~= 0 ) then 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: " .. sourcename ..".tex is ready to be recompiled.") 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: diff --git a/Build/source/texk/texlive/linked_scripts/ptex-fontmaps/kanji-config-updmap.pl b/Build/source/texk/texlive/linked_scripts/ptex-fontmaps/kanji-config-updmap.pl index a5159f26786..1a0f1f2530a 100755 --- a/Build/source/texk/texlive/linked_scripts/ptex-fontmaps/kanji-config-updmap.pl +++ b/Build/source/texk/texlive/linked_scripts/ptex-fontmaps/kanji-config-updmap.pl @@ -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 Getopt::Long qw(:config no_autoabbrev ignore_case_always); 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 @@ if ($opt_help) { # 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; diff --git a/Build/source/texk/texlive/linked_scripts/ptex-fontmaps/kanji-fontmap-creator.pl b/Build/source/texk/texlive/linked_scripts/ptex-fontmaps/kanji-fontmap-creator.pl index dc67800d5f2..4631e48c275 100755 --- a/Build/source/texk/texlive/linked_scripts/ptex-fontmaps/kanji-fontmap-creator.pl +++ b/Build/source/texk/texlive/linked_scripts/ptex-fontmaps/kanji-fontmap-creator.pl @@ -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_help = 0; my $opt_version = 0; my $prg = "kanji-fontmap-creator"; -my $version = "20180306.0"; +my $version = "20180328.0"; # # global vars configuring operation diff --git a/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl b/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl index 447554c8d5d..585ca0b7c2c 100755 --- a/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl +++ b/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl @@ -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 @@ sub action_remove { # 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 @@ C<tlpkg/gpg/repository-keys.gpg>. 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,263 @@ package, dependencies are never removed. Options: =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> + +=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 + +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> @@ -8469,9 +8729,13 @@ 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 @@ This script and its documentation were written for the TeX Live 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 diff --git a/Master/texmf-dist/doc/latex/lwarp/README.txt b/Master/texmf-dist/doc/latex/lwarp/README.txt index 84fd3e41701..02ab21b59be 100644 --- a/Master/texmf-dist/doc/latex/lwarp/README.txt +++ b/Master/texmf-dist/doc/latex/lwarp/README.txt @@ -1,5 +1,5 @@ -LaTeX lwarp package v0.51 README.txt +LaTeX lwarp package v0.52 README.txt Files included are: diff --git a/Master/texmf-dist/doc/latex/lwarp/lwarp.pdf b/Master/texmf-dist/doc/latex/lwarp/lwarp.pdf Binary files differindex 36177f970e9..4b143b849a8 100644 --- a/Master/texmf-dist/doc/latex/lwarp/lwarp.pdf +++ b/Master/texmf-dist/doc/latex/lwarp/lwarp.pdf diff --git a/Master/texmf-dist/scripts/lwarp/lwarpmk.lua b/Master/texmf-dist/scripts/lwarp/lwarpmk.lua index 39ab4a71e61..99b5f4949fe 100755 --- a/Master/texmf-dist/scripts/lwarp/lwarpmk.lua +++ b/Master/texmf-dist/scripts/lwarp/lwarpmk.lua @@ -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 @@ function loadconf () -- 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 @@ if (lfs.attributes(conffile,"mode")==nil) then -- 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 @@ splitfile (homehtmlfilename .. ".html" , sourcename .. "_html.html") 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 @@ os.execute ( rmname .. " " .. sourcename ..".ind " .. sourcename .. "_html.ind " .. sourcename ..".log " .. sourcename .. "_html.log " .. sourcename ..".gl* " .. sourcename .. "_html.gl* " .. - "*_html_inc.*" + " *_html_inc.* " ) end @@ -332,6 +333,8 @@ if opsystem=="Windows" then 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 @@ for line in limagesfile:lines() do 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 @@ end 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 .. lwimgname .. ".pdf" .. seqname .. 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 @@ if ( err ~= 0 ) then 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: " .. sourcename ..".tex is ready to be recompiled.") 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: diff --git a/Master/texmf-dist/source/latex/lwarp/lwarp.dtx b/Master/texmf-dist/source/latex/lwarp/lwarp.dtx index 7ca53bf2b44..9e314321fcf 100644 --- a/Master/texmf-dist/source/latex/lwarp/lwarp.dtx +++ b/Master/texmf-dist/source/latex/lwarp/lwarp.dtx @@ -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 @@ Keywords={LaTeX, HTML, conversion}% } {\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 @@ to redefine the message which is printed for page number references. \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,9 +745,42 @@ as \HTML\ has no concept of page numbers. \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. + +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} -\limitspfnote +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}{ @@ -839,8 +881,17 @@ in the \SVG\ image may be adjusted \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 @@ so complicated objects such as \tikz\ pictures are more likely to compile succes } +\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 @@ and the \brand{MathJax} cross-referencing system is ignored in favor of the \LaT 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 @@ Limitations when using \brand{MathJax} include: \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 @@ environments. \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 @@ of this extension is created first.} } \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 @@ This boolean may be tested by the user for later use. %<*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 @@ This boolean may be tested by the user for later use. % \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 @@ This boolean may be tested by the user for later use. % see the end of the Change History on page \pageref{sec:changesend}. % % \begin{description} +% \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 @@ This boolean may be tested by the user for later use. % \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 @@ This boolean may be tested by the user for later use. % \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 @@ This boolean may be tested by the user for later use. % \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 @@ This boolean may be tested by the user for later use. % \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 @@ This boolean may be tested by the user for later use. % \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 @@ This boolean may be tested by the user for later use. % 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 @@ This boolean may be tested by the user for later use. % 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 @@ This boolean may be tested by the user for later use. % 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 @@ This boolean may be tested by the user for later use. % \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 @@ This boolean may be tested by the user for later use. % \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 @@ This boolean may be tested by the user for later use. % 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 @@ This boolean may be tested by the user for later use. % % 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 @@ This boolean may be tested by the user for later use. % 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 @@ This boolean may be tested by the user for later use. % \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 @@ This boolean may be tested by the user for later use. % 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,9 +5808,22 @@ This boolean may be tested by the user for later use. % % % \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} @@ -5828,7 +5964,7 @@ This boolean may be tested by the user for later use. % \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 @@ This boolean may be tested by the user for later use. % \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 @@ This boolean may be tested by the user for later use. % % \subsection{Tabbing} % \limitstabbing +% \index{tabbing>and math} +% \index{math>\env{tabbing}} % % % \subsection{Tabular} @@ -6774,12 +6912,11 @@ This boolean may be tested by the user for later use. % 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} @@ -6798,6 +6935,11 @@ This boolean may be tested by the user for later use. % \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 @@ This boolean may be tested by the user for later use. % % 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 @@ For a possible alternative, see package(s) #2.} \LWR@loadafter{newtxmath} % newunicodechar must be loaded before lwarp \LWR@notmemoirloadafter{nextpage} +\LWR@loadafter{nicefrac} \LWR@loadafter{nonfloat} \LWR@loadafter{nonumonpart} \LWR@loadafter{nopageno} @@ -7975,6 +8124,7 @@ For a possible alternative, see package(s) #2.} % \LWR@loadafter{typearea}% preloaded by koma-script classes \LWR@loadafter{ulem} \LWR@loadafter{upref} +\LWR@loadafter{url} \LWR@loadafter{varioref}% no lwarp package provided \LWR@notmemoirloadafter{verse} \LWR@loadafter{vertbars} @@ -7996,7 +8146,7 @@ For a possible alternative, see package(s) #2.} - +% ^^A *required % \section{Required packages} % \label{sec:requiredpackages} % \index{package>required} @@ -8185,12 +8335,13 @@ For a possible alternative, see package(s) #2.} % \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 @@ top=1in,bottom=1in,% } % \end{macrocode} - - % \begin{macrocode} \end{warpall} % \end{macrocode} @@ -8337,7 +8486,7 @@ top=1in,bottom=1in,% % \end{macrocode} -% \DescribePackage{xstring} +% \DescribePackage{verbatim} % \begin{macrocode} \RequirePackage{verbatim} % \end{macrocode} @@ -10532,7 +10681,11 @@ div.programlisting pre.verbatim span.callout{ 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; +} @@ -11640,13 +11793,26 @@ src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX- % \subsection{lwarpmk option} -% The following is only generated if the \optn{lwarpmk} option -% was given to \pkg{lwarp}. -% \begin{macrocode} -\begin{LWR@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}.} @@ -11670,6 +11836,14 @@ src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX- % \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@createlwarpmk} +% \end{macrocode} % % ^^A *lwarpmk.lua % \begin{macrocode} @@ -11680,7 +11854,7 @@ src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX- -- 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 @@ function loadconf () -- 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 @@ if (lfs.attributes(conffile,"mode")==nil) then -- 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 @@ 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 " .. @@ -11980,7 +12155,7 @@ os.execute ( rmname .. " " .. sourcename ..".ind " .. sourcename .. "_html.ind " .. sourcename ..".log " .. sourcename .. "_html.log " .. sourcename ..".gl* " .. sourcename .. "_html.gl* " .. - "*_html_inc.*" + " *_html_inc.* " ) end @@ -12015,6 +12190,8 @@ if opsystem=="Windows" then 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 @@ for line in limagesfile:lines() do 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 @@ end 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 .. lwimgname .. ".pdf" .. seqname .. 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 @@ if ( err ~= 0 ) then 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: " .. sourcename ..".tex is ready to be recompiled.") 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 @@ end -- not --version % \cs{protect} is in case the tag appears in TOC, LOF, LOT. % \begin{macrocode} \newcommand*{\LWR@htmltagc}[1]{% -{% \LWR@traceinfo{LWR@htmltagc !\detokenize{#1}!}% \begingroup% \LWR@FBcancel% @@ -13195,8 +13388,7 @@ end -- not --version #1% \protect\LWR@origtextgreater% \endgroup% -\LWR@traceinfo{LWR@htmltagc: done}% -}% +% \LWR@traceinfo{LWR@htmltagc: done}% } % \end{macrocode} % \end{macro} @@ -13799,7 +13991,7 @@ end -- not --version % \begin{macrocode} \newcommand*{\LWR@closeparagraph} {% -\LWR@traceinfo{LWR@closeparagraph}% +% \LWR@traceinfo{LWR@closeparagraph}% % \end{macrocode} % See if paragraph handling is enabled: % \begin{macrocode} @@ -13908,7 +14100,7 @@ end -- not --version % \begin{macrocode} \newcommand*{\LWR@startpars}% {% -\LWR@traceinfo{LWR@startpars}% +% \LWR@traceinfo{LWR@startpars}% % \end{macrocode} % Ignore if inside a span: % \begin{macrocode} @@ -13947,7 +14139,7 @@ end -- not --version % \begin{macrocode} \global\boolfalse{LWR@doingapar}% }% nestspan -\LWR@traceinfo{LWR@startpars: done}% +% \LWR@traceinfo{LWR@startpars: done}% } % \end{macrocode} % \end{macro} @@ -14254,7 +14446,8 @@ end -- not --version % % \subsection{Regular page footnotes} % In \HTML\ documents, footnotes are placed at the -% bottom of the web page using the \LaTeX\ box \cs{LWR@footnotes}. +% bottom of the web page or the section, depending on \progcode{FootnoteDepth}, +% using the \LaTeX\ box \cs{LWR@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 @@ end -- not --version \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 @@ end -- not --version % % \begin{macro}{\@makefnmark} % \begin{macrocode} -\def\@makefnmark{\hbox{\textsuperscript{\@thefnmark}}} +\def\@makefnmark{% + \textsuperscript{\@thefnmark}% +} % \end{macrocode} % \end{macro} % @@ -14361,7 +14557,7 @@ end -- not --version % \begin{macrocode} \color@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@htmlspan{sup}{##1}}% @@ -14395,13 +14591,18 @@ end -- not --version % \begin{macrocode} \color@endgroup% }% vbox +% \end{macrocode} +% Paragraph handling: +% \changes{v0.52}{2018/03/28}{Fix: Paragraph handling.} +% \begin{macrocode} +\LWR@ensuredoingapar% }% % \end{macrocode} % \end{macro} % \begin{macro}{\@footnotetext} \marg{text} % \begin{macrocode} -\let\@footnotetext\LWR@footnotetext +\LetLtxMacro\@footnotetext\LWR@footnotetext % \end{macrocode} % \end{macro} % @@ -14423,13 +14624,13 @@ end -- not --version \long\def\@mpfootnotetext#1{% \LWR@traceinfo{@mpfootnotetext}% \global\setbox\LWR@mpfootnotes\vbox{% - \unvbox\LWR@mpfootnotes - \reset@font\footnotesize - \hsize\columnwidth - \@parboxrestore - \protected@edef\@currentlabel - {\csname p@mpfootnote\endcsname\@thefnmark}% - \color@begingroup + \unvbox\LWR@mpfootnotes% + \reset@font\footnotesize% + \hsize\columnwidth% + \@parboxrestore% + \protected@edef\@currentlabel% + {\csname p@mpfootnote\endcsname\@thefnmark}% + \color@begingroup% % \end{macrocode} % Use paragraph tags if in a tabular data cell or a \env{lateximage}: % \begin{macrocode} @@ -14455,6 +14656,11 @@ end -- not --version }% \color@endgroup% }% vbox +% \end{macrocode} +% Paragraph handling: +% \changes{v0.52}{2018/03/28}{Fix: Paragraph handling.} +% \begin{macrocode} +\LWR@ensuredoingapar% \LWR@traceinfo{@mpfootnotetext: done}% } % \end{macrocode} @@ -14720,7 +14926,6 @@ end -- not --version % % Replaces common symbols and short words with hyphens: % \begin{macrocode} -% \LWR@traceinfo{LWR@filenamenoblanks \#1: !#1!}% \edef\LWR@thisnewfilename{#1}% \LWR@traceinfo{LWR@filenamenoblanks edef: !\LWR@thisnewfilename!}% \fullexpandarg% @@ -14799,12 +15004,27 @@ end -- not --version \StrSubstitute{\LWR@thisnewfilename}{----}{-}[\LWR@thisnewfilename] \StrSubstitute{\LWR@thisnewfilename}{---}{-}[\LWR@thisnewfilename] \StrSubstitute{\LWR@thisnewfilename}{--}{-}[\LWR@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@thisnewfilename}{—}{-}[\LWR@thisnewfilename] % emdash \StrSubstitute{\LWR@thisnewfilename}{–}{-}[\LWR@thisnewfilename] % endash +}{}% +\else% not PDFTeX +\StrSubstitute{\LWR@thisnewfilename}{—}{-}[\LWR@thisnewfilename] +\StrSubstitute{\LWR@thisnewfilename}{–}{-}[\LWR@thisnewfilename] +\fi% +% \end{macrocode} +% Return the result: +% \begin{macrocode} \global\let\LWR@thisfilename\LWR@thisnewfilename% return a global result -\endgroup +\endgroup% +\LWR@traceinfo{LWR@filenamenoblanks: result is \LWR@thisfilename}% } % \end{macrocode} % \end{macro} @@ -14833,23 +15053,75 @@ end -- not --version % \end{macro} -% \begin{macro}{\LWR@nullifymathjaxensuremath} +% \begin{macro}{\LWR@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@customizedMathJax}{} +% \end{macrocode} +% \end{macro} + +% \begin{macro}{\CustomizeMathJax} +% +% \limitscustomizemathjax +% +% \changes{v0.52}{2018/03/31}{Added.} +% \begin{macrocode} +\newcommand*{\CustomizeMathJax}[1]{% + \appto{\LWR@customizedMathJax}{% + \(#1\)\par + }% +} +% \end{macrocode} +% \end{macro} + +% \begin{macro}{\LWR@customizeMathJax} % \changes{v0.51}{2018/03/18}{MathJax: Nullifies \cs{ensuremath}.} % \begin{macrocode} -\newcommand{\LWR@nullifymathjaxensuremath}{% +\newcommand{\LWR@customizeMathJax}{% \ifbool{mathjax}{ \LWR@stoppars \LWR@htmlcomment{Nullify \textbackslash{}ensuremath for MathJax:} -\( -\newcommand\ensuremath[1]{##1} -\) +\(\newcommand\ensuremath[1]{##1}\) + +\LWR@htmlcomment{Additional customizations for MathJax:} + +\LWR@customizedMathJax + \LWR@startpars }{} } % \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@newhtmlfile} \marg{section name} % \changes{v0.18}{2016/04/23}{side\TOC\ after title, improving responsive design.} @@ -14942,9 +15214,18 @@ end -- not --version % \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@filestart{ — #1}% there is an EMdash in front of the #1 +}{ +\LWR@filestart{ - #1}% hyphen +} +\else% +\LWR@filestart{ — #1}% there is an EMdash in front of the #1 +\fi% % \end{macrocode} % @@ -15007,10 +15288,10 @@ end -- not --version % \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@nullifymathjaxensuremath +\LWR@customizeMathJax % \end{macrocode} % % \begin{macrocode} @@ -15373,13 +15654,25 @@ end -- not --version % \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@nullfonts% - \LWR@htmlcomment{Opening #4 ``#3''{}}% + \IfBooleanTF{#1}% starred + {\LWR@htmlcomment{Opening #4*}}% + {% + \IfNoValueTF{#2}% short TOC + {\LWR@htmlcomment{Opening #4 ``#3''}}% + {\LWR@htmlcomment{Opening #4 ``#2''}}% + } \endgroup% }{}% @@ -15745,7 +16038,7 @@ end -- not --version % % \begin{macrocode} \newcommand*{\LWR@filestart}[1]{ -\LWR@traceinfo{LWR@filestart} +\LWR@traceinfo{LWR@filestart !#1!} % \end{macrocode} % Locally temporarily disable direct-formatting commands: % \begin{macrocode} @@ -16034,10 +16327,10 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% % \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@nullifymathjaxensuremath +\LWR@customizeMathJax % \end{macrocode} % % \begin{macrocode} @@ -16869,15 +17162,29 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% % \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 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% % \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}% +}% +}{ \newcommand{\citetitle}[1]{% -\InlineClass{citetitle}{—\,#1}}% emdash + \InlineClass{citetitle}{---\,#1}% +}% +} +\else% +\newcommand{\citetitle}[1]{% + \InlineClass{citetitle}{—\,#1}% +}% +\fi% \end{warpHTML} % \end{macrocode} % @@ -17139,22 +17460,35 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% % \limitstabbing % % \changes{v0.42}{2017/10/13}{Added.} +% \changes{v0.52}{2018/03/27}{Fix to allow inside \env{lateximage}.} % % \begin{macrocode} -\AfterEndPreamble{ -\LWR@traceinfo{Patching tabbing.} -\AtBeginEnvironment{tabbing}{% -\LWR@forcenewpage +\LetLtxMacro\LWR@origtabbing\tabbing +\LetLtxMacro\LWR@origendtabbing\endtabbing + +\renewcommand*{\tabbing}{% +\LWR@forcenewpage% \LWR@atbeginverbatim{3.5}{tabbing}% +\LWR@origtabbing% } -\AfterEndEnvironment{tabbing}{% + +\renewcommand*{\endtabbing}{% + \LWR@origendtabbing% \unskip\LWR@origvspace*{-\baselineskip}\LWR@afterendverbatim% } +% \end{macrocode} +% +% \cs{AtBeginDocument} because \cs{LWR@restoreorigformatting} has not yet been defined: +% \begin{macrocode} +\AtBeginDocument{ +\appto\LWR@restoreorigformatting{% +\LetLtxMacro\tabbing\LWR@origtabbing% +\LetLtxMacro\endtabbing\LWR@origendtabbing% +} } % \end{macrocode} % \end{environment} - % \begin{macrocode} \end{warpHTML} % \end{macrocode} @@ -21476,9 +21810,6 @@ autopage-\theLWR@currentautosec% \LWR@sanitize{#1}% \LWR@htmltag{% a href="\LWR@sanitized" % -% a href="% -% \begingroup\@sanitize#1\endgroup% -% " % target="\_{}blank"\LWR@orignewline% }% #2% @@ -21493,9 +21824,7 @@ autopage-\theLWR@currentautosec% % \changes{v0.45}{2017/12/29}{Improved URLs with underscores.} % \begin{macrocode} \NewDocumentCommand{\LWR@subhyperrefclass}{m +m m}{% -% \LWR@sanitize{#1}% \LWR@htmltag{% -% a href="\LWR@sanitized" a href="% \begingroup\@sanitize#1\endgroup% " % @@ -21516,10 +21845,22 @@ autopage-\theLWR@currentautosec% % % \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@hrefb}{O{} m +m}{% \LWR@ensuredoingapar% \LWR@subhyperref{#2}{#3}% +\endgroup% +} + +\newrobustcmd*{\href}{% +\begingroup% +\catcode`\#=12 +\catcode`\%=12 +\catcode`\&=12 +\catcode`\~=12 +\catcode`\_=12 +\LWR@hrefb% } % \end{macrocode} % \end{macro} @@ -21528,13 +21869,25 @@ autopage-\theLWR@currentautosec% % % 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@nolinkurlb}[1]{% \LWR@ensuredoingapar% \def\LWR@templink{#1}% \@onelevel@sanitize\LWR@templink% \LWR@templink% +\endgroup% +} + +\newrobustcmd*{\nolinkurl}{% +\begingroup% +\catcode`\#=12 +\catcode`\%=12 +\catcode`\&=12 +\catcode`\~=12 +\catcode`\_=12 +\LWR@nolinkurlb% } % \end{macrocode} % \end{macro} @@ -21543,18 +21896,31 @@ autopage-\theLWR@currentautosec% % \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@urla}here % and also redefined by \pkg{lwarp-url}. % % \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@urlb}{m}{% \LWR@ensuredoingapar% \def\LWR@templink{#1}% \@onelevel@sanitize\LWR@templink% \href{\LWR@templink}{\LWR@templink}% +\endgroup% +} + +\newrobustcmd*{\url}{% +\begingroup% +\catcode`\#=12 +\catcode`\%=12 +\catcode`\&=12 +\catcode`\~=12 +\catcode`\_=12 +\LWR@urlb% } % \end{macrocode} % \end{macro} @@ -22719,6 +23085,7 @@ autopage-\theLWR@currentautosec% \fi % \@input@{\jobname.bbl}% original \@input@{\BaseJobname.bbl}% lwarp + \DeclareDocumentCommand{\etalchar}{m}{\textsuperscript{#1}}% lwarp } % \end{macrocode} % \end{macro} @@ -22736,18 +23103,19 @@ autopage-\theLWR@currentautosec% % % % \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, % 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 @@ autopage-\theLWR@currentautosec% \endgroup \LWR@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 @@ autopage-\theLWR@currentautosec% % 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@addbaselinemarker}{% - \LWR@origincludegraphics[% - width=10sp,height=10sp% - ]{lwarp_baseline_marker.png}% - } -}{ - \@ifpackageloaded{graphics}{ +\IfFileExists{lwarp_baseline_marker.png}% +{ + \@ifpackageloaded{graphicx}{ \newcommand*{\LWR@addbaselinemarker}{% - \LWR@origincludegraphics{lwarp_baseline_marker.png}% + \LWR@origincludegraphics[% + width=10sp,height=10sp% + ]{lwarp_baseline_marker.png}% } }{ - \newcommand*{\LWR@addbaselinemarker}{% - \hspace*{10sp}% + \@ifpackageloaded{graphics}{ + \newcommand*{\LWR@addbaselinemarker}{% + \LWR@origincludegraphics{lwarp_baseline_marker.png}% + } + }{ + \PackageWarning{lwarp}{Load graphicx or graphics + for improved SVG math baselines,} + \newcommand*{\LWR@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@addbaselinemarker}{% + \hspace*{10sp}% + } } }% AtBeginDocument @@ -23088,10 +23477,12 @@ autopage-\theLWR@currentautosec% \newsavebox{\LWR@singledollarbox} \NewDocumentCommand{\LWR@subsingledollar}{s m m m}{% +\LWR@traceinfo{LWR@subsingledollar}% % \end{macrocode} % \begin{macrocode} \ifnumcomp{\value{LWR@lateximagedepth}}{>}{0}% {% +\LWR@traceinfo{LWR@subsingledollar: already in a lateximage}% #4% contents }% {% not in a lateximage @@ -23126,6 +23517,7 @@ autopage-\theLWR@currentautosec% % and a \CSS\ style to control the baseline adjustment. % \begin{macrocode} {% not mathjax +\LWR@traceinfo{LWR@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 @@ autopage-\theLWR@currentautosec% % Temporarily set font for the \HTML\ \PDF\ output: % \changes{v0.51}{2018/03/14}{Fix: Honors text font around \SVG\ math.} % \begin{macrocode} + \LWR@traceinfo{Using font family \LWR@f@family}% \csuse{LWR@orig\LWR@f@family family}% + \LWR@traceinfo{Using font series \LWR@f@series}% \csuse{LWR@orig\LWR@f@series series}% + \LWR@traceinfo{Using font shape \LWR@f@shape}% \csuse{LWR@orig\LWR@f@shape shape}% % \end{macrocode} % |lateximagedepth| must be nested to avoid generating paragraph tags. @@ -23178,8 +23573,11 @@ autopage-\theLWR@currentautosec% \global\advance\c@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@singledollardepth}{.70\dp\LWR@singledollarbox}% + \setlength{\LWR@singledollardepth}{% + \LateximageFontScale\dp\LWR@singledollarbox% + }% % \end{macrocode} % Make the length a global change: % \begin{macrocode} @@ -23187,13 +23585,19 @@ autopage-\theLWR@currentautosec% % \end{macrocode} % Likewise for width: % \begin{macrocode} - \setlength{\LWR@singledollarwidth}{.70\wd\LWR@singledollarbox}% + \setlength{\LWR@singledollarwidth}{% + \LateximageFontScale\wd\LWR@singledollarbox% + }% \global\LWR@singledollarwidth=\LWR@singledollarwidth% % \end{macrocode} % Likewise for total height: % \begin{macrocode} - \setlength{\LWR@singledollarheight}{.70\ht\LWR@singledollarbox}% - \addtolength{\LWR@singledollarheight}{.70\dp\LWR@singledollarbox}% + \setlength{\LWR@singledollarheight}{% + \LateximageFontScale\ht\LWR@singledollarbox% + }% + \addtolength{\LWR@singledollarheight}{% + \LateximageFontScale\dp\LWR@singledollarbox% + }% \global\LWR@singledollarheight=\LWR@singledollarheight% % \end{macrocode} % \begin{macrocode} @@ -23303,6 +23707,7 @@ autopage-\theLWR@currentautosec% }% not mathjax \endgroup% }% not in a lateximage +\LWR@traceinfo{LWR@subsingledollar: done}% } % \end{macrocode} % \end{macro} @@ -23391,7 +23796,7 @@ autopage-\theLWR@currentautosec% % \begin{macrocode} \protected\gdef\LWR@singledollar#1${% \ifbool{mathjax}{% -\LWR@subsingledollar*% + \LWR@subsingledollar*% {% alt tag \textbackslash( % \LWR@HTMLsanitize{#1} % extra space @@ -23400,7 +23805,7 @@ autopage-\theLWR@currentautosec% {singledollar}% add'l hashing {#1}% contents }{% not mathjax -\LWR@subsingledollar*% + \LWR@subsingledollar*% {% alt tag \textbackslash( % \LWR@HTMLsanitize{#1} % extra space @@ -23432,22 +23837,24 @@ autopage-\theLWR@currentautosec% % \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@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@subsingledollar*{(math image)}{\LWR@HTMLsanitize{#1}}{\relax% + \LWR@subsingledollar*{(math image)}{% + \protect\LWR@HTMLsanitize{\detokenize\expandafter{#1}}% + }{\relax% \LWR@origensuredmath{#1}% }% }{% SVG math @@ -23464,7 +23871,9 @@ autopage-\theLWR@currentautosec% \ifnumcomp{\value{LWR@lateximagedepth}}{>}{0}% {\LWR@origensuredmath{#1}}% {% - \LWR@subsingledollar*{(math image)}{\LWR@HTMLsanitize{#1}}{% + \LWR@subsingledollar*{(math image)}{% + \protect\LWR@HTMLsanitize{\detokenize\expandafter{#1}}% + }{% \LWR@origensuredmath{#1}% }% }% @@ -23690,21 +24099,14 @@ autopage-\theLWR@currentautosec% % \begin{macrocode} \let\LWR@origequation\equation \let\LWR@origendequation\endequation +\csletcs{LWR@origequation*}{equation*} +\csletcs{LWR@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@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 @@ autopage-\theLWR@currentautosec% % The contents are also printed to the \HTML\ output % for processing by the \brand{MathJax} script. % \begin{macrocode} -\NewEnviron{equation}{% +\newcommand*{\LWR@doequation}[2]{% % \end{macrocode} % If |mathjax| or |FormatWP|, print the \LaTeX\ expression: @@ -23737,7 +24139,7 @@ autopage-\theLWR@currentautosec% % \end{macrocode} % Print the \LaTeX\ math inside an \HTML\ comment: % \begin{macrocode} - \LWR@hidelatexequation{equation}{\BODY} + \LWR@hidelatexequation{#2}{#1} } % \end{macrocode} % SVG output: @@ -23750,37 +24152,77 @@ autopage-\theLWR@currentautosec% % 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@newautoidanchor% \booltrue{LWR@indisplaymathimage}% \begin{lateximage}[% - (\LWR@equationtag) \textbackslash{begin\{equation\}} % extra space - \LWR@HTMLsanitizeexpand{\detokenize\expandafter{\BODY}} % extra space - \textbackslash{end\{equation\}}% + \ifstrequal{#2}{equation*}{% + \ifdefequal{\LWR@equationtag}{\theequation}{% +% no tag was given + }{% + (\LWR@equationtag) % tag was given + }% + }{% + (\LWR@equationtag) % automatic numbering + }% + \textbackslash{begin\{#2\}} % extra space + \LWR@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@origequation - \BODY% contents collected by NewEnviron - \LWR@origendequation + \csuse{LWR@orig#2} + #1% contents collected by \collect@body + \csuse{LWR@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@doendequation}[1]{% \ifboolexpr{bool{mathjax} or ( bool{FormatWP} and bool{WPMarkMath} ) }% {% - \LWR@addmathjax{equation}{\BODY}% + \LWR@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@doequation{\BODY}{equation} +} +[\LWR@doendequation{equation}] \LetLtxMacro\LWR@equationnormal\equation \LetLtxMacro\LWR@endequationnormal\endequation @@ -23790,12 +24232,9 @@ autopage-\theLWR@currentautosec% % \begin{environment}{equation*} % \begin{macrocode} -\csletcs{LWR@origequationstar}{equation*} -\csletcs{LWR@origendequationstar}{endequation*} - -\renewenvironment*{equation*} -{\displaymath} -{\enddisplaymath} +\NewEnviron{equation*} +{\LWR@doequation{\BODY}{equation*}} +[\LWR@doendequation{equation*}] \csletcs{LWR@equationnormalstar}{equation*} \csletcs{LWR@endequationnormalstar}{endequation*} @@ -24545,7 +24984,8 @@ autopage-\theLWR@currentautosec% % \subsection{Font size} - +% \label{sec:mathfontscale} +% % \codeall % \begin{macrocode} \begin{warpall} @@ -24553,7 +24993,7 @@ autopage-\theLWR@currentautosec% % \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,6 +25004,18 @@ autopage-\theLWR@currentautosec% % \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 @@ autopage-\theLWR@currentautosec% % \begin{macro}{\LWR@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@remembertag}. % \begin{macrocode} -\let\LWR@equationtag\theequation +\newcommand*{\LWR@equationtag}{} % \end{macrocode} % \end{macro} @@ -24747,8 +25202,7 @@ autopage-\theLWR@currentautosec% {% \global\boolfalse{LWR@isstartingequation}% \xdef\LWR@startingequationtag{#1}% -}% -{}% +}{}% \xdef\LWR@equationtag{#1}% }% % \end{macrocode} @@ -24870,6 +25324,9 @@ autopage-\theLWR@currentautosec% \addtocounter{LWR@startingequation}{1}% \booltrue{LWR@isstartingequation}% \let\LWR@startingequationtag\theLWR@startingequation% +% \end{macrocode} +% The default equation tag, unless overwritten by \cs{tag}: +% \begin{macrocode} \let\LWR@equationtag\theequation% % \end{macrocode} % Starting a new lateximage: @@ -24909,16 +25366,28 @@ autopage-\theLWR@currentautosec% \LWR@traceinfo{lateximage: about to write to lateximages.txt}% \IfBooleanTF{#1}% starred {% hash - \LWR@traceinfo{lateximage: hash true, adding !#2!#3!}% + \LWR@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@hashedname{% \LWR@mdfive{\detokenize\expandafter{#2}-!-#3}% +% \LWR@mdfive{\detokenize\expandafter{#2}-!-\detokenize\expandafter{#3}}% }% \LWR@traceinfo{lateximage: hash is \LWR@hashedname}% +% \end{macrocode} +% Write the page, hashing, and hashed name: +% \begin{macrocode} \immediate\write\LWR@lateximagesfile{% |\arabic{LWR@LIpage}|true|\LWR@hashedname|% }% }% hash {% no hash +% \end{macrocode} +% No hash, so write the page, no hashing, and the image number: +% \begin{macrocode} \LWR@traceinfo{lateximage: hash false}% \immediate\write\LWR@lateximagesfile{% |\arabic{LWR@LIpage}|false|lateximage-\arabic{LWR@externalfilecnt}|% @@ -24960,7 +25429,7 @@ autopage-\theLWR@currentautosec% % \begin{macrocode} \def\@mpfn{footnote}% \def\thempfn{\thefootnote}% - \let\@footnotetext\LWR@footnotetext% + \LetLtxMacro\@footnotetext\LWR@footnotetext% % \end{macrocode} % Create the |LWRlateximage<number>| label: % \begin{macrocode} @@ -24984,8 +25453,8 @@ autopage-\theLWR@currentautosec% \LetLtxMacro\]\LWR@origclosebracket% \let\equation\LWR@origequation% \let\endequation\LWR@origendequation% - \csletcs{equation*}{LWR@origequationstar}% - \csletcs{endequation*}{LWR@origendequationstar}% + \csletcs{equation*}{LWR@origequation*}% + \csletcs{endequation*}{LWR@origendequation*}% }% not in display math % \end{macrocode} % For \pkg{chemformula}: @@ -26669,6 +27138,12 @@ width:\LWR@printlength{\LWR@tempwidth}% \def\(##1\){}% \def\[##1\]{}% \RenewDocumentCommand{\LWR@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 @@ span style="width:\LWR@printlength{\ALG@thistlm}; display:inline-block;"% % \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 @@ span style="width:\LWR@printlength{\ALG@thistlm}; display:inline-block;"% % \begin{macrocode} \LetLtxMacro\burl\url -\NewDocumentCommand{\burlalt}{O{} +m m}{% +\NewDocumentCommand{\LWR@burlaltb}{O{} +m m}{% \LWR@ensuredoingapar% \def\LWR@templink{#2}% \@onelevel@sanitize\LWR@templink% @@ -29345,6 +29821,17 @@ span style="width:\LWR@printlength{\ALG@thistlm}; display:inline-block;"% \@onelevel@sanitize\LWR@templinktwo% \LWR@subhyperref{\LWR@templink}{\LWR@templinktwo}% \LWR@ensuredoingapar% +\endgroup% +} + +\newrobustcmd*{\burlalt}{% +\begingroup% +\catcode`\#=12 +\catcode`\%=12 +\catcode`\&=12 +\catcode`\~=12 +\catcode`\_=12 +\LWR@burlaltb% } \LetLtxMacro\urlalt\burlalt @@ -30016,7 +30503,7 @@ span style="width:\LWR@printlength{\ALG@thistlm}; display:inline-block;"% \LWR@subsingledollar*{% lwarp \textbackslash{}ch\{\LWR@HTMLsanitize{#2}\}% alt text }{% - \LWR@HTMLsanitize{#1}% add'l hashing + \protect\LWR@HTMLsanitize{\detokenize\expandafter{#1}}% add'l hashing }% {% \chemformula_ch:nn {#1} {#2}% original @@ -30037,7 +30524,7 @@ span style="width:\LWR@printlength{\ALG@thistlm}; display:inline-block;"% \LWR@subsingledollar*{% lwarp \textbackslash{}chcpd\{\LWR@HTMLsanitize{#2}\}% }{% - \LWR@HTMLsanitize{#1}% + \protect\LWR@HTMLsanitize{\detokenize\expandafter{#1}}% }{% original \group_begin: \tl_if_blank:nF {#2} @@ -30095,7 +30582,10 @@ span style="width:\LWR@printlength{\ALG@thistlm}; display:inline-block;"% { \begingroup% \boolfalse{mathjax}% - \LWR@subsingledollar*{\textbackslash{}chlewis\{#2\}\{#3\}}{#1}{ + \LWR@subsingledollar*{\textbackslash{}chlewis\{#2\}\{#3\}}% + { + \protect\LWR@HTMLsanitize{\detokenize\expandafter{#1}}% + }{ \chemformula_lewis:nnn {#1} {#2} {#3} } \endgroup% @@ -30292,9 +30782,7 @@ span style="width:\LWR@printlength{\ALG@thistlm}; display:inline-block;"% % \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@restoreorigformatting{% @@ -30431,7 +30919,7 @@ span style="width:\LWR@printlength{\ALG@thistlm}; display:inline-block;"% \LWR@subsingledollar*{ \textbackslash{}p\{\LWR@HTMLsanitize{#1}\} }{ - chemmacrosp\LWR@HTMLsanitize{#1} + chemmacrosp\protect\LWR@HTMLsanitize{\detokenize\expandafter{#1}}% }{ \group_begin: \mbox @@ -30982,7 +31470,7 @@ span style="width:\LWR@printlength{\ALG@thistlm}; display:inline-block;"% \LWR@subsingledollar*{% yes hash \textbackslash{}ox*\{\LWR@HTMLsanitize{#3}\}% alt }{% - star \LWR@HTMLsanitize{#2}% addl' hashing with star + star \protect\LWR@HTMLsanitize{\detokenize\expandafter{#2}}% }{% \LWR@chemmacros@ox* {#2} {#3}% contents }% @@ -30991,7 +31479,7 @@ span style="width:\LWR@printlength{\ALG@thistlm}; display:inline-block;"% \LWR@subsingledollar*{% yes hash \textbackslash{}ox*\{\LWR@HTMLsanitize{#3}\}% alt }{% - \LWR@HTMLsanitize{#2}% addl' hashing without star + \protect\LWR@HTMLsanitize{\detokenize\expandafter{#2}}% }{% \LWR@chemmacros@ox {#2} {#3}% contents }% @@ -31386,8 +31874,7 @@ name = \chemmacros_translate:n {scheme-name} % \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 @@ name = \chemmacros_translate:n {scheme-name} \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 @@ name = \chemmacros_translate:n {scheme-name} % \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 @@ name = \chemmacros_translate:n {scheme-name} \newcommand{\AtBeginDelayedFloats}[1]{} \newcommand*{\processdelayedfloats}{} \newcommand*{\efloatseparator}{} +\def\efloattype{} +\providecommand\efloatheading[1]{} +\providecommand\efloatpreamble{} +\providecommand\efloatpostamble{} % \end{macrocode} % % \iffalse @@ -32783,19 +33274,78 @@ name = \chemmacros_translate:n {scheme-name} % % \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@ProvidesPackagePass{fancybox} % \end{macrocode} % +% After the preamble is loaded, after any patches to \env{Verbatim}: % \begin{macrocode} -\LWR@ProvidesPackagePass{fancybox} +\AfterEndPreamble{ +\LWR@traceinfo{Patching fancybox.} +% \end{macrocode} +% +% \begin{noindmacro}{\VerbatimFootnotes} +% Patched to use the new version. +% \begin{macrocode} +\def\VerbatimFootnotes{% +\let\@footnotetext\V@footnotetext% +\let\LWR@footnotetext\V@footnotetext% lwarp +} +% \end{macrocode} +% \end{noindmacro} +% +% \begin{noindmacro}{\V@@footnotetext} +% Patches in a subset of \pkg{lwarp}'s \cs{LWR@footnotetext} to the +% \pkg{fancyvrb} version of \cs{V@@footnotetext}. +% \begin{macrocode} +\def\V@@footnotetext{% +\LWR@traceinfo{V@footnotetext}% +\global\setbox\LWR@footnotes=\vbox\bgroup% +% \end{macrocode} +% Add to any current footnotes: +% \begin{macrocode} + \unvbox\LWR@footnotes% +% \end{macrocode} +% Remember the footnote number for \cs{ref}: +% \begin{macrocode} + \protected@edef\@currentlabel{% + \csname p@footnote\endcsname\@thefnmark% + }% @currentlabel +% \end{macrocode} +% Use \HTML\ superscripts in the footnote even inside a \env{lateximage}: +% \begin{macrocode} + \renewrobustcmd{\textsuperscript}[1]{\LWR@htmlspan{sup}{##1}}% +% \end{macrocode} +% Use paragraph tags if in a tabular data cell or a \env{lateximage}: +% \begin{macrocode} + \ifthenelse{% + \boolean{LWR@doingstartpars} \AND% + \cnttest{\value{LWR@lateximagedepth}}{=}{0}% + }% + {}% + {\LWR@htmltagc{\LWR@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} @@ -32970,10 +33520,6 @@ name = \chemmacros_translate:n {scheme-name} } % \end{macrocode} % -% \begin{macrocode} -\end{warpHTML} -% \end{macrocode} -% % \iffalse %</fancybox> % \fi @@ -33143,43 +33689,84 @@ name = \chemmacros_translate:n {scheme-name} % \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 \LWR@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@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@footnotetext% +\let\footnote\V@footnote% +\let\LWR@footnotetext\V@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@footnotetext} to the +% \pkg{fancyvrb} version of \cs{V@@footnotetext}. % \begin{macrocode} -\AfterEndPreamble{ -\LWR@traceinfo{Patching Verbatim.} +\def\V@@footnotetext{% +\LWR@traceinfo{V@footnotetext}% +\global\setbox\LWR@footnotes=\vbox\bgroup% % \end{macrocode} +% Add to any current footnotes: +% \begin{macrocode} + \unvbox\LWR@footnotes% +% \end{macrocode} +% Remember the footnote number for \cs{ref}: +% \begin{macrocode} + \protected@edef\@currentlabel{% + \csname p@footnote\endcsname\@thefnmark% + }% @currentlabel +% \end{macrocode} +% Use \HTML\ superscripts in the footnote even inside a \env{lateximage}: +% \begin{macrocode} + \renewrobustcmd{\textsuperscript}[1]{\LWR@htmlspan{sup}{##1}}% +% \end{macrocode} +% Use paragraph tags if in a tabular data cell or a \env{lateximage}: +% \begin{macrocode} + \ifthenelse{% + \boolean{LWR@doingstartpars} \AND% + \cnttest{\value{LWR@lateximagedepth}}{=}{0}% + }% + {}% + {\LWR@htmltagc{\LWR@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 @@ solid \LWR@origpound\LWR@tempcolor ; % } % \AfterEndPreamble % \end{macrocode} -% \begin{macrocode} -\end{warpHTML} -% \end{macrocode} -% % \iffalse %</fancyvrb> % \fi @@ -34535,6 +35118,8 @@ solid \LWR@origpound\LWR@tempcolor ; % % \DescribePackage{footmisc} % \pkg{footmisc} is emulated. % +% \pkg{lwarp} incidentally happens to emulate the \optn{stable} option. +% % \begin{macrocode} \LWR@ProvidesPackageDrop{footmisc} % \end{macrocode} @@ -34568,19 +35153,19 @@ solid \LWR@origpound\LWR@tempcolor ; % % \begin{macrocode} \newcommand\mpfootnotemark{% \@ifnextchar[% - \@xmpfootnotemark + \@xmpfootnotemark% {% - \stepcounter\@mpfn + \stepcounter\@mpfn% \protected@xdef\@thefnmark{\thempfn}% - \@footnotemark + \@footnotemark% }% } \def\@xmpfootnotemark[#1]{% - \begingroup - \csname c@\@mpfn\endcsname #1\relax + \begingroup% + \csname c@\@mpfn\endcsname #1\relax% \unrestored@protected@xdef\@thefnmark{\thempfn}% - \endgroup - \@footnotemark + \endgroup% + \@footnotemark% } % \end{macrocode} % @@ -35253,8 +35838,9 @@ solid \LWR@origpound\LWR@tempcolor ; % % % % Handle origin key: +% \changes{v0.52}{2018/03/27}{pkg{graphics}: Added defaults.} % \begin{macrocode} -\define@key{igraph}{origin}{% +\define@key{igraph}{origin}[c]{% \renewcommand*{\LWR@igorigin}{#1}% } % \end{macrocode} @@ -35282,6 +35868,7 @@ solid \LWR@origpound\LWR@tempcolor ; % % \end{macrocode} % % Numerous ignored keys: +% \changes{v0.52}{2018/03/27}{pkg{graphics}: Added defaults.} % \begin{macrocode} \define@key{igraph}{bb}{} \define@key{igraph}{bbllx}{} @@ -35290,18 +35877,31 @@ solid \LWR@origpound\LWR@tempcolor ; % \define@key{igraph}{bbury}{} \define@key{igraph}{natwidth}{} \define@key{igraph}{natheight}{} -\define@key{igraph}{hiresbb}{} +\define@key{igraph}{hiresbb}[true]{} \define@key{igraph}{viewport}{} \define@key{igraph}{trim}{} \define@key{igraph}{totalheight}{} -\define@key{igraph}{keepaspectratio}{} -\define@key{igraph}{clip}{} -\define@key{igraph}{draft}{} +\define@key{igraph}{keepaspectratio}[true]{} +\define@key{igraph}{clip}[true]{} +\define@key{igraph}{draft}[true]{} \define@key{igraph}{type}{} \define@key{igraph}{ext}{} \define@key{igraph}{read}{} \define@key{igraph}{command}{} % \end{macrocode} +% New in v1.1a: +% \changes{v0.52}{2018/03/27}{pkg{graphicx}: Updated for v1.1a.} +% \begin{macrocode} +\define@key{igraph}{quite}{} +\define@key{igraph}{page}{} +\define@key{igraph}{pagebox}{} +\define@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@key{igraph}{decodearray}{} +% \end{macrocode} % \subsection{Printing HTML styles} @@ -36137,7 +36737,7 @@ img src="% % \codehtml % \begin{macrocode} % \LWR@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 @@ img src="% -% \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@hyperimageb}{m +m}{% \LWR@ensuredoingapar% \def\LWR@templink{#1}% \@onelevel@sanitize\LWR@templink% \LWR@htmltag{img src="\LWR@templink" alt="#2" class="hyperimage"}% \LWR@ensuredoingapar% +\endgroup% +} + +\newrobustcmd*{\hyperimage}{% +\begingroup% +\catcode`\#=12 +\catcode`\%=12 +\catcode`\&=12 +\catcode`\~=12 +\catcode`\_=12 +\LWR@hyperimageb% } + % \end{macrocode} % \end{noindmacro} % @@ -36175,23 +36788,38 @@ img src="% % % 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@hyperdefb}{m m +m}{% \LWR@ensuredoingapar% \LWR@sublabel{#1.#2}% #3% +\endgroup% +} + +\newcommand*{\hyperdef}{% +\begingroup% +\catcode`\#=12 +\catcode`\%=12 +\catcode`\&=12 +\catcode`\~=12 +\catcode`\_=12 +\LWR@hyperdefb% } + % \end{macrocode} % \end{noindmacro} % % % \begin{noindmacro}{\LWR@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@hyperrefb}{m m m +m}{% +% \NewDocumentCommand{\LWR@hyperrefb}{m m m +m}{% +\NewDocumentCommand{\LWR@hyperrefbb}{m m m +m}{% \def\LWR@templink{#1}% \@onelevel@sanitize\LWR@templink% \def\LWR@templinktwo{#2}% @@ -36203,6 +36831,17 @@ img src="% }% #4% \LWR@htmltag{/a}% +\endgroup% +} + +\newrobustcmd*{\LWR@hyperrefb}{% +\begingroup% +\catcode`\#=12 +\catcode`\%=12 +\catcode`\&=12 +\catcode`\~=12 +\catcode`\_=12 +\LWR@hyperrefbb% } % \end{macrocode} % \end{noindmacro} @@ -36211,10 +36850,21 @@ img src="% % % Creates text as an \HTML\ link to the \LaTeX\ label. % \begin{macrocode} -\NewDocumentCommand{\LWR@hyperrefc}{O{label} +m}{ +\NewDocumentCommand{\LWR@hyperrefcb}{O{label} +m}{ \LWR@startref{#1}% #2% \LWR@htmltag{/a}% +\endgroup% +} + +\newcommand*{\LWR@hyperrefc}{% +\begingroup% +\catcode`\#=12 +\catcode`\%=12 +\catcode`\&=12 +\catcode`\~=12 +\catcode`\_=12 +\LWR@hyperrefcb% } % \end{macrocode} % \end{noindmacro} @@ -36238,10 +36888,22 @@ img src="% % % 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@hypertargetb}{m +m}{% \label{#1}% #2% +\endgroup% +} + +\newcommand*{\hypertarget}{% +\begingroup% +\catcode`\#=12 +\catcode`\%=12 +\catcode`\&=12 +\catcode`\~=12 +\catcode`\_=12 +\LWR@hypertargetb% } % \end{macrocode} % \end{noindmacro} @@ -36253,9 +36915,22 @@ img src="% % 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@hyperlinkb}{m +m}{% \hyperref[#1]{#2}% +\endgroup% +} + +\newcommand*{\hyperlink}{% +\begingroup% +\catcode`\#=12 +\catcode`\%=12 +\catcode`\&=12 +\catcode`\~=12 +\catcode`\_=12 +\LWR@hyperlinkb% } % \end{macrocode} % \end{noindmacro} @@ -37607,8 +38282,13 @@ width=\KFLT@imagewidth,height=\KFLT@h]{\KFLT@i}% \newlength{\LTcapwidth} % \end{macrocode} % +% \changes{v0.52}{2018/03/27}{Restore \cs{kill} in a \env{lateximage}.} % \begin{macrocode} +\LetLtxMacro\LWR@origkill\kill \renewcommand*{\kill}{\LWR@tabularendofline} +\appto\LWR@restoreorigformatting{% +\LetLtxMacro\kill\LWR@origkill% +} % \end{macrocode} % \iffalse @@ -38782,8 +39462,8 @@ background: % 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 @@ class="td% % % 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,6 +40439,45 @@ class="td% % % % +% \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@ProvidesPackagePass{nicefrac} +% \end{macrocode} +% +% \pkg{nicefrac} uses \TeX\ boxes, so \cs{@ensuredmath} must be restored temporarily: +% \begin{macrocode} +\LetLtxMacro\LWR@origUnitsNiceFrac\@UnitsNiceFrac + +\DeclareRobustCommand*{\@UnitsNiceFrac}[3][]{% +\begingroup% +\LetLtxMacro\@ensuredmath\LWR@origensuredmath% +\LWR@origUnitsNiceFrac[#1]{#2}{#3}% +\endgroup% +} +% \end{macrocode} + +% \iffalse +%</nicefrac> +% \fi +% +% +% % % \iffalse %<*nonfloat> @@ -42755,9 +43474,11 @@ class="td% % \__siunitx_print:nn { number } { \ensuremath {#1} } \LWR@subsingledollar{% lwarp \textbackslash( \LWR@HTMLsanitize{#1} \textbackslash)% lwarp - }{siunitx}{\__siunitx_print:nn { number } { - \LWR@origensuredmath{#1} - }}% lwarp + }{siunitx}{% + \__siunitx_print:nn { number } {% + \LWR@origensuredmath{#1}% + }% + }% lwarp % \end{macrocode} % \begin{macrocode} \__siunitx_unit_output_print: @@ -46618,6 +47339,46 @@ class="td% % % % +% \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@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@url@origUrl@FormatString\Url@FormatString + +\renewcommand*{\Url@FormatString}{% + \InlineClass{verbatim}{% + \LWR@restoreorigformatting% + \LWR@url@origUrl@FormatString% + }% +} +% \end{macrocode} + +% \iffalse +%</url> +% \fi +% +% +% % % \iffalse %<*verse> diff --git a/Master/texmf-dist/source/latex/lwarp/lwarp.ins b/Master/texmf-dist/source/latex/lwarp/lwarp.ins index fb9d9c5ba27..cf57ecd3dc1 100644 --- a/Master/texmf-dist/source/latex/lwarp/lwarp.ins +++ b/Master/texmf-dist/source/latex/lwarp/lwarp.ins @@ -193,6 +193,7 @@ version 2005/12/01 or later. \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 @@ version 2005/12/01 or later. \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}} diff --git a/Master/texmf-dist/tex/latex/lwarp/lwarp-breakurl.sty b/Master/texmf-dist/tex/latex/lwarp/lwarp-breakurl.sty index 49420b1f66e..8e4fc48a8dd 100644 --- a/Master/texmf-dist/tex/latex/lwarp/lwarp-breakurl.sty +++ b/Master/texmf-dist/tex/latex/lwarp/lwarp-breakurl.sty @@ -18,7 +18,7 @@ \LWR@ProvidesPackageDrop{breakurl} \LetLtxMacro\burl\url -\NewDocumentCommand{\burlalt}{O{} +m m}{% +\NewDocumentCommand{\LWR@burlaltb}{O{} +m m}{% \LWR@ensuredoingapar% \def\LWR@templink{#2}% \@onelevel@sanitize\LWR@templink% @@ -26,6 +26,17 @@ \@onelevel@sanitize\LWR@templinktwo% \LWR@subhyperref{\LWR@templink}{\LWR@templinktwo}% \LWR@ensuredoingapar% +\endgroup% +} + +\newrobustcmd*{\burlalt}{% +\begingroup% +\catcode`\#=12 +\catcode`\%=12 +\catcode`\&=12 +\catcode`\~=12 +\catcode`\_=12 +\LWR@burlaltb% } \LetLtxMacro\urlalt\burlalt diff --git a/Master/texmf-dist/tex/latex/lwarp/lwarp-chemformula.sty b/Master/texmf-dist/tex/latex/lwarp/lwarp-chemformula.sty index 16017fe39ef..6312ab8d43a 100644 --- a/Master/texmf-dist/tex/latex/lwarp/lwarp-chemformula.sty +++ b/Master/texmf-dist/tex/latex/lwarp/lwarp-chemformula.sty @@ -31,7 +31,7 @@ \LWR@subsingledollar*{% lwarp \textbackslash{}ch\{\LWR@HTMLsanitize{#2}\}% alt text }{% - \LWR@HTMLsanitize{#1}% add'l hashing + \protect\LWR@HTMLsanitize{\detokenize\expandafter{#1}}% add'l hashing }% {% \chemformula_ch:nn {#1} {#2}% original @@ -46,7 +46,7 @@ \LWR@subsingledollar*{% lwarp \textbackslash{}chcpd\{\LWR@HTMLsanitize{#2}\}% }{% - \LWR@HTMLsanitize{#1}% + \protect\LWR@HTMLsanitize{\detokenize\expandafter{#1}}% }{% original \group_begin: \tl_if_blank:nF {#2} @@ -86,7 +86,10 @@ { \begingroup% \boolfalse{mathjax}% - \LWR@subsingledollar*{\textbackslash{}chlewis\{#2\}\{#3\}}{#1}{ + \LWR@subsingledollar*{\textbackslash{}chlewis\{#2\}\{#3\}}% + { + \protect\LWR@HTMLsanitize{\detokenize\expandafter{#1}}% + }{ \chemformula_lewis:nnn {#1} {#2} {#3} } \endgroup% diff --git a/Master/texmf-dist/tex/latex/lwarp/lwarp-chemgreek.sty b/Master/texmf-dist/tex/latex/lwarp/lwarp-chemgreek.sty index 881fe65a8d4..da8741f93ba 100644 --- a/Master/texmf-dist/tex/latex/lwarp/lwarp-chemgreek.sty +++ b/Master/texmf-dist/tex/latex/lwarp/lwarp-chemgreek.sty @@ -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@restoreorigformatting{% diff --git a/Master/texmf-dist/tex/latex/lwarp/lwarp-chemmacros.sty b/Master/texmf-dist/tex/latex/lwarp/lwarp-chemmacros.sty index 257eb3d0469..ac51f867237 100644 --- a/Master/texmf-dist/tex/latex/lwarp/lwarp-chemmacros.sty +++ b/Master/texmf-dist/tex/latex/lwarp/lwarp-chemmacros.sty @@ -43,7 +43,7 @@ \LWR@subsingledollar*{ \textbackslash{}p\{\LWR@HTMLsanitize{#1}\} }{ - chemmacrosp\LWR@HTMLsanitize{#1} + chemmacrosp\protect\LWR@HTMLsanitize{\detokenize\expandafter{#1}}% }{ \group_begin: \mbox @@ -528,7 +528,7 @@ \LWR@subsingledollar*{% yes hash \textbackslash{}ox*\{\LWR@HTMLsanitize{#3}\}% alt }{% - star \LWR@HTMLsanitize{#2}% addl' hashing with star + star \protect\LWR@HTMLsanitize{\detokenize\expandafter{#2}}% }{% \LWR@chemmacros@ox* {#2} {#3}% contents }% @@ -537,7 +537,7 @@ \LWR@subsingledollar*{% yes hash \textbackslash{}ox*\{\LWR@HTMLsanitize{#3}\}% alt }{% - \LWR@HTMLsanitize{#2}% addl' hashing without star + \protect\LWR@HTMLsanitize{\detokenize\expandafter{#2}}% }{% \LWR@chemmacros@ox {#2} {#3}% contents }% diff --git a/Master/texmf-dist/tex/latex/lwarp/lwarp-chemnum.sty b/Master/texmf-dist/tex/latex/lwarp/lwarp-chemnum.sty index 2dc1d945060..478cd42d89d 100644 --- a/Master/texmf-dist/tex/latex/lwarp/lwarp-chemnum.sty +++ b/Master/texmf-dist/tex/latex/lwarp/lwarp-chemnum.sty @@ -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 diff --git a/Master/texmf-dist/tex/latex/lwarp/lwarp-endfloat.sty b/Master/texmf-dist/tex/latex/lwarp/lwarp-endfloat.sty index 6093d8b6f55..7a1c2a62f37 100644 --- a/Master/texmf-dist/tex/latex/lwarp/lwarp-endfloat.sty +++ b/Master/texmf-dist/tex/latex/lwarp/lwarp-endfloat.sty @@ -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'. diff --git a/Master/texmf-dist/tex/latex/lwarp/lwarp-fancybox.sty b/Master/texmf-dist/tex/latex/lwarp/lwarp-fancybox.sty index 36b250fd8b5..92ddb4cf161 100644 --- a/Master/texmf-dist/tex/latex/lwarp/lwarp-fancybox.sty +++ b/Master/texmf-dist/tex/latex/lwarp/lwarp-fancybox.sty @@ -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@ProvidesPackagePass{fancybox} +\AfterEndPreamble{ +\LWR@traceinfo{Patching fancybox.} +\def\VerbatimFootnotes{% +\let\@footnotetext\V@footnotetext% +\let\LWR@footnotetext\V@footnotetext% lwarp +} +\def\V@@footnotetext{% +\LWR@traceinfo{V@footnotetext}% +\global\setbox\LWR@footnotes=\vbox\bgroup% + \unvbox\LWR@footnotes% + \protected@edef\@currentlabel{% + \csname p@footnote\endcsname\@thefnmark% + }% @currentlabel + \renewrobustcmd{\textsuperscript}[1]{\LWR@htmlspan{sup}{##1}}% + \ifthenelse{% + \boolean{LWR@doingstartpars} \AND% + \cnttest{\value{LWR@lateximagedepth}}{=}{0}% + }% + {}% + {\LWR@htmltagc{\LWR@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@UseVerbatim{#2}% \LWR@afterendverbatim% } -\end{warpHTML} \endinput %% %% End of file `lwarp-fancybox.sty'. diff --git a/Master/texmf-dist/tex/latex/lwarp/lwarp-fancyvrb.sty b/Master/texmf-dist/tex/latex/lwarp/lwarp-fancyvrb.sty index ea8d9318c10..b83c7293347 100644 --- a/Master/texmf-dist/tex/latex/lwarp/lwarp-fancyvrb.sty +++ b/Master/texmf-dist/tex/latex/lwarp/lwarp-fancyvrb.sty @@ -18,18 +18,33 @@ \RequirePackage{xcolor}% for \convertcolorspec \LWR@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@traceinfo{Patching Verbatim.} +\LWR@traceinfo{Patching fancyvrb.} +\def\VerbatimFootnotes{% +\let\@footnotetext\V@footnotetext% +\let\footnote\V@footnote% +\let\LWR@footnotetext\V@footnotetext% lwarp +} +\def\V@@footnotetext{% +\LWR@traceinfo{V@footnotetext}% +\global\setbox\LWR@footnotes=\vbox\bgroup% + \unvbox\LWR@footnotes% + \protected@edef\@currentlabel{% + \csname p@footnote\endcsname\@thefnmark% + }% @currentlabel + \renewrobustcmd{\textsuperscript}[1]{\LWR@htmlspan{sup}{##1}}% + \ifthenelse{% + \boolean{LWR@doingstartpars} \AND% + \cnttest{\value{LWR@lateximagedepth}}{=}{0}% + }% + {}% + {\LWR@htmltagc{\LWR@tagregularparagraph}}% + \@makefntext{}% + \bgroup% + \aftergroup{\V@@@footnotetext}% + \ignorespaces% +}% \preto\FVB@Verbatim{\LWR@forcenewpage} \preto\FVB@LVerbatim{\LWR@forcenewpage} \def\FV@BeginListFrame@Single{% @@ -217,7 +232,6 @@ solid \LWR@origpound\LWR@tempcolor ; % } % \AfterEndPreamble -\end{warpHTML} \endinput %% %% End of file `lwarp-fancyvrb.sty'. diff --git a/Master/texmf-dist/tex/latex/lwarp/lwarp-footmisc.sty b/Master/texmf-dist/tex/latex/lwarp/lwarp-footmisc.sty index c5201420915..61b2daf18d9 100644 --- a/Master/texmf-dist/tex/latex/lwarp/lwarp-footmisc.sty +++ b/Master/texmf-dist/tex/latex/lwarp/lwarp-footmisc.sty @@ -35,19 +35,19 @@ \providecommand*{\footref}[1]{\labelcref{#1}} \newcommand\mpfootnotemark{% \@ifnextchar[% - \@xmpfootnotemark + \@xmpfootnotemark% {% - \stepcounter\@mpfn + \stepcounter\@mpfn% \protected@xdef\@thefnmark{\thempfn}% - \@footnotemark + \@footnotemark% }% } \def\@xmpfootnotemark[#1]{% - \begingroup - \csname c@\@mpfn\endcsname #1\relax + \begingroup% + \csname c@\@mpfn\endcsname #1\relax% \unrestored@protected@xdef\@thefnmark{\thempfn}% - \endgroup - \@footnotemark + \endgroup% + \@footnotemark% } \endinput %% diff --git a/Master/texmf-dist/tex/latex/lwarp/lwarp-graphics.sty b/Master/texmf-dist/tex/latex/lwarp/lwarp-graphics.sty index 3307c12a546..dca1348eca7 100644 --- a/Master/texmf-dist/tex/latex/lwarp/lwarp-graphics.sty +++ b/Master/texmf-dist/tex/latex/lwarp/lwarp-graphics.sty @@ -80,7 +80,7 @@ {}% not px }{}% end of length > 0pt } -\define@key{igraph}{origin}{% +\define@key{igraph}{origin}[c]{% \renewcommand*{\LWR@igorigin}{#1}% } \define@key{igraph}{angle}{\renewcommand*{\LWR@igangle}{#1}} @@ -96,17 +96,22 @@ \define@key{igraph}{bbury}{} \define@key{igraph}{natwidth}{} \define@key{igraph}{natheight}{} -\define@key{igraph}{hiresbb}{} +\define@key{igraph}{hiresbb}[true]{} \define@key{igraph}{viewport}{} \define@key{igraph}{trim}{} \define@key{igraph}{totalheight}{} -\define@key{igraph}{keepaspectratio}{} -\define@key{igraph}{clip}{} -\define@key{igraph}{draft}{} +\define@key{igraph}{keepaspectratio}[true]{} +\define@key{igraph}{clip}[true]{} +\define@key{igraph}{draft}[true]{} \define@key{igraph}{type}{} \define@key{igraph}{ext}{} \define@key{igraph}{read}{} \define@key{igraph}{command}{} +\define@key{igraph}{quite}{} +\define@key{igraph}{page}{} +\define@key{igraph}{pagebox}{} +\define@key{igraph}{interpolate}[true]{} +\define@key{igraph}{decodearray}{} \newcommand*{\LWR@rotstyle}[2]{% diff --git a/Master/texmf-dist/tex/latex/lwarp/lwarp-hyperref.sty b/Master/texmf-dist/tex/latex/lwarp/lwarp-hyperref.sty index 9a903029e78..51da8aac561 100644 --- a/Master/texmf-dist/tex/latex/lwarp/lwarp-hyperref.sty +++ b/Master/texmf-dist/tex/latex/lwarp/lwarp-hyperref.sty @@ -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@hyperimageb}{m +m}{% \LWR@ensuredoingapar% \def\LWR@templink{#1}% \@onelevel@sanitize\LWR@templink% \LWR@htmltag{img src="\LWR@templink" alt="#2" class="hyperimage"}% \LWR@ensuredoingapar% +\endgroup% } -\NewDocumentCommand{\hyperdef}{m m +m}{% + +\newrobustcmd*{\hyperimage}{% +\begingroup% +\catcode`\#=12 +\catcode`\%=12 +\catcode`\&=12 +\catcode`\~=12 +\catcode`\_=12 +\LWR@hyperimageb% +} + +\NewDocumentCommand{\LWR@hyperdefb}{m m +m}{% \LWR@ensuredoingapar% \LWR@sublabel{#1.#2}% #3% +\endgroup% } -\NewDocumentCommand{\LWR@hyperrefb}{m m m +m}{% + +\newcommand*{\hyperdef}{% +\begingroup% +\catcode`\#=12 +\catcode`\%=12 +\catcode`\&=12 +\catcode`\~=12 +\catcode`\_=12 +\LWR@hyperdefb% +} + +\NewDocumentCommand{\LWR@hyperrefbb}{m m m +m}{% \def\LWR@templink{#1}% \@onelevel@sanitize\LWR@templink% \def\LWR@templinktwo{#2}% @@ -51,12 +75,34 @@ }% #4% \LWR@htmltag{/a}% +\endgroup% +} + +\newrobustcmd*{\LWR@hyperrefb}{% +\begingroup% +\catcode`\#=12 +\catcode`\%=12 +\catcode`\&=12 +\catcode`\~=12 +\catcode`\_=12 +\LWR@hyperrefbb% } -\NewDocumentCommand{\LWR@hyperrefc}{O{label} +m}{ +\NewDocumentCommand{\LWR@hyperrefcb}{O{label} +m}{ \LWR@startref{#1}% #2% \LWR@htmltag{/a}% +\endgroup% +} + +\newcommand*{\LWR@hyperrefc}{% +\begingroup% +\catcode`\#=12 +\catcode`\%=12 +\catcode`\&=12 +\catcode`\~=12 +\catcode`\_=12 +\LWR@hyperrefcb% } \DeclareRobustCommand*{\hyperref}{% @@ -64,13 +110,35 @@ \@ifnextchar[\LWR@hyperrefc\LWR@hyperrefb% } -\NewDocumentCommand{\hypertarget}{m +m}{% +\NewDocumentCommand{\LWR@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@hypertargetb% +} + +\DeclareDocumentCommand{\LWR@hyperlinkb}{m +m}{% \hyperref[#1]{#2}% +\endgroup% +} + +\newcommand*{\hyperlink}{% +\begingroup% +\catcode`\#=12 +\catcode`\%=12 +\catcode`\&=12 +\catcode`\~=12 +\catcode`\_=12 +\LWR@hyperlinkb% } \NewDocumentCommand{\autoref}{s m}{% diff --git a/Master/texmf-dist/tex/latex/lwarp/lwarp-longtable.sty b/Master/texmf-dist/tex/latex/lwarp/lwarp-longtable.sty index 69d760bd55f..4b81417ad5f 100644 --- a/Master/texmf-dist/tex/latex/lwarp/lwarp-longtable.sty +++ b/Master/texmf-dist/tex/latex/lwarp/lwarp-longtable.sty @@ -56,7 +56,11 @@ \newlength{\LTpre} \newlength{\LTpost} \newlength{\LTcapwidth} +\LetLtxMacro\LWR@origkill\kill \renewcommand*{\kill}{\LWR@tabularendofline} +\appto\LWR@restoreorigformatting{% +\LetLtxMacro\kill\LWR@origkill% +} \endinput %% diff --git a/Master/texmf-dist/tex/latex/lwarp/lwarp-nameref.sty b/Master/texmf-dist/tex/latex/lwarp/lwarp-nameref.sty index a6a01190896..b71a901fd16 100644 --- a/Master/texmf-dist/tex/latex/lwarp/lwarp-nameref.sty +++ b/Master/texmf-dist/tex/latex/lwarp/lwarp-nameref.sty @@ -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*{} diff --git a/Master/texmf-dist/tex/latex/lwarp/lwarp-nicefrac.sty b/Master/texmf-dist/tex/latex/lwarp/lwarp-nicefrac.sty new file mode 100644 index 00000000000..8487ef1e344 --- /dev/null +++ b/Master/texmf-dist/tex/latex/lwarp/lwarp-nicefrac.sty @@ -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@ProvidesPackagePass{nicefrac} +\LetLtxMacro\LWR@origUnitsNiceFrac\@UnitsNiceFrac + +\DeclareRobustCommand*{\@UnitsNiceFrac}[3][]{% +\begingroup% +\LetLtxMacro\@ensuredmath\LWR@origensuredmath% +\LWR@origUnitsNiceFrac[#1]{#2}{#3}% +\endgroup% +} + +\endinput +%% +%% End of file `lwarp-nicefrac.sty'. diff --git a/Master/texmf-dist/tex/latex/lwarp/lwarp-siunitx.sty b/Master/texmf-dist/tex/latex/lwarp/lwarp-siunitx.sty index 6e7fd4b32a0..a8714119c7c 100644 --- a/Master/texmf-dist/tex/latex/lwarp/lwarp-siunitx.sty +++ b/Master/texmf-dist/tex/latex/lwarp/lwarp-siunitx.sty @@ -97,9 +97,11 @@ \__siunitx_unit_output_pre_print: \LWR@subsingledollar{% lwarp \textbackslash( \LWR@HTMLsanitize{#1} \textbackslash)% lwarp - }{siunitx}{\__siunitx_print:nn { number } { - \LWR@origensuredmath{#1} - }}% lwarp + }{siunitx}{% + \__siunitx_print:nn { number } {% + \LWR@origensuredmath{#1}% + }% + }% lwarp \__siunitx_unit_output_print: } \group_end:% lwarp diff --git a/Master/texmf-dist/tex/latex/lwarp/lwarp-url.sty b/Master/texmf-dist/tex/latex/lwarp/lwarp-url.sty new file mode 100644 index 00000000000..ee8b6ab195e --- /dev/null +++ b/Master/texmf-dist/tex/latex/lwarp/lwarp-url.sty @@ -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@ProvidesPackagePass{url} + +\LetLtxMacro\LWR@url@origUrl@FormatString\Url@FormatString + +\renewcommand*{\Url@FormatString}{% + \InlineClass{verbatim}{% + \LWR@restoreorigformatting% + \LWR@url@origUrl@FormatString% + }% +} + +\endinput +%% +%% End of file `lwarp-url.sty'. diff --git a/Master/texmf-dist/tex/latex/lwarp/lwarp.sty b/Master/texmf-dist/tex/latex/lwarp/lwarp.sty index 62fb3a6e8b5..7651948a52d 100644 --- a/Master/texmf-dist/tex/latex/lwarp/lwarp.sty +++ b/Master/texmf-dist/tex/latex/lwarp/lwarp.sty @@ -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 @@ For a possible alternative, see package(s) #2.} \LWR@notmemoirloadafter{needspace} \LWR@loadafter{newtxmath} \LWR@notmemoirloadafter{nextpage} +\LWR@loadafter{nicefrac} \LWR@loadafter{nonfloat} \LWR@loadafter{nonumonpart} \LWR@loadafter{nopageno} @@ -468,6 +471,7 @@ For a possible alternative, see package(s) #2.} \LWR@loadafter{turnthepage} \LWR@loadafter{ulem} \LWR@loadafter{upref} +\LWR@loadafter{url} \LWR@loadafter{varioref}% no lwarp package provided \LWR@notmemoirloadafter{verse} \LWR@loadafter{vertbars} @@ -512,7 +516,7 @@ For a possible alternative, see package(s) #2.} \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 @@ div.programlisting pre.verbatim span.callout{ 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 @@ src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX- \begin{LWR@createlwarpmk} - \begin{filecontents*}{lwarpmk.lua} #!/usr/bin/env texlua @@ -3066,7 +3075,7 @@ src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX- -- 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 @@ function loadconf () -- 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 @@ if (lfs.attributes(conffile,"mode")==nil) then -- 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 @@ splitfile (homehtmlfilename .. ".html" , sourcename .. "_html.html") 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 @@ os.execute ( rmname .. " " .. sourcename ..".ind " .. sourcename .. "_html.ind " .. sourcename ..".log " .. sourcename .. "_html.log " .. sourcename ..".gl* " .. sourcename .. "_html.gl* " .. - "*_html_inc.*" + " *_html_inc.* " ) end @@ -3394,6 +3404,8 @@ if opsystem=="Windows" then 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 @@ for line in limagesfile:lines() do 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 @@ end 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 .. lwimgname .. ".pdf" .. seqname .. 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 @@ if ( err ~= 0 ) then 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: " .. sourcename ..".tex is ready to be recompiled.") 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 @@ end -- not --version \newcommand*{\LWR@htmltagc}[1]{% -{% \LWR@traceinfo{LWR@htmltagc !\detokenize{#1}!}% \begingroup% \LWR@FBcancel% @@ -4092,8 +4120,6 @@ end -- not --version #1% \protect\LWR@origtextgreater% \endgroup% -\LWR@traceinfo{LWR@htmltagc: done}% -}% } \newcommand*{\LWR@nestspanitem}{% @@ -4376,7 +4402,6 @@ end -- not --version \newcommand*{\LWR@closeparagraph} {% -\LWR@traceinfo{LWR@closeparagraph}% \ifbool{LWR@doingapar}% {% handling pars \ifboolexpr{ @@ -4428,7 +4453,6 @@ end -- not --version \newcommand*{\LWR@startpars}% {% -\LWR@traceinfo{LWR@startpars}% \ifnumcomp{\value{LWR@spandepth}}{>}{0}% {}% {% @@ -4442,7 +4466,6 @@ end -- not --version \global\setbool{LWR@doingstartpars}{true}% \global\boolfalse{LWR@doingapar}% }% nestspan -\LWR@traceinfo{LWR@startpars: done}% } \newcommand*{\LWR@stoppars}% @@ -4539,7 +4562,7 @@ end -- not --version \begin{warpall} \newcounter{FootnoteDepth} -\setcounter{FootnoteDepth}{5} +\setcounter{FootnoteDepth}{3} \end{warpall} @@ -4547,7 +4570,9 @@ end -- not --version \newbox\LWR@footnotes \long\def\@makefntext#1{\textsuperscript{\@thefnmark}~#1} -\def\@makefnmark{\hbox{\textsuperscript{\@thefnmark}}} +\def\@makefnmark{% + \textsuperscript{\@thefnmark}% +} \long\def\LWR@footnotetext#1{% \LWR@traceinfo{LWR@footnotetext}% \global\setbox\LWR@footnotes=\vbox{% @@ -4575,20 +4600,21 @@ end -- not --version }% \color@endgroup% }% vbox +\LWR@ensuredoingapar% }% -\let\@footnotetext\LWR@footnotetext +\LetLtxMacro\@footnotetext\LWR@footnotetext \newbox\LWR@mpfootnotes \long\def\@mpfootnotetext#1{% \LWR@traceinfo{@mpfootnotetext}% \global\setbox\LWR@mpfootnotes\vbox{% - \unvbox\LWR@mpfootnotes - \reset@font\footnotesize - \hsize\columnwidth - \@parboxrestore - \protected@edef\@currentlabel - {\csname p@mpfootnote\endcsname\@thefnmark}% - \color@begingroup + \unvbox\LWR@mpfootnotes% + \reset@font\footnotesize% + \hsize\columnwidth% + \@parboxrestore% + \protected@edef\@currentlabel% + {\csname p@mpfootnote\endcsname\@thefnmark}% + \color@begingroup% \ifthenelse{% \boolean{LWR@doingstartpars} \AND% \cnttest{\value{LWR@lateximagedepth}}{=}{0}% @@ -4606,6 +4632,7 @@ end -- not --version }% \color@endgroup% }% vbox +\LWR@ensuredoingapar% \LWR@traceinfo{@mpfootnotetext: done}% } \AtBeginDocument{ @@ -4757,10 +4784,18 @@ end -- not --version \StrSubstitute{\LWR@thisnewfilename}{----}{-}[\LWR@thisnewfilename] \StrSubstitute{\LWR@thisnewfilename}{---}{-}[\LWR@thisnewfilename] \StrSubstitute{\LWR@thisnewfilename}{--}{-}[\LWR@thisnewfilename] +\ifPDFTeX% +\ifdefstring{\inputencodingname}{utf8}{% +\StrSubstitute{\LWR@thisnewfilename}{—}{-}[\LWR@thisnewfilename] +\StrSubstitute{\LWR@thisnewfilename}{–}{-}[\LWR@thisnewfilename] +}{}% +\else% not PDFTeX \StrSubstitute{\LWR@thisnewfilename}{—}{-}[\LWR@thisnewfilename] \StrSubstitute{\LWR@thisnewfilename}{–}{-}[\LWR@thisnewfilename] +\fi% \global\let\LWR@thisfilename\LWR@thisnewfilename% return a global result -\endgroup +\endgroup% +\LWR@traceinfo{LWR@filenamenoblanks: result is \LWR@thisfilename}% } \newcounter{LWR@previousautopagelabel} @@ -4775,18 +4810,39 @@ end -- not --version }% } -\newcommand{\LWR@nullifymathjaxensuremath}{% +\newcommand*{\LWR@customizedMathJax}{} + +\newcommand*{\CustomizeMathJax}[1]{% + \appto{\LWR@customizedMathJax}{% + \(#1\)\par + }% +} + +\newcommand{\LWR@customizeMathJax}{% \ifbool{mathjax}{ \LWR@stoppars \LWR@htmlcomment{Nullify \textbackslash{}ensuremath for MathJax:} -\( -\newcommand\ensuremath[1]{##1} -\) +\(\newcommand\ensuremath[1]{##1}\) + +\LWR@htmlcomment{Additional customizations for MathJax:} + +\LWR@customizedMathJax + \LWR@startpars }{} } +\end{warpHTML} + +\begin{warpprint} + +\newcommand*{\CustomizeMathJax}[1]{} + +\end{warpprint} + +\begin{warpHTML} + \newcommand*{\LWR@newhtmlfile}[1]{ \LWR@traceinfo{LWR@newhtmlfile} @@ -4830,7 +4886,15 @@ end -- not --version \LWR@stoppars +\ifPDFTeX% +\ifdefstring{\inputencodingname}{utf8}{% +\LWR@filestart{ — #1}% there is an EMdash in front of the #1 +}{ +\LWR@filestart{ - #1}% hyphen +} +\else% \LWR@filestart{ — #1}% there is an EMdash in front of the #1 +\fi% \setcounter{LWR@latestautopage}{\value{page}}% \LWR@newautopagelabel{LWR@latestautopage}% @@ -4860,7 +4924,7 @@ end -- not --version \LWR@stoppars -\LWR@nullifymathjaxensuremath +\LWR@customizeMathJax \LWR@traceinfo{LWR@newhtmlfile: done} } @@ -4968,7 +5032,13 @@ end -- not --version \ifbool{HTMLDebugComments}{% \begingroup% \LWR@nullfonts% - \LWR@htmlcomment{Opening #4 ``#3''{}}% + \IfBooleanTF{#1}% starred + {\LWR@htmlcomment{Opening #4*}}% + {% + \IfNoValueTF{#2}% short TOC + {\LWR@htmlcomment{Opening #4 ``#3''}}% + {\LWR@htmlcomment{Opening #4 ``#2''}}% + } \endgroup% }{}% @@ -5173,7 +5243,7 @@ end -- not --version \newcommand*{\LWR@filestart}[1]{ -\LWR@traceinfo{LWR@filestart} +\LWR@traceinfo{LWR@filestart !#1!} \begingroup \LWR@nullfonts \LWR@htmltag{!DOCTYPE html}\LWR@orignewline @@ -5286,7 +5356,7 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% \immediate\write\@mainaux{\catcode`\string$\active}% \LetLtxMacro\LWR@syntaxhighlightone$% balance for editor syntax highlighting \LWR@startpars -\LWR@nullifymathjaxensuremath +\LWR@customizeMathJax \LWR@traceinfo{LWR@lwarpStart: done} } \catcode`\$=3% math shift until lwarp starts @@ -5550,19 +5620,43 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% - - \begin{warpHTML} +\ifPDFTeX% +\ifdefstring{\inputencodingname}{utf8}{% +\newcommand{\attribution}[1]{% + \InlineClass{attribution}{—\,#1}% emdash +} +}{ \newcommand{\attribution}[1]{% -\InlineClass{attribution}{—\,#1}}% emdash + \InlineClass{attribution}{---\,#1}% +} +} +\else% +\newcommand{\attribution}[1]{% + \InlineClass{attribution}{—\,#1}% emdash +} +\fi% \end{warpHTML} \begin{warpprint} \newcommand{\attribution}[1]{\textsc{---\,#1}} \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,15 +5751,24 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% } } -\AfterEndPreamble{ -\LWR@traceinfo{Patching tabbing.} -\AtBeginEnvironment{tabbing}{% -\LWR@forcenewpage +\LetLtxMacro\LWR@origtabbing\tabbing +\LetLtxMacro\LWR@origendtabbing\endtabbing + +\renewcommand*{\tabbing}{% +\LWR@forcenewpage% \LWR@atbeginverbatim{3.5}{tabbing}% +\LWR@origtabbing% } -\AfterEndEnvironment{tabbing}{% + +\renewcommand*{\endtabbing}{% + \LWR@origendtabbing% \unskip\LWR@origvspace*{-\baselineskip}\LWR@afterendverbatim% } +\AtBeginDocument{ +\appto\LWR@restoreorigformatting{% +\LetLtxMacro\tabbing\LWR@origtabbing% +\LetLtxMacro\endtabbing\LWR@origendtabbing% +} } \end{warpHTML} @@ -7433,23 +7536,56 @@ autopage-\theLWR@currentautosec% \LWR@ensuredoingapar% } -\DeclareDocumentCommand{\href}{O{} m +m}{% +\DeclareDocumentCommand{\LWR@hrefb}{O{} m +m}{% \LWR@ensuredoingapar% \LWR@subhyperref{#2}{#3}% +\endgroup% } -\newcommand*{\nolinkurl}[1]{% +\newrobustcmd*{\href}{% +\begingroup% +\catcode`\#=12 +\catcode`\%=12 +\catcode`\&=12 +\catcode`\~=12 +\catcode`\_=12 +\LWR@hrefb% +} + +\newcommand*{\LWR@nolinkurlb}[1]{% \LWR@ensuredoingapar% \def\LWR@templink{#1}% \@onelevel@sanitize\LWR@templink% \LWR@templink% +\endgroup% +} + +\newrobustcmd*{\nolinkurl}{% +\begingroup% +\catcode`\#=12 +\catcode`\%=12 +\catcode`\&=12 +\catcode`\~=12 +\catcode`\_=12 +\LWR@nolinkurlb% } -\DeclareDocumentCommand{\url}{m}{% +\DeclareDocumentCommand{\LWR@urlb}{m}{% \LWR@ensuredoingapar% \def\LWR@templink{#1}% \@onelevel@sanitize\LWR@templink% \href{\LWR@templink}{\LWR@templink}% +\endgroup% +} + +\newrobustcmd*{\url}{% +\begingroup% +\catcode`\#=12 +\catcode`\%=12 +\catcode`\&=12 +\catcode`\~=12 +\catcode`\_=12 +\LWR@urlb% } \newcommand*{\LWR@subinlineimage}[5][]{% @@ -7917,6 +8053,7 @@ autopage-\theLWR@currentautosec% \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 @@ autopage-\theLWR@currentautosec% \endgroup \LWR@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 @@ autopage-\theLWR@currentautosec% \AtBeginDocument{ -\@ifpackageloaded{graphicx}{ - \newcommand*{\LWR@addbaselinemarker}{% - \LWR@origincludegraphics[% - width=10sp,height=10sp% - ]{lwarp_baseline_marker.png}% - } -}{ - \@ifpackageloaded{graphics}{ +\IfFileExists{lwarp_baseline_marker.png}% +{ + \@ifpackageloaded{graphicx}{ \newcommand*{\LWR@addbaselinemarker}{% - \LWR@origincludegraphics{lwarp_baseline_marker.png}% + \LWR@origincludegraphics[% + width=10sp,height=10sp% + ]{lwarp_baseline_marker.png}% } }{ - \newcommand*{\LWR@addbaselinemarker}{% - \hspace*{10sp}% + \@ifpackageloaded{graphics}{ + \newcommand*{\LWR@addbaselinemarker}{% + \LWR@origincludegraphics{lwarp_baseline_marker.png}% + } + }{ + \PackageWarning{lwarp}{Load graphicx or graphics + for improved SVG math baselines,} + \newcommand*{\LWR@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@addbaselinemarker}{% + \hspace*{10sp}% + } } }% AtBeginDocument @@ -8093,8 +8245,10 @@ autopage-\theLWR@currentautosec% \newsavebox{\LWR@singledollarbox} \NewDocumentCommand{\LWR@subsingledollar}{s m m m}{% +\LWR@traceinfo{LWR@subsingledollar}% \ifnumcomp{\value{LWR@lateximagedepth}}{>}{0}% {% +\LWR@traceinfo{LWR@subsingledollar: already in a lateximage}% #4% contents }% {% not in a lateximage @@ -8110,12 +8264,16 @@ autopage-\theLWR@currentautosec% {\textbackslash(\LWR@HTMLsanitize{#4}\textbackslash)}% }% mathjax {% not mathjax +\LWR@traceinfo{LWR@subsingledollar: not mathjax}% \begingroup% \LWR@restoreorigformatting% \RenewDocumentEnvironment{lateximage}{s o o o}{}{}% inside group \LWR@orignormalsize% + \LWR@traceinfo{Using font family \LWR@f@family}% \csuse{LWR@orig\LWR@f@family family}% + \LWR@traceinfo{Using font series \LWR@f@series}% \csuse{LWR@orig\LWR@f@series series}% + \LWR@traceinfo{Using font shape \LWR@f@shape}% \csuse{LWR@orig\LWR@f@shape shape}% \global\advance\c@LWR@lateximagedepth 1\relax% \global\sbox{\LWR@singledollarbox}{#4}% @@ -8127,12 +8285,20 @@ autopage-\theLWR@currentautosec% }% }% \global\advance\c@LWR@lateximagedepth -1\relax% Due to AmS \text macro. - \setlength{\LWR@singledollardepth}{.70\dp\LWR@singledollarbox}% + \setlength{\LWR@singledollardepth}{% + \LateximageFontScale\dp\LWR@singledollarbox% + }% \global\LWR@singledollardepth=\LWR@singledollardepth% - \setlength{\LWR@singledollarwidth}{.70\wd\LWR@singledollarbox}% + \setlength{\LWR@singledollarwidth}{% + \LateximageFontScale\wd\LWR@singledollarbox% + }% \global\LWR@singledollarwidth=\LWR@singledollarwidth% - \setlength{\LWR@singledollarheight}{.70\ht\LWR@singledollarbox}% - \addtolength{\LWR@singledollarheight}{.70\dp\LWR@singledollarbox}% + \setlength{\LWR@singledollarheight}{% + \LateximageFontScale\ht\LWR@singledollarbox% + }% + \addtolength{\LWR@singledollarheight}{% + \LateximageFontScale\dp\LWR@singledollarbox% + }% \global\LWR@singledollarheight=\LWR@singledollarheight% \endgroup% \ifdimgreater{\LWR@singledollarwidth}{.7\LWR@singledollarheight}{% @@ -8195,6 +8361,7 @@ autopage-\theLWR@currentautosec% }% not mathjax \endgroup% }% not in a lateximage +\LWR@traceinfo{LWR@subsingledollar: done}% } \LetLtxMacro\LWR@origdollar$ @@ -8237,7 +8404,7 @@ autopage-\theLWR@currentautosec% }% \protected\gdef\LWR@singledollar#1${% \ifbool{mathjax}{% -\LWR@subsingledollar*% + \LWR@subsingledollar*% {% alt tag \textbackslash( % \LWR@HTMLsanitize{#1} % extra space @@ -8246,7 +8413,7 @@ autopage-\theLWR@currentautosec% {singledollar}% add'l hashing {#1}% contents }{% not mathjax -\LWR@subsingledollar*% + \LWR@subsingledollar*% {% alt tag \textbackslash( % \LWR@HTMLsanitize{#1} % extra space @@ -8269,7 +8436,9 @@ autopage-\theLWR@currentautosec% \renewcommand{\@ensuredmath}[1]{% \ifbool{mathjax}{% - \LWR@subsingledollar*{(math image)}{\LWR@HTMLsanitize{#1}}{\relax% + \LWR@subsingledollar*{(math image)}{% + \protect\LWR@HTMLsanitize{\detokenize\expandafter{#1}}% + }{\relax% \LWR@origensuredmath{#1}% }% }{% SVG math @@ -8279,7 +8448,9 @@ autopage-\theLWR@currentautosec% \ifnumcomp{\value{LWR@lateximagedepth}}{>}{0}% {\LWR@origensuredmath{#1}}% {% - \LWR@subsingledollar*{(math image)}{\LWR@HTMLsanitize{#1}}{% + \LWR@subsingledollar*{(math image)}{% + \protect\LWR@HTMLsanitize{\detokenize\expandafter{#1}}% + }{% \LWR@origensuredmath{#1}% }% }% @@ -8374,49 +8545,68 @@ autopage-\theLWR@currentautosec% \let\LWR@origequation\equation \let\LWR@origendequation\endequation -\let\equation\relax -\let\endequation\relax - -\NewEnviron{equation}{% +\csletcs{LWR@origequation*}{equation*} +\csletcs{LWR@origendequation*}{endequation*} +\newcommand*{\LWR@doequation}[2]{% \ifboolexpr{bool{mathjax} or ( bool{FormatWP} and bool{WPMarkMath} ) }% { \LWR@syncmathjax - \LWR@hidelatexequation{equation}{\BODY} + \LWR@hidelatexequation{#2}{#1} } {% not mathjax - \begin{BlockClass}{displaymathnumbered} + \ifstrequal{#2}{equation*}{% + \begin{BlockClass}{displaymath}% + }{% + \begin{BlockClass}{displaymathnumbered}% + }% \LWR@newautoidanchor% \booltrue{LWR@indisplaymathimage}% \begin{lateximage}[% - (\LWR@equationtag) \textbackslash{begin\{equation\}} % extra space - \LWR@HTMLsanitizeexpand{\detokenize\expandafter{\BODY}} % extra space - \textbackslash{end\{equation\}}% + \ifstrequal{#2}{equation*}{% + \ifdefequal{\LWR@equationtag}{\theequation}{% + }{% + (\LWR@equationtag) % tag was given + }% + }{% + (\LWR@equationtag) % automatic numbering + }% + \textbackslash{begin\{#2\}} % extra space + \LWR@HTMLsanitizeexpand{\detokenize\expandafter{#1}} % extra space + \textbackslash{end\{#2\}}% ]% alt tag - \LWR@origequation - \BODY% contents collected by NewEnviron - \LWR@origendequation + \csuse{LWR@orig#2} + #1% contents collected by \collect@body + \csuse{LWR@origend#2} \end{lateximage}% \end{BlockClass} }% not mathjax - -}[% +} +\newcommand*{\LWR@doendequation}[1]{% \ifboolexpr{bool{mathjax} or ( bool{FormatWP} and bool{WPMarkMath} ) }% {% - \LWR@addmathjax{equation}{\BODY}% + \LWR@addmathjax{#1}{\BODY}% }{}% -] +} + +\let\equation\relax +\let\endequation\relax +\csletcs{equation*}{relax} +\csletcs{endequation*}{relax} + +\NewEnviron{equation} +{ +\LWR@doequation{\BODY}{equation} +} +[\LWR@doendequation{equation}] \LetLtxMacro\LWR@equationnormal\equation \LetLtxMacro\LWR@endequationnormal\endequation -\csletcs{LWR@origequationstar}{equation*} -\csletcs{LWR@origendequationstar}{endequation*} - -\renewenvironment*{equation*} -{\displaymath} -{\enddisplaymath} +\NewEnviron{equation*} +{\LWR@doequation{\BODY}{equation*}} +[\LWR@doendequation{equation*}] \csletcs{LWR@equationnormalstar}{equation*} \csletcs{LWR@endequationnormalstar}{endequation*} @@ -8842,11 +9032,12 @@ autopage-\theLWR@currentautosec% \newcounter{LWR@LIpage} \end{warpHTML} - \begin{warpall} \newcommand*{\LateximageFontSizeName}{large} +\newcommand*{\LateximageFontScale}{.75} + \end{warpall} @@ -8906,7 +9097,7 @@ autopage-\theLWR@currentautosec% \let\LWR@startingequationtag\theLWR@startingequation -\let\LWR@equationtag\theequation +\newcommand*{\LWR@equationtag}{} \AtBeginDocument{ @@ -8917,8 +9108,7 @@ autopage-\theLWR@currentautosec% {% \global\boolfalse{LWR@isstartingequation}% \xdef\LWR@startingequationtag{#1}% -}% -{}% +}{}% \xdef\LWR@equationtag{#1}% }% @@ -8985,7 +9175,8 @@ autopage-\theLWR@currentautosec% \LWR@traceinfo{lateximage: about to write to lateximages.txt}% \IfBooleanTF{#1}% starred {% hash - \LWR@traceinfo{lateximage: hash true, adding !#2!#3!}% + \LWR@traceinfo{lateximage: hash true, adding % + !\detokenize\expandafter{#2}!\detokenize\expandafter{#3}!}% \edef\LWR@hashedname{% \LWR@mdfive{\detokenize\expandafter{#2}-!-#3}% }% @@ -9012,7 +9203,7 @@ autopage-\theLWR@currentautosec% \LWR@restoreorigformatting% \def\@mpfn{footnote}% \def\thempfn{\thefootnote}% - \let\@footnotetext\LWR@footnotetext% + \LetLtxMacro\@footnotetext\LWR@footnotetext% \LWR@traceinfo{lateximage: about to create label}% \LWR@origlabel{LWRlateximage\arabic{LWR@lateximagenumber}}% \LWR@traceinfo{lateximage: finished creating the label}% @@ -9025,8 +9216,8 @@ autopage-\theLWR@currentautosec% \LetLtxMacro\]\LWR@origclosebracket% \let\equation\LWR@origequation% \let\endequation\LWR@origendequation% - \csletcs{equation*}{LWR@origequationstar}% - \csletcs{endequation*}{LWR@origendequationstar}% + \csletcs{equation*}{LWR@origequation*}% + \csletcs{endequation*}{LWR@origendequation*}% }% not in display math \LetLtxMacro\LWR@newsingledollar$% \LetLtxMacro\LWR@newsingledollar$% syntax highlighting @@ -9775,6 +9966,8 @@ width:\LWR@printlength{\LWR@tempwidth}% \def\(##1\){}% \def\[##1\]{}% \RenewDocumentCommand{\LWR@subsingledollar}{s m m m}{} +\let\texorpdfstring\relax% +\newcommand{\texorpdfstring}[2]{##2}% } |