summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/lwarp/lwarp.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/lwarp/lwarp.sty')
-rw-r--r--Master/texmf-dist/tex/latex/lwarp/lwarp.sty150
1 files changed, 106 insertions, 44 deletions
diff --git a/Master/texmf-dist/tex/latex/lwarp/lwarp.sty b/Master/texmf-dist/tex/latex/lwarp/lwarp.sty
index 66aaf534644..6e3518fcccb 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}
- [2022/02/01 v0.903 Allows LaTeX to directly produce HTML5 output.]
+ [2022/03/09 v0.904 Allows LaTeX to directly produce HTML5 output.]
@@ -512,6 +512,7 @@
\LWR@loadafter{lips}
\LWR@loadafter{listings}
\LWR@loadafter{listliketab}
+\LWR@loadafter{lltjp-siunitx}
\LWR@loadafter{lltjp-tascmac}
\LWR@loadafter{longtable}
\LWR@loadafter{lpic}
@@ -2485,7 +2486,7 @@ span.textnormal, div.textnormal {
font-variant: normal;
font-variant-numeric: normal ;
font-family: "DejaVu Serif", "Bitstream Vera Serif",
- "Lucida Bright", Georgia, serif;
+ "Lucida Bright", Georgia, serif;
}
span.textmd, div.textmd { font-weight: normal; }
@@ -4681,12 +4682,13 @@ MathJax = {
}
// Create the command map for:
- // \ifstar, \ifnextchar, \ifblank, \ifstrequal, \seteqnumber
+ // \ifstar, \ifnextchar, \ifblank, \ifstrequal, \gsub, \seteqnumber
new CommandMap('Lwarp-macros', {
ifstar: 'IfstarFunction',
ifnextchar: 'IfnextcharFunction',
ifblank: 'IfblankFunction',
ifstrequal: 'IfstrequalFunction',
+ gsubstitute: 'GsubstituteFunction',
seteqnumber: 'SeteqnumberFunction'
}, {
// This function implements an ifstar macro.
@@ -4729,6 +4731,15 @@ MathJax = {
useArgument(parser, isequal ? resultequal : resultnotequal);
},
+ // This function implements a gsub macro.
+ GsubstituteFunction(parser, name) {
+ const gsubfirst = parser.GetArgument(name);
+ const gsubsecond = parser.GetArgument(name);
+ const gsubthird = parser.GetArgument(name);
+ let gsubresult=gsubfirst.replace(gsubsecond, gsubthird);
+ useArgument(parser, gsubresult);
+ },
+
// This function modifies the equation numbers.
SeteqnumberFunction(parser, name) {
// Get the macro parameters
@@ -4829,7 +4840,7 @@ MathJax = {
<script
id="MathJax-script"
- src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js"
+ src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js"
></script>
\end{filecontents*}
\end{LWRwriteconf}
@@ -4843,7 +4854,7 @@ MathJax = {
-- Copyright 2016-2022 Brian Dunn
-printversion = "v0.903"
+printversion = "v0.904"
requiredconfversion = "2" -- also at *lwarpmk.conf
function printhelp ()
@@ -5976,6 +5987,18 @@ end -- not --version
\end{warpall}
+\begin{warpHTML}
+
+\StartDefiningTabulars
+\protected\gdef&{%
+ \PackageWarning{lwarp}{%
+ An ampersand is being used inside a tabular\MessageBreak
+ }%
+}%
+\StopDefiningTabulars
+
+\end{warpHTML}
+
\begin{warpall}
\newbool{LWR@dynamicmath}
\boolfalse{LWR@dynamicmath}
@@ -5992,13 +6015,41 @@ end -- not --version
\begin{warpHTML}
+
\let\LWR@origampersand\&
+
+\newrobustcmd*{\LWR@fontfortags}[1]{%
+ \ifmmode%
+ \PackageError{lwarp}%
+ {%
+ An HTML tag was generated inside math.\MessageBreak
+ This should never occur.\MessageBreak
+ Something is broken in Lwarp%
+ }%
+ {(Using #1.)}%
+ \else%
+ \ifdef{\romanencoding}%
+ {%
+ \romanencoding{\encodingdefault}%
+ }%
+ {%
+ \ifdef{\latintext}
+ {\latintext}
+ {\fontencoding\encodingdefault}%
+ }%
+ \LWR@print@normalfont%
+ \LWR@origttfamily%
+ \fi%
+}
+
\newcommand*{\HTMLentity}[1]{%
-\begingroup%
-\LWR@hook@processingtags%
-\LWR@origampersand#1;%
-\endgroup%
+ \begingroup%
+ \LWR@hook@processingtags%
+ \LWR@fontfortags{HTMLentity}%
+ \protect\LWR@origampersand\LWR@isolate{#1};%
+ \endgroup%
}
+
\newcommand*{\HTMLunicode}[1]{\HTMLentity{\LWR@origpound{}x#1}}
\renewrobustcmd*{\&}{\HTMLentity{amp}}
@@ -6368,7 +6419,7 @@ end -- not --version
\LWR@traceinfo{LWR@htmltagc !\detokenize{#1}!}%
\begingroup%
\LWR@hook@processingtags%
- \ifmmode\else\protect\LWR@print@normalfont\protect\LWR@origttfamily\fi%
+ \LWR@fontfortags{LWR@htmltagc}%
\protect\LWR@origtextless%
\LWR@isolate{#1}%
\protect\LWR@origtextgreater%
@@ -6471,7 +6522,7 @@ end -- not --version
\newcommand*{\LWR@htmlopencomment}{%
\begingroup%
\LWR@hook@processingtags%
- \ifmmode\else\protect\LWR@print@normalfont\protect\LWR@origttfamily\fi%
+ \LWR@fontfortags{LWR@htmlopencomment}%
\LWR@print@mbox{\LWR@origtextless{}!-\/-}%
\endgroup%
}
@@ -6479,7 +6530,7 @@ end -- not --version
\newcommand*{\LWR@htmlclosecomment}{%
\begingroup%
\LWR@hook@processingtags%
- \ifmmode\else\protect\LWR@print@normalfont\protect\LWR@origttfamily\fi%
+ \LWR@fontfortags{LWr@htmlclosecomment}%
\LWR@print@mbox{-\/-\LWR@origtextgreater}%
\endgroup%
}
@@ -9406,10 +9457,6 @@ end -- not --version
\LWR@formatted{LWR@parsenormalcolumn}
-\newcommand*{\LWR@parsewcolumn}[1]{%
- \LWR@columnspeclookahead{1}%
- \expandafter\LWR@parsenormalcolumn\expandafter{\LWR@strresulttwo}%
-}
\newcommand*{\LWR@parsestarcolumn}[1]{}
@@ -9479,21 +9526,24 @@ end -- not --version
\LWR@modifycolumntype{b}{1}{LWR@parsenormalcolumn}
{LWR@printmccoltype@normal}{LWR@printmccoldata@paragraph}
-\LWR@modifycolumntype{w}{2}{LWR@parsewcolumn}
- {LWR@printmccoltype@normal}{LWR@printmccoldata@normal}
-
-\LWR@modifycolumntype{W}{2}{LWR@parsewcolumn}
- {LWR@printmccoltype@normal}{LWR@printmccoldata@normal}
\LWR@modifycolumntype{*}{2}{LWR@parsestarcolumn}
{LWR@printmccoltype@ignore}{LWR@printmccoldata@skip}
-\NewDocumentCommand{\HTMLnewcolumntype}{m O{0} m}{%
- \expandafter\newcommand\expandafter*%
- \csname LWR@HTML@NC@rewrite@#1\endcsname[#2]{\NC@find #3}%
- \LWR@formatted{NC@rewrite@#1}%
+\NewDocumentCommand{\HTMLnewcolumntype}{m O{0} o m}{%
+ \IfValueTF{#3}
+ {
+ \expandafter\newcommand\expandafter*%
+ \csname LWR@HTML@NC@rewrite@#1\endcsname[#2][#3]{\NC@find #4}%
+ \LWR@formatted{NC@rewrite@#1}%
+ }
+ {
+ \expandafter\newcommand\expandafter*%
+ \csname LWR@HTML@NC@rewrite@#1\endcsname[#2]{\NC@find #4}%
+ \LWR@formatted{NC@rewrite@#1}%
+ }
}
\end{warpHTML}
\begin{warpprint}
-\NewDocumentCommand{\HTMLnewcolumntype}{m O{0} m}{}
+\NewDocumentCommand{\HTMLnewcolumntype}{m O{0} o m}{}
\end{warpprint}
\begin{warpHTML}
\newcommand*{\LWR@parsetablecols}[1]{%
@@ -12136,8 +12186,8 @@ end -- not --version
\renewcommand*{\$}{%
\ifnumcomp{\value{LWR@lateximagedepth}}{>}{0}%
- {\LWR@origtextdollar}%
- {\HTMLunicode{00024}}%
+ {\LWR@origtextdollar}%
+ {\HTMLunicode{00024}}%
}
\AtBeginDocument{
@@ -13249,6 +13299,7 @@ end -- not --version
+
\begin{warpHTML}
\newrobustcmd{\LWR@siunitx@textcelsius}{\HTMLentity{deg}C}
@@ -13265,18 +13316,13 @@ end -- not --version
\renewrobustcmd{\LWR@siunitx@textplanckbar}{\text{\ensuremath{\hbar}}}%
}
-\PassOptionsToPackage{
- detect-mode=true,
- per-mode=symbol, % fraction is not seen by pdftotext
- text-celsius = {\LWR@siunitx@textcelsius},
- text-degree = {\LWR@siunitx@textdegree},
- text-arcminute = {\LWR@siunitx@textprime} ,
- text-arcsecond = {\LWR@siunitx@textdblprime} ,
-}{siunitx-v2}
-
\end{warpHTML}
\begin{warpprint}
+\NewDocumentCommand{\HTMLDeclareSIUnit}{o +m m}{}
+\end{warpprint}
+
+\begin{warpprint}
\define@key{Gin}{class}{}
\AtBeginDocument{
\IfPackageLoadedTF{overpic}{
@@ -13905,8 +13951,13 @@ color:\LWR@origpound\LWR@tempcolor%
\LWR@HTML@mdseries%
\LWR@HTML@rmfamily%
\LWR@HTML@upshape%
+ \LWR@HTML@ulcshape%
\InlineClass(%
- font-weight:normal; font-family:serif; font-style:normal
+ font-weight: normal;
+ font-family: serif;
+ font-style: normal;
+ font-variant: normal;
+ font-variant-numeric: normal ;
){textnormal}{#1}%
}
@@ -13948,13 +13999,22 @@ color:\LWR@origpound\LWR@tempcolor%
}%
{%
\addtocounter{LWR@textcurrentfontdepth}{1}%
- \InlineClass{%
- text\LWR@f@family\LWR@origtilde{}%
- text\LWR@f@series\LWR@origtilde{}%
- text\LWR@f@shape\LWR@origtilde{}%
- text\LWR@f@shapecaps%
+ \ifboolexpr{%
+ test {\ifdefstring{\LWR@f@family}{rm}} and
+ test {\ifdefstring{\LWR@f@series}{md}} and
+ test {\ifdefstring{\LWR@f@shape}{up}} and
+ test {\ifdefstring{\LWR@f@shapecaps}{ulc}}
+ }%
+ {\InlineClass{textnormal}{#1}}%
+ {%
+ \InlineClass{%
+ text\LWR@f@family\LWR@origtilde{}%
+ text\LWR@f@series\LWR@origtilde{}%
+ text\LWR@f@shape\LWR@origtilde{}%
+ text\LWR@f@shapecaps%
+ }%
+ {#1}%
}%
- {#1}%
\addtocounter{LWR@textcurrentfontdepth}{-1}%
}%
}
@@ -14122,6 +14182,7 @@ color:\LWR@origpound\LWR@tempcolor%
\newcommand*{\LWR@currenttextcolor}{black}
\newcommand*{\LWR@tempcolor}{}
\newcommand*{\LWR@tempcolortwo}{}
+\newcommand*{\LWR@tempcolorthree}{}
\newcommand*{\LWR@findcurrenttextcolor}{%
\renewcommand{\LWR@tempcolor}{000000}%
}
@@ -14833,6 +14894,7 @@ color:\LWR@origpound\LWR@tempcolor%
\LWR@forceSVGmessage{xy}}
}{}
}
+
\endinput
%%
%% End of file `lwarp.sty'.