From 7d9d2e08fcab92adcc759e3f1e4bb0a15a63f220 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Sun, 26 Apr 2020 03:02:41 +0000 Subject: CTAN sync 202004260302 --- macros/latex/contrib/lwarp/README.txt | 2 +- macros/latex/contrib/lwarp/lwarp.dtx | 4335 +++++++++++++++++++++----------- macros/latex/contrib/lwarp/lwarp.ins | 1 + macros/latex/contrib/lwarp/lwarp.pdf | Bin 2653336 -> 2701656 bytes macros/latex/contrib/lwarp/lwarpmk.lua | 7 +- 5 files changed, 2822 insertions(+), 1523 deletions(-) (limited to 'macros/latex/contrib/lwarp') diff --git a/macros/latex/contrib/lwarp/README.txt b/macros/latex/contrib/lwarp/README.txt index 1a9232fc82..d4c0b0a650 100644 --- a/macros/latex/contrib/lwarp/README.txt +++ b/macros/latex/contrib/lwarp/README.txt @@ -1,5 +1,5 @@ -LaTeX lwarp package v0.83 README.txt +LaTeX lwarp package v0.84 README.txt Files included are: diff --git a/macros/latex/contrib/lwarp/lwarp.dtx b/macros/latex/contrib/lwarp/lwarp.dtx index 26c58843b5..f073d2bc36 100644 --- a/macros/latex/contrib/lwarp/lwarp.dtx +++ b/macros/latex/contrib/lwarp/lwarp.dtx @@ -16,7 +16,7 @@ % \iffalse %\NeedsTeXFormat{LaTeX2e}[1999/12/01] %\ProvidesPackage{lwarp} -% [2020/03/25 v0.83 Allows LaTeX to directly produce HTML5 output.] +% [2020/04/24 v0.84 Allows LaTeX to directly produce HTML5 output.] % %<*driver> \documentclass{ltxdoc} @@ -565,8 +565,8 @@ bibtex \textred{\_html}.gls \DescribeOption{GlossaryCmd}\DescribeDefault{makeglossaries} \DescribeOption[lwarpmk]{printglossary} \DescribeOption[lwarpmk]{htmlglossary} -\prog{lwarpmk} has the commands \texttt{lwarpmk printglossary} and -\texttt{lwarpmk htmlglossary}, which process the glossaries created by the +\prog{lwarpmk} has the commands \cmds{lwarpmk printglossary} and +\cmds{lwarpmk htmlglossary}, which process the glossaries created by the \pkg{glossaries} package using that package's \prog{makeglossaries} program. The shell command to execute is set by the \pkg{lwarp} option \optn{GlossaryCmd}, @@ -760,6 +760,10 @@ allowing other packages to work with it. \newcommand*{\limitspagenote}{% \pkg{pagenote} works as-is, but the \optn{page} option is disabled. + +Note that labels in page notes do not appear as expected, +\trouble[labels]{pagenote=\pkg{pagenote}} +even in the print version. } \newcommand*{\limitsendnotes}{% @@ -848,6 +852,11 @@ In the \CSS\ try referencing fonts which are more complete, but expect to see ga \newcommand{\limitsaccents}{% Native \LaTeX\ accents such as \cs{"} will work, but many more kinds of accents are available when using Unicode-aware \XeLaTeX\ and \LuaLaTeX. +If using accents in section names which will become file names, it is recommended +to use the \LaTeX\ accents such as \cs{"} and \cs{v} instead of Unicode accents. +The \LaTeX\ accents will have the accents stripped when creating the filenames, +whereas the Unicode accents will appear in the file names, which may cause +issues with some operating systems. } \newcommand{\limitsrelsize}{% @@ -1025,7 +1034,6 @@ instead of pdf\LaTeX. Many features are ignored during the \HTML\ conversion. The goal is source-level compatibility. -\cs{titlehead}, \cs{subject}, \cs{captionformat}, \cs{figureformat}, and \cs{tableformat} are not yet emulated. \testthis @@ -1035,6 +1043,10 @@ Please contact the author with any bug reports. } \newcommand{\limitsmemoir}{ +\pkg{lwarp} uses \pkg{caption}, which causes a warning from \pkg{memoir}. +\trouble[captions]{memoir=\pkg{memoir}>captions} +This is normal. Adjust captions via \pkg{caption}, instead of \pkg{memoir}. + While emulating \pkg{memoir}, \pkg{lwarp} pre-loads a number of packages (\cref{sec:patch-memoir-packages}). This can cause an options clash when the user's document later loads the same @@ -1062,19 +1074,52 @@ Since \pkg{lwarp} is intended to support the freestanding packages, which are often newer than the date declared by \pkg{memoir}, it is hoped that \pkg{memoir} will update and change its emulated version numbers to match. -\cs{verbfootnote} is not supported. +\cs{label} accepts an optional \optn{(bookmark)} argument, but this is +\margintag{\texttt{\cs{label}(bookmark)\{tag\}}} +ignored in \HTML. + +The \env{comment} environment is from the \pkg{comment} package, and thus +\trouble[\env{comment}]{comment=\env{comment}} +\trouble{memoir=\pkg{memoir}>comment=\env{comment}} +requires that the \cs{begin} and \cs{end} each be on its own line: +\begin{sourcedisplay} +\cs{begin}\{comment\} \\ +This is a comment. \\ +\cs{end}\{comment\} +\end{sourcedisplay} +Comments defined with \cs{newcomment} use \pkg{memoir}'s defintions, and +\margintag{\cs{newcomment}} +behave as expected, where the \cs{begin} and \cs{end} do have to each be on its own line. + +\cs{verbfootnote} is not supported.\watchout[verbatim footnotes] -\cs{newfootnoteseries}, etc. are not supported. +\cs{newfootnoteseries}, etc. are not supported.\watchout[\cs{newfootnoteseries}] \pkg{lwarp} loads \pkg{pagenote} to perform \pkg{memoir}'s pagenote functions, +\watchout[page notes] but there are minor differences in \cs{pagenotesubhead} and related macros. -Poem numbering is not supported. +To add support for pagenotes with \pkg{cleveref}, add: +\margintag{page notes with cleveref} +\trouble{memoir=\pkg{memoir}>page notes} +\begin{sourcedisplay} +\cs{crefname}\{pagenote\}\{page note\}\{page notes\} \\ +\cs{Crefname}\{pagenote\}\{Page note\}\{Page notes\} +\end{sourcedisplay} + +Note that for print mode, +\margintag{page note \cs{nameref}} +\cs{nameref} print the section name where the page notes are +declared in the text, but for \HTML\ it prints the name where the page notes are printed. + +Poem numbering is not supported.\watchout[poems] The \env{verbatim} environment does not yet support the \pkg{memoir} enhancements. +\watchout[\env{verbatim}] It is currently recommended to load and use \pkg{fancyvrb} instead. The \pkg{memoir} glossary system is not yet supported by \prog{lwarpmk}. +\watchout[glossaries] The \pkg{glossaries} package may be used instead, but does require the glossary entries be changed from the \pkg{memoir} syntax to the \pkg{glossaries} syntax. @@ -1116,6 +1161,10 @@ Horizontal spacing relies on \prog{pdftotext}'s ability to discern the layout text in the \HTML-tagged \PDF\ output. For some settings of \cs{HTMLleftmargini} or \cs{HTMLleftskip} the horizontal alignment may not work out exactly, in which case a label may be shifted by one space. +\trouble[\env{verse} margin]{verse=\pkg{verse}>margin} +\trouble{memoir=\pkg{memoir}>verse>margin} +During translation to \HTML, the stanza numbers are kept out of the left margin, +which would have caused \prog{pdftotext} to shift everything over. } @@ -1553,11 +1602,34 @@ This conversion is not total. Font control is via \CSS, and the custom \LaTeX\ font settings are ignored. +If the print version does not use \pkg{cleveref}, +\trouble[cref reference format undefined]{ntheorem=\pkg{ntheorem}>cref reference format} +\trouble{cref reference format} +\trouble{cleveref=\pkg{cleveref}>cref reference format} +place all \cs{theoremstyle} and \cs{newtheorem} +declarations in the preamble inside \cs{AtBeginDocument}.\footnote{% + \pkg{lwarp} uses \pkg{cleveref} for the \HTML\ conversion, + and loads \pkg{cleveref} \cs{AtEndPreamble}, just before \cs{AtBeginDocument}.% +} +For some theorems, it may also be required to add inside \cs{AtBeginDocument} +something such as: +\begin{sourcedisplay} +\cs{AtBeginDocument}\{ \% if not using cleveref package \\ + \fquad \cs{theoremstyle}\{definition\} \\ + \fquad \cs{newtheorem}\{dtheorem\}\{Definition\} \\ + \fquad \dots \\ + \fquad \cs{usepackage}\{etoolbox\} \% for \cs{ifdef} \\ + \fquad \cs{ifdef}\{\cs{cref}\}\{ \\ + \fqquad \cs{crefname}\{Proof\}\{Proof\}\{Proofs\} \\ + \fquad \}\{\} \\ +\} +\end{sourcedisplay} + \limitsntheoremnumbering } \newcommand{\limitsntheoremnumbering}{% -\pkg{ntheorem} has a bug with equation numbering in \AmS\ environments% +\pkg{ntheorem} has a bug with equation numbering in \AmS\ environments \trouble[Equation numbering]{ntheorem=\pkg{ntheorem}>numbering} \trouble{math>equation numbering>ntheorem=\pkg{ntheorem}} \trouble{AMSmath>ntheorem=\pkg{ntheorem}>numbering} @@ -1777,9 +1849,9 @@ by an \SVG, \PNG, or \JPG\ version for \HTML. } \newcommand{\limitscolor}{% -\pkg{color} is superceded by \pkg{xcolor}, and -\pkg{lwarp} requires several of the features of \pkg{xcolor}. -When \pkg{color} is requested, \pkg{xcolor} is loaded as well. + \pkg{color} is superceded by \pkg{xcolor}, and + \pkg{lwarp} requires several of the features of \pkg{xcolor}. + When \pkg{color} is requested, \pkg{xcolor} is loaded as well. } \newcommand{\limitsxcolor}{% @@ -2432,11 +2504,12 @@ Unfortunately, the \HTML\ \attribute{alt} attribute is not used here. 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 +The \pkg{fancybox} documentation's example of a 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. +\cs{fbox} is replaced by \cs{fboxBlock}. +This method does lose some \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} @@ -2743,7 +2816,8 @@ These are not the same as the third-party \brand{MathJax} extension. \newcommand{\limitsbabeltwo}{% When French is used, the caption separator is \trouble[\cs{CaptionSeparator}]{babel=\pkg{babel}>French} -changed to a dash. The following may be used to restore it to a colon: +changed to a dash. To restore it to a colon, +the following may be placed before \pkg{lwarp} is loaded: \begin{sourcedisplay} \cs{renewcommand}*\{\cs{CaptionSeparator}\}\{:\textasciitilde\} \end{sourcedisplay} @@ -2925,7 +2999,7 @@ This boolean may be tested by the user for later use. %<*package> % \fi % -% \CheckSum{43597} +% \CheckSum{44148} % % \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 @@ -3051,6 +3125,7 @@ This boolean may be tested by the user for later use. % \changes{v0.81}{2020/03/04}{\ 2020/03/04} % \changes{v0.82}{2020/03/25}{\ 2020/03/25} % \changes{v0.83}{2020/03/27}{\ 2020/03/27} +% \changes{v0.84}{2020/04/24}{\ 2020/04/24} @@ -3273,11 +3348,57 @@ This boolean may be tested by the user for later use. % % \begin{description} % \needspace{2\baselineskip} +% \item[v0.84:] Previous/next page links, numerous fixes. +% \begin{itemize} +% \item Added documentation of \env{BlockClass} and \cs{InlineClass} +% for \CSS\ \element{div}s and \element{span}s. +% \margintag{docs} +% See \cref{sec:classstyle}. +% \item Added \cs{LinkPrevious}, \cs{LinkNext} page links. +% See \cref{sec:htmlsettings}. +% \item Added \cs{FirstPageBottom}. +% \watchout[home page footer changed] +% Home page no longer shares \cs{PageBottom}. +% See \cref{sec:htmlsettings}. +% \item Improved coexistence with \pkg{comment}, support for nested environments. +% \margintag{core} +% \item No longer requires but still supports the \pkg{caption} package. +% \item Improved filenames and \HTML\ titles when using special characters. +% \item Change: Append \filenm{-0} to section named Index +% \watchout{previously \_index} +% to distinguish from \filenm{index.html} +% \item Fixed style tags for \cs{multicolumn}, \cs{multirow}. +% \item Fixed spacing in \env{tabbing}. +% \item Fixed \env{lateximage} for: \env{quote}, \env{quotation}, \env{verse}, +% \env{center}, \env{flushleft}, \env{flushright}, +% \element{par} tags, packages \pkg{verbatim}, \pkg{alltt}, \pkg{epigraph}. +% \item Fixed \pkg{textcomp} due to integration into \LaTeX\ kernel. +% \item Fixed \cs{itshape}, etc. Adapted to \LaTeX\ \pkg{fontaxes} integration. +% \item Fixed \cs{@fnsymbol}. +% \item Warns about section names with dollar-delimited math. +% \item Warns about a \element{span} containing a float, caption, section, +% \pkg{mdframed}, or other \element{div} object. +% \item Only warn about \XeTeX\ logo and \pkg{graphics} if actually used \cs{Xe}. +% \item \cmds{lwarpmk clean} also removes \filenm{comment_*.cut}. +% \margintag{\prog{lwarpmk}} +% \item \pkg{scrextend}, \pkg{scrartcl}, \pkg{scrbook}: Added \cs{titlehead}, +% \margintag{packages} +% \cs{subject}, \cs{subtitle}, \cs{publishers}. +% \item \pkg{titling}: Fixed \cs{printthanks}. +% \item \pkg{memoir}, \pkg{abstract}: Fixed for updated \pkg{memoir}. +% \item \pkg{memoir}: Fixed \cs{newcomment}, pagenotes, crossreferences. +% Fixed setting a recursive name. +% \item Fixed or improved: \pkg{amsthm}, \pkg{backref}, \pkg{biblatex}, \pkg{fixme}, +% \pkg{nfssext-cfr}, \pkg{ntheorem}, \pkg{parcolumns}, +% \pkg{realscripts}, \pkg{rotfloat}, \pkg{titling}. +% \item Added \pkg{boxedminipage}, renamed from \pkg{boxedminipage2e} per author. +% \item Verified to work as-is with \pkg{mcite}. +% \end{itemize} +% \needspace{2\baselineskip} % \item[v0.83:] \pkg{memoir} fixes. % \begin{itemize} -% \item \pkg{memoir}: Various fixes and updates, but subcaption labels +% \item \pkg{memoir}: Various fixes and updates. % \margintag{packages} -% still need work. (Out of time\dots) % \item \pkg{physunits}: Updated to v1.0.4. % \end{itemize} % \needspace{2\baselineskip} @@ -3447,7 +3568,7 @@ This boolean may be tested by the user for later use. % \cmidrule(r){1-1}\cmidrule(l){2-2} % (hard coded as ``image'') & \cs{ImageAltText} \\ % \cs{mathimagename} & \cs{MathImageAltText} \\ -% \cs{pacakgediagramname} & \cs{PackageDiagramAltText} \\ +% \cs{packagediagramname} & \cs{PackageDiagramAltText} \\ % \end{tabular} % \end{center} % \item Added \cs{ImageAltText} for the default \HTML\ \attribute{alt} text for @@ -5197,7 +5318,7 @@ This boolean may be tested by the user for later use. % Glossary: & \mpkg{gloss}, \mpkg{glossaries} and \prog{xindy}, \mpkg{nomencl}.\\ % % Bibliography: & \spkg{babelbib}, \mpkg{backref}, \mpkg{biblatex}, \mpkg{bibunits}, -% \mpkg{chapterbib}, \mpkg{cite}, \ipkg{hypernat}, \mpkg{natbib}, +% \mpkg{chapterbib}, \mpkg{cite}, \ipkg{hypernat}, \spkg{mcite}, \mpkg{natbib}, % \spkg{notes2bib}, \ipkg{showtags}. % % \\ @@ -5339,7 +5460,8 @@ This boolean may be tested by the user for later use. % Verbatim: & % \mpkg{fancyvrb}, \mpkg{moreverb}, \spkg{shortvrb}, \mpkg{verbatim}. \\ % -% Frames: & \mpkg{boxedminipage2e}, \mpkg{fancybox}, \mpkg{framed}, \mpkg{mdframed}, +% Frames: & \mpkg{boxedminipage}, \mpkg{boxedminipage2e}, +% \mpkg{fancybox}, \mpkg{framed}, \mpkg{mdframed}, % \epkg{niceframe}, \epkg{shadow}, \epkg{vertbars}. \\ % % Multi-columns: & \epkg{adjmulticol}, \epkg{multicol}, @@ -5359,7 +5481,7 @@ This boolean may be tested by the user for later use. % \ipkg{lua-check-hyphen}, \ipkg{luacolor}, \epkg{magaz}, \epkg{nolbreaks}, % \ipkg{normalcolor}, % \ipkg{pdfcol}, \ipkg{pdfcolmk}, -% \ipkg{pdfrender}, \epkg{realscripts}, \mpkg{relsize}\ejax, +% \ipkg{pdfrender}, \mpkg{realscripts}, \mpkg{relsize}\ejax, % \ipkg{scalefnt}, \epkg{soul}, \epkg{soulpos}, \epkg{soulutf8}, \mpkg{stackengine}, % \epkg{textfit}, \epkg{thinsp}, \ipkg{trimclip}, \ipkg{truncate}, % \mpkg{ulem}, \mpkg{umoline}, \ipkg{underscore}, \ipkg{uspace}, @@ -6213,8 +6335,8 @@ This boolean may be tested by the user for later use. % \brand{MathJax} is used to display math. % This file should not be modified by the user. % -% \item [|comment.cut|:] A temporary file used by \pkg{lwarp} to -% conditionally process blocks of text. This file may be ignored. +% \item [|comment\_*.cut|:] Temporary files used by \pkg{lwarp} to +% conditionally process blocks of text. These files may be ignored. % \end{description} % % \hrule \medskip @@ -6586,7 +6708,7 @@ This boolean may be tested by the user for later use. % % The \filenm{-images} directory contains \SVG\ images % automatically generated for inline and display math, \pkg{tikz}, etc. -% To remove all the images from the \filenm{lateximages} directory: +% To remove all the images from the \filenm{-images} directory: % \userentry{lwarpmk cleanlimages} % % @@ -6783,15 +6905,20 @@ This boolean may be tested by the user for later use. % \gindex{sideTOC=side\TOC>name} % \gindex{settings>language} % -% Regional localization is supported by \pkg{lwarp} via the following package options -% and macros: +% Regional localization is supported by \pkg{lwarp} via the package options +% and macros shown in \cref{tab:localization}. % +% \begin{table} +% \caption{Localization settings} +% \label{tab:localization} % \begin{description} % \item [Object names:] \LaTeX\ provides redefinable names for various objects, % and \pkg{lwarp} adds a few more. Use \cs{renewcommand} to change these. % \begin{description} % \item [\cs{abstractname}:] This macro is honored by \pkg{lwarp}. % \item [\cs{linkhomename}:] Displayed by the link to the homepage. +% \item [\cs{linkpreviousname}:] Displayed by the link to the previous page +% \item [\cs{linknextname}:] Displayed by the link to the next page. % \item [\cs{sidetocname}:] Displayed at the head of the side\TOC. % \end{description} % \item [\HTML\ settings:] See \cref{tab:htmlsettings} and @@ -6815,6 +6942,7 @@ This boolean may be tested by the user for later use. % \item [\optn{pdftotextEnc}:] To adjust the encoding of \prog{pdftotext}. % \end{description} % \end{description} +% \end{table} % % % \subsection{Accessibility} @@ -6838,8 +6966,11 @@ This boolean may be tested by the user for later use. % \HTML\ also provides the \attribute{title} attribute, which usually % generates a pop-up text. \pkg{lwarp} can add this to a reference or hyperlink. % \brand{MathJax} also has provisions for improved accessibility -% as well. +% as well. See \cref{tab:accessibility}. % +% \begin{table} +% \caption{Accessibiltiy settings} +% \label{tab:accessibility} % \begin{description} % \item [\cs{ImageAltText}:] The default \HTML\ \attribute{alt} text % for \cs{includegraphics} and \env{lateximage}s. @@ -6897,6 +7028,7 @@ This boolean may be tested by the user for later use. % This may be changed by redefining \cs{AltTextOpen} and \cs{AltTextClose}. % Set with \cs{renewcommand}. % \end{description} +% \end{table} % % % @@ -7077,6 +7209,23 @@ This boolean may be tested by the user for later use. % with \pkg{fontspec} after loading the traditional font packages. % Monospaced output ligatures must be turned off % to produce the correct \HTML\ characters. +% +% Any monospace font with built-in ligatures may require these ligatures to +% \changes{v0.84}{2020/04/15}{Docs: \brand{JetBrain Mono} font.} +% be disabled for \HTML. In one example, \brand{JetBrain Mono}, +% \trouble[\brand{JetBrain Mono}]{font>JetBrain Mono=\brand{JetBrain Mono}} +% \trouble{jetbrain mono=\brand{JetBrain Mono}} +% \trouble[\HTML\ corrupted]{HTML>corrupted} +% \trouble{font>ligatures} +% it is required to use +% \begin{sourcedisplay} +% \cs{setmonofont}\{JetBrains Mono\}[\% \\ +% \dots \\ +% \textgreen{Contextuals=AlternateOff,} \\ +% ] +% \end{sourcedisplay} +% After \pkg{lwarp} is loaded, the ligature may be re-enabled for print mode +% by using \cs{setmonofont} again inside a \env{warpprint} environment. % \item \ldots{} the rest of the preamble and the main document. % \end{enumerate} % @@ -7109,7 +7258,7 @@ This boolean may be tested by the user for later use. % \gindex{settings>lwarp=\pkg{lwarp} package options} % % \begin{table} -% \caption{\pkg{lwarp} package options\label{tab:options}} +% \caption{\pkg{Lwarp} package options\label{tab:options}} % \centering % \renewcommand{\arraystretch}{1.2} % \begin{tabular}{>{\ttfamily}lp{3.25in}} @@ -7478,10 +7627,13 @@ This boolean may be tested by the user for later use. % \begin{table}[p] % \caption{\HTML\ settings} % \label{tab:htmlsettings} +% \renewcommand{\arraystretch}{1.1} % \begin{tabular}{>{\ttfamily}lp{3in}} % \toprule % Macro \Slash Cntr \Slash Bool & Description \\ \midrule % \cs{linkhomename} & Name of the link to the homepage. \\ +% \cs{linkpreviousname} & Name of the link to the previous page. \\ +% \cs{linknextname} & Name of the link to the next page. \\ % \midrule % SideTOCDepth & Sectioning depth of the side\TOC. \\ % \cs{sidetocname} & Name of the side\TOC. \\ @@ -7515,8 +7667,9 @@ This boolean may be tested by the user for later use. % \cs{HTMLDescription} & The \HTML\ \attribute{description} meta tag. \\ % \midrule % \cs{HTMLFirstPageTop} & Heading for the home page. \\ +% \cs{HTMLFirstPageTop} & Footer for the home page. \\ % \cs{HTMLPageTop} & Heading for the other pages. \\ -% \cs{HTMLPageBottom} & Footing for all pages. \\ +% \cs{HTMLPageBottom} & Footer for the other pages. \\ % \midrule % HTMLDebugComments & Boolean to generate \HTML\ comments. \\ % \bottomrule @@ -7591,6 +7744,7 @@ This boolean may be tested by the user for later use. % % \end{description} \bigskip % +% \needspace{3\baselineskip} % \item[Placed in the preamble before \texttt{\cs{begin}\{document\}}:] \ % % \begin{description} @@ -7600,6 +7754,16 @@ This boolean may be tested by the user for later use. % Redefine with \cs{renewcommand}. % \changes{v0.63}{2018/11/29}{Docs: \cs{linkhomename}.} % +% \ItemDescribeMacro{\linkpreviousname} \DescribeDefault{Previous} +% Name of the link to the previous page. Paragraphs are allowed. +% Redefine with \cs{renewcommand}. +% \changes{v0.84}{2020/04/24}{Docs: \cs{linkpreviousname}.} +% +% \ItemDescribeMacro{\linknextname} \DescribeDefault{Next} +% Name of the link to the next page. Paragraphs are allowed. +% Redefine with \cs{renewcommand}. +% \changes{v0.84}{2020/04/24}{Docs: \cs{linkpreviousname}.} +% % \ItemDescribeCounter{tocdepth} Sectioning depth of the table of contents. % See \cref{sec:stackdepths} for a list of \LaTeX{} stack depths. % @@ -7729,7 +7893,7 @@ This boolean may be tested by the user for later use. % % \end{description} % -% \needspace{2\baselineskip} +% \needspace{3\baselineskip} % \item[Placed before \texttt{\cs{begin}\{document\}}, % or before any sectioning command which causes a file break:] \ % @@ -7806,6 +7970,14 @@ This boolean may be tested by the user for later use. % \ItemDescribeMacro{\HTMLFirstPageTop} \marg{contents} \DescribeDefault{} \quad % A user-definable custom action applied % to the top of the home page. Useful for logos, etc. +% \cs{LinkNext} may be used to link to the next web page. +% Defaults empty. +% Ignored in print output. +% +% \ItemDescribeMacro{\HTMLFirstPageBottom} \marg{contents} \DescribeDefault{} \quad +% A user-definable custom action applied +% to the bottom of the home page. Useful for logos, etc. +% \cs{LinkNext} may be used to link to the next web page. % Defaults empty. % Ignored in print output. % @@ -7813,21 +7985,34 @@ This boolean may be tested by the user for later use. % A user-definable custom action applied to % the top of pages other than the home page. Useful for logos, etc. % Defaults empty. -% \cs{LinkHome} may be used to place a link back to the homepage. +% \cs{LinkHome} may be used to place a link back to the homepage, as well as +% \cs{LinkPrevious} and \cs{LinkNext}. % Ignored in print output. % % \ItemDescribeMacro{\HTMLPageBottom} \marg{contents} \DescribeDefault{} \quad % A user-definable custom action applied to the -% bottom of each web page. +% bottom of pages other than the home page. % Useful for authors, copyright notices, contact information, etc. % Defaults empty. -% \cs{LinkHome} may be used to place a link back to the homepage. +% \cs{LinkHome} may be used to place a link back to the homepage, as well as +% \cs{LinkPrevious} and \cs{LinkNext}. % Ignored in print output. % +% \ItemDescribeMacro{\LinkHome} Creates a link to the home page. +% Usually used in \cs{HTMLPageTop} and related. +% +% \ItemDescribeMacro{\LinkPrevious} Creates a link to the previous \HTML\ page, +% unless already at the home page. +% Usually used in \cs{HTMLPageTop} and related. +% +% \ItemDescribeMacro{\LinkNext} Creates a link to the next \HTML\ page, unless +% already at the end. +% Usually used in \cs{HTMLPageTop} and related. +% % \end{description} % % -% \needspace{2\baselineskip} +% \needspace{3\baselineskip} % \item[Placed in the home page before the first sectioning command which causes a file break:] \ % % \begin{description} @@ -7883,13 +8068,15 @@ This boolean may be tested by the user for later use. % % \emph{Do not place anything else on the same line as \texttt{\cs{end}\{warpprint\}}}. % \watchout +% Also do not nest \env{warpprint} inside itself. % -% \ItemDescribeEnv{warpHTML} An environment which is only used +% \ItemDescribeEnv{warpHTML} An environment which is only included % while generating \HTML\ output. This is useful for website logos and % other items which have no purpose in printed output. % % \emph{Do not place anything else on the same line as \texttt{\cs{end}\{warpHTML\}}}. % \watchout +% Also do not nest \env{warpHTML} inside itself. % % \ItemDescribeMacro{\warpprintonly} \marg{contents} \quad % A macro version of the \env{warpprint} environment. @@ -8011,8 +8198,46 @@ This boolean may be tested by the user for later use. % \VerbatimInput[frame=lines]{sample_project.css} % % Finally use |\CSSFilename{.css}| in the document to activate the custom \CSS. -% -% +% +% +% \subsection{Assigning \CSS\ classes and styles} +% \label{sec:classstyle} +% +% \gindex{CSS>class=\attribute{class}} +% \gindex{CSS>style=\attribute{span}} +% \gindex{HTML>class=\attribute{class}} +% \gindex{HTML>style=\attribute{style}} +% \gindex{HTML>div=\element{div}} +% \gindex{HTML>span=\element{span}} +% +% \HTML\ \CSS\ classes and styles may be assigned to fragments of the document. +% +% \DescribeEnv{BlockClass} \oarg{style} \marg{class} +% +% An entire block of text, including paragraphs, may be assigned a \CSS\ class +% and optional \CSS\ style using the \env{BlockClass} environment. +% The result is placed inside a \element{div}. +% A \env{BlockClass} may nest other \env{BlockClass}es or \cs{InlineClass}es. +% +% \DescribeMacro{\InlineClass} +% \parg{\acro{wp} \CSS\ style} \oarg{web \CSS\ style} +% \marg{\CSS\ class} \marg{text} +% +% A section of text without paragraphs may be assinged a \CSS\ class and optional +% \CSS\ style using the \cs{InlineClass} macro. +% The result is placed inside a \element{span}. +% \cs{InlineClass} may be nested, but per the \HTML\ standard it must not contain +% \env{BlockClass}, nor may it contain a paragraph, nor several other objects +% such as \HTML\ figures. +% \cs{InlineClass} also accepts a second optional parameter, enclosed inside +% parentheses, which assigns the style while generating output for a word processor, +% while ignoring the web style. +% +% Nullified versions of \env{BlockClass} and \cs{InlineClass} are provided +% for the print version, so they may be used in the document without +% placing them inside \env{warpHTML} or \cs{warpHTMLonly}. +% +% % \subsection{Selecting the operating system} % \label{sec:OSportabilityusage} % \changes{v0.11}{2016/03/11}{Added section: Selecting the operating system.} @@ -8022,7 +8247,7 @@ This boolean may be tested by the user for later use. % % \subsection{Selecting actions for print, \HTML, or \brand{MathJax} output} % \label{sec:selectingoutput} -% \gindex{settings>selecting output} +% \gindex{settings>selecting print/\HTML\ output} % \changes{v0.15}{2016/04/05}{Docs: Clarify print/\HTML\ output.} % % The following environments and macros are used to select actions which only apply @@ -8050,6 +8275,7 @@ This boolean may be tested by the user for later use. % Do \emph{not} place anything else on the same line as |\end{warpHTML}|. % \trouble[\texttt{\cs{end}\{warpHTML\}}]{warpHTML} % The exact phrase is used to mark the end of the environment. +% Do not nest \env{warpHTML} inside itself.\watchout[nesting] % % \DescribeEnv{warpprint} % Anything which is to be done only for print output @@ -8061,6 +8287,7 @@ This boolean may be tested by the user for later use. % \end{Verbatim} % As above, do not place anything else on the line with |\end{warpprint}|. % \trouble[\texttt{\cs{end}\{warpprint\}}]{warpprint} +% Do not nest \env{warpprint} inside itself.\watchout[nesting] % % \DescribeEnv{warpall} % Anything which is to be done for any output @@ -8071,6 +8298,8 @@ This boolean may be tested by the user for later use. % \end{warpall} % \end{Verbatim} % As above, do not place anything else on the line with |\end{warpall}|. +% \trouble[\texttt{\cs{end}\{warpall\}}]{warpall} +% Do not nest \env{warpall} inside itself.\watchout[nesting] % % % Macros are also provided for print-only or \HTML-only code: @@ -8087,6 +8316,9 @@ This boolean may be tested by the user for later use. % Anything which is to be done only while using \HTML\ output with \brand{MathJax} % is surrounded by a \env{warpMathJax} environment. % Usually, this is \cs{CustomizeMathJax}, used to add emulation macros. +% |\end{warpMathJax}| must appear on its own line. +% \trouble[\texttt{\cs{end}\{warpMathJax\}}]{warpMathJax} +% Do not nest \env{warpMathJax} inside itself.\watchout[nesting] % % % \subsection{Commands to be placed into the \env{warpprint} environment} @@ -8474,7 +8706,7 @@ This boolean may be tested by the user for later use. % and \cs{StopDefiningTabulars} afterwards. % Also see the \pkg{lwarp} documentation for the \pkg{fancybox} package. % \item [To frame equations:] See \cref{sec:fancybox} for the \pkg{fancybox} package. -% \item [For fancy framed minipages:] See packages \pkg{boxedminipage2e}, +% \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 @@ -8601,6 +8833,14 @@ This boolean may be tested by the user for later use. % \DescribePackage{varioref} % \limitscpageref % +% \pkg{cleveref} changes the behavior of \pkg{varioref} in that +% \trouble[\pkg{varioref} types]{varioref=\pkg{varioref}} +% the reference type is automatically printed if \pkg{cleveref} is loaded. +% \pkg{Lwarp} requires \pkg{cleveref}, so the \HTML\ version will always +% automatically print the reference types even if the print mode does not. +% The simplest way to make them match is to require the \pkg{cleveref} package +% for the document. +% % \subsubsection{Hyperlinks, \pkg{hyperref}, and \pkg{url}} % % \DescribePackage{hyperref} @@ -9751,6 +9991,41 @@ This boolean may be tested by the user for later use. % \DescribeClass{memoir} % \limitsmemoir % +% The custom frame commands in the \pkg{memoir} manual may be emulated by +% \trouble[\env{framewithtitle}, \env{titledframe}]{framewithtitle=\env{framewithtitle}} +% \trouble{titledframe=\env{titledframe}} +% \trouble{memoir=\pkg{memoir}>\env{framewithtitle}, \env{titledframe}} +% \gindex{memoir=\pkg{memoir}>\env{framewithtitle}, \env{titledframe}} +% placing the original defintions in the preamble inside \env{warpprint} +% environments, and then providing an \HTML\ equivalent: +% \begin{sourceverb} +% \begin{warpHTML} +% \newcommand{\FrameTitle}[2]{% +% \textbf{#2} +% } +% +% \newenvironment{framewithtitle}[2][\FrameFirst@Lab\ (cont.)]{% +% \begin{fminipage}{\linewidth} +% \textbf{#2} +% \begin{minipage}{\linewidth} +% } +% {\end{minipage}\end{fminipage}} +% +% \newcommand{\TitleFrame}[2]{% +% \par +% \textbf{#1}\par +% \fboxBlock{#2} +% } +% +% \newenvironment{titledframe}[2][\FrameFirst@Lab\ (cont.)]{% +% \par +% \textbf{#2} +% \begin{fminipage}{\linewidth} +% } +% {\end{fminipage}} +% \end{warpHTML} +% \end{sourceverb} +% % % \subsection{International languages} % \label{sec:international} @@ -10920,10 +11195,13 @@ This boolean may be tested by the user for later use. % \item[\ctr{SideTOCDepth} < \ctr{FileDepth}:] A warning is displayed if these % counters are set such that the side\TOC\ will not be able to access all pages % of the website. -% \item[Duplicate filenames:] \pkg{lwarp} may generate file names from section names. -% While doing so, the filenames are simplified and special characters are removed. +% \item[Filenames:] \pkg{lwarp} may generate file names from section names. +% While doing so, the filenames are simplified, and special characters +% and math are removed. % If this process generates a duplicate filename, and error is generated, % describing the filename and which section name generated it. +% A warning is issued if dollar-delimited math is used. +% Parenthesis-delimited math is recommended instead. % \item[Multirow:] When \cs{multirow} or \cs{multicolrow} are used, % \trouble[\HTML\ corrupted]{HTML>corrupted} % \cs{mrowcell} or \cs{mcolrowcell} must be placed in the appropriate cells to @@ -10985,9 +11263,20 @@ This boolean may be tested by the user for later use. % that your document's \LaTeX{} code is correct, before attempting % to generate an \HTML\ version. % -% \item [\texttt{\cs{end}\{warpHTML\}, \cs{end}\{warpprint\}, \cs{end}\{warpall\}}:] -% \trouble{warpHTML}\trouble{warpprint}\trouble{warpall} +% \item [\texttt{\cs{end}\{warpHTML\}, \cs{end}\{warpprint\}, +% \cs{end}\{warpall\}, \cs{end}\{warpMathJax\}}:] ~ \\ +% \trouble{warpHTML} +% \trouble{warpprint}\trouble{warpall}\trouble{warpMathJax} % Each of these must be without any other characters on the same line. +% \watchout[\env{warpHTML}, \env{warpprint}, \env{warpMathJax}, \env{warpall}] +% +% \item[``\texttt{Runaway argument? File ended while scanning use of \cs{next}}:] ~ \\ +% \trouble{warpHTML} +% \trouble{warpprint}\trouble{warpall}\trouble{warpMathJax} +% \trouble{Runaway argument? File ended \dots} +% \trouble{File ended while scanning use of \cs{next}} +% Don't use \env{warpHTML}, \env{warpprint}, \env{warpall}, or +% \env{warpMathJax} inside itself. % % \item [Options clash:] If using \pkg{memoir}, see \cref{sec:limitsmemoir}. % @@ -11051,7 +11340,7 @@ This boolean may be tested by the user for later use. % inside a group first. % % Also, custom macros which appear inside a section, -% \trouble[macros in section,table,figure names]{sectioning>macro in name} +% \trouble[macros in section, table, figure names]{sectioning>macro in name} % \trouble{table>macro in name} % \trouble{figure>macro in name} % figure, or table name should be @@ -11080,6 +11369,19 @@ This boolean may be tested by the user for later use. % define new macros for print and \HTML\ modes, see \cref{sec:definingprinthtml} % regarding \cs{LWR@expandableformatted}. % +% \item[''\texttt{Token not allowed in a PDF string}'':] This \pkg{hyperref} +% \trouble{Token not allowed in a PDF string} +% \trouble{hyperref=\pkg{hyperref}>Token not allowed in a PDF string} +% warning appears while creating the print-mode document, not \HTML. +% A low-level macro is being used in a section name which appears +% in the \PDF\ bookmarks. \pkg{hyperref} removes this macro from +% the bookmark, and warns of doing so. +% To avoid this warning, use \cs{pdfstringdefDisableCommands} in +% the preamble to define simplified replacement macros for each, or use +% \cs{texorpdfstring} in the \cs{section} or related macro +% to declare what to use for the \TeX\ text, v.s. the \PDF\ bookmark. +% See the \pkg{hyperref} manual. +% % \item[Complicated objects inside math:] Some objects, such as \tikz, % \trouble[``impure'' math objects]{math>non-math contents} % may not compile in \pkg{lwarp}'s normal math emulation. @@ -11610,12 +11912,13 @@ This boolean may be tested by the user for later use. {% Package #1,\MessageBreak or one which uses #1,\MessageBreak - must be loaded after lwarp + must be loaded after Lwarp.\MessageBreak + Enter 'H' for possible solutions% } - {Move \detokenize{\usepackage}{#1} after - \detokenize{\usepackage}{lwarp}.\MessageBreak + {Move ``\protect\usepackage{#1}'' after + ``\protect\usepackage{lwarp}''.\MessageBreak Package #1 may also be loaded by something else,\MessageBreak - which must also be moved after lwarp.} + which must also be moved after Lwarp.} } {} } @@ -11671,8 +11974,11 @@ This boolean may be tested by the user for later use. {} { \PackageError{lwarp} - {Package #1 must be loaded before lwarp} - {Move \detokenize{\usepackage}{#1} before \detokenize{\usepackage}{lwarp}.} + {% + Package #1 must be loaded before lwarp.\MessageBreak + Enter 'H' for possible solutions% + } + {Move ``\protect\usepackage{#1}'' before ``\protect\usepackage{lwarp}''.} } } % \end{macrocode} @@ -11808,7 +12114,6 @@ This boolean may be tested by the user for later use. \LWR@earlyloadnever{alg}{algorithm2e, algorithmicx} \LWR@earlyloadnever{algorithmic}{algorithm2e, algorithmicx} \LWR@earlyloadnever{bitfield}{bytefield} -\LWR@earlyloadnever{boxedminipage}{boxedminipage2e} \LWR@earlyloadnever{caption2}{caption} % \LWR@earlyloadnever{ccaption}{caption}% might be preloaded by memoir \LWR@earlyloadnever{colortab}{colortbl} @@ -11915,6 +12220,7 @@ This boolean may be tested by the user for later use. \LWR@notmemoirloadafter{booktabs} \LWR@loadafter{bophook} \LWR@loadafter{bounddvi} +\LWR@loadafter{boxedminipage} \LWR@loadafter{boxedminipage2e} \LWR@loadafter{braket} \LWR@loadafter{breakurl} @@ -12368,9 +12674,12 @@ This boolean may be tested by the user for later use. % % \begin{macrocode} \newcommand{\LWR@mdfive}[1]{% -\PackageError{lwarp} -{No MD5 macro was found} -{Lwarp must find the macros pdfmdfivesum or mdfivesum.} + \PackageError{lwarp} + {No MD5 macro was found} + {% + Lwarp must find the macros \protect\pdfmdfivesum\space + or \protect\mdfivesum.% + } } % \end{macrocode} % @@ -12499,7 +12808,8 @@ This boolean may be tested by the user for later use. {% Lwarp requires a vector font.\MessageBreak Install and load cm-super, lmodern, or another\MessageBreak - Type-1 vector font before loading lwarp% + Type-1 vector font before loading lwarp.\MessageBreak + Enter 'H' for possible solutions% } {% Install cm-super or lmodern.\MessageBreak @@ -12537,6 +12847,16 @@ This boolean may be tested by the user for later use. % \section{Miscellaneous tools} % % +% \subsection{Variables} +% +% \begin{macrocode} +\newlength{\LWR@templengthone} +\newlength{\LWR@templengthtwo} +\newlength{\LWR@templengththree} +\newcounter{LWR@tempcountone} +% \end{macrocode} +% +% % \subsection{Lengths and units} % % \begin{macro}{\LWR@providelength} \marg{\cs{lengthname}} @@ -12595,9 +12915,12 @@ This boolean may be tested by the user for later use. % Prints an error if could not patch a macro. % \begin{macrocode} \newcommand*{\LWR@patcherror}[2]{% -\PackageError{lwarp} -{Unable to patch package #1, macro #2} -{Please contact the author of the Lwarp package.} + \PackageError{lwarp}% + {% + Unable to patch package #1, macro #2.\MessageBreak + Lwarp may need to be updated% + }% + {Please contact the maintainer of the Lwarp package.}% } % \end{macrocode} % \end{macro} @@ -12728,7 +13051,8 @@ This boolean may be tested by the user for later use. % Results in the macro name without the leading backslash. % % Ref: \href{https://tex.stackexchange.com/questions/42318/removing-a-backslash-from-a-character-sequence} -% {\texttt{https://tex.stackexchange.com/questions/42318/removing-a-backslash-from-a-character-sequence}} +% {\texttt{https://tex.stackexchange.com/questions/42318/ \\ +% \hspace*{\fill}removing-a-backslash-from-a-character-sequence}} % % \changes{v0.79}{2020/01/18}{Added.} % \begin{macrocode} @@ -13474,28 +13798,37 @@ This boolean may be tested by the user for later use. % \end{macrocode} -% Use |comment_print.cut| for print mode, and -% |comment_html.cut| for \HTML\ mode. -% This helps \prog{latexmk} to more reliably know whether to recompile. -% -% \changes{v0.37}{2017/08/19}{\pkg{comment}: Maintains independent -% cutfiles for print, \HTML.} +% \begin{macro}{\LWR@includecomment} \marg{env name} \marg{partial filename} +% \begin{macro}{\LWR@excludecomment} \marg{env name} \marg{partial filename} % +% Use many \pkg{comment} cut files to avoid collision in case the +% user uses the \pkg{comment} package. Each filename is ``|comment_#2.cut|''. +% Based on the \pkg{comment} package. +% \changes{v0.84}{2020/03/30}{Independent cut files.} % \begin{macrocode} -\ifbool{warpingHTML}{ -\def\DefaultCutFileName{\def\CommentCutFile{comment_html.cut}} -}{} +\def\LWR@includecomment + #1#2{\message{Lwarp: Including comment '#1'}% + \csarg\def{After#1Comment}{\CloseAndInputCutFile} + \csarg\def{#1}{\endgroup \message{Including '#1' comment.}% + \def\CommentCutFile{comment_#2.cut} \SetUpCutFile \ProcessComment{#1}}% + \CommentEndDef{#1}} -\ifbool{warpingprint}{ -\def\DefaultCutFileName{\def\CommentCutFile{comment_print.cut}} -}{} +\def\LWR@excludecomment + #1#2{\message{Lwarp: Excluding comment '#1'}% + \csarg\def{#1}{\endgroup \message{Excluding '#1' comment.}% + \begingroup + \def\CommentCutFile{comment_#2.cut} \def\ProcessCutFile{}% + \def\ThisComment####1{}\ProcessComment{#1}}% + \csarg\def{After#1Comment}{\CloseAndInputCutFile \endgroup} + \CommentEndDef{#1}} % \end{macrocode} - +% \end{macro} +% \end{macro} % \begin{environment}{warpall} % Anything in the |warpall| environment will be generated for print or \HTML\ outputs. % \begin{macrocode} -\includecomment{warpall} +\LWR@includecomment{warpall}{all} % \end{macrocode} % \end{environment} @@ -13505,8 +13838,8 @@ This boolean may be tested by the user for later use. % For \HTML\ output: % \begin{macrocode} \ifbool{warpingHTML} - {\includecomment{warpHTML}} - {\excludecomment{warpHTML}}% + {\LWR@includecomment{warpHTML}{html}} + {\LWR@excludecomment{warpHTML}{html}} % \end{macrocode} % \end{environment} @@ -13515,8 +13848,8 @@ This boolean may be tested by the user for later use. % Anything in the |warpprint| environment will be generated for print output only. % \begin{macrocode} \ifbool{warpingprint} - {\includecomment{warpprint}} - {\excludecomment{warpprint}} + {\LWR@includecomment{warpprint}{print}} + {\LWR@excludecomment{warpprint}{print}} % \end{macrocode} % \end{environment} @@ -13526,25 +13859,25 @@ This boolean may be tested by the user for later use. % \changes{v0.79}{2020/01/26}{Added.} % \begin{macrocode} \begin{warpprint} -\excludecomment{warpMathJax} +\LWR@excludecomment{warpMathJax}{mathjax} \end{warpprint} \begin{warpHTML} \ifbool{mathjax} - {\includecomment{warpMathJax}} - {\excludecomment{warpMathJax}} + {\LWR@includecomment{warpMathJax}{mathjax}} + {\LWR@excludecomment{warpMathJax}{mathjax}} \end{warpHTML} % \end{macrocode} % \end{environment} -% \begin{environment}{LWR@creatinglwarpmk} +% \begin{environment}{LWRcreatelwarpmk} % Optionally generate a local copy of \prog{lwarpmk}. % Default to no. % \begin{macrocode} \ifbool{LWR@creatinglwarpmk} - {\includecomment{LWR@createlwarpmk}} - {\excludecomment{LWR@createlwarpmk}} + {\LWR@includecomment{LWRcreatelwarpmk}{lwarpmk}} + {\LWR@excludecomment{LWRcreatelwarpmk}{lwarpmk}} % \end{macrocode} % \end{environment} % @@ -14254,7 +14587,6 @@ This boolean may be tested by the user for later use. \LWR@checkloadnever{#1}{alg}{algorithm2e, algorithmicx} \LWR@checkloadnever{#1}{algorithmic}{algorithm2e, algorithmicx} \LWR@checkloadnever{#1}{bitfield}{bytefield} -\LWR@checkloadnever{#1}{boxedminipage}{boxedminipage2e} \LWR@checkloadnever{#1}{caption2}{caption} \LWR@checkloadnever{#1}{ccaption}{caption}% might be preloaded by memoir \LWR@checkloadnever{#1}{colortab}{colortbl} @@ -14455,8 +14787,9 @@ This boolean may be tested by the user for later use. % \begin{macrocode} \NewDocumentCommand{\LWR@ProvidesPackagePass}{m o}{ \PackageInfo{lwarp}{% - Using package `#1' and adding lwarp modifications,\MessageBreak - including options,}% + Using package `#1',\MessageBreak + and adding lwarp modifications, including options,\MessageBreak% + }% \IfValueTF{#2}% {\ProvidesPackage{lwarp-#1}[#2]}% {\ProvidesPackage{lwarp-#1}}% @@ -14565,28 +14898,6 @@ This boolean may be tested by the user for later use. -% \section{Additional required packages} - -% \codehtml -% \begin{macrocode} -\begin{warpHTML} -% \end{macrocode} - -% \DescribePackage{caption} -% \changes{v0.47}{2018/01/29}{\pkg{caption}: Also loads \pkg{lwarp-caption}.} -% \changes{v0.66}{2018/12/29}{\pkg{caption}: Fix for options clash.} -% \begin{macrocode} -\LWR@origRequirePackage{caption} -\AtBeginDocument{\RequirePackage{lwarp-caption}}% -% \end{macrocode} - -% \begin{macrocode} -\end{warpHTML} -% \end{macrocode} - - - - % \section{File handles} % Defines file handles for writes. @@ -14847,9 +15158,7 @@ This boolean may be tested by the user for later use. % The new \HTML\ versions of macros and environments are used most of the time. % Copies of the print versions are used inside a \env{lateximage} environment, % which draws and remembers an image of the printed output, and also several -% other places. The copies of the print versions may also be used by the \HTML\ -% versions, such as when the \HTML\ version merely encloses the print version -% inside \HTML\ tags. +% other places. % % The general structure for providing print and \HTML\ versions of a macro or % environment is as follows: @@ -14859,13 +15168,14 @@ This boolean may be tested by the user for later use. % \item[For a preexisting macro, not defined with \pkg{xparse}:] An \HTML\ version % is provided with a special name, inside a \env{warpHTML} environment, % then \cs{LWR@formatted} is used to redefine and patch various macros: -% \begin{Verbatim}[gobble=2,obeytabs,tabsize=4,frame=lines] +% \needspace{5\baselineskip} +% \begin{sourceverb} % \begin{warpHTML} % \newcommand{\LWR@HTML@name}{...}% may also use xparse % % \LWR@formatted{name} % \end{warpHTML} -% \end{Verbatim} +% \end{sourceverb} % |\LWR@formatted{name}| copies the original print version, % then redefines \cs{name} to use either the print or \HTML\ version depending % on which mode \pkg{lwarp} is using. \pkg{xparse} may be used to @@ -14874,16 +15184,18 @@ This boolean may be tested by the user for later use. % \item[For a preexisiting environment, not defined with \pkg{xparse}:] The process % is similar. Note the use of \cs{LWR@formattedenv} instead of \cs{LWR@formatted}. -% \begin{Verbatim}[gobble=2,obeytabs,tabsize=4,frame=lines] +% \needspace{5\baselineskip} +% \begin{sourceverb} % \begin{warpHTML} % \newenvironment{LWR@HTML@name}{...}% may also use xparse % % \LWR@formattedenv{name} % \end{warpHTML} -% \end{Verbatim} +% \end{sourceverb} % \item[If the original used \pkg{xparse}:] A copy must be made using a new name: -% \begin{Verbatim}[gobble=2,obeytabs,tabsize=4,frame=lines] +% \needspace{7\baselineskip} +% \begin{sourceverb} % \begin{warpHTML} % \NewDocumentCommand{\LWR@print@name}{..}{..}% copy the original % @@ -14891,7 +15203,7 @@ This boolean may be tested by the user for later use. % % \LWR@formatted{name} % \end{warpHTML} -% \end{Verbatim} +% \end{sourceverb} % Similar for an environment, using \cs{LWR@formattedenv}. % (\cs{LWR@formatted} and \cs{LWR@formattedenv} use \cs{LetLtxMacro} to % copy the original print definiton, @@ -14899,7 +15211,8 @@ This boolean may be tested by the user for later use. % so the print version must be manually recreated in the \pkg{lwarp} source.) % \item[For a new macro or environment, not using \pkg{xparse} for the print version:] \ -% \begin{Verbatim}[gobble=2,obeytabs,tabsize=4,frame=lines] +% \needspace{9\baselineskip} +% \begin{sourceverb} % \begin{warpall} % \newcommand{\name}{...}% NOT xparse! % \end{warpall} @@ -14909,7 +15222,7 @@ This boolean may be tested by the user for later use. % % \LWR@formatted{name} % \end{warpHTML} -% \end{Verbatim} +% \end{sourceverb} % Similar for an environment. % The plain \cs{name} or environment \env{name} is used for the printed % version, and is placed inside \env{warpall}. @@ -14921,7 +15234,8 @@ This boolean may be tested by the user for later use. % by defining the \cs{LWR@print@} version with \pkg{xparse}, along with % \cs{name} defined without \pkg{xparse} to refer directly to the \cs{LWR@print} % version: -% \begin{Verbatim}[gobble=2,obeytabs,tabsize=4,frame=lines] +% \needspace{16\baselineskip} +% \begin{sourceverb} % \begin{warpall} % \NewDocumentCommand{\LWR@print@name}{...} {...}% -or- % \NewDocumentEnvironment{\LWR@print@name}{...} {...} {...} @@ -14938,7 +15252,7 @@ This boolean may be tested by the user for later use. % \LWR@formatted{name}% -or- % \LWR@formattedenv{name} % \end{warpHTML} -% \end{Verbatim} +% \end{sourceverb} % % \end{description} % @@ -15353,13 +15667,6 @@ This boolean may be tested by the user for later use. \let\LWR@origsp\sp \let\LWR@origsb\sb -\LetLtxMacro\LWR@origtextsuperscript\textsuperscript -\LetLtxMacro\LWR@orig@textsuperscript\@textsuperscript - -\AtBeginDocument{ -\LetLtxMacro\LWR@origtextsubscript\textsubscript -\LetLtxMacro\LWR@orig@textsubscript\@textsubscript -} \LetLtxMacro\LWR@origunderline\underline % \end{macrocode} @@ -15415,6 +15722,7 @@ This boolean may be tested by the user for later use. % \limitsaccents % % \changes{v0.37}{2017/08/18}{\protect\LaTeX\ accents: Added.} +% \changes{v0.84}{2020/04/12}{\protect\LaTeX\ accents: Add'l symbols.} % % \codehtml % \begin{macrocode} @@ -15430,29 +15738,41 @@ This boolean may be tested by the user for later use. % % For Unicode engines, only \cs{t} needs to be redefined: % \begin{macrocode} -\LetLtxMacro\LWR@origt\t +\LetLtxMacro\LWR@origtie\t % \end{macrocode} % For pdf\LaTeX, additional work is required: % \begin{macrocode} \ifPDFTeX% pdflatex or dvi latex -\LetLtxMacro\LWR@origequalaccent\= +\LetLtxMacro\LWR@origgraveaccent\` +\LetLtxMacro\LWR@origacuteaccent\' +\LetLtxMacro\LWR@origcircumflexaccent\^ +\LetLtxMacro\LWR@origtildeaccent\~ +\LetLtxMacro\LWR@origmacronaccent\= +\LetLtxMacro\LWR@origbreve\u \LetLtxMacro\LWR@origdotaccent\. -\LetLtxMacro\LWR@origu\u -\LetLtxMacro\LWR@origv\v -\LetLtxMacro\LWR@origc\c -\LetLtxMacro\LWR@origd\d -\LetLtxMacro\LWR@origb\b +\LetLtxMacro\LWR@origdiaeresisaccent\" +\LetLtxMacro\LWR@origdoubleacuteaccent\H +\LetLtxMacro\LWR@origcaronaccent\v +\LetLtxMacro\LWR@origdotbelowaccent\d +\LetLtxMacro\LWR@origcedillaaccent\c +\LetLtxMacro\LWR@origmacronbelowaccent\b % \end{macrocode} % The \HTML\ redefinitions follow. % % For pdf\LaTeX, Unicode diacritical marks are used: % \begin{macrocode} -\renewcommand*{\=}[1]{#1\HTMLunicode{0305}} -\renewcommand*{\.}[1]{#1\HTMLunicode{0307}} +\renewcommand*{\`}[1]{#1\HTMLunicode{0300}} +\renewcommand*{\'}[1]{#1\HTMLunicode{0301}} +\renewcommand*{\^}[1]{#1\HTMLunicode{0302}} +\renewcommand*{\~}[1]{#1\HTMLunicode{0303}} +\renewcommand*{\=}[1]{#1\HTMLunicode{0304}} \renewcommand*{\u}[1]{#1\HTMLunicode{0306}} +\renewcommand*{\.}[1]{#1\HTMLunicode{0307}} +\renewcommand*{\"}[1]{#1\HTMLunicode{0308}} +\renewcommand*{\H}[1]{#1\HTMLunicode{030B}} \renewcommand*{\v}[1]{#1\HTMLunicode{030C}} -\renewcommand*{\c}[1]{#1\HTMLunicode{0327}} \renewcommand*{\d}[1]{#1\HTMLunicode{0323}} +\renewcommand*{\c}[1]{#1\HTMLunicode{0327}} \renewcommand*{\b}[1]{#1\HTMLunicode{0331}} \fi % \end{macrocode} @@ -15467,18 +15787,24 @@ This boolean may be tested by the user for later use. % \begin{macrocode} \ifPDFTeX% pdflatex or dvi latex \newcommand*{\LWR@restoreorigaccents}{% -\LetLtxMacro\=\LWR@origequalaccent% -\LetLtxMacro\.\LWR@origdotaccent% -\LetLtxMacro\u\LWR@origu% -\LetLtxMacro\v\LWR@origu% -\LetLtxMacro\t\LWR@origt% -\LetLtxMacro\c\LWR@origc% -\LetLtxMacro\d\LWR@origd% -\LetLtxMacro\b\LWR@origb% + \LetLtxMacro\`\LWR@origgraveaccent% + \LetLtxMacro\'\LWR@origacuteaccent% + \LetLtxMacro\^\LWR@origcircumflexaccent% + \LetLtxMacro\~\LWR@origtildeaccent% + \LetLtxMacro\=\LWR@origmacronaccent% + \LetLtxMacro\u\LWR@origbreve% + \LetLtxMacro\.\LWR@origdotaccent% + \LetLtxMacro\"\LWR@origdiaeresisaccent% + \LetLtxMacro\H\LWR@origdoubleacuteaccent% + \LetLtxMacro\v\LWR@origcaronaccent% + \LetLtxMacro\t\LWR@origtie% + \LetLtxMacro\d\LWR@origdotbelowaccent% + \LetLtxMacro\c\LWR@origcedillaaccent% + \LetLtxMacro\b\LWR@origmacronbelowaccent% }% \else% XeLaTeX, LuaLaTeX: \newcommand*{\LWR@restoreorigaccents}{% -\LetLtxMacro\t\LWR@origt% + \LetLtxMacro\t\LWR@origtie% }% \fi% }% AtBeginDocument @@ -15513,7 +15839,7 @@ This boolean may be tested by the user for later use. % Default to no configuration files: % \changes{v0.61}{2018/10/02}{Don't write configuration files if processing \pkg{pstool} image.} % \begin{macrocode} -\excludecomment{LWRwriteconf} +\LWR@excludecomment{LWRwriteconf}{writeconf} % \end{macrocode} % % Generate configuration files if print mode and not \filenm{-pstool}: @@ -15531,7 +15857,7 @@ This boolean may be tested by the user for later use. } { \PackageInfo{lwarp}{Generating lwarp configuration files,}% - \includecomment{LWRwriteconf} + \LWR@includecomment{LWRwriteconf}{writeconf} } \end{warpprint} % \end{macrocode} @@ -15626,9 +15952,12 @@ This boolean may be tested by the user for later use. % Error message if not sure which \LaTeX\ engine is being used. % \begin{macrocode} \newcommand*{\LWR@unknownengine}{% - \PackageError{lwarp} - {Unknown LaTeX engine.} - {Lwarp only knows about pdflatex, dvi latex, xelatex, lualatex, and upLateX.} + \PackageError{lwarp}% + {Unknown LaTeX engine}% + {% + Lwarp only knows about pdflatex, dvi latex, + xelatex, lualatex, and upLateX.% + }% } % \end{macrocode} % \end{macro} @@ -16041,6 +16370,11 @@ This boolean may be tested by the user for later use. % \changes{v0.76}{2019/10/02}{\filenm{lwarp.css}: Fix for small caps.} % \changes{v0.79}{2020/01/17}{\filenm{lwarp.css}: Fix: Nested \env{tabular}s.} % \changes{v0.81}{2020/02/22}{\filenm{lwarp.css}: Added \pkg{nolbreaks}.} +% \changes{v0.84}{2020/03/28}{\filenm{lwarp.css}: Added \pkg{koma-*} subject.} +% \changes{v0.84}{2020/04/10}{\filenm{lwarp.css}: Improved \pkg{realscripts}.} +% \changes{v0.84}{2020/04/13}{\filenm{lwarp.css}: Improved \pkg{nfssext-cfr}.} +% \changes{v0.84}{2020/04/18}{\filenm{lwarp.css}: Fix: Minipage tex align.} +% \changes{v0.84}{2020/04/24}{\filenm{lwarp.css}: Fix: Top nav if narrow window.} % % ^^A *lwarp.css % @@ -16126,10 +16460,6 @@ span.textit, div.textit { font-style: italic; } span.textmd, div.textmd { font-weight: normal; } -span.texteb { font-weight: bolder; } - -span.textlg { font-weight: lighter; } - span.textup, div.textup { font-style: normal; font-variant: normal; @@ -16158,6 +16488,52 @@ span.textsf, div.textsf { Geneva, Verdana, sans-serif ; } +/* nfssext-cfr lining figures */ +span.textln, div.textln { + font-variant-numeric: lining-nums ; +} + +/* nfssext-cfr proportional figures */ +span.textp, div.textp { + font-variant-numeric: proportional-nums ; +} + +/* nfssext-cfr tabular figures */ +span.textt, div.textt { + font-variant-numeric: tabular-nums ; +} + +/* nfssext-cfr font weights */ +span.textdb, div.textdb { + font-weight: 500 ; +} + +span.textsb, div.textsb { + font-weight: 600 ; +} + +span.texteb, div.texteb { + font-weight: 800 ; +} + +span.textub, div.textub { + font-weight: 900 ; +} + +span.textlg, div.textlg { + font-weight: 300 ; +} + +span.textel, div.textel { + font-weight: 200 ; +} + +span.textul, div.textul { + font-weight: 100 ; +} + + + span.textcircled { border: 1px solid black ; border-radius: 1ex ; } span.underline { @@ -16202,16 +16578,16 @@ div.diagboxW { .supsubscript sub { position: relative; display: block; - font-size: .5em; + font-size: .7em; line-height: 1; } .supsubscript sup { - top: .5em; + top: .3em; } .supsubscript sub { - top: .5em; + top: .3em; } div.attribution p { @@ -16693,6 +17069,7 @@ div.wpminipage { border: 1px solid green ; margin: .5ex ; padding: .5ex ;} .minipage, .fminipage, .fcolorminipage { /* display: inline-block ; */ /* Mini pages which follow each other will be tiled. */ + text-align:left; margin: .25em .25em .25em .25em; padding: .25em .25em .25em .25em; display: inline-flex; @@ -17188,6 +17565,26 @@ span.verbatim { +div.titlehead +{ + text-align: left ; + font-style: normal ; + font-weight: normal ; + font-style: normal ; + font-size: .8em ; + margin: 1ex 0em 1ex 0em ; +} + +div.subject +{ + text-align: center ; + font-style: normal ; + font-weight: bold ; + font-style: normal ; + font-size: .8em ; + margin: 1ex 0em 1ex 0em ; +} + div.published { text-align: center ; @@ -17282,6 +17679,7 @@ footer { } +/* for \LinkHome, \LinkPrevious, and \LinkNext: */ a.linkhome { font-weight:bold ; font-size: 1em ;} @@ -17620,6 +18018,7 @@ span.sidetocthetitle { display: none } box-shadow: none ; } span.sidetocthetitle { display: inline } + nav.topnavigation { display:block } nav.botnavigation { display:block } div.bodycontainer { width: 100% } .marginpar { @@ -18599,11 +18998,12 @@ src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.6/MathJax.js?config=TeX- % \changes{v0.74}{2019/08/05}{\prog{lwarpmk}: \cmds{lwarpmk clean} removes add'l files.}% % \changes{v0.74}{2019/08/14}{\prog{lwarpmk}: \cmds{lwarpmk epstopdf} and \cmds{pdftosvg} honor directories.}% % \changes{v0.81}{2020/03/04}{\prog{lwarpmk}: Improved error if in \pkg{lwarp} source directory.}% +% \changes{v0.84}{2020/03/30}{\prog{lwarpmk}: \optn{clean} also removes \filenm{comment_*.cut}}% % % The following is only generated if the \optn{lwarpmk} option % was given to \pkg{lwarp}. % \begin{macrocode} -\begin{LWR@createlwarpmk} +\begin{LWRcreatelwarpmk} % \end{macrocode} % % ^^A *lwarpmk.lua @@ -18614,7 +19014,7 @@ src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.6/MathJax.js?config=TeX- -- Copyright 2016-2020 Brian Dunn -printversion = "v0.83" +printversion = "v0.84" requiredconfversion = "2" -- also at *lwarpmk.conf function printhelp () @@ -19008,7 +19408,7 @@ function removeaux () -- Remove auxiliary files: -- All .aux files are removed since there may be many bbl*.aux files. -- Also removes sourcename_html.pdf, sourcename_html.html, --- and sourcename_html.sidetoc. +-- and sourcename_html.sidetoc, plus comment_*.cut. -- os.execute ( rmname .. " *.aux " .. sourcename ..".toc " .. sourcename .. "_html.toc " .. @@ -19022,7 +19422,8 @@ os.execute ( rmname .. " *.aux " .. sourcename .. "_html.pdf " .. sourcename .. "_html.html " .. sourcename .. "_html.sidetoc " .. - " *_html_inc.* " + " *_html_inc.* " .. + " comment_*.cut" ) end @@ -19568,7 +19969,7 @@ end -- not --version % \end{macrocode} % % \begin{macrocode} -\end{LWR@createlwarpmk} +\end{LWRcreatelwarpmk} % \end{macrocode} % @@ -20082,7 +20483,7 @@ end -- not --version % such as 100+ for one chapter, 200+ for another chapter, etc. % \begin{macrocode} \newcommand*{\SetHTMLFileNumber}[1]{% -\setcounter{LWR@htmlfilenumber}{#1}% + \setcounter{LWR@htmlfilenumber}{#1}% } % \end{macrocode} % \end{macro} @@ -20108,9 +20509,43 @@ end -- not --version % \end{macrocode} +% Updated each time a new \HTML\ file is begun. +% Used to provide \HTML\ previous/next web page links. +% \begin{macrocode} +\newcounter{LWR@HTMLpagenum} +\setcounter{LWR@HTMLpagenum}{0} +% \end{macrocode} + + +% \DescribeCounter{LWR@htmlseqfilenumber} +% A sequential count of the number of each \HTML\ file as it is being created. +% Number 0 is the home page. +% Unlike \cs{LWR@htmlfilenumber}, this one is known to increment by one +% for each file. This is used to generate previous \slash next links for +% each web page, via labels called |\BaseJobname-autofile-*|, and the +% last page is also labelled |\BaseJobname-autofile-last|. +% +% \changes{v0.84}{2020/04/24}{Added prev/next links.} +% \begin{macrocode} +\newcounter{LWR@htmlseqfilenumber} +\setcounter{LWR@htmlseqfilenumber}{0} +% \end{macrocode} + +% \DescribeBoolean{LWR@setseqfilelabel} +% At each new \HTML\ file, this is false until a sectional unit is used, +% at which point this is set true and a label is placed. +% In this way, the previous/next labels will point to a named section. +% \begin{macrocode} +\newbool{LWR@setseqfilelabel} +\setbool{LWR@setseqfilelabel}{false} +% \end{macrocode} + + % \DescribeCounter{LWR@htmlfilenumber} % Records the number of each \HTML\ file as it is being created. % Number 0 is the home page. +% This might not be sequential, as the user may use +% \cs{SetHTMLFileNumber} to create groups of numbered nodes. % \begin{macrocode} \newcounter{LWR@htmlfilenumber} \setcounter{LWR@htmlfilenumber}{0} @@ -20125,6 +20560,8 @@ end -- not --version % \changes{v0.20}{2016/09/11}{Sections called ``Index'' or ``index'' have an underscore % prepended to their filenames if no prefix.} % \changes{v0.66}{2019/01/30}{Sanitize underscores.} +% \changes{v0.84}{2020/04/10}{Fix: Sections called ``Index'' or ``index'' have \filenm{-0} +% appended to their filenames if no prefix.} % % Prints the filename for a given section: |\HTMLFilename{}filenumber/name.html| % \begin{macrocode} @@ -20144,33 +20581,35 @@ end -- not --version % \LWR@traceinfo{about to assign temp}% \LWR@sanitize{#1}% \LWR@traceinfo{about to compare with ??}% -\ifthenelse{\equal{\LWR@sanitized}{??}}% +\ifdefstring{\LWR@sanitized}{??} {\LWR@traceinfo{found ??}}% {\LWR@traceinfo{not found ??}}% \LWR@traceinfo{about to compare with zero or empty}% -\ifthenelse{% - \equal{\LWR@sanitized}{0}% - \OR \equal{\LWR@sanitized}{}% - \OR \equal{\LWR@sanitized}{??}% -}% +\ifboolexpr{ + test {\ifdefstring{\LWR@sanitized}{0}} or + test {\ifdefstring{\LWR@sanitized}{}} or + test {\ifdefstring{\LWR@sanitized}{??}} +} {% \LWR@traceinfo{LWR@htmlsectionfilename B \HomeHTMLFilename.html}% \HomeHTMLFilename.html% }% % \end{macrocode} % For a \LaTeX\ section named ``Index'' or ``index'' without a prefix, create a filename -% with a leading underscore to avoid colliding with the \HTML\ filename |index.html|: +% with a trailing \filenm{-0} to avoid colliding with the \HTML\ filename |index.html|: % \begin{macrocode} {% \LWR@traceinfo{LWR@htmlsectionfilename C \LWR@sanitized}% - \ifthenelse{% - \equal{\HTMLFilename}{} \AND - \equal{\LWR@sanitized}{Index} \OR - \equal{\LWR@sanitized}{index}% + \ifboolexpr{ + test{\ifdefvoid{\HTMLFilename}} and + ( + test{\ifdefstring{\LWR@sanitized}{Index}} or + test{\ifdefstring{\LWR@sanitized}{index}} + ) }% {% - \LWR@traceinfo{Prefixing the index name with an underscore.}% - \_\LWR@sanitized.html% + \LWR@traceinfo{Adding a zero to the index filename.}% + \LWR@sanitized-0.html% }% % \end{macrocode} % Otherwise, create a filename with the chosen prefix: @@ -20192,15 +20631,15 @@ end -- not --version % \changes{v0.50}{2018/02/20}{Fix: SVG math in a section name.} % \begin{macrocode} \newcommand*{\LWR@htmlrefsectionfilename}[1]{% -\LWR@traceinfo{LWR@htmlrefsectionfilename: !\detokenize{#1}!}% + \LWR@traceinfo{LWR@htmlrefsectionfilename: !\detokenize{#1}!}% % \end{macrocode} % \cs{LWR@nullfonts} to allow math in a section name. % \begin{macrocode} -\begingroup% -\LWR@nullfonts% -\LWR@htmlsectionfilename{\LWR@htmlfileref{#1}}% -\endgroup% -\LWR@traceinfo{LWR@htmlrefsectionfilename: done}% + \begingroup% + \LWR@nullfonts% + \LWR@htmlsectionfilename{\LWR@htmlfileref{#1}}% + \endgroup% + \LWR@traceinfo{LWR@htmlrefsectionfilename: done}% } % \end{macrocode} % \end{macro} @@ -20243,7 +20682,7 @@ end -- not --version % The filename must be detokenized for underscores. % \begin{macrocode} \newcommand*{\LinkHome}{% -\LWR@subhyperrefclass{\HomeHTMLFilename.html}{\linkhomename}{linkhome}% + \LWR@subhyperrefclass{\HomeHTMLFilename.html}{\linkhomename}{linkhome}% } % \end{macrocode} % \end{macro} @@ -20302,8 +20741,8 @@ end -- not --version % Creates a link to the homepage at the top of the page for use when the window is too % narrow for the side\TOC. % \begin{macrocode} -\newcommand*{\LWR@topnavigation}{ -\LWR@htmlelementclassline{nav}{topnavigation}{\LinkHome} +\newcommand*{\LWR@topnavigation}{% + \LWR@htmlelementclassline{nav}{topnavigation}{\LinkHome} } % \end{macrocode} % \end{macro} @@ -20313,8 +20752,8 @@ end -- not --version % Creates a link to the homepage at the bottom of the page for use when the window is too % narrow for the side\TOC. % \begin{macrocode} -\newcommand*{\LWR@botnavigation}{ -\LWR@htmlelementclassline{nav}{botnavigation}{\LinkHome} +\newcommand*{\LWR@botnavigation}{% + \LWR@htmlelementclassline{nav}{botnavigation}{\LinkHome} } % \end{macrocode} % \end{macro} @@ -20324,6 +20763,110 @@ end -- not --version % \end{macrocode} +% \section{Previous \Slash next navigation links} + +% \codeall +% \begin{macrocode} +\begin{warpall} +% \end{macrocode} + +% \begin{macro}{\linkpreviousname} What to call the link to the previous web page. +% \changes{v0.84}{2020/04/24}{Added prev/next links.} +% \begin{macrocode} +\newcommand*{\linkpreviousname}{Previous} +% \end{macrocode} +% \end{macro} + +% \begin{macro}{\linknextname} What to call the link to the next web page. +% \changes{v0.84}{2020/04/24}{Added prev/next links.} +% \begin{macrocode} +\newcommand*{\linknextname}{Next} +% \end{macrocode} +% \end{macro} + +% \begin{macrocode} +\end{warpall} +% \end{macrocode} + + +% \codeprint +% \begin{macrocode} +\begin{warpprint} +% \end{macrocode} + +% \begin{macro}{\LinkPrevious} Creates a link to the previous web page if there is one. +% \begin{macrocode} +\newcommand*{\LinkPrevious}{} +% \end{macrocode} +% \end{macro} + +% \begin{macro}{\LinkNext} Creates a link to the next web page if there is one. +% \begin{macrocode} +\newcommand*{\LinkNext}{} +% \end{macrocode} +% \end{macro} + +% \begin{macrocode} +\end{warpprint} +% \end{macrocode} + + +% \codehtml +% \begin{macrocode} +\begin{warpHTML} +% \end{macrocode} + +% \begin{macro}{\LinkPrevious} Creates a link to the previous web page if there is one. +% +% The links refer to the \LaTeX\ labels |\Basejobname-autofile-*| +% +% \changes{v0.84}{2020/04/24}{Added prev/next links.} +% \begin{macrocode} +\newcommand*{\LinkPrevious}{% + \ifnumless{\value{LWR@htmlseqfilenumber}}{1}{}{% + \setcounter{LWR@tempcountone}{\value{LWR@htmlseqfilenumber}-1}% + \LWR@subhyperrefclass{% + \LWR@htmlrefsectionfilename{% + \BaseJobname-autofile-\arabic{LWR@tempcountone}% + }% + }{\linkpreviousname}{linkhome}% + }% +} +% \end{macrocode} +% \end{macro} + +% \begin{macro}{\LinkNext} Creates a link to the next web page if there is one. +% +% The links refer to the \LaTeX\ labels |\Basejobname-autofile-*| \\ +% and the last is the label |\Basejobname-autofile-last| +% +% \changes{v0.84}{2020/04/24}{Added prev/next links.} +% \begin{macrocode} +\newcommand*{\LinkNext}{% + \ifcsdef{r@\BaseJobname-autofile-last@lwarp}{% + \edef\LWR@tempone{% + \LWR@htmlfileref{\BaseJobname-autofile-\arabic{LWR@htmlseqfilenumber}}% + }% + \edef\LWR@temptwo{% + \LWR@htmlfileref{\BaseJobname-autofile-last}% + }% + \ifdefequal{\LWR@tempone}{\LWR@temptwo}{}{% + \setcounter{LWR@tempcountone}{\value{LWR@htmlseqfilenumber}+1}% + \LWR@subhyperrefclass{% + \LWR@htmlrefsectionfilename{% + \BaseJobname-autofile-\arabic{LWR@tempcountone}% + }% + }{\linknextname}{linkhome}% + }% + }{}% +} +% \end{macrocode} +% \end{macro} + +% \begin{macrocode} +\end{warpHTML} +% \end{macrocode} + % \section{\cs{LWRPrintStack} diagnostic tool} @@ -20689,6 +21232,35 @@ end -- not --version % \end{macro} % +% \begin{macro}{\LWR@spanwarnformat} \marg{object} +% +% Warns if the given object is used inside a span. +% \begin{macrocode} +\newcommand*{\LWR@spanwarnformat}[1]{% + \ifnumcomp{\value{LWR@spandepth}}{>}{0}{% + \PackageWarning{lwarp}{% + A #1 is being used inside a span.\MessageBreak + Formatting may be lost,% + }% + }{}% +} +% \end{macrocode} +% \end{macro} + +% \begin{macro}{\LWR@spanwarninvalid} \marg{object} +% +% Warns if the given object is used inside a span. +% \begin{macrocode} +\newcommand*{\LWR@spanwarninvalid}[1]{% + \ifnumcomp{\value{LWR@spandepth}}{>}{0}{% + \PackageWarning{lwarp}{% + A #1 is being used inside a span.\MessageBreak + This generates invalid HTML,% + }% + }{}% +} +% \end{macrocode} +% \end{macro} % \begin{environment}{LWR@nestspan} Disable \env{minipage}, \cs{parbox}, % and \HTML\ \element{div}s inside a \element{span}. @@ -20706,6 +21278,8 @@ end -- not --version % \changes{v0.44}{2017/11/15}{Added \env{list} and \env{trivlist}.} % \changes{v0.70}{2019/04/02}{Improved \env{minipage}, \cs{parbox} inside a span.} % \changes{v0.73}{2019/06/23}{Fix: \env{quote}, \env{quotation} inside a span.} +% \changes{v0.84}{2020/04/22}{Nullified \env{minipage}, \cs{parbox} inside a span.} +% \changes{v0.84}{2020/04/22}{Issue warnings inside a span.} % % \begin{macrocode} \newcommand*{\LWR@nestspanitem}{% @@ -20723,11 +21297,21 @@ end -- not --version {% not in a lateximage \LWR@traceinfo{LWR@nestspan: NOT inside a lateximage}% \addtocounter{LWR@spandepth}{1}% +% \end{macrocode} +% Nullify several objects inside the span: +% ^^A {\LWR@subhtmlelementclass{span}{inlineminipage}}% +% ^^A {\LWR@htmltagc{/span}}% +% \begin{macrocode} \RenewDocumentEnvironment{minipage}{O{t} o O{t} m}% - {\LWR@subhtmlelementclass{span}{inlineminipage}}% - {\LWR@htmltagc{/span}}% - \RenewDocumentEnvironment{BlockClass}{o m}{}{}% - \renewcommand{\BlockClassSingle}[2]{##2}% + {\LWR@spanwarnformat{minipage or \protect\parbox}}% + {}% + \RenewDocumentEnvironment{BlockClass}{o m}% + {\LWR@spanwarnformat{multi-paragraph object}}% + {}% + \renewcommand{\BlockClassSingle}[2]{% + {\LWR@spanwarnformat{multi-paragraph object}}% + ##2% + }% \renewcommand{\LWR@forcenewpage}{}% \renewcommand{\LWR@liststart}{% \let\item\LWR@nestspanitem% @@ -21043,12 +21627,12 @@ end -- not --version % \codehtml % \begin{macrocode} \begin{warpHTML} + \NewDocumentEnvironment{LWR@print@BlockClass}{o m}{}{}% + \NewDocumentEnvironment{LWR@HTML@BlockClass}{o m}% -{% - \LWR@htmldivclass[#1]{#2}% -} -{\LWR@htmldivclassend{#2}} + {\LWR@htmldivclass[#1]{#2}} + {\LWR@htmldivclassend{#2}} \LWR@formattedenv{BlockClass} \end{warpHTML} @@ -21073,7 +21657,7 @@ end -- not --version % \begin{macrocode} \begin{warpHTML} \newcommand{\LWR@HTML@BlockClassSingle}[2]{% -\LWR@htmlelementclassline{div}{#1}{#2}% + \LWR@htmlelementclassline{div}{#1}{#2}% } \LWR@formatted{BlockClassSingle} @@ -21497,14 +22081,18 @@ end -- not --version % \begin{macro}{\LWR@startpars} % Begin handling \HTML\ paragraphs. % This allows an \HTML\ paragraph to start, but one has not yet begun. +% \changes{v0.84}{2020/04/14}{Ignore if in \env{lateximage}.} % \begin{macrocode} \newcommand*{\LWR@startpars}% {% % \LWR@traceinfo{LWR@startpars}% % \end{macrocode} -% Ignore if inside a span: +% Ignore if inside a \env{lateximage} or \element{span}: % \begin{macrocode} -\ifnumcomp{\value{LWR@spandepth}}{>}{0}% +\ifboolexpr{ + test {\ifnumcomp{\value{LWR@lateximagedepth}}{>}{0}} or + test {\ifnumcomp{\value{LWR@spandepth}}{>}{0}} +}% {}% {% % \end{macrocode} @@ -21550,13 +22138,17 @@ end -- not --version % Any currently open \HTML\ paragraph is closed, and no more will be opened. % % \changes{v0.36}{2017/08/15}{Extra \protect\HTML\ source space after paragraphs.} +% \changes{v0.84}{2020/04/14}{Ignore if in \env{lateximage}.} % \begin{macrocode} \newcommand*{\LWR@stoppars}% {% % \end{macrocode} -% Ignore if inside a span: +% Ignore if inside a \env{lateximage} or \element{span}: % \begin{macrocode} -\ifnumcomp{\value{LWR@spandepth}}{>}{0}% +\ifboolexpr{ + test {\ifnumcomp{\value{LWR@lateximagedepth}}{>}{0}} or + test {\ifnumcomp{\value{LWR@spandepth}}{>}{0}} +}% {}% {% % \end{macrocode} @@ -21635,14 +22227,12 @@ end -- not --version % \begin{macrocode} \AtBeginDocument{ -\def\@afterindentfalse{\let\if@afterindent\iffalse} -\@afterindentfalse + \def\@afterindentfalse{\let\if@afterindent\iffalse} + \@afterindentfalse } \let\LWR@afterindent@syntaxhighlight\fi% syntax highlighting % \end{macrocode} - - % \begin{macrocode} \end{warpHTML} % \end{macrocode} @@ -21658,8 +22248,10 @@ end -- not --version % In the following, catcode is manually changed back and forth % without groups, since new macros are being defined which must % not be contained within the groups. +% \changes{v0.84}{2020/04/24}{Added \cs{FirstPageBottom}.} % \begin{macrocode} \newcommand{\LWR@firstpagetop}{} % for the home page alone +\newcommand{\LWR@firstpagebottom}{} % for the home page alone \newcommand{\LWR@pagetop}{} % for all other pages \newcommand{\LWR@pagebottom}{} % \end{macrocode} @@ -21678,6 +22270,19 @@ end -- not --version % % \end{macro} % +% \begin{macro}{\HTMLFirstPageBottom} \marg{text and logos} +% +% \changes{v0.84}{2020/04/24}{Added \cs{FirstPageBottom}.} +% +% \begin{macrocode} +\newcommand{\HTMLFirstPageBottom}[1]{% + \renewcommand{\LWR@firstpagebottom}{#1}% +} +% \end{macrocode} +% +% +% \end{macro} +% % % \begin{macro}{\HTMLPageTop} \marg{text and logos} % @@ -22198,7 +22803,7 @@ end -- not --version % \changes{v0.48}{2018/02/11}{Removed \cs{itshape}.} % \begin{macrocode} \AtBeginDocument{ -\def\thempfootnote{\@alph\c@mpfootnote} + \def\thempfootnote{\@alph\c@mpfootnote} } % \end{macrocode} % \end{macro} @@ -22440,6 +23045,7 @@ end -- not --version \begin{warpHTML} % \end{macrocode} + % \begin{macro}{\LWR@thisfilename} % The currently-active filename or number. % At first, this is the homepage. @@ -22513,6 +23119,27 @@ end -- not --version % \end{macro} +% \begin{macro}{\LWR@avoiddupfilenames} \qquad +% Instructions for how to avoid duplicate filenames. +% This is used in a warning in \cs{LWR@filenamenoblanks}, +% and in an error in \cs{LWR@newhtmlfile}. +% \begin{macrocode} +\newcommand*{\LWR@avoiddupfilenames}{% + To avoid duplicate filenames, use the optional\MessageBreak + short Table of Contents entry:\MessageBreak + \space\space\protect\section[Unique name, no math]{Name with math}% + \MessageBreak + or use \protect\texorpdfstring, from the hyperref package:\MessageBreak + \space\space% + \protect\section{\MessageBreak + \space\space\space\space\protect\texorpdfstring\MessageBreak + \space\space\space\space\space\space% + {Name with math}{Unique name, no math}\MessageBreak + \space\space} +} +% \end{macrocode} +% \end{macro} + % \begin{macro}{\LWR@filenamenoblanks} \marg{filename} % @@ -22539,6 +23166,7 @@ end -- not --version % \begin{macrocode} \edef\LWR@thisnewfilename{#1}% % \end{macrocode} +% % Replaces common macros with hyphens. % (\cs{\&} is done by \cs{LWR@nullfonts}.) % \begin{macrocode} @@ -22555,6 +23183,31 @@ end -- not --version % \begin{macrocode} \edef\LWR@thisnewfilename{\detokenize\expandafter{\LWR@thisnewfilename}}% % \end{macrocode} +% +% Warn if there is dollar math in the section name: +% \begin{macrocode} +\ifbool{FileSectionNames}{% + \IfSubStr{\LWR@thisnewfilename}{\LWRdollar}{% + \PackageWarning{lwarp} + {% + This section name:\MessageBreak + \space\space``\detokenize\expandafter{#1}''\MessageBreak + at the line number listed below,\MessageBreak + is using $dollar-delimited math$, + which generates\MessageBreak + complicated file names. It is better to use\MessageBreak + \space\space% + \protect\section{Name with \protect\(parenthesis math\protect\)}% + \MessageBreak + The math then will be removed from the file name.\MessageBreak + \MessageBreak + \LWR@avoiddupfilenames% + \MessageBreak + This section is found before or% + } + }{}% +}{} +% \end{macrocode} % \begin{macrocode} \LWR@traceinfo{LWR@filenamenoblanks edef: !\LWR@thisnewfilename!}% \fullexpandarg% @@ -22631,28 +23284,31 @@ end -- not --version % \begin{macrocode} \LWR@simplifycustom% % \end{macrocode} -% Convert multiple hyphens: -% \begin{macrocode} -\LWR@simplifyname*{-----} -\LWR@simplifyname*{----} -\LWR@simplifyname*{---} -\LWR@simplifyname*{--} -% \end{macrocode} +% % If pdf\LaTeX\ and not \optn{utf8} encoding, don't try to convert emdash, endash: % \changes{v0.52}{2018/04/01}{Fix: \cs{FileDepth} with non-utf8 encoding.} +% \changes{v0.84}{2020/04/21}{Fix: Dashes in filename.} % \begin{macrocode} \ifPDFTeX% pdflatex or dvi latex \ifdefstring{\inputencodingname}{utf8}{% -\LWR@simplifyname*{—} + \LWR@simplifyname*{—} % emdash -\LWR@simplifyname*{–} + \LWR@simplifyname*{–} % endash }{}% \else% not PDFTeX -\LWR@simplifyname*{—} -\LWR@simplifyname*{–} + \LWR@simplifyname*{—} + \LWR@simplifyname*{–} \fi% % \end{macrocode} +% +% Convert multiple hyphens: +% \begin{macrocode} +\LWR@simplifyname*{-----} +\LWR@simplifyname*{----} +\LWR@simplifyname*{---} +\LWR@simplifyname*{--} +% \end{macrocode} % If starts with a dash, remove the leading dash: % \begin{macrocode} \IfBeginWith{\LWR@thisnewfilename}{\detokenize{-}}{% @@ -22899,7 +23555,7 @@ end -- not --version \ifbool{LWR@warnedcustomizemathjax}{}{% \StrLen{\detokenize{#1}}[\LWR@tempone]% \ifnumgreater{\LWR@tempone}{200}{% - \AtBeginDocument{% + \AtEndDocument{% \PackageWarningNoLine{lwarp}{% To ensure faster MathJax compilation, place each\MessageBreak custom macro in its own \protect\CustomizeMathJax.\MessageBreak @@ -23122,6 +23778,34 @@ end -- not --version \begin{warpHTML} % \end{macrocode} + +% \begin{macro}{\LWR@createfooter} If specified, create the first or later web page footer. +% \changes{v0.73}{2019/06/23}{Fix: Empty header/footer.} +% \changes{v0.84}{2020/04/24}{Added \cs{FirstPageBottom}.} +% \begin{macrocode} +\newcommand*{\LWR@createfooter}{% + \ifnumless{\value{LWR@htmlseqfilenumber}}{1}{% + \ifdefempty{\LWR@firstpagebottom}{}{% + \LWR@htmlelement{footer} + + \LWR@firstpagebottom + + \LWR@htmlelementend{footer} + }% + }{% + \ifdefempty{\LWR@pagebottom}{}{% + \LWR@htmlelement{footer} + + \LWR@pagebottom + + \LWR@htmlelementend{footer} + }% + }% +} +% \end{macrocode} +% \end{macro} + + % \begin{macro}{\LWR@newhtmlfile} \marg{section name} % \changes{v0.18}{2016/04/23}{side\TOC\ after title, improving responsive design.} % \changes{v0.21}{2017/02/22}{Skip title if not given.} @@ -23151,20 +23835,7 @@ end -- not --version % % No footer between files if \EPUB: % \begin{macrocode} -\ifbool{FormatEPUB} -{} -{ -% \end{macrocode} -% \changes{v0.73}{2019/06/23}{Fix: Empty header/footer.} -% \begin{macrocode} - \ifdefempty{\LWR@pagebottom}{}{% - \LWR@htmlelement{footer} - - \LWR@pagebottom - - \LWR@htmlelementend{footer} - } -} +\ifbool{FormatEPUB}{}{\LWR@createfooter} % \end{macrocode} % % @@ -23183,8 +23854,11 @@ end -- not --version \LWR@htmltag{/html}\LWR@orignewline \LWR@traceinfo{LWR@newhtmlfile: about to LWR@orignewpage} \LWR@orignewpage - +% \end{macrocode} +% \changes{v0.84}{2020/04/24}{Added prev/next links.} +% \begin{macrocode} \addtocounter{LWR@htmlfilenumber}{1}% +\addtocounter{LWR@htmlseqfilenumber}{1}% % \end{macrocode} % % @@ -23221,23 +23895,25 @@ end -- not --version % \end{macrocode} % If the filename is not unique, create an error. % \begin{macrocode} - \PackageError{lwarp} + \PackageError{lwarp}% {% - Section name\MessageBreak + The section name:\MessageBreak ``#1'',\MessageBreak at the line number listed below,\MessageBreak generates the filename\MessageBreak ``\LWR@thisfilename'',\MessageBreak - which appears to be a duplicate.\MessageBreak - There is a previous section with an\MessageBreak - identical or similar name% - } + which appears to be a duplicate. There is a\MessageBreak + previous section with an identical or similar name.\MessageBreak + While generating file names, Lwarp sanitizes math,\MessageBreak + most symbols, and a few common short words,\MessageBreak + and this may cause a conflict.\MessageBreak + Enter 'H' for possible solutions% + }% {% - Lwarp sanitizes most symbols and a few common short words - when generating file names, and this may cause a conflict. - } - } -} + \LWR@avoiddupfilenames% + }% + }% +}% % \end{macrocode} % If using file numbers instead of names, the name is set to the next file number. % \begin{macrocode} @@ -23278,7 +23954,7 @@ end -- not --version % \end{macrocode} % -% Track the page numbers: +% Track the \PDF\ page numbers of the \HTML\ output: % \changes{v0.48}{2018/02/11}{Fix: \TOC, \LOF, \LOT\ links.} % \begin{macrocode} \setcounter{LWR@latestautopage}{\value{page}}% @@ -23332,10 +24008,17 @@ end -- not --version % % Start of the \element{textbody}: % \changes{v0.65}{2018/12/18}{Improved \CSS\ for page layout.} +% \changes{v0.84}{2020/04/24}{Added prev/next links.} % \begin{macrocode} \LWR@htmlelementclass{div}{bodycontainer} \LWR@htmlelementclass{section}{textbody} - +% \end{macrocode} +% +% Not yet found a new section in this file. +% Once one is found, a label will be placed for +% previous/next links. +% \begin{macrocode} +\boolfalse{LWR@setseqfilelabel} % \end{macrocode} % % @@ -23396,18 +24079,24 @@ end -- not --version % \prog{pdflatex} to generate characters and \prog{pdftotext} to read them. % If extra symbols appear in the text, % \trouble[accents in filenames]{filename>accents} +% \trouble{accents>file names} % \trouble{sectioning>accents} % \gindex{filename>accent in} % \gindex{accents>in section \& file names} % it may be that \prog{pdflatex} is actually producing a symbol over or under a % character, resulting in \prog{pdftotext} picking up the accent symbol separately. % -% \XeLaTeX{} and \LuaLaTeX{} directly support accented section and file names. +% \XeLaTeX{} and \LuaLaTeX{} directly support accented section and file names, % \gindex{accents>in section \& file names} % \gindex{Unicode>file \& section names} % \gindex{UTF-8>file \& section names} % \gindex{Xe\LaTeX>file \& section names} % \gindex{Lua\LaTeX>file \& section names} +% but it may be necessary to use \LaTeX\ accents instead of +% native Unicode accents. \LaTeX\ accents will have the accents stripped +% when creating file names, whereas using Unicode accents will create filenames +% which include accents, which may cause issues with some operating systems. +% % % % \codehtml @@ -23541,6 +24230,10 @@ end -- not --version % \begin{macro}{\LWR@createautosec} \marg{section type} % % Create an autosection tag. +% +% The use of \cs{textquotedbl} instead of |"| provides improved +% compatibility with \pkg{xeCJK}. +% % \changes{v0.47}{2018/01/26}{Fix: Line wrap at \HTML\ hyphen.} % \changes{v0.63}{2018/11/24}{Fix for \pkg{xeCJK}.} % \begin{macrocode} @@ -23689,6 +24382,13 @@ end -- not --version \IfValueTF{#2}% {\LWR@traceinfo{LWR@section: starting #4 #2}}% {\LWR@traceinfo{LWR@section: starting #4 #3}}% +% \end{macrocode} +% Warn if starting a section inside a \element{span}: +% \changes{v0.84}{2020/04/22}{Warn inside a \element{span}.} +% \begin{macrocode} + \LWR@spanwarninvalid{section}% +% \end{macrocode} +% \begin{macrocode} \LWR@maybeprintpendingfootnotes{\csuse{LWR@depth#4}}% \LWR@stoppars% \LWR@startnewdepth{#4}% @@ -23913,7 +24613,7 @@ end -- not --version {}% \LWR@traceinfo{LWR@section: finished print section number}% }{}% -}% end of not starred +}% not starred % \end{macrocode} % Print the section name: % \begin{macrocode} @@ -23927,7 +24627,11 @@ end -- not --version \LWR@htmltag{\@nameuse{LWR@tag#4end}}% \LWR@orignewline% % \end{macrocode} -% Generate a \LaTeX{} label: +% +% Generate a \LaTeX{} label. +% +% Track the \PDF\ page numbers of the \HTML\ output. +% % \changes{v0.43}{2017/11/01}{Fix: Math in section name.} % \changes{v0.48}{2018/02/11}{Fix: \TOC, \LOF, \LOT\ links.} % \changes{v0.66}{2019/01/28}{Fix: \TOC, \LOF, \LOT\ links.} @@ -23937,6 +24641,18 @@ end -- not --version \setcounter{LWR@latestautopage}{\value{page}}% \LWR@newautopagelabel{LWR@currentautosec}\LWR@orignewline% % \end{macrocode} +% +% If this is the first section found in this file, +% create a label for prevous/next links: +% \changes{v0.84}{2020/04/24}{Added prev/next links.} +% \begin{macrocode} +\ifbool{LWR@setseqfilelabel}{}{% + \label{\BaseJobname-autofile-\arabic{LWR@htmlseqfilenumber}}% + \booltrue{LWR@setseqfilelabel}% +}% +% \end{macrocode} +% +% % Start paragraph handing unless is an inline paragraph or subparagraph: % \begin{macrocode} \ifthenelse{% @@ -24190,7 +24906,7 @@ end -- not --version \newcommand*{\LWR@currentHTMLLanguage}{en-US} \newcommand*{\HTMLLanguage}[1]{% -\renewcommand*{\LWR@currentHTMLLanguage}{#1}% + \renewcommand*{\LWR@currentHTMLLanguage}{#1}% } % \end{macrocode} % \end{macro} @@ -24203,18 +24919,19 @@ end -- not --version % \changes{v0.52}{2018/04/01}{Fix: \cs{FileDepth} with non-utf8 encoding.} % \changes{v0.62}{2018/11/02}{Refactored.} % \changes{v0.64}{2018/12/07}{Added \pkg{utarticle} and related.} +% \changes{v0.84}{2020/04/21}{Improved spacing for \pkg{xeCJK}.} % \begin{macrocode} \ifPDFTeX% pdflatex or dvi latex \ifdefstring{\inputencodingname}{utf8}{% - \newcommand*{\theHTMLTitleSeparator}{ — }% EMdash + \newcommand*{\theHTMLTitleSeparator}{ —\ }% EMdash }{% - \newcommand*{\theHTMLTitleSeparator}{ - }% hyphen + \newcommand*{\theHTMLTitleSeparator}{ -\ }% hyphen }% \else% \ifpTeX - \newcommand*{\theHTMLTitleSeparator}{ - }% hyphen + \newcommand*{\theHTMLTitleSeparator}{ -\ }% hyphen \else - \newcommand*{\theHTMLTitleSeparator}{ — }% EMdash + \newcommand*{\theHTMLTitleSeparator}{ —\ }% EMdash \fi% \fi% % \end{macrocode} @@ -24280,7 +24997,7 @@ end -- not --version % \end{macrocode} -% \begin{macro}{\LWR@filestart} \oarg{sectionname} \qquad +% \begin{macro}{\LWR@filestart} \oarg{section name} \qquad % Creates the opening \HTML\ tags. % \changes{v0.19}{2016/05/25}{lwarp\_mathjax.txt loaded.} % \changes{v0.20}{2016/06/27}{Adds meta description.} @@ -24291,30 +25008,53 @@ end -- not --version \newcommand*{\LWR@filestart}[1][]{% \LWR@traceinfo{LWR@filestart !#1!}% % \end{macrocode} +% % Locally temporarily disable direct-formatting commands: % \begin{macrocode} \begingroup% \LWR@nullfonts% % \end{macrocode} +% % Save the section name for use while creating the % \HTML\ meta \attribute{title} tag: % \begin{macrocode} \edef\theHTMLSection{#1}% % \end{macrocode} +% +% Remove extra material: +% \changes{v0.84}{2020/04/12}{Improved \HTML\ title.} +% \begin{macrocode} +\StrSubstitute{\theHTMLSection}{\protect}{\detokenize{-}}[\theHTMLSection] +\StrSubstitute{\theHTMLSection}{\detokenize{-----}}{\detokenize{-}}[\theHTMLSection] +\StrSubstitute{\theHTMLSection}{\detokenize{----}}{\detokenize{-}}[\theHTMLSection] +\StrSubstitute{\theHTMLSection}{\detokenize{---}}{\detokenize{-}}[\theHTMLSection] +\StrSubstitute{\theHTMLSection}{\detokenize{--}}{\detokenize{-}}[\theHTMLSection] +% \end{macrocode} +% +% If starts with a dash, remove the leading dash: +% \begin{macrocode} +\IfBeginWith{\theHTMLSection}{\detokenize{-}}{% + \StrGobbleLeft{\theHTMLSection}{1}[\theHTMLSection]% +}{}% +% \end{macrocode} +% % Create the page's \HTML\ header: % \begin{macrocode} \LWR@htmltag{!DOCTYPE html}\LWR@orignewline % \end{macrocode} +% % The language is user-adjustable: % \begin{macrocode} \LWR@htmltag{% html lang=\LWR@orig@textquotedbl\LWR@currentHTMLLanguage\LWR@orig@textquotedbl% }\LWR@orignewline % \end{macrocode} +% % Start of the meta data: % \begin{macrocode} \LWR@htmltag{head}\LWR@orignewline % \end{macrocode} +% % Charset is fixed at UTF-8: % \begin{macrocode} \LWR@htmltag{% @@ -24355,6 +25095,7 @@ end -- not --version }\LWR@orignewline }% % \end{macrocode} +% % Mobile-friendly viewport: % \gindex{HTML>meta tag>viewport} % \gindex{viewport>HTML meta tag} @@ -24366,6 +25107,7 @@ end -- not --version content=\LWR@orig@textquotedbl{}width=device-width, initial-scale=1.0\LWR@orig@textquotedbl\ /% }\LWR@orignewline % \end{macrocode} +% % IE patch: % \changes{v0.63}{2018/11/30}{Fix: Break ligature for \pkg{luatexko}.} % \begin{macrocode} @@ -24379,6 +25121,7 @@ end -- not --version \LWR@htmltag{/script}\LWR@orignewline \LWR@htmltag{![endif]-\/-}\LWR@orignewline % \end{macrocode} +% % The page's title, if there is one. % A section name is also added if given. % \changes{v0.44}{2017/11/18}{Add \cs{HTMLTitle}.} @@ -24394,6 +25137,7 @@ end -- not --version \LWR@htmltag{/title}\LWR@orignewline% }% % \end{macrocode} +% % The page's stylesheet: % \begin{macrocode} \LWR@htmltag{% @@ -24404,6 +25148,7 @@ end -- not --version }% \LWR@orignewline % \end{macrocode} +% % Optional \brand{MathJax} support. The \HTML\ tags must be turned off % during the verbatim input, and the paragraph handling which was % turned on at the end of verbatim input must be immediately turned off @@ -24429,10 +25174,12 @@ end -- not --version }% end of mathjax {}% % \end{macrocode} +% % End of the header: % \begin{macrocode} \LWR@htmltag{/head}\LWR@orignewline % \end{macrocode} +% % Start of the body: % \begin{macrocode} \LWR@htmltag{body}\LWR@orignewline @@ -24591,6 +25338,13 @@ end -- not --version \LWR@htmlelementclass{section}{textbody} % \end{macrocode} % +% Create a label for previous/next links, and remember it has been done: +% \changes{v0.84}{2020/04/24}{Added prev/next links.} +% \begin{macrocode} +\booltrue{LWR@setseqfilelabel}% +\label{\BaseJobname-autofile-\arabic{LWR@htmlseqfilenumber}} +% \end{macrocode} +% % 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}. @@ -24691,7 +25445,9 @@ end -- not --version % Close the textbody: % \changes{v0.65}{2018/12/18}{Improved \CSS\ for page layout.} +% \changes{v0.84}{2020/04/24}{Added prev/next links.} % \begin{macrocode} +\label{\BaseJobname-autofile-last} \LWR@htmlelementclassend{section}{textbody} \LWR@htmlelementclassend{div}{bodycontainer} \LWR@htmlelementclassend{div}{bodyandsidetoc} @@ -24701,17 +25457,10 @@ end -- not --version \LWR@printpendingfootnotes % \end{macrocode} % -% Create the footer: -% -% \changes{v0.73}{2019/06/23}{Fix: Empty header/footer.} +% Create the footer if not \EPUB\: +% \changes{v0.84}{2020/04/24}{Fix: No footer for \EPUB} % \begin{macrocode} -\ifdefempty{\LWR@pagebottom}{}{% - \LWR@htmlelement{footer} - - \LWR@pagebottom - - \LWR@htmlelementend{footer} -} +\ifbool{FormatEPUB}{}{\LWR@createfooter} % \end{macrocode} % No bottom navigation if are finishing the home page, @@ -24744,7 +25493,7 @@ end -- not --version % \begin{macro}{\enddocument} % If labels have not changed, mark successful completion -% of the \env{lateximages} file. +% of the \filenm{lateximages.txt} file. % Executed as everything is being shut down. % \changes{v0.70}{2019/03/26}{If labels changed, require recompile before making limages.} % \begin{macrocode} @@ -24767,13 +25516,15 @@ end -- not --version } {} { - \PackageWarningNoLine{lwarp} - {% - Could not patch \protect\enddocument.\MessageBreak - If labels have changed, be sure to recompile before\MessageBreak - creating lateximages with\MessageBreak - \space\space lwarpmk limages,\MessageBreak - or the images may be corrupt% + \AtEndDocument{ + \PackageWarningNoLine{lwarp} + {% + Could not patch \protect\enddocument.\MessageBreak + If labels have changed, be sure to recompile before\MessageBreak + creating lateximages with\MessageBreak + \space\space lwarpmk limages,\MessageBreak + or the images may be corrupt% + } } } % \end{macrocode} @@ -25010,24 +25761,27 @@ end -- not --version % % \subsection{Printing the thanks} % -% \codeall -% \begin{macrocode} -\begin{warpall} -% \end{macrocode} -% \DescribeMacro{\printthanks} Forces the \cs{thanks} to be printed. -% +% \begin{macro}{\printthanks} Forces the \cs{thanks} to be printed. % This is necessary in a \env{titlingpage} environment % when \cs{maketitle} was not used. -% \changes{v0.73}{2019/06/25}{Fix: Paragraph tags.} -% \begin{macrocode} -\newcommand*{\printthanks}{\LWR@stoppars\@thanks\LWR@startpars} -% \end{macrocode} % +% \changes{v0.84}{2020/03/29}{Fix: \cs{printthanks} in print mode.} % +% \codeprint % \begin{macrocode} -\end{warpall} +\begin{warpprint} +\newcommand*{\printthanks}{\@thanks} +\end{warpprint} % \end{macrocode} +% \changes{v0.73}{2019/06/25}{Fix: Paragraph tags.} +% \codehtml +% \begin{macrocode} +\begin{warpHTML} +\newcommand*{\printthanks}{\LWR@stoppars\@thanks\LWR@startpars} +\end{warpHTML} +% \end{macrocode} +% \end{macro} % \subsection{Printing the title, etc.\ in \HTML} @@ -25250,12 +26004,22 @@ end -- not --version % The original definition used \cs{\textbar} which was not being seen by \prog{pdftotext}. % % \changes{v0.34}{2017/08/07}{Text symbols instead of math.} +% \changes{v0.84}{2020/04/17}{\cs{LWR@formatted}, fixed double bar.} % % \begin{macrocode} -\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} +\def\LWR@HTML@@fnsymbol#1{% + \ifcase#1\or *\or + \HTMLentity{dagger}\or + \HTMLentity{Dagger}\or + \HTMLentity{sect}\or + \HTMLentity{para}\or + \HTMLunicode{2016}\or + **\or + \HTMLentity{dagger}\HTMLentity{dagger} \or + \HTMLentity{Dagger}\HTMLentity{Dagger} \else + \@ctrerr\fi% +} +\LWR@formatted{@fnsymbol} % \end{macrocode} % \end{macro} % @@ -25450,10 +26214,16 @@ end -- not --version }% }% yes titling package {% no titling package - \newcommand{\published}[1]{}% - \newcommand*{\printpublished}{}% - \newcommand{\subtitle}{}% - \newcommand*{\printsubtitle}% +% \end{macrocode} +% \changes{v0.84}{2020/03/28}{Fixed \cs{subtitle}, \cs{printsubtitle} if no \pkg{titling}.} +% \changes{v0.84}{2020/03/28}{Added \cs{subtitle}, \cs{published} for \pkg{koma*}.} +% \begin{macrocode} + \def\@published{}% + \DeclareDocumentCommand{\published}{m}{\gdef\@published{##1}}% + \DeclareDocumentCommand{\printpublished}{}{}% + \def\@subtitle{}% + \DeclareDocumentCommand{\subtitle}{m}{\gdef\@subtitle{##1}}% + \DeclareDocumentCommand{\printsubtitle}{}{}% }% no titling package }% \AddSubtitlePublished % \end{macrocode} @@ -25493,12 +26263,12 @@ end -- not --version % \begin{macrocode} \DeclareDocumentEnvironment{abstract}{O{\abstractname}} { -\LWR@forcenewpage -\BlockClass{abstract} -\BlockClassSingle{abstracttitle}{#1} + \LWR@forcenewpage + \BlockClass{abstract} + \BlockClassSingle{abstracttitle}{#1} } { -\endBlockClass + \endBlockClass } % \end{macrocode} % \end{environment} @@ -25523,31 +26293,34 @@ end -- not --version % Ex: |"A quotation." \attribution{\textsc{Author Name}\\\textsl{Book Title}}| % % \changes{v0.73}{2019/06/25}{Fix: Paragraph tags.} +% \changes{v0.84}{2020/04/14}{Added print mode.} +% +% \codeall +% \begin{macrocode} +\begin{warpall} +\newcommand{\attribution}[1]{ + \begin{flushright} + \unskip + #1 + \end{flushright}% +} +\end{warpall} +% \end{macrocode} +% \end{macro} % % \codehtml % \begin{macrocode} \begin{warpHTML} -\newcommand{\attribution}[1]{% +\newcommand{\LWR@HTML@attribution}[1]{% \LWR@stoppars% \begin{BlockClass}{attribution} #1 \end{BlockClass} \LWR@startpars% } +\LWR@formatted{attribution} \end{warpHTML} % \end{macrocode} -% \codeprint -% \begin{macrocode} -\begin{warpprint} -\newcommand{\attribution}[1]{ - \begin{flushright} - \unskip - #1 - \end{flushright}% -} -\end{warpprint} -% \end{macrocode} -% \end{macro} % \subsection{Quotes, quotations} @@ -25558,25 +26331,31 @@ end -- not --version % \end{macrocode} % % \begin{environment}{quote} +% \changes{v0.84}{2020/04/14}{Added print mode.} % \begin{macrocode} -\renewenvironment*{quote} +\newenvironment*{LWR@HTML@quote} { \LWR@forcenewpage \LWR@htmlblocktag{blockquote} } {\LWR@htmlblocktag{/blockquote}} + +\LWR@formattedenv{quote} % \end{macrocode} % \end{environment} % -% \changes{v0.71}{2019/04/27}{Fix: \env{blockquotation} tag.} % \begin{environment}{quotation} +% \changes{v0.71}{2019/04/27}{Fix: \env{blockquotation} tag.} +% \changes{v0.84}{2020/04/14}{Added print mode.} % \begin{macrocode} -\renewenvironment*{quotation} +\newenvironment*{LWR@HTML@quotation} { \LWR@forcenewpage \LWR@htmlblocktag{blockquote} } {\LWR@htmlblocktag{/blockquote}} + +\LWR@formattedenv{quotation} % \end{macrocode} % \end{environment} @@ -25599,8 +26378,9 @@ end -- not --version % % \begin{environment}{verse} % \changes{v0.54}{2018/04/08}{Fix: Line spacing.} +% \changes{v0.84}{2020/04/14}{Added print mode.} % \begin{macrocode} -\renewenvironment{verse} +\newenvironment{LWR@HTML@verse} {\let\\\newline% lwarp \list{}{\itemsep \z@ \itemindent -1.5em% @@ -25609,6 +26389,8 @@ end -- not --version \advance\leftmargin 1.5em}% \item\relax} {\endlist} + +\LWR@formattedenv{verse} % \end{macrocode} % \end{environment} % @@ -25786,15 +26568,16 @@ end -- not --version % % Patch \cs{verbatiminput} to add \HTML\ tags: % +% \changes{v0.84}{2020/04/16}{Added print mode.} % \begin{macrocode} -\let\LWRV@origverbatim@input\verbatim@input - -\renewcommand{\verbatim@input}[2]{% -\ifbool{LWR@verbtags}{\LWR@forcenewpage}{}% -\LWR@atbeginverbatim{2.5}{Verbatim}% -\LWRV@origverbatim@input{#1}{#2}% -\LWR@afterendverbatim{1.5}% +\newcommand{\LWR@HTML@verbatim@input}[2]{% + \ifbool{LWR@verbtags}{\LWR@forcenewpage}{}% + \LWR@atbeginverbatim{2.5}{Verbatim}% + \LWR@print@verbatim@input{#1}{#2}% + \LWR@afterendverbatim{1.5}% } + +\LWR@formatted{verbatim@input} % \end{macrocode} % \end{macro} @@ -25803,16 +26586,25 @@ end -- not --version % \begin{environment}{verbatim} % % \changes{v0.20}{2016/12/24}{Added.} +% \changes{v0.84}{2020/04/16}{Added print mode.} % % \begin{macrocode} \AfterEndPreamble{ \LWR@traceinfo{Patching verbatim.} \AtBeginEnvironment{verbatim}{% -\LWR@forcenewpage% -\LWR@atbeginverbatim{2.5}{verbatim}% + \ifnumcomp{\value{LWR@lateximagedepth}}{>}{0}% + {}% + {% + \LWR@forcenewpage% + \LWR@atbeginverbatim{2.5}{verbatim}% + }% } \AfterEndEnvironment{verbatim}{% - \LWR@afterendverbatim{1}% + \ifnumcomp{\value{LWR@lateximagedepth}}{>}{0}% + {}% + {% + \LWR@afterendverbatim{1}% + }% } } % \end{macrocode} @@ -25826,11 +26618,19 @@ end -- not --version % \changes{v0.42}{2017/10/13}{Added.} % \changes{v0.52}{2018/03/27}{Fix to allow inside \env{lateximage}.} % \changes{v0.58}{2018/06/07}{Improved print/\HTML\ output selection.} +% \changes{v0.84}{2020/04/17}{Restore spacing.} % \begin{macrocode} \newcommand*{\LWR@HTML@tabbing}{% -\LWR@forcenewpage% -\LWR@atbeginverbatim{3}{tabbing}% -\LWR@print@tabbing% + \LWR@forcenewpage% + \LWR@atbeginverbatim{3}{tabbing}% + \let\enskip\LWR@origenskip% + \let\quad\LWR@origquad% + \let\qquad\LWR@origqquad% + \let~\LWR@origtilde% + \let\,\LWR@origcomma% + \let\thinspace\LWR@origthinspace% + \let\negthinspace\LWR@orignegthinspace% + \LWR@print@tabbing% } \newcommand*{\LWR@HTML@endtabbing}{% @@ -26325,22 +27125,22 @@ end -- not --version % \begin{macro}{\LWR@restoreoriglists} Restores the original \env{trivlist} environment. % \begin{macrocode} \newcommand*{\LWR@restoreoriglists}{% -\LWR@traceinfo{LWR@restoreoriglists}% -\LetLtxMacro\item\LWR@origitem% -\LetLtxMacro\@item\LWR@orig@item% -\let\@trivlist\LWR@orig@trivlist% -\let\trivlist\LWR@origtrivlist% -\let\endtrivlist\LWR@origendtrivlist% -\LetLtxMacro\itemize\LWR@origitemize% -\LetLtxMacro\enditemize\LWR@endorigitemize% -\LetLtxMacro\enumerate\LWR@origenumerate% -\LetLtxMacro\endenumerate\LWR@endorigenumerate% -\LetLtxMacro\description\LWR@origdescription% -\LetLtxMacro\enddescription\LWR@endorigdescription% -\let\@mklab\LWR@orig@mklab% -\let\makelabel\LWR@origmakelabel% -\let\@donoparitem\LWR@orig@donoparitem% -\let\@nbitem\LWR@orig@nbitem% + \LWR@traceinfo{LWR@restoreoriglists}% + \LetLtxMacro\item\LWR@origitem% + \LetLtxMacro\@item\LWR@orig@item% + \let\@trivlist\LWR@orig@trivlist% + \let\trivlist\LWR@origtrivlist% + \let\endtrivlist\LWR@origendtrivlist% + \LetLtxMacro\itemize\LWR@origitemize% + \LetLtxMacro\enditemize\LWR@endorigitemize% + \LetLtxMacro\enumerate\LWR@origenumerate% + \LetLtxMacro\endenumerate\LWR@endorigenumerate% + \LetLtxMacro\description\LWR@origdescription% + \LetLtxMacro\enddescription\LWR@endorigdescription% + \let\@mklab\LWR@orig@mklab% + \let\makelabel\LWR@origmakelabel% + \let\@donoparitem\LWR@orig@donoparitem% + \let\@nbitem\LWR@orig@nbitem% } % \end{macrocode} % \end{macro} @@ -26726,7 +27526,7 @@ end -- not --version % \subsubsection{Longtable variables} % \DescribeBoolean{LWR@starredlongtable} -% Per the \pkg{caption} pacakge, step the counter if |longtable*|. +% Per the \pkg{caption} package, step the counter if |longtable*|. % % \begin{macrocode} \newbool{LWR@starredlongtable} @@ -28385,15 +29185,6 @@ end -- not --version -% Used to compute margins, tabular trims, column offsets: -% \begin{macrocode} -\newlength{\LWR@templengthone} -\newlength{\LWR@templengthtwo} -\newlength{\LWR@templengththree} -\newcounter{LWR@tempcountone} -% \end{macrocode} - - % \begin{macro}{\LWR@tdstartstyles} % Begins possibly adding a table data cell style. % \begin{macrocode} @@ -29147,20 +29938,11 @@ end -- not --version % % \begin{macrocode} \IfValueT{#2}{ % rows? - rowspan="#2" % -% \end{macrocode} -% -% \changes{v0.47}{2018/01/26}{Fix: Line wrap at \HTML\ hyphen.} -% \begin{macrocode} - \IfValueT{#1}{% vpos? - \ifstrequal{#1}{b}% - {style="\LWR@print@mbox{vertical-align:bottom}" }{}% - \ifstrequal{#1}{t}% - {style="\LWR@print@mbox{vertical-align:top}" }{}% - }% vpos? - }% rows? + rowspan="#2" % + }% % \end{macrocode} % +% \changes{v0.84}{2020/04/16}{Fix: Multicolumn style.} % \begin{macrocode} class="td% % \end{macrocode} @@ -29213,10 +29995,30 @@ end -- not --version % \begin{macrocode} \LWR@tdstartstyles% % \end{macrocode} +% +% Style for vertical position: +% \changes{v0.47}{2018/01/26}{Fix: Line wrap at \HTML\ hyphen.} +% \begin{macrocode} + \IfValueT{#1}{% vpos? + \ifstrequal{#1}{b}% + {% + \LWR@tdaddstyle% + \LWR@print@mbox{vertical-align:bottom}% + }{}% + \ifstrequal{#1}{t}% + {% + \LWR@tdaddstyle% + \LWR@print@mbox{vertical-align:top}% + }{}% + }% vpos? +% \end{macrocode} +% +% Style for row colors: % \changes{v0.49}{2018/02/18}{\pkg{xcolor}: Added tabular row colors.} % \begin{macrocode} \LWR@addtabularrowcolor% % \end{macrocode} +% Other styles: % \begin{macrocode} \LWR@addcmidrulewidth% \LWR@addcdashline% @@ -30073,16 +30875,7 @@ end -- not --version % a warning is issued here instructing the user to please isolate the \element{span} % to print-only. % \begin{macrocode} - \ifnumcomp{\value{LWR@spandepth}}{>}{0}{% - \PackageWarning{lwarp}{% - A tabular is being used inside a span such as\MessageBreak - a minipage. Some formatting may not be correct\MessageBreak - in the tabular.\MessageBreak - It is recommended to use \protect\warpprintonly\space or the\MessageBreak - warpprint environment to isolate the span to\MessageBreak - print-only,% - } - }{}% + \LWR@spanwarnformat{tabular}% \addtocounter{LWR@tabulardepth}{1}% % \end{macrocode} % Not yet started a table row: @@ -30431,6 +31224,8 @@ end -- not --version % \begin{description} % \item [\cs{label}:] Adds \HTML\ tags (\cref{sec:labels}), % and another \filenm{.aux} entry (\cref{sec:lwarplabelsetup}). +% If \pkg{memoir} is used, its \cs{@mem@old@label} points to \pkg{lwarp}'s version, +% and \pkg{cleveref} patches. % \item [\cs{newlabel}:] Unchanged. When the |.aux| file is read, sets \cs{r@