From c64b76557cb363f0c2990ee6a72dd2f8cf231af4 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 1 Feb 2022 22:09:57 +0000 Subject: lwarp (1feb22) git-svn-id: svn://tug.org/texlive/trunk@61842 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/lwarp/README.txt | 4 +- Master/texmf-dist/doc/latex/lwarp/lwarp.pdf | Bin 3144374 -> 3176264 bytes Master/texmf-dist/scripts/lwarp/lwarpmk.lua | 13 +- Master/texmf-dist/source/latex/lwarp/lwarp.dtx | 3649 ++++++++++++-------- Master/texmf-dist/source/latex/lwarp/lwarp.ins | 2 + Master/texmf-dist/tex/latex/lwarp/lwarp-CJK.sty | 2 +- .../texmf-dist/tex/latex/lwarp/lwarp-CJKutf8.sty | 2 +- .../texmf-dist/tex/latex/lwarp/lwarp-SIunits.sty | 9 +- .../texmf-dist/tex/latex/lwarp/lwarp-abstract.sty | 2 +- Master/texmf-dist/tex/latex/lwarp/lwarp-acro.sty | 4 +- .../texmf-dist/tex/latex/lwarp/lwarp-acronym.sty | 10 +- .../tex/latex/lwarp/lwarp-algorithm2e.sty | 28 +- Master/texmf-dist/tex/latex/lwarp/lwarp-amsthm.sty | 4 +- Master/texmf-dist/tex/latex/lwarp/lwarp-array.sty | 2 +- .../texmf-dist/tex/latex/lwarp/lwarp-authblk.sty | 2 +- .../texmf-dist/tex/latex/lwarp/lwarp-backnaur.sty | 8 +- .../texmf-dist/tex/latex/lwarp/lwarp-biblatex.sty | 2 +- .../texmf-dist/tex/latex/lwarp/lwarp-booktabs.sty | 2 +- Master/texmf-dist/tex/latex/lwarp/lwarp-cancel.sty | 2 +- .../texmf-dist/tex/latex/lwarp/lwarp-caption.sty | 2 +- .../texmf-dist/tex/latex/lwarp/lwarp-caption3.sty | 2 +- Master/texmf-dist/tex/latex/lwarp/lwarp-cases.sty | 27 +- .../texmf-dist/tex/latex/lwarp/lwarp-chemfig.sty | 4 +- .../tex/latex/lwarp/lwarp-chemformula.sty | 35 +- .../tex/latex/lwarp/lwarp-chemmacros.sty | 33 +- .../texmf-dist/tex/latex/lwarp/lwarp-cleveref.sty | 6 +- .../texmf-dist/tex/latex/lwarp/lwarp-cmbright.sty | 2 +- Master/texmf-dist/tex/latex/lwarp/lwarp-color.sty | 1 + .../lwarp/lwarp-common-mathjax-newpxtxmath.sty | 156 +- .../lwarp/lwarp-common-mathjax-nonunicode.sty | 114 +- Master/texmf-dist/tex/latex/lwarp/lwarp-cuted.sty | 4 +- .../texmf-dist/tex/latex/lwarp/lwarp-endnotes.sty | 4 + .../texmf-dist/tex/latex/lwarp/lwarp-fancybox.sty | 68 +- .../texmf-dist/tex/latex/lwarp/lwarp-floatrow.sty | 2 +- .../texmf-dist/tex/latex/lwarp/lwarp-flushend.sty | 6 +- .../texmf-dist/tex/latex/lwarp/lwarp-footnote.sty | 2 +- .../texmf-dist/tex/latex/lwarp/lwarp-fourier.sty | 4 +- Master/texmf-dist/tex/latex/lwarp/lwarp-framed.sty | 112 +- .../texmf-dist/tex/latex/lwarp/lwarp-graphics.sty | 5 +- .../texmf-dist/tex/latex/lwarp/lwarp-hanging.sty | 2 +- .../texmf-dist/tex/latex/lwarp/lwarp-keyfloat.sty | 7 +- .../tex/latex/lwarp/lwarp-kpfonts-otf.sty | 54 +- Master/texmf-dist/tex/latex/lwarp/lwarp-lipsum.sty | 5 +- .../texmf-dist/tex/latex/lwarp/lwarp-mathalpha.sty | 10 +- .../texmf-dist/tex/latex/lwarp/lwarp-mathptmx.sty | 2 +- Master/texmf-dist/tex/latex/lwarp/lwarp-mhchem.sty | 108 +- .../texmf-dist/tex/latex/lwarp/lwarp-microtype.sty | 2 +- Master/texmf-dist/tex/latex/lwarp/lwarp-minted.sty | 11 +- .../texmf-dist/tex/latex/lwarp/lwarp-multirow.sty | 77 +- .../texmf-dist/tex/latex/lwarp/lwarp-nccfoots.sty | 4 + .../texmf-dist/tex/latex/lwarp/lwarp-ntheorem.sty | 4 +- .../texmf-dist/tex/latex/lwarp/lwarp-parnotes.sty | 44 +- .../texmf-dist/tex/latex/lwarp/lwarp-pdftricks.sty | 2 +- .../texmf-dist/tex/latex/lwarp/lwarp-physics.sty | 2 +- .../tex/latex/lwarp/lwarp-showlabels.sty | 26 + .../tex/latex/lwarp/lwarp-siunitx-v2.sty | 149 +- .../tex/latex/lwarp/lwarp-thm-listof.sty | 2 +- Master/texmf-dist/tex/latex/lwarp/lwarp-tikz.sty | 2 +- .../texmf-dist/tex/latex/lwarp/lwarp-titling.sty | 2 +- Master/texmf-dist/tex/latex/lwarp/lwarp-todo.sty | 4 +- Master/texmf-dist/tex/latex/lwarp/lwarp-vwcol.sty | 4 +- .../texmf-dist/tex/latex/lwarp/lwarp-wrapfig.sty | 4 +- .../texmf-dist/tex/latex/lwarp/lwarp-wrapfig2.sty | 57 + Master/texmf-dist/tex/latex/lwarp/lwarp-xcolor.sty | 295 +- Master/texmf-dist/tex/latex/lwarp/lwarp.sty | 1269 +++---- 65 files changed, 3965 insertions(+), 2519 deletions(-) create mode 100644 Master/texmf-dist/tex/latex/lwarp/lwarp-showlabels.sty create mode 100644 Master/texmf-dist/tex/latex/lwarp/lwarp-wrapfig2.sty (limited to 'Master/texmf-dist') diff --git a/Master/texmf-dist/doc/latex/lwarp/README.txt b/Master/texmf-dist/doc/latex/lwarp/README.txt index d6e0d17d051..5b687de6c9f 100644 --- a/Master/texmf-dist/doc/latex/lwarp/README.txt +++ b/Master/texmf-dist/doc/latex/lwarp/README.txt @@ -1,5 +1,5 @@ -LaTeX lwarp package v0.902 README.txt +LaTeX lwarp package v0.903 README.txt Files included are: @@ -41,7 +41,7 @@ and version 1.3 or later is part of all distributions of LaTeX version 2005/12/01 or later. -Copyright 2016-2021 Brian Dunn +Copyright 2016-2022 Brian Dunn Homepage: http://BDTechConcepts.com Email: bd@BDTechConcepts.com diff --git a/Master/texmf-dist/doc/latex/lwarp/lwarp.pdf b/Master/texmf-dist/doc/latex/lwarp/lwarp.pdf index e6119bc4e80..a9286ae0f90 100644 Binary files a/Master/texmf-dist/doc/latex/lwarp/lwarp.pdf and b/Master/texmf-dist/doc/latex/lwarp/lwarp.pdf differ diff --git a/Master/texmf-dist/scripts/lwarp/lwarpmk.lua b/Master/texmf-dist/scripts/lwarp/lwarpmk.lua index eddb459816f..b0d9a1c6f49 100755 --- a/Master/texmf-dist/scripts/lwarp/lwarpmk.lua +++ b/Master/texmf-dist/scripts/lwarp/lwarpmk.lua @@ -1,8 +1,8 @@ #!/usr/bin/env texlua --- Copyright 2016-2021 Brian Dunn +-- Copyright 2016-2022 Brian Dunn -printversion = "v0.902" +printversion = "v0.903" requiredconfversion = "2" -- also at *lwarpmk.conf function printhelp () @@ -383,8 +383,15 @@ function pdftohtml () -- Convert to text: print ("lwarpmk: Converting " .. sourcename .."_html.pdf to " .. sourcename .. "_html.html") -os.execute("pdftotext -enc " .. pdftotextenc .. " -nopgbrk -layout " +err = os.execute("pdftotext -enc " .. pdftotextenc .. " -nopgbrk -layout " .. sourcename .. "_html.pdf " .. sourcename .. "_html.html") +if ( err ~= 0 ) then + print ("lwarpmk: ===") + print ("lwarpmk: Ensure that the Poppler utilities are installed." ) + print ("lwarpmk: See the Lwarp manual: `Installing additional utilities'." ) + print ("lwarpmk: ===") + os.exit(1) +end -- Split the result into individual HTML files: splitfile (homehtmlfilename .. ".html" , sourcename .. "_html.html") end diff --git a/Master/texmf-dist/source/latex/lwarp/lwarp.dtx b/Master/texmf-dist/source/latex/lwarp/lwarp.dtx index 743e616dc11..98001980204 100644 --- a/Master/texmf-dist/source/latex/lwarp/lwarp.dtx +++ b/Master/texmf-dist/source/latex/lwarp/lwarp.dtx @@ -1,7 +1,7 @@ % % \iffalse meta-comment % -% Copyright 2016-2021 Brian Dunn +% Copyright 2016-2022 Brian Dunn % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either version 1.3 @@ -16,7 +16,7 @@ % \iffalse %\NeedsTeXFormat{LaTeX2e}[1999/12/01] %\ProvidesPackage{lwarp} -% [2021/10/01 v0.902 Allows LaTeX to directly produce HTML5 output.] +% [2022/02/01 v0.903 Allows LaTeX to directly produce HTML5 output.] % %<*driver> \documentclass{ltxdoc} @@ -197,7 +197,7 @@ % Indexing, logos, \Describexxxx, etc: -\usepackage{dtxdescribe}[2021/09/02] +\usepackage{dtxdescribe}[2021/12/18] \usepackage{splitidx} @@ -267,7 +267,7 @@ Keywords={LaTeX, HTML, conversion}% \newcommand*{\AV}{\acro{A}\Slash\acro{V}} \makeatletter -\@ifpackageloaded{erewhon}{\renewcommand*{\HTMLfive}{\acro{HTML}\textosf{5}}}{} +\IfPackageLoadedTF{erewhon}{\renewcommand*{\HTMLfive}{\acro{HTML}\textosf{5}}}{} \makeatother \newcommand{\credits}[1]{{\footnotesize(\textit{Emulates or patches code by} \textsc{#1}.)}} @@ -1837,6 +1837,7 @@ Do not use the \optn{scale} option, since it is not well supported by \HTML\ bro \margintag{options} \optn{origin}, \optn{rotate} and \optn{scale}, plus new \optn{class} and \optn{alt} keys. +(\optn{alt} has recently been incorportated into \pkg{graphicx} itself.) With \HTML\ output, \cs{includegraphics} accepts an optional \margintag{\HTML\ class} @@ -2929,6 +2930,10 @@ The result usually looks fine, and otherwise is enough to get the meaning across Document modifications required for \MathJax: \begin{itemize} +\item Place \cs{sisetup} in the preamble before \texttt{\cs{begin}\{document\}}. + \watchout[\cs{sisetup}] + Changes made later may be ignored, especially with \MathJax. + The \MathJax\ emulation also ignores most macro options. \item Custom units may be added with \cs{CustomizeMathJax}. \margintag{custom units} See the \pkg{lwarp-siunitx} code for examples. @@ -2942,6 +2947,8 @@ Document modifications required for \MathJax: \cs{cubic}\textred{\{}\cs{centi}\cs{meter}\textred{\}} \end{sourcedisplay} Single units do not require braces. +\item For \cs{numlist}, the argument is printed as text as-is, + so use space between semicolons for improved readability. \end{itemize} Also see \nameref{sec:limitsmathjax}, \cref{sec:limitsmathjax}. @@ -3083,6 +3090,14 @@ using \cmds{pdflatex filename.tex} or similar, after which \prog{lwarpmk} may then be used with the new configuration files. } +\newcommand*{\newimagechecksums}{ +Due to changes in how automatically-generated +\watchout[New images] +\SVG\ image file names are computed, +after \cmds{lwarpmk html} use \cmds{lwarpmk cleanlimages} a single time, +and then \cmds{lwarpmk limages} to generate the new images. +} + \newcommand*{\describehashing}{% If starred, a hashed filename is used.\margintag{image filename hashing} @@ -3097,7 +3112,7 @@ but also enough additional information to provide a unique hash. An example is when the expression is a complicated \TeX\ expression, which would not copy/paste well. A simplified tag may be used, while the complicated expression is -duplicated in the additional hashing argument. +used in the additional hashing argument to ensure a unique image. Another example is when the expression is simple, but the image depends on options. These options may be decoded into text form and @@ -3137,6 +3152,11 @@ This boolean may be tested by the user for later use. \setcounter{IndexColumns}{2} + +% To color the text of the listing, but this makes it harder to read: +% \apptocmd{\MacroFont}{\color{blue!40!black}}{}{} + + \DisableCrossrefs \CodelineIndex \RecordChanges @@ -3152,7 +3172,7 @@ This boolean may be tested by the user for later use. %<*package> % \fi % -% \CheckSum{54254} +% \CheckSum{54471} % % \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 @@ -3296,6 +3316,8 @@ This boolean may be tested by the user for later use. % \changes{v0.900}{2021/07/17}{\ 2021/07/17} % \changes{v0.901}{2021/08/27}{\ 2021/08/27} % \changes{v0.902}{2021/10/01}{\ 2021/10/01} +% \changes{v0.903}{2021/12/23}{Now uses \cs{IfPackageLoadedTF}, etc.} +% \changes{v0.903}{2022/02/01}{\ 2022/02/01} @@ -3328,7 +3350,7 @@ This boolean may be tested by the user for later use. % % \fileversion{} \Dash \filedate % -% {\small\textcopyright{} 2016--2021} Brian Dunn\\ \small \texttt{bd@BDTechConcepts.com} +% {\small\textcopyright{} 2016--2022} Brian Dunn\\ \small \texttt{bd@BDTechConcepts.com} % % \end{center} % @@ -3530,6 +3552,28 @@ This boolean may be tested by the user for later use. % % \begin{description} % \needspace{2\baselineskip} +% \item[v0.903:] Various updates and improvements. +% \begin{itemize} +% \item Error if \prog{pdftotext} not available. +% \margintag{\prog{lwarpmk}} +% Ensures that \brand{poppler} programs are installed. +% \item \prog{ps2pdf}: Allow transparency due to recent changes in \prog{ps2pdf}. +% \margintag{core} +% \item \newimagechecksums +% \item Improved back refs. +% \item Fixed \env{verbatim*}. +% \item Various internal updates for recent \LaTeX\ release. +% \item \pkg{cuted}: Updated to v2.0. +% \margintag{packages} +% \item \pkg{flushend}: Updated to v4.0. +% \item \pkg{mathalpha}: Updated for v1.14+. +% \item \pkg{minted}: Updated to v2.6. +% \item \pkg{cases}: Updated to v3.2. +% \item \pkg{siunitx} with \MathJax: Improved \cs{per}, \cs{numlist}, \cs{SIlist}, +% comma decimal points. +% \item Added \pkg{showlabels}, \pkg{wrapfig2}. +% \end{itemize} +% \needspace{2\baselineskip} % \item[v0.902:] \pkg{beamerarticle}, footnotes, paragraph tags. % \begin{itemize} % \item Fixed footnotes inside descriptions, minipages, \pkg{amsthm}, \cs{nameref}. @@ -5931,7 +5975,7 @@ This boolean may be tested by the user for later use. % \epkg{nonfloat}, \mpkg{picinpar}, \ipkg{placeins}, \epkg{rotfloat}, \ipkg{stfloats}, % \mpkg{subcaption}, \mpkg{subfig}, \epkg{subfigure}, \spkg{subfloat}, % \epkg{swfigure}, -% \epkg{topcapt}, \epkg{trivfloat}, \epkg{wrapfig}. \\ +% \epkg{topcapt}, \epkg{trivfloat}, \epkg{wrapfig}, \epkg{wrapfig2}. \\ % % \midrule % @@ -6137,6 +6181,7 @@ This boolean may be tested by the user for later use. % % Debug: & \ipkg{chkfloat}, \ipkg{cmdtrack}, \ipkg{dprogress}, \mpkg{lipsum}, % \ipkg{lua-visual-debug}, \mpkg{mwe}, \ipkg{refcheck}, +% \ipkg{showlabels}, \ipkg{showkeys}, % \ipkg{srcltx}, \ipkg{srctex}, \ipkg{vpe}, \ipkg{xbmks}. \\ % % \midrule @@ -6655,6 +6700,13 @@ This boolean may be tested by the user for later use. % % \changes{v0.27}{2017/04/02}{Docs: Installing utilities for \brand{MacOS}.} % +% \trouble{poppler=\prog{poppler}>install} +% \trouble{perl=\prog{perl}} +% \trouble{pdfcrop=\prog{pdfcrop}} +% \trouble{pdftotext=\prog{pdftotex}} +% \trouble{pdfseparate=\prog{pdfseparate}} +% \trouble{pdftocairo=\prog{pdftocairo}} +% % \begin{description} % \item [To test for the existence of the additional utilities:] \ % @@ -7016,13 +7068,13 @@ This boolean may be tested by the user for later use. % % \qquad Open the file |tutorial.html| in a web browser. % -% Note that math is still displayed as its \attribute{alt} tag, which is -% \margintag{math} -% the plain-text \LaTeX\ source, -% until the -% images of the math expressions have been generated. Math may be -% displayed as \SVG\ images or by a \MathJax\ script, as seen in -% \cref{sec:tutorialsvgmath,sec:tutorialmathjax}. +% Note that math images have not yet been generated, +% \margintag{math images} +% \changes{v0.903}{2022/01/24}{Docs: Math images.} +% so math is still displayed as its \attribute{alt} tag, which is +% set to the plain-text \LaTeX\ source for that expression. +% Math may be displayed as \SVG\ images (\cref{sec:tutorialsvgmath}) +% or by a \MathJax\ script (\cref{sec:tutorialmathjax}). % % \item Force a recompile: % \userentry{lwarpmk again} @@ -8939,6 +8991,9 @@ This boolean may be tested by the user for later use. % Do not nest \env{warpsvg} inside itself. \watchout[nesting] % \env{warpsvg} may be used inside \env{warpHTML}. % +% To define macros or environments which behave differently depending +% \margintag{\cs{LWR@formatted}} +% on print or \HTML\ output, see \cref{sec:definingprinthtml}. % % % \subsection{Commands to be placed into the \env{warpprint} environment} @@ -11104,14 +11159,14 @@ This boolean may be tested by the user for later use. % { % latex tm \LWRopseq % dvips -o tm-pics.ps tm.dvi \LWRopseq -% ps2pdf tm-pics.ps \LWRopseq +% ps2pdf -dALLOWPSTRANSPARENCY tm-pics.ps \LWRopseq % pdflatex tm.tex % } , % HTMLLatexCmd= % { % latex tm_html \LWRopseq % dvips -o tm_html-pics.ps tm_html.dvi \LWRopseq -% ps2pdf tm_html-pics.ps \LWRopseq +% ps2pdf -dALLOWPSTRANSPARENCY tm_html-pics.ps \LWRopseq % pdflatex tm_html.tex % } % } @@ -12841,13 +12896,25 @@ This boolean may be tested by the user for later use. % % \section{Early package requirements} % -% \DescribePackage{etoolbox} -% Provides \cs{ifbool} and other functions. % -% \DescribePackage{xpatch} -% Patches macros with optional arguments. +% \DescribePackage{etoolbox} Provides \cs{ifbool} and other functions. +% % \begin{macrocode} \RequirePackage{etoolbox}[2011/01/03]% v2.6 for \BeforeBeginEnvironment, etc. +% \end{macrocode} +% +% Patch to fix copy of environment with a \cs{par}: +% +% \href{https://github.com/josephwright/etoolbox/issues/35}{https://github.com/josephwright/etoolbox/issues/35} +% \changes{v0.903}{2021/12/21}{\pkg{etoolbox}: Patch for \cs{NewCommandCopy}.} +% \begin{macrocode} +\long\def\etb@carsquare#1#2#3\@nil{#1#2} +% \end{macrocode} +% +% +% \DescribePackage{xpatch} Patches macros with optional arguments. +% +% \begin{macrocode} \RequirePackage{xpatch} % \end{macrocode} @@ -12902,7 +12969,7 @@ This boolean may be tested by the user for later use. % % \begin{macrocode} \newcommand*{\LWR@loadafter}[1]{% -\@ifpackageloaded{#1} +\IfPackageLoadedTF{#1} { \PackageError{lwarp} {% @@ -12931,7 +12998,7 @@ This boolean may be tested by the user for later use. % % \changes{v0.45}{2017/12/03}{Added.} % \begin{macrocode} -\@ifclassloaded{memoir} +\IfClassLoadedTF{memoir} {\newcommand*{\LWR@notmemoirloadafter}[1]{}} {\LetLtxMacro\LWR@notmemoirloadafter\LWR@loadafter} % \end{macrocode} @@ -12946,17 +13013,17 @@ This boolean may be tested by the user for later use. % \begin{macrocode} \LetLtxMacro\LWR@notltjloadafter\LWR@loadafter -\@ifclassloaded{ltjarticle}{\renewcommand*{\LWR@notltjloadafter}[1]{}}{} -\@ifclassloaded{ltjbook}{\renewcommand*{\LWR@notltjloadafter}[1]{}}{} -\@ifclassloaded{ltjreport}{\renewcommand*{\LWR@notltjloadafter}[1]{}}{} -\@ifclassloaded{ltjsarticle}{\renewcommand*{\LWR@notltjloadafter}[1]{}}{} -\@ifclassloaded{ltjsbook}{\renewcommand*{\LWR@notltjloadafter}[1]{}}{} -\@ifclassloaded{ltjsreport}{\renewcommand*{\LWR@notltjloadafter}[1]{}}{} -\@ifclassloaded{ltjspf}{\renewcommand*{\LWR@notltjloadafter}[1]{}}{} -\@ifclassloaded{ltjskiyou}{\renewcommand*{\LWR@notltjloadafter}[1]{}}{} -\@ifclassloaded{ltjtarticle}{\renewcommand*{\LWR@notltjloadafter}[1]{}}{} -\@ifclassloaded{ltjtbook}{\renewcommand*{\LWR@notltjloadafter}[1]{}}{} -\@ifclassloaded{ltjtreport}{\renewcommand*{\LWR@notltjloadafter}[1]{}}{} +\IfClassLoadedTF{ltjarticle}{\renewcommand*{\LWR@notltjloadafter}[1]{}}{} +\IfClassLoadedTF{ltjbook}{\renewcommand*{\LWR@notltjloadafter}[1]{}}{} +\IfClassLoadedTF{ltjreport}{\renewcommand*{\LWR@notltjloadafter}[1]{}}{} +\IfClassLoadedTF{ltjsarticle}{\renewcommand*{\LWR@notltjloadafter}[1]{}}{} +\IfClassLoadedTF{ltjsbook}{\renewcommand*{\LWR@notltjloadafter}[1]{}}{} +\IfClassLoadedTF{ltjsreport}{\renewcommand*{\LWR@notltjloadafter}[1]{}}{} +\IfClassLoadedTF{ltjspf}{\renewcommand*{\LWR@notltjloadafter}[1]{}}{} +\IfClassLoadedTF{ltjskiyou}{\renewcommand*{\LWR@notltjloadafter}[1]{}}{} +\IfClassLoadedTF{ltjtarticle}{\renewcommand*{\LWR@notltjloadafter}[1]{}}{} +\IfClassLoadedTF{ltjtbook}{\renewcommand*{\LWR@notltjloadafter}[1]{}}{} +\IfClassLoadedTF{ltjtreport}{\renewcommand*{\LWR@notltjloadafter}[1]{}}{} % \end{macrocode} % \end{macro} @@ -12968,7 +13035,7 @@ This boolean may be tested by the user for later use. % % \begin{macrocode} \newcommand*{\LWR@loadbefore}[1]{% -\@ifpackageloaded{#1} +\IfPackageLoadedTF{#1} {\relax} { \PackageError{lwarp} @@ -13065,7 +13132,7 @@ This boolean may be tested by the user for later use. % % \begin{macrocode} \newcommand*{\LWR@earlyloadnever}[2]{% - \@ifpackageloaded{#1}{% + \IfPackageLoadedTF{#1}{% \LWR@loadnever{#1}{#2}% }{}% } @@ -13083,7 +13150,7 @@ This boolean may be tested by the user for later use. % % \begin{macrocode} \newcommand*{\LWR@earlyclassloadnever}[2]{% -\@ifclassloaded{#1}{% +\IfClassLoadedTF{#1}{% \PackageError{lwarp} {% Class #1 is not supported\MessageBreak @@ -13164,7 +13231,7 @@ This boolean may be tested by the user for later use. \LWR@checkloadnever{libgreek}{libertinust1math, newtx} \LWR@checkloadnever{newthm}{ntheorem} \LWR@checkloadnever{pdfcprot}{microtype} -\LWR@checkloadnever{picins}{floatflt, wrapfig} +\LWR@checkloadnever{picins}{floatflt, wrapfig, wrapfig2} \LWR@checkloadnever{rplain}{fancyhdr} \LWR@checkloadnever{si}{siunitx} \LWR@checkloadnever{sistyle}{siunitx} @@ -13187,7 +13254,12 @@ This boolean may be tested by the user for later use. \LWR@checkloadnever{arraycols}{} \LWR@checkloadnever{bidi}{} \LWR@checkloadnever{cals}{} -\LWR@checkloadnever{cellspace}{} +% \end{macrocode} +% \changes{v0.903}{2022/01/06}{Alternative for \pkg{cellspace}.} +% \begin{macrocode} +\LWR@checkloadnever{cellspace}{tabls} +% \end{macrocode} +% \begin{macrocode} \LWR@checkloadnever{cgloss4e}{} \LWR@checkloadnever{collcell}{} \LWR@checkloadnever{colophon}{} @@ -13285,7 +13357,7 @@ This boolean may be tested by the user for later use. % % The older \pkg{CJK} and \pkg{CJKutf8} only work with \pkg{xeCJK}: % \begin{macrocode} -\@ifpackageloaded{xeCJK}{}{ +\IfPackageLoadedTF{xeCJK}{}{ \LWR@checkloadnever{CJK}{ctex, xeCJK} \LWR@checkloadnever{CJKutf8}{ctex, xeCJK} } @@ -13764,6 +13836,7 @@ This boolean may be tested by the user for later use. \LWR@loadafter{shadow} \LWR@loadafter{shapepar} \LWR@notmemoirloadafter{showidx} +\LWR@loadafter{showlabels} \LWR@loadafter{showkeys} \LWR@loadafter{showtags} \LWR@loadafter{shuffle} @@ -13881,6 +13954,7 @@ This boolean may be tested by the user for later use. \LWR@loadafter{widows-and-orphans} \LWR@loadafter{witharrows} \LWR@loadafter{wrapfig} +\LWR@loadafter{wrapfig2} \LWR@loadafter{xbmks} \LWR@loadafter{xcolor} \LWR@loadafter{xechangebar} @@ -13966,8 +14040,8 @@ This boolean may be tested by the user for later use. \newcommand*{\LWR@pdfencoding}{% \RequirePackage[T1]{fontenc} - \@ifpackageloaded{inputenc}{}{ - \@ifpackageloaded{inputenx}{}{ + \IfPackageLoadedTF{inputenc}{}{ + \IfPackageLoadedTF{inputenx}{}{ \RequirePackage[utf8]{inputenc} } } @@ -14093,7 +14167,7 @@ This boolean may be tested by the user for later use. % \begin{macrocode} \ifxetexorluatex \AtBeginDocument{ - \@ifpackageloaded{kpfonts}{ + \IfPackageLoadedTF{kpfonts}{ \PackageError{lwarp} {% When using XeLaTeX or LuaLaTeX,\MessageBreak @@ -14173,7 +14247,7 @@ This boolean may be tested by the user for later use. % \end{macro} -% \subsection{Patching} +% \subsection{Patching macros} % \begin{macro}{\LWR@patcherror} \marg{packagename} \marg{macroname} % @@ -14193,6 +14267,35 @@ This boolean may be tested by the user for later use. % \end{macro} % % +% \subsection{Copying macros} +% +% \begin{macro}{\csNewCommandCopycs} \marg{dest csname} \marg{source csname} +% +% Given a cs-name for each, copies a macro to a new definition. +% +% \changes{v0.903}{2021/12/21}{Added.} +% \begin{macrocode} +\providecommand*{\csNewCommandCopycs}[2]{% + \expandafter\NewCommandCopy\csname#1\expandafter\endcsname% + \csname#2\endcsname% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\NewEnvironmentCopy} \marg{dest} \marg{source} +% +% Copies an environment to a new definition. +% +% \changes{v0.903}{2021/12/21}{Added.} +% \begin{macrocode} +\providecommand*{\NewEnvironmentCopy}[2]{% + \csNewCommandCopycs{#1}{#2}% + \csNewCommandCopycs{end#1}{end#2}% +} +% \end{macrocode} +% \end{macro} +% +% % \subsection{Chinese text isolation} % % \begin{macro}{\LWR@isolate} \marg{text} @@ -14206,11 +14309,11 @@ This boolean may be tested by the user for later use. % \begin{macrocode} \newcommand{\LWR@isolate}[1]{#1}% -\@ifpackageloaded{ctexpatch}{ +\IfPackageLoadedTF{ctexpatch}{ \renewcommand{\LWR@isolate}[1]{\null#1\null}% }{} -\@ifpackageloaded{xeCJK}{ +\IfPackageLoadedTF{xeCJK}{ \renewcommand{\LWR@isolate}[1]{\null#1\null}% }{} % \end{macrocode} @@ -15384,7 +15487,7 @@ This boolean may be tested by the user for later use. % \changes{v0.50}{2018/02/24}{Fix: Load \pkg{fontspec} if necessary.} % \begin{macrocode} \ifxetexorluatex -\@ifpackageloaded{fontspec}{}{ +\IfPackageLoadedTF{fontspec}{}{ \usepackage[no-math]{fontspec} } % \end{macrocode} @@ -15459,7 +15562,7 @@ This boolean may be tested by the user for later use. % \LaTeX{} dash and quote ligatures, which may fail on older browers % but at least won't corrupt written words. % \begin{macrocode} -\RequirePackage {microtype} +\RequirePackage{microtype} \microtypesetup{ protrusion=false, @@ -15560,7 +15663,7 @@ This boolean may be tested by the user for later use. % These will be replaced by \pkg{lwarp} \cs{AtBeginDocument} % with a very large page size to reduce \HTML\ tag overflow off the page. % \begin{macrocode} -\@ifpackageloaded{geometry} +\IfPackageLoadedTF{geometry} {}{ \RequirePackage[ reset, @@ -15763,18 +15866,8 @@ This boolean may be tested by the user for later use. % Used to emulate \cs{nameref}. % \begin{macrocode} \RequirePackage{gettitlestring} -% \end{macrocode} -% \DescribePackage{everyhook} -% -% \pkg{everyhook} is used to patch paragraph handling. -% -% \changes{v0.63}{2018/11/29}{\pkg{everyhook}: Fix for \pkg{bxjs*} classes.} -% \begin{macrocode} -\@ifundefined{bxjs@everypar}{}{\let\everypar\bxjs@everypar} - -\RequirePackage{everyhook} \end{warpHTML} % \end{macrocode} @@ -15804,7 +15897,7 @@ This boolean may be tested by the user for later use. \LetLtxMacro\LWR@orig@filec@ntents\filec@ntents - \@ifpackagelater{filecontents}{2011/10/08} + \IfPackageAtLeastTF{filecontents}{2011/10/08} { % \end{macrocode} % For a newer version of the \pkg{filecontents} package, simply @@ -16288,7 +16381,7 @@ This boolean may be tested by the user for later use. % if a package has already been loaded, it is loaded again with its original options. % \changes{v0.79}{2019/12/31}{Fix: \pkg{catoptions}.} % \begin{macrocode} - \@ifpackageloaded{#1}{% + \IfPackageLoadedTF{#1}{% \edef\LWR@tempone{\csuse{opt@#1.sty}}% \IfValueTF{#2}% {% @@ -16624,11 +16717,17 @@ This boolean may be tested by the user for later use. % \section{Defining print and \HTML\ versions of macros and environments} % \label{sec:definingprinthtml} -% \gindex{print>selecting print/HTML definitions} -% \gindex{HTML>selecting print/HTML definitions} +% \gindex{print>defining print \Slash HTML macros \Slash envs} +% \gindex{HTML>defining print \Slash HTML macros \Slash envs} +% \gindex{LWR@formatted=\cs{LWR@formatted} print \Slash HTML} +% \gindex{defining print \Slash HTML macros \Slash envs} % -% The following refers to defining objects inside \pkg{lwarp}, and is not -% for the user's document. +% \changes{v0.903}{2021/12/19}{Docs: Now using \cs{NewCommandCopy}, \pkg{xparse} OK.} +% +% The following refers to defining objects inside \pkg{lwarp}, +% and may also be of some use for package authors to adapt their +% packages for \pkg{lwarp}. +% The following is not for the user's document. % % Many macros and environments must be provided as both print and \HTML\ versions. % @@ -16648,97 +16747,51 @@ This boolean may be tested by the user for later use. % % \begin{description} % -% \item[For a preexisting macro, not defined with \pkg{xparse}:] An \HTML\ version +% \item[For a preexisting macro:] 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: % \needspace{5\baselineskip} % \begin{sourceverb} % \begin{warpHTML} -% \newcommand{\LWR@HTML@name}{...}% may also use xparse +% \newcommand{\LWR@HTML@name}{...} % % \LWR@formatted{name} % \end{warpHTML} % \end{sourceverb} -% |\LWR@formatted{name}| copies the original print version, +% |\LWR@formatted{name}| copies the original print version to a new +% name \cs{LWR@print@}, % 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 -% define the new \HTML\ version, even if the original did not use \pkg{xparse}. -% \pkg{expl3} syntax may be used as well. +% on which mode \pkg{lwarp} is using. -% \item[For a preexisiting environment, not defined with \pkg{xparse}:] The process +% \item[For a preexisiting environment:] The process % is similar. Note the use of \cs{LWR@formattedenv} instead of \cs{LWR@formatted}. % \needspace{5\baselineskip} % \begin{sourceverb} % \begin{warpHTML} -% \newenvironment{LWR@HTML@name}{...}% may also use xparse +% \newenvironment{LWR@HTML@name}{...}{..} % % \LWR@formattedenv{name} % \end{warpHTML} % \end{sourceverb} -% \item[If the original used \pkg{xparse}:] A copy must be made using a new name: -% \needspace{7\baselineskip} -% \begin{sourceverb} -% \begin{warpHTML} -% \NewDocumentCommand{\LWR@print@name}{..}{..}% copy the original -% -% \NewDocumentCommand{\LWR@HTML@name}{..}{..}% or use \newcommand -% -% \LWR@formatted{name} -% \end{warpHTML} -% \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, -% which may not work with macros and environments created by \pkg{xparse}, -% 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:] \ +% \item[For a new macro or environment:] The print version is defined inside +% \env{warpall}, so that it can also be seen and modified by during \HTML\ outut. % \needspace{9\baselineskip} % \begin{sourceverb} % \begin{warpall} -% \newcommand{\name}{...}% NOT xparse! +% \newcommand{\name}{...}% The print version. % \end{warpall} % % \begin{warpHTML} -% \newcommand{\LWR@HTML@name}{...}% may use xparse for HTML +% \newcommand{\LWR@HTML@name}{...} % % \LWR@formatted{name} % \end{warpHTML} % \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}. -% \pkg{xparse} may be used for the \cs{LWR@HTML@} version. -% \pkg{expl3} syntax may be used for the print and \HTML\ versions. -% -% \item [For a new macro or environment, using \pkg{xparse}:] -% It is possible to use \pkg{xparse} for an entirely new macro or environment -% 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: -% \needspace{16\baselineskip} -% \begin{sourceverb} -% \begin{warpall} -% \NewDocumentCommand{\LWR@print@name}{...} {...}% -or- -% \NewDocumentEnvironment{\LWR@print@name}{...} {...} {...} -% -% % Simply a call to \LWR@print@name: -% \newcommand{\name}{\LWR@print@name}% -or- -% \newenvironment{name}{\LWR@print@name}{\endLWR@print@name} -% \end{warpall} -% -% \begin{warpHTML} -% \NewDocumentCommand{\LWR@HTML@name}{...} {...}% -or- -% \NewDocumentEnvironment{\LWR@HTML@name}{...} {...} {...} -% -% \LWR@formatted{name}% -or- -% \LWR@formattedenv{name} -% \end{warpHTML} -% \end{sourceverb} +% Similar for an environment, using \cs{formattedenv}. % % \end{description} -% + % In general, \cs{LWR@formatted} or \cs{LWR@formattedenv} are placed inside % a \env{warpHTML} environment, and while producing an \HTML\ document % they do the following: @@ -16755,16 +16808,16 @@ This boolean may be tested by the user for later use. % used, as well as any new definitions defined in \env{warpall} above. % \item When \pkg{lwarp} is generating \HTML\ output, \cs{LWR@formatting} is % set to ``|HTML|'', and \cs{name} is directed to \cs{LWR@HTML@}. +% For an environment, \cs{endname} is directed to \cs{endLWR@HTML@}. % \item When \pkg{lwarp} is generating \HTML\ output % but enters a \env{lateximage} environment, % or for some other reason needs to draw images using the original print % defintions, \cs{LWR@formatting} is changed to ``|print|'' and \cs{name} is % then redirected to \cs{LWR@print@}, which was the original \cs{name}. +% \item Since the new \cs{name} does not process any arguments, +% they are processed by \cs{LWR@print@name} or \cs{LWR@HTML@name}. % \end{itemize} % -% Since arguments are not handled by the new \cs{name}, any star and other arguments -% are processed by the print or \HTML\ version. -% % Expandable versions are also provided as well. % These usually are necessary for anything which could appear inside a \env{tabular}, % without which a ``|Misplaced \omit|'' error may occur. @@ -16861,12 +16914,12 @@ This boolean may be tested by the user for later use. % where is set by \cs{LWR@formatting}, and is |print| or |HTML|. % % \changes{v0.893}{2020/11/15}{Improved error handling.} +% \changes{v0.903}{2021/12/19}{Now using \cs{NewCommandCopy}.} % \begin{macrocode} \newcommand*{\LWR@formatted}[1]{% \LWR@formatted@checkname{#1}% \ifcsundef{LWR@print@#1}{% - \expandafter\LetLtxMacro\csname LWR@print@#1\expandafter\endcsname% - \csname#1\endcsname% + \csNewCommandCopycs{LWR@print@#1}{#1}% }{}% \ifcsundef{#1}{% \expandafter\newrobustcmd\csname #1\endcsname{% @@ -16888,12 +16941,12 @@ This boolean may be tested by the user for later use. % An expandable version of \cs{LWR@formatted}. % % \changes{v0.893}{2020/11/15}{Improved error handling.} +% \changes{v0.903}{2021/12/19}{Now using \cs{NewCommandCopy}.} % \begin{macrocode} \newcommand*{\LWR@expandableformatted}[1]{% \LWR@formatted@checkname{#1}% \ifcsundef{LWR@print@#1}{% - \expandafter\LetLtxMacro\csname LWR@print@#1\expandafter\endcsname% - \csname#1\endcsname% + \csNewCommandCopycs{LWR@print@#1}{#1}% }{}% \ifcsundef{#1}{% \expandafter\newcommand\csname #1\endcsname{% @@ -16917,14 +16970,13 @@ This boolean may be tested by the user for later use. % where is set by \cs{LWR@formatting}, and is |print| or |HTML|. % % \changes{v0.893}{2020/11/15}{Improved error handling.} +% \changes{v0.903}{2021/12/19}{Now using \cs{NewCommandCopy}.} % \begin{macrocode} \newcommand*{\LWR@formattedenv}[1]{% \LWR@formatted@checkname{#1}% \LWR@formatted@checkendname{#1}% \ifcsundef{LWR@print@#1}{% - \expandafter\LetLtxMacro\csname LWR@print@#1\expandafter\endcsname% - \csname#1\endcsname% - \csletcs{endLWR@print@#1}{end#1}% + \NewEnvironmentCopy{LWR@print@#1}{#1}% }{}% \DeclareDocumentEnvironment{#1}{}% {% @@ -16943,14 +16995,13 @@ This boolean may be tested by the user for later use. % An expandable version of \env{LWR@formattedenv}. % % \changes{v0.893}{2020/11/15}{Improved error handling.} +% \changes{v0.903}{2021/12/19}{Now using \cs{NewCommandCopy}.} % \begin{macrocode} \newcommand*{\LWR@expandableformattedenv}[1]{% \LWR@formatted@checkname{#1}% \LWR@formatted@checkendname{#1}% \ifcsundef{LWR@print@#1}{% - \expandafter\LetLtxMacro\csname LWR@print@#1\expandafter\endcsname% - \csname#1\endcsname% - \csletcs{endLWR@print@#1}{end#1}% + \NewEnvironmentCopy{LWR@print@#1}{#1}% }{}% \DeclareExpandableDocumentEnvironment{#1}{}% {% @@ -17236,7 +17287,7 @@ This boolean may be tested by the user for later use. \LetLtxMacro\LWR@orig@textquotedbl\LWR@orig@@textquotedbl \AtEndPreamble{ -\@ifpackageloaded{libertinus-otf}{ +\IfPackageLoadedTF{libertinus-otf}{ \renewcommand{\LWR@orig@textquotedbl}{\LWR@orig@@textquotedbl\kern-.15em} \LetLtxMacro\textquotedbl\LWR@orig@textquotedbl }{} @@ -17764,16 +17815,17 @@ This boolean may be tested by the user for later use. }{% dvips % \end{macrocode} % For \DVI\ \prog{latex} with \prog{dvips} and \prog{ps2pdf}: +% \changes{v0.903}{2021/10/04}{Allow transparency.} % \begin{macrocode} \def\LWR@tempprintlatexcmd{% \LWR@compilecmd{latex}{} \LWR@addcompilecmd{dvips}{} - \LWR@addcompilecmd{ps2pdf}{}.ps + \LWR@addcompilecmd{ps2pdf -dALLOWPSTRANSPARENCY}{}.ps } \def\LWR@tempHTMLlatexcmd{% \LWR@compilecmd{latex}{_html} \LWR@addcompilecmd{dvips}{_html} - \LWR@addcompilecmd{ps2pdf}{_html}.ps + \LWR@addcompilecmd{ps2pdf -dALLOWPSTRANSPARENCY}{_html}.ps } } } @@ -17785,12 +17837,12 @@ This boolean may be tested by the user for later use. % \changes{v0.63}{2018/11/25}{\pkg{ujarticle} and related: Compile options.} % \changes{v0.64}{2018/12/07}{\pkg{utarticle} and related: Added.} % \begin{macrocode} -\@ifclassloaded{ujarticle}{\LWR@compileuplatex}{} -\@ifclassloaded{ujbook}{\LWR@compileuplatex}{} -\@ifclassloaded{ujreport}{\LWR@compileuplatex}{} -\@ifclassloaded{utarticle}{\LWR@compileuplatex}{} -\@ifclassloaded{utbook}{\LWR@compileuplatex}{} -\@ifclassloaded{utreport}{\LWR@compileuplatex}{} +\IfClassLoadedTF{ujarticle}{\LWR@compileuplatex}{} +\IfClassLoadedTF{ujbook}{\LWR@compileuplatex}{} +\IfClassLoadedTF{ujreport}{\LWR@compileuplatex}{} +\IfClassLoadedTF{utarticle}{\LWR@compileuplatex}{} +\IfClassLoadedTF{utbook}{\LWR@compileuplatex}{} +\IfClassLoadedTF{utreport}{\LWR@compileuplatex}{} % \end{macrocode} % Only make the setting permanent if the original was empty: % \changes{v0.61}{2018/09/20}{Added \optn{PrintLatexCmd} option.} @@ -17969,6 +18021,7 @@ This boolean may be tested by the user for later use. % \changes{v0.902}{2021/09/15}{\filenm{lwarp.css}: Centered \element{div} \attribute{author}.} % \changes{v0.902}{2021/09/15}{\filenm{lwarp.css}: Added \pkg{beamerarticle}.} % \changes{v0.902}{2021/09/28}{\filenm{lwarp.css}: Added \attribute{textnormal}.} +% \changes{v0.903}{2022/01/02}{\filenm{lwarp.css}: Improved pars in lists.} % % ^^A *lwarp.css % @@ -17978,7 +18031,7 @@ This boolean may be tested by the user for later use. \begin{filecontents*}[overwrite]{lwarp.css} /* CSS stylesheet for the LaTeX Lwarp package - Copyright 2016-2021 Brian Dunn — BD Tech Concepts LLC + Copyright 2016-2022 Brian Dunn — BD Tech Concepts LLC */ @@ -18490,7 +18543,7 @@ div.bodywithoutsidetoc main.bodycontainer { } section.textbody div.footnotes{ - margin: 3ex 2em .5ex 2em ; + margin: 1ex 2em 2ex 2em ; border-bottom: 2px solid silver ; } @@ -18527,6 +18580,8 @@ body dir, body menu { li { margin: 0ex 0em 1ex 0em; } +li.p { display: inline ; } + html { margin: 0; padding: 0; @@ -20807,6 +20862,7 @@ MathJax = { % \changes{v0.84}{2020/03/30}{\prog{lwarpmk}: \optn{clean} also removes \filenm{comment_*.cut}} % \changes{v0.89}{2020/08/29}{\prog{lwarpmk}: \optn{clean} also removes \filenm{*.bbl}} % \changes{v0.899}{2021/05/30}{\prog{lwarpmk}: Warn if \pkg{lwarp} package not detected.} +% \changes{v0.903}{2021/11/30}{\prog{lwarpmk}: Error if \prog{pdftotext} not available.} % % The following is only generated if the \optn{lwarpmk} option % was given to \pkg{lwarp}. @@ -20819,10 +20875,10 @@ MathJax = { \begin{filecontents*}[overwrite]{lwarpmk.lua} #!/usr/bin/env texlua --- Copyright 2016-2021 Brian Dunn +-- Copyright 2016-2022 Brian Dunn -printversion = "v0.902" +printversion = "v0.903" requiredconfversion = "2" -- also at *lwarpmk.conf function printhelp () @@ -21219,8 +21275,15 @@ function pdftohtml () -- Convert to text: print ("lwarpmk: Converting " .. sourcename .."_html.pdf to " .. sourcename .. "_html.html") -os.execute("pdftotext -enc " .. pdftotextenc .. " -nopgbrk -layout " +err = os.execute("pdftotext -enc " .. pdftotextenc .. " -nopgbrk -layout " .. sourcename .. "_html.pdf " .. sourcename .. "_html.html") +if ( err ~= 0 ) then + print ("lwarpmk: ===") + print ("lwarpmk: Ensure that the Poppler utilities are installed." ) + print ("lwarpmk: See the Lwarp manual: `Installing additional utilities'." ) + print ("lwarpmk: ===") + os.exit(1) +end -- Split the result into individual HTML files: splitfile (homehtmlfilename .. ".html" , sourcename .. "_html.html") end @@ -22079,15 +22142,40 @@ end -- not --version % \begin{macro}{\LWR@setexparray} \marg{name} \marg{index} \marg{contents} % \changes{v0.66}{2018/12/31}{Fix with \cs{par}.} % \changes{v0.79}{2020/01/18}{Fix: Nested \env{tabular}s.} +% \changes{v0.903}{2021/12/17}{Par handling.} % \begin{macrocode} +\newbool{LWR@setexparray@doingparhooks} + \NewDocumentCommand{\LWR@setexparray}{m m m}{% - \let\LWR@temp@par\par% +% \end{macrocode} +% +% Temporarily disable paragraph handling during the assignment. +% This is not done in a group with global assignments because +% a table may be nested. +% \begin{macrocode} + \let\ifLWR@setexparray@doingparhooks\ifLWR@doingparhooks% + \setbool{LWR@doingparhooks}{false}% + \let\LWR@setexparray@par\par% \let\par\relax% - \edef\LWR@thisexparrayname{#1#2}% +% \end{macrocode} +% +% The name of the control sequence is the given name with the +% index appended. +% \begin{macrocode} + \xdef\LWR@thisexparrayname{#1#2}% +% \end{macrocode} +% +% Locally assign the value to the control sequence: +% \begin{macrocode} \ifstrempty{#3}% {\csdef{\LWR@thisexparrayname}{}}% {\csedef{\LWR@thisexparrayname}{#3}}% - \let\par\LWR@temp@par% +% \end{macrocode} +% +% Restore the paragraph handling: +% \begin{macrocode} + \let\ifLWR@doingparhooks\ifLWR@setexparray@doingparhooks% + \let\par\LWR@setexparray@par% } % \end{macrocode} % \end{macro} @@ -23012,6 +23100,7 @@ end -- not --version % \subsection{Hook while processing tags} % +% \DescribeHook[lwarp]{\cs{LWR@hook@processingtags}} % This is used to disable special text processing while processing \HTML\ tags. % Special processing includes that done by % \pkg{babel-french}, \pkg{luavina}, \pkg{xevlna}. @@ -23197,60 +23286,60 @@ end -- not --version % \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.} % \changes{v0.896}{2021/03/05}{Issue \env{BlockClassWP} warning inside a span.} +% \changes{v0.903}{2021/12/17}{Par handling.} % % \begin{macrocode} \newcommand*{\LWR@nestspanitem}{% - \if@newlist\else{\LWR@htmltagc{br /}}\fi% + \if@newlist\else{ + \LWR@htmltagc{br /}% + \LWR@orignewline% + }\fi% \LWR@origitem% } \newenvironment*{LWR@nestspan} {% -\LWR@traceinfo{LWR@nestspan starting}% -\ifnumcomp{\value{LWR@lateximagedepth}}{>}{0}% -{% - \LWR@traceinfo{LWR@nestspan: inside a lateximage}% -}% -{% not in a lateximage - \LWR@traceinfo{LWR@nestspan: NOT inside a lateximage}% - \addtocounter{LWR@spandepth}{1}% + \LWR@traceinfo{LWR@nestspan starting}% + \ifnumcomp{\value{LWR@lateximagedepth}}{>}{0}% + {% + \LWR@traceinfo{LWR@nestspan: inside a lateximage}% + }% + {% not in a lateximage + \LWR@traceinfo{LWR@nestspan: NOT inside a lateximage}% + \addtocounter{LWR@spandepth}{1}% % \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@spanwarnformat{minipage or \protect\parbox}}% - {}% - \RenewDocumentEnvironment{BlockClass}{o m}% - {\LWR@spanwarnformat{multi-paragraph object}}% - {}% - \RenewDocumentEnvironment{LWR@BlockClassWP}{m m D(){} m}% - {\LWR@spanwarnformat{multi-paragraph object}}% - {}% - \renewcommand{\BlockClassSingle}[2]{% - {\LWR@spanwarnformat{multi-paragraph object}}% - ##2% - }% - \renewcommand{\LWR@forcenewpage}{}% - \renewcommand{\LWR@liststart}{% - \LetLtxMacro\item\LWR@nestspanitem% - }% - \renewcommand{\LWR@listend}{\LWR@htmltagc{br /}\LWR@htmltagc{br /}}% - \renewenvironment{quote}{\LWR@htmltagc{br /}}{\LWR@htmltagc{br /}}% - \renewenvironment{quotation}{\LWR@htmltagc{br /}}{\LWR@htmltagc{br /}}% -}% not in a lateximage -\LWR@traceinfo{LWR@nestspan starting: done}% + \RenewDocumentEnvironment{minipage}{O{t} o O{t} m}% + {\LWR@spanwarnformat{minipage or \protect\parbox}}% + {}% + \RenewDocumentEnvironment{BlockClass}{o m}% + {\LWR@spanwarnformat{multi-paragraph object}}% + {}% + \RenewDocumentEnvironment{LWR@BlockClassWP}{m m D(){} m}% + {\LWR@spanwarnformat{multi-paragraph object}}% + {}% + \renewcommand{\BlockClassSingle}[2]{% + {\LWR@spanwarnformat{multi-paragraph object}}% + ##2% + }% + \renewcommand{\LWR@forcenewpage}{}% + \renewcommand{\LWR@liststart}{\LetLtxMacro\item\LWR@nestspanitem}% + \renewcommand{\LWR@listend}{\leavevmode}% + \renewenvironment{quote}{\LWR@htmltagc{br /}}{\LWR@htmltagc{br /}}% + \renewenvironment{quotation}{\LWR@htmltagc{br /}}{\LWR@htmltagc{br /}}% + }% not in a lateximage + \LWR@traceinfo{LWR@nestspan starting: done}% }% starting env {% ending env -\LWR@traceinfo{LWR@nestspan ending}% -\ifnumcomp{\value{LWR@lateximagedepth}}{>}{0}% -{}% -{\addtocounter{LWR@spandepth}{-1}}% -\LWR@traceinfo{LWR@nestspan ending: done}% + \LWR@traceinfo{LWR@nestspan ending}% + \ifnumcomp{\value{LWR@lateximagedepth}}{>}{0}% + {}% + {\addtocounter{LWR@spandepth}{-1}}% + \LWR@traceinfo{LWR@nestspan ending: done}% } - -\AfterEndEnvironment{LWR@nestspan}{\global\let\par\LWR@closeparagraph} % \end{macrocode} % \end{environment} @@ -23265,12 +23354,12 @@ end -- not --version % % \begin{macrocode} \NewDocumentCommand{\LWR@htmlspan}{m +m}{% -\LWR@ensuredoingapar% -\LWR@htmltagc{#1}% -\begin{LWR@nestspan}% -#2% -\LWR@htmltagc{/#1}% -\end{LWR@nestspan}% + \LWR@ensuredoingapar% + \LWR@htmltagc{#1}% + \begin{LWR@nestspan}% + #2% + \LWR@htmltagc{/#1}% + \end{LWR@nestspan}% } % \end{macrocode} % \end{macro} @@ -23303,9 +23392,7 @@ end -- not --version % Print an \HTML\ tag: \textless{}tag\textgreater{} % \begin{macrocode} \newcommand*{\LWR@htmltag}[1]{% -% \LWR@traceinfo{LWR@htmltagb !\detokenize{#1}!}% -\LWR@htmltagc{#1}% -% \LWR@traceinfo{LWR@htmltagb: done}% + \LWR@htmltagc{#1}% } % \end{macrocode} % \end{macro} @@ -23321,25 +23408,21 @@ end -- not --version % \changes{v0.85}{2020/04/29}{Fix: Added print macros for \pkg{fontspec}.} % \begin{macrocode} \newcommand*{\LWR@htmlopencomment}{% -{% % \LWR@traceinfo{LWR@htmlopencomment}% -\begingroup% -\LWR@hook@processingtags% -\ifmmode\else\protect\LWR@print@normalfont\protect\LWR@origttfamily\fi% -\LWR@print@mbox{\LWR@origtextless{}!-\/-}% -\endgroup% -}% + \begingroup% + \LWR@hook@processingtags% + \ifmmode\else\protect\LWR@print@normalfont\protect\LWR@origttfamily\fi% + \LWR@print@mbox{\LWR@origtextless{}!-\/-}% + \endgroup% } \newcommand*{\LWR@htmlclosecomment}{% -{% % \LWR@traceinfo{LWR@htmlclosecomment}% -\begingroup% -\LWR@hook@processingtags% -\ifmmode\else\protect\LWR@print@normalfont\protect\LWR@origttfamily\fi% -\LWR@print@mbox{-\/-\LWR@origtextgreater}% -\endgroup% -}% + \begingroup% + \LWR@hook@processingtags% + \ifmmode\else\protect\LWR@print@normalfont\protect\LWR@origttfamily\fi% + \LWR@print@mbox{-\/-\LWR@origtextgreater}% + \endgroup% } % \end{macrocode} % \end{macro} @@ -23352,16 +23435,16 @@ end -- not --version % \changes{v0.893}{2020/10/16}{Disabled in math mode.} % \begin{macrocode} \newcommand{\LWR@htmlcomment}[1]{% -\ifmmode% -\else% - \LWR@htmlopencomment{}% - {% - \LWR@print@normalfont% - \LWR@origttfamily% break ligatures - #1% - }% - \LWR@htmlclosecomment{}% -\fi% + \ifmmode% + \else% + \LWR@htmlopencomment{}% + {% + \LWR@print@normalfont% + \LWR@origttfamily% break ligatures + #1% + }% + \LWR@htmlclosecomment{}% + \fi% } % \end{macrocode} % \end{macro} @@ -23370,16 +23453,16 @@ end -- not --version % \begin{macro}{\LWR@htmlblockcomment} \marg{comment} % \begin{macrocode} \newcommand{\LWR@htmlblockcomment}[1] -{\LWR@stoppars\LWR@htmlcomment{#1}\LWR@startpars} + {\LWR@stoppars\LWR@htmlcomment{#1}\LWR@startpars} % \end{macrocode} % \end{macro} % \begin{macro}{\LWR@htmlblocktag} \marg{tag} print a stand-alone \HTML\ tag % \begin{macrocode} \newcommand*{\LWR@htmlblocktag}[1]{% -\LWR@stoppars% -\LWR@htmltag{#1}% -\LWR@startpars% + \LWR@stoppars% + \LWR@htmltag{#1}% + \LWR@startpars% } % \end{macrocode} % \end{macro} @@ -23408,24 +23491,24 @@ end -- not --version % % \begin{macrocode} \NewDocumentCommand{\LWR@subhtmlelementclass}{m O{} D(){} m}{% -\LWR@traceinfo{LWR@subhtmlelementclass !#1!#2!#3!#4!}% -\ifblank{#2}% -{% empty style - \LWR@htmltag{% - #1% - \ifblank{#3}{}{ role=\textquotedbl#3\textquotedbl}% spaces - \ifblank{#4}{}{ class=\textquotedbl#4\textquotedbl}% spaces + \LWR@traceinfo{LWR@subhtmlelementclass !#1!#2!#3!#4!}% + \ifblank{#2}% + {% empty style + \LWR@htmltag{% + #1% + \ifblank{#3}{}{ role=\textquotedbl#3\textquotedbl}% spaces + \ifblank{#4}{}{ class=\textquotedbl#4\textquotedbl}% spaces + }% }% -}% -{% non-empty style - \LWR@htmltag{% - #1\LWR@indentHTML% - \ifblank{#3}{}{role=\textquotedbl#3\textquotedbl\LWR@indentHTML}% - \ifblank{#4}{}{class=\textquotedbl#4\textquotedbl\LWR@indentHTML}% - style=\textquotedbl#2\textquotedbl\LWR@orignewline% + {% non-empty style + \LWR@htmltag{% + #1\LWR@indentHTML% + \ifblank{#3}{}{role=\textquotedbl#3\textquotedbl\LWR@indentHTML}% + \ifblank{#4}{}{class=\textquotedbl#4\textquotedbl\LWR@indentHTML}% + style=\textquotedbl#2\textquotedbl\LWR@orignewline% + }% }% -}% -\LWR@traceinfo{LWR@subhtmlelementclass done}% + \LWR@traceinfo{LWR@subhtmlelementclass done}% } % \end{macrocode} % \end{macro} @@ -23497,12 +23580,12 @@ end -- not --version % \changes{v0.73}{2019/06/26}{Vertical space.} % \begin{macrocode} \NewDocumentCommand{\LWR@htmlelementclassline}{m o m +m}{% -\LWR@stoppars -\LWR@forceemptyline% -\LWR@subhtmlelementclass{#1}[#2]{#3}% -#4% -\LWR@htmltag{/#1} -\LWR@startpars + \LWR@stoppars + \LWR@forceemptyline% + \LWR@subhtmlelementclass{#1}[#2]{#3}% + #4% + \LWR@htmltag{/#1} + \LWR@startpars } % \end{macrocode} % \end{macro} @@ -23516,7 +23599,7 @@ end -- not --version % \begin{macro}{\LWR@htmlelement} \marg{element} % \begin{macrocode} \newcommand*{\LWR@htmlelement}[1]{% -\LWR@htmlblocktag{#1} + \LWR@htmlblocktag{#1} } % \end{macrocode} % \end{macro} @@ -23524,9 +23607,9 @@ end -- not --version % \begin{macro}{\LWR@htmlelementend} \marg{element} % \begin{macrocode} \newcommand*{\LWR@htmlelementend}[1]{% -\LWR@stoppars -\LWR@htmltag{/#1} -\LWR@startpars + \LWR@stoppars + \LWR@htmltag{/#1} + \LWR@startpars } \end{warpHTML} @@ -23558,12 +23641,13 @@ end -- not --version % \changes{v0.34}{2017/08/02}{Moved optional argument in front of mandatory.} % \changes{v0.57}{2018/05/28}{Improved print/\HTML\ output selection.} % \changes{v0.896}{2021/03/05}{Added \ARIA\ role.} +% \changes{v0.903}{2021/12/19}{Now using \cs{NewCommandCopy}.} % -% \codeprint +% \codeall % \begin{macrocode} -\begin{warpprint} +\begin{warpall} \NewDocumentEnvironment{BlockClass}{o D(){} m}{}{} -\end{warpprint} +\end{warpall} % \end{macrocode} % \end{environment} % @@ -23571,8 +23655,6 @@ end -- not --version % \begin{macrocode} \begin{warpHTML} -\NewDocumentEnvironment{LWR@print@BlockClass}{o D(){} m}{}{}% - \NewDocumentEnvironment{LWR@HTML@BlockClass}{o D(){} m}% {\LWR@htmldivclass[#1](#2){#3}}% {\LWR@htmldivclassend{#3}} @@ -23623,30 +23705,29 @@ end -- not --version % \changes{v0.34}{2017/08/02}{Moved optional argument in front of mandatory.} % \changes{v0.57}{2018/05/28}{Improved print/\HTML\ output selection.} % \changes{v0.62}{2018/10/24}{Added optional word-processing style. Replaces \cs{LWR@HTMLtextstyle}.} +% \changes{v0.903}{2021/12/19}{Now using \cs{NewCommandCopy}.} % -% \codeprint +% \codeall % \begin{macrocode} -\begin{warpprint} +\begin{warpall} \NewDocumentCommand{\InlineClass}{D{(}{)}{} o m +m}{#4}% -\end{warpprint} +\end{warpall} % \end{macrocode} % \end{macro} % % \codehtml % \begin{macrocode} \begin{warpHTML} -\NewDocumentCommand{\LWR@print@InlineClass}{D{(}{)}{} o m +m}{#4}% - \NewDocumentCommand{\LWR@HTML@InlineClass}{D{(}{)}{} o m +m}{% -\LWR@traceinfo{LWR@HTML@InlineClass #3}% -\ifbool{FormatWP}{% - \LWR@traceinfo{LWR@HTML@InlineClass: FormatWP}% - \LWR@htmlspanclass[#1]{#3}{#4}% -}{% - \LWR@traceinfo{LWR@HTML@InlineClass: not FormatWP}% - \LWR@htmlspanclass[#2]{#3}{#4}% -}% -\LWR@traceinfo{LWR@HTML@InlineClass: done}% + \LWR@traceinfo{LWR@HTML@InlineClass #3}% + \ifbool{FormatWP}{% + \LWR@traceinfo{LWR@HTML@InlineClass: FormatWP}% + \LWR@htmlspanclass[#1]{#3}{#4}% + }{% + \LWR@traceinfo{LWR@HTML@InlineClass: not FormatWP}% + \LWR@htmlspanclass[#2]{#3}{#4}% + }% + \LWR@traceinfo{LWR@HTML@InlineClass: done}% } \LWR@formatted{InlineClass} @@ -23667,48 +23748,47 @@ end -- not --version % \changes{v0.57}{2018/05/28}{Improved print/\HTML\ output selection.} % \changes{v0.63}{2018/11/24}{Fix for \pkg{xeCJK}.} % \changes{v0.896}{2021/03/05}{Added \ARIA\ role.} +% \changes{v0.903}{2021/12/19}{Now using \cs{NewCommandCopy}.} % -% \codeprint +% \codeall % \begin{macrocode} -\begin{warpprint} +\begin{warpall} \NewDocumentEnvironment{LWR@BlockClassWP}{m m D(){} m}{}{} -\end{warpprint} +\end{warpall} % \end{macrocode} % \end{environment} % % \codehtml % \begin{macrocode} \begin{warpHTML} -\NewDocumentEnvironment{LWR@print@LWR@BlockClassWP}{m m D(){} m}{}{}% - \NewDocumentEnvironment{LWR@HTML@LWR@BlockClassWP}{m m D(){} m}% -{% -\LWR@stoppars% -\ifbool{FormatWP}% -{% - \addtocounter{LWR@thisautoidWP}{1}% + {% + \LWR@stoppars% + \ifbool{FormatWP}% + {% + \addtocounter{LWR@thisautoidWP}{1}% % \end{macrocode} % \changes{v0.65}{2018/12/21}{Fix space between class and id.} % \begin{macrocode} - \LWR@htmltag{% - div class=\textquotedbl#4\textquotedbl\ % space - id=\textquotedbl% - \LWR@print@mbox{autoidWP-\arabic{LWR@thisautoidWP}}% - \textquotedbl% - \ifblank{#3}{}{ role=\textquotedbl#3\textquotedbl}% - \ifblank{#1}{}{ style=\textquotedbl#1\textquotedbl}% - }% -}% FormatWP -{% not FormatWP - \LWR@htmltag{% - div class=\textquotedbl#4\textquotedbl% - \ifblank{#3}{}{ role=\textquotedbl#3\textquotedbl}% - \ifblank{#2}{}{ style=\textquotedbl#2\textquotedbl}% - }% -}% not FormatWP -\LWR@startpars% -} -{\LWR@htmldivclassend{#4}} + \LWR@htmltag{% + div class=\textquotedbl#4\textquotedbl\ % space + id=\textquotedbl% + \LWR@print@mbox{autoidWP-\arabic{LWR@thisautoidWP}}% + \textquotedbl% + \ifblank{#3}{}{ role=\textquotedbl#3\textquotedbl}% + \ifblank{#1}{}{ style=\textquotedbl#1\textquotedbl}% + }% + }% FormatWP + {% not FormatWP + \LWR@htmltag{% + div class=\textquotedbl#4\textquotedbl% + \ifblank{#3}{}{ role=\textquotedbl#3\textquotedbl}% + \ifblank{#2}{}{ style=\textquotedbl#2\textquotedbl}% + }% + }% not FormatWP + \LWR@startpars% + } + {\LWR@htmldivclassend{#4}} \LWR@formattedenv{LWR@BlockClassWP} \end{warpHTML} @@ -23775,14 +23855,16 @@ end -- not --version % Paragraph tags are or are not allowed depending on many conditions. % \Cref{sec:parstartstop} has high-level commands which allow % paragraph-tag generation to start/stop. -% Even when allowed (\cs{LWR@doingstartpars}), +% Even when allowed (\bool{LWR@doingstartpars}), % tags are not generated until a \LaTeX{} paragraph -% is being used (\cs{LWR@doingapar}). -% |LWR@lateximagedepth| is used to prevent nesting tags inside -% a |lateximage|. -% |LWR@spandepth| is used to prevent nesting paragraph tags inside +% is being used (\bool{LWR@doingapar}). +% \ctr{LWR@lateximagedepth} is used to prevent nesting tags inside +% a \env{lateximage}. +% \ctr{LWR@spandepth} is used to prevent nesting paragraph tags inside % a paragraph, which became important inside \cs{fbox} commands and other spans. - +% +% The \LaTeX\ paragraph hooks are used to manage tag creation. +% % \codehtml % \begin{macrocode} \begin{warpHTML} @@ -23797,6 +23879,31 @@ end -- not --version % \end{macrocode} +% \DescribeBoolean{LWR@doingparhooks} +% Tells whether the \pkg{lwarp} paragraph hooks are to be active. +% \begin{macrocode} +\newbool{LWR@doingparhooks} +\boolfalse{LWR@doingparhooks} +% \end{macrocode} + +% \DescribeBoolean{LWR@in@multirow@par} +% Tells whether to generate break instead of paragraph tags inside a \cs{multirow}. +% \changes{v0.903}{2021/12/17}{Par handling.} +% \begin{macrocode} +\newbool{LWR@in@multirow@par} +\boolfalse{LWR@in@multirow@par} +% \end{macrocode} + + +% \DescribeBoolean{LWR@starting@fancybox} +% Suppresses \element{br} if beginning a \pkg{fancybox} environment. +% \changes{v0.903}{2022/01/29}{Par handling.} +% \begin{macrocode} +\newbool{LWR@starting@fancybox} +\boolfalse{LWR@starting@fancybox} +% \end{macrocode} + + % \DescribeBoolean{LWR@doingstartpars} % Tells whether paragraphs may be generated. % \begin{macrocode} @@ -23843,17 +23950,20 @@ end -- not --version % % See if paragraph handling is enabled: % \begin{macrocode} -\ifbool{LWR@doingstartpars}% -{% handling pars + \ifboolexpr{ + bool{LWR@doingparhooks} and + bool{LWR@doingstartpars} + }% + {% handling pars % \end{macrocode} % % See if have already started a \env{lateximage} or a \element{span}. % If so, do not generate nested paragraph tags. % \begin{macrocode} - \ifboolexpr{ - test {\ifnumcomp{\value{LWR@lateximagedepth}}{>}{0}} or - test {\ifnumcomp{\value{LWR@spandepth}}{>}{0}} - }% nested par tags? + \ifboolexpr{ + test {\ifnumcomp{\value{LWR@lateximagedepth}}{>}{0}} or + test {\ifnumcomp{\value{LWR@spandepth}}{>}{0}} + }% nested par tags? % \end{macrocode} % % If so: Do nothing if already started a \env{lateximage} page. @@ -23861,14 +23971,14 @@ end -- not --version % Also do nothing if already inside a \element{span}. Do not nest paragraph tags % inside a \element{span}. % \begin{macrocode} - {}% no nested par tags + {}% no nested par tags % \end{macrocode} % % Else: No \env{lateximage} or \element{span} has been started yet, % so it's OK to generate paragraph tags. % \begin{macrocode} - {% yes nest par tags - \ifbool{LWR@doingapar}{}{% + {% yes nest par tags + \ifbool{LWR@doingapar}{}{% % \end{macrocode} % % If \pkg{parnotes} is used, paragraph notes are inserted @@ -23876,35 +23986,30 @@ end -- not --version % \changes{v0.56}{2018/05/09}{Added support for \pkg{parnotes}.} % \changes{v0.902}{2021/09/20}{Improved \pkg{parnotes}.} % \begin{macrocode} - \PN@parnotes@auto% + \PN@parnotes@auto% % \end{macrocode} % % Set flag before creating the tag, so that the tag itself does not trigger % a new paragraph: % \changes{v0.902}{2021/09/20}{Improved par tags.} % \begin{macrocode} - \global\booltrue{LWR@doingapar}% + \global\booltrue{LWR@doingapar}% % \end{macrocode} % % The opening paragraph tag. % Do not create tag if doing \pkg{algorithm2e} handling instead: % \changes{v0.66}{2019/02/02}{Improved \HTML\ formatting.} +% \changes{v0.903}{2021/12/17}{Par handling.} % \begin{macrocode} - \ifbool{LWR@algocf@dopars}{}{% - \LWR@htmltagc{\LWR@tagregularparagraph}\LWR@orignewline% + \ifbool{LWR@algocf@dopars}{}{% + \ifbool{LWR@in@multirow@par}% + {}% + {\LWR@htmltagc{\LWR@tagregularparagraph}\LWR@orignewline}% + }% }% - }% -% \end{macrocode} -% -% At the endof each paragraph, -% generate closing tag and do regular |/par| stuff. -% (Attempting to use the \pkg{everyhook} |cr| hook -% for \cs{LWR@closeparagraph} does not work well.) -% \begin{macrocode} - \let\par\LWR@closeparagraph% - }% end of yes nest par tags -}% end of handling pars -{}% not handling pars + }% end of yes nest par tags + }% end of handling pars + {}% not handling pars } \let\LWR@ensuredoingapar\LWR@openparagraph @@ -23919,17 +24024,18 @@ end -- not --version % and not in tabular metadata. Factored from \cs{LWR@closeparagraph}. % % \changes{v0.66}{2019/01/01}{Factored.} +% \changes{v0.903}{2021/12/17}{Par handling.} % \begin{macrocode} \newcommand*{\LWR@closeparagraph@br} {% \ifboolexpr{ test {\ifnumcomp{\value{LWR@spandepth}}{>}{0}} and test {\ifnumcomp{\value{LWR@lateximagedepth}}{=}{0}} and - not bool {LWR@intabularmetadata} + not bool {LWR@starting@fancybox} and + not bool {LWR@intabularmetadata} or + bool {LWR@in@multirow@par} }% - {% - \unskip\LWR@htmltagc{br /}% - }% + {\unskip\LWR@htmltagc{br /}}% {}% } % \end{macrocode} @@ -23948,36 +24054,39 @@ end -- not --version % % See if paragraph handling is enabled: % \begin{macrocode} -\ifbool{LWR@doingapar}% + \ifbool{LWR@doingparhooks}{% + \ifbool{LWR@doingapar}% % \end{macrocode} % % If currently in paragraph mode: % \begin{macrocode} -{% handling pars + {% handling pars % \end{macrocode} % % See if already started a \env{lateximage} or a \element{span}: +% \changes{v0.903}{2021/12/17}{Par handling.} % \begin{macrocode} - \ifboolexpr{ - test {\ifnumcomp{\value{LWR@lateximagedepth}}{>}{0}} or - test {\ifnumcomp{\value{LWR@spandepth}}{>}{0}} - }% + \ifboolexpr{ + test {\ifnumcomp{\value{LWR@lateximagedepth}}{>}{0}} or + test {\ifnumcomp{\value{LWR@spandepth}}{>}{0}} or + bool{LWR@in@multirow@par} + }% % \end{macrocode} % % Add a parbreak if in a span, not in a lateximage, % and not in table metadata. % \begin{macrocode} - {% no nested par tags - \LWR@closeparagraph@br% - }% no nested par tags + {% no nested par tags + \LWR@closeparagraph@br% + }% no nested par tags % \end{macrocode} % % If have not already started a \env{lateximage} or a \element{span}: % \begin{macrocode} - {% yes nest par tags + {% yes nest par tags % \end{macrocode} % -% Print a closing tag and some extra vertical space. +% Print a closing tag. % % (The fill seems to be required to force the \pkg{caption} % package to create flush left caption text in the \HTML.) @@ -23985,20 +24094,20 @@ end -- not --version % \changes{v0.70}{2019/03/25}{Reduced underfull \cs{hbox} warnings.} % \changes{v0.71}{2019/04/08}{Flush left captions.} % \begin{macrocode} - \@hspacer{\fill}% \hspace*{\fill} - \leavevmode\LWR@orignewline% - \LWR@htmltagc{/\LWR@tagregularparagraph}% + \@hspacer{\fill}% \hspace*{\fill} + \leavevmode\LWR@orignewline% + \LWR@htmltagc{/\LWR@tagregularparagraph}% % \end{macrocode} % % No longer doing a paragraph: % \begin{macrocode} - \global\boolfalse{LWR@doingapar}% keep + \global\boolfalse{LWR@doingapar}% % \end{macrocode} % % Disable the special \env{minipage} \& \cs{hspace} interaction % until a new minipage is found: % \begin{macrocode} - \global\boolfalse{LWR@minipagethispar}% + \global\boolfalse{LWR@minipagethispar}% % \end{macrocode} % % If \pkg{parnotes} is used, paragraph notes are inserted @@ -24006,53 +24115,71 @@ end -- not --version % \changes{v0.56}{2018/05/09}{Added support for \pkg{parnotes}.} % \changes{v0.902}{2021/09/20}{Improved \pkg{parnotes}.} % \begin{macrocode} - \PN@parnotes@auto% + \PN@parnotes@auto% % \end{macrocode} % -% After creating par notes, not yet started a new paragraph: % \begin{macrocode} - \global\boolfalse{LWR@doingapar}% - }% end of yes nest par tags -}% end of handling pars + }% end of yes nest par tags + }% LWR@doingapar: end of handling pars % \end{macrocode} % % Add a parbreak if in a span, not in a lateximage, % and not in table metadata. % \changes{v0.66}{2019/01/01}{Fix: Combined span, \env{tabular}, and \env{lateximage}.} % \begin{macrocode} -{% not handling pars - \LWR@closeparagraph@br% -}% not handling pars + {% not LWR@doingapar: not handling pars + \LWR@closeparagraph@br% + }% not handling pars % \end{macrocode} % % In most cases, finish with a \LaTeX\ \cs{par}, but in the case -% of paragraphs between lines in a tabular fetch the next token instead: +% of paragraphs between lines in a tabular fetch the next token instead. +% Required for \cs{multicolumn}. % \changes{v0.46}{2018/01/19}{Fix: Tabular empty lines.} % \begin{macrocode} -\ifboolexpr{% - not bool {LWR@doingapar} and - test {\ifnumcomp{\value{LWR@tabulardepth}}{>}{0}} and - test { - \ifnumcomp{\value{LWR@tabulardepth}}{=}{\value{LWR@tabularpardepth}} - } and - bool {LWR@intabularmetadata} and - not bool {LWR@tableparcell} and - test {\ifnumcomp{\value{LWR@lateximagedepth}}{=}{0}} -}% -{% - \LWR@getmynexttoken% -}{% - \LWR@origpar% -}% + \ifboolexpr{% + not bool {LWR@doingapar} and + test {\ifnumcomp{\value{LWR@tabulardepth}}{>}{0}} and + test { + \ifnumcomp{\value{LWR@tabulardepth}}{=}{\value{LWR@tabularpardepth}} + } and + bool {LWR@intabularmetadata} and + not bool {LWR@tableparcell} and + test {\ifnumcomp{\value{LWR@lateximagedepth}}{=}{0}} + }% + {\LWR@getmynexttoken}% + {}% + }% LWR@doingparhooks + {}% not LWR@doingparhooks +% Do not place anything here, due to the above \LWR@getmynexttoken. } % \end{macrocode} % \end{macro} + +% \subsection{Paragraph Hooks} +% +% \changes{v0.903}{2021/12/17}{Par handling.} +% +% \DescribeHook[LaTeX]{para/begin} +% \begin{macrocode} +\AddToHook{para/begin}[lwarp]{\LWR@openparagraph} +% \end{macrocode} +% +% \DescribeHook[LaTeX]{para/end} +% \begin{macrocode} +\AddToHook{para/end}[lwarp]{\LWR@closeparagraph} +% \end{macrocode} + + % \begin{macrocode} \end{warpHTML} % \end{macrocode} + + + % \section{Paragraph start/stop handling} % \label{sec:parstartstop} % These commands allow/disallow the generation of \HTML\ @@ -24061,8 +24188,8 @@ end -- not --version % \Cref{sec:parhanding} has the commands which actually generate % the tags. % -% The |everyhook| package is used to generate the opening -% paragraph tags. The closing tags are generated by \cs{par}. +% The \LaTeX\ paragraph hooks are used to generate the opening and closing +% paragraph tags. % \codehtml % \begin{macrocode} @@ -24074,62 +24201,49 @@ end -- not --version % 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}.} +% \changes{v0.903}{2021/12/17}{Par handling.} % \begin{macrocode} \newcommand*{\LWR@startpars}% {% -% \LWR@traceinfo{LWR@startpars}% % \end{macrocode} % % Ignore if inside a \env{lateximage} or \element{span}: % \begin{macrocode} -\ifboolexpr{ - test {\ifnumcomp{\value{LWR@lateximagedepth}}{>}{0}} or - test {\ifnumcomp{\value{LWR@spandepth}}{>}{0}} -}% -{}% -{% + \ifboolexpr{ + test {\ifnumcomp{\value{LWR@lateximagedepth}}{>}{0}} or + test {\ifnumcomp{\value{LWR@spandepth}}{>}{0}} + }% + {}% nesting + {% not nesting % \end{macrocode} % +% The \LaTeX\ paragraph hook controls tag generation for +% the start and end of paragraphs. +% % See if currently handling \HTML\ paragraphs: % \begin{macrocode} - \ifbool{LWR@doingstartpars}% + \ifboolexpr {bool{LWR@doingparhooks} and bool{LWR@doingstartpars}}% % \end{macrocode} % % If already in paragraph mode, do nothing. % \begin{macrocode} - {}% + {}% % \end{macrocode} % % If not currently in paragraph mode: % \begin{macrocode} - {% -% \end{macrocode} -% -% At the start of each paragraph, generate an opening tag: -% \gindex{par=\cs{par}>hooks} -% \changes{v0.902}{2021/09/24}{Cleared hook before adding.} -% \begin{macrocode} - \ClearPreHook{par}% - \PushPreHook{par}{\LWR@openparagraph}% -% \end{macrocode} -% -% At the end of each paragraph, generate closing tag then do regular |/par| actions: -% \begin{macrocode} - \let\par\LWR@closeparagraph - - }% an intentionally blank line + {\par}% % \end{macrocode} % % Are now handling paragraphs, but have not yet actually started one: % \begin{macrocode} - \global\setbool{LWR@doingstartpars}{true}% + \global\booltrue{LWR@doingstartpars}% % \end{macrocode} % % No \element{par} tag yet to undo: % \begin{macrocode} - \global\boolfalse{LWR@doingapar}% -}% nestspan -% \LWR@traceinfo{LWR@startpars: done}% + \global\boolfalse{LWR@doingapar}% + }% not nesting } % \end{macrocode} % \end{macro} @@ -24141,6 +24255,7 @@ end -- not --version % % \changes{v0.36}{2017/08/15}{Extra \protect\HTML\ source space after paragraphs.} % \changes{v0.84}{2020/04/14}{Ignore if in \env{lateximage}.} +% \changes{v0.903}{2021/12/17}{Par handling.} % \begin{macrocode} \newcommand*{\LWR@stoppars}% {% @@ -24148,74 +24263,59 @@ end -- not --version % % Ignore if inside a \env{lateximage} or \element{span}: % \begin{macrocode} -\ifboolexpr{ - test {\ifnumcomp{\value{LWR@lateximagedepth}}{>}{0}} or - test {\ifnumcomp{\value{LWR@spandepth}}{>}{0}} -}% -{}% -{% + \ifboolexpr{ + test {\ifnumcomp{\value{LWR@lateximagedepth}}{>}{0}} or + test {\ifnumcomp{\value{LWR@spandepth}}{>}{0}} + }% + {}% nesting + {% not nesting % \end{macrocode} % % See if currently handling \HTML\ paragraphs: % \begin{macrocode} - \ifbool{LWR@doingapar}% + \ifboolexpr{bool{LWR@doingparhooks} and bool{LWR@doingapar}}% % \end{macrocode} % % if currently in an \HTML\ paragraph: % \begin{macrocode} - {% + {% % \end{macrocode} % % Print a closing tag: % \changes{v0.66}{2019/02/02}{Improved \HTML\ formatting.} % \begin{macrocode} - \leavevmode\LWR@orignewline% - \LWR@htmltagc{/\LWR@tagregularparagraph}% - \LWR@orignewline% + \leavevmode\LWR@orignewline% + \LWR@htmltagc{/\LWR@tagregularparagraph}% + \LWR@orignewline% % \end{macrocode} % % No longer have an open \HTML\ paragraph: % \begin{macrocode} - \global\boolfalse{LWR@doingapar}% + \global\boolfalse{LWR@doingapar}% % \end{macrocode} % % Disable the special \env{minipage} \& \cs{hspace} interaction % until a new minipage is found: % \changes{v0.71}{2019/04/08}{Reduced underfull \cs{hbox} warnings.} % \begin{macrocode} - \global\boolfalse{LWR@minipagethispar} - }% + \global\boolfalse{LWR@minipagethispar}% + }% % \end{macrocode} % % If was not in an \HTML\ paragraph: % \begin{macrocode} - {}% -% \end{macrocode} -% -% See if currently allowing \HTML\ paragraphs: -% \begin{macrocode} - \ifbool{LWR@doingstartpars}% -% \end{macrocode} -% -% If so: clear the |par| hook to no longer catch paragraphs: -% \begin{macrocode} - {\ClearPreHook{par}}% -% \end{macrocode} -% -% Else: Do nothing: -% \begin{macrocode} - {}% + {}% % \end{macrocode} % % No longer in paragraph mode: % \begin{macrocode} - \global\setbool{LWR@doingstartpars}{false}% + \global\setbool{LWR@doingstartpars}{false}% % \end{macrocode} % % No \element{p} tag to undo: % \begin{macrocode} - \global\boolfalse{LWR@doingapar}% -}% nestspan + \global\boolfalse{LWR@doingapar}% + }% not nesting } % \end{macrocode} % \end{macro} @@ -24352,8 +24452,8 @@ end -- not --version % % \begin{macrocode} \newcommand*{\CSSFilename}[1]{% -\renewcommand*{\LWR@currentcss}{#1}% -\@onelevel@sanitize\LWR@currentcss% + \renewcommand*{\LWR@currentcss}{#1}% + \@onelevel@sanitize\LWR@currentcss% } \end{warpHTML} @@ -24930,6 +25030,18 @@ end -- not --version % \end{macro} % +% \begin{macro}{\LWR@nullifyfootnotes} +% +% Cancels footnotes, such as inside an \HTML\ comment or a \cs{nameref}. +% \changes{v0.903}{2021/12/28}{Added.} +% \begin{macrocode} +\newcommand*{\LWR@nullifyfootnotes}{% + \renewcommand{\footnote}[2][]{}% + \renewcommand{\footnotemark}[1][]{}% +} +% \end{macrocode} +% \end{macro} + % \begin{macrocode} \end{warpHTML} @@ -24957,9 +25069,10 @@ end -- not --version \renewcommand{\marginpar}[2][]{% \ifbool{FormatWP}% {% -\begin{LWR@BlockClassWP}{width:2in; float:right; margin:10pt}{}(note){marginblock}% -#2 -\end{LWR@BlockClassWP}% + \begin{LWR@BlockClassWP}% + {width:2in; float:right; margin:10pt}{}(note){marginblock}% + #2 + \end{LWR@BlockClassWP}% }% {% \LWR@htmlspanclass(note){marginpar}{#2}% @@ -24982,18 +25095,22 @@ end -- not --version % \changes{v0.896}{2021/03/05}{Added \ARIA\ role.} % \begin{macrocode} \newcommand{\marginparBlock}[2][]{% -\LWR@stoppars% -\ifbool{FormatWP}% -{% - \begin{LWR@BlockClassWP}{width:2in; float:right; margin:10pt}{}(note){marginblock}% - #2 - \end{LWR@BlockClassWP} -}{% - \begin{BlockClass}[width:2in; float:right; margin:10pt](note){marginparblock}% - #2 - \end{BlockClass} -}% -\LWR@startpars% + \LWR@stoppars% + \ifbool{FormatWP}% + {% + \begin{LWR@BlockClassWP}% + {width:2in; float:right; margin:10pt}{}% + (note){marginblock}% + #2 + \end{LWR@BlockClassWP} + }% + {% + \begin{BlockClass}[width:2in; float:right; margin:10pt]% + (note){marginparblock}% + #2 + \end{BlockClass} + }% + \LWR@startpars% } % \end{macrocode} % \end{macro} @@ -25605,30 +25722,33 @@ end -- not --version % \end{macro} -% \begin{macro}{\LWR@HTMLsanitize} \marg{text} +% \begin{macro}{\LWR@HTMLsanitizedetokenized} \marg{detokenized text} % -% Prints the sanitized text. +% Prints the sanitized text, already detokenized. % +% \changes{v0.903}{2021/12/17}{Added.} % \begin{macrocode} -\newrobustcmd{\LWR@HTMLsanitize}[1]{% +\newrobustcmd{\LWR@HTMLsanitizedetokenized}[1]{% + \LWR@traceinfo{LWR@HTMLsanitizedetokenized !#1!}% % \end{macrocode} % Cancel French \pkg{babel} character handling, % and fully expand the strings: % \begin{macrocode} \begingroup% \LWR@hook@processingtags% - \edef\LWR@strresult{\detokenize{#1}}% + \edef\LWR@strresult{#1}% \LWR@subHTMLsanitize% \LWR@strresult% \endgroup% + \LWR@traceinfo{LWR@HTMLsanitize done}% } % \end{macrocode} % \end{macro} -% \begin{macro}{\LWR@HTMLsanitizeexpand} \marg{text} +% \begin{macro}{\LWR@HTMLsanitizeexpanded} \marg{text}% % -% This version expands the argument before sanitizing it. +% This version must be given the detokenized and expanded text. % This is only used for adding math to \MathJax\ expressions or % \env{lateximage} \attribute{alt} tags. % @@ -25636,7 +25756,6 @@ end -- not --version % \changes{v0.51}{2018/03/07}{Fix: Escapes double quotes.} % ^^A \changes{v0.79}{2020/01/27}{Fix: \cs{\&}.} % \changes{v0.89}{2020/08/08}{Fix: Nested \MathJax\ environments.} -% ^^A *88* % \begin{macrocode} \edef\LWR@beginspaceleftbrace{begin \LWRleftbrace} \edef\LWR@beginspaceleftbrace{\detokenize\expandafter{\LWR@beginspaceleftbrace}} @@ -25648,7 +25767,7 @@ end -- not --version \edef\LWR@endrightbrace{end\LWRrightbrace} \edef\LWR@endrightbrace{\detokenize\expandafter{\LWR@endrightbrace}} -\newrobustcmd{\LWR@HTMLsanitizeexpand}[1]{% +\newrobustcmd{\LWR@HTMLsanitizeexpanded}[1]{% % \end{macrocode} % Cancel French \pkg{babel} character handling, % and fully expand the strings: @@ -25656,11 +25775,10 @@ end -- not --version \begingroup% \LWR@hook@processingtags% % \end{macrocode} -% The difference between this and \cs{LWR@HTMLsanitize} (without ``expand'') -% is the following \cs{expandafter}: % \begin{macrocode} - \edef\LWR@strresult{\detokenize\expandafter{#1}}% + \edef\LWR@strresult{#1}% % \end{macrocode} +% % The math expression may includes spaces between tokens, % but \MathJax\ does not want a space between \cs{begin} or \cs{end} % and the following brace. @@ -25734,7 +25852,7 @@ end -- not --version \StrLen{\detokenize{#1}}[\LWR@tempone]% \ifnumgreater{\LWR@tempone}{350}{% \AtEndDocument{% - \PackageWarningNoLine{lwarp}{% + \PackageNoteNoLine{lwarp}{% To ensure faster MathJax compilation, place each\MessageBreak custom macro in its own \protect\CustomizeMathJax.\MessageBreak See the Lwarp documentation regarding customizing\MessageBreak @@ -26714,19 +26832,31 @@ end -- not --version % \changes{v0.52}{2018/03/28}{Fix: Footnote numbering: Limited \HTML\ comment if starred.} % \changes{v0.52}{2018/03/28}{Fix: Footnote numbering: Use short \TOC\ entry % for HTMLDebug comments.} +% \changes{v0.903}{2021/12/28}{Add: Sectioning \HTML\ comment divider.} +% \changes{v0.903}{2021/12/28}{Fix: Nullfiy footnotes in \HTML\ comment.} % \begin{macrocode} -\ifbool{HTMLDebugComments}{% - \begingroup% - \LWR@nullfonts% - \IfBooleanTF{#1}% starred - {\LWR@htmlcomment{Opening #4*}}% +\begingroup% +\LWR@nullfonts% +\LWR@nullifyfootnotes% +\LWR@htmlcomment{................................}% +\LWR@orignewline% +\ifbool{HTMLDebugComments}% {% - \IfNoValueTF{#2}% short TOC - {\LWR@htmlcomment{Opening #4 ``#3''}}% - {\LWR@htmlcomment{Opening #4 ``#2''}}% - }\LWR@orignewline% - \endgroup% -}{} + \IfBooleanTF{#1}% starred + {% + \IfNoValueTF{#2}% short TOC + {\LWR@htmlcomment{Opening #4* ``#3''}}% + {\LWR@htmlcomment{Opening #4* ``#2''}}% + }% + {% + \IfNoValueTF{#2}% short TOC + {\LWR@htmlcomment{Opening #4 ``#3''}}% + {\LWR@htmlcomment{Opening #4 ``#2''}}% + }% + \LWR@orignewline% + }% + {}% +\endgroup% % \end{macrocode} % % For inline sections paragraph and subparagraph, start a new paragraph now: @@ -27286,10 +27416,14 @@ end -- not --version % \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]% +\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: @@ -27574,9 +27708,18 @@ end -- not --version % % Not yet started any paragraph handling: % \begin{macrocode} +\global\booltrue{LWR@doingparhooks} \global\boolfalse{LWR@doingapar} \global\boolfalse{LWR@doingstartpars} % \end{macrocode} +% +% \cs{color@endgroup}'s \cs{endgraf} was conflicting with \pkg{lwarp}'s +% paragraph handling. +% \changes{v0.903}{2021/12/13}{Par handling.} +% \begin{macrocode} +\let\color@endgroup\endgroup +% \end{macrocode} +% % Document and page settings: % \changes{v0.45}{2017/12/08}{Fix: Lateximages on incorrect pages with \brand{Mathjax}.} % \begin{macrocode} @@ -27804,13 +27947,15 @@ end -- not --version % \end{macro} +% \DescribeHook[LaTeX]{enddocument/info} Used to close the \filenm{*-images.txt} file. % \begin{macro}{\enddocument} % If labels have not changed, mark successful completion % of the \filenm{lateximages.txt} file. % Executed as everything is being shut down. % -% For the newer kernel hooks, see \cmds{texdoc lthooks-doc} and \cmds{texdoc ltshipout-doc}. +% For the newer kernel hooks, see \cmds{texdoc lthooks-doc} +% and \cmds{texdoc ltshipout-doc}. % \changes{v0.70}{2019/03/26}{If labels changed, require recompile before making limages.} % \changes{v0.89}{2020/07/28}{Adapt to \LaTeX\ core changes.} % \begin{macrocode} @@ -27876,6 +28021,10 @@ end -- not --version % % See \cmds{texdoc lthooks-doc} and \cmds{textdoc ltshipout-doc}. % +% \DescribeHook[LaTeX]{shipoout/background} Nullified. +% +% \DescribeHook[LaTeX]{shipoout/foreground} Nullified. +% % \changes{v0.89}{2020/07/28}{Foreground/background hooks: Adapt to \LaTeX\ core changes.} % \begin{macrocode} \ifdef{\RemoveFromHook}{ @@ -28078,7 +28227,7 @@ end -- not --version } \AtBeginDocument{ -\@ifpackageloaded{titling}{ +\IfPackageLoadedTF{titling}{ \AtBeginEnvironment{titlingpage}{ \renewrobustcmd{\affiliation}[1]{\\ \textsc{\small#1}} } @@ -28297,7 +28446,7 @@ end -- not --version % % % \begin{macrocode} -\@ifclassloaded{memoir} +\IfClassLoadedTF{memoir} { \newcommand{\LWR@setfootnoteseries}{% \renewcommand\thefootnote{\@arabic\c@footnote}% @@ -28562,7 +28711,7 @@ end -- not --version % % \begin{macrocode} \newcommand*{\AddSubtitlePublished}{% -\@ifpackageloaded{titling}{% yes titling package +\IfPackageLoadedTF{titling}{% yes titling package \newcommand{\@published}{}% \newcommand{\published}[1]{\gdef\@published{##1}}% \renewcommand*{\maketitlehooka}{\printpublished}% @@ -28999,6 +29148,7 @@ end -- not --version % % \changes{v0.20}{2016/12/24}{Added.} % \changes{v0.84}{2020/04/16}{Added print mode.} +% \changes{v0.903}{2022/01/02}{Added \env{verbatim*}.} % % \begin{macrocode} \AfterEndPreamble{ @@ -29018,6 +29168,22 @@ end -- not --version \LWR@afterendverbatim% }% } +% +\AtBeginEnvironment{verbatim*}{% + \ifnumcomp{\value{LWR@lateximagedepth}}{>}{0}% + {}% + {% + \LWR@forcenewpage% + \LWR@atbeginverbatim{verbatim}% + }% +} +\AfterEndEnvironment{verbatim*}{% + \ifnumcomp{\value{LWR@lateximagedepth}}{>}{0}% + {}% + {% + \LWR@afterendverbatim% + }% +} } % \end{macrocode} % \end{environment} @@ -29031,8 +29197,10 @@ end -- not --version % \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.} +% \changes{v0.903}{2021/12/20}{Converted to env.} % \begin{macrocode} -\newcommand*{\LWR@HTML@tabbing}{% +\newenvironment*{LWR@HTML@tabbing} +{% \LWR@forcenewpage% \LWR@atbeginverbatim{tabbing}% \let\enskip\LWR@origenskip% @@ -29044,14 +29212,12 @@ end -- not --version \let\negthinspace\LWR@orignegthinspace% \LWR@print@tabbing% } - -\newcommand*{\LWR@HTML@endtabbing}{% - \LWR@print@endtabbing% +{% + \endLWR@print@tabbing% \LWR@afterendverbatim% } -\LWR@formatted{tabbing} -\LWR@formatted{endtabbing} +\LWR@formattedenv{tabbing} % \end{macrocode} % % \end{environment} @@ -29260,11 +29426,9 @@ end -- not --version \else % \if@inlabel % \indent - \par % \fi \ifhmode % \unskip\unskip - \par \fi \if@newlist \if@nobreak @@ -29361,12 +29525,15 @@ end -- not --version % leave room for the label while inside a list during paragraph construction. % % \changes{v0.44}{2017/11/15}{Added \env{list} and \env{trivlist}.} +% \changes{v0.903}{2021/12/17}{Par handling.} % \begin{macrocode} \newcommand*{\LWR@listitem}{% \LWR@stoppars% \LWR@startnewdepth{listitem}% \LWR@htmltag{li}% + \LWR@orignewline% \LWR@startpars% + \LWR@ensuredoingapar% \LWR@origitem% } % \end{macrocode} @@ -29432,12 +29599,15 @@ end -- not --version % % See \cs{LWR@openparagraph} where extra \cs{hspace} is used to % leave room for the label while inside a list during paragraph construction. +% \changes{v0.903}{2021/12/17}{Par handling.} % \begin{macrocode} \newcommand*{\LWR@itemizeitem}{% \LWR@stoppars% \LWR@startnewdepth{listitem}% \LWR@htmltag{li}% + \LWR@orignewline% \LWR@startpars% + \LWR@ensuredoingapar% \LWR@origitem% } % \end{macrocode} @@ -29654,13 +29824,17 @@ end -- not --version % \end{macrocode} % \end{macro} -% \cs{futurelet} copies the next token then executes a function to analyze it. - -% \cs{LWR@futurenonspacelet} does the same, but ignores intervening white space - -% Based on the \pkg{booktabs} style: % \begin{macro}{\LWR@futurenonspacelet} +% +% \cs{futurelet} copies the next token then executes a function to analyze it. +% +% \cs{LWR@futurenonspacelet} does the same, but ignores intervening spaces +% and paragraphs. +% +% Based on the \pkg{booktabs} style: +% +% \changes{v0.903}{2021/10/13}{Now ignores \cs{par}.} % \begin{macrocode} \def\LWR@futurenonspacelet#1{\def\LWR@cs{#1}% \afterassignment\LWR@fnslone\let\nexttoken= } @@ -29668,19 +29842,30 @@ end -- not --version \def\LWR@fnslone{\expandafter\futurelet\LWR@cs\LWR@fnsltwo} \def\LWR@fnsltwo{% -\expandafter\ifx\LWR@cs\@sptoken\let\next=\LWR@fnslthree% -\else\let\next=\nexttoken\fi\next} + \expandafter\ifx\LWR@cs\@sptoken% + \let\next=\LWR@fnslthree% + \else% + \expandafter\ifx\LWR@cs\par% + \let\next=\LWR@fnslthree% + \else% + \let\next=\nexttoken% + \fi% + \fi\next} \def\LWR@fnslthree{\afterassignment\LWR@fnslone\let\next= } % \end{macrocode} % \end{macro} + % \begin{macro}{\LWR@getmynexttoken} % Looks ahead and copies the next token into \cs{LWR@mynexttoken}. % \begin{macrocode} \newcommand*{\LWR@getmynexttoken}{% \LWR@traceinfo{LWR@getmynexttoken}% -% nothing must follow this next line +% \end{macrocode} +% +% Nothing must follow this next line:\watchout +% \begin{macrocode} \LWR@futurenonspacelet\LWR@mynexttoken\LWR@tabledatacolumntag } % \end{macrocode} @@ -31776,11 +31961,10 @@ end -- not --version % left to right columns. % % \begin{macrocode} -\NewDocumentCommand{\LWR@docdashline} - {>{\SplitArgument{1}{-}}m}% - {% - \LWR@subcdashline#1% - } +\NewDocumentCommand{\LWR@docdashline}{>{\SplitArgument{1}{-}}m}% +{% + \LWR@subcdashline#1% +} % \end{macrocode} % \end{macro} @@ -31831,7 +32015,7 @@ end -- not --version % \begin{macrocode} \newcommand*{\LWR@subaddcmidruletrim}[2]{% \setlength{\LWR@templengthone}{% - \LWR@getexparray{LWR@midrules}{\arabic{LWR@tableLaTeXcolindex}}% + \LWR@getexparray{LWR@midrules}{\arabic{LWR@tableLaTeXcolindex}}% }% \ifdimcomp{\LWR@templengthone}{>}{0pt}% {% @@ -32995,13 +33179,13 @@ end -- not --version {% \@xmultirow defined, so some version of multirow was loaded % \end{macrocode} % -% |\@ifpackageloaded{multirow}| determines if v2.0 or later of +% |\IfPackageLoadedTF{multirow}| determines if v2.0 or later of % \pkg{multirow} was used, which included the \cs{ProvidesPackage} macro. % % The print version: % \begin{macrocode} -\@ifpackageloaded{multirow}{% v2.0 or newer -\@ifpackagelater{multirow}{2016/09/01}% 2016/09/27 for v2.0 +\IfPackageLoadedTF{multirow}{% v2.0 or newer +\IfPackageAtLeastTF{multirow}{2016/09/01}% 2016/09/27 for v2.0 {% v2.0+: \DeclareExpandableDocumentCommand{\LWR@print@multicolumnrow}% {+m +m +O{c} +m +O{0} +m +O{0pt} +m}% @@ -33015,7 +33199,7 @@ end -- not --version }% packageloaded{multirow} % \end{macrocode} % -% If not |\@ifpackageloaded{multirow}| but \cs{@xmultirow} is defined, +% If not |\IfPackageLoadedTF{multirow}| but \cs{@xmultirow} is defined, % then this must be v1.6 or earlier, which did not |\ProvidesPackage{multirow}|, % and did not have the \optn{vposn} option. % @@ -33166,23 +33350,28 @@ end -- not --version {% \LWR@traceinfo{LWR@tabledatacolumntag}% % \end{macrocode} +% % \hspace*{.5in} |\show\LWR@mynexttoken| to see what tokens to look for % \begin{macrocode} % \end{macrocode} +% % If not any of the below, start a new table cell: % \begin{macrocode} \global\let\LWR@mynextaction\LWR@tabledatasinglecolumntag% % \end{macrocode} +% % If exiting the tabular: % \begin{macrocode} \ifdefequal{\LWR@mynexttoken}{\end}% {\booltrue{LWR@exitingtabular}}{}% % \end{macrocode} +% % \env{longtable} can have a caption in a cell % \begin{macrocode} \ifdefequal{\LWR@mynexttoken}{\caption}% {\global\let\LWR@mynextaction\LWR@donothing}{}% % \end{macrocode} +% % Look for other things which would not start a table cell: % \begin{macrocode} \ifdefequal{\LWR@mynexttoken}{\multicolumn}% @@ -33194,11 +33383,13 @@ end -- not --version \ifdefequal{\LWR@mynexttoken}{\noalign}% {\global\let\LWR@mynextaction\LWR@donothing}{}% % \end{macrocode} +% % If an \cs{mrowcell}, this is a cell to be skipped over: % \begin{macrocode} \ifdefequal{\LWR@mynexttoken}{\mrowcell}% {\global\let\LWR@mynextaction\LWR@donothing}{}% % \end{macrocode} +% % If an \cs{mcolrowcell}, this is a cell to be skipped over: % \begin{macrocode} \ifdefequal{\LWR@mynexttoken}{\mcolrowcell}% @@ -33298,11 +33489,14 @@ end -- not --version \ifdefequal{\LWR@mynexttoken}{\lasthdashline}% {\global\let\LWR@mynextaction\LWR@donothing}{}% % \end{macrocode} +% % Ignore an empty line between rows: % \changes{v0.45}{2017/12/06}{Fix: Empty line between rows.} % \begin{macrocode} \ifdefequal{\LWR@mynexttoken}{\par}% - {\global\let\LWR@mynextaction\LWR@donothing}{}% + {% + \global\let\LWR@mynextaction\LWR@donothing% + }{}% % \end{macrocode} % % No action for an \cs{end} token. @@ -33312,9 +33506,8 @@ end -- not --version % % Start the new table cell if was not any of the above: % \begin{macrocode} - \LWR@traceinfo{LWR@tabledatacolumntag: about to do mynext}% + \LWR@traceinfo{LWR@tabledatacolumntag: done, about to do LWR@mynextaction}% \LWR@mynextaction% - \LWR@traceinfo{LWR@tabledatacolumntag: done}% } % \end{macrocode} % \end{macro} @@ -33423,7 +33616,7 @@ end -- not --version % \begin{macrocode} \AtBeginDocument{ -\@ifpackageloaded{lwarp-tabls} +\IfPackageLoadedTF{lwarp-tabls} { \newcommand*{\LWR@HTMLhline}[1][]{% \ifbool{FormatWP}% @@ -33563,16 +33756,28 @@ end -- not --version \boolfalse{LWR@foundmrowcell}% % \end{macrocode} % -% +% In case of nesting: % \begin{macrocode} \renewcommand*{\LWR@multicoltext}{}% + \booltrue{LWR@intabularmetadata}% +% \end{macrocode} +% +% New \PDF\ page, unless in a \cs{multirow}: +% \changes{v0.903}{2021/12/17}{Par handling.} +% \begin{macrocode} + \ifbool{LWR@in@multirow@par}% + {\leavevmode\LWR@orignewline}% + {\LWR@forcenewpage}% +% \end{macrocode} +% +% In case of nesting, locally no longer in a \cs{multirow}: +% \changes{v0.903}{2021/12/17}{Par handling.} +% \begin{macrocode} + \boolfalse{LWR@in@multirow@par}% % \end{macrocode} % % Create the |table| tag: % \begin{macrocode} - \booltrue{LWR@intabularmetadata}% - \LWR@traceinfo{LWR@@tabular: About to LWR@forecenewpage.}% - \LWR@forcenewpage \LWR@htmlblocktag{table}% % \end{macrocode} % Parse the table columns: @@ -34018,12 +34223,11 @@ end -- not --version % \begin{macro}{\LWR@nameref} \marg{label} % Returns the section name for this label: % \changes{v0.66}{2019/01/27}{No longer use \pkg{zref}.} -% \changes{v0.902}{2021/09/24}{Disable footnotes in \cs{nameref}.} +% \changes{v0.902}{2021/09/24}{Nullify footnotes in \cs{nameref}.} % \begin{macrocode} \newcommand*{\LWR@nameref}[1]{% \begingroup% - \renewcommand{\footnote}[2][]{}% - \renewcommand{\footnotemark}[1][]{}% + \LWR@nullifyfootnotes% \expandafter\LWR@setref\csname r@#1@lwarp\endcsname\LWR@firstoffive{#1}% \endgroup% } @@ -34369,7 +34573,8 @@ end -- not --version % \end{macrocode} % \end{macro} -% \begin{macro}{\ref} * \marg{label} \quad +% \begin{macro}{\ref} * \marg{label} +% % \cs{ref} is redefined to \cs{LWR@HTML@ref}, % except inside the text part of a \cs{hyperref}, % where it is redefined to \cs{LWR@ref@ignorestar}. @@ -34400,16 +34605,76 @@ end -- not --version % \end{macrocode} % % -% \begin{macro}{\LWR@refwithsection} +% \begin{macro}{\LWR@refwithsection} * \marg{label} +% +% Creates a reference, using the section number as the text. +% Used for back references. +% % \changes{v0.896}{2021/04/21}{Added.} +% \changes{v0.903}{2021/12/13}{Fixed: Ref undefined or w/o label.} % \begin{macrocode} \NewDocumentCommand{\LWR@refwithsection}{s m}{% \LWR@traceinfo{LWR@refwithsection !#2!}% +% \end{macrocode} +% +% If starred, just use the text without a hyperlink: +% \begin{macrocode} \IfBooleanTF{#1}% {\LWR@print@ref{\BaseJobname-autopage-\LWR@currentautosecpageref{#2}}}% {% +% \end{macrocode} +% +% Open the reference: +% \begin{macrocode} \LWR@startref{#2}% - \LWR@print@ref{\BaseJobname-autopage-\LWR@currentautosecpageref{#2}}% +% \end{macrocode} +% +% Add the text of the link. +% +% Check for and handle an undefined reference: +% \begin{macrocode} + \edef\@tempa{\LWR@currentautosecpageref{#2}}% + \ifdefstring{\@tempa}{??}% + {??}% +% \end{macrocode} +% +% For a defined reference: +% \begin{macrocode} + {% +% \end{macrocode} +% +% Set \cs{@tempa} to \cs{r@