diff options
Diffstat (limited to 'Master/texmf-dist/source')
-rw-r--r-- | Master/texmf-dist/source/latex/lwarp/lwarp.dtx | 1946 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/lwarp/lwarp.ins | 11 |
2 files changed, 1532 insertions, 425 deletions
diff --git a/Master/texmf-dist/source/latex/lwarp/lwarp.dtx b/Master/texmf-dist/source/latex/lwarp/lwarp.dtx index 4c75ba4c6a1..7d6037ecbe8 100644 --- a/Master/texmf-dist/source/latex/lwarp/lwarp.dtx +++ b/Master/texmf-dist/source/latex/lwarp/lwarp.dtx @@ -16,7 +16,7 @@ % \iffalse %<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01] %<package>\ProvidesPackage{lwarp} -%<package> [2018/02/19 v0.49 Allows LaTeX to directly produce HTML5 output.] +%<package> [2018/03/03 v0.50 Allows LaTeX to directly produce HTML5 output.] % %<*driver> \documentclass{ltxdoc} @@ -132,12 +132,6 @@ \usepackage{comment} \excludecomment{testing} - -% \usepackage{morefloats} -% \usepackage{marginfix} - - - \usepackage{tocloft} \renewcommand{\cftpartfont}{\Large\bfseries} \setlength{\cftsecnumwidth}{2.5em} @@ -271,14 +265,14 @@ Keywords={LaTeX, HTML, conversion}% \providerobustcmd*{\lmacro}[1]{\textbackslash#1} -\providerobustcmd*{\cmds}[1]{\texttt{#1}} -\providerobustcmd*{\env}[1]{\texttt{#1}} -\providerobustcmd*{\ctr}[1]{\texttt{#1}} -\providerobustcmd*{\pkg}[1]{\textsf{#1}} -\providerobustcmd*{\prog}[1]{\textsf{#1}} -\providerobustcmd*{\progcode}[1]{\texttt{#1}} -\providerobustcmd*{\optn}[1]{\texttt{#1}} -\providerobustcmd*{\filenm}[1]{\texttt{#1}} +\providerobustcmd*{\cmds}[1]{\mbox{\texttt{#1}}} +\providerobustcmd*{\env}[1]{\mbox{\texttt{#1}}} +\providerobustcmd*{\ctr}[1]{\mbox{\texttt{#1}}} +\providerobustcmd*{\pkg}[1]{\mbox{\textsf{#1}}} +\providerobustcmd*{\prog}[1]{\mbox{\textsf{#1}}} +\providerobustcmd*{\progcode}[1]{\mbox{\texttt{#1}}} +\providerobustcmd*{\optn}[1]{\mbox{\texttt{#1}}} +\providerobustcmd*{\filenm}[1]{\mbox{\texttt{#1}}} \providerobustcmd*{\brand}[1]{\textsc{#1}} @@ -287,6 +281,8 @@ Keywords={LaTeX, HTML, conversion}% \newrobustcmd{\attribute}[1]{\texttt{#1}} \newrobustcmd{\UI}[1]{\textbf{\textsf{#1}}} +\newrobustcmd{\supregistered}{\textsuperscript{\textregistered}} + \newrobustcmd{\TOC}{\acro{TOC}} \newrobustcmd{\LOF}{\acro{LOF}} \newrobustcmd{\LOT}{\acro{LOT}} @@ -422,6 +418,21 @@ Green-colored tags in the left margin show which sections of source code apply to the generation of \HTML, print, or both forms of output. } +\newcommand{\limitssectioningmath}{% +When using \SVG\ math in sectioning commands, \watchout[math in \cs{section}] +use \cs{(} and \cs{)} to delimit math +instead of \$: +\begin{sourcedisplay} +\cs{section}\{Section name with math \cs{(}1+2=3\cs{)}\} +\end{sourcedisplay} +\index{section>math in heading} +\index{math>in section heading} +} + +\newcommand{\limitssectioning}{% +\limitssectioningmath +} + \newcommand{\limitscpageref}{\pkg{cleveref} and \pkg{varioref} are supported, \watchout[\pkg{cleveref} page numbers] but printed page numbers do not map to \HTML, @@ -460,7 +471,7 @@ automatically load \pkg{backref}, so \pkg{backref} must be loaded explicitly. If using the \optn{number} option with file splits, \watchout[missing \acro{TOC}] be sure to place the table of contents before the abstract. -The number option causes a section break which +The \optn{number} option causes a section break which may cause a file split, which would put a table of contents out of the home page if it is after the abstract. } @@ -480,9 +491,9 @@ See \cref{sec:publishedsubtitle}. } \newcommand{\limitsappendix}{% -During \HTML\ conversion, the option \texttt{toc} without +During \HTML\ conversion, the option \optn{toc} without \watchout[incorrect \acro{TOC} link] -the option \texttt{page} results in a \acro{TOC} link to +the option \optn{page} results in a \acro{TOC} link to whichever section was before the \texttt{appendices} environment. It is recommended to use both \texttt{toc} and also \texttt{page} at the same time. } @@ -678,7 +689,7 @@ Some \pkg{textcomp} symbols do not have Unicode equivalents, and thus are not supported. Many \pkg{textcomp} symbols are not supported by many fonts. -\watchout[Missing symbols] +\watchout[missing symbols] Try using more complete fonts in the \CSS, but expect to see gaps in coverage. } @@ -842,22 +853,18 @@ Math may be rendered as \SVG\ graphics or using the \brand{MathJax} JavaScript display engine. \index{JavaScript>MathJax} -In its current implementation, -\margintag{SVG files} -rendering math as images creates a new \SVG\ file for each expression. -In text with many references to math variables, -this can result in a large number of files with -duplicate content. -In the future, some method of content-based naming and check-summing -may be used to remove the need for duplicate files. - -Another approach could be -\margintag{SVG inline} -to in-line the \SVG\ files directly into the \HTML. +Rendering math as images creates a new \SVG\ file for each expression, \margintag{SVG files} +except that an MD5 hash is used to combine identical duplicates of the same +inline math expression into a single file, which must be converted to \SVG\ only once. +Display math is still handled as individual files, since it may contain labels +or references which are likely to change. + +The \SVG\ images are currently stored separately, \margintag{SVG inline} +but they could be encoded in-line directly into the \HTML\ document. This may reduce the number of files and potentially speed loading the images, but slows the display of the rest of the document before the images are loaded. -Others converters have used \PNG\ files, +Others \LaTeX-to-\HTML\ converters have used \PNG\ files, \margintag{PNG files} sometimes pre-scaled for print resolution but displayed on-screen at a scaled down size. This allows high-quality print output at the expense @@ -946,7 +953,7 @@ Limitations when using \brand{MathJax} include: \margintag{footnotes in math} \item Math appearing inside a lateximage, \margintag{lateximage} - and therefore also inside a \tikz{} or \env{picture} + and therefore also inside a \tikz\ or \env{picture} environment, is rendered as SVG math even if \brand{MathJax} is used in the rest of the document. \item Usage of \pkg{siunitx} inside a math equation \margintag{siunitx} @@ -1007,7 +1014,7 @@ are ignored. \index{equation>miss-numbered}% \index{split>miss-numbered}% \index{AMSmath>split miss-numbered} -when the option \texttt{thref} is used. \pkg{lwarp} does not share +when the option \optn{thref} is used. \pkg{lwarp} does not share this bug, so equations with \cs{split}, etc, are numbered correctly with \pkg{lwarp}'s \HTML\ output, but not with the print output. It is recommended to use \pkg{cleveref} instead of \pkg{ntheorem}'s @@ -1029,7 +1036,7 @@ a \texttt{.svg}, \texttt{.png}, or \texttt{.jpg} version of the same image. \cs{includegraphics}\{filename\} \% print:.pdf, HTML:.svg or other \end{sourcedisplay} For print output, \pkg{lwarp} will automatically choose the \texttt{.pdf} if available, -other some other format otherwise. +or some other format otherwise. For \HTML, one of the other formats is used instead. \DescribeProgram{pdftocairo} @@ -1099,6 +1106,8 @@ ugly results for scaling and rotating. } \newcommand{\limitssvgimages}{% +\limitssectioningmath + When a math expression, \texttt{picture}, or \tikz\ environment is added or \watchout[Adding/removing] removed, the \SVG\ images must be re-created with \texttt{lwarpmk limages} @@ -1116,9 +1125,10 @@ Expressing math as \SVG\ images has the advantage of representing the math exactly as \LaTeX\ would, but has the disadvantage of requiring an individual file for each math expression. \watchout[Lots of files!] -There is no attempt at -reusing the same file each time the same expression occurs, so each -time \texttt{\$x\$} is used, for example, yet another file is created. +For inline math, \pkg{lwarp} uses an MD5 hash on its \LaTeX\ source +to combine multiple instances of identical inline expressions into a single image file, +but display math and other environments such as \env{picture} and \tikz\ require +one image file each. For a document with a large amount of math, see \cref{sec:tutorialmathjax} to use \brand{MathJax} instead. } @@ -1757,11 +1767,11 @@ Possible solutions include: } \newcommand{\limitskeyfloat}{% -If placing a \cs{keyfig}[H] inside a \env{keywrap}, +If placing a \cs{keyfig}\texttt{[H]} inside a \env{keywrap}, \watchout[\env{keywrap}] use an absolute width for \cs{keyfig}, instead of \texttt{lw}-proportional widths. -(The [H] option forces the use of a minipage, which internally adjusts for +(The \optn{[H]} option forces the use of a minipage, which internally adjusts for a virtual 6-inch wide minipage, which then corrupts the \optn{lw} option.) } @@ -1782,7 +1792,7 @@ of this extension is created first.} \newcommand{\limitsnicefrac}{% \pkg{units} and \pkg{nicefrac} work as-is with \pkg{lwarp}, but \brand{MathJax} does not have an extension for \pkg{units} or \pkg{nicefrac}. -These packages do work with \pkg{lwarp}'s option \texttt{svgmath}. +These packages do work with \pkg{lwarp}'s option \optn{svgmath}. } @@ -1915,7 +1925,7 @@ This boolean may be tested by the user for later use. %<*package> % \fi % -% \CheckSum{21061} +% \CheckSum{21481} % % \CharacterTable % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z @@ -2006,6 +2016,7 @@ This boolean may be tested by the user for later use. % \changes{v0.47}{2018/01/30}{\ 2018/01/30} % \changes{v0.48}{2018/02/14}{\ 2018/02/14} % \changes{v0.49}{2018/02/19}{\ 2018/02/19} +% \changes{v0.50}{2018/03/03}{\ 2018/03/03} @@ -2199,6 +2210,37 @@ This boolean may be tested by the user for later use. % For a detailed list of changes, see the Change History on page \pageref{sec:changehistory}. % % \begin{description} +% \item[v0.50:] \ +% \begin{itemize} +% \item \SVG\ math and other \env{lateximage}s now are +% converted to \SVG\ using \margintag{\SVG\ math} +% parallel background tasks, utilizing all available \acro{CPU} cores. +% \item Inline \SVG\ math image file names now are MD5 hashes made from +% their source \LaTeX\ code. +% Identical inline math expressions, such as multiple instance of \$x\$, +% now share a single image file. +% This reduces the number of images to store, transmit, process, and display. +% Each image file is only converted to \SVG\ a single time, and reused if it +% already exists. +% Display math and other forms of \SVG\ image such as \env{picture} and +% \tikz\ still use individual image files which are recreated each time +% |lwarpmk limages| is run. +% \item Fixes: SVG math and/or \cs{underline} in a sectioning file name. +% \item Improved \SVG\ display math and tags. +% \item Improved \SVG\ math and \pkg{siunitx} \attribute{alt} tags. +% \item Improved \pkg{siunitx} units. +% \item Fix: \cs{ensuremath} with MathJax now creates a \env{lateximage}. +% \item Fix: \cs{centering}, etc. in \SVG\ math, \env{lateximage}, \tikz. +% \item Fix: Made various macros robust, +% additionally fixing \pkg{authblk}.\margintag{misc. fixes} +% \item Fix: \pkg{ntheorem} if neither \optn{standard} nor \optn{amsthm} selected. +% \item Fix: \pkg{listings}: Improved column alignment. +% \item Fix: Load \pkg{fontspec} if necessary. +% \item Added \pkg{xy}, \pkg{epstopdf}, \pkg{diagbox}, \pkg{pbox}, \margintag{packages} +% \pkg{bytefield}, \pkg{axodraw2}, \pkg{phfqit}, +% \pkg{schemata}, +% \pkg{dblfloatfix}, \pkg{nonfloat}, \pkg{morefloats}. +% \end{itemize} % \item[v0.49:] \ % \begin{itemize} % \item Added \pkg{xcolor} \cs{rowcolors}.\margintag{tabular} @@ -2211,6 +2253,7 @@ This boolean may be tested by the user for later use. % \pkg{lineno}, \pkg{fnlineno}, \pkg{figsize}, \pkg{hypdestopt}, \pkg{pagegrid}, % \pkg{pdfrender}, \pkg{luacolor}, \pkg{resizegather}. % \end{itemize} +% \needspace{2\baselineskip} % \item[v0.48:] \ % \begin{itemize} % \item Added some documentation @@ -2265,7 +2308,7 @@ This boolean may be tested by the user for later use. % \needspace{2\baselineskip} % \item[v0.45:] \ % \begin{itemize} -% \item Improved MikTeX install instructions.\margintag{docs} +% \item Improved \prog{MikTeX} install instructions.\margintag{docs} % \item Improved graphics and \pkg{epstopdf} instructions. % \item Updates to the \nameref{sec:introduction}. % \item Added \pkg{memoir}, \pkg{memhfixc}. @@ -2365,7 +2408,7 @@ This boolean may be tested by the user for later use. % marks around minipages, at the table of contents, % at the \acro{LOF} and \acro{LOT}, and whether to % print math as \LaTeX\ source for copy/paste into the -% LibreOffice Writer TeXMaths extension. +% \prog{LibreOffice Writer TeXMaths} extension. % \item Improved formatting for numerous objects. % See \cref{sec:wordprocessorconversion}. % \end{itemize} @@ -2615,7 +2658,7 @@ This boolean may be tested by the user for later use. % and while also using the |&| character inside the definition. % This may include the use inside conditional expressions. % \item Several math environments were incorrectly placed inline. -% Also, for \pkg{amsmath} with \SVG\ math, the |fleqn| option has been removed, +% Also, for \pkg{amsmath} with \SVG\ math, the \optn{fleqn} option has been removed, % resulting in improved spacing for aligned equations. % \item Bug fixes; see the changelog. % \end{itemize} @@ -2643,7 +2686,7 @@ This boolean may be tested by the user for later use. % \end{sourcedisplay} % % The \pkg{lwarp} package now produces the configuration files during -% print output, and also accepts the option |lwarpmk| if desired. +% print output, and also accepts the option \optn{lwarpmk} if desired. % % \item A number of macros % \watchout[HTML setup changes.] @@ -2693,7 +2736,7 @@ This boolean may be tested by the user for later use. % \item The old file |lwarp_html.xdy| may be deleted. % \end{enumerate} % -% \item The new \pkg{lwarp} package option |xdyFilename| may be used to tell +% \item The new \pkg{lwarp} package option optn{xdyFilename} may be used to tell % \prog{lwarpmk} to use a custom |.xdy| file instead of |lwarp.xdy|. % See \cref{sec:modifyxindy}. % @@ -2703,7 +2746,7 @@ This boolean may be tested by the user for later use. % as well as glossary. % \item Print mode without \prog{latexmk} now uses \prog{xindy} instead of \prog{makeindex}. % \item \prog{texindy}/\prog{xindy} usage depends on \prog{pdflatex} vs \prog{xelatex}, \prog{lualatex}. -% \item For \prog{pdflatex} and \prog{texindy}, the |-C utf8| option is used. This is +% \item For \prog{pdflatex} and \prog{texindy}, the \optn{-C utf8} option is used. This is % supported in modern distributions, but a customized |lwarpmk.lua| may % need to be created for use with older distributions. % \end{itemize} @@ -2714,9 +2757,9 @@ This boolean may be tested by the user for later use. % % \item[v0.29:] \ % \begin{itemize} -% \item Add: |lwarpmklang| option for \pkg{lwarp-newproject} and \pkg{lwarp}. +% \item Add: \optn{lwarpmklang} option for \pkg{lwarp-newproject} and \pkg{lwarp}. % Sets the language to use while processing the glossary. -% (As of v0.30, this has been changed to the |IndexLanguage| option.) +% (As of v0.30, this has been changed to the \optn{IndexLanguage} option.) % \item Fix: \cs{includegraphics} when no optional arguments. % \end{itemize} % \item[v0.28:] \ @@ -2834,7 +2877,7 @@ This boolean may be tested by the user for later use. % ^^A \item \pkg{lwarp} now tries to auto-detect the operating system, % ^^A and \cs{warpOSwindows} is only needed if the auto-detection % ^^A fails to detect \brand{Windows}. (As of v0.30, \cs{warpOSwindows} has been converted to -% ^^A the |OSWindows| option.) +% ^^A the \optn{OSWindows} option.) % ^^A \item Tabular column types |@|, |>|, and |<| are now supported. % ^^A \item |BlockClass| and \cs{InlineClass} add an optional style. % ^^A \item The |sidebar| and |example| environments have been moved to the @@ -2843,7 +2886,7 @@ This boolean may be tested by the user for later use. % ^^A \needspace{2\baselineskip} % ^^A \item[v0.19:] \ % ^^A \begin{itemize} -% ^^A \item \brand{MathJax} now may be used to display math via the |mathjax| option. +% ^^A \item \brand{MathJax} now may be used to display math via the \optn{mathjax} option. % ^^A See \cref{sec:loading,sec:limitsmath}. % ^^A To use \brand{MathJax} with a pre-existing project, % ^^A \watchout @@ -2911,27 +2954,28 @@ This boolean may be tested by the user for later use. % occasional user intervention is required in certain cases. % % As a package running directly in \LaTeX, \pkg{lwarp} has some advantages over -% other methods of \HTML\ conversion. A deeper level of \TeX\ understanding is -% of course possible, as \TeX\ itself is still in use. +% other methods of \HTML\ conversion. \TeX\ itself is still used, allowing a +% wider range of \TeX\ trickery to be understood. % Lua expressions are still available with \LuaTeX. % Entire categories of -% \LaTeX\ packages work as-is when used with \pkg{lwarp}: definitions, file handling, -% utilities, internal data structures and calculations, +% \LaTeX\ packages work as-is when used with \pkg{lwarp}: +% definitions, file handling, utilities, internal data structures and calculations, +% specialized math-mode typesetting for various fields of science and engineering, % and anything generating plain-text output. % Blocks of \PDF\ output may be automatically converted to \SVG\ images % while using the same font and spacing as the original print document, -% directly supporting \tikz\ and \env{picture}, +% directly supporting \tikz\ and \env{picture}. % Numerous packages are easily adapted for \HTML\ versions, either % by loading and patching the originals, or by creating nullified or emulated % replacements, and all without resorting to external programming. % As a result, several hundred packages have already been adapted (\cref{tab:supported}), and % an uncounted number more work as-is. % -% Packages have been selected according to several criteria: importance, +% Packages have been selected according to several criteria: perceived importance, % popularity lists, recent CTAN updates, CTAN topics, mention in other packages, support by other % \HTML\ conversion methods, % and from sample documents taken from public archives\footnote{An amazing number of -% decades-old packages are still in modern use.}. +% decades-old packages are still in use today.}. % % \rulebreak % @@ -2944,14 +2988,15 @@ This boolean may be tested by the user for later use. % \prog{pdflatex}, \prog{xelatex}, or \prog{lualatex} may be used, % allowing \pkg{lwarp} to process the usual image formats. % While generating \HTML\ output, \SVG\ files are used in place of \PDF. -% Other formats such as \JPG\ are used as-is. +% Other formats such as \PNG\ and \JPG\ are used as-is. % % SVG images may be used for math, -% and are also used for \env{picture}, and \tikz{} environments. -% This format has better browser and e-book support than \MathML\ (as of this writing), +% and are also used for \env{picture}, \tikz, and similar environments. +% The \SVG\ format has better browser and e-book support +% than \MathML\ (as of this writing), % while still allowing for high-quality display and printing of images % (again, subject to potentially -% bug-ridden\footnote{Firefox has had an on-again/off-again bug +% bug-ridden\footnote{\brand{Firefox} has had an on-again/off-again bug % for quite some time regareding printing \SVG{}s at high resolution.} browser % support). % @@ -2963,15 +3008,20 @@ This boolean may be tested by the user for later use. % particular opinion on the matter, except to say that in this case \LaTeX{} is much easier to implement!} % Custom \LaTeX{} macros may be used as-is in math expressions, since the math is evaluated % entirely inside \LaTeX. +% An MD5 hash is used to combine multiple instances of the same inline math expression +% into a single image file, which then needs to be converted to \SVG\ only a single time. % % The \brand{MathJax} JavaScript display engine may be selected % for math display instead of using \SVG\ images. % Subject to browser support and Internet access, % \brand{MathJax} allows an \HTML\ page to display -% math without relying on a large number of external image files.\footnote{One \SVG\ image -% file per math expression. A commmon scientific paper can easily run into several thousand -% files, depending on how often something like \$x\$ is used. -% In testing one sample document it appears that hashing would only reduce the number in half.} +% math without relying on a large number of +% external image files.\footnote{One \SVG\ image +% file per math expression, except that duplicate inline math expressions are combined +% into a single file according to the MD5 hash function of its contents. +% A common scientific paper can easily include several thousand files, +% and in one case the MD5 hash cut the number of files in half and the rendering +% time by 30\%.} % \pkg{lwarp} maintains \LaTeX\ control for cross-referencing % and equation numbering, and attempts to force \brand{MathJax} to tag equations accordingly. % @@ -3102,17 +3152,31 @@ This boolean may be tested by the user for later use. % Theorems: & Native \LaTeX\ theorems, % \pkg{theorem}, \pkg{amsthm}, \pkg{ntheorem}. \\ % -% Additional math: & \pkg{delarray}, \pkg{bm}, math fonts via \SVG\ images, \pkg{resizegather}. \\ +% Additional math: & Math fonts via \SVG\ images, \pkg{resizegather}. +% As-is: \pkg{delarray}, \pkg{bm}, \pkg{braket}, etc. \\ +% +% \midrule % % Units and fractions: & \pkg{siunitx}, \pkg{xfrac}, \pkg{nicefrac}, \pkg{units} \\ % +% Science and engineering: & +% \pkg{listings}, \pkg{algorithmicx}, \pkg{bytefield}, \pkg{axodraw2}, +% \pkg{phfqit}. +% Tested to work with SVG math: \pkg{physics}, \pkg{slashed}, +% \pkg{heppennames}, \pkg{hepnicenames}, +% \pkg{simpler-wick}, \pkg{linop}, \pkg{blochsphere}, etc. +% \emph{(Math-mode packages generally work as-is with \SVG\ math.)} \\ +% +% Liberal arts: & \pkg{schemata} \\ +% % \midrule % % Floats: & Appear where declared. % \pkg{float}, \pkg{rotfloat}, \pkg{newfloat}, \pkg{caption} and \pkg{subcaption}, % \pkg{subfig}, \pkg{subfigure}, \pkg{capt-of}, \pkg{placeins}, \pkg{trivfloat}, \pkg{floatrow}, % \pkg{subfloat}, \pkg{keyfloat}, \pkg{wrapfig}, \pkg{cutwin}, \pkg{floatflt}, -% \pkg{flafter}, \pkg{fltrace}, \pkg{endfloat}, \pkg{hypcap}, \pkg{stfloats}. \\ +% \pkg{flafter}, \pkg{fltrace}, \pkg{endfloat}, \pkg{hypcap}, \pkg{stfloats}, +% \pkg{fix2col}, \pkg{dblfloatfix}, \pkg{nonfloat}, \pkg{morefloats}. \\ % % \midrule % @@ -3120,7 +3184,7 @@ This boolean may be tested by the user for later use. % \env{tabular} environment, \pkg{array}, \pkg{tabularx}, \pkg{tabulary}, % \pkg{threeparttable}, \pkg{multirow}, % \pkg{longtable}, \pkg{supertabular}, \pkg{xtab}, \pkg{ltxtable}, -% \pkg{booktabs}, \pkg{colortbl}.\\ +% \pkg{booktabs}, \pkg{colortbl}, \pkg{bigdelim}, \pkg{diagbox}.\\ % % \midrule % @@ -3131,8 +3195,8 @@ This boolean may be tested by the user for later use. % are accepted as well. % \cs{rotatebox} and \cs{scalebox} are supported as well as \HTML\ can handle. % \pkg{rotating} is emulated but all objects are unrotated. -% \pkg{picture} and \pkg{tikz} are converted to an \SVG\ image. -% \pkg{grffile}, \pkg{overpic}, \pkg{figsize}. \\ +% \pkg{picture}, \pkg{tikz}, and \pkg{xy} are converted to an \SVG\ image. +% \pkg{grffile}, \pkg{epstopdf}, \pkg{overpic}, \pkg{figsize}. \\ % % % \midrule @@ -3153,8 +3217,8 @@ This boolean may be tested by the user for later use. % % Environments: & Standard \LaTeX{} environments. \\ % -% \env{minipage}: & Some \HTMLfive-imposed limitations. -% Nested minipages are supported. \\ +% \env{minipage}, \cs{parbox}: & Some \HTMLfive-imposed limitations. +% Nested minipages are supported. \pkg{pbox}.\\ % % Quotations: & \pkg{verse}, \pkg{csquotes}, \pkg{epigraph} \\ % @@ -3216,7 +3280,9 @@ This boolean may be tested by the user for later use. % \pkg{fileerr}, % \pkg{somedefs}, % \pkg{trace}, -% \pkg{xspace}. \\ +% \pkg{xspace}. +% Also, any math-only packages, including specialized typesetting for +% various fields of science and engineering. \\ % % \bottomrule % @@ -3298,7 +3364,7 @@ This boolean may be tested by the user for later use. % \end{description} % % \subsubsection{Asciidoctor-LaTeX} -% The Asciidoctor-LaTeX project is adding additional \LaTeX{}-related features. +% The Asciidoctor-LaTeX project is developing additional \LaTeX{}-related features. % \begin{description} % \item [Asciidoctor-LateX:] ~ \\ % \url{http://www.noteshare.io/book/asciidoctor-latex-manual} \\ @@ -3322,8 +3388,8 @@ This boolean may be tested by the user for later use. % have advanced through the years in their abilities % to represent math with a \LaTeX-ish input syntax, unicode math fonts, % and high-quality output, and also generate \HTML\ with varying success. -% See recent developments in Microsoft\,\textregistered{} Word\,\textregistered{} -% and LibreOffice\,\texttrademark{} Writer. +% See recent developments in \brand{Microsoft}\,\supregistered\ \prog{Word}\,\supregistered{} +% and \brand{LibreOffice}\,\texttrademark\ \prog{Writer}. % % \subsection{Commercial systems} % @@ -3331,9 +3397,9 @@ This boolean may be tested by the user for later use. % \DescribeProgram{Adobe} \DescribeProgram{FrameMaker} % \DescribeProgram{InDesign} \DescribeProgram{Flare} \DescribeProgram{Madcap} % abilities have been advancing in the areas of typesetting, cross-referencing, and \HTML\ generation. -% See Adobe\,\textregistered{} FrameMaker\,\textregistered{}, -% Adobe InDesign\,\textregistered{}, -% and Madcap Flare\,\texttrademark{}. +% See \brand{Adobe}\,\supregistered{} \prog{FrameMaker}\,\supregistered{}, +% \brand{Adobe} \prog{InDesign}\,\supregistered, +% and \brand{Madcap} \prog{Flare}\,\texttrademark. % % \subsection{Comparisons} % \index{markup languages} @@ -3452,7 +3518,7 @@ This boolean may be tested by the user for later use. % % From \brand{Poppler}: \url{poppler.freedesktop.org}. % -% For \brand{MacOS}\textregistered, see +% For \brand{MacOS}\supregistered, see % \url{https://brew.sh/}, install \prog{Homebrew}, then % \userentry{brew install poppler} % @@ -3502,8 +3568,8 @@ This boolean may be tested by the user for later use. % \item [MiK\TeX:] If using MiK\TeX: % \begin{enumerate} % \item To install \pkg{lwarp} the first time, -% use the \pkg{MikTeX Package Manager (Admin)}. -% \item To update \pkg{lwarp}, use \pkg{MikTeX Update (Admin)}. +% use the \prog{MikTeX Package Manager (Admin)}. +% \item To update \pkg{lwarp}, use \prog{MikTeX Update (Admin)}. % \item Either way, also update the package \pkg{miktex-misc}, which will install and % update the \prog{lwarpmk} executable. % \end{enumerate} @@ -3927,6 +3993,10 @@ This boolean may be tested by the user for later use. % This file should not be modified by the user. % A custom file may be used instead, if necessary. % +% \item [|lwarp\_one\_limage.txt|:] For \brand{Windows} only. +% Used to process \SVG\ images in the background. Copied to +% |lwarp_one_limage.cmd| when images are generated. +% % \item [|lwarp\_mathjax.txt|:] Inserted into the \HTML\ files when % \brand{MathJax} is used to display math. % This file should not be modified by the user. @@ -4074,8 +4144,8 @@ This boolean may be tested by the user for later use. % By default \pkg{lwarp} represents math as \SVG\ images with % \margintag{math as \SVG\ images} % the \LaTeX\ source included in \attribute{alt} attributes. In this way, -% the math displays as it was drawn by \LaTeX, and the \LaTeX\ source -% may be copied and pasted into some other document. +% the math is displayed as it was drawn by \LaTeX, and the \LaTeX\ source +% may be copied and pasted into other documents. % % \pkg{lwarp} uses the same mechanism for \env{picture} and \tikz\ environments. % \margintag{\env{picture} and \tikz} @@ -4104,7 +4174,7 @@ This boolean may be tested by the user for later use. % \margintag{math with \brand{MathJax}} % % \begin{enumerate} -% \item In the tutorial's source code, uncomment the |mathjax| package option for \pkg{lwarp}: +% \item In the tutorial's source code, uncomment the \optn{mathjax} package option for \pkg{lwarp}: % \begin{sourcedisplay} % mathjax, \% Use MathJax to display math. % \end{sourcedisplay} @@ -4165,7 +4235,7 @@ This boolean may be tested by the user for later use. % and recompile as needed. % % \begin{enumerate} -% \item In the tutorial's source code uncomment the |latexmk| option for the +% \item In the tutorial's source code uncomment the \optn{latexmk} option for the % \pkg{lwarp} package: % \begin{sourcedisplay} % latexmk, \% Use latexmk to compile. @@ -4238,7 +4308,7 @@ This boolean may be tested by the user for later use. % % \DescribeOption{IndexLanguage} % To assign a language to be used while processing the index and glossary, -% use the |IndexLanguage| option: +% use the \optn{IndexLanguage} option: % \index{language>glossary} % \index{language>index} % \index{glossary>language} @@ -4473,13 +4543,13 @@ This boolean may be tested by the user for later use. % While using \prog{xelatex} or \prog{lualatex}, \prog{xindy} is used for the index. % Everything is handled in UTF-8 encoding, and should work as expected. % -% While using \prog{pdflatex}, the \prog{texindy} program is used with the |-C utf8| option, +% While using \prog{pdflatex}, the \prog{texindy} program is used with the \optn{-C utf8} option, % which is newly supported in recent distributions of \LaTeX. This option correctly % sorts index entries into headings while using Latin languages, but will not work % well with others. \XeLaTeX\ or \LuaLaTeX\ are recommended for non-Latin languages. % % For an older distribution of \LaTeX, it may be necessary to generate a local version of -% |lwarpmk.lua| and modify it to remove the |-C utf8| option from the texindy call. +% |lwarpmk.lua| and modify it to remove the \optn{-C utf8} option from the \prog{texindy} call. % See \cref{sec:modifylwarpmk}. % % @@ -4524,12 +4594,12 @@ This boolean may be tested by the user for later use. % \DescribeOption{warpprint} % \DescribeOption{warpHTML} % Usually controlled by \prog{lwarpmk}, and not set in the document. -% Select the |warpprint| option to generate print output (default), -% or the |warpHTML| option to generate \HTMLfive{} output. +% Select the \optn{warpprint} option to generate print output (default), +% or the \optn{warpHTML} option to generate \HTMLfive\ output. % The default is print output, so the print version may be % compiled with the usual \prog{pdflatex}, etc. % When \pkg{lwarp} is loaded in print mode, it creates -% |<project>_html.tex|, which sets the |warpHTML| option before calling +% |<project>_html.tex|, which sets the \optn{warpHTML} option before calling % the user's source code |<project>.tex|. In this way, |<project>.tex| % can |\usepackage{lwarp}| without any options to create a printed version, % while |<project>_html.tex| will create an \HTML\ version. @@ -4631,7 +4701,7 @@ This boolean may be tested by the user for later use. % causing the % homepage to be the file |index.html|. Underscores are allowed in % \margintag{filename underscores} -% |HomeHTMLFilename| and |HTMLFilename| options, but may need to be escaped +% \optn{HomeHTMLFilename} and \optn{HTMLFilename} options, but may need to be escaped % elsewhere, such as when appearing in a list: % \index{underscore>filename}\index{file>underscore} % \changes{v0.24}{2017/03/13}{Docs: Filename underscore.} @@ -4751,8 +4821,12 @@ This boolean may be tested by the user for later use. % \ItemDescribeBoolean{FileSectionNames} \DescribeDefault{true} % If true, web page filenames are derived from a sanitized version % of the section names. If false, web pages are numbered. -% Either way, the |HTMLFilename| option is used as a prefix. +% Either way, the \optn{HTMLFilename} option is used as a prefix. % See \cref{sec:filenameexamples} for examples of naming and numbering \HTML\ files. +% The user must ensure that filenames are unique after begin sanitized. \watchout[Unique filename!] +% For example, math in the section name is removed before creating the filename, +% so the rest of the filename must be sufficiently unique to avoid name collisions. +% \index{file>unique names} % % \ItemDescribeCounter{FootnoteDepth} \DescribeDefault{5} % Determines where to place pending footnotes. @@ -5220,7 +5294,7 @@ This boolean may be tested by the user for later use. % \end{Verbatim} % This line creates the hyperlinks for the \HTML\ index. During print output % \cs{hyperindexref} becomes a null function. -% \item In the document source use the |xdyFilename| option for \pkg{lwarp}: +% \item In the document source use the \optn{xdyFilename} option for \pkg{lwarp}: % \DescribeOption{xdyFilename} % \begin{Verbatim}[gobble=2,tabsize=4] % \usepackage[ @@ -5251,9 +5325,13 @@ This boolean may be tested by the user for later use. % for a smooth conversion to both \HTML\ and print-formatted outputs: % % -% \subsection{Formatting} +% \subsection{Sectioning} +% +% \limitssectioning % % +% \subsection{Formatting} +% % \subsubsection{Text formatting} % % \limitstext @@ -5908,7 +5986,7 @@ This boolean may be tested by the user for later use. % % \pkg{lwarp} may be told to modify its \HTML\ output to make it % easier to import the \HTML\ document into a word processor. -% At the time of this writing, it seems that LibreOffice works best at +% At the time of this writing, it seems that \brand{LibreOffice} works best at % preserving table layout, but it still has some limitations, such as % an inability to automatically assign figure and table % frames and captions according to user-selected \HTML\ classes. @@ -5945,7 +6023,7 @@ This boolean may be tested by the user for later use. % \item If using a class without chapters, \cs{section} and lower are % shifted up in level for the \HTML\ heading tags. The \CSS\ has % not been changed, so the section heading formats will not match the normal -% \HTML\ output, but when imported to LibreOffice Writer the higher +% \HTML\ output, but when imported to \prog{LibreOffice Writer} the higher % section headings will import as \UI{Heading~1} for the title, \UI{Heading~2} % for \cs{section}, etc. % \item Headers, footers, and navigation are removed at file splits. @@ -5957,17 +6035,17 @@ This boolean may be tested by the user for later use. % but they are no longer useful when the document has been % imported into a word processor. % \item An additional \element{div} with an \attribute{id} encapsulates -% each float and minipage, which on import into LibreOffice Writer +% each float and minipage, which on import into \prog{LibreOffice Writer} % causes a thin frame to appear around the text block for each. % \item Float captions are given an explicit italic formatting. -% \item Tabular rule borders are made explicit for LibreOffice Writer. -% LibreOffice displays a light border around each cell while editing, +% \item Tabular rule borders are made explicit for \prog{LibreOffice Writer}. +% \brand{LibreOffice} displays a light border around each cell while editing, % even those which have no border when printed, % and \pkg{lwarp} also uses a light border for thin rules, % so it will be best to judge the results using -% the print preview instead of while editing in LibreOffice. +% the print preview instead of while editing in \brand{LibreOffice}. % \item \cs{includegraphics} and \SVG\ math width and height -% are made explicit for LibreOffice. +% are made explicit for \brand{LibreOffice}. % \item \cs{hspace} is approximated by a number of \cs{quad}s, % and rules are approximated by a number of underscores. % \item Explicit \HTML\ styles are given to: @@ -6082,7 +6160,7 @@ This boolean may be tested by the user for later use. % \newcommand{\describeWPMarkMath}{ % While formatting for word processors, % prints math as \LaTeX\ code instead of creating \SVG\ images or \brand{MathJax}. -% This is useful for cut/paste into the LibreOffice Writer TeXMaths extension. +% This is useful for cut/paste into the \prog{LibreOffice Writer TeXMaths} extension. % } % % \DescribeBoolean{WPMarkMath} \DescribeDefault{false} @@ -6096,10 +6174,10 @@ This boolean may be tested by the user for later use. % \begin{sourcedisplay} % \cs{usepackage}\{siunitx\} % \end{sourcedisplay} -% in the TeXMaths preamble. +% in the \prog{TeXMaths} preamble. % Equation numbering is problematic for \AmS\ math environments. % \end{docsidebar} -% \index{siunitx>with TeXMaths} +% \index{siunitx>with \prog{TeXMaths}} % \index{math>word processor conversion} % % @@ -6107,7 +6185,7 @@ This boolean may be tested by the user for later use. % While formatting for word processors, % |true| sets the document title to \element{h1}, which is expected for \HTML\ documents, % but also causes the lower-level section headings to start at \UI{Heading 2} when -% imported into LibreOffice. +% imported into \brand{LibreOffice}. % Set to |false| to cause the title to be plain text, and the section headings % to begin at \UI{Heading 1}. % @@ -6161,39 +6239,39 @@ This boolean may be tested by the user for later use. % \index{word processor>conversion recommendations} % \index{LibreOffice>conversion recommendations} % -% For use with LibreOffice Writer, it is recommended to: +% For use with \prog{LibreOffice Writer}, it is recommended to: % \margintag{TOC, LOF, LOT} % \begin{enumerate}[nosep] % \item Set \cs{booltrue}\{FormatWP\}. % \item Set \cs{booltrue}\{WPMarkTOC\} and \cs{boolfalse}\{WPMarkLOFT\}. % \item Use \pkg{lwarp} to generate the \HTML\ document. -% \item Copy/paste from the \HTML\ document into an empty LibreOffice Writer document. -% \item Manually insert a LibreOffice \acro{TOC} in the LibreOffice document. +% \item Copy/paste from the \HTML\ document into an empty \prog{LibreOffice Writer} document. +% \item Manually insert a \brand{LibreOffice} \acro{TOC} in the \brand{LibreOffice} document. % \item Manually add frames around each float, adding a caption which is cut/pasted from % each float's simulated caption. % \item Manually create cross references. % \end{enumerate} -% This process yields a document with an actual LibreOffice Table of Contents, +% This process yields a document with an actual \brand{LibreOffice} Table of Contents, % but a simulated List of Figures and List of Tables. % % For \pkg{siunitx}, remember to adjust the preamble as mentioned above. % \margintag{siunitx} % -% LibreOffice has options in the View menu to turn on/off the display of +% \brand{LibreOffice} has options in the \UI{View} menu to turn on/off the display of % \margintag{LO view border options} % thin borders around table cells and text objects. % % % \subsection{Limitations} % -% Floats and captions are not explicitly converted to LibreOffice floats with their -% own captions. Floats are surrounded by a thin frame in the LibreOffice editor, -% and may be marked with |WPMarkFloats|, but are not given a proper LibreOffice +% Floats and captions are not explicitly converted to \brand{LibreOffice} floats with their +% own captions. Floats are surrounded by a thin frame in the \brand{LibreOffice} editor, +% and may be marked with |WPMarkFloats|, but are not given a proper \brand{LibreOffice} % object frame. % Captions are given an explicit italic formatting, -% but not a proper LibreOffice paragraph style. +% but not a proper \brand{LibreOffice} paragraph style. % -% Cross references are not actual LibreOffice linked cross references. +% Cross references are not actual \brand{LibreOffice} linked cross references. % % The List of Figures and List of Tables are not linked. % The pasted pseudo \acro{LOF} and \acro{LOT} match the numbering @@ -6204,7 +6282,7 @@ This boolean may be tested by the user for later use. % SVG math is recommended when using the \AmS\ environments, which may have % multiple numbered equations per object. % -% As of when last checked, LibreOffice ignores the following: +% As of when last checked, \brand{LibreOffice} ignores the following: % \begin{itemize} % \item Minipage alignment. % \item Tabular cell vertical alignment. @@ -6388,10 +6466,10 @@ This boolean may be tested by the user for later use. % A project-local copy of |lwarpmk.lua| may be generated, modified, and then used to % compile documents: % \begin{enumerate} -% \item Add the |lwarpmk| option to the \pkg{lwarp} package. +% \item Add the \optn{lwarpmk} option to the \pkg{lwarp} package. % \item Recompile the printed version of the document. -% The |lwarpmk| option causes \pkg{lwarp} to create a local copy of |lwarpmk.lua| -% \item The |lwarpmk| option may now be removed from the \pkg{lwarp} package. +% The \optn{lwarpmk} option causes \pkg{lwarp} to create a local copy of |lwarpmk.lua| +% \item The \optn{lwarpmk} option may now be removed from the \pkg{lwarp} package. % \item Copy and rename |lwarpmk.lua| to a new file such as |mymake.lua|. % \item Modify |mymake.lua| as desired. % \item If necessary, make |mymake.lua| executable. @@ -6501,6 +6579,8 @@ This boolean may be tested by the user for later use. % \begin{itemize} % \item See the warning regarding changes to the \HTML\ settings % at \cref{sec:htmlsettings}. +% \item Ensure that the filenames are unique after math and short words are removed. +% See \optn{FileSectionNames} at \cref{sec:htmlsettings}. % \end{itemize} % % \item [Missing / incorrect cross-references:] ~ @@ -6746,8 +6826,23 @@ This boolean may be tested by the user for later use. % % \section{Detecting the \TeX\ Engine — pdflatex, lualatex, xelatex} % +% \changes{v0.16}{2016/04/07}{Added XeLaTeX, LuaLaTeX support.} +% See: \url{http://tex.stackexchange.com/a/47579}. +% +% Detects \XeTeX{} and \LuaLaTeX: +% \index{XeLaTeX>detection}\index{LuaLaTeX>detection} % \begin{macrocode} \RequirePackage{iftex} +\newif\ifxetexorluatex +\ifXeTeX + \xetexorluatextrue +\else + \ifLuaTeX + \xetexorluatextrue + \else + \xetexorluatexfalse + \fi +\fi \ifLuaTeX \RequirePackage{luatex85}% until the geometry package is updated @@ -6755,6 +6850,35 @@ This boolean may be tested by the user for later use. % \end{macrocode} % % +% \section{MD5 hashing} +% +% The MD5 hash is used for \env{lateximage} filenames for \SVG\ math. +% +% \begin{macrocode} +\newcommand{\LWR@mdfive}[1]{% +\PackageError{lwarp} +{No MD5 macro was found.} +{Lwarp must find the macros pdfmdfivesum or mdfivesum.} +} + +\ifPDFTeX +\let\LWR@mdfive\pdfmdfivesum +\fi + +\ifLuaTeX +\RequirePackage{pdftexcmds} +\let\LWR@mdfive\pdf@mdfivesum +\fi + +\ifXeTeX +\@ifundefined{pdffivesum}{} + {\let\LWR@mdfive\pdfmdfivesum} +\@ifundefined{mdfivesum}{} + {\let\LWR@mdfive\mdfivesum} +\fi +% \end{macrocode} +% +% % \section{pdfLaTeX T1 and UTF8 encoding} % % When using pdf\LaTeX, \pkg{lwarp} required T1 and UTF8 encoding. @@ -6883,7 +7007,7 @@ This boolean may be tested by the user for later use. % % \subsection{Common portability code} % -% \DescribeBoolean{usingOSWindows} Set if the |OSWindows| option is used. +% \DescribeBoolean{usingOSWindows} Set if the \optn{OSWindows} option is used. % \begin{macrocode} \newbool{usingOSWindows} \boolfalse{usingOSWindows} @@ -6907,7 +7031,7 @@ This boolean may be tested by the user for later use. % \begin{macro}{\LWR@setOSWindows} % Set defaults for the \brand{MS-Windows} operating system. % \pkg{lwarp} attempts to auto-detect the operatings system, -% and the |OSWindows| option may also be used to force +% and the \optn{OSWindows} option may also be used to force % \brand{MS-Windows} compatibility. % % \changes{v0.20}{2016/12/19}{Auto-detects operating system.} @@ -6922,7 +7046,7 @@ This boolean may be tested by the user for later use. % \end{macro} % % Test for windows during compile. The user may also specify -% |OSWindows| package option in case this test fails. +% \optn{OSWindows} package option in case this test fails. % \begin{macrocode} \ifwindows \LWR@setOSWindows @@ -6973,7 +7097,8 @@ This boolean may be tested by the user for later use. % % % \DescribeOption{warpprint} -% If the |warpprint| option is given, boolean |warpingprint| is true and boolean |warpingHTML| is false, +% If the \optn{warpprint} option is given, +% boolean |warpingprint| is true and boolean |warpingHTML| is false, % and may be used for \cs{ifbool} tests. % % @@ -6989,7 +7114,8 @@ This boolean may be tested by the user for later use. % Anything in the |warpHTML| environment will be generated for \HTML\ output only. % % \DescribeOption{warpHTML} -% If the |warpHTML| option is given, boolean |warpingHTML| is true and boolean |warpingprint| is false, +% If the \optn{warpHTML} option is given, +% boolean |warpingHTML| is true and boolean |warpingprint| is false, % and may be used for \cs{ifbool} tests. % % \begin{macrocode} @@ -7008,10 +7134,11 @@ This boolean may be tested by the user for later use. % % \changes{v0.19}{2016/05/25}{Options: mathsvg and mathjax} % \DescribeOption{mathsvg} -% Option |mathsvg| selects \SVG\ math display: -% \index{math>mathsvg option} -% \index{SVG>mathsvg option} -% If the |mathsvg| option is given, boolean |mathjax| is false, and may be used for \cs{ifbool} tests. +% Option \optn{mathsvg} selects \SVG\ math display: +% \index{math>\optn{mathsvg} option} +% \index{SVG>\optn{mathsvg} option} +% If the \optn{mathsvg} option is given, boolean |mathjax| is false, +% and may be used for \cs{ifbool} tests. % \begin{macrocode} \DeclareVoidOption{mathsvg}{% \PackageInfo{lwarp}{Using option 'mathsvg'} @@ -7020,10 +7147,10 @@ This boolean may be tested by the user for later use. % \end{macrocode} % % \DescribeOption{mathjax} -% Option |mathjax| selects \brand{MathJax} math display: -% \index{math>mathjax option} -% \index{MathJax>mathjax option} -% If the |mathjax| option is given, boolean |mathjax| is true, may be used for \cs{ifbool} tests. +% Option \optn{mathjax} selects \brand{MathJax} math display: +% \index{math>\optn{mathjax} option} +% \index{MathJax>\optn{mathjax} option} +% If the \optn{mathjax} option is given, boolean |mathjax| is true, may be used for \cs{ifbool} tests. % \begin{macrocode} \DeclareVoidOption{mathjax}{% \PackageInfo{lwarp}{Using option 'mathjax'} @@ -7034,7 +7161,7 @@ This boolean may be tested by the user for later use. % \DescribeOption{BaseJobname} -% Option |BaseJobname| sets the \cs{BaseJobname} for this document. +% Option \optn{BaseJobname} sets the \cs{BaseJobname} for this document. % % This is the \cs{jobname} of the printed version, even if currently % compiling the \HTML\ version. @@ -7079,7 +7206,7 @@ This boolean may be tested by the user for later use. % Useful for archiving for future use. % This file may be made executable and acts just like \prog{lwarpmk}. % -% If |lwarpmk| option, creates a local copy of |lwarpmk.lua|: +% If \optn{lwarpmk} option, creates a local copy of |lwarpmk.lua|: % \begin{macrocode} \newbool{LWR@creatinglwarpmk} \boolfalse{LWR@creatinglwarpmk} @@ -7136,7 +7263,7 @@ This boolean may be tested by the user for later use. % \DescribeOption{latexmk} -% Option |latexmk| tells \prog{lwarpmk} to use \prog{latexmk} when compiling documents. +% Option \optn{latexmk} tells \prog{lwarpmk} to use \prog{latexmk} when compiling documents. % % \changes{v0.30}{2017/04/29}{Option \prog{latexmk} replaces macro \cs{UseLatexmk}.} % @@ -7401,6 +7528,7 @@ For a possible alternative, see package(s) #2.} \LWR@notmemoirloadafter{array} % \LWR@loadafter{atbegshi}% used by morewrites \LWR@loadafter{authblk} +\LWR@loadafter{axodraw2} \LWR@loadafter{backref} \LWR@loadafter{balance} \LWR@loadafter{bigdelim} @@ -7411,6 +7539,7 @@ For a possible alternative, see package(s) #2.} \LWR@loadafter{boxedminipage} \LWR@loadafter{boxedminipage2e} \LWR@loadafter{breakurl} +\LWR@loadafter{bytefield} \LWR@loadafter{cancel} \LWR@loadafter{caption} \LWR@notmemoirloadafter{ccaption} @@ -7426,8 +7555,10 @@ For a possible alternative, see package(s) #2.} \LWR@notmemoirloadafter{crop} \LWR@loadafter{cuted} \LWR@loadafter{cutwin} +\LWR@loadafter{dblfloatfix} \LWR@loadafter{dblfnote} \LWR@notmemoirloadafter{dcolumn} +\LWR@loadafter{diagbox} \LWR@loadafter{draftwatermark} \LWR@loadafter{easy-todo} \LWR@loadafter{ebook} @@ -7439,6 +7570,7 @@ For a possible alternative, see package(s) #2.} \LWR@notmemoirloadafter{enumerate} \LWR@loadafter{enumitem} \LWR@notmemoirloadafter{epigraph} +\LWR@loadafter{epstopdf} \LWR@loadafter{eso-pic} \LWR@loadafter{everypage} \LWR@loadafter{everyshi} @@ -7513,6 +7645,7 @@ For a possible alternative, see package(s) #2.} \LWR@loadafter{microtype} \LWR@loadafter{midfloat} \LWR@loadafter{midpage} +\LWR@loadafter{morefloats} \LWR@notmemoirloadafter{moreverb} % morewrites must be loaded before lwarp \LWR@notmemoirloadafter{mparhack} @@ -7526,6 +7659,7 @@ For a possible alternative, see package(s) #2.} \LWR@loadafter{newtxmath} % newunicodechar must be loaded before lwarp \LWR@notmemoirloadafter{nextpage} +\LWR@loadafter{nonfloat} \LWR@loadafter{nonumonpart} \LWR@loadafter{nopageno} \LWR@loadafter{nowidow} @@ -7536,10 +7670,12 @@ For a possible alternative, see package(s) #2.} \LWR@loadafter{pagesel} \LWR@loadafter{paralist} \LWR@notmemoirloadafter{parskip} +\LWR@loadafter{pbox} \LWR@loadafter{pdfrender} \LWR@loadafter{pdflscape} \LWR@loadafter{pdfsync} \LWR@loadafter{pfnote} +\LWR@loadafter{phfqit} \LWR@loadafter{placeins} \LWR@loadafter{prelim2e} \LWR@loadafter{prettyref} @@ -7555,6 +7691,7 @@ For a possible alternative, see package(s) #2.} \LWR@loadafter{rotfloat} \LWR@loadafter{savetrees} % \LWR@loadafter{scalefnt}% loaded by babel-french +\LWR@loadafter{schemata} \LWR@loadafter{scrextend} \LWR@loadafter{scrhack} \LWR@loadafter{scrlayer} @@ -7621,6 +7758,7 @@ For a possible alternative, see package(s) #2.} \LWR@loadafter{xmpincl} \LWR@loadafter{xtab} \LWR@loadafter{xurl} +\LWR@loadafter{xy} \LWR@loadafter{zwpagelayout} % \end{macrocode} @@ -7637,43 +7775,6 @@ For a possible alternative, see package(s) #2.} % \HTML\ output. Some of them are also automatically loaded when % generating print output, but some are not. % -% In the document preamble, create a \env{warpprint} environment, and place -% inside it any of the following packages which are required and which -% are labeled as ``Print: OK to Load in a \env{warpprint} environment''. -% Those packages which are labeled as ``Print: Pre-Loaded'' -% need not be placed into the document preamble. - - - -% \codeall -% \begin{macrocode} -\begin{warpall} -% \end{macrocode} - - -% \changes{v0.16}{2016/04/07}{Added XeLaTeX, LuaLaTeX support.} -% See: \url{http://tex.stackexchange.com/a/47579}. - -% Detects \XeTeX{} and \LuaLaTeX: -% \index{XeLaTeX>detection}\index{LuaLaTeX>detection} -% \begin{macrocode} -\RequirePackage{iftex} -\newif\ifxetexorluatex -\ifXeTeX - \xetexorluatextrue -\else - \ifLuaTeX - \xetexorluatextrue - \else - \xetexorluatexfalse - \fi -\fi -% \end{macrocode} - -% \begin{macrocode} -\end{warpall} -% \end{macrocode} - % \codehtml % \begin{macrocode} \begin{warpHTML} @@ -7692,9 +7793,16 @@ For a possible alternative, see package(s) #2.} % ^^A % \index{font>during conversion} % ^^A % For \XeLaTeX{} and \LuaLaTeX, uses DejaVu Serif for enhanced Cyrillic and Greek coverage. % ^^A % \index{Unicode>XeLaTeX \& LuaLaTeX} +% ^^A +% ^^A +% +% Load \pkg{fontspec} if necessary: +% \changes{v0.50}{2018/02/24}{Fix: Load \pkg{fontspec} if necessary.} % \begin{macrocode} \ifxetexorluatex -% ^^A \usepackage[no-math]{fontspec} +\@ifpackageloaded{fontspec}{}{ +\usepackage[no-math]{fontspec} +} % \end{macrocode} % ^^A \defaultfontfeatures{Ligatures=Common} % ^^A \setmainfont{DejaVu Serif} @@ -8086,20 +8194,22 @@ top=1in,bottom=1in,% % Equation numbers are placed to the left for \HTML. % % \pkg{newtxmath} automatically loads \pkg{amsmath}, -% so the options |leqno| and |fleqn| are passed beforehand to be +% so the option \optn{leqno} is passed beforehand to be % picked up both here and by \pkg{newtxmath} if it is used. % \changes{v0.16}{2016/04/11}{Fix: newtxmath compatibility.} % \changes{v0.33}{2016/06/21}{\pkg{amsmath}: Removed \optn{fleqn} option.} % +% ^^A *8* remove leqno and references % \begin{macrocode} -\PassOptionsToPackage{leqno}{amsmath} +% \PassOptionsToPackage{leqno}{amsmath}% disabled to test centered display math \RequirePackage{amsmath} % \end{macrocode} % % Patches to allow \cs{eqref} inside a caption: % \changes{v0.49}{2018/02/18}{\pkg{amsmath}: Fix: Patches for \cs{eqref}.} +% \changes{v0.50}{2018/03/02}{\pkg{amsmath}: Fix: Upright tags for \SVG math.} % \begin{macrocode} -\def\maketag@@@#1{#1} +\def\maketag@@@#1{\text{#1}} \def\tagform@#1{\maketag@@@{(\ignorespaces#1\unskip)}} % \end{macrocode} @@ -8878,7 +8988,15 @@ top=1in,bottom=1in,% } \LetLtxMacro\LWR@origunderline\underline - +% \end{macrocode} +% +% \changes{v0.50}{2018/02/22}{Fix: \cs{centering}, etc. in \SVG\ math, \env{lateximage}, \tikz.} +% \begin{macrocode} +\let\LWR@origraggedright\raggedright +\let\LWR@origraggedleft\raggedleft +\let\LWR@origcentering\centering +% \end{macrocode} +% \begin{macrocode} \let\LWR@orignewpage\newpage \let\LWR@origpagestyle\pagestyle @@ -9062,7 +9180,7 @@ top=1in,bottom=1in,% % executing\\ % \hspace*{2ex} |pdflatex <project.tex>|,\\ % or similar for \prog{xelatex} or \prog{lualatex}, in print-document generation mode, -% which is the default unless the |warpHTML| option is given. +% which is the default unless the \optn{warpHTML} option is given. % |lwarpmk.conf| is then used by the utility \prog{lwarpmk}. % % An example |lwarpmk.conf|: @@ -9163,6 +9281,7 @@ homehtmlfilename = "\HomeHTMLFilename"% % \changes{v0.26}{2017/03/30}{\filenm{lwarp.css}: Improved responsive % \attribute{marginpar} and \attribute{marginblock}.} % \changes{v0.30}{2017/04/26}{Fix: \filenm{*.css} files only written in print mode.} +% \changes{v0.50}{2018/03/02}{\filenm{lwarp.css}: Improved \SVG\ display math centering.} % % ^^A *lwarp.css % \begin{macrocode} @@ -9265,6 +9384,26 @@ span.underline { text-decoration-skip ; } +span.overline { + text-decoration: overline ; + text-decoration-skip ; +} + +/* for diagbox */ +div.diagboxtitleN { border-bottom: 1px solid gray } +div.diagboxtitleS { border-top: 1px solid gray } + +div.diagboxE { + padding-left: 2em ; + text-align: right ; +} + +div.diagboxW { + padding-right: 2em ; + text-align: left ; +} + + /* For realscripts */ .supsubscript { @@ -9627,6 +9766,37 @@ border-bottom: 1px solid silver ; } +div.displaymath { + text-align: center ; +} + +div.displaymathnumbered { + text-align: right ; + margin-left: 5% ; + margin-right: 5% ; + min-width: 2.5in ; +} + +@media all and (min-width: 400px) { + div.displaymathnumbered { + margin-left: 10% ; + margin-right: 10% ; + } +} + +@media all and (min-width: 800px) { + div.displaymathnumbered { + margin-right: 20% ; + } +} + +@media all and (min-width: 1200px) { + div.displaymathnumbered { + margin-right: 30% ; + } +} + + .inlineprogramlisting { font-family: "DejaVu Mono", "Bitstream Vera Mono", "Lucida Console", "Nimbus Mono L", "Liberation Mono", "FreeMono", "Andale Mono", @@ -10674,6 +10844,8 @@ div.minipage { border-radius: 1ex ; } +table div.minipage { background: none ; border: none ; } + div.framebox div.minipage {border:none ; background:none} section.textbody > div.minipage { @@ -11074,6 +11246,41 @@ nav.botnavigation { % \end{macrocode} +% \subsection{lwarp\_one\_limage.cmd} +% +% \DescribeFile{lwarp_one_limage.cmd} +% Used by \pkg{lwarp} to help make \env{lateximage}s when using \brand{Windows}. +% +% This must be present when compiling the project, +% but does not need to be present when distributing +% the resulting \HTML\ files. +% +% The arguments are each of the three fields from \filenm{lateximages.txt}, +% and also the base name of the source file. +% +% \prog{MikTeX} does not allow file \filenm{lwarp\_one\_limage.cmd} to be +% created directly by \prog{lwarpmk}, so \filenm{lwarp\_one\_limage.txt} is created instead, +% then copied to \filenm{lwarp\_one\_limage.cmd} by \prog{lwarpmk}. +% This occurs each time \prog{lwarpmk} used to create \env{lateximage}s. +% +% \changes{v0.50}{2018/02/27}{\filenm{lwarp\_one\_limage.txt}: Added.} +% +% ^^A *lwarp_one_limage.txt +% \begin{macrocode} +\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 +del lateximages\%3.pdf +del lateximages\lateximagetemp-%1.pdf" +exit +\end{filecontents*} +\end{warpprint} +% \end{macrocode} + + % \subsection{lwarp\_mathjax.txt} @@ -11203,7 +11410,7 @@ src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX- % \subsection{lwarpmk option} -% The following is only generated if the |lwarpmk| option +% The following is only generated if the \optn{lwarpmk} option % was given to \pkg{lwarp}. % \begin{macrocode} \begin{LWR@createlwarpmk} @@ -11226,6 +11433,11 @@ src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX- % \changes{v0.37}{2017/08/19}{\prog{lwarpmk}: Removes additional \HTML\ \filenm{aux} files.} % \changes{v0.38}{2017/08/24}{\prog{lwarpmk}: Added \cmds{print1} and \cmds{html1} actions.} % \changes{v0.47}{2018/01/24}{\prog{lwarpmk}: \prog{pdfcrop}: Removed \optn{hires} option for improved crop accuracy.} +% \changes{v0.50}{2018/02/22}{\prog{lwarpmk}: MD5 hash avoids duplicate \SVG\ math.} +% \changes{v0.50}{2018/02/27}{\prog{lwarpmk}: Multiprocess support making lateximages.} +% \changes{v0.50}{2018/02/28}{\prog{lwarpmk}: Error if \filenm{lateximages.txt} does not exist.} +% \changes{v0.50}{2018/02/28}{\prog{lwarpmk}: Error if \filenm{lwarpmk.conf} points to \pkg{lwarp}.} +% \changes{v0.50}{2018/02/28}{\prog{lwarpmk}: Improved error messages.} % % ^^A *lwarpmk.lua % \begin{macrocode} @@ -11236,7 +11448,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.49" +printversion = "v0.50" function printhelp () print ("lwarpmk: Use lwarpmk -h or lwarpmk --help for help.") ; @@ -11259,7 +11471,7 @@ lwarpmk pdftohtml [project]: For use with latexmk or a Makefile: Convert project_html.pdf to project_html.html and individual HTML files. -lwarpmk clean [project]: Remove project.aux, .toc, .lof/t, .idx, .ind, .log, *_html_inc.*, .gl* +lwarpmk clean [project]: Remove .aux, .toc, .lof/t, .idx, .ind, .log, *_html_inc.*, .gl* lwarpmk cleanall [project]: Remove auxiliary files and also project.pdf, *.html lwarpmk -h: Print this help message. lwarpmk --help: Print this help message. @@ -11300,10 +11512,12 @@ local sfile = io.open(sourcefile) io.output(destfile) for line in sfile:lines() do i,j,copen,cstart,newfilename = string.find (line,"(.*)|(.*)|(.*)|") ; -if ( (i~= nil) and (copen == "<!--") and (cstart == "Start file")) then -- split the file -io.output(newfilename) ; -else -- not a splitpoint -io.write (line .. "\n") ; +if ( (i~= nil) and (copen == "<!--") and (cstart == "Start file")) then + -- split the file + io.output(newfilename) ; +else + -- not a splitpoint + io.write (line .. "\n") ; end end -- do io.close(sfile) @@ -11312,8 +11526,10 @@ end -- function -- Incorrect value, so print an error and exit. function cvalueerror ( line, linenum , cvalue ) - print ( linenum .. " : " .. line ) ; + print ("lwarpmk: ===") + print ("lwarpmk: " .. linenum .. " : " .. line ) ; print ("lwarpmk: incorrect variable value \"" .. cvalue .. "\" in lwarpmk.conf.\n" ) ; + print ("lwarpmk: ===") printconf () ; os.exit(1) ; end @@ -11330,11 +11546,14 @@ language = "english" -- Default xdyfile: xdyfile = "lwarp.xdy" -- Verify the file exists: -if (lfs.attributes(conffile,"mode")==nil) then -- file not exists -print("lwarpmk: " .. conffile .." does not exist.") -print("lwarpmk: " .. arg[2] .. " does not appear to be a project name.\n") -printhelp () ; -os.exit(1) -- exit the entire lwarpmk script +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") + print ("lwarpmk: ===") + printhelp () ; + os.exit(1) -- exit the entire lwarpmk script else -- file exists -- Read the file: print ("lwarpmk: Reading " .. conffile ..".") @@ -11346,11 +11565,13 @@ linenum = linenum + 1 i,j,cvarname,cvalue = string.find (line,"([%w-_]*)%s*=%s*\"([%w%-_%.]*)\"") ; -- Error if incorrect enclosing characters: if ( i == nil ) then -print ( linenum .. " : " .. line ) ; -print ( "lwarpmk: Incorrect entry in " .. conffile ..".\n" ) ; -printconf () ; -os.exit(1) ; -end + print ("lwarpmk: ===") + print ("lwarpmk: " .. linenum .. " : " .. line ) ; + print ("lwarpmk: Incorrect entry in " .. conffile ..".\n" ) ; + print ("lwarpmk: ===") + printconf () ; + os.exit(1) ; +end -- nil if ( cvarname == "opsystem" ) then -- Verify choice of opsystem: if ( (cvalue == "Unix") or (cvalue == "Windows") ) then @@ -11376,39 +11597,65 @@ elseif ( cvarname == "latexmk" ) then latexmk = cvalue elseif ( cvarname == "language" ) then language = cvalue elseif ( cvarname == "xdyfile" ) then xdyfile = cvalue else -print ( linenum .. " : " .. line ) ; -print ("lwarpmk: Incorrect variable name \"" .. cvarname .. "\" in " .. conffile ..".\n" ) ; -printconf () ; + print ("lwarpmk: ===") + print ("lwarpmk: " .. linenum .. " : " .. line ) ; + print ("lwarpmk: Incorrect variable name \"" .. cvarname .. "\" in " .. conffile ..".\n" ) ; + print ("lwarpmk: ===") + printconf () ; os.exit(1) ; -end +end -- cvarname end -- do scan lines io.close(cfile) end -- file exists +-- Error if sourcename is "lwarp". +-- This could happen if a local copy of lwarp has recently been recompiled. +if sourcename=="lwarp" then + print ("lwarpmk: ===") + print ("lwarpmk: Lwarp has recently been recompiled in this directory,") + print ("lwarpmk: and \"lwarpmk.conf\" is no longer set for your own project.") + print ("lwarpmk: Recompile your own project using pdf/lua/xelatex <projectname>.") + print ("lwarpmk: After a recompile, \"lwarpmk.conf\" will be set for your project,") + print ("lwarpmk: and you may again use lwarpmk.") + print ("lwarpmk: ===") + os.exit(1) +end -- sourcename of "lwarp" -- Select some operating-system commands: if opsystem=="Unix" then -- For Unix / Linux / Mac OS: -rmname = "rm" -mvname = "mv" -touchnamepre = "touch" -touchnamepost = "" -dirslash = "/" -opquote= "\'" + rmname = "rm" + mvname = "mv" + cpname = "cp" + touchnamepre = "touch" + touchnamepost = "" + newtouchname = "touch" + dirslash = "/" + opquote= "\'" + cmdgroupopenname = " ( " + cmdgroupclosename = " ) " + seqname = " ; " + bgname = " &" elseif opsystem=="Windows" then -- For Windows -rmname = "DEL" -mvname = "MOVE" -touchnamepre = "COPY /b" -touchnamepost = "+,," -dirslash = "\\" -opquote= "\"" + rmname = "DEL" + mvname = "MOVE" + cpname = "COPY" + touchnamepre = "COPY /b" + touchnamepost = "+,," + newtouchname = "echo empty >" + dirslash = "\\" + opquote= "\"" + cmdgroupopenname = "" + cmdgroupclosename = "" + seqname = " & " + bgname = "" else print ( "lwarpmk: Select Unix or Windows for opsystem" ) end --- for Windows -- set xindycmd according to pdflatex vs xelatex/lualatex: if ( latexname == "pdflatex" ) then -xindycmd = "texindy -C utf8" -glossarycmd = "xindy -C utf8" + xindycmd = "texindy -C utf8" + glossarycmd = "xindy -C utf8" else -xindycmd = "xindy -M texindy -C utf8" -glossarycmd = "xindy -C utf8" + xindycmd = "xindy -M texindy -C utf8" + glossarycmd = "xindy -C utf8" end end -- loadconf @@ -11429,8 +11676,8 @@ for line in fsource:lines() do if ( string.find(line,"Rerun to get") ~= nil ) then io.close(fsource) return true -end -end +end -- if +end -- do io.close(fsource) return false end @@ -11441,10 +11688,13 @@ end function onetime (fsuffix) print("lwarpmk: Compiling with " .. latexname .. " " .. sourcename..fsuffix) -err = os.execute( --- "echo " .. - latexname .. " " .. sourcename..fsuffix ) -if ( err ~= 0 ) then print ( "lwarpmk: Compile error.") ; os.exit(1) ; end +err = os.execute(latexname .. " " .. sourcename..fsuffix) +if ( err ~= 0 ) then + print ("lwarpmk: ===") + print ("lwarpmk: Compile error.") + print ("lwarpmk: ===") + os.exit(1) +end return (reruntoget(sourcename .. fsuffix .. ".log") ) ; end @@ -11465,8 +11715,10 @@ end function verifyfileexists (filename) if (lfs.attributes ( filename , "modification" ) == nil ) then -print ( "lwarpmk: " .. filename .. " not found." ) ; -os.exit (1) ; + print ("lwarpmk: ===") + print ("lwarpmk: " .. filename .. " not found." ) ; + print ("lwarpmk: ===") + os.exit (1) ; end end @@ -11474,89 +11726,156 @@ end -- Convert <project>_html.pdf into HTML files: function pdftohtml () - -- Convert to text: - print ("lwarpmk: Converting " .. sourcename - .."_html.pdf to " .. sourcename .. "_html.html") - os.execute("pdftotext -enc UTF-8 -nopgbrk -layout " - .. sourcename .. "_html.pdf " .. sourcename .. "_html.html") - -- Split the result into individual HTML files: - splitfile (homehtmlfilename .. ".html" , sourcename .. "_html.html") +-- Convert to text: +print ("lwarpmk: Converting " .. sourcename + .."_html.pdf to " .. sourcename .. "_html.html") +os.execute("pdftotext -enc UTF-8 -nopgbrk -layout " + .. sourcename .. "_html.pdf " .. sourcename .. "_html.html") +-- Split the result into individual HTML files: +splitfile (homehtmlfilename .. ".html" , sourcename .. "_html.html") end -- Remove auxiliary files: function removeaux () - os.execute ( rmname .. " " .. - sourcename ..".aux " .. sourcename .. "_html.aux " .. - sourcename ..".toc " .. sourcename .. "_html.toc " .. - sourcename ..".lof " .. sourcename .. "_html.lof " .. - sourcename ..".lot " .. sourcename .. "_html.lot " .. - sourcename ..".idx " .. sourcename .. "_html.idx " .. - sourcename ..".ind " .. sourcename .. "_html.ind " .. - sourcename ..".log " .. sourcename .. "_html.log " .. - sourcename ..".gl* " .. sourcename .. "_html.gl* " .. - "*_html_inc.*" - ) +os.execute ( rmname .. " " .. + sourcename ..".aux " .. sourcename .. "_html.aux " .. + sourcename ..".toc " .. sourcename .. "_html.toc " .. + sourcename ..".lof " .. sourcename .. "_html.lof " .. + sourcename ..".lot " .. sourcename .. "_html.lot " .. + sourcename ..".idx " .. sourcename .. "_html.idx " .. + sourcename ..".ind " .. sourcename .. "_html.ind " .. + sourcename ..".log " .. sourcename .. "_html.log " .. + sourcename ..".gl* " .. sourcename .. "_html.gl* " .. + "*_html_inc.*" + ) end - - -- Create lateximages based on lateximages.txt: function createlateximages () print ("lwarpmk: Creating lateximages.") -local limagesfile = io.open("lateximages.txt") +local limagesfile = io.open("lateximages.txt", "r") +if ( limagesfile == nil ) then + print ("lwarpmk: ===") + print ("lwarpmk: \"lateximages.txt\" does not exist.") + print ("lwarpmk: Your project does not use SVG math or other lateximages,") + print ("lwarpmk: or the file has been deleted somehow.") + print ("lwarpmk: Use \"lwarpmk html\" to recompile your project,") + print ("lwarpmk: and recreate \"lateximages.txt\".") + print ("lwarpmk: If your project does not use SVG math or other lateximages,") + print ("lwarpmk: then \"lateximages.txt\" will never exist, and") + print ("lwarpmk: \"lwarpmk limages\" will not be necessary.") + print ("lwarpmk: ===") + os.exit(1) +end -- Create the lateximages directory, ignore error if already exists err = os.execute("mkdir lateximages") +-- For Windows, create lwarp_one_limage.cmd: +if opsystem=="Windows" then + err = os.execute ( + cpname .. " lwarp_one_limage.txt lwarp_one_limage.cmd" + ) + if ( err ~= 0 ) then + print ("lwarpmk: ===") + print ("lwarpmk: File error trying to copy to lwarp_one_limage.cmd") + print ("lwarpmk: ===") + os.exit(1) ; + end +end -- create lwarp_one_limage.cmd -- Scan lateximages.txt for line in limagesfile:lines() do -- lwimgpage is the page number in the PDF which has the image --- lwimgnum is the sequential lateximage number to assign for the image -i,j,lwimgpage,lwimgnum = string.find (line,"|(.*)|(.*)|") +-- lwimghash is true if this filename is a hash +-- lwimgname is the lateximage filename root to assign for the image +i,j,lwimgpage,lwimghash,lwimgname = string.find (line,"|(.*)|(.*)|(.*)|") -- For each entry: if ( (i~=nil) ) then +-- Skip is this image is hashed and already exists: +local lwimgfullname = "lateximages" .. dirslash .. lwimgname .. ".svg" +if ( + (lwimghash ~= "true") or + (lfs.attributes(lwimgfullname,"mode")==nil) -- file not exists +) +then -- not hashed or not exists: +-- Print the name of the file being generated: +print ( "lwarpmk: " .. lwimgname ) +-- Touch/create the dest so that only once instance tries to build it: +err = os.execute(newtouchname .. " " .. lwimgfullname) +if ( err ~= 0 ) then + print ("lwarpmk: ===") + print ("lwarpmk: File error trying to touch " .. lwimgfullname) + print ("lwarpmk: ===") + os.exit(1) ; +end -- Separate out the image into its own single-page pdf: +if opsystem=="Unix" then +-- For Unix / Linux / Mac OS: err = os.execute( -"pdfseparate -f " .. lwimgpage .. " -l " .. - lwimgpage .. " " .. sourcename .."_html.pdf lateximagetemp-%d.pdf") +-- print ( +cmdgroupopenname .. +"pdfseparate -f " .. lwimgpage .. " -l " .. lwimgpage .. " " .. + sourcename .."_html.pdf " .. + "lateximages" .. dirslash .."lateximagetemp-%d" .. ".pdf" .. + seqname .. -- Crop the image: -err = os.execute( -"pdfcrop lateximagetemp-" .. lwimgpage ..".pdf lateximage-" .. lwimgnum ..".pdf") -if ( err ~= 0 ) then print ( "lwarpmk: File error.") ; os.exit(1) ; end +"pdfcrop lateximages" .. dirslash .. "lateximagetemp-" .. lwimgpage .. ".pdf " .. + "lateximages" .. dirslash .. lwimgname .. ".pdf" .. + seqname .. -- Convert the image to svg: -err = os.execute( -"pdftocairo -svg lateximage-" .. lwimgnum ..".pdf lateximage-" .. lwimgnum ..".svg") -if ( err ~= 0 ) then print ( "lwarpmk: File error.") ; os.exit(1) ; end --- Move the result into lateximages/: -err = os.execute( -mvname .. " lateximage-" .. lwimgnum ..".svg lateximages" .. dirslash ) -if ( err ~= 0 ) then print ( "lwarpmk: File error.") ; os.exit(1) ; end +"pdftocairo -svg lateximages" .. dirslash .. lwimgname .. ".pdf " .. + "lateximages" .. dirslash .. lwimgname ..".svg" .. + seqname .. -- Remove the temporary files: -err = os.execute( -rmname .. " lateximage-" .. lwimgnum ..".pdf lateximagetemp-" .. lwimgpage ..".pdf") -if ( err ~= 0 ) then print ( "lwarpmk: File error.") ; os.exit(1) ; end +rmname .. " lateximages" .. dirslash .. lwimgname .. ".pdf" .. seqname .. +rmname .. " lateximages" .. dirslash .. "lateximagetemp-" .. lwimgpage .. ".pdf" .. +cmdgroupclosename .. " >/dev/null " .. bgname +) +elseif opsystem=="Windows" then +-- For Windows +err = os.execute ( + "start /b \"\" lwarp_one_limage " .. + lwimgpage .. " " .. + lwimghash .. " " .. + lwimgname .. " " .. + sourcename .. " <nul >nul" +) +end -- Windows +if ( err ~= 0 ) then + print ("lwarpmk: ===") + print ("lwarpmk: File error trying to create one lateximage.") + print ("lwarpmk: ===") + os.exit(1) end +end -- not hashed or not exists +end -- not nil end -- do io.close(limagesfile) +print ( "lwarpmk limages: done" ) end -- function -- Use latexmk to compile source and index: -- fsuffix is "" for print, or "_html" for HTML function compilelatexmk ( fsuffix ) - -- The recorder option is required to detect changes in <project>.tex - -- while we are loading <project>_html.tex. - err=os.execute ( "latexmk -pdf -dvi- -ps- -recorder " - .. "-e " - .. opquote - .. "$makeindex = q/" -- $ - .. xindycmd - .. " -M " .. xdyfile - .. " -L " .. language .. " /" - .. opquote - .. " -pdflatex=\"" .. latexname .." %O %S\" " - .. sourcename..fsuffix ..".tex" ) ; - if ( err ~= 0 ) then print ( "lwarpmk: Compile error.") ; os.exit(1) ; end +-- The recorder option is required to detect changes in <project>.tex +-- while we are loading <project>_html.tex. +err=os.execute ( "latexmk -pdf -dvi- -ps- -recorder " + .. "-e " + .. opquote + .. "$makeindex = q/" -- $ + .. xindycmd + .. " -M " .. xdyfile + .. " -L " .. language .. " /" + .. opquote + .. " -pdflatex=\"" .. latexname .." %O %S\" " + .. sourcename..fsuffix ..".tex" ) ; +if ( err ~= 0 ) then + print ("lwarpmk: ===") + print ("lwarpmk: Compile error.") + print ("lwarpmk: ===") + os.exit(1) +end end @@ -12251,10 +12570,18 @@ end -- not --version % \begin{macro}{\LWR@htmlrefsectionfilename} \marg{label} % % Prints the filename for the given label +% +% \changes{v0.50}{2018/02/20}{Fix: SVG math in a section name.} % \begin{macrocode} \newcommand*{\LWR@htmlrefsectionfilename}[1]{% \LWR@traceinfo{LWR@htmlrefsectionfilename: !\detokenize{#1}!}% +% \end{macrocode} +% \cs{LWR@nullfonts} to allow math in a section name. +% \begin{macrocode} +\begingroup% +\LWR@nullfonts% \LWR@htmlsectionfilename{\LWR@htmlfileref{#1}}% +\endgroup% \LWR@traceinfo{LWR@htmlrefsectionfilename: done}% } % \end{macrocode} @@ -12636,6 +12963,7 @@ end -- not --version #1% \protect\LWR@origtextgreater% \endgroup% +\LWR@traceinfo{LWR@htmltagc: done}% }% } % \end{macrocode} @@ -12963,7 +13291,10 @@ end -- not --version % \begin{macrocode} \begin{warpHTML} \NewDocumentEnvironment{BlockClass}{o m}% -{\LWR@htmldivclass[#1]{#2}} +{% + \LWR@origpar% + \LWR@htmldivclass[#1]{#2}% +} {\LWR@htmldivclassend{#2}} \end{warpHTML} % \end{macrocode} @@ -12986,6 +13317,7 @@ end -- not --version % \begin{macrocode} \begin{warpHTML} \newcommand{\BlockClassSingle}[2]{% +\LWR@origpar% \LWR@htmlelementclassline{div}{#1}{#2}% } \end{warpHTML} @@ -13798,8 +14130,9 @@ end -- not --version \color@begingroup% % \end{macrocode} % Use \HTML\ superscripts even inside a \env{lateximage}: +% \changes{v0.50}{2018/02/20}{Robustify macros.} % \begin{macrocode} - \renewcommand{\textsuperscript}[1]{\LWR@htmlspan{sup}{##1}}% + \renewrobustcmd{\textsuperscript}[1]{\LWR@htmlspan{sup}{##1}}% % \end{macrocode} % Use paragraph tags if in a tabular data cell or a \env{lateximage}: % \begin{macrocode} @@ -14145,17 +14478,17 @@ end -- not --version \newcommand*{\LWR@filenamenoblanks}[1]{% \begingroup % \end{macrocode} - +% % Locally temporarily disable direct-formatting commands, % not used in filenames: % \begin{macrocode} \LWR@nullfonts% \renewcommand*{\LWR@htmltagc}[1]{}% % \end{macrocode} -% Replaces common symbols and short words with hyphens: % +% Replaces common symbols and short words with hyphens: % \begin{macrocode} -\LWR@traceinfo{LWR@filenamenoblanks \#1: !#1!}% +% \LWR@traceinfo{LWR@filenamenoblanks \#1: !#1!}% \edef\LWR@thisnewfilename{#1}% \LWR@traceinfo{LWR@filenamenoblanks edef: !\LWR@thisnewfilename!}% \fullexpandarg% @@ -14279,7 +14612,7 @@ end -- not --version % navigation, side TOC, header, and starts the text body. % \begin{macrocode} \newcommand*{\LWR@newhtmlfile}[1]{ -\LWR@traceinfo{LWR@newhtmlfile: !#1!} +\LWR@traceinfo{LWR@newhtmlfile} % \end{macrocode} % At the bottom of the ending file: @@ -14337,12 +14670,20 @@ end -- not --version % where to split the files apart. % Uses pipe-separated fields for |split_html.gawk|. % Uses monospaced font with ligatures disabled for everything except the title. +% +% \changes{v0.50}{2018/02/20}{Fix: SVG math in a section name.} % \begin{macrocode} \LWR@traceinfo{LWR@newhtmlfile: about to print start file}% +% \end{macrocode} +% \cs{LWR@nullfonts} to allow math in a section name. +% \begin{macrocode} +\begingroup% +\LWR@nullfonts% \LWR@htmlblockcomment{% |Start file|% \LWR@htmlsectionfilename{\LWR@thisfilename}|% } +\endgroup% % \end{macrocode} % At the top of the starting file: @@ -15151,14 +15492,11 @@ end -- not --version % Locally temporarily disable direct-formatting commands: % \begin{macrocode} \begingroup -\LWR@traceinfo{LWR@filestart: A} \LWR@nullfonts -\LWR@traceinfo{LWR@filestart: B} % \end{macrocode} % Create the page's \HTML\ header: % \begin{macrocode} \LWR@htmltag{!DOCTYPE html}\LWR@orignewline -\LWR@traceinfo{LWR@filestart: C} % \end{macrocode} % The language is user-adjustable: % \begin{macrocode} @@ -16438,8 +16776,13 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% % Use a mono-spaced font to preserve horizontal positioning. % If horizontal alignment is important for the user, use a mono-spaced font % in the \CSS\ for the |verse| class. +% \changes{v0.50}{2018/03/02}{Improved column alignment.} % \begin{macrocode} \begingroup% +% \end{macrocode} +% \changes{v0.50}{2018/03/02}{Improved column alignment.} +% \begin{macrocode} +\LWR@orignormalsize% \LWR@origttfamily% % \end{macrocode} % Since inside a \element{pre}, restore the original list processing: @@ -19653,7 +19996,7 @@ rowspan="#2" % % % If not |\@ifpackageloaded{multirow}| but \cs{@xmultirow} is defined, % then this must be v1.6 or earlier, which did not |\ProvidesPackage{multirow}|, -% and did not have the |vposn| option. +% and did not have the \optn{vposn} option. % % \begin{macrocode} {% v1.6 or older did not \ProvidePackage @@ -20524,7 +20867,7 @@ rowspan="#2" % % % \begin{macro}{\LWR@htmlfileref} \marg{label} % \changes{v0.24}{2017/03/13}{Fix: Index links while \cs{tracinglwarp}.} -% Returns the file number for this label: +% Returns the file number or name for this label: % \begin{macrocode} \newcommand*{\LWR@htmlfileref}[1]{% % \end{macrocode} @@ -20946,7 +21289,6 @@ autopage-\theLWR@currentautosec% % \marg{filename} \marg{extension} \marg{style} % % \changes{v0.18}{2016/05/18}{Surpress extra space.} -% % \begin{macrocode} \newcommand*{\LWR@subinlineimage}[5][]{% \ifblank{#1}% @@ -21122,7 +21464,7 @@ autopage-\theLWR@currentautosec% % \DescribeCounter{LWR@thisautoidWP} % A sequential counter for all word processor conversion \element{div}s. -% This is used to convince LibreOffice to form a frame around this element. +% This is used to convince \brand{LibreOffice} to form a frame around this element. % \changes{v0.45}{2017/12/09}{Separate \ctr{LWR@thisautoidWP} for word processor \element{div}s.} % \begin{macrocode} \newcounter{LWR@thisautoidWP} @@ -22222,6 +22564,12 @@ autopage-\theLWR@currentautosec% \let\rlap\LWR@origrlap% \let\hfilneg\LWR@orighfilneg% % \end{macrocode} +% \changes{v0.50}{2018/02/22}{Fix: \cs{centering}, etc. in \SVG\ math, \env{lateximage}, \tikz.} +% \begin{macrocode} +\let\raggedright\LWR@origraggedright +\let\raggedleft\LWR@origraggedleft +\let\centering\LWR@origcentering +% \end{macrocode} % \begin{macrocode} \let\,\LWR@origcomma% disable HTML short unbreakable space \let\textellipsis\LWR@origtextellipsis% @@ -22419,13 +22767,21 @@ autopage-\theLWR@currentautosec% % \end{macrocode} % For SVG, print the math inside a \env{lateximage}, % with an \element{alt} tag of the \LaTeX\ code: +% \changes{v0.50}{2018/02/24}{Improved \SVG\ math \attribute{alt} tags.} +% \changes{v0.50}{2018/03/02}{Improved \SVG\ math display.} % \begin{macrocode} {% not mathjax + \begin{BlockClass}{displaymath} \begin{lateximage}% - [\textbackslash{[} \LWR@HTMLsanitize{#1} \textbackslash{]}]% + [% + \textbackslash{[} % extra space + \LWR@HTMLsanitize{#1} % extra space + \textbackslash{]}% + ]% \LWR@origdollar\LWR@origdollar#1\LWR@origdollar\LWR@origdollar% \end{lateximage}% + \end{BlockClass} }% not mathjax }% @@ -22434,25 +22790,45 @@ autopage-\theLWR@currentautosec% % % % -% \begin{macro}{\LWR@singledollar} -% Redefine the single dollar sign to place math inside a \env{lateximage}, or use \brand{MathJax}: +% \begin{macro}{\LWR@subsingledollar} \marg{alt text} \marg{math expression} +% Redefine the single dollar sign to place math inside a \env{lateximage}, +% or use \brand{MathJax}: +% If the \attribute{alt} text is empty, the math expression is used +% for the \attribute{alt} text. % % \changes{v0.19}{2016/05/25}{\brand{MathJax} support.} % \changes{v0.42}{2017/10/26}{If \progcode{FormatWP} print LaTeX expression.} % \changes{v0.47}{2018/01/24}{Added \SVG\ math image baseline adjust and em sizing.} +% \changes{v0.50}{2018/02/23}{Fix: Use \env{lateximage} even if MathJax.} +% \changes{v0.50}{2018/02/24}{Improved \SVG\ math \attribute{alt} tags.} % \begin{macrocode} \newlength{\LWR@singledollarwidth} \newlength{\LWR@singledollarheight} \newlength{\LWR@singledollardepth} -\protected\gdef\LWR@subsingledollar#1{% +\protected\gdef\LWR@subsingledollar#1#2{% \begingroup% -\ifboolexpr{bool{mathjax} or ( bool{FormatWP} and bool{WPMarkMath} ) }% +% \end{macrocode} +% MathJax cannot parse the often complicated \TeX\ expressions which +% appear in the various uses of \cs{ensuredmath}. +% \cs{ensuremath} forces the \attribute{alt} tag to ``|math image|''. +% If this is the case, force the use of a \env{lateximage} even if MathJax. +% Likewise for \pkg{siunitx} if |parse-numbers=false|. +% +% If MathJax, or if formatting math for a word processor, print the math expression. +% \begin{macrocode} +\ifboolexpr{% + ( + bool{mathjax} or + ( bool{FormatWP} and bool{WPMarkMath} ) + ) and + ( not test { \ifstrequal {#1} {math image} } ) +}% % \end{macrocode} % For \brand{MathJax}, print the math between |\(| and |\)|: % \begin{macrocode} {% - {\textbackslash(\LWR@HTMLsanitize{#1}\textbackslash)}% + {\textbackslash(\LWR@HTMLsanitize{#2}\textbackslash)}% }% mathjax % \end{macrocode} % For SVG, print the math inside a \env{lateximage}, @@ -22466,13 +22842,13 @@ autopage-\theLWR@currentautosec% \LWR@restoreorigformatting% \LWR@orignormalsize% \global\setlength{\LWR@singledollardepth}{\depthof{% - \LWR@origdollar#1\LWR@origdollar% + \LWR@origdollar#2\LWR@origdollar% }*\real{.8}}% \global\setlength{\LWR@singledollarwidth}{\widthof{% - \LWR@origdollar#1\LWR@origdollar% + \LWR@origdollar#2\LWR@origdollar% }*\real{.8}}% \global\setlength{\LWR@singledollarheight}{\totalheightof{% - \LWR@origdollar#1\LWR@origdollar% + \LWR@origdollar#2\LWR@origdollar% }*\real{.8}}% % \end{macrocode} % \changes{v0.49}{2018/02/18}{Fix: Incorrect \PDF\ output size corrupted \HTML.} @@ -22485,28 +22861,28 @@ autopage-\theLWR@currentautosec% % user's selected font size. % Start with the larger of width or height: % \begin{macrocode} -% \ifdimgreater{\LWR@singledollarwidth}{\LWR@singledollarheight}{% -% \def\LWR@singledollarstyle{% -% width:\LWR@convertto{em}{\the\LWR@singledollarwidth} em% -% }% -% }{% + \ifdimgreater{\LWR@singledollarwidth}{\LWR@singledollarheight}{% + \def\LWR@singledollarstyle{% + width:\LWR@convertto{em}{\the\LWR@singledollarwidth} em% + }% + }{% \def\LWR@singledollarstyle{% height:\LWR@convertto{em}{\the\LWR@singledollarheight }em% }% -% }% + }% % \end{macrocode} % If narrow width, use the height. Single-letter variables look best if they all are % scaled according to height. % \begin{macrocode} -% \ifdimless{\LWR@singledollarwidth}{.8em}% -% {% -% \def\LWR@singledollarstyle{% -% height:\LWR@convertto{em}{\the\LWR@singledollarheight }em% -% }% -% }% -% {}% + \ifdimless{\LWR@singledollarwidth}{.8em}% + {% + \def\LWR@singledollarstyle{% + height:\LWR@convertto{em}{\the\LWR@singledollarheight }em% + }% + }% + {}% % \end{macrocode} -% If extremely thin, use the width: +% If extremely wide and short, use the width: % \begin{macrocode} \ifdimless{\LWR@singledollarheight}{.3em}% {% @@ -22521,7 +22897,10 @@ autopage-\theLWR@currentautosec% % \begin{macrocode} \ifdimgreater{\LWR@singledollardepth}{0.01em}{% \def\LWR@singledollardepthstyle{% - \ ; \LWR@origmbox{vertical-align:-\LWR@convertto{em}{\the\LWR@singledollardepth} em} % + \ ; % extra space + \LWR@origmbox{% + vertical-align:-\LWR@convertto{em}{\the\LWR@singledollardepth} em% + } % extra space }% }{% \def\LWR@singledollardepthstyle{}% @@ -22529,18 +22908,34 @@ autopage-\theLWR@currentautosec% % \end{macrocode} % Create the \env{lateximage} using the alternate tag and the computed % size and depth. -% \begin{macrocode} - \begin{lateximage}% - [\textbackslash( \LWR@HTMLsanitize{#1} \textbackslash)]% - [\LWR@singledollarstyle \LWR@singledollardepthstyle]% - \LWR@origdollar#1\LWR@origdollar% +% The star causes \env{lateximage} to use an MD5 hash as the filename. +% \changes{v0.50}{2018/02/22}{MD5 hash avoids duplicate \SVG\ math.} +% \begin{macrocode} + \ifblank{#1}{% + \begin{lateximage}*% + [% + \textbackslash( % + \LWR@HTMLsanitize{#2} % extra space + \textbackslash)% + ]% + [\LWR@singledollarstyle \LWR@singledollardepthstyle]% + }{% + \begin{lateximage}% + [#1]% + [\LWR@singledollarstyle \LWR@singledollardepthstyle]% + }% + \LWR@origdollar#2\LWR@origdollar% \end{lateximage}% }% \endgroup% } +% \end{macrocode} +% \end{macro} +% \begin{macro}{\LWR@singledollar} \marg{alt text} \marg{math expression} +% \begin{macrocode} \protected\gdef\LWR@singledollar#1${% -\LWR@subsingledollar{#1}% +\LWR@subsingledollar{}{#1}% } % \end{macrocode} % \end{macro} @@ -22560,19 +22955,39 @@ autopage-\theLWR@currentautosec% -% \begin{macro}{\@ensuredmath} \marg{expression} Not yet adapted to \pkg{lwarp}. +% \begin{macro}{\@ensuredmath} \marg{expression} % % \changes{v0.42}{2017/10/16}{Improved \cs{ensuremath}.} -% +% \changes{v0.50}{2018/02/23}{Fix: Use \env{lateximage} even if MathJax.} +% \changes{v0.50}{2018/02/24}{Improved \SVG\ math \attribute{alt} tags.} % \begin{macrocode} \LetLtxMacro\LWR@origensuredmath\@ensuredmath \renewcommand{\@ensuredmath}[1]{% +\ifbool{mathjax}{% +% \end{macrocode} +% If MathJax, a \env{lateximage} is used, since \cs{ensuremath} is +% often used for complex \TeX\ expressions which MathJax may not render. +% \begin{macrocode} +% \begin{lateximage}[math image] +% \LWR@origensuredmath{#1} +% \end{lateximage} + \LWR@subsingledollar{math image}{\relax#1}% +}{% SVG math +% \end{macrocode} +% If already inside a \env{lateximage} in math mode, continue as-is. +% \begin{macrocode} \ifmmode% \LWR@origensuredmath{#1}% \else% - \LWR@subsingledollar{\relax#1}% +% \end{macrocode} +% Create an inline math \env{lateximage}, +% but don't use the expression as the \attribute{alt} tag, since +% the expression may be complex internal code used to draw a math expression. +% \begin{macrocode} + \LWR@subsingledollar{math image}{\relax#1}% \fi% +}% } % \end{macrocode} % \end{macro} @@ -22797,10 +23212,14 @@ autopage-\theLWR@currentautosec% {% not mathjax % \end{macrocode} % Begin the \env{lateximage} with an \element{alt} tag containing the math source: +% \changes{v0.50}{2018/03/02}{Improved \SVG\ math display.} % \begin{macrocode} - \begin{lateximage}[(\LWR@equationtag) \textbackslash{begin\{equation\}} % - \LWR@HTMLsanitizeexpand{\detokenize\expandafter{\BODY}} % - \textbackslash{end\{equation\}}]% alt tag + \begin{BlockClass}{displaymathnumbered} + \begin{lateximage}[% + (\LWR@equationtag) \textbackslash{begin\{equation\}} % extra space + \LWR@HTMLsanitizeexpand{\detokenize\expandafter{\BODY}} % extra space + \textbackslash{end\{equation\}}% + ]% alt tag % \end{macrocode} % Create the actual \LaTeX-formatted equation inside % the |lateximage| using the contents of the environment. @@ -22809,6 +23228,7 @@ autopage-\theLWR@currentautosec% \BODY% contents collected by NewEnviron \LWR@origendequation \end{lateximage}% + \end{BlockClass} }% not mathjax % \end{macrocode} @@ -23027,7 +23447,9 @@ autopage-\theLWR@currentautosec% % For numbered \SVG\ equations, first create a \env{lateximage} with % an \attribute{alt} attribute containing sanitized copy of the source code: % \changes{v0.42}{2017/10/12}{Fix: Numbering and naming AMS math environments.} +% \changes{v0.50}{2018/03/02}{Improved \SVG\ math display.} % \begin{macrocode} + \begin{BlockClass}{displaymathnumbered} \begin{lateximage}[(\LWR@startingequationtag--\LWR@equationtag) \LWR@addmathjax{eqnarray}{\BODY}] % \end{macrocode} @@ -23037,17 +23459,21 @@ autopage-\theLWR@currentautosec% \BODY \LWR@origendeqnarray \end{lateximage} + \end{BlockClass} }% {% not LWR@numbereqnarray % \end{macrocode} % If not numbered, do the same, but an extra \cs{nonumber} seems to be required: +% \changes{v0.50}{2018/03/02}{Improved \SVG\ math display.} % \begin{macrocode} + \begin{BlockClass}{displaymath} \begin{lateximage}[\LWR@addmathjax{eqnarray*}{\BODY}] \LWR@origeqnarray \BODY \nonumber \LWR@origendeqnarray \end{lateximage} + \end{BlockClass} }% LWR@numbereqnarray }% not mathjax % \end{macrocode} @@ -23078,7 +23504,8 @@ autopage-\theLWR@currentautosec% % % The following \AmS\ environments are more easily patched in-place: % -% \changes{v0.44}{2017/11/16}{\pkg{AMS environments}: Fix: Groups for lateximages.} +% \changes{v0.44}{2017/11/16}{AMS environments: Fix: Groups for \env{lateximage}s.} +% \changes{v0.50}{2018/03/01}{AMS environments: Improved \SVG\ math display.} % % \begin{environment}{multline} % \begin{macrocode} @@ -23091,6 +23518,7 @@ autopage-\theLWR@currentautosec% \LWR@beginhideamsmath } { + \begin{BlockClass}{displaymathnumbered} \begin{lateximage}[\LWR@amsmathbodynumbered{multline}] } } @@ -23103,7 +23531,7 @@ autopage-\theLWR@currentautosec% \boolfalse{LWR@amsmultline} \LWR@addmathjax{multline}{\the\@envbody} } -{\end{lateximage}} +{\end{lateximage}\end{BlockClass}} } % \end{macrocode} @@ -23121,6 +23549,7 @@ autopage-\theLWR@currentautosec% \LWR@beginhideamsmath } { + \begin{BlockClass}{displaymath} \begin{lateximage}[\LWR@amsmathbody{multline*}] } } @@ -23133,7 +23562,7 @@ autopage-\theLWR@currentautosec% \boolfalse{LWR@amsmultline} \LWR@addmathjax{multline*}{\the\@envbody} } -{\end{lateximage}} +{\end{lateximage}\end{BlockClass}} } @@ -23152,6 +23581,7 @@ autopage-\theLWR@currentautosec% \LWR@beginhideamsmath } { + \begin{BlockClass}{displaymathnumbered} \begin{lateximage}[\LWR@amsmathbodynumbered{gather}] } } @@ -23163,7 +23593,7 @@ autopage-\theLWR@currentautosec% \LWR@endhideamsmath \LWR@addmathjax{gather}{\the\@envbody} } -{\end{lateximage}} +{\end{lateximage}\end{BlockClass}} } % \end{macrocode} @@ -23180,6 +23610,7 @@ autopage-\theLWR@currentautosec% \LWR@beginhideamsmath } { + \begin{BlockClass}{displaymath} \begin{lateximage}[\LWR@amsmathbody{gather*}] } } @@ -23191,7 +23622,7 @@ autopage-\theLWR@currentautosec% \LWR@endhideamsmath \LWR@addmathjax{gather*}{\the\@envbody} } -{\end{lateximage}} +{\end{lateximage}\end{BlockClass}} } % \end{macrocode} @@ -23209,6 +23640,7 @@ autopage-\theLWR@currentautosec% \LWR@beginhideamsmath } { + \begin{BlockClass}{displaymathnumbered} \begin{lateximage}[\LWR@amsmathbodynumbered{align}] } } @@ -23220,7 +23652,7 @@ autopage-\theLWR@currentautosec% \LWR@endhideamsmath \LWR@addmathjax{align}{\the\@envbody} } -{\end{lateximage}} +{\end{lateximage}\end{BlockClass}} } % \end{macrocode} @@ -23238,6 +23670,7 @@ autopage-\theLWR@currentautosec% \LWR@beginhideamsmath } { + \begin{BlockClass}{displaymath} \begin{lateximage}[\LWR@amsmathbody{align*}] } } @@ -23249,7 +23682,7 @@ autopage-\theLWR@currentautosec% \LWR@endhideamsmath \LWR@addmathjax{align*}{\the\@envbody} } -{\end{lateximage}} +{\end{lateximage}\end{BlockClass}} } % \end{macrocode} @@ -23267,6 +23700,7 @@ autopage-\theLWR@currentautosec% \LWR@beginhideamsmath } { + \begin{BlockClass}{displaymathnumbered} \begin{lateximage}[\LWR@amsmathbodynumbered{flalign}] } } @@ -23278,7 +23712,7 @@ autopage-\theLWR@currentautosec% \LWR@endhideamsmath \LWR@addmathjax{flalign}{\the\@envbody} } -{\end{lateximage}} +{\end{lateximage}\end{BlockClass}} } % \end{macrocode} @@ -23296,6 +23730,7 @@ autopage-\theLWR@currentautosec% \LWR@beginhideamsmath } { + \begin{BlockClass}{displaymath} \begin{lateximage}[\LWR@amsmathbody{flalign*}] } } @@ -23307,7 +23742,7 @@ autopage-\theLWR@currentautosec% \LWR@endhideamsmath \LWR@addmathjax{flalign*}{\the\@envbody} } -{\end{lateximage}} +{\end{lateximage}\end{BlockClass}} } % \end{macrocode} @@ -23590,7 +24025,7 @@ autopage-\theLWR@currentautosec% % \subsection{HTML \element{alt} tags} -% \begin{macro}{\LWR@amsmathbody} \marg{envname} +% \begin{macro}{\LWR@amsmathbody} \marg{envname} \qquad % For use inside the optional argument to a \env{lateximage} % to add the contents of a AMS math environment to the \element{alt} tag. % @@ -23599,14 +24034,14 @@ autopage-\theLWR@currentautosec% % \begin{macrocode} \newcommand*{\LWR@amsmathbody}[1] {% -\textbackslash\{begin\}\{#1\} % +\textbackslash\{begin\}\{#1\} % extra space \LWR@HTMLsanitizeexpand{\detokenize\expandafter{\the\@envbody}}% \textbackslash\{end\}\{#1\}% } % \end{macrocode} % \end{macro} -% \begin{macro}{\LWR@amsmathbodynumbered} \marg{envname} +% \begin{macro}{\LWR@amsmathbodynumbered} \marg{envname} \qquad % For use inside the optional argument to a \env{lateximage} % to add the contents of a AMS math environment to the \element{alt} tag, % prefixed by the equation numbers. @@ -23618,8 +24053,8 @@ autopage-\theLWR@currentautosec% {% \ifnumcomp{\value{LWR@startingequation}}{=}{\value{equation}}% {(\LWR@equationtag)}% -{(\LWR@startingequationtag--\LWR@equationtag)} % -\LWR@amsmathbody{#1} % +{(\LWR@startingequationtag--\LWR@equationtag)} % extra space +\LWR@amsmathbody{#1} % extra space } % \end{macrocode} % \end{macro} @@ -23627,7 +24062,17 @@ autopage-\theLWR@currentautosec% % \subsection{\env{lateximage}} -% \begin{environment}{lateximage} \oarg{\element{alt} tag} \oarg{CSS style} +% \begin{environment}{lateximage} * \oarg{\element{alt} tag} \oarg{CSS style} +% +% Typesets the contents and then renders the result as an \SVG\ file. +% +% The optional \element{alt} tag is included in the \HTML\ code for use with copy/paste. +% +% The starred version also uses the \element{alt} tag to create an MD5 hash which is +% used as the image's filename. This is used for \SVG\ math expressions, and +% may also be of some use for the document creator. +% The use of the hash for the filename means that identical expressions will all share a +% single file, and the file must be converted to \SVG\ only a single time. % % \changes{v0.18}{2016/05/18}{Surpress extra space.} % \changes{v0.18}{2016/05/18}{pdfcrop: -{}-hires added.} @@ -23644,7 +24089,7 @@ autopage-\theLWR@currentautosec% % \begin{macrocode} \catcode`\$=\active% -\NewDocumentEnvironment{lateximage}{O{image}O{}} +\NewDocumentEnvironment{lateximage}{s O{image} O{}} {% \LWR@traceinfo{lateximage: starting on \jobname.pdf page \arabic{page}}% % \end{macrocode} @@ -23704,11 +24149,24 @@ autopage-\theLWR@currentautosec% class="lateximagesource"}% % \end{macrocode} % Write instructions to the |lateximages.txt| file: +% \changes{v0.50}{2018/02/22}{MD5 hash avoids duplicate \SVG\ math.} % \begin{macrocode} \LWR@traceinfo{lateximage: about to write to lateximages.txt}% - \immediate\write\LWR@lateximagesfile{% - |\arabic{LWR@LIpage}|\arabic{LWR@externalfilecnt}|% - }% + \IfBooleanTF{#1}% starred + {% hash + \LWR@traceinfo{lateximage: hash true}% + \edef\LWR@hashedname{\LWR@mdfive{\detokenize\expandafter{#2}}}% + \LWR@traceinfo{lateximage: hash is \LWR@hashedname}% + \immediate\write\LWR@lateximagesfile{% + |\arabic{LWR@LIpage}|true|\LWR@hashedname|% + }% + }% hash + {% no hash + \LWR@traceinfo{lateximage: hash false}% + \immediate\write\LWR@lateximagesfile{% + |\arabic{LWR@LIpage}|false|lateximage-\arabic{LWR@externalfilecnt}|% + }% + }% no hash % \end{macrocode} % Place an open comment tag. % This will hide any traces of the lateximage \PDF\ page which were picked up by @@ -23752,6 +24210,7 @@ autopage-\theLWR@currentautosec% \LWR@traceinfo{lateximage: finished creating the label}% % \end{macrocode} % Enable print-mode math functions: +% \changes{v0.50}{2018/02/20}{Fix: SVG math in a section name.} % \begin{macrocode} \LetLtxMacro$\LWR@origdollar% \catcode`\$=3% math shift @@ -23797,9 +24256,23 @@ autopage-\theLWR@currentautosec% % \end{macrocode} % Create a link to the lateximage, allowing its natural height: % \changes{v0.47}{2018/01/26}{Fix: Line wrap at \HTML\ hyphen.} +% \changes{v0.50}{2018/02/22}{MD5 hash avoids duplicate \SVG\ math.} % \begin{macrocode} - \LWR@subinlineimage[#1]{lateximage}% - {lateximages\OSPathSymbol{}\LWR@origmbox{lateximage-\theLWR@externalfilecnt}}{svg}{#2}% + \IfBooleanTF{#1}% starred + {% hash + \LWR@subinlineimage[#2]{lateximage}% + {% + lateximages\OSPathSymbol% + \LWR@origmbox{\LWR@hashedname}% + }{svg}{#3}% + }% hash + {% no hash + \LWR@subinlineimage[#2]{lateximage}% + {% + lateximages\OSPathSymbol% + \LWR@origmbox{lateximage-\theLWR@externalfilecnt}% + }{svg}{#3}% + }% no hash % \end{macrocode} % Be sure that are doing a paragraph: % \begin{macrocode} @@ -23835,7 +24308,7 @@ autopage-\theLWR@currentautosec% % % \changes{v0.48}{2018/02/02}{Print mode boxed to natural width.} % \begin{macrocode} -\NewDocumentEnvironment{lateximage}{o o} +\NewDocumentEnvironment{lateximage}{s o o} {\begin{varwidth}[b]{\linewidth}} {\end{varwidth}} % \end{macrocode} @@ -23988,14 +24461,30 @@ autopage-\theLWR@currentautosec% % Options for siunitx: +% \changes{v0.50}{2018/02/24}{\pkg{siunitx}: Improved units.} % \begin{macrocode} +\newrobustcmd{\LWR@siunitx@textcelsius}{\HTMLentity{deg}C} +\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}}} + +\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{ detect-mode=true, per-mode=symbol, % fraction is not seen by pdftotext -% text-celsius = {\protect\LWRsiunitx@degree{}C}, -% text-degree = {\protect\LWRsiunitx@degree}, + text-celsius = {\LWR@siunitx@textcelsius}, + text-degree = {\LWR@siunitx@textdegree}, + text-arcminute = {\LWR@siunitx@textprime} , + text-arcsecond = {\LWR@siunitx@textdblprime} , }{siunitx} - % \end{macrocode} % \begin{macrocode} @@ -24552,7 +25041,8 @@ autopage-\theLWR@currentautosec% % \label{sec:footnotesminipageplaced} % % -% \DescribeBoolean{LWR@minipagefullwidth} Should the next minipage have no \HTML\ |width|? +% \DescribeBoolean{LWR@minipagefullwidth} Should the next minipage +% have no \HTML\ |width|? % \begin{macrocode} \newbool{LWR@minipagefullwidth} \boolfalse{LWR@minipagefullwidth} @@ -25132,7 +25622,7 @@ width:\LWR@printlength{\LWR@tempwidth}% % \begin{macro}{\LWR@HTMLtextstyle} \marg{FormatWP style} \marg{class} \marg{text} % % If |FormatWP|, adds an explicit style to the text span class. -% This is used by LibreOffice to mark its imported text using the given style. +% This is used by \brand{LibreOffice} to mark its imported text using the given style. % \changes{v0.42}{2017/10/20}{Added.} % \begin{macrocode} \DeclareRobustCommand{\LWR@HTMLtextstyle}[3]{% @@ -25279,6 +25769,12 @@ width:\LWR@printlength{\LWR@tempwidth}% % \begin{macro}{\LWR@nullfonts} Removes formatting during filename operations. +% +% \textcolor{red}{Use only inside a group.}\watchout +% +% The following are \emph{not} made robust, +% since they must be expanded to their nullified versions. +% % \changes{v0.34}{2017/08/05}{Improved font control.} % \changes{v0.36}{2017/08/15}{Fix: Filenames while using \brand{MathJax}.} % \changes{v0.40}{2017/09/21}{Fix: Long arguments for expandable command.} @@ -25308,23 +25804,40 @@ width:\LWR@printlength{\LWR@tempwidth}% \LetLtxMacro{\itshape}{\LWR@nullitshape}% \LetLtxMacro{\em}{\LWR@nullem}% \LetLtxMacro{\normalfont}{\LWR@nullnormalfont}% +% \end{macrocode} +% \changes{v0.50}{2018/02/20}{Robustify macros.} +% \begin{macrocode} \renewcommand*{\,}{-}% \renewcommand*{~}{-}% +\renewcommand*{\newline}{ }% \renewcommand*{\textellipsis}{-}% +% \end{macrocode} +% \begin{macrocode} \renewcommand*{\HTMLunicode}[1]{-}% \renewcommand*{\HTMLentity}[1]{-}% % \end{macrocode} % Ampersand becomes ``and'', which is a short word and is then removed from the filename. % \begin{macrocode} \renewcommand*{\&}{and}% +% \end{macrocode} +% \begin{macrocode} \renewcommand{\textsuperscript}[1]{##1}% \renewcommand{\textsubscript}[1]{##1}% -\LetLtxMacro\underline\LWR@origunderline% +% \end{macrocode} +% \changes{v0.50}{2018/02/20}{Fix: \cs{underline} in sectioning file name.} +% \begin{macrocode} +\renewcommand{\underline}[1]{##1}% +% \end{macrocode} +% \begin{macrocode} \RenewDocumentCommand{\LWR@htmlspanclass}{o m +m}{##3}% \DeclareExpandableDocumentCommand{\InlineClass}{+o +m +m}{##3}% \DeclareRobustCommand{\LWR@HTMLtextstyle}[3]{##3}% -\DeclareRobustCommand{\LWR@subsingledollar}[1]{}% -\renewcommand*{\newline}{ }% +% \end{macrocode} +% Nullify math macros. +% \begin{macrocode} +\def\(##1\){}% +\def\[##1\]{}% +\renewcommand{\LWR@subsingledollar}[2]{} } % \end{macrocode} % \end{macro} @@ -25359,57 +25872,59 @@ width:\LWR@printlength{\LWR@tempwidth}% % \end{macro} % \changes{v0.48}{2018/02/02}{Improved font control.} +% \changes{v0.50}{2018/02/20}{Robustify macros.} +% % \begin{macro}{\mdseries} % \begin{macrocode} -\renewcommand*{\mdseries}{\renewcommand*{\LWR@f@series}{md}} +\renewrobustcmd*{\mdseries}{\renewcommand*{\LWR@f@series}{md}} % \end{macrocode} % \end{macro} % \begin{macro}{\bfseries} % \begin{macrocode} -\renewcommand*{\bfseries}{\renewcommand*{\LWR@f@series}{bf}} +\renewrobustcmd*{\bfseries}{\renewcommand*{\LWR@f@series}{bf}} % \end{macrocode} % \end{macro} % \begin{macro}{\rmfamily} % \begin{macrocode} -\renewcommand*{\rmfamily}{\renewcommand*{\LWR@f@family}{rm}} +\renewrobustcmd*{\rmfamily}{\renewcommand*{\LWR@f@family}{rm}} % \end{macrocode} % \end{macro} % \begin{macro}{\sffamily} % \begin{macrocode} -\renewcommand*{\sffamily}{\renewcommand*{\LWR@f@family}{sf}} +\renewrobustcmd*{\sffamily}{\renewcommand*{\LWR@f@family}{sf}} % \end{macrocode} % \end{macro} % \begin{macro}{\ttfamily} % \begin{macrocode} -\renewcommand*{\ttfamily}{\renewcommand*{\LWR@f@family}{tt}} +\renewrobustcmd*{\ttfamily}{\renewcommand*{\LWR@f@family}{tt}} % \end{macrocode} % \end{macro} % \begin{macro}{\upshape} % \begin{macrocode} -\renewcommand*{\upshape}{\renewcommand*{\LWR@f@shape}{up}} +\renewrobustcmd*{\upshape}{\renewcommand*{\LWR@f@shape}{up}} % \end{macrocode} % \end{macro} % \begin{macro}{\itshape} % \begin{macrocode} -\renewcommand*{\itshape}{\renewcommand*{\LWR@f@shape}{it}} +\renewrobustcmd*{\itshape}{\renewcommand*{\LWR@f@shape}{it}} % \end{macrocode} % \end{macro} % \begin{macro}{\scshape} % \begin{macrocode} -\renewcommand*{\scshape}{\renewcommand*{\LWR@f@shape}{sc}} +\renewrobustcmd*{\scshape}{\renewcommand*{\LWR@f@shape}{sc}} % \end{macrocode} % \end{macro} % \begin{macro}{\normalfont} % \begin{macrocode} -\renewcommand*{\normalfont}{\rmfamily\mdseries\upshape} +\renewrobustcmd*{\normalfont}{\rmfamily\mdseries\upshape} % \end{macrocode} % \end{macro} @@ -25433,8 +25948,9 @@ width:\LWR@printlength{\LWR@tempwidth}% % \begin{macro}{\textsuperscript} \marg{text} +% \changes{v0.50}{2018/02/20}{Robustify macros.} % \begin{macrocode} -\renewcommand{\textsuperscript}[1]{\LWR@htmlspan{sup}{#1}} +\renewrobustcmd{\textsuperscript}[1]{\LWR@htmlspan{sup}{#1}} % \end{macrocode} % \end{macro} @@ -25446,9 +25962,10 @@ width:\LWR@printlength{\LWR@tempwidth}% % \end{macro} % \begin{macro}{\textsubscript} \marg{text} +% \changes{v0.50}{2018/02/20}{Robustify macros.} % \begin{macrocode} \AtBeginDocument{ -\renewcommand{\textsubscript}[1]{\LWR@htmlspan{sub}{#1}} +\renewrobustcmd{\textsubscript}[1]{\LWR@htmlspan{sub}{#1}} } % \end{macrocode} % \end{macro} @@ -25499,6 +26016,18 @@ width:\LWR@printlength{\LWR@tempwidth}% % \end{macro} +% \begin{macro}{\LWR@overline} \marg{text} +% \changes{v0.50}{2018/02/21}{Added.} +% \begin{macrocode} +\newcommand{\LWR@overline}[1]{% +\LWR@HTMLtextstyle% + {text-decoration:overline;text-decoration-skip}% + {overline}{#1}% +} +% \end{macrocode} +% \end{macro} + + % \begin{macrocode} \end{warpHTML} % \end{macrocode} @@ -25531,16 +26060,16 @@ width:\LWR@printlength{\LWR@tempwidth}% % \end{macrocode} % Direct-formatting font sizes are ignored: % \begin{macrocode} -\renewcommand*{\normalsize}{} -\renewcommand*{\small}{} -\renewcommand*{\footnotesize}{} -\renewcommand*{\scriptsize}{} -\renewcommand*{\tiny}{} -\renewcommand*{\large}{} -\renewcommand*{\Large}{} -\renewcommand*{\LARGE}{} -\renewcommand*{\huge}{} -\renewcommand*{\Huge}{} +\renewrobustcmd*{\normalsize}{} +\renewrobustcmd*{\small}{} +\renewrobustcmd*{\footnotesize}{} +\renewrobustcmd*{\scriptsize}{} +\renewrobustcmd*{\tiny}{} +\renewrobustcmd*{\large}{} +\renewrobustcmd*{\Large}{} +\renewrobustcmd*{\LARGE}{} +\renewrobustcmd*{\huge}{} +\renewrobustcmd*{\Huge}{} % \end{macrocode} % % \changes{v0.49}{2018/02/18}{Fix: Adapt to classes.} @@ -25589,9 +26118,10 @@ width:\LWR@printlength{\LWR@tempwidth}% % \begin{macro}{\newline} % Uses the \HTML\ \element{br /} element. +% \changes{v0.50}{2018/02/20}{Robustify macros.} % \begin{macrocode} -\newcommand*{\LWR@newlinebr}{\unskip\LWR@htmltag{br /}\LWR@orignewline}% -\let\newline\LWR@newlinebr +\newrobustcmd*{\LWR@newlinebr}{\unskip\LWR@htmltag{br /}\LWR@orignewline}% +\LetLtxMacro\newline\LWR@newlinebr % \end{macrocode} % \end{macro} @@ -25747,7 +26277,7 @@ width:\LWR@printlength{\LWR@tempwidth}% % \begin{macrocode} {% \LWR@htmltagc{% - span style="width:\LWR@printlength{\LWR@tempwidth}; % + span style="width:\LWR@printlength{\LWR@tempwidth}; % extra space display:inline-block"% }% % \end{macrocode} @@ -25807,8 +26337,9 @@ width:\LWR@printlength{\LWR@tempwidth}% % % % \begin{macro}{\vspace} * \marg{length} Nullified. +% \changes{v0.50}{2018/02/20}{Robustify macros.} % \begin{macrocode} -\let\vspace\LWR@vspace +\LetLtxMacro\vspace\LWR@vspace % \end{macrocode} % \end{macro} @@ -25985,11 +26516,13 @@ width:\LWR@printlength{\LWR@tempwidth}% % % % \begin{macro}{\rule} \oarg{raise} \marg{width} \marg{height} -% \changes{v0.19}{2016/06/01}{Added} % % Handles special minipage \& horizontal space interactions. +% +% \changes{v0.19}{2016/06/01}{Added} +% \changes{v0.50}{2018/02/20}{Robustify macros.} % \begin{macrocode} -\renewcommand{\rule}{\LWR@rule} +\renewrobustcmd{\rule}{\LWR@rule} % \end{macrocode} % \end{macro} @@ -26280,7 +26813,7 @@ width:\LWR@printlength{\LWR@tempwidth}% % % \begin{itemize} % \item \TeX\ is a trademark of American Mathematical Society. -% \item \brand{Adobe}® and \brand{Adobe Framemaker}® are either registered trademarks or +% \item \brand{Adobe}® and \brand{Adobe} \prog{Framemaker}® are either registered trademarks or % trademarks of \brand{Adobe Systems Incorporated} in the United States and/or other countries. % \item \brand{Linux}® is the registered trademark of Linus Torvalds in the U.S.\ and other countries. % \item \brand{Mac\,OS}® is a trademark of \brand{Apple Inc.} @@ -27510,6 +28043,39 @@ span style="width:\LWR@printlength{\ALG@thistlm}; display:inline-block;"% % % % +% \iffalse +%<*axodraw2> +% \fi +% +% \part{lwarp-axodraw2.sty} + +% \section{axodraw2} +% +% \credits{John C. Collins, J.A.M. Vermaseren} +% +% \DescribePackage{axodraw2} +% \pkg{axodraw2} is patched for use by \pkg{lwarp}. +% +% \changes{v0.50}{2018/02/22}{\pkg{axodraw2}: Added.} +% +% \codehtml +% +% \begin{macrocode} +\LWR@ProvidesPackagePass{axodraw2} +% \end{macrocode} + +% \begin{macrocode} +\BeforeBeginEnvironment{axopicture}{\begin{lateximage}[axopicture]} + +\AfterEndEnvironment{axopicture}{\end{lateximage}} +% \end{macrocode} + +% \iffalse +%</axodraw2> +% \fi +% +% +% % % % \iffalse @@ -27538,7 +28104,7 @@ span style="width:\LWR@printlength{\ALG@thistlm}; display:inline-block;"% \LWR@ProvidesPackagePass{backref} % \end{macrocode} -% Force the |hyperref| option: +% Force the \optn{hyperref} option: % \begin{macrocode} \def\backref{}\let\backrefxxx\hyper@section@backref % \end{macrocode} @@ -27928,6 +28494,39 @@ span style="width:\LWR@printlength{\ALG@thistlm}; display:inline-block;"% % % % \iffalse +%<*bytefield> +% \fi +% +% \part{lwarp-bytefield.sty} + +% \section{bytefield} +% +% \credits{Scott Pakin} +% +% \DescribePackage{bytefield} +% \pkg{bytefield} is patched for use by \pkg{lwarp}. +% +% \changes{v0.50}{2018/02/22}{\pkg{bytefield}: Added.} +% +% \codehtml +% +% \begin{macrocode} +\LWR@ProvidesPackagePass{bytefield} +% \end{macrocode} + +% \begin{macrocode} +\BeforeBeginEnvironment{bytefield}{\begin{lateximage}[bytefield]} + +\AfterEndEnvironment{bytefield}{\end{lateximage}} +% \end{macrocode} + +% \iffalse +%</bytefield> +% \fi +% +% +% +% \iffalse %<*cancel> % \fi % @@ -27943,6 +28542,7 @@ span style="width:\LWR@printlength{\ALG@thistlm}; display:inline-block;"% % \codehtml % % \begin{macrocode} +\LWR@origRequirePackage{lwarp-xcolor}% for \convertcolorspec \LWR@ProvidesPackagePass{cancel} % \end{macrocode} % @@ -28783,6 +29383,32 @@ span style="width:\LWR@printlength{\ALG@thistlm}; display:inline-block;"% % % % \iffalse +%<*dblfloatfix> +% \fi +% +% \part{lwarp-dblfloatfix.sty} +% +% \section{dblfloatfix} +% +% \DescribePackage{dblfloatfix} +% \pkg{dblfloatfix} is ignored. +% +% \changes{v0.50}{2018/02/20}{\pkg{dblfloatfix}: Added.} +% +% \codehtml +% +% \begin{macrocode} +\LWR@ProvidesPackageDrop{dblfloatfix} +% \end{macrocode} +% +% \iffalse +%</dblfloatfix> +% \fi +% +% +% +% +% \iffalse %<*dblfnote> % \fi % @@ -28848,6 +29474,121 @@ span style="width:\LWR@printlength{\ALG@thistlm}; display:inline-block;"% % % % \iffalse +%<*diagbox> +% \fi +% +% \part{lwarp-diagbox.sty} + +% \section{diagbox} +% +% \credits{Leo Liu} +% +% \DescribePackage{diagbox} +% \pkg{diagbox} is patched for use by \pkg{lwarp}. +% +% \changes{v0.50}{2018/02/21}{\pkg{diagbox}: Added.} +% +% \codehtml +% +% \begin{macrocode} +\LWR@ProvidesPackagePass{diagbox} +% \end{macrocode} +% +% To restore print-mode inside a \env{lateximage}: +% \begin{macrocode} +\LetLtxMacro\LWR@origdiagbox@double\diagbox@double +\LetLtxMacro\LWR@origdiagbox@triple\diagbox@triple + +\appto\LWR@restoreorigformatting{ +\LetLtxMacro\diagbox@double\LWR@origdiagbox@double +\LetLtxMacro\diagbox@triple\LWR@origdiagbox@triple +} +% \end{macrocode} + +% \begin{noindmacro}{\LWR@diagbox@AB} \marg{E/W} \marg{A} \marg{E/W} \marg{B} +% \begin{macrocode} +\newcommand{\LWR@diagbox@AB}[4]{ +\begingroup% +\LetLtxMacro\\\newline% +\BlockClassSingle{diagbox#1}{#2}% +\BlockClassSingle{diagbox#3}{#4}% +\endgroup% +\LWR@stoppars% +} +% \end{macrocode} +% \end{noindmacro} + +% \begin{noindmacro}{\LWR@diagboxNW} \marg{A} \marg{B} +% \begin{macrocode} +\newcommand{\LWR@diagboxNW}[2]{% +\LWR@diagbox@AB{E}{#2}{W}{#1}% +} +% \end{macrocode} +% \end{noindmacro} + +% Likewise for NE, SW, SE: +% \begin{macrocode} +\newcommand{\LWR@diagboxNE}[2]{% +\LWR@diagbox@AB{W}{#1}{E}{#2}% +} + +\let\LWR@diagboxSW\LWR@diagboxNE +\let\LWR@diagboxSE\LWR@diagboxNW +% \end{macrocode} + +% \begin{noindmacro}{\diagbox@double} \marg{keys} \marg{A} \marg{B} +% \begin{macrocode} +\def\diagbox@double#1#2#3{% +\setkeys{diagbox}{dir=NW,#1}% +\csuse{LWR@diagbox\diagbox@dir}{#2}{#3}% +} +% \end{macrocode} +% \end{noindmacro} + +% \begin{noindmacro}{\LWR@diagboxTNW} \marg{title} \marg{A} \marg{B} +% \begin{macrocode} +\newcommand{\LWR@diagboxTNW}[3]{% +\BlockClassSingle{diagboxtitleN}{#1} +\LWR@diagboxNW{#2}{#3} +} +% \end{macrocode} +% \end{noindmacro} + +% Likewise for NE, SW, SE: +% \begin{macrocode} +\newcommand{\LWR@diagboxTNE}[3]{% +\BlockClassSingle{diagboxtitleN}{#1} +\LWR@diagboxNE{#2}{#3} +} + +\newcommand{\LWR@diagboxTSW}[3]{% +\LWR@diagboxSW{#2}{#3} +\BlockClassSingle{diagboxtitleS}{#1} +} + +\newcommand{\LWR@diagboxTSE}[3]{% +\LWR@diagboxSE{#2}{#3} +\BlockClassSingle{diagboxtitleS}{#1} +} +% \end{macrocode} +% +% \begin{noindmacro}{\diagbox@triple} \marg{keys} \marg{A} \marg{T} \marg{B} +% \begin{macrocode} +\def\diagbox@triple#1#2#3#4{% +\setkeys{diagbox}{dir=NW,#1}% +\csuse{LWR@diagboxT\diagbox@dir}{#3}{#2}{#4}% +} +% \end{macrocode} +% \end{noindmacro} +% +% \iffalse +%</diagbox> +% \fi +% +% +% +% +% \iffalse %<*draftwatermark> % \fi @@ -29384,6 +30125,40 @@ span style="width:\LWR@printlength{\ALG@thistlm}; display:inline-block;"% % % % +% \iffalse +%<*epstopdf> +% \fi +% +% \part{lwarp-epstopdf.sty} +% +% \section{epstopdf} +% +% \DescribePackage{epstopdf} +% \pkg{epstopdf} is ignored. +% +% Filenames should be used without a suffix so that +% \SVG, \PNG, or \JPG\ versions of the file will be used for \HTML\ output. +% +% \changes{v0.50}{2018/02/21}{\pkg{epstopdf}: Added.} +% +% \codehtml +% +% \begin{macrocode} +\LWR@ProvidesPackageDrop{epstopdf} +% \end{macrocode} +% +% \begin{macrocode} +\newcommand*{\epstopdfsetup}[1]{} +\newcommand*{\epstopdfcall}[1]{} +\newcommand*{\epstopdfDeclareGraphicsRule}[4]{} +% \end{macrocode} +% +% \iffalse +%</epstopdf> +% \fi +% +% +% % % % \iffalse @@ -29834,9 +30609,9 @@ span style="width:\LWR@printlength{\ALG@thistlm}; display:inline-block;"% \LWR@ProvidesPackagePass{fancyref} % \end{macrocode} % -% To remove the |margin| option, if \cs{fancyrefhook} is anything -% other than the |paren| option, then force it to the default instead. -% (Comparing to the |margin| option was not possible since \pkg{lwarp} has +% To remove the \optn{margin} option, if \cs{fancyrefhook} is anything +% other than the \optn{paren} option, then force it to the default instead. +% (Comparing to the \optn{margin} option was not possible since \pkg{lwarp} has % revised the meaning of \cs{mbox} so the comparison failed.) % \begin{macrocode} \newcommand*{\LWRfref@parenfancyrefhook}[1]{(#1)} @@ -29908,6 +30683,7 @@ span style="width:\LWR@printlength{\ALG@thistlm}; display:inline-block;"% % \codehtml % \begin{macrocode} \RequirePackage{xcolor}% for \convertcolorspec + \LWR@ProvidesPackagePass{fancyvrb} % \end{macrocode} % @@ -30332,7 +31108,7 @@ border#1: \strip@pt\dimexpr \FV@FrameRule\relax\relax pt solid \#\LWR@tempcolor % \end{macrocode} % % Restore \pkg{lwarp}'s version of \cs{@wrindex}, -% ignoring the \pkg{fixme} package's |target| option: +% ignoring the \pkg{fixme} package's \optn{target} option: % \begin{macrocode} \let\@wrindex\LWR@wrindex % \end{macrocode} @@ -30598,7 +31374,7 @@ border#1: \strip@pt\dimexpr \FV@FrameRule\relax\relax pt solid \#\LWR@tempcolor \setlength{\LWR@templengthone}{#3}% \LWR@BlockClassWP{% float:right; % - width:\LWR@printlength{\LWR@templengthone}; % + width:\LWR@printlength{\LWR@templengthone}; % extra space margin:10pt% }{% width:\LWR@printlength{\LWR@templengthone}% @@ -31925,7 +32701,7 @@ border#1: \strip@pt\dimexpr \FV@FrameRule\relax\relax pt solid \#\LWR@tempcolor % Used to store the user's selected dimensions and \HTML\ class. % -% The class defaults to ``inlineimage'' unless changed by a |class=xyx| option. +% The class defaults to ``inlineimage'' unless changed by a \optn{class=xyx} option. % \begin{macrocode} \newlength{\LWR@igwidth} \newlength{\LWR@igheight} @@ -31980,7 +32756,7 @@ border#1: \strip@pt\dimexpr \FV@FrameRule\relax\relax pt solid \#\LWR@tempcolor % Default to use the converted fixed length given: % \begin{macrocode} \renewcommand*{\LWR@igheightstyle}{% - height:\LWR@printlength{\LWR@igheight} % + height:\LWR@printlength{\LWR@igheight} % extra space }% % \end{macrocode} % If ex or em dimensions were given, use those instead: @@ -32095,24 +32871,32 @@ border#1: \strip@pt\dimexpr \FV@FrameRule\relax\relax pt solid \#\LWR@tempcolor \boolfalse{LWR@infloatrow} % \end{macrocode} +% \begin{macro}{\LWR@opacity} For \HTML, used only for \cs{includegraphics}. +% % \cs{LWR@opacity} may be set by the \pkg{transparent} package. -% For \HTML\ it is only used for \cs{includegraphics}. % \begin{macrocode} \def\LWR@opacity{1} % \end{macrocode} +% \end{macro} -% Used to determine the actual image size if needed: +% \begin{macro}{\LWR@imagesizebox} +% Used to determine the actual image size if needed. % \begin{macrocode} \newsavebox{\LWR@imagesizebox} % \end{macrocode} +% \end{macro} +% \begin{macro}{\Gin@setfile} Sets the parsed filename. % \begin{macrocode} \let\LWR@origGin@setfile\Gin@setfile % \end{macrocode} +% \end{macro} +% \DescribeKey[Gin]{class} \CSS\ class for the image. +% % Define the new class key for the print-mode version of \cs{includegraphics}, % which is enabled inside a \env{lateximage}. % \changes{v0.42}{2017/10/24}{\pkg{includegraphics}: Fix: Class key.} @@ -32286,15 +33070,15 @@ img src="% {\LWR@origtilde{} transform-origin: \LWR@originnames{\LWR@igorigin}; \LWR@orignewline}{}% \ifthenelse{\NOT\equal{\LWR@igangle}{}}% {% -\LWR@rotstyle{-ms-}{\LWR@igangle} % -\LWR@rotstyle{-webkit-}{\LWR@igangle} % +\LWR@rotstyle{-ms-}{\LWR@igangle} % extra space +\LWR@rotstyle{-webkit-}{\LWR@igangle} % extra space \LWR@rotstyle{}{\LWR@igangle % }}{}% \ifthenelse{\NOT\equal{\LWR@igxscale}{1}\OR% \NOT\equal{\LWR@igyscale}{1}}% -{\LWR@scalestyle{-ms-}{\LWR@igxscale}{\LWR@igyscale} % -\LWR@scalestyle{-webkit-}{\LWR@igxscale}{\LWR@igyscale} % -\LWR@scalestyle{}{\LWR@igxscale}{\LWR@igyscale}}{} % +{\LWR@scalestyle{-ms-}{\LWR@igxscale}{\LWR@igyscale} % extra space +\LWR@scalestyle{-webkit-}{\LWR@igxscale}{\LWR@igyscale} % extra space +\LWR@scalestyle{}{\LWR@igxscale}{\LWR@igyscale}}{} % extra space % \ifthenelse{\NOT\equal{\LWR@opacity}{1}}% {opacity:\LWR@opacity; }% @@ -32321,9 +33105,7 @@ img src="% % Handles width and height, converted to fixed width and heights. -% Converts any |.pdf| references to |.svg| for \HTML\ - -% The user should always refer to |.pdf| in the document source. +% The user should always use no file suffix in the document source. % \begin{macrocode} \AtBeginDocument{ @@ -32427,9 +33209,9 @@ img src="% % \end{macrocode} % Print the rotation information: % \begin{macrocode} -\LWR@rotstyle{-ms-}{#2} % -\LWR@rotstyle{-webkit-}{#2} % -\LWR@rotstyle{}{#2} % +\LWR@rotstyle{-ms-}{#2} % extra space +\LWR@rotstyle{-webkit-}{#2} % extra space +\LWR@rotstyle{}{#2} % extra space "}\LWR@orignewline% % \end{macrocode} % Print the text to be rotated: @@ -32459,9 +33241,9 @@ img src="% % \end{macrocode} % Print the scaling information: % \begin{macrocode} -\LWR@scalestyle{-ms-}{#1}{\IfNoValueTF{#2}{#1}{#2}} % -\LWR@scalestyle{-webkit-}{#1}{\IfNoValueTF{#2}{#1}{#2}} % -\LWR@scalestyle{}{#1}{\IfNoValueTF{#2}{#1}{#2}} % +\LWR@scalestyle{-ms-}{#1}{\IfNoValueTF{#2}{#1}{#2}} % extra space +\LWR@scalestyle{-webkit-}{#1}{\IfNoValueTF{#2}{#1}{#2}} % extra space +\LWR@scalestyle{}{#1}{\IfNoValueTF{#2}{#1}{#2}} % extra space "}% % \end{macrocode} % Print the text to be scaled: @@ -32623,9 +33405,15 @@ img src="% \renewcommand*{\LWR@printcloselist}{\LWR@printcloseitemize}% \renewcommand*{\LWR@printopenlist}{% \LWR@findhangingleftmargin% - ul style="\LWR@origmbox{list-style-type:none;} % - \LWR@origmbox{margin-left:\LWR@printlength{\LWR@templengthone}} ; % - \LWR@origmbox{text-indent:-\LWR@printlength{\hangingindent}}"% + ul style="% + \LWR@origmbox{list-style-type:none;} % extra space + \LWR@origmbox{% + margin-left:\LWR@printlength{\LWR@templengthone}% + } ; % extra space + \LWR@origmbox{% + text-indent:-\LWR@printlength{\hangingindent}% + }% + "% }% \let\item\LWR@itemizeitem% \list{}{}% @@ -33588,7 +34376,7 @@ width=\KFLT@imagewidth,height=\KFLT@h]{\KFLT@i}% \LWR@ensuredoingapar% \setlength{\LWR@templengthone}{#1}% \begin{LWR@BlockClassWP}{% - float:right; width:\LWR@printlength{\LWR@templengthone}; % + float:right; width:\LWR@printlength{\LWR@templengthone}; % extra space margin:10pt% }% {% @@ -33743,7 +34531,7 @@ width=\KFLT@imagewidth,height=\KFLT@h]{\KFLT@i}% % \cs{lettrine} \oarg{keys} \marg{letter} \marg{additional text} % \begin{macrocode} \DeclareDocumentCommand{\lettrine}{o m m}{% -\InlineClass{lettrine}{#2}\InlineClass{lettrinetext}{#3} % +\InlineClass{lettrine}{#2}\InlineClass{lettrinetext}{#3} % extra space } \newcounter{DefaultLines} @@ -34006,6 +34794,11 @@ width=\KFLT@imagewidth,height=\KFLT@h]{\KFLT@i}% % ^^A \hspace*{3em}how-to-pass-an-optional-argument-to-\\ % ^^A \hspace*{3em}an-environment-with-verbatim-content}} % +% Force flexible columns: +% \changes{v0.50}{2018/03/02}{\pkg{listings}: Force flexible columns.} +% \begin{macrocode} +\lst@column@flexible +% \end{macrocode} % % % Patches to embed listings inside |pre| tags: @@ -34764,6 +35557,7 @@ width=\KFLT@imagewidth,height=\KFLT@h]{\KFLT@i}% % \codehtml % \begin{macrocode} \RequirePackage{xcolor}% for \convertcolorspec + \LWR@ProvidesPackageDrop{mdframed} % \end{macrocode} % @@ -35534,6 +36328,31 @@ background: % % % +% \iffalse +%<*morefloats> +% \fi +% +% \part{lwarp-morefloats.sty} +% +% \section{morefloats} +% +% \DescribePackage{morefloats} +% \pkg{morefloats} is ignored. +% +% \changes{v0.50}{2018/02/22}{\pkg{morefloats}: Added.} +% +% \codehtml +% +% \begin{macrocode} +\LWR@ProvidesPackageDrop{morefloats} +% \end{macrocode} +% +% \iffalse +%</morefloats> +% \fi +% +% +% % % \iffalse %<*moreverb> @@ -36240,6 +37059,40 @@ class="td% % % % \iffalse +%<*nonfloat> +% \fi +% +% \part{lwarp-nonfloat.sty} +% +% \section{nonfloat} +% +% \credits{Kai Rascher} +% +% \DescribePackage{nonfloat} +% \pkg{nonfloat} is emulated. +% +% \changes{v0.50}{2018/02/21}{\pkg{nonfloat}: Added.} +% +% \codehtml +% +% \begin{macrocode} +\LWR@ProvidesPackageDrop{nonfloat} +% \end{macrocode} +% +% \begin{macrocode} +\LetLtxMacro\topcaption\caption +\newcommand{\figcaption}{\def\@captype{figure}\caption} +\newcommand{\tabcaption}{\def\@captype{table}\topcaption} +\newenvironment{narrow}[2]{}{} +% \end{macrocode} +% +% \iffalse +%</nonfloat> +% \fi +% +% +% +% \iffalse %<*nonumonpart> % \fi % @@ -36422,7 +37275,6 @@ class="td% \DeclareOption{amsmath}{} \DeclareOption{hyperref}{} - \LWR@ProvidesPackagePass{ntheorem} % \end{macrocode} % @@ -36744,6 +37596,11 @@ class="td% % The following standard configuration is renewed using the new \CSS: % \begin{macrocode} \ifbool{LWR@ntheoremamsthm}{}{% +% \end{macrocode} +% \changes{v0.50}{2018/03/01}{\pkg{ntheorem}: Fix: Not \optn{standard} nor \optn{amsthm} selected.} +% \begin{macrocode} +\ifx\thm@usestd\@undefined +\else \theoremnumbering{arabic} \theoremstyle{plain} \RequirePackage{latexsym} @@ -36789,13 +37646,14 @@ class="td% \qedsymbol{\HTMLunicode{220E}}% UTF-8 end-of-proof \theoremsymbol{} +\fi }% not amsthm % \end{macrocode} % % % \subsection{\pkg{amsthm} option} % -% Only if the |amsthm| option was given: +% Only if the \optn{amsthm} option was given: % \begin{macrocode} \ifbool{LWR@ntheoremamsthm}{ @@ -37224,6 +38082,48 @@ class="td% % % % +% \iffalse +%<*pbox> +% \fi +% +% \part{lwarp-pbox.sty} +% +% \section{pbox} +% +% \credits{Simon Law} +% +% \DescribePackage{pbox} +% \pkg{pbox} is emulated. +% +% \changes{v0.50}{2018/02/21}{\pkg{pbox}: Added.} +% +% \codehtml +% +% \begin{macrocode} +\LWR@ProvidesPackageDrop{pbox} +% \end{macrocode} +% +% \begin{macrocode} +\NewDocumentCommand{\pbox}{O{t} o O{t} m +m}{% +\booltrue{LWR@minipagefullwidth}% +\parbox[#1][#2][#3]{#4}{#5}% +} + +\newcommand{\settominwidth}[3][\columnwidth]{% +\settowidth{#2}{#3}% +} + +\newcommand{\widthofpbox}[1]{% +\widthof{#1}% +} +% \end{macrocode} +% +% \iffalse +%</pbox> +% \fi +% +% +% % % % \iffalse @@ -37349,6 +38249,47 @@ class="td% % % % +% \iffalse +%<*phfqit> +% \fi +% +% \part{lwarp-phfqit.sty} + +% \section{phfqit} +% +% \credits{Philippe Faist} +% +% \DescribePackage{phfqit} +% \pkg{phfqit} is patched for use by \pkg{lwarp}. +% +% \changes{v0.50}{2018/02/22}{\pkg{phfqit}: Added.} +% +% \codehtml +% +% \begin{macrocode} +\LWR@ProvidesPackagePass{phfqit} +% \end{macrocode} + +% \begin{macrocode} +\LetLtxMacro\LWR@origbitstring\bitstring + +\renewcommand\bitstring[1]{% +\InlineClass[% + text-decoration: overline underline ; +]{bitstring}{#1}% +% \phfqit@bitstring{#1}% +} + +\appto{\LWR@restoreorigformatting}{ +\LetLtxMacro\bitstring\LWR@origbitstring +} +% \end{macrocode} + +% \iffalse +%</phfqit> +% \fi +% +% % % % \iffalse @@ -38039,6 +38980,52 @@ class="td% % % % \iffalse +%<*schemata> +% \fi +% +% \part{lwarp-schemata.sty} + +% \section{schemata} +% +% \credits{Charles P. Schaum} +% +% \DescribePackage{schemata} +% \pkg{schemata} is patched for use by \pkg{lwarp}. +% +% \changes{v0.50}{2018/02/23}{\pkg{schemata}: Added.} +% +% \codehtml +% +% \begin{macrocode} +\LWR@ProvidesPackagePass{schemata} +% \end{macrocode} + +% \begin{macrocode} +\LetLtxMacro\LWR@schemata@origschema\schema +\LetLtxMacro\LWR@schemata@origSchema\Schema + +\renewcommand{\schema}[3][open]{% +\begin{lateximage}% +\LWR@orignormalsize +\LWR@schemata@origschema[#1]{#2}{#3}% +\end{lateximage}% +} + +\renewcommand{\Schema}[5][open]{% +\begin{lateximage}% +\LWR@orignormalsize +\LWR@schemata@origSchema[#1]{#2}{#3}{#4}{#5}% +\end{lateximage}% +} +% \end{macrocode} + +% \iffalse +%</schemata> +% \fi +% +% +% +% \iffalse %<*scrextend> % \fi % @@ -38955,13 +39942,17 @@ class="td% % \changes{v0.36}{2017/08/17}{\pkg{siunitx}: Improved symbol support.} % \changes{v0.37}{2017/08/17}{\pkg{siunitx}: Improved symbol support.} % \changes{v0.38}{2017/08/26}{\pkg{siunitx}: Removed from \pkg{lwarp} core.} +% \changes{v0.50}{2018/10/23}{\pkg{siunitx}: Fix: Loads \pkg{xcolor}.} % % \codehtml % % \begin{macrocode} +\RequirePackage{xcolor}% for \convertcolorspec + \LWR@ProvidesPackagePass{siunitx} % \end{macrocode} +% \changes{v0.50}{2018/02/24}{\pkg{siunitx}: Improved units.} % \begin{macrocode} \AtBeginDocument{% in case textcomp was not loaded \DeclareSIUnit\bohr{\textit{a}\textsubscript{0}} @@ -38969,6 +39960,7 @@ class="td% \DeclareSIUnit\elementarycharge{\textit{e}} \DeclareSIUnit\electronmass{\textit{m}\textsubscript{e}} \DeclareSIUnit\hartree{\textit{E}\textsubscript{h}} +\DeclareSIUnit\planckbar{\LWR@siunitx@textplanckbar} }% AtBeginDocument % \end{macrocode} % @@ -39054,11 +40046,14 @@ class="td% { \__siunitx_unit_output_pre_print: % \end{macrocode} -% For |parse-numbers=false|, since \cs{ensuredmath} was restored to its original: +% For |parse-numbers=false|: % \changes{v0.48}{2018/02/14}{\pkg{siunitx}: Improved \SVG\ math.} +% \changes{v0.50}{2018/02/24}{\pkg{siunitx}: Improved \SVG\ math \attribute{alt} tags.} % \begin{macrocode} % \__siunitx_print:nn { number } { \ensuremath {#1} } - \LWR@subsingledollar{\__siunitx_print:nn { number } { #1 }}% lwarp + \LWR@subsingledollar{% lwarp + \textbackslash( \LWR@HTMLsanitize{#1} \textbackslash)% lwarp + }{\__siunitx_print:nn { number } { #1 }}% lwarp % \end{macrocode} % \begin{macrocode} \__siunitx_unit_output_print: @@ -39081,7 +40076,6 @@ class="td% \l__siunitx_number_denominator_tl \__siunitx_number_output_single_aux: } -% % \end{macrocode} % For units, the fraction code is replaced by the symbol code: % \changes{v0.48}{2018/02/14}{\pkg{siunitx}: Changes fraction to symbol.} @@ -39101,9 +40095,48 @@ class="td% \tl_put_right:NV \l__siunitx_unit_tl \l__siunitx_per_symbol_tl \tl_put_right:NV \l__siunitx_unit_tl \l__siunitx_unit_denominator_tl } - - - +% \end{macrocode} +% \changes{v0.50}{2018/02/24}{\pkg{siunitx}: Improved units.} +% \begin{macrocode} +\cs_undefine:N \__siunitx_angle_print_astronomy_aux: +\cs_new_protected:Npn \__siunitx_angle_print_astronomy_aux: { + \prop_get:NnNT \l__siunitx_number_out_prop { mantissa-integer } + \l__siunitx_tmpa_tl + { \__siunitx_print:nV { number } \l__siunitx_tmpa_tl } + \ifnumcomp{\value{LWR@lateximagedepth}}{>}{0}% lwarp + {% lateximage + \hbox_set:Nn \l__siunitx_angle_marker_box + { + \__siunitx_print:nn { number } { { \l__siunitx_output_decimal_tl } } + } + \hbox_set:Nn \l__siunitx_angle_unit_box + { + \__siunitx_print:nV { unit } \l__siunitx_unit_tl + \skip_horizontal:n { -\scriptspace } + } + \__siunitx_angle_print_astronomy_aux:n { marker } + \__siunitx_angle_print_astronomy_aux:n { unit } + \hbox_set:Nn \l__siunitx_angle_marker_box + { + \box_use:N \l__siunitx_angle_marker_box + \box_use:N \l__siunitx_angle_unit_box + } + \dim_compare:nNnTF + { \l__siunitx_angle_marker_dim } > { \l__siunitx_angle_unit_dim } + { \__siunitx_angle_print_astronomy_marker: } + { \__siunitx_angle_print_astronomy_unit: } + }% lateximage + {% not a lateximage + \__siunitx_print:nV { unit } \l__siunitx_unit_tl + \__siunitx_print:nn { number } { { \l__siunitx_output_decimal_tl } } + }% not a lateximage + \prop_get:NnNT \l__siunitx_number_out_prop { mantissa-decimal } + \l__siunitx_tmpa_tl + { \__siunitx_print:nV { number } \l__siunitx_tmpa_tl } +} +% \end{macrocode} +% +% \begin{macrocode} \RenewDocumentCommand \num { o m } { \leavevmode \group_begin:% lwarp @@ -40803,7 +41836,7 @@ class="td% \begin{lateximage}% \ifbool{LWR@tikzbabel}% Test for Tikz version v3.0.0 {}% -{\catcode`\$=3} % dollar sign is math shift +{\catcode`\$=3}% dollar sign is math shift } \AfterEndEnvironment{tikzpicture}{% @@ -43056,7 +44089,7 @@ class="td% % % \changes{v0.49}{2018/02/16}{\pkg{vwcol}: Added.} % -% The |width| option is ignored. +% The \optn{width} option is ignored. % All \env{vwcol} environments adjust to 1--3 equal-width columns, depening on the % width of the browser window. % @@ -44395,6 +45428,69 @@ scaling = false % % % +% +% +% \iffalse +%<*xy> +% \fi +% +% \part{lwarp-xy.sty} + +% \section{xy} +% +% \credits{Kristoffer H. Rose, Ross Moore} +% +% \DescribePackage{xy} +% \pkg{xy} is patched for use by \pkg{lwarp}. +% +% \cs{xypolygon} must be used inside the \env{xy} environment, \watchout +% or inside \cs{xy} \dots \cs{endxy}. +% +% \changes{v0.50}{2018/02/21}{\pkg{xy}: Added.} +% +% \codehtml +% +% \begin{macrocode} +\LWR@ProvidesPackagePass{xy} +% \end{macrocode} + +% \begin{macrocode} +\AtBeginDocument{ + +\preto{\xy}{\begin{lateximage}[xy image]} +\appto{\endxy}{\end{lateximage}} + +\@ifundefined{xymatrix}{}{ +\LetLtxMacro\LWR@origxymatrix\xymatrix + +\renewcommand{\xymatrix}[1]{% +\begin{lateximage}[xymatrix] +\LWR@origxymatrix{#1} +\end{lateximage} +} +} + +\@ifundefined{xygraph}{}{ +\LetLtxMacro\LWR@origxygraph\xygraph + +\renewcommand{\xygraph}[1]{% +\begin{lateximage}[xygraph] +\LWR@origxygraph{#1} +\end{lateximage} +} +} + +} +% \end{macrocode} + +% \iffalse +%</xy> +% \fi +% +% +% +% +% % \iffalse %<*zwpagelayout> % \fi diff --git a/Master/texmf-dist/source/latex/lwarp/lwarp.ins b/Master/texmf-dist/source/latex/lwarp/lwarp.ins index 75b0eb69d11..fd46f2633c4 100644 --- a/Master/texmf-dist/source/latex/lwarp/lwarp.ins +++ b/Master/texmf-dist/source/latex/lwarp/lwarp.ins @@ -52,6 +52,7 @@ version 2005/12/01 or later. \file{lwarp-array.sty}{\from{lwarp.dtx}{array}} \file{lwarp-atbegshi.sty}{\from{lwarp.dtx}{atbegshi}} \file{lwarp-authblk.sty}{\from{lwarp.dtx}{authblk}} +\file{lwarp-axodraw2.sty}{\from{lwarp.dtx}{axodraw2}} \file{lwarp-backref.sty}{\from{lwarp.dtx}{backref}} \file{lwarp-balance.sty}{\from{lwarp.dtx}{balance}} \file{lwarp-bigdelim.sty}{\from{lwarp.dtx}{bigdelim}} @@ -62,6 +63,7 @@ version 2005/12/01 or later. \file{lwarp-boxedminipage.sty}{\from{lwarp.dtx}{boxedminipage}} \file{lwarp-boxedminipage2e.sty}{\from{lwarp.dtx}{boxedminipage2e}} \file{lwarp-breakurl.sty}{\from{lwarp.dtx}{breakurl}} +\file{lwarp-bytefield.sty}{\from{lwarp.dtx}{bytefield}} \file{lwarp-cancel.sty}{\from{lwarp.dtx}{cancel}} \file{lwarp-caption.sty}{\from{lwarp.dtx}{caption}} \file{lwarp-caption2.sty}{\from{lwarp.dtx}{caption2}} @@ -78,8 +80,10 @@ version 2005/12/01 or later. \file{lwarp-crop.sty}{\from{lwarp.dtx}{crop}} \file{lwarp-cuted.sty}{\from{lwarp.dtx}{cuted}} \file{lwarp-cutwin.sty}{\from{lwarp.dtx}{cutwin}} +\file{lwarp-dblfloatfix.sty}{\from{lwarp.dtx}{dblfloatfix}} \file{lwarp-dblfnote.sty}{\from{lwarp.dtx}{dblfnote}} \file{lwarp-dcolumn.sty}{\from{lwarp.dtx}{dcolumn}} +\file{lwarp-diagbox.sty}{\from{lwarp.dtx}{diagbox}} \file{lwarp-draftwatermark.sty}{\from{lwarp.dtx}{draftwatermark}} \file{lwarp-easy-todo.sty}{\from{lwarp.dtx}{easy-todo}} \file{lwarp-ebook.sty}{\from{lwarp.dtx}{ebook}} @@ -91,6 +95,7 @@ version 2005/12/01 or later. \file{lwarp-enumerate.sty}{\from{lwarp.dtx}{enumerate}} \file{lwarp-enumitem.sty}{\from{lwarp.dtx}{enumitem}} \file{lwarp-epigraph.sty}{\from{lwarp.dtx}{epigraph}} +\file{lwarp-epstopdf.sty}{\from{lwarp.dtx}{epstopdf}} \file{lwarp-eso-pic.sty}{\from{lwarp.dtx}{eso-pic}} \file{lwarp-everypage.sty}{\from{lwarp.dtx}{everypage}} \file{lwarp-everyshi.sty}{\from{lwarp.dtx}{everyshi}} @@ -166,6 +171,7 @@ version 2005/12/01 or later. \file{lwarp-microtype.sty}{\from{lwarp.dtx}{microtype}} \file{lwarp-midfloat.sty}{\from{lwarp.dtx}{midfloat}} \file{lwarp-midpage.sty}{\from{lwarp.dtx}{midpage}} +\file{lwarp-morefloats.sty}{\from{lwarp.dtx}{morefloats}} \file{lwarp-moreverb.sty}{\from{lwarp.dtx}{moreverb}} \file{lwarp-morewrites.sty}{\from{lwarp.dtx}{morewrites}} \file{lwarp-mparhack.sty}{\from{lwarp.dtx}{mparhack}} @@ -178,6 +184,7 @@ version 2005/12/01 or later. \file{lwarp-newclude.sty}{\from{lwarp.dtx}{newclude}} \file{lwarp-newunicodechar.sty}{\from{lwarp.dtx}{newunicodechar}} \file{lwarp-nextpage.sty}{\from{lwarp.dtx}{nextpage}} +\file{lwarp-nonfloat.sty}{\from{lwarp.dtx}{nonfloat}} \file{lwarp-nonumonpart.sty}{\from{lwarp.dtx}{nonumonpart}} \file{lwarp-nopageno.sty}{\from{lwarp.dtx}{nopageno}} \file{lwarp-nowidow.sty}{\from{lwarp.dtx}{nowidow}} @@ -188,10 +195,12 @@ version 2005/12/01 or later. \file{lwarp-pagesel.sty}{\from{lwarp.dtx}{pagesel}} \file{lwarp-paralist.sty}{\from{lwarp.dtx}{paralist}} \file{lwarp-parskip.sty}{\from{lwarp.dtx}{parskip}} +\file{lwarp-pbox.sty}{\from{lwarp.dtx}{pbox}} \file{lwarp-pdfrender.sty}{\from{lwarp.dtx}{pdfrender}} \file{lwarp-pdflscape.sty}{\from{lwarp.dtx}{pdflscape}} \file{lwarp-pdfsync.sty}{\from{lwarp.dtx}{pdfsync}} \file{lwarp-pfnote.sty}{\from{lwarp.dtx}{pfnote}} +\file{lwarp-phfqit.sty}{\from{lwarp.dtx}{phfqit}} \file{lwarp-placeins.sty}{\from{lwarp.dtx}{placeins}} \file{lwarp-prelim2e.sty}{\from{lwarp.dtx}{prelim2e}} \file{lwarp-prettyref.sty}{\from{lwarp.dtx}{prettyref}} @@ -207,6 +216,7 @@ version 2005/12/01 or later. \file{lwarp-rotfloat.sty}{\from{lwarp.dtx}{rotfloat}} \file{lwarp-savetrees.sty}{\from{lwarp.dtx}{savetrees}} \file{lwarp-scalefnt.sty}{\from{lwarp.dtx}{scalefnt}} +\file{lwarp-schemata.sty}{\from{lwarp.dtx}{schemata}} \file{lwarp-scrextend.sty}{\from{lwarp.dtx}{scrextend}} \file{lwarp-scrhack.sty}{\from{lwarp.dtx}{scrhack}} \file{lwarp-scrlayer.sty}{\from{lwarp.dtx}{scrlayer}} @@ -271,6 +281,7 @@ version 2005/12/01 or later. \file{lwarp-xmpincl.sty}{\from{lwarp.dtx}{xmpincl}} \file{lwarp-xtab.sty}{\from{lwarp.dtx}{xtab}} \file{lwarp-xurl.sty}{\from{lwarp.dtx}{xurl}} +\file{lwarp-xy.sty}{\from{lwarp.dtx}{xy}} \file{lwarp-zwpagelayout.sty}{\from{lwarp.dtx}{zwpagelayout}} \file{lwarp-patch-komascript.sty}{\from{lwarp.dtx}{patch-komascript}} \file{lwarp-patch-memoir.sty}{\from{lwarp.dtx}{patch-memoir}} |