diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/lwarp/lwarp.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/lwarp/lwarp.sty | 734 |
1 files changed, 519 insertions, 215 deletions
diff --git a/Master/texmf-dist/tex/latex/lwarp/lwarp.sty b/Master/texmf-dist/tex/latex/lwarp/lwarp.sty index 753a687aab8..62fb3a6e8b5 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/03 v0.50 Allows LaTeX to directly produce HTML5 output.] + [2018/03/24 v0.51 Allows LaTeX to directly produce HTML5 output.] @@ -113,6 +113,7 @@ \newbool{warpingprint} \newbool{warpingHTML} \newbool{mathjax} +\newbool{LWR@origmathjax} \booltrue{warpingprint}% \boolfalse{warpingHTML}% \boolfalse{mathjax}% @@ -131,10 +132,12 @@ \DeclareVoidOption{mathsvg}{% \PackageInfo{lwarp}{Using option 'mathsvg'} \boolfalse{mathjax}% +\boolfalse{LWR@origmathjax}% } \DeclareVoidOption{mathjax}{% \PackageInfo{lwarp}{Using option 'mathjax'} \booltrue{mathjax}% +\booltrue{LWR@origmathjax}% } \DeclareStringOption[\jobname]{BaseJobname} @@ -276,6 +279,11 @@ For a possible alternative, see package(s) #2.} \LWR@notmemoirloadafter{chngpage} \LWR@loadafter{chappg} \LWR@loadafter{chapterbib} +\LWR@loadafter{chemfig} +\LWR@loadafter{chemformula} +\LWR@loadafter{chemgreek} +\LWR@loadafter{chemmacros} +\LWR@loadafter{chemnum} \LWR@loadafter{cite} \LWR@loadafter{color} \LWR@loadafter{colortbl} @@ -299,6 +307,7 @@ For a possible alternative, see package(s) #2.} \LWR@loadafter{enumitem} \LWR@notmemoirloadafter{epigraph} \LWR@loadafter{epstopdf} +\LWR@loadafter{epstopdf-base} \LWR@loadafter{eso-pic} \LWR@loadafter{everypage} \LWR@loadafter{everyshi} @@ -334,6 +343,7 @@ For a possible alternative, see package(s) #2.} \LWR@loadafter{geometry} \LWR@loadafter{glossaries} \LWR@loadafter{grffile} +\LWR@loadafter{grid} \LWR@loadafter{hang} \LWR@loadafter{hanging} \LWR@loadafter{hypcap} @@ -355,6 +365,7 @@ For a possible alternative, see package(s) #2.} \LWR@loadafter{longtable} \LWR@loadafter{lscape} \LWR@loadafter{ltcaption} +\LWR@loadafter{ltxgrid} \LWR@loadafter{ltxtable} \LWR@loadafter{luacolor} \LWR@loadafter{luatodonotes} @@ -365,6 +376,7 @@ For a possible alternative, see package(s) #2.} \LWR@loadafter{mdframed} \LWR@loadafter{memhfixc} \LWR@loadafter{metalogo} +\LWR@loadafter{mhchem} \LWR@loadafter{microtype} \LWR@loadafter{midfloat} \LWR@loadafter{midpage} @@ -511,10 +523,6 @@ top=1in,bottom=1in,% \RequirePackage{xparse} -\@ifundefined{AfterPackage}% -{ -\RequirePackage{afterpackage} -}{} \end{warpall} @@ -898,7 +906,7 @@ top=1in,bottom=1in,% \LetLtxMacro\LWR@origmbox\mbox \LetLtxMacro\LWR@origmakebox\makebox - +\chardef\LWR@origpound=`\# \let\LWR@origcomma\, \let\LWR@origtilde~ \let\LWR@origenskip\enskip @@ -1050,12 +1058,12 @@ top=1in,bottom=1in,% \LetLtxMacro{\c}{\LWR@origc}% \LetLtxMacro{\d}{\LWR@origd}% \LetLtxMacro{\b}{\LWR@origb}% -} +}% \else% XeLaTeX, LuaLaTeX: \newcommand*{\LWR@restoreorigaccents}{% \LetLtxMacro{\t}{\LWR@origt}% -} -\fi +}% +\fi% }% AtBeginDocument \end{warpHTML} @@ -2085,7 +2093,9 @@ div.flushright{text-align:right;} div.flushright table {margin-left:auto ; margin-right: 0em ;} /* Fancybox */ -div.Btrivlist table tr td { padding: .2ex 0em ; } +div.Btrivlist table tr td { + padding: .2ex 0em ; +} /* program listing callouts: */ span.callout { @@ -2201,12 +2211,11 @@ a.linkhome { font-weight:bold ; font-size: 1em ;} div.lateximagesource { padding: 0px ; margin: 0px ; display: none; } img.lateximage{ - padding: 0px 0px 0px 0px ; + padding: 0pt ; + margin: 0pt ; box-shadow: none ; border: none ; background: none ; - margin: 0px 0px -.15ex 0px ; - /* pdfcrop leaves a slight margin, adjust to baseline */ max-width: 100% ; border-radius: 0ex ; border: none ; @@ -2934,11 +2943,11 @@ nav.botnavigation { \begin{warpprint} \begin{filecontents*}{lwarp_one_limage.txt} @echo off -pdfseparate -f %1 -l %1 %4_html.pdf lateximages\lateximagetemp-%%d.pdf" -pdfcrop lateximages\lateximagetemp-%1.pdf lateximages\%3.pdf -pdftocairo -svg lateximages\%3.pdf lateximages\%3.svg +pdfseparate -f %1 -l %1 %4_html.pdf lateximages\lateximagetemp-%%d.pdf +pdfcrop --hires lateximages\lateximagetemp-%1.pdf lateximages\%3.pdf +pdftocairo -svg -noshrink lateximages\%3.pdf lateximages\%3.svg del lateximages\%3.pdf -del lateximages\lateximagetemp-%1.pdf" +del lateximages\lateximagetemp-%1.pdf exit \end{filecontents*} \end{warpprint} @@ -3057,7 +3066,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.50" +printversion = "v0.51" function printhelp () print ("lwarpmk: Use lwarpmk -h or lwarpmk --help for help.") ; @@ -3421,11 +3430,11 @@ cmdgroupopenname .. "lateximages" .. dirslash .."lateximagetemp-%d" .. ".pdf" .. seqname .. -- Crop the image: -"pdfcrop lateximages" .. dirslash .. "lateximagetemp-" .. lwimgpage .. ".pdf " .. +"pdfcrop --hires lateximages" .. dirslash .. "lateximagetemp-" .. lwimgpage .. ".pdf " .. "lateximages" .. dirslash .. lwimgname .. ".pdf" .. seqname .. -- Convert the image to svg: -"pdftocairo -svg lateximages" .. dirslash .. lwimgname .. ".pdf " .. +"pdftocairo -svg -noshrink lateximages" .. dirslash .. lwimgname .. ".pdf " .. "lateximages" .. dirslash .. lwimgname ..".svg" .. seqname .. -- Remove the temporary files: @@ -3831,7 +3840,7 @@ end -- not --version \LWR@origampersand#1;% \endgroup } -\newcommand*{\HTMLunicode}[1]{\HTMLentity{\#x#1}} +\newcommand*{\HTMLunicode}[1]{\HTMLentity{\LWR@origpound{}x#1}} \renewrobustcmd*{\&}{\HTMLentity{amp}} @@ -4042,7 +4051,7 @@ end -- not --version \renewrobustcmd*{\FBthinspace}{% \begingroup% \LWR@FBcancel% - \LWR@origampersand\#x202f;% \, + \LWR@origampersand\LWR@origpound{}x202f;% \, \endgroup% }% \renewrobustcmd*{\FBguillspace}{% @@ -4054,7 +4063,7 @@ end -- not --version \DeclareDocumentCommand{\FBmedkern}{}{% \begingroup% \LWR@FBcancel% - \LWR@origampersand\#x202f;% \, + \LWR@origampersand\LWR@origpound{}x202f;% \, \endgroup% }% \DeclareDocumentCommand{\FBthickkern}{}{% @@ -4133,7 +4142,7 @@ end -- not --version } \NewDocumentCommand{\LWR@htmlspanclass}{o m +m}{% -\LWR@traceinfo{LWR@htmlspanclass #2}% +\LWR@traceinfo{LWR@htmlspanclass |#1|#2|}% \LWR@ensuredoingapar% \LWR@subhtmlelementclass{span}[#1]{#2}% \begin{LWR@nestspan}% @@ -4187,7 +4196,7 @@ end -- not --version \NewDocumentCommand{\LWR@subhtmlelementclass}{m O{} m}{% -\LWR@traceinfo{LWR@subhtmlelementclass #1 #3}% +\LWR@traceinfo{LWR@subhtmlelementclass !#1!#2!#3!}% \ifblank{#2}% {\LWR@htmltag{#1 class="#3"}}% empty option {\LWR@htmltag{#1 class="#3" style="#2"}}% non-empty option @@ -4711,7 +4720,7 @@ end -- not --version {\textless}{-}[\LWR@thisnewfilename] \StrSubstitute{\LWR@thisnewfilename}% {\textgreater}{-}[\LWR@thisnewfilename] -\StrSubstitute{\LWR@thisnewfilename}{\#}{-}[\LWR@thisnewfilename] +\StrSubstitute{\LWR@thisnewfilename}{\LWR@origpound}{-}[\LWR@thisnewfilename] \StrSubstitute{\LWR@thisnewfilename}{\_}{-}[\LWR@thisnewfilename] \StrSubstitute{\LWR@thisnewfilename}{\ }{-}[\LWR@thisnewfilename] \StrSubstitute{\LWR@thisnewfilename}{\%}{-}[\LWR@thisnewfilename] @@ -4766,6 +4775,18 @@ end -- not --version }% } +\newcommand{\LWR@nullifymathjaxensuremath}{% +\ifbool{mathjax}{ +\LWR@stoppars +\LWR@htmlcomment{Nullify \textbackslash{}ensuremath for MathJax:} + +\( +\newcommand\ensuremath[1]{##1} +\) +\LWR@startpars +}{} +} + \newcommand*{\LWR@newhtmlfile}[1]{ \LWR@traceinfo{LWR@newhtmlfile} @@ -4839,6 +4860,7 @@ end -- not --version \LWR@stoppars +\LWR@nullifymathjaxensuremath \LWR@traceinfo{LWR@newhtmlfile: done} } @@ -5264,6 +5286,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@traceinfo{LWR@lwarpStart: done} } \catcode`\$=3% math shift until lwarp starts @@ -5475,41 +5498,38 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% \end{warpHTML} \begin{warpall} -\AfterPackage{titling}{ \newcommand*{\AddSubtitlePublished}{% - -\newcommand{\@published}{} - -\newcommand{\published}[1]{\gdef\@published{##1}} - -\renewcommand*{\maketitlehooka}{\printpublished} - -\newcommand*{\printpublished}{% -\warpprintonly{\begin{center}\unskip}% -\begin{BlockClass}{published}% -\warpprintonly{\large\itshape}% -\@published% -\end{BlockClass}% -\warpprintonly{\end{center}}% -} - -\newcommand{\@subtitle}{} - -\newcommand{\subtitle}[1]{\gdef\@subtitle{##1}} - -\renewcommand*{\maketitlehookb}{\printsubtitle} - -\newcommand*{\printsubtitle}{% -\warpprintonly{\begin{center}\unskip}% -\begin{BlockClass}{subtitle}% -\warpprintonly{\Large\itshape}% -\@subtitle% -\end{BlockClass}% -\warpprintonly{\end{center}}% -} - +\@ifpackageloaded{titling}{% yes titling package + \newcommand{\@published}{}% + \newcommand{\published}[1]{\gdef\@published{##1}}% + \renewcommand*{\maketitlehooka}{\printpublished}% + \newcommand*{\printpublished}{% + \warpprintonly{\begin{center}\unskip}% + \begin{BlockClass}{published}% + \warpprintonly{\large\itshape}% + \@published% + \end{BlockClass}% + \warpprintonly{\end{center}}% + }% + \newcommand{\@subtitle}{}% + \newcommand{\subtitle}[1]{\gdef\@subtitle{##1}}% + \renewcommand*{\maketitlehookb}{\printsubtitle}% + \newcommand*{\printsubtitle}{% + \warpprintonly{\begin{center}\unskip}% + \begin{BlockClass}{subtitle}% + \warpprintonly{\Large\itshape}% + \@subtitle% + \end{BlockClass}% + \warpprintonly{\end{center}}% + }% +}% yes titling package +{% no titling package + \newcommand{\published}[1]{}% + \newcommand*{\printpublished}{}% + \newcommand{\subtitle}{}% + \newcommand*{\printsubtitle}% +}% no titling package }% \AddSubtitlePublished -}% AfterPackage \end{warpall} @@ -5588,14 +5608,16 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% \newbool{LWR@verbtags} \booltrue{LWR@verbtags} -\newcommand*{\LWR@atbeginverbatim}[2][] +\newcommand*{\LWR@atbeginverbatim}[3][] {% \setlength{\parskip}{0ex}% \LWR@stoppars% \ifbool{LWR@verbtags}{% - \LWR@htmltag{pre class="#2" - \ifthenelse{\equal{#1}{}}{}{style="#1"}% -}\LWR@orignewline% pre + \LWR@htmltag{pre class="#3" + \ifthenelse{\equal{#1}{}}{}{style="#1"}% + }% + \unskip\LWR@origvspace*{-#2\baselineskip}% + \LWR@orignewline% pre }{}% \begingroup% \LWR@orignormalsize% @@ -5618,7 +5640,7 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% \renewcommand{\verbatim@input}[2]{% \ifbool{LWR@verbtags}{\LWR@forcenewpage}{}% -\LWR@atbeginverbatim{Verbatim}\unskip\LWR@origvspace*{-\baselineskip}%% +\LWR@atbeginverbatim{3.5}{Verbatim}% \LWRV@origverbatim@input{#1}{#2}% \unskip\LWR@origvspace*{-\baselineskip}\LWR@afterendverbatim% } @@ -5627,7 +5649,8 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% \LWR@traceinfo{Patching verbatim.} \AtBeginEnvironment{verbatim}{% \LWR@forcenewpage% -\LWR@atbeginverbatim{verbatim}\unskip\LWR@origvspace*{-2\baselineskip}% +\LWR@atbeginverbatim{.5}{verbatim}% +\unskip\LWR@origvspace*{-1.5\baselineskip}% } \AfterEndEnvironment{verbatim}{% \unskip\LWR@origvspace*{-\baselineskip}\LWR@afterendverbatim% @@ -5638,7 +5661,7 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% \LWR@traceinfo{Patching tabbing.} \AtBeginEnvironment{tabbing}{% \LWR@forcenewpage -\LWR@atbeginverbatim{tabbing}\unskip\LWR@origvspace*{-\baselineskip}% +\LWR@atbeginverbatim{3.5}{tabbing}% } \AfterEndEnvironment{tabbing}{% \unskip\LWR@origvspace*{-\baselineskip}\LWR@afterendverbatim% @@ -5710,7 +5733,7 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% \refstepcounter\@listctr \fi \fi - \makelabel{#1}% + \makelabel{#1} % extra space \ignorespaces% } @@ -6288,7 +6311,7 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% }{% \LWR@htmltag{% tr class="hline" % - style="border-top: 1px solid \#\LWR@ruleHTMLcolor "% + style="border-top: 1px solid \LWR@origpound\LWR@ruleHTMLcolor "% }% }% \LWR@orignewline% @@ -6301,7 +6324,7 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% }{% \LWR@htmltag{% tr class="tbrule" % - style="border-top: 1px solid \#\LWR@ruleHTMLcolor "% + style="border-top: 1px solid \LWR@origpound\LWR@ruleHTMLcolor "% }% }% \LWR@orignewline% @@ -6529,14 +6552,14 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% border-top:\LWR@printlength{\LWR@atleastonept} solid % \ifdefvoid{\LWR@ruleHTMLcolor}{% \ifdimcomp{#1}{<}{\LWR@lightrulewidth}% - {\#A0A0A0}% + {\LWR@origpound{}A0A0A0}% {% lightrule or heaver \ifdimcomp{#1}{<}{\LWR@heavyrulewidth}% - {\#808080}% + {\LWR@origpound{}808080}% {black}% }% lightrule or heavier }{% - \#\LWR@ruleHTMLcolor% + \LWR@origpound\LWR@ruleHTMLcolor% } }% custom width and/or color } @@ -6571,12 +6594,12 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% \ifdefvoid{\LWR@xcolorrowHTMLcolor}{}% {% xcolor row color \LWR@tdaddstyle% - background:\#\LWR@xcolorrowHTMLcolor% + background:\LWR@origpound\LWR@xcolorrowHTMLcolor% }% }% {% explicit row color \LWR@tdaddstyle% - background:\#\LWR@rowHTMLcolor% + background:\LWR@origpound\LWR@rowHTMLcolor% }% }% } @@ -6589,7 +6612,7 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% \ifdefvoid{\LWR@ruleHTMLcolor}{}% {% \LWR@tdaddstyle% - border-top: 1px solid \#\LWR@ruleHTMLcolor% + border-top: 1px solid \LWR@origpound\LWR@ruleHTMLcolor% }{}% }{}% } @@ -6601,13 +6624,13 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% \edef\LWR@tempone{\LWR@getexparray{LWR@colbarspec}{leftedge}}% \ifdefstring{\LWR@tempone}{tvertbarl}{% \LWR@tdaddstyle% - border-left: 1px solid \#\LWR@vertruleHTMLcolor% + border-left: 1px solid \LWR@origpound\LWR@vertruleHTMLcolor% }{}% }{}% \edef\LWR@tempone{\LWR@getexparray{LWR@colbarspec}{\arabic{LWR@tablecolindex}}}% \ifdefstring{\LWR@tempone}{tvertbarr}{% \LWR@tdaddstyle% - border-right: 1px solid \#\LWR@vertruleHTMLcolor% + border-right: 1px solid \LWR@origpound\LWR@vertruleHTMLcolor% }{}% }% } @@ -6616,7 +6639,7 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% \newcommand*{\LWR@subaddtabularcellcolor}[1]{% \LWR@htmltag{div class="cellcolor" style="% - background:\#{}#1 % + background:\LWR@origpound{}{}#1 % " }% \addtocounter{LWR@cellcolordepth}{1}% } @@ -6734,11 +6757,11 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% \ifbool{LWR@tabularmutemods}{}{% \ifbool{LWR@mcolvertbarl}{% \LWR@tdaddstyle% - border-left: 1px solid \#\LWR@vertruleHTMLcolor% + border-left: 1px solid \LWR@origpound\LWR@vertruleHTMLcolor% }{}% \ifbool{LWR@mcolvertbarr}{% \LWR@tdaddstyle% - border-right: 1px solid \#\LWR@vertruleHTMLcolor% + border-right: 1px solid \LWR@origpound\LWR@vertruleHTMLcolor% }{}% }% } @@ -7319,7 +7342,7 @@ rowspan="#2" % \LWR@traceinfo{LWR@startref B}% \LWR@origmbox{\LWR@htmlrefsectionfilename{#1}}% \LWR@traceinfo{LWR@startref C}% -\#% +\LWR@origpound% \LWR@traceinfo{LWR@startref D: !#1!}% \ifthenelse{\equal{\LWR@lidref}{??}}% {% @@ -7492,10 +7515,15 @@ autopage-\theLWR@currentautosec% \boolfalse{LWR@freezethisautoid} \newcommand*{\LWR@newautoidanchor}{% -\ifbool{LWR@freezethisautoid}{}{% - \addtocounter{LWR@thisautoid}{1}% - \LWR@htmltag{a id="\LWR@origmbox{autoid-\arabic{LWR@thisautoid}}"}\LWR@htmltag{/a}% -}% +\ifnumcomp{\value{LWR@lateximagedepth}}{>}{0}% +{}% +{ + \ifbool{LWR@freezethisautoid}{}{% + \addtocounter{LWR@thisautoid}{1}% + \LWR@htmltag{a id="\LWR@origmbox{autoid-\arabic{LWR@thisautoid}}"}% + \LWR@htmltag{/a}% + }% +} } \newcommand*{\@captype}{} @@ -7590,8 +7618,10 @@ autopage-\theLWR@currentautosec% \renewcommand*{\addcontentsline}[3]{% \ifstrequal{#1}{toc}{}{% not TOC - \LWR@newautoidanchor% - \ifthenelse{\equal{#1}{thm}}{\csdef{ext@#2}{thm}}{}% +\ifnumcomp{\value{LWR@lateximagedepth}}{>}{0}% + {} + {\LWR@newautoidanchor}% + \ifcsvoid{ext@#2}{\csdef{ext@#2}{#1}}{}% \addtocontents{\@nameuse{ext@#2}}{% \protect\LWRsetnextfloat% {\arabic{LWR@latestautopage}}% @@ -7751,7 +7781,7 @@ autopage-\theLWR@currentautosec% \ifthenelse{\cnttest{#1}{<=}{\value{tocdepth}}}{% \LWR@startpars% \LWR@subhyperrefclass{% - \LWR@htmlrefsectionfilename{autopage-#4}\#\LWR@origmbox{autosec-#4}% + \LWR@htmlrefsectionfilename{autopage-#4}\LWR@origpound\LWR@origmbox{autosec-#4}% }{#3}{toc#2}% \LWR@stoppars% } @@ -7780,7 +7810,7 @@ autopage-\theLWR@currentautosec% \LWR@startpars% \LWR@subhyperrefclass{% \LWR@htmlrefsectionfilename{autopage-\arabic{LWR@nextautopage}}% - \#\LWR@origmbox{autoid-\arabic{LWR@nextautoid}}}% + \LWR@origpound\LWR@origmbox{autoid-\arabic{LWR@nextautoid}}}% {#4}{toc#2}% \LWR@stoppars% }{}% @@ -7942,9 +7972,9 @@ autopage-\theLWR@currentautosec% \let\llap\LWR@origllap% \let\rlap\LWR@origrlap% \let\hfilneg\LWR@orighfilneg% -\let\raggedright\LWR@origraggedright -\let\raggedleft\LWR@origraggedleft -\let\centering\LWR@origcentering +\let\raggedright\LWR@origraggedright% +\let\raggedleft\LWR@origraggedleft% +\let\centering\LWR@origcentering% \let\,\LWR@origcomma% disable HTML short unbreakable space \let\textellipsis\LWR@origtextellipsis% \let\textless\LWR@origtextless% @@ -8015,8 +8045,6 @@ autopage-\theLWR@currentautosec% \let\LaTeXe\LWR@origLaTeXe% \renewcommand*{\Xe}{X\textsubscript{E}}% \LetLtxMacro\@ensuredmath\LWR@origensuredmath% -\csletcs{equation*}{LWR@origequationstar}% -\csletcs{endequation*}{LWR@origendequationstar}% \LWR@restoreorigaccents% \LWR@restoreoriglists% \LWR@FBcancel% @@ -8024,105 +8052,113 @@ autopage-\theLWR@currentautosec% \end{warpHTML} \begin{warpHTML} +\newcounter{LWR@externalfilecnt} + +\newbool{LWR@indisplaymathimage} + \let\LWR@origtextdollar\$ \renewcommand*{\$}{% \ifnumcomp{\value{LWR@lateximagedepth}}{>}{0}% {\LWR@origtextdollar}% -{\LWR@htmltagc{span}\LWR@origtextdollar\LWR@htmltagc{/span}}% +{\HTMLentity{dollar}}% } -\newcounter{LWR@externalfilecnt} - -\LetLtxMacro\LWR@origdollar$ -\LetLtxMacro\LWR@secondorigdollar$% balance for editor syntax highlighting - -\LetLtxMacro\LWR@origopenparen\( -\LetLtxMacro\LWR@origcloseparen\) -\LetLtxMacro\LWR@origopenbracket\[ -\LetLtxMacro\LWR@origclosebracket\] - -\begingroup -\catcode`\$=\active% -\protected\gdef${\@ifnextchar$\LWR@doubledollar\LWR@singledollar}% - -\protected\gdef\LWR@doubledollar$#1$${ -\ifboolexpr{bool{mathjax} or ( bool{FormatWP} and bool{WPMarkMath} ) }% -{ - - \textbackslash[% - \LWR@HTMLsanitize{#1}% - \textbackslash] +\AtBeginDocument{ -}% mathjax -{% not mathjax +\@ifpackageloaded{graphicx}{ + \newcommand*{\LWR@addbaselinemarker}{% + \LWR@origincludegraphics[% + width=10sp,height=10sp% + ]{lwarp_baseline_marker.png}% + } +}{ + \@ifpackageloaded{graphics}{ + \newcommand*{\LWR@addbaselinemarker}{% + \LWR@origincludegraphics{lwarp_baseline_marker.png}% + } + }{ + \newcommand*{\LWR@addbaselinemarker}{% + \hspace*{10sp}% + } + } +} - \begin{BlockClass}{displaymath} - \begin{lateximage}% - [% - \textbackslash{[} % extra space - \LWR@HTMLsanitize{#1} % extra space - \textbackslash{]}% - ]% - \LWR@origdollar\LWR@origdollar#1\LWR@origdollar\LWR@origdollar% - \end{lateximage}% - \end{BlockClass} +}% AtBeginDocument -}% not mathjax -}% \newlength{\LWR@singledollarwidth} \newlength{\LWR@singledollarheight} \newlength{\LWR@singledollardepth} -\protected\gdef\LWR@subsingledollar#1#2{% +\newsavebox{\LWR@singledollarbox} + +\NewDocumentCommand{\LWR@subsingledollar}{s m m m}{% +\ifnumcomp{\value{LWR@lateximagedepth}}{>}{0}% +{% + #4% contents +}% +{% not in a lateximage \begingroup% \ifboolexpr{% ( bool{mathjax} or ( bool{FormatWP} and bool{WPMarkMath} ) ) and - ( not test { \ifstrequal {#1} {math image} } ) + ( not test { \ifstrequal {#2} {(math image)} } )% from \ensuredmath }% {% - {\textbackslash(\LWR@HTMLsanitize{#2}\textbackslash)}% + {\textbackslash(\LWR@HTMLsanitize{#4}\textbackslash)}% }% mathjax {% not mathjax + \begingroup% \LWR@restoreorigformatting% + \RenewDocumentEnvironment{lateximage}{s o o o}{}{}% inside group \LWR@orignormalsize% - \global\setlength{\LWR@singledollardepth}{\depthof{% - \LWR@origdollar#2\LWR@origdollar% - }*\real{.8}}% - \global\setlength{\LWR@singledollarwidth}{\widthof{% - \LWR@origdollar#2\LWR@origdollar% - }*\real{.8}}% - \global\setlength{\LWR@singledollarheight}{\totalheightof{% - \LWR@origdollar#2\LWR@origdollar% - }*\real{.8}}% - \LWR@origscriptsize% - \ifdimgreater{\LWR@singledollarwidth}{\LWR@singledollarheight}{% + \csuse{LWR@orig\LWR@f@family family}% + \csuse{LWR@orig\LWR@f@series series}% + \csuse{LWR@orig\LWR@f@shape shape}% + \global\advance\c@LWR@lateximagedepth 1\relax% + \global\sbox{\LWR@singledollarbox}{#4}% + \global\sbox{\LWR@singledollarbox}{% + \usebox{\LWR@singledollarbox}% + \hspace*{-10sp}% + \raisebox{-\dp\LWR@singledollarbox}{% + \LWR@addbaselinemarker% + }% + }% + \global\advance\c@LWR@lateximagedepth -1\relax% Due to AmS \text macro. + \setlength{\LWR@singledollardepth}{.70\dp\LWR@singledollarbox}% + \global\LWR@singledollardepth=\LWR@singledollardepth% + \setlength{\LWR@singledollarwidth}{.70\wd\LWR@singledollarbox}% + \global\LWR@singledollarwidth=\LWR@singledollarwidth% + \setlength{\LWR@singledollarheight}{.70\ht\LWR@singledollarbox}% + \addtolength{\LWR@singledollarheight}{.70\dp\LWR@singledollarbox}% + \global\LWR@singledollarheight=\LWR@singledollarheight% + \endgroup% + \ifdimgreater{\LWR@singledollarwidth}{.7\LWR@singledollarheight}{% \def\LWR@singledollarstyle{% width:\LWR@convertto{em}{\the\LWR@singledollarwidth} em% }% }{% \def\LWR@singledollarstyle{% - height:\LWR@convertto{em}{\the\LWR@singledollarheight }em% + height:\LWR@convertto{em}{\the\LWR@singledollarheight} em% }% }% - \ifdimless{\LWR@singledollarwidth}{.8em}% + \ifdimless{\LWR@singledollarwidth}{.2em}% {% \def\LWR@singledollarstyle{% - height:\LWR@convertto{em}{\the\LWR@singledollarheight }em% + height:\LWR@convertto{em}{\the\LWR@singledollarheight} em% }% }% {}% - \ifdimless{\LWR@singledollarheight}{.3em}% + \ifdimless{\LWR@singledollarheight}{.2em}% {% \def\LWR@singledollarstyle{% width:\LWR@convertto{em}{\the\LWR@singledollarwidth} em% }% }% {}% - \ifdimgreater{\LWR@singledollardepth}{0.01em}{% + \ifdimgreater{\LWR@singledollardepth}{0.05ex}{% \def\LWR@singledollardepthstyle{% \ ; % extra space \LWR@origmbox{% @@ -8132,27 +8168,93 @@ autopage-\theLWR@currentautosec% }{% \def\LWR@singledollardepthstyle{}% }% - \ifblank{#1}{% - \begin{lateximage}*% - [% - \textbackslash( % - \LWR@HTMLsanitize{#2} % extra space - \textbackslash)% + \IfValueTF{#1}{% + \LWR@findcurrenttextcolor% sets \LWR@tempcolor + \begin{lateximage}*% use hashing + [#2]% alt + [% addl' hashing + #3% + FM\LWR@f@family% + SR\LWR@f@series% + SH\LWR@f@shape% + CL\LWR@tempcolor% ]% - [\LWR@singledollarstyle \LWR@singledollardepthstyle]% + [\LWR@singledollarstyle \LWR@singledollardepthstyle]% CSS }{% - \begin{lateximage}% - [#1]% - [\LWR@singledollarstyle \LWR@singledollardepthstyle]% + \begin{lateximage}% no hashing + [#2]% alt + []% no add'l hashing + [\LWR@singledollarstyle \LWR@singledollardepthstyle]% CSS }% - \LWR@origdollar#2\LWR@origdollar% + \LWR@addbaselinemarker% + \hspace*{-10sp}% + \usebox{\LWR@singledollarbox}% + \hspace*{-10sp}% + \LWR@addbaselinemarker% \end{lateximage}% -}% +}% not mathjax \endgroup% +}% not in a lateximage } +\LetLtxMacro\LWR@origdollar$ +\LetLtxMacro\LWR@secondorigdollar$% balance for editor syntax highlighting + +\LetLtxMacro\LWR@origopenparen\( +\LetLtxMacro\LWR@origcloseparen\) +\LetLtxMacro\LWR@origopenbracket\[ +\LetLtxMacro\LWR@origclosebracket\] + +\begingroup +\catcode`\$=\active% +\protected\gdef${\@ifnextchar$\LWR@doubledollar\LWR@singledollar}% + +\protected\gdef\LWR@newsingledollar{\@ifnextchar$\LWR@doubledollar\LWR@singledollar}% + +\protected\gdef\LWR@doubledollar$#1$${% +\ifboolexpr{bool{mathjax} or ( bool{FormatWP} and bool{WPMarkMath} ) }% +{ + + \textbackslash[% + \LWR@HTMLsanitize{#1}% + \textbackslash] + +}% mathjax +{% not mathjax + \begin{BlockClass}{displaymath}% + \LWR@newautoidanchor% + \booltrue{LWR@indisplaymathimage}% + \begin{lateximage}% + [% + \textbackslash{[} % extra space + \LWR@HTMLsanitize{#1} % extra space + \textbackslash{]}% + ]% + \LWR@origdollar\LWR@origdollar#1\LWR@origdollar\LWR@origdollar% + \end{lateximage}% + \end{BlockClass}% +}% not mathjax +}% \protected\gdef\LWR@singledollar#1${% -\LWR@subsingledollar{}{#1}% +\ifbool{mathjax}{% +\LWR@subsingledollar*% + {% alt tag + \textbackslash( % + \LWR@HTMLsanitize{#1} % extra space + \textbackslash)% + }% + {singledollar}% add'l hashing + {#1}% contents +}{% not mathjax +\LWR@subsingledollar*% + {% alt tag + \textbackslash( % + \LWR@HTMLsanitize{#1} % extra space + \textbackslash)% + }% + {singledollar}% add'l hashing + {\LWR@origensuredmath{#1}}% contents +}% not mathjax } \protected\gdef\(#1\){$#1$} @@ -8160,16 +8262,27 @@ autopage-\theLWR@currentautosec% \endgroup +\LetLtxMacro\LWR@openbracketnormal\[ +\LetLtxMacro\LWR@closebracketnormal\] + \LetLtxMacro\LWR@origensuredmath\@ensuredmath \renewcommand{\@ensuredmath}[1]{% \ifbool{mathjax}{% - \LWR@subsingledollar{math image}{\relax#1}% + \LWR@subsingledollar*{(math image)}{\LWR@HTMLsanitize{#1}}{\relax% + \LWR@origensuredmath{#1}% + }% }{% SVG math \ifmmode% \LWR@origensuredmath{#1}% \else% - \LWR@subsingledollar{math image}{\relax#1}% + \ifnumcomp{\value{LWR@lateximagedepth}}{>}{0}% + {\LWR@origensuredmath{#1}}% + {% + \LWR@subsingledollar*{(math image)}{\LWR@HTMLsanitize{#1}}{% + \LWR@origensuredmath{#1}% + }% + }% \fi% }% } @@ -8180,7 +8293,40 @@ autopage-\theLWR@currentautosec% \let\enddisplaymath\relax \NewEnviron{math}{\expandafter\(\BODY\)} -\NewEnviron{displaymath}{\expandafter\[\BODY\]\@ignoretrue} +\NewEnviron{LWR@displaymathnormal}{\expandafter\[\BODY\]\@ignoretrue} + +\LetLtxMacro\[\LWR@openbracketnormal% +\LetLtxMacro\]\LWR@closebracketnormal% +\LetLtxMacro\displaymath\LWR@displaymathnormal% +\LetLtxMacro\enddisplaymath\endLWR@displaymathnormal% +\newenvironment{LWR@displaymathother} +{% + \begin{BlockClass}{displaymath}% + \LWR@newautoidanchor% + \booltrue{LWR@indisplaymathimage}% + \begin{lateximage}% + [(display math)]% + \LWR@origdollar\LWR@origdollar% +} +{% + \LWR@origdollar\LWR@origdollar% + \end{lateximage}% + \end{BlockClass}% +} +\newenvironment{LWR@equationother} +{% + \begin{BlockClass}{displaymathnumbered}% + \LWR@newautoidanchor% + \booltrue{LWR@indisplaymathimage}% + \begin{lateximage}% + [(display math)]% + \LWR@origequation% +} +{% + \LWR@origendequation% + \end{lateximage}% + \end{BlockClass}% +} \newcounter{LWR@nextequation} \newcommand*{\LWR@syncmathjax}{% @@ -8240,6 +8386,8 @@ autopage-\theLWR@currentautosec% } {% not mathjax \begin{BlockClass}{displaymathnumbered} + \LWR@newautoidanchor% + \booltrue{LWR@indisplaymathimage}% \begin{lateximage}[% (\LWR@equationtag) \textbackslash{begin\{equation\}} % extra space \LWR@HTMLsanitizeexpand{\detokenize\expandafter{\BODY}} % extra space @@ -8260,12 +8408,59 @@ autopage-\theLWR@currentautosec% ] +\LetLtxMacro\LWR@equationnormal\equation +\LetLtxMacro\LWR@endequationnormal\endequation + \csletcs{LWR@origequationstar}{equation*} \csletcs{LWR@origendequationstar}{endequation*} + \renewenvironment*{equation*} {\displaymath} {\enddisplaymath} +\csletcs{LWR@equationnormalstar}{equation*} +\csletcs{LWR@endequationnormalstar}{endequation*} + +\LetLtxMacro\LWR@equationless\equation +\LetLtxMacro\LWR@endequationless\endequation +\csletcs{LWR@equationlessstar}{equation*} +\csletcs{LWR@endequationlessstar}{endequation*} + +\newcommand*{\displaymathnormal}{% +\ifbool{LWR@origmathjax}{\booltrue{mathjax}}{\boolfalse{mathjax}}% +\LetLtxMacro\[\LWR@openbracketnormal% +\LetLtxMacro\]\LWR@closebracketnormal% +\LetLtxMacro\displaymath\LWR@displaymathnormal% +\LetLtxMacro\enddisplaymath\endLWR@displaymathnormal% +\LetLtxMacro\equation\LWR@equationnormal% +\LetLtxMacro\endequation\LWR@endequationnormal% +\csletcs{equation*}{LWR@equationnormalstar}% +\csletcs{endequation*}{LWR@endequationnormalstar}% +} + +\newcommand*{\displaymathother}{% +\boolfalse{mathjax}% +\LetLtxMacro\displaymath\LWR@displaymathother% +\LetLtxMacro\enddisplaymath\endLWR@displaymathother% +\LetLtxMacro\[\LWR@displaymathother% +\LetLtxMacro\]\endLWR@displaymathother% +\LetLtxMacro\equation\LWR@equationother% +\LetLtxMacro\endequation\endLWR@equationother% +\csletcs{equation*}{displaymath}% +\csletcs{endequation*}{enddisplaymath}% +} + +\end{warpHTML} + +\begin{warpprint} + +\newcommand*{\displaymathnormal}{} +\newcommand*{\displaymathother}{} + +\end{warpprint} + +\begin{warpHTML} + \newbool{LWR@amsmultline} \boolfalse{LWR@amsmultline} @@ -8328,7 +8523,9 @@ autopage-\theLWR@currentautosec% {% not mathjax \ifbool{LWR@numbereqnarray} { - \begin{BlockClass}{displaymathnumbered} + \begin{BlockClass}{displaymathnumbered}% + \LWR@newautoidanchor% + \booltrue{LWR@indisplaymathimage}% \begin{lateximage}[(\LWR@startingequationtag--\LWR@equationtag) \LWR@addmathjax{eqnarray}{\BODY}] \LWR@origeqnarray @@ -8339,6 +8536,8 @@ autopage-\theLWR@currentautosec% }% {% not LWR@numbereqnarray \begin{BlockClass}{displaymath} + \LWR@newautoidanchor% + \booltrue{LWR@indisplaymathimage}% \begin{lateximage}[\LWR@addmathjax{eqnarray*}{\BODY}] \LWR@origeqnarray \BODY @@ -8367,6 +8566,8 @@ autopage-\theLWR@currentautosec% } { \begin{BlockClass}{displaymathnumbered} + \LWR@newautoidanchor% + \booltrue{LWR@indisplaymathimage}% \begin{lateximage}[\LWR@amsmathbodynumbered{multline}] } } @@ -8393,6 +8594,8 @@ autopage-\theLWR@currentautosec% } { \begin{BlockClass}{displaymath} + \LWR@newautoidanchor + \booltrue{LWR@indisplaymathimage}% \begin{lateximage}[\LWR@amsmathbody{multline*}] } } @@ -8419,7 +8622,9 @@ autopage-\theLWR@currentautosec% \LWR@beginhideamsmath } { - \begin{BlockClass}{displaymathnumbered} + \begin{BlockClass}{displaymathnumbered} + \LWR@newautoidanchor% + \booltrue{LWR@indisplaymathimage}% \begin{lateximage}[\LWR@amsmathbodynumbered{gather}] } } @@ -8445,6 +8650,8 @@ autopage-\theLWR@currentautosec% } { \begin{BlockClass}{displaymath} + \LWR@newautoidanchor% + \booltrue{LWR@indisplaymathimage}% \begin{lateximage}[\LWR@amsmathbody{gather*}] } } @@ -8469,7 +8676,9 @@ autopage-\theLWR@currentautosec% \LWR@beginhideamsmath } { - \begin{BlockClass}{displaymathnumbered} + \begin{BlockClass}{displaymathnumbered} + \LWR@newautoidanchor% + \booltrue{LWR@indisplaymathimage}% \begin{lateximage}[\LWR@amsmathbodynumbered{align}] } } @@ -8495,6 +8704,8 @@ autopage-\theLWR@currentautosec% } { \begin{BlockClass}{displaymath} + \LWR@newautoidanchor% + \booltrue{LWR@indisplaymathimage}% \begin{lateximage}[\LWR@amsmathbody{align*}] } } @@ -8520,6 +8731,8 @@ autopage-\theLWR@currentautosec% } { \begin{BlockClass}{displaymathnumbered} + \LWR@newautoidanchor% + \booltrue{LWR@indisplaymathimage}% \begin{lateximage}[\LWR@amsmathbodynumbered{flalign}] } } @@ -8545,6 +8758,8 @@ autopage-\theLWR@currentautosec% } { \begin{BlockClass}{displaymath} + \LWR@newautoidanchor% + \booltrue{LWR@indisplaymathimage}% \begin{lateximage}[\LWR@amsmathbody{flalign*}] } } @@ -8560,6 +8775,60 @@ autopage-\theLWR@currentautosec% } +\BeforeBeginEnvironment{alignat}{ + +\ifboolexpr{bool{mathjax} or ( bool{FormatWP} and bool{WPMarkMath} ) }% +{ + \LWR@syncmathjax + \boolfalse{LWR@amsmultline} + \LWR@beginhideamsmath +} +{ + \begin{BlockClass}{displaymathnumbered} + \LWR@newautoidanchor% + \booltrue{LWR@indisplaymathimage}% + \begin{lateximage}[\LWR@amsmathbodynumbered{alignat}] +} +} + +\AfterEndEnvironment{alignat}{ + +\ifboolexpr{bool{mathjax} or ( bool{FormatWP} and bool{WPMarkMath} ) }% +{ + \LWR@endhideamsmath + \LWR@addmathjax{alignat}{\the\@envbody} +} +{\end{lateximage}\end{BlockClass}} + +} + +\BeforeBeginEnvironment{alignat*}{ + +\ifboolexpr{bool{mathjax} or ( bool{FormatWP} and bool{WPMarkMath} ) }% +{ + \LWR@syncmathjax + \boolfalse{LWR@amsmultline} + \LWR@beginhideamsmath +} +{ + \begin{BlockClass}{displaymath} + \LWR@newautoidanchor% + \booltrue{LWR@indisplaymathimage}% + \begin{lateximage}[\LWR@amsmathbody{alignat*}] +} +} + +\AfterEndEnvironment{alignat*}{ + +\ifboolexpr{bool{mathjax} or ( bool{FormatWP} and bool{WPMarkMath} ) }% +{ + \LWR@endhideamsmath + \LWR@addmathjax{alignat*}{\the\@envbody} +} +{\end{lateximage}\end{BlockClass}} + +} + \end{warpHTML} \begin{warpHTML} @@ -8583,43 +8852,36 @@ autopage-\theLWR@currentautosec% \begin{warpHTML} -\newcommand{\LWR@HTMLsanitize}[1]{% +\newrobustcmd{\LWR@HTMLsanitize}[1]{% \begingroup% \LWR@FBcancel% +\fullexpandarg% \protect\StrSubstitute{\detokenize{#1}}% -{\detokenize{&}}% -{\detokenize{&}}[\LWR@strresult]% +{\detokenize{&}}{\detokenize{&}}[\LWR@strresult]% +\protect\StrSubstitute{\detokenize\expandafter{\LWR@strresult}}% +{\detokenize{<}}{\detokenize{<}}[\LWR@strresult]% \protect\StrSubstitute{\detokenize\expandafter{\LWR@strresult}}% -{\detokenize{<}}% -{\detokenize{<}}% -[\LWR@strresult]% +{\detokenize{>}}{\detokenize{>}}[\LWR@strresult]% \protect\StrSubstitute{\detokenize\expandafter{\LWR@strresult}}% -{\detokenize{>}}% -{\detokenize{>}}% -[\LWR@strresult]% +{\detokenize{"}}{\detokenize{"}}[\LWR@strresult]% \protect\StrSubstitute{\detokenize\expandafter{\LWR@strresult}}% -{\detokenize{##}}% -{\#}% -[\LWR@strresult]% +{\detokenize{##}}{\LWR@origpound}[\LWR@strresult]% \LWR@strresult% \endgroup% } -\newcommand{\LWR@HTMLsanitizeexpand}[1]{% +\newrobustcmd{\LWR@HTMLsanitizeexpand}[1]{% \begingroup% \LWR@FBcancel% +\fullexpandarg% \protect\StrSubstitute{\detokenize\expandafter{#1}}% -{\detokenize{&}}% -{\detokenize{&}}% -[\LWR@strresult]% +{\detokenize{&}}{\detokenize{&}}[\LWR@strresult]% +\protect\StrSubstitute{\detokenize\expandafter{\LWR@strresult}}% +{\detokenize{<}}{\detokenize{<}}[\LWR@strresult]% \protect\StrSubstitute{\detokenize\expandafter{\LWR@strresult}}% -{\detokenize{<}}% -{\detokenize{<}}% -[\LWR@strresult]% +{\detokenize{>}}{\detokenize{>}}[\LWR@strresult]% \protect\StrSubstitute{\detokenize\expandafter{\LWR@strresult}}% -{\detokenize{>}}% -{\detokenize{>}}% -[\LWR@strresult]% +{\detokenize{"}}{\detokenize{"}}[\LWR@strresult]% \LWR@strresult% \endgroup% } @@ -8695,14 +8957,16 @@ autopage-\theLWR@currentautosec% \catcode`\$=\active% -\NewDocumentEnvironment{lateximage}{s O{image} O{}} +\NewDocumentEnvironment{lateximage}{s O{(image)} O{} O{}} {% \LWR@traceinfo{lateximage: starting on \jobname.pdf page \arabic{page}}% -\ifthenelse{\cnttest{\value{LWR@lateximagedepth}}{>}{0}}% +\LWR@traceinfo{lateximage: entering depth is \arabic{LWR@lateximagedepth}}% +\ifnumcomp{\value{LWR@lateximagedepth}}{>}{0}% {% - \addtocounter{LWR@lateximagedepth}{1}% + \global\advance\c@LWR@lateximagedepth 1\relax% Due to AmS \text macro. }% {% start of outer-most lateximage +\LWR@traceinfo{lateximage: starting outer-most lateximage}% \setcounter{LWR@startingequation}{\value{equation}}% \addtocounter{LWR@startingequation}{1}% \booltrue{LWR@isstartingequation}% @@ -8716,13 +8980,15 @@ autopage-\theLWR@currentautosec% \LWR@traceinfo{lateximage: LWR@externalfilecnt is \arabic{LWR@externalfilecnt}}% \setcounterpageref{LWR@LIpage}{LWRlateximage\arabic{LWR@lateximagenumber}}% \LWR@traceinfo{lateximage: LWR@LIpage is \arabic{LWR@LIpage}}% - \LWR@htmltag{span id="lateximage\arabic{LWR@lateximagenumber}" % + \LWR@htmltag{span id="lateximage\arabic{LWR@lateximagenumber}" % extra space class="lateximagesource"}% \LWR@traceinfo{lateximage: about to write to lateximages.txt}% \IfBooleanTF{#1}% starred {% hash - \LWR@traceinfo{lateximage: hash true}% - \edef\LWR@hashedname{\LWR@mdfive{\detokenize\expandafter{#2}}}% + \LWR@traceinfo{lateximage: hash true, adding !#2!#3!}% + \edef\LWR@hashedname{% + \LWR@mdfive{\detokenize\expandafter{#2}-!-#3}% + }% \LWR@traceinfo{lateximage: hash is \LWR@hashedname}% \immediate\write\LWR@lateximagesfile{% |\arabic{LWR@LIpage}|true|\LWR@hashedname|% @@ -8736,7 +9002,7 @@ autopage-\theLWR@currentautosec% }% no hash \LWR@traceinfo{lateximage: about to create open comment}% \LWR@htmlopencomment% - \addtocounter{LWR@lateximagedepth}{1}% + \addtocounter{LWR@lateximagedepth}{1}% \LWR@traceinfo{lateximage: about to create a new page}% \LWR@orignewpage% \LWR@traceinfo{lateximage: about to create minipage}% @@ -8754,16 +9020,29 @@ autopage-\theLWR@currentautosec% \catcode`\$=3% math shift \LetLtxMacro\(\LWR@origopenparen% \LetLtxMacro\)\LWR@origcloseparen% - \LetLtxMacro\[\LWR@origopenbracket% - \LetLtxMacro\]\LWR@origclosebracket% + \ifbool{LWR@indisplaymathimage}{}{% not in display math + \LetLtxMacro\[\LWR@origopenbracket% + \LetLtxMacro\]\LWR@origclosebracket% + \let\equation\LWR@origequation% + \let\endequation\LWR@origendequation% + \csletcs{equation*}{LWR@origequationstar}% + \csletcs{endequation*}{LWR@origendequationstar}% + }% not in display math + \LetLtxMacro\LWR@newsingledollar$% + \LetLtxMacro\LWR@newsingledollar$% syntax highlighting }% end of outer-most lateximage \LWR@traceinfo{lateximage: finished start of environment}% }% end of \begin{lateximage} {% start of \end{lateximage} -\LWR@traceinfo{lateximage: starting end of environment}% -\ifthenelse{\cnttest{\value{LWR@lateximagedepth}}{>}{1}}% -{\addtocounter{LWR@lateximagedepth}{-1}}% +\LWR@traceinfo{lateximage: starting end of lateximage}% +\LWR@traceinfo{lateximage: internal depth was \arabic{LWR@lateximagedepth}}% +\ifnumcomp{\value{LWR@lateximagedepth}}{>}{1}% +{% + \LWR@traceinfo{lateximage: unnesting}% + \global\advance\c@LWR@lateximagedepth -1\relax% +}% {% end of outer-most lateximage +\LWR@traceinfo{lateximage: ending outer-most lateximage}% \LWR@origendminipage% \LWR@orignewpage% \LWR@origscriptsize% @@ -8776,14 +9055,14 @@ autopage-\theLWR@currentautosec% {% lateximages\OSPathSymbol% \LWR@origmbox{\LWR@hashedname}% - }{svg}{#3}% + }{svg}{#4}% }% hash {% no hash \LWR@subinlineimage[#2]{lateximage}% {% lateximages\OSPathSymbol% \LWR@origmbox{lateximage-\theLWR@externalfilecnt}% - }{svg}{#3}% + }{svg}{#4}% }% no hash \LWR@ensuredoingapar% \LWR@htmltag{/span}% @@ -8792,6 +9071,7 @@ autopage-\theLWR@currentautosec% }{}% \addtocounter{LWR@lateximagedepth}{-1}% }% end of outer-most lateximage +\LWR@traceinfo{lateximage: exiting depth is \arabic{LWR@lateximagedepth}}% \LWR@traceinfo{lateximage: done}% }% \catcode`\$=3% math shift @@ -8799,7 +9079,7 @@ autopage-\theLWR@currentautosec% \begin{warpprint} -\NewDocumentEnvironment{lateximage}{s o o} +\NewDocumentEnvironment{lateximage}{s o o o} {\begin{varwidth}[b]{\linewidth}} {\end{varwidth}} @@ -8867,14 +9147,14 @@ autopage-\theLWR@currentautosec% \newrobustcmd{\LWR@siunitx@textdegree}{\HTMLentity{deg}} \newrobustcmd{\LWR@siunitx@textprime}{\HTMLunicode{2032}} \newrobustcmd{\LWR@siunitx@textdblprime}{\HTMLunicode{2033}} -\newrobustcmd{\LWR@siunitx@textplanckbar}{\text{\HTMLunicode{0127}}} +\newrobustcmd{\LWR@siunitx@textplanckbar}{\text{\textit{\HTMLunicode{0127}}}} -\appto\LWR@restoreorigformatting{ -\renewrobustcmd{\LWR@siunitx@textcelsius}{\text{\ensuremath{^\circ}C}} -\renewrobustcmd{\LWR@siunitx@textdegree}{\text{\ensuremath{^\circ}}} -\renewrobustcmd{\LWR@siunitx@textprime}{\text{\ensuremath{^\prime}}} -\renewrobustcmd{\LWR@siunitx@textdblprime}{\text{\ensuremath{^{\prime\prime}}}} -\renewrobustcmd{\LWR@siunitx@textplanckbar}{\text{\ensuremath{\hbar}}} +\appto\LWR@restoreorigformatting{% +\renewrobustcmd{\LWR@siunitx@textcelsius}{\text{\ensuremath{^\circ}C}}% +\renewrobustcmd{\LWR@siunitx@textdegree}{\text{\ensuremath{^\circ}}}% +\renewrobustcmd{\LWR@siunitx@textprime}{\text{\ensuremath{^\prime}}}% +\renewrobustcmd{\LWR@siunitx@textdblprime}{\text{\ensuremath{^{\prime\prime}}}}% +\renewrobustcmd{\LWR@siunitx@textplanckbar}{\text{\ensuremath{\hbar}}}% } \PassOptionsToPackage{ @@ -8994,7 +9274,7 @@ autopage-\theLWR@currentautosec% \LetLtxMacro\endfcolorminipage\endLWRprint@fcolorminipage% } -\appto{\LWR@restoreorigformatting}{% +\appto\LWR@restoreorigformatting{% \LWR@restoreorigprintxcolor% } \warpprintonly{\LWR@restoreorigprintxcolor} @@ -9004,6 +9284,20 @@ autopage-\theLWR@currentautosec% }% AtBeginDocument \end{warpall} +\begin{warpprint} + +\AtBeginDocument{ +\@ifpackageloaded{chemmacros}{ +\DeclareDocumentEnvironment{polymerdelims}{} + {}{} + +\DeclareDocumentEnvironment{redoxreaction}{m m} + {\rule{0pt}{#1}}{\rule[-#2]{0pt}{#2}} +}{}% chemmacros +}% AtBeginDocument + +\end{warpprint} + @@ -9480,7 +9774,7 @@ width:\LWR@printlength{\LWR@tempwidth}% \DeclareRobustCommand{\LWR@HTMLtextstyle}[3]{##3}% \def\(##1\){}% \def\[##1\]{}% -\renewcommand{\LWR@subsingledollar}[2]{} +\RenewDocumentCommand{\LWR@subsingledollar}{s m m m}{} } @@ -9550,6 +9844,17 @@ width:\LWR@printlength{\LWR@tempwidth}% {overline}{#1}% } +\newcommand*{\LWR@currenttextcolor}{black} +\newcommand*{\LWR@tempcolor}{} +\newcommand*{\LWR@tempcolortwo}{} +\newcommand*{\LWR@findcurrenttextcolor}{% +\renewcommand{\LWR@tempcolor}{black}% +} +\NewDocumentCommand{\LWR@textcurrentcolor}{m}{% + \renewcommand*{\LWR@currenttextcolor}{black}% + #1% +} + \end{warpHTML} @@ -9672,7 +9977,6 @@ width:\LWR@printlength{\LWR@tempwidth}% \RenewDocumentCommand{\enlargethispage}{s m}{} \renewcommand*{\clearpage}{} \renewcommand*{\cleardoublepage}{} -\newcommand*{\LWR@currenttextcolor}{black} \NewDocumentCommand{\LWR@rule}{o m m}{% \setlength{\LWR@tempwidth}{#2}% \ifthenelse{\lengthtest{\LWR@tempwidth=0pt}} |