summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/lwarp/lwarp.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/lwarp/lwarp.dtx')
-rw-r--r--Master/texmf-dist/source/latex/lwarp/lwarp.dtx4099
1 files changed, 3202 insertions, 897 deletions
diff --git a/Master/texmf-dist/source/latex/lwarp/lwarp.dtx b/Master/texmf-dist/source/latex/lwarp/lwarp.dtx
index 355a913cfd6..c63327e36f4 100644
--- a/Master/texmf-dist/source/latex/lwarp/lwarp.dtx
+++ b/Master/texmf-dist/source/latex/lwarp/lwarp.dtx
@@ -16,7 +16,7 @@
% \iffalse
%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
%<package>\ProvidesPackage{lwarp}
-%<package> [2018/06/06 v0.57 Allows LaTeX to directly produce HTML5 output.]
+%<package> [2018/07/07 v0.58 Allows LaTeX to directly produce HTML5 output.]
%
%<*driver>
\documentclass{ltxdoc}
@@ -310,7 +310,7 @@ Keywords={LaTeX, HTML, conversion}%
\newcommand*{\rulebreak}{\bigskip\hfill\rule[.7ex]{.3\linewidth}{.4pt}\hspace*{\fill}\bigskip\@afterheading}
\makeatother
-\newcommand{\DescribeDefault}[1]{\margintag{\footnotesize \textcolor{green!50!black}{Default: \texttt{#1}}}}
+\newcommand{\DescribeDefault}[1]{\margintag{\footnotesize \textgreen{Default: \texttt{#1}}}}
\newcommand{\goesto}{$\Rightarrow$}
@@ -322,9 +322,17 @@ Keywords={LaTeX, HTML, conversion}%
\newcommand*{\testthis}{\textcolor{blue}{Please send bug reports!}\watchout[Not fully tested!]}
+\newcommand*{\fquad}{\hspace*{1em}}
+\newcommand*{\fqquad}{\hspace*{2em}}
+\newcommand*{\fqqquad}{\hspace*{3em}}
+
+\newcommand{\textred}[1]{\textcolor{red}{#1}}
+\newcommand{\textgreen}[1]{\textcolor{green!50!black}{#1}}
+\newcommand{\textblue}[1]{\textcolor{blue!70!black}{#1}}
+
\newcommand{\userentry}[1]{%
\par
-\hspace*{2em}\begin{minipage}{\linewidth-2em}
+\fqquad\begin{minipage}{\linewidth-2em}
{\footnotesize Enter~$\Rightarrow$}\quad\texttt{#1}
\end{minipage}
\par
@@ -334,10 +342,10 @@ Keywords={LaTeX, HTML, conversion}%
{
\leavevmode
\par
-\hspace*{2em}\minipage{\linewidth-2em}
+\fqquad\minipage{\linewidth-2em}
\ttfamily
}
-{
+{%
\endminipage
\par
}
@@ -346,7 +354,7 @@ Keywords={LaTeX, HTML, conversion}%
{
\leavevmode
\par
-\hspace*{2em}\minipage{\linewidth-2em}
+\fqquad\minipage{\linewidth-2em}
\sffamily
}
{
@@ -365,8 +373,8 @@ Keywords={LaTeX, HTML, conversion}%
{\smallskip\hrule\endminipage\hspace*{\fill}\bigskip}
\newcommand{\pdflatexonly}{
-\textcolor{red}{Only pre-loaded if \prog{pdflatex} is being used.}
-\marginpar{\raggedleft\textcolor{blue!70!black}{\prog{pdflatex} only:}}
+\textred{Only pre-loaded if \prog{pdflatex} is being used.}
+\marginpar{\raggedleft\textblue{\prog{pdflatex} only:}}
}
% From package dtxdescribe:
@@ -383,7 +391,7 @@ Keywords={LaTeX, HTML, conversion}%
% \makeatother
% \newcommand{\margintag}[1]{%
-% \marginpar{\raggedleft\textcolor{blue!70!black}{#1}}%
+% \marginpar{\raggedleft\textblue{#1}}%
% }
@@ -481,8 +489,8 @@ Ex:
\cs{cpageref}\{tab:first,tab:second\} \\
\hspace*{-2em} in \HTML\ becomes:\\
\rmfamily
- ``pages \textbf{for} table \textcolor{red}{4.1} and
- \textbf{for} table \textcolor{red}{4.2}''
+ ``pages \textbf{for} table \textred{4.1} and
+ \textbf{for} table \textred{4.2}''
\end{sourcedisplay}
See \cs{cpagerefFor} at \cpageref{sec:cpagereffor}
to redefine the message which is printed for page number references.
@@ -542,15 +550,15 @@ The \pkg{lwarp} package option
\DescribeOption{xindyLanguage}
\DescribeDefault{english}
\optn{xindyLanguage} sets the language used by \prog{xindy}.
-This is passed to \prog{xindy} using its \optn{-L} option, and is
-used for both index and glossary generation.
+This is passed to \prog{xindy} using its \optn{-L} option
+when using \cmds{lwarpmk printindex} and \cmds{lwarpmk htmlindex}.
The option
\DescribeOption{xindyCodepage}
\DescribeDefault{utf8}
\optn{xindycodepage} sets the codepage used by \prog{xindy}.
-This is passed to \prog{xindy} using its \optn{-C} option, and is
-used for both index and glossary generation.
+This is passed to \prog{xindy} using its \optn{-C} option
+when using \cmds{lwarpmk printindex} and \cmds{lwarpmk htmlindex}.
}
\newcommand{\limitspdftotextenc}{%
@@ -578,14 +586,35 @@ To do so, add to the start of the \filenm{.bib} file the following:
}
\newcommand{\limitsglossaries}{%
-\prog{xindy} is required for \pkg{glossaries}.
+\margintag{processing glossaries}
+\DescribeOption{GlossaryCmd}\DescribeDefault{makeglossaries}
+\DescribeOption[lwarpmk]{printglossary}
+\DescribeOption[lwarpmk]{htmlglossary}
+\prog{lwarpmk} has the commands \texttt{lwarpmk printglossary} and
+\texttt{lwarpmk htmlglossary}, which process the glossaries created by the
+\pkg{glossaries} package using that package's \cmds{makeglossaries} command.
-The default \optn{style=item} option for \pkg{glossaries} conflicts
-with \pkg{lwarp}, so the style is forced to \texttt{index} instead.
+The shell command to execute is set by the \pkg{lwarp} option \optn{GlossaryCmd},
+which defaults to \cmds{makeglossaries}.
+The print or \HTML\ glossary filename is appended to this command.
-The page number list in the printed form would become \cs{nameref}s in \HTML,
-which could become a very long string if many items are referenced.
-For now, the number list is simply turned off.
+In some situations it may be required to modify the default command,
+\watchout[\cmds{makeglossaries} not found]
+such as to add the \cmds{perl} command in front:
+\begin{sourcedisplay}
+\cs{usepackage}[ \\
+\fquad\ GlossaryCmd=\{\textred{perl} makeglossaries\}, \\
+] \{lwarp\}
+\end{sourcedisplay}
+
+To set the language to use for processing glossaries with \prog{xindy}:
+\margintag{\prog{xindy} language}
+\begin{sourcedisplay}
+\cs{usepackage}[ \\
+\fquad\ GlossaryCmd=\{makeglossaries \textred{-L english}\}, \\
+] \{lwarp\}
+\end{sourcedisplay}
+Other options for \cmds{makeglossaries} may be set as well.
The glossaries may be placed in a numbered or unnumbered section, given
\margintag{placement and \acro{TOC} options}
@@ -615,29 +644,33 @@ a \acro{TOC} entry, and placed inline or on their own \HTML\ page:
\end{sourcedisplay}
\end{description}
-\limitsxindylanguage
-
-\DescribeOption[lwarpmk]{printglossary}
-\DescribeOption[lwarpmk]{htmlglossary}
-\prog{lwarpmk} has the commands \texttt{lwarpmk printglossary} and
-\texttt{lwarpmk htmlglossary} to process the glossaries created by
-\pkg{glossaries} using \prog{xindy}.
-}
-
+The default \optn{style=item} option for \pkg{glossaries} conflicts
+\watchout[glossary style]
+with \pkg{lwarp}, so the style is forced to \texttt{index} instead.
-\newcommand*{\limitsindex}{%
+The page number list in the printed form would become \cs{nameref}s in \HTML,
+\watchout[number list]
+which could become a very long string if many items are referenced.
+For now, the number list is simply turned off.
-\limitsxindylanguage
+The print and \HTML\ versions of the glossary differ
+\margintag{print/\HTML\ versions}
+in their internal page numbers.
+Separate commands for generating print and \HTML\ glossaries are used, even
+though the page number is currently ignored.
+}
-\limitstocloft
+\newcommand{\limitstocbibind}{%
An index may be placed inline with other \HTML\ text, or on its own \HTML\ page:
-\DescribePackage{makeidx}
\margintag{placement and \acro{TOC} options}
+\index{index>placement and \acro{TOC} options}
+\index{index>table of contents}
\begin{description}
\item [Inline, with a manual TOC entry:] \
+\DescribePackage{makeidx}
A commonly-used method to introduce an index in a \LaTeX\ document:
\begin{sourcedisplay}
@@ -649,6 +682,7 @@ An index may be placed inline with other \HTML\ text, or on its own \HTML\ page:
\needspace{3\baselineskip}
\item [On its own \HTML\ page, with a manual TOC entry:] \
+\DescribePackage{makeidx}
\begin{sourcedisplay}
\cs{begin}\{warpprint\} \\
\cs{cleardoublepage} \\
@@ -661,9 +695,9 @@ An index may be placed inline with other \HTML\ text, or on its own \HTML\ page:
\end{sourcedisplay}
\item [Inline, with an automatic TOC entry:] \
+ \DescribePackage{tocbibind}
The \pkg{tocbibind}
- \DescribePackage{tocbibind}
package may be used to automatically place an entry in the \acro{TOC}.
\begin{sourcedisplay}
\cs{usepackage}[nottoc]\{tocbibind\} \\
@@ -673,7 +707,8 @@ An index may be placed inline with other \HTML\ text, or on its own \HTML\ page:
\cs{printindex}
\end{sourcedisplay}
-\item [On its own \HTML\ page, with an automatic TOC entry:]
+\item [On its own \HTML\ page, with an automatic TOC entry:] \
+ \DescribePackage{tocbibind}
\begin{sourcedisplay}
\cs{usepackage}[nottoc]\{tocbibind\} \\
\dots \\
@@ -688,6 +723,47 @@ Use the \pkg{tocbibind} \optn{numindex} option to generate a numbered index.
\DescribeOption[tocbibind]{numindex}
Without this option, the index heading has no number.
\margintag{numbered index section}
+
+Other packages, such as \pkg{imakeidx}, may also have options for including
+the index in the Table of Contents.
+}
+
+\newcommand*{\limitssplitidx}{%
+If the \optn{latexmk} option is selected for \pkg{lwarp},
+\prog{latexmk} will compile the document but will \emph{not} compile the indexes.
+\cmds{lwarpmk printindex} and \cmds{lwarpmk htmlindex} will still be required.
+
+When using \cs{AtWriteToIndex} or \cs{AtNextWriteToIndex}, the user must not
+\watchout[\cs{thepage}]
+refer to \cs{thepage} during \HTML\ output, as the concept of a page number is
+meaningless. Instead, do
+\begin{sourcedisplay}
+ \cs{addtocounter}\{LWR@autoindex\}\{1\} \\
+ \cs{LWR@new@label}\{LWRindex-\cs{arabic}\{LWR@autoindex\}\} \\
+\end{sourcedisplay}
+where the \cs{index}-like action occurs,
+and then refer to \texttt{\cs{arabic}\{LWR@autoindex\}} instead of \cs{thepage}
+where the reference should occur.
+
+See \cref{sec:specialindex} in the \pkg{lwarp-patch-memoir} package
+for the \cs{@@wrspindexhyp} macro as an example.
+}
+
+\newcommand{\limitsimakeidx}{%
+When using \prog{makeindex}, to match the print and \HTML\ output's
+\margintag{letter headings}
+\index{index>letter headings}
+display of index letter headings, specify the \filenm{lwarp.ist} style:
+\begin{sourcedisplay}
+\cs{makeindex}[options=\{-s lwarp.ist\}]
+\end{sourcedisplay}
+(For \HTML\ the \filenm{lwarp.ist} style is used automatically,
+which displays letter headings.
+When using \prog{xindy} the default style also displays letter headings.)
+
+See \cref{sec:indexingimakeidx} for how to setup \prog{lwarpmk}
+\margintag{index setup}
+to process the indexes with \pkg{imakeidx}, both with and without shell escape.
}
\newcommand{\limitstocloft}{%
@@ -819,15 +895,15 @@ to generate consistent results between print and \HTML, use
the \pkg{footmisc} package with the \optn{stable} option,
provide a short \TOC\ entry, and \cs{protect} the \cs{footnote}:
\begin{sourcedisplay}
-\cs{usepackage}[\textcolor{red}{stable}]\{footmisc\}\\
+\cs{usepackage}[\textred{stable}]\{footmisc\}\\
\dots\\
-\cs{subsection}\textcolor{red}{[Subsection Name]}\\
-\hspace*{2em}\{Subsection Name\textcolor{red}{\cs{protect}}\cs{footnote}\{A footnote.\}\}
+\cs{subsection}\textred{[Subsection Name]}\\
+\fqquad\{Subsection Name\textred{\cs{protect}}\cs{footnote}\{A footnote.\}\}
\end{sourcedisplay}
If using \pkg{memoir} class, with which \pkg{lwarp} preloads \pkg{footmisc}, the
\optn{stable} option must be declared before \pkg{lwarp} is loaded:
\begin{sourcedisplay}
-\cs{PassOptionsToPackage}\{\textcolor{red}{stable}\}\{footmisc\} \\
+\cs{PassOptionsToPackage}\{\textred{stable}\}\{footmisc\} \\
\cs{usepackage}\{lwarp\} \\
\dots
\end{sourcedisplay}
@@ -846,8 +922,8 @@ and using footnotes in a sectioning command or display math,
use \cs{footnotemark} and \cs{footnotetext}:
\begin{sourcedisplay}
\cs{subsection}[Subsection Name]\\
-\hspace*{2em}\{Subsection Name\cs{protect}\textcolor{red}{\cs{footnotemark}}\} \\
-\textcolor{red}{\cs{footnotetext}}\{A footnote with \cs{verb}+verbtim+.\} \\
+\fqquad\{Subsection Name\cs{protect}\textred{\cs{footnotemark}}\} \\
+\textred{\cs{footnotetext}}\{A footnote with \cs{verb}+verbtim+.\} \\
\end{sourcedisplay}
and likewise for equations or display math.
@@ -959,13 +1035,13 @@ in the \SVG\ image may be adjusted
by setting \cs{LateximageFontSizeName} to a font size name --- \emph{without the backslash},
which defaults to:
\begin{sourcedisplay}
-\cs{renewcommand}\{\cs{LateximageFontSizeName}\}\{\textcolor{red}{normalsize}\}
+\cs{renewcommand}\{\cs{LateximageFontSizeName}\}\{\textred{normalsize}\}
\end{sourcedisplay}
For inline \SVG\ math, font size is instead controlled by \cs{LateximageFontScale},
which defaults to:
\begin{sourcedisplay}
-\cs{newcommand}*\{\cs{LateximageFontScale}\}\{\textcolor{red}{.75}\}
+\cs{newcommand}*\{\cs{LateximageFontScale}\}\{\textred{.75}\}
\end{sourcedisplay}
}
@@ -1002,8 +1078,8 @@ and thus will have a global effect.
Examples:
\begin{sourcedisplay}
\cs{CustomizeMathJax}\{ \\
- \hspace*{2em}\cs{newcommand}\{\cs{expval}\}[1]\{\cs{langle}\#1\cs{rangle}\} \\
- \hspace*{2em}\cs{newcommand}\{\cs{abs}\}[1]\{\cs{lvert}\#1\cs{rvert}\} \\
+ \fqquad\cs{newcommand}\{\cs{expval}\}[1]\{\cs{langle}\#1\cs{rangle}\} \\
+ \fqquad\cs{newcommand}\{\cs{abs}\}[1]\{\cs{lvert}\#1\cs{rvert}\} \\
\} \\
\cs{CustomizeMathJax}\{\cs{newcommand}\{\cs{arsinh}\}\{\cs{text}\{arsinh\}\}\} \\
\cs{CustomizeMathJax}\{\cs{newcommand}\{\cs{arcosh}\}\{\cs{text}\{arcosh\}\}\}
@@ -1114,7 +1190,7 @@ Limitations when using \brand{MathJax} include:
\href{https://groups.google.com/forum/\#!topic/mathjax-users/jUtewUcE2bY}
{\texttt{https://groups.google.com/forum/\#!topic/\\
- \hspace*{2em}mathjax-users/jUtewUcE2bY}}
+ \fqquad\ mathjax-users/jUtewUcE2bY}}
\item \brand{MathJax} itself does not support subequations.
\margintag{subequations}
@@ -1159,9 +1235,9 @@ after the preamble. Macros defined in the preamble which contain \texttt{\$}
must be enclosed between \cs{StartDefiningMath} and \cs{StopDefiningMath}
to temporarily change to the \HTML\ meaning of \texttt{\$}:
\begin{sourcedisplay}
-\textcolor{red}{\cs{StartDefiningMath}} \\
+\textred{\cs{StartDefiningMath}} \\
\cs{newcommand}\{\dots\} \\
-\textcolor{red}{\cs{StopDefiningMath}}
+\textred{\cs{StopDefiningMath}}
\end{sourcedisplay}
As an alternative, use \cs{(} and \cs{)} instead of \texttt{\$}, in which
@@ -1230,7 +1306,7 @@ For \cs{includegraphics} with \texttt{.pdf} files,
\watchout[\texttt{.pdf} image files]
the user should provide a \texttt{.pdf} image file, and also
a \texttt{.svg}, \texttt{.png}, or \texttt{.jpg} version of the same image.
-\textcolor{red}{These should be referred to without a file extension:}
+\textred{These should be referred to without a file extension:}
\watchout[no file extension]
\begin{sourcedisplay}
\cs{includegraphics}\{filename\} \% print:.pdf, HTML:.svg or other
@@ -1459,9 +1535,9 @@ or the packages \pkg{multirow}, \pkg{longtable}, \pkg{supertabular}, or \pkg{xta
then restore \texttt{\&} to its default catcode after, using the following commands.
These are are ignored in print mode.
\begin{sourcedisplay}
- \textcolor{red}{\cs{StartDefiningTabulars}} \\
+ \textred{\cs{StartDefiningTabulars}} \\
<define macros or environments using \env{tabular} and \texttt{\&} here> \\
- \textcolor{red}{\cs{StopDefiningTabulars}}
+ \textred{\cs{StopDefiningTabulars}}
\end{sourcedisplay}
This includes before and after defining any macro
\watchout[floatrow]
@@ -1482,7 +1558,7 @@ or the packages \pkg{multirow}, \pkg{longtable}, \pkg{supertabular}, or \pkg{xta
\small
\begin{tabular}{lll}
\dots\ \& & \cs{multirow}\{2\}\{.5in\}\{text\} & \&\ \dots \\
- \dots\ \& & \textcolor{red}{\cs{mrowcell}} & \&\ \dots \\
+ \dots\ \& & \textred{\cs{mrowcell}} & \&\ \dots \\
\end{tabular}
\end{sourcedisplay}
Note that recent versions of \pkg{multirow} include a new optional
@@ -1505,7 +1581,7 @@ or the packages \pkg{multirow}, \pkg{longtable}, \pkg{supertabular}, or \pkg{xta
To avoid this, use \cs{TabularMacro} just before the macro.
This is ignored in print mode.
\begin{sourcedisplay}
- \textcolor{red}{\cs{TabularMacro}}\cs{somemacro} \&
+ \textred{\cs{TabularMacro}}\cs{somemacro} \&
more row contents \textbackslash\textbackslash
\end{sourcedisplay}
\end {itemize}
@@ -1573,7 +1649,7 @@ or the packages \pkg{multirow}, \pkg{longtable}, \pkg{supertabular}, or \pkg{xta
\end{sourcedisplay}
to
\begin{sourcedisplay}
- \textcolor{red}{\cs{warpprintonly}\{}This \& That \cs{endhead}\textcolor{red}{\}}
+ \textred{\cs{warpprintonly}\{}This \& That \cs{endhead}\textred{\}}
\end{sourcedisplay}
and likewise with the other \cs{end} headings.
Keep the \cs{endfirsthead} row unchanged, as it is still relevent to \HTML\ output.
@@ -1601,7 +1677,7 @@ or the packages \pkg{multirow}, \pkg{longtable}, \pkg{supertabular}, or \pkg{xta
To resolve this problem, make a copy of the row, with one version
for print output, containing the extra braces, and another version
for \HTML\ output, without the extra braces, such as: \\
- \hspace*{.375in} \cs{warpprintonly}\{\texttt{1 \& 2 \& \textcolor{red}{\{}\cs{multirow}\{2\}\{2cm\}\{Text\}\textcolor{red}{\}} \& 3 \textbackslash\textbackslash\}} \\
+ \hspace*{.375in} \cs{warpprintonly}\{\texttt{1 \& 2 \& \textred{\{}\cs{multirow}\{2\}\{2cm\}\{Text\}\textred{\}} \& 3 \textbackslash\textbackslash\}} \\
\hspace*{.375in} \cs{warpHTMLonly}\{\texttt{1 \& 2 \& \cs{multirow}\{2\}\{2cm\}\{Text\} \& 3 \textbackslash\textbackslash\}}
\end{itemize}
\end{description}
@@ -1616,7 +1692,7 @@ To create a 2 column, 3 row cell:
\begin{sourcedisplay}
\cs{multicolumnrow}%
\textcolor{blue}{\{2\}\{c\}}%
- \textcolor{green!50!black}{[c]\{3\}[0]\{1in\}[0pt]}\{Text\}
+ \textgreen{[c]\{3\}[0]\{1in\}[0pt]}\{Text\}
\end{sourcedisplay}
The two arguments for \cs{multicolumn} come first, followed by
the five arguments for \cs{multirow}, many of which are optional,
@@ -1633,8 +1709,8 @@ of each column and each row to be skipped:
\small
\begin{tabular}{lll}
\dots\ \& & \cs{multicolumnrow}\{2\}\{c\}[c]\{3\}[0]\{1in\}[0pt]\{Text\} & \&\ \dots \\
-\dots\ \& & \textcolor{red}{\cs{mcolrowcell}} \hfill \& \hfill \textcolor{red}{\cs{mcolrowcell}} & \&\ \dots \\
-\dots\ \& & \textcolor{red}{\cs{mcolrowcell}} \hfill \& \hfill \textcolor{red}{\cs{mcolrowcell}} & \&\ \dots \\
+\dots\ \& & \textred{\cs{mcolrowcell}} \hfill \& \hfill \textred{\cs{mcolrowcell}} & \&\ \dots \\
+\dots\ \& & \textred{\cs{mcolrowcell}} \hfill \& \hfill \textred{\cs{mcolrowcell}} & \&\ \dots \\
\end{tabular}
\end{sourcedisplay}
@@ -1652,18 +1728,18 @@ when the containing enviroment ends, resulting in corrupted \HTML\ rows.
To fix this, use \cs{ResumeTabular} as follows.
This is ignored in print mode.
\begin{sourcedisplay}
-\textcolor{red}{\cs{StartDefiningTabulars}} \% because \& is used in a definition \\
+\textred{\cs{StartDefiningTabulars}} \% because \& is used in a definition \\
\cs{newenvironment}\{outerenvironment\} \\
\{ \\
\cs{tabular}\{cc\} \\
left \& right \textbackslash\textbackslash \\
\} \\
\{ \\
-\textcolor{red}{\cs{TabularMacro}\cs{ResumeTabular}} \\
+\textred{\cs{TabularMacro}\cs{ResumeTabular}} \\
left \& right \textbackslash\textbackslash \\
\cs{endtabular} \\
\} \\
-\textcolor{red}{\cs{StopDefiningTabulars}} \\
+\textred{\cs{StopDefiningTabulars}} \\
\end{sourcedisplay}
}
@@ -1697,10 +1773,10 @@ or place it inside \cs{warpingprintonly}.
For \cs{tablefirsthead}, etc., enclose them as follows:
\watchout[misplaced alignment alignment tab character \&]
\begin{sourcedisplay}
-\textcolor{red}{\cs{StartDefiningTabulars}} \\
+\textred{\cs{StartDefiningTabulars}} \\
\cs{tablefirsthead} \\
\dots \\
-\textcolor{red}{\cs{StopDefiningTabulars}}
+\textred{\cs{StopDefiningTabulars}}
\end{sourcedisplay}
See \cref{sec:limitstabular}.
@@ -1717,17 +1793,17 @@ are above or below the delimiter:
\begin{sourcedisplay}
\hrule\smallskip
\cs{begin}\{tabular\}\{lll\} \\
-\textcolor{green!50!black}{<empty>} \& a \& b \textbackslash\textbackslash \\
+\textgreen{<empty>} \& a \& b \textbackslash\textbackslash \\
\cs{ldelim}\{\textbackslash\{\}\{2\}\{.25in\}[left ] \& c \& d \textbackslash\textbackslash \\
-\textcolor{red}{\cs{mrowcell}} \& e \& f \textbackslash\textbackslash \\
-\textcolor{green!50!black}{<empty>} \& g \& h \textbackslash\textbackslash \\
+\textred{\cs{mrowcell}} \& e \& f \textbackslash\textbackslash \\
+\textgreen{<empty>} \& g \& h \textbackslash\textbackslash \\
\cs{end}\{tabular\}
\smallskip\hrule
\begin{tabular}{lll}
-\textcolor{green!50!black}{<>} & a & b \\
+\textgreen{<>} & a & b \\
\ldelim{\{}{2}{.25in}[left ] & c & d \\
\mrowcell & e & f \\
-\textcolor{green!50!black}{<>} & g & h \\
+\textgreen{<>} & g & h \\
\end{tabular}
\hrule
\end{sourcedisplay}
@@ -2034,7 +2110,7 @@ output for \optn{per-mode} and \optn{quotient-mode}.
Some units will require that the expression be placed inside math mode.
\watchout[math mode required]
-\textcolor{red}{NOTE: As of this writing, the \pkg{siunitx} extension
+\textred{NOTE: As of this writing, the \pkg{siunitx} extension
for \brand{MathJax} is not currently hosted at any public CDN,
thus \pkg{siunitx} is not usable with \brand{MathJax} unless a local copy
of this extension is created first.}
@@ -2209,7 +2285,6 @@ This boolean may be tested by the user for later use.
\setlength{\marginparpush}{.7ex}
\setlength{\IndexMin}{40ex}
-
\setcounter{IndexColumns}{2}
\DisableCrossrefs
@@ -2227,7 +2302,7 @@ This boolean may be tested by the user for later use.
%<*package>
% \fi
%
-% \CheckSum{24592}
+% \CheckSum{25214}
%
% \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
@@ -2326,6 +2401,8 @@ This boolean may be tested by the user for later use.
% \changes{v0.55}{2018/04/26}{\ 2018/04/26}
% \changes{v0.56}{2018/05/12}{\ 2018/05/12}
% \changes{v0.57}{2018/06/06}{\ 2018/06/06}
+% \changes{v0.58}{2018/07/07}{\ 2018/07/07}
+% \changes{v0.58}{2018/06/07}{Replaced each \cs{csuse} with \cs{@nameuse} to force error if undefined.}
@@ -2487,12 +2564,12 @@ This boolean may be tested by the user for later use.
% To make a contribution: \hfill
% \href{https://www.tug.org/donate.html}{\texttt{https://www.tug.org/donate.html}}
%
-% For country-specific \TeX\ users groups: \hfill
-% \href{http://tug.org/usergroups.html}{\texttt{http://tug.org/usergroups.html}}
-%
% For users of MiK\TeX: \hfill
% \href{https://miktex.org/donations.html}{\texttt{https://miktex.org/donations.html}}
%
+% For country-specific \TeX\ users groups: \hfill
+% \href{http://tug.org/usergroups.html}{\texttt{http://tug.org/usergroups.html}}
+%
% \endgroup
%
% \clearpage
@@ -2523,7 +2600,55 @@ This boolean may be tested by the user for later use.
%
% \begin{description}
% \needspace{2\baselineskip}
-% \item[v0.57:] \
+% \item[v0.58:] Extensive improvements in indexing, glossaries.
+% Adds \PDF-inclusion packages.
+% \begin{itemize}
+% \item Due to changes in \prog{lwarpmk} and the configuration files
+% \watchout[recompile from scratch]
+% \filenm{lwarpmk.conf} and \filenm{*.lwarpmkconf},
+% \textred{it is necessary to recompile an existing project a single time}
+% using \cmds{pdflatex filename.tex}, or similar for \prog{xelatex} or \prog{lualatex}.
+% After this single recompile, the configuration files will work with the
+% new version of \prog{lwarpmk}.
+% \item \prog{lwarpmk}: Added the |-p| option to specify the project name.
+% \margintag{\prog{lwarpmk}}
+% \item \prog{lwarpmk}: Now uses \prog{makeglossaries} for glossary generation,
+% \margintag{\pkg{glossaries}}
+% allowing the processing of multiple glossaries at once.
+% \item Added \pkg{lwarp} option \optn{GlossaryCmd}
+% to specify the shell command used by \cmds{lwarpmk printglossary} and
+% \cmds{lwarpmk htmlglossary}. Defaults to \cmds{makeglossaries}.
+% \item Docs: Extra indexing options. See \cref{sec:indexingoverview}.
+% \margintag{index and glossary}
+% \item Added support for \prog{makeindex}. (Previously supported only \prog{xindy}.)
+% Also added indexing packages listed below.
+% \item Added \pkg{lwarp} options \optn{PrintIndexCmd}, \optn{HTMLIndexCmd},
+% and \optn{LatexmkIndexCmd}
+% to specify shell commands used by \cmds{lwarpmk printindex},
+% \cmds{lwarpmk htmlindex}, and \prog{latexmk}. May be preset with the
+% \optn{makeindex} or \optn{xindy} \pkg{lwarp} options. See \cref{sec:loading}.
+% \item Added \pkg{lwarp} options \optn{makeindex} and \optn{xindy} to
+% set \optn{PrintIndexCmd}, \optn{HTMLIndexCmd}, and \optn{LatexmkIndexCmd}
+% to sensible values for a typical single index. See \cref{sec:loading}.
+% \item Added \pkg{lwarp} option \optn{makeindexStyle} to tell \prog{lwarpmk} to
+% use a custom style instead of \filenm{lwarp.ist}.
+% See \cref{sec:modifymakeindex}.
+% \item Fix for index entries with \cs{see}, \cs{seealso}, \cs{emph}, \cs{textbf}, etc.
+% \item Replaced each \cs{csuse} with \cs{@nameuse} for improved error detection.
+% \margintag{misc. fixes}
+% \item Additional internal print/\HTML\ macro selection improvements.
+% \item Fix: \cs{printindex} finishes pending \cs{index} writes first.
+% \item Fixes for \pkg{memoir}: \pkg{makeidx}, \pkg{ccaption}, multiple indexes, \cs{specialindex}.
+% \margintag{packages}
+% \item Fixes for \pkg{komascript}: Indexing improvements.
+% \item Added \pkg{imakeidx}, \pkg{index}, \pkg{repeatindex}, \pkg{splitidx}.
+% \item Added \pkg{attachfile}, \pkg{attachfile2}, \pkg{intopdf},
+% \pkg{pdfpages}, \pkg{pdfx}.
+% \item Added \pkg{cases}.
+% \item Tested to work as-is: \pkg{notes2bib}, \pkg{hvindex}.
+% \end{itemize}
+% \needspace{2\baselineskip}
+% \item[v0.57:] \pkg{algorithm2e}, \pkg{float} styles, tabular packages, internal improvements.
% \begin{itemize}
% \item Added support for MathJax equations with \cs{footnote}, \cs{footnotemark}.
% \margintag{MathJax}
@@ -2549,7 +2674,7 @@ This boolean may be tested by the user for later use.
% (-xy- diagram)
% \end{sourcedisplay}
% See \cref{sec:packagediagramname}.
-% \item Fix: Restoring various macros in a \env{lateximage} and similar situations.
+% \item Fix: Improved print/\HTML\ macro selection.
% \item Fix: \cs{href} text catcodes.
% \margintag{misc. fixes}
% \item Fix: \cs{subref} text.
@@ -2563,11 +2688,11 @@ This boolean may be tested by the user for later use.
% \item Added \pkg{algorithm2e}, \pkg{register}, \pkg{ltablex}, \pkg{xltabular},
% \pkg{xellipsis}, \pkg{trimclip}, \pkg{errata}, \pkg{vowel}, \pkg{xpiano}.
% \item Prevents \pkg{glossary}.
-% \item Verified works as-is with \pkg{gauss}, \pkg{phonrule}, \pkg{piano},
+% \item Tested to work as-is with \pkg{gauss}, \pkg{phonrule}, \pkg{piano},
% \pkg{SIunits}, \pkg{tikzcodeblocks}.
% \end{itemize}
% \needspace{2\baselineskip}
-% \item[v0.56:] \
+% \item[v0.56:] Shell escape, tabular packages.
% \begin{itemize}
% \item Added
% \margintag{\prog{lwarpmk}}
@@ -2591,11 +2716,11 @@ This boolean may be tested by the user for later use.
% \item Added \pkg{parnotes}, \pkg{quoting}, \pkg{lua-check-hyphen},
% \pkg{tocenter}, \pkg{underscore}.
% \margintag{packages}
-% \item Verified works as-is with \pkg{babelbib}, \pkg{bibunits}, \pkg{bodegraph},
+% \item Tested to work as-is with \pkg{babelbib}, \pkg{bibunits}, \pkg{bodegraph},
% \pkg{fast-diagram}, \pkg{nicematrix}, \pkg{structmech}.
% \end{itemize}
% \needspace{2\baselineskip}
-% \item[v0.55:] \
+% \item[v0.55:] Various fixes.
% \begin{itemize}
% \item Fix: Extraneous space in file links, which also
% \margintag{misc fixes}
@@ -2609,7 +2734,7 @@ This boolean may be tested by the user for later use.
% \item Added \pkg{clrdblpg}.
% \end{itemize}
% \needspace{2\baselineskip}
-% \item[v0.54:] \
+% \item[v0.54:] Float \cs{centering}, improved image checks.
% \begin{itemize}
% \item \progcode{lwarpmk limages} checks for the presence of the \HTML\ version
% \margintag{\prog{lwarpmk}}
@@ -2646,7 +2771,7 @@ This boolean may be tested by the user for later use.
% to process documents in an encoding other than UTF-8.
% See \cref{sec:fonts}.
%
-% \textcolor{red}{For an existing document, \watchout[Reset the configuration]
+% \textred{For an existing document, \watchout[Reset the configuration]
% recompile the print version with \prog{pdflatex}, \prog{xelatex}, or
% \prog{lualatex} a single time,
% to readjust the \filenm{lwarpmk.conf} configuration file,
@@ -2676,7 +2801,7 @@ This boolean may be tested by the user for later use.
% \item Prevents loading \pkg{ae}, \pkg{aecc}, \pkg{t1enc}, and \pkg{wasysym}.
% \end{itemize}
% \needspace{2\baselineskip}
-% \item[v0.53:] \
+% \item[v0.53:] Improved image checks.
% \begin{itemize}
% \item \prog{lwarpmk}: Added a warning about corrupted images due to the
% \margintag{\prog{lwarpmk}}
@@ -2686,7 +2811,7 @@ This boolean may be tested by the user for later use.
% \cmds{lwarpmk pdftohtml}.
% \end{itemize}
% \needspace{2\baselineskip}
-% \item[v0.52:] \
+% \item[v0.52:] Improved footnotes, \SVG\ math.
% \begin{itemize}
% \item Improved install instructions regarding \filenm{lwarp\_baseline\_marker.png}.
% \margintag{documentation}
@@ -2725,7 +2850,7 @@ This boolean may be tested by the user for later use.
% \item \pkg{url}: Fixes for active characters.
% \end{itemize}
% \needspace{2\baselineskip}
-% \item[v0.51:] \
+% \item[v0.51:] Improved \SVG\ math, added numerous chemistry packages.
% \begin{itemize}
% \item Docs: Added \nameref{sec:thingstoavoid}.
% \margintag{documentation}
@@ -2752,7 +2877,7 @@ This boolean may be tested by the user for later use.
% \pkg{epstopdf-base}, \pkg{grid}, \pkg{ltxgrid}.
% \end{itemize}
% \needspace{2\baselineskip}
-% \item[v0.50:] \
+% \item[v0.50:] Improved \SVG\ math.
% \begin{itemize}
% \item \SVG\ math and other \env{lateximage}s now are
% converted to \SVG\ using \margintag{\SVG\ math}
@@ -2942,11 +3067,11 @@ This boolean may be tested by the user for later use.
% boolean |FormatWP| is set |true|.
% See \cref{sec:wordprocessorconversion}.
% \begin{itemize}
-% \item \textcolor{red}{The} \watchout[name change]
-% \textcolor{red}{boolean |FormatWordProcessor| has
+% \item \textred{The} \watchout[name change]
+% \textred{boolean |FormatWordProcessor| has
% been renamed |FormatWP|.}
-% \item \textcolor{red}{The} \watchout[name change]
-% \textcolor{red}{boolean |HTMLMarkFloats| has
+% \item \textred{The} \watchout[name change]
+% \textred{boolean |HTMLMarkFloats| has
% been renamed |WPMarkFloats|.}
% \item New booleans control whether to place additional
% marks around minipages, at the table of contents,
@@ -2979,7 +3104,7 @@ This boolean may be tested by the user for later use.
% \item Improved \pkg{booktabs}: Width and trim are honored.
% \item Added \cs{mcolrowcell} for empty cells inside a \cs{multicolumnrow}.
% \watchout[new syntax]
-% \textcolor{red}{Use \cs{mcolrowcell} instead of \cs{mrowcell} for two-dimensional
+% \textred{Use \cs{mcolrowcell} instead of \cs{mrowcell} for two-dimensional
% cells created by \cs{multicolumnrow}.}
% Continue to use \cs{mrowcell} for empty cells in a \cs{multirow}.
% See \cref{sec:multicolumnmultirow} on \cpageref{sec:multicolumnmultirow}.
@@ -2996,7 +3121,7 @@ This boolean may be tested by the user for later use.
% \item Improved \pkg{graphics} \cs{graphicspath} support.
% \margintag{\cs{includegraphics} path}
% Multiple image directories may now be used.
-% \textcolor{red}{Refer to |.pdf| files without a file extension}
+% \textred{Refer to |.pdf| files without a file extension}
% \watchout[image file extensions]
% to allow the \HTML\ version
% to use a |.svg|, |.png|, |.jpg|, or |.gif| version instead.
@@ -3281,7 +3406,7 @@ This boolean may be tested by the user for later use.
% \item The old file |lwarp_html.xdy| may be deleted.
% \end{enumerate}
%
-% \item The new \pkg{lwarp} package option optn{xindyStyle} may be used to tell
+% \item The new \pkg{lwarp} package option \optn{xindyStyle} may be used to tell
% \prog{lwarpmk} to use a custom |.xdy| file instead of |lwarp.xdy|.
% See \cref{sec:modifyxindy}.
%
@@ -3671,12 +3796,18 @@ This boolean may be tested by the user for later use.
%
% Front \&\ back matter: & \pkg{abstract}, \pkg{appendix}. \\
%
-% Indexing: & \prog{texindy} is used, with hyperlinks. \pkg{idxlayout}. \\
+% Indexing: & \prog{makeindex} and \prog{xindy} are supported, with hyperlinks.
+%
+% \pkg{idxlayout}, \pkg{imakeidx}, \pkg{index}, \pkg{makeidx}, \pkg{repeatindex}, \pkg{splitidx}.
+%
+% Tested to work as-is: \pkg{hvindex}.\\
%
% Glossary: & \pkg{glossaries} and \prog{xindy} are used. \\
%
% Bibliography: & \pkg{babelbib}, \pkg{backref}, \pkg{biblatex}, \pkg{bibunits},
-% \pkg{chapterbib}, \pkg{cite}, \pkg{hypernat}, \pkg{natbib}. \\
+% \pkg{chapterbib}, \pkg{cite}, \pkg{hypernat}, \pkg{natbib}.
+%
+% Tested to work as-is: \pkg{notes2bib}. \\
%
% \midrule
%
@@ -3708,7 +3839,7 @@ This boolean may be tested by the user for later use.
% Theorems: & Native \LaTeX\ theorems,
% \pkg{amsthm}, \pkg{ntheorem}, \pkg{theorem}. \\
%
-% Additional math: & Math fonts via \SVG\ images, \pkg{resizegather}, \pkg{xy}.
+% Additional math: & Math fonts via \SVG\ images, \pkg{cases}, \pkg{resizegather}, \pkg{xy}.
%
% Tested to work as-is:
% \pkg{amscd}, \pkg{bm}, \pkg{braket}, \pkg{delarray}, \pkg{guass}, \pkg{nicematrix},
@@ -3839,6 +3970,12 @@ This boolean may be tested by the user for later use.
%
% \midrule
%
+% Files: &
+% \pkg{attachfile}, \pkg{attachfile2}, \pkg{hyperxmp}, \pkg{intopdf},
+% \pkg{pdfpages}, \pkg{pdfx}, \pkg{xmpincl}. \\
+%
+% \midrule
+%
% Science and engineering: &
% \pkg{algorithm2e}, \pkg{algorithmicx}, \pkg{axodraw2}, \pkg{bytefield},
% \pkg{chemfig}, \pkg{chemformula}, \pkg{chemgreek}, \pkg{chemmacros}, \pkg{chemnum},
@@ -4451,7 +4588,7 @@ This boolean may be tested by the user for later use.
% \end{description}
%
% \vfill
-% \textcolor{red}{\textbf{Any utilities installed by hand must be added to the |PATH|.}}
+% \textred{\textbf{Any utilities installed by hand must be added to the |PATH|.}}
% \vfill
%
%
@@ -4531,7 +4668,7 @@ This boolean may be tested by the user for later use.
%
% \begin{center}
% \footnotesize
-% \textcolor{red}{Note: There are two pages!}
+% \textred{Note: There are two pages!}
% \end{center}
%
% \small
@@ -4583,7 +4720,11 @@ This boolean may be tested by the user for later use.
% \item [|sample\_project.css|:] An example of a user-customized \CSS\ file,
% which may be used for project-specific changes to the \pkg{lwarp} defaults.
%
-% \item [|lwarp.xdy|:] Used by \pkg{lwarp} while creating an index.
+% \item [|lwarp.ist|:] Used by \pkg{lwarp} while creating an index using \prog{makeindex}.
+% This file should not be modified by the user.
+% A custom file may be used instead, if necessary.
+%
+% \item [|lwarp.xdy|:] Used by \pkg{lwarp} while creating an index using \prog{xindy}.
% This file should not be modified by the user.
% A custom file may be used instead, if necessary.
%
@@ -4650,9 +4791,11 @@ This boolean may be tested by the user for later use.
% Although, when using the utility \prog{latexmk} (introduced later), the changed date is
% ignored and an actual change in contents must occur to cause a recompile.}
%
-% \item Process the index.\index{index>processing}\footnote{A \cmds{lwarpmk printglossary} command is also
-% available to process a glossary produced with the \textsf{glossaries} package.
-% See \cref{sec:glossaries}.}\footnote{Also see \cref{sec:indextocbibind} for index options.}
+% \item Process the index.\index{index>processing}%
+% \footnote{The command \cmds{lwarpmk printglossary} is also
+% available to process a glossary produced with the \textsf{glossaries} package.
+% See \cref{sec:glossaries}.}%
+% \footnote{Also see \cref{sec:indexsetup} for index options.}
% \userentry{lwarpmk printindex}
%
% \item Recompile again to include the index.
@@ -4714,9 +4857,10 @@ This boolean may be tested by the user for later use.
% \userentry{lwarpmk html}
% \userentry{lwarpmk print}
%
-% \item Process the \HTML\ index and recompile:\index{index>processing}\footnote{A \texttt{lwarpmk htmlglossary} command is also
+% \item Process the \HTML\ index and recompile:\index{index>processing}
+% \footnote{The command \cmds{lwarpmk htmlglossary} is also
% available to process a glossary produced with the \textsf{glossaries} package.
-% See \cref{sec:glossaries}.}\footnote{Also see \cref{sec:indextocbibind} for index options.}
+% See \cref{sec:glossaries}.}\footnote{Also see \cref{sec:indexsetup} for index options.}
% \userentry{lwarpmk htmlindex}
% \userentry{lwarpmk html}
%
@@ -4797,7 +4941,7 @@ This boolean may be tested by the user for later use.
% \begin{sourcedisplay}
% \cs{usepackage}\{lwarp\} \\
% \dots \\
-% \textcolor{red}{\cs{CSSFilename}\{lwarp\_formal.css\}} \\
+% \textred{\cs{CSSFilename}\{lwarp\_formal.css\}} \\
% \dots \\
% \cs{begin}\{document\} \\
% \end{sourcedisplay}
@@ -4904,24 +5048,14 @@ This boolean may be tested by the user for later use.
% \pkg{lwarp} supports the \pkg{glossaries} package, although this tutorial
% does not supply an example.
%
-% \DescribeOption{xindyLanguage}
-% To assign the \prog{xindy} language and codepage to be used
-% while processing the index and glossary,
-% use the \optn{xindyLanguage} and \optn{xindyCodepage} options:
-% \index{language>glossary}
-% \index{language>index}
-% \index{glossary>language}
-% \index{index>language}
-%
-% \begin{Verbatim}[gobble=2,frame=lines]
-% \usepackage[xindyLanguage=english, xindyCodepage=utf8]{lwarp}
-% \end{Verbatim}
%
% \index{glossary>processing}
% To process the glossary for the print version:
% \index{glossary>processing}
% \userentry{lwarpmk printglossary}
%
+% \fquad (If \cmds{makeglossaries} is not found, see \cref{sec:glossaries}.)\watchout
+%
% To process the glossary for the \HTML\ version:
% \userentry{lwarpmk htmlglossary}
%
@@ -4931,7 +5065,7 @@ This boolean may be tested by the user for later use.
% \userentry{lwarpmk print1}
% \userentry{lwarpmk print}
%
-%
+% See \cref{sec:glossaries} to set options for processing glossaries.
%
%
% \clearpage
@@ -4977,7 +5111,7 @@ This boolean may be tested by the user for later use.
% During testing it may be useful to finish the \HTML\ conversion even when
% the document had errors and did not compile successfully. To attempt an
% \HTML\ conversion of an incomplete document:
-% \userentry{lwarpmk pdftohtml [project]}
+% \userentry{lwarpmk pdftohtml [-p project]}
%
%
% \subsection{Processing multiple projects in the same directory}
@@ -4995,8 +5129,8 @@ This boolean may be tested by the user for later use.
% \end{sourcedisplay}
%
% To compile each project with |lwarkmk|:
-% \userentry{lwarpmk print project\_a}
-% \userentry{lwarpmk html project\_b}
+% \userentry{lwarpmk print -p project\_a}
+% \userentry{lwarpmk html -p project\_b}
%
%
% \subsection{Using the \prog{make} utility}
@@ -5004,7 +5138,7 @@ This boolean may be tested by the user for later use.
% \prog{lwarpmk} has an action which may be useful for integration with the
% common \prog{make} utility:
% \begin{sourcedisplay}
-% |lwarpmk pdftohtml [project]|
+% |lwarpmk pdftohtml [-p project]|
% \end{sourcedisplay}
%
% \prog{make} may be used to compile the code to \PDF\ with \HTML\
@@ -5056,6 +5190,10 @@ This boolean may be tested by the user for later use.
% |*| columns, \pkg{multirow}, \pkg{longtable}, \pkg{supertabular}, \pkg{xtab},
% \pkg{bigdelim}. See \cref{sec:limitstabular}.
% \item Possible option clashes with \pkg{memoir}. See \cref{sec:limitsmemoir}.
+% \item If using indexes, see \cref{sec:indexsetup}.
+% \item If using many indexes, glossaries, |.aux| files, etc.,
+% see \cref{sec:indexsetup} regarding \pkg{morewrites}.
+% If \pkg{morewrites} is already used, be sure to add the setup with |allocate=10|.
% \item Other changes as per \nameref{sec:limitations}, \cref{sec:limitations}.
% \end{enumerate}
% \item Convert any \PDF\ images to \SVG. See \cref{sec:limitsgraphics}.
@@ -5226,7 +5364,11 @@ This boolean may be tested by the user for later use.
%
% The \pkg{lwarp} option \optn{xindyLanguage} may be used to set the language option
% for \pkg{xindy}, and the \optn{xindyCodepage} option may be used to set the codepage
-% option for \pkg{xindy}. These are used for both index and glossary generation.
+% option for \pkg{xindy}. These are used for
+% ^^A both
+% index
+% ^^A and glossary
+% generation.
%
%
% \clearpage
@@ -5236,25 +5378,42 @@ This boolean may be tested by the user for later use.
% \index{settings>lwarp package options}
%
% \begin{table}
-% \caption{Package options\label{tab:options}}
+% \caption{\pkg{lwarp} 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 \brand{MathJax}. \\
-% OSWindows & Force compatibility with \brand{MS-Windows}. \\
-% BaseJobname & The \cs{jobname} to use.
-% Set to the \cs{jobname} of the printed version even while generating \HTML. \\
+% latexmk & Boolean for \prog{lwarpmk} to use \prog{latexmk} for compiling documents. \\
% HomeHTMLFilename & The filename of the home page. \\
% HTMLFilename & A prefix for the filenames of the remaining web pages. \\
-% latexmk & Boolean for \prog{lwarpmk} to use \prog{latexmk} for compiling documents. \\
-% lwarpmk & Generate a local copy of \filenm{lwarpmk.lua}. \\
-% xindyLanguage & The \prog{xindy} language option used for index and glossary generation. \\
-% xindyCodepage & The \prog{xindy} codepage option used for index and glossary generation. \\
-% xindyStyle & Set a custom filename for \prog{xindy}. \\
+% \midrule
+% \multicolumn{2}{l}{\small For indexing (\cref{sec:indexsetup}) and glossaries (\cref{sec:glossaries}):} \\
+% makeindex & Use \prog{makeindex} to generate indices. \\
+% xindy & Use \prog{xindy} to generate indices. \\
+% makeindexStyle & Set a custom style for \prog{makeindex}. \\
+% xindyStyle & Set a custom style for \prog{xindy}. \\
+% xindyLanguage & The \prog{xindy} language option used for index
+% ^^A and glossary
+% generation. \\
+% xindyCodepage & The \prog{xindy} codepage option used for index
+% ^^A and glossary
+% generation. \\
+% PrintIndexCmd & Shell commands executed by \cmds{lwarpmk printindex}. \\
+% HTMLIndexCmd & Shell commands executed by \cmds{lwarpmk htmlindex}. \\
+% LatexmkIndexCmd & Shell commands executed by \prog{latexmk}. \\
+% GlossaryCmd & Shell command executed by \cmds{lwarpmk printglossary} and \cmds{lwarpmk htmlglossary}. \\
+% \midrule
+% \multicolumn{2}{l}{\small Seldom necessary:} \\
+% OSWindows & Force compatibility with \brand{MS-Windows}. \\
% pdftotextEnc & Set the encoding for \prog{pdftotext}. \\
+% lwarpmk & Generate a local copy of \filenm{lwarpmk.lua}. \\
+% \midrule
+% \multicolumn{2}{l}{\small Used internally by \pkg{lwarp}:} \\
+% warpprint & Generate print output, and also generate configuration files. \\
+% warpHTML & Generate \HTML\ output. \\
+% BaseJobname & The \cs{jobname} to use.
+% Set to the \cs{jobname} of the printed version even while generating \HTML. \\
% \bottomrule
% \end{tabular}
% \end{table}
@@ -5269,68 +5428,243 @@ This boolean may be tested by the user for later use.
% \DescribePackage{lwarp}
% \index{lwarp>loading}\index{lwarp>options}
%
-% \DescribeOption{warpprint}
-% \DescribeOption{warpHTML}
-% Usually controlled by \prog{lwarpmk}, and not set in the document.
-% Select the \optn{warpprint} option to generate print output (default),
-% or the \optn{warpHTML} option to generate \HTMLfive\ output.
-% The default is print output, so the print version may be
-% compiled with the usual \prog{pdflatex}, etc.
-% When \pkg{lwarp} is loaded in print mode, it creates
-% |<project>_html.tex|, which sets the \optn{warpHTML} option before calling
-% the user's source code |<project>.tex|. In this way, |<project>.tex|
-% can |\usepackage{lwarp}| without any options to create a printed version,
-% while |<project>_html.tex| will create an \HTML\ version.
+% \begin{description}
%
+% \item[\optn{mathsvg}, \optn{mathjax}:]
% \DescribeOption{mathsvg}
% \DescribeOption{mathjax}
-% For math display, select |mathsvg| (default), or |mathjax|.
+% For math display, select \optn{mathsvg} (default), or \optn{mathjax}.
% For more information about the math options, see \cref{sec:limitsmath}.
+%
%
-% \DescribeOption{OSWindows} See \cref{sec:OSportabilityusage} if using \brand{Windows}.
+% \item[\optn{latexmk}:]
+% \DescribeOption{latexmk}
+% \DescribeDefault{false} Tells \prog{lwarpmk} to use \prog{latexmk} to recompile the
+% document several times if necessary.
+% Otherwise, \prog{lwarpmk} attempts to determing for itself whether to recompile.
+% See \cref{sec:htmlsettings}.
%
-% \DescribeOption{BaseJobname}
-% \DescribeDefault{\cs{jobname}} 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}.
%
+% \item[\optn{HomeHTMLFilename}:]
% \DescribeOption{HomeHTMLFilename}
-% \DescribeDefault{\{\}} See \cref{sec:htmlsettings}. \\
+% \DescribeDefault{\{\}}
+% See \cref{sec:htmlsettings}.
+%
%
+% \item[\optn{HTMLFilename}:]
% \DescribeOption{HTMLFilename}
-% \DescribeDefault{\{\}} See \cref{sec:htmlsettings}. \\
+% \DescribeDefault{\{\}}
+% See \cref{sec:htmlsettings}.
%
-% \DescribeOption{xindyLanguage}
-% \DescribeDefault{english} If using an index or glossary,
-% see \cref{sec:handlingpackageoptions}. \\
%
-% \DescribeOption{xindyCodepage}
-% \DescribeDefault{utf8} If using an index or glossary,
-% see \cref{sec:handlingpackageoptions}. \\
+% \item[\optn{makeindex}:]
+% \DescribeOption{makeindex}
+% \DescribeDefault{makeindex} Sets \optn{PrintIndexCmd}, \optn{HTMLIndexCmd},
+% and \optn{LatexmkImageCmd}
+% to use \prog{makeindex} when generating indexes with
+% \cmds{lwarpmk printindex}, \cmds{lwarpmk htmlindex}, or \prog{latexmk}.
+% If neither \optn{makeindex} nor \optn{xindy} is used, \optn{makeindex} is assumed.
%
-% \DescribeOption{latexmk}
-% \DescribeDefault{false} Tells \prog{lwarpmk} to use \prog{latexmk} to recompile the
-% document several times if necessary.
-% Otherwise, \prog{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 \filenm{lwarpmk.lua} for archival or local-installation purposes,
-% compile the print version with the \optn{lwarpmk} option set.
-% See \cref{sec:handlingpackageoptions}.
+% \item[\optn{xindy}:]
+% \DescribeOption{xindy}
+% \DescribeDefault{makeindex} Sets \optn{PrintIndexCmd}, \optn{HTMLIndexCmd},
+% and \optn{LatexmkImageCmd}
+% to use \prog{xindy} when generating indexes with
+% \cmds{lwarpmk printindex}, \cmds{lwarpmk htmlindex}, or \prog{latexmk}.
+%
+%
+% \item[\optn{makeindexStyle}:]
+% \DescribeOption{makeindexStyle}
+% \DescribeDefault{lwarp.ist}
+% If you wish to use a custom |.ist| file for
+% index generation, see \cref{sec:handlingpackageoptions}.
%
+%
+% \item[\optn{xindyStyle}:]
% \DescribeOption{xindyStyle}
% \DescribeDefault{lwarp.xdy}
% If you wish to use a custom |.xdy| file for
-% index generation, see \cref{sec:handlingpackageoptions}. \\
+% index generation, see \cref{sec:handlingpackageoptions}.
+%
+%
+% \item[\optn{xindyLanguage}:]
+% \DescribeOption{xindyLanguage}
+% \DescribeDefault{english} If using an index or glossary,
+% see \cref{sec:handlingpackageoptions}.
+%
+%
+% \item[\optn{xindyCodepage}:]
+% \DescribeOption{xindyCodepage}
+% \DescribeDefault{utf8} If using an index,
+% ^^A or glossary,
+% see \cref{sec:handlingpackageoptions}.
+%
+%
+% \item[\optn{PrintIndexCmd}:]
+% \DescribeOption{PrintIndexCmd}
+% \DescribeDefault{<automatic>} Sets the shell commands executed by \cmds{lwarpmk printindex}.
+% If not specified, will be set by the selection of \optn{makeindex} or
+% \optn{xindy}. May be used to specify the creation of multiple indexes.
+% See \cref{sec:indexsetup}.
+%
+% \needspace{2\baselineskip}
+% Examples:
+% \begin{sourcedisplay}
+% \small
+% makeindex -s lwarp.ist projectname.idx \hfill (\prog{makeindex}) \\
+% xindy -M lwarp.xdy -L english -C utf8 projectname.idx \hfill (\prog{xindy})
+% \end{sourcedisplay}
+%
+% The use of the \optn{makeindex} or \optn{xindy} options sets \optn{PrintIndexCmd}
+% \margintag{automatic setting}
+% to sensible values for each of those programs while compiling a single index.
+% \pkg{lwarp}'s \optn{makeindexStyle}, \optn{xindyStyle},
+% \optn{xindyLanuage}, and \optn{xindyCodepage} options will be used if specified.
+%
+% If specifying \optn{PrintIndexCmd} manually,
+% \watchout[xindy]
+% be sure to assign an \prog{xindy}
+% language and codepage with the |-L| and |-C| \prog{xindy} options, as the
+% \prog{lwarp} \optn{xindyLanguage} and \optn{xindyCodepage} options are not
+% used for the \optn{PrintIndexCmd} option when it is set manually.
+%
+% This option is stored in the configuration files \filenm{lwarpmk.conf}
+% and \filenm{*.lwarpmkconf}, and is then passed by the \cmds{lwarpmk printindex}
+% command to the operating system to compile the print indexes.
+% Since the command string is parsed by \TeX, written to a file,
+% read from the file by Lua\TeX, and finally passed to the operating system,
+% any attempt at quoting will be problematic. For complicated commands,
+% it would be best to create a shell script, and simply refer to the script
+% with the \pkg{lwarp} \optn{PrintIndexCmd} option.
+%
+%
+% \item[\optn{HTMLIndexCmd}:]
+% \DescribeOption{HTMLIndexCmd}
+% \DescribeDefault{<automatic>} Sets the shell commands executed by \cmds{lwarpmk htmlindex}.
+% If not specified, will be set by the selection of \optn{makeindex} or
+% \optn{xindy}. May be used to specify the creation of multiple indexes.
+% See \cref{sec:indexsetup}.
+%
+% \needspace{2\baselineskip}
+% Example settings are similar to \optn{PrintIndexCmd},
+% \watchout[filenames]
+% but append |_html| to the filenames:
+% \begin{sourcedisplay}
+% \small
+% makeindex -s lwarp.ist projectname\textred{\_html}.idx \hfill (\prog{makeindex}) \\
+% xindy -M lwarp.xdy -L english -C utf8 projectname\textred{\_html}.idx \hfill (\prog{xindy})
+% \end{sourcedisplay}
+%
+% The use of the \optn{makeindex} or \optn{xindy} options sets \optn{HTMLIndexCmd}
+% \margintag{automatic setting}
+% to sensible values for each of those programs while compiling a single index.
+% \pkg{lwarp}'s \optn{makeindexStyle}, \optn{xindyStyle},
+% \optn{xindyLanuage}, and \optn{xindyCodepage} options will be used if specified.
+%
+% If specifying \optn{HTMLIndexCmd} manually,
+% \watchout[xindy]
+% be sure to assign an \prog{xindy}
+% language and codepage with the |-L| and |-C| \prog{xindy} options, as the
+% \prog{lwarp} \optn{xindyLanguage} and \optn{xindyCodepage} options are not
+% used for the \optn{HTMLIndexCmd} option when it is set manually.
+%
+% As with \optn{PrintIndexCmd}, to generate complicated indexes it may be
+% worthwhile to use a shell script, then refer to that script with \optn{HTMLIndexCmd}.
+%
+%
+% \item[\optn{LatexmkIndexCmd}:]
+% \DescribeOption{LatexmkIndexCmd}
+% \DescribeDefault{<automatic>} Sets the shell commands executed by \prog{latexmk}.
+% Unlike \optn{PrintIndexCmd} and \optn{HTMLIndexCmd}, \optn{LatexmkIndexCmd}
+% does not include any filenames, which will be provided instead by \prog{latexmk}.
+% See \cref{sec:indexsetup}.
+%
+% \needspace{2\baselineskip}
+% Example settings are similar to \optn{PrintIndexCmd}, but without a filename:
+% \begin{sourcedisplay}
+% \small
+% makeindex -s lwarp.ist \hfill (\prog{makeindex}) \\
+% xindy -M lwarp.xdy -L english -C utf8 \hfill (\prog{xindy})
+% \end{sourcedisplay}
+%
+% The use of the \optn{makeindex} or \optn{xindy} options sets \optn{LatexmkIndexCmd}
+% \margintag{automatic setting}
+% to either of the two settings show above.
+% \pkg{lwarp}'s \optn{makeindexStyle}, \optn{xindyStyle},
+% \optn{xindyLanuage}, and \optn{xindyCodepage} options will be used if specified.
+% Unlike \optn{PrintIndexCmd} and \optn{HTMLIndexCmd},
+% \prog{latexmk} uses either of the single-line settings of \optn{LatexmkIndexCmd}
+% shown above to compile each of multiple indexes if necessary.
+%
+% If specifying \optn{LatexmkIndexCmd} manually,
+% \watchout[xindy]
+% be sure to assign an \prog{xindy}
+% language and codepage with the |-L| and |-C| \prog{xindy} options, as the
+% \prog{lwarp} \optn{xindyLanguage} and \optn{xindyCodepage} options are not
+% used for the \optn{LatexmkIndexCmd} option when it is set manually.
+%
+%
+% \item[\optn{GlossaryCmd}:]
+% \DescribeOption{GlossaryCmd}
+% \DescribeDefault{\cmds{makeglossaries}} Sets the shell command
+% executed by \cmds{lwarpmk printglossary} and \cmds{lwarpmk htmlglossary}.
+% The print or \HTML\ glossary filename is appended to this command.
+% See \cref{sec:glossaries}.
%
+%
+% \item[\optn{OSWindows}:]
+% \DescribeOption{OSWindows} \pkg{lwarp} attempts to automatically sense \brand{Windows},
+% but it may be forced with this option.
+% See \cref{sec:OSportabilityusage}.
+%
+%
+% \item[\optn{pdftotextEnc}:]
% \DescribeOption{pdftotextEnc}
% \DescribeDefault{UTF-8} Used to specify
% the encoding used by \prog{pdftotext} during the \PDF-\HTML\ conversion.
% In most situations, the default is the correct choice.
%
%
+% \item[\optn{lwarpmk}:]
+% \DescribeOption{lwarpmk} If you wish to have \pkg{lwarp} generate a local
+% copy of \filenm{lwarpmk.lua} for archival or local-installation purposes,
+% compile the print version with the \optn{lwarpmk} option set.
+% See \cref{sec:handlingpackageoptions}.
+%
+% \begin{quote}
+% \hrule
+% The following options are used internally by \pkg{lwarp}, and
+% usually are not used in the user's document:
+% \smallskip
+% \hrule
+% \end{quote}
+%
+%
+% \item[\optn{warpprint} and \optn{warpHTML}:]
+% \DescribeOption{warpprint}
+% \DescribeOption{warpHTML}
+% Usually controlled by \prog{lwarpmk}, and not set in the document.
+% Select the \optn{warpprint} option to generate print output (default),
+% or the \optn{warpHTML} option to generate \HTMLfive\ output.
+% The default is print output, so the print version may be
+% compiled with the usual \prog{pdflatex}, etc.
+% When \pkg{lwarp} is loaded in print mode, it creates
+% |<project>_html.tex|, which sets the \optn{warpHTML} option before calling
+% the user's source code |<project>.tex|. In this way, |<project>.tex|
+% can |\usepackage{lwarp}| without any options to create a printed version,
+% while |<project>_html.tex| will create an \HTML\ version.
+%
+%
+% \item[\optn{BaseJobname}:]
+% \DescribeOption{BaseJobname}
+% \DescribeDefault{\cs{jobname}} 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}.
+%
+% \end{description}
+%
% \clearpage
%
% \subsection{Customizing the HTML output}
@@ -5340,8 +5674,9 @@ This boolean may be tested by the user for later use.
%
% \changes{v0.43}{2017/11/04}{Docs: HTML settings table.}
% \changes{v0.43}{2017/11/06}{Docs: Reorganized HTML customization.}
-% \begin{table}
+% \begin{table}[p]
% \caption{HTML settings}
+% \label{tab:htmlsettings}
% \begin{tabular}{>{\ttfamily}lp{3in}}
% \toprule
% Option & Description \\ \midrule
@@ -5365,7 +5700,8 @@ This boolean may be tested by the user for later use.
% \end{tabular}
% \end{table}
%
-% Several settings may be used to customize the \HTML\ output.
+% \Cref{tab:htmlsettings} shows 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,
@@ -5400,7 +5736,7 @@ This boolean may be tested by the user for later use.
% \index{underscore>filename}\index{file>underscore in name}
% \changes{v0.24}{2017/03/13}{Docs: Filename underscore.}
% \begin{sourcedisplay}
-% \cs{item} [\cs{href}\{file\textcolor{red}{\textbackslash\_}name.pdf\}\{text\}] \textbackslash
+% \cs{item} [\cs{href}\{file\textred{\textbackslash\_}name.pdf\}\{text\}] \textbackslash
% \end{sourcedisplay}
% See \cref{sec:filenameexamples} for examples of naming and numbering \HTML\ files.
%
@@ -5420,6 +5756,12 @@ This boolean may be tested by the user for later use.
% \ItemDescribeOption{mathjax} \DescribeDefault{false}
% Selects \brand{MathJax} for math output.
%
+% \ItemDescribeOption{makeindex} \DescribeDefault{makeindex}
+% Selects \prog{makeindex} for index generation by \prog{lwarpmk}.
+%
+% \ItemDescribeOption{xindy} \DescribeDefault{makeindex}
+% Selects \prog{xindy} for index generation by \prog{lwarpmk}.
+%
% \end{description} \bigskip
%
% \item[Placed in the preamble before \texttt{\cs{begin}\{document\}}:] \
@@ -5955,8 +6297,10 @@ This boolean may be tested by the user for later use.
%
% To disable the generation of \HTML\ description meta tags,
% \margintag{disabling}
-% use:\\
-% \hspace*{1em} |\HTMLDescription{}|
+% use:
+% \begin{sourcedisplay}
+% \fqquad \cs{HTMLDescription}\{\}
+% \end{sourcedisplay}
%
%
% \subsection{HTML page meta title}
@@ -5986,42 +6330,6 @@ This boolean may be tested by the user for later use.
% \cs{HTMLAuthor} may be used to set the meta tag to a simple list of names.
%
%
-% \subsection{Modifying \prog{xindy} index processing}
-% \label{sec:modifyxindy}
-%
-% \DescribeProgram{xindy}
-% \DescribeFile{lwarp.xdy}
-% \prog{lwarpmk} uses the file |lwarp.xdy| to process the index.
-% \index{lwarp.xdy>customizing}
-% \index{xindy>customizing}
-% This file is over-written by \pkg{lwarp} whenever a print version of
-% the document is processed.
-%
-% To customize index processing:
-% \begin{enumerate}
-% \item Copy |lwarp.xdy| to a new filename such as |projectname.xdy|
-% \item Make changes to |projectname.xdy|.
-% Keep the line which says
-% \begin{Verbatim}[gobble=2,tabsize=4]
-% (markup-locref :open "\hyperindexref{" :close "}")
-% \end{Verbatim}
-% This line creates the hyperlinks for the \HTML\ index. During print output
-% \cs{hyperindexref} becomes a null function.
-% \item In the document source use the \optn{xindyStyle} option for \pkg{lwarp}:
-% \DescribeOption{xindyStyle}
-% \begin{Verbatim}[gobble=2,tabsize=4]
-% \usepackage[
-% ... other options ...
-% xindyStyle=projectname.xdy,
-% ]{lwarp}
-% \end{Verbatim}
-% \item Recompile the print version, which causes
-% \pkg{lwarp} to rewrite the |lwarpmk.conf| configuration file.
-% This tells \prog{lwarpmk} to use the custom |projectname.xdy| file instead of |lwarp.xdy|.
-% \end{enumerate}
-%
-%
-%
%
% \section{Special cases and limitations}
% \label{sec:limitations}
@@ -6269,9 +6577,9 @@ This boolean may be tested by the user for later use.
% \cs{ref}\{sec:name\} on page \cs{pageref}\{sec:name\} \\
% \rmfamily
% \hspace*{-2em} in \HTML\ becomes: \\
-% ``Sec.~\textcolor{red}{1.23}
+% ``Sec.~\textred{1.23}
% on page (\textbf{see}
-% sec.~\textcolor{red}{1.23})''.
+% sec.~\textred{1.23})''.
% \end{sourcedisplay}
% \cs{pagerefPageFor} may be redefined to ``page for '', empty, etc.
% See \cpageref{sec:pagerefpagefor}.
@@ -6418,7 +6726,7 @@ This boolean may be tested by the user for later use.
% \subsubsection{BibTeX}
% \label{sec:limitsbibtex}
% \index{BibTeX>\cs{etalchar} error}
-% \index{warning>Improper \cs{prevdepth}.}
+% \index{error>Improper \cs{prevdepth}.}
% \index{Improper \cs{prevdepth}.}
% \DescribeMacro{\etalchar} Displays a superscript ``+'' to indicate ``and others''.
% \changes{v0.54}{2018/03/09}{Docs: BibTeX.}
@@ -6430,21 +6738,666 @@ This boolean may be tested by the user for later use.
% \label{sec:glossaries}
%
% \DescribePackage{glossaries}
+% \index{glossary>options}
+% \index{language>glossary}
+% \index{glossary>language}
% \limitsglossaries
%
%
-% \subsubsection{Index and the \pkg{tocbibind} package}
-% \label{sec:indextocbibind}
-% \index{index>placement and \acro{TOC} options}
+% \subsubsection{Indexing overview}
+% \label{sec:indexingoverview}
%
-% \changes{v0.38}{2017/08/24}{Docs: Index, \pkg{tocbibind}.}
+% There are many ways to process indexes for a \LaTeX\ document,
+% including native \LaTeX\ capabilities, a number of packages and classes,
+% the possible availability of shell escape and \prog{latexmk}, and the
+% need to process print and \HTML\ versions.
+% \pkg{lwarp} attempts to provide easy recompilation of indexes along with
+% the rest of the document, but the various indexing options must be set correctly.
+% Numerous examples are given below.
+% Some differ in minor details, so the important parts are highlighted in red,
+% and options are in green.
+%
+% Once set up properly, the entire document may be recompiled with
+% \cmds{lwarpmk print} and \cmds{lwarpmk html}.
+% In some cases, it will also be necessary to compile the indexes with
+% \cmds{lwarpmk printindex} and \cmds{lwarpmk htmlindex}.
+% A recompile may then be forced with \cmds{lwarpmk print1} and \cmds{lwarpmk html1}.
+%
+% The user may continue to process indexes manually or by shell script
+% \margintag{manual processing}
+% without the use of \prog{lwarpmk}, but adjustments will be required to
+% process \HTML\ indexes as well. In general, \filenm{*.idx} and \filenm{*.ind} files
+% will be accompanied by \filenm{*\_html.idx} and \filenm{*\_html.ind} files.
%
-% \limitsindex
+% If using a custom indexing style file,
+% \margintag{custom index style}
+% see \cref{sec:modifymakeindex,sec:modifyxindy}.
%
% See \cref{sec:index} for \pkg{lwarp}'s core index and glossary code,
-% and \cref{sec:tocbibind} for \pkg{tocbibind}.
+% \margintag{source code}
+% \index{index>source code}
+% \cref{sec:indexpkg} for \pkg{index},
+% \cref{sec:splitidx} for \pkg{splitidx},
+% \cref{sec:imakeidx} for \pkg{imakeidx},
+% \cref{sec:tocbibind} for \pkg{tocbibind},
+% and \cref{sec:memoirbackmatter} for \pkg{memoir}'s indexing patches.
%
%
+% \subsubsection{Indexing with basic \LaTeX\ and \pkg{makeidx}}
+% \label{sec:indexsetup}
+%
+% \changes{v0.38}{2017/08/24}{Docs: Index, \pkg{tocbibind}.}
+% \changes{v0.58}{2018/06/14}{Docs: Index, \prog{makeindex}, \pkg{imakeidx}.}
+%
+% \index{xindy>and hyperref}
+% \index{hyperref>and xindy}
+% \index{index>xindy and hyperref}
+% \index{index>missing entries}
+% \index{index>see, seealso, ranges}
+% \index{index>processing}
+%
+% The following allow the user to process indexes automatically, or
+% \margintag{\prog{lwarpmk} processing}
+% using \prog{lwarpmk}'s commands:
+% \userentry{lwarpmk printindex}
+% \userentry{lwarpmk htmlindex}
+%
+% \begin{description}
+%
+% \needspace{2\baselineskip}
+% \item [For a single index using \prog{makeindex}:]
+% \begin{sourcedisplay}
+% \cs{usepackage}\textred{[makeindex\textgreen{,latexmk}]}
+% \{\textblue{lwarp}\}
+% \end{sourcedisplay}
+% The usual \filenm{.idx} and \filenm{.ind} files will be used,
+% along with the new \filenm{lwarp.ist} style file.
+% When creating the \HTML\ index, ``\texttt{\_html}'' is automatically appended
+% to each of the names.
+%
+% \prog{lwarpmk} will use \prog{latexmk} if specified, in which case
+% \prog{latexmk} will create the index automatically.
+% Otherwise, use \userentry{lwarpmk printindex} \userentry{lwarpmk htmlindex}
+% to compile the indexes.
+%
+% \needspace{8\baselineskip}
+% \item [For a single index using \prog{xindy}:]
+% \begin{sourcedisplay}
+% \cs{usepackage}[ \\
+% \fqquad \textred{xindy,} \\
+% \fqquad \textgreen{xindyLanguage=english,} \hfill \textrm{<optional>} \\
+% \fqquad \textgreen{xindyCodepage=utf8,} \hfill \textrm{<optional>} \\
+% \fqquad \textgreen{latexmk} \hfill \textrm{<optional>}\\
+% ]\{\textblue{lwarp}\}
+% \end{sourcedisplay}
+% The usual \filenm{.idx} and \filenm{.ind} files will be used,
+% along with the new \filenm{lwarp.xdy} style file.
+%
+% \prog{lwarpmk} will use \prog{latexmk} if specified, in which case
+% \prog{latexmk} will create the index automatically.
+% Otherwise, use \userentry{lwarpmk printindex} \userentry{lwarpmk htmlindex}
+% to compile the indexes.
+% \end{description}
+%
+%
+% \subsubsection{Indexing with \pkg{index}}
+%
+% \pkg{lwarp} is told how to use \prog{makeindex} using the
+% \optn{PrintIndexCmd} and \optn{HTMLIndexCmd} options.
+% The file \filenm{lwarp.ist} is specified, which generates index letter heads for
+% print output and also allows special \HTML\ formatting for \HTML\ output.
+%
+% \begin{description}
+%
+% \needspace{20\baselineskip}
+% \item [For multiple indexes using \prog{makeindex} and \pkg{index}:] \
+%
+% \textgreen{
+% (Assuming that the second index has file extensions \filenm{.sist} and \filenm{.sind})
+% }
+% \begin{sourcedisplay}
+% \cs{usepackage}[ \\
+% \fquad\textred{makeindex,} \textgreen{latexmk,} \\
+% \fquad\textred{PrintIndexCmd}=\{ \\
+% \fqquad makeindex -s lwarp.ist <projectname>.idx \textred{;} \\
+% \fqquad makeindex -s lwarp.ist \\
+% \fqqquad -o <projectname>\textred{.sind} <projectname>\textred{.sidx} \\
+% \fquad\}, \\
+% \fquad\textred{HTMLIndexCmd}=\{ \\
+% \fqquad makeindex -s lwarp.ist <projectname>\textred{\_html}.idx \textred{;} \\
+% \fqquad makeindex -s lwarp.ist \\
+% \fqqquad -o <projectname>\textred{\_html.sind} <projectname>\textred{\_html.sidx} \\
+% \fquad\} \\
+% ]\{\textblue{lwarp}\} \\
+% \cs{usepackage}\{\textblue{index}\} \\
+% \dots \\
+% \cs{makeindex} \\
+% \cs{newindex}\{secondname\}\{\textred{sidx}\}\{\textred{sind}\}\{Second Index\}
+% \end{sourcedisplay}
+% \emph{For \brand{Windows}, replace the two ``;'' characters with ``\&''.}\watchout[\brand{Windows}]
+%
+% When creating the \HTML\ index, ``\texttt{\_html}'' is automatically appended
+% to the index filenames.
+%
+% Use \userentry{lwarpmk printindex} \userentry{lwarpmk htmlindex}
+% to compile the indexes.
+%
+% If the \optn{latexmk} option is selected for \pkg{lwarp},
+% \prog{latexmk} will compile the document but will \emph{not} compile the indexes.
+% \cmds{lwarpmk printindex} and \cmds{lwarpmk htmlindex} will still be required.
+%
+% \end{description}
+%
+%
+% \subsubsection{Indexing with \pkg{splitidx}}
+%
+% \pkg{lwarp} is told how to use \prog{splitindex} using the
+% \optn{PrintIndexCmd} and \optn{HTMLIndexCmd} options.
+% The file \filenm{lwarp.ist} is specified, which generates index letter heads for
+% print output and also allows special \HTML\ formatting for \HTML\ output.
+%
+% \limitssplitidx
+%
+% \begin{description}
+%
+% \needspace{16\baselineskip}
+% \item [For multiple indexes using \prog{makeindex} and \pkg{splitidx}:]
+% \begin{sourcedisplay}
+% \cs{usepackage}[ \\
+% \fquad\textred{makeindex,} \textgreen{latexmk,} \\
+% \fquad\textred{PrintIndexCmd}=\{ \\
+% \fqquad splitindex <projectname> \textred{-\/- -s lwarp.ist} \\
+% \fquad\}, \\
+% \fquad\textred{HTMLIndexCmd}=\{ \\
+% \fqquad splitindex <projectname>\textred{\_html} \textred{-\/- -s lwarp.ist} \\
+% \fquad\} \\
+% ]\{\textblue{lwarp}\} \\
+% \cs{usepackage}\{\textblue{splitidx}\} \\
+% \dots \\
+% \cs{makeindex} \\
+% \cs{newindex}[Second Index]\{secondname\} \\
+% \end{sourcedisplay}
+% When creating the \HTML\ index, ``\texttt{\_html}'' is automatically appended
+% to each of the names.
+%
+% Use \userentry{lwarpmk printindex} \userentry{lwarpmk htmlindex}
+% to compile the indexes.
+%
+% \needspace{18\baselineskip}
+% \item [For multiple indexes using \prog{xindy} and \pkg{splitidx}:]
+% \begin{sourcedisplay}
+% \cs{usepackage}[ \\
+% \fquad\textred{xindy,} \textgreen{latexmk,} \\
+% \fquad\textred{PrintIndexCmd}=\{ \\
+% \fqquad splitindex \textred{-m xindy} <projectname> \textred{-\/- -M lwarp.xdy} \\
+% \fqqquad \textgreen{-L english -C utf8} \hfill{<optional>} \\
+% \fquad\}, \\
+% \fquad\textred{HTMLIndexCmd}=\{ \\
+% \fqquad splitindex \textred{-m xindy} <projectname>\textred{\_html} \textred{-\/- -M lwarp.xdy} \\
+% \fqqquad \textgreen{-L english -C utf8} \hfill{<optional>} \\
+% \fquad\} \\
+% ]\{\textblue{lwarp}\} \\
+% \cs{usepackage}\{\textblue{splitidx}\} \\
+% \dots \\
+% \cs{makeindex} \\
+% \cs{newindex}[Second Index]\{secondname\} \\
+% \end{sourcedisplay}
+% When creating the \HTML\ index, ``\texttt{\_html}'' is automatically appended
+% to each of the names.
+%
+% Use \userentry{lwarpmk printindex} \userentry{lwarpmk htmlindex}
+% to compile the indexes.
+%
+% \end{description}
+%
+%
+%
+%
+% \subsubsection{Indexing with \pkg{imakeidx}}
+% \label{sec:indexingimakeidx}
+%
+% Due to the number of methods which may be used to process multiple indexes,
+% the options for style file and \prog{xindy} language and codepage must be
+% specified in one of several different ways. These are described in detail later in
+% this section, but are summarized here.
+%
+% If shell escape is used, \pkg{imakeidx} will automatically compile the indexes by itself.
+% Options specifying a custom style file and \prog{xindy} language and
+% codepage must be specified for each \cs{makeindex} command using its
+% \optn{options=} option, which must include
+% \pkg{lwarp}'s special \filenm{lwarp.ist} or \filenm{lwarp.xdy} file,
+% or a file based on them.
+% If using a custom indexing style file, see \cref{sec:modifymakeindex,sec:modifyxindy}.
+% The \optn{splitindex} option is also available of shell escape is used,
+% in which case the \pkg{splitidx} package and \prog{splitindex} program will also be used.
+%
+% If shell escape is not possible, \prog{latexmk} may be used to
+% automatically compile the indexes.
+% The style, language, and codepage options are specified with \pkg{lwarp}'s
+% \optn{makeindexStyle}, \optn{xindyStyle}, \optn{xindyLanguage}, and
+% \optn{xindyCodepage} options. These are passed to \prog{latexmk} by
+% \prog{lwarpmk}'s \cmds{lwarpmk} \cmds{printindex} and \cmds{lwarpmk} \cmds{htmlindex} commands.
+%
+% Where shell escape and \prog{latexmk} are not possible,
+% \prog{lwarpmk} may be used to manually compile the indexes.
+% \pkg{lwarp}'s \optn{PrintIndexCmd} and \optn{HTMLIndexCmd} options are used.
+%
+% \begin{description}
+% \needspace{2\baselineskip}
+% \item [For a single or multiple indexes using \prog{makeindex} and \pkg{imakeidx}:] \
+%
+% The index style \filenm{lwarp.ist} is automatically used for \HTML\ output.
+% This file turns on letter headings, so it may be desirable to specify it as
+% an option, in which case it will also be used for print output, which will
+% help match the print and \HTML\ output.
+% \begin{sourcedisplay}
+% \cs{usepackage}\textred{[makeindex\textgreen{,latexmk}]}
+% \{\textblue{lwarp}\} \\
+% \cs{usepackage}\textred{[makeindex]}\{\textblue{imakeidx}\} \\
+% \dots \\
+% \cs{makeindex}[\textgreen{options=\{-s lwarp.ist\}}] \\
+% \cs{makeindex}[name=secondname,\textgreen{options=\{-s lwarp.ist\}}] \\
+% \end{sourcedisplay}
+% \pkg{imakeidx} will automatically compile the indexes.
+% Shell escape is not required while using \prog{makeindex}.
+% \optn{latexmk} may be specified, and if so it will be used for
+% \cmds{lwarpmk print} and \cmds{lwarpmk html}, but \prog{imakeidx} will actually
+% create the indexes.
+%
+% \needspace{2\baselineskip}
+% \item [For a single or multiple indexes using \prog{makeindex} and \prog{splitindex} with \pkg{imakeidx}:] \
+%
+% The index style \filenm{lwarp.ist} is automatically used for \HTML\ output.
+% This file turns on letter headings, so it may be desirable to specify it as
+% an option, in which case it will also be used for print output, which will
+% help match the print and \HTML\ output.
+% \begin{sourcedisplay}
+% \cs{usepackage}\textred{[makeindex\textgreen{,latexmk}]}
+% \{\textblue{lwarp}\} \\
+% \cs{usepackage}\textred{[makeindex,splitindex]}\{\textblue{imakeidx}\} \\
+% \dots \\
+% \cs{makeindex}[\textgreen{options=\{-s lwarp.ist\}}] \\
+% \cs{makeindex}[name=secondname,\textgreen{options=\{-s lwarp.ist\}}] \\
+% \end{sourcedisplay}
+% Shell escape is required while using \prog{splitindex}.
+% For the first compile, use
+% \watchout[enable shell escape]
+% \userentry{pdflatex \textred{-shell-escape} projectname.tex}
+% \userentry{pdflatex \textred{-\/-enable-write18} projectname.tex \quad \textrm{(MikTeX)}}
+% or similar with \prog{xelatex} or \prog{lualatex}.
+% \prog{lwarp} will remember that shell escape was used.
+%
+% \prog{imakeidx} will automatically execute \prog{splitindex},
+% and will also use \prog{makeindex} to compile the indexes.
+%
+% \optn{latexmk} may be specified, and if so it will be used for
+% \cmds{lwarpmk print} and \cmds{lwarpmk html}, but \prog{imakeidx} will actually
+% create the indexes.
+%
+% \needspace{2\baselineskip}
+% \item [For multiple indexes using \prog{xindy} and \pkg{imakeidx}, using shell escape:] \
+%
+% Options may be given to \pkg{imakeidx}'s \cs{makeindex} command.
+% The style file \filenm{lwarp.xdy} is automatically used for \HTML\ output,
+% and is not necessary for print output since the output will be similar.
+% If language or codepage must be set, they should be specified as
+% options for \cs{makeindex}, since \pkg{imakeidx} will process the indexes.
+% \begin{sourcedisplay}
+% \cs{usepackage}\textred{[xindy\textgreen{,latexmk}]}
+% \{\textblue{lwarp}\} \\
+% \cs{usepackage}\textred{[xindy\textgreen{,splitindex}]}\{\textblue{imakeidx}\} \\
+% \dots \\
+% \cs{makeindex}[ \\
+% \fquad \textgreen{options=\{ -M lwarp.xdy \textgreen{-L english -c utf8} \}} \\
+% ] \\
+% \cs{makeindex}[ \\
+% \fquad name=secondname, \\
+% \fquad \textgreen{options=\{ -M lwarp.xdy \textgreen{-L english -c utf8} \}} \\
+% ] \\
+% \end{sourcedisplay}
+% For the first compile, use
+% \watchout[enable shell escape]
+% \userentry{pdflatex \textred{-shell-escape} projectname.tex}
+% \userentry{pdflatex \textred{-\/-enable-write18} projectname.tex \quad \textrm{(MikTeX)}}
+% or similar with \prog{xelatex} or \prog{lualatex}.
+% \prog{lwarp} will remember that shell escape was used.
+%
+% \prog{imakeidx} will automatically execute \prog{splitindex} if selected,
+% and will also use \prog{xindy} to compile the indexes.
+%
+% If selected, \prog{latexmk} will automatically recompile the entire document
+% as necessary.
+%
+% \needspace{14\baselineskip}
+% \item [For indexes using \prog{xindy} and \prog{imakeidx}, without shell escape,
+% but \emph{with} \prog{latexmk}:] \
+%
+% \pkg{lwarp}'s options are used, and are passed to \prog{latexmk}.
+%
+% \begin{sourcedisplay}
+% \cs{usepackage}[ \\
+% \fquad\textred{xindy,} \\
+% \fquad \textgreen{xindyLanguage=english,} \hfill \textrm{<optional>} \\
+% \fquad \textgreen{xindyCodepage=utf8,} \hfill \textrm{<optional>} \\
+% \fquad\textred{latexmk,} \\
+% ]\{\textblue{lwarp}\} \\
+% \cs{usepackage}\textred{[xindy]}\{\textblue{imakeidx}\} \\
+% \dots \\
+% \cs{makeindex} \\
+% \cs{makeindex}[name=secondname] \\
+% \end{sourcedisplay}
+% \prog{latexmk} will create the indexes automatically when
+% \cmds{lwarpmk print} and \cmds{lwarpmk html} are executed.
+%
+% \needspace{20\baselineskip}
+% \item [For indexes using \prog{xindy} and \prog{imakeidx}, without shell escape,
+% and \emph{without} \prog{latexmk}:] \
+%
+% \prog{lwarpmk} must be told how to create the indexes:
+% \begin{sourcedisplay}
+% \cs{usepackage}[ \\
+% \fquad\textred{xindy,} \\
+% \fquad\textred{PrintIndexCmd}=\{ \\
+% \fqquad xindy \textred{-M lwarp.xdy} \textgreen{-L english -C utf8} \\
+% \fqqquad <projectname>.idx \textred{;} \\
+% \fqquad xindy \textred{-M lwarp.xdy} \textgreen{-L english -C utf8} \\
+% \fqqquad secondname.idx \\
+% \fquad\}, \\
+% \fquad\textred{HTMLIndexCmd}=\{ \\
+% \fqquad xindy \textred{-M lwarp.xdy} \textgreen{-L english -C utf8} \\
+% \fqqquad <projectname>\textred{\_html}.idx \textred{;} \\
+% \fqquad xindy \textred{-M lwarp.xdy} \textgreen{-L english -C utf8} \\
+% \fqqquad secondname\textred{\_html}.idx \\
+% \fquad\} \\
+% ]\{\textblue{lwarp}\} \\
+% \cs{usepackage}\textred{[xindy]}\{\textblue{imakeidx}\} \\
+% \dots \\
+% \cs{makeindex} \\
+% \cs{makeindex}[name=secondname] \\
+% \end{sourcedisplay}
+% \emph{For \brand{Windows}, replace the two ``;'' characters with ``\&''.}\watchout[\brand{Windows}]
+%
+% \texttt{<projectname>} is the \cs{jobname}:
+% if compiling ``\filenm{name.tex}'', use the filenames \filenm{name.idx} and
+% \filenm{name\_html.idx}.
+%
+% Use \userentry{lwarpmk printindex} \userentry{lwarpmk htmlindex}
+% to compile the indexes.
+% \end{description}
+%
+%
+% \subsubsection{Indexes with \pkg{memoir}}
+%
+% \begin{description}
+% \needspace{7\baselineskip}
+% \item [For a single index with \pkg{memoir} and \pkg{makeindex}:]
+% \begin{sourcedisplay}
+% \cs{documentclass}\{\textblue{memoir}\} \\
+% \cs{usepackage}\textred{[makeindex\textgreen{,latexmk}]}\{\textblue{lwarp}\} \\
+% \dots \\
+% \cs{makeindex}
+% \end{sourcedisplay}
+% The usual \filenm{.idx} and \filenm{.ind} files will be used,
+% along with the \filenm{lwarp.ist} style file.
+%
+% \prog{lwarpmk} will use \prog{latexmk} if specified, in which case
+% \prog{latexmk} will create the index automatically.
+% Otherwise, use \userentry{lwarpmk printindex} \userentry{lwarpmk htmlindex}
+% to compile the indexes.
+%
+% \needspace{9\baselineskip}
+% \item [For multiple indexes with \pkg{memoir} and \pkg{makeindex},
+% using \prog{latexmk}:] \
+%
+% \pkg{lwarp}'s options are used, and are passed to \prog{latexmk}.
+% \begin{sourcedisplay}
+% \cs{documentclass}\{\textblue{memoir}\} \\
+% \cs{usepackage}\textred{[makeindex,latexmk]}\{\textblue{lwarp}\} \\
+% \dots \\
+% \cs{makeindex} \\
+% \cs{makeindex}[secondname]
+% \end{sourcedisplay}
+% \prog{lwarpmk} will use \prog{latexmk} to create the indexes automatically
+% when the user executes \cmds{lwarpmk print} and \cmds{lwarpmk html}.
+%
+% \needspace{19\baselineskip}
+% \item [For multiple indexes with \pkg{memoir} and \pkg{makeindex},
+% \emph{without} \pkg{latexmk}:] \
+%
+% \prog{lwarpmk} must be told how to create the indexes:
+% \begin{sourcedisplay}
+% \cs{documentclass}\{\textblue{memoir}\} \\
+% \cs{usepackage}[ \\
+% \fquad\textred{makeindex,} \\
+% \fquad\textred{PrintIndexCmd}=\{ \\
+% \fqquad makeindex \textred{-s lwarp.ist} <projectname>.idx \textred{;} \\
+% \fqquad makeindex \textred{-s lwarp.ist} secondname.idx \\
+% \fquad\}, \\
+% \fquad\textred{HTMLIndexCmd}=\{ \\
+% \fqquad makeindex \textred{-s lwarp.ist} <projectname>\textred{\_html}.idx \textred{;} \\
+% \fqquad makeindex \textred{-s lwarp.ist} secondname\textred{\_html}.idx \\
+% \fquad\} \\
+% ]\{\textblue{lwarp}\} \\
+% \dots \\
+% \cs{makeindex} \\
+% \cs{makeindex}[secondname] \\
+% \end{sourcedisplay}
+% \emph{For \brand{Windows}, replace the two ``;'' characters with ``\&''.}\watchout[\brand{Windows}]
+%
+% \texttt{<projectname>} is the \cs{jobname}:
+% if compiling ``\filenm{name.tex}'', use the filenames \filenm{name.idx} and
+% \filenm{name\_html.idx}.
+%
+% Use \userentry{lwarpmk printindex} \userentry{lwarpmk htmlindex}
+% to compile the indexes.
+%
+% \needspace{13\baselineskip}
+% \item [For a single index with \pkg{memoir} and \pkg{xindy}:]
+% \begin{sourcedisplay}
+% \cs{documentclass}\{\textblue{memoir}\} \\
+% \cs{usepackage}[ \\
+% \fqquad \textred{xindy,} \\
+% \fqquad \textgreen{xindyLanguage=english,} \hfill \textrm{<optional>} \\
+% \fqquad \textgreen{xindyCodepage=utf8,} \hfill \textrm{<optional>} \\
+% \fqquad \textgreen{latexmk} \hfill \textrm{<optional>}\\
+% ]\{\textblue{lwarp}\} \\
+% \dots \\
+% \textred{\cs{xindyindex}} \\
+% \cs{makeindex}
+% \end{sourcedisplay}
+% The usual \filenm{.idx} and \filenm{.ind} files will be used,
+% along with the \filenm{lwarp.xdy} style file.
+%
+% \prog{lwarpmk} will use \prog{latexmk} if specified, in which case
+% \prog{latexmk} will create the index automatically.
+% Otherwise, use \userentry{lwarpmk printindex} \userentry{lwarpmk htmlindex}
+% to compile the indexes.
+%
+% \needspace{17\baselineskip}
+% \item [For multiple indexes with \pkg{memoir} and \pkg{xindy},
+% using \pkg{latexmk}:] \
+%
+% \pkg{lwarp}'s options are used, and are passed to \prog{latexmk}.
+% \begin{sourcedisplay}
+% \cs{documentclass}\{\textblue{memoir}\} \\
+% \cs{usepackage}[ \\
+% \fqquad \textred{xindy,} \\
+% \fqquad \textgreen{xindyLanguage=english,} \hfill \textrm{<optional>} \\
+% \fqquad \textgreen{xindyCodepage=utf8,} \hfill \textrm{<optional>} \\
+% \fqquad \textred{latexmk} \\
+% ]\{\textblue{lwarp}\} \\
+% \dots \\
+% \textred{\cs{xindyindex}} \\
+% \cs{makeindex} \\
+% \cs{makeindex}[secondname] \\
+% \end{sourcedisplay}
+% \prog{lwarpmk} will use \prog{latexmk} to create the indexes automatically.
+%
+% \needspace{24\baselineskip}
+% \item [For multiple indexes with \pkg{memoir} and \pkg{xindy},
+% \emph{without} \pkg{latexmk}:] \
+%
+% \prog{lwarpmk} must be told how to create the indexes:
+% \begin{sourcedisplay}
+% \cs{documentclass}\{\textblue{memoir}\} \\
+% \cs{usepackage}[ \\
+% \fquad\textred{xindy,} \\
+% \fquad\textred{PrintIndexCmd}=\{ \\
+% \fqquad xindy \textred{-M lwarp.xdy} \textgreen{-L english -C utf8} \\
+% \fqqquad <projectname>.idx \textred{;} \\
+% \fqquad xindy \textred{-M lwarp.xdy} \textgreen{-L english -C utf8} \\
+% \fqqquad secondname.idx \\
+% \fquad\}, \\
+% \fquad\textred{HTMLIndexCmd}=\{ \\
+% \fqquad xindy \textred{-M lwarp.xdy} \textgreen{-L english -C utf8} \\
+% \fqqquad <projectname>\textred{\_html}.idx \textred{;} \\
+% \fqquad xindy \textred{-M lwarp.xdy} \textgreen{-L english -C utf8} \\
+% \fqqquad secondname\textred{\_html}.idx \\
+% \fquad\} \\
+% ]\{\textblue{lwarp}\} \\
+% \dots \\
+% \textred{\cs{xindyindex}} \\
+% \cs{makeindex} \\
+% \cs{makeindex}[secondname] \\
+% \end{sourcedisplay}
+% \emph{For \brand{Windows}, replace the four ``;'' characters with ``\&''.}\watchout[\brand{Windows}]
+%
+% \texttt{<projectname>} is the \cs{jobname}:
+% if compiling ``\filenm{name.tex}'', use the filenames \filenm{name.idx} and
+% \filenm{name\_html.idx}.
+%
+% Use \userentry{lwarpmk printindex} \userentry{lwarpmk htmlindex}
+% to compile the indexes.
+% \end{description}
+%
+%
+% \subsubsection{Using a custom \prog{makeindex} style file}
+% \label{sec:modifymakeindex}
+%
+% \DescribeProgram{makeindex}
+% \DescribeFile{lwarp.ist}
+% When using \prog{makeindex}, \prog{lwarpmk} uses the file |lwarp.ist| to process the index.
+% \index{lwarp.ist>customizing}
+% \index{makeindex>customizing}
+% \index{index>custom \pkg{makeindex} style file}
+% This file is over-written by \pkg{lwarp} whenever a print version of
+% the document is processed.
+%
+% To use a custom \prog{makeindex} style file:
+% \begin{enumerate}
+% \item Copy |lwarp.ist| to a new filename such as |projectname.ist|
+% \item Make changes to |projectname.ist|.
+% Keep the lines which refer to \cs{hyperindexref}.
+% These lines creates the hyperlinks for the \HTML\ index. During print output
+% \cs{hyperindexref} becomes a null function.
+% \item In the document source use the \optn{makeindexStyle} option for \pkg{lwarp}:
+% \DescribeOption{makeindexStyle}
+% \begin{Verbatim}[gobble=2,tabsize=4]
+% \usepackage[
+% ... other options ...
+% \textred{makeindexStyle=projectname.ist},
+% ]{lwarp}
+% \end{Verbatim}
+% Likewise, refer to the custom style file if using \cs{PrintIndexCmd},
+% \cs{HTMLIndexCmd}, or \cs{LatexmkIndexCmd}.
+% \item Recompile the print version, which causes
+% \pkg{lwarp} to rewrite the |lwarpmk.conf| configuration file.
+% This tells \prog{lwarpmk} to use the custom |projectname.ist| file
+% instead of |lwarp.ist|.
+% \end{enumerate}
+%
+%
+% \subsubsection{Using a custom \prog{xindy} style file}
+% \label{sec:modifyxindy}
+%
+% \DescribeProgram{xindy}
+% \DescribeFile{lwarp.xdy}
+% When using \prog{xindy}, \prog{lwarpmk} uses the file |lwarp.xdy| to process the index.
+% \index{lwarp.xdy>customizing}
+% \index{xindy>customizing}
+% \index{index>custom \pkg{xindy} style file}
+% This file is over-written by \pkg{lwarp} whenever a print version of
+% the document is processed.
+%
+% To use a custom \prog{xindy} style file:
+% \begin{enumerate}
+% \item Copy |lwarp.xdy| to a new filename such as |projectname.xdy|
+% \item Make changes to |projectname.xdy|.
+%
+% Keep the lines which refer to \cs{hyperindexref}:
+% \begin{Verbatim}[gobble=2,tabsize=4]
+% (define-attributes (("hyperindexref")))
+% (markup-locref :open "\hyperindexref{" :close "}")
+% ...
+% (markup-locref :open "\textit{\hyperindexref{" :close "}}" :attr "textit")
+% \end{Verbatim}
+% These lines create the hyperlinks for the \HTML\ index. During print output
+% \cs{hyperindexref} becomes a null function.
+%
+% To create custom styles, refer to the lines for \cs{textbf} and \cs{textit}.
+% \item In the document source use the \optn{xindyStyle} option for \pkg{lwarp}:
+% \DescribeOption{xindyStyle}
+% \begin{Verbatim}[gobble=2,tabsize=4]
+% \usepackage[
+% ... other options ...
+% \textred{xindyStyle=projectname.xdy},
+% ]{lwarp}
+% \end{Verbatim}
+% Likewise, refer to the custom style file if using \cs{PrintIndexCmd},
+% \cs{HTMLIndexCmd}, or \cs{LatexmkIndexCmd}.
+% \item Recompile the print version, which causes
+% \pkg{lwarp} to rewrite the |lwarpmk.conf| configuration file.
+% This tells \prog{lwarpmk} to use the custom |projectname.xdy| file instead of |lwarp.xdy|.
+% \end{enumerate}
+%
+%
+% \subsubsection{Additional indexing limitations}
+% \prog{xindy} and \pkg{hyperref} may not work well together for print output
+% \margintag{\pkg{xindy} with \pkg{hyperref}}
+% with ``see'', ``see also'', reference ranges, or stylized index references.
+% It may be necessary to turn off hyper-referencing for indexes:
+% \begin{sourcedisplay}
+% \cs{usepackage}\textred{[hyperindex=false]}\{hyperref\}
+% \end{sourcedisplay}
+%
+% If an \HTML\ index is empty, it may be necessary to add the following
+% \watchout[empty index]
+% before \pkg{lwarp} is loaded:
+% \index{index>empty}
+% \begin{sourcedisplay}
+% \textred{\cs{usepackage}\{morewrites\}} \\
+% \textred{\cs{morewritessetup}\{allocate=10\}} \\
+% \dots \\
+% \cs{usepackage}\{lwarp\}
+% \end{sourcedisplay}
+%
+% When using \prog{makeindex}, custom display styles are possible:
+% \index{index>custom display styles}
+% \margintag{\prog{makeindex} custom display styles}
+% \begin{sourcedisplay}
+% \cs{begin}\{warpprint\} \\
+% \cs{newcommand}\{\cs{notesstyle}\}[1]\{\#1nn\} \\
+% \cs{end}\{warpprint\} \\
+% ~ \\
+% \cs{begin}\{warpHTML\} \\
+% \cs{makeatletter} \\
+% \cs{newcommand}\{\cs{notesstyle}\}[1]\{\cs{LWR@doindexentry}\{\#1\} notes \} \\
+% \cs{makeatother} \\
+% \cs{end}\{warpHTML\} \\
+% \dots \\
+% A sentence.\cs{index}\{key\textbar{}notesstyle\}
+% \end{sourcedisplay}
+%
+% For custom styles with \prog{xindy},
+% \margintag{\prog{xindy} custom display styles}
+% see \filenm{lwarp.xdy} for \cs{textbf} and \cs{textit} as examples.
+%
+%
+% \subsubsection{Index positions, \acro{TOC}, \pkg{tocbibind}}
+% \limitstocbibind
+%
+% \limitstocloft
+%
%
%
% \subsection{Math}
@@ -6646,7 +7599,7 @@ This boolean may be tested by the user for later use.
% \limitsmemoir
% \index{memoir>options clash}
% \index{options clash, memoir}
-% \index{warning>Options clash, memoir}
+% \index{error>Options clash, memoir}
%
%
% \subsection{Miscellaneous}
@@ -7378,6 +8331,7 @@ This boolean may be tested by the user for later use.
% \changes{v0.16}{2016/04/08}{Docs: Text not converting.}
% \changes{v0.34}{2017/08/08}{Docs: Misplaced alignment character.}
% \changes{v0.42}{2017/10/13}{Docs: Improper \cs{prevdepth}.}
+% \changes{v0.58}{2018/06/07}{Docs: Misplaced \cs{omit}.}
%
% \begin{description}
%
@@ -7407,9 +8361,18 @@ This boolean may be tested by the user for later use.
%
% \item [Options clash:] If using \pkg{memoir}, see \cref{sec:limitsmemoir}.
%
+% \item [``No room for a new \cs{write}.'':] Before |\usepackage{lwarp}|, add:
+% \index{error>No Room for a new \cs{write}.}
+% \index{No room for a new \cs{write}.}
+% \index{morewrites>No room for a new \cs{write}.}
+% \begin{sourcedisplay}
+% \cs{usepackage}\{morewrites\} \\
+% \cs{morewritessetup}\{allocate=10\}
+% \end{sourcedisplay}
+%
% \item [``Missing \$ inserted.'':] If using a filename or URL in a
% footnote or \cs{item}, escape underscores with \cs{\_}.
-% \index{warning>Missing \$ inserted.}
+% \index{error>Missing \$ inserted.}
% \index{Missing \$ inserted.}
%
% \item [``Label(s) may have changed. Rerun to get cross-references right.'':] \
@@ -7419,17 +8382,17 @@ This boolean may be tested by the user for later use.
% \begin{sourcedisplay}
% \cs{textit}\{X\}\cs{,}=\cs{,}1
% \end{sourcedisplay}
-% \index{warning>Label(s) may have changed.}
+% \index{error>Label(s) may have changed.}
% \index{Label(s) may have changed}
%
% \item [``Leaders not followed by proper glue'':] This can be caused by
% a missing |l@<floattype>| or |l@<sectiontype>| definition.
% See \pkg{lwarp}'s definitions for examples.
-% \index{warning>Leaders not followed by proper glue.}
+% \index{error>Leaders not followed by proper glue.}
% \index{Leaders not followed by proper glue.}
%
% \item [``Improper \cs{prevdepth}'':]
-% \index{warning>Improper \cs{prevdepth}.}
+% \index{error>Improper \cs{prevdepth}.}
% \index{Improper \cs{prevdepth}.}
% \env{lateximage}s and \SVG\ math require \cs{newpage}, which
% cannot work inside \TeX\ boxes or \cs{ensuremath}.
@@ -7464,6 +8427,12 @@ This boolean may be tested by the user for later use.
% \dots \\
% \cs{end}\{equation\}
% \end{sourcedisplay}
+%
+% \item[``\texttt{Misplaced \cs{omit}}'':] If using \cs{LWR@formatted} to
+% \watchout[\cs{LWR@formatted}]
+% define new macros for print and \HTML\ modes, see \cref{sec:definingprinthtml}
+% regarding \cs{LWR@expandableformatted}.
+%
% \item[Complicated objects inside display math:] Some objects, such as \tikz,
% \watchout[display math]
% may not compile in \pkg{lwarp}'s normal display math emulation.
@@ -7906,6 +8875,19 @@ This boolean may be tested by the user for later use.
% \end{macrocode}
% \end{macro}
+
+% \begin{macro}{\LWR@patcherror} \marg{packagename} \marg{macroname}
+%
+% Prints an error if could not patch a macro.
+% \begin{macrocode}
+\newcommand*{\LWR@patcherror}[2]{%
+\PackageError{lwarp}
+{Unable to patch package #1, macro #2}
+{Please contact the author of the lwarp package.}
+}
+% \end{macrocode}
+% \end{macro}
+
%
%
% \section{Early package requirements}
@@ -8017,6 +8999,7 @@ This boolean may be tested by the user for later use.
% \end{macrocode}
+
% \DescribeBoolean{warpingprint}
% \DescribeBoolean{warpingHTML}
% \DescribeBoolean{mathjax}
@@ -8124,6 +9107,33 @@ This boolean may be tested by the user for later use.
% \end{macrocode}
+% \DescribeOption{makeindexStyle} Selects a custom |.ist| file.
+% The default is |lwarp.ist|.
+% A customized file should be based on |lwarp.ist|, and must retain
+% the lines related to \cs{hyperindexref}.
+%
+% \changes{v0.58}{2018/06/21}{Added option \optn{makeindexStyle.}}
+%
+% \begin{macrocode}
+\DeclareStringOption[lwarp.ist]{makeindexStyle}
+% \end{macrocode}
+
+
+% \DescribeOption{xindyStyle} Selects a custom |.xdy| file.
+% The default is |lwarp.xdy|.
+% A customized file should be based on |lwarp.xdy|, and must retain
+% the line
+% \begin{Verbatim}[gobble=2]
+% (markup-locref :open "\hyperindexref{" :close "}")
+% \end{Verbatim}
+%
+% \changes{v0.30}{2017/04/28}{Option \optn{xdyFilename} added.}
+% \changes{v0.54}{2018/04/06}{Option \optn{xdyFilename} changed to \optn{xindyStyle.}}
+%
+% \begin{macrocode}
+\DeclareStringOption[lwarp.xdy]{xindyStyle}
+% \end{macrocode}
+
% \DescribeOption{xindyLanguage} Sets the \pkg{xindy} language to be assigned
% in \prog{lwarpmk}'s configuration files. This is then used by \prog{lwarpmk} while
@@ -8140,7 +9150,8 @@ This boolean may be tested by the user for later use.
% \DescribeOption{xindyCodepage} Sets the \pkg{xindy} codepage to be assigned
% in \prog{lwarpmk}'s configuration files. This is then used by \prog{lwarpmk} while
-% processing the index and glossary.
+% processing the index.
+% ^^A and glossary.
%
% \changes{v0.54}{2018/04/06}{Add: \optn{xindyCodepage}.}
%
@@ -8150,22 +9161,6 @@ This boolean may be tested by the user for later use.
-% \DescribeOption{xindyStyle} Selects a custom |.xdy| file.
-% The default is |lwarp.xdy|.
-% A customized file should be based on |lwarp.xdy|, and must retain
-% the line
-% \begin{Verbatim}[gobble=2]
-% (markup-locref :open "\hyperindexref{" :close "}")
-% \end{Verbatim}
-%
-% \changes{v0.30}{2017/04/28}{Option \optn{xdyFilename} added.}
-% \changes{v0.54}{2018/04/06}{Option \optn{xdyFilename} changed to \optn{xindyStyle.}}
-%
-% \begin{macrocode}
-\DeclareStringOption[lwarp.xdy]{xindyStyle}
-% \end{macrocode}
-
-
% \limitspdftotextenc
%
% \changes{v0.54}{2018/04/06}{Add: \optn{pdftotextEnc}.}
@@ -8237,6 +9232,67 @@ This boolean may be tested by the user for later use.
+% \DescribeOption{PrintIndexCmd} \DescribeDefault{<empty>}
+% The shell commands to use to compile the print indexes.
+%
+% \begin{macrocode}
+\DeclareStringOption[]{PrintIndexCmd}
+% \end{macrocode}
+
+% \DescribeOption{HTMLIndexCmd} \DescribeDefault{<empty>}
+% The shell commands to use to compile the \HTML\ indexes.
+%
+% \begin{macrocode}
+\DeclareStringOption[]{HTMLIndexCmd}
+% \end{macrocode}
+
+
+% \DescribeOption{LatexmkIndexCmd} \DescribeDefault{<empty>}
+% The shell commands to by used by \prog{latexmk} to compile the print indexes.
+% Unlike \optn{PrintIndexCmd} and \optn{HTMLIndexCmd},
+% \optn{LatexmkIndexCmd} does not include the filename, which will be
+% provided by \prog{latexmk}.
+%
+% \begin{macrocode}
+\DeclareStringOption[]{LatexmkIndexCmd}
+% \end{macrocode}
+
+% \DescribeOption{makeindex} Tells \pkg{lwarp} to
+% use \pkg{makeindex} for index generation.
+% When \filenm{lwarpmk.conf} and \filenm{*.lwarpmkconf} are generated,
+% \optn{PrintIndexCmd} and \optn{HTMLIndexCmd} will be set for \prog{makeindex}
+% with a single index file.
+% \changes{v0.58}{2018/06/20}{Added \optn{makeindex} option.}
+% \begin{macrocode}
+\DeclareBoolOption[false]{makeindex}
+% \end{macrocode}
+
+
+% \DescribeOption{xindy} Tells \pkg{lwarp} to
+% use \pkg{xindy} for index generation.
+% When \filenm{lwarpmk.conf} and \filenm{*.lwarpmkconf} are generated,
+% \optn{PrintIndexCmd} and \optn{HTMLIndexCmd} will be set for \prog{xindy}
+% with a single index file.
+% \changes{v0.58}{2018/06/20}{Added \optn{xindy} option.}
+% \begin{macrocode}
+\DeclareBoolOption[false]{xindy}
+% \end{macrocode}
+
+
+% \DescribeOption{GlossaryCmd} \DescribeDefault{makeglossaries}
+% The shell command to use to compile the glossary.
+% The print or \HTML\ version of the glossary filename will be appended to this command.
+%
+% \begin{macrocode}
+\DeclareStringOption[makeglossaries]{GlossaryCmd}
+% \end{macrocode}
+
+
+
+
+
+
+
% \DescribeOption{latexmk}
% Option \optn{latexmk} tells \prog{lwarpmk} to use \prog{latexmk} when compiling documents.
%
@@ -8273,10 +9329,61 @@ This boolean may be tested by the user for later use.
%
%
%
-% \subsection{Conditional compilation}
+% \cs{LWR@PrintIndexCmd} and \cs{LWR@HTMLIndexCmd} are tested to see if they are empty.
+% If so, they are set to a reasonable defaults for a single index using \prog{makeindex},
+% then possibly set to defaults for \prog{xindy}
+% if the \pkg{lwarp} \optn{xindy} option was selected.
%
+% \begin{macrocode}
+\ifdefempty{\LWR@PrintIndexCmd}{
+ \renewcommand{\LWR@PrintIndexCmd}{%
+ makeindex -s \LWR@makeindexStyle \space \jobname.idx%
+ }
+ \ifbool{LWR@xindy}{
+ \renewcommand{\LWR@PrintIndexCmd}{%
+ xindy
+ -M \LWR@xindyStyle \space
+ -L \LWR@xindyLanguage \space
+ -C \LWR@xindyCodepage \space
+ \jobname.idx%
+ }
+ }{}
+}{}
+
+\ifdefempty{\LWR@HTMLIndexCmd}{
+ \renewcommand{\LWR@HTMLIndexCmd}{%
+ makeindex -s \LWR@makeindexStyle \space \jobname_html.idx%
+ }
+ \ifbool{LWR@xindy}{
+ \renewcommand{\LWR@HTMLIndexCmd}{%
+ xindy
+ -M \LWR@xindyStyle \space
+ -L \LWR@xindyLanguage \space
+ -C \LWR@xindyCodepage \space
+ \jobname_html.idx%
+ }
+ }{}
+}{}
+
+\ifdefempty{\LWR@LatexmkIndexCmd}{
+ \renewcommand{\LWR@LatexmkIndexCmd}{%
+ makeindex -s \LWR@makeindexStyle%
+ }
+ \ifbool{LWR@xindy}{
+ \renewcommand{\LWR@LatexmkIndexCmd}{%
+ xindy
+ -M \LWR@xindyStyle \space
+ -L \LWR@xindyLanguage \space
+ -C \LWR@xindyCodepage%
+ }
+ }{}
+}{}
+% \end{macrocode}
%
%
+%
+% \subsection{Conditional compilation}
+%
% \begin{macro}{\warpprintonly} \marg{contents}
%
% Only process the contents if producing printed output.
@@ -8517,6 +9624,7 @@ For a possible alternative, see package(s) #2.}
% \changes{v0.25}{2017/03/16}{Fix: Allows XE\LaTeX\ and
% \LuaLaTeX\ to preload graphics and graphicx.}
% \changes{v0.45}{2017/12/03}{Allows \pkg{memoir}'s preloaded packages.}
+% \changes{v0.58}{2018/06/21}{Fix: \pkg{memoir} and \pkg{ccaption}.}
%
% The following packages must be loaded after \pkg{lwarp}:
% ^^A *loadafter
@@ -8543,6 +9651,8 @@ For a possible alternative, see package(s) #2.}
\LWR@loadafter{arabicfront}
\LWR@notmemoirloadafter{array}
% \LWR@loadafter{atbegshi}% used by morewrites
+\LWR@loadafter{attachfile}
+\LWR@loadafter{attachfile2}
\LWR@loadafter{authblk}
\LWR@loadafter{axodraw2}
\LWR@loadafter{backref}
@@ -8559,7 +9669,8 @@ For a possible alternative, see package(s) #2.}
\LWR@loadafter{cancel}
\LWR@loadafter{caption}
\LWR@loadafter{caption2}
-\LWR@loadafter{ccaption}
+\LWR@loadafter{cases}
+% \LWR@loadafter{ccaption}% may be preloaded by memoir
\LWR@loadafter{changebar}
\LWR@notmemoirloadafter{changepage}
\LWR@notmemoirloadafter{chngpage}
@@ -8649,9 +9760,12 @@ For a possible alternative, see package(s) #2.}
\LWR@loadafter{hyphenat}
\LWR@loadafter{idxlayout}
\LWR@loadafter{ifoddpage}
+\LWR@loadafter{imakeidx}
\LWR@loadafter{indentfirst}
+\LWR@notmemoirloadafter{index}
% inputenc must be loaded before lwarp
% inputenx must be loaded before lwarp
+\LWR@loadafter{intopdf}
\LWR@loadafter{keyfloat}
\LWR@loadafter{layout}
\LWR@loadafter{letterspace}
@@ -8669,6 +9783,7 @@ For a possible alternative, see package(s) #2.}
\LWR@loadafter{luacolor}
\LWR@loadafter{luatodonotes}
\LWR@loadafter{magaz}
+\LWR@notmemoirloadafter{makeidx}
\LWR@loadafter{marginfit}
\LWR@loadafter{marginfix}
\LWR@loadafter{marginnote}
@@ -8710,7 +9825,9 @@ For a possible alternative, see package(s) #2.}
\LWR@loadafter{pbox}
\LWR@loadafter{pdfrender}
\LWR@loadafter{pdflscape}
+\LWR@loadafter{pdfpages}
\LWR@loadafter{pdfsync}
+\LWR@loadafter{pdfx}
\LWR@loadafter{pfnote}
\LWR@loadafter{phfqit}
\LWR@loadafter{placeins}
@@ -8723,6 +9840,7 @@ For a possible alternative, see package(s) #2.}
\LWR@loadafter{realscripts}
\LWR@loadafter{register}
\LWR@loadafter{relsize}
+\LWR@loadafter{repeatindex}
\LWR@loadafter{resizegather}
\LWR@loadafter{romanbar}
\LWR@loadafter{romanbarpagenumber}
@@ -8749,6 +9867,7 @@ For a possible alternative, see package(s) #2.}
\LWR@loadafter{soul}
\LWR@loadafter{soulpos}
\LWR@loadafter{soulutf8}
+\LWR@loadafter{splitidx}
\LWR@loadafter{stabular}
\LWR@loadafter{stfloats}
\LWR@loadafter{subfig}
@@ -9160,13 +10279,6 @@ top=1in,bottom=1in,%
% \end{macrocode}
-% \DescribePackage{makeidx}
-% \begin{macrocode}
-\RequirePackage{makeidx}
-\makeindex
-% \end{macrocode}
-
-
% \DescribePackage{calc}
% \begin{macrocode}
\RequirePackage{calc}
@@ -9228,14 +10340,12 @@ top=1in,bottom=1in,%
% \DescribePackage{amsmath}
% Preloaded to avoid options clash and to add patches.
%
-% \changes{v0.16}{2016/04/09}{Fix: amsmath options clash}
+% ^^A \changes{v0.16}{2016/04/09}{Fix: amsmath options clash}
%
-% Equation numbers are placed to the left for \HTML.
-%
-% \pkg{newtxmath} automatically loads \pkg{amsmath},
-% so the option \optn{leqno} is passed beforehand to be
-% picked up both here and by \pkg{newtxmath} if it is used.
-% \changes{v0.16}{2016/04/11}{Fix: newtxmath compatibility.}
+% ^^A \pkg{newtxmath} automatically loads \pkg{amsmath},
+% ^^A so the option \optn{leqno} is passed beforehand to be
+% ^^A picked up both here and by \pkg{newtxmath} if it is used.
+% ^^A \changes{v0.16}{2016/04/11}{Fix: newtxmath compatibility.}
% \changes{v0.33}{2016/06/21}{\pkg{amsmath}: Removed \optn{fleqn} option.}
%
% ^^A *8* remove leqno and references
@@ -9765,7 +10875,9 @@ top=1in,bottom=1in,%
% The new \HTML\ versions of macros and environments are used most of the time.
% Copies of the print versions are used inside a \env{lateximage} environment,
% which draws and remembers an image of the printed output, and also several
-% other places.
+% other places. The copies of the print versions may also be used by the \HTML\
+% versions, such as when the \HTML\ version merely encloses the print version
+% inside \HTML\ tags.
%
% The general structure for providing print and \HTML\ versions of a macro or
% environment is as follows:
@@ -9882,7 +10994,10 @@ top=1in,bottom=1in,%
% Since arguments are not handled by the new \cs{name}, any star and other arguments
% are processed by the print or \HTML\ version.
%
-% Expandable versions are also provided as well:
+% Expandable versions are also provided as well.
+% These areusually necessary for anything which could appear inside a \env{tabular},
+% without which an |Misplaced \omit| error may occur.
+% \watchout[Misplaced \cs{omit} error]
% \begin{sourcedisplay}
% \cs{LWR@expandableformatted} \\
% \cs{LWR@expandableformattedenv}
@@ -9926,11 +11041,11 @@ top=1in,bottom=1in,%
}{}%
\ifcsundef{#1}{%
\expandafter\newrobustcmd\csname #1\endcsname{%
- \csuse{LWR@\LWR@formatting @#1}%
+ \@nameuse{LWR@\LWR@formatting @#1}%
}%
}{%
\expandafter\renewrobustcmd\csname #1\endcsname{%
- \csuse{LWR@\LWR@formatting @#1}%
+ \@nameuse{LWR@\LWR@formatting @#1}%
}%
}%
}
@@ -9950,11 +11065,11 @@ top=1in,bottom=1in,%
}{}%
\ifcsundef{#1}{%
\expandafter\newcommand\csname #1\endcsname{%
- \csuse{LWR@\LWR@formatting @#1}%
+ \@nameuse{LWR@\LWR@formatting @#1}%
}%
}{%
\expandafter\renewcommand\csname #1\endcsname{%
- \csuse{LWR@\LWR@formatting @#1}%
+ \@nameuse{LWR@\LWR@formatting @#1}%
}%
}%
}
@@ -9976,8 +11091,8 @@ top=1in,bottom=1in,%
\csletcs{endLWR@print@#1}{end#1}%
}{}%
\DeclareDocumentEnvironment{#1}{}%
- {\csuse{LWR@\LWR@formatting @#1}}%
- {\csuse{endLWR@\LWR@formatting @#1}}%
+ {\@nameuse{LWR@\LWR@formatting @#1}}%
+ {\@nameuse{endLWR@\LWR@formatting @#1}}%
}
% \end{macrocode}
% \end{macro}
@@ -9993,8 +11108,8 @@ top=1in,bottom=1in,%
\csletcs{endLWR@print@#1}{end#1}%
}{}%
\DeclareExpandableDocumentEnvironment{#1}{}%
- {\csuse{LWR@\LWR@formatting @#1}}%
- {\csuse{endLWR@\LWR@formatting @#1}}%
+ {\@nameuse{LWR@\LWR@formatting @#1}}%
+ {\@nameuse{endLWR@\LWR@formatting @#1}}%
}
% \end{macrocode}
% \end{macro}
@@ -10222,32 +11337,17 @@ top=1in,bottom=1in,%
\let\LWR@origenskip\enskip
\let\LWR@origquad\quad
\let\LWR@origqquad\qquad
-\let\LWR@orighfill\hfill
\let\LWR@orighfil\hfil
\let\LWR@orighss\hss
\let\LWR@origllap\llap
\let\LWR@origrlap\rlap
\let\LWR@orighfilneg\hfilneg
-\let\LWR@orighrulefill\hrulefill
-\let\LWR@origdotfill\dotfill
-
\let\LWR@origmedskip\medskip
\let\LWR@origbigskip\bigskip
\let\LWR@origtextellipsis\textellipsis
-\let\LWR@orignormalsize\normalsize
-\let\LWR@origsmall\small
-\let\LWR@origfootnotesize\footnotesize
-\let\LWR@origscriptsize\scriptsize
-\let\LWR@origtiny\tiny
-\let\LWR@origlarge\large
-\let\LWR@origLarge\Large
-\let\LWR@origLARGE\LARGE
-\let\LWR@orighuge\huge
-\let\LWR@origHuge\Huge
-
\LetLtxMacro\LWR@origtextrm\textrm
\LetLtxMacro\LWR@origtextsf\textsf
\LetLtxMacro\LWR@origtexttt\texttt
@@ -10272,7 +11372,6 @@ top=1in,bottom=1in,%
\LetLtxMacro\LWR@origem\em
\LetLtxMacro\LWR@orignormalfont\normalfont
-\let\LWR@origraggedright\raggedright
\let\LWR@origonecolumn\onecolumn
\let\LWR@origsp\sp
@@ -10288,12 +11387,6 @@ top=1in,bottom=1in,%
\LetLtxMacro\LWR@origunderline\underline
% \end{macrocode}
%
-% \changes{v0.50}{2018/02/22}{Fix: \cs{centering}, etc. in \SVG\ math, \env{lateximage}, \tikz.}
-% \begin{macrocode}
-\let\LWR@origraggedright\raggedright
-\let\LWR@origraggedleft\raggedleft
-\let\LWR@origcentering\centering
-% \end{macrocode}
% \begin{macrocode}
\let\LWR@orignewpage\newpage
@@ -10476,15 +11569,6 @@ top=1in,bottom=1in,%
% which is the default unless the \optn{warpHTML} option is given.
% |lwarpmk.conf| is then used by the utility \prog{lwarpmk}.
%
-% An example |lwarpmk.conf|:
-% \begin{Verbatim}[gobble=2,frame=lines,obeytabs,tabsize=4,formatcom={\unskip}]
-% opsystem = "Unix" -- or "Windows"
-% latexname = "pdflatex" -- or "lualatex" or "xelatex"
-% sourcename = "projectname" -- your .tex source
-% homehtmlfilename = "index" -- or "projectname"
-% htmlfilename = "" -- or "projectname" if numbered HTML files
-% \end{Verbatim}
-%
% \changes{v0.29}{2017/04/15}{\filenm{lwarpmk.conf}: Add: \optn{language}
% option for config files.}
% \changes{v0.54}{2018/04/06}{\filenm{lwarpmk.conf}: Option \optn{xdyFilename} changed to \optn{xindyStyle}.}
@@ -10492,10 +11576,14 @@ top=1in,bottom=1in,%
% \changes{v0.54}{2018/04/06}{\filenm{lwarpmk.conf}: Option \optn{xindyCodepage} added.}
% \changes{v0.54}{2018/04/06}{\filenm{lwarpmk.conf}: Option \optn{pdftotextEnc} added.}
% \changes{v0.56}{2018/05/11}{\filenm{lwarpmk.conf}: Records \texttt{-shell-escape}.}
+% \changes{v0.58}{2018/06/20}{\filenm{lwarpmk.conf}: Generated \cs{AtBeginDocument}.}
+% \changes{v0.58}{2018/06/20}{\filenm{lwarpmk.conf}: Added options \optn{makeindex} and \optn{xindy}.}
+% \changes{v0.58}{2018/06/21}{\filenm{lwarpmk.conf}: Added option \optn{makeindexstyle}.}
%
% \codeprint
% \begin{macrocode}
\begin{warpprint}
+\AtBeginDocument{
\ifcsdef{LWR@quickfile}{}{\newwrite{\LWR@quickfile}}
\immediate\openout\LWR@quickfile=lwarpmk.conf
\ifbool{usingOSWindows}{
@@ -10519,11 +11607,19 @@ homehtmlfilename = "\HomeHTMLFilename"%
\immediate\write\LWR@quickfile{htmlfilename = "\HTMLFilename"}
\immediate\write\LWR@quickfile{latexmk = "\ifbool{LWR@latexmk}{true}{false}"}
\immediate\write\LWR@quickfile{shellescape = "\ifshellescape true\else false\fi"}
-\immediate\write\LWR@quickfile{xindylanguage = "\LWR@xindyLanguage"}
-\immediate\write\LWR@quickfile{xindycodepage = "\LWR@xindyCodepage"}
-\immediate\write\LWR@quickfile{xindystyle = "\LWR@xindyStyle"}
+\immediate\write\LWR@quickfile{printindexcmd = "\LWR@PrintIndexCmd"}
+\immediate\write\LWR@quickfile{HTMLindexcmd = "\LWR@HTMLIndexCmd"}
+\immediate\write\LWR@quickfile{latexmkindexcmd = "\LWR@LatexmkIndexCmd"}
+\immediate\write\LWR@quickfile{glossarycmd = "\LWR@GlossaryCmd"}
+% \end{macrocode}
+% ^^A \immediate\write\LWR@quickfile{makeindexstyle = "\LWR@makeindexStyle"}
+% ^^A \immediate\write\LWR@quickfile{xindylanguage = "\LWR@xindyLanguage"}
+% ^^A \immediate\write\LWR@quickfile{xindycodepage = "\LWR@xindyCodepage"}
+% ^^A \immediate\write\LWR@quickfile{xindystyle = "\LWR@xindyStyle"}
+% \begin{macrocode}
\immediate\write\LWR@quickfile{pdftotextenc = "\LWR@pdftotextEnc"}
\immediate\closeout\LWR@quickfile
+}% AtBeginDocument
\end{warpprint}
% \end{macrocode}
@@ -10540,9 +11636,15 @@ homehtmlfilename = "\HomeHTMLFilename"%
% \changes{v0.54}{2018/04/06}{\filenm{*.lwarpmkconf}: Option \optn{xindyCodepage} added.}
% \changes{v0.54}{2018/04/06}{\filenm{*.lwarpmkconf}: Option \optn{pdftotextEnc} added.}
% \changes{v0.56}{2018/05/11}{\filenm{*.lwarpmkconf}: Records \texttt{-shell-escape}.}
+% \changes{v0.58}{2018/06/20}{\filenm{*.lwarpmkconf}: Generated \cs{AtBeginDocument}.}
+% \changes{v0.58}{2018/06/20}{\filenm{*.lwarpmkconf}: Added options \optn{makeindex} and \optn{xindy}.}
+% \changes{v0.58}{2018/06/21}{\filenm{*.lwarpmkconf}: Added option \optn{makeindexstyle}.}
%
+% The \optn{makeindex} and \optn{xindy} options have already previously been handled
+% for \filenm{lwarp.conf}.
% \begin{macrocode}
\begin{warpprint}
+\AtBeginDocument{
\ifcsdef{LWR@quickfile}{}{\newwrite{\LWR@quickfile}}
\immediate\openout\LWR@quickfile=\jobname.lwarpmkconf
\ifbool{usingOSWindows}{
@@ -10566,11 +11668,19 @@ homehtmlfilename = "\HomeHTMLFilename"%
\immediate\write\LWR@quickfile{htmlfilename = "\HTMLFilename"}
\immediate\write\LWR@quickfile{latexmk = "\ifbool{LWR@latexmk}{true}{false}"}
\immediate\write\LWR@quickfile{shellescape = "\ifshellescape true\else false\fi"}
-\immediate\write\LWR@quickfile{xindylanguage = "\LWR@xindyLanguage"}
-\immediate\write\LWR@quickfile{xindycodepage = "\LWR@xindyCodepage"}
-\immediate\write\LWR@quickfile{xindystyle = "\LWR@xindyStyle"}
+\immediate\write\LWR@quickfile{printindexcmd = "\LWR@PrintIndexCmd"}
+\immediate\write\LWR@quickfile{HTMLindexcmd = "\LWR@HTMLIndexCmd"}
+\immediate\write\LWR@quickfile{latexmkindexcmd = "\LWR@LatexmkIndexCmd"}
+\immediate\write\LWR@quickfile{glossarycmd = "\LWR@GlossaryCmd"}
+% \end{macrocode}
+% ^^A \immediate\write\LWR@quickfile{makeindexstyle = "\LWR@makeindexStyle"}
+% ^^A \immediate\write\LWR@quickfile{xindylanguage = "\LWR@xindyLanguage"}
+% ^^A \immediate\write\LWR@quickfile{xindycodepage = "\LWR@xindyCodepage"}
+% ^^A \immediate\write\LWR@quickfile{xindystyle = "\LWR@xindyStyle"}
+% \begin{macrocode}
\immediate\write\LWR@quickfile{pdftotextenc = "\LWR@pdftotextEnc"}
\immediate\closeout\LWR@quickfile
+}% AtBeginDocument
\end{warpprint}
% \end{macrocode}
@@ -12577,6 +13687,48 @@ nav.botnavigation {
% \end{macrocode}
+% \subsection{lwarp.ist}
+
+% \DescribeFile{lwarp.ist}
+% Used to modify the index for \pkg{lwarp}.
+%
+% This must be present when compiling the project,
+% but does not need to be present when distributing
+% the resulting \HTML\ files.
+%
+% The page compositor line is for \pkg{memoir}'s \cs{specialindex}.
+%
+% \changes{v0.58}{2018/06/17}{\filenm{lwarp\_html.ist}: Added.}
+%
+% ^^A *lwarp.ist
+% \begin{macrocode}
+\begin{warpprint}
+\begin{filecontents*}{lwarp.ist}
+preamble
+"\\begin{theindex}
+ \\providecommand*\\lettergroupDefault[1]{}
+ \\providecommand*\\lettergroup[1]{%
+ \\par\\textbf{#1}\\par
+ \\nopagebreak
+ }
+"
+headings_flag 1
+heading_prefix "
+ \\lettergroup{"
+heading_suffix "}"
+delim_0 ", \\hyperindexref{"
+delim_1 ", \\hyperindexref{"
+delim_2 ", \\hyperindexref{"
+delim_n "}, \\hyperindexref{"
+delim_r "} -- \\hyperindexref{"
+delim_t "}"
+page_compositor "."
+\end{filecontents*}
+% \end{Verbatim}% for syntax highlighting
+\end{warpprint}
+% \end{macrocode}
+
+
% \subsection{lwarp.xdy}
@@ -12587,8 +13739,14 @@ nav.botnavigation {
% but does not need to be present when distributing
% the resulting \HTML\ files.
%
+% See: \\
+% \href{https://tex.stackexchange.com/questions/80300/how-can-i-convince-hyperref-and-xindy-to-play-together-nicely}
+% {https://tex.stackexchange.com/questions/80300/ \\ \fqquad\ how-can-i-convince-hyperref-and-xindy-to-play-together-nicely}
+%
% \changes{v0.30}{2017/04/28}{File: \filenm{lwarp\_html.xdy} renamed to \filenm{lwarp.xdy}.}
% \changes{v0.30}{2017/04/26}{Fix: \filenm{lwarp.xdy} only written in print mode.}
+% \changes{v0.58}{2018/06/19}{\filenm{lwarp.xdy}: Requires \filenm{makeindex.xdy}.}
+% \changes{v0.58}{2018/06/21}{\filenm{lwarp.xdy}: Supports bold, italic.}
%
% ^^A *lwarp.xdy
% \begin{macrocode}
@@ -12599,10 +13757,14 @@ nav.botnavigation {
(require "texindy.xdy")
(require "page-ranges.xdy")
(require "book-order.xdy")
-(require "page-ranges.xdy")
-(markup-locref :open "\hyperindexref{" :close "}")
(define-location-class "arabic-page-numbers"
("arabic-numbers") :min-range-length 1)
+(require "makeindex.xdy")
+(define-attributes (("hyperindexref")))
+(markup-locref :open "\hyperindexref{" :close "}")
+(markup-locref :open "\hyperindexref{" :close "}" :attr "hyperpage")
+(markup-locref :open "\textbf{\hyperindexref{" :close "}}" :attr "textbf")
+(markup-locref :open "\textit{\hyperindexref{" :close "}}" :attr "textit")
(define-location-class-order ("roman-page-numbers"
"arabic-page-numbers"
"alpha-page-numbers"
@@ -12840,6 +14002,11 @@ src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-
% \changes{v0.56}{2018/05/11}{\prog{lwarpmk}: Supports \texttt{-shell-escape}.}
% \changes{v0.57}{2018/05/20}{\prog{lwarpmk}: Improved code factoring.}
% \changes{v0.57}{2018/05/20}{\prog{lwarpmk}: Improved error handling.}
+% \changes{v0.58}{2018/06/14}{\prog{lwarpmk}: Added \texttt{-p} option for project name.}
+% \changes{v0.58}{2018/06/14}{\prog{lwarpmk}: Added optional list of names for \cmds{lwarpmk printindex} and /cmds{lwarpmk htmlindex}.}
+% \changes{v0.58}{2018/06/18}{\prog{lwarpmk}: Glossary generation now uses \prog{makeglossaries}.}
+% \changes{v0.58}{2018/06/20}{\prog{lwarpmk}: Added \optn{makeindex} and \optn{xindy} options.}
+% \changes{v0.58}{2018/06/20}{\prog{lwarpmk}: \cmds{lwarpmk clean} removes all \filenm{*.ind} and \filenm{*.idx} files.}
%
% The following is only generated if the \optn{lwarpmk} option
% was given to \pkg{lwarp}.
@@ -12855,7 +14022,7 @@ src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-
-- Copyright 2016-2018 Brian Dunn
-printversion = "v0.57"
+printversion = "v0.58"
function printhelp ()
@@ -12869,56 +14036,62 @@ function printusage ()
--
print ( [[
-lwarpmk print [project]: Compile the print version if necessary.
-lwarpmk print1 [project]: Forced single compile of the print version.
-lwarpmk printindex [project]: Process the index for the print version.
-lwarpmk printglossary [project]: Process the glossary for the print version.
-lwarpmk html [project]: Compile the HTML version if necessary.
-lwarpmk html1 [project]: Forced single compile of the HTML version.
-lwarpmk htmlindex [project]: Process the index for the html version.
-lwarpmk htmlglossary [project]: Process the glossary for the html version.
-lwarpmk again [project]: Touch the source code to trigger recompiles.
-lwarpmk limages [project]: Process the "lateximages" created by lwarp.sty.
-lwarpmk pdftohtml [project]:
+lwarpmk print [-p project]: Compile the print version if necessary.
+lwarpmk print1 [-p project]: Forced single compile of the print version.
+lwarpmk printindex [-p project]: Process print indexes.
+lwarpmk printglossary [-p project]: Process the glossary for the print version.
+lwarpmk html [-p project]: Compile the HTML version if necessary.
+lwarpmk html1 [-p project]: Forced single compile of the HTML version.
+lwarpmk htmlindex [-p project]: Process HTML indexes.
+lwarpmk htmlglossary [-p project]: Process the glossary for the html version.
+lwarpmk again [-p project]: Touch the source code to trigger recompiles.
+lwarpmk limages [-p project]: Process the "lateximages" created by lwarp.sty.
+lwarpmk pdftohtml [-p project]:
For use with latexmk or a Makefile:
Converts project_html.pdf to project_html.html and individual HTML files.
Finishes the HTML conversion even if there was a compile error.
lwarpmk pdftosvg <list of file names>: Converts each PDF file to SVG.
-lwarpmk clean [project]: Remove .aux, .toc, .lof/t, .idx, .ind, .log, *_html_inc.*, .gl*
-lwarpmk cleanall [project]: Remove auxiliary files and also project.pdf, *.html
+lwarpmk clean [-p project]: Remove .aux, .toc, .lof/t, .idx, .ind, .log, *_html_inc.*, .gl*
+lwarpmk cleanall [-p project]: Remove auxiliary files and also project.pdf, *.html
lwarpmk cleanlimages: Removes all images from the "lateximages" directory.
lwarpmk -h: Print this help message.
lwarpmk --help: Print this help message.
]] )
-printconf ()
+-- printconf ()
end
-function printconf ()
---
--- Print the format of the configuration file lwarpmk.conf:
---
-print ( [[
-An example lwarpmk.conf or <project>.lwarpmkconf project file:
---
-opsystem = "Unix" (or "Windows")
-latexname = "pdflatex" (or "lualatex", or "xelatex")
-sourcename = "projectname" (the source-code filename w/o .tex)
-homehtmlfilename = "index" (or perhaps the project name)
-htmlfilename = "" (or "projectname" - filename prefix)
-latexmk = "false" (or "true" to use latexmk to build PDFs)
-shellescape = "false"
-xindylanguge = "english" (use a language supported by xindy)
-xindycodepage = "utf8" (use a codepage supported by xindy)
-xindystyle = "lwarp.xdy" (or a custom file based on lwarp.xdy)
-pdftotextenc = "UTF-8" (use an encoding supported by pdftotext)
---
-Filenames must contain only letters, numbers, underscore, or dash.
-Values must be in upright "quotes".
-
-]] ) ;
-end
+-- function printconf ()
+-- --
+-- -- Print the format of the configuration file lwarpmk.conf:
+-- --
+-- print ( [[
+-- An example lwarpmk.conf or <project>.lwarpmkconf project file:
+-- --
+-- opsystem = "Unix" (or "Windows")
+-- latexname = "pdflatex" (or "lualatex", or "xelatex")
+-- sourcename = "projectname" (the source-code filename w/o .tex)
+-- homehtmlfilename = "index" (or perhaps the project name)
+-- htmlfilename = "" (or "projectname" - filename prefix)
+-- latexmk = "false" (or "true" to use latexmk to build PDFs)
+-- shellescape = "false"
+-- printindexcmd = "makeindex -s lwarp.ist <name>.idx"
+-- HTMLindexcmd = "makeindex -s lwarp.ist <name>_html.idx"
+-- latexmkindexcmd = "makeindex -s lwarp.ist"
+-- -- indexprog = "makeindex" or "xindy"
+-- -- makeindexstyle = "lwarp.ist" (or a custom file based on lwarp.ist)
+-- -- xindylanguge = "english" (use a language supported by xindy)
+-- -- xindycodepage = "utf8" (use a codepage supported by xindy)
+-- -- xindystyle = "lwarp.xdy" (or a custom file based on lwarp.xdy)
+-- glossarycmd = "makeglossaries"
+-- pdftotextenc = "UTF-8" (use an encoding supported by pdftotext)
+-- --
+-- Filenames must contain only letters, numbers, underscore, or dash.
+-- Values must be in upright "quotes".
+--
+-- ]] ) ;
+-- end
@@ -12956,7 +14129,7 @@ function cvalueerror ( line, linenum , cvalue )
"\" in lwarpmk.conf.\n"
) ;
print ("lwarpmk: ===")
- printconf () ;
+-- printconf () ;
os.exit(1) ;
end
@@ -12967,16 +14140,31 @@ function loadconf ()
--
-- Default configuration filename:
local conffile = "lwarpmk.conf"
+local confroot = "lwarpmk"
+-- Global argument index
+argindex = 2
-- Optional configuration filename:
-if ( arg[2] ~= nil ) then conffile = arg[2]..".lwarpmkconf" end
+if ( arg[argindex] == "-p" ) then
+ argindex = argindex + 1
+ confroot = arg[argindex]
+ conffile = confroot..".lwarpmkconf"
+ argindex = argindex + 1
+end
-- Additional defaults:
opsystem = "Unix"
latexmk = "false"
shellescape = "false"
-xindylanguage = "english"
-xindycodepage = "utf8"
-xindystyle = "lwarp.xdy"
-pdftotextenc = "UTF-8"
+printindexcmd = ""
+HTMLindexcmd = ""
+latexmkindexcmd = ""
+-- to be removed:
+-- indexprog = "makeindex"
+-- makeindexstyle = "lwarp.ist"
+-- xindylanguage = "english"
+-- xindycodepage = "utf8"
+-- xindystyle = "lwarp.xdy"
+-- pdftotextenc = "UTF-8"
+glossarycmd = "makeglossaries"
-- Verify the file exists:
if (lfs.attributes(conffile,"mode")==nil) then
-- file not exists
@@ -12985,9 +14173,9 @@ if (lfs.attributes(conffile,"mode")==nil) then
print ("lwarpmk: Move to the project's source directory,")
print ("lwarpmk: recompile using pdflatex, xelatex, or lualatex,")
print ("lwarpmk: then try using lwarpmk again.")
- if ( arg[2] ~= nil ) then
+ if ( arg[argindex] ~= nil ) then
print (
- "lwarpmk: (\"" .. arg[2] ..
+ "lwarpmk: (\"" .. confroot ..
"\" does not appear to be a project name.)"
)
end
@@ -13002,14 +14190,14 @@ local cfile = io.open(conffile)
local linenum = 0
for line in cfile:lines() do -- scan lines
linenum = linenum + 1
-i,j,cvarname,cvalue = string.find (line,"([%w-_]*)%s*=%s*\"([%w%-_%.]*)\"") ;
+i,j,cvarname,cvalue = string.find (line,"([%w-_]*)%s*=%s*\"([^\"]*)\"") ;
-- Error if incorrect enclosing characters:
if ( i == nil ) then
print ("lwarpmk: ===")
print ("lwarpmk: " .. linenum .. " : " .. line ) ;
print ("lwarpmk: Incorrect entry in " .. conffile ..".\n" ) ;
print ("lwarpmk: ===")
- printconf () ;
+-- printconf () ;
os.exit(1) ;
end -- nil
if ( cvarname == "opsystem" ) then
@@ -13035,9 +14223,25 @@ elseif ( cvarname == "homehtmlfilename" ) then homehtmlfilename = cvalue
elseif ( cvarname == "htmlfilename" ) then htmlfilename = cvalue
elseif ( cvarname == "latexmk" ) then latexmk = cvalue
elseif ( cvarname == "shellescape" ) then shellescape = cvalue
-elseif ( cvarname == "xindylanguage" ) then xindylanguage = cvalue
-elseif ( cvarname == "xindycodepage" ) then xindycodepage = cvalue
-elseif ( cvarname == "xindystyle" ) then xindystyle = cvalue
+elseif ( cvarname == "printindexcmd" ) then printindexcmd = cvalue
+elseif ( cvarname == "HTMLindexcmd" ) then HTMLindexcmd = cvalue
+elseif ( cvarname == "latexmkindexcmd" ) then latexmkindexcmd = cvalue
+elseif ( cvarname == "glossarycmd" ) then glossarycmd = cvalue
+-- to be removed:
+-- elseif ( cvarname == "indexprog" ) then
+-- -- Verify choice of indexing program:
+-- if (
+-- (cvalue == "makeindex") or
+-- (cvalue == "xindy")
+-- ) then
+-- indexprog = cvalue
+-- else
+-- cvalueerror ( line, linenum , cvalue )
+-- end
+-- elseif ( cvarname == "makeindexstyle" ) then makeindexstyle = cvalue
+-- elseif ( cvarname == "xindylanguage" ) then xindylanguage = cvalue
+-- elseif ( cvarname == "xindycodepage" ) then xindycodepage = cvalue
+-- elseif ( cvarname == "xindystyle" ) then xindystyle = cvalue
elseif ( cvarname == "pdftotextenc" ) then pdftotextenc = cvalue
else
print ("lwarpmk: ===")
@@ -13047,7 +14251,7 @@ else
conffile ..".\n"
) ;
print ("lwarpmk: ===")
- printconf () ;
+-- printconf () ;
os.exit(1) ;
end -- cvarname
end -- do scan lines
@@ -13095,15 +14299,6 @@ elseif opsystem=="Windows" then -- For Windows
else print ( "lwarpmk: Select Unix or Windows for opsystem" )
end --- for Windows
--- set xindycmd, glossarycmd according to pdflatex vs xelatex/lualatex:
-if ( latexname == "pdflatex" ) then
- xindycmd = "texindy "
- glossarycmd = "xindy "
-else
- xindycmd = "xindy -M texindy "
- glossarycmd = "xindy "
-end
-
end -- loadconf
@@ -13219,8 +14414,8 @@ os.execute ( rmname .. " *.aux " ..
sourcename ..".toc " .. sourcename .. "_html.toc " ..
sourcename ..".lof " .. sourcename .. "_html.lof " ..
sourcename ..".lot " .. sourcename .. "_html.lot " ..
- sourcename ..".idx " .. sourcename .. "_html.idx " ..
- sourcename ..".ind " .. sourcename .. "_html.ind " ..
+ " *.idx " ..
+ " *.ind " ..
sourcename ..".log " .. sourcename .. "_html.log " ..
sourcename ..".gl* " .. sourcename .. "_html.gl* " ..
" *_html_inc.* "
@@ -13472,10 +14667,8 @@ executecheckerror (
.. "-e "
.. opquote
.. "$makeindex = q/" -- $
- .. xindycmd
- .. " -M " .. xindystyle
- .. " -C " .. xindycodepage
- .. " -L " .. xindylanguage .. " /"
+ .. latexmkindexcmd
+ .. " /"
.. opquote
.. " -pdflatex=\"" .. latexname .. thisshellescape .." %O %S\" "
.. sourcename..fsuffix ..".tex"
@@ -13488,10 +14681,10 @@ end -- function
function convertpdftosvg ()
--
-- Converts PDF files to SVG files.
--- The filenames are arg[2] and up.
+-- The filenames are arg[argindex] and up.
-- arg[1] is the command "pdftosvg".
--
-for i = 2 , #arg do
+for i = argindex , #arg do
if (lfs.attributes(arg[i],"mode")==nil) then
print ("lwarpmk: File \"" .. arg[i] .. "\" does not exist.")
else
@@ -13502,6 +14695,14 @@ end -- do
end --function
+-- Force an update and conclude processing:
+function updateanddone ()
+print ("lwarpmk: Forcing an update of " .. sourcename ..".tex.")
+refreshdate ()
+print ("lwarpmk: " .. sourcename ..".tex is ready to be recompiled.")
+print ("lwarpmk: Done.")
+end -- function
+
-- Start of the main code: --
@@ -13554,26 +14755,18 @@ elseif arg[1] == "print1" then
print ("lwarpmk: Done.") ;
--- lwarp printindex:
+-- lwarpmk printindex:
-- Compile the index then touch the source
-- to trigger a recompile of the document:
elseif arg[1] == "printindex" then
loadconf ()
-print ("lwarpmk: Processing the index.")
-os.execute(
- xindycmd
- .. " -M " .. xindystyle
- .. " -C " .. xindycodepage
- .. " -L " .. xindylanguage
- .. " " .. sourcename .. ".idx")
-print ("lwarpmk: Forcing an update of " .. sourcename ..".tex.")
-refreshdate ()
-print ("lwarpmk: " .. sourcename ..".tex is ready to be recompiled.")
-print ("lwarpmk: Done.")
+os.execute ( printindexcmd )
+print ("lwarpmk: -------")
+updateanddone ()
--- lwarp printglossary:
+-- lwarpmk printglossary:
-- Compile the glossary then touch the source
-- to trigger a recompile of the document:
@@ -13581,16 +14774,8 @@ elseif arg[1] == "printglossary" then
loadconf ()
print ("lwarpmk: Processing the glossary.")
-os.execute(glossarycmd ..
- " -L " .. xindylanguage ..
- " -C " .. xindycodepage ..
- " -I xindy -M " .. sourcename ..
- " -t " .. sourcename .. ".glg -o " .. sourcename .. ".gls "
- .. sourcename .. ".glo")
-print ("lwarpmk: Forcing an update of " .. sourcename ..".tex.")
-refreshdate ()
-print ("lwarpmk: " .. sourcename ..".tex is ready to be recompiled.")
-print ("lwarpmk: Done.")
+os.execute(glossarycmd .. " " .. sourcename)
+updateanddone ()
-- lwarpmk html:
@@ -13643,39 +14828,21 @@ elseif arg[1] == "pdftohtml" then
elseif arg[1] == "htmlindex" then
loadconf ()
-print ("lwarpmk: Processing the index.")
-os.execute(
- xindycmd
- .. " -M " .. xindystyle
- .. " -L " .. xindylanguage
- .. " -C " .. xindycodepage
- .. " " .. sourcename .. "_html.idx"
-)
-print ("lwarpmk: Forcing an update of " .. sourcename ..".tex.")
-refreshdate ()
-print ("lwarpmk: " .. sourcename ..".tex is ready to be recompiled.")
-print ("lwarpmk: Done.")
+os.execute ( HTMLindexcmd )
+print ("lwarpmk: -------")
+updateanddone ()
-- lwarpmk htmlglossary:
-- Compile the glossary then touch the source
--- to trigger a recompile of the document:
+-- to trigger a recompile of the document.
+-- The <sourcename>.xdy file is created by the glossaries package.
elseif arg[1] == "htmlglossary" then
loadconf ()
print ("lwarpmk: Processing the glossary.")
-
-os.execute(glossarycmd ..
- " -L " .. xindylanguage ..
- " -C " .. xindycodepage ..
- " -I xindy -M " ..sourcename ..
- "_html -t " .. sourcename .. "_html.glg -o " ..sourcename ..
- "_html.gls " ..sourcename .. "_html.glo")
-
-print ("lwarpmk: Forcing an update of " .. sourcename ..".tex.")
-refreshdate ()
-print ("lwarpmk: " .. sourcename ..".tex is ready to be recompiled.")
-print ("lwarpmk: Done.")
+os.execute(glossarycmd .. " " .. sourcename .. "_html")
+updateanddone ()
-- lwarpmk limages:
@@ -13693,14 +14860,11 @@ print ("lwarpmk: Done.")
elseif arg[1] == "again" then
loadconf ()
-print ("lwarpmk: Forcing an update of " .. sourcename ..".tex.")
-refreshdate ()
-print ("lwarpmk: " .. sourcename ..".tex is ready to be recompiled.")
-print ("lwarpmk: Done.")
+updateanddone ()
-- lwarpmk clean:
--- Remove project.aux, .toc, .lof, .lot, .idx, .ind, .log, *_html_inc.*, .gl*
+-- Remove project.aux, .toc, .lof, .lot, .log, *.idx, *.ind, *_html_inc.*, .gl*
elseif arg[1] == "clean" then
loadconf ()
@@ -13709,7 +14873,7 @@ print ("lwarpmk: Done.")
-- lwarpmk cleanall
--- Remove project.aux, .toc, .lof, .lot, .idx, .ind, .log, *_html_inc.*, .gl*
+-- Remove project.aux, .toc, .lof, .lot, .log, *.idx, *.ind, *_html_inc.*, .gl*
-- and also project.pdf, *.html
elseif arg[1] == "cleanall" then
@@ -13987,7 +15151,7 @@ end -- not --version
%
% \begin{macro}{\LWR@getexparray} \marg{name} \marg{index}
% \begin{macrocode}
-\newcommand*{\LWR@getexparray}[2]{\csuse{#1#2}}
+\newcommand*{\LWR@getexparray}[2]{\@nameuse{#1#2}}
% \end{macrocode}
% \end{macro}
@@ -17029,15 +18193,15 @@ end -- not --version
\ifthenelse{%
\(%
\(\NOT\equal{#1}{\BooleanTrue}\)\OR%
- \(\cnttest{\csuse{LWR@depth#4}}{=}{\LWR@depthpart}\)\OR%
+ \(\cnttest{\@nameuse{LWR@depth#4}}{=}{\LWR@depthpart}\)\OR%
\(\boolean{LWR@forcinghtmlpage}\)%
\)%
\AND%
- \cnttest{\csuse{LWR@depth#4}}{<=}{\value{FileDepth}}%
+ \cnttest{\@nameuse{LWR@depth#4}}{<=}{\value{FileDepth}}%
\AND%
\(%
\NOT\boolean{CombineHigherDepths}\OR%
- \cnttest{\csuse{LWR@depth#4}}{<=}{\value{LWR@prevFileDepth}}%
+ \cnttest{\@nameuse{LWR@depth#4}}{<=}{\value{LWR@prevFileDepth}}%
\)%
\AND%
% \end{macrocode}
@@ -17114,7 +18278,7 @@ end -- not --version
% For inline sections paragraph and subparagraph, start a new paragraph now:
% \begin{macrocode}
\ifthenelse{%
- \cnttest{\csuse{LWR@depth#4}}{>=}{\LWR@depthparagraph}%
+ \cnttest{\@nameuse{LWR@depth#4}}{>=}{\LWR@depthparagraph}%
}%
{\LWR@startpars}%
{}%
@@ -17122,7 +18286,7 @@ end -- not --version
% Create the opening tag with an autosec:
% \begin{macrocode}
\LWR@traceinfo{LWR@section: about to LWR@createautosec}%
-\LWR@createautosec{\csuse{LWR@tag#4}}%
+\LWR@createautosec{\@nameuse{LWR@tag#4}}%
% \end{macrocode}
% \changes{v0.43}{2017/11/01}{Fix: Math in section name.}
% \begin{macrocode}
@@ -17149,7 +18313,7 @@ end -- not --version
% Only add a numbered TOC entry if section number is not too deep:
% \begin{macrocode}
\ifthenelse{%
- \cnttest{\csuse{LWR@depth#4}}{<=}{\value{secnumdepth}}%
+ \cnttest{\@nameuse{LWR@depth#4}}{<=}{\value{secnumdepth}}%
}%
{% if secnumdepth
% \end{macrocode}
@@ -17167,7 +18331,7 @@ end -- not --version
\LWR@traceinfo{LWR@section: about to addcontentsline}%
\addcontentsline{toc}{#4}%
{%
- \protect\numberline{\csuse{the#4}}%
+ \protect\numberline{\@nameuse{the#4}}%
{\ignorespaces\IfValueTF{#2}{#2}{#3}\protect\relax}%
}%
\LWR@traceinfo{LWR@section: finished addcontentsline}%
@@ -17192,18 +18356,18 @@ end -- not --version
\ifbool{LWR@mainmatter}%
{%
\ifthenelse{%
- \(\cnttest{\csuse{LWR@depth#4}}{<=}%
+ \(\cnttest{\@nameuse{LWR@depth#4}}{<=}%
{\value{secnumdepth}}\) \AND%
- \(\cnttest{\csuse{LWR@depth#4}}{<=}{\LWR@depthpart}\)%
+ \(\cnttest{\@nameuse{LWR@depth#4}}{<=}{\LWR@depthpart}\)%
}%
- {\csuse{#4name}~{}}%
+ {\@nameuse{#4name}~{}}%
{}%
% \end{macrocode}
% Print the section number:
% \begin{macrocode}
\LWR@traceinfo{LWR@section: about to print section number}%
\ifthenelse{%
- \cnttest{\csuse{LWR@depth#4}}{<=}{\value{secnumdepth}}%
+ \cnttest{\@nameuse{LWR@depth#4}}{<=}{\value{secnumdepth}}%
}%
{%
\ifstrequal{#4}{chapter}%
@@ -17223,7 +18387,7 @@ end -- not --version
% Close the heading tag, such as /H2:
% \begin{macrocode}
\LWR@traceinfo{LWR@section: about to close the heading tag}%
-\LWR@htmltag{\csuse{LWR@tag#4end}}%
+\LWR@htmltag{\@nameuse{LWR@tag#4end}}%
% \end{macrocode}
% Generate a \LaTeX{} label:
% \changes{v0.43}{2017/11/01}{Fix: Math in section name.}
@@ -17235,7 +18399,7 @@ end -- not --version
% Start paragraph handing unless is an inline paragraph or subparagraph:
% \begin{macrocode}
\ifthenelse{%
- \cnttest{\csuse{LWR@depth#4}}{<}{\LWR@depthparagraph}%
+ \cnttest{\@nameuse{LWR@depth#4}}{<}{\LWR@depthparagraph}%
}%
{\LWR@startpars}%
{}%
@@ -17255,10 +18419,10 @@ end -- not --version
% \begin{macrocode}
\ifthenelse{%
\NOT\equal{#1}{\BooleanTrue}\OR%
- \cnttest{\csuse{LWR@depth#4}}{=}{\LWR@depthpart}%
+ \cnttest{\@nameuse{LWR@depth#4}}{=}{\LWR@depthpart}%
}%
{% not starred
- \setcounter{LWR@prevFileDepth}{\csuse{LWR@depth#4}}%
+ \setcounter{LWR@prevFileDepth}{\@nameuse{LWR@depth#4}}%
}% not starred
{}%
% \end{macrocode}
@@ -17638,11 +18802,11 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}%
% \end{macrocode}
% Reduce chance of line overflow in verbatim environments:
% \begin{macrocode}
-\LWR@origscriptsize%
+\LWR@print@scriptsize%
% \end{macrocode}
% In \PDF\ output, don't allow line breaks to interfere with \HTML\ tags:
% \begin{macrocode}
-\LWR@origraggedright%
+\LWR@print@raggedright%
\LetLtxMacro{\\}{\LWR@endofline}%
% \end{macrocode}
% Spread the lines for \prog{pdftotext} to read them well:
@@ -17795,8 +18959,8 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}%
\newcommand*{\LWR@requesttoc}[2]{%
\ifbool{#1}
{
- \expandafter\newwrite\csuse{tf@#2}
- \immediate\openout \csuse{tf@#2} \jobname.#2\relax
+ \expandafter\newwrite\@nameuse{tf@#2}
+ \immediate\openout \@nameuse{tf@#2} \jobname.#2\relax
}{}
}
% \end{macrocode}
@@ -18797,9 +19961,9 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}%
% \changes{v0.50}{2018/03/02}{Improved column alignment.}
% \changes{v0.54}{2018/04/06}{Improved column alignment.}
% \begin{macrocode}
-% \LWR@orignormalsize%
+% \LWR@print@normalsize%
\LWR@origttfamily%
-\LWR@origsmall%
+\LWR@print@small%
% \end{macrocode}
% Since inside a \element{pre}, restore the original list processing:
% \begin{macrocode}
@@ -18887,32 +20051,23 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}%
%
% \changes{v0.42}{2017/10/13}{Added.}
% \changes{v0.52}{2018/03/27}{Fix to allow inside \env{lateximage}.}
-%
+% \changes{v0.58}{2018/06/07}{Improved print/\HTML\ output selection.}
% \begin{macrocode}
-\LetLtxMacro\LWR@origtabbing\tabbing
-\LetLtxMacro\LWR@origendtabbing\endtabbing
-
-\renewcommand*{\tabbing}{%
+\newcommand*{\LWR@HTML@tabbing}{%
\LWR@forcenewpage%
\LWR@atbeginverbatim{3}{tabbing}%
-\LWR@origtabbing%
+\LWR@print@tabbing%
}
-\renewcommand*{\endtabbing}{%
- \LWR@origendtabbing%
+\newcommand*{\LWR@HTML@endtabbing}{%
+ \LWR@print@endtabbing%
\LWR@afterendverbatim{1}%
}
+
+\LWR@formatted{tabbing}
+\LWR@formatted{endtabbing}
% \end{macrocode}
%
-% \cs{AtBeginDocument} because \cs{LWR@restoreorigformatting} has not yet been defined:
-% \begin{macrocode}
-\AtBeginDocument{
-\appto\LWR@restoreorigformatting{%
-\LetLtxMacro\tabbing\LWR@origtabbing%
-\LetLtxMacro\endtabbing\LWR@origendtabbing%
-}
-}
-% \end{macrocode}
% \end{environment}
% \begin{macrocode}
@@ -20610,8 +21765,10 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}%
% \end{macrocode}
% \begin{docsidebar}
% \raggedright
-% Many people define centered versions ``|P|'', ``|M|'', and ``|B|'': \\
-% \hspace*{1em}|\newcolumntype{P}[1]{>{\centering\arraybackslash}p{#1}}|
+% Many people define centered versions ``|P|'', ``|M|'', and ``|B|'':
+% \begin{Verbatim}[tabsize=4,gobble=2]
+% \newcolumntype{P}[1]{>{\centering\arraybackslash}p{#1}}
+% \end{Verbatim}
% \end{docsidebar}
% \begin{macrocode}
\IfStrEq{\LWR@strresult}{P}{\LWR@parsepcolumn{P}}{}%
@@ -22140,7 +23297,7 @@ rowspan="#2" %
{%
\refstepcounter{\LTcaptype}%
\protected@edef\@currentlabel{%
- \csuse{p@\LTcaptype}\csuse{the\LTcaptype}%
+ \@nameuse{p@\LTcaptype}\@nameuse{the\LTcaptype}%
}%
}%
}{}%
@@ -22148,7 +23305,7 @@ rowspan="#2" %
% Create an \HTML\ caption. Afterwards, maybe make a LOT entry.
% \begin{macrocode}
\LWR@figcaption%
- \csuse{fnum@\LTcaptype}\CaptionSeparator#3%
+ \@nameuse{fnum@\LTcaptype}\CaptionSeparator#3%
\endLWR@figcaption%
% \end{macrocode}
% See if an optional caption was given:
@@ -22168,11 +23325,11 @@ rowspan="#2" %
% \begin{macrocode}
{% No TOC entry
\addcontentsline%
- {\csuse{ext@\LTcaptype}}%
+ {\@nameuse{ext@\LTcaptype}}%
{\LTcaptype}%
{%
\protect\numberline%
- {\csuse{p@\LTcaptype}\csuse{the\LTcaptype}}%
+ {\@nameuse{p@\LTcaptype}\@nameuse{the\LTcaptype}}%
{\ignorespaces #3\protect\relax}%
}%
}% end of No TOC entry
@@ -22181,11 +23338,11 @@ rowspan="#2" %
% \begin{macrocode}
{% yes TOC entry
\addcontentsline%
- {\csuse{ext@\LTcaptype}}%
+ {\@nameuse{ext@\LTcaptype}}%
{\LTcaptype}%
{%
\protect\numberline%
- {\csuse{p@\LTcaptype}\csuse{the\LTcaptype}}%
+ {\@nameuse{p@\LTcaptype}\@nameuse{the\LTcaptype}}%
{\ignorespaces #2\protect\relax}%
}%
}% end of yes TOC entry
@@ -22416,6 +23573,15 @@ rowspan="#2" %
\newcommand*{\LWR@donothing}{}
% \end{macrocode}
%
+% In case \pkg{array} is not loaded:
+% \changes{v0.58}{2018/06/21}{\pkg{memoir}: Fix for \cs{firsthlline}, \cs{lasthline}.}
+% \begin{macrocode}
+\let\firsthline\relax
+\let\lasthline\relax
+\newcommand*{\firsthline}{}
+\newcommand*{\lasthline}{}
+% \end{macrocode}
+%
% In case \pkg{bigdelim} is not loaded:
% \begin{macrocode}
\newcommand*{\ldelim}{}
@@ -22742,9 +23908,19 @@ rowspan="#2" %
%
% These are default defininitions in case \pkg{booktabs} is not loaded,
% and are not expected to used, but must exist as placeholders.
+% They are pre-deleted in case \pkg{memoir} has already loaded \pkg{booktabs}.
%
% \changes{v0.34}{2017/08/08}{\pkg{booktabs}: Works inside \env{lateximage}.}
+% \changes{v0.58}{2018/06/21}{\pkg{memoir}: Fix for \pkg{booktabs}.}
% \begin{macrocode}
+\LetLtxMacro\toprule\relax
+\LetLtxMacro\midrule\relax
+\LetLtxMacro\cmidrule\cline
+\LetLtxMacro\bottomrule\relax
+\LetLtxMacro\addlinespace\relax
+\LetLtxMacro\morecmidrules\relax
+\LetLtxMacro\specialrule\relax
+
\newcommand*{\toprule}[1][]{\hline}
\newcommand*{\midrule}[1][]{\hline}
\LetLtxMacro\cmidrule\cline
@@ -23213,7 +24389,7 @@ rowspan="#2" %
% See: \\
% \href{http://tex.stackexchange.com/questions/57194/extract-section-number-from-equation-reference}
% {\ttfamily http://tex.stackexchange.com/questions/57194/ \\
-% \hspace*{2em}extract-section-number-from-equation-reference}
+% \fqquad\ extract-section-number-from-equation-reference}
%
% Create a new property list called special:
% \begin{macrocode}
@@ -23361,41 +24537,45 @@ rowspan="#2" %
% \end{macro}
%
%
-% \begin{macro}{\LWR@newlabel} \parg{bookmark} \marg{label} \oarg{type}
+% \begin{macro}{\LWR@new@label} \parg{bookmark} \marg{label} \oarg{type}
%
% \cs{label} during \HTML\ output when not in \SVG\ math mode,
% removing extra spaces around the label, as done by regular \LaTeX\ \cs{label}.
%
+% The is also used during a \env{lateximage}, including \SVG\ math, since
+% the special label handling is required, but \cs{LWR@sublabel} does not
+% generate \HTML\ tags inside a \env{lateximage}.
+%
% \pkg{clevereref} later encases this to add its own cross-referencing.
%
% The optional \meta{bookmark} is per the \pkg{memoir} class, and is ignored.
%
% The optional \meta{type} is per the \pkg{ntheorem} package, and is ignored.
+%
% \begin{macrocode}
-\NewDocumentCommand{\LWR@newlabel}{d() m o}{%
-\LWR@traceinfo{LWR@newlabel: starting}%
-\LWR@traceinfo{LWR@newlabel: !#2!}%
+\NewDocumentCommand{\LWR@new@label}{d() m o}{%
+\LWR@traceinfo{LWR@new@label: starting}%
+\LWR@traceinfo{LWR@new@label: !#2!}%
% \@bsphack%
% \end{macrocode}
% Create a traditional \LaTeX\ label, as modified by \pkg{cleveref}:
% \begin{macrocode}
-\LWR@origlabel{#2}%
+\LWR@orig@label{#2}%
% \end{macrocode}
% Create a special label which holds the section number,
% |LWR@htmlfilenumber|, |LWR@lateximagedepth|, and |LWR@lateximagenumber|:
% \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 \arabic{LWR@htmlfilenumber}}%
+\LWR@traceinfo{LWR@new@label: filesectionnames is \ifbool{FileSectionNames}{true}{false}}%
+\LWR@traceinfo{LWR@new@label: LWR@thisfilename is !\LWR@thisfilename!}%
+\LWR@traceinfo{LWR@new@label: LWR@htmlfilenumber is \arabic{LWR@htmlfilenumber}}%
\LWR@splabel{#2}%
\LWR@sublabel{#2}%
% \@esphack%
-\LWR@traceinfo{LWR@newlabel: done}%
+\LWR@traceinfo{LWR@new@label: done}%
}
% \end{macrocode}
% \end{macro}
-%
-%
+
% \subsection{References}
@@ -23479,26 +24659,30 @@ rowspan="#2" %
\NewDocumentCommand{\LWR@subnewref}{m m}{%
\LWR@traceinfo{LWR@subnewref #1 #2}%
\LWR@startref{#1}%
-\LWR@origref{#2}%
+\LWR@print@ref{#2}%
\LWR@htmltag{/a}%
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\ref} * \marg{label} \quad
-% \cs{ref} is redefined to \cs{LWR@newref},
+% \cs{ref} is redefined to \cs{LWR@HTML@ref},
% except inside the text part of a \cs{hyperref},
% where it is redefined to \cs{LWR@ref@ignorestar}.
-% \begin{macro}{\LWR@newref} * \marg{label}
+% \begin{macro}{\LWR@HTML@ref} * \marg{label}
% Create an internal document reference link,
% or without a link if starred per \pkg{hyperref}.
+%
+% \changes{v0.58}{2018/06/07}{Improved print/\HTML\ output selection.}
% \begin{macrocode}
-\NewDocumentCommand{\LWR@newref}{s m}{%
-\LWR@traceinfo{LWR@newref !#2!}%
+\NewDocumentCommand{\LWR@HTML@ref}{s m}{%
+\LWR@traceinfo{LWR@HTML@ref !#2!}%
\IfBooleanTF{#1}%
-{\LWR@origref{#2}}%
+{\LWR@print@ref{#2}}%
{\LWR@subnewref{#2}{#2}}%
}
+
+\LWR@formatted{ref}
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -23509,7 +24693,7 @@ rowspan="#2" %
% \changes{v0.57}{2018/06/05}{\pkg{subcaption}: Fix: \cs{subref}.}
% \begin{macrocode}
\NewDocumentCommand{\LWR@ref@ignorestar}{s m}{%
- \LWR@origref{#2}%
+ \LWR@print@ref{#2}%
}
% \end{macrocode}
% \end{macro}
@@ -23532,9 +24716,9 @@ rowspan="#2" %
% \changes{v0.20}{2017/01/03}{Added.}
%
% \begin{macrocode}
-\NewDocumentCommand{\LWR@newpageref}{s m}{%
+\NewDocumentCommand{\LWR@new@pageref}{s m}{%
\IfBooleanTF{#1}%
-{(\pagerefPageFor\LWR@origref{#2})}%
+{(\pagerefPageFor\LWR@print@ref{#2})}%
{(\cpageref{#2})}%
}
% \end{macrocode}
@@ -23844,7 +25028,7 @@ autopage-\theLWR@currentautosec%
% \end{macrocode}
% Settings while inside the environment:
% \begin{macrocode}
-\LWR@origraggedright%
+\LWR@print@raggedright%
% \end{macrocode}
% Open an \HTML\ |figure| tag.
% The figure is assigned a \attribute{class} equal to its type,
@@ -23857,7 +25041,7 @@ autopage-\theLWR@currentautosec%
% \begin{macrocode}
\LWR@htmltag{%
figure id="\LWR@print@mbox{autoid-\arabic{LWR@thisautoid}}" % space
- class="#1 \csuse{LWR@floatstyle@#1}"%
+ class="#1 \@nameuse{LWR@floatstyle@#1}"%
}%
\ifbool{FormatWP}{%
\LWR@orignewline%
@@ -24044,7 +25228,7 @@ autopage-\theLWR@currentautosec%
% \changes{v0.54}{2018/04/19}{Honor \cs{centering}, etc. in floats.}
% \begin{macrocode}
\newcommand*{\LWR@endfloatalignment}{%
-\ifdefvoid{\LWR@floatalignmentname}{}{\csuse{end\LWR@floatalignmentname}}%
+\ifdefvoid{\LWR@floatalignmentname}{}{\@nameuse{end\LWR@floatalignmentname}}%
\renewcommand*{\LWR@floatalignmentname}{}%
}
% \end{macrocode}
@@ -24144,24 +25328,17 @@ autopage-\theLWR@currentautosec%
}
% \end{macrocode}
% \end{environment}
-
%
-% After packages have loaded, remember the print-mode version of the following:
-% \begin{macrocode}
-\AtBeginDocument{
-\LetLtxMacro\LWR@origcaption@begin\caption@begin
-\LetLtxMacro\LWR@origcaption@end\caption@end
-}
-% \end{macrocode}
-
-% \begin{macro}{\LWR@caption@begin} \marg{type}
+%
+% \begin{macro}{\LWR@HTML@caption@begin} \marg{type}
%
% Low-level patches to create \HTML\ tags for captions.
% \changes{v0.47}{2018/01/28}{Fix: Argument passed to \cs{LWR@origcaption@begin}.}
+% \changes{v0.58}{2018/06/07}{Improved print/\HTML\ output selection.}
% \begin{macrocode}
-\newcommand{\LWR@caption@begin}[1]
+\newcommand*{\LWR@HTML@caption@begin}[1]
{
-\LWR@traceinfo{LWR@caption@begin}%
+\LWR@traceinfo{LWR@HTML@caption@begin}%
% \end{macrocode}
% Keep par and minipage changes local:
% \begin{macrocode}
@@ -24179,27 +25356,28 @@ autopage-\theLWR@currentautosec%
% Enclose the original caption code inside an \HTML\ tag:
% \begin{macrocode}
\LWR@figcaption%
-\LWR@traceinfo{LWR@caption@begin: about to LWR@origcaption@begin}%
-\LWR@origcaption@begin{#1}%
-\LWR@traceinfo{LWR@caption@begin: done}%
+\LWR@traceinfo{LWR@HTML@caption@begin: about to LWR@origcaption@begin}%
+\LWR@print@caption@begin{#1}%
+\LWR@traceinfo{LWR@HTML@caption@begin: done}%
}
% \end{macrocode}
% \end{macro}
-% \begin{macro}{\LWR@caption@end}
+% \begin{macro}{\LWR@HTML@caption@end}
% Low-level patches to create \HTML\ tags for captions.
+% \changes{v0.58}{2018/06/07}{Improved print/\HTML\ output selection.}
% \begin{macrocode}
-\newcommand{\LWR@caption@end}
+\newcommand*{\LWR@HTML@caption@end}
{%
-\LWR@traceinfo{LWR@caption@end}%
-\LWR@origcaption@end%
+\LWR@traceinfo{LWR@HTML@caption@end}%
+\LWR@print@caption@end%
% \end{macrocode}
% Closing tag:
% \begin{macrocode}
\endLWR@figcaption%
\endgroup%
% \leavevmode% avoid bad space factor (0) error
-\LWR@traceinfo{LWR@caption@end: done}%
+\LWR@traceinfo{LWR@HTML@caption@end: done}%
}
% \end{macrocode}
% \end{macro}
@@ -24207,10 +25385,13 @@ autopage-\theLWR@currentautosec%
% \begin{macro}{\caption@begin}
% \begin{macro}{\caption@end}
% Low-level patches to create \HTML\ tags for captions.
+% These are assigned \cs{AtBeginDocument} so that other packages
+% which modify captions will have already been loaded before saving the
+% print-mode version.
% \begin{macrocode}
\AtBeginDocument{
-\let\caption@begin\LWR@caption@begin
-\let\caption@end\LWR@caption@end
+\LWR@formatted{caption@begin}
+\LWR@formatted{caption@end}
}
% \end{macrocode}
% \end{macro}
@@ -24518,12 +25699,12 @@ autopage-\theLWR@currentautosec%
% \begin{macrocode}
\NewDocumentCommand{\listof}{m +m}{%
\@ifundefined{l@#1}{%
- \csdef{l@#1}[2]{\hypertocfloat{1}{#1}{\csuse{ext@#1}}{##1}{##2}}%
+ \csdef{l@#1}[2]{\hypertocfloat{1}{#1}{\@nameuse{ext@#1}}{##1}{##2}}%
}{}%
\LWR@subtableofcontents{\@nameuse{ext@#1}}{#2}
\expandafter\newwrite\csname tf@\csname ext@#1\endcsname\endcsname
\immediate\openout \csname tf@\csname ext@#1\endcsname\endcsname
- \jobname.\csuse{ext@#1}\relax
+ \jobname.\@nameuse{ext@#1}\relax
}
% \end{macrocode}
% \end{macro}
@@ -24812,7 +25993,7 @@ autopage-\theLWR@currentautosec%
% See:\\
% \href{http://tex.stackexchange.com/questions/187038/how-to-mention-section-number-in-index-created-by-imakeidx}
% {\texttt{http://tex.stackexchange.com/questions/187038/\\
-% \hspace*{2em}how-to-mention-section-number-in-index-created-by-imakeidx}}
+% \fqquad\ how-to-mention-section-number-in-index-created-by-imakeidx}}
% Index links are tracked by the counter |LWR@autoindex|.
% This counter is used to create a label for each index entry, and
@@ -24835,44 +26016,37 @@ autopage-\theLWR@currentautosec%
-% \begin{macro}{\printindex}
-% \begin{macrocode}
-\let\LWR@origprintindex\printindex
-
-\renewcommand*{\printindex}
-{
-\LWR@startpars
-\LWR@origprintindex
-}
-% \end{macrocode}
-% \end{macro}
-
% \begin{environment}{theindex}
% \begin{macrocode}
\@ifundefined{chapter}
{\newcommand*{\LWR@indexsection}[1]{\section*{#1}}}
{\newcommand*{\LWR@indexsection}[1]{\chapter*{#1}}}
+\AtBeginDocument{
\renewenvironment*{theindex}{%
-\LWR@indexsection{\indexname}%
-\let\item\LWR@indexitem%
-\let\subitem\LWR@indexsubitem%
-\let\subsubitem\LWR@indexsubsubitem%
+ \LWR@indexsection{\indexname}%
+ \let\item\LWR@indexitem%
+ \let\subitem\LWR@indexsubitem%
+ \let\subsubitem\LWR@indexsubsubitem%
}{}
+}% AtBeginDocument
% \end{macrocode}
% \end{environment}
-% \begin{macro}{\LWR@indexitem}
+% \begin{macro}{\LWR@indexitem} \oarg{index key} \qquad
+% The optional argument is added to support \pkg{repeatindex}.
+%
+% \changes{v0.58}{2018/06/21}{Accepts optional arg for \pkg{repeatindex}.}
% \begin{macrocode}
-\newcommand{\LWR@indexitem}{
+\newcommand{\LWR@indexitem}[1][\@empty]{
-\InlineClass{indexitem}{}
+\InlineClass{indexitem}{}#1%
}
% \end{macrocode}
% \end{macro}
-% \begin{macro}{\LWR@indexitem}
+% \begin{macro}{\LWR@indexsubitem}
% \begin{macrocode}
\newcommand{\LWR@indexsubitem}{
@@ -24881,7 +26055,7 @@ autopage-\theLWR@currentautosec%
% \end{macrocode}
% \end{macro}
-% \begin{macro}{\LWR@indexitem}
+% \begin{macro}{\LWR@indexsubsubitem}
% \begin{macrocode}
\newcommand{\LWR@indexsubsubitem}{
@@ -24892,28 +26066,30 @@ autopage-\theLWR@currentautosec%
% \begin{macro}{\@wrindex} \marg{term} \qquad
-% Redefined to write the |LWR@autoindex| counter instead of |page|
+% Redefined to write the |LWR@autoindex| counter instead of |page|.
% \changes{v0.28}{2017/04/13}{Improved indexing.}
% \begin{macrocode}
\def\LWR@wrindex#1{%
\addtocounter{LWR@autoindex}{1}%
-\LWR@newlabel{LWRindex-\arabic{LWR@autoindex}}%
+\LWR@new@label{LWRindex-\arabic{LWR@autoindex}}%
\protected@write\@indexfile{}%
{\string\indexentry{#1}{\arabic{LWR@autoindex}}}%
\endgroup
\@esphack}
+\AtBeginDocument{
\let\@wrindex\LWR@wrindex
+}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\@wrglossary} \marg{term} \qquad
-% Redefined to write the |LWR@latestautopage| counter instead of |page|
+% Redefined to write the |LWR@latestautopage| counter instead of |page|.
% \begin{macrocode}
\def\@wrglossary#1{%
\addtocounter{LWR@autoglossary}{1}%
-\LWR@newlabel{LWRglossary-\theLWR@autoglossary}%
+\LWR@new@label{LWRglossary-\theLWR@autoglossary}%
\protected@write\@glossaryfile{}%
{\string\glossaryentry{#1}{\theLWR@autoglossary}}%
\endgroup
@@ -24922,16 +26098,74 @@ autopage-\theLWR@currentautosec%
% \end{macro}
+% \begin{macro}{\LWR@indexnameref} \marg{LWR@autoindex}
+%
+% Creates a hyperlink based on the given entry's autoindex.
+% \begin{macrocode}
+\newcommand*{\LWR@indexnameref}[1]{\nameref{LWRindex-#1}}
+% \end{macrocode}
+% \end{macro}
-% \begin{macro}{\hyperindexref} \marg{autosecnumber}
+% \begin{macro}{\LWR@doindexentry} \marg{LWR@autoindex, or macros.}
%
-% |\hyperindexref{web address}| is inserted into |*.ind| by
-% the xindy style file |lwarp.xdy|
+% Creates a hyperlink, or handles \cs{see}, \cs{textbf}, etc.
+%
+% \changes{v0.58}{2018/06/17}{Adds support for \cs{see}, \cs{seealso}, \cs{emph}, \cs{textbf}, etc.}
+% \begin{macrocode}
+\newrobustcmd{\LWR@doindexentry}[1]{%
+\IfInteger{#1}%
+ {\LWR@indexnameref{#1}}%
+ {#1}%
+}
+% \end{macrocode}
+% \end{macro}
+
+
+% \begin{macro}{\LWR@hyperindexrefnullified} \qquad
+% Handles macros commonly seen inside an \cs{index} entry.
+%
+% To handle additional macros:
+% \begin{sourcedisplay}
+% \cs{appto}\cs{LWR@hyperindexrefnullified}\{\dots\}
+% \end{sourcedisplay}
+%
+% \changes{v0.58}{2018/06/17}{Adds support for \cs{see}, \cs{seealso}, \cs{emph}, \cs{textbf}, etc.}
+% \begin{macrocode}
+\newcommand{\LWR@hyperindexrefnullified}{%
+\renewcommand{\emph}[1]{\LWR@HTMLemph{\LWR@doindexentry{##1}}}%
+\renewcommand{\textbf}[1]{\LWR@HTMLtextbf{\LWR@doindexentry{##1}}}%
+\renewcommand{\textrm}[1]{\LWR@HTMLtextrm{\LWR@doindexentry{##1}}}%
+\renewcommand{\textsf}[1]{\LWR@HTMLtextsf{\LWR@doindexentry{##1}}}%
+\renewcommand{\texttt}[1]{\LWR@HTMLtexttt{\LWR@doindexentry{##1}}}%
+\renewcommand{\textup}[1]{\LWR@HTMLtextup{\LWR@doindexentry{##1}}}%
+\renewcommand{\textsc}[1]{\LWR@HTMLtextsc{\LWR@doindexentry{##1}}}%
+\renewcommand{\textit}[1]{\LWR@HTMLtextit{\LWR@doindexentry{##1}}}%
+\renewcommand{\textsl}[1]{\LWR@HTMLtextsl{\LWR@doindexentry{##1}}}%
+}
+% \end{macrocode}
+% \end{macro}
+
+
+% \begin{macro}{\hyperindexref} \marg{LWR@autoindex}
+%
+% |\hyperindexref{LWR@autoindex}| is inserted into |*.ind| by
+% the \pkg{makeindex} style file \filenm{lwarp.ist} or
+% the \pkg{xindy} style file \filenm{lwarp.xdy}.
%
% \changes{v0.20}{2016/12/19}{Print mode provided in case \pkg{hyperref} not used.}
% \changes{v0.28}{2017/04/13}{Improved indexing.}
+% \changes{v0.58}{2018/06/17}{Adds support for \cs{see}, \cs{seealso}, \cs{emph}, \cs{textbf}, etc.}
% \begin{macrocode}
-\newcommand*{\hyperindexref}[1]{\nameref{LWRindex-#1}}
+\newcommand{\hyperindexref}[1]{%
+\IfInteger{#1}%
+ {\LWR@indexnameref{#1}}%
+ {%
+ \begingroup%
+ \LWR@hyperindexrefnullified
+ #1%
+ \endgroup%
+ }%
+}
% \end{macrocode}
% \end{macro}
@@ -25011,7 +26245,7 @@ autopage-\theLWR@currentautosec%
% {
% \footnotesize
% \textit{Adapted from |embracedef.sty|, which is by \textup{\textsc{Takayuki YATO}}:} \\
-% \hspace*{2em}\url{https://gist.github.com/zr-tex8r/b72555e3e7ad2f0a37f1}
+% \fqquad\url{https://gist.github.com/zr-tex8r/b72555e3e7ad2f0a37f1}
% }
%
% \changes{v0.45}{2018/01/13}{Patched to emphasize titles.}
@@ -25076,53 +26310,29 @@ autopage-\theLWR@currentautosec%
% \begin{macrocode}
\newcommand*{\LWR@restoreorigformatting}{%
\LWR@traceinfo{LWR@restoreorigformatting}%
+% \end{macrocode}
+% Numerous macros change their print/\HTML\ meaning depending on \cs{LWR@formatting}:
+% \begin{macrocode}
\renewcommand*{\LWR@formatting}{print}%
\linespread{1}%
% \end{macrocode}
%
% \begin{macrocode}
-\LetLtxMacro\caption@begin\LWR@origcaption@begin%
-\LetLtxMacro\caption@end\LWR@origcaption@end%
\let\par\LWR@origpar%
% \end{macrocode}
%
-% \changes{v0.43}{2017/10/31}{Fix: \cs{ref} in math or lateximage.}
-% \begin{macrocode}
-\LetLtxMacro\ref\LWR@origref% {} syntax highlighting
-% \end{macrocode}
-% \changes{v0.48}{2018/02/04}{Fix: Font sizes in \SVG\ math, \env{lateximage}, \tikz.}
-% \begin{macrocode}
-\let\normalsize\LWR@orignormalsize%
-\let\small\LWR@origsmall%
-\let\footnotesize\LWR@origfootnotesize%
-\let\scriptsize\LWR@origscriptsize%
-\let\tiny\LWR@origtiny%
-\let\large\LWR@origlarge%
-\let\Large\LWR@origLarge%
-\let\LARGE\LWR@origLARGE%
-\let\huge\LWR@orighuge%
-\let\Huge\LWR@origHuge%
-% \end{macrocode}
% \begin{macrocode}
\LWR@select@print@hspace%
% \end{macrocode}
+%
% \changes{v0.48}{2018/02/04}{Fix: Spacing in \SVG\ math, \env{lateximage}, \tikz.}
% \begin{macrocode}
-\LetLtxMacro\hfill\LWR@orighfill%
\LetLtxMacro\hfil\LWR@orighfil%
-\LetLtxMacro\hrulefill\LWR@orighrulefill%
-\LetLtxMacro\dotfill\LWR@origdotfill%
\let\hss\LWR@orighss%
\let\llap\LWR@origllap%
\let\rlap\LWR@origrlap%
\let\hfilneg\LWR@orighfilneg%
% \end{macrocode}
-% \changes{v0.50}{2018/02/22}{Fix: \cs{centering}, etc. in \SVG\ math, \env{lateximage}, \tikz.}
-% \begin{macrocode}
-\let\raggedright\LWR@origraggedright%
-\let\raggedleft\LWR@origraggedleft%
-\let\centering\LWR@origcentering%
-% \end{macrocode}
% \begin{macrocode}
\let\,\LWR@origcomma% disable HTML short unbreakable space
\let\thinspace\LWR@origthinspace% disable HTML short unbreakable space
@@ -25429,17 +26639,17 @@ autopage-\theLWR@currentautosec%
% \begin{macrocode}
\LWR@restoreorigformatting%
\RenewDocumentEnvironment{lateximage}{s o o o}{}{}% inside group
- \LWR@orignormalsize%
+ \LWR@print@normalsize%
% \end{macrocode}
% Temporarily set font for the \HTML\ \PDF\ output:
% \changes{v0.51}{2018/03/14}{Fix: Honors text font around \SVG\ math.}
% \begin{macrocode}
\LWR@traceinfo{Using font family \LWR@f@family}%
- \csuse{LWR@orig\LWR@f@family family}%
+ \@nameuse{LWR@orig\LWR@f@family family}%
\LWR@traceinfo{Using font series \LWR@f@series}%
- \csuse{LWR@orig\LWR@f@series series}%
+ \@nameuse{LWR@orig\LWR@f@series series}%
\LWR@traceinfo{Using font shape \LWR@f@shape}%
- \csuse{LWR@orig\LWR@f@shape shape}%
+ \@nameuse{LWR@orig\LWR@f@shape shape}%
% \end{macrocode}
% |lateximagedepth| must be nested to avoid generating paragraph tags.
% \AmS\ math modifies the \cs{text} macro such that \cs{addtocounter} does not
@@ -25971,7 +27181,7 @@ autopage-\theLWR@currentautosec%
% Start the \LaTeX\ math environment inside the \HTML\ comment:
% \begin{macrocode}
\begingroup
-\csuse{LWR@orig#1}
+\@nameuse{LWR@orig#1}
% \end{macrocode}
% While in the math environment,
% restore various commands to their \LaTeX\ meanings.
@@ -25989,7 +27199,7 @@ autopage-\theLWR@currentautosec%
% \end{macrocode}
% End the \LaTeX{} math environment inside the \HTML\ comment:
% \begin{macrocode}
-\csuse{LWR@origend#1}
+\@nameuse{LWR@origend#1}
\endgroup
% \end{macrocode}
@@ -26040,7 +27250,8 @@ autopage-\theLWR@currentautosec%
% \end{macrocode}
%
%
-% \begin{macro}{\LWR@doequation}
+% \begin{macro}{\LWR@doequation} \marg{env contents} \marg{env name}
+%
% \changes{v0.19}{2016/05/25}{\brand{MathJax} support.}
% \changes{v0.52}{2018/03/28}{Fix: \env{equation*} with \env{split}.}
%
@@ -26115,11 +27326,11 @@ autopage-\theLWR@currentautosec%
% Create the actual \LaTeX-formatted equation inside
% the |lateximage| using the contents of the environment.
% \begin{macrocode}
- \csuse{LWR@orig#2}
+ \@nameuse{LWR@orig#2}%
#1% contents collected by \collect@body
- \csuse{LWR@origend#2}
+ \@nameuse{LWR@origend#2}%
\end{lateximage}%
- \end{BlockClass}
+ \end{BlockClass}%
}% not mathjax
}
% \end{macrocode}
@@ -26154,10 +27365,8 @@ autopage-\theLWR@currentautosec%
% which stores the contents of its environment in a
% macro called \cs{BODY}.
% \begin{macrocode}
-\NewEnviron{equation}
-{
-\LWR@doequation{\BODY}{equation}
-}
+\NewEnviron{equation}%
+{\LWR@doequation{\BODY}{equation}}%
[\LWR@doendequation{equation}]
\LetLtxMacro\LWR@equationnormal\equation
@@ -26168,8 +27377,8 @@ autopage-\theLWR@currentautosec%
% \begin{environment}{equation*}
% \begin{macrocode}
-\NewEnviron{equation*}
-{\LWR@doequation{\BODY}{equation*}}
+\NewEnviron{equation*}%
+{\LWR@doequation{\BODY}{equation*}}%
[\LWR@doendequation{equation*}]
\csletcs{LWR@equationnormalstar}{equation*}
@@ -26300,12 +27509,12 @@ autopage-\theLWR@currentautosec%
% \end{macrocode}
% The combined \LaTeX\ \& \HTML\ label is printed in a \cs{text} field:
% \begin{macrocode}
- \text{
+ \text{%
% \end{macrocode}
% Shift the label over to the right side of the environment to avoid
% over-printing the math:
% \begin{macrocode}
- \ifbool{LWR@amsmultline}{}{\hspace*{\totwidth@}}
+ \ifbool{LWR@amsmultline}{}{\hspace*{\totwidth@}}%
% \end{macrocode}
% Temporarily end the \HTML\ comment,
% insert the \LaTeX{} \& \HTML\ label, then
@@ -27365,7 +28574,7 @@ autopage-\theLWR@currentautosec%
% \begin{macrocode}
\LWR@traceinfo{lateximage: about to create minipage}%
\LWR@print@minipage{6in}%
- \csuse{LWR@orig\LateximageFontSizeName}%
+ \@nameuse{LWR@print@\LateximageFontSizeName}%
% \end{macrocode}
% Temporarily restore formatting to its \PDF\ definitions:
% Do not produce \HTML\ tags for \cs{hspace}, etc. inside a lateximage.
@@ -27383,7 +28592,7 @@ autopage-\theLWR@currentautosec%
% Create the |LWRlateximage<number>| label:
% \begin{macrocode}
\LWR@traceinfo{lateximage: about to create label}%
- \LWR@origlabel{LWRlateximage\arabic{LWR@lateximagenumber}}%
+ \LWR@orig@label{LWRlateximage\arabic{LWR@lateximagenumber}}%
\LWR@traceinfo{lateximage: finished creating the label}%
% \end{macrocode}
% Enable print-mode math functions:
@@ -27446,7 +28655,7 @@ autopage-\theLWR@currentautosec%
\LWR@traceinfo{lateximage: ending outer-most lateximage}%
\endLWR@print@minipage%
\LWR@orignewpage%
- \LWR@origscriptsize%
+ \LWR@print@scriptsize%
% \end{macrocode}
% Close the \HTML\ comment which encapsulated any traces of the lateximage picked up by \prog{pdftotext}:
% \begin{macrocode}
@@ -27582,33 +28791,36 @@ autopage-\theLWR@currentautosec%
% \begin{macro}{\centering}
% \changes{v0.54}{2018/04/19}{Added debug comment.}
% \begin{macrocode}
-\renewcommand*{\centering}{%
+\newcommand*{\LWR@HTML@centering}{%
\ifbool{HTMLDebugComments}{%
\LWR@htmlcomment{centering}%
}{}%
}
+\LWR@formatted{centering}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\raggedleft}
% \changes{v0.54}{2018/04/19}{Added debug comment.}
% \begin{macrocode}
-\renewcommand*{\raggedleft}{%
+\newcommand*{\LWR@HTML@raggedleft}{%
\ifbool{HTMLDebugComments}{%
\LWR@htmlcomment{raggedleft}%
}{}%
}
+\LWR@formatted{raggedleft}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\raggedright}
% \changes{v0.54}{2018/04/19}{Added debug comment.}
% \begin{macrocode}
-\renewcommand*{\raggedright}{%
+\newcommand*{\LWR@HTML@raggedright}{%
\ifbool{HTMLDebugComments}{%
\LWR@htmlcomment{raggedright}%
}{}%
}
+\LWR@formatted{raggedright}
% \end{macrocode}
% \end{macro}
@@ -27790,11 +29002,11 @@ autopage-\theLWR@currentautosec%
% \end{macrocode}
%
%
-% \textcolor{red}{After \pkg{xparse} may have been loaded \dots}
+% \textred{After \pkg{xparse} may have been loaded \dots}
% \begin{macrocode}
\AtBeginDocument{
% \end{macrocode}
-% \textcolor{red}{\dots\ and \emph{only} if \pkg{xcolor} was loaded:}
+% \textred{\dots\ and \emph{only} if \pkg{xcolor} was loaded:}
% \begin{macrocode}
\@ifpackageloaded{xcolor}{
\LWR@traceinfo{patching xcolor}
@@ -28214,23 +29426,20 @@ autopage-\theLWR@currentautosec%
% Remember and patch some label-related defintions.
% These will be further encased and patched by other packages later.
%
+% \cs{label} and \cs{pageref} do NOT change their behavior according to
+% print or \HTML\ output, and thus do not use the \cs{LWR@formatted} system.
+%
% \begin{macrocode}
-\LetLtxMacro\LWR@origlabel\label
-\RenewDocumentCommand{\label}{}{\LWR@newlabel}
-
-\LetLtxMacro\LWR@origref\ref
-\RenewDocumentCommand{\ref}{}{\LWR@newref}%
-
-\LetLtxMacro\LWR@origpageref\pageref
-\RenewDocumentCommand{\pageref}{}{\LWR@newpageref}
+\LetLtxMacro\LWR@orig@label\label
+\RenewDocumentCommand{\label}{}{\LWR@new@label}
+\LetLtxMacro\LWR@orig@pageref\pageref
+\RenewDocumentCommand{\pageref}{}{\LWR@new@pageref}
\end{warpHTML}
% \end{macrocode}
-
-
% \section{Picture}
% \label{sec:picture}
@@ -28471,7 +29680,7 @@ autopage-\theLWR@currentautosec%
% \end{macrocode}
% \cs{raggedright} cancels hyphenation, which will be done by \HTML\ instead.
% \begin{macrocode}
-\LWR@origraggedright%
+\LWR@print@raggedright%
% \end{macrocode}
% Set minipage footnotes:
% \begin{macrocode}
@@ -29033,7 +30242,7 @@ width:\LWR@printlength{\LWR@tempwidth}%
% \begin{macro}{\LWR@nullfonts} Removes formatting during filename operations.
%
-% \textcolor{red}{Use only inside a group.}\watchout
+% \textred{Use only inside a group.}\watchout
%
% The following are \emph{not} made robust,
% since they must be expanded to their nullified versions.
@@ -29390,18 +30599,40 @@ width:\LWR@printlength{\LWR@tempwidth}%
\renewrobustcmd*{\textellipsis}{\HTMLunicode{2026}}
% \end{macrocode}
+%
% Direct-formatting font sizes are ignored:
+%
+% \changes{v0.58}{2018/06/07}{Improved print/\HTML\ output selection.}
% \begin{macrocode}
-\renewrobustcmd*{\normalsize}{}
-\renewrobustcmd*{\small}{}
-\renewrobustcmd*{\footnotesize}{}
-\renewrobustcmd*{\scriptsize}{}
-\renewrobustcmd*{\tiny}{}
-\renewrobustcmd*{\large}{}
-\renewrobustcmd*{\Large}{}
-\renewrobustcmd*{\LARGE}{}
-\renewrobustcmd*{\huge}{}
-\renewrobustcmd*{\Huge}{}
+\newrobustcmd*{\LWR@HTML@normalsize}{}
+\LWR@formatted{normalsize}
+
+\newrobustcmd*{\LWR@HTML@small}{}
+\LWR@formatted{small}
+
+\newrobustcmd*{\LWR@HTML@footnotesize}{}
+\LWR@formatted{footnotesize}
+
+\newrobustcmd*{\LWR@HTML@scriptsize}{}
+\LWR@formatted{scriptsize}
+
+\newrobustcmd*{\LWR@HTML@tiny}{}
+\LWR@formatted{tiny}
+
+\newrobustcmd*{\LWR@HTML@large}{}
+\LWR@formatted{large}
+
+\newrobustcmd*{\LWR@HTML@Large}{}
+\LWR@formatted{Large}
+
+\newrobustcmd*{\LWR@HTML@LARGE}{}
+\LWR@formatted{LARGE}
+
+\newrobustcmd*{\LWR@HTML@huge}{}
+\LWR@formatted{huge}
+
+\newrobustcmd*{\LWR@HTML@Huge}{}
+\LWR@formatted{Huge}
% \end{macrocode}
%
% \changes{v0.49}{2018/02/18}{Fix: Adapt to classes.}
@@ -29418,22 +30649,28 @@ width:\LWR@printlength{\LWR@tempwidth}%
% \begin{macro}{\hfill}
% \changes{v0.20}{2016/12/12}{Inserts a \cs{qquad}.}
+% \changes{v0.58}{2018/06/07}{Improved print/\HTML\ output selection.}
% \begin{macrocode}
-\renewcommand*{\hfill}{\qquad}
+\newcommand*{\LWR@HTML@hfill}{\qquad}
+\LWR@formatted{hfill}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\hrulefill}
% \changes{v0.20}{2017/01/19}{Inserts a short rule.}
+% \changes{v0.58}{2018/06/07}{Improved print/\HTML\ output selection.}
% \begin{macrocode}
-\renewcommand*{\hrulefill}{\rule{1in}{1pt}}
+\newcommand*{\LWR@HTML@hrulefill}{\rule{1in}{1pt}}
+\LWR@formatted{hrulefill}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\dotfill}
% \changes{v0.20}{2017/01/19}{Inserts an ellipsis.}
+% \changes{v0.58}{2018/06/07}{Improved print/\HTML\ output selection.}
% \begin{macrocode}
-\renewcommand*{\dotfill}{\dots}
+\newcommand*{\LWR@HTML@dotfill}{\dots}
+\LWR@formatted{dotfill}
% \end{macrocode}
% \end{macro}
@@ -30871,9 +32108,9 @@ width:\LWR@printlength{\LWR@tempwidth}%
% \pkg{lwarp} caption handling:
% \begin{macrocode}
\renewcommand{\algocf@makecaption}[2]{%
-\LWR@caption@begin{algocf}%
+\LWR@HTML@caption@begin{algocf}%
\algocf@captiontext{#1}{#2}%
-\LWR@caption@end%
+\LWR@HTML@caption@end%
}
% \end{macrocode}
%
@@ -30881,21 +32118,21 @@ width:\LWR@printlength{\LWR@tempwidth}%
% Print any caption where it is declared:
% \begin{macrocode}
\renewcommand{\algocf@makecaption@plain}[2]{%
- \LWR@caption@begin{algocf}%
+ \LWR@HTML@caption@begin{algocf}%
\algocf@captiontext{#1}{#2}%
- \LWR@caption@end%
+ \LWR@HTML@caption@end%
}
\renewcommand{\algocf@makecaption@boxed}[2]{%
- \LWR@caption@begin{algocf}%
+ \LWR@HTML@caption@begin{algocf}%
\algocf@captiontext{#1}{#2}%
- \LWR@caption@end%
+ \LWR@HTML@caption@end%
}
\renewcommand{\algocf@makecaption@ruled}[2]{%
- \LWR@caption@begin{algocf}%
+ \LWR@HTML@caption@begin{algocf}%
\algocf@captiontext{#1}{#2}%
- \LWR@caption@end%
+ \LWR@HTML@caption@end%
}
% \end{macrocode}
%
@@ -31128,7 +32365,7 @@ span style="width:\LWR@printlength{\ALG@thistlm}; display:inline-block;"%
% \fi
%
% \part{lwarp-alltt.sty}
-
+%
% \section{alltt}
%
% \credits{Johannes Braams}
@@ -31143,7 +32380,7 @@ span style="width:\LWR@printlength{\ALG@thistlm}; display:inline-block;"%
% \begin{macrocode}
\LWR@ProvidesPackagePass{alltt}
% \end{macrocode}
-
+%
% \begin{macrocode}
\AfterEndPreamble{
\LWR@traceinfo{Patching alltt.}
@@ -31156,7 +32393,7 @@ span style="width:\LWR@printlength{\ALG@thistlm}; display:inline-block;"%
}
}
% \end{macrocode}
-
+%
% \iffalse
%</alltt>
% \fi
@@ -31239,7 +32476,7 @@ span style="width:\LWR@printlength{\ALG@thistlm}; display:inline-block;"%
\else % numbered theorem, need to check for optional arg
\def\@tempa{\@oparg{\@ynthm{#2}}[]}%
\fi
- \AtBeginEnvironment{#2}{\edef\LWR@thisthmstyle{\csuse{LWR@thmstyle#2}}}% lwarp
+ \AtBeginEnvironment{#2}{\edef\LWR@thisthmstyle{\@nameuse{LWR@thmstyle#2}}}% lwarp
}%
\@tempa
}
@@ -31558,24 +32795,24 @@ span style="width:\LWR@printlength{\ALG@thistlm}; display:inline-block;"%
% \pkg{array} is used as-is for print output, and emulated for \HTML.
%
% \changes{v0.45}{2017/12/03}{\pkg{array}: Added.}
+% \changes{v0.58}{2018/06/07}{\pkg{array}: Improved print/\HTML\ output selection.}
%
% \codehtml
%
+% Remove the dummy macros:
% \begin{macrocode}
+\let\firsthline\relax
+\let\lasthline\relax
+
\LWR@ProvidesPackagePass{array}
% \end{macrocode}
%
% \begin{macrocode}
-\let\LWR@origfirsthline\firsthline
-\let\LWR@origlasthline\lasthline
+\newcommand*{\LWR@HTML@firsthline}{\LWR@HTMLhline}%
+\LWR@expandableformatted{firsthline}
-\appto\LWR@restoreorigformatting{%
-\let\firsthline\LWR@origfirsthline%
-\let\lasthline\LWR@origlasthline%
-}
-
-\renewcommand*{\firsthline}{\LWR@HTMLhline}%
-\renewcommand*{\lasthline}{\LWR@HTMLhline}%
+\newcommand*{\LWR@HTML@lasthline}{\LWR@HTMLhline}%
+\LWR@expandableformatted{lasthline}
% \end{macrocode}
%
% \iffalse
@@ -31753,6 +32990,223 @@ span style="width:\LWR@printlength{\ALG@thistlm}; display:inline-block;"%
%
%
% \iffalse
+%<*attachfile>
+% \fi
+%
+% \part{lwarp-attachfile.sty}
+
+% \section{attachfile}
+%
+% \credits{Scott Pakin}
+%
+% \DescribePackage{attachfile}
+% \pkg{attachfile} is patched for use by \pkg{lwarp}.
+%
+% Metadata is ignored for now.\watchout
+%
+% \changes{v0.58}{2018/06/08}{\pkg{attachfile}: Added.}
+%
+% \codehtml
+%
+% \begin{macrocode}
+\LWR@ProvidesPackagePass{attachfile}
+% \end{macrocode}
+%
+% Encloses each icon:
+% \begin{macrocode}
+\newenvironment*{LWR@attachfile@icon}
+{
+ \begin{lateximage}*%
+ [-attachfile-]%
+ [%
+ \detokenize\expandafter{\atfi@icon@icon}-%
+ \detokenize\expandafter{\atfi@color@rgb}%
+ ]%
+}
+{
+ \end{lateximage}
+}
+% \end{macrocode}
+%
+% Each icon is enclosed inside a \env{LWR@attachfile@icon} environment:
+% \begin{macrocode}
+\xpretocmd{\atfi@acroGraph}{\LWR@attachfile@icon}{}{}
+\xapptocmd{\atfi@acroGraph}{\endLWR@attachfile@icon}{}{}
+
+\xpretocmd{\atfi@acroPaperclip}{\LWR@attachfile@icon}{}{}
+\xapptocmd{\atfi@acroPaperclip}{\endLWR@attachfile@icon}{}{}
+
+\xpretocmd{\atfi@acroPushPin}{\LWR@attachfile@icon}{}{}
+\xapptocmd{\atfi@acroPushPin}{\endLWR@attachfile@icon}{}{}
+
+\xpretocmd{\atfi@acroTag}{\LWR@attachfile@icon}{}{}
+\xapptocmd{\atfi@acroTag}{\endLWR@attachfile@icon}{}{}
+% \end{macrocode}
+%
+% Disable \PDF\ file embedding:
+% \begin{macrocode}
+\DeclareRobustCommand{\atfi@embedfile}[1]{}
+% \end{macrocode}
+%
+% The displayed output for an \cs{attachfile} reference:
+% \begin{macrocode}
+\newcommand*{\LWR@attachfile@appearance}{}
+
+\DeclareRobustCommand{\atfi@set@appearance}[1]{%
+ \def\LWR@attachfile@appearance{#1}%
+}
+% \end{macrocode}
+%
+% A file annotation becomes a reference:
+% \begin{macrocode}
+\DeclareRobustCommand{\atfi@insert@file@annot}[1]{%
+ \href{#1}{\LWR@attachfile@appearance}%
+}
+% \end{macrocode}
+
+% \iffalse
+%</attachfile>
+% \fi
+%
+%
+%
+%
+% \iffalse
+%<*attachfile2>
+% \fi
+%
+% \part{lwarp-attachfile2.sty}
+
+% \section{attachfile2}
+%
+% \credits{Heiko Oberdiek}
+%
+% \DescribePackage{attachfile2}
+% \pkg{attachfile2} is patched for use by \pkg{lwarp}.
+%
+% Metadata is ignored for now.\watchout
+%
+% \changes{v0.58}{2018/06/08}{\pkg{attachfile2}: Added.}
+%
+% \codehtml
+%
+% \begin{macrocode}
+\LWR@ProvidesPackagePass{attachfile2}
+% \end{macrocode}
+%
+% Adds memory of the selected color:
+% \begin{macrocode}
+\def\LWR@attachfiletwo@color{}%
+
+\define@key{AtFi}{color}{%
+ \def\LWR@attachfiletwo@color{#1}% lwarp
+ \HyColor@AttachfileColor{#1}%
+ \atfi@color@tex\atfi@color@inline\atfi@color@annot
+ {attachfile2}{color}%
+}
+% \end{macrocode}
+%
+% Encloses each icon:
+% \begin{macrocode}
+\newenvironment*{LWR@attachfile@icon}
+{
+ \begin{lateximage}*%
+ [-attachfile-]%
+ [%
+ \detokenize\expandafter{\atfi@icon@icon}-%
+ \detokenize\expandafter{\LWR@attachfiletwo@color}%
+ ]%
+}
+{
+ \end{lateximage}
+}
+% \end{macrocode}
+%
+% Each icon is enclosed inside a \env{LWR@attachfile@icon} environment:
+% \begin{macrocode}
+\xpretocmd{\atfi@acroGraph}{\LWR@attachfile@icon}{}{}
+\xapptocmd{\atfi@acroGraph}{\endLWR@attachfile@icon}{}{}
+
+\xpretocmd{\atfi@acroPaperclip}{\LWR@attachfile@icon}{}{}
+\xapptocmd{\atfi@acroPaperclip}{\endLWR@attachfile@icon}{}{}
+
+\xpretocmd{\atfi@acroPushPin}{\LWR@attachfile@icon}{}{}
+\xapptocmd{\atfi@acroPushPin}{\endLWR@attachfile@icon}{}{}
+
+\xpretocmd{\atfi@acroTag}{\LWR@attachfile@icon}{}{}
+\xapptocmd{\atfi@acroTag}{\endLWR@attachfile@icon}{}{}
+% \end{macrocode}
+%
+% Disable \PDF\ file embedding:
+% \begin{macrocode}
+\DeclareRobustCommand{\atfi@embedfile}[1]{}
+% \end{macrocode}
+%
+% The displayed output for an \cs{attachfile} reference:
+% \begin{macrocode}
+\newcommand*{\LWR@attachfile@appearance}{}
+
+\def\atfi@set@appearance@icon{%
+ \atfi@set@appearance{\csname atfi@acro\atfi@icon@icon\endcsname}%
+}
+
+\DeclareRobustCommand{\atfi@set@appearance}[1]{%
+ \def\LWR@attachfile@appearance{#1}%
+}
+% \end{macrocode}
+%
+% A file annotation becomes a reference:
+% \begin{macrocode}
+\DeclareRobustCommand{\atfi@insert@file@annot}[1]{%
+ \href{#1}{\LWR@attachfile@appearance}%
+}
+% \end{macrocode}
+%
+% Modified for text color:
+% \begin{macrocode}
+\DeclareRobustCommand{\notextattachfile}[2][]{%
+ \begingroup
+ \atfi@setup{#1}%
+ \ifatfi@print
+ \leavevmode
+ \begingroup
+ \HyColor@UseColor\atfi@color@tex
+ \LWR@textcurrentcolor{#2}% lwarp
+% \strut
+ \endgroup
+% \else
+% \sbox\ltx@zero{#2\strut}%
+% \makebox[\wd0]{}%
+ \fi
+ \endgroup
+}
+% \end{macrocode}
+%
+% Modified to draw the icon:
+% \begin{macrocode}
+\DeclareRobustCommand{\noattachfile}[1][]{%
+ \begingroup
+ \atfi@setup{#1}%
+ \atfi@set@appearance@icon
+ \ifatfi@print
+ \LWR@attachfile@appearance% lwarp
+% \expandafter
+% \atfi@refxform\csname atfi@appobj@\atfi@icon@icon\endcsname
+% \else
+% \makebox[\atfi@appearancewidth]{}%
+ \fi
+ \endgroup
+}
+% \end{macrocode}
+
+% \iffalse
+%</attachfile2>
+% \fi
+%
+%
+%
+%
+% \iffalse
%<*authblk>
% \fi
%
@@ -32666,6 +34120,59 @@ span style="width:\LWR@printlength{\ALG@thistlm}; display:inline-block;"%
%
%
% \iffalse
+%<*cases>
+% \fi
+%
+% \part{lwarp-cases.sty}
+%
+% \section{cases}
+%
+% \credits{Donald Arseneau}
+%
+% \DescribePackage{cases}
+% \pkg{cases} is patched for use by \pkg{lwarp}.
+%
+% \changes{v0.58}{2018/06/08}{\pkg{cases}: Added.}
+%
+% \codehtml
+%
+% \begin{macrocode}
+\LWR@ProvidesPackagePass{cases}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\BeforeBeginEnvironment{numcases}{
+ \begin{BlockClass}{displaymathnumbered}
+ \LWR@newautoidanchor%
+ \booltrue{LWR@indisplaymathimage}%
+ \begin{lateximage}[-cases- \mathimagename]
+}
+
+\AfterEndEnvironment{numcases}{
+ \end{lateximage}\end{BlockClass}
+}
+
+\BeforeBeginEnvironment{subnumcases}{
+ \begin{BlockClass}{displaymathnumbered}
+ \LWR@newautoidanchor%
+ \booltrue{LWR@indisplaymathimage}%
+ \begin{lateximage}[-cases- \mathimagename]
+}
+
+\AfterEndEnvironment{subnumcases}{
+ \end{lateximage}\end{BlockClass}
+}
+% \end{macrocode}
+%
+% \iffalse
+%</cases>
+% \fi
+%
+%
+%
+%
+%
+% \iffalse
%<*ccaption>
% \fi
@@ -33923,7 +35430,7 @@ span style="width:\LWR@printlength{\ALG@thistlm}; display:inline-block;"%
% \subsection{Reactions}
%
% \begin{noindmacro}{\chemmacros\_declare\_reaction\_env} \\
-% \hspace*{2em} \marg{chem} \marg{math} \marg{args number} \marg{argument list (\{\#2\}\{\#3\}...)}
+% \fqquad \marg{chem} \marg{math} \marg{args number} \marg{argument list (\{\#2\}\{\#3\}...)}
% \begin{macrocode}
\AtBeginDocument{
\@ifchemmacrosmoduleloaded{reactions}{
@@ -34979,7 +36486,7 @@ name = \chemmacros_translate:n {scheme-name}
% \begin{macrocode}
\def\diagbox@double#1#2#3{%
\setkeys{diagbox}{dir=NW,#1}%
-\csuse{LWR@diagbox\diagbox@dir}{#2}{#3}%
+\@nameuse{LWR@diagbox\diagbox@dir}{#2}{#3}%
}
% \end{macrocode}
% \end{noindmacro}
@@ -35015,7 +36522,7 @@ name = \chemmacros_translate:n {scheme-name}
% \begin{macrocode}
\def\diagbox@triple#1#2#3#4{%
\setkeys{diagbox}{dir=NW,#1}%
-\csuse{LWR@diagboxT\diagbox@dir}{#3}{#2}{#4}%
+\@nameuse{LWR@diagboxT\diagbox@dir}{#3}{#2}{#4}%
}
% \end{macrocode}
% \end{noindmacro}
@@ -35460,8 +36967,8 @@ name = \chemmacros_translate:n {scheme-name}
\renewcommand*{\newlist}[3]{%
\LWR@orignewlist{#1}{#2}{#3}%
-\AtBeginEnvironment{#1}{\csuse{LWR@#2start}}%
-\AtEndEnvironment{#1}{\csuse{LWR@#2end}}%
+\AtBeginEnvironment{#1}{\@nameuse{LWR@#2start}}%
+\AtEndEnvironment{#1}{\@nameuse{LWR@#2end}}%
}
% \end{macrocode}
@@ -35680,66 +37187,42 @@ name = \chemmacros_translate:n {scheme-name}
% {\StartDynamicMath$_a^{\arabic{erratum}}$\StopDynamicMath}
{\textsubscript{a}\textsuperscript{\arabic{erratum}}}
{}
- {
- \PackageError{lwarp}
- {Unable to patch the erratum package, erratumAdd macro}
- {Please contact the author of the lwarp package.}
- }
+ {\LWR@patcherror{erratum}{erratumAdd}}
\xpatchcmd{\erratumDelete}
{$_d^{\arabic{erratum}}$}
% {\StartDynamicMath$_d^{\arabic{erratum}}$\StopDynamicMath}
{\textsubscript{d}\textsuperscript{\arabic{erratum}}}
{}
- {
- \PackageError{lwarp}
- {Unable to patch the erratum package, erratumDelete macro}
- {Please contact the author of the lwarp package.}
- }
+ {\LWR@patcherror{erratum}{erratumDelete}}
\xpatchcmd{\erratumReplace}
{$_r^{\arabic{erratum}}$}
% {\StartDynamicMath$_r^{\arabic{erratum}}$\StopDynamicMath}
{\textsubscript{r}\textsuperscript{\arabic{erratum}}}
{}
- {
- \PackageError{lwarp}
- {Unable to patch the erratum package, erratumReplace macro}
- {Please contact the author of the lwarp package.}
- }
+ {\LWR@patcherror{erratum}{erratumReplace}}
\xpatchcmd{\erratum}
{$_a$}
% {\StartDynamicMath$_a$\StopDynamicMath}
{\textsubscript{a}}
{}
- {
- \PackageError{lwarp}
- {Unable to patch the erratum package, eDelete macro}
- {Please contact the author of the lwarp package.}
- }
+ {\LWR@patcherror{erratum}{erratumDelete}}
\xpatchcmd{\erratum}
{$_d^{\@thefnmark}$}
% {\StartDynamicMath$_d^{\@thefnmark}$\StopDynamicMath}
{\textsubscript{d}\textsuperscript{\@thefnmark}}
{}
- {
- \PackageError{lwarp}
- {Unable to patch the erratum package, eDelete macro}
- {Please contact the author of the lwarp package.}
- }
+ {\LWR@patcherror{erratum}{eDelete}}
\xpatchcmd{\erratum}
{$_r^{\@thefnmark}$}
% {\StartDynamicMath$_r^{\@thefnmark}$\StopDynamicMath}
{\textsubscript{r}\textsuperscript{\@thefnmark}}
{}
- {
- \PackageError{lwarp}
- {Unable to patch the erratum package, eReplace macro}
- {Please contact the author of the lwarp package.}
- }
+ {\LWR@patcherror{erratum}{eReplace}}
% \end{macrocode}
% Finish the current page's errata before closing and reloading the list:
@@ -38414,6 +39897,7 @@ solid \LWR@origpound\LWR@tempcolor ; %
\setupglossaries{nonumberlist}
\setglossarystyle{index}
% \end{macrocode}
+%
% Patched to fix \acro{TOC} pointing to the previous page:
% \begin{macrocode}
\renewcommand*{\@p@glossarysection}[2]{%
@@ -39465,7 +40949,7 @@ img src="%
%
% \begin{noindmacro}{\hangpara} \marg{indent} \marg{afternum}
%
-% \textcolor{red}{Use \env{hangparas} instead.}
+% \textred{Use \env{hangparas} instead.}
% \begin{macrocode}
\newcommand*{\hangpara}[2]{}
% \end{macrocode}
@@ -40152,13 +41636,13 @@ img src="%
% \begin{macrocode}
\newcommand{\LWR@indexprenote}{}
-\renewcommand*{\printindex}
-{
+\preto\printindex{
+
+\LWR@orignewpage
\LWR@startpars
\LWR@indexprenote
-\LWR@origprintindex
}
\newcommand{\setindexprenote}[1]{\renewcommand{\LWR@indexprenote}{#1}}
@@ -40225,6 +41709,272 @@ img src="%
%
%
%
+% \iffalse
+%<*imakeidx>
+% \fi
+%
+% \part{lwarp-imakeidx.sty}
+%
+% \section{imakeidx}
+% \label{sec:imakeidx}
+%
+% \credits{Enrico Gregorio}
+%
+% \DescribePackage{imakeidx}
+% \pkg{imakeidx} is patched for use by \pkg{lwarp}.
+%
+% \limitsimakeidx
+%
+% \changes{v0.58}{2018/06/13}{\pkg{imakeidx}: Added.}
+%
+% \codehtml
+%
+% \begin{macrocode}
+\LWR@ProvidesPackagePass{imakeidx}
+% \end{macrocode}
+%
+% Use the new \HTML\ suffix:
+% \begin{macrocode}
+\catcode`\_=12%
+\define@key{imki}{name}{\def\imki@name{#1_html}}
+\catcode`\_=8%
+% \end{macrocode}
+%
+% \begin{noindmacro}{\printindex}
+% The \HTML\ version of \cs{printindex}:
+% \begin{macrocode}
+\catcode`\_=12%
+
+\renewcommand*{\printindex}[1][\imki@jobname]{%
+\LWR@orignewpage%
+\LWR@startpars%
+\ifstrequal{#1}{\imki@jobname}{%
+ \@ifundefined{#1@idxfile}{%
+ \imki@error{#1}%
+ }{%
+ \imki@putindex{#1}%
+ }%
+}{%
+ \@ifundefined{#1_html@idxfile}{\imki@error{#1_html}}{\imki@putindex{#1_html}}%
+}%
+}
+
+\catcode`\_=8%
+% \end{macrocode}
+% \end{noindmacro}
+%
+% \begin{noindmacro}{\@index}
+% The \HTML\ version of \cs{\@index}:
+% \begin{macrocode}
+\catcode`\_=12%
+
+\def\@index[#1]{%
+ \ifstrequal{#1}{\imki@jobname}%
+ {%
+ \@ifundefined{#1@idxfile}%
+ {%
+ \PackageWarning{imakeidx}{Undefined index file `#1'}%
+ \begingroup
+ \@sanitize
+ \imki@nowrindex%
+ }%
+ {%
+ \edef\@idxfile{#1}%
+ \begingroup
+ \@sanitize
+ \@wrindex\@idxfile%
+ }%
+ }%
+ {%
+ \@ifundefined{#1_html@idxfile}%
+ {%
+ \PackageWarning{imakeidx}{Undefined index file `#1_html'}%
+ \begingroup
+ \@sanitize
+ \imki@nowrindex%
+ }%
+ {%
+ \edef\@idxfile{#1_html}%
+ \begingroup
+ \@sanitize
+ \@wrindex\@idxfile%
+ }%
+ }%
+}
+
+\catcode`\_=8%
+% \end{macrocode}
+% \end{noindmacro}
+%
+% \begin{noindmacro}{\item}
+% \begin{noindmacro}{\subitem}
+% \begin{noindmacro}{\subsubitem}
+% \HTML\ versions of \cs{item}, etc.:
+% \begin{macrocode}
+\appto\theindex{%
+ \let\item\LWR@indexitem%
+ \let\subitem\LWR@indexsubitem%
+ \let\subsubitem\LWR@indexsubsubitem%
+}
+% \end{macrocode}
+% \end{noindmacro}
+% \end{noindmacro}
+% \end{noindmacro}
+%
+% \begin{noindmacro}{\imki@wrindexentrysplit} \marg{file} \marg{entry} \marg{page}
+% \begin{noindmacro}{\imki@wrindexentryunique} \marg{file} \marg{entry} \marg{page}
+%
+% While writing index entries, adds an \HTML\ label, and
+% writes the label's index instead of the page number:
+% \begin{macrocode}
+\renewcommand\imki@wrindexentrysplit[3]{%
+\addtocounter{LWR@autoindex}{1}%
+\LWR@new@label{LWRindex-\arabic{LWR@autoindex}}%
+ \expandafter\protected@write\csname#1@idxfile\endcsname{}%
+ {\string\indexentry{#2}{\arabic{LWR@autoindex}}}%
+}
+
+\renewcommand\imki@wrindexentryunique[3]{%
+\addtocounter{LWR@autoindex}{1}%
+\LWR@new@label{LWRindex-\arabic{LWR@autoindex}}%
+ \protected@write\@indexfile{}%
+ {\string\indexentry[#1]{#2}{\arabic{LWR@autoindex}}}%
+}
+
+\def\imki@wrindexsplit#1#2{%
+\imki@wrindexentrysplit{#1}{#2}{\thepage}%
+\endgroup\imki@showidxentry{#1}{#2}%
+ \@esphack%
+}
+
+\def\imki@wrindexunique#1#2{%
+\imki@wrindexentryunique{#1}{#2}{\thepage}%
+\endgroup\imki@showidxentry{#1}{#2}%
+ \@esphack%
+ }
+
+% \end{macrocode}
+% \end{noindmacro}
+% \end{noindmacro}
+%
+% \begin{noindmacro}{\LWR@imki@setxdydefopts}
+%
+% Sets the \pkg{xindy} \HTML\ options, ignoring the user's settings.
+% \begin{macrocode}
+\newcommand*{\LWR@imki@setxdydefopts}{%
+ \edef\imki@options{ \space %
+ -M \space \LWR@xindyStyle\space %
+ -L \space \LWR@xindyLanguage\space %
+ -C \space \LWR@xindyCodepage\space %
+ }%
+}
+% \end{macrocode}
+% \end{noindmacro}
+%
+% \begin{noindmacro}{\LWR@imki@setdefopts} \marg{user options}
+%
+% Sets the \HTML\ options, added to the user's settings,
+% depending on whether \pkg{makeindex} or \pkg{xindy} are used.
+%
+% For \prog{makeindex}, the user's choice is ignored, and only the \pkg{lwarp}
+% version is used. (Only one style at a time is possible.)
+%
+% For \prog{xindy}, multiple modules may be specified, and the \pkg{lwarp}
+% version is appended.
+% \begin{macrocode}
+\newcommand*{\LWR@imki@setdefopts}[1]{%
+\ifblank{#1}{%
+ \edef\imki@options{\space -s \space \LWR@makeindexStyle \space}%
+ \ifdefstring{\imki@progdefault}{xindy}{\LWR@imki@setxdydefopts}{}%
+ \ifdefstring{\imki@progdefault}{texindy}{\LWR@imki@setxdydefopts}{}%
+ \ifdefstring{\imki@progdefault}{truexindy}{\LWR@imki@setxdydefopts}{}%
+}{%
+ \edef\imki@options{\space #1 \space}%
+}%
+}
+% \end{macrocode}
+% \end{noindmacro}
+%
+% \begin{noindmacro}{\imki@makeindex}
+% Use the new \HTML\ options:
+% \begin{macrocode}
+\xpatchcmd{\imki@makeindex}
+ {\let\imki@options\space}
+ {\LWR@imki@setdefopts{}}%
+ {}
+ {\LWR@patcherror{imakeidx}{makeindex}}
+% \end{macrocode}
+% \end{noindmacro}
+%
+% Use the new \HTML\ options.
+% \begin{macrocode}
+\define@key{imki}{options}{\LWR@imki@setdefopts{#1}}
+% \end{macrocode}
+%
+% \begin{noindmacro}{\imki@resetdefaults}
+% Use the new \HTML\ options:
+% \begin{macrocode}
+\xpatchcmd{\imki@resetdefaults}
+ {\def\imki@options{ }}
+ {\LWR@imki@setdefopts{}}
+ {}
+ {\LWR@patcherror{imakeidx}{resetdefaults}}
+% \end{macrocode}
+% \end{noindmacro}
+%
+% \env{theindex} was already defined \cs{AtBeginDocument} by the \pkg{lwarp} core,
+% so it must be redefined here similarly, but patched for \pkg{imakeidx}:
+% \begin{noindenvironment}{theindex}
+% \begin{macrocode}
+\AtBeginDocument{
+\renewenvironment*{theindex}{%
+ \imki@maybeaddtotoc
+ \imki@indexlevel{\indexname}
+ \let\item\LWR@indexitem%
+ \let\subitem\LWR@indexsubitem%
+ \let\subsubitem\LWR@indexsubsubitem%
+}{}
+}% AtBeginDocument
+% \end{macrocode}
+% \end{noindenvironment}
+%
+%
+% Update to the new defaults:
+% \begin{macrocode}
+\imki@resetdefaults
+% \end{macrocode}
+%
+% Update to the new patches:
+%
+% \cs{AtBeginDocument} is because \cs{@wrindex} is previously defined
+% as \cs{AtBeginDocument} in the \pkg{lwarp} core.
+%
+% \begin{macrocode}
+\ifimki@splitindex
+ \let\imki@startidx\imki@startidxunique
+ \AtBeginDocument{\let\@wrindex\imki@wrindexunique}
+ \let\imki@putindex\imki@putindexunique
+ \let\imki@wrindexentry\imki@wrindexentryunique
+ \let\imki@startidxsplit\@undefined
+ \let\imki@wrindexsplit\@undefined
+ \let\imki@putindexsplit\@undefined
+\else
+ \let\imki@startidx\imki@startidxsplit
+ \AtBeginDocument{\let\@wrindex\imki@wrindexsplit}
+ \let\imki@putindex\imki@putindexsplit
+ \let\imki@wrindexentry\imki@wrindexentrysplit
+ \let\imki@startidxunique\@undefined
+ \let\imki@wrindexunique\@undefined
+ \let\imki@putindexunique\@undefined
+\fi
+% \end{macrocode}
+%
+% \iffalse
+%</imakeidx>
+% \fi
+%
+%
+%
%
% \iffalse
%<*indentfirst>
@@ -40255,6 +42005,110 @@ img src="%
%
%
% \iffalse
+%<*index>
+% \fi
+%
+% \part{lwarp-index.sty}
+%
+% \section{index}
+% \label{sec:indexpkg}
+%
+% \credits{David M. Jones}
+%
+% \DescribePackage{index}
+% \pkg{index} is patched for use by \pkg{lwarp}.
+%
+% \changes{v0.58}{2018/07/06}{\pkg{index}: Added.}
+%
+% \codehtml
+%
+% \begin{macrocode}
+\LWR@ProvidesPackagePass{index}
+% \end{macrocode}
+%
+% Use \cs{theLWR@autoindex} instead of \cs{thepage}.
+% \cs{@tempswatrue} is used to force an immediate write to the index file
+% instead of waiting until the end of the page.
+% \begin{macrocode}
+\xpatchcmd{\newindex}
+ {\x@newindex[thepage]}
+ {%
+ \@tempswatrue%
+ \x@newindex[theLWR@autoindex]%
+ }
+ {}
+ {\LWR@patcherror{index}{newindex}}
+
+\xpatchcmd{\renewindex}
+ {\x@renewindex[thepage]}
+ {%
+ \@tempswatrue%
+ \x@renewindex[theLWR@autoindex]%
+ }
+ {}
+ {\LWR@patcherror{index}{renewindex}}
+% \end{macrocode}
+%
+% Patched to set a new autoindex:
+% \begin{macrocode}
+\xpatchcmd{\@wrindex}
+ {\begingroup}
+ {%
+ \addtocounter{LWR@autoindex}{1}% lwarp
+ \LWR@new@label{LWRindex-\arabic{LWR@autoindex}}% lwarp
+ \begingroup%
+ }
+ {}
+ {\LWR@patcherror{index}{@wrindex}}
+% \end{macrocode}
+%
+% \cs{AtBeginDocument} \pkg{lwarp} core \cs{let}s \cs{@wrindex} to \cs{LWR@wrindex}.
+% Since the \pkg{index} package has been loaded, \cs{let} to its version instead:
+% \begin{macrocode}
+\let\LWR@index@wrindex\@wrindex
+
+\AtBeginDocument{
+\let\@wrindex\LWR@index@wrindex
+}
+% \end{macrocode}
+%
+% Modified to add \cs{index@prologue}:
+% \begin{macrocode}
+\AtBeginDocument{
+\renewenvironment*{theindex}{%
+ \LWR@indexsection{\indexname}%
+ \ifx\index@prologue\@empty\else
+ \index@prologue
+ \bigskip
+ \fi
+ \let\item\LWR@indexitem%
+ \let\subitem\LWR@indexsubitem%
+ \let\subsubitem\LWR@indexsubsubitem%
+}{}
+}% AtBeginDocument
+% \end{macrocode}
+%
+%
+% Disabled:
+% \begin{macrocode}
+\def\@showidx#1{}
+\let\@texttop\relax
+\renewcommand*{\raggedbottom}{}
+\renewcommand*{\flushbottom}{}
+\renewcommand*{\markboth}[2]{}
+\renewcommand*{\markright}[1]{}
+% \end{macrocode}
+
+%
+% \iffalse
+%</index>
+% \fi
+%
+%
+%
+%
+%
+% \iffalse
%<*inputenc>
% \fi
%
@@ -40317,6 +42171,40 @@ img src="%
%
%
% \iffalse
+%<*intopdf>
+% \fi
+%
+% \part{lwarp-intopdf.sty}
+%
+% \section{intopdf}
+%
+% \DescribePackage{intopdf}
+% \pkg{intopdf} is emulated.
+%
+% \changes{v0.58}{2018/06/08}{\pkg{intopdf}: Added.}
+%
+% The MIME type and description are ignored for now.
+%
+% \codehtml
+%
+% \begin{macrocode}
+\LWR@ProvidesPackageDrop{intopdf}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\NewDocumentCommand{\attachandlink}{m o m m}{%
+ \href{#1}{#4}%
+}
+% \end{macrocode}
+%
+% \iffalse
+%</intopdf>
+% \fi
+%
+%
+%
+%
+% \iffalse
%<*keyfloat>
% \fi
@@ -41638,6 +43526,46 @@ width=\KFLT@imagewidth,height=\KFLT@h]{\KFLT@i}%
%
%
% \iffalse
+%<*makeidx>
+% \fi
+%
+% \part{lwarp-makeidx.sty}
+%
+% \section{makeidx}
+%
+% \credits{\LaTeX\ Project Team}
+%
+% \DescribePackage{makeidx}
+% \pkg{makeidx} is patched for use by \pkg{lwarp}.
+%
+% \changes{v0.58}{2018/06/30}{\pkg{makeidx}: Added. Moved from \pkg{lwarp} core.}
+%
+% \codehtml
+%
+% \begin{macrocode}
+\LWR@ProvidesPackagePass{makeidx}
+% \end{macrocode}
+%
+% \cs{@wrindex} is redefined \cs{AtBeginDocument} by the \pkg{lwarp} core.
+%
+% \begin{macro}{\printindex}
+%
+% \changes{v0.58}{2018/06/13}{Fix: Extra \cs{newpage} to flush pending \cs{index} writes.}
+% \begin{macrocode}
+\preto\printindex{%
+ \LWR@orignewpage%
+ \LWR@startpars%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \iffalse
+%</makeidx>
+% \fi
+%
+%
+%
+% \iffalse
%<*marginfit>
% \fi
%
@@ -41882,15 +43810,15 @@ width=\KFLT@imagewidth,height=\KFLT@h]{\KFLT@i}%
% ^^A \DescribeMacro{\mdfsetup}
% To handle CSS and paragraphs,
% patch code at start and end of environment and contents.
-% \cs{LWR@origraggedright} helps avoid hyphenation.
+% \cs{LWR@print@raggedright} helps avoid hyphenation.
%
% \changes{v0.25}{2017/03/16}{\pkg{mdframed}: Help avoid hyphenation.}
%
% \begin{macrocode}
\mdfsetup{
-startcode={\LWR@mdframedstart\LWR@origraggedright},
+startcode={\LWR@mdframedstart\LWR@print@raggedright},
endcode={\LWR@mdframedend},
-startinnercode={\LWR@startpars\LWR@origraggedright},
+startinnercode={\LWR@startpars\LWR@print@raggedright},
endinnercode={\LWR@stoppars},
}
% \end{macrocode}
@@ -41903,7 +43831,7 @@ endinnercode={\LWR@stoppars},
% Given the \pkg{mdframed} key, print the color.
% \begin{macrocode}
\newcommand*{\LWR@mdfprintcolor}[1]{%
-\convertcolorspec{named}{\csuse{mdf@#1}}{HTML}\LWR@tempcolor%
+\convertcolorspec{named}{\@nameuse{mdf@#1}}{HTML}\LWR@tempcolor%
\LWR@origpound\LWR@tempcolor
}
% \end{macrocode}
@@ -41914,7 +43842,7 @@ endinnercode={\LWR@stoppars},
% Given the \pkg{mdframed} key, print the length.
% \begin{macrocode}
\newcommand*{\LWR@mdfprintlength}[1]{%
-\LWR@printlength{\csuse{mdf@#1@length}}
+\LWR@printlength{\@nameuse{mdf@#1@length}}
}
% \end{macrocode}
% \end{noindmacro}
@@ -42201,8 +44129,8 @@ background:
% Perform the original subtitle action:
% \begin{macrocode}
\IfNoValueTF{#2}
-{\csuse{LWR@origmdf#1title}{#3}}%
-{\csuse{LWR@origmdf#1title}[#2]{#3}}%
+{\@nameuse{LWR@origmdf#1title}{#3}}%
+{\@nameuse{LWR@origmdf#1title}[#2]{#3}}%
% \end{macrocode}
% Close the span and unnest the paragraph tag restriction:
% \begin{macrocode}
@@ -43868,7 +45796,7 @@ class="td%
\@thm{#1}{#1}{#2}
}%
\global\@namedef{end#1}{\@endtheorem}
- \AtBeginEnvironment{#1}{\edef\LWR@thisthmstyle{\csuse{LWR@thmstyle#1}}}% lwarp
+ \AtBeginEnvironment{#1}{\edef\LWR@thisthmstyle{\@nameuse{LWR@thmstyle#1}}}% lwarp
\fi
}
@@ -43884,7 +45812,7 @@ class="td%
\@thm{#1}{#1}{#2}
}%
\global\@namedef{end#1}{\@endtheorem}
- \AtBeginEnvironment{#1}{\edef\LWR@thisthmstyle{\csuse{LWR@thmstyle#1}}}% lwarp
+ \AtBeginEnvironment{#1}{\edef\LWR@thisthmstyle{\@nameuse{LWR@thmstyle#1}}}% lwarp
\fi
}
@@ -43905,7 +45833,7 @@ class="td%
\@thm{#1}{#2}{#3}
}%
\global\@namedef{end#1}{\@endtheorem}
- \AtBeginEnvironment{#1}{\edef\LWR@thisthmstyle{\csuse{LWR@thmstyle#1}}}% lwarp
+ \AtBeginEnvironment{#1}{\edef\LWR@thisthmstyle{\@nameuse{LWR@thmstyle#1}}}% lwarp
\fi}
}
% \end{macrocode}
@@ -44712,6 +46640,178 @@ class="td%
%
%
% \iffalse
+%<*pdfpages>
+% \fi
+%
+% \part{lwarp-pdfpages.sty}
+%
+% \section{pdfpages}
+%
+% \credits{Andreas Matthias}
+%
+% \DescribePackage{pdfpages}
+% \pkg{pdfpages} is patched for use by \pkg{lwarp}.
+%
+% Option \optn{link} and \optn{linkname} work:
+% \begin{Verbatim}[tabsize=4,gobble=2,frame=lines]
+% \hyperlink{<filename>.pdf.<pagenubmer}}{some text}
+% \hyperlink{<linkname>.<pagenubmer}}{some text}
+% \end{Verbatim}
+%
+% Options which make no sense in \HTML\ are disabled.
+%
+% \changes{v0.58}{2018/06/11}{\pkg{pdfpages}: Added.}
+%
+% \codehtml
+%
+% \begin{macrocode}
+\LWR@ProvidesPackagePass{pdfpages}
+% \end{macrocode}
+%
+% Disable option which have no meaning for \HTML\ output:
+% \begin{macrocode}
+\define@key{pdfpages}{fitpaper}[false]{}
+\define@key{pdfpages}{landscape}[false]{}
+\define@key{pdfpages}{openright}[false]{}
+\define@key{pdfpages}{signature}{}
+\define@key{pdfpages}{signature*}{}
+\define@key{pdfpages}{booklet}[false]{}
+\define@key{pdfpages}{rotateoversize}[false]{}
+\define@key{pdfpages}{doublepages}[false]{}
+\define@key{pdfpages}{doublepagestwist}[false]{}
+\define@key{pdfpages}{doublepagestwistodd}[false]{}
+\define@key{pdfpages}{doublepagestwist*}[false]{}
+\define@key{pdfpages}{doublepagestwistodd*}[false]{}
+\define@key{pdfpages}{duplicatepages}[2]{}
+\define@key{pdfpages}{thread}[false]{}
+\define@key{pdfpages}{threadname}{}
+\define@key{pdfpages}{linkfit}{}
+\define@key{pdfpages}{linktodoc}[false]{}
+\define@key{pdfpages}{linktodocfit}{}
+\define@key{pdfpages}{linkfilename}{}
+\define@key{pdfpages}{survey}[false]{}
+\define@key{pdfpages}{survey-nolink}[false]{}
+\define@key{pdfpages}{newwindow}[false]{}
+% \end{macrocode}
+%
+% Use print mode while measuring the page numbers:
+% \begin{macrocode}
+\xpretocmd{\AM@getpagecount}{\LWR@restoreorigformatting}{}{}
+% \end{macrocode}
+%
+% Emulate a bit of \pkg{eso-pic}:
+% \begin{macrocode}
+\newif\ifESO@texcoord
+
+\newcommand{\ESO@HookIIBG}{}
+
+\renewcommand{\AM@AddToShipoutPicture}{\g@addto@macro\ESO@HookIIBG}
+
+\renewcommand{\ClearShipoutPicture}{}
+% \end{macrocode}
+%
+% \begin{noindmacro}{\LWR@esopic@newpage}
+% At each \cs{newpage}.
+%
+% \begin{macrocode}
+\newcommand*{\LWR@esopic@newpage}{%
+% \end{macrocode}
+%
+% Is there something to draw?
+% \begin{macrocode}
+\ifdefvoid{\ESO@HookIIBG}%
+{}%
+{%
+% \end{macrocode}
+%
+% If the \optn{link} option was specified, add a hyper taraget:
+% \begin{macrocode}
+ \ifAM@link%
+ \hypertarget{\AM@linkname.\AM@page}{}%
+ \fi%
+% \end{macrocode}
+%
+% Draw inside a picture environment of the size of a virtual page:
+% \begin{macrocode}
+ \begingroup%
+ \setlength{\unitlength}{1in}%
+ \begin{picture}(8,10.5)%
+ \ESO@HookIIBG%
+ \end{picture}%
+ \endgroup%
+ \global\let\ESO@HookIIBG\@empty%
+}
+}
+% \end{macrocode}
+% \end{noindmacro}
+%
+% \begin{noindmacro}{\AM@output}
+% Patched to use \cs{LWR@esopic@newpage}.
+% \begin{macrocode}
+\xpatchcmd{\AM@output}
+ {\newpage}
+ {\LWR@esopic@newpage}
+ {}
+ {\LWR@patcherror{pdfpages}{AM@output-1}}
+
+\xpatchcmd{\AM@output}
+ {\newpage}
+ {\LWR@esopic@newpage}
+ {}
+ {\LWR@patcherror{pdfpages}{AM@output-2}}
+
+\xpatchcmd{\AM@output}
+ {\newpage}
+ {\LWR@esopic@newpage}
+ {}
+ {\LWR@patcherror{pdfpages}{AM@output-3}}
+% \end{macrocode}
+% \end{noindmacro}
+%
+% \begin{noindmacro}{\includepdf} Patched to set a reasonable paper size.
+% \begin{macrocode}
+\xpretocmd{\includepdf}{%
+ \begingroup%
+ \setlength{\paperwidth}{8in}%
+ \setlength{\paperheight}{10.5in}%
+}{}{}
+
+\xapptocmd{\includepdf}{%
+ \endgroup%
+}{}{}
+% \end{macrocode}
+% \end{noindmacro}
+
+% \begin{noindmacro}{\includepdfmerge} Patched to set a reasonable paper size.
+% \begin{macrocode}
+\xpretocmd{\includepdfmerge}{%
+ \begingroup%
+ \setlength{\paperwidth}{8in}%
+ \setlength{\paperheight}{10.5in}%
+}{}{}
+
+\xapptocmd{\includepdfmerge}{%
+ \endgroup%
+}{}{}
+% \end{macrocode}
+% \end{noindmacro}
+%
+% \begin{noindmacro}{\AM@hyper@begin@i}
+% Hyper links are created by \cs{LWR@esopic@newpage},
+% so don't create them here:
+% \begin{macrocode}
+\renewcommand{\AM@hyper@begin@i}{}
+% \end{macrocode}
+% \end{noindmacro}
+%
+% \iffalse
+%</pdfpages>
+% \fi
+%
+%
+%
+%
+% \iffalse
%<*pdfrender>
% \fi
%
@@ -44776,6 +46876,31 @@ class="td%
%
%
%
+% \iffalse
+%<*pdfx>
+% \fi
+%
+% \part{lwarp-pdfx.sty}
+%
+% \section{pdfx}
+%
+% \DescribePackage{pdfx}
+% \pkg{pdfx} is ignored.
+%
+% \changes{v0.58}{2018/06/08}{\pkg{pdfx}: Added.}
+%
+% \codehtml
+%
+% \begin{macrocode}
+\LWR@ProvidesPackageDrop{pdfx}
+% \end{macrocode}
+%
+% \iffalse
+%</pdfx>
+% \fi
+%
+%
+%
%
% \iffalse
%<*pfnote>
@@ -45039,7 +47164,7 @@ class="td%
% and make the length assignment global, per: \\
%\href{https://tex.stackexchange.com/questions/300823/why-is-setlength-ineffective-inside-a-tabular-environment}
%{\ttfamily https://tex.stackexchange.com/questions/300823/ \\
-% \hspace*{2em} why-is-setlength-ineffective-inside-a-tabular-environment}
+% \fqquad\ why-is-setlength-ineffective-inside-a-tabular-environment}
% \begin{macrocode}
\setlength{\LWR@quotchapwidth}{#1*2}%
\global\LWR@quotchapwidth=\LWR@quotchapwidth%
@@ -45092,19 +47217,12 @@ class="td%
\xpatchcmd{\quoting}{\quo@begintext}
{\begin{LWR@blocktextcurrentfont}\quo@begintext}
{}
- {
- \PackageError{lwarp}
- {Unable to patch the quoting package}
- {Please contact the author of the lwarp package.}
- }
+ {\LWR@patcherror{quoting}{quoting}}
+
\xpatchcmd{\endquoting}{\quo@endtext}
{\quo@endtext\end{LWR@blocktextcurrentfont}}
{}
- {
- \PackageError{lwarp}
- {Unable to patch the quoting package}
- {Please contact the author of the lwarp package.}
- }
+ {\LWR@patcherror{imakeidx}{endquoting}}
% \end{macrocode}
% \iffalse
@@ -45359,6 +47477,69 @@ class="td%
%
%
%
+% \iffalse
+%<*repeatindex>
+% \fi
+%
+% \part{lwarp-repeatindex.sty}
+%
+% \section{repeatindex}
+%
+% \DescribePackage{repeatindex}
+% \pkg{repeatindex} is emulated for \pkg{lwarp}.
+%
+% \pkg{lwarp} must be used with a special style file:
+% \begin{sourcedisplay}
+% \cs{usepackage}[makeindex,\textred{makeindexStyle=\{lwarp\_repeatindex\}}]\{lwarp\}
+% \end{sourcedisplay}
+% where \filenm{lwarp\_repeatindex.ist} may be copied from the following
+% modified version of \filenm{lwarp.ist}:
+% \begin{Verbatim}[gobble=2,obeytabs,tabsize=4,frame=leftline]
+% preamble
+% "\\begin{theindex}
+% \\providecommand*\\lettergroupDefault[1]{}
+% \\providecommand*\\lettergroup[1]{%
+% \\par\\textbf{#1}\\par
+% \\nopagebreak
+% }
+% "
+% headings_flag 1
+% heading_prefix "
+% \\lettergroup{"
+% heading_suffix "}"
+% delim_0 "], \\hyperindexref{"
+% delim_1 ", \\hyperindexref{"
+% delim_2 ", \\hyperindexref{"
+% delim_n "}, \\hyperindexref{"
+% delim_r "} -- \\hyperindexref{"
+% delim_t "}"
+%
+% item_0 "\n \\item ["
+% \end{Verbatim}
+% (The modifications are the |delim_0| and |item_0| entries.)
+%
+% \changes{v0.58}{2018/06/21}{\pkg{repeatindex}: Added.}
+%
+% \codehtml
+%
+% \begin{macrocode}
+\LWR@ProvidesPackageDrop{repeatindex}[2001/10/13]
+% \end{macrocode}
+%
+% In the \pkg{lwarp} core, \cs{LWR@indexitem} is modified
+% to accept the optional \cs{item} argument.
+%
+% \begin{macrocode}
+\RequirePackage{makeidx}
+\def\entryprefix{\itshape}
+\def\entrypostfix{\dots}
+% \end{macrocode}
+%
+% \iffalse
+%</repeatindex>
+% \fi
+%
+%
%
%
% \iffalse
@@ -45662,14 +47843,14 @@ class="td%
\renewcommand{\schema}[3][open]{%
\begin{lateximage}%
-\LWR@orignormalsize
+\LWR@print@normalsize
\LWR@schemata@origschema[#1]{#2}{#3}%
\end{lateximage}%
}
\renewcommand{\Schema}[5][open]{%
\begin{lateximage}%
-\LWR@orignormalsize
+\LWR@print@normalsize
\LWR@schemata@origSchema[#1]{#2}{#3}{#4}{#5}%
\end{lateximage}%
}
@@ -45829,7 +48010,7 @@ class="td%
% \href
% {https://tex.stackexchange.com/questions/45401/use-the-s-star-argument-with-newdocumentenvironment}
% {\ttfamily https://tex.stackexchange.com/questions/45401/ \\
-% \hspace*{2em} use-the-s-star-argument-with-newdocumentenvironment}
+% \fqquad\ use-the-s-star-argument-with-newdocumentenvironment}
% \begin{macrocode}
\ExplSyntaxOn
@@ -46374,7 +48555,9 @@ class="td%
% \begin{macrocode}
\LWR@ProvidesPackageDrop{showidx}
% \end{macrocode}
-
+%
+% \cs{@wrindex} is redefined \cs{AtBeginDocument} by the \pkg{lwarp} core.
+%
% \iffalse
%</showidx>
% \fi
@@ -46937,7 +49120,7 @@ class="td%
\ifcsempty{#2}%
{\LWR@HTMLtextstyle{#5}{#3}{#1}}%
{%
- \convertcolorspec{named}{\csuse{#2}}{HTML}\LWR@tempcolor%
+ \convertcolorspec{named}{\@nameuse{#2}}{HTML}\LWR@tempcolor%
\LWR@htmlspanclass[#5;#4:\LWR@origpound\LWR@tempcolor]{#3}{#1}%
}%
}
@@ -47078,6 +49261,97 @@ class="td%
%
%
%
+% \iffalse
+%<*splitidx>
+% \fi
+%
+% \part{lwarp-splitidx.sty}
+%
+% \section{splitidx}
+% \label{sec:splitidx}
+%
+% \credits{Markus Kohm}
+%
+% \DescribePackage{splitidx}
+% \pkg{splitidx} is patched for use by \pkg{lwarp}.
+%
+% \limitssplitidx
+%
+% \changes{v0.58}{2018/06/30}{\pkg{splitidx}: Added.}
+%
+% \codehtml
+%
+% \begin{macrocode}
+\LWR@ProvidesPackagePass{splitidx}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\catcode`\_=12%
+\xpatchcmd{\newindex}
+ {\jobname-#2.idx}
+ {\jobname-#2_html.idx}
+ {}
+ {\LWR@patcherror{splitidx}{@newindex}}
+\catcode`\_=8%
+% \end{macrocode}
+%
+% Patched to use \pkg{lwarp}'s automatic indexing counter instead of \cs{thepage}:
+% \begin{macrocode}
+\renewcommand*{\@wrsindex}[2][]{%
+ \ifx\relax#1\relax
+ \if@splitidx
+ \@wrsindex[idx]{#2}%
+ \else
+ \def\@tempa{#2}%
+ \if@verbindex\@onelevel@sanitize\@tempa\fi
+ \@wrindex{\@tempa}%
+ \fi
+ \else
+ \def\@tempa{#2}%
+ \csname index@#1@hook\endcsname
+% \expandafter\ifx\csname @@wrsindex\endcsname\relax
+ \addtocounter{LWR@autoindex}{1}% lwarp
+ \LWR@new@label{LWRindex-\arabic{LWR@autoindex}}% lwarp
+% \@@@wrsindex{#1}{{\@tempa}{\thepage}}%
+ \@@@wrsindex{#1}{{\@tempa}{\arabic{LWR@autoindex}}}%
+% \else
+% \def\@tempb{\@@wrsindex{#1}}%
+% \expandafter\@tempb\@tempa||\\%
+% \fi
+ \endgroup
+ \@esphack
+ \fi
+}
+% \end{macrocode}
+%
+% \pkg{lwarp} defines sectioning commands with \pkg{xparse},
+% so the below patches are done as temporary redefinitions instead of being \cs{let}.
+% \begin{macrocode}
+\xpatchcmd{\printsubindex}
+ {\let\section\subsection}
+ {\renewcommand*{\section}{\subsection}}
+ {}
+ {\LWR@patcherror{splitidx}{printsubindex-section}}
+
+\xpatchcmd{\printsubindex}
+ {\let\chapter\section}
+ {\renewcommand*{\chapter}{\section}}
+ {}
+ {\LWR@patcherror{splitidx}{printsubindex-chapter}}
+
+\xpatchcmd{\printsubindex}
+ {\let\@makechapterhead\section}
+ {\def\@makechapterhead{\section}}
+ {}
+ {\LWR@patcherror{splitidx}{printsubindex-chapter}}
+% \end{macrocode}
+%
+% \iffalse
+%</splitidx>
+% \fi
+%
+%
+%
%
%
% \iffalse
@@ -47424,7 +49698,7 @@ class="td%
% The starred version uses the printed |sub@<label>| which is stored as
% if it were a page number:
% \begin{macrocode}
-\renewcommand{\sf@@subref}[1]{\LWR@origpageref{sub@#1}}
+\renewcommand{\sf@@subref}[1]{\LWR@orig@pageref{sub@#1}}
% \end{macrocode}
% \end{noindmacro}
%
@@ -47859,6 +50133,7 @@ class="td%
% improved XeLaTeX and LuaLaTeX support.}
% \changes{v0.42}{2017/10/13}{\pkg{textcomp}: Improved \cs{interrobangdown}.}
% \changes{v0.54}{2018/04/08}{\pkg{textcomp}: Fix for \cs{textperthousand}.}
+% \changes{v0.58}{2018/06/07}{\pkg{textcomp}: Improved print/\HTML\ output selection.}
%
% \codehtml
%
@@ -47867,46 +50142,6 @@ class="td%
% \end{macrocode}
%
%
-% \subsection{Remembering original defintions}
-%
-% The following are restored for print when inside a \env{lateximage}:
-% \begin{macrocode}
-\let\LWR@origtextdegree\textdegree
-\let\LWR@origtextcelsius\textcelsius
-\let\LWR@origtextohm\textohm
-\let\LWR@origtextmu\textmu
-\let\LWR@origtextlquill\textlquill
-\let\LWR@origtextrquill\textrquill
-\let\LWR@origtextcircledP\textcircledP
-\let\LWR@origtexttwelveudash\texttwelveudash
-\let\LWR@origtextthreequartersemdash\textthreequartersemdash
-\let\LWR@origtextmho\textmho
-\let\LWR@origtextnaira\textnaira
-\let\LWR@origtextpeso\textpeso
-\let\LWR@origtextrecipe\textrecipe
-\let\LWR@origtextinterrobangdown\textinterrobangdown
-\let\LWR@origtextperthousand\textperthousand
-\let\LWR@origtextpertenthousand\textpertenthousand
-\let\LWR@origtextbaht\textbaht
-\let\LWR@origtextdiscount\textdiscount
-\let\LWR@origtextservicemark\textservicemark
-\LetLtxMacro\LWR@origcapitalcedilla\capitalcedilla
-\LetLtxMacro\LWR@origcapitalogonek\capitalogonek
-\LetLtxMacro\LWR@origcapitalgrave\capitalgrave
-\LetLtxMacro\LWR@origcapitalacute\capitalacute
-\LetLtxMacro\LWR@origcapitalcircumflex\capitalcircumflex
-\LetLtxMacro\LWR@origcapitaltilde\capitaltilde
-\LetLtxMacro\LWR@origcapitaldieresis\capitaldieresis
-\LetLtxMacro\LWR@origcapitalhungarumlaut\capitalhungarumlaut
-\LetLtxMacro\LWR@origcapitalring\capitalring
-\LetLtxMacro\LWR@origcapitalcaron\capitalcaron
-\LetLtxMacro\LWR@origcapitalbreve\capitalbreve
-\LetLtxMacro\LWR@origcapitalmacron\capitalmacron
-\LetLtxMacro\LWR@origcapitaldotaccent\capitaldotaccent
-\LetLtxMacro\LWR@origtextcircled\textcircled
-% \end{macrocode}
-%
-%
% \subsection{HTML symbols}
%
% For \HTML, use \HTML\ entities or direct Unicode, depending on the engine.
@@ -47918,25 +50153,25 @@ class="td%
% \begin{macrocode}
\AtBeginDocument{
\ifPDFTeX
-\renewcommand*{\textdegree}{\HTMLentity{deg}}
-\renewcommand*{\textcelsius}{\HTMLunicode{2103}}
-\renewcommand*{\textohm}{\HTMLunicode{2126}}
-\renewcommand*{\textmu}{\HTMLunicode{00B5}}
-\renewcommand*{\textlquill}{\HTMLunicode{2045}}
-\renewcommand*{\textrquill}{\HTMLunicode{2046}}
-\renewcommand*{\textcircledP}{\HTMLunicode{2117}}
-\renewcommand*{\texttwelveudash}{\HTMLunicode{2014}}% emdash
-\renewcommand*{\textthreequartersemdash}{\HTMLunicode{2014}}% emdash
-\renewcommand*{\textmho}{\HTMLunicode{2127}}
-\renewcommand*{\textnaira}{\HTMLunicode{20A6}}
-\renewcommand*{\textpeso}{\HTMLunicode{20B1}}
-\renewcommand*{\textrecipe}{\HTMLunicode{211E}}
-\renewcommand*{\textinterrobangdown}{\HTMLunicode{2E18}}
-\renewcommand*{\textperthousand}{\HTMLunicode{2030}}
-\renewcommand*{\textpertenthousand}{\HTMLunicode{2031}}
-\renewcommand*{\textbaht}{\HTMLunicode{0E3F}}
-\renewcommand*{\textdiscount}{\%}
-\renewcommand*{\textservicemark}{\HTMLunicode{2120}}
+\newcommand*{\LWR@HTML@textdegree}{\HTMLentity{deg}}
+\newcommand*{\LWR@HTML@textcelsius}{\HTMLunicode{2103}}
+\newcommand*{\LWR@HTML@textohm}{\HTMLunicode{2126}}
+\newcommand*{\LWR@HTML@textmu}{\HTMLunicode{00B5}}
+\newcommand*{\LWR@HTML@textlquill}{\HTMLunicode{2045}}
+\newcommand*{\LWR@HTML@textrquill}{\HTMLunicode{2046}}
+\newcommand*{\LWR@HTML@textcircledP}{\HTMLunicode{2117}}
+\newcommand*{\LWR@HTML@texttwelveudash}{\HTMLunicode{2014}}% emdash
+\newcommand*{\LWR@HTML@textthreequartersemdash}{\HTMLunicode{2014}}% emdash
+\newcommand*{\LWR@HTML@textmho}{\HTMLunicode{2127}}
+\newcommand*{\LWR@HTML@textnaira}{\HTMLunicode{20A6}}
+\newcommand*{\LWR@HTML@textpeso}{\HTMLunicode{20B1}}
+\newcommand*{\LWR@HTML@textrecipe}{\HTMLunicode{211E}}
+\newcommand*{\LWR@HTML@textinterrobangdown}{\HTMLunicode{2E18}}
+\newcommand*{\LWR@HTML@textperthousand}{\HTMLunicode{2030}}
+\newcommand*{\LWR@HTML@textpertenthousand}{\HTMLunicode{2031}}
+\newcommand*{\LWR@HTML@textbaht}{\HTMLunicode{0E3F}}
+\newcommand*{\LWR@HTML@textdiscount}{\%}
+\newcommand*{\LWR@HTML@textservicemark}{\HTMLunicode{2120}}
\else
% \end{macrocode}
%
@@ -47945,26 +50180,46 @@ class="td%
% NOTE: Some of the following do not print well in the listing.
% Consult the .dtx or .sty file for the actual characters.
% \begin{macrocode}
-\renewcommand*{\textdegree}{°}
-\renewcommand*{\textcelsius}{℃}
-\renewcommand*{\textohm}{Ω}
-\renewcommand*{\textmu}{µ}
-\renewcommand*{\textlquill}{⁅}
-\renewcommand*{\textrquill}{⁆}
-\renewcommand*{\textcircledP}{℗}
-\renewcommand*{\texttwelveudash}{—}% emdash
-\renewcommand*{\textthreequartersemdash}{—}% emdash
-\renewcommand*{\textmho}{℧}
-\renewcommand*{\textnaira}{₦}
-\renewcommand*{\textpeso}{₱}
-\renewcommand*{\textrecipe}{℞}
-\renewcommand*{\textinterrobangdown}{⸘}
-\renewcommand*{\textperthousand}{‰}
-\renewcommand*{\textpertenthousand}{‱}
-\renewcommand*{\textbaht}{฿}
-\renewcommand*{\textdiscount}{\%}
-\renewcommand*{\textservicemark}{℠}
+\newcommand*{\LWR@HTML@textdegree}{°}
+\newcommand*{\LWR@HTML@textcelsius}{℃}
+\newcommand*{\LWR@HTML@textohm}{Ω}
+\newcommand*{\LWR@HTML@textmu}{µ}
+\newcommand*{\LWR@HTML@textlquill}{⁅}
+\newcommand*{\LWR@HTML@textrquill}{⁆}
+\newcommand*{\LWR@HTML@textcircledP}{℗}
+\newcommand*{\LWR@HTML@texttwelveudash}{—}% emdash
+\newcommand*{\LWR@HTML@textthreequartersemdash}{—}% emdash
+\newcommand*{\LWR@HTML@textmho}{℧}
+\newcommand*{\LWR@HTML@textnaira}{₦}
+\newcommand*{\LWR@HTML@textpeso}{₱}
+\newcommand*{\LWR@HTML@textrecipe}{℞}
+\newcommand*{\LWR@HTML@textinterrobangdown}{⸘}
+\newcommand*{\LWR@HTML@textperthousand}{‰}
+\newcommand*{\LWR@HTML@textpertenthousand}{‱}
+\newcommand*{\LWR@HTML@textbaht}{฿}
+\newcommand*{\LWR@HTML@textdiscount}{\%}
+\newcommand*{\LWR@HTML@textservicemark}{℠}
\fi
+
+\LWR@formatted{textdegree}
+\LWR@formatted{textcelsius}
+\LWR@formatted{textohm}
+\LWR@formatted{textmu}
+\LWR@formatted{textlquill}
+\LWR@formatted{textrquill}
+\LWR@formatted{textcircledP}
+\LWR@formatted{texttwelveudash}
+\LWR@formatted{textthreequartersemdash}
+\LWR@formatted{textmho}
+\LWR@formatted{textnaira}
+\LWR@formatted{textpeso}
+\LWR@formatted{textrecipe}
+\LWR@formatted{textinterrobangdown}
+\LWR@formatted{textperthousand}
+\LWR@formatted{textpertenthousand}
+\LWR@formatted{textbaht}
+\LWR@formatted{textdiscount}
+\LWR@formatted{textservicemark}
% \end{macrocode}
%
%
@@ -47972,70 +50227,45 @@ class="td%
%
% For \HTML, Unicode diacritical marks are used:
% \begin{macrocode}
-\renewcommand*{\capitalcedilla}[1]{#1\HTMLunicode{0327}}
-\renewcommand*{\capitalogonek}[1]{#1\HTMLunicode{0328}}
-\renewcommand*{\capitalgrave}[1]{#1\HTMLunicode{0300}}
-\renewcommand*{\capitalacute}[1]{#1\HTMLunicode{0301}}
-\renewcommand*{\capitalcircumflex}[1]{#1\HTMLunicode{0302}}
-\renewcommand*{\capitaltilde}[1]{#1\HTMLunicode{0303}}
-\renewcommand*{\capitaldieresis}[1]{#1\HTMLunicode{0308}}
-\renewcommand*{\capitalhungarumlaut}[1]{#1\HTMLunicode{30B}}
-\renewcommand*{\capitalring}[1]{#1\HTMLunicode{30A}}
-\renewcommand*{\capitalcaron}[1]{#1\HTMLunicode{30C}}
-\renewcommand*{\capitalbreve}[1]{#1\HTMLunicode{306}}
-\renewcommand*{\capitalmacron}[1]{#1\HTMLunicode{304}}
-\renewcommand*{\capitaldotaccent}[1]{#1\HTMLunicode{307}}
+\newcommand*{\LWR@HTML@capitalcedilla}[1]{#1\HTMLunicode{0327}}
+\newcommand*{\LWR@HTML@capitalogonek}[1]{#1\HTMLunicode{0328}}
+\newcommand*{\LWR@HTML@capitalgrave}[1]{#1\HTMLunicode{0300}}
+\newcommand*{\LWR@HTML@capitalacute}[1]{#1\HTMLunicode{0301}}
+\newcommand*{\LWR@HTML@capitalcircumflex}[1]{#1\HTMLunicode{0302}}
+\newcommand*{\LWR@HTML@capitaltilde}[1]{#1\HTMLunicode{0303}}
+\newcommand*{\LWR@HTML@capitaldieresis}[1]{#1\HTMLunicode{0308}}
+\newcommand*{\LWR@HTML@capitalhungarumlaut}[1]{#1\HTMLunicode{30B}}
+\newcommand*{\LWR@HTML@capitalring}[1]{#1\HTMLunicode{30A}}
+\newcommand*{\LWR@HTML@capitalcaron}[1]{#1\HTMLunicode{30C}}
+\newcommand*{\LWR@HTML@capitalbreve}[1]{#1\HTMLunicode{306}}
+\newcommand*{\LWR@HTML@capitalmacron}[1]{#1\HTMLunicode{304}}
+\newcommand*{\LWR@HTML@capitaldotaccent}[1]{#1\HTMLunicode{307}}
% \end{macrocode}
% \cs{textcircled} becomes a span with a rounded border:
% \begin{macrocode}
-\renewcommand*{\textcircled}[1]{%
+\newcommand*{\LWR@HTML@textcircled}[1]{%
\InlineClass[border: 1px solid \LWR@currenttextcolor]{textcircled}{#1}%
}
+
+\LWR@formatted{capitalcedilla}
+\LWR@formatted{capitalogonek}
+\LWR@formatted{capitalgrave}
+\LWR@formatted{capitalacute}
+\LWR@formatted{capitalcircumflex}
+\LWR@formatted{capitaltilde}
+\LWR@formatted{capitaldieresis}
+\LWR@formatted{capitalhungarumlaut}
+\LWR@formatted{capitalring}
+\LWR@formatted{capitalcaron}
+\LWR@formatted{capitalbreve}
+\LWR@formatted{capitalmacron}
+\LWR@formatted{capitaldotaccent}
+\LWR@formatted{textcircled}
+
}% AtBeginDocument
% \end{macrocode}
%
%
-% \subsection{Inside a \env{lateximage}}
-%
-% When a \env{lateximage} is begun:
-% \begin{macrocode}
-\appto\LWR@restoreorigformatting{%
-\let\textdegree\LWR@origtextdegree%
-\let\textcelsius\LWR@origtextcelsius%
-\let\textohm\LWR@origtextohm%
-\let\textmu\LWR@origtextmu%
-\let\textlquill\LWR@origtextlquill%
-\let\textrquill\LWR@origtextrquill%
-\let\textcircledP\LWR@origtextcircledP%
-\let\texttwelveudash\LWR@origtexttwelveudash%
-\let\textthreequartersemdash\LWR@origtextthreequartersemdash%
-\let\textmho\LWR@origtextmho%
-\let\textnaira\LWR@origtextnaira%
-\let\textpeso\LWR@origtextpeso%
-\let\textrecipe\LWR@origtextrecipe%
-\let\textinterrobangdown\LWR@origtextinterrobangdown%
-\let\textperthousand\LWR@origtextperthousand%
-\let\textpertenthousand\LWR@origtextpertenthousand%
-\let\textbaht\LWR@origtextbaht%
-\let\textdiscount\LWR@origtextdiscount%
-\let\textservicemark\LWR@origtextservicemark%
-\LetLtxMacro\capitalcedilla\LWR@origcapitalcedilla%
-\LetLtxMacro\capitalogonek\LWR@origcapitalogonek%
-\LetLtxMacro\capitalgrave\LWR@origcapitalgrave%
-\LetLtxMacro\capitalacute\LWR@origcapitalacute%
-\LetLtxMacro\capitalcircumflex\LWR@origcapitalcircumflex%
-\LetLtxMacro\capitaltilde\LWR@origcapitaltilde%
-\LetLtxMacro\capitaldieresis\LWR@origcapitaldieresis%
-\LetLtxMacro\capitalhungarumlaut\LWR@origcapitalhungarumlaut%
-\LetLtxMacro\capitalring\LWR@origcapitalring%
-\LetLtxMacro\capitalcaron\LWR@origcapitalcaron%
-\LetLtxMacro\capitalbreve\LWR@origcapitalbreve%
-\LetLtxMacro\capitalmacron\LWR@origcapitalmacron%
-\LetLtxMacro\capitaldotaccent\LWR@origcapitaldotaccent%
-\LetLtxMacro\textcircled\LWR@origtextcircled%
-}
-% \end{macrocode}
-%
%
% \iffalse
%</textcomp>
@@ -48227,7 +50457,7 @@ class="td%
\expandafter \endcsname \the \theorem@bodyfont
\@thm{#1}{#2}}%
\global \expandafter \let \csname end#1\endcsname \@endtheorem
- \AtBeginEnvironment{#1}{\edef\LWR@thisthmstyle{\csuse{LWR@thmstyle#1}}}% lwarp
+ \AtBeginEnvironment{#1}{\edef\LWR@thisthmstyle{\@nameuse{LWR@thmstyle#1}}}% lwarp
}}
\gdef\@ynthm#1#2{%
@@ -48240,7 +50470,7 @@ class="td%
\expandafter{\csname th@\the \theorem@style \expandafter
\endcsname \the\theorem@bodyfont \@thm{#1}{#2}}%
\global \expandafter \let \csname end#1\endcsname \@endtheorem
- \AtBeginEnvironment{#1}{\edef\LWR@thisthmstyle{\csuse{LWR@thmstyle#1}}}% lwarp
+ \AtBeginEnvironment{#1}{\edef\LWR@thisthmstyle{\@nameuse{LWR@thmstyle#1}}}% lwarp
}}
\gdef\@othm#1[#2]#3{%
@@ -48256,7 +50486,7 @@ class="td%
\expandafter{\csname th@\the \theorem@style \expandafter
\endcsname \the\theorem@bodyfont \@thm{#2}{#3}}%
\global \expandafter \let \csname end#1\endcsname \@endtheorem
- \AtBeginEnvironment{#1}{\edef\LWR@thisthmstyle{\csuse{LWR@thmstyle#1}}}% lwarp
+ \AtBeginEnvironment{#1}{\edef\LWR@thisthmstyle{\@nameuse{LWR@thmstyle#1}}}% lwarp
}%
\fi}
% \end{macrocode}
@@ -48499,7 +50729,7 @@ class="td%
% Also see:\\
% \href{https://tex.stackexchange.com/questions/16199/test-if-a-package-or-package-option-is-loaded}
% {https://tex.stackexchange.com/questions/16199/\\
-% \hspace*{2em}test-if-a-package-or-package-option-is-loaded}
+% \fqquad\ test-if-a-package-or-package-option-is-loaded}
% \begin{macrocode}
@@ -48542,18 +50772,18 @@ class="td%
\LetLtxMacro\pgfutil@minipage\LWR@print@minipage
\let\pgfutil@endminipage\endLWR@print@minipage
-\let\pgfutil@raggedleft\LWR@origraggedleft
-\let\pgfutil@raggedright\LWR@origraggedright
+\let\pgfutil@raggedleft\LWR@print@raggedleft
+\let\pgfutil@raggedright\LWR@print@raggedright
-\def\pgfutil@font@tiny{\LWR@origtiny}
-\def\pgfutil@font@scriptsize{\LWR@origscriptsize}
-\def\pgfutil@font@footnotesize{\LWR@origfootnotesize}
-\def\pgfutil@font@small{\LWR@origsmall}
-\def\pgfutil@font@normalsize{\LWR@orignormalsize}
-\def\pgfutil@font@large{\LWR@origlarge}
-\def\pgfutil@font@Large{\LWR@origLarge}
-\def\pgfutil@font@huge{\LWR@orighuge}
-\def\pgfutil@font@Huge{\LWR@origHuge}
+\def\pgfutil@font@tiny{\LWR@printtiny}
+\def\pgfutil@font@scriptsize{\LWR@printscriptsize}
+\def\pgfutil@font@footnotesize{\LWR@printfootnotesize}
+\def\pgfutil@font@small{\LWR@print@small}
+\def\pgfutil@font@normalsize{\LWR@print@normalsize}
+\def\pgfutil@font@large{\LWR@printlarge}
+\def\pgfutil@font@Large{\LWR@printLarge}
+\def\pgfutil@font@huge{\LWR@printhuge}
+\def\pgfutil@font@Huge{\LWR@printHuge}
\def\pgfutil@font@itshape{\LWR@origitshape}
\def\pgfutil@font@bfseries{\LWR@origbfseries}
@@ -49518,7 +51748,7 @@ class="td%
% \DescribePackage{tocbibind}
% \pkg{tocbibind} is patched for use by \pkg{lwarp}.
%
-% \limitsindex
+% \limitstocbibind
%
% \changes{v0.38}{2017/08/22}{\pkg{tocbibind}: Added.}
% \changes{v0.40}{2017/09/12}{\pkg{tocbibind}: Improved for \cs{simplechapter}.}
@@ -50411,7 +52641,7 @@ class="td%
\begin{warpall}
% \end{macrocode}
-% \textcolor{red}{For both print and \HTML\ output:}
+% \textred{For both print and \HTML\ output:}
%
% When using \pkg{float}, \pkg{trivfloat}, or \pkg{algorithmicx} at the same time,
% be aware of conflicting file usage.
@@ -52735,6 +54965,31 @@ scaling = false
\RequirePackage{lwarp-scrextend}
% \end{macrocode}
%
+%
+% Indexing macros, simplified for \pkg{lwarp}:
+% \changes{v0.58}{2018/07/06}{\pkg{lwarp-patch-komascript}: Modified indexing.}
+% \begin{macrocode}
+\AtBeginDocument{
+
+\renewcommand*{\idx@heading}{%
+ \idx@@heading{\indexname}%
+}
+
+\renewenvironment{theindex}{%
+ \idx@heading%
+ \index@preamble\par\nobreak
+ \let\item\LWR@indexitem%
+ \let\subitem\LWR@indexsubitem%
+ \let\subsubitem\LWR@indexsubsubitem%
+}
+{}
+
+\renewcommand*\indexspace{}
+
+}% AtBeginDocument
+% \end{macrocode}
+%
+%
% The \cs{minisec} is placed inside a \element{div} of class \attribute{minisec}.
% \begin{macrocode}
\renewcommand*{\minisec}[1]{
@@ -52849,6 +55104,7 @@ scaling = false
\RequirePackage{lwarp-footmisc}% req'd
\RequirePackage{lwarp-framed}% req'd
\RequirePackage{lwarp-hanging}% req'd
+\RequirePackage{lwarp-makeidx}% req'd
\DisemulatePackage{moreverb}
\RequirePackage{lwarp-moreverb}
\RequirePackage{lwarp-mparhack}
@@ -52859,6 +55115,7 @@ scaling = false
\RequirePackage{lwarp-setspace}% req'd
\RequirePackage{lwarp-showidx}
\RequirePackage{lwarp-subfigure}% red'q
+\makeindex
% \end{macrocode}
% \pkg{subfigure} is emulated via \pkg{subfig}, which pre-defines
% |subfigure| and |subtable|, but \pkg{memoir} does not, so
@@ -52883,25 +55140,9 @@ scaling = false
%
% Bypass the \pkg{memoir} package mechanism:
% \begin{macrocode}
-\LetLtxMacro\LWR@origlabel\@mem@old@label
+\LetLtxMacro\LWR@orig@label\@mem@old@label
% \end{macrocode}
-
-% Redefined to write the |LWR@autoindex| counter instead of |page|
-% \begin{macrocode}
-\AtBeginDocument{
- \def\@@wrindexhyp#1||\\{%
- \addtocounter{LWR@autoindex}{1}%
- \LWR@newlabel{LWRindex-\arabic{LWR@autoindex}}%
- \ifshowindexmark\@showidx{#1}\fi
- \protected@write\@auxout{}%
- {\string\@@wrindexm@m{\@idxfile}{#1}{\arabic{LWR@autoindex}}}%
- \endgroup
- \@esphack}%
-}
-% \end{macrocode}
-
-
%
% \pkg{memoir} already set the page size to a default,
% so it must be forced large for \pkg{lwarp}'s use,
@@ -53091,7 +55332,7 @@ scaling = false
%
% \subsection{Titles}
%
-% \changes{v0.54}{2018/04/06}{\pkg{memoir}: Update for v3.7g.}
+% \changes{v0.54}{2018/04/06}{\pkg{lwarp-patch-memoir}: Update for v3.7g.}
% \begin{macrocode}
\csletcs{titlingpage*}{titlingpage}
\csletcs{endtitlingpage*}{endtitlingpage}
@@ -53762,7 +56003,7 @@ scaling = false
% \begin{macrocode}
\renewenvironment{sidenamedlegend}[2][]{
\begin{center}
-\csuse{\@captype name}\CaptionSeparator#2
+\@nameuse{\@captype name}\CaptionSeparator#2
\end{center}
}
{}
@@ -54011,6 +56252,70 @@ scaling = false
% \end{macrocode}
%
% \subsection{Back matter}
+% \label{sec:memoirbackmatter}
+%
+% Redefined to write the |LWR@autoindex| counter instead of |page|.
+% Note that \pkg{memoir} has two versions, depending on the use of \pkg{hyperref}.
+% \begin{macrocode}
+\AtBeginDocument{
+
+\def\@@wrindexhyp#1||\\{%
+ \addtocounter{LWR@autoindex}{1}%
+ \LWR@new@label{LWRindex-\arabic{LWR@autoindex}}%
+% \ifshowindexmark\@showidx{#1}\fi
+ \protected@write\@auxout{}%
+ {\string\@@wrindexm@m{\@idxfile}{#1}{\arabic{LWR@autoindex}}}%
+ \endgroup
+ \@esphack}%
+% \end{macrocode}
+%
+% \label{sec:specialindex}
+% \cs{specialindex} behaves like a regular \cs{index}, pointing to where
+% \cs{specialindex} is used.
+% If \cs{specialindex} is used inside a figure or table after the \cs{caption},
+% then the hyperlink will be given the name of that particular figure or table.
+% \changes{v0.58}{2018/06/22}{\pkg{lwarp-patch-memoir}: Fix for \cs{specialindex}.}
+% \begin{macrocode}
+\def\@@wrspindexhyp#1||\\{%
+ \addtocounter{LWR@autoindex}{1}%
+ \LWR@new@label{LWRindex-\arabic{LWR@autoindex}}%
+% \ifshowindexmark\@showidx{#1}\fi
+ \protected@write\@auxout{}%
+ {%
+% \string\@@wrindexm@m{\@idxfile}{#1}{\@nameuse{the\@sptheidx}}%
+ \string\@@wrindexm@m{\@idxfile}{#1}{\arabic{LWR@autoindex}}%
+ }%
+ \endgroup
+ \@esphack}%
+
+}% \AtBeginDocument
+% \end{macrocode}
+
+% Patched to use |_html| filename and \cs{BaseJobname}:
+% \changes{v0.58}{2018/06/22}{\pkg{lwarp-patch-memoir}: Fix for multiple indexes.}
+% \begin{macrocode}
+\catcode`\_=12%
+\renewcommand*{\makeindex}[1][\BaseJobname]{%
+ \if@filesw
+ \def\index{\@bsphack%
+ \@ifnextchar [{\@index}{\@index[\BaseJobname]}}
+ \def\specialindex{\@bsphack\@spindex}%
+ \makememindexhook
+ \expandafter\newwrite\csname #1@idxfile\endcsname
+ \expandafter\immediate\openout \csname #1@idxfile\endcsname #1_html.idx\relax
+ \typeout{Writing index file #1_html.idx }%
+ \fi}
+\catcode`\_=8%
+% \end{macrocode}
+
+% Patched to use |_html| filename and \cs{BaseJobname}.
+% This will later be patched by the \pkg{lwarp} core.
+% \changes{v0.58}{2018/06/22}{\pkg{lwarp-patch-memoir}: Fix for multiple indexes.}
+% \begin{macrocode}
+\catcode`\_=12%
+\renewcommand{\printindex}[1][\BaseJobname]{\@input@{#1_html.ind}}
+\catcode`\_=8%
+% \end{macrocode}
%
% \begin{macrocode}
\DeclareDocumentCommand{\newblock}{}{}
@@ -54083,7 +56388,7 @@ scaling = false
% \ContinuedFloat%
% \caption{#1}%
\begin{LWR@figcaption}% later becomes \caption*
-\csuse{\@captype name} \thechapter.\the\value{\@captype}\CaptionSeparator #1
+\@nameuse{\@captype name} \thechapter.\the\value{\@captype}\CaptionSeparator #1
\end{LWR@figcaption}
}
% \end{macrocode}
@@ -54102,9 +56407,9 @@ scaling = false
\renewcommand{\namedlegend}[2][]{
\begin{center}
-\csuse{fleg\@captype}\CaptionSeparator#2\\
+\@nameuse{fleg\@captype}\CaptionSeparator#2\\
\end{center}
-\csuse{flegtoc\@captype}{#1}
+\@nameuse{flegtoc\@captype}{#1}
}
\renewcommand{\newfixedcaption}[3][\caption]{%