diff options
Diffstat (limited to 'Master/texmf-dist/tex')
17 files changed, 540 insertions, 153 deletions
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}% } |