diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/lwarp/lwarp.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/lwarp/lwarp.sty | 260 |
1 files changed, 81 insertions, 179 deletions
diff --git a/Master/texmf-dist/tex/latex/lwarp/lwarp.sty b/Master/texmf-dist/tex/latex/lwarp/lwarp.sty index a204cb86a25..bfb4dcebee8 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} - [2020/05/12 v0.86 Allows LaTeX to directly produce HTML5 output.] + [2020/06/03 v0.87 Allows LaTeX to directly produce HTML5 output.] @@ -26,6 +26,8 @@ \RequirePackage{iftex}[2019/11/07] +\RequirePackage{ifpdf} +\RequirePackage{ifptex} \newif\ifxetexorluatex @@ -152,6 +154,7 @@ \LWR@earlyloadnever{bitfield}{bytefield} \LWR@earlyloadnever{caption2}{caption} \LWR@earlyloadnever{colortab}{colortbl} +\LWR@earlyloadnever{csvtools}{datatool} \LWR@earlyloadnever{doublespace}{setspace} \LWR@earlyloadnever{epsf}{graphicx} \LWR@earlyloadnever{fancyheadings}{fancyhdr} @@ -256,6 +259,7 @@ \LWR@loadafter{chkfloat} \LWR@notmemoirloadafter{chngpage} \LWR@loadafter{cite} +\LWR@loadafter{citeref} \LWR@loadafter{cmdtrack} \LWR@loadafter{colonequals} \LWR@loadafter{color} @@ -278,6 +282,7 @@ \LWR@loadafter{draftcopy} \LWR@loadafter{draftfigure} \LWR@loadafter{draftwatermark} +\LWR@loadafter{drftcite} \LWR@loadafter{easy-todo} \LWR@loadafter{ebook} \LWR@loadafter{econometrics} @@ -374,6 +379,7 @@ \LWR@loadafter{imakeidx} \LWR@notmemoirloadafter{index} \LWR@loadafter{intopdf} +\LWR@loadafter{jurabib} \LWR@loadafter{karnaugh-map} \LWR@loadafter{keyfloat} \LWR@loadafter{layaureo} @@ -426,6 +432,7 @@ \LWR@notmemoirloadafter{moreverb} \LWR@notmemoirloadafter{movie15} \LWR@notmemoirloadafter{mparhack} +\LWR@loadafter{multibib} \LWR@loadafter{multicap} \LWR@loadafter{multicolrule} \LWR@loadafter{multimedia} @@ -548,6 +555,7 @@ \LWR@loadafter{soul} \LWR@loadafter{soulpos} \LWR@loadafter{soulutf8} +\LWR@loadafter{splitbib} \LWR@loadafter{splitidx} \LWR@loadafter{srcltx} \LWR@loadafter{srctex} @@ -1271,6 +1279,7 @@ \LWR@checkloadnever{#1}{caption2}{caption} \LWR@checkloadnever{#1}{ccaption}{caption}% might be preloaded by memoir \LWR@checkloadnever{#1}{colortab}{colortbl} +\LWR@checkloadnever{#1}{csvtools}{datatool} \LWR@checkloadnever{#1}{doublespace}{setspace} \LWR@checkloadnever{#1}{epsf}{graphicx} \LWR@checkloadnever{#1}{fancyheadings}{fancyhdr} @@ -4187,12 +4196,12 @@ page_compositor "." \begin{filecontents*}[overwrite]{lwarp_mathjax.txt} <script> // Lwarp MathJax emulation code +// // Based on code by Davide P. Cervone. -// Original code: https://github.com/mathjax/MathJax/issues/2313 -// Modified by Brian Dunn to adjust equation numbering, add subequations, -// and add starred macros. // Equation numbering: https://github.com/mathjax/MathJax/issues/2427 -// Starred macros: https://github.com/mathjax/MathJax/issues/2428 +// Starred and ifnextchar macros: https://github.com/mathjax/MathJax/issues/2428 +// +// Modified by Brian Dunn to adjust equation numbering and add subequations. // // LaTeX can use \seteqnumber{subequations?}{section}{number} before each equation. // subequations? is 0 usually, 1 if inside subequations. @@ -4207,10 +4216,8 @@ MathJax = { }, startup: { ready() { - // // These would be replaced by import commands if you wanted to make // a proper extension. - // const Configuration = MathJax._.input.tex.Configuration.Configuration; const CommandMap = MathJax._.input.tex.SymbolMap.CommandMap; const Macro = MathJax._.input.tex.Symbol.Macro; @@ -4218,170 +4225,65 @@ MathJax = { const ParseUtil = MathJax._.input.tex.ParseUtil.default; const expandable = MathJax._.util.Options.expandable; - // - // These are the names of the command maps: - // - const SETEQNUMBERMAP = 'seteqnumberCoreMap' ; - - // - // These functions implement the macros: - // - const seteqnumberFunction = (parser, name) => { - // Get the macro parameters - const star = parser.GetStar(); // true if there is a * - const optBrackets = parser.GetBrackets(name); // contents of optional brackets - const newsubequations = parser.GetArgument(name); // the subequations argument - const neweqsection = parser.GetArgument(name); // the eq section argument - const neweqnumber = parser.GetArgument(name); // the eq number argument - MathJax.config.subequations=newsubequations ; // a string with boolean meaning - MathJax.config.section=neweqsection ; // a string with numeric meaning - parser.tags.counter = parser.tags.allCounter = neweqnumber ; - }; - - // - // This is the configuration for the seteqnumberFunctionConfig TeX extension. - // - const seteqnumberFunctionConfig = Configuration.create('seteqnumberCore', { - // - // Initialize the extension by creating the command map, - // then append the command map to the given configuration as a macro handler. - // - init(config) { - const map = new CommandMap(SETEQNUMBERMAP,{},{}); - config.append( - Configuration.create( - 'seteqnumberDefs', - {handler: {macro: [SETEQNUMBERMAP]}} - ) - ); - }, - - // - // Add options (from the - // seteqnumberCore configuration object in the document's - // option list, if any). - // - config(config, jax) { - const map = jax.parseOptions.handlers.retrieve(SETEQNUMBERMAP); - const options = jax.parseOptions.options.seteqnumberCore; - for (const cs of Object.keys(options)) { - map.add(cs, new Macro(cs, seteqnumberFunction, options[cs])); - } - }, - - options: { - seteqnumberCore: expandable({}) - } - } - ); - - const IFSTARMAP = 'ifstarMap'; - - // - // This function implements an ifstar macro. - // - const IfstarFunction = (parser, name, resultstar, resultnostar) => { - // - // Get the macro parameters - // - const star = parser.GetStar(); // true if there is a * - // - // Construct the replacement string for the macro - // - const macro = [(star ? resultstar : resultnostar)].join(''); - // - // Insert the replacement string into the TeX string, and check - // that there haven't been too many maxro substitutions (prevents - // infinite loops). - // - parser.string = ParseUtil.addArgs(parser, macro, parser.string.slice(parser.i)); + // Insert the replacement string into the TeX string, and check + // that there haven't been too many maxro substitutions (prevents + // infinite loops). + const useArgument = (parser, text) => { + parser.string = ParseUtil.addArgs(parser, text, parser.string.slice(parser.i)); parser.i = 0; if (++parser.macroCount > parser.configuration.options.maxMacros) { throw new TexError('MaxMacroSub1', - 'MathJax maximum macro substitution count exceeded; ' + - 'is there a recursive macro call?'); + 'MathJax maximum macro substitution count exceeded; ' + + 'is there a recursive macro call?'); } - }; - - // - // This is the configuration for the IfstarConfiguration TeX extension. - // - const IfstarConfiguration = Configuration.create('Ifstar', { - // - // Initialize the extension by creating the command map for the - // macros defined by \DeclareIfstar, and add the - // \DeclareIfstar macro itself. Then append the - // command map to the given configuration as a macro handler - // - init(config) { - const map = new CommandMap(IFSTARMAP, { - DeclareIfstar: ['Declare_Ifstar'] - }, { - // - // Implements \DeclareIfstar control sequence. - // - Declare_Ifstar(parser, name) { - // - // Get the control sequence to define and the starred and - // non-starred macros to use. - // - let cs = ParseUtil.trimSpaces(parser.GetArgument(name)); - const resultstar = parser.GetArgument(name); - const resultnostar = parser.GetArgument(name); - // - // Check that the control sequence name is valid - // - if (cs.charAt(0) === '\\') cs = cs.substr(1); - if (!cs.match(/^(.|[a-z]+)$/i)) { //$ syntax highlighting - throw new TexError( - 'IllegalControlSequenceName', - 'Illegal control sequence name for %1', - name - ); - } - // - // Look up the command map and add the new macro to it using - // IfstarFunction as the function and passing it the - // given starred and non-starred macros. - // - const map = parser.configuration.handlers.retrieve(IFSTARMAP); - map.add(cs, new Macro(cs, IfstarFunction, [resultstar, resultnostar])); - } - }); - config.append( - Configuration.create('IfstarDefs', {handler: {macro: [IFSTARMAP]}}) - ); + } + + // Create the command map for \ifstar, \ifnextchar, \seteqnumber + new CommandMap('ifstar-ifnextchar-setequnumber', { + ifstar: 'IfstarFunction', + ifnextchar: 'IfnextcharFunction', + seteqnumber: 'SeteqnumberFunction' + }, { + // This function implements an ifstar macro. + IfstarFunction(parser, name) { + const resultstar = parser.GetArgument(name); + const resultnostar = parser.GetArgument(name); + const star = parser.GetStar(); // true if there is a * + useArgument(parser, star ? resultstar : resultnostar); }, - // - // Add any user-defined starred/non-starred macros (from the - // Ifstar configuration object in the document's - // option list), if any. - // - config(config, jax) { - const map = jax.parseOptions.handlers.retrieve(IFSTARMAP); - const starmacros = jax.parseOptions.options.Ifstar; - for (const cs of Object.keys(starmacros)) { - map.add(cs, new Macro(cs, IfstarFunction, starmacros[cs])); + // This function implements an ifnextchar macro. + IfnextcharFunction(parser, name) { + let whichchar = parser.GetArgument(name); + if (whichchar.match(/^(?:0x[0-9A-F]+|[0-9]+)$/i)) { + // $ syntax highlighting + whichchar = String.fromCodePoint(parseInt(whichchar)); } + const resultnextchar = parser.GetArgument(name); + const resultnotnextchar = parser.GetArgument(name); + const gotchar = (parser.GetNext() === whichchar); + useArgument(parser, gotchar ? resultnextchar : resultnotnextchar); }, - // - // Indicate that Ifstar is a valid option, and can have - // any number of definitions. The format is - // - // name: [starred, non-starred] - // - // where 'name' is the macro name, and starred and non-starred are the - // macros to use for the \name macro. You can include - // pre-defined macros here, which will be available without - // further configuration. - // - options: { - Ifstar: expandable({}) + // This function modifies the equation numbers. + SeteqnumberFunction(parser, name) { + // Get the macro parameters + const star = parser.GetStar(); // true if there is a * + const optBrackets = parser.GetBrackets(name); // contents of optional brackets + const newsubequations = parser.GetArgument(name); // the subequations argument + const neweqsection = parser.GetArgument(name); // the eq section argument + const neweqnumber = parser.GetArgument(name); // the eq number argument + MathJax.config.subequations=newsubequations ; // a string with boolean meaning + MathJax.config.section=neweqsection ; // a string with numeric meaning + parser.tags.counter = parser.tags.allCounter = neweqnumber ; } }); + // Create the ifstar-ifnextchar-setequnumber package + Configuration.create('ifstar-ifnextchar-setequnumber', { + handler: {macro: ['ifstar-ifnextchar-setequnumber']} + }); + MathJax.startup.defaultReady(); // For forward references: @@ -4401,10 +4303,7 @@ MathJax = { }, // startup tex: { - packages: {'[+]': ['seteqnumberCore', 'tagFormat', 'Ifstar']}, - seteqnumberCore: { - seteqnumber: [] // a user-defined macro - }, + packages: {'[+]': ['tagFormat', 'ifstar-ifnextchar-setequnumber']}, tags: "ams", tagFormat: { number: function (n) { @@ -4434,7 +4333,7 @@ MathJax = { -- Copyright 2016-2020 Brian Dunn -printversion = "v0.86" +printversion = "v0.87" requiredconfversion = "2" -- also at *lwarpmk.conf function printhelp () @@ -10915,14 +10814,6 @@ end -- not --version \providecommand{\glo@name}{} \end{warpall} \begin{warpHTML} -\def\bibliography#1{% - \if@filesw - \immediate\write\@auxout{\string\bibdata{#1}}% - \fi - \begingroup% - \@input@{\BaseJobname.bbl}% lwarp - \endgroup% -} \renewcommand{\@biblabel}[1]{[#1]\quad} \AtBeginDocument{ @@ -12810,6 +12701,13 @@ color:\LWR@origpound\LWR@tempcolor% \end{warpHTML} +\begin{warpall} + +\newbool{FixSmallCaps} +\boolfalse{FixSmallCaps} + +\end{warpall} + \begin{warpHTML} @@ -13061,7 +12959,9 @@ color:\LWR@origpound\LWR@tempcolor% \AtBeginDocument{\LWR@formatted{itshape}} \newrobustcmd*{\LWR@HTML@scshape}{% - \LWR@print@scshape% + \ifbool{FixSmallCaps}{}{% + \LWR@print@scshape% + }% \renewcommand*{\LWR@f@shapecaps}{sc}% } \AtBeginDocument{\LWR@formatted{scshape}} @@ -13079,7 +12979,9 @@ color:\LWR@origpound\LWR@tempcolor% \LetLtxMacro\sishape\scshape }{} \newrobustcmd*{\LWR@HTML@sishape}{% - \LWR@print@sishape% + \ifbool{FixSmallCaps}{}{% + \LWR@print@sishape% + }% \renewcommand*{\LWR@f@shape}{it} \renewcommand*{\LWR@f@shapecaps}{sc}% } @@ -13728,6 +13630,11 @@ color:\LWR@origpound\LWR@tempcolor% {Enclose its uses inside lateximage\MessageBreak environments to force SVG output} \LWR@mathjaxwarn{jkmath}{} + \LWR@mathjaxwarn{mathtools} + {See the Lwarp manual regarding the disallowspaces\MessageBreak + and showonlyrefs options, the alignat environment,\MessageBreak + and \protect\DeclarePairedDelimiter\space and related% + } \LWR@mathjaxwarn{mathspec}{} \LWR@mathjaxwarn{multirow} {Multirow works as expected in text mode, but\MessageBreak @@ -13737,11 +13644,6 @@ color:\LWR@origpound\LWR@tempcolor% \LWR@mathjaxwarn{pb-diagram} {Enclose its uses inside lateximage environments\MessageBreak to force SVG output} - \LWR@mathjaxwarn{physics} - {The third-party extension is not used.\MessageBreak - Avoid automatic delimiters.\MessageBreak - Use all mandatory arguments, adding empty as needed.\MessageBreak - See the Lwarp manual for details} \LWR@mathjaxwarn{unicode-math} {Not all characters are encoded correctly.\MessageBreak Some symbol fonts are not supported by MathJax,\MessageBreak |