From 43f910cd38a469d36aef7baf4403e9513728b939 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 9 Nov 2017 01:32:04 +0000 Subject: lwarp (9nov17) git-svn-id: svn://tug.org/texlive/trunk@45722 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/lwarp/README.txt | 2 +- Master/texmf-dist/doc/latex/lwarp/lwarp.pdf | Bin 1583065 -> 1605184 bytes Master/texmf-dist/scripts/lwarp/lwarpmk.lua | 2 +- Master/texmf-dist/source/latex/lwarp/lwarp.dtx | 1691 +++++++++++++------- Master/texmf-dist/source/latex/lwarp/lwarp.ins | 3 + .../texmf-dist/tex/latex/lwarp/lwarp-breakurl.sty | 36 + .../texmf-dist/tex/latex/lwarp/lwarp-hyperref.sty | 18 +- .../tex/latex/lwarp/lwarp-luatodonotes.sty | 26 + .../texmf-dist/tex/latex/lwarp/lwarp-multirow.sty | 17 +- .../texmf-dist/tex/latex/lwarp/lwarp-todonotes.sty | 25 + Master/texmf-dist/tex/latex/lwarp/lwarp.sty | 371 +++-- 11 files changed, 1411 insertions(+), 780 deletions(-) create mode 100644 Master/texmf-dist/tex/latex/lwarp/lwarp-breakurl.sty create mode 100644 Master/texmf-dist/tex/latex/lwarp/lwarp-luatodonotes.sty create mode 100644 Master/texmf-dist/tex/latex/lwarp/lwarp-todonotes.sty (limited to 'Master') diff --git a/Master/texmf-dist/doc/latex/lwarp/README.txt b/Master/texmf-dist/doc/latex/lwarp/README.txt index c740bf01bfa..f7e3c7f2bf3 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.42 README.txt +LaTeX lwarp package v0.43 README.txt Files included are: diff --git a/Master/texmf-dist/doc/latex/lwarp/lwarp.pdf b/Master/texmf-dist/doc/latex/lwarp/lwarp.pdf index f01233eab15..c408ff9b98b 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 7d0dbb62ac5..c813ebfe66a 100755 --- a/Master/texmf-dist/scripts/lwarp/lwarpmk.lua +++ b/Master/texmf-dist/scripts/lwarp/lwarpmk.lua @@ -4,7 +4,7 @@ -- Print the usage of the lwarpmk command: -printversion = "v0.42" +printversion = "v0.43" function printhelp () print ("lwarpmk: Use lwarpmk -h or lwarpmk --help for help.") ; diff --git a/Master/texmf-dist/source/latex/lwarp/lwarp.dtx b/Master/texmf-dist/source/latex/lwarp/lwarp.dtx index 26c9ba2770f..d95b653aa2e 100644 --- a/Master/texmf-dist/source/latex/lwarp/lwarp.dtx +++ b/Master/texmf-dist/source/latex/lwarp/lwarp.dtx @@ -16,7 +16,7 @@ % \iffalse %\NeedsTeXFormat{LaTeX2e}[1999/12/01] %\ProvidesPackage{lwarp} -% [2017/10/30 v0.42 Allows LaTeX to directly produce HTML5 output.] +% [2017/11/08 v0.43 Allows LaTeX to directly produce HTML5 output.] % %<*driver> \documentclass{ltxdoc} @@ -266,6 +266,8 @@ Keywords={LaTeX, HTML, conversion}% \newrobustcmd{\CTAN}{\acro{CTAN}} \newrobustcmd{\TDS}{\acro{TDS}} +\newcommand{\DescribeDefault}[1]{\margintag{\footnotesize \textcolor{green!50!black}{Default: \texttt{#1}}}} + \newcommand{\goesto}{$\Rightarrow$} \newcommand{\credits}[1]{{\footnotesize(\textit{Based on original code by} \textsc{#1}.)}} @@ -642,7 +644,14 @@ may limit how small the output will be displayed. } \newcommand{\limitsreferences}{% +Labels with special characters may be a problem. +\margintag{labels} +It is best to stick with alpha-numeric, hyphen, and perhaps the colon (if not French). +The underscore currently does not yet work when generating math for MathJax. +\watchout[underscores] + \cs{nameref} refers to the most recently-used section where the \cs{label} +\margintag{\cs{nameref}} was defined. If no section has been defined before the \cs{label}, \watchout[empty link] @@ -1615,6 +1624,18 @@ changes do not affect the \HTML\ output. \end{docsidebar} } +\newcommand{\limitstodonotes}{% +\pkg{todonotes} and \pkg{luatodonotes} are only emulated as if they were loaded +with the \texttt{disable} option. +All functions are disabled, but source compatibility is provided +with the print version. + +\pkg{todonotes} and \pkg{luatodonotes} use \pkg{xkeyval}, so if the user's +\watchout[\pkg{xkeyvalue}] +document uses \cs{presetkeys} then \pkg{xkeyval} will have +to be loaded explictly by the user's document. +} + \newcommand{\limitsnewtxmath}{% The proper load order is: \watchout[loading sequence] @@ -1672,7 +1693,7 @@ This boolean may be tested by the user for later use. %<*package> % \fi % -% \CheckSum{14824} +% \CheckSum{14970} % % \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 @@ -1756,6 +1777,7 @@ This boolean may be tested by the user for later use. % \changes{v0.40}{2017/09/25}{\ 2017/09/25} % \changes{v0.41}{2017/10/07}{\ 2017/10/07} % \changes{v0.42}{2017/10/30}{\ 2017/10/30} +% \changes{v0.43}{2017/11/08}{\ 2017/11/08} @@ -1940,8 +1962,35 @@ This boolean may be tested by the user for later use. % For a detailed list of changes, see the Change History on page \pageref{sec:changehistory}. % % \begin{description} +% \item[v0.43:] \ +% \begin{itemize} +% \item Docs: Reorganized \HTML\ customization, added an \HTML\ settings table. +% See \cref{sec:htmlsettings}. +% \item Added |FootnoteDepth| to control the placement +% \margintag{footnotes} +% of pending footnotes before section breaks. +% By default, pending footnotes are printed before +% each \cs{subparagraph} or higher. +% \item Fix: Expansion in section name. \margintag{sectioning} +% \item Fix: Ignore spaces in tabular column specification. +% \margintag{\env{tabular}} +% \item Fix: Tabular rules at bottom or when finishing incomplete rows. +% \item Fix: \cs{multicolumn} at/bang/before/after specifications, trim, +% and vertical rules. +% \item Fix: \pkg{supertabular} and \pkg{xtab} column misalignment. +% \item Fix: \env{equation*}. +% \margintag{math} +% \item Fix: \SVG\ math in a section name. +% \item Fix: \cs{ref} and \cs{eqref} in \SVG\ math. +% \item Added \pkg{todonotes} and \pkg{luatodonotes} (but only |disabled|). +% \margintag{packages} +% \item Added \pkg{breakurl}. +% \item \pkg{hyperref}: Fix: Several macros were made robust, \cs{Gauge} added. +% \end{itemize} +% \needspace{2\baselineskip} % \item[v0.42:] \ % \begin{itemize} +% \item Added \TeX\ development support page.\margintag{Support \TeX!} % \item Improved assitance for word-processor conversions when % \margintag{word-processor conversion} % boolean |FormatWP| is set |true|. @@ -2625,7 +2674,7 @@ This boolean may be tested by the user for later use. % \midrule % % Cross-references: & Emulated, with hyperlinks. -% \pkg{hyperref}, \pkg{cleveref}, \pkg{varioref}, \pkg{url}. \\ +% \pkg{hyperref}, \pkg{cleveref}, \pkg{varioref}, \pkg{url}, \pkg{breakurl}. \\ % % Languages: & \pkg{babel}. (\pkg{polyglossia} is untested.) \\ % @@ -2633,7 +2682,8 @@ This boolean may be tested by the user for later use. % % Margin notes: & \pkg{marginfit}, \pkg{marginfix}. \\ % -% Footnotes: & \pkg{footnote}, \pkg{footmisc}, +% Footnotes: & Adds \cmds{FootnoteDepth} to print footnotes at section breaks. +% \pkg{footnote}, \pkg{footmisc}, % \pkg{marginnote}, \pkg{sidenote}, \pkg{pagenote}, \pkg{endnotes}. \\ % % \midrule @@ -3660,333 +3710,32 @@ This boolean may be tested by the user for later use. % \clearpage % \subsection{Changing the CSS style} % -% \DescribeMacro{\CSSFilename} -% \cs{CSSFilename} may be used to choose which |.css| file is used to display -% each section of the web page. Use \cs{CSSFilename} before |\begin{document}| -% to assign the style of the home page. -% If different parts of the website should have different styles, -% call \cs{CSSFilename} again before each section heading which creates a new file. -% -% The styles provided by \pkg{lwarp} include: -% \begin{description} -% \item[|lwarp.css|:] A default style if \cs{CSSFilename} is not used. This -% style is comparable to a plain \LaTeX\ document. -% To set this style, you may use |\CSSFilename{lwarp.css}|, or no \cs{CSSFilename} call at all. -% \item[|lwarp\_formal.css|:] A formal style with a serif fonts and a traditional -% look. -% \item[|lwarp\_sagebrush.css|:] A style with muted colors, gradient backgrounds, -% additional borders, and rounded corners. -% \end{description} -% -% To see each style in use, change the \cs{CSSFilename} entry in the tutorial, -% |lwarpmk html| again, and then reload the webpage. -% -% A customized style may also be created. -% \margintag{Custom \CSS} -% For each new project a file -% called |sample_project.css| is generated. This may be renamed to -% |.css| then used by assigning |\CSSFilename{.css}|. -% -% Note that |sample_project.css| is overwritten whenever \pkg{lwarp} -% is loaded in print mode. -% It is therefore important to rename the file \watchout[Rename it!] -% to something like |.css| before -% using it, so that your own changes are not overwritten. +% For a formal \CSS\ style, add to the preamble: +% \begin{sourcedisplay} +% \cs{usepackage}\{lwarp\} \\ +% \dots \\ +% \textcolor{red}{\cs{CSSFilename}\{lwarp\_formal.css\}} \\ +% \dots \\ +% \cs{begin}\{document\} \\ +% \end{sourcedisplay} % -% |.css| has an entry which loads |lwarp.css|, and this -% entry may be changed to load |lwarp_formal.css| or |lwarp_sagebrush.css| if -% desired. Additional changes to the \CSS\ may be made by making entries -% later in the |.css| file. +% For a modern \CSS\ style, |lwarp_sagebrush.css| is also provided: +% \begin{sourcedisplay} +% \cs{CSSFilename}\{lwarp\_sagebrush.css\} +% \end{sourcedisplay} % +% See \cref{sec:csscustomization} for more information about modifying the CSS styling +% of the document. % % -% \clearpage % % \subsection{Customizing the HTML output} -% \label{sec:htmlsettings} -% \index{settings>HTML conversion} -% \index{HTML>conversion settings} -% -% Several settings may be used to customize the \HTML\ output. -% Watch for the correct placement of each!\watchout[Placement!] -% -% Note that if changes are made, -% \watchout[Changes!] -% it is best to first: -% \begin{enumerate} -% \item Clear all the \HTML, \PDF, and auxiliary files: \userentry{lwarpmk clearall} -% \item Recompile the print version in order to recreate -% the configuration files for |lwarpmk|: \userentry{lwarpmk print} -% \item Finally, recompile the \HTML\ version with the new settings: \userentry{lwarpmk html} -% \end{enumerate} -% -% \begin{description}[style=unboxed] -% -% \item[Options for the \pkg{lwarp} package:] \ \newline -% Use the following as options for |\usepackage[]{lwarp}|: -% -% \begin{description} -% -% \ItemDescribeOption{HomeHTMLFilename} Filename of the homepage, without -% the ``|.html|'' suffix. -% Defaults to the \cs{BaseJobname}. A common setting is: -% \begin{sourcedisplay} -% |HomeHTMLFilename=index| -% \end{sourcedisplay} -% causing the -% homepage to be the file |index.html|. Underscores are allowed in -% \margintag{filename underscores} -% |HomeHTMLFilename| and |HTMLFilename| options, but may need to be escaped -% elsewhere, such as when appearing in a list: -% \index{underscore>filename}\index{file>underscore} -% \changes{v0.24}{2017/03/13}{Docs: Filename underscore.} -% \begin{sourcedisplay} -% \cs{item} [\cs{href}\{file\textcolor{red}{\textbackslash\_}name.pdf\}\{text\}] \textbackslash -% \end{sourcedisplay} % -% \ItemDescribeOption{HTMLFilename} A filename prefix for the rest of the \HTML\ web pages. -% Useful for numbered web pages with a common prefix. May be empty. +% A number of settings may be made to control the \HTML\ output, including +% filename generation, automatic compilation, math output, document splitting, +% meta data, and page headers and footers. % -% \ItemDescribeOption{latexmk} Controls whether -% \pkg{lwarp} uses |latexmk| to -% compile the document. This setting is written to |lwarpmk|'s configuration -% files. Defaults to false. -% -% \ItemDescribeOption{mathsvg} Selects \SVG\ display for math output. (The default.) -% -% \ItemDescribeOption{mathjax} Selects MathJax for math output. -% -% \end{description} -% -% \item[Placed in the preamble before \texttt{\cs{begin}\{document\}}:] \ -% -% \begin{description} -% -% \ItemDescribeCounter{tocdepth} Sectioning depth of the table of contents. -% See \cref{sec:stackdepths} for a list of \LaTeX{} stack depths. -% -% \ItemDescribeCounter{SideTOCDepth} Sectioning depth of the side\TOC. -% Defaults to 1, causing the side\TOC\ to show sections but not subsections. -% -% Each subpage of the website has its own small table of contents -% \margintag{side\TOC} -% on the side (the ``side\TOC''). Its depth is set by |SideTOCDepth|. -% This side\TOC\ is only shown if the web page is wide enough. -% When using a narrow web browser window, -% ``responsive web design'' is used to show the side\TOC\ at the top of the -% page and a link back to ``Home'' at the bottom. -% -% \label{sec:filedepth} -% It is recommended to set: -% \begin{sourcedisplay} -% |SideTOCDepth|\,=\,|FileDepth| -% \end{sourcedisplay} -% or -% \begin{sourcedisplay} -% |SideTOCDepth|\,=\,|FileDepth|+1 -% \end{sourcedisplay} -% -% If |SideTOCDepth|\,<\,|FileDepth|, web pages will be inaccessible via the -% side\TOC. \watchout -% \index{file>inaccessible} -% \index{page>inacessible} -% \index{missing sections} -% \index{section>missing} -% -% \ItemDescribeCounter{FileDepth} Sectioning depth of file splits. -% Defaults to -5, causing the entire \HTML\ website to be one single file. -% \begin{itemize} -% \item To place the entire file into one \HTML\ page, use: -% \begin{sourcedisplay} -% \cs{setcounter}\{FileDepth\}\{-5\} -% \end{sourcedisplay} -% \item To split the \HTML\ file at \cs{section} depth, use: -% \begin{sourcedisplay} -% \cs{setcounter}\{FileDepth\}\{1\} -% \end{sourcedisplay} -% \item To ensure that the \HTML\ pages/files are accessible: -% \watchout\\ -% Place a \cs{tableofcontents} somewhere before the first section -% break (therefore in the ``home page''), and set -% \begin{sourcedisplay} -% tocdepth\,>=\,FileDepth -% \end{sourcedisplay} -% \index{file>inaccessible} -% \index{page>inacessible} -% \index{missing sections} -% \index{section>missing} -% \end{itemize} -% -% \ItemDescribeBoolean{CombineHigherDepths} Combine a higher section with -% its first lower subsections, down to the |FileDepth|. -% Defaults to true. Set to false to simulate the concept of a chapter -% opening on its own page, for example. -% -% The file splits are controlled by the counter |FileDepth| and -% the boolean |CombineHigherDepths|. -% Setting |FileDepth| to 0 splits the file -% at chapters, 1 at sections, etc. |CombineHigherDepths| controls whether -% to combine pages at levels higher than the chosen |FileDepth|, such as -% in this tutorial where the page which opens the chapter also contains the -% first section. -% Be careful to set |tocdepth| and |SideTOCDepth| to allow -% \watchout[Inaccesible pages!] -% access to each page of the website. Set |tocdepth| and |SideTOCDepth| to be -% greater than or equal to |FileDepth|. -% -% When making changes to the file structure, -% \watchout[Lost in an old page!] -% it is possible to end up -% with the web browser pointing to an old file which is no longer in use. -% When this occurs, changes to the web site will not appear in the browser, -% even if reloading the page, because that page is no longer in use. -% It is best to return to the home page, clean the files (|lwarpmk cleanall|), -% change |FileDepth| and/or |CombineHigherDepths|, then finally recompile and -% renavigate to the desired page using the new file structure. -% -% \ItemDescribeBoolean{FileSectionNames} If true, web page filenames are -% derived from a sanitized version of the section names. If false, web pages -% are numbered. Either way, the |HTMLFilename| option is used as a prefix. -% -% Example \HTML\ filenames: -% \changes{v0.20}{2016/09/11}{Docs: Examples for generating \HTML\ file names.} -% \label{sec:filenameexamples} -% \margintag{HTML filenames} -% \index{HTML>filename generation} -% \begin{description} -% \item[Numbered \HTML\ nodes:] \ -% -% Example: Homepage |index.html|, and |node-1|, |node-2|. -% \footnote{See \cs{SetHTMLFileNumber} to number grouped by chapter, for example.} -% \begin{Verbatim}[gobble=2,frame=lines,obeytabs,tabsize=4] -% \usepackage[ -% HomeHTMLFilename=index, -% HTMLFilename={node-} -% ]{lwarp} -% \boolfalse{FileSectionNames} -% \end{Verbatim} -% -% \item[Named \HTML\ sections, no prefix:] \ -% -% Example: |index.html|, and |About.html|, |Products.html| -% \begin{Verbatim}[gobble=2,frame=lines,obeytabs,tabsize=4] -% \usepackage[ -% HomeHTMLFilename=index, -% HTMLFilename={} -% ]{lwarp} -% \booltrue{FileSectionNames} -% \end{Verbatim} -% -% \item[Named \HTML\ sections, with prefix:] \ -% -% Example: Homepage |mywebsite.html|, and additional pages such -% as |mywebsite-About.html|, etc. -% \begin{Verbatim}[gobble=2,frame=lines,obeytabs,tabsize=4] -% \usepackage[ -% HomeHTMLFilename=mywebsite, -% HTMLFilename={mywebsite-} -% ]{lwarp} -% \booltrue{FileSectionNames} -% \end{Verbatim} -% \end{description} -% -% \ItemDescribeMacro{\abstractname} The name of the abstract. -% This may also be over-written -% by the \pkg{babel} package. Defaults to ``Abstract''. -% -% \end{description} -% -% -% \item[Placed before \texttt{\cs{begin}\{document\}}, -% or before any sectioning command which causes a file break:] \ -% -% \begin{description} -% \ItemDescribeMacro{\CSSFilename} \marg{filename.css} \quad -% Sets the \CSS\ file to use for the following -% files. May be changed before each each sectioning command which would -% cause a file split. -% -% The \CSS\ styles of the web pages are set by the \cs{CSSFilename} command. -% If \cs{CSSFilename} is not used, a default plain style is used to mimic printed -% \LaTeX\ output. |lwarp_sagebrush.css| is a semi-fancy colored style as shown -% in this tutorial. Change it to |lwarp_formal.css| for a more formal look, -% or comment out the \cs{CSSFilename} command to see the default. -% \cs{CSSFilename} may be used before each file break to set the \CSS\ for -% individual pagess of the website. -% -% \ItemDescribeMacro{\HTMLLanguage} The \HTML\ file's |html lang| tag. -% Defaults to |en-US|. -% -% \ItemDescribeMacro{\HTMLAuthor} The \HTML\ header's meta author. -% Defaults to \cs{theauthor}. -% -% \ItemDescribeMacro{\HTMLDescription} \marg{description} \quad -% Sets the \HTML\ \attribute{description} tag for -% the following files. May be changed before each each sectioning command which would -% cause a file split. -% -% \ItemDescribeMacro{\HTMLFirstPageTop} \marg{contents} \quad -% A user-definable custom action applied -% to the top of the home page. Useful for logos, etc. -% Defaults empty. -% Ignored in print output. -% -% \ItemDescribeMacro{\HTMLPageTop} \marg{contents} \quad -% A user-definable custom action applied to -% the top of pages other than the home page. Useful for logos, etc. -% Defaults empty. -% |\LinkHome| may be used to place a link back to the homepage. -% Ignored in print output. -% -% \ItemDescribeMacro{\HTMLPageBottom} \marg{contents} \quad -% A user-definable custom action applied to the -% bottom of each web page. -% Useful for authors, copyright notices, contact information, etc. -% Defaults empty. -% |\LinkHome| may be used to place a link back to the homepage. -% Ignored in print output. -% -% \end{description} -% -% -% \needspace{2\baselineskip} -% \item[Placed in the home page before the first sectioning command which causes a file break:] \ -% -% \begin{description} -% \ItemDescribeMacro{\tableofcontents} -% Used to place a table of contents on the home page. -% This command must be used before the first file split, -% \watchout[TOC on the homepage!] -% so that a way is available to navigate to other files from the homepage. -% -% Links to each chapter/section are provided, as selected by |tocdepth|. -% \end{description} -% -% -% \needspace{2\baselineskip} -% \item[Placed in the document wherever necessary:] \ -% -% \begin{description} -% \ItemDescribeEnv{warpprint} An environment which is only used -% while generating print output. Place here anything which does not -% apply to \HTML\ and which may cause problems with \pkg{lwarp}. -% If \pkg{lwarp} knows about and emulates or supports -% a package then its related macros, lengths, counters, etc. probably won't have -% to be placed inside a \env{warpprint} environment, but unknown packages -% may cause problems which may be isolated from \pkg{lwarp} using this environment. -% -% \ItemDescribeEnv{warpHTML} An environment which is only used -% while generating \HTML\ output. This is useful for website logos and -% other items which have no purpose in printed output. -% -% \ItemDescribeMacro{\warpprintonly} \marg{contents} \quad -% A macro version of the \env{warpprint} environment. -% -% \ItemDescribeMacro{\warpHTMLonly} \marg{contents} \quad -% A macro version of the \env{warpHTML} environment. -% \end{description} -% -% \end{description} +% See \cref{sec:htmlsettings} for more information. % % % \clearpage @@ -4265,12 +4014,35 @@ This boolean may be tested by the user for later use. % See \cref{sec:modifylwarpmk}. % % -% +% \clearpage % % \subsection{\protect\pkg{lwarp} package loading and options} % \label{sec:loading} % \index{settings>lwarp package options} % +% \begin{table} +% \caption{Package options\label{tab:options}} +% \centering +% \begin{tabular}{>{\ttfamily}lp{3.25in}} +% Option & Description \\ \midrule +% warpprint & Generate print output, and also generate configuration files. \\ +% warpHTML & Generate \HTML\ output. \\ +% mathsvg & Show math using \SVG\ images. \\ +% mathjax & Show math using MathJax. \\ +% OSWindows & Force compatibility with MS-Windows. \\ +% BaseJobname & The \cs{jobname} to use. +% Set to the \cs{jobname} of the printed version even while generating \HTML. \\ +% HomeHTMLFilename & The filename of the home page. \\ +% HTMLFilename & A prefix for the filenames of the remaining web pages. \\ +% IndexLanguage & The |xindy| language option used for index and glossary generation. \\ +% latexmk & Boolean for |lwarpmk| to use |latexmk| for compiling documents. \\ +% lwarpmk & Generate a local copy of |lwarpmk.lua|. \\ +% xdyFilename & Set a custom filename for |xindy|. \\ +% \bottomrule +% \end{tabular} +% \end{table} +% +% % \pkg{lwarp} supports |book|, |report|, and |article| classes. % % Load the \pkg{lwarp} package immediately after the font and UTF-8 setup commands. @@ -4281,6 +4053,7 @@ This boolean may be tested by the user for later use. % % \DescribeOption{warpprint} % \DescribeOption{warpHTML} +% Usually controlled by |lwarpmk|, and not set in the document. % Select the |warpprint| option to generate print output (default), % or the |warpHTML| option to generate \HTMLfive{} output. % The default is print output, so the print version may be @@ -4296,32 +4069,438 @@ This boolean may be tested by the user for later use. % For math display, select |mathsvg| (default), or |mathjax|. % For more information about the math options, see \cref{sec:limitsmath}. % -% See \cref{tab:options} for the full list of options. +% \DescribeOption{OSWindows} See \cref{sec:OSportabilityusage} if using Windows. +% +% \DescribeOption{BaseJobname} Not intended for the user. +% Used internally by \pkg{lwarp} when +% creating the |*_html.tex| file used to compile the \HTML\ version. +% See \cref{sec:handlingpackageoptions}. +% +% \DescribeOption{HomeHTMLFilename} See \cref{sec:htmlsettings}. +% +% \DescribeOption{HTMLFilename} See \cref{sec:htmlsettings}. % +% \DescribeOption{IndexLanguage} If using an index or glossary, +% see \cref{sec:handlingpackageoptions}. +% +% \DescribeOption{latexmk} Has |lwarpmk| use |latexmk| to recompile the +% document several times if necessary. +% Otherwise, |lwarpmk| attempts to determing for itself whether to recompile. +% See \cref{sec:htmlsettings}. +% +% \DescribeOption{lwarpmk} If you wish to have \pkg{lwarp} generate a local +% copy of |lwarpmk.lua| for archival or local-installation purposes, +% compile the print version with the |lwarpmk| option set. +% See \cref{sec:handlingpackageoptions}. +% +% \DescribeOption{xdyFilename} The default |xindy| filename is |lwarp.xdy|. +% If you wish to use a custom |.xdy| file for +% index generation, see \cref{sec:handlingpackageoptions}. +% +% +% +% \clearpage +% +% \subsection{Customizing the HTML output} +% \label{sec:htmlsettings} +% \index{settings>HTML conversion} +% \index{HTML>conversion settings} % +% \changes{v0.43}{2017/11/04}{Docs: HTML settings table.} +% \changes{v0.43}{2017/11/06}{Docs: Reorganized HTML customization.} % \begin{table} -% \caption{Package options\label{tab:options}} -% \centering -% \begin{tabular}{>{\ttfamily}lp{3.25in}} -% Option & Description \\ \hline -% warpprint & Generate print output, and also generate configuration files. \\ -% warpHTML & Generate \HTML\ output. \\ -% mathsvg & Show math using \SVG\ images. \\ -% mathjax & Show math using MathJax. \\ -% OSWindows & Force compatibility with MS-Windows. \\ -% BaseJobname & The \cs{jobname} to use. -% Set to the \cs{jobname} of the printed version even while generating \HTML. \\ -% HomeHTMLFilename & The filename of the home page. \\ -% HTMLFilename & A prefix for the filenames of the remaining web pages. \\ -% IndexLanguage & The |xindy| language option used for index and glossary generation. \\ -% latexmk & Boolean for |lwarpmk| to use |latexmk| for compiling documents. -% Otherwise, |lwarpmk| attempts to recompile several times by itself. \\ -% lwarpmk & Generate a local copy of |lwarpmk.lua|. \\ -% xdyFilename & Tells |lwarpmk| to use a custom filename for |xindy|, instead of |lwarp.xdy|. \\ +% \caption{HTML settings} +% \begin{tabular}{>{\ttfamily}lp{3in}} +% \toprule +% Option & Description \\ \midrule +% SideTOCDepth & Sectioning depth of the side\TOC. \\ +% FileDepth & Sectioning depth of the file splits. \\ +% CombineHigherDepths & Combine higher section levels. \\ +% FileSectionNames & Use section names for file names, else use numbers. \\ +% FootnoteDepth & Sectioning depth of footnotes. \\ +% \cs{abstractname} & The name of the abstract. \\ +% \cs{CSSFilename} & The \CSS\ for the following files. \\ +% \cs{HTMLLanguage} & The |html lang| tag. \\ +% \cs{HTMLAuthor} & The \HTML\ |author| meta tag. \\ +% \cs{HTMLDescription} & The \HTML\ |description| meta tag. \\ +% \cs{HTMLFirstPageTop} & Heading for the home page. \\ +% \cs{HTMLPageTop} & Heading for the other pages. \\ +% \cs{HTMLPageBottom} & Footing for all pages. \\ +% \bottomrule % \end{tabular} % \end{table} % +% Several settings may be used to customize the \HTML\ output. +% Watch for the correct placement of each!\watchout[Placement!] +% +% Note that if changes are made, +% \watchout[Changes!] +% it is best to first: +% \begin{enumerate} +% \item Clear all the \HTML, \PDF, and auxiliary files: \userentry{lwarpmk clearall} +% \item Recompile the print version in order to recreate +% the configuration files for |lwarpmk|: \userentry{lwarpmk print} +% \item Finally, recompile the \HTML\ version with the new settings: \userentry{lwarpmk html} +% \end{enumerate} +% +% \begin{description}[style=unboxed] +% +% \item[Options for the \pkg{lwarp} package:] \ \newline +% Use the following as options for |\usepackage[]{lwarp}|: +% +% \begin{description} +% +% \ItemDescribeOption{HomeHTMLFilename} \DescribeDefault{\cs{BaseJobname}} +% Filename of the homepage, without +% the ``|.html|'' suffix. +% Defaults to the \cs{BaseJobname}. A common setting is: +% \begin{sourcedisplay} +% |HomeHTMLFilename=index| +% \end{sourcedisplay} +% causing the +% homepage to be the file |index.html|. Underscores are allowed in +% \margintag{filename underscores} +% |HomeHTMLFilename| and |HTMLFilename| options, but may need to be escaped +% elsewhere, such as when appearing in a list: +% \index{underscore>filename}\index{file>underscore} +% \changes{v0.24}{2017/03/13}{Docs: Filename underscore.} +% \begin{sourcedisplay} +% \cs{item} [\cs{href}\{file\textcolor{red}{\textbackslash\_}name.pdf\}\{text\}] \textbackslash +% \end{sourcedisplay} +% See \cref{sec:filenameexamples} for examples of naming and numbering \HTML\ files. +% +% \ItemDescribeOption{HTMLFilename} \DescribeDefault{} +% A filename prefix for the rest of the \HTML\ web pages. +% Useful for numbered web pages with a common prefix. May be empty. +% See \cref{sec:filenameexamples} for examples of naming and numbering \HTML\ files. +% +% \ItemDescribeOption{latexmk} \DescribeDefault{false} +% Controls whether \pkg{lwarp} uses |latexmk| to +% compile the document. This setting is written to |lwarpmk|'s configuration +% files. +% +% \ItemDescribeOption{mathsvg} \DescribeDefault{true} +% Selects \SVG\ display for math output. (The default.) +% +% \ItemDescribeOption{mathjax} \DescribeDefault{false} +% Selects MathJax for math output. +% +% \end{description} \bigskip +% +% \item[Placed in the preamble before \texttt{\cs{begin}\{document\}}:] \ +% +% \begin{description} +% +% \ItemDescribeCounter{tocdepth} Sectioning depth of the table of contents. +% See \cref{sec:stackdepths} for a list of \LaTeX{} stack depths. +% +% \ItemDescribeCounter{SideTOCDepth} \DescribeDefault{1} +% Sectioning depth of the side\TOC. +% Defaults to 1, causing the side\TOC\ to show sections but not subsections. +% +% Each subpage of the website has its own small table of contents +% \margintag{side\TOC} +% on the side (the ``side\TOC''). Its depth is set by |SideTOCDepth|. +% This side\TOC\ is only shown if the web page is wide enough. +% When using a narrow web browser window, +% ``responsive web design'' is used to show the side\TOC\ at the top of the +% page and a link back to ``Home'' at the bottom. +% +% \label{sec:filedepth} +% It is recommended to set: +% \begin{sourcedisplay} +% |SideTOCDepth|\,=\,|FileDepth| +% \end{sourcedisplay} +% or +% \begin{sourcedisplay} +% |SideTOCDepth|\,=\,|FileDepth|+1 +% \end{sourcedisplay} +% +% If |SideTOCDepth|\,<\,|FileDepth|, +% \watchout[inaccessible pages] +% web pages will be inaccessible via the side\TOC. +% \index{file>inaccessible} +% \index{page>inacessible} +% \index{missing sections} +% \index{section>missing} +% +% \ItemDescribeCounter{FileDepth} \DescribeDefault{-5} +% Sectioning depth of file splits. +% Defaults to -5, causing the entire \HTML\ website to be one single file. +% \begin{itemize} +% \item To place the entire file into one \HTML\ page, use: +% \begin{sourcedisplay} +% \cs{setcounter}\{FileDepth\}\{-5\} +% \end{sourcedisplay} +% \item To split the \HTML\ file at \cs{section} depth, use: +% \begin{sourcedisplay} +% \cs{setcounter}\{FileDepth\}\{1\} +% \end{sourcedisplay} +% \item To ensure that the \HTML\ pages/files are accessible: +% \watchout\\ +% Place a \cs{tableofcontents} somewhere before the first section +% break (therefore in the ``home page''), and set +% \begin{sourcedisplay} +% tocdepth\,>=\,FileDepth +% \end{sourcedisplay} +% \index{file>inaccessible} +% \index{page>inacessible} +% \index{missing sections} +% \index{section>missing} +% \end{itemize} +% +% \ItemDescribeBoolean{CombineHigherDepths} \DescribeDefault{true} +% Combine a higher section with +% its first lower subsections, down to the |FileDepth|. +% Defaults to true. Set to false to simulate the concept of a chapter +% opening on its own page, for example. +% +% The file splits are controlled by the counter |FileDepth| and +% the boolean |CombineHigherDepths|. +% Setting |FileDepth| to 0 splits the file +% at chapters, 1 at sections, etc. |CombineHigherDepths| controls whether +% to combine pages at levels higher than the chosen |FileDepth|, such as +% in this tutorial where the page which opens the chapter also contains the +% first section. +% Be careful to set |tocdepth| and |SideTOCDepth| to allow +% \watchout[Inaccesible pages!] +% access to each page of the website. Set |tocdepth| and |SideTOCDepth| to be +% greater than or equal to |FileDepth|. +% +% When making changes to the file structure, +% \watchout[Lost in an old page!] +% it is possible to end up +% with the web browser pointing to an old file which is no longer in use. +% When this occurs, changes to the web site will not appear in the browser, +% even if reloading the page, because that page is no longer in use. +% It is best to return to the home page, clean the files (|lwarpmk cleanall|), +% change |FileDepth| and/or |CombineHigherDepths|, then finally recompile and +% renavigate to the desired page using the new file structure. +% +% \ItemDescribeBoolean{FileSectionNames} \DescribeDefault{true} +% If true, web page filenames are derived from a sanitized version +% of the section names. If false, web pages are numbered. +% Either way, the |HTMLFilename| option is used as a prefix. +% See \cref{sec:filenameexamples} for examples of naming and numbering \HTML\ files. +% +% \ItemDescribeCounter{FootnoteDepth} \DescribeDefault{5} +% Determines where to place pending footnotes. +% |5| places footnotes before each break down to the \cs{subparagraph} level. +% |1| places footnotes before each \cs{section} break. +% Any pending footnotes are also placed at the bottom of each page +% before each file break. +% +% \ItemDescribeMacro{\abstractname} \DescribeDefault{Abstract} +% The name of the abstract. +% This may also be over-written +% by the \pkg{babel} package. Defaults to ``Abstract''. +% +% \end{description} +% +% +% \item[Placed before \texttt{\cs{begin}\{document\}}, +% or before any sectioning command which causes a file break:] \ +% +% \begin{description} +% \ItemDescribeMacro{\CSSFilename} \marg{filename.css} \DescribeDefault{lwarp.css} \quad +% Sets the \CSS\ file to use for the following +% files. May be changed before each each sectioning command which would +% cause a file split. +% +% The \CSS\ styles of the web pages are set by the \cs{CSSFilename} command. +% If \cs{CSSFilename} is not used, a default plain style is used to mimic printed +% \LaTeX\ output. |lwarp_sagebrush.css| is a semi-fancy colored style as shown +% in this tutorial. Change it to |lwarp_formal.css| for a more formal look, +% or comment out the \cs{CSSFilename} command to see the default. +% \cs{CSSFilename} may be used before each file break to set the \CSS\ for +% individual pagess of the website. +% +% \ItemDescribeMacro{\HTMLLanguage} \marg{langauge} \DescribeDefault{en-US} \quad +% The \HTML\ file's |html lang| meta tag. +% Defaults to |en-US|. +% +% \ItemDescribeMacro{\HTMLAuthor} \marg{author} \DescribeDefault{\cs{theauthor}} \quad +% The \HTML\ header's meta author. +% Defaults to \cs{theauthor}. +% +% \ItemDescribeMacro{\HTMLDescription} \marg{description} \DescribeDefault{} \quad +% Sets the \HTML\ \attribute{description} tag for +% the following files. May be changed before each each sectioning command which would +% cause a file split. +% +% \ItemDescribeMacro{\HTMLFirstPageTop} \marg{contents} \DescribeDefault{} \quad +% A user-definable custom action applied +% to the top of the home page. Useful for logos, etc. +% Defaults empty. +% Ignored in print output. +% +% \ItemDescribeMacro{\HTMLPageTop} \marg{contents} \DescribeDefault{} \quad +% A user-definable custom action applied to +% the top of pages other than the home page. Useful for logos, etc. +% Defaults empty. +% |\LinkHome| may be used to place a link back to the homepage. +% Ignored in print output. +% +% \ItemDescribeMacro{\HTMLPageBottom} \marg{contents} \DescribeDefault{} \quad +% A user-definable custom action applied to the +% bottom of each web page. +% Useful for authors, copyright notices, contact information, etc. +% Defaults empty. +% |\LinkHome| may be used to place a link back to the homepage. +% Ignored in print output. +% +% \end{description} +% +% +% \needspace{2\baselineskip} +% \item[Placed in the home page before the first sectioning command which causes a file break:] \ +% +% \begin{description} +% \ItemDescribeMacro{\tableofcontents} +% Used to place a table of contents on the home page. +% This command must be used before the first file split, +% \watchout[TOC on the homepage!] +% so that a way is available to navigate to other files from the homepage. +% +% Links to each chapter/section are provided, as selected by |tocdepth|. +% \end{description} +% +% +% \needspace{2\baselineskip} +% \item[Placed in the document wherever necessary:] \ +% +% \begin{description} +% \ItemDescribeEnv{warpprint} An environment which is only used +% while generating print output. Place here anything which does not +% apply to \HTML\ and which may cause problems with \pkg{lwarp}. +% If \pkg{lwarp} knows about and emulates or supports +% a package then its related macros, lengths, counters, etc. probably won't have +% to be placed inside a \env{warpprint} environment, but unknown packages +% may cause problems which may be isolated from \pkg{lwarp} using this environment. +% +% \ItemDescribeEnv{warpHTML} An environment which is only used +% while generating \HTML\ output. This is useful for website logos and +% other items which have no purpose in printed output. +% +% \ItemDescribeMacro{\warpprintonly} \marg{contents} \quad +% A macro version of the \env{warpprint} environment. +% +% \ItemDescribeMacro{\warpHTMLonly} \marg{contents} \quad +% A macro version of the \env{warpHTML} environment. +% \end{description} +% +% \end{description} +% +% +% \subsubsection{Example HTML file naming} +% \label{sec:filenameexamples} +% \index{HTML>filename generation} +% \changes{v0.20}{2016/09/11}{Docs: Examples for generating \HTML\ file names.} % +% Examples of ways to name or number \HTML\ files: +% \begin{description} +% \item[Numbered \HTML\ nodes:] \ +% +% Example: Homepage |index.html|, and |node-1|, |node-2|. +% \footnote{See \cs{SetHTMLFileNumber} to number in groups by chapter, for example.} +% \begin{Verbatim}[gobble=2,frame=lines,obeytabs,tabsize=4] +% \usepackage[ +% HomeHTMLFilename=index, +% HTMLFilename={node-} +% ]{lwarp} +% \boolfalse{FileSectionNames} +% \end{Verbatim} +% +% \item[Named \HTML\ sections, no prefix:] \ +% +% Example: |index.html|, and |About.html|, |Products.html| +% \begin{Verbatim}[gobble=2,frame=lines,obeytabs,tabsize=4] +% \usepackage[ +% HomeHTMLFilename=index, +% HTMLFilename={} +% ]{lwarp} +% \booltrue{FileSectionNames} +% \end{Verbatim} +% +% \item[Named \HTML\ sections, with prefix:] \ +% +% Example: Homepage |mywebsite.html|, and additional pages such +% as \\ +% |mywebsite-About.html|, |mywebsite-Products|, etc. +% \begin{Verbatim}[gobble=2,frame=lines,obeytabs,tabsize=4] +% \usepackage[ +% HomeHTMLFilename=mywebsite, +% HTMLFilename={mywebsite-} +% ]{lwarp} +% \booltrue{FileSectionNames} +% \end{Verbatim} +% \end{description} +% +% +% \subsection{Customizing the CSS} +% \label{sec:csscustomization} +% +% \DescribeMacro{\CSSFilename} \DescribeDefault{lwarp.css} +% \cs{CSSFilename} may be used to choose which |.css| file is used to display +% each page of the web site. Use \cs{CSSFilename} before |\begin{document}| +% to assign the style of the home page. +% If different parts of the website should have different styles, +% call \cs{CSSFilename} again before each section heading which creates a new file. +% This may be changed numerous times throughout the file, resulting in +% different \HTML\ pages having different \CSS\ files assigned: +% \begin{Verbatim}[gobble=2,tabsize=4] +% ... +% \newCSS{myCSS.css} +% \chapter{Another Chapter} +% ... +% \end{Verbatim} +% \index{CSS>file selection} +% \index{CSS>per HTML page} +% \index{settings>CSS selection} +% +% The styles provided by \pkg{lwarp} include: +% \begin{description} +% \item[|lwarp.css|:] A default style if \cs{CSSFilename} is not used. This +% style is comparable to a plain \LaTeX\ document. +% To set this style, you may use |\CSSFilename{lwarp.css}|, or no \cs{CSSFilename} call at all. +% \item[|lwarp\_formal.css|:] A formal style with a serif fonts and a traditional +% look. +% \item[|lwarp\_sagebrush.css|:] A style with muted colors, gradient backgrounds, +% additional borders, and rounded corners. +% \end{description} +% +% To see each style in use, change the \cs{CSSFilename} entry in the tutorial, +% |lwarpmk html| again, and then reload the tutorial webpage. +% +% A customized style may also be created. +% \margintag{Custom \CSS} +% For each new project a file +% called |sample_project.css| is generated. This may be renamed to +% |.css| then used by assigning |\CSSFilename{.css}|. +% +% Note that |sample_project.css| is overwritten whenever \pkg{lwarp} +% is loaded in print mode. +% It is therefore important to rename the file \watchout[Rename it!] +% to something like |.css| before +% using it, so that your own changes are not overwritten. +% +% |.css| has an entry which loads |lwarp.css|, and this +% entry may be changed to load |lwarp_formal.css| or |lwarp_sagebrush.css| if +% desired. Additional changes to the \CSS\ may be made by making entries +% later in the |.css| file. +% +% \label{sec:projectcss} +% \DescribeFile{lwarp.css}\DescribeFile{project.css}\DescribeFile{sample_project.css}\label{sec:lwarpcss} +% It is best to make a local project-specific \CSS\ file such as |project.css|, containing only +% things which are different from |lwarp.css|. +% The file |project.css| should refer to |lwarp.css| as follows: +% \index{CSS>project-specific changes}\index{CSS>lwarp.css} +% \index{settings>\CSS\ project-specific} +% \vspace{-2ex} +% \VerbatimInput[frame=lines]{sample_project.css} +% +% Finally use |\CSSFilename{.css}| in the document to activate the custom \CSS. +% % % \subsection{Selecting the operating system} % \label{sec:OSportabilityusage} @@ -4516,38 +4695,6 @@ This boolean may be tested by the user for later use. % May be set empty to cancel the meta author tag. % % -% \subsection{CSS} -% -% \label{sec:projectcss} -% \DescribeFile{lwarp.css}\DescribeFile{project.css}\DescribeFile{sample_project.css}\label{sec:lwarpcss}It is best -% to make a local project-specific \CSS\ file such as |project.css|, containing only -% things which are different from |lwarp.css|. -% |project.css| should refer to |lwarp.css| as follows: -% \index{CSS>project-specific changes}\index{CSS>lwarp.css} -% \index{settings>\CSS\ project-specific} -% \vspace{-2ex} -% \VerbatimInput[frame=lines]{sample_project.css} -% -% An example file called |sample_project.css| is provided, and may be renamed |project.css|. -% -% \label{sec:setcss} -% -% \DescribeMacro{\CSSFilename} -% For each section at which \HTML\ files are split, -% |\CSSFilename| may be used before the sectioning command to select a \CSS\ file for that and all -% following sections. This may be changed numerous times throughout the file, resulting in -% different \HTML\ pages having different \CSS\ files assigned: -% \begin{Verbatim}[gobble=2,tabsize=4] -% ... -% \newCSS{myCSS.css} -% \chapter{Another Chapter} -% ... -% \end{Verbatim} -% \index{CSS>file selection} -% \index{CSS>per HTML page} -% \index{settings>CSS selection} -% -% % \subsection{Modifying \protect\texttt{xindy} index processing} % \label{sec:modifyxindy} % @@ -4773,6 +4920,8 @@ This boolean may be tested by the user for later use. % % \subsection{Cross-references} % +% \index{math>labels --- valid characters} +% \index{label>valid characters} % \limitsreferences % % \subsubsection{Page references} The printed page does not translate @@ -5043,7 +5192,12 @@ This boolean may be tested by the user for later use. % \limitsbabeltwo % % +% \needspace{5\baselineskip} +% +% \subsubsection{\pkg{todonotes} package} % +% \DescribePackage{todonotes} +% \limitstodonotes % % % @@ -5070,10 +5224,9 @@ This boolean may be tested by the user for later use. % A special boolean is provided to simplify the process of % converting \pkg{lwarp} \HTML\ output to \EPUB: % -% \DescribeBoolean{FormatEPUB} +% \DescribeBoolean{FormatEPUB} \DescribeDefault{false} % \begin{docsidebar}[\texttt{FormatEPUB}] % \raggedright -% Default false. % |FormatEPUB| changes \HTML\ output for easy \EPUB\ conversion % via an external program. Removes per-file headers, footers, and nav. % Adds footnotes per chapter/section. @@ -5095,7 +5248,7 @@ This boolean may be tested by the user for later use. % Several changes are then made to the \HTML\ output: % \begin{itemize} % \item Headers, footers, and navigation are removed at file splits. -% \item Any accumulated footnotes are printed at the bottom of each file split. +% \item Any accumulated footnotes are printed at the bottom of each section. % \end{itemize} % % The resulting files will be ready to be loaded into an \EPUB\ conversion @@ -5185,10 +5338,9 @@ This boolean may be tested by the user for later use. % A special boolean is provided to simplify the process of % converting \pkg{lwarp} \HTML\ output to \EPUB: % -% \DescribeBoolean{FormatWP} +% \DescribeBoolean{FormatWP} \DescribeDefault{false} % \begin{docsidebar}[\texttt{FormatWP}] % \raggedright -% Default false. % Changes \HTML\ output for easier conversion % by a word processor. % Removes headers and nav, prints footnotes per section, @@ -5214,11 +5366,7 @@ This boolean may be tested by the user for later use. % section headings will import as \UI{Heading~1} for the title, \UI{Heading~2} % for \cs{section}, etc. % \item Headers, footers, and navigation are removed at file splits. -% \item Any accumulated footnotes are printed at the bottom of each file split. -% These will have to be manually moved to their proper place in -% the document. \pkg{lwarp} does not know where the page breaks -% will be in the word processor's document, so the footnotes are -% simply moved to the end of each sectional break. +% \item Any accumulated footnotes are printed at the bottom of each section. % \item Forces single-file output. % \item Turns off \HTML\ debugging comments. % These are comments appearing inside the \HTML\ code, @@ -5268,7 +5416,6 @@ This boolean may be tested by the user for later use. % \subsection{Additional modifications} % % \newcommand{\describeWPMarkFloats}{ -% Default |false|. % Adds % \begin{sourcedisplay} % === begin table === \\ @@ -5286,7 +5433,7 @@ This boolean may be tested by the user for later use. % to word-processor frames and captions. % } % -% \DescribeBoolean{WPMarkFloats} +% \DescribeBoolean{WPMarkFloats} \DescribeDefault{false} % \begin{docsidebar}[\texttt{WPMarkFloats}] % \raggedright % \describeWPMarkFloats @@ -5294,7 +5441,6 @@ This boolean may be tested by the user for later use. % % % \newcommand{\describeWPMarkMinipages}{ -% Default |false|. % Adds % \begin{sourcedisplay} % === begin minipage === \\ @@ -5306,7 +5452,7 @@ This boolean may be tested by the user for later use. % to word-processor frames. % } % -% \DescribeBoolean{WPMarkMinipages} +% \DescribeBoolean{WPMarkMinipages} \DescribeDefault{false} % \begin{docsidebar}[\texttt{WPMarkMinipages}] % \raggedright % \describeWPMarkMinipages @@ -5314,7 +5460,6 @@ This boolean may be tested by the user for later use. % % % \newcommand{\describeWPMarkTOC}{ -% Default |true|. % While formatting for word processors, adds % \begin{sourcedisplay} % === table of contents === \\ @@ -5325,7 +5470,7 @@ This boolean may be tested by the user for later use. % \emph{If set |false|, the actual \acro{TOC} is printed instead.} % } % -% \DescribeBoolean{WPMarkTOC} +% \DescribeBoolean{WPMarkTOC} \DescribeDefault{true} % \begin{docsidebar}[\texttt{WPMarkTOC}] % \raggedright % \describeWPMarkTOC @@ -5333,7 +5478,6 @@ This boolean may be tested by the user for later use. % % % \newcommand{\describeWPMarkLOFT}{ -% Default |false|. % While formatting for word processors, adds % \begin{sourcedisplay} % === list of figures === \quad \textrm{\textit{and\,/\,or}} \\ @@ -5345,7 +5489,7 @@ This boolean may be tested by the user for later use. % \emph{If set |false|, the actual lists are printed instead.} % } % -% \DescribeBoolean{WPMarkLOFT} +% \DescribeBoolean{WPMarkLOFT} \DescribeDefault{false} % \begin{docsidebar}[\texttt{WPMarkLOFT}] % \raggedright % \describeWPMarkLOFT @@ -5353,13 +5497,12 @@ This boolean may be tested by the user for later use. % % % \newcommand{\describeWPMarkMath}{ -% Default |false|. % While formatting for word processors, % prints math as \LaTeX\ code instead of creating \SVG\ images or MathJax. % This is useful for cut/paste into the LibreOffice Writer TeXMaths extension. % } % -% \DescribeBoolean{WPMarkMath} +% \DescribeBoolean{WPMarkMath} \DescribeDefault{false} % \DescribeProgram{TeXMaths} % \margintag{siunitx} % \begin{docsidebar}[\texttt{WPMarkMath}] @@ -5378,7 +5521,6 @@ This boolean may be tested by the user for later use. % % % \newcommand*{\describeWPTitleHeading}{ -% Default |false|. % While formatting for word processors, % |true| sets the document title to \element{h1}, which is expected for \HTML\ documents, % but also causes the lower-level section headings to start at \UI{Heading 2} when @@ -5389,7 +5531,7 @@ This boolean may be tested by the user for later use. % See \cref{tab:WPsectionheadings} on \cpageref{tab:WPsectionheadings}. % } % -% \DescribeBoolean{WPTitleHeading} +% \DescribeBoolean{WPTitleHeading} \DescribeDefault{false} % \margintag{section headings} % \begin{docsidebar}[\texttt{WPTitleHeading}] % \raggedright @@ -6278,7 +6420,7 @@ This boolean may be tested by the user for later use. -% \DescribeOption{HomeHTMLFilename} +% \DescribeOption{HomeHTMLFilename} \DescribeDefault{\cs{\BaseJobname}} % The filename of the homepage. % The default is the jobname. % This option is stored into \cs{LWR@HomeHTMLFilename}, @@ -6292,7 +6434,7 @@ This boolean may be tested by the user for later use. % \end{macrocode} -% \DescribeOption{HTMLFilename} +% \DescribeOption{HTMLFilename} \DescribeDefault{} % The filename prefix of web pages after the homepage. % The default is empty, no prefix. % This option is stored into \cs{LWR@HTMLFilename}, @@ -6552,6 +6694,7 @@ For a possible alternative, see package(s) #2.} \LWR@loadafter{booktabs} \LWR@loadafter{boxedminipage} \LWR@loadafter{boxedminipage2e} +\LWR@loadafter{breakurl} \LWR@loadafter{ccaption} \LWR@loadafter{changepage} \LWR@loadafter{chngpage} @@ -6609,6 +6752,7 @@ For a possible alternative, see package(s) #2.} \LWR@loadafter{longtable} \LWR@loadafter{lscape} \LWR@loadafter{ltcaption} +\LWR@loadafter{luatodonotes} \LWR@loadafter{marginfit} \LWR@loadafter{marginfix} \LWR@loadafter{marginnote} @@ -6678,6 +6822,7 @@ For a possible alternative, see package(s) #2.} \LWR@loadafter{titling} \LWR@loadafter{tocbibind} \LWR@loadafter{tocloft} +\LWR@loadafter{todonotes} \LWR@loadafter{transparent} \LWR@loadafter{trivfloat} \LWR@loadafter{typearea} @@ -7520,7 +7665,7 @@ top=1in,bottom=1in,% % \end{macro} -% \DescribeBoolean{HTMLDebugComments} Default false. +% \DescribeBoolean{HTMLDebugComments} \DescribeDefault{false} % Add comments in \HTML\ % about closing \element{div}s, sections, etc. % \index{HTML>conversion settings>debug comments} @@ -7566,7 +7711,7 @@ top=1in,bottom=1in,% % % \subsection{User-level controls} % -% \DescribeBoolean{FormatEPUB} Default false. +% \DescribeBoolean{FormatEPUB} \DescribeDefault{false} % Changes \HTML\ output for easy \EPUB\ conversion % via an external program. Removes per-file headers, footers, and nav. % Adds footnotes per chapter/section. @@ -7581,7 +7726,7 @@ top=1in,bottom=1in,% % \end{macrocode} % % -% \DescribeBoolean{FormatWP} Default false. +% \DescribeBoolean{FormatWP} \DescribeDefault{false} % Changes \HTML\ output for easier conversion % by a word processor. % Removes headers and nav, prints footnotes per section, @@ -7598,7 +7743,7 @@ top=1in,bottom=1in,% % \end{macrocode} % % -% \DescribeBoolean{WPMarkFloats} +% \DescribeBoolean{WPMarkFloats} \DescribeDefault{false} % \describeWPMarkFloats % \footnote{Perhaps some day word processors will have \HTML\ import options % for identifying \element{figure} and \element{figcaption} tags @@ -7614,7 +7759,7 @@ top=1in,bottom=1in,% \boolfalse{WPMarkFloats} % \end{macrocode} -% \DescribeBoolean{WPMarkMinipages} +% \DescribeBoolean{WPMarkMinipages} \DescribeDefault{false} % \changes{v0.42}{2017/10/18}{Added boolean \protect\texttt{WPMarkMinipages}.} % \describeWPMarkMinipages % \begin{macrocode} @@ -7622,7 +7767,7 @@ top=1in,bottom=1in,% \boolfalse{WPMarkMinipages} % \end{macrocode} -% \DescribeBoolean{WPMarkTOC} +% \DescribeBoolean{WPMarkTOC} \DescribeDefault{true} % \changes{v0.42}{2017/10/18}{Added boolean \protect\texttt{WPMarkTOC}.} % \describeWPMarkTOC % \begin{macrocode} @@ -7631,7 +7776,7 @@ top=1in,bottom=1in,% % \end{macrocode} -% \DescribeBoolean{WPMarkLOFT} +% \DescribeBoolean{WPMarkLOFT} \DescribeDefault{false} % \changes{v0.42}{2017/10/19}{Added boolean \protect\texttt{WPMarkLOFT}.} % \describeWPMarkLOFT % \begin{macrocode} @@ -7640,7 +7785,7 @@ top=1in,bottom=1in,% % \end{macrocode} -% \DescribeBoolean{WPMarkMath} +% \DescribeBoolean{WPMarkMath} \DescribeDefault{false} % \changes{v0.42}{2017/10/19}{Added boolean \protect\texttt{WPMarkMath}.} % \describeWPMarkMath % \begin{macrocode} @@ -7649,7 +7794,7 @@ top=1in,bottom=1in,% % \end{macrocode} -% \DescribeBoolean{WPTitleHeading} +% \DescribeBoolean{WPTitleHeading} \DescribeDefault{false} % \changes{v0.42}{2017/10/19}{Added boolean \protect\texttt{WPTitleHeading}.} % \describeWPTitleHeading % \begin{macrocode} @@ -9889,7 +10034,7 @@ nav.botnavigation { \begin{warpprint} \begin{filecontents*}{sample_project.css} /* ( --- Start of project.css --- ) */ -/* A sample project-specific CSS file for lwarp --- ) */ +/* ( --- A sample project-specific CSS file for lwarp --- ) */ /* Load default lwarp settings: */ @import url("lwarp.css") ; @@ -10087,7 +10232,7 @@ src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX- -- Print the usage of the lwarpmk command: -printversion = "v0.42" +printversion = "v0.43" function printhelp () print ("lwarpmk: Use lwarpmk -h or lwarpmk --help for help.") ; @@ -12254,7 +12399,7 @@ end -- not --version \begin{warpall} % \end{macrocode} -% In the following, catcode is manually changes back and forth +% 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. % \begin{macrocode} @@ -12472,6 +12617,28 @@ end -- not --version % \subsection{Regular page footnote implementation} % \label{sec:footnotesregular} % +% +% \codeall +% \begin{macrocode} +\begin{warpall} +% \end{macrocode} + +% \DescribeCounter{FootnoteDepth} \DescribeDefault{5} Determines how deeply +% to place footnotes in the \HTML\ files, similar to |tocdepth|. +% The default of |5| places footnotes before each \cs{subparagraph} or higher. +% See \cref{tab:depthsheadings} for a table of \LaTeX\ section headings. +% \changes{v0.43}{2017/11/08}{Added \protect\texttt{FootnoteDepth}.} +% \begin{macrocode} +\newcounter{FootnoteDepth} +\setcounter{FootnoteDepth}{5} +% \end{macrocode} + +% \begin{macrocode} +\end{warpall} +% \end{macrocode} + + + % \codehtml % \begin{macrocode} \begin{warpHTML} @@ -12642,11 +12809,16 @@ end -- not --version % \end{macrocode} % \end{macro} % -% \begin{macro}{\LWR@epubprintpendingfootnotes} +% \begin{macro}{\LWR@maybeprintpendingfootnotes} \marg{depth} % Used to print footnotes before sections only if formatting for an \EPUB\ or word processor: +% \changes{v0.43}{2017/11/08}{Added \protect\texttt{FootnoteDepth}.} % \begin{macrocode} -\newcommand*{\LWR@epubprintpendingfootnotes}{% -\ifthenelse{\boolean{FormatEPUB}\OR\boolean{FormatWP}}% +\newcommand*{\LWR@maybeprintpendingfootnotes}[1]{% +\ifboolexpr{ + not test{\ifnumcomp{#1}{>}{\value{FootnoteDepth}}} or + bool{FormatEPUB} or + bool{FormatWP} +}% {\LWR@printpendingfootnotes}% {}% } @@ -12915,7 +13087,7 @@ end -- not --version % \begin{macrocode} \ifbool{FileSectionNames}% {\LWR@filenamenoblanks{#1}} -{\renewcommand*{\LWR@thisfilename}{\theLWR@htmlfilenumber}} +{\renewcommand*{\LWR@thisfilename}{\arabic{LWR@htmlfilenumber}}} % \end{macrocode} % Include an \HTML\ comment to instruct lwarpmk @@ -13248,6 +13420,16 @@ end -- not --version % \end{macro} % % +% \DescribeCounter{LWR@currentautosec} Records the page number when the section +% was created. If a math expression is included in the section name, +% and SVG math is used, the corresponding \env{lateximage} will cause the +% page number to change by the time the following autosec label is created. +% \changes{v0.43}{2017/11/01}{\protect\texttt{LWR@currentautosec}: Added.} +% \begin{macrocode} +\newcounter{LWR@currentautosec} +% \end{macrocode} +% +% % % \begin{macro}{\LWR@section} * \oarg{TOC name} \marg{name} \marg{sectiontype} % @@ -13260,14 +13442,6 @@ end -- not --version % \begin{macrocode} \DeclareDocumentCommand{\LWR@section}{m m m m}{% \LWR@traceinfo{LWR@section |#2| |#3|}% -% \ifthenelse{% -% % \equal{#2}{\-NoValue-}\AND% -% \isempty{#3}% -% }% -% {% empty section name -% \LWR@traceinfo{LWR@section: empty section}% -% }% empty section name -% {% not an empty section name \LWR@traceinfo{LWR@section: not an empty section}% \LWR@stoppars% % \end{macrocode} @@ -13299,7 +13473,10 @@ end -- not --version \cnttest{\csuse{LWR@depth#4}}{<=}{\value{LWR@prevFileDepth}}% \)% \AND% - \NOT\equal{#3}{}% phantomsection +% \end{macrocode} +% \changes{v0.43}{2017/10/31}{Fix: Expansion in comparison.} +% \begin{macrocode} + \NOT\isempty{#3}% phantomsection }% % \end{macrocode} % If so: start a new \HTML\ file: @@ -13340,10 +13517,14 @@ end -- not --version % \end{macrocode} % Print an opening comment with the level and the name; % ex: ``section'' ``Introduction'' +% \changes{v0.43}{2017/10/31}{Fix: Nullify fonts inside HTML comment.} % \begin{macrocode} \ifbool{HTMLDebugComments}{% + \begingroup% + \LWR@nullfonts% \LWR@htmlcomment{Opening #4 ``#3''{}}% + \endgroup% }{}% % \end{macrocode} @@ -13359,6 +13540,10 @@ end -- not --version % \begin{macrocode} \LWR@createautosec{\csuse{LWR@tag#4}}% % \end{macrocode} +% \changes{v0.43}{2017/11/01}{Fix: Math in section name.} +% \begin{macrocode} +\setcounter{LWR@currentautosec}{\value{page}} +% \end{macrocode} % Check if starred: % \begin{macrocode} \IfBooleanTF{#1}% @@ -13454,8 +13639,9 @@ end -- not --version \LWR@htmltag{\csuse{LWR@tag#4end}}% % \end{macrocode} % Generate a \LaTeX{} label: +% \changes{v0.43}{2017/11/01}{Fix: Math in section name.} % \begin{macrocode} -\label{autopage-\thepage}% +\label{autopage-\theLWR@currentautosec}% % \end{macrocode} % Start paragraph handing unless is an inline paragraph or subparagraph: % \begin{macrocode} @@ -13496,7 +13682,6 @@ end -- not --version \global\boolfalse{LWR@forcinghtmltoc}% }% % -% }% not an empty section name \LWR@traceinfo{LWR@section: done}% } % \end{macrocode} @@ -13512,7 +13697,7 @@ end -- not --version % % \begin{macrocode} \DeclareDocumentCommand{\part}{s o m}{% -\LWR@epubprintpendingfootnotes% +\LWR@maybeprintpendingfootnotes{\LWR@depthpart}% \LWR@stoppars% \LWR@startnewdepth{\LWR@depthpart}{\LWR@printclosepart}% @@ -13535,7 +13720,7 @@ end -- not --version {% \DeclareDocumentCommand{\chapter}{s o m}{% \LWR@traceinfo{chapter #3}% -\LWR@epubprintpendingfootnotes% +\LWR@maybeprintpendingfootnotes{\LWR@depthchapter}% \LWR@stoppars% \LWR@startnewdepth{\LWR@depthchapter}{\LWR@printclosechapter}% @@ -13551,7 +13736,7 @@ end -- not --version % \begin{macro}{\section} * \oarg{TOC name} \marg{name} % \begin{macrocode} \DeclareDocumentCommand{\section}{s o m}{% -\LWR@epubprintpendingfootnotes% +\LWR@maybeprintpendingfootnotes{\LWR@depthsection}% \LWR@stoppars% \LWR@startnewdepth{\LWR@depthsection}{\LWR@printclosesection}% @@ -13566,7 +13751,7 @@ end -- not --version % \begin{macro}{\subsection} * \oarg{TOC name} \marg{name} % \begin{macrocode} \DeclareDocumentCommand{\subsection}{s o m}{% -\LWR@epubprintpendingfootnotes% +\LWR@maybeprintpendingfootnotes{\LWR@depthsubsection}% \LWR@stoppars% \LWR@startnewdepth{\LWR@depthsubsection}{\LWR@printclosesubsection}% @@ -13581,7 +13766,7 @@ end -- not --version % \begin{macro}{\subsubsection} * \oarg{TOC name} \marg{name} % \begin{macrocode} \DeclareDocumentCommand{\subsubsection}{s o m}{% -\LWR@epubprintpendingfootnotes% +\LWR@maybeprintpendingfootnotes{\LWR@depthsubsubsection}% \LWR@stoppars% \LWR@startnewdepth{\LWR@depthsubsubsection}% @@ -13598,7 +13783,7 @@ end -- not --version % \begin{macro}{\paragraph} * \oarg{TOC name} \marg{name} % \begin{macrocode} \DeclareDocumentCommand{\paragraph}{s o m}{% -\LWR@epubprintpendingfootnotes% +\LWR@maybeprintpendingfootnotes{\LWR@depthparagraph}% \LWR@stoppars% \LWR@startnewdepth{\LWR@depthparagraph}{\LWR@printcloseparagraph}% @@ -13613,7 +13798,7 @@ end -- not --version % \begin{macro}{\subparagraph} * \oarg{TOC name} \marg{name} % \begin{macrocode} \DeclareDocumentCommand{\subparagraph}{s o m}{% -\LWR@epubprintpendingfootnotes% +\LWR@maybeprintpendingfootnotes{\LWR@depthsubparagraph}% \LWR@stoppars% \LWR@startnewdepth{\LWR@depthsubparagraph}{\LWR@printclosesubparagraph}% @@ -15322,6 +15507,13 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% \boolfalse{LWR@startedrow} % \end{macrocode} +% \DescribeBoolean{LWR@tabularcelladded} +% True if have added a data cell for this position. +% \begin{macrocode} +\newbool{LWR@tabularcelladded} +\boolfalse{LWR@tabularcelladded} +% \end{macrocode} + % \DescribeBoolean{LWR@doinghline} % True if the next row will have an hline or midrule above it. % Also used for \cs{midrule}. @@ -15410,8 +15602,8 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% \ifbool{LWR@skipatbang}% {}% {% - \LWR@printatbang{at}{\theLWR@tablecolspos}% - \LWR@printatbang{bang}{\theLWR@tablecolspos}% + \LWR@printatbang{at}{\arabic{LWR@tablecolindex}}% + \LWR@printatbang{bang}{\arabic{LWR@tablecolindex}}% }% } % \end{macrocode} @@ -15454,7 +15646,7 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% bool{LWR@emptyatbang} }% {}% - {\LWR@getexparray{LWR@colafterspec}{\theLWR@tablecolspos}}% + {\LWR@getexparray{LWR@colafterspec}{\arabic{LWR@tablecolindex}}}% % \end{macrocode} % Close paragraphs: % \begin{macrocode} @@ -15465,6 +15657,7 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% % Skip the |@| and |!| cells if are closing a multicolumn cell. % \begin{macrocode} \leavevmode\unskip\LWR@htmltag{/td}\LWR@orignewline% + \global\booltrue{LWR@tabularcelladded}% \LWR@insertatbangcols% }% not skipping mrowcell }% not exiting tabular @@ -15569,7 +15762,11 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% % \end{macrocode} % Move to the next column. % \begin{macrocode} - \addtocounter{LWR@tablecolspos}{1}% + \addtocounter{LWR@tablecolindex}{1}% +% \end{macrocode} +% Have not yet added data in this column: +% \begin{macrocode} +\boolfalse{LWR@tabularcelladded}% % \end{macrocode} % Look at the next token to decide multi or single column data tag. % \begin{macrocode} @@ -15632,29 +15829,37 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% % \end{macrocode} % Reenable the table data tags until finished with the final row: % \begin{macrocode} -\boolfalse{LWR@exitingtabular}% +\global\boolfalse{LWR@exitingtabular}% % \end{macrocode} % Generate table data tags and ampersands until the right edge: % \begin{macrocode} -\whiledo{\value{LWR@tablecolspos}<\value{LWR@tabletotalcols}}{% -\LWR@tabledatasinglecolumntag% +\whiledo{% + \(% + \boolean{LWR@intabularmetadata} \AND% + \NOT\boolean{LWR@tabularcelladded} \AND% + \cnttest{\value{LWR@tablecolindex}}{=}{\value{LWR@tabletotalcols}}% + \) \OR% + \cnttest{\value{LWR@tablecolindex}}{<}{\value{LWR@tabletotalcols}}% +}{% + \LWR@tabledatasinglecolumntag% % \end{macrocode} % The following is essentially \cs{LWR@tabularampersand} with % |LWR@emptyatbang| added to empty the following cells: % \begin{macrocode} \LWR@closetabledatacell% - \addtocounter{LWR@tablecolspos}{1}% + \addtocounter{LWR@tablecolindex}{1}% + \boolfalse{LWR@tabularcelladded}% \global\booltrue{LWR@emptyatbang}% % \end{macrocode} % Starts the next cell: % \begin{macrocode} - \LWR@getmynexttoken% + \ifthenelse{% + \cnttest{\value{LWR@tablecolindex}}{<}{\value{LWR@tabletotalcols}}% + }% + {\LWR@getmynexttoken}% + {}% }% % \end{macrocode} -% Required to close the final cell: -% \begin{macrocode} -\LWR@closetabledatacell% -% \end{macrocode} % Reenable the original |LWR@exitingtabular| to close the entire table: % \begin{macrocode} \endgroup% @@ -15677,7 +15882,7 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% % \begin{macrocode} \NewDocumentCommand{\LWR@tabularendofline}{s o} {% -\ifthenelse{\value{LWR@tablecolspos}<\value{LWR@tabletotalcols}}{% +\ifthenelse{\value{LWR@tablecolindex}<\value{LWR@tabletotalcols}}{% \LWR@tabularfinishrow% }% {% @@ -15700,7 +15905,11 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% % \end{macrocode} % Start at first column: % \begin{macrocode} -\setcounter{LWR@tablecolspos}{1} +\setcounter{LWR@tablecolindex}{1}% +% \end{macrocode} +% Have not yet added data in this column: +% \begin{macrocode} +\boolfalse{LWR@tabularcelladded}% % \end{macrocode} % Look at the next token to decide between single column data tag % or a special case: @@ -15744,35 +15953,50 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% % \end{macro} -% \DescribeCounter{LWR@tablecolswidth} -% Holds the width of the table columns specification. +% \DescribeCounter{LWR@tablecolspecwidth} +% Holds the number of tokens in the table columns specification. % -% This is the number of tokens, including one for each |@| etc. column, and also -% one each for the parameters of |p|, |@|, etc. columns, and three for each |D| column. +% This is includes one for each |@|, |!|, |<|, |>| column, +% and also one for each of the parameters of |p|, |@|, |!|, |<|, |>| columns, +% and three for each |D| column. % % (This is not the total \# of \LaTeX\ columns in the table.) % \begin{macrocode} -\newcounter{LWR@tablecolswidth} +\newcounter{LWR@tablecolspecwidth} % \end{macrocode} +% \DescribeCounter{LWR@tablecolspecindex} +% While parsing the \LaTeX\ table column specification, +% starts at 1 and is incremented per token of the specification. +% While producing the table, resets to 1 at the start of the table and +% also at each end of line, and is incremented by 1 by each ampersand. +% \begin{macrocode} +\newcounter{LWR@tablecolspecindex} +% \end{macrocode} -% \DescribeCounter{LWR@tablecolspos} -% Where are currently looking into the table column specification. -% Index starts at 1. +% \DescribeCounter{LWR@tablecolindex} +% While parsing the \LaTeX\ table column specification, +% starts at 1 and is incremented per token of the specification. +% While producing the table, resets to 1 at the start of the table and +% also at each end of line, and is incremented by 1 by each ampersand. % \begin{macrocode} -\newcounter{LWR@tablecolspos} +\newcounter{LWR@tablecolindex} % \end{macrocode} % \DescribeCounter{LWR@tabletotalcols} -% Holds the final number of table columns, not counting |@| and |!| columns. -% This is equal to the number of cells in each row. +% While parsing a table column specification, +% begins at 0 and increments by 1 per \LaTeX\ table column. +% Eventually holds the final number of \LaTeX\ table columns in each row, +% not counting |@| and |!| columns. +% (In \HTML, |@| and |!| cells become their own columns, but are not included in +% |LWR@tabletotalcols|.) % \begin{macrocode} \newcounter{LWR@tabletotalcols} % \end{macrocode} % \DescribeCounter{LWR@tabletotalcolsnext} -% Holds the next column while parsing. -% Is one more than |LWR@tabletotalcols|. +% Holds the next \LaTeX\ table column index while parsing, +% equal to one more than |LWR@tabletotalcols|. % \begin{macrocode} \newcounter{LWR@tabletotalcolsnext} % \end{macrocode} @@ -15812,16 +16036,16 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% % Move to the next token after the '@': % \begin{macrocode} \LWR@traceinfo{at column}% -\addtocounter{LWR@tablecolspos}{1}% +\addtocounter{LWR@tablecolspecindex}{1}% % \end{macrocode} -% Read the next token into \cs{LWR@strresult}, expanding once: +% Read the next token into \cs{LWR@colparameter}, expanding once: % \begin{macrocode} \LWR@traceinfo{about to read the next token:}% \expandarg% -\StrChar{\LWR@origcolspec}{\theLWR@tablecolspos}[\LWR@colparameter] +\StrChar{\LWR@origcolspec}{\arabic{LWR@tablecolspecindex}}[\LWR@colparameter] \fullexpandarg% % \end{macrocode} -% Store the result into a data array, expanding once out of \cs{LWR@strresult}: +% Store the result into a data array, expanding once out of \cs{LWR@colparameter}: % \begin{macrocode} \LWR@traceinfo{have now read the next token}% \ifthenelse{\cnttest{\value{LWR@tabletotalcols}}=0} @@ -15833,9 +16057,9 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% }% {% not at the left edge: \LWR@traceinfo{not at the left edge}% - \LWR@setexparray{LWR@colatspec}{\theLWR@tabletotalcols}{\LWR@colparameter}% - \LWR@traceinfo{at \theLWR@tabletotalcols: % - \LWR@getexparray{LWR@colatspec}{\theLWR@tabletotalcols}}% + \LWR@setexparray{LWR@colatspec}{\arabic{LWR@tabletotalcols}}{\LWR@colparameter}% + \LWR@traceinfo{at \arabic{LWR@tabletotalcols}: % + \LWR@getexparray{LWR@colatspec}{\arabic{LWR@tabletotalcols}}}% }% \let\LWR@colparameter\relax% \booltrue{LWR@validtablecol}% @@ -15855,16 +16079,16 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% % Move to the next token after the '!': % \begin{macrocode} \LWR@traceinfo{bang column}% -\addtocounter{LWR@tablecolspos}{1}% +\addtocounter{LWR@tablecolspecindex}{1}% % \end{macrocode} -% Read the next token into \cs{LWR@strresult}, expanding once: +% Read the next token into \cs{LWR@colparameter}, expanding once: % \begin{macrocode} \LWR@traceinfo{about to read the next token:}% \expandarg% -\StrChar{\LWR@origcolspec}{\theLWR@tablecolspos}[\LWR@colparameter] +\StrChar{\LWR@origcolspec}{\arabic{LWR@tablecolspecindex}}[\LWR@colparameter] \fullexpandarg% % \end{macrocode} -% Store the result into a data array, expanding once out of \cs{LWR@strresult}: +% Store the result into a data array, expanding once out of \cs{LWR@colparameter}: % \begin{macrocode} \LWR@traceinfo{have now read the next token}% \ifthenelse{\cnttest{\value{LWR@tabletotalcols}}=0} @@ -15874,8 +16098,8 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% }% {% not at the left edge: \LWR@traceinfo{not at the left edge}% - \LWR@setexparray{LWR@colbangspec}{\theLWR@tabletotalcols}{\LWR@colparameter}% - \LWR@traceinfo{bang \theLWR@tabletotalcols: \LWR@colparameter!}% + \LWR@setexparray{LWR@colbangspec}{\arabic{LWR@tabletotalcols}}{\LWR@colparameter}% + \LWR@traceinfo{bang \arabic{LWR@tabletotalcols}: \LWR@colparameter!}% }% \let\LWR@colparameter\relax% \booltrue{LWR@validtablecol}% @@ -15894,17 +16118,17 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% % \end{macrocode} % Move to the next token after the '>': % \begin{macrocode} -\addtocounter{LWR@tablecolspos}{1}% +\addtocounter{LWR@tablecolspecindex}{1}% % \end{macrocode} -% Read the next token, expanding once into \cs{LWR@strresult}: +% Read the next token, expanding once into \cs{LWR@colparameter}: % \begin{macrocode} \expandarg% -\StrChar{\LWR@origcolspec}{\theLWR@tablecolspos}[\LWR@colparameter]% +\StrChar{\LWR@origcolspec}{\arabic{LWR@tablecolspecindex}}[\LWR@colparameter]% \fullexpandarg% % \end{macrocode} -% Store the result into a data array, expanding once out of \cs{LWR@strresult}: +% Store the result into a data array, expanding once out of \cs{LWR@colparameter}: % \begin{macrocode} -\LWR@setexparray{LWR@colbeforespec}{\theLWR@tabletotalcolsnext}{\LWR@colparameter}% +\LWR@setexparray{LWR@colbeforespec}{\arabic{LWR@tabletotalcolsnext}}{\LWR@colparameter}% \let\LWR@colparameter\relax% \booltrue{LWR@validtablecol}% } @@ -15920,18 +16144,17 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% % \end{macrocode} % Move to the next token after the '<': % \begin{macrocode} -\addtocounter{LWR@tablecolspos}{1}% +\addtocounter{LWR@tablecolspecindex}{1}% % \end{macrocode} -% Read the next token, expanding once into \cs{LWR@strresult}: +% Read the next token, expanding once into \cs{LWR@colparameter}: % \begin{macrocode} -% \StrChar{#1}{\theLWR@tablecolspos}[\LWR@colparameter] \expandarg% -\StrChar{\LWR@origcolspec}{\theLWR@tablecolspos}[\LWR@colparameter]% +\StrChar{\LWR@origcolspec}{\arabic{LWR@tablecolspecindex}}[\LWR@colparameter]% \fullexpandarg% % \end{macrocode} -% Store the result into a data array, expanding once out of \cs{LWR@strresult}: +% Store the result into a data array, expanding once out of \cs{LWR@colparameter}: % \begin{macrocode} -\LWR@setexparray{LWR@colafterspec}{\theLWR@tabletotalcols}{\LWR@colparameter}% +\LWR@setexparray{LWR@colafterspec}{\arabic{LWR@tabletotalcols}}{\LWR@colparameter}% \let\LWR@colparameter\relax% \booltrue{LWR@validtablecol}% } @@ -15954,7 +16177,7 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% \LWR@setexparray{LWR@colbarspec}{leftedge}{tvertbarl}% }% {% not at the left edge: - \LWR@setexparray{LWR@colbarspec}{\theLWR@tabletotalcols}{tvertbarr}% + \LWR@setexparray{LWR@colbarspec}{\arabic{LWR@tabletotalcols}}{tvertbarr}% }% \booltrue{LWR@validtablecol}% } @@ -15973,12 +16196,12 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% \appto\LWR@tablecolspec{#1}% \addtocounter{LWR@tabletotalcols}{1}% \addtocounter{LWR@tabletotalcolsnext}{1}% -\LWR@traceinfo{normal column \theLWR@tabletotalcols: #1}% -\LWR@setexparray{LWR@colatspec}{\theLWR@tabletotalcolsnext}{}% -\LWR@setexparray{LWR@colbangspec}{\theLWR@tabletotalcolsnext}{}% -\LWR@setexparray{LWR@colbeforespec}{\theLWR@tabletotalcolsnext}{}% -\LWR@setexparray{LWR@colafterspec}{\theLWR@tabletotalcolsnext}{}% -\LWR@setexparray{LWR@colbarspec}{\theLWR@tabletotalcolsnext}{}% +\LWR@traceinfo{normal column \arabic{LWR@tabletotalcols}: #1}% +\LWR@setexparray{LWR@colatspec}{\arabic{LWR@tabletotalcolsnext}}{}% +\LWR@setexparray{LWR@colbangspec}{\arabic{LWR@tabletotalcolsnext}}{}% +\LWR@setexparray{LWR@colbeforespec}{\arabic{LWR@tabletotalcolsnext}}{}% +\LWR@setexparray{LWR@colafterspec}{\arabic{LWR@tabletotalcolsnext}}{}% +\LWR@setexparray{LWR@colbarspec}{\arabic{LWR@tabletotalcolsnext}}{}% \booltrue{LWR@validtablecol}% } % \end{macrocode} @@ -15998,7 +16221,7 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% % \end{macrocode} % Skips the following width token: % \begin{macrocode} -\addtocounter{LWR@tablecolspos}{1}% +\addtocounter{LWR@tablecolspecindex}{1}% } % \end{macrocode} % \end{macro} @@ -16022,7 +16245,7 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% % \end{macrocode} % Skips the following three parameters. % \begin{macrocode} -\addtocounter{LWR@tablecolspos}{3}% +\addtocounter{LWR@tablecolspecindex}{3}% } % \end{macrocode} % \end{macro} @@ -16127,6 +16350,12 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% % \begin{macrocode} \renewcommand*{\LWR@origcolspec}{#1}% % \end{macrocode} +% Remove spaces: +% \changes{v0.43}{2017/11/01}{Ignore spaces in col spec.} +% \begin{macrocode} +\expandarg% +\StrSubstitute{\LWR@origcolspec}{ }{}[\LWR@origcolspec]% +% \end{macrocode} % Clear the parsed resulting column spec: % \begin{macrocode} \renewcommand*{\LWR@tablecolspec}{}% @@ -16157,27 +16386,27 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% % \end{macrocode} % Starting at the first column specification: % \begin{macrocode} -\setcounter{LWR@tablecolspos}{1}% +\setcounter{LWR@tablecolspecindex}{1}% % \end{macrocode} % Place the colspecs string length into \cs{LWR@strresult}, % and remember the number of characters in the column specification: % \begin{macrocode} \LWR@traceinfo{about to StrLen}% -\noexpandarg% -\StrLen{#1}[\LWR@strresult]% +\expandarg% +\StrLen{\LWR@origcolspec}[\LWR@strresult]% \fullexpandarg% \LWR@traceinfo{finished StrLen}% -\setcounter{LWR@tablecolswidth}{\LWR@strresult}% +\setcounter{LWR@tablecolspecwidth}{\LWR@strresult}% % \end{macrocode} % Scan through the column specifications: % \begin{macrocode} -\whiledo{\not\value{LWR@tablecolspos}>\value{LWR@tablecolswidth}}{% +\whiledo{\not\value{LWR@tablecolspecindex}>\value{LWR@tablecolspecwidth}}{% % \end{macrocode} % Place the next single-character column type into \cs{LWR@strresult}: % \begin{macrocode} -\noexpandarg% -\StrChar{#1}{\theLWR@tablecolspos}[\LWR@strresult]% -\LWR@traceinfo{position \arabic{LWR@tablecolspos}: \LWR@strresult}% +\expandarg% +\StrChar{\LWR@origcolspec}{\arabic{LWR@tablecolspecindex}}[\LWR@strresult]% +\LWR@traceinfo{position \arabic{LWR@tablecolspecindex}: \LWR@strresult}% \fullexpandarg% % \end{macrocode} % Not yet found a valid column type @@ -16229,8 +16458,8 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% \LWR@traceinfo{invalid column type: \LWR@strresult}% \LWR@parsenormalcolumn{l}% }% -\addtocounter{LWR@tablecolspos}{1}% -}% +\addtocounter{LWR@tablecolspecindex}{1}% +}% whiledo }% % \end{macrocode} % \end{macro} @@ -16333,6 +16562,7 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% {\LWR@atbangspec}% % \LWR@htmltag{/td}\LWR@orignewline% + \global\booltrue{LWR@tabularcelladded}% }% not empty }% % \end{macrocode} @@ -16342,7 +16572,7 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% % \begin{macro}{\LWR@addleftmostbartag} % \begin{macrocode} \newcommand*{\LWR@addleftmostbartag}{% -\ifnumcomp{\value{LWR@tablecolspos}}{=}{1}{% +\ifnumcomp{\value{LWR@tablecolindex}}{=}{1}{% \LWR@printbartag{leftedge}% }{}% } @@ -16353,7 +16583,7 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% % \begin{macro}{\LWR@tabularleftedge} % \begin{macrocode} \newcommand*{\LWR@tabularleftedge}{% -\ifthenelse{\cnttest{\value{LWR@tablecolspos}}=1}% +\ifthenelse{\cnttest{\value{LWR@tablecolindex}}=1}% {% \LWR@printatbang{at}{leftedge}% \LWR@printatbang{bang}{leftedge}% @@ -16395,7 +16625,7 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% % \end{macrocode} % Fetch the current column's alignment character into |\LWR@strresult|: % \begin{macrocode} - \StrChar{\LWR@tablecolspec}{\theLWR@tablecolspos}[\LWR@strresult]% + \StrChar{\LWR@tablecolspec}{\arabic{LWR@tablecolindex}}[\LWR@strresult]% % \end{macrocode} % print the start of a new table data cell: % \begin{macrocode} @@ -16410,7 +16640,7 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% % \begin{macrocode} \LWR@addcmidruletrim% \LWR@addleftmostbartag% - \LWR@printbartag{\theLWR@tablecolspos}% + \LWR@printbartag{\arabic{LWR@tablecolindex}}% "% % \end{macrocode} % \changes{v0.42}{2017/10/26}{If \protect\texttt{FormatWP} add cell alignment.} @@ -16442,7 +16672,9 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% % \begin{macrocode} \ifboolexpr{bool{LWR@tabularmutemods} or bool{LWR@emptyatbang}}% {}% - {\LWR@getexparray{LWR@colbeforespec}{\theLWR@tablecolspos}}% + {% + \LWR@getexparray{LWR@colbeforespec}{\arabic{LWR@tablecolindex}}% + }% \global\boolfalse{LWR@intabularmetadata}% }% not exiting tabular }{}% in tabular metadata @@ -16522,13 +16754,13 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% {% \setcounter{LWR@midrulecounter}{1}% \whiledo{% -\cnttest{\value{LWR@midrulecounter}}{<=}{\value{LWR@tablecolswidth}}% +\cnttest{\value{LWR@midrulecounter}}{<=}{\value{LWR@tablecolspecwidth}}% }% {% -\LWR@setexparray{LWR@midrules}{\theLWR@midrulecounter}{0pt}% +\LWR@setexparray{LWR@midrules}{\arabic{LWR@midrulecounter}}{0pt}% \setlength{\LWR@thiscmidrulewidth}{\LWR@cmidrulewidth}% -\LWR@setexparray{LWR@trimlrules}{\theLWR@midrulecounter}{}% -\LWR@setexparray{LWR@trimrrules}{\theLWR@midrulecounter}{}% +\LWR@setexparray{LWR@trimlrules}{\arabic{LWR@midrulecounter}}{}% +\LWR@setexparray{LWR@trimrrules}{\arabic{LWR@midrulecounter}}{}% \addtocounter{LWR@midrulecounter}{1}% }% } @@ -16552,7 +16784,7 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% \setcounter{LWR@midrulecounter}{#3}% \whiledo{\cnttest{\value{LWR@midrulecounter}}{<=}{#4}}% {% -\LWR@setexparray{LWR@midrules}{\theLWR@midrulecounter}{#1}% +\LWR@setexparray{LWR@midrules}{\arabic{LWR@midrulecounter}}{#1}% \addtocounter{LWR@midrulecounter}{1}% }% whiledo \IfSubStr{#2}{l}{\LWR@setexparray{LWR@trimlrules}{#3}{l}}{}% @@ -16629,7 +16861,7 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% % % \begin{macrocode} \newcommand*{\LWR@subaddcmidruletrim}[2]{% -\setlength{\LWR@templengthone}{\LWR@getexparray{LWR@midrules}{\theLWR@tablecolspos}}% +\setlength{\LWR@templengthone}{\LWR@getexparray{LWR@midrules}{\arabic{LWR@tablecolindex}}}% \ifdimcomp{\LWR@templengthone}{>}{0pt}% {% % \end{macrocode} @@ -16657,8 +16889,8 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% % \begin{macrocode} \newcommand*{\LWR@addcmidruletrim}{% \LWR@subaddcmidruletrim% -{\LWR@getexparray{LWR@trimlrules}{\theLWR@tablecolspos}}% -{\LWR@getexparray{LWR@trimrrules}{\theLWR@tablecolspos}}% +{\LWR@getexparray{LWR@trimlrules}{\arabic{LWR@tablecolindex}}}% +{\LWR@getexparray{LWR@trimrrules}{\arabic{LWR@tablecolindex}}}% } % \end{macrocode} % \end{macro} @@ -16745,7 +16977,7 @@ text-align:#1; vertical-align:#2% % \begin{macrocode} \newcommand*{\LWR@addformatwpalignment}{% \ifbool{FormatWP}{% -\StrChar{\LWR@tablecolspec}{\theLWR@tablecolspos}[\LWR@strresult]% +\StrChar{\LWR@tablecolspec}{\arabic{LWR@tablecolindex}}[\LWR@strresult]% \ifdefstring{\LWR@strresult}{l}{\LWR@WPcell{left}{middle}}{}% \ifdefstring{\LWR@strresult}{c}{\LWR@WPcell{center}{middle}}{}% \ifdefstring{\LWR@strresult}{r}{\LWR@WPcell{right}{middle}}{}% @@ -16774,7 +17006,11 @@ text-align:#1; vertical-align:#2% \newcounter{LWR@tablemulticolspos} % \end{macrocode} - +% Remembers multicolumn vertical rules if found in the column spec. +% \begin{macrocode} +\newbool{LWR@mcolvertbarl} +\newbool{LWR@mcolvertbarr} +% \end{macrocode} % \begin{macro}{\LWR@printmccoltype} \marg{colspec} % Print any valid column type found. Does not print |@|, |!|, |>|, or |<| columns @@ -16787,7 +17023,7 @@ text-align:#1; vertical-align:#2% % \end{macrocode} % Get one token of the column spec: % \begin{macrocode} -\StrChar{#1}{\theLWR@tablemulticolspos}[\LWR@strresult]% +\StrChar{#1}{\arabic{LWR@tablemulticolspos}}[\LWR@strresult]% % \end{macrocode} % Add to the \HTML\ tag depending on which column type is found: % \begin{macrocode} @@ -16802,6 +17038,14 @@ text-align:#1; vertical-align:#2% \IfStrEq{\LWR@strresult}{B}{B}{}% \IfStrEq{\LWR@strresult}{S}{r}{}% \IfStrEq{\LWR@strresult}{X}{p}{}% +% \end{macrocode} +% \changes{v0.43}{2017/11/07}{Added vertical rules.} +% \begin{macrocode} +\IfStrEq{\LWR@strresult}{|}{% + \ifthenelse{\value{LWR@tablemulticolspos}=1}% + {\booltrue{LWR@mcolvertbarl}}% + {\booltrue{LWR@mcolvertbarr}}% +}{}% \LWR@traceinfo{lwr@printmccoltype done}% } % \end{macrocode} @@ -16823,7 +17067,7 @@ text-align:#1; vertical-align:#2% % \begin{macrocode} \newcommand*{\LWR@multicolother}[1]{% \addtocounter{LWR@tablemulticolspos}{1}% -\StrChar{#1}{\theLWR@tablemulticolspos}[\LWR@strresult]% +\StrChar{#1}{\arabic{LWR@tablemulticolspos}}[\LWR@strresult]% \LWR@strresult% % \end{macrocode} % A valid column data type was found: @@ -16863,7 +17107,7 @@ text-align:#1; vertical-align:#2% % \end{macrocode} % Get one token of the column spec: % \begin{macrocode} -\StrChar{#1}{\theLWR@tablemulticolspos}[\LWR@strresult]% +\StrChar{#1}{\arabic{LWR@tablemulticolspos}}[\LWR@strresult]% % \end{macrocode} % Print the text depending on which column type is found. % Also handles |@|, |>|, |<| as it comes to them. @@ -16920,7 +17164,7 @@ text-align:#1; vertical-align:#2% % Scan across the tokens in the column spec: % \begin{macrocode} \whiledo{% -\not\value{LWR@tablemulticolspos}>\value{LWR@tablemulticolswidth}% + \NOT\value{LWR@tablemulticolspos}>\value{LWR@tablemulticolswidth}% }% {% % \end{macrocode} @@ -16945,33 +17189,47 @@ text-align:#1; vertical-align:#2% \newcommand{\LWR@multicoltext}{} % \end{macrocode} +% To find multicolumn right trim: +% \begin{macrocode} +\newcounter{LWR@lastmulticolumn} +% \end{macrocode} + % \begin{macro}{\LWR@domulticolumn} -% \oarg{1: vpos} \oarg{2: \#rows} \marg{3: numcols} \marg{4: colspec} \marg{5: text} +% \oarg{1: vpos} \oarg{2: \#rows} +% \marg{3: numLaTeXcols} \marg{4: numHTMLcols} +% \marg{5: colspec} \marg{6: text} % % \changes{v0.39}{2017/08/30}{Add: Optional \protect\texttt{vpos} and \# rows.} % \changes{v0.41}{2017/09/28}{Add: \cs{cmidrule} trims.} % % \begin{macrocode} -\NewDocumentCommand{\LWR@domulticolumn}{o o m m +m}{% -\LWR@traceinfo{lwr@domulticolumn -#1- -#2- -#3- -#4-}% +\NewDocumentCommand{\LWR@domulticolumn}{o o m m m +m}{% +\LWR@traceinfo{LWR@domulticolumn -#1- -#2- -#4- -#5-}% % \end{macrocode} % Remember the text to be inserted, and % remember that a valid column type was found: % \begin{macrocode} \renewcommand{\LWR@multicoltext}{% -#5% +#6% \booltrue{LWR@validtablecol}% }% % \end{macrocode} +% Compute the rightmost column to be included. +% This is used to create the right trim. +% \changes{v0.43}{2017/11/07}{Fix: Multicolumn trim.} +% \begin{macrocode} +\setcounter{LWR@lastmulticolumn}{\value{LWR@tablecolindex}}% +\addtocounter{LWR@lastmulticolumn}{#3}% +\addtocounter{LWR@lastmulticolumn}{-1}% +% \end{macrocode} % Row processing: % \begin{macrocode} \LWR@maybenewtablerow% -\LWR@tabularleftedge% % \end{macrocode} % Begin the opening table data tag: % \begin{macrocode} -\LWR@htmltag{td colspan="#3" % +\LWR@htmltag{td colspan="#4" % % \end{macrocode} % % \begin{macrocode} @@ -16990,19 +17248,27 @@ rowspan="#2" % % \begin{macrocode} class="td% % \end{macrocode} -% Print the column type: +% Print the column type and vertical bars: % \begin{macrocode} -\LWR@parsemulticolumnalignment{#4}{\LWR@printmccoltype}% +\boolfalse{LWR@mcolvertbarl}% +\boolfalse{LWR@mcolvertbarr}% +\LWR@parsemulticolumnalignment{#5}{\LWR@printmccoltype}% % \end{macrocode} % If this column has a cmidrule, add ``rule'' to the end of the \HTML\ class tag. % -% If this position had a ``Y'' then add ``rule''. +% If this position had a ``Y'' then add ``rule'' for a horizontal rule: +% \changes{v0.43}{2017/11/07}{Fix: Multicolumn trim.} +% \begin{macrocode} +\LWR@subaddcmidruletrim% +{\LWR@getexparray{LWR@trimlrules}{\arabic{LWR@tablecolindex}}}% +{\LWR@getexparray{LWR@trimrrules}{\arabic{LWR@lastmulticolumn}}}% +% \end{macrocode} % Also add vertical bar class. % \changes{v0.41}{2017/10/07}{Added vertical rules.} +% \changes{v0.43}{2017/11/07}{Fix for vertical rules.} % \begin{macrocode} -\LWR@addcmidruletrim% -\LWR@addleftmostbartag% -\LWR@printbartag{\theLWR@tablecolspos}% +\ifbool{LWR@mcolvertbarl}{ tvertbarl}{}% +\ifbool{LWR@mcolvertbarr}{ tvertbarr}{}% % \end{macrocode} % Close the class tag's opening quote: % \begin{macrocode} @@ -17016,7 +17282,7 @@ rowspan="#2" % \LWR@tdendstyles% }% end of the opening table data tag \global\boolfalse{LWR@intabularmetadata}% -\LWR@parsemulticolumnalignment{#4}{\LWR@printmccoldata}% +\LWR@parsemulticolumnalignment{#5}{\LWR@printmccoldata}% } % \end{macrocode} % \end{macro} @@ -17031,16 +17297,16 @@ rowspan="#2" % % \end{macrocode} % Figure out how many extra \HTML\ columns to add for |@| and |!| columns: % \begin{macrocode} -\LWR@tabularhtmlcolumns{\theLWR@tablecolspos}{#1} +\LWR@tabularhtmlcolumns{\arabic{LWR@tablecolindex}}{#1} % \end{macrocode} % Create the multicolumn tag: % \begin{macrocode} -\LWR@domulticolumn{\theLWR@tabhtmlcoltotal}{#2}{#3}% +\LWR@domulticolumn{#1}{\arabic{LWR@tabhtmlcoltotal}}{#2}{#3}% % \end{macrocode} % Move to the next \LaTeX\ column: % \begin{macrocode} -\addtocounter{LWR@tablecolspos}{#1}% -\addtocounter{LWR@tablecolspos}{-1}% +\addtocounter{LWR@tablecolindex}{#1}% +\addtocounter{LWR@tablecolindex}{-1}% % \end{macrocode} % Skip any trailing |@| or |!| columns for this cell: % \begin{macrocode} @@ -17093,11 +17359,12 @@ rowspan="#2" % % Figure out how many extra \HTML\ columns to add for |@| and |!| columns % found between the first and the last column: % \begin{macrocode} -\LWR@tabularhtmlcolumns{1}{\theLWR@tabletotalcols} +\LWR@tabularhtmlcolumns{1}{\arabic{LWR@tabletotalcols}} % \end{macrocode} % Create the multicolumn tag: % \begin{macrocode} -\LWR@domulticolumn{\theLWR@tabhtmlcoltotal}{P}{% \LWR@domulticolumn +\LWR@domulticolumn{\arabic{LWR@tabletotalcols}}{\arabic{LWR@tabhtmlcoltotal}}{P}% +{% \LWR@domulticolumn \IfBooleanTF{#1}% star? % \end{macrocode} % Star version, show a caption but do not make a LOT entry: @@ -17176,8 +17443,8 @@ rowspan="#2" % \booltrue{LWR@skipatbang}% }% end of \LWR@domulticolumn -\addtocounter{LWR@tablecolspos}{\theLWR@tabletotalcols} -\addtocounter{LWR@tablecolspos}{-1} +\addtocounter{LWR@tablecolindex}{\arabic{LWR@tabletotalcols}} +\addtocounter{LWR@tablecolindex}{-1} } % \end{macrocode} @@ -17204,6 +17471,33 @@ rowspan="#2" % \newcounter{LWR@tabhtmlcoltotal} % \end{macrocode} + +% \begin{macro}{\LWR@subtabularhtmlcolumns} \marg{index} +% +% Factored from \cs{LWr@tabularhtmlcolumns}, which follows. +% \begin{macrocode} +\newcommand*{\LWR@subtabularhtmlcolumns}[1]{% +% \end{macrocode} +% Temporarily define a macro equal to the |@| specification for this column: +% \begin{macrocode} + \edef\LWR@atbangspec{\LWR@getexparray{LWR@colatspec}{#1}}% +% \end{macrocode} +% If the |@| specification is not empty, add to the count: +% \begin{macrocode} + \ifdefempty{\LWR@atbangspec}% + {}% + {\addtocounter{LWR@tabhtmlcoltotal}{1}}% +% \end{macrocode} +% Likewise for the |!| columns: +% \begin{macrocode} + \edef\LWR@atbangspec{\LWR@getexparray{LWR@colbangspec}{#1}}% + \ifdefempty{\LWR@atbangspec}% + {}% + {\addtocounter{LWR@tabhtmlcoltotal}{1}}% +} +% \end{macrocode} +% \end{macro} + % \begin{macro}{\LWR@tabularhtmlcolumns} % \marg{starting \LaTeX\ column} \marg{number \LaTeX\ columns} % @@ -17223,31 +17517,16 @@ rowspan="#2" % \setcounter{LWR@tabhtmlcolend}{#1}% \addtocounter{LWR@tabhtmlcolend}{#2}% % \end{macrocode} -% Walk across the \LaTeX\ columns looking for |@| and |!| columns: -% \begin{macrocode} -\whiledo{\value{LWR@tabhtmlcolindex}<\value{LWR@tabhtmlcolend}}{% -% \end{macrocode} -% Temporarily define a macro equal to the |@| specification for this column: -% \begin{macrocode} - \edef\LWR@atbangspec{\LWR@getexparray{LWR@colatspec}% - {\theLWR@tabhtmlcolindex}}% -% \end{macrocode} -% If the |@| specification is not empty, add to the count: -% \begin{macrocode} - \ifdefempty{\LWR@atbangspec}% - {}% - {\addtocounter{LWR@tabhtmlcoltotal}{1}}% -% \end{macrocode} -% Likewise for the |!| columns: +% If at the left edge, add the at/bang columns for the left edge: % \begin{macrocode} - \edef\LWR@atbangspec{\LWR@getexparray{LWR@colbangspec}% - {\theLWR@tabhtmlcolindex}}% - \ifdefempty{\LWR@atbangspec}% - {}% - {\addtocounter{LWR@tabhtmlcoltotal}{1}}% +\ifthenelse{\value{LWR@tabhtmlcolindex}=1}{% + \LWR@subtabularhtmlcolumns{leftedge}% +}{}% % \end{macrocode} -% Move to the next \LaTeX\ column: +% Walk across the \LaTeX\ columns looking for |@| and |!| columns: % \begin{macrocode} +\whiledo{\value{LWR@tabhtmlcolindex}<\value{LWR@tabhtmlcolend}}{% + \LWR@subtabularhtmlcolumns{\arabic{LWR@tabhtmlcolindex}}% \addtocounter{LWR@tabhtmlcolindex}{1}% }% whiledo } @@ -17384,9 +17663,9 @@ rowspan="#2" % % See \cref{sec:limitstabular}. % % \changes{v0.39}{2017/08/29}{Added.} -% +% \changes{v0.43}{2017/11/07}{\cs{newcommand} instead of \cs{relax} to fix \pkg{supertabular} and \pkg{xtab}.} % \begin{macrocode} -\let\TabularMacro\relax +\newcommand*{\TabularMacro}{} % \end{macrocode} % \end{macro} @@ -17488,7 +17767,7 @@ rowspan="#2" % % If exiting the tabular: % \begin{macrocode} \ifdefequal{\LWR@mynexttoken}{\end}% - {\booltrue{LWR@exitingtabular}}{}% + {\global\booltrue{LWR@exitingtabular}}{}% % \end{macrocode} % \env{longtable} can have a caption in a cell % \begin{macrocode} @@ -17650,14 +17929,14 @@ rowspan="#2" % { \newcommand*{\LWR@hline}[1][]{% \ifbool{FormatWP}% - {\LWR@docmidrule{1-\theLWR@tabletotalcols}}% + {\LWR@docmidrule{1-\arabic{LWR@tabletotalcols}}}% {\booltrue{LWR@doinghline}}% \LWR@getmynexttoken}% } { \newcommand*{\LWR@hline}{% \ifbool{FormatWP}% - {\LWR@docmidrule{1-\theLWR@tabletotalcols}}% + {\LWR@docmidrule{1-\arabic{LWR@tabletotalcols}}}% {\booltrue{LWR@doinghline}}% \LWR@getmynexttoken}% } @@ -17731,8 +18010,8 @@ rowspan="#2" % % Have not yet found the end of tabular command. % Unmute the |@| and |!| columns. % \begin{macrocode} -\boolfalse{LWR@exitingtabular}% -\boolfalse{LWR@tabularmutemods}% +\global\boolfalse{LWR@exitingtabular}% +\global\boolfalse{LWR@tabularmutemods}% % \end{macrocode} % Create the |table| tag: % \begin{macrocode} @@ -17750,9 +18029,13 @@ rowspan="#2" % % \begin{macrocode} \LWR@stoppars% % \end{macrocode} -% Track column \# for setting text-align: +% Track column \#: % \begin{macrocode} -\setcounter{LWR@tablecolspos}{1}% +\setcounter{LWR@tablecolindex}{1}% +% \end{macrocode} +% Have not yet added data in this column: +% \begin{macrocode} +\boolfalse{LWR@tabularcelladded}% % \end{macrocode} % Start looking for midrules: % \begin{macrocode} @@ -17780,10 +18063,10 @@ rowspan="#2" % \DeclareDocumentCommand{\toprule}{o d()} {% \IfValueTF{##1}% - {\LWR@docmidrule[##1](){1-\theLWR@tabletotalcols}}% + {\LWR@docmidrule[##1](){1-\arabic{LWR@tabletotalcols}}}% {% \ifbool{FormatWP}% - {\LWR@docmidrule[##1](){1-\theLWR@tabletotalcols}}% + {\LWR@docmidrule[##1](){1-\arabic{LWR@tabletotalcols}}}% {\booltrue{LWR@doingtbrule}}% }% \LWR@getmynexttoken}% @@ -17791,10 +18074,10 @@ rowspan="#2" % \DeclareDocumentCommand{\midrule}{o d()}% {% \IfValueTF{##1}% - {\LWR@docmidrule[##1](){1-\theLWR@tabletotalcols}}% + {\LWR@docmidrule[##1](){1-\arabic{LWR@tabletotalcols}}}% {% \ifbool{FormatWP}% - {\LWR@docmidrule[##1](){1-\theLWR@tabletotalcols}}% + {\LWR@docmidrule[##1](){1-\arabic{LWR@tabletotalcols}}}% {\booltrue{LWR@doinghline}}% }% \LWR@getmynexttoken}% @@ -17805,10 +18088,10 @@ rowspan="#2" % \DeclareDocumentCommand{\bottomrule}{o d()} {% \IfValueTF{##1}% - {\LWR@docmidrule[##1](){1-\theLWR@tabletotalcols}}% + {\LWR@docmidrule[##1](){1-\arabic{LWR@tabletotalcols}}}% {% \ifbool{FormatWP}% - {\LWR@docmidrule[##1](){1-\theLWR@tabletotalcols}}% + {\LWR@docmidrule[##1](){1-\arabic{LWR@tabletotalcols}}}% {\booltrue{LWR@doingtbrule}}% }% \LWR@getmynexttoken}% @@ -17816,7 +18099,7 @@ rowspan="#2" % \DeclareDocumentCommand{\addlinespace}{o}{}% \DeclareDocumentCommand{\morecmidrules}{}{}% \DeclareDocumentCommand{\specialrule}{m m m d()}% - {\LWR@docmidrule[##1](){1-\theLWR@tabletotalcols}\LWR@getmynexttoken}% + {\LWR@docmidrule[##1](){1-\arabic{LWR@tabletotalcols}}\LWR@getmynexttoken}% % \end{macrocode} % The following create data cells and will have no more data in this cell, % so we do not want to look ahead for a possible data cell, @@ -17830,7 +18113,6 @@ rowspan="#2" % }% \renewcommand*{\mcolrowcell}{% \LWR@maybenewtablerow% - \LWR@tabularleftedge% \global\booltrue{LWR@skippingmcolrowcell}% }% \LetLtxMacro{\caption}{\LWR@longtabledatacaptiontag}% @@ -17858,7 +18140,14 @@ rowspan="#2" % % \begin{macrocode} {% \LWR@traceinfo{LWR@tabular ending}% -\ifthenelse{\value{LWR@tablecolspos}<\value{LWR@tablecolswidth}}{% +\ifthenelse{% + \(% + \boolean{LWR@intabularmetadata} \AND% + \NOT\boolean{LWR@tabularcelladded} \AND% + \cnttest{\value{LWR@tablecolindex}}{=}{\value{LWR@tabletotalcols}}% + \) \OR% + \cnttest{\value{LWR@tablecolindex}}{<}{\value{LWR@tabletotalcols}}% +}{% \LWR@tabularfinishrow% }% {% @@ -18056,7 +18345,7 @@ rowspan="#2" % % Define a new property which has either a filename or a file number: % \begin{macrocode} \zref@newprop{zLWR@htmlfilenumber}{% -\ifbool{FileSectionNames}{\LWR@thisfilename}{\theLWR@htmlfilenumber}% +\ifbool{FileSectionNames}{\LWR@thisfilename}{\arabic{LWR@htmlfilenumber}}% }% % \end{macrocode} % Additional properties for lateximages: @@ -18188,7 +18477,7 @@ rowspan="#2" % % \begin{macrocode} \LWR@traceinfo{LWR@newlabel: filesectionnames is \ifbool{FileSectionNames}{true}{false}}% \LWR@traceinfo{LWR@newlabel: LWR@thisfilename is !\LWR@thisfilename!}% -\LWR@traceinfo{LWR@newlabel: LWR@htmlfilenumber is \theLWR@htmlfilenumber}% +\LWR@traceinfo{LWR@newlabel: LWR@htmlfilenumber is \arabic{LWR@htmlfilenumber}}% \LWR@splabel{#1}% \LWR@subsublabel{#1}% % \@esphack% @@ -18324,8 +18613,10 @@ rowspan="#2" % % \begin{macro}{\nameref} \marg{label} +% +% \changes{v0.43}{2017/10/31}{Made robust.} % \begin{macrocode} -\newcommand*{\nameref}[1]{% +\DeclareRobustCommand*{\nameref}[1]{% \LWR@traceinfo{nameref A}% \LWR@startref{#1}% \LWR@traceinfo{nameref B}% @@ -18396,6 +18687,8 @@ class="#3"\LWR@orignewline}#2\LWR@htmltag{/a}% % \begin{macro}{\href} \oarg{options} \marg{URL} \marg{text} % % Create a link with accompanying text: +% +% \changes{v0.43}{2017/10/31}{Made robust.} % \begin{macrocode} \NewDocumentCommand{\LWR@hrefb}{O{} m +m}{% \LWR@subhyperref{#2}{#3}% @@ -18403,7 +18696,7 @@ class="#3"\LWR@orignewline}#2\LWR@htmltag{/a}% \LWR@ensuredoingapar% } -\newcommand{\href}{% +\DeclareRobustCommand*{\href}{% \LWR@ensuredoingapar% \begingroup% \catcode`\_=12 @@ -18415,10 +18708,11 @@ class="#3"\LWR@orignewline}#2\LWR@htmltag{/a}% % \begin{macro}{\nolinkurl} \marg{URL} % % Print the name of the link without creating the link: +% \changes{v0.43}{2017/10/31}{Made robust.} % \begin{macrocode} \newcommand*{\LWR@nolinkurlb}[1]{#1\endgroup\LWR@ensuredoingapar} -\newcommand{\nolinkurl}{% +\DeclareRobustCommand*{\nolinkurl}{% \LWR@ensuredoingapar% \begingroup\catcode`\_=12 \LWR@nolinkurlb% @@ -18432,6 +18726,8 @@ class="#3"\LWR@orignewline}#2\LWR@htmltag{/a}% % Create a link whose text name is the address of the link. % The \pkg{url} package may redefine \cs{url}, so it is \cs{let} to \cs{LWR@urla}here % and also redefined by \pkg{lwarp-url}. +% +% \changes{v0.43}{2017/10/31}{Made robust.} % \begin{macrocode} \newcommand*{\LWR@urlb}[1]{% \href{#1}{#1}% @@ -18439,7 +18735,7 @@ class="#3"\LWR@orignewline}#2\LWR@htmltag{/a}% \LWR@ensuredoingapar% } -\newcommand{\LWR@urla}{% +\DeclareRobustCommand*{\LWR@urla}{% \LWR@ensuredoingapar% \begingroup\catcode`\_=12 \LWR@urlb% @@ -19485,12 +19781,15 @@ class="#3"\LWR@orignewline}#2\LWR@htmltag{/a}% % \changes{v0.40}{2017/09/09}{Improved symbols inside a \env{lateximage}.} % \changes{v0.40}{2017/09/09}{Improved \protect\LaTeX\ logos inside a \env{lateximage}.} % \changes{v0.40}{2017/09/09}{Nullified \cs{InlineClass}, etc. inside a \env{lateximage}.} -% \changes{v0.42}{2017/10/16}{Improved \cs{ensuremath}.} % % \begin{macrocode} \newcommand*{\LWR@restoreorigformatting}{% \LWR@traceinfo{LWR@restoreorigformatting}% \linespread{1}% +% \end{macrocode} +% \changes{v0.43}{2017/10/31}{Fix: \cs{ref} in math or lateximage.} +% \begin{macrocode} +\LetLtxMacro\ref\LWR@origref%{} syntax highlighting \RenewDocumentCommand{\InlineClass}{o m +m}{##3}% \RenewDocumentEnvironment{BlockClass}{o m}{}{}% \renewcommand{\BlockClassSingle}[2]{##2}% @@ -19562,7 +19861,15 @@ class="#3"\LWR@orignewline}#2\LWR@htmltag{/a}% \let\LaTeX\LWR@origLaTeX% \let\LaTeXe\LWR@origLaTeXe% \renewcommand*{\Xe}{X\textsubscript{E}}% +% \end{macrocode} +% \changes{v0.42}{2017/10/16}{Improved \cs{ensuremath}.} +% \begin{macrocode} \LetLtxMacro\@ensuredmath\LWR@origensuredmath% +% \end{macrocode} +% \changes{v0.43}{2017/10/31}{Fix: Improved math inside lateximages.} +% \begin{macrocode} +\csletcs{equation*}{LWR@origequationstar}% +\csletcs{endequation*}{LWR@origendequationstar}% % \LWR@restoreorigaccents% % @@ -19652,7 +19959,7 @@ class="#3"\LWR@orignewline}#2\LWR@htmltag{/a}% % % Redefine the double dollar sign to place math inside a \env{lateximage}, or use MathJax: % \begin{macrocode} -\gdef\LWR@doubledollar$#1$${ +\protected\gdef\LWR@doubledollar$#1$${ % \end{macrocode} % If MathJax or formatting for a word processor, print the \LaTeX\ expression: % \changes{v0.42}{2017/10/26}{If \protect\texttt{FormatWP} print LaTeX expression.} @@ -19693,7 +20000,7 @@ class="#3"\LWR@orignewline}#2\LWR@htmltag{/a}% % % \changes{v0.42}{2017/10/26}{If \protect\texttt{FormatWP} print LaTeX expression.} % \begin{macrocode} -\gdef\LWR@subsingledollar#1{% +\protected\gdef\LWR@subsingledollar#1{% \ifboolexpr{bool{mathjax} or ( bool{FormatWP} and bool{WPMarkMath} ) }% % \end{macrocode} % For MathJax, print the math between |\(| and |\)|: @@ -19712,7 +20019,7 @@ class="#3"\LWR@orignewline}#2\LWR@htmltag{/a}% }% } -\gdef\LWR@singledollar#1${% +\protected\gdef\LWR@singledollar#1${% \LWR@subsingledollar{#1}% } % \end{macrocode} @@ -19723,8 +20030,9 @@ class="#3"\LWR@orignewline}#2\LWR@htmltag{/a}% % \begin{macro}{\)} % Redefine to the above dollar macros. % \begin{macrocode} -\gdef\(#1\){$#1$} -\gdef\[#1\]{$$#1$$} +\protected\gdef\(#1\){% +$#1$} +\protected\gdef\[#1\]{$$#1$$} \endgroup @@ -20002,6 +20310,18 @@ class="#3"\LWR@orignewline}#2\LWR@htmltag{/a}% % \end{environment} +% \begin{environment}{equation*} +% \begin{macrocode} +\csletcs{LWR@origequationstar}{equation*} +\csletcs{LWR@origendequationstar}{endequation*} +\renewenvironment*{equation*} +{\displaymath} +{\enddisplaymath} +% \end{macrocode} +% \end{environment} + + + % \subsection{AMS Math environments} % \changes{v0.19}{2016/05/25}{MathJax support added.} @@ -20853,7 +21173,7 @@ class="#3"\LWR@orignewline}#2\LWR@htmltag{/a}% % \end{macrocode} % Figure out what the next page number will be: % \begin{macrocode} - \setcounterpageref{LWR@LIpage}{LWRlateximage\theLWR@lateximagenumber}% + \setcounterpageref{LWR@LIpage}{LWRlateximage\arabic{LWR@lateximagenumber}}% \LWR@traceinfo{lateximage: LWR@LIpage is \arabic{LWR@LIpage}}% % \end{macrocode} % Create an \HTML\ span which will hold the comment which contains the |pdftotext| translation @@ -21496,14 +21816,17 @@ class="#3"\LWR@orignewline}#2\LWR@htmltag{/a}% % These will be further encased and patched by other packages later. % % \begin{macrocode} -\let\LWR@origlabel\label -\let\label\LWR@newlabel -\let\LWR@origref\ref -\let\ref\LWR@newref% \end{ syntax highlighting -\let\LWR@origpageref\pageref -\let\pageref\LWR@newpageref +\LetLtxMacro\LWR@origlabel\label +% \LetLtxMacro\label\LWR@newlabel +\RenewDocumentCommand{\label}{}{\LWR@newlabel} +\LetLtxMacro\LWR@origref\ref +% \LetLtxMacro\ref\LWR@newref +\RenewDocumentCommand{\ref}{}{\LWR@newref}% +\LetLtxMacro\LWR@origpageref\pageref +% \LetLtxMacro\pageref\LWR@newpageref +\RenewDocumentCommand{\pageref}{}{\LWR@newpageref} \end{warpHTML} % \end{macrocode} @@ -22335,6 +22658,7 @@ width:\rndprintlength{\LWR@tempwidth}% % \changes{v0.34}{2017/08/05}{Improved font control.} % \changes{v0.36}{2017/08/15}{Fix: Filenames while using MathJax.} % \changes{v0.40}{2017/09/21}{Fix: Long arguments for expandable command.} +% \changes{v0.43}{2017/10/31}{Fix: Nullify dollar inside filesnames.} % \begin{macrocode} \newcommand*{\LWR@nullfonts}{% \LetLtxMacro{\emph}{\LWR@nullemph}% @@ -22371,6 +22695,7 @@ width:\rndprintlength{\LWR@tempwidth}% \RenewDocumentCommand{\LWR@htmlspanclass}{o m +m}{##3}% \DeclareExpandableDocumentCommand{\InlineClass}{+o +m +m}{##3}% \DeclareRobustCommand{\LWR@HTMLtextstyle}[3]{##3}% +\DeclareRobustCommand{\LWR@subsingledollar}[1]{}% } % \end{macrocode} % \end{macro} @@ -24374,6 +24699,49 @@ span style="width:\rndprintlength{\ALG@thistlm}; display:inline-block;"% % % % +% \iffalse +%<*breakurl> +% \fi +% +% \part{lwarp-breakurl.sty} +% +% \section{breakurl} +% +% \DescribePackage{breakurl} +% \pkg{breakurl} is emulated. +% +% \changes{v0.43}{2017/10/31}{\pkg{breakurl}: Added.} +% +% \codehtml +% +% \begin{macrocode} +\LWR@ProvidesPackageDrop{breakurl} +% \end{macrocode} +% +% \begin{macrocode} +\LetLtxMacro\burl\url + +\NewDocumentCommand{\LWR@burlaltb}{O{} +m m}{% +\LWR@subhyperref{#3}{#2}% order reversed from \href +\endgroup% +\LWR@ensuredoingapar% +} + +\DeclareRobustCommand*{\burlalt}{% +\LWR@ensuredoingapar% +\begingroup% +\catcode`\_=12 +\LWR@burlaltb% +} +\LetLtxMacro\urlalt\burlalt +% \end{macrocode} +% +% \iffalse +% +% \fi +% +% +% % % % \iffalse @@ -27879,6 +28247,8 @@ img src="\LWR@parsedfilename" \LWR@orignewline% % \begin{noindmacro}{\hyperimage} \marg{url} \marg{alt text} % % Insert an image with alt text: +% +% \changes{v0.43}{2017/10/31}{\pkg{hyperref}: Made robust.} % \begin{macrocode} \NewDocumentCommand{\LWR@hyperimageb}{m +m}{% \LWR@htmltag{img src="#1" alt="#2" class="hyperimage"{}}% @@ -27886,7 +28256,7 @@ img src="\LWR@parsedfilename" \LWR@orignewline% \LWR@ensuredoingapar% } -\newcommand{\hyperimage}{% +\DeclareRobustCommand*{\hyperimage}{% \LWR@ensuredoingapar% \begingroup\catcode`\_=12 \LWR@hyperimageb% @@ -27941,8 +28311,9 @@ img src="\LWR@parsedfilename" \LWR@orignewline% % \marg{1: URL} \marg{2: category} \marg{3: name} \marg{4: text} \quad ---\,or\,--- \\ % \oarg{1: label} \marg{2: text} % +% \changes{v0.43}{2017/10/31}{\pkg{hyperref}: Made robust.} % \begin{macrocode} -\newcommand{\hyperref}{% +\DeclareRobustCommand*{\hyperref}{% \LWR@ensuredoingapar% \begingroup\catcode`\_=12 \@ifnextchar[\LWR@hyperrefc\LWR@hyperrefb% @@ -28071,9 +28442,10 @@ img src="\LWR@parsedfilename" \LWR@orignewline% % \begin{noindmacro}{\TextField} \oarg{parameters} \marg{label} +% \changes{v0.43}{2017/10/31}{\pkg{hyperref}: Made robust.} % % \begin{macrocode} -\newcommand*{\TextField}[2][]{} +\DeclareRobustCommand{\TextField}[2][]{} % \end{macrocode} % \end{noindmacro} @@ -28081,7 +28453,7 @@ img src="\LWR@parsedfilename" \LWR@orignewline% % \begin{noindmacro}{\CheckBox} \oarg{parameters} \marg{label} % % \begin{macrocode} -\newcommand*{\CheckBox}[2][]{} +\DeclareRobustCommand{\CheckBox}[2][]{} % \end{macrocode} % \end{noindmacro} @@ -28089,7 +28461,7 @@ img src="\LWR@parsedfilename" \LWR@orignewline% % \begin{noindmacro}{\ChoiceMenu} \oarg{parameters} \marg{label} \marg{choices} % % \begin{macrocode} -\newcommand{\ChoiceMenu}[3][]{} +\DeclareRobustCommand{\ChoiceMenu}[3][]{} % \end{macrocode} % \end{noindmacro} @@ -28097,7 +28469,7 @@ img src="\LWR@parsedfilename" \LWR@orignewline% % \begin{noindmacro}{\PushButton} \oarg{parameters} \marg{label} % % \begin{macrocode} -\newcommand*{\PushButton}[2][]{} +\DeclareRobustCommand{\PushButton}[2][]{} % \end{macrocode} % \end{noindmacro} @@ -28105,7 +28477,7 @@ img src="\LWR@parsedfilename" \LWR@orignewline% % \begin{noindmacro}{\Submit} \oarg{parameters} \marg{label} % % \begin{macrocode} -\newcommand*{\Submit}[2][]{} +\DeclareRobustCommand{\Submit}[2][]{} % \end{macrocode} % \end{noindmacro} @@ -28113,7 +28485,16 @@ img src="\LWR@parsedfilename" \LWR@orignewline% % \begin{noindmacro}{\Reset} \oarg{parameters} \marg{label} % % \begin{macrocode} -\newcommand*{\Reset}[2][]{} +\DeclareRobustCommand{\Reset}[2][]{} +% \end{macrocode} +% \end{noindmacro} + + +% \begin{noindmacro}{\Gauge} \oarg{parameters} \marg{label} +% +% \changes{v0.43}{2017/10/31}{\pkg{hyperref}: \cs{Gauge} added.} +% \begin{macrocode} +\DeclareRobustCommand{\Gauge}[2][]{} % \end{macrocode} % \end{noindmacro} @@ -29086,6 +29467,43 @@ img src="\LWR@parsedfilename" \LWR@orignewline% % % % +% \iffalse +%<*luatodonotes> +% \fi +% +% \part{lwarp-luatodonotes.sty} +% +% \section{luatodonotes} +% +% \DescribePackage{luatodonotes} +% \pkg{luatodonotes} is emulated. +% +% \limitstodonotes +% +% \changes{v0.43}{2017/10/07}{\pkg{luatodonotes}: Added.} +% +% \codehtml +% +% \begin{macrocode} +\LWR@ProvidesPackageDrop{luatodonotes} +% \end{macrocode} +% +% \begin{macrocode} +\newcommand{\listoftodos}[1][]{} +\newcommand{\todo}[2][]{} +\newcommand{\missingfigure}[2][]{} +\newcommand{\todototoc}{} +\newcommand{\todoarea}[3][]{}% +% \end{macrocode} +% +% \iffalse +% +% \fi +% +% +% +% +% % % \iffalse %<*marginfit> @@ -30226,7 +30644,7 @@ class="td% % \end{macrocode} % Append this column's spec: % \begin{macrocode} -\StrChar{\LWR@tablecolspec}{\theLWR@tablecolspos}% +\StrChar{\LWR@tablecolspec}{\arabic{LWR@tablecolindex}}% % \end{macrocode} % If this column has a cmidrule, add ``rule'' to the end of the \HTML\ class tag. % Also add the vertical bar class. @@ -30234,7 +30652,7 @@ class="td% % \begin{macrocode} \LWR@addcmidruletrim% \LWR@addleftmostbartag% -\LWR@printbartag{\theLWR@tablecolspos}% +\LWR@printbartag{\arabic{LWR@tablecolindex}}% "% % \end{macrocode} % \changes{v0.42}{2017/10/26}{\pkg{multirow}: If \protect\texttt{FormatWP} add cell alignment.} @@ -30248,7 +30666,7 @@ class="td% % \changes{v0.41}{2017/10/05}{Fix: \protect\textless\ spec.} % The column's |<| spec: % \begin{macrocode} -\LWR@getexparray{LWR@colbeforespec}{\theLWR@tablecolspos}% +\LWR@getexparray{LWR@colbeforespec}{\arabic{LWR@tablecolindex}}% % \end{macrocode} % While printing the text, redefine |\\| to generate a new line % \begin{macrocode} @@ -30282,18 +30700,19 @@ class="td% % \end{macrocode} % Figure out how many extra \HTML\ columns to add for |@| and |!| columns: % \begin{macrocode} -\LWR@tabularhtmlcolumns{\theLWR@tablecolspos}{#1} +\LWR@tabularhtmlcolumns{\arabic{LWR@tablecolindex}}{#1} % \end{macrocode} % Create the multicolumn/multirow tag: % \begin{macrocode} -\begingroup\LetLtxMacro{\\}{\LWR@endofline}% -\LWR@domulticolumn[#3][#4]{\theLWR@tabhtmlcoltotal}{#2}{#8}% +\begingroup% +\LetLtxMacro{\\}{\LWR@endofline}% +\LWR@domulticolumn[#3][#4]{#1}{\arabic{LWR@tabhtmlcoltotal}}{#2}{#8}% \endgroup% % \end{macrocode} % Move to the next \LaTeX\ column: % \begin{macrocode} -\addtocounter{LWR@tablecolspos}{#1}% -\addtocounter{LWR@tablecolspos}{-1}% +\addtocounter{LWR@tablecolindex}{#1}% +\addtocounter{LWR@tablecolindex}{-1}% % \end{macrocode} % Skip any trailing |@| or |!| columns for this cell: % \begin{macrocode} @@ -35217,6 +35636,40 @@ class="td% % % % +% \iffalse +%<*todonotes> +% \fi +% +% \part{lwarp-todonotes.sty} +% +% \section{todonotes} +% +% \DescribePackage{todonotes} +% \pkg{todonotes} is emulated. +% +% \limitstodonotes +% +% \changes{v0.43}{2017/10/07}{\pkg{todonotes}: Added.} +% +% \codehtml +% +% \begin{macrocode} +\LWR@ProvidesPackageDrop{todonotes} +% \end{macrocode} +% +% \begin{macrocode} +\newcommand{\listoftodos}[1][]{} +\newcommand{\todo}[2][]{} +\newcommand{\missingfigure}[2][]{} +\newcommand{\todototoc}{} +% \end{macrocode} +% +% \iffalse +% +% \fi +% +% +% % % % diff --git a/Master/texmf-dist/source/latex/lwarp/lwarp.ins b/Master/texmf-dist/source/latex/lwarp/lwarp.ins index e8c31efeb6a..1f6dac34b11 100644 --- a/Master/texmf-dist/source/latex/lwarp/lwarp.ins +++ b/Master/texmf-dist/source/latex/lwarp/lwarp.ins @@ -55,6 +55,7 @@ version 2005/12/01 or later. \file{lwarp-booktabs.sty}{\from{lwarp.dtx}{booktabs}} \file{lwarp-boxedminipage.sty}{\from{lwarp.dtx}{boxedminipage}} \file{lwarp-boxedminipage2e.sty}{\from{lwarp.dtx}{boxedminipage2e}} +\file{lwarp-breakurl.sty}{\from{lwarp.dtx}{breakurl}} \file{lwarp-ccaption.sty}{\from{lwarp.dtx}{ccaption}} \file{lwarp-changepage.sty}{\from{lwarp.dtx}{changepage}} \file{lwarp-chngpage.sty}{\from{lwarp.dtx}{chngpage}} @@ -117,6 +118,7 @@ version 2005/12/01 or later. \file{lwarp-longtable.sty}{\from{lwarp.dtx}{longtable}} \file{lwarp-lscape.sty}{\from{lwarp.dtx}{lscape}} \file{lwarp-ltcaption.sty}{\from{lwarp.dtx}{ltcaption}} +\file{lwarp-luatodonotes.sty}{\from{lwarp.dtx}{luatodonotes}} \file{lwarp-marginfit.sty}{\from{lwarp.dtx}{marginfit}} \file{lwarp-marginfix.sty}{\from{lwarp.dtx}{marginfix}} \file{lwarp-marginnote.sty}{\from{lwarp.dtx}{marginnote}} @@ -187,6 +189,7 @@ version 2005/12/01 or later. \file{lwarp-titling.sty}{\from{lwarp.dtx}{titling}} \file{lwarp-tocbibind.sty}{\from{lwarp.dtx}{tocbibind}} \file{lwarp-tocloft.sty}{\from{lwarp.dtx}{tocloft}} +\file{lwarp-todonotes.sty}{\from{lwarp.dtx}{todonotes}} \file{lwarp-transparent.sty}{\from{lwarp.dtx}{transparent}} \file{lwarp-trivfloat.sty}{\from{lwarp.dtx}{trivfloat}} \file{lwarp-typearea.sty}{\from{lwarp.dtx}{typearea}} diff --git a/Master/texmf-dist/tex/latex/lwarp/lwarp-breakurl.sty b/Master/texmf-dist/tex/latex/lwarp/lwarp-breakurl.sty new file mode 100644 index 00000000000..0e2ea60d61a --- /dev/null +++ b/Master/texmf-dist/tex/latex/lwarp/lwarp-breakurl.sty @@ -0,0 +1,36 @@ +%% +%% This is file `lwarp-breakurl.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% lwarp.dtx (with options: `breakurl') +%% This is a generated file. +%% Copyright 2016-2017 Brian Dunn +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +\LWR@ProvidesPackageDrop{breakurl} +\LetLtxMacro\burl\url + +\NewDocumentCommand{\LWR@burlaltb}{O{} +m m}{% +\LWR@subhyperref{#3}{#2}% order reversed from \href +\endgroup% +\LWR@ensuredoingapar% +} + +\DeclareRobustCommand*{\burlalt}{% +\LWR@ensuredoingapar% +\begingroup% +\catcode`\_=12 +\LWR@burlaltb% +} +\LetLtxMacro\urlalt\burlalt +\endinput +%% +%% End of file `lwarp-breakurl.sty'. diff --git a/Master/texmf-dist/tex/latex/lwarp/lwarp-hyperref.sty b/Master/texmf-dist/tex/latex/lwarp/lwarp-hyperref.sty index b9882e5fc06..e59293feab1 100644 --- a/Master/texmf-dist/tex/latex/lwarp/lwarp-hyperref.sty +++ b/Master/texmf-dist/tex/latex/lwarp/lwarp-hyperref.sty @@ -33,7 +33,7 @@ \LWR@ensuredoingapar% } -\newcommand{\hyperimage}{% +\DeclareRobustCommand*{\hyperimage}{% \LWR@ensuredoingapar% \begingroup\catcode`\_=12 \LWR@hyperimageb% @@ -57,7 +57,7 @@ \endgroup% } -\newcommand{\hyperref}{% +\DeclareRobustCommand*{\hyperref}{% \LWR@ensuredoingapar% \begingroup\catcode`\_=12 \@ifnextchar[\LWR@hyperrefc\LWR@hyperrefb% @@ -97,17 +97,19 @@ \newcommand{\Acrobatmenu}[2]{} -\newcommand*{\TextField}[2][]{} +\DeclareRobustCommand{\TextField}[2][]{} -\newcommand*{\CheckBox}[2][]{} +\DeclareRobustCommand{\CheckBox}[2][]{} -\newcommand{\ChoiceMenu}[3][]{} +\DeclareRobustCommand{\ChoiceMenu}[3][]{} -\newcommand*{\PushButton}[2][]{} +\DeclareRobustCommand{\PushButton}[2][]{} -\newcommand*{\Submit}[2][]{} +\DeclareRobustCommand{\Submit}[2][]{} -\newcommand*{\Reset}[2][]{} +\DeclareRobustCommand{\Reset}[2][]{} + +\DeclareRobustCommand{\Gauge}[2][]{} \newcommand*{\LayoutTextField}[2]{} diff --git a/Master/texmf-dist/tex/latex/lwarp/lwarp-luatodonotes.sty b/Master/texmf-dist/tex/latex/lwarp/lwarp-luatodonotes.sty new file mode 100644 index 00000000000..fe717da7589 --- /dev/null +++ b/Master/texmf-dist/tex/latex/lwarp/lwarp-luatodonotes.sty @@ -0,0 +1,26 @@ +%% +%% This is file `lwarp-luatodonotes.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% lwarp.dtx (with options: `luatodonotes') +%% This is a generated file. +%% Copyright 2016-2017 Brian Dunn +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +\LWR@ProvidesPackageDrop{luatodonotes} +\newcommand{\listoftodos}[1][]{} +\newcommand{\todo}[2][]{} +\newcommand{\missingfigure}[2][]{} +\newcommand{\todototoc}{} +\newcommand{\todoarea}[3][]{}% +\endinput +%% +%% End of file `lwarp-luatodonotes.sty'. diff --git a/Master/texmf-dist/tex/latex/lwarp/lwarp-multirow.sty b/Master/texmf-dist/tex/latex/lwarp/lwarp-multirow.sty index 6dcd5d69290..b52c068a6df 100644 --- a/Master/texmf-dist/tex/latex/lwarp/lwarp-multirow.sty +++ b/Master/texmf-dist/tex/latex/lwarp/lwarp-multirow.sty @@ -35,17 +35,17 @@ style="border-\LWR@multirowborder: 2px dotted black ; % padding-\LWR@multirowborder: 2px" % }% class="td% -\StrChar{\LWR@tablecolspec}{\theLWR@tablecolspos}% +\StrChar{\LWR@tablecolspec}{\arabic{LWR@tablecolindex}}% \LWR@addcmidruletrim% \LWR@addleftmostbartag% -\LWR@printbartag{\theLWR@tablecolspos}% +\LWR@printbartag{\arabic{LWR@tablecolindex}}% "% \LWR@tdstartstyles% \LWR@addcmidrulewidth% \LWR@addformatwpalignment% \LWR@tdendstyles% }% -\LWR@getexparray{LWR@colbeforespec}{\theLWR@tablecolspos}% +\LWR@getexparray{LWR@colbeforespec}{\arabic{LWR@tablecolindex}}% \begingroup\LetLtxMacro{\\}{\LWR@endofline}#6\endgroup% \LWR@stoppars% \global\boolfalse{LWR@intabularmetadata}% @@ -53,12 +53,13 @@ class="td% \LWR@traceinfo{*** multirow done}% }% \NewDocumentCommand{\multicolumnrow}{m m O{} m O{} m O{} +m}{% -\LWR@tabularhtmlcolumns{\theLWR@tablecolspos}{#1} -\begingroup\LetLtxMacro{\\}{\LWR@endofline}% -\LWR@domulticolumn[#3][#4]{\theLWR@tabhtmlcoltotal}{#2}{#8}% +\LWR@tabularhtmlcolumns{\arabic{LWR@tablecolindex}}{#1} +\begingroup% +\LetLtxMacro{\\}{\LWR@endofline}% +\LWR@domulticolumn[#3][#4]{#1}{\arabic{LWR@tabhtmlcoltotal}}{#2}{#8}% \endgroup% -\addtocounter{LWR@tablecolspos}{#1}% -\addtocounter{LWR@tablecolspos}{-1}% +\addtocounter{LWR@tablecolindex}{#1}% +\addtocounter{LWR@tablecolindex}{-1}% \booltrue{LWR@skipatbang}% } \appto{\LWR@restoreorigformatting}{% diff --git a/Master/texmf-dist/tex/latex/lwarp/lwarp-todonotes.sty b/Master/texmf-dist/tex/latex/lwarp/lwarp-todonotes.sty new file mode 100644 index 00000000000..5fc3e762dcc --- /dev/null +++ b/Master/texmf-dist/tex/latex/lwarp/lwarp-todonotes.sty @@ -0,0 +1,25 @@ +%% +%% This is file `lwarp-todonotes.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% lwarp.dtx (with options: `todonotes') +%% This is a generated file. +%% Copyright 2016-2017 Brian Dunn +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +\LWR@ProvidesPackageDrop{todonotes} +\newcommand{\listoftodos}[1][]{} +\newcommand{\todo}[2][]{} +\newcommand{\missingfigure}[2][]{} +\newcommand{\todototoc}{} +\endinput +%% +%% End of file `lwarp-todonotes.sty'. diff --git a/Master/texmf-dist/tex/latex/lwarp/lwarp.sty b/Master/texmf-dist/tex/latex/lwarp/lwarp.sty index 333d89cbbad..195c33a9dd0 100644 --- a/Master/texmf-dist/tex/latex/lwarp/lwarp.sty +++ b/Master/texmf-dist/tex/latex/lwarp/lwarp.sty @@ -17,7 +17,7 @@ %% version 2005/12/01 or later. \NeedsTeXFormat{LaTeX2e}[1999/12/01] \ProvidesPackage{lwarp} - [2017/10/30 v0.42 Allows LaTeX to directly produce HTML5 output.] + [2017/11/08 v0.43 Allows LaTeX to directly produce HTML5 output.] @@ -220,6 +220,7 @@ For a possible alternative, see package(s) #2.} \LWR@loadafter{booktabs} \LWR@loadafter{boxedminipage} \LWR@loadafter{boxedminipage2e} +\LWR@loadafter{breakurl} \LWR@loadafter{ccaption} \LWR@loadafter{changepage} \LWR@loadafter{chngpage} @@ -272,6 +273,7 @@ For a possible alternative, see package(s) #2.} \LWR@loadafter{longtable} \LWR@loadafter{lscape} \LWR@loadafter{ltcaption} +\LWR@loadafter{luatodonotes} \LWR@loadafter{marginfit} \LWR@loadafter{marginfix} \LWR@loadafter{marginnote} @@ -335,6 +337,7 @@ For a possible alternative, see package(s) #2.} \LWR@loadafter{titling} \LWR@loadafter{tocbibind} \LWR@loadafter{tocloft} +\LWR@loadafter{todonotes} \LWR@loadafter{transparent} \LWR@loadafter{trivfloat} \LWR@loadafter{typearea} @@ -2603,7 +2606,7 @@ nav.botnavigation { \begin{warpprint} \begin{filecontents*}{sample_project.css} /* ( --- Start of project.css --- ) */ -/* A sample project-specific CSS file for lwarp --- ) */ +/* ( --- A sample project-specific CSS file for lwarp --- ) */ /* Load default lwarp settings: */ @import url("lwarp.css") ; @@ -2739,7 +2742,7 @@ src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX- -- Print the usage of the lwarpmk command: -printversion = "v0.42" +printversion = "v0.43" function printhelp () print ("lwarpmk: Use lwarpmk -h or lwarpmk --help for help.") ; @@ -4076,6 +4079,13 @@ end -- not --version \end{warpall} +\begin{warpall} + +\newcounter{FootnoteDepth} +\setcounter{FootnoteDepth}{5} + +\end{warpall} + \begin{warpHTML} \newbox\LWR@footnotes @@ -4147,8 +4157,12 @@ end -- not --version \end{BlockClass} \fi } -\newcommand*{\LWR@epubprintpendingfootnotes}{% -\ifthenelse{\boolean{FormatEPUB}\OR\boolean{FormatWP}}% +\newcommand*{\LWR@maybeprintpendingfootnotes}[1]{% +\ifboolexpr{ + not test{\ifnumcomp{#1}{>}{\value{FootnoteDepth}}} or + bool{FormatEPUB} or + bool{FormatWP} +}% {\LWR@printpendingfootnotes}% {}% } @@ -4280,7 +4294,7 @@ end -- not --version \ifbool{FileSectionNames}% {\LWR@filenamenoblanks{#1}} -{\renewcommand*{\LWR@thisfilename}{\theLWR@htmlfilenumber}} +{\renewcommand*{\LWR@thisfilename}{\arabic{LWR@htmlfilenumber}}} \LWR@htmlblockcomment{% |Start file|% @@ -4373,6 +4387,7 @@ end -- not --version \def\@seccntformat#1{\csname the#1\endcsname\protect\quad} \newcommand*{\simplechapterdelim}{} \let\@chapcntformat\@seccntformat +\newcounter{LWR@currentautosec} \DeclareDocumentCommand{\LWR@section}{m m m m}{% \LWR@traceinfo{LWR@section |#2| |#3|}% \LWR@traceinfo{LWR@section: not an empty section}% @@ -4395,7 +4410,7 @@ end -- not --version \cnttest{\csuse{LWR@depth#4}}{<=}{\value{LWR@prevFileDepth}}% \)% \AND% - \NOT\equal{#3}{}% phantomsection + \NOT\isempty{#3}% phantomsection }% {% new file \LWR@traceinfo{LWR@section: new HTML file}% @@ -4414,7 +4429,10 @@ end -- not --version }% \ifbool{HTMLDebugComments}{% + \begingroup% + \LWR@nullfonts% \LWR@htmlcomment{Opening #4 ``#3''{}}% + \endgroup% }{}% \ifthenelse{% @@ -4423,6 +4441,7 @@ end -- not --version {\LWR@startpars}% {}% \LWR@createautosec{\csuse{LWR@tag#4}}% +\setcounter{LWR@currentautosec}{\value{page}} \IfBooleanTF{#1}% {% \ifbool{LWR@forcinghtmltoc}% @@ -4479,7 +4498,7 @@ end -- not --version }% end of not starred #3% \LWR@htmltag{\csuse{LWR@tag#4end}}% -\label{autopage-\thepage}% +\label{autopage-\theLWR@currentautosec}% \ifthenelse{% \cnttest{\csuse{LWR@depth#4}}{<}{\LWR@depthparagraph}% }% @@ -4504,7 +4523,7 @@ end -- not --version \DeclareDocumentCommand{\part}{s o m}{% -\LWR@epubprintpendingfootnotes% +\LWR@maybeprintpendingfootnotes{\LWR@depthpart}% \LWR@stoppars% \LWR@startnewdepth{\LWR@depthpart}{\LWR@printclosepart}% @@ -4519,7 +4538,7 @@ end -- not --version {% \DeclareDocumentCommand{\chapter}{s o m}{% \LWR@traceinfo{chapter #3}% -\LWR@epubprintpendingfootnotes% +\LWR@maybeprintpendingfootnotes{\LWR@depthchapter}% \LWR@stoppars% \LWR@startnewdepth{\LWR@depthchapter}{\LWR@printclosechapter}% @@ -4530,7 +4549,7 @@ end -- not --version } \DeclareDocumentCommand{\section}{s o m}{% -\LWR@epubprintpendingfootnotes% +\LWR@maybeprintpendingfootnotes{\LWR@depthsection}% \LWR@stoppars% \LWR@startnewdepth{\LWR@depthsection}{\LWR@printclosesection}% @@ -4539,7 +4558,7 @@ end -- not --version } \DeclareDocumentCommand{\subsection}{s o m}{% -\LWR@epubprintpendingfootnotes% +\LWR@maybeprintpendingfootnotes{\LWR@depthsubsection}% \LWR@stoppars% \LWR@startnewdepth{\LWR@depthsubsection}{\LWR@printclosesubsection}% @@ -4548,7 +4567,7 @@ end -- not --version } \DeclareDocumentCommand{\subsubsection}{s o m}{% -\LWR@epubprintpendingfootnotes% +\LWR@maybeprintpendingfootnotes{\LWR@depthsubsubsection}% \LWR@stoppars% \LWR@startnewdepth{\LWR@depthsubsubsection}% @@ -4558,7 +4577,7 @@ end -- not --version } \DeclareDocumentCommand{\paragraph}{s o m}{% -\LWR@epubprintpendingfootnotes% +\LWR@maybeprintpendingfootnotes{\LWR@depthparagraph}% \LWR@stoppars% \LWR@startnewdepth{\LWR@depthparagraph}{\LWR@printcloseparagraph}% @@ -4567,7 +4586,7 @@ end -- not --version } \DeclareDocumentCommand{\subparagraph}{s o m}{% -\LWR@epubprintpendingfootnotes% +\LWR@maybeprintpendingfootnotes{\LWR@depthsubparagraph}% \LWR@stoppars% \LWR@startnewdepth{\LWR@depthsubparagraph}{\LWR@printclosesubparagraph}% @@ -5198,6 +5217,9 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% \newbool{LWR@startedrow} \boolfalse{LWR@startedrow} +\newbool{LWR@tabularcelladded} +\boolfalse{LWR@tabularcelladded} + \newbool{LWR@doinghline} \boolfalse{LWR@doinghline} @@ -5225,8 +5247,8 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% \ifbool{LWR@skipatbang}% {}% {% - \LWR@printatbang{at}{\theLWR@tablecolspos}% - \LWR@printatbang{bang}{\theLWR@tablecolspos}% + \LWR@printatbang{at}{\arabic{LWR@tablecolindex}}% + \LWR@printatbang{bang}{\arabic{LWR@tablecolindex}}% }% } @@ -5248,10 +5270,11 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% bool{LWR@emptyatbang} }% {}% - {\LWR@getexparray{LWR@colafterspec}{\theLWR@tablecolspos}}% + {\LWR@getexparray{LWR@colafterspec}{\arabic{LWR@tablecolindex}}}% \ifbool{LWR@tableparcell}{\LWR@stoppars}{}% \global\boolfalse{LWR@tableparcell}% \leavevmode\unskip\LWR@htmltag{/td}\LWR@orignewline% + \global\booltrue{LWR@tabularcelladded}% \LWR@insertatbangcols% }% not skipping mrowcell }% not exiting tabular @@ -5285,7 +5308,8 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% {% \unskip% \LWR@closetabledatacell% - \addtocounter{LWR@tablecolspos}{1}% + \addtocounter{LWR@tablecolindex}{1}% +\boolfalse{LWR@tabularcelladded}% \LWR@getmynexttoken% }% {\LWR@origampmacro}% @@ -5304,15 +5328,26 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% \ifbool{LWR@exitingtabular}{% \booltrue{LWR@tabularmutemods}% }{}% -\boolfalse{LWR@exitingtabular}% -\whiledo{\value{LWR@tablecolspos}<\value{LWR@tabletotalcols}}{% -\LWR@tabledatasinglecolumntag% +\global\boolfalse{LWR@exitingtabular}% +\whiledo{% + \(% + \boolean{LWR@intabularmetadata} \AND% + \NOT\boolean{LWR@tabularcelladded} \AND% + \cnttest{\value{LWR@tablecolindex}}{=}{\value{LWR@tabletotalcols}}% + \) \OR% + \cnttest{\value{LWR@tablecolindex}}{<}{\value{LWR@tabletotalcols}}% +}{% + \LWR@tabledatasinglecolumntag% \LWR@closetabledatacell% - \addtocounter{LWR@tablecolspos}{1}% + \addtocounter{LWR@tablecolindex}{1}% + \boolfalse{LWR@tabularcelladded}% \global\booltrue{LWR@emptyatbang}% - \LWR@getmynexttoken% + \ifthenelse{% + \cnttest{\value{LWR@tablecolindex}}{<}{\value{LWR@tabletotalcols}}% + }% + {\LWR@getmynexttoken}% + {}% }% -\LWR@closetabledatacell% \endgroup% \global\boolfalse{LWR@emptyatbang}% }{}% ifboolexpr @@ -5321,7 +5356,7 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% \NewDocumentCommand{\LWR@tabularendofline}{s o} {% -\ifthenelse{\value{LWR@tablecolspos}<\value{LWR@tabletotalcols}}{% +\ifthenelse{\value{LWR@tablecolindex}<\value{LWR@tabletotalcols}}{% \LWR@tabularfinishrow% }% {% @@ -5334,7 +5369,8 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% \global\boolfalse{LWR@doingtbrule}% \global\boolfalse{LWR@doingcmidrule}% \LWR@clearmidrules% -\setcounter{LWR@tablecolspos}{1} +\setcounter{LWR@tablecolindex}{1}% +\boolfalse{LWR@tabularcelladded}% \LWR@getmynexttoken% } @@ -5351,9 +5387,11 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% \newcommand*{\LWR@origcolspec}{} -\newcounter{LWR@tablecolswidth} +\newcounter{LWR@tablecolspecwidth} + +\newcounter{LWR@tablecolspecindex} -\newcounter{LWR@tablecolspos} +\newcounter{LWR@tablecolindex} \newcounter{LWR@tabletotalcols} @@ -5363,10 +5401,10 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% \newcommand*{\LWR@colparameter}{} \newcommand*{\LWR@parseatcolumn}{% \LWR@traceinfo{at column}% -\addtocounter{LWR@tablecolspos}{1}% +\addtocounter{LWR@tablecolspecindex}{1}% \LWR@traceinfo{about to read the next token:}% \expandarg% -\StrChar{\LWR@origcolspec}{\theLWR@tablecolspos}[\LWR@colparameter] +\StrChar{\LWR@origcolspec}{\arabic{LWR@tablecolspecindex}}[\LWR@colparameter] \fullexpandarg% \LWR@traceinfo{have now read the next token}% \ifthenelse{\cnttest{\value{LWR@tabletotalcols}}=0} @@ -5378,19 +5416,19 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% }% {% not at the left edge: \LWR@traceinfo{not at the left edge}% - \LWR@setexparray{LWR@colatspec}{\theLWR@tabletotalcols}{\LWR@colparameter}% - \LWR@traceinfo{at \theLWR@tabletotalcols: % - \LWR@getexparray{LWR@colatspec}{\theLWR@tabletotalcols}}% + \LWR@setexparray{LWR@colatspec}{\arabic{LWR@tabletotalcols}}{\LWR@colparameter}% + \LWR@traceinfo{at \arabic{LWR@tabletotalcols}: % + \LWR@getexparray{LWR@colatspec}{\arabic{LWR@tabletotalcols}}}% }% \let\LWR@colparameter\relax% \booltrue{LWR@validtablecol}% } \newcommand*{\LWR@parsebangcolumn}{% \LWR@traceinfo{bang column}% -\addtocounter{LWR@tablecolspos}{1}% +\addtocounter{LWR@tablecolspecindex}{1}% \LWR@traceinfo{about to read the next token:}% \expandarg% -\StrChar{\LWR@origcolspec}{\theLWR@tablecolspos}[\LWR@colparameter] +\StrChar{\LWR@origcolspec}{\arabic{LWR@tablecolspecindex}}[\LWR@colparameter] \fullexpandarg% \LWR@traceinfo{have now read the next token}% \ifthenelse{\cnttest{\value{LWR@tabletotalcols}}=0} @@ -5400,27 +5438,27 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% }% {% not at the left edge: \LWR@traceinfo{not at the left edge}% - \LWR@setexparray{LWR@colbangspec}{\theLWR@tabletotalcols}{\LWR@colparameter}% - \LWR@traceinfo{bang \theLWR@tabletotalcols: \LWR@colparameter!}% + \LWR@setexparray{LWR@colbangspec}{\arabic{LWR@tabletotalcols}}{\LWR@colparameter}% + \LWR@traceinfo{bang \arabic{LWR@tabletotalcols}: \LWR@colparameter!}% }% \let\LWR@colparameter\relax% \booltrue{LWR@validtablecol}% } \newcommand*{\LWR@parsebeforecolumn}{% -\addtocounter{LWR@tablecolspos}{1}% +\addtocounter{LWR@tablecolspecindex}{1}% \expandarg% -\StrChar{\LWR@origcolspec}{\theLWR@tablecolspos}[\LWR@colparameter]% +\StrChar{\LWR@origcolspec}{\arabic{LWR@tablecolspecindex}}[\LWR@colparameter]% \fullexpandarg% -\LWR@setexparray{LWR@colbeforespec}{\theLWR@tabletotalcolsnext}{\LWR@colparameter}% +\LWR@setexparray{LWR@colbeforespec}{\arabic{LWR@tabletotalcolsnext}}{\LWR@colparameter}% \let\LWR@colparameter\relax% \booltrue{LWR@validtablecol}% } \newcommand*{\LWR@parseaftercolumn}{% -\addtocounter{LWR@tablecolspos}{1}% +\addtocounter{LWR@tablecolspecindex}{1}% \expandarg% -\StrChar{\LWR@origcolspec}{\theLWR@tablecolspos}[\LWR@colparameter]% +\StrChar{\LWR@origcolspec}{\arabic{LWR@tablecolspecindex}}[\LWR@colparameter]% \fullexpandarg% -\LWR@setexparray{LWR@colafterspec}{\theLWR@tabletotalcols}{\LWR@colparameter}% +\LWR@setexparray{LWR@colafterspec}{\arabic{LWR@tabletotalcols}}{\LWR@colparameter}% \let\LWR@colparameter\relax% \booltrue{LWR@validtablecol}% } @@ -5431,7 +5469,7 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% \LWR@setexparray{LWR@colbarspec}{leftedge}{tvertbarl}% }% {% not at the left edge: - \LWR@setexparray{LWR@colbarspec}{\theLWR@tabletotalcols}{tvertbarr}% + \LWR@setexparray{LWR@colbarspec}{\arabic{LWR@tabletotalcols}}{tvertbarr}% }% \booltrue{LWR@validtablecol}% } @@ -5439,23 +5477,23 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% \appto\LWR@tablecolspec{#1}% \addtocounter{LWR@tabletotalcols}{1}% \addtocounter{LWR@tabletotalcolsnext}{1}% -\LWR@traceinfo{normal column \theLWR@tabletotalcols: #1}% -\LWR@setexparray{LWR@colatspec}{\theLWR@tabletotalcolsnext}{}% -\LWR@setexparray{LWR@colbangspec}{\theLWR@tabletotalcolsnext}{}% -\LWR@setexparray{LWR@colbeforespec}{\theLWR@tabletotalcolsnext}{}% -\LWR@setexparray{LWR@colafterspec}{\theLWR@tabletotalcolsnext}{}% -\LWR@setexparray{LWR@colbarspec}{\theLWR@tabletotalcolsnext}{}% +\LWR@traceinfo{normal column \arabic{LWR@tabletotalcols}: #1}% +\LWR@setexparray{LWR@colatspec}{\arabic{LWR@tabletotalcolsnext}}{}% +\LWR@setexparray{LWR@colbangspec}{\arabic{LWR@tabletotalcolsnext}}{}% +\LWR@setexparray{LWR@colbeforespec}{\arabic{LWR@tabletotalcolsnext}}{}% +\LWR@setexparray{LWR@colafterspec}{\arabic{LWR@tabletotalcolsnext}}{}% +\LWR@setexparray{LWR@colbarspec}{\arabic{LWR@tabletotalcolsnext}}{}% \booltrue{LWR@validtablecol}% } \newcommand*{\LWR@parsepcolumn}[1]{% \LWR@parsenormalcolumn{#1}% -\addtocounter{LWR@tablecolspos}{1}% +\addtocounter{LWR@tablecolspecindex}{1}% } \newcommand*{\LWR@parseDcolumn}[1]{% \LWR@parsenormalcolumn{#1}% -\addtocounter{LWR@tablecolspos}{3}% +\addtocounter{LWR@tablecolspecindex}{3}% } @@ -5463,6 +5501,8 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% \newcommand*{\LWR@parsetablecols}[1]{% \LWR@traceinfo{LWR@parsetablecols started}% \renewcommand*{\LWR@origcolspec}{#1}% +\expandarg% +\StrSubstitute{\LWR@origcolspec}{ }{}[\LWR@origcolspec]% \renewcommand*{\LWR@tablecolspec}{}% \setcounter{LWR@tabletotalcols}{0}% \setcounter{LWR@tabletotalcolsnext}{1}% @@ -5484,17 +5524,17 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% \LWR@setexparray{LWR@colbarspec}{1}{}% \LWR@setexparray{LWR@colbarspec}{2}{}% \LWR@setexparray{LWR@colbarspec}{3}{}% -\setcounter{LWR@tablecolspos}{1}% +\setcounter{LWR@tablecolspecindex}{1}% \LWR@traceinfo{about to StrLen}% -\noexpandarg% -\StrLen{#1}[\LWR@strresult]% +\expandarg% +\StrLen{\LWR@origcolspec}[\LWR@strresult]% \fullexpandarg% \LWR@traceinfo{finished StrLen}% -\setcounter{LWR@tablecolswidth}{\LWR@strresult}% -\whiledo{\not\value{LWR@tablecolspos}>\value{LWR@tablecolswidth}}{% -\noexpandarg% -\StrChar{#1}{\theLWR@tablecolspos}[\LWR@strresult]% -\LWR@traceinfo{position \arabic{LWR@tablecolspos}: \LWR@strresult}% +\setcounter{LWR@tablecolspecwidth}{\LWR@strresult}% +\whiledo{\not\value{LWR@tablecolspecindex}>\value{LWR@tablecolspecwidth}}{% +\expandarg% +\StrChar{\LWR@origcolspec}{\arabic{LWR@tablecolspecindex}}[\LWR@strresult]% +\LWR@traceinfo{position \arabic{LWR@tablecolspecindex}: \LWR@strresult}% \fullexpandarg% \boolfalse{LWR@validtablecol}% \IfStrEq{\LWR@strresult}{l}{\LWR@parsenormalcolumn{l}}{}% @@ -5522,8 +5562,8 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% \LWR@traceinfo{invalid column type: \LWR@strresult}% \LWR@parsenormalcolumn{l}% }% -\addtocounter{LWR@tablecolspos}{1}% -}% +\addtocounter{LWR@tablecolspecindex}{1}% +}% whiledo }% @@ -5580,17 +5620,18 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% {}% {\LWR@atbangspec}% \LWR@htmltag{/td}\LWR@orignewline% + \global\booltrue{LWR@tabularcelladded}% }% not empty }% \newcommand*{\LWR@addleftmostbartag}{% -\ifnumcomp{\value{LWR@tablecolspos}}{=}{1}{% +\ifnumcomp{\value{LWR@tablecolindex}}{=}{1}{% \LWR@printbartag{leftedge}% }{}% } \newcommand*{\LWR@tabularleftedge}{% -\ifthenelse{\cnttest{\value{LWR@tablecolspos}}=1}% +\ifthenelse{\cnttest{\value{LWR@tablecolindex}}=1}% {% \LWR@printatbang{at}{leftedge}% \LWR@printatbang{bang}{leftedge}% @@ -5607,12 +5648,12 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% \ifbool{LWR@exitingtabular}{}% {% not exiting tabular \LWR@tabularleftedge% - \StrChar{\LWR@tablecolspec}{\theLWR@tablecolspos}[\LWR@strresult]% + \StrChar{\LWR@tablecolspec}{\arabic{LWR@tablecolindex}}[\LWR@strresult]% \LWR@htmltag{td class="td% \LWR@strresult% \LWR@addcmidruletrim% \LWR@addleftmostbartag% - \LWR@printbartag{\theLWR@tablecolspos}% + \LWR@printbartag{\arabic{LWR@tablecolindex}}% "% \LWR@tdstartstyles% \LWR@addcmidrulewidth% @@ -5635,7 +5676,9 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% {}% no pars \ifboolexpr{bool{LWR@tabularmutemods} or bool{LWR@emptyatbang}}% {}% - {\LWR@getexparray{LWR@colbeforespec}{\theLWR@tablecolspos}}% + {% + \LWR@getexparray{LWR@colbeforespec}{\arabic{LWR@tablecolindex}}% + }% \global\boolfalse{LWR@intabularmetadata}% }% not exiting tabular }{}% in tabular metadata @@ -5662,13 +5705,13 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% {% \setcounter{LWR@midrulecounter}{1}% \whiledo{% -\cnttest{\value{LWR@midrulecounter}}{<=}{\value{LWR@tablecolswidth}}% +\cnttest{\value{LWR@midrulecounter}}{<=}{\value{LWR@tablecolspecwidth}}% }% {% -\LWR@setexparray{LWR@midrules}{\theLWR@midrulecounter}{0pt}% +\LWR@setexparray{LWR@midrules}{\arabic{LWR@midrulecounter}}{0pt}% \setlength{\LWR@thiscmidrulewidth}{\LWR@cmidrulewidth}% -\LWR@setexparray{LWR@trimlrules}{\theLWR@midrulecounter}{}% -\LWR@setexparray{LWR@trimrrules}{\theLWR@midrulecounter}{}% +\LWR@setexparray{LWR@trimlrules}{\arabic{LWR@midrulecounter}}{}% +\LWR@setexparray{LWR@trimrrules}{\arabic{LWR@midrulecounter}}{}% \addtocounter{LWR@midrulecounter}{1}% }% } @@ -5677,7 +5720,7 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% \setcounter{LWR@midrulecounter}{#3}% \whiledo{\cnttest{\value{LWR@midrulecounter}}{<=}{#4}}% {% -\LWR@setexparray{LWR@midrules}{\theLWR@midrulecounter}{#1}% +\LWR@setexparray{LWR@midrules}{\arabic{LWR@midrulecounter}}{#1}% \addtocounter{LWR@midrulecounter}{1}% }% whiledo \IfSubStr{#2}{l}{\LWR@setexparray{LWR@trimlrules}{#3}{l}}{}% @@ -5710,7 +5753,7 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% } \newcommand*{\LWR@subaddcmidruletrim}[2]{% -\setlength{\LWR@templengthone}{\LWR@getexparray{LWR@midrules}{\theLWR@tablecolspos}}% +\setlength{\LWR@templengthone}{\LWR@getexparray{LWR@midrules}{\arabic{LWR@tablecolindex}}}% \ifdimcomp{\LWR@templengthone}{>}{0pt}% {% \LWR@origtilde tdrule#1#2% @@ -5723,8 +5766,8 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% \newcommand*{\LWR@addcmidruletrim}{% \LWR@subaddcmidruletrim% -{\LWR@getexparray{LWR@trimlrules}{\theLWR@tablecolspos}}% -{\LWR@getexparray{LWR@trimrrules}{\theLWR@tablecolspos}}% +{\LWR@getexparray{LWR@trimlrules}{\arabic{LWR@tablecolindex}}}% +{\LWR@getexparray{LWR@trimrrules}{\arabic{LWR@tablecolindex}}}% } \newcommand{\LWR@addrulewidth}[2]{% @@ -5759,7 +5802,7 @@ text-align:#1; vertical-align:#2% \newcommand*{\LWR@addformatwpalignment}{% \ifbool{FormatWP}{% -\StrChar{\LWR@tablecolspec}{\theLWR@tablecolspos}[\LWR@strresult]% +\StrChar{\LWR@tablecolspec}{\arabic{LWR@tablecolindex}}[\LWR@strresult]% \ifdefstring{\LWR@strresult}{l}{\LWR@WPcell{left}{middle}}{}% \ifdefstring{\LWR@strresult}{c}{\LWR@WPcell{center}{middle}}{}% \ifdefstring{\LWR@strresult}{r}{\LWR@WPcell{right}{middle}}{}% @@ -5777,9 +5820,12 @@ text-align:#1; vertical-align:#2% \newcounter{LWR@tablemulticolswidth} \newcounter{LWR@tablemulticolspos} +\newbool{LWR@mcolvertbarl} +\newbool{LWR@mcolvertbarr} + \newcommand*{\LWR@printmccoltype}[1]{% \LWR@traceinfo{lwr@printmccoltype -#1-}% -\StrChar{#1}{\theLWR@tablemulticolspos}[\LWR@strresult]% +\StrChar{#1}{\arabic{LWR@tablemulticolspos}}[\LWR@strresult]% \IfStrEq{\LWR@strresult}{l}{l}{}% \IfStrEq{\LWR@strresult}{c}{c}{}% \IfStrEq{\LWR@strresult}{r}{r}{}% @@ -5791,6 +5837,11 @@ text-align:#1; vertical-align:#2% \IfStrEq{\LWR@strresult}{B}{B}{}% \IfStrEq{\LWR@strresult}{S}{r}{}% \IfStrEq{\LWR@strresult}{X}{p}{}% +\IfStrEq{\LWR@strresult}{|}{% + \ifthenelse{\value{LWR@tablemulticolspos}=1}% + {\booltrue{LWR@mcolvertbarl}}% + {\booltrue{LWR@mcolvertbarr}}% +}{}% \LWR@traceinfo{lwr@printmccoltype done}% } @@ -5802,7 +5853,7 @@ text-align:#1; vertical-align:#2% \newcommand*{\LWR@multicolother}[1]{% \addtocounter{LWR@tablemulticolspos}{1}% -\StrChar{#1}{\theLWR@tablemulticolspos}[\LWR@strresult]% +\StrChar{#1}{\arabic{LWR@tablemulticolspos}}[\LWR@strresult]% \LWR@strresult% \booltrue{LWR@validtablecol}% } @@ -5814,7 +5865,7 @@ text-align:#1; vertical-align:#2% \newcommand*{\LWR@printmccoldata}[1]{% \LWR@traceinfo{lwr@printmccoldata -#1}% \boolfalse{LWR@validtablecol}% -\StrChar{#1}{\theLWR@tablemulticolspos}[\LWR@strresult]% +\StrChar{#1}{\arabic{LWR@tablemulticolspos}}[\LWR@strresult]% \IfStrEq{\LWR@strresult}{l}{\LWR@multicoltext}{}% \IfStrEq{\LWR@strresult}{c}{\LWR@multicoltext}{}% \IfStrEq{\LWR@strresult}{r}{\LWR@multicoltext}{}% @@ -5844,7 +5895,7 @@ text-align:#1; vertical-align:#2% \StrLen{#1}[\LWR@strresult]% \setcounter{LWR@tablemulticolswidth}{\LWR@strresult}% \whiledo{% -\not\value{LWR@tablemulticolspos}>\value{LWR@tablemulticolswidth}% + \NOT\value{LWR@tablemulticolspos}>\value{LWR@tablemulticolswidth}% }% {% #2{#1}% @@ -5855,15 +5906,19 @@ text-align:#1; vertical-align:#2% \newcommand{\LWR@multicoltext}{} -\NewDocumentCommand{\LWR@domulticolumn}{o o m m +m}{% -\LWR@traceinfo{lwr@domulticolumn -#1- -#2- -#3- -#4-}% +\newcounter{LWR@lastmulticolumn} + +\NewDocumentCommand{\LWR@domulticolumn}{o o m m m +m}{% +\LWR@traceinfo{LWR@domulticolumn -#1- -#2- -#4- -#5-}% \renewcommand{\LWR@multicoltext}{% -#5% +#6% \booltrue{LWR@validtablecol}% }% +\setcounter{LWR@lastmulticolumn}{\value{LWR@tablecolindex}}% +\addtocounter{LWR@lastmulticolumn}{#3}% +\addtocounter{LWR@lastmulticolumn}{-1}% \LWR@maybenewtablerow% -\LWR@tabularleftedge% -\LWR@htmltag{td colspan="#3" % +\LWR@htmltag{td colspan="#4" % \IfValueT{#2}{ % rows? rowspan="#2" % \IfValueT{#1}{% vpos? @@ -5872,10 +5927,14 @@ rowspan="#2" % }% vpos? }% rows? class="td% -\LWR@parsemulticolumnalignment{#4}{\LWR@printmccoltype}% -\LWR@addcmidruletrim% -\LWR@addleftmostbartag% -\LWR@printbartag{\theLWR@tablecolspos}% +\boolfalse{LWR@mcolvertbarl}% +\boolfalse{LWR@mcolvertbarr}% +\LWR@parsemulticolumnalignment{#5}{\LWR@printmccoltype}% +\LWR@subaddcmidruletrim% +{\LWR@getexparray{LWR@trimlrules}{\arabic{LWR@tablecolindex}}}% +{\LWR@getexparray{LWR@trimrrules}{\arabic{LWR@lastmulticolumn}}}% +\ifbool{LWR@mcolvertbarl}{ tvertbarl}{}% +\ifbool{LWR@mcolvertbarr}{ tvertbarr}{}% "% \LWR@tdstartstyles% \LWR@addcmidrulewidth% @@ -5883,16 +5942,16 @@ rowspan="#2" % \LWR@tdendstyles% }% end of the opening table data tag \global\boolfalse{LWR@intabularmetadata}% -\LWR@parsemulticolumnalignment{#4}{\LWR@printmccoldata}% +\LWR@parsemulticolumnalignment{#5}{\LWR@printmccoldata}% } \NewDocumentCommand{\LWR@htmlmulticolumn}{m m +m}% {% -\LWR@tabularhtmlcolumns{\theLWR@tablecolspos}{#1} -\LWR@domulticolumn{\theLWR@tabhtmlcoltotal}{#2}{#3}% -\addtocounter{LWR@tablecolspos}{#1}% -\addtocounter{LWR@tablecolspos}{-1}% +\LWR@tabularhtmlcolumns{\arabic{LWR@tablecolindex}}{#1} +\LWR@domulticolumn{#1}{\arabic{LWR@tabhtmlcoltotal}}{#2}{#3}% +\addtocounter{LWR@tablecolindex}{#1}% +\addtocounter{LWR@tablecolindex}{-1}% \booltrue{LWR@skipatbang}% } @@ -5907,8 +5966,9 @@ rowspan="#2" % {\LWR@setlatestname{#2}}% given and non-empty }% optional given {\LWR@setlatestname{#3}}% no optional -\LWR@tabularhtmlcolumns{1}{\theLWR@tabletotalcols} -\LWR@domulticolumn{\theLWR@tabhtmlcoltotal}{P}{% \LWR@domulticolumn +\LWR@tabularhtmlcolumns{1}{\arabic{LWR@tabletotalcols}} +\LWR@domulticolumn{\arabic{LWR@tabletotalcols}}{\arabic{LWR@tabhtmlcoltotal}}{P}% +{% \LWR@domulticolumn \IfBooleanTF{#1}% star? {% yes star \LWR@figcaption% @@ -5958,8 +6018,8 @@ rowspan="#2" % \booltrue{LWR@skipatbang}% }% end of \LWR@domulticolumn -\addtocounter{LWR@tablecolspos}{\theLWR@tabletotalcols} -\addtocounter{LWR@tablecolspos}{-1} +\addtocounter{LWR@tablecolindex}{\arabic{LWR@tabletotalcols}} +\addtocounter{LWR@tablecolindex}{-1} } @@ -5969,22 +6029,27 @@ rowspan="#2" % \newcounter{LWR@tabhtmlcolend} \newcounter{LWR@tabhtmlcoltotal} -\newcommand*{\LWR@tabularhtmlcolumns}[2]{% -\setcounter{LWR@tabhtmlcolindex}{#1}% -\setcounter{LWR@tabhtmlcoltotal}{#2}% -\setcounter{LWR@tabhtmlcolend}{#1}% -\addtocounter{LWR@tabhtmlcolend}{#2}% -\whiledo{\value{LWR@tabhtmlcolindex}<\value{LWR@tabhtmlcolend}}{% - \edef\LWR@atbangspec{\LWR@getexparray{LWR@colatspec}% - {\theLWR@tabhtmlcolindex}}% +\newcommand*{\LWR@subtabularhtmlcolumns}[1]{% + \edef\LWR@atbangspec{\LWR@getexparray{LWR@colatspec}{#1}}% \ifdefempty{\LWR@atbangspec}% {}% {\addtocounter{LWR@tabhtmlcoltotal}{1}}% - \edef\LWR@atbangspec{\LWR@getexparray{LWR@colbangspec}% - {\theLWR@tabhtmlcolindex}}% + \edef\LWR@atbangspec{\LWR@getexparray{LWR@colbangspec}{#1}}% \ifdefempty{\LWR@atbangspec}% {}% {\addtocounter{LWR@tabhtmlcoltotal}{1}}% +} + +\newcommand*{\LWR@tabularhtmlcolumns}[2]{% +\setcounter{LWR@tabhtmlcolindex}{#1}% +\setcounter{LWR@tabhtmlcoltotal}{#2}% +\setcounter{LWR@tabhtmlcolend}{#1}% +\addtocounter{LWR@tabhtmlcolend}{#2}% +\ifthenelse{\value{LWR@tabhtmlcolindex}=1}{% + \LWR@subtabularhtmlcolumns{leftedge}% +}{}% +\whiledo{\value{LWR@tabhtmlcolindex}<\value{LWR@tabhtmlcolend}}{% + \LWR@subtabularhtmlcolumns{\arabic{LWR@tabhtmlcolindex}}% \addtocounter{LWR@tabhtmlcolindex}{1}% }% whiledo } @@ -6025,7 +6090,7 @@ rowspan="#2" % \begin{warpall} -\let\TabularMacro\relax +\newcommand*{\TabularMacro}{} \end{warpall} @@ -6057,7 +6122,7 @@ rowspan="#2" % \LWR@traceinfo{LWR@tabledatacolumntag}% \let\mynext\LWR@tabledatasinglecolumntag% \ifdefequal{\LWR@mynexttoken}{\end}% - {\booltrue{LWR@exitingtabular}}{}% + {\global\booltrue{LWR@exitingtabular}}{}% \ifdefequal{\LWR@mynexttoken}{\caption}% {\let\mynext\LWR@donothing}{}% \ifdefequal{\LWR@mynexttoken}{\multicolumn}% @@ -6127,14 +6192,14 @@ rowspan="#2" % { \newcommand*{\LWR@hline}[1][]{% \ifbool{FormatWP}% - {\LWR@docmidrule{1-\theLWR@tabletotalcols}}% + {\LWR@docmidrule{1-\arabic{LWR@tabletotalcols}}}% {\booltrue{LWR@doinghline}}% \LWR@getmynexttoken}% } { \newcommand*{\LWR@hline}{% \ifbool{FormatWP}% - {\LWR@docmidrule{1-\theLWR@tabletotalcols}}% + {\LWR@docmidrule{1-\arabic{LWR@tabletotalcols}}}% {\booltrue{LWR@doinghline}}% \LWR@getmynexttoken}% } @@ -6165,14 +6230,15 @@ rowspan="#2" % \global\boolfalse{LWR@doingtbrule}% \global\boolfalse{LWR@doingcmidrule}% \LWR@nullifyNoAutoSpacing% -\boolfalse{LWR@exitingtabular}% -\boolfalse{LWR@tabularmutemods}% +\global\boolfalse{LWR@exitingtabular}% +\global\boolfalse{LWR@tabularmutemods}% \global\booltrue{LWR@intabularmetadata}% \LWR@forcenewpage \LWR@htmlblocktag{table}% \LWR@parsetablecols{#2}% \LWR@stoppars% -\setcounter{LWR@tablecolspos}{1}% +\setcounter{LWR@tablecolindex}{1}% +\boolfalse{LWR@tabularcelladded}% \LWR@clearmidrules% \LetLtxMacro{\\}{\LWR@tabularendofline}% \LWR@traceinfo{LWR@tabular: redefining macros}% @@ -6182,20 +6248,20 @@ rowspan="#2" % \DeclareDocumentCommand{\toprule}{o d()} {% \IfValueTF{##1}% - {\LWR@docmidrule[##1](){1-\theLWR@tabletotalcols}}% + {\LWR@docmidrule[##1](){1-\arabic{LWR@tabletotalcols}}}% {% \ifbool{FormatWP}% - {\LWR@docmidrule[##1](){1-\theLWR@tabletotalcols}}% + {\LWR@docmidrule[##1](){1-\arabic{LWR@tabletotalcols}}}% {\booltrue{LWR@doingtbrule}}% }% \LWR@getmynexttoken}% \DeclareDocumentCommand{\midrule}{o d()}% {% \IfValueTF{##1}% - {\LWR@docmidrule[##1](){1-\theLWR@tabletotalcols}}% + {\LWR@docmidrule[##1](){1-\arabic{LWR@tabletotalcols}}}% {% \ifbool{FormatWP}% - {\LWR@docmidrule[##1](){1-\theLWR@tabletotalcols}}% + {\LWR@docmidrule[##1](){1-\arabic{LWR@tabletotalcols}}}% {\booltrue{LWR@doinghline}}% }% \LWR@getmynexttoken}% @@ -6204,17 +6270,17 @@ rowspan="#2" % \DeclareDocumentCommand{\bottomrule}{o d()} {% \IfValueTF{##1}% - {\LWR@docmidrule[##1](){1-\theLWR@tabletotalcols}}% + {\LWR@docmidrule[##1](){1-\arabic{LWR@tabletotalcols}}}% {% \ifbool{FormatWP}% - {\LWR@docmidrule[##1](){1-\theLWR@tabletotalcols}}% + {\LWR@docmidrule[##1](){1-\arabic{LWR@tabletotalcols}}}% {\booltrue{LWR@doingtbrule}}% }% \LWR@getmynexttoken}% \DeclareDocumentCommand{\addlinespace}{o}{}% \DeclareDocumentCommand{\morecmidrules}{}{}% \DeclareDocumentCommand{\specialrule}{m m m d()}% - {\LWR@docmidrule[##1](){1-\theLWR@tabletotalcols}\LWR@getmynexttoken}% + {\LWR@docmidrule[##1](){1-\arabic{LWR@tabletotalcols}}\LWR@getmynexttoken}% \renewcommand{\multicolumn}{\LWR@htmlmulticolumn}% \renewcommand*{\mrowcell}{% \LWR@maybenewtablerow% @@ -6223,7 +6289,6 @@ rowspan="#2" % }% \renewcommand*{\mcolrowcell}{% \LWR@maybenewtablerow% - \LWR@tabularleftedge% \global\booltrue{LWR@skippingmcolrowcell}% }% \LetLtxMacro{\caption}{\LWR@longtabledatacaptiontag}% @@ -6239,7 +6304,14 @@ rowspan="#2" % }% {% \LWR@traceinfo{LWR@tabular ending}% -\ifthenelse{\value{LWR@tablecolspos}<\value{LWR@tablecolswidth}}{% +\ifthenelse{% + \(% + \boolean{LWR@intabularmetadata} \AND% + \NOT\boolean{LWR@tabularcelladded} \AND% + \cnttest{\value{LWR@tablecolindex}}{=}{\value{LWR@tabletotalcols}}% + \) \OR% + \cnttest{\value{LWR@tablecolindex}}{<}{\value{LWR@tabletotalcols}}% +}{% \LWR@tabularfinishrow% }% {% @@ -6279,7 +6351,7 @@ rowspan="#2" % \zref@newlist{special} \zref@newprop{zLWR@name}{\@currentlabelname} \zref@newprop{zLWR@htmlfilenumber}{% -\ifbool{FileSectionNames}{\LWR@thisfilename}{\theLWR@htmlfilenumber}% +\ifbool{FileSectionNames}{\LWR@thisfilename}{\arabic{LWR@htmlfilenumber}}% }% \zref@newprop{zLWR@lateximagedepth}{\arabic{LWR@lateximagedepth}} \zref@newprop{zLWR@lateximagenumber}{\arabic{LWR@lateximagenumber}} @@ -6333,7 +6405,7 @@ rowspan="#2" % \LWR@origlabel{#1}% \LWR@traceinfo{LWR@newlabel: filesectionnames is \ifbool{FileSectionNames}{true}{false}}% \LWR@traceinfo{LWR@newlabel: LWR@thisfilename is !\LWR@thisfilename!}% -\LWR@traceinfo{LWR@newlabel: LWR@htmlfilenumber is \theLWR@htmlfilenumber}% +\LWR@traceinfo{LWR@newlabel: LWR@htmlfilenumber is \arabic{LWR@htmlfilenumber}}% \LWR@splabel{#1}% \LWR@subsublabel{#1}% \LWR@traceinfo{LWR@newlabel: done}% @@ -6393,7 +6465,7 @@ rowspan="#2" % {(\cpageref{#2})}% } -\newcommand*{\nameref}[1]{% +\DeclareRobustCommand*{\nameref}[1]{% \LWR@traceinfo{nameref A}% \LWR@startref{#1}% \LWR@traceinfo{nameref B}% @@ -6426,7 +6498,7 @@ class="#3"\LWR@orignewline}#2\LWR@htmltag{/a}% \LWR@ensuredoingapar% } -\newcommand{\href}{% +\DeclareRobustCommand*{\href}{% \LWR@ensuredoingapar% \begingroup% \catcode`\_=12 @@ -6435,7 +6507,7 @@ class="#3"\LWR@orignewline}#2\LWR@htmltag{/a}% \newcommand*{\LWR@nolinkurlb}[1]{#1\endgroup\LWR@ensuredoingapar} -\newcommand{\nolinkurl}{% +\DeclareRobustCommand*{\nolinkurl}{% \LWR@ensuredoingapar% \begingroup\catcode`\_=12 \LWR@nolinkurlb% @@ -6447,7 +6519,7 @@ class="#3"\LWR@orignewline}#2\LWR@htmltag{/a}% \LWR@ensuredoingapar% } -\newcommand{\LWR@urla}{% +\DeclareRobustCommand*{\LWR@urla}{% \LWR@ensuredoingapar% \begingroup\catcode`\_=12 \LWR@urlb% @@ -6871,6 +6943,7 @@ class="#3"\LWR@orignewline}#2\LWR@htmltag{/a}% \newcommand*{\LWR@restoreorigformatting}{% \LWR@traceinfo{LWR@restoreorigformatting}% \linespread{1}% +\LetLtxMacro\ref\LWR@origref%{} syntax highlighting \RenewDocumentCommand{\InlineClass}{o m +m}{##3}% \RenewDocumentEnvironment{BlockClass}{o m}{}{}% \renewcommand{\BlockClassSingle}[2]{##2}% @@ -6943,6 +7016,8 @@ class="#3"\LWR@orignewline}#2\LWR@htmltag{/a}% \let\LaTeXe\LWR@origLaTeXe% \renewcommand*{\Xe}{X\textsubscript{E}}% \LetLtxMacro\@ensuredmath\LWR@origensuredmath% +\csletcs{equation*}{LWR@origequationstar}% +\csletcs{endequation*}{LWR@origendequationstar}% \LWR@restoreorigaccents% \LWR@FBcancel% } @@ -6971,7 +7046,7 @@ class="#3"\LWR@orignewline}#2\LWR@htmltag{/a}% \catcode`\$=\active% \protected\gdef${\@ifnextchar$\LWR@doubledollar\LWR@singledollar}% -\gdef\LWR@doubledollar$#1$${ +\protected\gdef\LWR@doubledollar$#1$${ \ifboolexpr{bool{mathjax} or ( bool{FormatWP} and bool{WPMarkMath} ) }% { @@ -6989,7 +7064,7 @@ class="#3"\LWR@orignewline}#2\LWR@htmltag{/a}% }% not mathjax }% -\gdef\LWR@subsingledollar#1{% +\protected\gdef\LWR@subsingledollar#1{% \ifboolexpr{bool{mathjax} or ( bool{FormatWP} and bool{WPMarkMath} ) }% {% {\textbackslash(\LWR@HTMLsanitize{#1}\textbackslash)}% @@ -7002,12 +7077,13 @@ class="#3"\LWR@orignewline}#2\LWR@htmltag{/a}% }% } -\gdef\LWR@singledollar#1${% +\protected\gdef\LWR@singledollar#1${% \LWR@subsingledollar{#1}% } -\gdef\(#1\){$#1$} -\gdef\[#1\]{$$#1$$} +\protected\gdef\(#1\){% +$#1$} +\protected\gdef\[#1\]{$$#1$$} \endgroup @@ -7104,6 +7180,12 @@ class="#3"\LWR@orignewline}#2\LWR@htmltag{/a}% ] +\csletcs{LWR@origequationstar}{equation*} +\csletcs{LWR@origendequationstar}{endequation*} +\renewenvironment*{equation*} +{\displaymath} +{\enddisplaymath} + \newbool{LWR@amsmultline} \boolfalse{LWR@amsmultline} @@ -7540,7 +7622,7 @@ class="#3"\LWR@orignewline}#2\LWR@htmltag{/a}% \LWR@ensuredoingapar% \addtocounter{LWR@externalfilecnt}{1}% \LWR@traceinfo{lateximage: LWR@externalfilecnt is \arabic{LWR@externalfilecnt}}% - \setcounterpageref{LWR@LIpage}{LWRlateximage\theLWR@lateximagenumber}% + \setcounterpageref{LWR@LIpage}{LWRlateximage\arabic{LWR@lateximagenumber}}% \LWR@traceinfo{lateximage: LWR@LIpage is \arabic{LWR@LIpage}}% \LWR@htmltag{span id="lateximage\arabic{LWR@lateximagenumber}" % class="lateximagesource"{}} \LWR@orignewline @@ -7806,12 +7888,14 @@ class="#3"\LWR@orignewline}#2\LWR@htmltag{/a}% #1{\cpagerefFor\ \cref{#2}}{\cref{#3}}{}{}{}{}} }% AfterEndPreamble -\let\LWR@origlabel\label -\let\label\LWR@newlabel -\let\LWR@origref\ref -\let\ref\LWR@newref% \end{ syntax highlighting -\let\LWR@origpageref\pageref -\let\pageref\LWR@newpageref +\LetLtxMacro\LWR@origlabel\label +\RenewDocumentCommand{\label}{}{\LWR@newlabel} + +\LetLtxMacro\LWR@origref\ref +\RenewDocumentCommand{\ref}{}{\LWR@newref}% + +\LetLtxMacro\LWR@origpageref\pageref +\RenewDocumentCommand{\pageref}{}{\LWR@newpageref} \end{warpHTML} @@ -8202,6 +8286,7 @@ width:\rndprintlength{\LWR@tempwidth}% \RenewDocumentCommand{\LWR@htmlspanclass}{o m +m}{##3}% \DeclareExpandableDocumentCommand{\InlineClass}{+o +m +m}{##3}% \DeclareRobustCommand{\LWR@HTMLtextstyle}[3]{##3}% +\DeclareRobustCommand{\LWR@subsingledollar}[1]{}% } \renewcommand*{\mdseries}{} -- cgit v1.2.3