From 8065b9f4ce6618e2a867b384059805a0d56050cb Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 8 Aug 2017 20:42:15 +0000 Subject: lwarp (8aug17) git-svn-id: svn://tug.org/texlive/trunk@44988 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/source/latex/lwarp/lwarp.dtx | 4515 ++++++++++++++++++------ Master/texmf-dist/source/latex/lwarp/lwarp.ins | 30 +- 2 files changed, 3398 insertions(+), 1147 deletions(-) (limited to 'Master/texmf-dist/source/latex/lwarp') diff --git a/Master/texmf-dist/source/latex/lwarp/lwarp.dtx b/Master/texmf-dist/source/latex/lwarp/lwarp.dtx index f21ed1054b1..6b6fcb62373 100644 --- a/Master/texmf-dist/source/latex/lwarp/lwarp.dtx +++ b/Master/texmf-dist/source/latex/lwarp/lwarp.dtx @@ -16,7 +16,7 @@ % \iffalse %\NeedsTeXFormat{LaTeX2e}[1999/12/01] %\ProvidesPackage{lwarp} -% [2017/07/10 v0.33 Allows LaTeX to directly produce HTML5 output.] +% [2017/08/08 v0.34 Allows LaTeX to directly produce HTML5 output.] % %<*driver> \documentclass{ltxdoc} @@ -182,7 +182,8 @@ Keywords={LaTeX, HTML, conversion}% \newcommand{\env}[1]{\texttt{#1}} \newcommand{\pkg}[1]{\textsf{#1}} \newcommand{\acro}[1]{\textsc{\lowercase{#1}}} -\newcommand{\tag}[1]{\texttt{<#1>}} +\newcommand{\element}[1]{\texttt{<#1>}} +\newcommand{\attribute}[1]{\texttt{#1}} \newcommand{\TOC}{\acro{TOC}} \newcommand{\LOF}{\acro{LOF}} @@ -310,6 +311,16 @@ See \cref{sec:successfulcommands} to redefine the message which is printed for page number references. } +\newcommand{\limitshyperlinks}{% +\pkg{lwarp} emulates \pkg{hyperref}, including the creation of active hyperlinks, +but does not require that \pkg{hyperref} be loaded by the document. + +\pkg{lwarp} can also load \pkg{url}, but \pkg{url} should not be used at the +same time as \pkg{hyperref}, since they both define the \cs{url} command. +\pkg{lwarp} does not (yet) attempt to convert \pkg{url} links into hyperlinks +during \HTML\ output, nor does \pkg{url} create hyperlinks during print output. +} + \newcommand{\limitsabstract}{% \pkg{abstract} is supported. If using the \texttt{number} option with file splits, @@ -324,6 +335,25 @@ of the home page if it is after the abstract. \newcommand{\limitstext}{\cs{textbf}, etc.\ are supported, but \cs{bfseries}, etc.\ are not yet supported.} +\newcommand{\limitshspace}{% +\DescribeMacro{\hspace}% +\index{space>horizontal}% +\index{horizontal space}% +\cs{hspace} is converted to an inline \HTML\ span of the given width, +except that \texttt{0} width is ignored, +a width of \texttt{.16667em} is converted to +an \HTML\ thin breakable space (\texttt{U+2009}), +and a \cs{fill} is converted to a \cs{qquad}. + +\index{\texttt{\textasciitilde}}% +\DescribeMacro{\,}% +\texttt{\~} and \cs{,} are converted to \HTML\ entities. + +\DescribeMacro{\kern}% +\DescribeMacro{\hskip}% +\cs{kern} and \cs{hskip} are treated as a single normal space. +} + \newcommand{\limitsreferences}{% \cs{nameref} refers to the most recently-used section where the \cs{label} was defined. If no section has been defined before the \cs{label}, @@ -409,7 +439,7 @@ via a number of utility programs. The \SVG\ format is a scalable-vector web format, so math may be typeset by \LaTeX{} with its fine control and precision, then displayed or printed at any size, depending on (sometimes broken) browser support. -An \HTML\ \texttt{ALT} tag carries the \LaTeX{} code which generated the +An \HTML\ \attribute{alt} attribute carries the \LaTeX{} code which generated the math, allowing copy/paste of the \LaTeX{} math expression into other documents. \limitslateximagefontsize @@ -624,16 +654,18 @@ Use \CSS\ or \cs{textcolor} where possible. \newcommand{\limitstabular}{% \begin{itemize} -\item When defining environments or macros which include \env{tabular} plus - \margintag{misplaced alignment alignment tab character \&} +\item When defining environments or macros which include \env{tabular} + plus\watchout[misplaced alignment alignment tab character \&] \index{alignment tab character \&, misplaced} \index{misplaced alignment tab character \&} instances of the \texttt{\&} character, it may be necessary to make \texttt{\&} active before the environment or macro is defined, - then restore \texttt{\&} to its default catcode after, using the following commands: \\ - \hspace*{.375in} \cs{StartDefiningTabulars} \\ - \hspace*{.375in} \\ - \hspace*{.375in} \cs{EndDefiningTabulars} + then restore \texttt{\&} to its default catcode after, using the following commands: + \begin{sourcedisplay} + \cs{StartDefiningTabulars} \\ + \\ + \cs{EndDefiningTabulars} + \end{sourcedisplay} \item Vertical rules are not yet supported. \margintag{column types} @@ -748,15 +780,15 @@ the page will be corrupted. } \newcommand{\limitsminipage}{% -Minipages and parboxes will be placed side-by-side in \HTML -unless you place a \cs{newline} between them. -\margintag{placement} - A line of text with an inline minipage \watchout[inline] or parbox will have the minipage or parbox placed onto its own line, because a paragraph is a block element and cannot be made \texttt{inline-block}. +Minipages and parboxes will be placed side-by-side in \HTML\ +\margintag{placement} +unless you place a \cs{newline} between them. + Side-by-side minipages may be separated by \cs{quad}, \cs{qquad}, \cs{enskip}, \margintag{side-by-side} \cs{hspace}, \cs{hfill}, or a \cs{rule}. @@ -765,10 +797,12 @@ similar in print and \HTML. Paragraph tags are surpressed between side-by-side minipages and these spacing commands, but not at the start or end of the paragraph. -There is limited support for minipages inside an \HTML\ \tag{span}. +There is limited support for minipages inside an \HTML\ \element{span}. \margintag{in a span} -An \HTML\ \tag{div} cannot appear inside a \tag{span}. -While in a \tag{span}, minipages and parboxes are ignored. +An \HTML\ \element{div} cannot appear inside a \element{span}. +While in a \element{span}, minipages, and parboxes, and any enclosed lists +have limited \HTML\ tags, resulting in an ``inline'' format, without markup +except for \HTML\ breaks. Use \cs{newline} or \cs{par} for an \HTML\ break. When using \cs{linewidth}, \cs{textwidth}, and \cs{textheight}, @@ -782,7 +816,7 @@ given no \HTML\ width. A new macro \cs{minipagefullwidth} requests \margintag{full-width minipages} that the next minipage be generated -without an \HTML\ \texttt{width} tag, allowing it to be the full width of +without an \HTML\ \attribute{width} attribute, allowing it to be the full width of the display rather than the fixed width given. Nested minipages adopt their parent's text alignment in \HTML, @@ -792,6 +826,70 @@ Use a \env{flushleft} or similar environment in the child minipage to force a text alignment. } +\newcommand{\limitsfancybox}{% +\pkg{fancybox}'s documentation has an example \env{FramedEqn} environment +\margintag{framed equation example} +which combines math, \cs{Sbox}, a minipage, and an \cs{fbox}. +This combination requires that the entire +environment be enclosed inside a \env{lateximage}, which is done by +adding \cs{lateximage} at the very start of \env{FramedEqn}'s beginning code, and +\cs{endlateximage} at the very end of the ending code. +Unfortunately, the \HTML\ \attribute{alt} attribute is not used here. +\begin{sourcedisplay} +\cs{newenvironment}{FramedEqn} \\ +\{ \\ +\cs{lateximage}\% NEW \\ +\cs{setlength}\{\cs{fboxsep}\}\{15pt\} \\ +\dots\}\{\dots\\ +\cs{[}\cs{fbox}\{\cs{TheSbox}\}\cs{]} \\ +\cs{endlateximage}\% NEW \\ +\} +\end{sourcedisplay} + +\cs{fbox} works with \pkg{fancybox}. +\margintag{framing alternatives} +Also see \pkg{lwarp}'s \cs{fboxBlock} macro and \env{fminipage} environment for +alternatives to \cs{fbox} for framing environments. + +The \pkg{fancybox} documentation's example framed table +\margintag{framed table example} +using an \cs{fbox} containing a \env{tabular} +does not work with \pkg{lwarp}, but the \env{FramedTable} environment does work if +\cs{fbox} is replaced by \cs{fboxBlock}. This method loses \HTML\ formatting. +A better method is to enclose the table's contents inside a \env{fminipage} environment. +The caption may be placed either inside or outside the \env{fminipage}: +\begin{sourcedisplay} +\cs{begin}\{table\}\\ +\cs{begin}\{fminipage\}\{\cs{linewidth}\}\\ +\cs{begin}\{tabular\}\{lr\}\\ +...\\ +\cs{end}\{tabular\}\\ +\cs{end}\{fminipage\}\\ +\cs{end}\{table\}\\ +\end{sourcedisplay} + +\pkg{lwarp} does not support the \env{verbatim} environment inside a span, box, +\margintag{framed verbatim} +or \pkg{fancybox}'s \cs{Sbox}, but a \env{verbatim} may be placed inside +a \env{fminipage}. The \pkg{fancybox} documentation's example \env{FramedVerb} +may be defined as: +\begin{sourcedisplay} +\cs{newenvironment}\{FramedVerb\}[1] \% width\\ +\{\\ +\cs{VerbatimEnvironment}\\ +\cs{fminipage}\{\#1\}\\ +\cs{begin}{Verbatim}\\ +\}\{\\ +\cs{end}{Verbatim}\\ +\cs{endfminipage}\\ +\} +\end{sourcedisplay} + + +\pkg{fancybox}'s \cs{VerbBox} may be used inside \cs{fbox}. +\margintag{framed \cs{VerbBox}} +} + \newcommand{\limitsmdframed}{% Most basic functionality is supported, including \margintag{support} @@ -895,23 +993,43 @@ Do not use \cmds{per-mode=fraction}, which cannot be seen by the final \cmds{pdf \watchout[per-mode] } - -\newcommand{\limitsbabelone}{% -If using \pkg{babel} with French, use -\watchout[French]% -\begin{sourcedisplay} -\cs{frenchbsetup\{StandardLists=true\}} -\end{sourcedisplay} -to preserve the special \HTML\ and \pkg{enumitem} list handling. +\newcommand{\limitsnicefrac}{% +\pkg{units} and \pkg{nicefrac} work as-is with \pkg{lwarp}, but +MathJax does not have an extension for \pkg{units} or \pkg{nicefrac}. +These packages do work with \pkg{lwarp}'s option \texttt{svgmath}. } + +% \newcommand{\limitsbabelone}{% +% If using \pkg{babel} with French, use +% \watchout[French]% +% \begin{sourcedisplay} +% \cs{frenchbsetup\{StandardLists=true\}} +% \end{sourcedisplay} +% to preserve the special \HTML\ and list handling. +% } + \newcommand{\limitsbabeltwo}{% -Also, when French is used, the caption separator is +When French is used, the caption separator is \margintag{\cs{CaptionSeparator}} changed to a dash. The following may be used to restore it to a colon: \begin{sourcedisplay} \texttt{\cs{renewcommand}*\{\cs{CaptionSeparator}\}\{:\textasciitilde\}} \end{sourcedisplay} + +Also when French is used, +\margintag{punctuation spaces} +\pkg{lwarp} patches \cs{FBcolonspace} and \cs{FBthinspace} to create +fixed-width \HTML\ spaces around punctutation: +\begin{sourcedisplay} +\cs{renewcommand*}\{\cs{FBcolonspace}\}\{\~{}\} \\ +\cs{renewcommand*}\{\cs{FBthinspace}\}\{\cs{,}\} +\end{sourcedisplay} +If the user's document also changes these parameters, +\watchout[customized spacing] +the user's changes +should be placed inside a \env{warpprint} environment so that the user's +changes do not affect the \HTML\ output. } \newcommand{\limitsnewclude}{% @@ -942,26 +1060,6 @@ The proper load order is: \end{enumerate} } -\newcommand{\limitsenumitem}{% -\pkg{enumitem} is pre-loaded during \HTML\ output. -\margintag{enumitem} -Many of the spacing options are rendered irrelevant by \cmds{pdftotext} and -\HTML. Numbering, labels, and \cs{newlist} function correctly. -} - -\newcommand{\limitsenumerate}{% -\pkg{enumerate} conflicts with \pkg{enumitem} if both are loaded -at the same time, but \pkg{lwarp} does not actually load \pkg{enumerate}. -While generating \HTML, \pkg{lwarp} only loads \pkg{enumitem}, and -\pkg{enumerate} is simulated by \pkg{enumitem} using -the functionality of the \texttt{shortlabels} option. - -A problem may occur during print output if \pkg{enumitem} is loaded, -either manually or by some other package such as \pkg{siunitx}. -If these are used, \pkg{enumerate} will conflict with \pkg{enumitem} -during print output. -} - \newcommand{\limitsglossaries}{% \texttt{xindy} is required for \pkg{glossaries}. @@ -1026,7 +1124,7 @@ This boolean may be tested by the user for later use. %<*package> % \fi % -% \CheckSum{0} +% \CheckSum{12319} % % \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 @@ -1098,6 +1196,9 @@ This boolean may be tested by the user for later use. % \changes{v0.31}{2017/05/15}{\ 2017/05/15} % \changes{v0.32}{2017/06/09}{\ 2016/06/09} % \changes{v0.33}{2017/07/10}{\ 2017/07/10} +% \changes{v0.34}{2017/08/08}{\ 2017/08/08} +% \changes{v0.34}{2017/07/25}{File: \texttt{README.txt}: updated.} +% \changes{v0.34}{2017/07/25}{Docs: Horizontal space limitations.} @@ -1148,7 +1249,7 @@ This boolean may be tested by the user for later use. % using external utility programs only for the final conversion of text and images. % Math may be represented by \SVG\ files or MathJax. % -% Documents may be produced by \LaTeX, \LuaLaTeX, or \XeLaTeX. +% Documents may be produced by pdf\LaTeX, \LuaLaTeX, or \XeLaTeX. % A |texlua| script removes the need for system utilities such as |make| and |gawk|, % and also supports |xindy| and |latexmk|. Configuration is automatic at the % first manual compile. @@ -1159,8 +1260,8 @@ This boolean may be tested by the user for later use. % % A modular package-loading system uses the \pkg{lwarp} version of a package for % \HTML\ when available. -% Several dozen \LaTeX\ packages are supported with these high-level source -% compatibility replacements. +% More than a hundred \LaTeX\ packages are supported with these high-level source +% compatibility replacements, and many others work as-is. % % A tutorial is provided to quickly introduce the user to the major components % of the package. @@ -1232,6 +1333,67 @@ 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.34:] \ +% \begin{itemize} +% \item \env{BlockClass}'s optional argument has been moved +% \watchout[Optional arguments] +% in front of the mandatory argument: +% \begin{sourcedisplay} +% |BlockClass[style]{class}| \quad \textrm{(NEW)} +% \end{sourcedisplay} +% instead of: +% \begin{sourcedisplay} +% |BlockClass{class}[style]| \quad \textrm{(OLD)} +% \end{sourcedisplay} +% This change makes it more consistent with \LaTeX\ standards, +% and avoids problems with space between arguments. +% \item Likewise, \cs{InlineClass}'s optional argument now +% \watchout[Optional arguments] +% comes before the mandatory arguments: +% \begin{sourcedisplay} +% |\InlineClass[style]{class}{text}| +% \end{sourcedisplay} +% \item Improved compatibility between spans, minipages, lists, +% \margintag{spans with minipages} +% frames, and math. +% Handles minipages and lists inside an \HTML\ span, +% such as an \cs{fbox} containing a minipage, +% although with minimal \HTML\ fomatting. +% See \cref{sec:minipages}. +% \cs{fboxBlock} is added to frame minipages, tables, +% \margintag{framing minipages} +% and lists with full \HTML\ formatting +% but no longer inline, and behaves as \cs{fbox} for print output. +% The \env{fminipage} environment is added for framed minipages, +% as an environment with full \HTML\ formatting, +% and draws a framed minipage in print output. +% See \cref{sec:framedminipages}. +% \cs{fbox} and minipages now often work in \SVG\ math and \env{lateximage}s. +% MathJax supports \cs{fbox}, but not \cs{fboxBlock} nor \env{fminipage}. +% \item Improved compatibility between \env{lateximage} and +% \margintag{lateximage, \SVG\ math, tabular} +% \env{minipage}, \cs{parbox}, \cs{makebox}, \cs{fbox}, \cs{framebox}, +% \cs{raisebox}, \cs{scalebox}, \cs{reflectbox}, \env{tabular}, \pkg{booktabs}. +% \item Improved font control for \env{lateximage}es and \SVG\ math. +% \item Added the \env{eqnarray} environments.\margintag{eqnarray} +% \item \pkg{fancyvrb} is no longer required (preloaded), +% \margintag{verbatim packages} +% but is still supported. +% \item Added \pkg{verbatim} and \pkg{moreverb}. +% \item Added \pkg{fancybox}, \pkg{boxedminipage2e} and \pkg{shadow}. +% \margintag{framing packages} +% \item \pkg{enumitem} is no longer required, but is still supported. +% \margintag{list packages} +% \item Added \pkg{enumerate} and \pkg{paralist}. +% \item \pkg{titleps} is no longer required, but is still supported. +% \item Added \pkg{crop}. +% \item Added \pkg{rotfloat}, \pkg{marginfit}, +% and several minor packages; see the change log. +% \item Adds fixed-width \HTML\ spaces around punctuation +% \margintag{babel-french} +% when using \pkg{babel-french}. +% \end{itemize} +% \needspace{2\baselineskip} % \item[v0.33:] \ % \begin{itemize} % \item Tabular |@| and |!| columns now have their own \HTML\ columns. @@ -1354,7 +1516,7 @@ This boolean may be tested by the user for later use. % \item \cs{HTMLAuthor} \marg{name} assigns \HTML\ meta author if non-empty. % Defaults to \cs{theauthor}. % \item Booean |HTMLDebugComments| controls whether \HTML\ comments are -% added for closing \tag{div}s, opening and closing sections, etc. +% added for closing \element{div}s, opening and closing sections, etc. % \item Boolean |FormatEPUB| changes \HTML\ output for easy \EPUB\ conversion % via an external program. % Removes per-file headers, footers, and nav. Adds footnotes per chapter/section. @@ -1628,8 +1790,11 @@ This boolean may be tested by the user for later use. % Honors \cmds{tocdepth} and \cmds{secnumdepth}. % Adds \cmds{filedepth} for splitting the \HTML\ output. % Files may be numbered sequentially or named according to section name. -% Common short words and punctuation is removed from the filenames. \\ -% Table of Contents, Figures, Tables: & Supported, with hyperlinks. \\ +% Common short words and punctuation is removed from the filenames. +% Emulates \pkg{titlesec}. \\ +% Page layout: & Emulates \pkg{fancyhdr}, \pkg{titleps}. \\ +% Table of contents, figures, tables: & Supported, with hyperlinks. +% Emulates \pkg{titletoc} and \pkg{tocloft}. \\ % Title page: & \cs{maketitle}, \env{titlepage}, \pkg{titling}. Optional % \pkg{titling}-based commands for published and subtitle. \\ % \env{abstract}: & Supported \\ @@ -1639,10 +1804,12 @@ This boolean may be tested by the user for later use. % \HTML\ hyperlinks are generated for \TOC, \LOF, \LOT, % \cs{nameref}, \cs{ref}, % the \pkg{cleveref} commands, and index entries.\\ +% \pkg{url}: & Supported, without hyperlinks so far. \\ % \midrule +% Margin notes: & \pkg{marginfit}, \pkg{marginfix}. \\ % Footnotes: & \pkg{footnote}, \pkg{footmisc}, % \pkg{marginnote}, \pkg{sidenote}, \pkg{pagenote}, \pkg{endnotes}. \\ -% Indexing: & \cmds{texindy} is used, with hyperlinks. \\ +% Indexing: & \cmds{texindy} is used, with hyperlinks. \pkg{idxlayout} is emulated. \\ % Glossary: & \pkg{glossaries} and \cmds{xindy} are used. \\ % Bibliography: & Supported, without hyperlinks so far. \\ % \midrule @@ -1656,7 +1823,7 @@ This boolean may be tested by the user for later use. % \pkg{theorem}, \pkg{amsthm}, \pkg{ntheorem}. \\ % \midrule % Floats: & Appear where declared. -% \pkg{float}, \pkg{newfloat}, \pkg{caption} and \pkg{subcaption}, +% \pkg{float}, \pkg{rotfloat}, \pkg{newfloat}, \pkg{caption} and \pkg{subcaption}, % \pkg{subfig}, \pkg{capt-of}, \pkg{placeins}, \pkg{trivfloat}, \pkg{floatrow}, % \pkg{keyfloat}, \pkg{wrapfig}, \pkg{cutwin}, \pkg{floatflt}. \\ % \midrule @@ -1683,16 +1850,17 @@ This boolean may be tested by the user for later use. % \cs{rotatebox} and \cs{scalebox} are supported as well as \HTML\ can handle. \\ % \pkg{rotating}: & Emulated. All objects are displayed unrotated. \\ % \midrule -% Lists: & Supported \\ -% \pkg{enumitem}: & Supported, although spacing is still controlled by \CSS. \\ +% Lists: & Standard \LaTeX\ environments are supported, along with +% \pkg{enumitem}, \pkg{enumerate}, \pkg{paralist}. +% Spacing is still controlled by \CSS. \\ % \midrule % Environments: & Standard \LaTeX{} environments are supported. \\ % \pkg{picture} and \pkg{tikz}: & Converted to an \SVG\ image. \\ % \env{minipage}: & Supported with some \HTMLfive-imposed limitations. % Nested minipages are supported. % Footnotes appear at the bottom of the \HTML\ page. \\ -% \pkg{fancyvrb}: & Supported except for verbatim footnotes. \\ -% \pkg{framed}, \pkg{mdframed}: & Supported \\ +% Verbatim: & \pkg{verbatim}, \pkg{moreverb}, \pkg{fancyvrb} (except for verbatim footnotes). \\ +% Frames: & \pkg{framed}, \pkg{fancybox}, \pkg{mdframed}, \pkg{boxedminipage2e}, \pkg{shadow}. \\ % \pkg{multicol}: & Emulated, with \CSSthree. % Converted to up to three columns with an optional heading, % per browser support. Single-column if unsupported.\\ @@ -1736,7 +1904,7 @@ This boolean may be tested by the user for later use. % % % Supported packages include everything listed in the table of contents, -% plus each of the following in \cref{tab:additionalsupported}, +% plus the packages listed in \cref{tab:additionalsupported}, % and probably others which have not yet been tested. % Many are simply nullfied during \HTML\ output. % Others are not affected by the output mode and thus work as-is. @@ -1748,11 +1916,11 @@ This boolean may be tested by the user for later use. % \sffamily % babel, bm, % calc, cleveref, csquotes, -% enumitem, % fancyvrb, fileerr, -% newtxmath, +% newtxmath, nicefrac % siunitx, somedefs, % tikz, trace, +% units, url, % varioref, % xspace % \end{table} @@ -2588,7 +2756,7 @@ 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 |alt| tags. In this way, +% 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. % @@ -2904,7 +3072,7 @@ This boolean may be tested by the user for later use. % Defaults to \cs{theauthor}. % % \ItemDescribeMacro{\HTMLDescription} \marg{description} \quad -% Sets the \HTML\ description tag for +% Sets the \HTML\ \attribute{description} tag for % the following files. May be changed before each each sectioning command which would % cause a file split. % @@ -3379,8 +3547,6 @@ This boolean may be tested by the user for later use. % % \begin{itemize} % \item Paragraph formatting: \cs{parindent} \cs{parskip} -% \item Variable spaces such as \cs{vspace}. \cs{hfill} is turned into a \cs{quad}. -% Fixed spaces such as \cs{quad} are emulated correctly. % \item Manual page positions such as the \pkg{textpos} package, which is % emulated but only in a limited way. % \end{itemize} @@ -3392,86 +3558,6 @@ This boolean may be tested by the user for later use. % Also see \cref{sec:troubleshooting}: \nameref{sec:troubleshooting}. % % -% \subsection{Commands for a successful HTML conversion} -% \label{sec:successfulcommands} -% \index{HTML>commands for a successful conversion} -% -% \changes{v0.14}{2016/03/26}{Docs: Commands for a successful \HTML\ conversion.} -% -% Some commonly-used \LaTeX{} expressions should be modified to allow -% for a smooth conversion to both \HTML\ and print-formatted outputs: -% -% \begin{description} -% -% \item [Page references:] The printed page does not translate to the \HTML\ -% page, so references to page numbers are converted to parentheses containing -% \cs{pagerefPageFor}, which defaults to ``see '', -% followed by a hyperlink to the appropriate -% object. Ex: ``Sec.~\textcolor{red}{1.23} -% on page (see sec.~\textcolor{red}{1.23})''. -% \cs{pagerefPageFor} may be redefined to ``page for '', empty, etc. -% -% \item [\cs{bfseries}, etc:] Use \cs{textbf} instead. -% \item [\cs{centering}, \cs{raggedright}, \cs{raggedleft}:] ~ -% -% Use the environments \env{center}, \env{flushright}, \env{flushleft} instead. -% -% \item [Superscripts and other non-math uses of math mode:] ~ -% -% Use \cs{textsuperscript\{x\}} instead of |$^{x}$| -% -% \item [Empty \cs{item} followed by a new line of text or a nested list:] \ -% -% Use a trailing backslash: |\item[label] \| -% \index{item, list, empty}\index{list item, empty} -% -% \item [Filenames in lists:] \ -% -% Escape underscores in -% \margintag{filename underscore} -% the filenames: -% \begin{sourcedisplay} -% |\item[\href{file\_name.pdf}{text}]| -% \end{sourcedisplay} -% \index{underscore>filename}\index{file>underscore} -% \changes{v0.24}{2017/03/13}{Docs: Filename underscore.} -% -% \item [Side-by-side minipages:] \ -% -% Place side-by-side minipages inside a |center| environment, -% with horizontal space between them, such as \cs{quad}, \cs{qquad}, -% \cs{hspace}, or \cs{hfill}. The result is similar in print and -% \HTML. Do not use space commands at the start or end of the line. -% -% \item [\cs{fbox} around a minipage:] ~ -% -% \cs{fbox} can only be used around inline items during -% \HTML\ output. -% -% For an \cs{fbox} around a minipage, you may: -% \index{fbox>around a minipage} -% \index{minipage>in an \cs{fbox}} -% \begin{itemize} -% \item Place the \cs{fbox} command and -% its closing brace inside \env{warpprint} environments. -% \item Use \cs{mdframed} instead. -% ^^A \item Use the \env{example} or \env{sidebar} environments. -% \item Use a custom environment to create a sidebar, -% containing a \env{BlockClass} environment -% with custom \CSS\ formatting, -% and |\warpprintonly{\hrule}| command: -% \begin{Verbatim}[gobble=2,frame=lines] -% \begin{BlockClass}{frameminipage}% ignored in print output -% % use CSS to format div class ``framedminipage'' -% \warpprintonly{\hrule} % only appears in print output -% Contents -% \warpprintonly{\hrule} % only appears in print output -% \end{BlockClass} -% \end{Verbatim} -% \end{itemize} -% \end{description} -% -% Also see \cref{sec:troubleshooting}: \nameref{sec:troubleshooting}. % % % @@ -3501,7 +3587,7 @@ This boolean may be tested by the user for later use. % % \DescribeEnv{titlepage} % The \env{titlepage} environment may be used to hold a custom title page. -% The titlepage will be set in a \tag{div} class |titlepage|, and \cs{printtitle}, etc.\ may be used +% The titlepage will be set in a \element{div} class |titlepage|, and \cs{printtitle}, etc.\ may be used % inside this environment. % % \DescribeEnv{titlingpage} @@ -3514,31 +3600,31 @@ This boolean may be tested by the user for later use. % file break and \CSS\ detection. % \watchout % Use the |\subtitle| command instead. -% In \HTML, the title will appear in a heading |h1|. +% In \HTML, the title will appear in a heading \element{h1}. % % \DescribeMacro{\author} \marg{author} % % In |\author|, use |\protect| before formatting commands such as |\textsc|. % \watchout -% In \HTML, the author will appear in a \tag{div} class |author|. +% In \HTML, the author will appear in a \element{div} class |author|. % \cs{affiliation} is a new addition to \pkg{lwarp}. % % \DescribeMacro{\date} \marg{date} % % |\date| works as expected. -% In \HTML, this will appear in a \tag{div} class |titledate|. +% In \HTML, this will appear in a \element{div} class |titledate|. % % \DescribeMacro{\subtitle} \marg{subtitle} % % A new command which sets a subtitle. Newlines are allowed. % The default is empty. -% In \HTML, this will appear in a \tag{div} class |subtitle|. +% In \HTML, this will appear in a \element{div} class |subtitle|. % % \DescribeMacro{\published} \marg{published} % % A new command which sets a publisher. % The default is empty. -% In \HTML, this will appear in a \tag{div} class |published|. +% In \HTML, this will appear in a \element{div} class |published|. % % % \DescribeMacro{\thanks} \marg{text} @@ -3584,7 +3670,7 @@ This boolean may be tested by the user for later use. % \index{author>HTML meta tag} % \index{meta tag, HTML>author} % \DescribeMacro{\HTMLAuthor} \marg{author} \quad Sets the contents -% of the web page \tag{meta name="author"} tag. +% of the web page \element{meta name="author"} element. % Defaults to |\HTMLAuthor{\theauthor}|. % May be set empty to cancel the meta author tag. % @@ -3661,10 +3747,64 @@ This boolean may be tested by the user for later use. % \subsection{Special cases and limitations} % \label{sec:limitations} % +% +% \label{sec:successfulcommands} +% \index{HTML>commands for a successful conversion} +% +% \changes{v0.14}{2016/03/26}{Docs: Commands for a successful \HTML\ conversion.} +% +% Also see \cref{sec:troubleshooting}: \nameref{sec:troubleshooting}. +% +% Some commonly-used \LaTeX{} expressions should be modified to allow +% for a smooth conversion to both \HTML\ and print-formatted outputs: +% +% +% \subsubsection{Page references} The printed page does not translate to the \HTML\ +% page, so references to page numbers are converted to parentheses containing +% \cs{pagerefPageFor}, which defaults to ``see '', +% followed by a hyperlink to the appropriate +% object. Ex: ``Sec.~\textcolor{red}{1.23} +% on page (see sec.~\textcolor{red}{1.23})''. +% \cs{pagerefPageFor} may be redefined to ``page for '', empty, etc. +% +% % \subsubsection{Text formatting} % % \limitstext % +% \subsubsection{Horizontal space} +% +% \limitshspace +% +% +% \subsubsection{Text alignment} +% +% Use the environments \env{center}, \env{flushright}, \env{flushleft} instead +% of the macros \cs{centering}, \cs{raggedright}, \cs{raggedleft}. +% +% +% \subsubsection{Superscripts and other non-math uses of math mode} +% +% Use \cs{textsuperscript\{x\}} instead of |$^{x}$| +% +% \subsubsection{Empty \cs{item} followed by a new line of text or a nested list:} +% +% Use a trailing backslash: |\item[label] \| +% \index{item>empty}\index{list item, empty} +% +% \subsubsection{Filenames in lists} +% +% \index{underscore>filename}\index{file>underscore} +% \changes{v0.24}{2017/03/13}{Docs: Filename underscore.} +% Escape underscores in +% \margintag{filename underscore} +% the filenames: +% \begin{sourcedisplay} +% |\item[\href{file\_name.pdf}{text}]| +% \end{sourcedisplay} +% +% +% % \subsubsection{Cross-references} % % \limitsreferences @@ -3675,6 +3815,10 @@ This boolean may be tested by the user for later use. % % \limitspageref % +% \subsubsection{Hyperlinks, \pkg{hyperref}, and \pkg{url}} +% +% \limitshyperlinks +% % % \subsubsection{Footnotes and page notes} % @@ -3706,7 +3850,7 @@ This boolean may be tested by the user for later use. % % % \subsubsection{Tabular} -% +% \label{sec:limitstabular} % \limitstabular % % @@ -3723,10 +3867,102 @@ This boolean may be tested by the user for later use. % % % \subsubsection{Minipages} +% \label{sec:minipages} % % \limitsminipage % % +% \subsubsection{Side-by-side minipages} +% +% Place side-by-side minipages inside a |center| environment, +% with horizontal space between them, such as \cs{quad}, \cs{qquad}, +% \cs{hspace}, or \cs{hfill}. The result is similar in print and +% \HTML. Do not use space commands at the start or end of the line. +% +% \subsubsection{Framed minipages and other environments} +% \label{sec:framedminipages} +% +% \cs{fbox} can only be used around inline \element{span} items during +% \HTML\ output, but \HTML\ cannot place a block element such as a \element{div} for a minipage +% or a list inside of a \element{span}. Several options are provided for framing an object, +% depending on which kind of object and which packages are loaded: +% +% For a framed object, options include: +% \DescribeMacro{\fbox} +% \DescribeMacro{\fboxBlock} +% \DescribeEnv{fminipage} +% \index{fbox>around a minipage} +% \index{minipage>framed} +% \index{framed objects} +% \begin{description}[style=unboxed] +% \item [To remove the frame in HTML output:] Place the \cs{fbox} command and +% its closing brace inside \env{warpprint} environments. +% This will nullify the frame for \HTML\ output. +% \item [To frame the contents inline with some formatting losses in HTML:] +% This is the default action of \cs{fbox} when enclosing a minipage. +% \margintag{For inline text:} +% During \HTML\ output, \cs{fbox} nullifies the \HTML\ tags +% for \env{minipage}, \cs{parbox}, +% and lists. The contents are included as inline text inside the +% \cs{fbox}'s \element{span} of class |framebox|. +% For lists, line breaks are converted to \HTML\ breaks. +% The result is a plain-text inline version of the contents, framed inline +% with the surrounding text, but lacking any extra \HTML\ markup. +% \item [To frame the contents on their own line with improved formatting in HTML:] A new +% command \cs{fboxBlock} is included, +% \margintag{For inline \env{minipage} and lists:} +% intended to be a direct replacement +% for \cs{fbox} for cases where the \cs{fbox} surrounds a minipage, table, or list. +% For print output, this behaves as \cs{fbox}. +% For \HTML\ output, the contents are placed +% inside an \HTML\ \element{div} with the class |framed|, resulting in the contents +% being placed on their own line with a frame surrounding them. +% The contents preserve their \HTML\ formatting, so lists and minipages look nicer, +% and valid \HTML\ is created for a \env{tabular}. +% While an \cs{fbox} containing a \env{tabular} is valid \LaTeX\ code, the result +% in \HTML\ is problematic since a table is a \element{div} not a \element{span}, +% so use \cs{fboxBlock} around a \env{tabular}, or else place the \env{tabular} +% inside a \env{minipage}, or use \env{fminipage}, described next. +% Also see below regarding the ``Misplaced alignment tab character \&'' error. +% \item [To create a framed minipage in both print and HTML:] A new environment \env{fminipage} +% \margintag{For display \env{tabular}, minipages, and lists:} +% is included. For print output, this is identical to \env{minipage}, except that +% it is also framed. +% For \HTML\ output, this forms a \element{div} of class |framed|, the contents +% preserve their \HTML\ formatting, and valid \HTML\ is created for a \env{tabular}. +% Also see below regarding the ``Misplaced alignment tab character \&'' error. +% \item [To frame tables or verbatim environments:] Place the contents +% inside a \env{fminipage}, or perhaps a \cs{fboxBlock} for a \env{tabular}. +% Also, if using \cs{fboxblock} with \env{tabular}, +% \watchout[Misplaced alignment tab character \&] +% you will have to use \cs{StartDefiningTabulars} +% before the start of the macro which uses \cs{fboxBlock} and the \env{tabular}, +% and \cs{EndDefiningTabulars} afterwards. +% Also see the \pkg{lwarp} documentation for the \pkg{fancybox} package. +% \item [To frame equations:] See the \pkg{lwarp} documentation for the \pkg{fancybox} package. +% \item [For fancy framed minipages:] See packages \pkg{boxedminipage}, +% \pkg{shadow}, \pkg{fancybox}, \pkg{framed}, \pkg{mdframed}. +% \item [Custom environments:] Use a custom environment to create a sidebar, +% containing a \env{BlockClass} environment +% with custom \CSS\ formatting, +% and |\warpprintonly{\hrule}| command: +% \begin{Verbatim}[gobble=2,frame=lines] +% \begin{BlockClass}{frameminipage}% ignored in print output +% % use CSS to format div class ``framedminipage'' +% \warpprintonly{\hrule} % only appears in print output +% Contents +% \warpprintonly{\hrule} % only appears in print output +% \end{BlockClass} +% \end{Verbatim} +% \end{description} +% +% +% +% \subsubsection{\pkg{fancybox} package} +% +% \limitsfancybox +% +% % \subsubsection{\pkg{mdframed} package} % % \limitsmdframed @@ -3768,6 +4004,13 @@ This boolean may be tested by the user for later use. % \limitssiunitx % % +% \subsubsection{\pkg{units} and \pkg{nicefrac} packages} +% +% \DescribePackage{units} +% \DescribePackage{nicefrac} +% \limitsnicefrac +% +% % \subsubsection{\pkg{newclude} package} % % \changes{v0.14}{2016/03/29}{Docs: Newclude limitations.} @@ -3785,7 +4028,7 @@ This boolean may be tested by the user for later use. % \subsubsection{\pkg{babel} package} % % \DescribePackage{babel} -% \limitsbabelone +% ^^A \limitsbabelone % % \limitsbabeltwo % @@ -3797,16 +4040,6 @@ This boolean may be tested by the user for later use. % \limitsglossaries % % -% \subsubsection{\pkg{enumitem} package} -% -% \DescribePackage{enumitem} -% \limitsenumitem -% -% -% \subsubsection{\pkg{enumerate} package} -% -% \DescribePackage{enumerate} -% \limitsenumerate % % % @@ -3824,10 +4057,10 @@ This boolean may be tested by the user for later use. % to \EPUB. % % To assign the author's name for regular \pkg{lwarp} \HTML\ -% \margintag{\tag{meta} author} +% \margintag{\element{meta} author} % files, and also for the \EPUB, % use \cs{HTMLAuthor} \marg{name}. This assigns the name to the -% \tag{meta} author tag. It may be set empty, and it defaults to +% \element{meta} author element. It may be set empty, and it defaults to % \cs{theauthor}. % % A special boolean is provided to simplify the process of @@ -3879,8 +4112,8 @@ This boolean may be tested by the user for later use. % see \cref{tab:depthsheadings}. % For example, an |article| % class document would break at \cs{section}, which is mapped to \HTML\ -% heading level \tag{h4}, whereas a |book| class document would break at \cs{chapter}, -% which is \HTML\ heading level \tag{h3}. +% heading level \element{h4}, whereas a |book| class document would break at \cs{chapter}, +% which is \HTML\ heading level \element{h3}. % For Calibre, this option is found in % \begin{UIdisplay} % \textsf{Preferences $\to$ Conversion (Common Options) $\to$ @@ -3891,7 +4124,7 @@ This boolean may be tested by the user for later use. % \begin{UIdisplay} % Math HTML tags with tag name: % \end{UIdisplay} -% to \tag{h4}. (Or \tag{h3} for document classes with \cs{chapter}s.) +% to \element{h4}. (Or \element{h3} for document classes with \cs{chapter}s.) % The \textsf{Detect chapters at} field should then show % \begin{UIdisplay} % //h:h4 \qquad \textrm{---\,or\,---} \qquad //h:h3 @@ -3969,7 +4202,7 @@ This boolean may be tested by the user for later use. % \item Forces single-file output. % \item Turns off \HTML\ debugging comments. % These are comments appearing inside the \HTML\ code, -% marking the opening/closing of sections and \tag{div}s, +% marking the opening/closing of sections and \element{div}s, % but they are no longer useful when the document has been % imported into a word processor. % \end{itemize} @@ -4127,6 +4360,7 @@ This boolean may be tested by the user for later use. % % \changes{v0.14}{2016/03/26}{Docs: Troubleshooting cross-references.} % \changes{v0.16}{2016/04/08}{Docs: Text not converting.} +% \changes{v0.34}{2017/08/08}{Docs: Misplaced alignment character.} % % \begin{description} % @@ -4136,9 +4370,18 @@ This boolean may be tested by the user for later use. % See \cref{sec:fonts} regarding vector fonts. % \end{itemize} % -% \item [Undefined \HTML\ settings:] \ +% \item [Undefined HTML settings:] \ +% \begin{itemize} % \item See the warning regarding the placement of the \HTML\ settings % at \cref{sec:htmlsettings}. +% \end{itemize} +% +% \item [Misplaced alignment character \&:] \ +% \begin{itemize} +% \item If using \env{tabular} inside a \cs{fbox} or other macro, +% use \cs{StartDefiningTabulars} before the definition, and +% \cs{EndDefiningTabulars} after. See \cref{sec:limitstabular} +% \end{itemize} % % \item [Obscure error messages:] ~ % \begin{itemize} @@ -4154,7 +4397,7 @@ This boolean may be tested by the user for later use. % and the use of \cs{tableofcontents} in the home page. % \end{itemize} % -% \item [Missing \HTML\ files:] \ +% \item [Missing HTML files:] \ % \item See the warning regarding changes to the \HTML\ settings % at \cref{sec:htmlsettings}. % @@ -4343,16 +4586,16 @@ This boolean may be tested by the user for later use. % \toprule % Section & \parbox[c]{.35in}{\LaTeX{} depth} & \HTML\ headings \\ % \midrule -% title of the entire website & & h1 \\ +% title of the entire website & & \element{h1} \\ % none & -5 & new for this package \\ % book & -2 & \textbf{not yet used} \\ -% part & -1 & h2 \\ -% chapter & 0 & h3 \\ -% section & 1 & h4 \\ -% subsection & 2 & h5 \\ -% subsubsection & 3 & h6 \\ -% paragraph & 4 & span class = "paragraph" \\ -% subparagraph & 5 & span class = "subparagraph" \\ +% part & -1 & \element{h2} \\ +% chapter & 0 & \element{h3} \\ +% section & 1 & \element{h4} \\ +% subsection & 2 & \element{h5} \\ +% subsubsection & 3 & \element{h6} \\ +% paragraph & 4 & \element{span class = "paragraph"} \\ +% subparagraph & 5 & \element{span class = "subparagraph"} \\ % listitem & 7 & new for this package, used for list items \\ % \bottomrule % \end{tabular} @@ -4360,9 +4603,9 @@ This boolean may be tested by the user for later use. % % Support for the \pkg{memoir} package will require the addition of a |book| % level, which may push the \HTML\ headings down a step, and also cause -% |subsubsection| to become a \tag{div} due to a limit of six \HTML\ headings. +% |subsubsection| to become a \element{div} due to a limit of six \HTML\ headings. % -% It is possible to use \HTMLfive{} \cmds{section} and \cmds{H1} for all levels, +% It is possible to use \HTMLfive{} \element{section} and \element{h1} for all levels, % but this may not be well-recognized by older browsers. % % Fixed levels for parts and chapters allow the \CSS\ to remain fixed as well. @@ -4476,6 +4719,13 @@ This boolean may be tested by the user for later use. % \end{macrocode} +% \DescribePackage{letltxmacro} +% Used to redefine \cs{textbf} and friends. +% +% \begin{macrocode} +\RequirePackage{letltxmacro} +% \end{macrocode} +% % \clearpage % @@ -4899,9 +5149,11 @@ after lwarp.} % \begin{macrocode} \newcommand*{\LWR@loadnever}[2]{% \PackageError{lwarp} -{Package #1 does not work with lwarp's HTML conversion. -Please use the #2 package instead} -{Package #1 conflicts with lwarp in some way, but package #2 probably will work instead.} +{Package #1 is not supported by lwarp's HTML conversion. +Package(s) #2 may be useful instead} +{Package #1 might conflict with lwarp in some way, +or is superceded by another package. +For a possible alternative, see package(s) #2.} } % \end{macrocode} % \end{macro} @@ -4922,30 +5174,45 @@ Please use the #2 package instead} \LWR@loadafter{algorithmicx} \LWR@loadafter{alltt} \LWR@loadafter{amsthm} +\LWR@loadafter{array} +\LWR@loadafter{balance} \LWR@loadafter{bookmark} \LWR@loadafter{booktabs} +\LWR@loadafter{boxedminipage} +\LWR@loadafter{boxedminipage2e} \LWR@loadafter{ccaption} \LWR@loadafter{changepage} +\LWR@loadafter{crop} \LWR@loadafter{cutwin} \LWR@loadafter{dcolumn} \LWR@loadafter{draftwatermark} \LWR@loadafter{ellipsis} \LWR@loadafter{emptypage} \LWR@loadafter{enumerate} +\LWR@loadafter{enumitem} \LWR@loadafter{epigraph} \LWR@loadafter{eso-pic} \LWR@loadafter{everypage} +\LWR@loadafter{everyshi} \LWR@loadafter{extramarks} +\LWR@loadafter{fancybox} \LWR@loadafter{fancyhdr} -\LWR@loadafter{floatrow} +\LWR@loadafter{fancyvrb} +\LWR@loadafter{figcaps} \LWR@loadafter{float} \LWR@loadafter{floatflt} +\LWR@loadafter{floatpag} +\LWR@loadafter{floatrow} +\LWR@loadafter{flushend} \LWR@loadafter{ftnright} +\LWR@loadafter{fullpage} \LWR@loadafter{geometry} \LWR@loadafter{glossaries} % \LWR@loadafter{graphics}% pre-loaded by xunicode % \LWR@loadafter{graphicx}% pre-loaded by xunicode \LWR@loadafter{hyperref} +\LWR@loadafter{hyperxmp} +\LWR@loadafter{idxlayout} \LWR@loadafter{indentfirst} \LWR@loadafter{keyfloat} \LWR@loadafter{layout} @@ -4956,11 +5223,13 @@ Please use the #2 package instead} \LWR@loadafter{longtable} \LWR@loadafter{lscape} \LWR@loadafter{ltcaption} +\LWR@loadafter{marginfit} \LWR@loadafter{marginfix} \LWR@loadafter{marginnote} \LWR@loadafter{mcaption} \LWR@loadafter{mdframed} \LWR@loadafter{microtype} +\LWR@loadafter{moreverb} \LWR@loadafter{mparhack} %\LWR@loadafter{multicol}% loaded by ltxdoc \LWR@loadafter{multirow} @@ -4971,11 +5240,18 @@ Please use the #2 package instead} \LWR@loadafter{nowidow} \LWR@loadafter{ntheorem} \LWR@loadafter{pagenote} +\LWR@loadafter{paralist} \LWR@loadafter{parskip} +\LWR@loadafter{pdflscape} +\LWR@loadafter{pdfsync} \LWR@loadafter{placeins} +\LWR@loadafter{prelim2e} \LWR@loadafter{ragged2e} \LWR@loadafter{rotating} +\LWR@loadafter{rotfloat} +\LWR@loadafter{savetrees} \LWR@loadafter{setspace} +\LWR@loadafter{shadow} \LWR@loadafter{showidx} \LWR@loadafter{showkeys} \LWR@loadafter{sidecap} @@ -5000,6 +5276,7 @@ Please use the #2 package instead} \LWR@loadafter{wrapfig} \LWR@loadafter{xcolor} \LWR@loadafter{xfrac} +\LWR@loadafter{xmpincl} % \end{macrocode} @@ -5324,11 +5601,29 @@ top=1in,bottom=1in,% \begin{warpall} % \end{macrocode} -% \DescribePackage{fancyvrb} +% \DescribePackage{filecontents} +% +% Used to write helper files, done in print mode. +% +% Patched to work with \pkg{morewrites}, per +% \href +% {https://tex.stackexchange.com/questions/312830/does-morewrites-not-support-filecontents-and-can-i-write-body-of-environment-us/312910} +% {\texttt{https://tex.stackexchange.com/questions/312830/\\ +% does-morewrites-not-support-filecontents-and-can-i-write-body-of-environment-us/\\ +% 312910}} +% +% \changes{v0.34}{2017/08/02}{\pkg{filecontents}: Required. Patched for \protect\pkg{morewrites}.} % -% Used for Verbatim, verse. % \begin{macrocode} -\RequirePackage{fancyvrb} +\RequirePackage{filecontents} + +\@ifpackagelater{filecontents}{2011/10/09}% +{} +{ +\newwrite\fcwrite +\let\LWR@origfilec@ntents\filec@ntents +\def\filec@ntents{\def\chardef##1\write{\let\reserved@c\fcwrite}\LWR@origfilec@ntents} +} % \end{macrocode} @@ -5356,6 +5651,12 @@ top=1in,bottom=1in,% % \end{macrocode} +% \DescribePackage{xstring} +% \begin{macrocode} +\RequirePackage{verbatim} +% \end{macrocode} + + % \DescribePackage{makeidx} % \begin{macrocode} \RequirePackage{makeidx} @@ -5389,16 +5690,6 @@ top=1in,bottom=1in,% % conflicted with \pkg{subfig}.} -% \DescribePackage{enumitem} -% -% \pkg{enumitem} is patched to support |\newlist| with \HTML. -% \begin{macrocode} -\RequirePackage{enumitem} -\setlist[itemize]{leftmargin=0em} -\setlist[enumerate]{leftmargin=0em} -\setlist[description]{leftmargin=0em} -% \end{macrocode} - % \begin{macrocode} \end{warpHTML} % \end{macrocode} @@ -5416,6 +5707,14 @@ top=1in,bottom=1in,% \RequirePackage{titling} % \end{macrocode} +% \DescribePackage{environ} +% +% Used to encapsulate math environments for re-use in \HTML\ ALT text. +% +% \begin{macrocode} +\RequirePackage{environ} +% \end{macrocode} + % \begin{macrocode} \end{warpall} % \end{macrocode} @@ -5452,12 +5751,20 @@ top=1in,bottom=1in,% % \end{macrocode} -% \DescribePackage{environ} +% \DescribePackage{xfrac} % -% Used to encapsulate math environments for re-use in \HTML\ ALT text. +% Patched for \HTML\ use. +% See \cref{sec:xfrac}. + +% \begin{macrocode} +\RequirePackage{xfrac} +% \end{macrocode} + +% +% Used to convert lengths for image width/height options. % % \begin{macrocode} -\RequirePackage{environ} +\RequirePackage{printlen} % \end{macrocode} @@ -5466,68 +5773,9 @@ top=1in,bottom=1in,% -% \DescribePackage{titleps} -% \changes{v0.19}{2016/05/27}{titleps: null \cs{pagestyle} and \cs{thispagestyle} for HTML.} -% -% Used to place an \HTML\ comment into the footer of a page below the footnotes. -% This comment is used for |lateximage| environments, including math. -% -% The |nopatches| option prevents titleps from trying to patch sectioning commands. -% -% \cs{pagestyle} and \cs{thispagestyle} are nullified for \HTML\ output. -% + % \begin{macrocode} -\RequirePackage[nopatches]{titleps} -% \end{macrocode} -% -% \begin{macro}{\pagestyle} \marg{style} -% \begin{macrocode} -\let\LWR@origpagestyle\pagestyle -\renewcommand*{\pagestyle}[1]{} -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\thispagestyle} \marg{style} -% \begin{macrocode} -\let\LWR@origthispagestyle\thispagestyle -\renewcommand*{\thispagestyle}[1]{} -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\pagenumbering} \marg{commands} -% \begin{macrocode} -\let\LWR@origpagenumbering\pagenumbering -\renewcommand*{\pagenumbering}[1]{} -% \end{macrocode} -% \end{macro} -% - - -% \DescribePackage{xfrac} -% -% Patched for \HTML\ use. -% See \cref{sec:xfrac}. - -% \begin{macrocode} -\RequirePackage{xfrac} -% \end{macrocode} - -% -% Used to convert lengths for image width/height options. -% -% \begin{macrocode} -\RequirePackage{printlen} -% \end{macrocode} - - - - - - - - -% \begin{macrocode} -\end{warpHTML} +\end{warpHTML} % \end{macrocode} @@ -5544,7 +5792,7 @@ top=1in,bottom=1in,% % Remember the original \cs{RequirePackage}: % \begin{macrocode} -\let\LWR@origRequirePackage\RequirePackage +\LetLtxMacro{\LWR@origRequirePackage}{\RequirePackage} % \end{macrocode} % \begin{macro}{\LWR@requirepackagenames} Stores the list of required package names. @@ -5640,7 +5888,7 @@ top=1in,bottom=1in,% {\LWR@origRequirePackage{\LWR@requirepackagenames}} } } -\let\usepackage\RequirePackage +\LetLtxMacro{\usepackage}{\RequirePackage} % \end{macrocode} % \end{macro} @@ -5760,7 +6008,7 @@ top=1in,bottom=1in,% % \DescribeBoolean{HTMLDebugComments} Default false. % Add comments in \HTML\ -% about closing \tag{div}s, sections, etc. +% about closing \element{div}s, sections, etc. % \index{HTML>conversion settings>debug comments} % \index{debugging>HTML debug comments} % \index{troubleshooting>HTML debug comments} @@ -5774,6 +6022,19 @@ top=1in,bottom=1in,% +% If \cs{tracinglwarp}, show where preamble hooks occur: +% \begin{macrocode} +\AfterEndPreamble{ +\LWR@traceinfo{AfterEndPreamble} +} + +\AtBeginDocument{ +\LWR@traceinfo{AtBeginDocument} +} +% \end{macrocode} + + + % \section{HTML-conversion output modifications} % @@ -5819,7 +6080,7 @@ top=1in,bottom=1in,% % This helps identify boundaries of floats to be manually converted % to word-processor frames. % (Perhaps some day word processors will have \HTML\ import options -% for identifying \tag{div} classes for figures and tables.) +% for identifying \element{div} classes for figures and tables.) % \index{word processor>HTML conversion settings} % \index{HTML>conversion settings>word processor} % @@ -5848,16 +6109,29 @@ top=1in,bottom=1in,% % Will be temporarily restored to original meaning inside any lateximage environment. % Also nullify unused commands. % \begin{macrocode} -\let\LWR@origtextit\textit -\let\LWR@origtextbf\textbf -\let\LWR@origtexttt\texttt -\let\LWR@origtextsc\textsc -\let\LWR@origtextsf\textsf -\let\LWR@origtextrm\textrm -\let\LWR@origbfseries\bfseries -\let\LWR@origrmfamily\rmfamily -\let\LWR@origttfamily\ttfamily -\let\LWR@orignormalfont\normalfont +\LetLtxMacro{\LWR@origtextrm}{\textrm} +\LetLtxMacro{\LWR@origtextsf}{\textsf} +\LetLtxMacro{\LWR@origtexttt}{\texttt} +\LetLtxMacro{\LWR@origtextnormal}{\textnormal} +\LetLtxMacro{\LWR@origtextbf}{\textbf} +\LetLtxMacro{\LWR@origtextmd}{\textmd} +\LetLtxMacro{\LWR@origtextit}{\textit} +\LetLtxMacro{\LWR@origtextsl}{\textsl} +\LetLtxMacro{\LWR@origtextsc}{\textsc} +\LetLtxMacro{\LWR@origtextup}{\textup} +\LetLtxMacro{\LWR@origemph}{\emph} + +\LetLtxMacro{\LWR@origrmfamily}{\rmfamily} +\LetLtxMacro{\LWR@origsffamily}{\sffamily} +\LetLtxMacro{\LWR@origttfamily}{\ttfamily} +\LetLtxMacro{\LWR@origbfseries}{\bfseries} +\LetLtxMacro{\LWR@origmdseries}{\mdseries} +\LetLtxMacro{\LWR@origupshape}{\upshape} +\LetLtxMacro{\LWR@origslshape}{\slshape} +\LetLtxMacro{\LWR@origscshape}{\scshape} +\LetLtxMacro{\LWR@origitshape}{\itshape} +\LetLtxMacro{\LWR@origem}{\em} +\LetLtxMacro{\LWR@orignormalfont}{\normalfont} \let\LWR@origraggedright\raggedright \let\LWR@origonecolumn\onecolumn @@ -5869,17 +6143,30 @@ top=1in,bottom=1in,% \let\LWR@orignewpage\newpage -\let\LWR@origminipage\minipage +\let\LWR@origpagestyle\pagestyle +\let\LWR@origthispagestyle\thispagestyle +\let\LWR@origpagenumbering\pagenumbering + +\LetLtxMacro{\LWR@origminipage}{\minipage} \let\LWR@origendminipage\endminipage +\LetLtxMacro{\LWR@origparbox}{\parbox} \let\LWR@orignewline\newline -\let\LWR@origitem\item +\LetLtxMacro{\LWR@origitem}{\item} + +\LetLtxMacro{\LWR@origitemize}{\itemize} +\LetLtxMacro{\LWR@endorigitemize}{\enditemize} +\LetLtxMacro{\LWR@origenumerate}{\enumerate} +\LetLtxMacro{\LWR@endorigenumerate}{\endenumerate} +\LetLtxMacro{\LWR@origdescription}{\description} +\LetLtxMacro{\LWR@endorigdescription}{\enddescription} + \let\LWR@origpar\par -\let\LWR@origfootnote\footnote +\LetLtxMacro{\LWR@origfootnote}{\footnote} \let\LWR@orig@mpfootnotetext\@mpfootnotetext \let\LWR@origclearpage\clearpage @@ -6048,7 +6335,7 @@ homehtmlfilename = "\HomeHTMLFilename"% % % \begin{macrocode} \begin{warpprint} -\begin{VerbatimOut}{lwarp.css} +\begin{filecontents*}{lwarp.css} /* CSS stylesheet for the LaTeX lwarp package Copyright 2016-2017 Brian Dunn — BD Tech Concepts LLC @@ -6108,7 +6395,7 @@ span.indexitem {margin-left: 0em} span.indexsubitem {margin-left: 2em} span.indexsubsubitem {margin-left: 4em} -div.hidden { display: none ; } +div.hidden, span.hidden { display: none ; } kbd { font-family: "DejaVu Mono", "Bitstream Vera Mono", "Lucida Console", @@ -6117,12 +6404,16 @@ kbd { font-size: 100% ; } +pre { padding: 3pt ; } + span.strong { font-weight: bold; } span.textmd { font-weight: normal; } span.textsc { font-variant: small-caps; } +span.textsl { font-style: oblique; } + span.textup { font-variant: normal; } span.textrm { @@ -6440,6 +6731,13 @@ border-bottom: 1px solid silver ; overflow-x: auto; } +span.listinglabel { + display: inline-block ; + font-size: 70% ; + width: 4em ; + text-align: right ; + margin-right: 2em ; +} div.abstract { margin: 2em 5% 2em 5% ; @@ -6532,15 +6830,40 @@ div.doublespace { line-height: 2 ; } /* Have not yet researched this. */ .minipage p {margin: .75ex 0em .75ex 0em ;} +.shadowbox, .shabox { + border: 1px solid black; + box-shadow: 3px 3px 3px #808080 ; + border-radius: 0px ; + padding: .4ex .3em .4ex .3em ; + margin: 0pt .3ex 0pt .3ex ; + display: inline-block ; +} + +.doublebox { + border: 3px double black; + border-radius: 0px ; + padding: .4ex .3em .4ex .3em ; + margin: 0pt .3ex 0pt .3ex ; + display: inline-block ; +} + +.ovalbox, .Ovalbox { + border: 1px solid black; + border-radius: 1ex ; + padding: .4ex .3em .4ex .3em ; + margin: 0pt .3ex 0pt .3ex ; + display: inline-block ; +} + +.Ovalbox { border-width: 2px ; } + .framebox { - margin: 0ex ; - padding: 0ex ; border: 1px solid black; border-radius: 0px ; padding: .3ex .2em 0ex .2em ; - margin: .1ex ; + margin: 0pt .1ex 0pt .1ex ; display: inline-block ; } @@ -6583,7 +6906,7 @@ div.doublespace { line-height: 2 ; } /* framed package */ -.framed { +.framed, pre.boxedverbatim { margin: 3ex 0em 3ex 0em ; border: 1px solid black; border-radius: 0px ; @@ -6622,7 +6945,8 @@ dl { } dl dt { - margin-top: 1ex; + margin-top: 1ex; + margin-left: 1em ; font-weight: bold; } @@ -6844,6 +7168,8 @@ div.flushright{text-align:right;} div.flushright table {margin-left:auto ; margin-right: 0em ;} +/* Fancybox */ +div.Btrivlist table tr td { padding: .2ex 0em ; } /* program listing callouts: */ @@ -7233,7 +7559,7 @@ nav.botnavigation { display:none; } nav.topnavigation { display:block } nav.botnavigation { display:block } } -\end{VerbatimOut} +\end{filecontents*} % \end{Verbatim}% for syntax highlighting \end{warpprint} % \end{macrocode} @@ -7252,7 +7578,7 @@ nav.botnavigation { display:none; } % % \begin{macrocode} \begin{warpprint} -\begin{VerbatimOut}{lwarp_sagebrush.css} +\begin{filecontents*}{lwarp_sagebrush.css} @import url("lwarp.css") ; @@ -7487,7 +7813,7 @@ nav.sidetoc a:hover { } -\end{VerbatimOut} +\end{filecontents*} % \end{Verbatim}% for syntax highlighting \end{warpprint} % \end{macrocode} @@ -7506,7 +7832,7 @@ nav.sidetoc a:hover { % % \begin{macrocode} \begin{warpprint} -\begin{VerbatimOut}{lwarp_formal.css} +\begin{filecontents*}{lwarp_formal.css} @import url("lwarp.css") ; @@ -7711,7 +8037,7 @@ nav.botnavigation { background: #dedcd5 ; border-top: 1px solid black ; } -\end{VerbatimOut} +\end{filecontents*} % \end{Verbatim}% for syntax highlighting \end{warpprint} % \end{macrocode} @@ -7728,7 +8054,7 @@ nav.botnavigation { % % \begin{macrocode} \begin{warpprint} -\begin{VerbatimOut}{sample_project.css} +\begin{filecontents*}{sample_project.css} /* ( --- Start of project.css --- ) */ /* A sample project-specific CSS file for lwarp --- ) */ @@ -7740,7 +8066,7 @@ nav.botnavigation { /* . . . */ /* ( --- End of project.css --- ) */ -\end{VerbatimOut} +\end{filecontents*} % \end{Verbatim}% for syntax highlighting \end{warpprint} % \end{macrocode} @@ -7761,14 +8087,14 @@ nav.botnavigation { % % \begin{macrocode} \begin{warpprint} -\begin{VerbatimOut}{lwarp.xdy} +\begin{filecontents*}{lwarp.xdy} (require "tex/inputenc/latin.xdy") (merge-rule "\\PS *" "Postscript") (require "texindy.xdy") (require "page-ranges.xdy") (require "book-order.xdy") (markup-locref :open "\hyperindexref{" :close "}") -\end{VerbatimOut} +\end{filecontents*} % \end{Verbatim}% for syntax highlighting \end{warpprint} % \end{macrocode} @@ -7786,11 +8112,12 @@ nav.botnavigation { % % \changes{v0.28}{2017/04/11}{File \protect\texttt{lwarp\_mathjax.txt}: Updated \protect\acro{CDN} repository.} % \changes{v0.30}{2017/04/26}{Fix: \protect\texttt{lwarp\_mathjax.txt} only written in print mode.} +% \changes{v0.34}{2017/07/27}{File: \protect\texttt{lwarp\_mathjax.txt} version change.} % % % \begin{macrocode} \begin{warpprint} -\begin{VerbatimOut}{lwarp_mathjax.txt} +\begin{filecontents*}{lwarp_mathjax.txt} @@ -7885,7 +8212,7 @@ src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX- --> -\end{VerbatimOut} +\end{filecontents*} % \end{Verbatim}% for syntax highlighting \end{warpprint} % \end{macrocode} @@ -7916,14 +8243,14 @@ src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX- % due to \protect\texttt{luatex} changes.} % % \begin{macrocode} -\begin{VerbatimOut}{lwarpmk.lua} +\begin{filecontents*}{lwarpmk.lua} #!/usr/bin/env texlua -- Copyright 2016-2017 Brian Dunn -- Print the usage of the lwarpmk command: -printversion = "v0.33" +printversion = "v0.34" function printhelp () print ("lwarpmk: Use lwarpmk -h or lwarpmk --help for help.") ; @@ -8233,7 +8560,7 @@ function compilelatexmk ( fsuffix ) err=os.execute ( "latexmk -pdf -dvi- -ps- -recorder " .. "-e " .. opquote - .. "$makeindex = q/" + .. "$makeindex = q/" -- $ .. xindycmd .. " -M " .. xdyfile .. " -L " .. language .. " /" @@ -8440,7 +8767,7 @@ printhelp () end end -- not --version -\end{VerbatimOut} +\end{filecontents*} % \end{Verbatim}% for syntax highlighting % \end{macrocode} % @@ -8690,7 +9017,14 @@ end -- not --version % \end{macrocode} % \begin{macro}{\HTMLentity} \marg{entitytag} % \begin{macrocode} -\newcommand*{\HTMLentity}[1]{\LWR@origampersand#1;} +\newcommand*{\HTMLentity}[1]{% +% \LWR@traceinfo{HTMLentity \detokenize{#1}}% +\begingroup% +\LWR@FBcancel% +\LWR@origampersand#1;% +\endgroup +% \LWR@traceinfo{HTMLentity done}% +} % \end{macrocode} % \end{macro} % \begin{macro}{\HTMLunicode} \marg{hex\_unicode} @@ -9009,7 +9343,7 @@ end -- not --version -% \section{Forcing a new PDF page} +% \section{PDF pages and styles} % \codehtml % \begin{macrocode} @@ -9028,6 +9362,31 @@ end -- not --version \LWR@stoppars\LWR@orignewpage\LWR@startpars% } % \end{macrocode} + + + +% \cs{pagestyle} and \cs{thispagestyle} are nullified for \HTML\ output. +% +% \begin{macro}{\pagestyle} \marg{style} +% \begin{macrocode} +\renewcommand*{\pagestyle}[1]{} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\thispagestyle} \marg{style} +% \begin{macrocode} +\renewcommand*{\thispagestyle}[1]{} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\pagenumbering} \marg{commands} +% \begin{macrocode} +\renewcommand*{\pagenumbering}[1]{} +% \end{macrocode} +% \end{macro} +% + + % \begin{macrocode} \end{warpHTML} % \end{macrocode} @@ -9067,16 +9426,42 @@ end -- not --version % \subsection{HTML tags} +% \changes{v0.34}{2017/08/03}{\pkg{babel-french}: Adds fixed-width HTML spaces to punctuation.} +% Adjust \pkg{babel-french} for \HTML\ spaces: +% \begin{macrocode} +\@ifpackagewith{babel}{french}{ +\renewcommand*{\FBcolonspace}{~} +\renewcommand*{\FBthinspace}{\,} +}{} +% \end{macrocode} + +% \begin{macro}{\LWR@FBcancel} Cancels \HTML\ spacing for \pkg{babel-french} +% \begin{macrocode} +\@ifpackagewith{babel}{french}{% +\newcommand{\LWR@FBcancel}{% +\csdef{FBcolonspace}{}% +\csdef{FBthinspace}{}% +} +} +{% not french: +\newcommand{\LWR@FBcancel}{} +}% +% \end{macrocode} +% \end{macro} + % \begin{macro}{\LWR@htmltagc} \marg{tag} % Break ligatures and use upright apostrophes in \HTML\ tags. % %|\protect| is in case the tag appears in TOC, LOF, LOT. % \begin{macrocode} - \newcommand*{\LWR@htmltagc}[1]{% {% -\protect\LWR@origttfamily% +% \LWR@traceinfo{LWR@htmltagc \detokenize{#1}}% +\begingroup% +\LWR@FBcancel% +\ifmmode\else\protect\LWR@origttfamily\fi% \protect\LWR@origtextless#1\protect\LWR@origtextgreater% +\endgroup% }% } % \end{macrocode} @@ -9084,24 +9469,65 @@ end -- not --version % -% \begin{environment}{LWR@nestspan} Disable \env{minipage}, \cs{parbox} inside a \tag{span}. +% \begin{environment}{LWR@nestspan} Disable \env{minipage}, \cs{parbox}, +% and \HTML\ \element{div}s inside a \element{span}. % -% |\begin{LWR@nestspan}| must follow the opening || tag to allow +% |\begin{LWR@nestspan}| must follow the opening \element{span} tag to allow % \watchout % a paragraph to start if the span is at the beginning of a new paragraph. % -% |\end{LWR@nestspan}| must follow the |/span| or an extra |

| may appear. +% |\end{LWR@nestspan}| must follow the \element{/span} or a \element{p} may appear +% inside the span. % \watchout % % \changes{v0.20}{2016/12/24}{Fix: Minipages inside a span.} +% \changes{v0.34}{2017/07/29}{Fix: Minipages, BlocksClass, and lists inside a span.} % % \begin{macrocode} +\newcommand*{\LWR@nestspanitem}{% +\if@newlist\else{\LWR@htmltagc{br /}}\fi% +\LWR@origitem% +} + \newenvironment*{LWR@nestspan} {% +\LWR@traceinfo{LWR@nestspan}% +\ifthenelse{\cnttest{\value{LWR@lateximagedepth}}{>}{0}}% +{% +\LWR@traceinfo{LWR@nestspan: inside a lateximage}% +}% +{% not in a lateximage +\LWR@traceinfo{LWR@nestspan: NOT inside a lateximage}% \addtocounter{LWR@spandepth}{1}% \RenewDocumentEnvironment{minipage}{O{t} o O{t} m}{}{}% +\RenewDocumentEnvironment{BlockClass}{o m}{}{}% +\renewcommand{\BlockClassSingle}[2]{##2}% +\renewcommand{\LWR@forcenewpage}{}% +\renewcommand{\LWR@itemizestart}{% +\let\item\LWR@nestspanitem% +% \global\boolfalse{LWR@allownestspanitembreak}% +}% +\renewcommand{\LWR@itemizeend}{}% +\renewcommand{\LWR@enumeratestart}{% +\let\item\LWR@nestspanitem% +% \global\boolfalse{LWR@allownestspanitembreak}% +}% +\renewcommand{\LWR@enumerateend}{}% +\renewcommand{\LWR@descriptionstart}{% +\let\item\LWR@nestspanitem% +% \global\boolfalse{LWR@allownestspanitembreak}% }% -{\addtocounter{LWR@spandepth}{-1}} +\renewcommand{\LWR@descriptionend}{}% +}% not in a lateximage +}% +{% +\ifthenelse{\cnttest{\value{LWR@lateximagedepth}}{>}{0}}% +{}% +{\addtocounter{LWR@spandepth}{-1}}% +\LWR@traceinfo{LWR@nestspan: done}% +} + +\AfterEndEnvironment{LWR@nestspan}{\global\let\par\LWR@closeparagraph} % \end{macrocode} % \end{environment} @@ -9127,11 +9553,14 @@ end -- not --version % \end{macro} -% \begin{macro}{\LWR@htmlspanclass} \marg{class} \oarg{style} \marg{text} +% \begin{macro}{\LWR@htmlspanclass} \oarg{style} \marg{class} \marg{text} +% +% \changes{v0.34}{2017/08/02}{Moved optional argument in front of mandatory.} +% % \begin{macrocode} -\NewDocumentCommand{\LWR@htmlspanclass}{m o +m}{% +\NewDocumentCommand{\LWR@htmlspanclass}{o m +m}{% \LWR@ensuredoingapar% -\LWR@subhtmlelementclass{span}{#1}[#2]% +\LWR@subhtmlelementclass{span}[#1]{#2}% \begin{LWR@nestspan}% #3% \LWR@htmltagc{/span}% @@ -9165,11 +9594,25 @@ end -- not --version % \begin{macro}{\LWR@htmlclosecomment} % \begin{macrocode} \newcommand*{\LWR@htmlopencomment}{% -{\LWR@origttfamily\LWR@origtextless{}!{-}{-}}% +{% +% \LWR@traceinfo{LWR@htmlopencomment}% +\begingroup% +\LWR@FBcancel% +\ifmmode\else\protect\LWR@origttfamily\fi% +\LWR@origtextless{}!{-}{-}% +\endgroup% +}% } \newcommand*{\LWR@htmlclosecomment}{% -{\LWR@origttfamily{-}{-}\LWR@origtextgreater{}}% +{% +% \LWR@traceinfo{LWR@htmlclosecomment}% +\begingroup% +\LWR@FBcancel% +\ifmmode\else\protect\LWR@origttfamily\fi% +{-}{-}\LWR@origtextgreater{}% +\endgroup% +}% } % \end{macrocode} % \end{macro} @@ -9216,21 +9659,22 @@ end -- not --version % \subsection{Div class and element class} -% \begin{macro}{\LWR@subhtmlelementclass} \marg{element} \marg{class} \oarg{style} +% \begin{macro}{\LWR@subhtmlelementclass} \marg{element} \oarg{style} \marg{class} % % Factored and reused in several places. % % \changes{v0.20}{2017/01/17}{Factored code.} +% \changes{v0.34}{2017/08/02}{Moved optional argument in front of mandatory.} % % \begin{macrocode} -\NewDocumentCommand{\LWR@subhtmlelementclass}{m m o}{% -\IfValueTF{#3}% +\NewDocumentCommand{\LWR@subhtmlelementclass}{m o m}{% +\IfValueTF{#2}% {% option -\ifthenelse{\equal{#3}{}}% -{\LWR@htmltag{#1 class="#2"}}% empty option -{\LWR@htmltag{#1 class="#2" style="#3"}}% non-empty option +\ifthenelse{\equal{#2}{}}% +{\LWR@htmltag{#1 class="#3"}}% empty option +{\LWR@htmltag{#1 class="#3" style="#2"}}% non-empty option }% option -{\LWR@htmltag{#1 class="#2"}}% no option +{\LWR@htmltag{#1 class="#3"}}% no option } % \end{macrocode} % \end{macro} @@ -9239,11 +9683,12 @@ end -- not --version % \begin{macro}{\LWR@htmlelementclass} \marg{element} \marg{class} \oarg{style} % % \changes{v0.20}{2017/01/17}{Added optional style.} +% \changes{v0.34}{2017/08/02}{Moved optional argument in front of mandatory.} % % \begin{macrocode} -\NewDocumentCommand{\LWR@htmlelementclass}{m m o}{% +\NewDocumentCommand{\LWR@htmlelementclass}{m o m}{% \LWR@stoppars% -\LWR@subhtmlelementclass{#1}{#2}[#3]% +\LWR@subhtmlelementclass{#1}[#2]{#3}% \LWR@startpars% } % \end{macrocode} @@ -9263,13 +9708,14 @@ end -- not --version % \end{macrocode} % \end{macro} -% \begin{macro}{\LWR@htmldivclass} \marg{class} \oarg{style} +% \begin{macro}{\LWR@htmldivclass} \oarg{style} \marg{class} % % \changes{v0.20}{2017/01/17}{Added optional style.} +% \changes{v0.34}{2017/08/02}{Moved optional argument in front of mandatory.} % % \begin{macrocode} -\NewDocumentCommand{\LWR@htmldivclass}{m o}{% -\LWR@htmlelementclass{div}{#1}[#2]% +\NewDocumentCommand{\LWR@htmldivclass}{o m}{% +\LWR@htmlelementclass{div}[#1]{#2}% } % \end{macrocode} % \end{macro} @@ -9287,11 +9733,14 @@ end -- not --version % A single-line element, without a paragraph tag for the line of text: % \begin{macro}{\LWR@htmlelementclassline} -% \marg{element} \marg{class} \oarg{style} \marg{text} +% \marg{element} \oarg{style} \marg{class} \marg{text} +% +% \changes{v0.34}{2017/08/02}{Moved optional argument in front of mandatory.} +% % \begin{macrocode} -\NewDocumentCommand{\LWR@htmlelementclassline}{m m o +m}{% +\NewDocumentCommand{\LWR@htmlelementclassline}{m o m +m}{% \LWR@stoppars -\LWR@subhtmlelementclass{#1}{#2}[#3]% +\LWR@subhtmlelementclass{#1}[#2]{#3}% #4% \LWR@htmltag{/#1} \LWR@startpars @@ -9338,23 +9787,24 @@ end -- not --version % For other direct-formatting commands, see \cref{sec:directformatting}. -% \begin{environment}{BlockClass} \marg{class} \oarg{style} \quad +% \begin{environment}{BlockClass} \oarg{style} \marg{class} \quad % High-level interface for div classes. % % \qquad Ex: |\begin{BlockClass}{class}| text |\end{BlockClass}| % % \changes{v0.20}{2017/01/03}{Renamed from "blockclass".} % \changes{v0.20}{2017/01/17}{Added optional style.} +% \changes{v0.34}{2017/08/02}{Moved optional argument in front of mandatory.} % % \codehtml % \begin{macrocode} \begin{warpHTML} -\NewDocumentEnvironment{BlockClass}{m o} +\NewDocumentEnvironment{BlockClass}{o m}% { -\LWR@htmldivclass{#1}[#2] +\LWR@htmldivclass[#1]{#2} } { -\LWR@htmldivclassend{#1} +\LWR@htmldivclassend{#2} } \end{warpHTML} % \end{macrocode} @@ -9362,14 +9812,14 @@ end -- not --version % \codeprint % \begin{macrocode} \begin{warpprint} -\NewDocumentEnvironment{BlockClass}{m o}{}{} +\NewDocumentEnvironment{BlockClass}{o m}{}{}% \end{warpprint} % \end{macrocode} % \end{environment} % % % \begin{macro}{\BlockClassSingle} \marg{class} \marg{text} \quad -% A single-line \tag{div}, without a paragraph tag for the line of text. +% A single-line \element{div}, without a paragraph tag for the line of text. % % \changes{v0.20}{2017/01/03}{Renamed from "LWR@htmldivclassline".} % @@ -9392,23 +9842,24 @@ end -- not --version % \end{macro} -% \begin{macro}{\InlineClass} \marg{class} \oarg{style} \marg{text} \quad +% \begin{macro}{\InlineClass} \oarg{style} \marg{class} \marg{text} \quad % High-level interface for inline span classes. % % \changes{v0.20}{2017/01/03}{Renamed from "inlineclass".} +% \changes{v0.34}{2017/08/02}{Moved optional argument in front of mandatory.} % % \codehtml % \begin{macrocode} \begin{warpHTML} -\NewDocumentCommand{\InlineClass}{m o +m}{% -\LWR@htmlspanclass{#1}[#2]{#3}% +\NewDocumentCommand{\InlineClass}{o m +m}{% +\LWR@htmlspanclass[#1]{#2}{#3}% } \end{warpHTML} % \end{macrocode} % \codeprint % \begin{macrocode} \begin{warpprint} -\NewDocumentCommand{\InlineClass}{m o +m}{#3} +\NewDocumentCommand{\InlineClass}{o m +m}{#3}% \end{warpprint} % \end{macrocode} % \end{macro} @@ -9531,7 +9982,7 @@ end -- not --version \ifbool{LWR@doingstartpars}% {% handling pars % \end{macrocode} -% See if have already started a \env{lateximage} or a \tag{span}. +% See if have already started a \env{lateximage} or a \element{span}. % If so, do not generate nested paragraph tags. % \begin{macrocode} \ifthenelse{% @@ -9540,12 +9991,12 @@ end -- not --version }% nested par tags? % \end{macrocode} % If so: Do nothing if already started a \env{lateximage} page. Cannot nest a \env{lateximage}. -% Also do nothing if already inside a \tag{span}. Do not nest paragraph tags -% inside a \tag{span}. +% Also do nothing if already inside a \element{span}. Do not nest paragraph tags +% inside a \element{span}. % \begin{macrocode} {}% no nested par tags % \end{macrocode} -% Else: No \env{lateximage} or \tag{span} has been started yet, +% Else: No \env{lateximage} or \element{span} has been started yet, % so it's OK to generate paragraph tags. % \begin{macrocode} {% yes nest par tags @@ -9553,9 +10004,6 @@ end -- not --version % \end{macrocode} % Manually indent item list labels to avoid left margin intrustion: % -% \LaTeX{} default list environments use |\@itemdepth| and |\@enumdepth|, but -% \pkg{lwarp} uses the \pkg{enumitem} package, which uses |\@listdepth|. -% % See if are nested inside an item list: % \begin{macrocode} \ifnumcomp{\@listdepth}{>}{0}% @@ -9600,14 +10048,14 @@ end -- not --version % \begin{macrocode} {% handling pars % \end{macrocode} -% See if already started a \env{lateximage} or a \tag{span}: +% See if already started a \env{lateximage} or a \element{span}: % \begin{macrocode} \ifthenelse{% \cnttest{\value{LWR@lateximagedepth}}{>}{0} \OR% \cnttest{\value{LWR@spandepth}}{>}{0}% }% % \end{macrocode} -% Do nothing if already started a \env{lateximage} or a \tag{span}, +% Do nothing if already started a \env{lateximage} or a \element{span}, % but add a parbreak if in a span but not a \env{lateximage}. % \begin{macrocode} {% no nested par tags @@ -9622,7 +10070,7 @@ end -- not --version {}% }% no nested par tags % \end{macrocode} -% If have not already started a \env{lateximage} or a \tag{span}: +% If have not already started a \env{lateximage} or a \element{span}: % \begin{macrocode} {% yes nest par tags % \end{macrocode} @@ -9686,6 +10134,12 @@ end -- not --version \newcommand*{\LWR@startpars}% {% % \end{macrocode} +% Ignore if inside a span: +% \begin{macrocode} +\ifthenelse{\cnttest{\value{LWR@spandepth}}{>}{0}}% +{}% +{% +% \end{macrocode} % See if currently handling \HTML\ paragraphs: % \begin{macrocode} \ifbool{LWR@doingstartpars}% @@ -9715,6 +10169,7 @@ end -- not --version % No tag yet to undo: % \begin{macrocode} \global\boolfalse{LWR@doingapar}% +}% nestspan } % \end{macrocode} % \end{macro} @@ -9727,6 +10182,12 @@ end -- not --version \newcommand*{\LWR@stoppars}% {% % \end{macrocode} +% Ignore if inside a span: +% \begin{macrocode} +\ifthenelse{\cnttest{\value{LWR@spandepth}}{>}{0}}% +{}% +{% +% \end{macrocode} % See if currently handling \HTML\ paragraphs: % \begin{macrocode} \ifbool{LWR@doingapar}% @@ -9773,9 +10234,10 @@ end -- not --version % \begin{macrocode} \global\setbool{LWR@doingstartpars}{false}% % \end{macrocode} -% no |

| tag to undo: +% no \element{p} tag to undo: % \begin{macrocode} \global\boolfalse{LWR@doingapar}% +}% nestspan } % \end{macrocode} % \end{macro} @@ -10202,23 +10664,8 @@ end -- not --version % Locally temporarily disable direct-formatting commands, % not used in filenames: % \begin{macrocode} -\renewcommand*{\HTMLunicode}[1]{} -\renewcommand*{\HTMLentity}[1]{##1} -\renewcommand*{\LWR@htmltagc}[1]{} -\DeclareExpandableDocumentCommand{\InlineClass}{m o m}{##3} -% \end{macrocode} -% Ampersand becomes ``and'', which is a short word and is then removed from the filename. -% \begin{macrocode} -\renewcommand*{\&}{and} -\renewcommand{\textit}[1]{##1} -\renewcommand{\textsc}[1]{##1} -\renewcommand{\textsl}[1]{##1} -\renewcommand{\textbf}[1]{##1} -\renewcommand{\texttt}[1]{##1} -\renewcommand{\textsf}[1]{##1} -\renewcommand{\textrm}[1]{##1} -\renewcommand{\textsuperscript}[1]{##1} -\renewcommand{\textsubscript}[1]{##1} +\LWR@nullfonts +\renewcommand*{\LWR@htmltagc}[1]{}% % \end{macrocode} % Replaces common symbols and short words with hyphens: % @@ -10430,7 +10877,7 @@ end -- not --version % \end{macrocode} % -% Start of the \tag{textbody}: +% Start of the \element{textbody}: % \begin{macrocode} \LWR@htmlelementclass{section}{textbody} @@ -10963,27 +11410,19 @@ end -- not --version % % \begin{macrocode} \newcommand*{\LWR@filestart}[1]{ +\LWR@traceinfo{LWR@filestart} % \end{macrocode} % Locally temporarily disable direct-formatting commands: % \begin{macrocode} \begingroup -\renewcommand{\textit}[1]{##1}% not used in filenames -\renewcommand{\textsc}[1]{##1} -\renewcommand{\textsl}[1]{##1} -\renewcommand{\textbf}[1]{##1} -\renewcommand{\texttt}[1]{##1} -\renewcommand{\textsf}[1]{##1} -\renewcommand{\textrm}[1]{##1} -\renewcommand{\textsuperscript}[1]{##1} -\renewcommand{\textsubscript}[1]{##1} -\renewcommand*{\HTMLunicode}[1]{} -\renewcommand*{\HTMLentity}[1]{} -\RenewDocumentCommand{\LWR@htmlspanclass}{m o +m}{##3} -\DeclareExpandableDocumentCommand{\InlineClass}{m o m}{##3} +\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} @@ -11058,7 +11497,7 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% \ifbool{mathjax}% {% \boolfalse{LWR@verbtags} -\VerbatimInput{lwarp_mathjax.txt}% +\verbatiminput{lwarp_mathjax.txt}% \booltrue{LWR@verbtags} \LWR@stoppars }% end of mathjax @@ -11072,6 +11511,7 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% % \begin{macrocode} \LWR@htmltag{body}\LWR@orignewline \endgroup +\LWR@traceinfo{LWR@filestart: done} } % \end{macrocode} % \end{macro} @@ -11099,8 +11539,10 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% % \changes{v0.28}{2017/04/09}{\texttt{FormatWordProcessor} forces single-file output.} % Executed at the beginning of the entire document. % \begin{macrocode} +\catcode`\$=\active \newcommand*{\LWR@LwarpStart} {% +\LWR@traceinfo{LWR@lwarpStart} % \end{macrocode} % % If formatting for a word processor, @@ -11120,9 +11562,10 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% \edef\LWR@strresult{\HTMLFilename} \edef\HTMLFilename{\detokenize\expandafter{\LWR@strresult}} % \end{macrocode} -% Force onecolumn: +% Force onecolumn and empty page style: % \begin{macrocode} \LWR@origonecolumn% +\LWR@origpagestyle{empty} % \end{macrocode} % Reduce chance of line overflow in verbatim environments: % \begin{macrocode} @@ -11131,7 +11574,7 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% % In \PDF\ output, don't allow line breaks to interfere with \HTML\ tags: % \begin{macrocode} \LWR@origraggedright% -\let\\\LWR@endofline% +\LetLtxMacro{\\}{\LWR@endofline}% % \end{macrocode} % Spread the lines for |pdftotext| to read them well: % \begin{macrocode} @@ -11172,10 +11615,10 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% % % Tabular: % \begin{macrocode} -\let\LWR@origtabular\tabular -\let\LWR@origendtabular\endtabular -\let\tabular\LWR@tabular -\let\endtabular\endLWR@tabular +\LetLtxMacro{\LWR@origtabular}{\tabular} +\LetLtxMacro{\LWR@origendtabular}{\endtabular} +\LetLtxMacro{\tabular}{\LWR@tabular} +\LetLtxMacro{\endtabular}{\endLWR@tabular} % \end{macrocode} % Float captions: % \begin{macrocode} @@ -11204,8 +11647,8 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% % \end{macrocode} % Graphics: % \begin{macrocode} -\let\rotatebox\LWR@rotatebox -\let\scalebox\LWR@scalebox +\LetLtxMacro{\rotatebox}{\LWR@rotatebox} +\LetLtxMacro{\scalebox}{\LWR@scalebox} \let\reflectbox\LWR@reflectbox % \end{macrocode} % Not yet started any paragraph handling: @@ -11215,14 +11658,16 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% % \end{macrocode} % Start a new \HTML\ file and a header: % \begin{macrocode} +\LWR@traceinfo{LWR@lwarpStart: Starting new file.} \LWR@filestart{} +\LWR@traceinfo{LWR@lwarpStart: Generating first header.} \LWR@htmltag{header}\LWR@orignewline \LWR@startpars \LWR@firstpagetop \LWR@stoppars \LWR@htmltag{/header}\LWR@orignewline +\LWR@traceinfo{LWR@lwarpStart: Generating textbody.} \LWR@htmltag{section class="textbody"{}} -\LWR@origpagestyle{empty} % \end{macrocode} % Document and page settings: % \begin{macrocode} @@ -11238,18 +11683,35 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% \fi % \end{macrocode} % -% Initial default patch for fancyvrb: +% Patch the |itemize|, |enumerate|, and |description| environments and \cs{item}. +% This works with the native \LaTeX\ environments, as well as +% those provided by \pkg{enumitem}, \pkg{enumerate}, and \pkg{paralist}. % \begin{macrocode} -\fvset{frame=none}% +\LWR@patchlists +% \end{macrocode} +% +% Ensure that math mode is active to call \pkg{lwarp}'s patches: +% \begin{macrocode} +\catcode`\$=\active % \end{macrocode} % % Allow \HTML\ paragraphs to begin: % \begin{macrocode} \LWR@startpars +\LWR@traceinfo{LWR@lwarpStart: done} } +\catcode`\$=3% math shift until lwarp starts % \end{macrocode} % \end{macro} +% ^^A % Not yet working: +% ^^A % \begin{macrocode} +% ^^A % \AfterEndPreamble{ +% ^^A % \LWR@traceinfo{Patching @ensuredmath}% *8* +% ^^A % \let\@ensuredmath\LWR@ensuredmath +% ^^A % } +% ^^A % \end{macrocode} + % \begin{macrocode} \end{warpHTML} % \end{macrocode} @@ -11415,11 +11877,11 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% % % The following provide setting commands for both \HTML\ and print outputs. % -% \DescribeMacro{@published} -% \DescribeMacro{@title} -% \DescribeMacro{@subtitle} -% \DescribeMacro{@author} -% \DescribeMacro{@date} +% \DescribeMacro{\@published} +% \DescribeMacro{\@title} +% \DescribeMacro{\@subtitle} +% \DescribeMacro{\@author} +% \DescribeMacro{\@date} % \cs{@title}, \cs{@subtitle}, \cs{@author}, etc.\ store the values % as originally assigned, including any \cs{thanks}, \cs{and}, or \cs{affiliation}. % These are low-level macros intended to be used by other macros @@ -11873,7 +12335,7 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% \renewcommand{\maketitle}{\begin{titlepage}% \let\footnotesize\small \let\footnoterule\relax - \let \footnote \thanks + \LetLtxMacro{\footnote}{\thanks} \@bsmarkseries \def\@makefnmark{\rlap{\@textsuperscript{% \normalfont\@bsthanksheadpre \tamark \@bsthanksheadpost}}}% @@ -12069,10 +12531,14 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% % % Re-defined to use an \HTML\ entity for the double vertical bar symbol. % The original definition used \cs{\textbar} which was not being found by \cmds{pdftotext}. +% +% \changes{v0.34}{2017/08/07}{Text symbols instead of math.} +% % \begin{macrocode} -\def\@fnsymbol#1{\ensuremath{\ifcase#1\or *\or \dagger\or \ddagger\or - \mathsection\or \mathparagraph\or \text{\HTMLunicode{2016}}\or - **\or \dagger\dagger \or \ddagger\ddagger \else\@ctrerr\fi}} +\def\@fnsymbol#1{\ifcase#1\or *\or \HTMLentity{dagger}\or \HTMLentity{Dagger}\or + \HTMLentity{sect}\or \HTMLentity{para}\or \text{\HTMLunicode{2016}}\or + **\or \HTMLentity{dagger}\HTMLentity{dagger} \or + \HTMLentity{Dagger}\HTMLentity{Dagger} \else\@ctrerr\fi} % \end{macrocode} % \end{macro} % @@ -12340,34 +12806,9 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% % \section{Verbatim} -% \codehtml -% \begin{macrocode} -\begin{warpHTML} -% \end{macrocode} - -% \begin{environment}{verbatim} -% -% \changes{v0.20}{2016/12/24}{Added.} -% -% \begin{macrocode} -\AfterEndPreamble{ -\AtBeginEnvironment{verbatim}{% -\LWR@forcenewpage -\LWR@atbeginverbatim{verbatim}\unskip\LWR@origvspace*{-\baselineskip}% -} -\AfterEndEnvironment{verbatim}{\unskip\LWR@origvspace*{-\baselineskip}\LWR@afterendverbatim} -} -% \end{macrocode} -% \end{environment} - -% \begin{macrocode} -\end{warpHTML} -% \end{macrocode} - - - +% \changes{v0.34}{2017/07/27}{Verbatim refactored to +% remove \protect\pkg{fancyvrb} requirement.} -% \section{Fancyvrb} % \codeall % \begin{macrocode} @@ -12390,30 +12831,20 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% % \begin{macrocode} \begin{warpHTML} % \end{macrocode} -% + % \DescribeBoolean{LWR@verbtags} Used to temporarily turn off verbatim tags -% while doing \env{VerbatimInput} in the \HTML\ head. +% while doing \cs{verbatiminput} in the \HTML\ head. % \begin{macrocode} \newbool{LWR@verbtags} \booltrue{LWR@verbtags} % \end{macrocode} -% For \cs{VerbatimFootnotes}: -% \begin{macrocode} -\renewcommand{\VerbatimFootnotes}{ -\PackageError{lwarp} -{Verbatim footnotes are not yet supported by lwarp.} -{This may be improved some day.} -} -% \end{macrocode} - - -% \begin{macro}{\LWR@atbeginverbatim} \marg{class} +% \begin{macro}{\LWR@atbeginverbatim} \oarg{style} \marg{class} % % Encloses a verbatim environment with the given \CSS\ class. % \begin{macrocode} -\newcommand*{\LWR@atbeginverbatim}[1] +\newcommand*{\LWR@atbeginverbatim}[2][] {% % \end{macrocode} % Avoid excessive space between lines: @@ -12424,20 +12855,27 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% % \begin{macrocode} \LWR@stoppars% % \end{macrocode} -% Create a new |pre| of the given class: +% Create a new |pre| of the given class. +% The tags may temporarily be turned off for internal use, such +% as loading the MathJax script. % \begin{macrocode} -\ifbool{LWR@verbtags}{\LWR@htmltag{pre class="#1"{}}}{}% +\ifbool{LWR@verbtags}{% +\LWR@htmltag{pre class="#2" +\ifthenelse{\equal{#1}{}}{}{style="#1"}% +}% pre +}{}% % \end{macrocode} % 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. % \begin{macrocode} +\begingroup% \LWR@origttfamily% % \end{macrocode} % Do not produce \HTML\ tags for \cs{hspace} inside a verse |par|. % Restore plain \LaTeX{} \cs{hspace} functionality: % \begin{macrocode} -\let\hspace\LWR@orighspace% +\LetLtxMacro{\hspace}{\LWR@orighspace}% } % \end{macrocode} % \end{macro} @@ -12449,6 +12887,7 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% % \end{macrocode} % Remove excess vertical space at the end of the |pre|: % \begin{macrocode} +\endgroup% \unskip% % \end{macrocode} % At the end of the environment, close the |pre|: @@ -12464,274 +12903,54 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% % \end{macrocode} % \end{macro} % + + +% \begin{macro}{\verbatiminput} \marg{filename} % -% \begin{macro}{\LWR@Verbatimclass} Holds the class of the following verbatim. +% Patch \cs{verbatiminput} to add \HTML\ tags: % % \begin{macrocode} -\newcommand*{\LWR@Verbatimclass}{fancyvrb} +\let\LWRV@origverbatim@input\verbatim@input + +\renewcommand{\verbatim@input}[2]{% +\ifbool{LWR@verbtags}{\LWR@forcenewpage}{}% +\LWR@atbeginverbatim{Verbatim}\unskip\LWR@origvspace*{-\baselineskip}%% +\LWRV@origverbatim@input{#1}{#2}% +\unskip\LWR@origvspace*{-\baselineskip}\LWR@afterendverbatim% +} % \end{macrocode} % \end{macro} + + + +% \begin{environment}{verbatim} % -% \begin{environment}{VerbatimClass} \marg{class} \oarg{Verbatim options} +% \changes{v0.20}{2016/12/24}{Added.} % -% Creates a \env{Verbatim} enclosed in a \tag{div} of the given class. % \begin{macrocode} -\NewDocumentEnvironment{VerbatimClass}{m O{}} -{% -\renewcommand*{\LWR@Verbatimclass}{#1}% -\LWR@origVerbatim[#2]% +\AfterEndPreamble{ +\LWR@traceinfo{Patching verbatim.} +\AtBeginEnvironment{verbatim}{% +\LWR@forcenewpage +\LWR@atbeginverbatim{verbatim}\unskip\LWR@origvspace*{-\baselineskip}% +} +\AfterEndEnvironment{verbatim}{\unskip\LWR@origvspace*{-\baselineskip}\LWR@afterendverbatim} } -{\endVerbatim} % \end{macrocode} % \end{environment} -% -% After the preamble is loaded, after any patches to \env{Verbatim}: + % \begin{macrocode} -\AfterEndPreamble{ +\end{warpHTML} % \end{macrocode} + + + + + + +% \section{Theorems} % -% Remember the original defintion of \env{Verbatim}: -% \begin{macrocode} -\let\LWR@origVerbatim\Verbatim -% \end{macrocode} -% -% -% \begin{environment}{Verbatim} -% -% Patched to place the environment in a |fancyvrb| div, -% and the label in a |fancyvrblabel| div. -% Also corrects the left margin for line numbers. -% Also uses |VerbatimHTMLWidth| to control placement of line numbers on the right. -% Aligning the right margin requires knowing the width. -% -% \changes{v0.20}{2016/12/24}{Added.} -% -% \begin{macrocode} -\renewcommand*{\Verbatim}{% -\LWR@forcenewpage -\renewcommand*{\LWR@Verbatimclass}{fancyvrb}% -\LWR@origVerbatim% -} -% \end{macrocode} -% \end{environment} -% -% -% The following patches to \env{Verbatim} are executed at the -% start and end of the environment, depending on the choice of |frame|. -% Original code is from the \pkg{fancyvrb} package. -% \begin{macrocode} -\newcommand*{\LWR@fvstartnone}{% -\LWR@traceinfo{fvstartnone}% -\ifbool{LWR@verbtags}{\hbox to\z@{\LWR@htmltagc{div class="\LWR@Verbatimclass"}}}{}% -\hbox to\z@{\LWR@atbeginverbatim{verbatim}}% -} - -\newcommand*{\LWR@fvendnone}{% -\LWR@traceinfo{fvendnone}% -\hbox to\z@{\LWR@afterendverbatim}% -\ifbool{LWR@verbtags}{\hbox to\z@{\LWR@htmltagc{/div}}}{}% -} - -\newcommand*{\LWR@fvstartsingle}{% -\LWR@traceinfo{fvstartsingle}% -\LWR@fvstartnone% -\FV@BeginListFrame@Single% -} - -\newcommand*{\LWR@fvendsingle}{% -\LWR@traceinfo{fvendsingle}% -\FV@EndListFrame@Single% -\LWR@fvendnone% -} - -\newcommand*{\LWR@fvstartline}{% -\LWR@traceinfo{fvstartline}% -\LWR@fvstartnone% -\FV@BeginListFrame@Lines% -} - -\newcommand*{\LWR@fvendline}{% -\LWR@traceinfo{fvendline}% -\FV@EndListFrame@Lines% -\LWR@fvendnone% -} -% \end{macrocode} -% -% The following patches select the start/left/right/end -% behaviors depending on |frame|. -% Original code is from the \pkg{fancyvrb} package. -% \begin{macrocode} -\def\FV@Frame@none{% -\let\FV@BeginListFrame\LWR@fvstartnone% -\let\FV@LeftListFrame\relax% -\let\FV@RightListFrame\relax% -\let\FV@EndListFrame\LWR@fvendnone} - -\def\FV@Frame@single{% -\let\FV@BeginListFrame\LWR@fvstartsingle% -\let\FV@LeftListFrame\FV@LeftListFrame@Single% -\let\FV@RightListFrame\FV@RightListFrame@Single% -\let\FV@EndListFrame\LWR@fvendsingle} - -\def\FV@Frame@lines{% -\let\FV@BeginListFrame\LWR@fvstartline% -\let\FV@LeftListFrame\relax% -\let\FV@RightListFrame\relax% -\let\FV@EndListFrame\LWR@fvendline} - -\def\FV@Frame@topline{% -\let\FV@BeginListFrame\LWR@fvstartline% -\let\FV@LeftListFrame\relax% -\let\FV@RightListFrame\relax% -\let\FV@EndListFrame\LWR@fvendnone} - -\def\FV@Frame@bottomline{% -\let\FV@BeginListFrame\LWR@fvstartnone% -\let\FV@LeftListFrame\relax% -\let\FV@RightListFrame\relax% -\let\FV@EndListFrame\LWR@fvendline} - -\def\FV@Frame@leftline{% -% To define the \FV@FrameFillLine macro (from \FV@BeginListFrame) -\ifx\FancyVerbFillColor\relax% -\let\FV@FrameFillLine\relax% -\else% -\@tempdima\FV@FrameRule\relax% -\multiply\@tempdima-\tw@% -\edef\FV@FrameFillLine{% -{\noexpand\FancyVerbFillColor{\vrule\@width\number\@tempdima sp}% -\kern-\number\@tempdima sp}}% -\fi% -\let\FV@BeginListFrame\LWR@fvstartnone% -\let\FV@LeftListFrame\FV@LeftListFrame@Single% -\let\FV@RightListFrame\relax% -\let\FV@EndListFrame\LWR@fvendnone} -% \end{macrocode} -% -% Adds the optional label to the top and bottom edges. -% Original code is from the \pkg{fancyvrb} package. -% \begin{macrocode} -\def\FV@SingleFrameLine#1{% - \hbox to\z@{% -% \kern\leftmargin - \ifnum#1=\z@\relax - \let\FV@Label\FV@LabelBegin - \else - \let\FV@Label\FV@LabelEnd - \fi - \ifx\FV@Label\relax -% \FancyVerbRuleColor{\vrule \@width\linewidth \@height\FV@FrameRule}% - \else - \ifnum#1=\z@ -% \setbox\z@\hbox{\strut\enspace\FV@LabelBegin\enspace\strut}% - \ifx\FV@LabelPositionTopLine\relax - \else - \LWR@htmltagc{div class="fancyvrblabel"} - \LWR@origtextrm{\FV@LabelBegin}% \textrm preserves emdash - \LWR@htmltagc{/div} - \fi - \else -% \setbox\z@\hbox{\strut\enspace\FV@LabelEnd\enspace\strut}% - \ifx\FV@LabelPositionBottomLine\relax - \else - \LWR@htmltagc{div class="fancyvrblabel"} - \LWR@origtextrm{\FV@LabelEnd} - \LWR@htmltagc{/div} - \fi - \fi - - \fi - \hss - } -} -% \end{macrocode} -% -% Processes each line, adding optional line numbers. -% Original code is from the \pkg{fancyvrb} package. -% \begin{macrocode} -\def\FV@ListProcessLine#1{% - \hbox to \hsize{% -% \kern\leftmargin - \hbox to \VerbatimHTMLWidth {% - \ifcsvoid{FV@LeftListNumber}{}{\kern 2.5em}% - \FV@LeftListNumber% -% \FV@LeftListFrame - \FancyVerbFormatLine{#1}% - \hss% -% \FV@RightListFrame - \FV@RightListNumber% -}% - \hss% required to avoid underfull hboxes -} -} -% \end{macrocode} - -% \begin{environment}{BVerbatim} -% \begin{macrocode} -\AtBeginEnvironment{BVerbatim} -{ -\LWR@forcenewpage -\LWR@atbeginverbatim{bverbatim} - -} - -\AfterEndEnvironment{BVerbatim} -{ -\leavevmode\par\LWR@origvspace{-\baselineskip} -\LWR@afterendverbatim -} -% \end{macrocode} -% \end{environment} - - -% \begin{environment}{LVerbatim} No changes required. -% ^^A \begin{macrocode} -% ^^A \AtBeginEnvironment{LVerbatim} -% ^^A { -% ^^A \LWR@atbeginverbatim{lverbatim} -% ^^A \unskip\LWR@origvspace{-\baselineskip} -% ^^A } - -% ^^A \AfterEndEnvironment{LVerbatim} -% ^^A { -% ^^A \unskip\LWR@origvspace{-\baselineskip} -% ^^A \LWR@afterendverbatim -% ^^A } -% ^^A \end{macrocode} -% \end{environment} - -% End of the modifications to make at the end of the preamble: -% \begin{macrocode} -} % \AfterEndPreamble -% \end{macrocode} - -% -% \begin{macro}{\UseVerbatim} \marg{text} -% -% No changes required. -% ^^A \begin{macrocode} -% ^^A \let\LWR@origUseVerbatim\UseVerbatim -% ^^A -% ^^A \renewcommand*{\UseVerbatim}[1]{% -% ^^A \LWR@atbeginverbatim{bverbatim}% -% ^^A \unskip\LWR@origvspace{-\baselineskip}% -% ^^A \LWR@origUseVerbatim{#1}% -% ^^A \unskip% -% ^^A \LWR@afterendverbatim% -% ^^A } -% ^^A \end{macrocode} -% \end{macro} - -% \begin{macrocode} -\end{warpHTML} -% \end{macrocode} - - - - -% \section{Theorems} -% -% \changes{v0.25}{2017/03/17}{Basic \LaTeX\ theorems: improved \CSS.} +% \changes{v0.25}{2017/03/17}{Basic \LaTeX\ theorems: improved \CSS.} % % % \DescribeMacro{\newtheorem} \marg{text} \oarg{counter} -or- \oarg{oldname} \marg{text} @@ -12783,11 +13002,37 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% % \section{Lists} % -% \limitsbabelone +% ^^A \limitsbabelone % -% \limitsenumitem +% The environments |itemize|, |enumerate|, and |description| are patched +% when \pkg{lwarp} is started. These patches support the standard +% \LaTeX\ environments, as well as those of \pkg{enumerate}, \pkg{enumitem}, +% and \pkg{paralist}, and at least the French version of \pkg{babel}. +% Additional patches are done on a package-specific basis. +% +% The \LaTeX\ source for |itemize| and |enumerate| are found in |source2e|, but +% the source for |description| is found in |article.cls|, etc. +% +% To have an empty +% item,\margintag{empty item}\index{item>empty}\index{list item, empty} use +% |\mbox{}| or a trailing backslash. +% This forces a new line in print output, matching the new line which +% will appear in \HTML\ output. +% Ex: +%\begin{Verbatim}[gobble=2,frame=lines,obeytabs,tabsize=4] +%\begin{itemize} +%\item \mbox{} +% \begin{itemize} +% ... +% \end{itemize} +%\item \ +% \begin{itemize} +% ... +% \end{itemize} +%\end{Verbatim} +% +% \changes{v0.34}{2017/07/27}{Lists refactored to remove \pkg{enumitem} requirement.} % - % \subsection{Itemize} % \codehtml @@ -12795,11 +13040,6 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% \begin{warpHTML} % \end{macrocode} -% \begin{macrocode} -\let\LWR@origitem\item -% \end{macrocode} - - % \begin{macro}{\LWR@itemizeitem} \oarg{label} % % Handles |\item| inside an itemize or enumerate. @@ -12817,22 +13057,8 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% % \end{macrocode} % \end{macro} - -% To have a blank item, use |\mbox{}|. -% This forces a new line in print output, matching the new line which -% will appear in \HTML\ output. -% Ex: -%\begin{Verbatim}[gobble=2,frame=lines,obeytabs,tabsize=4] -%\begin{itemize} -%\item \mbox{} -% \begin{itemize} -% ... -%\end{Verbatim} - -% \begin{environment}{itemize} \oarg{enumitem options} +% \begin{environment}{itemize} \oarg{options} % \begin{macrocode} -\AtBeginEnvironment{itemize}{\LWR@itemizestart} - \newcommand*{\LWR@itemizestart}{% \LWR@stoppars% \LWR@pushoneclose{\LWR@depthlist}{\LWR@printcloseitemize{}}% @@ -12841,8 +13067,6 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% \let\item\LWR@itemizeitem% } -\AtEndEnvironment{itemize}{\LWR@itemizeend} - \newcommand*{\LWR@itemizeend}{% \LWR@stoppars% \LWR@closeprevious{\LWR@depthlistitem}% @@ -12858,10 +13082,8 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% % An \HTML\ unordered list is used with customized \LaTeX-generated labels. -% \begin{environment}{enumerate} \oarg{enumitem options} +% \begin{environment}{enumerate} \oarg{options} % \begin{macrocode} -\AtBeginEnvironment{enumerate}{\LWR@enumeratestart} - \newcommand*{\LWR@enumeratestart}{% \LWR@stoppars% \LWR@pushoneclose{\LWR@depthlist}{\LWR@printcloseitemize{}}% @@ -12870,9 +13092,6 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% \let\item\LWR@itemizeitem% } - -\AtEndEnvironment{enumerate}{\LWR@enumerateend} - \newcommand*{\LWR@enumerateend}{% \LWR@stoppars% \LWR@closeprevious{\LWR@depthlistitem}% @@ -12893,8 +13112,22 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% \LWR@stoppars% \LWR@setlatestname{#1}% \LWR@startnewdepth{\LWR@depthlistitem}{\LWR@printclosedescitem{}}% +% \end{macrocode} +% Temporarily disable \cs{hspace}, which |article.cls|, etc.\ use per \cs{item} +% for |description|s only. +% This causes \pkg{lwarp} to mistakenly place an empty span between +% \HTML\ list tags. +% \begin{macrocode} +\LetLtxMacro{\hspace}{\LWR@nohspace}% +% \end{macrocode} +% Process the original \cs{item} code: +% \begin{macrocode} \LWR@origitem[]% % \end{macrocode} +% Restore \cs{hspace} for use in the item text: +% \begin{macrocode} +\LetLtxMacro{\hspace}{\LWR@hspace}% +% \end{macrocode} % Be sure the label doesn't print to the left of the rest of the file: % \begin{macrocode} \LWR@orighspace{1in} @@ -12906,10 +13139,8 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% % \end{macrocode} % \end{macro} -% \begin{environment}{description} \oarg{enumitem options} +% \begin{environment}{description} \oarg{options} % \begin{macrocode} -\AtBeginEnvironment{description}{\LWR@descriptionstart} - \newcommand*{\LWR@descriptionstart}{% \LWR@stoppars% \LWR@pushoneclose{\LWR@depthlist}{\LWR@printclosedescription{}}% @@ -12918,8 +13149,6 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% \let\item\LWR@descitem% } -\AtEndEnvironment{description}{\LWR@descriptionend} - \newcommand*{\LWR@descriptionend}{% \LWR@stoppars% \LWR@closeprevious{\LWR@depthlistitem}% @@ -12929,24 +13158,27 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% % \end{macrocode} % \end{environment} - -% \begin{macro}{\newlist} \marg{name} \marg{type} \marg{maxdepth} -% \begin{macro}{\renewlist} \marg{name} \marg{type} \marg{maxdepth} +% \begin{macro}{\LWR@patchlists} Patches list environments. +% +% \cs{LWr@patchlists} remembers \cs{item} as defined by whatever packages have +% been loaded, then +% patches the |itemize|, |enumerate|, and |description| environments and \cs{item}. +% This works with the native \LaTeX\ environments, as well as +% those provided by \pkg{enumitem}, \pkg{enumerate}, and \pkg{paralist}. % -% For \pkg{enumitem} lists, new lists must have the start and end actions assigned to -% the new environment. Renewed lists already have their actions assigned, and -% thus need no changes. % \begin{macrocode} -\let\LWR@orignewlist\newlist - -\renewcommand*{\newlist}[3]{% -\LWR@orignewlist{#1}{#2}{#3}% -\AtBeginEnvironment{#1}{\csuse{LWR@#2start}}% -\AtEndEnvironment{#1}{\csuse{LWR@#2end}}% +\newcommand*{\LWR@patchlists}{% +\LetLtxMacro{\LWR@origitem}{\item} +\AtBeginEnvironment{itemize}{\LWR@itemizestart} +\AtEndEnvironment{itemize}{\LWR@itemizeend} +\AtBeginEnvironment{enumerate}{\LWR@enumeratestart} +\AtEndEnvironment{enumerate}{\LWR@enumerateend} +\AtBeginEnvironment{description}{\LWR@descriptionstart} +\AtEndEnvironment{description}{\LWR@descriptionend} } % \end{macrocode} % \end{macro} -% \end{macro} + % \begin{macrocode} \end{warpHTML} @@ -12998,9 +13230,9 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% \afterassignment\LWR@fnslone\let\nexttoken= } \def\LWR@fnslone{\expandafter\futurelet\LWR@cs\LWR@fnsltwo} \def\LWR@fnsltwo{% -\expandafter\ifx\LWR@cs\@sptoken\let\next=\@BTfnslthree% +\expandafter\ifx\LWR@cs\@sptoken\let\next=\LWR@fnslthree% \else\let\next=\nexttoken\fi\next} -\def\@BTfnslthree{\afterassignment\LWR@fnslone\let\next= } +\def\LWR@fnslthree{\afterassignment\LWR@fnslone\let\next= } % \end{macrocode} % \end{macro} @@ -13008,6 +13240,7 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% % Looks ahead and copies the next token into |\LWR@mynexttoken|. % \begin{macrocode} \newcommand*{\LWR@getmynexttoken}{% +\LWR@traceinfo{LWR@getmynexttoken}% % nothing must follow this next line \LWR@futurenonspacelet\LWR@mynexttoken\LWR@tabledatacolumntag } @@ -13151,7 +13384,7 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% % \end{macrocode} % % Place \cs{StartDefiningTabulars} and -% \cs{EndDefiningTabulars}\margintag{misplaced alignment tab character \&} +% \cs{EndDefiningTabulars}\watchout[misplaced alignment tab character \&] % \index{alignment tab character \&, misplaced} % \index{misplaced alignment tab character \&} % before and after defining macros or environments which include @@ -14472,7 +14705,7 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% % \end{macrocode} % While printing the text, redefine |\\| to generate a new line % \begin{macrocode} -\begingroup \let\\\LWR@endofline #5 \endgroup +\begingroup \LetLtxMacro{\\}{\LWR@endofline} #5 \endgroup \LWR@stoppars% \global\boolfalse{LWR@intabularmetadata}% }% @@ -14493,10 +14726,15 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% % \begin{macro}{\LWR@tabledatacolumntag} % Open a new \HTML\ table cell unless the next token is for a macro % which does not create data, such as |\hline|, |\toprule|, etc: +% +% \changes{v0.34}{2017/08/08}{\pkg{booktabs}: Works inside \env{lateximage}.} +% % \begin{macrocode} \newbool{LWR@exitingtabular} + \newcommand*{\LWR@tabledatacolumntag}% {% +\LWR@traceinfo{LWR@tabledatacolumntag}% % \end{macrocode} % \hspace*{.5in} |\show\LWR@mynexttoken| to see what tokens to look for % \begin{macrocode} @@ -14539,6 +14777,9 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% \ifthenelse{\isequivalentto{\LWR@mynexttoken}{\cmidrule}}% {\let\mynext\LWR@donothing}{}% % +\ifthenelse{\isequivalentto{\LWR@mynexttoken}{\specialrule}}% +{\let\mynext\LWR@donothing}{}% +% \ifthenelse{\isequivalentto{\LWR@mynexttoken}{\cline}}% {\let\mynext\LWR@donothing}{}% % @@ -14591,11 +14832,30 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% % \begin{macrocode} \begin{warpHTML} % \end{macrocode} - +% +% +% These are default defininitions in case \pkg{booktabs} is not loaded, +% and are not expected to used, but must exist as placeholders. +% +% \changes{v0.34}{2017/08/08}{\pkg{booktabs}: Works inside \env{lateximage}.} +% \begin{macrocode} +\newcommand*{\LWR@origtoprule}[1]{\hline} +\newcommand*{\LWR@origmidrule}[1]{\hline} +\LetLtxMacro\LWR@origcmidrule\cline +\newcommand*{\LWR@origbottomrule}[1]{\hline} +\newcommand*{\LWR@origaddlinespace}[1][]{} +\newcommand*{\LWR@origmorecmidrules}{} +\newcommand*{\LWR@origspecialrule}[3]{\hline} +% \end{macrocode} +% +% % \begin{environment}{LWR@tabular} \oarg{vertposition} \marg{colspecs} % % The new tabular environment will be |\let| in |\LWR@LwarpStart|, % since \pkg{siunitx} might redefine tabular in the user's document. +% +% \changes{v0.34}{2017/08/08}{\pkg{booktabs}: Works inside \env{lateximage}.} +% % \begin{macrocode} \StartDefiningTabulars @@ -14646,34 +14906,38 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% % \end{macrocode} % |\\| becomes a macro to end the table row: % \begin{macrocode} -\let\\\LWR@tabularendofline% +\LetLtxMacro{\\}{\LWR@tabularendofline}% % \end{macrocode} % The following may appear before a data cell is created, % so after doing their actions, we look ahead with |\LWR@getmynextoken| % to see if the next token might create a new data cell: % \begin{macrocode} +\LWR@traceinfo{LWR@tabular: redefining macros}% \renewcommand*{\hline}{\LWR@domidrule\LWR@getmynexttoken}% -\newcommand*{\midrule}{\LWR@domidrule\LWR@getmynexttoken}% - -\NewDocumentCommand{\cmidrule}{o d() m}% -{\LWR@docmidrule[##1](##2){##3}\LWR@getmynexttoken}% - \RenewDocumentCommand{\cline}{m}% {\LWR@docmidrule{##1}\LWR@getmynexttoken}% -\newcommand*{\toprule}{\LWR@dotbrule\LWR@getmynexttoken}% +\DeclareDocumentCommand{\toprule}{o}{\LWR@dotbrule\LWR@getmynexttoken}% + +\DeclareDocumentCommand{\midrule}{o}{\LWR@domidrule\LWR@getmynexttoken}% -\newcommand*{\bottomrule}{\LWR@dotbrule\LWR@getmynexttoken}% +\DeclareDocumentCommand{\cmidrule}{o d() m}% +{\LWR@docmidrule[##1](##2){##3}\LWR@getmynexttoken}% + +\DeclareDocumentCommand{\bottomrule}{o}{\LWR@dotbrule\LWR@getmynexttoken}% +\DeclareDocumentCommand{\addlinespace}{o}{} +\DeclareDocumentCommand{\morecmidrules}{}{} +\DeclareDocumentCommand{\specialrule}{m m m}{\LWR@domidrule\LWR@getmynexttoken} % \end{macrocode} % The following create data cells and will have no more data in this cell, % so we do not want to look ahead for a possible data cell, % so do not want to use |\LWR@getmynexttoken|. % \begin{macrocode} -\let\multicolumn\LWR@tabledatamulticolumntag% -\let\multirow\LWR@tabledatamultirowtag% +\LetLtxMacro{\multicolumn}{\LWR@tabledatamulticolumntag}% +\LetLtxMacro{\multirow}{\LWR@tabledatamultirowtag}% \renewcommand*{\mrowcell}{\global\booltrue{LWR@skippingmrowcell}}% -\let\caption\LWR@longtabledatacaptiontag% +\LetLtxMacro{\caption}{\LWR@longtabledatacaptiontag}% % \end{macrocode} % Reset for new processing: % \begin{macrocode} @@ -14688,6 +14952,7 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% % \end{macrocode} % Look ahead for a possible table data cell: % \begin{macrocode} +\LWR@traceinfo{LWR@tabular: about to LWR@getmynexttoken}% \LWR@getmynexttoken% }% % \end{macrocode} @@ -15193,7 +15458,7 @@ lateximage\LWR@lateximagenumberref{#1}% % Any reference to |\usepackage{hyperref}| must be placed inside a \env{warpprint} environment. % \watchout % \begin{macrocode} -% DO NOT TELL OTHER PACKAGES TO ASSUME HYPERREF: +% DO NOT TELL OTHER PACKAGES TO ASSUME HYPERREF, lest they attempt to patch it: % \EmulatesPackage{hyperref}[2015/08/01]% Disabled. Do not do this. % \end{macrocode} @@ -15258,7 +15523,9 @@ class="#3"\LWR@orignewline}#2\LWR@htmltag{/a}% % \begin{macro}{\url} \marg{URL} % -% Create a link whose text name is the address of the link: +% Create a link whose text name is the address of the link. +% The \pkg{url} package may redefine \cs{url}, so it is \cs{let} to \cs{LWR@urla}here +% and also redefined by \pkg{lwarp-url}. % \begin{macrocode} \newcommand*{\LWR@urlb}[1]{% \href{#1}{#1}% @@ -15266,11 +15533,13 @@ class="#3"\LWR@orignewline}#2\LWR@htmltag{/a}% \LWR@ensuredoingapar% } -\newcommand{\url}{% +\newcommand{\LWR@urla}{% \LWR@ensuredoingapar% \begingroup\catcode`\_=12 \LWR@urlb% } + +\let\url\LWR@urla % \end{macrocode} % \end{macro} @@ -15486,10 +15755,10 @@ class="#3"\LWR@orignewline}#2\LWR@htmltag{/a}% % When a new \HTML\ file is marked in the \LaTeX\ \PDF\ file, % the \LaTeX\ page number at that point is stored in |LWR@latestautopage|, % (and the associated filename is remembered by the special \LaTeX\ labels). -% This page number is used to generate an |autofloat| \HTML\ \tag{id} +% This page number is used to generate an |autofloat| \HTML\ \element{id} % in the \HTML\ output at the start of the new \HTML\ file. % Meanwhile, there is a float counter used to generate an \HTML\ |autofloat| -% \tag{id} at the start of the float itself in the \HTML\ file. +% \element{id} at the start of the float itself in the \HTML\ file. % The |autopage| and |autofloat| values to use for each float are written to the % |.lof|, etc. files just before each float's entry. These values are used % by \cs{l@figure}, etc. to create the \HTML\ links in the List of Figures, etc. @@ -16286,15 +16555,15 @@ class="#3"\LWR@orignewline}#2\LWR@htmltag{/a}% % \subsection{Inline and display math} % \begin{macrocode} -\let\LWR@origdollar=$ -\let\LWR@secondorigdollar=$% balance for editor syntax highlighting +\LetLtxMacro\LWR@origdollar$ +\LetLtxMacro\LWR@secondorigdollar$% balance for editor syntax highlighting % \end{macrocode} % \begin{macrocode} -\let\LWR@origopenparen\( -\let\LWR@origcloseparen\) -\let\LWR@origopenbracket\[ -\let\LWR@origclosebracket\] +\LetLtxMacro\LWR@origopenparen\( +\LetLtxMacro\LWR@origcloseparen\) +\LetLtxMacro\LWR@origopenbracket\[ +\LetLtxMacro\LWR@origclosebracket\] % \end{macrocode} % \DescribeObject{\$} @@ -16336,7 +16605,7 @@ class="#3"\LWR@orignewline}#2\LWR@htmltag{/a}% % \changes{v0.19}{2016/05/25}{MathJax support.} % Redefine the single dollar sign to place math inside a \env{lateximage}, or use MathJax: % \begin{macrocode} -\gdef\LWR@singledollar#1${% +\gdef\LWR@subsingledollar#1{% \ifbool{mathjax}% % \end{macrocode} % For MathJax, print the math between |\(| and |\)|: @@ -16351,7 +16620,11 @@ class="#3"\LWR@orignewline}#2\LWR@htmltag{/a}% \LWR@origdollar#1\LWR@origdollar% \end{lateximage}% }% -}% +} + +\gdef\LWR@singledollar#1${% +\LWR@subsingledollar{#1}% +} % \end{macrocode} % \end{macro} @@ -16364,11 +16637,28 @@ class="#3"\LWR@orignewline}#2\LWR@htmltag{/a}% \gdef\[#1\]{$$#1$$} \endgroup + + + % \end{macrocode} % \end{macro} % \end{macro} + +% \begin{macro}{\@ensuredmath} \marg{expression} Not yet adapted to \pkg{lwarp}. +% +% \begin{macrocode} +\let\LWR@orig@ensuredmath\@ensuredmath + +\newcommand*{\LWR@ensuredmath}[1]{% +\LWR@traceinfo{@ensuredmath: page \thepage: \detokenize{#1}}% +\LWR@subsingledollar{#1}% +} +% \end{macrocode} +% \end{macro} + + % Remove the old |math| and |displaymath| environments: % \begin{macrocode} \let\math\relax @@ -16393,11 +16683,6 @@ class="#3"\LWR@orignewline}#2\LWR@htmltag{/a}% % \end{macrocode} % \end{environment} -% When the document begins, the dollar sign must be made active to trigger the new math macros: -% \begin{macrocode} -\AtBeginDocument{\catcode`\$=\active} -% \end{macrocode} - % \subsection{MathJax support} @@ -16422,14 +16707,13 @@ class="#3"\LWR@orignewline}#2\LWR@htmltag{/a}% % Otherwise, use the simple equation number. % \begin{macrocode} \ifcsdef{thechapter}{ -\BlockClassSingle{hidden}{ +\InlineClass{hidden}{ \textbackslash( \textbackslash{}seteqsection \{\thechapter\} \textbackslash) } } {}% not using chapters - % \end{macrocode} % MathJax doesn't allow setting the equation number to 1: % \begin{macrocode} @@ -16445,7 +16729,7 @@ class="#3"\LWR@orignewline}#2\LWR@htmltag{/a}% % Place the MathJax command inside ``\cs{(}'' and ``\cs{)}'' characters, % to be printed to \HTML, not interpreted by \LaTeX. % \begin{macrocode} -\BlockClassSingle{hidden}{ +\InlineClass{hidden}{ \textbackslash( \textbackslash{}seteqnumber \{\arabic{LWR@nextequation}\} \textbackslash) @@ -16458,19 +16742,38 @@ class="#3"\LWR@orignewline}#2\LWR@htmltag{/a}% % -% \begin{macro}{\LWR@restoremathlatexformatting} -% While producing math, use regular \LaTeX\ formatting instead of \HTML\ tags. +% \begin{macro}{\LWR@restoreorigformatting} +% While producing \SVG\ math or a \env{lateximage}, +% use regular \LaTeX\ formatting instead of \HTML\ tags. +% \changes{v0.34}{2017/08/05}{Improved font control.} +% \changes{v0.34}{2017/08/08}{\pkg{booktabs}: Works inside \env{lateximage}.} % \begin{macrocode} -\newcommand*{\LWR@restoremathlatexformatting}{% -\let\hspace\LWR@orighspace% -\let\rule\LWR@origrule% +\newcommand*{\LWR@restoreorigformatting}{% +\LetLtxMacro{\hspace}{\LWR@orighspace}% +\LetLtxMacro\rule\LWR@origrule% \let\,\LWR@origcomma% disable HTML short unbreakable space -\let\textit\LWR@origtextit% -\let\textbf\LWR@origtextbf% -\let\texttt\LWR@origtexttt% -\let\textsc\LWR@origtextsc% -\let\textsf\LWR@origtextsf% -\let\textrm\LWR@origtextrm% +\LetLtxMacro{\textrm}{\LWR@origtextrm}% +\LetLtxMacro{\textsf}{\LWR@origtextsf}% +\LetLtxMacro{\texttt}{\LWR@origtexttt}% +\LetLtxMacro{\textbf}{\LWR@origtextbf}% +\LetLtxMacro{\textmd}{\LWR@origtextmd}% +\LetLtxMacro{\textit}{\LWR@origtextit}% +\LetLtxMacro{\textsl}{\LWR@origtextsl}% +\LetLtxMacro{\textsc}{\LWR@origtextsc}% +\LetLtxMacro{\textup}{\LWR@origtextup}% +\LetLtxMacro{\textnormal}{\LWR@origtextnormal}% +\LetLtxMacro{\emph}{\LWR@origemph}% +\LetLtxMacro{\rmfamily}{\LWR@origrmfamily}% +\LetLtxMacro{\sffamily}{\LWR@origsffamily}% +\LetLtxMacro{\ttfamily}{\LWR@origttfamily}% +\LetLtxMacro{\bfseries}{\LWR@origbfseries}% +\LetLtxMacro{\mdseries}{\LWR@origmdseries}% +\LetLtxMacro{\upshape}{\LWR@origupshape}% +\LetLtxMacro{\slshape}{\LWR@origslshape}% +\LetLtxMacro{\scshape}{\LWR@origscshape}% +\LetLtxMacro{\itshape}{\LWR@origitshape}% +\LetLtxMacro{\em}{\LWR@origem}% +\LetLtxMacro{\normalfont}{\LWR@orignormalfont}% \renewcommand*{\thefootnote}{\fnsymbol{footnote}}% \let\textsuperscript\LWR@origtextsuperscript% \let\textsubscript\LWR@origtextsubscript% @@ -16478,6 +16781,29 @@ class="#3"\LWR@orignewline}#2\LWR@htmltag{/a}% \let\enskip\LWR@origenskip% \let\quad\LWR@origquad% \let\qquad\LWR@origqquad% +\LetLtxMacro{\tabular}{\LWR@origtabular}% +\LetLtxMacro{\endtabular}{\LWR@origendtabular}% +\LetLtxMacro\toprule\LWR@origtoprule% +\LetLtxMacro\midrule\LWR@origmidrule% +\LetLtxMacro\cmidrule\LWR@origcmidrule% +\LetLtxMacro\bottomrule\LWR@origbottomrule% +\LetLtxMacro\addlinespace\LWR@origaddlinespace% +\LetLtxMacro\morecmidrules\LWR@origmorecmidrules% +\LetLtxMacro\specialrule\LWR@origspecialrule% +\let\newline\LWR@orignewline% +\LetLtxMacro{\raisebox}{\LWR@origraisebox}% +\LetLtxMacro{\scalebox}{\LWR@origscalebox}% +\LetLtxMacro{\rotatebox}{\LWR@origrotatebox}% +\let\reflectbox\LWR@origreflectbox% +\let\framebox\LWR@origframebox% +\let\makebox\LWR@origmakebox% +\let\fbox\LWR@origfbox% +\let\fboxBlock\LWR@origfbox% +\LetLtxMacro{\fminipage}{\LWR@fminipageprint}% +\LetLtxMacro{\endfminipage}{\endLWR@fminipageprint}% +\LetLtxMacro{\minipage}{\LWR@origminipage}% +\let\endminipage\LWR@endminipage% +\LetLtxMacro{\parbox}{\LWR@origparbox}% } % \end{macrocode} % \end{macro} @@ -16504,7 +16830,7 @@ class="#3"\LWR@orignewline}#2\LWR@htmltag{/a}% % While in the math environment, % restore various commands to their \LaTeX\ meanings. % \begin{macrocode} -\LWR@restoremathlatexformatting +\LWR@restoreorigformatting % \end{macrocode} % ^^A When a label is encountered, the \HTML\ comment is closed, % ^^A the label is generated in an HTML-output context, @@ -16538,10 +16864,10 @@ class="#3"\LWR@orignewline}#2\LWR@htmltag{/a}% % The contents are printed to \HTML\ output, not interpreted by \LaTeX. % \begin{macrocode} \NewDocumentCommand{\LWR@addmathjax}{m +m}{% - % \end{macrocode} % Enclose the MathJax environment inside printed ``\cs{(}'' and ``\cs{)}'' characters. % \begin{macrocode} +\LWR@origtilde\LWR@orignewline \textbackslash{}begin\{#1\} % \end{macrocode} % Print the contents, sanitizing for \HTML\ special characters. @@ -16551,7 +16877,7 @@ class="#3"\LWR@orignewline}#2\LWR@htmltag{/a}% % Close the MathJax environment: % \begin{macrocode} \textbackslash{}end\{#1\} - +\LWR@orignewline } % \end{macrocode} % \end{macro} @@ -16707,11 +17033,11 @@ class="#3"\LWR@orignewline}#2\LWR@htmltag{/a}% % \begin{macrocode} \newcommand*{\LWR@beginhideamsmath}{ \LWR@stoppars - +\LWR@origtilde\LWR@orignewline \LWR@htmlopencomment \begingroup -\LWR@restoremathlatexformatting +\LWR@restoreorigformatting } % \end{macrocode} % \end{macro} @@ -16723,7 +17049,7 @@ class="#3"\LWR@orignewline}#2\LWR@htmltag{/a}% \endgroup \LWR@htmlclosecomment - +\LWR@orignewline \LWR@startpars } % \end{macrocode} @@ -16736,9 +17062,11 @@ class="#3"\LWR@orignewline}#2\LWR@htmltag{/a}% % % \changes{v0.19}{2016/05/25}{MathJax support added.} % \changes{v0.33}{2017/06/20}{Fix: Incorrectly-inline math environments.} +% \changes{v0.34}{2017/07/29}{Fix: Added the \protect\texttt{eqnarray} environments.} % % The following \pkg{amsmath} environments already collect their contents -% in \cs{@envbody} for further processing. +% in \cs{@envbody} for further processing. \env{eqnarray} is not an \AmS\ package, +% and thus requires special handling. % % For \SVG\ math: Each envrionment is encapsulated inside a \env{lateximage} environment, % along with a special |LWRAMSMATHBODY| argument @@ -16750,6 +17078,121 @@ class="#3"\LWR@orignewline}#2\LWR@htmltag{/a}% % printed to \HTML\ output for MathJax to process. % + +% \begin{environment}{eqnarray} +% +% This environmnet is not an \AmS\ environment and thus its body is not +% automatically captured, so the \pkg{environ} package is used to +% capture the environment into \cs{BODY}. +% \begin{macrocode} +\let\LWR@origeqnarray\eqnarray +\let\LWR@origendeqnarray\endeqnarray +% \end{macrocode} +% +% To remember whether the starred environment was used, and thus +% whether to number the equations: +% \begin{macrocode} +\newbool{LWR@numbereqnarray} +\booltrue{LWR@numbereqnarray} +% \end{macrocode} +% +% Common code used by \env{eqnarray} and \env{Beqnarray} (from \pkg{fancybox}): +% \begin{macrocode} +\newcommand{\LWR@eqnarrayfactor}{% +% \end{macrocode} +% +% Different behavior depending on MathJax vs \SVG\ math: +% \begin{macrocode} +\ifbool{mathjax} +{ +% \end{macrocode} +% +% If MathJax, the environment contents (the \cs{BODY}) are executed in a +% \HTML\ comment to trigger the correct equation number increment (if not starred), +% then are included verbatim in the output for MathJax to interpret: +% \begin{macrocode} +\LWR@syncmathjax +\boolfalse{LWR@amsmultline} +\ifbool{LWR@numbereqnarray} +{ +% \end{macrocode} +% +% If numbering the equations, execute a copy inside an \HTML\ comment block: +% \begin{macrocode} +\LWR@beginhideamsmath +\LWR@origeqnarray +\BODY +\LWR@origendeqnarray +\LWR@endhideamsmath +% \end{macrocode} +% +% Then print the (sanitized) contents to the output for MathJax to interpret: +% \begin{macrocode} +\LWR@addmathjax{eqnarray}{\BODY} +}{% not LWR@numbereqnarray +% \end{macrocode} +% +% If not numbering equations, just create the contents for MathJax: +% \begin{macrocode} +\LWR@addmathjax{eqnarray*}{\BODY} +}% LWR@numbereqnarray +}% mathjax +{% not mathjax +\ifbool{LWR@numbereqnarray} +{ +% \end{macrocode} +% +% For numbered \SVG\ equations, first create a \env{lateximage} with +% an \attribute{alt} attribute containing sanitized copy of the source code: +% \begin{macrocode} +\begin{lateximage}[\LWR@addmathjax{eqnarray}{\BODY}] +% \end{macrocode} +% Then create the image contents using an actual \env{eqnarray}: +% \begin{macrocode} +\LWR@origeqnarray +\BODY +\LWR@origendeqnarray +\end{lateximage} +}{% not LWR@numbereqnarray +% \end{macrocode} +% If not numbered, do the same, but an extra \cs{nonumber} seems to be required: +% \begin{macrocode} +\begin{lateximage}[\LWR@addmathjax{eqnarray*}{\BODY}] +\LWR@origeqnarray +\BODY +\nonumber +\LWR@origendeqnarray +\end{lateximage} +}% LWR@numbereqnarray +}% not mathjax +% \end{macrocode} +% +% Default to number equations in the future: +% \begin{macrocode} +\booltrue{LWR@numbereqnarray} +} +% \end{macrocode} +% +% \env{eqnarray} itself is made with a blank line before and after to +% force it to be on its own line: +% \begin{macrocode} +\RenewEnviron{eqnarray} +{% + +\LWR@eqnarrayfactor + +} +% \end{macrocode} +% +% The starred version is patched to turn off the numbering: +% \begin{macrocode} +\csgpreto{eqnarray*}{\boolfalse{LWR@numbereqnarray}} +% \end{macrocode} +% \end{environment} +% +% +% The following \AmS\ environments are more easily patched in-place: +% % \begin{environment}{multline} % \begin{macrocode} \BeforeBeginEnvironment{multline}{ @@ -17138,12 +17581,19 @@ class="#3"\LWR@orignewline}#2\LWR@htmltag{/a}% % \begin{environment}{lateximage} \oarg{alttag} +% % \changes{v0.18}{2016/05/18}{Surpress extra space.} % \changes{v0.18}{2016/05/18}{pdfcrop: -{}-hires added.} % \changes{v0.18}{2016/05/19}{Reorganize \cs{HomeHTMLFilename} logic.} % \changes{v0.26}{2017/03/22}{Print mode now uses a \env{minipage} of \cs{linewidth}.} % \changes{v0.26}{2017/03/29}{Labels track page numbers of lateximages.} +% \changes{v0.34}{2017/07/29}{Fix: \env{lateximage} with +% \env{minipage}, \cs{parbox}, \cs{makebox}, \cs{fbox}, \cs{framebox}, +% \cs{raisebox}, \cs{scalebox}, \cs{reflectbox}.} +% % \begin{macrocode} +\catcode`\$=\active% + \NewDocumentEnvironment{lateximage}{O{image}}{% \LWR@traceinfo{lateximage: starting on page \arabic{page}}% \ifthenelse{\cnttest{\value{LWR@lateximagedepth}}{>}{0}}% @@ -17163,7 +17613,7 @@ class="#3"\LWR@orignewline}#2\LWR@htmltag{/a}% \addtocounter{LWR@lateximagenumber}{1}% \LWR@traceinfo{lateximage: LWR@lateximagenumber is \arabic{LWR@lateximagenumber}}% % \end{macrocode} -% While inside a lateximage, do not use mathjax: +% While inside a lateximage, locally do not use mathjax: % \begin{macrocode} \boolfalse{mathjax} % \end{macrocode} @@ -17189,50 +17639,51 @@ class="lateximagesource"{}} \LWR@orignewline % \end{macrocode} % Write instructions to the |lateximages.txt| file: % \begin{macrocode} +\LWR@traceinfo{lateximage: about to write to lateximages.txt}% \immediate\write\LWR@file{|\theLWR@LIpage|\theLWR@externalfilecnt|}% % \end{macrocode} % Place an open comment tag at the bottom of page; footnotes will be above this tag. % This will hide any traces of the lateximage \PDF\ page which were picked up by % |pdftotext|. % \begin{macrocode} +\LWR@traceinfo{lateximage: about to create open comment}% \LWR@htmlopencomment% +% \end{macrocode} +% One level deeper: +% \begin{macrocode} \addtocounter{LWR@lateximagedepth}{1}% % \end{macrocode} % Start the new \PDF\ page: % \begin{macrocode} +\LWR@traceinfo{lateximage: about to create new page}% \LWR@orignewpage% % \end{macrocode} % Typeset the image in a ``standard'' width page and font size: % \begin{macrocode} +\LWR@traceinfo{lateximage: about to create minipage}% \LWR@origminipage{6in}% \csuse{LWR@orig\LateximageFontSizeName}% % \end{macrocode} % Temporarily restore formatting to its \PDF\ definitions: % Do not produce \HTML\ tags for \cs{hspace}, etc. inside a lateximage. % \begin{macrocode} -\let\hspace\LWR@orighspace% -\let\rule\LWR@origrule% -\let\,\LWR@origcomma% disable HTML short unbreakable space -\let\textit\LWR@origtextit% -\let\textbf\LWR@origtextbf% -\let\texttt\LWR@origtexttt% -\let\textsc\LWR@origtextsc% -\let\textsf\LWR@origtextsf% -\let\textrm\LWR@origtextrm% -\renewcommand*{\thefootnote}{\fnsymbol{footnote}}% -\let\textsuperscript\LWR@origtextsuperscript% -\let\textsubscript\LWR@origtextsubscript% -\let~\LWR@origtilde% -\let\enskip\LWR@origenskip% -\let\quad\LWR@origquad% -\let\qquad\LWR@origqquad% -\let\tabular\LWR@origtabular% -\let\endtabular\LWR@origendtabular% -\let\newline\LWR@orignewline% +\LWR@traceinfo{lateximage: about to temporarily restore formatting}% +\LWR@restoreorigformatting% +\LWR@traceinfo{lateximage: about to create label}% \LWR@origlabel{LWRlateximage\arabic{LWR@lateximagenumber}}% +\LWR@traceinfo{lateximage: finished creating the label}% +\LetLtxMacro$\LWR@origdollar% +\catcode`\$=3% math shift +\LetLtxMacro\(\LWR@origopenparen% +\LetLtxMacro\)\LWR@origcloseparen% +\LetLtxMacro\[\LWR@origopenbracket% +\LetLtxMacro\]\LWR@origclosebracket% +\let\@ensuredmath\LWR@orig@ensuredmath% }% end of outer-most lateximage +\LWR@traceinfo{lateximage: finished start of environment}% }% end of \begin{lateximage} {% start of \end{lateximage} +\LWR@traceinfo{lateximage: starting end of environment}% \ifthenelse{\cnttest{\value{LWR@lateximagedepth}}{>}{1}}% % \end{macrocode} % If nesting inside an already-existing lateximage, simply record one more level: @@ -17293,14 +17744,17 @@ class="lateximagesource"{}} \LWR@orignewline % \begin{macrocode} \addtocounter{LWR@lateximagedepth}{-1}% }% end of outer-most lateximage -\LWR@traceinfo{lateximage: done} +\LWR@traceinfo{lateximage: done}% }% +\catcode`\$=3% math shift \end{warpHTML} % \end{macrocode} + % \codeprint % \begin{macrocode} \begin{warpprint} -\newenvironment{lateximage}[1][]{\minipage{\linewidth}}{\endminipage} +% \newenvironment{lateximage}[1][]{\minipage{\linewidth}}{\endminipage} +\newenvironment{lateximage}[1][]{}{} \end{warpprint} % \end{macrocode} % \end{environment} @@ -17891,6 +18345,8 @@ img src="\thisgraphicspath\LWR@strresult\LWR@imageextension" \LWR@orignewline % Will \cs{let}\cs{rotatebox}\cs{LWR@rotatebox} at \cs{LWR@LwarpStart}, % in case \cs{rotatebox} was over-written by a later package load. % \begin{macrocode} +\LetLtxMacro\LWR@origrotatebox\rotatebox + \NewDocumentCommand{\LWR@rotatebox}{O{} m +m}{% % \end{macrocode} % Reset the origin to ``none-given'': @@ -17935,6 +18391,8 @@ img src="\thisgraphicspath\LWR@strresult\LWR@imageextension" \LWR@orignewline % Will \cs{let}\cs{scalebox}\cs{LWR@scalebox} at \cs{LWR@LwarpStart}, % in case \cs{scalebox} was over-written by a later package load. % \begin{macrocode} +\LetLtxMacro\LWR@origscalebox\scalebox + \NewDocumentCommand{\LWR@scalebox}{m o m}{% % \end{macrocode} % Select |inline-block| so that \HTML\ will transform this span: @@ -17967,6 +18425,8 @@ img src="\thisgraphicspath\LWR@strresult\LWR@imageextension" \LWR@orignewline % in case \\ % \cs{reflectbox} was over-written by a later package load. % \begin{macrocode} +\let\LWR@origreflectbox\reflectbox + \newcommand{\LWR@reflectbox}[1]{\LWR@scalebox{-1}[1]{#1}} % \end{macrocode} % \end{macro} @@ -18049,6 +18509,7 @@ img src="\thisgraphicspath\LWR@strresult\LWR@imageextension" \LWR@orignewline % \end{flushleft} % \begin{macrocode} \AfterEndPreamble{ +\LWR@traceinfo{Patching cleveref.} % \end{macrocode} % \begin{macro}{\@@setcref} \marg{kindofref} \marg{label} @@ -18151,10 +18612,7 @@ img src="\thisgraphicspath\LWR@strresult\LWR@imageextension" \LWR@orignewline % \changes{v0.24}{2017/03/13}{Fix for inline images.} % \changes{v0.26}{2017/03/30}{Fix for \cs{makebox} in \env{picture}.} % \begin{macrocode} -\BeforeBeginEnvironment{picture}{% -\lateximage% -\let\makebox\LWR@origmakebox% -} +\BeforeBeginEnvironment{picture}{\lateximage} \AfterEndEnvironment{picture}{\endlateximage} % \end{macrocode} @@ -18204,11 +18662,6 @@ img src="\thisgraphicspath\LWR@strresult\LWR@imageextension" \LWR@orignewline \newlength{\LWR@minipageheight} % \end{macrocode} % -% Remember the original definitions: -% \begin{macrocode} -\let\LWR@origminipage\minipage -\let\LWR@origendminipage\endminipage -% \end{macrocode} % % % \subsection{Footnote handling} @@ -18330,13 +18783,6 @@ img src="\thisgraphicspath\LWR@strresult\LWR@imageextension" \LWR@orignewline % \begin{macrocode} \RenewDocumentEnvironment{minipage}{O{t} o O{t} m} {% -% \end{macrocode} -% Pre-compute the given width and height: -% \begin{macrocode} -% \end{macrocode} -% Reset the text area if are starting the outer-most minipage: -% \begin{macrocode} -\LWR@traceinfo{starting minipage of width #4}% \uselengthunit{in}% \setlength{\LWR@minipagewidth}{#4}% \ifthenelse{\cnttest{\value{LWR@minipagedepth}}{=}{0}}{% @@ -18356,7 +18802,7 @@ img src="\thisgraphicspath\LWR@strresult\LWR@imageextension" \LWR@orignewline % \begin{macrocode} \LWR@stoppars% % \end{macrocode} -% Create the |

| tag with optional alignment style: +% Create the \element{div} tag with optional alignment style: % \begin{macrocode} \LWR@traceinfo{minipage: creating div class}% \LWR@orignewpage% @@ -18447,14 +18893,16 @@ img src="\thisgraphicspath\LWR@strresult\LWR@imageextension" \LWR@orignewline % \end{macro} % % -% \begin{macro}{\makebox} \oarg{width} \oarg{pos} \marg{text} +% \begin{macro}{\makebox} \parg(posn) \oarg{width} \oarg{pos} \marg{text} % -% Width and position are ignored. +% Width and positions are ignored. +% +% \changes{v0.34}{2017/07/31}{Fix: Handles paren arg.} % \begin{macrocode} -\let\LWR@origmakebox\makebox +\LetLtxMacro\LWR@origmakebox\makebox -\RenewDocumentCommand{\makebox}{o o m}{% -\mbox{#3} +\RenewDocumentCommand{\makebox}{d() o o m}{% +\mbox{#4} } % \end{macrocode} % \end{macro} @@ -18464,6 +18912,8 @@ img src="\thisgraphicspath\LWR@strresult\LWR@imageextension" \LWR@orignewline % % Width and position are ignored. % \begin{macrocode} +\LetLtxMacro\LWR@origframebox\framebox + \RenewDocumentCommand{\framebox}{o o m}{% \fbox{#3} } @@ -18472,18 +18922,61 @@ img src="\thisgraphicspath\LWR@strresult\LWR@imageextension" \LWR@orignewline % % % \begin{macro}{\fbox} \marg{text} +% +% Creates a framed inline span enclosing the text. % \begin{macrocode} \let\LWR@origfbox\fbox + +\renewcommand{\fbox}[1]{% +\LWR@htmltagc{span class="framebox"}% +\begin{LWR@nestspan}% +#1 +\LWR@htmltagc{/span}% +\end{LWR@nestspan}% +} +% \end{macrocode} +% \end{macro} +% + +% \begin{macro}{\fboxBlock} \marg{text} +% Creates a framed \HTML\ \element{div} of the text. +% +% A print-output version is also supplied below. +% +% \changes{v0.34}{2017/07/31}{Added.} % -\renewcommand*{\fbox}[1]{% -\InlineClass{framebox}{#1}% +% \begin{macrocode} +\newcommand{\fboxBlock}[1]{% +\begin{BlockClass}{framed} +#1 +\end{BlockClass} } % \end{macrocode} % \end{macro} + +% \begin{environment}{fminipage} \oarg{align} \oarg{height} \oarg{align} \marg{width} +% +% Creates a framed \HTML\ \element{div} around its contents. +% +% A print-output version is also supplied below. +% +% \changes{v0.34}{2017/07/31}{Added.} +% +% \begin{macrocode} +\NewDocumentEnvironment{fminipage}{O{t} o O{t} m} +{% +\setlength{\LWR@tempwidth}{#4} +\begin{BlockClass}[width:\rndprintlength{\LWR@tempwidth};]{framed}% +} +{\end{BlockClass}} +% \end{macrocode} +% \end{environment} % % % \begin{macro}{\raisebox} \marg{raiselen} \oarg{height} \oarg{depth} \marg{text} % \begin{macrocode} +\LetLtxMacro{\LWR@origraisebox}{\raisebox} + \RenewDocumentCommand{\raisebox}{m o o m}{% #4% } @@ -18496,6 +18989,69 @@ img src="\thisgraphicspath\LWR@strresult\LWR@imageextension" \LWR@orignewline +% \codeall +% \begin{macrocode} +\begin{warpall} +% \end{macrocode} + +% \begin{environment}{LWR@fminipageprint} \oarg{align} \oarg{height} \oarg{align} \marg{width} +% +% Creates a frame around its contents. +% \begin{macrocode} +\newsavebox{\LWR@fminipagebox} + +\NewDocumentEnvironment{LWR@fminipageprint}{O{t} o O{t} m} +{% +\IfValueTF{#2}% +{\minipage[#1][#2][#3]{#4}}% +{\minipage[#3]{#4}}% +\begin{lrbox}{\LWR@fminipagebox}% +\IfValueTF{#2}% +{\minipage[#1][#2][#3]{\linewidth-2\fboxsep-2\fboxrule}}% +{\minipage[#3]{\linewidth-2\fboxsep-2\fboxrule}}% +} +{% +\endminipage% +\end{lrbox}% +\fbox{\usebox{\LWR@fminipagebox}}% +\endminipage% +} +% \end{macrocode} +% \end{environment} + + +% \begin{macrocode} +\end{warpall} +% \end{macrocode} + + + +% \codeprint +% \begin{macrocode} +\begin{warpprint} +% \end{macrocode} + +% \begin{macro}{\fboxBlock} \marg{text} +% +% Creates a framed \HTML\ \element{div} around the text. +% \begin{macrocode} +\let\fboxBlock\fbox +% \end{macrocode} +% \end{macro} + + +% \begin{environment}{fminipage} \oarg{align} \oarg{height} \oarg{align} \marg{width} +% +% Creates a frame around its contents. +% \begin{macrocode} +\LetLtxMacro{\fminipage}{\LWR@fminipageprint} +\LetLtxMacro{\endfminipage}{\endLWR@fminipageprint} +% \end{macrocode} +% \end{environment} + +% \begin{macrocode} +\end{warpprint} +% \end{macrocode} @@ -18517,67 +19073,167 @@ img src="\thisgraphicspath\LWR@strresult\LWR@imageextension" \LWR@orignewline \begin{warpHTML} % \end{macrocode} +% \changes{v0.34}{2017/08/05}{Improved font control.} + % \begin{macro}{\emph} \marg{text} % \begin{macrocode} -\renewcommand{\emph}[1]{\LWR@htmlspan{em}{#1}} +\DeclareRobustCommand{\LWR@HTMLemph}[1]{\LWR@htmlspan{em}{#1}} +\DeclareRobustCommand{\LWR@nullemph}[1]{#1} +\LetLtxMacro{\emph}{\LWR@HTMLemph} % \end{macrocode} % \end{macro} % \begin{macro}{\textmd} \marg{text} % \begin{macrocode} -\renewcommand{\textmd}[1]{\LWR@htmlspan{textmd}{#1}} +\DeclareRobustCommand{\LWR@HTMLtextmd}[1]{\LWR@htmlspan{textmd}{#1}} +\DeclareRobustCommand{\LWR@nulltextmd}[1]{#1} +\LetLtxMacro{\textmd}{\LWR@HTMLtextmd} % \end{macrocode} % \end{macro} % \begin{macro}{\textbf} \marg{text} % \begin{macrocode} -\renewcommand{\textbf}[1]{\LWR@htmlspan{b}{#1}} +\DeclareRobustCommand{\LWR@HTMLtextbf}[1]{\LWR@htmlspan{b}{#1}} +\DeclareRobustCommand{\LWR@nulltextbf}[1]{#1} +\LetLtxMacro{\textbf}{\LWR@HTMLtextbf} % \end{macrocode} % \end{macro} % \begin{macro}{\textrm} \marg{text} % \begin{macrocode} -\renewcommand{\textrm}[1]{\InlineClass{textrm}{#1}} +\DeclareRobustCommand{\LWR@HTMLtextrm}[1]{\LWR@htmlspan{textrm}{#1}} +\DeclareRobustCommand{\LWR@nulltextrm}[1]{#1} +\LetLtxMacro{\textrm}{\LWR@HTMLtextrm} % \end{macrocode} % \end{macro} % \begin{macro}{\textsf} \marg{text} % \begin{macrocode} -\renewcommand{\textsf}[1]{\InlineClass{textsf}{#1}} +\DeclareRobustCommand{\LWR@HTMLtextsf}[1]{\LWR@htmlspan{textsf}{#1}} +\DeclareRobustCommand{\LWR@nulltextsf}[1]{#1} +\LetLtxMacro{\textsf}{\LWR@HTMLtextsf} % \end{macrocode} % \end{macro} % \begin{macro}{\texttt} \marg{text} % \begin{macrocode} -\renewcommand{\texttt}[1]{\LWR@htmlspan{kbd}{#1}} +\DeclareRobustCommand{\LWR@HTMLtexttt}[1]{\LWR@htmlspan{kbd}{#1}} +\DeclareRobustCommand{\LWR@nulltexttt}[1]{#1} +\LetLtxMacro{\texttt}{\LWR@HTMLtexttt} % \end{macrocode} % \end{macro} % \begin{macro}{\textup} \marg{text} % \changes{v0.28}{2017/04/13}{Fixed span class.} % \begin{macrocode} -\renewcommand{\textup}[1]{\InlineClass{textup}{#1}} +\DeclareRobustCommand{\LWR@HTMLtextup}[1]{\LWR@htmlspan{textup}{#1}} +\DeclareRobustCommand{\LWR@nulltextup}[1]{#1} +\LetLtxMacro{\textup}{\LWR@HTMLtextup} % \end{macrocode} % \end{macro} % \begin{macro}{\textit} \marg{text} % \begin{macrocode} -\renewcommand{\textit}[1]{\LWR@htmlspan{i}{#1}} +\DeclareRobustCommand{\LWR@HTMLtextit}[1]{\LWR@htmlspan{i}{#1}} +\DeclareRobustCommand{\LWR@nulltextit}[1]{#1} +\LetLtxMacro{\textit}{\LWR@HTMLtextit} % \end{macrocode} % \end{macro} % \begin{macro}{\textsc} \marg{text} % \begin{macrocode} -\renewcommand{\textsc}[1]{\InlineClass{textsc}{#1}} +\DeclareRobustCommand{\LWR@HTMLtextsc}[1]{\LWR@htmlspan{textsc}{#1}} +\DeclareRobustCommand{\LWR@nulltextsc}[1]{#1} +\LetLtxMacro{\textsc}{\LWR@HTMLtextsc} % \end{macrocode} % \end{macro} -% \begin{macro}{\textnormal} \marg{text} +% \begin{macro}{\textsl} \marg{text} % \begin{macrocode} -\renewcommand{\textnormal}[1]{\textmd{\textrm{\textup{#1}}}} +\DeclareRobustCommand{\LWR@HTMLtextsl}[1]{\LWR@htmlspan{testsl}{#1}} +\DeclareRobustCommand{\LWR@nulltextsl}[1]{#1} +\LetLtxMacro{\textsl}{\LWR@HTMLtextsl} % \end{macrocode} % \end{macro} +% \begin{macro}{\textnormal} \marg{text} +% \begin{macrocode} +\DeclareRobustCommand{\LWR@HTMLtextnormal}[1]{\textmd{\textrm{\textup{#1}}}} +\DeclareRobustCommand{\LWR@nulltextnormal}[1]{#1} +\LetLtxMacro{\textnormal}{\LWR@HTMLtextnormal} +% \end{macrocode} +% \end{macro} + + +% \begin{macrocode} +\DeclareRobustCommand{\LWR@HTMLrmfamily}[1]{} +\DeclareRobustCommand{\LWR@HTMLsffamily}[1]{} +\DeclareRobustCommand{\LWR@HTMLttfamily}[1]{} +\DeclareRobustCommand{\LWR@HTMLbfseries}[1]{} +\DeclareRobustCommand{\LWR@HTMLmdseries}[1]{} +\DeclareRobustCommand{\LWR@HTMLupshape}[1]{} +\DeclareRobustCommand{\LWR@HTMLslshape}[1]{} +\DeclareRobustCommand{\LWR@HTMLscshape}[1]{} +\DeclareRobustCommand{\LWR@HTMLitshape}[1]{} +\DeclareRobustCommand{\LWR@HTMLem}[1]{} +\DeclareRobustCommand{\LWR@nullrmfamily}[1]{} +\DeclareRobustCommand{\LWR@nullsffamily}[1]{} +\DeclareRobustCommand{\LWR@nullttfamily}[1]{} +\DeclareRobustCommand{\LWR@nullbfseries}[1]{} +\DeclareRobustCommand{\LWR@nullmdseries}[1]{} +\DeclareRobustCommand{\LWR@nullupshape}[1]{} +\DeclareRobustCommand{\LWR@nullslshape}[1]{} +\DeclareRobustCommand{\LWR@nullscshape}[1]{} +\DeclareRobustCommand{\LWR@nullitshape}[1]{} +\DeclareRobustCommand{\LWR@nullem}[1]{} +% \end{macrocode} + + + +% \begin{macro}{\LWR@nullfonts} Removes formatting during filename operations. +% \changes{v0.34}{2017/08/05}{Improved font control.} +% \begin{macrocode} +\newcommand*{\LWR@nullfonts}{% +\LetLtxMacro{\emph}{\LWR@nullemph}% +\LetLtxMacro{\textmd}{\LWR@nulltextmd}% +\LetLtxMacro{\textbf}{\LWR@nulltextbf}% +\LetLtxMacro{\textrm}{\LWR@nulltextrm}% +\LetLtxMacro{\textsf}{\LWR@nulltextsf}% +\LetLtxMacro{\texttt}{\LWR@nulltexttt}% +\LetLtxMacro{\textup}{\LWR@nulltextup}% +\LetLtxMacro{\textit}{\LWR@nulltextit}% +\LetLtxMacro{\textsc}{\LWR@nulltextsc}% +\LetLtxMacro{\textsl}{\LWR@nulltextsl}% +\LetLtxMacro{\textnormal}{\LWR@nulltextnormal}% +\LetLtxMacro{\rmfamily}{\LWR@nullrmfamily}% +\LetLtxMacro{\sffamily}{\LWR@nullsffamily}% +\LetLtxMacro{\ttfamily}{\LWR@nullttfamily}% +\LetLtxMacro{\bfseries}{\LWR@nullbfseries}% +\LetLtxMacro{\mdseries}{\LWR@nullmdseries}% +\LetLtxMacro{\upshape}{\LWR@nullupshape}% +\LetLtxMacro{\slshape}{\LWR@nullslshape}% +\LetLtxMacro{\scshape}{\LWR@nullscshape}% +\LetLtxMacro{\itshape}{\LWR@nullitshape}% +\LetLtxMacro{\em}{\LWR@nullem}% +\LetLtxMacro{\normalfont}{\LWR@nullnormalfont}% +\renewcommand*{\HTMLunicode}[1]{}% +% \renewcommand*{\HTMLunicode}[1]{} +% \renewcommand*{\HTMLentity}[1]{##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}% +\renewcommand{\textsuperscript}[1]{##1}% +% \renewcommand{\textsuperscript}[1]{##1} +\renewcommand{\textsubscript}[1]{##1}% +% \renewcommand{\textsubscript}[1]{##1} +\RenewDocumentCommand{\LWR@htmlspanclass}{o m +m}{##3}% +\DeclareExpandableDocumentCommand{\InlineClass}{o m +m}{##3}% +% \DeclareExpandableDocumentCommand{\InlineClass}{o m +m}{##3}% +} +% \end{macrocode} +% \end{macro} % \begin{macro}{\mdseries} @@ -18782,7 +19438,7 @@ img src="\thisgraphicspath\LWR@strresult\LWR@imageextension" \LWR@orignewline % \begin{macro}{\newline} -% Uses \HTML\ |
| tag +% Uses the \HTML\ \element{br /} element. % \begin{macrocode} \newcommand*{\LWR@newlinebr}{\unskip\LWR@htmltag{br /}\LWR@orignewline}% \let\newline\LWR@newlinebr @@ -18799,7 +19455,7 @@ img src="\thisgraphicspath\LWR@strresult\LWR@imageextension" \LWR@orignewline % % Inside |tabular|, |\\| is temporarily changed to \cs{LWR@tabularendofline}. % \begin{macrocode} -\let\LWR@origendofline\\ +\LetLtxMacro\LWR@origendofline\\ \NewDocumentCommand{\LWR@endofline}{s o} {% \newline% @@ -18814,11 +19470,11 @@ img src="\thisgraphicspath\LWR@strresult\LWR@imageextension" \LWR@orignewline % \begin{macro}{\LWR@minipagestartpars} % \changes{v0.19}{2016/05/31}{Surpresses paragraph tags between minipages.} % \index{minipage>horizontal space between} -% \index{space>horizontal between minipages} +% \index{space>horizontal>between minipages} % \index{horizontal space>between minipages} % Minipages are often placed side-by-side inside figures, with a bit of % horizontal space to separate them. Since \HTML\ does not allow -% a \tag{div} to be inside a |p|, paragraphs must be turned off during the +% a \element{div} to be inside a |p|, paragraphs must be turned off during the % generation of the minipage, then turned on after the minipage is complete. % When this occurs between side-by-side minipages, |lwarp| correctly % surpresses the paragraph tags between the minipages, unless some other @@ -18961,13 +19617,22 @@ span style="width:\printlength{\LWR@tempwidth}; display:inline-block;"% } % \end{macrocode} % \end{macro} +% +% \begin{macro}{\LWR@nohspace} * \marg{length} +% +% Used to disable \cs{hspace} while creating |description| \cs{item}s. +% \begin{macrocode} +\NewDocumentCommand{\LWR@nohspace}{s m}{} +% \end{macrocode} +% \end{macro} + % % % \begin{macro}{\hspace} * \marg{length} % % Handles special minipage \& horizontal space interactions. % \begin{macrocode} -\let\hspace\LWR@hspace +\LetLtxMacro{\hspace}{\LWR@hspace} % \end{macrocode} % \end{macro} @@ -19128,7 +19793,7 @@ display:inline-block;"% % % Handles special minipage \& horizontal space interactions. % \begin{macrocode} -\let\rule\LWR@rule +\renewcommand{\rule}{\LWR@rule} % \end{macrocode} % \end{macro} @@ -19323,6 +19988,9 @@ display:inline-block;"% % \end{macro} % \end{macro} + + + % \begin{macrocode} \end{warpHTML} % \end{macrocode} @@ -19483,7 +20151,7 @@ display:inline-block;"% % % \section{Afterpage} % -% \DescribePackage{afterpage} Not used. +% \DescribePackage{afterpage} Emulated. % % \changes{v0.20}{2017/01/11}{\pkg{afterpage}: Added.} % @@ -19524,8 +20192,8 @@ display:inline-block;"% % \end{macrocode} % % -% Inside the \env{algorithmic} environment, level indenting is converted to a \tag{span} -% of the required length, and comments are placed inside a \tag{span} which is floated right. +% Inside the \env{algorithmic} environment, level indenting is converted to a \element{span} +% of the required length, and comments are placed inside a \element{span} which is floated right. % % \limitscombiningfloats % @@ -19585,6 +20253,7 @@ span style="width:\rndprintlength{\ALG@thistlm}; display:inline-block;"% % \begin{macrocode} \AfterEndPreamble{ +\LWR@traceinfo{Patching alltt.} \AtBeginEnvironment{alltt}{% \LWR@forcenewpage \LWR@atbeginverbatim{alltt}\unskip\LWR@origvspace*{-\baselineskip}% @@ -19619,12 +20288,12 @@ span style="width:\rndprintlength{\ALG@thistlm}; display:inline-block;"% % \begin{description} % \item[CSS styling of theorems and proofs:] \ % \begin{description} -% \item [Theorem:] \tag{div} of class |amsthmbody| -% \item [Theorem Name:] \tag{span} of class |amsthmname| -% \item [Theorem Number:] \tag{span} of class |amsthmnumber| -% \item [Theorem Note:] \tag{span} of class |amsthmnote| -% \item [Proof:] \tag{div} of class |amsthmproof| -% \item [Proof Name:] \tag{span} of class |amsthmproofname| +% \item [Theorem:] \element{div} of class |amsthmbody| +% \item [Theorem Name:] \element{span} of class |amsthmname| +% \item [Theorem Number:] \element{span} of class |amsthmnumber| +% \item [Theorem Note:] \element{span} of class |amsthmnote| +% \item [Proof:] \element{div} of class |amsthmproof| +% \item [Proof Name:] \element{span} of class |amsthmproofname| % \end{description} % where || is |plain|, |definition|, etc. % \end{description} @@ -19752,6 +20421,46 @@ span style="width:\rndprintlength{\ALG@thistlm}; display:inline-block;"% % % % +% +% +% \clearpage +% +% \iffalse +%<*balance> +% \fi +% +% \part{lwarp-balance.sty} +% +% \section{Balance} +% +% \DescribePackage{balance} Emulated. +% +% \changes{v0.34}{2017/07/27}{\pkg{balance}: Added.} +% +% \codehtml +% +% Discard all options for \pkg{lwarp-balance}: +% \begin{macrocode} +\LWR@ProvidesPackageDrop{balance} +% \end{macrocode} +% +% +% \begin{macrocode} +\newcommand*{\balance}{} +\newcommand*{\nobalance}{} +% \end{macrocode} +% +% +% \iffalse +% +% \fi +% +% +% +% +% +% \clearpage +% % \iffalse %<*bookmark> % \fi @@ -19789,7 +20498,6 @@ span style="width:\rndprintlength{\ALG@thistlm}; display:inline-block;"% % % % -% \clearpage % % \iffalse %<*booktabs> @@ -19803,21 +20511,28 @@ span style="width:\rndprintlength{\ALG@thistlm}; display:inline-block;"% % % \DescribePackage{booktabs} % \pkg{booktabs} is emulated during \HTML\ output, and -% the \pkg{booktabs} package is ignored. - +% used as-is during print output and inside an \HTML\ \env{lateximage}. +% +% \changes{v0.34}{2017/08/08}{\pkg{booktabs}: Works inside \env{lateximage}.} +% % \codehtml % \begin{macrocode} -\LWR@ProvidesPackageDrop{booktabs} +\LWR@ProvidesPackagePass{booktabs} % \end{macrocode} % % Booktabs emulation is spread among the tabular code. +% The original definitions are saved here for use in \HTML\ \env{lateximage}s. +% The \HTML\ versions temporarily overwrite these print versions +% when \env{tabular} is started. % -% -% Emulated for source compatibility. % \begin{macrocode} -\newcommand*{\addlinespace}[1]{} -\newcommand*{\morecmidrules}{} -\newcommand*{\specialrule}[3]{} +\LetLtxMacro\LWR@origtoprule\toprule +\LetLtxMacro\LWR@origmidrule\midrule +\LetLtxMacro\LWR@origcmidrule\cmidrule +\LetLtxMacro\LWR@origbottomrule\bottomrule +\LetLtxMacro\LWR@origaddlinespace\addlinespace +\LetLtxMacro\LWR@origmorecmidrules\morecmidrules +\LetLtxMacro\LWR@origspecialrule\specialrule % \end{macrocode} % \iffalse @@ -19826,6 +20541,76 @@ span style="width:\rndprintlength{\ALG@thistlm}; display:inline-block;"% % % % +% +% \clearpage +% +% +% \iffalse +%<*boxedminipage> +% \fi +% +% \part{lwarp-boxedminipage.sty} +% +% \section{Boxedminipage} +% +% \DescribePackage{boxedminipage} +% \pkg{boxedminipage} is superceded by \pkg{boxedminipage2e}. +% +% \changes{v0.34}{2017/07/26}{\pkg{boxedminipage}: Prevented.} +% +% \codehtml +% \begin{macrocode} +\LWR@loadnever{boxedminipage}{boxedminipage2e} +% \end{macrocode} +% +% \iffalse +% +% \fi +% +% +% +% +% \iffalse +%<*boxedminipage2e> +% \fi + +% \part{lwarp-boxedminipage2e.sty} + +% \section{Boxedminipage2e} +% +% \DescribePackage{boxedminipage2e} +% \pkg{boxedminipage2e} is emulated. +% +% \changes{v0.34}{2017/07/26}{\pkg{boxedminipage2e}: Added.} +% +% \codehtml +% +% Discard all options for \pkg{lwarp-boxedminipage2e}: +% \begin{macrocode} +\LWR@ProvidesPackageDrop{boxedminipage2e} +% \end{macrocode} + +% \begin{macrocode} +\newenvironment{boxedminipage}{% +\begin{BlockClass}{framebox}% +\minipage% +} +{ +\endminipage% +\end{BlockClass} +} +% \end{macrocode} + +% \iffalse +% +% \fi +% +% +% +% +% +% \clearpage +% % \iffalse %<*ccaption> % \fi @@ -19852,7 +20637,6 @@ span style="width:\rndprintlength{\ALG@thistlm}; display:inline-block;"% % % % -% \clearpage % % \iffalse %<*changepage> @@ -19895,6 +20679,38 @@ span style="width:\rndprintlength{\ALG@thistlm}; display:inline-block;"% % \clearpage % % \iffalse +%<*crop> +% \fi +% +% \part{lwarp-crop.sty} +% +% \section{Crop} +% +% \DescribePackage{crop} Emulated. +% +% \changes{v0.34}{2017/08/03}{\pkg{crop}: Added.} +% +% \codehtml +% +% Discard all options for \pkg{lwarp-crop}: +% \begin{macrocode} +\LWR@ProvidesPackageDrop{crop} +% \end{macrocode} +% +% \begin{macrocode} +\newcommand*{\crop}[1][]{} +\newcommand*{\cropdef}[6][]{} +% \end{macrocode} +% +% \iffalse +% +% \fi +% +% +% +% \clearpage +% +% \iffalse %<*cutwin> % \fi % @@ -20092,8 +20908,6 @@ span style="width:\rndprintlength{\ALG@thistlm}; display:inline-block;"% % \changes{v0.26}{2017/03/27}{\pkg{endnotes}: Added.} % % -% Discard all options for \pkg{lwarp-endnotes}: -% % \codehtml % \begin{macrocode} \LWR@ProvidesPackagePass{endnotes} @@ -20119,53 +20933,101 @@ span style="width:\rndprintlength{\ALG@thistlm}; display:inline-block;"% % % % -% % \clearpage % % \iffalse %<*enumerate> % \fi - +% % \part{lwarp-enumerate.sty} - +% % \section{Enumerate} +% \label{sec:enumerate} % % \DescribePackage{enumerate} -% \pkg{enumerate} is ignored. -% \pkg{enumitem} is then modified per the |shortlabels| option. +% \pkg{enumerate} is supported with no changes. + +% This package is only required because it was used in the past to drop +% and then emulate the package. +% It cannot be removed because an older version which dropped the +% package may still remain, for example in a local vs. distribution directory, +% but it is now supported directly by \pkg{lwarp} and thus must no longer be dropped. +% +% \changes{v0.34}{2017/07/27}{\pkg{enumerate}: Added.} +% +% \codehtml +% \begin{macrocode} +\LWR@ProvidesPackagePass{enumerate} +% \end{macrocode} +% +% +% \iffalse +% +% \fi +% +% +% +% +% +% \clearpage +% +% \iffalse +%<*enumitem> +% \fi +% +% \part{lwarp-enumitem.sty} % -% \limitsenumerate +% \section{Enumitem} +% \label{sec:enumitem} +% +% \DescribePackage{enumitem} +% \pkg{enumitem} is supported with minor adjustments. % -% \changes{v0.22}{2017/03/02}{\pkg{enumerate}: Added.} +% \changes{v0.34}{2017/07/27}{\pkg{enumitem}: Added, no longer required.} % % \codehtml +% \begin{macrocode} +\LWR@ProvidesPackagePass{enumitem} +% \end{macrocode} +% +% % -% Discard all options for \pkg{lwarp-enumerate}: +% \codehtml % \begin{macrocode} -\LWR@ProvidesPackageDrop{enumerate} +\begin{warpHTML} % \end{macrocode} +% \cs{newlist} \marg{name} \marg{type} \marg{maxdepth} \\ +% \cs{renewlist} \marg{name} \marg{type} \marg{maxdepth} +% +% For \pkg{enumitem} lists, new lists must have the start and end actions assigned to +% the new environment. Renewed lists already have their actions assigned, and +% thus need no changes. % \begin{macrocode} -% \DeclareOption{shortlabels} -% { -\def\enit@shl#1{% - \ifnum\enit@type=\tw@ - \enit@toks{#1}% - \else - \def\enit@c{#1}% - \enit@first#1,\@nil\@@nil % Returns enit@toks - \fi} -% } +\let\LWR@orignewlist\newlist + +\renewcommand*{\newlist}[3]{% +\LWR@orignewlist{#1}{#2}{#3}% +\AtBeginEnvironment{#1}{\csuse{LWR@#2start}}% +\AtEndEnvironment{#1}{\csuse{LWR@#2end}}% +} % \end{macrocode} +% \begin{macrocode} +\end{warpHTML} +% \end{macrocode} + % \iffalse -% +% % \fi % % % +% +% +% % \clearpage % % \iffalse @@ -20233,183 +21095,737 @@ span style="width:\rndprintlength{\ALG@thistlm}; display:inline-block;"% \newcommand{\cleartoevenpage}[1][]{} % \end{macrocode} -% \iffalse -% -% \fi -% -% -% -% -% \iffalse -%<*eso-pic> -% \fi +% \iffalse +% +% \fi +% +% +% +% +% \iffalse +%<*eso-pic> +% \fi + +% \part{lwarp-eso-pic.sty} + +% \section{Eso-pic} +% \label{sec:eso-pic} +% +% \changes{v0.20}{2017/01/11}{\pkg{eso-pic}: Added.} +% +% \DescribePackage{eso-pic} +% \pkg{eso-pic} is emulated during \HTML\ output, and +% the \pkg{eso-pic} package is ignored. + +% \codehtml + +% \begin{macrocode} +\LWR@ProvidesPackageDrop{eso-pic} +% \end{macrocode} + +% \begin{macrocode} +\newcommand*{\LenToUnit}{} +\newcommand{\AtPageUpperLeft}[1]{} +\newcommand{\AtPageLowerLeft}[1]{} +\newcommand{\AtPageCenter}[1]{} +\newcommand{\AtStockLowerLeft}[1]{} +\newcommand{\AtStockUpperLeft}[1]{} +\newcommand{\AtStockCenter}[1]{} +\newcommand{\AtTextUpperLeft}[1]{} +\newcommand{\AtTextLowerLeft}[1]{} +\newcommand{\AtTextCenter}[1]{} +\NewDocumentCommand{\AddToShipoutPictureBG}{s +m}{} +\renewcommand{\AddToShipoutPicture}{\AddToShipoutPictureBG} +\NewDocumentCommand{\AddToShipoutPictureFG}{s +m}{} +\newcommand*{\ClearShipoutPictureBG}{} +\newcommand*{\ClearShipoutPicture}{} +\newcommand*{\ClearShipoutPictureFG}{} +\newcommand{\gridSetup}[6][]{} +% \end{macrocode} + +% \iffalse +% +% \fi +% +% +% +% \clearpage +% +% \iffalse +%<*everypage> +% \fi + +% \part{lwarp-everypage.sty} + +% \section{Everypage} +% \label{sec:everypage} +% +% \changes{v0.20}{2017/01/11}{\pkg{everypage}: Added.} +% +% \DescribePackage{everypage} +% \pkg{everypage} is emulated during \HTML\ output, and +% the \pkg{everypage} package is ignored. + +% \codehtml +% \begin{macrocode} +\LWR@ProvidesPackageDrop{everypage} +% \end{macrocode} + +% \begin{macrocode} +\newcommand*{\AddEverypageHook}[1]{} +\newcommand*{\AddThispageHook}[1]{} +% \end{macrocode} + +% \iffalse +% +% \fi +% +% +% +% +% \clearpage +% +% \iffalse +%<*everyshi> +% \fi +% +% \part{lwarp-everyshi.sty} +% +% \section{Everyshi} +% +% \DescribePackage{everyshi} Emulated. +% +% \changes{v0.34}{2017/08/03}{\pkg{everyshi}: Added.} +% +% \codehtml +% +% Discard all options for \pkg{lwarp-everyshi}: +% \begin{macrocode} +\LWR@ProvidesPackageDrop{everyshi} +% \end{macrocode} +% +% \begin{macrocode} +\newcommand*{\EveryShipout}[1]{} +\newcommand*{\AtNextShipout}[1]{} +% \end{macrocode} +% +% \iffalse +% +% \fi +% +% +% +% +% +% +% \iffalse +%<*extramarks> +% \fi + +% \part{lwarp-extramarks.sty} + +% \section{Extramarks} +% +% \DescribePackage{extramarks} +% \pkg{extramarks} is not used. +% +% \changes{v0.20}{2017/01/11}{\pkg{extramarks}: Added.} +% +% \codehtml +% +% Discard all options for \pkg{lwarp-extramarks}: +% \begin{macrocode} +\LWR@ProvidesPackageDrop{extramarks} +% \end{macrocode} + +% \begin{macrocode} +\newcommand*{\extramarks}[2]{} +\newcommand*{\firstleftxmark}{} +\newcommand*{\lastleftxmark}{} +\newcommand*{\firstrightxmark}{} +\newcommand*{\lastrightxmark}{} +\newcommand*{\firstxmark}{} +\newcommand*{\lastxmark}{} +\newcommand*{\topxmark}{} +\newcommand*{\topleftxmark}{} +\newcommand*{\firstleftmark}{} +\newcommand*{\lastrightmark}{} +% \end{macrocode} + +% \iffalse +% +% \fi +% +% +% +% +% \clearpage +% +% \iffalse +%<*fancybox> +% \fi +% +% \part{lwarp-fancybox.sty} +% +% \section{Fancybox} +% \label{sec:fancybox} +% +% \credits{Timothy Van Zandt} +% +% \DescribePackage{fancybox} +% \pkg{fancybox} is supported with some patches. +% +% \limitsfancybox +% +% +% \changes{v0.34}{2017/07/27}{\pkg{fancybox}: Added.} +% +% \codehtml +% \begin{macrocode} +\begin{warpHTML} +% \end{macrocode} +% +% \begin{macrocode} +\LWR@ProvidesPackagePass{fancybox} +% \end{macrocode} +% +% +% +% \begin{macrocode} +\renewcommand*{\@shadowbox}[1]{\InlineClass{shadowbox}{#1}} + +\renewcommand*{\@doublebox}[1]{\InlineClass{doublebox}{#1}} + +\renewcommand*{\@ovalbox}[2]{% +\ifthenelse{\isequivalentto{#1}{\thinlines}} +{\InlineClass{ovalbox}{#2}} +{\InlineClass{Ovalbox}{#2}} +} +% \end{macrocode} +% +% +% Convert minipages, parboxes, and lists into linear text +% using the |LWR@nestspan| environment: +% \begin{macrocode} +\let\LWR@origSbox\Sbox + +\def\Sbox{\LWR@origSbox\LWR@nestspan} + + +\let\LWR@origendSbox\endSbox + +\def\endSbox{\endLWR@nestspan\LWR@origendSbox} +% \end{macrocode} +% +% \env{Beqnarray} is adapted for MathJax or enclosed inside a \env{lateximage}: +% +% \begin{macrocode} +\RenewEnviron{Beqnarray} +{\LWR@eqnarrayfactor} + +\csgpreto{Beqnarray*}{\boolfalse{LWR@numbereqnarray}} +% \end{macrocode} +% +% \cs{GenericCaption} is enclosed in an \HTML\ block: +% +% \begin{macrocode} +\renewcommand{\GenericCaption}[1]{% +\LWR@htmlblocktag{figcaption}% +#1% +\LWR@htmlblocktag{/figcaption}% +} +% \end{macrocode} +% +% \env{Btrivlist} is enclosed in an \HTML\ block: +% +% \begin{macrocode} +\RenewDocumentEnvironment{Btrivlist}{m o} +{\begin{BlockClass}{Btrivlist}\tabular{#1}} +{\endtabular\end{BlockClass}} +% \end{macrocode} +% +% \env{Btrivlist} is also neutralized when used inside a span: +% +% \begin{macrocode} +\AtBeginEnvironment{LWR@nestspan}{% +\RenewDocumentEnvironment{Btrivlist}{m o}{}{}% +\RenewDocumentCommand{\LWR@origitem}{d()}{\LWRFB@origitem}% +} +% \end{macrocode} +% +% \pkg{lwarp}'s handling of \cs{item} is patched to accept +% \pkg{fancybox}'s optional arguments: +% +% \begin{macrocode} +\let\LWRFB@origitemizeitem\LWR@itemizeitem +\let\LWRFB@origdescitem\LWR@descitem +\LetLtxMacro{\LWRFB@origitem}{\LWR@origitem} + +\RenewDocumentCommand{\LWR@itemizeitem}{d()}{\LWRFB@origitemizeitem} +\RenewDocumentCommand{\LWR@descitem}{d()}{\LWRFB@origdescitem} +% \end{macrocode} +% +% The various boxed lists become regular lists: +% +% \begin{macrocode} +\renewenvironment{Bitemize}[1][]{\begin{itemize}}{\end{itemize}} +\renewenvironment{Benumerate}[1][]{\begin{enumerate}}{\end{enumerate}} +\renewenvironment{Bdescription}[1][]{\begin{description}}{\end{description}} +% \end{macrocode} +% +% \cs{boxput} simply prints one then the other argument, +% side-by-side instead of above and behind: +% +% \begin{macrocode} +\RenewDocumentCommand{\boxput}{s d() m m}{% +\IfBooleanTF{#1}{#3\quad#4}{#4\quad#3}% +} +% \end{macrocode} +% +% Neutralized commands: +% +% \begin{macrocode} +\RenewDocumentCommand{\fancyput}{s d() m}{} +\RenewDocumentCommand{\thisfancyput}{s d() m}{} + +\RenewDocumentCommand{\fancypage}{m m}{} +\RenewDocumentCommand{\thisfancypage}{m m}{} + +\def\LandScape#1{} +\def\endLandScape{} +\def\@Landscape#1#2#3{} +\def\endLandscape{} +% \end{macrocode} +% +% Low-level patches for \env{Verbatim}, \env{VerbatimInput}, \env{UseVerbatim}: +% +% \begin{macrocode} +\let\LWRFB@UseVerbatim\UseVerbatim +\renewcommand*{\UseVerbatim}[1]{% +\LWR@atbeginverbatim{Verbatim}\unskip\LWR@origvspace*{-\baselineskip}%% +\LWRFB@UseVerbatim{#1}% +\LWR@afterendverbatim% +} + +\let\LWRFB@LUseVerbatim\LUseVerbatim + +\renewcommand*{\LUseVerbatim}[1]{% +\LWR@atbeginverbatim{LVerbatim}\unskip\LWR@origvspace*{-\baselineskip}%% +\LWRFB@LUseVerbatim{#1}% +\LWR@afterendverbatim% +} + +\def\@BUseVerbatim[#1]#2{% +\LWR@atbeginverbatim{BVerbatim}\unskip\LWR@origvspace*{-\baselineskip}%% +\LWRFB@UseVerbatim{#2}% +\LWR@afterendverbatim% +} +% \end{macrocode} +% +% \begin{macrocode} +\end{warpHTML} +% \end{macrocode} +% +% \iffalse +% +% \fi +% +% +% +% +% +% +% \iffalse +%<*fancyhdr> +% \fi + +% \part{lwarp-fancyhdr.sty} + +% \section{Fancyhdr} +% +% \DescribePackage{fancyhdr} +% \pkg{fancyhdr} is nullified. +% +% \changes{v0.20}{2017/01/11}{\pkg{fancyhdr}: Added.} +% \changes{v0.33}{2017/06/18}{\pkg{fancyhdr}: Fix: Optional args for \cs{lhead}, etc.} +% +% \codehtml +% +% Discard all options for \pkg{lwarp-fancyhdr}: +% \begin{macrocode} +\LWR@ProvidesPackageDrop{fancyhdr} +% \end{macrocode} + +% \begin{macrocode} +\newcommand*{\fancyhead}[2][]{} +\newcommand*{\fancyfoot}[2][]{} +\newcommand*{\fancyhf}[2][]{} +\newcommand*{\fancypagestyle}[2]{} +\newcommand*{\lhead}[2][]{} +\newcommand*{\chead}[2][]{} +\newcommand*{\rhead}[2][]{} +\newcommand*{\lfoot}[2][]{} +\newcommand*{\cfoot}[2][]{} +\newcommand*{\rfoot}[2][]{} +\newcommand*{\headrulewidth}{} +\newcommand*{\footrulewidth}{} +\newcommand*{\fancyheadoffset}[2][]{} +\newcommand*{\fancyfootoffset}[2][]{} +\newcommand*{\fancyhfoffset}[2][]{} +\newcommand*{\iffloatpage}[2]{#2} +\newcommand*{\ifftopfloat}[2]{#2} +\newcommand*{\iffbotfloat}[2]{#2} +% \end{macrocode} + +% \iffalse +% +% \fi +% +% +% +% +% +% +% \clearpage +% +% \iffalse +%<*fancyvrb> +% \fi +% +% \part{lwarp-fancyvrb.sty} +% +% \section{Fancyvrb} +% \label{sec:fancyvrb} +% +% \credits{Timothy Van Zandt} +% +% \DescribePackage{fancyvrb} +% \pkg{fancyvrb} is supported with some patches. +% +% +% \changes{v0.34}{2017/07/27}{\pkg{fancyvrb}: Added, no longer required.} +% +% \codehtml +% \begin{macrocode} +\RequirePackage{xcolor}% for \convertcolorspec +\LWR@ProvidesPackagePass{fancyvrb} +% \end{macrocode} +% + +% \codehtml +% \begin{macrocode} +\begin{warpHTML} +% \end{macrocode} +% + +% Initial default patch for fancyvrb: +% \begin{macrocode} +\fvset{frame=none}% +% \end{macrocode} + +% For \cs{VerbatimFootnotes}: +% \begin{macrocode} +\renewcommand{\VerbatimFootnotes}{ +\PackageError{lwarp} +{Verbatim footnotes are not yet supported by lwarp.} +{This may be improved some day.} +} +% \end{macrocode} + + +% After the preamble is loaded, after any patches to \env{Verbatim}: +% \begin{macrocode} +\AfterEndPreamble{ +\LWR@traceinfo{Patching Verbatim.} +% \end{macrocode} +% +% Remember the original defintion of \env{Verbatim}: +% \begin{macrocode} +\let\LWRFV@origVerbatim\Verbatim +% \end{macrocode} +% +% +% \begin{environment}{Verbatim} +% +% Patched to place the environment in a |fancyvrb| div, +% and the label in a |fancyvrblabel| div. +% Also corrects the left margin for line numbers. +% Also uses |VerbatimHTMLWidth| to control placement of line numbers on the right. +% Aligning the right margin requires knowing the width. +% +% \changes{v0.20}{2016/12/24}{Added.} +% +% \begin{macrocode} +\renewcommand*{\Verbatim}{% +\LWR@forcenewpage +\LWRFV@origVerbatim% +} +% \end{macrocode} +% \end{environment} +% +% \begin{macro}{\LWR@FVstyle} Holds the style of the verbatim. +% \begin{macrocode} +\newcommand*{\LWR@FVstyle}{} +% \end{macrocode} +% \end{macro} +% +% The following patches to \env{Verbatim} are executed at the +% start and end of the environment, depending on the choice of |frame|. +% Original code is from the \pkg{fancyvrb} package. +% \begin{macrocode} +\newcommand*{\LWR@fvstartnone}{% +\LWR@traceinfo{fvstartnone}% +\hbox to\z@{\LWR@atbeginverbatim[\LWR@FVstyle]{verbatim}}% +} + +\newcommand*{\LWR@fvendnone}{% +\LWR@traceinfo{fvendnone}% +\hbox to\z@{\LWR@afterendverbatim}% +} + +\newcommand*{\LWR@fvstartsingle}{% +\LWR@traceinfo{fvstartsingle}% +\LWR@fvstartnone% +\FV@BeginListFrame@Single% +} + +\newcommand*{\LWR@fvendsingle}{% +\LWR@traceinfo{fvendsingle}% +\FV@EndListFrame@Single% +\LWR@fvendnone% +} + +\newcommand*{\LWR@fvstartline}{% +\LWR@traceinfo{fvstartline}% +\LWR@fvstartnone% +\FV@BeginListFrame@Lines% +} + +\newcommand*{\LWR@fvendline}{% +\LWR@traceinfo{fvendline}% +\FV@EndListFrame@Lines% +\LWR@fvendnone% +} +% \end{macrocode} +% +% The following patches select the start/left/right/end +% behaviors depending on |frame|. +% Original code is from the \pkg{fancyvrb} package. +% \begin{macrocode} + +\newcommand*{\LWR@FVfindcurrentcolor}{% +\protect\colorlet{LWR@current@color}{.}% +\protect\convertcolorspec{named}{LWR@current@color}{HTML}\LWR@tempcolor% +} + +\newcommand*{\LWR@FVtextstyle}{% +\LWR@FVfindcurrentcolor +\ifdefstring{\LWR@tempcolor}{000000}% +{}% +{color: \#\LWR@tempcolor ; }% +} + + +\newcommand*{\LWR@FVfindbordercolor}{% +\FancyVerbRuleColor% +\LWR@FVfindcurrentcolor +\color{black} +} -% \part{lwarp-eso-pic.sty} +% border width of \FV@FrameRule +\newcommand*{\LWR@FVborderstyle}[1]{% +padding#1: \strip@pt\dimexpr \FV@FrameSep\relax\relax pt ; +\LWR@FVfindbordercolor +border#1: \strip@pt\dimexpr \FV@FrameRule\relax\relax pt solid \#\LWR@tempcolor ; +} -% \section{Eso-pic} -% \label{sec:eso-pic} -% -% \changes{v0.20}{2017/01/11}{\pkg{eso-pic}: Added.} -% -% \DescribePackage{eso-pic} -% \pkg{eso-pic} is emulated during \HTML\ output, and -% the \pkg{eso-pic} package is ignored. +\def\FV@Frame@none{% +\renewcommand*{\LWR@FVstyle}{\LWR@FVtextstyle}% +\let\FV@BeginListFrame\LWR@fvstartnone% +\let\FV@LeftListFrame\relax% +\let\FV@RightListFrame\relax% +\let\FV@EndListFrame\LWR@fvendnone} -% \codehtml +\FV@Frame@none% default values -% \begin{macrocode} -\LWR@ProvidesPackageDrop{eso-pic} -% \end{macrocode} +\def\FV@Frame@single{% +\renewcommand*{\LWR@FVstyle}{\LWR@FVtextstyle\LWR@FVborderstyle{}}% +\let\FV@BeginListFrame\LWR@fvstartsingle% +\let\FV@LeftListFrame\FV@LeftListFrame@Single% +\let\FV@RightListFrame\FV@RightListFrame@Single% +\let\FV@EndListFrame\LWR@fvendsingle} -% \begin{macrocode} -\newcommand*{\LenToUnit}{} -\newcommand{\AtPageUpperLeft}[1]{} -\newcommand{\AtPageLowerLeft}[1]{} -\newcommand{\AtPageCenter}[1]{} -\newcommand{\AtStockLowerLeft}[1]{} -\newcommand{\AtStockUpperLeft}[1]{} -\newcommand{\AtStockCenter}[1]{} -\newcommand{\AtTextUpperLeft}[1]{} -\newcommand{\AtTextLowerLeft}[1]{} -\newcommand{\AtTextCenter}[1]{} -\NewDocumentCommand{\AddToShipoutPictureBG}{s +m}{} -\let\AddToShipoutPicture\AddToShipoutPictureBG -\NewDocumentCommand{\AddToShipoutPictureFG}{s +m}{} -\newcommand*{\ClearShipoutPictureBG}{} -\newcommand*{\ClearShipoutPicture}{} -\newcommand*{\ClearShipoutPictureFG}{} -\newcommand{\gridSetup}[6][]{} -% \end{macrocode} +\def\FV@Frame@lines{% +\renewcommand*{\LWR@FVstyle}{\LWR@FVtextstyle\LWR@FVborderstyle{-top}\LWR@FVborderstyle{-bottom}}% +\let\FV@BeginListFrame\LWR@fvstartline% +\let\FV@LeftListFrame\relax% +\let\FV@RightListFrame\relax% +\let\FV@EndListFrame\LWR@fvendline} -% \iffalse -% -% \fi -% -% -% -% \clearpage -% -% \iffalse -%<*everypage> -% \fi +\def\FV@Frame@topline{% +\renewcommand*{\LWR@FVstyle}{\LWR@FVtextstyle\LWR@FVborderstyle{-top}}% +\let\FV@BeginListFrame\LWR@fvstartline% +\let\FV@LeftListFrame\relax% +\let\FV@RightListFrame\relax% +\let\FV@EndListFrame\LWR@fvendnone} -% \part{lwarp-everypage.sty} +\def\FV@Frame@bottomline{% +\renewcommand*{\LWR@FVstyle}{\LWR@FVtextstyle\LWR@FVborderstyle{-bottom}}% +\let\FV@BeginListFrame\LWR@fvstartnone% +\let\FV@LeftListFrame\relax% +\let\FV@RightListFrame\relax% +\let\FV@EndListFrame\LWR@fvendline} -% \section{Everypage} -% \label{sec:everypage} -% -% \changes{v0.20}{2017/01/11}{\pkg{everypage}: Added.} +\def\FV@Frame@leftline{% +\renewcommand*{\LWR@FVstyle}{\LWR@FVtextstyle\LWR@FVborderstyle{-left}}% +% To define the \FV@FrameFillLine macro (from \FV@BeginListFrame) +\ifx\FancyVerbFillColor\relax% +\let\FV@FrameFillLine\relax% +\else% +\@tempdima\FV@FrameRule\relax% +\multiply\@tempdima-\tw@% +\edef\FV@FrameFillLine{% +{\noexpand\FancyVerbFillColor{\vrule\@width\number\@tempdima sp}% +\kern-\number\@tempdima sp}}% +\fi% +\let\FV@BeginListFrame\LWR@fvstartnone% +\let\FV@LeftListFrame\FV@LeftListFrame@Single% +\let\FV@RightListFrame\relax% +\let\FV@EndListFrame\LWR@fvendnone} +% \end{macrocode} % -% \DescribePackage{everypage} -% \pkg{everypage} is emulated during \HTML\ output, and -% the \pkg{everypage} package is ignored. +% Adds the optional label to the top and bottom edges. +% Original code is from the \pkg{fancyvrb} package. +% \begin{macrocode} +\def\FV@SingleFrameLine#1{% + \hbox to\z@{% +% \kern\leftmargin + \ifnum#1=\z@\relax + \let\FV@Label\FV@LabelBegin + \else + \let\FV@Label\FV@LabelEnd + \fi + \ifx\FV@Label\relax +% \FancyVerbRuleColor{\vrule \@width\linewidth \@height\FV@FrameRule}% + \else + \ifnum#1=\z@ +% \setbox\z@\hbox{\strut\enspace\FV@LabelBegin\enspace\strut}% + \ifx\FV@LabelPositionTopLine\relax + \else + \LWR@FVfindbordercolor + \LWR@htmltagc{div class="fancyvrblabel" style="color: \#\LWR@tempcolor"} + \LWR@origtextrm{\FV@LabelBegin}% \textrm preserves emdash + \LWR@htmltagc{/div} + \fi + \else +% \setbox\z@\hbox{\strut\enspace\FV@LabelEnd\enspace\strut}% + \ifx\FV@LabelPositionBottomLine\relax + \else + \LWR@FVfindbordercolor + \LWR@htmltagc{div class="fancyvrblabel" style="color: \#\LWR@tempcolor"} + \LWR@origtextrm{\FV@LabelEnd} + \LWR@htmltagc{/div} + \fi + \fi -% \codehtml + \fi + \hss + } +} +% \end{macrocode} +% +% Processes each line, adding optional line numbers. +% Original code is from the \pkg{fancyvrb} package. % \begin{macrocode} -\LWR@ProvidesPackageDrop{everypage} +\def\FV@ListProcessLine#1{% + \hbox to \hsize{% +% \kern\leftmargin + \hbox to \VerbatimHTMLWidth {% + \ifcsvoid{FV@LeftListNumber}{}{\kern 2.5em}% + \FV@LeftListNumber% +% \FV@LeftListFrame + \FancyVerbFormatLine{#1}% + \hss% +% \FV@RightListFrame + \FV@RightListNumber% + }% + \hss% required to avoid underfull hboxes +} +} % \end{macrocode} +% \begin{environment}{BVerbatim} % \begin{macrocode} -\newcommand*{\AddEverypageHook}[1]{} -\newcommand*{\AddThispageHook}[1]{} -% \end{macrocode} +\AtBeginEnvironment{BVerbatim} +{ +\LWR@forcenewpage +\LWR@atbeginverbatim{bverbatim} -% \iffalse -% -% \fi -% -% -% \iffalse -%<*extramarks> -% \fi +} -% \part{lwarp-extramarks.sty} +\AfterEndEnvironment{BVerbatim} +{ +\leavevmode\par\LWR@origvspace{-\baselineskip} +\LWR@afterendverbatim +} +% \end{macrocode} +% \end{environment} -% \section{Extramarks} -% -% \DescribePackage{extramarks} -% \pkg{extramarks} is not used. -% -% \changes{v0.20}{2017/01/11}{\pkg{extramarks}: Added.} -% -% \codehtml -% -% Discard all options for \pkg{lwarp-extramarks}: +% End of the modifications to make at the end of the preamble: % \begin{macrocode} -\LWR@ProvidesPackageDrop{extramarks} +} % \AfterEndPreamble % \end{macrocode} % \begin{macrocode} -\newcommand*{\extramarks}[2]{} -\newcommand*{\firstleftxmark}{} -\newcommand*{\lastleftxmark}{} -\newcommand*{\firstrightxmark}{} -\newcommand*{\lastrightxmark}{} -\newcommand*{\firstxmark}{} -\newcommand*{\lastxmark}{} -\newcommand*{\topxmark}{} -\newcommand*{\topleftxmark}{} -\newcommand*{\firstleftmark}{} -\newcommand*{\lastrightmark}{} +\end{warpHTML} % \end{macrocode} - +% % \iffalse -% +% % \fi % % % +% +% % \clearpage % % \iffalse -%<*fancyhdr> +%<*figcaps> % \fi - -% \part{lwarp-fancyhdr.sty} - -% \section{Fancyhdr} % -% \DescribePackage{fancyhdr} -% \pkg{fancyhdr} is nullified. +% \part{lwarp-figcaps.sty} % -% \changes{v0.20}{2017/01/11}{\pkg{fancyhdr}: Added.} -% \changes{v0.33}{2017/06/18}{\pkg{fancyhdr}: Fix: Optional args for \cs{lhead}, etc.} +% \section{Figcaps} +% +% \DescribePackage{figcaps} Emulated. +% +% \changes{v0.34}{2017/07/27}{\pkg{figcaps}: Added.} % % \codehtml % -% Discard all options for \pkg{lwarp-fancyhdr}: +% Discard all options for \pkg{lwarp-figcaps}: % \begin{macrocode} -\LWR@ProvidesPackageDrop{fancyhdr} +\LWR@ProvidesPackageDrop{figcaps} % \end{macrocode} - +% % \begin{macrocode} -\newcommand*{\fancyhead}[2][]{} -\newcommand*{\fancyfoot}[2][]{} -\newcommand*{\fancyhf}[2][]{} -\newcommand*{\fancypagestyle}[2]{} -\newcommand*{\lhead}[2][]{} -\newcommand*{\chead}[2][]{} -\newcommand*{\rhead}[2][]{} -\newcommand*{\lfoot}[2][]{} -\newcommand*{\cfoot}[2][]{} -\newcommand*{\rfoot}[2][]{} -\newcommand*{\headrulewidth}{} -\newcommand*{\footrulewidth}{} -\newcommand*{\fancyheadoffset}[2][]{} -\newcommand*{\fancyfootoffset}[2][]{} -\newcommand*{\fancyhfoffset}[2][]{} -\newcommand*{\iffloatpage}[2]{#2} -\newcommand*{\ifftopfloat}[2]{#2} -\newcommand*{\iffbotfloat}[2]{#2} +\newcommand*{\figcapson}{} +\newcommand*{\figcapsoff}{} +\newcommand*{\printfigures}{} +\newcommand*{\figmarkon}{} +\newcommand*{\figmarkoff}{} +\def\figurecapname{Figure Captions} +\def\tablepagename{Tables} +\def\figurepagename{Figures} % \end{macrocode} - +% % \iffalse -% +% % \fi % % % -% % \clearpage % % \iffalse @@ -20448,9 +21864,7 @@ span style="width:\rndprintlength{\ALG@thistlm}; display:inline-block;"% % \begin{macrocode} \NewDocumentCommand{\newfloat}{m m m o}{% \IfValueTF{#4} -{ -\DeclareFloatingEnvironment[fileext=#3,within=#4]{#1} -} +{\DeclareFloatingEnvironment[fileext=#3,within=#4]{#1}} {\DeclareFloatingEnvironment[fileext=#3]{#1}} % \end{macrocode} % \pkg{newfloat} package automatically creates the \cs{listof} command @@ -20558,9 +21972,42 @@ span style="width:\rndprintlength{\ALG@thistlm}; display:inline-block;"% % \end{macrocode} % % \iffalse -% +% +% \fi +% +% +% +% +% \clearpage +% +% \iffalse +%<*floatpag> % \fi % +% \part{lwarp-floatpag.sty} +% +% \section{Floatpag} +% +% \DescribePackage{floatpag} Emulated. +% +% \changes{v0.34}{2017/08/03}{\pkg{floatpag}: Added.} +% +% \codehtml +% +% Discard all options for \pkg{lwarp-floatpag}: +% \begin{macrocode} +\LWR@ProvidesPackageDrop{floatpag} +% \end{macrocode} +% +% \begin{macrocode} +\newcommand*{\floatpagestyle}[1]{} +\newcommand*{\rotfloatpagestyle}[1]{} +\newcommand*{\thisfloatpagestyle}[1]{} +% \end{macrocode} +% +% \iffalse +% +% \fi % % % @@ -20747,7 +22194,7 @@ span style="width:\rndprintlength{\ALG@thistlm}; display:inline-block;"% % ^^A \begin{environment}{floatrow} \oarg{numfloats} % \changes{v0.20}{2016/08/20}{Fix: \cs{linewidth} in a floatrow.} % -% The row of floats is placed into a \tag{div} of class |floatrow|. +% The row of floats is placed into a \element{div} of class |floatrow|. % \begin{macrocode} \newenvironment*{floatrow}[1][2] { @@ -20853,7 +22300,7 @@ span style="width:\rndprintlength{\ALG@thistlm}; display:inline-block;"% % ^^A \begin{macro}{\floatfoot} \marg{text} % % Places additional text inside a float, -% inside a \CSS\ \tag{div} of class |floatfoot|. +% inside a \CSS\ \element{div} of class |floatfoot|. % \begin{macrocode} \NewDocumentCommand{\floatfoot}{s +m}{% \begin{BlockClass}{floatfoot} @@ -20877,7 +22324,7 @@ span style="width:\rndprintlength{\ALG@thistlm}; display:inline-block;"% \newenvironment*{subfloatrow}[1][2] { % \end{macrocode} -% The row of floats is placed into a \tag{div} of class |floatrow|: +% The row of floats is placed into a \element{div} of class |floatrow|: % \begin{macrocode} \LWR@forcenewpage \BlockClass{floatrow} @@ -20902,6 +22349,48 @@ span style="width:\rndprintlength{\ALG@thistlm}; display:inline-block;"% % % % +% +% +% \clearpage +% +% \iffalse +%<*flushend> +% \fi +% +% \part{lwarp-flushend.sty} +% +% \section{Flushend} +% +% \DescribePackage{flushend} Emulated. +% +% \changes{v0.34}{2017/07/27}{\pkg{flushend}: Added.} +% +% \codehtml +% +% Discard all options for \pkg{lwarp-flushend}: +% \begin{macrocode} +\LWR@ProvidesPackageDrop{flushend} +% \end{ma-crocode} +% +% \begin{macrocode} +\newcommand*{\flushend}{} +\newcommand*{\raggedend}{} +\newcommand*{\flushcolsend}{} +\newcommand*{\raggedcolsend}{} +\newcommand*{\atColsBreak}[1]{} +\newcommand*{\atColsEnd}[1]{} +\newcommand*{\showcolsendrule}{} +% \end{macrocode} +% +% \iffalse +% +% \fi +% +% +% +% +% +% % \clearpage % % \iffalse @@ -20968,6 +22457,8 @@ span style="width:\rndprintlength{\ALG@thistlm}; display:inline-block;"% % % % +% \clearpage +% % \iffalse %<*footmisc> % \fi @@ -21091,7 +22582,7 @@ span style="width:\rndprintlength{\ALG@thistlm}; display:inline-block;"% \begingroup% \let\@makefntext\@empty% \let\@finalstrut\@gobble% - \let\rule\@gobbletwo% + \LetLtxMacro\rule\@gobbletwo% *8* also the optional argument? \@footnotetext{\unvbox\z@}% \endgroup% } @@ -21165,6 +22656,7 @@ span style="width:\rndprintlength{\ALG@thistlm}; display:inline-block;"% % Accept all options for \pkg{lwarp-framed}: % \begin{macrocode} \LWR@ProvidesPackagePass{framed} +\RequirePackage{xcolor}% for \convertcolorspec % \end{macrocode} @@ -21186,14 +22678,14 @@ span style="width:\rndprintlength{\ALG@thistlm}; display:inline-block;"% \renewenvironment{shaded}{% \convertcolorspec{named}{shadecolor}{HTML}\LWR@tempcolor% \LWR@forcenewpage -\BlockClass{framed}[background: \#\LWR@tempcolor]% +\BlockClass[background: \#\LWR@tempcolor]{framed}% } {\endBlockClass} \renewenvironment{shaded*}{% \convertcolorspec{named}{shadecolor}{HTML}\LWR@tempcolor% \LWR@forcenewpage -\BlockClass{framed}[background: \#\LWR@tempcolor]% +\BlockClass[background: \#\LWR@tempcolor]{framed}% } {\endBlockClass} @@ -21210,14 +22702,14 @@ span style="width:\rndprintlength{\ALG@thistlm}; display:inline-block;"% \renewenvironment{snugshade}{% \convertcolorspec{named}{shadecolor}{HTML}\LWR@tempcolor% \LWR@forcenewpage -\BlockClass{snugframed}[background: \#\LWR@tempcolor]% +\BlockClass[background: \#\LWR@tempcolor]{snugframed}% } {\endBlockClass} \renewenvironment{snugshade*}{% \convertcolorspec{named}{shadecolor}{HTML}\LWR@tempcolor% \LWR@forcenewpage -\BlockClass{snugframed}[background: \#\LWR@tempcolor]% +\BlockClass[background: \#\LWR@tempcolor]{snugframed}% } {\endBlockClass} @@ -21239,9 +22731,9 @@ span style="width:\rndprintlength{\ALG@thistlm}; display:inline-block;"% \renewcommand{\CustomFBox}[7]{% \convertcolorspec{named}{TFFrameColor}{HTML}\LWR@tempcolor% \LWR@forcenewpage -\begin{BlockClass}{framed}[border: 3px solid \#\LWR@tempcolor]% +\begin{BlockClass}[border: 3px solid \#\LWR@tempcolor]{framed}% \ifthenelse{\isempty{#1}}{}{% not empty -\begin{BlockClass}{framedtitle}[background: \#\LWR@tempcolor]% +\begin{BlockClass}[background: \#\LWR@tempcolor]{framedtitle}% \textcolor{TFTitleColor}{\textbf{#1}}% \end{BlockClass} }% not empty @@ -21250,7 +22742,7 @@ span style="width:\rndprintlength{\ALG@thistlm}; display:inline-block;"% \ifthenelse{\isempty{#2}}{}{% not empty \convertcolorspec{named}{TFFrameColor}{HTML}\LWR@tempcolor% -\begin{BlockClass}{framedtitle}[background: \#\LWR@tempcolor]% +\begin{BlockClass}[background: \#\LWR@tempcolor]{framedtitle}% \textcolor{TFTitleColor}{\textbf{#2}}% \end{BlockClass} }% not empty @@ -21329,6 +22821,37 @@ span style="width:\rndprintlength{\ALG@thistlm}; display:inline-block;"% % % % +% +% +% +% \iffalse +%<*fullpage> +% \fi +% +% \part{lwarp-fullpage.sty} +% +% \section{Fullpage} +% +% \DescribePackage{fullpage} Emulated. +% +% \changes{v0.34}{2017/07/27}{\pkg{fullpage}: Added.} +% +% \codehtml +% +% Discard all options for \pkg{lwarp-fullpage}: +% \begin{macrocode} +\LWR@ProvidesPackageDrop{fullpage} +% \end{macrocode} +% +% +% \iffalse +% +% \fi +% +% +% +% \clearpage +% % \iffalse %<*geometry> % \fi @@ -21790,6 +23313,88 @@ span style="width:\rndprintlength{\ALG@thistlm}; display:inline-block;"% % % % +% +% \clearpage +% +% \iffalse +%<*hyperxmp> +% \fi +% +% \part{lwarp-hyperxmp.sty} +% +% \section{Hyperxmp} +% +% \DescribePackage{hyperxmp} Emulated. +% +% \changes{v0.34}{2017/08/03}{\pkg{hyperxmp}: Added.} +% +% \codehtml +% +% Discard all options for \pkg{lwarp-hyperxmp}: +% \begin{macrocode} +\LWR@ProvidesPackageDrop{hyperxmp} +% \end{macrocode} +% +% +% \iffalse +% +% \fi +% +% +% +% +% \clearpage +% +% \iffalse +%<*idxlayout> +% \fi +% +% \part{lwarp-idxlayout.sty} +% +% \section{Idxlayout} +% +% \DescribePackage{idxlayout} Emulated. +% +% \changes{v0.34}{2017/07/27}{\pkg{idxlayout}: Added.} +% +% \codehtml +% +% Discard all options for \pkg{lwarp-idxlayout}: +% \begin{macrocode} +\LWR@ProvidesPackageDrop{idxlayout} +% \end{macrocode} +% +% \begin{macrocode} +\newcommand{\LWR@indexprenote}{} + +\renewcommand*{\printindex} +{ +\LWR@indexsection +\LWR@startpars + +\LWR@indexprenote + +\LWR@origprintindex +} + +\newcommand{\setindexprenote}[1]{\renewcommand{\LWR@indexprenote}{#1}} +\newcommand*{\noindexprenote}{\renewcommand{\LWR@indexprenote}{}} + +\newcommand{\idxlayout}[1]{} +\newcommand*{\indexfont}{} +\newcommand*{\indexjustific}{} +\newcommand*{\indexsubsdelim}{} +\newcommand*{\indexstheadcase}{} +% \end{macrocode} +% +% \iffalse +% +% \fi +% +% +% +% \clearpage +% % \iffalse %<*indentfirst> % \fi @@ -22099,8 +23704,8 @@ span style="width:\rndprintlength{\ALG@thistlm}; display:inline-block;"% \LWR@ProvidesPackageDrop{lettrine} % \end{macrocode} % -% The initial letter is in a \tag{span} of class |lettrine|, and the following -% text is in a \tag{span} of class |lettrinetext|. +% The initial letter is in a \element{span} of class |lettrine|, and the following +% text is in a \element{span} of class |lettrinetext|. % \cs{lettrine} \oarg{keys} \marg{letter} \marg{additional text} % \begin{macrocode} \DeclareDocumentCommand{\lettrine}{o m m}{% @@ -22253,7 +23858,7 @@ span style="width:\rndprintlength{\ALG@thistlm}; display:inline-block;"% % Creating a display. % % Disable line numbers, -% produce the |
|, then
+% produce the \element{pre}, then
 % reenable line numbers.
 %    \begin{macrocode}
 \LWR@traceinfo{About to create verbatim.}%
@@ -22264,7 +23869,7 @@ span style="width:\rndprintlength{\ALG@thistlm}; display:inline-block;"%
 \let\lsthk@EveryPar\LWR@origlsthkEveryPar%
 \else%
 %    \end{macrocode}
-% Inline, so open a ||
+% Inline, so open a \element{span}:
 %    \begin{macrocode}
 \ifbool{LWR@verbtags}{\LWR@htmltag{span class="inlineprogramlisting"}}{}%
 \fi%
@@ -22281,7 +23886,7 @@ span style="width:\rndprintlength{\ALG@thistlm}; display:inline-block;"%
 % Creating a display.
 %
 % Disable line numbers,
-% produce the |
|, then +% produce the \element{/pre}, then % reenable line numbers: % \begin{macrocode} \let\lsthk@EveryPar\relax% @@ -22290,7 +23895,7 @@ span style="width:\rndprintlength{\ALG@thistlm}; display:inline-block;"% \let\lsthk@EveryPar\LWR@origlsthkEveryPar% \else% % \end{macrocode} -% Inline, so create the closing ||: +% Inline, so create the closing \element{/span}: % \begin{macrocode} \ifbool{LWR@verbtags}{\noindent\LWR@htmltag{/span}}{}% \fi% @@ -22596,10 +24201,36 @@ span style="width:\rndprintlength{\ALG@thistlm}; display:inline-block;"% % % % -% % \clearpage % % \iffalse +%<*marginfit> +% \fi +% +% \part{lwarp-marginfit.sty} +% +% \section{Marginfit} +% +% \DescribePackage{marginfit} Emulated. +% +% \changes{v0.34}{2017/07/25}{\pkg{marginfit}: Added.} +% +% \codehtml +% +% Discard all options for \pkg{lwarp-marginfit}: +% \begin{macrocode} +\LWR@ProvidesPackageDrop{marginfit} +% \end{macrocode} +% +% \iffalse +% +% \fi +% +% +% +% +% +% \iffalse %<*marginfix> % \fi % @@ -22607,7 +24238,7 @@ span style="width:\rndprintlength{\ALG@thistlm}; display:inline-block;"% % % \section{Marginfix} % -% \DescribePackage{marginfix} Not used. +% \DescribePackage{marginfix} Emulated. % % \changes{v0.26}{2017/03/29}{\pkg{marginfix}: Added.} % @@ -22732,6 +24363,7 @@ span style="width:\rndprintlength{\ALG@thistlm}; display:inline-block;"% % % \codehtml % \begin{macrocode} +\RequirePackage{xcolor}% for \convertcolorspec \LWR@ProvidesPackageDrop{mdframed} % \end{macrocode} % @@ -22741,10 +24373,10 @@ span style="width:\rndprintlength{\ALG@thistlm}; display:inline-block;"% % % Environments created or encapsulated by \pkg{mdframed} are enclosed in a % \margintag{CSS classes} -% \tag{div} of class |md|, or |mdframed| otherwise. +% \element{div} of class |md|, or |mdframed| otherwise. % -% Frame titles are placed into a \tag{span} of class |mdframedtitle|. -% Subtitles are in a \tag{span} of class |mdframedsubtitle|, and likewise for subsubtitles. +% Frame titles are placed into a \element{span} of class |mdframedtitle|. +% Subtitles are in a \element{span} of class |mdframedsubtitle|, and likewise for subsubtitles. % % Pre-existing hooks are used to patch extra functions before and after the frames. % @@ -22801,7 +24433,7 @@ endinnercode={\LWR@stoppars}, % ^^A \begin{macro}{\LWR@mdframedstart} % Actions before an mdframe starts. % -% Encapsulate a frame inside a \tag{div} of the desired |class|. +% Encapsulate a frame inside a \element{div} of the desired |class|. % \begin{macrocode} \newcommand*{\LWR@mdframedstart}{% % \end{macrocode} @@ -22814,7 +24446,7 @@ endinnercode={\LWR@stoppars}, % \begin{macrocode} \uselengthunit{PT}% % \end{macrocode} -% Open a \tag{div} and with custom |class| and custom |style|: +% Open a \element{div} and with custom |class| and custom |style|: % \begin{macrocode} \LWR@htmltagc{div class="\LWR@mdthisenv" \LWR@orignewline style=" \LWR@orignewline @@ -22851,8 +24483,8 @@ box-shadow: % \env{mdframed} environment may not work with the modified \cs{hspace} and \cs{rule}, % so restore them to their originals while inside \env{mdframed}: % \begin{macrocode} -\let\hspace\LWR@orighspace% -\let\rule\LWR@origrule% +\LetLtxMacro{\hspace}{\LWR@orighspace}% +\LetLtxMacro\rule\LWR@origrule% } % \end{macrocode} % ^^A \end{macro} @@ -22860,11 +24492,11 @@ box-shadow: % ^^A \begin{macro}{\LWR@mdframedend} % Actions after an mdframe ends. % -% After closing the \tag{div}, globally restore to the default environment type: +% After closing the \element{div}, globally restore to the default environment type: % \begin{macrocode} \newcommand*{\LWR@mdframedend}{ % \end{macrocode} -% Close the custom \tag{div}: +% Close the custom \element{div}: % \begin{macrocode} \LWR@htmldivclassend{\LWR@mdthisenv} % \end{macrocode} @@ -22883,9 +24515,9 @@ box-shadow: % ^^A \begin{macro}{\mdfframedtitleenv} \marg{title} % % Encapsulation of the original which places the title -% inside a \tag{span} of class |mdframedtitle|: +% inside a \element{span} of class |mdframedtitle|: % \begin{macrocode} -\let\LWR@origmdfframedtitleenv\mdfframedtitleenv +\LetLtxMacro\LWR@origmdfframedtitleenv\mdfframedtitleenv \newlength{\LWR@titleroundcorner} @@ -22896,7 +24528,7 @@ box-shadow: % \begin{macrocode} \uselengthunit{PT}% % \end{macrocode} -% Open a \tag{span} with a custom |class| and custom |style|: +% Open a \element{span} with a custom |class| and custom |style|: % \begin{macrocode} \LWR@htmltagc{span class="mdframedtitle" \LWR@orignewline style=" \LWR@orignewline @@ -22954,7 +24586,7 @@ border-radius: % % Common code for \cs{LWR@mdfsubtitle} and \cs{LWR@mdfsubsubtitle}. % -% Encapsulate the subtitle inside a \tag{span} of class |mdframedsubtitle|: +% Encapsulate the subtitle inside a \element{span} of class |mdframedsubtitle|: % \begin{macrocode} \NewDocumentCommand{\LWR@mdfsubtitlecommon}{m o m} {% the following empty line is required @@ -22966,7 +24598,7 @@ border-radius: % \begin{macrocode} \let\par\LWR@origpar% % \end{macrocode} -% Open a \tag{span} with a custom |class| and custom |style|: +% Open a \element{span} with a custom |class| and custom |style|: % \begin{macrocode} \LWR@htmltagc{span class="mdframed#1title" style=" \LWR@orignewline @@ -23087,15 +24719,98 @@ solid % \oarg{numberedlike} \marg{caption} \oarg{within} % % Modified from the original to remember the environment. +% +% \changes{v0.34}{2017/08/05}{\pkg{mdframed}: Improved \env{mdtheorem} patch.} +% % \begin{macrocode} -\let\LWR@origmdtheorem\mdtheorem - -\DeclareDocumentCommand{\LWR@mdtheorem}{O{} m o m o}{% -\LWR@origmdtheorem[#1]{#2}[#3]{#4}[#5]% -\BeforeBeginEnvironment{#2}{\renewcommand*{\LWR@mdthisenv}{md#2}}% -} - -\let\mdtheorem\LWR@mdtheorem +\DeclareDocumentCommand{\mdtheorem}{ O{} m o m o }% + {\ifcsdef{#2}% + {\mdf@PackageWarning{Environment #2 already exits\MessageBreak}}% + {% + \IfNoValueTF {#3}% + {%#3 not given -- number relationship + \IfNoValueTF {#5}% + {%#3+#5 not given + \@definecounter{#2}% + \expandafter\xdef\csname the#2\endcsname{\@thmcounter{#2}}% + \newenvironment{#2}[1][]{% + \refstepcounter{#2}% + \ifstrempty{##1}% + {\let\@temptitle\relax}% + {% + \def\@temptitle{\mdf@theoremseparator% + \mdf@theoremspace% + \mdf@theoremtitlefont% + ##1}% + \mdf@thm@caption{#2}{{#4}{\csname the#2\endcsname}{##1}}% + }% + \begin{mdframed}[#1,frametitle={\strut#4\ \csname the#2\endcsname% + \@temptitle}]}% + {\end{mdframed}}% + \newenvironment{#2*}[1][]{% + \ifstrempty{##1}{\let\@temptitle\relax}{\def\@temptitle{:\ ##1}}% + \begin{mdframed}[#1,frametitle={\strut#4\@temptitle}]}% + {\end{mdframed}}% + }% + {%#5 given -- reset counter + \@definecounter{#2}\@newctr{#2}[#5]% + \expandafter\xdef\csname the#2\endcsname{\@thmcounter{#2}}% + \expandafter\xdef\csname the#2\endcsname{% + \expandafter\noexpand\csname the#5\endcsname \@thmcountersep% + \@thmcounter{#2}}% + \newenvironment{#2}[1][]{% + \refstepcounter{#2}% + \ifstrempty{##1}% + {\let\@temptitle\relax}% + {% + \def\@temptitle{\mdf@theoremseparator% + \mdf@theoremspace% + \mdf@theoremtitlefont% + ##1}% + \mdf@thm@caption{#2}{{#4}{\csname the#2\endcsname}{##1}}% + } + \begin{mdframed}[#1,frametitle={\strut#4\ \csname the#2\endcsname% + \@temptitle}]}% + {\end{mdframed}}% + \newenvironment{#2*}[1][]{% + \ifstrempty{##1}% + {\let\@temptitle\relax}% + {% + \def\@temptitle{\mdf@theoremseparator% + \mdf@theoremspace% + \mdf@theoremtitlefont% + ##1}% + \mdf@thm@caption{#2}{{#4}{\csname the#2\endcsname}{##1}}% + }% + \begin{mdframed}[#1,frametitle={\strut#4\@temptitle}]}% + {\end{mdframed}}% + }% + }% + {%#3 given -- number relationship + \global\@namedef{the#2}{\@nameuse{the#3}}% + \newenvironment{#2}[1][]{% + \refstepcounter{#3}% + \ifstrempty{##1}% + {\let\@temptitle\relax}% + {% + \def\@temptitle{\mdf@theoremseparator% + \mdf@theoremspace% + \mdf@theoremtitlefont% + ##1}% + \mdf@thm@caption{#2}{{#4}{\csname the#2\endcsname}{##1}}% + } + \begin{mdframed}[#1,frametitle={\strut#4\ \csname the#2\endcsname% + \@temptitle}]}% + {\end{mdframed}}% + \newenvironment{#2*}[1][]{% + \ifstrempty{##1}{\let\@temptitle\relax}{\def\@temptitle{:\ ##1}}% + \begin{mdframed}[#1,frametitle={\strut#4\@temptitle}]}% + {\end{mdframed}}% + }% + \BeforeBeginEnvironment{#2}{\renewcommand*{\LWR@mdthisenv}{md#2}}% new + \BeforeBeginEnvironment{#2*}{\renewcommand*{\LWR@mdthisenv}{md#2}}% new + }% + } % \end{macrocode} % ^^A \end{macro} % @@ -23197,6 +24912,125 @@ solid % \clearpage % % \iffalse +%<*moreverb> +% \fi +% +% \part{lwarp-moreverb.sty} +% +% \section{Moreverb} +% \label{sec:moreverb} +% +% +% \DescribePackage{moreverb} +% \pkg{moreverb} is supported with some patches. +% +% +% +% \changes{v0.34}{2017/08/02}{\pkg{moreverb}: Added.} +% +% \codehtml +% \begin{macrocode} +\begin{warpHTML} +% \end{macrocode} +% +% \begin{macrocode} +\LWR@ProvidesPackagePass{moreverb} +% \end{macrocode} +% +% +% +% \begin{macrocode} +\BeforeBeginEnvironment{verbatimtab}{% +\LWR@forcenewpage +\LWR@atbeginverbatim{Verbatim}\unskip\LWR@origvspace*{-\baselineskip}% +} +\AfterEndEnvironment{verbatimtab}{% +\LWR@afterendverbatim% +} + + +\LetLtxMacro\LWRMV@orig@verbatimtabinput\@verbatimtabinput + +\renewcommand{\@verbatimtabinput}[2][]{% +\LWR@forcenewpage +\LWR@atbeginverbatim{Verbatim}\unskip\LWR@origvspace*{-\baselineskip}% +\LWRMV@orig@verbatimtabinput[#1]{#2}% +\LWR@afterendverbatim% +} + +\BeforeBeginEnvironment{listing}{% +\LWR@forcenewpage +\LWR@atbeginverbatim{programlisting}\unskip\LWR@origvspace*{-\baselineskip}% +} + +\AfterEndEnvironment{listing}{% +% \unskip\LWR@origvspace*{-\baselineskip}% +\LWR@afterendverbatim% +} + +\BeforeBeginEnvironment{listingcont}{% +\LWR@forcenewpage +\LWR@atbeginverbatim{programlisting}\unskip\LWR@origvspace*{-\baselineskip}% +} + +\AfterEndEnvironment{listingcont}{% +% \unskip\LWR@origvspace*{-\baselineskip}% +\LWR@afterendverbatim% +} + +\renewcommand{\listinglabel}[1]{\InlineClass{listinglabel}{\the#1}} + +\def\thelisting@line{% +\@tempcnta=\listing@line% +\divide\@tempcnta\listing@step \multiply\@tempcnta\listing@step% +\ifnum\listing@line=\@ne% +\listinglabel\listing@line% +\else% +\ifnum\@tempcnta=\listing@line% +\listinglabel\listing@line% +\else% +\InlineClass{listinglabel}{}% +\fi% +\fi} + +\LetLtxMacro\LWRMV@@listinginput\@listinginput + +\renewcommand{\@listinginput}[3][]{ +\LWR@forcenewpage +\LWR@atbeginverbatim{programlisting}\unskip\LWR@origvspace*{-\baselineskip}% +\LWRMV@@listinginput[#1]{#2}{#3} +\LWR@afterendverbatim% +} + + +\renewenvironment*{boxedverbatim} +{ +\LWR@forcenewpage +\LWR@atbeginverbatim{boxedverbatim}\unskip\LWR@origvspace*{-\baselineskip}% +\verbatim% +} +{ +\endverbatim% +\LWR@afterendverbatim% +} + + +% \end{macrocode} +% +% \begin{macrocode} +\end{warpHTML} +% \end{macrocode} +% +% \iffalse +% +% \fi +% +% +% +% +% \clearpage +% +% \iffalse %<*mparhack> % \fi % @@ -23204,7 +25038,7 @@ solid % % \section{Mparhack} % -% \DescribePackage{mparhack} Not used. +% \DescribePackage{mparhack} Emulated. % % \changes{v0.26}{2017/03/29}{\pkg{mparhack}: Added.} % @@ -23245,9 +25079,9 @@ solid % Multicols are converted into a 1--3 column display, browser-supported. % -% The optional multicols heading is placed inside a \tag{div} of class |multicolsheading|. +% The optional multicols heading is placed inside a \element{div} of class |multicolsheading|. % -% The content is placed inside a \tag{div} of class |multicols|. +% The content is placed inside a \element{div} of class |multicols|. % \begin{macrocode} \begin{warpHTML} @@ -23563,8 +25397,8 @@ solid % \begin{description} % \item[CSS styling of theorems and proofs:] \ % \begin{description} -% \item [Theorem:] \tag{div} of class |theorembody| -% \item [Theorem Header:] \tag{span} of class |theoremheader