From e0c6872cf40896c7be36b11dcc744620f10adf1d Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 2 Sep 2019 13:46:59 +0900 Subject: Initial commit --- macros/latex/contrib/lwarp/README.txt | 47 + macros/latex/contrib/lwarp/lwarp.dtx | 70907 +++++++++++++++++++ macros/latex/contrib/lwarp/lwarp.ins | 484 + macros/latex/contrib/lwarp/lwarp.pdf | Bin 0 -> 2456196 bytes .../latex/contrib/lwarp/lwarp_baseline_marker.eps | 32 + .../latex/contrib/lwarp/lwarp_baseline_marker.png | Bin 0 -> 89 bytes macros/latex/contrib/lwarp/lwarp_tutorial.txt | 95 + macros/latex/contrib/lwarp/lwarpmk.lua | 862 + 8 files changed, 72427 insertions(+) create mode 100644 macros/latex/contrib/lwarp/README.txt create mode 100644 macros/latex/contrib/lwarp/lwarp.dtx create mode 100644 macros/latex/contrib/lwarp/lwarp.ins create mode 100644 macros/latex/contrib/lwarp/lwarp.pdf create mode 100644 macros/latex/contrib/lwarp/lwarp_baseline_marker.eps create mode 100644 macros/latex/contrib/lwarp/lwarp_baseline_marker.png create mode 100644 macros/latex/contrib/lwarp/lwarp_tutorial.txt create mode 100755 macros/latex/contrib/lwarp/lwarpmk.lua (limited to 'macros/latex/contrib/lwarp') diff --git a/macros/latex/contrib/lwarp/README.txt b/macros/latex/contrib/lwarp/README.txt new file mode 100644 index 0000000000..8096e91183 --- /dev/null +++ b/macros/latex/contrib/lwarp/README.txt @@ -0,0 +1,47 @@ + +LaTeX lwarp package v0.73 README.txt + +Files included are: + +lwarp.dtx: The documented source code. +lwarp.ins: The documentation driver. +lwarp.pdf: The documentation. +lwarp_tutorial.txt: More documentation. A sample tutorial. +lwarpmk.lua: A utility program which compiles print or HTML versions. +lwarp_mathjax.txt: A script inserted when MathJax is used. +lwarp_baseline_marker.png: A tiny transparent image used to + improve SVG math width and baselines, to be located in + tex/latex/lwarp and thus be found by kpsewhich. + +Derived by compiling lwarp.ins: +lwarp.sty: The lwarp package. +lwarp-*.sty: Numerous compatibility files for other packages. + + +NOTE FOR TEX DISTRIBUTION MAINTAINERS: +For a TeX distribution, an executable called "lwarpmk" should +be created in each bin directory, which is a link to or which +calls the "lwarpmk.lua" script found in the scripts directory. +See the installation instructions in the documentation. + + +The documentation includes a file listing "tutorial.tex" which may be +copied/pasted from the documentation into an editor, or it may +be copied from the file lwarp_tutorial.tex, which is found in the +documentation directory. + + +License: +This work may be distributed and/or modified under the +conditions of the LaTeX Project Public License, either version 1.3 +of this license or (at your option) any later version. +The latest version of this license is in + http://www.latex-project.org/lppl.txt +and version 1.3 or later is part of all distributions of LaTeX +version 2005/12/01 or later. + + +Copyright 2016-2019 Brian Dunn + +Homepage: http://BDTechConcepts.com +Email: bd@BDTechConcepts.com diff --git a/macros/latex/contrib/lwarp/lwarp.dtx b/macros/latex/contrib/lwarp/lwarp.dtx new file mode 100644 index 0000000000..1fb0b0536c --- /dev/null +++ b/macros/latex/contrib/lwarp/lwarp.dtx @@ -0,0 +1,70907 @@ +% +% \iffalse meta-comment +% +% Copyright 2016-2019 Brian Dunn +% +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2005/12/01 or later. +% +% \fi +% +% \iffalse +%\NeedsTeXFormat{LaTeX2e}[1999/12/01] +%\ProvidesPackage{lwarp} +% [2019/07/11 v0.73 Allows LaTeX to directly produce HTML5 output.] +% +%<*driver> +\documentclass{ltxdoc} + +\usepackage{lmodern} +% \usepackage{libertine} +\usepackage[space]{erewhon} +\usepackage[varqu,varl]{inconsolata} % typewriter +% \usepackage{roboto}% conflicts with \textsc inside a float +% \usepackage{sourcesanspro} +\usepackage{cabin} +% \usepackage[tabular,semibold]{sourcesanspro} + +% +\usepackage[T1]{fontenc} +\usepackage[utf8]{inputenc} + +\usepackage{textcomp} % provides \degree, \textquotesingle, \textmu + +\usepackage{newunicodechar} +\newunicodechar{ff}{ff} +\newunicodechar{fi}{fi} +\newunicodechar{fl}{fl} +\newunicodechar{ffi}{ffi} +\newunicodechar{ffl}{ffl} +% \newunicodechar{°}{\degree} +\newunicodechar{ρ}{\ensuremath{\rho}} +\newunicodechar{⨯}{\texttimes} +\newunicodechar{⁄}{\textfractionsolidus} +% \newunicodechar{®}{\textregistered} +% \newunicodechar{©}{\textcopyright} +\newunicodechar{—}{---} +\newunicodechar{–}{--} +% \newunicodechar{”}{''} +% \newunicodechar{“}{``} +% \newunicodechar{§}{\S} +% \newunicodechar{¶}{\P} +% \newunicodechar{†}{\dag} +\newunicodechar{‡}{\ddag} +\newunicodechar{Á}{\'{A}} +\newunicodechar{è}{\`{e}} +\newunicodechar{ø}{\o{}} +\newunicodechar{Æ}{\AE{}} +\newunicodechar{â}{\^{a}} +\newunicodechar{ô}{\^{o}} +\newunicodechar{Ô}{\^{O}} +\newunicodechar{ê}{\^{e}} +\newunicodechar{Ω}{\textohm} +\newunicodechar{μ}{\textmu} +\newunicodechar{⁅}{\textlquill} +\newunicodechar{⁆}{\textrquill} +\newunicodechar{℗}{\textcircledP} +\newunicodechar{—}{\texttwelveudash}% emdash +\newunicodechar{—}{\textthreequartersemdash}% emdash +\newunicodechar{℧}{\textmho} +\newunicodechar{₦}{\textnaira} +\newunicodechar{₱}{\textpeso} +\newunicodechar{℞}{\textrecipe} +\newunicodechar{‽}{\textinterrobang} +\newunicodechar{⸘}{\textinterrobangdown} +\newunicodechar{‰}{\textperthousand} +\newunicodechar{‱}{\textpertenthousand} +\newunicodechar{฿}{\textbaht} +\newunicodechar{℠}{\textservicemark} + +\usepackage[log-declarations=false]{xparse} + + + +\usepackage[lwarpmk]{lwarp} + +\usepackage[erewhon]{newtxmath} + + + +\usepackage{titlesec} +% \usepackage[nobottomtitles*]{titlesec} +% \renewcommand{\bottomtitlespace}{.\textheight} + +\titleformat{\part}[hang] + {\LARGE\ttfamily\bfseries}{}{0pt}{}[\marginpar{\hfill{}File\,\thepart}] + +\titlespacing*{\part}{0pt}{*5}{0ex} + +% redefine \part to modify \@currentlabelname: +\makeatletter +\LetLtxMacro\LWR@titlesec@part\part +\RenewDocumentCommand{\part}{s o m}{% +\def\@currentlabelname{#3}% +\IfBooleanTF{#1}{% star + \IfValueTF{#2}{% star opt + \LWR@titlesec@part*[#2]{#3}% + }{% star noopt + \LWR@titlesec@part*{#3}% + }% +}{% no star + \IfValueTF{#2}{% opt + \LWR@titlesec@part[#2]{#3}% + }{% noopt + \LWR@titlesec@part{#3}% + }% +}% +} +\makeatother + + +\usepackage{needspace} + + +\usepackage[svgnames]{xcolor} +\definecolor{myurlcolor}{rgb}{0,0,.7} +\definecolor{mylinkcolor}{rgb}{.7,0,0} +\definecolor{codecolor}{rgb}{0,.4,.2} +\definecolor{overviewcolor}{rgb}{0,.2,.4} + +\usepackage[ + left=2in, + right=1.5in, + top=1.5in, + bottom=1in +]{geometry} + +\usepackage{graphicx} +\graphicspath{{images/}} + + +\usepackage{metalogo} + +\makeatletter +\@ifpackageloaded{erewhon}{ +% for erewhon: +\setlogokern{Te}{-.08em} +\setlogokern{eX}{-0.04em} +\setlogokern{La}{-.25em} +\setlogokern{aT}{-.10em} +\setlogokern{Xe}{-.04em} +\setlogokern{eL}{-.06em} +\setlogodrop{0.27ex} +}{} +\makeatother + + +\usepackage{enumitem} + +\usepackage{array} +\usepackage{longtable} +\usepackage{booktabs} +\usepackage{threeparttable} +\usepackage{multirow} +\usepackage{bigdelim} + +\usepackage[normalem]{ulem} + +\usepackage{fancyvrb} + +\usepackage{capt-of} + +\usepackage{comment} + +% ^^A tocloft had issues with \textsc +% \usepackage{tocloft} +% \renewcommand{\cftpartfont}{\Large\bfseries} +% \setlength{\cftsecnumwidth}{2.5em} +% \setlength{\cftsubsecnumwidth}{3em} +% \setlength{\cftsubsubsecindent}{2.8em} +% \setlength{\cftsubsubsecnumwidth}{4em} + +\usepackage{titletoc} +\dottedcontents{part}[0em]{\large\bfseries}{3.5em}{1pc} +\dottedcontents{section}[2em]{\bfseries}{3.5em}{1pc} +\dottedcontents{subsection}[4em]{}{3.5em}{1pc} +\dottedcontents{subsubsection}[6em]{}{4em}{1pc} + +\usepackage[notbib,notindex,nottoc]{tocbibind} + +\usepackage{titleps} + +\newpagestyle{pageheadfoot}{ + \headrule + \sethead{\pkg{lwarp}}{}{\thepage} +% \renewcommand{\makefootrule}{\rule[2.5ex]{\linewidth}{.4pt}} + \setfoot{}{}{} +} + +\pagestyle{pageheadfoot} + + +\usepackage{dtxdescribe}[2019/07/16] + + +\usepackage{splitidx} + +\newindex[Index of Objects]{idx} +\newindex[General Index]{gen} +\newindex[Troubleshooting Index]{trb} +\newindex[Index of Indexes]{meta} + +\makeindex + +\newcommand*{\gindex}[1]{\sindex[gen]{#1}\ignorespaces} + + + +\usepackage{microtype} + +\usepackage[all,defaultlines=2]{nowidow} + + + +\usepackage[pdftex,bookmarks=true,hidelinks,% +colorlinks,linkcolor=mylinkcolor,urlcolor=myurlcolor,% +pageanchor=true,hyperindex=true,hyperfootnotes=false% +]{hyperref} + +\hypersetup{% +pdfinfo={% +Title={LaTeX lwarp package},% +Author={Brian Dunn},% +Subject={LaTeX to HTML conversion},% +Keywords={LaTeX, HTML, conversion}% +}} + + + +\usepackage{cleveref} + + +\renewcommand{\partname}{Package} +\renewcommand*{\thepart}{\arabic{part}} + +\renewenvironment{abstract} + { + \addvspace{\bigskipamount} + \begin{center} + \textbf{\abstractname} + \end{center} +% \small + \setlength{\parindent}{2em} + \setlength{\parskip}{0ex} + } + { + \addvspace{\bigskipamount} + } + +\makeatletter +\newcommand*{\rulebreak}{% + \bigskip\hfill\rule[.7ex]{.3\linewidth}{.4pt}\hspace*{\fill}\bigskip\@afterheading% +} +\makeatother + +\newcommand*{\goesto}{$\Rightarrow$} + +\newcommand*{\AV}{\acro{A}\Slash\acro{V}} + +\makeatletter +\@ifpackageloaded{erewhon}{\renewcommand*{\HTMLfive}{\acro{HTML}\textosf{5}}}{} +\makeatother + +\newcommand{\credits}[1]{{\footnotesize(\textit{Emulates or patches code by} \textsc{#1}.)}} + +\newcommand*{\codehtml}{\leavevmode\marginpar{\footnotesize\raggedleft\textcolor{codecolor}{\textbf{for HTML output:~}}}\vspace{-5.25ex}} +\newcommand*{\codeprint}{\leavevmode\marginpar{\footnotesize\raggedleft\textcolor{codecolor}{\textbf{for PRINT output:~}}}\vspace{-5.25ex}} +\newcommand*{\codeall}{\leavevmode\marginpar{\footnotesize\raggedleft\textcolor{codecolor}{\textbf{for HTML \& PRINT:~}}}\vspace{-5.25ex}} +\newcommand*{\codeconfig}{\leavevmode\marginpar{\footnotesize\raggedleft\textcolor{codecolor}{\textbf{Config file:~}}}\vspace{-5.25ex}} + +\newcommand*{\testthis}{\textcolor{blue}{Please send bug reports!}\watchout[Not fully tested!]} + +\newcommand{\textred}[1]{\textcolor{red}{#1}} +\newcommand{\textgreen}[1]{\textcolor{green!50!black}{#1}} +\newcommand{\textcyan}[1]{\textcolor{cyan!70!black}{#1}} +\newcommand{\textblue}[1]{\textcolor{blue!70!black}{#1}} +\newcommand{\textgray}[1]{\textcolor{white!30!black}{#1}} + + +% \newcommand{\spkg}[1]{\textcolor{green!30!gray}{\pkg{#1}}}% package supported as-is +% \newcommand{\mpkg}[1]{\textcolor{cyan!30!gray}{\pkg{#1}}}% package modified for HTML +% \newcommand{\epkg}[1]{\textcolor{blue!30!gray}{\pkg{#1}}}% package emulated for HTML +% \newcommand{\ipkg}[1]{\textcolor{magenta!30!gray}{\pkg{#1}}}% package ignored +% \newcommand{\wpkg}[1]{\textcolor{red!30!gray}{\pkg{#1}}}% package warning special case + +% green/blue/magenta/gray +\newcommand{\spkg}[1]{\textcolor[Hsb]{120,1,.4}{\pkg{#1}}}% package supported as-is +\newcommand{\mpkg}[1]{\textcolor[Hsb]{240,1,.4}{\pkg{#1}}}% package modified for HTML +\newcommand{\epkg}[1]{\textcolor[Hsb]{300,1,.5}{\pkg{#1}}}% package emulated for HTML +\newcommand{\ipkg}[1]{\textcolor[Hsb]{0,0,.5}{\pkg{#1}}}% package ignored +\newcommand{\wpkg}[1]{\textcolor[Hsb]{0,1,.5}{\pkg{#1}}}% package warning special case + +% green/cyan/blue/magenta +% \newcommand{\spkg}[1]{\textcolor[Hsb]{120,1,.4}{\pkg{#1}}}% package supported as-is +% \newcommand{\mpkg}[1]{\textcolor[Hsb]{180,1,.4}{\pkg{#1}}}% package modified for HTML +% \newcommand{\epkg}[1]{\textcolor[Hsb]{240,1,.5}{\pkg{#1}}}% package emulated for HTML +% \newcommand{\ipkg}[1]{\textcolor[Hsb]{300,1,.5}{\pkg{#1}}}% package ignored +% \newcommand{\wpkg}[1]{\textcolor[Hsb]{0,1,.5}{\pkg{#1}}}% package warning special case + + + +\newcommand{\pdflatexonly}{ +\textred{Only pre-loaded if \prog{pdflatex} is being used.} +\marginpar{\raggedleft\textblue{\prog{pdflatex} only:}} +} + + +% \trouble[watchout phrase]{index entry} +\newcommand*{\trouble}[2][]{% +\ifblank{#1}{}{% + \watchout[#1]% +}% +\sindex[trb]{#2}% +\ignorespaces% +} + + +% The following text is used in multiple places in the documentation: + +\newcommand{\needhelp}{ +\begin{minipage}{\linewidth} +\hrule\smallskip +\small +See the \nameref{sec:indexgen} for ``how-to'', and +the \nameref{sec:indextrb} if something doesn't work. +The \nameref{sec:indexidx} contains automated entries for each package, macro, environment, +counter, boolean, and other objects; individually and also sorted by category. +A \nameref{sec:troubleshooting} section is also available. +\smallskip +\hrule +\end{minipage}\margintag{Need help?} +} + +\newcommand{\usedbykomascript}{ +This package may be loaded standalone, but +is also loaded automatically if \pkg{koma-script} classes are in use. +\cs{DeclareDocumentCommand} is used to overwrite the \pkg{koma-script} definitions. +} + +\newcommand{\documentationnotes}{ +The following sections document the actual implementation of the \pkg{lwarp} package. + +The small numbers at the left end of a line refer to line numbers +\margintag{line numbers} +in the \texttt{lwarp.sty} file. + +Blue-colored tags in the left margin +\margintag{subjects} +aid in quickly identifying the subject of each paragraph. + +Black-colored tags in the left marign are used to +\margintag{objects} +identify programming objects such as files, packages, +environments, booleans, and counters. +Items without a tag are command macros. +Each of these also appears in the index as +\margintag{index entries} +individual entries, and are also listed together under ``files'', ``packages'', ``environments'', +``booleans'', and ``counters''. + +Special warnings are marked with a warning icon. +\watchout[warnings] + +\codehtml\vspace*{5.25ex}\ignorespaces +\codeprint\vspace*{5.25ex}\ignorespaces +\codeall\vspace*{5.25ex}\ignorespaces +Green-colored tags in the left margin show which sections of source +code apply to the generation of \HTML, print, or both forms of output. +} + + +\newcommand{\describemathimagename}{% +When creating an \SVG\ math image, its \attribute{alt} tag may be set +to the math expression, which may be hashed for image reuse. +In the case of \cs{ensuremath} or after \cs{inlinemathother}, +where the contents require a unique image for each instance of the same expression, +the \attribute{alt} tag is set to \cs{mathimagename}, and the image is not reused. + +This expression is visible in the browser if images are not loaded, +and appears when the text is copied and pasted. +The default is ``math image'', and it may be changed according to the document's language. +This may be set in the preamble, or changed as necessary inside the document, +where it will affect the following \SVG\ math images. +} + +\newcommand{\describepackagediagramname}{% +For many packages, the output is placed inside a \env{lateximage} with an +\HTML\ \attribute{alt} tag set to the package name followed by \cs{packagediagramname}. +For example: +\begin{sourcedisplay} +(-xy- diagram) +\end{sourcedisplay} +This expression is visible in the browser if images are not loaded, +and appears when the text is copied and pasted. +The default is ``diagram'', and may it be changed according to the document's language. +This may be set in the preamble, or changed as necessary inside the document, +where it will affect the following \env{lateximage}s. +} + +\newcommand{\limitscpageref}{% +\pkg{cleveref} and \pkg{varioref} are supported, +\trouble[\pkg{cleveref} page numbers]{page numbers} +\trouble{reference>page number} +but printed page numbers do not map to \HTML, +so a section name or a text phrase +are used for \cs{cpageref} and \cs{cpagerefrange}. +This phrase includes \cs{cpagerefFor}, which defaults to ``for''. + +\needspace{3\baselineskip} +Ex: +\begin{sourcedisplay} + \cs{cpageref}\{tab:first,tab:second\} \\ + \hspace*{-2em} in \HTML\ becomes:\\ + \rmfamily + ``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. +} + +\newcommand{\limitshyperlinks}{% +\pkg{lwarp} emulates \pkg{hyperref}, including the creation of active hyperlinks, +but does not require that \pkg{hyperref} be loaded by the document. + +Do not place a comment with a \texttt{\%} character between arguments +\trouble[comments between arguments]{hyperref=\pkg{hyperref}>comments between arguments} +for \cs{hyperref}, etc., as it is neutralized for inclusion in \HTML\ \URL{}s. + +\pkg{lwarp} can also load \pkg{url}, but \pkg{url} should not be used at the +same time as \pkg{hyperref}, since they both define the \cs{url} command. +\pkg{lwarp} does not (yet) attempt to convert \pkg{url} links into hyperlinks +during \HTML\ output, nor does the print version of \pkg{url} +create hyperlinks. + +When generating \HTML, \pkg{lwarp}'s emulation of \pkg{hyperref} does not +\trouble[\pkg{backref}]{hyperref=\pkg{hyperref}>backref=\pkg{backref}} +\trouble{backref=\pkg{backref}} +automatically load \pkg{backref}, so \pkg{backref} must be loaded explicitly. +} + +\newcommand{\limitsabstract}{% +If using the \optn{number} option with file splits, +\trouble[missing \TOC]{abstract>missing \TOC} +be sure to place the table of contents before the abstract. +The \optn{number} option causes a section break which +may cause a file split, which would put a table of contents out +of the home page if it is after the abstract. +} + +\newcommand{\limitstitlepage}{% +\pkg{lwarp} supports the native \LaTeX\ titling commands, and also +\margintag{package support} +supports the packages \pkg{authblk} and \pkg{titling}. If both are +\trouble[load order]{authblk=\pkg{authblk}>titling=\pkg{titling}} +\trouble{titling=\pkg{titling}>authblk=\pkg{authblk}} +used, \pkg{authblk} should be loaded before \pkg{titling}. + +If using the \pkg{titling} package, additional titlepage fields +\margintag{\cs{published} and \cs{subtitle}} +for \cs{published} and \cs{subtitle} may be added by using +\cs{AddSubtitlePublished} in the preamble. +See \cref{sec:publishedsubtitle}. +} + +\newcommand{\limitsappendix}{% +During \HTML\ conversion, the option \optn{toc} without +\trouble[incorrect \TOC\ link]{appendix>incorrect \TOC\ link} +the option \optn{page} results in a \TOC\ link to +whichever section was before the \texttt{appendices} environment. +It is recommended to use both \texttt{toc} and also \texttt{page} at the same time. +} + +\newcommand{\limitspdftotextenc}{% +The option +\DescribeOption{pdftotextEnc} +\DescribeDefault{UTF-8} +\optn{pdftotextEnc} sets the encoding used by \prog{pdftotext}. +This is passed to \prog{pdftotext} using its \optn{-enc} option, and is +used when converting \LaTeX\ \PDF\ output with \HTML\ tags into +a plain-text file with \HTML\ tags. +} + +\newcommand{\limitsbibtex}{% +When enough authors are cited for a source, +\watchout[Modify *.bib] +\trouble{Improper \cs{prevdepth}>bibtex=\pkg{bibtex}} +\trouble{bibtex=\pkg{bibtex}>Improper \cs{prevdepth}} +\trouble{bibtex=\pkg{bibtex}>\cs{etalchar}} +\trouble{etalchar=\cs{etalchar}} +\BibTeX\ may use the \cs{etalchar} command +to display a math superscript with a $+$ character to indicate ``and others''. +Without modification, this will result in an ``Improper \cs{prevdepth}'' error. +At present, \pkg{lwarp} requires that \cs{etalchar} be replaced by a text superscript. +To do so, add to the start of the \filenm{.bib} file the following: +\begin{sourcedisplay} +\hspace*{-6em}@PREAMBLE\{"\cs{let}\cs{etalchar}\cs{relax} +\cs{newcommand}\{\cs{etalchar}\}[1]\{\cs{textsuperscript}\{\#1\}\}"\} +\end{sourcedisplay} +} + +\newcommand{\limitsgloss}{% +To process the \HTML\ glossary: +\begin{sourcedisplay} +bibtex \textred{\_html}.gls +\end{sourcedisplay} +} + +\newcommand{\limitsglossaries}{% +\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 \prog{makeglossaries} program. + +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. + +In some situations it may be required to modify the default command, +\trouble[\prog{makeglossaries} not found]{makeglossaries=\prog{makeglossaries}>not found} +\trouble{glossaries=\pkg{glossaries}>makeglossaries=\prog{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 \prog{makeglossaries} may be set as well. + +The glossaries may be placed in a numbered or unnumbered section, given +\margintag{placement and \TOC\ options} +a \TOC\ entry, and placed inline or on their own \HTML\ page: +\begin{description} + +\item [Numbered section, on its own \HTML\ page:] + \begin{sourcedisplay} + \cs{usepackage}[xindy,toc,numberedsection=nolabel]\{glossaries\} \\ + \dots \\ + \cs{printglossaries} + \end{sourcedisplay} + +\item [Unnumbered section, inline with the current \HTML\ page:] + \begin{sourcedisplay} + \cs{usepackage}[xindy,toc]\{glossaries\} \\ + \dots \\ + \cs{printglossaries} + \end{sourcedisplay} + +\item [Unnumbered section, on its own \HTML\ page:] + \begin{sourcedisplay} + \cs{usepackage}[xindy,toc]\{glossaries\} \\ + \dots \\ + \cs{ForceHTMLPage} \\ + \cs{printglossaries} + \end{sourcedisplay} +\end{description} + +The default \optn{style=item} option for \pkg{glossaries} conflicts +\trouble[glossary style]{glossaries=\pkg{glossaries}>style} +with \pkg{lwarp}, so the style is forced to \texttt{index} instead. + +The page number list in the printed form would become \cs{nameref}s in \HTML, +\trouble[number list]{glossaries=\pkg{glossaries}>page numbers} +which could become a very long string if many items are referenced. +For now, the number list is simply turned off. + +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. +} + +\newcommand{\limitsnomencl}{% +To process the \HTML\ nomenclature: +\begin{sourcedisplay} +makeindex \textred{\_html}.nlo -s nomencl.ist -o \textred{\_html}.nls +\end{sourcedisplay} +} + +\newcommand{\limitstocbibind}{% +An index may be placed inline with other \HTML\ text, or on its own \HTML\ page: +\margintag{placement and \TOC\ options} +\gindex{index>placement and \TOC\ options} +\gindex{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} + \cs{cleardoublepage} \\ + \cs{phantomsection} \\ + \cs{addcontentsline}\{toc\}\{section\}\{\cs{indexname}\}\% or chapter \\ + \cs{printindex} + \end{sourcedisplay} + +\needspace{3\baselineskip} +\item [On its own \HTML\ page, with a manual \TOC\ entry:] \ +\DescribePackage{makeidx} + \begin{sourcedisplay} + \cs{begin}\{warpprint\} \\ + \cs{cleardoublepage} \\ + \cs{phantomsection} \\ + \cs{addcontentsline}\{toc\}\{section\}\{\cs{indexname}\}\% or chapter \\ + \cs{end}\{warpprint\} \\ + \cs{ForceHTMLPage} \\ + \cs{ForceHTMLTOC} \\ + \cs{printindex} + \end{sourcedisplay} + +\item [Inline, with an automatic \TOC\ entry:] \ + \DescribePackage{tocbibind} + + The \pkg{tocbibind} + package may be used to automatically place an entry in the \TOC. + \begin{sourcedisplay} + \cs{usepackage}[nottoc]\{tocbibind\} \\ + \dots \\ + \cs{cleardoublepage} \\ + \cs{phantomsection} \% to fix print-version index link \\ + \cs{printindex} + \end{sourcedisplay} + +\item [On its own \HTML\ page, with an automatic \TOC\ entry:] \ + \DescribePackage{tocbibind} + \begin{sourcedisplay} + \cs{usepackage}[nottoc]\{tocbibind\} \\ + \dots \\ + \cs{cleardoublepage} \\ + \cs{phantomsection} \% to fix print-version index link \\ + \cs{ForceHTMLPage} \\ + \cs{printindex} + \end{sourcedisplay} +\end{description} + +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 +\trouble[\cs{thepage}]{splitidx=\pkg{splitidx}>\cs{thepage} and \cs{AtWriteToIndex}} +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} +\gindex{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}{% +If using \pkg{tocloft} with \pkg{tocbibind}, \pkg{anonchap}, +\DescribePackage{tocloft} +\trouble[\pkg{tocloft} \& other packages]{tocloft=\pkg{tocloft}>chapter titles} +\pkg{fncychap}, or other packages which change chapter title formatting, +load \pkg{tocloft} with its \optn{titles} option, which +tells \pkg{tocloft} to use standard \LaTeX\ commands to create the titles, +allowing other packages to work with it. +} + +\newcommand*{\limitspagenote}{% +\pkg{pagenote} works as-is, but the \optn{page} option is disabled. +} + +\newcommand*{\limitsendnotes}{% +To place the endnotes in the \TOC, use: +\margintag{table of contents} +\begin{sourcedisplay} +\cs{usepackage}\{endnotes\} \\ +\cs{appto}\cs{enoteheading}\{\cs{addcontentsline}\{toc\}\{section\}\{\cs{notesname}\}\} +\cs{renewcommand*}\{\cs{notesname}\}\{Endnotes\} \% optional \\ +\end{sourcedisplay} + +To additionally have the endnotes on their own \HTML\ page, +\margintag{\HTML\ page} +if \texttt{FileDepth} allows: +\begin{sourcedisplay} +\cs{ForceHTMLPage} \\ +\cs{theendnotes} +\end{sourcedisplay} +} + + +\newcommand{\limitstext}{% +\cs{textbf}, etc.\ are supported, +\trouble[\cs{bfseries}, etc.]{text>\cs{bfseries} etc.} +\trouble{formatting>\cs{bfseries} etc.} +but \cs{bfseries}, etc.\ work only in some situations. + +\texttt{\&}, \texttt{\textless}, and \texttt{\textgreater} +\trouble[HTML special chars]{HTML>entities} +\trouble{HTML>\&, \textless, \textgreater} +\trouble{text>\&, \textless, \textgreater} +have special meanings in \HTML. +If \cs{\&}, \cs{textless}, and \cs{textgreater} are used, proper +\HTML\ entities will be used, but there may be \HTML\ parsing problems +if these special characters occur unescaped in program listings +or other verbatim text. + +For program listings, the \pkg{listings} package is supported, +\margintag{program listings} +and its \optn{literate} option is used to convert +\texttt{\&}, \texttt{\textless}, and \texttt{\textgreater} +to proper \HTML\ entities. + +The various \env{verbatim}-related environments do not convert +\texttt{\&}, \texttt{\textless}, and \texttt{\textgreater}, +\margintag{verbatim} +so care must be taken to avoid accidentally including valid \HTML\ code inside +these environments. Adding a space on either side may be sufficient. +} + +\newcommand{\limitshspace}{% +\DescribeMacro{\hspace}% +\gindex{space>horizontal}% +\gindex{horizontal space}% +\cs{hspace} is converted to an inline \HTML\ span of the given width, +except that \texttt{0} width is ignored, +a width of \texttt{.16667em} is converted to +an \HTML\ thin breakable space (\texttt{U+2009}), +and a \cs{fill} is converted to a \cs{qquad}. + +\gindex{\texttt{\textasciitilde}}% +\gindex{\cs{,}}% +\DescribeMacro{\,}% +\texttt{\~} and \cs{,} are converted to \HTML\ entities. + +\DescribeMacro{\kern}% +\DescribeMacro{\hskip}% +\cs{kern} and \cs{hskip} are entered into the \HTML\ \PDF\ output as-is, +then interpreted by \prog{pdftotext}, and thus usually appear as a single space. +} + +\newcommand{\limitstextcomp}{% +Some \pkg{textcomp} symbols do not have Unicode equivalents, and thus +are not supported. + +Many \pkg{textcomp} symbols are not supported by many system \Slash browser fonts. +\trouble[missing symbols]{textcomp=\pkg{textcomp}>missing symbols} +\trouble{font>missing symbols} +In the \CSS\ try referencing fonts which are more complete, but expect to see gaps in coverage. +} + +\newcommand{\limitsaccents}{% +Native \LaTeX\ accents such as \cs{"} will work, but many more kinds of +accents are available when using Unicode-aware \XeLaTeX\ and \LuaLaTeX. +} + +\newcommand{\limitsrelsize}{% +For \HTML, only the inline macros are supported: \cs{textlarger}, \cs{textsmaller}, and +\cs{textscale}. Each becomes an inline span of a modified \attribute{font-size}. + +\cs{relsize}, \cs{larger}, \cs{smaller}, and \cs{relscale} are ignored. + +While creating \SVG\ math for \HTML, the original definitions are temporarilty restored, +and so should work as expected. + +The \HTML\ browser's setting for minumum font size +\watchout[not small] +may limit how small the output will be displayed. +} + +\newcommand{\limitsreferences}{% +Labels with special characters may be a problem. +\margintag{labels} +\trouble[label characters]{label>characters} +\trouble{reference>label characters} +It is best to stick with alpha-numeric, hyphen, underscore, and perhaps the colon (if not French). + +\cs{nameref} refers to the most recently-used section where the \cs{label} +\margintag{\cs{nameref}} +was defined. +If no section has been defined before the \cs{label}, +\trouble[empty link]{label>\cs{nameref} empty} +the link will be empty. +Index entries also use \cs{nameref} and have the same limitation. +\trouble{index>empty link} +\trouble{reference>empty link} +} + +\newcommand{\limitspfnote}{ +While emulating \pkg{pfnote}, +\margintag{\pkg{pfnote}} +\pkg{lwarp} is not able to reset \HTML\ footnote +\trouble[\pkg{pfnote} numbers]{pfnote=\pkg{pfnote}>numbering} +numbers per page number to match the printed version, +as \HTML\ has no concept of page numbers. +\pkg{lwarp} therefore uses continuous footnote numbering even for \pkg{pfnote}. +} + +\newcommand{\limitsperpage}{ +To have footnote numbers reset each time footnotes are printed: +\margintag{footnote numbering} +\begin{sourcedisplay} +\cs{setcounter}\{footnoteReset\}\{1\} +\end{sourcedisplay} + +For \pkg{bigfoot}, \pkg{manyfoot}, or \pkg{perpage}: +\begin{sourcedisplay} +\cs{MakePerPage}\{footnoteX\} \\ +\textrm{--- or ---} \\ +\cs{MakeSortedPerPage}\{footnoteX\} +\end{sourcedisplay} +The footnotes are reset when they are printed, according to section level +as set by \ctr{FootnoteDepth}, which is not necessarily by \HTML\ page. +This is recommended for \cs{alph}, \cs{Alph}, or \cs{fnsymbol} footnotes, +due to the limited number of symbols which are available. +} + +\newcommand{\limitsfootnotes}{ +\pkg{lwarp} uses native \LaTeX\ footnote code, although with its own +\cs{box} to avoid the \LaTeX\ output routine. The usual functions mostly work as-is. + +\limitsperpage + +The \pkg{footmisc} \optn{stable} option is emulated by \pkg{lwarp}. +\margintag{\pkg{footmisc}} + +When using footnotes in sectioning commands, +\trouble[sectioning commands]{footnote>sectioning, \pkg{footmisc}} +\trouble{footmisc=\pkg{footmisc}} +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}[\textred{stable}]\{footmisc\}\\ +\dots\\ +\cs{subsection}\textred{[Subsection Name]}\\ +\fqquad\{Subsection Name\textred{\cs{protect}}\cs{footnote}\{A footnote.\}\} +\end{sourcedisplay} + +If using \pkg{memoir} class, +\margintag{\pkg{memoir} with \pkg{footmisc}} +with which \pkg{lwarp} preloads \pkg{footmisc}, the +\optn{stable} option must be declared before \pkg{lwarp} is loaded: +\trouble[\pkg{memoir}]{footnote>memoir=\pkg{memoir}} +\trouble{memoir=\pkg{memoir}>footmisc=\pkg{footmisc}} +\begin{sourcedisplay} +\cs{PassOptionsToPackage}\{\textred{stable}\}\{footmisc\} \\ +\cs{usepackage}\{lwarp\} \\ +\dots +\end{sourcedisplay} + +Do not use a starred sectioning command. As an alternative, it may be possible to +adjust \cs{secnumdepth} instead. +% Attempting to use \cs{footnotemark} instead +% of \cs{footnote} may result in misnumbered footnotes in the print document. +} + +\newcommand{\limitsverbatimfootnotes}{% +If using \pkg{fancybox} or \pkg{fancyvrb} with \cs{VerbatimFootnotes}, +\margintag{\pkg{fancybox}, \pkg{fancyvrb}} +\trouble[\cs{VerbatimFootnotes}]{footnote>VerbatimFootnotes=\cs{VerbatimFootnotes}} +and using footnotes in a sectioning command or display math, +\trouble[sectioning or displaymath]{footnote>sectioning, verbatim} +\trouble{footnote>displaymath} +\trouble{VerbatimFootnotes} +\trouble{fancybox=\pkg{fancybox}>VerbatimFootnotes=\cs{VerbatimFootnotes}} +\trouble{fancyvrb=\pkg{fancyvrb}>VerbatimFootnotes=\cs{VerbatimFootnotes}} +\trouble{footnote>paragraph tags} +use \cs{footnotemark} and \cs{footnotetext}: +\begin{sourcedisplay} +\cs{subsection}[Subsection Name]\\ +\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. + +At present there is a bug such that paragraph closing tags are not present in +footnotes when \cs{VerbatimFootnotes} are selected. The browser usually compensates. +} + +\newcommand{\limitsmanyfootbigfoot}{% +Verbatim footnotes are not yet supported. +\margintag{\pkg{bigfoot}, \pkg{manyfoot}} +\watchout[verbatim] + +If using the \pkg{bigfoot} package, and possibly also \pkg{manyfoot}, +\trouble{bigfoot=\pkg{bigfoot}} +\trouble{manyfoot=\pkg{manyfoot}} +problems may occur with counter allocation because \pkg{lwarp} uses many counters, +and there is a difference in how counters numbered 256 and up are handled in pdf\LaTeX. +With \pkg{bigfoot} this has been known to show up as an error +related to one footnote insert being forbidden inside another. Another problem +showed up as a input stack error, and which of these problems occurred depended on how +many counters were allocated. + +As a possible solution, try creating several new counters before defining +\pkg{bigfoot} or \pkg{manyfoot} footnotes, +hoping to shift the problematic counter above the 256 threshold. +It may instead be necessary to use \XeLaTeX\ or \LuaLaTeX\ +instead of pdf\LaTeX. +} + +\newcommand{\limitskomascript}{ +Many features are ignored during the \HTML\ conversion. +The goal is source-level compatibility. + +\cs{titlehead}, \cs{subject}, +\cs{captionformat}, \cs{figureformat}, and \cs{tableformat} are not yet emulated. + +\testthis + +Some features have not yet been tested. +Please contact the author with any bug reports. +} + +\newcommand{\limitsmemoir}{ +While emulating \pkg{memoir}, \pkg{lwarp} pre-loads +a number of packages (\cref{sec:patch-memoir-packages}). +This can cause an options clash when the user's document later loads the same +\trouble[options clash]{memoir=\pkg{memoir}>options clash} +\trouble{options clash>memoir=\pkg{memoir}} +packages with options. To fix this problem, specify the options before +loading \pkg{lwarp}: +\begin{sourcedisplay} +\cs{documentclass}\{memoir\} \\ +\dots \\ +\cs{PassOptionsToPackage}\{options\_list\}\{package\_name\} \\ +\dots \\ +\cs{usepackage\{lwarp\}} \\ +\dots \\ +\cs{usepackage\{package\_name\}} +\end{sourcedisplay} + +\pkg{memoir} emulates a number of packages, and declares a version date for each +\trouble[version numbers]{memoir=\pkg{memoir}>version clash} +\trouble{package>version numbers with \pkg{memoir}} +\trouble{version numbers>with \pkg{memoir}} +which often does not match the date of the corresponding freestanding package. +This can cause warnings about incorrect version numbers. +Since \pkg{lwarp} is intended to support the freestanding packages, +which are often newer than the date declared by \pkg{memoir}, it is hoped that +\pkg{memoir} will update and change its emulated version numbers to match. + +\cs{verbfootnote} is not supported. + +\cs{newfootnoteseries}, etc. are not supported. + +\pkg{lwarp} loads \pkg{pagenote} to perform \pkg{memoir}'s pagenote functions, +but there are minor differences in \cs{pagenotesubhead} and related macros. + +Poem numbering is not supported. + +The \env{verbatim} environment does not yet support the \pkg{memoir} enhancements. +It is currently recommended to load and use \pkg{fancyvrb} instead. + +The \pkg{memoir} glossary system is not yet supported by \prog{lwarpmk}. +The \pkg{glossaries} package may be used instead, +but does require the glossary entries be +changed from the \pkg{memoir} syntax to the \pkg{glossaries} syntax. +} + +\newcommand{\limitsverse}{% +When using \pkg{verse} or \pkg{memoir}, always place a +\texttt{\textbackslash\textbackslash} after each line. + +\DescribeMacro{\attrib} +The documentation for the \pkg{verse} and \pkg{memoir} packages suggest +defining an \cs{attrib} command, which may already exist in current documents, +but it will only work for print output. +\pkg{lwarp} provides \cs{attribution}, which +works for both print and \HTML\ output. To combine the two so that +\cs{attrib} is used for print and \cs{attribution} is used for \HTML: +\begin{sourcedisplay} +\cs{begin}\{warpHTML\} \\ +\cs{let}\cs{attrib}\cs{attribution} \\ +\cs{end}\{warpHTML\} +\end{sourcedisplay} + +\DescribeLength{\vleftskip} +\DescribeLength{\vleftmargini} +These lengths are used by \pkg{verse} and \pkg{memoir} to control the left margin, +and they may already be set by the user for print output. New lengths + \DescribeLength{\HTMLvleftskip}\DescribeLength{\HTMLleftmargini} +\cs{HTMLvleftskip} and \cs{HTMLleftmargini} are provided to control the +margins in \HTML\ output. These new lengths may be set by the user +before any \env{verse} environment, and persist until they are manually changed again. +One reason to change \cs{HTMLleftmargini} is if there is a wide +\cs{flagverse} in use, such as the word ``Chorus'', in which case the value of +\cs{HTMLleftmargini} should be set to a wide enough length to contain ``Chorus''. +The default is wide enough for a stanza number. + +Horizontal spacing relies on \prog{pdftotext}'s ability to discern the layout +\trouble[spacing]{verse>spacing} +(\optn{-layout} option) of the +text in the \HTML-tagged \PDF\ output. For some settings of +\cs{HTMLleftmargini} or \cs{HTMLleftskip} the horizontal alignment may not work out +exactly, in which case a label may be shifted by one space. +} + + +\newcommand{\limitslateximagefontsize}{% +For the \env{lateximage} environment, +the size of the math and text used +\margintag{SVG image font size} +in the \SVG\ image may be adjusted +\gindex{font>size>lateximage}% +\gindex{font>size>math, SVG}% +\gindex{math>font size --- SVG}% +\gindex{lateximage>font size}% +by setting \cs{LateximageFontSizeName} to a font size name \Dash \emph{without the backslash}, +which defaults to: +\begin{sourcedisplay} +\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}\}\{\textred{.75}\} +\end{sourcedisplay} +} + + + +\newcommand{\limitsmath}{% + +\subsubsection{Math in section names} +\limitsmathinsectionnames + +\subsubsection{Rendering tradeoffs} + +Math may be rendered +\margintag{Math rendering} +as \SVG\ graphics or using the \brand{MathJax} JavaScript display engine. +\gindex{JavaScript=\brand{JavaScript}>MathJax=\brand{MathJax}} + +Rendering math as images creates a new \SVG\ file for each expression, \margintag{SVG files} +except that an MD5 hash is used to combine identical duplicates of the same +inline math expression into a single file, which must be converted to \SVG\ only once. +Display math is still handled as individual files, since it may contain labels +or references which are likely to change. + +The \SVG\ images are currently stored separately, \margintag{SVG inline} +but they could be encoded in-line directly into the \HTML\ document. +This may reduce the number of files and potentially speed loading the images, +but slows the display of the rest of the document before the images are loaded. + +Others \LaTeX-to-\HTML\ converters have used \PNG\ files, +\margintag{PNG files} +sometimes pre-scaled for print resolution but displayed +on-screen at a scaled down size. This allows high-quality print output at the expense +of larger files, but \SVG\ files are the preferred approach for scalable graphics. + +Conversion to \MathML\ might be a better approach, +\margintag{MathML} +among other things allowing a more compact representation of math than \SVG\ drawings. +Problems with \MathML\ include limited browser support and some +issues with the fine control of the appearance of the result. +Also see \cref{sec:epub} regarding \EPUB\ output with \brand{MathJax}. + +\subsubsection{\SVG\ option} + +For \SVG\ math, +\margintag{SVG math option} +math is rendered as usual by \LaTeX{} into the initial \PDF\ file using the +\gindex{math>SVG summary}% +\gindex{SVG>math summary}% +current font\footnote{See \cref{sec:xfrac} regarding fonts and fractions.}, +then is captured from the \PDF\ and converted to \SVG\ graphics +via a number of utility programs. +The \SVG\ format is a scalable-vector web format, so math may be typeset by \LaTeX{} +with its fine control and precision, then displayed or printed at any size, +depending on (sometimes broken) browser support. +An \HTML\ \attribute{alt} attribute carries the \LaTeX{} code which generated the +math, allowing copy/paste of the \LaTeX{} math expression into other documents. + +\limitslateximagefontsize + +For \SVG\ math, text copy/paste from the \HTML\ \element{alt} tags lists the +\margintag{SVG math copy/paste} +equation number or tag for single equations, along with the \LaTeX\ code +for the math expression. +For \AmS\ environments with multiple numbers in the same environment, +only the first and last is copy/pasted, as a range. +No tags are listed inside a starred \AmS\ environment, although the \cs{tag} +macro will still appear inside the \LaTeX\ math expression. + +SVG math does not work inside \TeX\ boxes, since a \cs{newpage} is required +\trouble[SVG math in \TeX\ boxes]{math>in \TeX\ boxes} +before and after each image. + +\subsubsection{\brand{MathJax} option} + +The popular \brand{MathJax} alternative (\url{mathjax.org}) may be used to display math. +\margintag{\brand{MathJax} math option} +\DescribeProgram{MathJax} +\gindex{math>MathJax=\brand{MathJax} summary} +\gindex{MathJax=\brand{MathJax}>summary} + +When \brand{MathJax} is enabled, math is rendered twice: +\begin{enumerate} +\item As regular \LaTeX\ \PDF\ output placed inside an \HTML\ comment, allowing +equation numbering and cross referencing to be almost entirely under the control of \LaTeX, and +\item As detokenized printed \LaTeX{} commands placed directly into the \HTML\ output +for interpretation by the \brand{MathJax} display scripts. An additional script is used to +pre-set the equation number format and value according to the current \LaTeX\ values, +and the \brand{MathJax} cross-referencing system is ignored in favor of the \LaTeX\ internal system, +seamlessly integrating with the rest of the \LaTeX\ code. +\end{enumerate} + +\subsubsection{Customizing \brand{MathJax}} +\gindex{MathJax=\brand{MathJax}>custom functions} +\gindex{math>MathJax=\brand{MathJax} custom functions} +\limitscustomizemathjax + +\subsubsection{\brand{MathJax} limitations} +Limitations when using \brand{MathJax} include: +\margintag{\brand{MathJax} limitations} +\DescribeProgram{MathJax} +\begin{itemize} +\item \brand{MathJax} itself does not support subequations. + \margintag{subequations} +\trouble{MathJax=\brand{MathJax}>subequations}% +\trouble{math>subequations}% + This may be improved by parsing the \LaTeX{} + math expression to manually insert tags, but this has not yet been done. +\item Footnotes inside equations are not yet supported while using \brand{MathJax}. + \margintag{footnotes in math} +\item Math appearing inside a lateximage, + \margintag{lateximage} + and therefore also inside a \tikz\ or \env{picture} + environment, is rendered as SVG math even if \brand{MathJax} is used in the rest of the document. +\item Usage of \pkg{siunitx} inside a math equation + \margintag{siunitx} + is supported via a third-party \brand{MathJax} extension. + While inside a math expression, do not use \cs{SI} or \cs{si} inside \cs{text}, + where it will be rendered as normal text. + \trouble[siunitx inside an equation]{siunitx=\pkg{siunitx}>MathJax=\brand{MathJax}} + \trouble{MathJax=\brand{MathJax}>siunitx=\pkg{siunitx}} + + \href{https://github.com/burnpanck/MathJax-siunitx} + {\texttt{https://github.com/burnpanck/MathJax-siunitx}} + + Also see \cref{sec:limitssiunitx}. + +\item A \env{tabbing} environment is emulated + using an \HTML\ \element{pre}.\margintag{tabbing} + While \brand{MathJax} is enabled inside \env{tabbing}, the browser may not correctly + render the horizontal alignment of the math and text following after on the same line. + +\item Other math-related macros and packages are not supported by \brand{MathJax}, + \trouble[other macros and packages]{MathJax=\brand{MathJax}>unsupported packages} + including \cs{ensuremath} and \pkg{bigdelim}, + along with occasionally-used macros such as \cs{relax}. + \pkg{lwarp} emulates footnotes, \pkg{units}, and \pkg{nicefrac} for MathJax. +\end{itemize} +} + +\newcommand{\limitsmathcatcode}{ +The math shift character \texttt{\$} is not set for \HTML\ output until +\margintag{preamble macros with math} +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} +\textred{\cs{StartDefiningMath}} \\ +\cs{newcommand}\{\dots\} \\ +\textred{\cs{StopDefiningMath}} +\end{sourcedisplay} + +As an alternative, use \cs{(} and \cs{)} instead of \texttt{\$}, in which +case \cs{StartDefiningMath} and \cs{StopDefiningMath} are not necessary. + +If a package defines macros using \texttt{\$}, it may be nessary to use +\cs{StartDefiningMath} and \cs{StopDefiningMath} before and after loading the +package. +} + +\newcommand{\limitsmathinline}{ +\DescribeMacro{\inlinemathnormal} +\DescribeMacro{\inlinemathother} +An inline math expression is usually converted to a reusable hashed \SVG\ math +image, or a MathJax expression. The hash or expression depends on the contents +of the math expression. In most cases this math expression is static, such as \texttt{\$x+1\$}, +so the image can be reused for multiples instances of the same expression. +In some cases, +\margintag{changing contents} +the math expression includes a counter or other object which may +change between uses. +Another problem is complicated contents +\margintag{complicated \attribute{alt} tag} +which do not expand well in an \attribute{alt} tag. +The macro \cs{inlinemathother} may be used before a dynamic +math expression, and \cs{inlinemathnormal} after. Doing so tells \pkg{lwarp} to +use an unhashed \SVG\ math image, even if MathJax is in use. +See \cref{sec:localizingdynamicmath}. +} + +\newcommand*{\limitsmathdisplay}{ +\DescribeMacro{\displaymathnormal} +By default, or when selecting \cs{displaymathnormal}, +\brand{Mathjax} math display environments print their contents +as text into \HTML, +and \SVG\ display math environments render their contents as \SVG\ images +and use their contents as the \attribute{alt} tag of \HTML\ output. +To do so, the contents are loaded into a macro for reuse. +In some cases, such as complicated \tikz\ pictures, compilation will fail. + +\DescribeMacro{\displaymathother} +When selecting \cs{displaymathother}, +it is assumed that the contents are more complicated than ``pure'' +math. +An example is an elaborate \tikz\ picture, +\margintag{MathJax unsupported} +which will not render in \brand{MathJax} and +will not make sense as an \HTML\ \attribute{alt} tag. +\margintag{complicated \attribute{alt} tag} +In this mode, \brand{MathJax} is turned off, +math display environments become \SVG\ images, even if \brand{MathJax} is selected, +and the \HTML\ \attribute{alt} tags become simple messages. +The contents are internally processed as an environment instead of a macro argument, +so complicated objects such as \tikz\ pictures are more likely to compile successfully. +} + + +\newcommand{\limitscustomizemathjax}{% +\brand{MathJax} does not have preexisting support every possible math function. +Additional \brand{MathJax} function definitions may be +defined. These will be declared at the start of each \HTML\ page, +and thus will have a global effect. + +Examples: +\begin{sourcedisplay} +\cs{CustomizeMathJax}\{ \\ + \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\}\}\} +\cs{CustomizeMathJax}\{\cs{newcommand}\{\cs{NN}\}\{\cs{mathbb}\{N\}\}\} +\end{sourcedisplay} +} + +%\newcommand{\limitscustomizeKaTeX}{% +%Ka\TeX\ does not have preexisting support every possible math function. +%Additional Ka\TeX\ function definitions may be +%defined. These will be declared at the start of each \HTML\ page, +%and thus will have a global effect. + +%Examples: +%\begin{sourcedisplay} +%\cs{CustomizeKaTeX}\{ \\ + %\fqquad\cs{gdef}\cs{expval}\#1\{\cs{langle}\#1\cs{rangle}\} \\ + %\fqquad\cs{gdef}\cs{abs}\#1]\{\cs{lvert}\#1\cs{rvert}\} \\ +%\} \\ +%\cs{CustomizeKaTeX}\{\cs{gdef}\cs{arsinh}\{\cs{text}\{arsinh\}\}\} \\ +%\cs{CustomizeKaTeX}\{\cs{gdef}\cs{arcosh}\{\cs{text}\{arcosh\}\}\} +%\cs{CustomizeKaTeX}\{\cs{gdef}\cs{NN}\{\cs{mathbb}\{N\}\}\} +%\end{sourcedisplay} +%} + +\newcommand*{\limitsmathinsectionnames}{ +If using named \HTML\ files, +in section names use paren math \texttt{\textbackslash(x+y\textbackslash)} +\trouble[math in section names]{filename>math in} +\trouble{sectioning>math in name} +\trouble{math>section name} +\trouble{math>file name} +instead of dollar math \texttt{\$x+y\$}. +(Dollar math works, but appears in the filename.) +Or, use a short name for the \TOC\ entry without the math, or use \cs{texorpdfstring}: +\begin{sourcedisplay} +\cs{section}\{A name with math \\ + \fqquad \cs{texorpdfstring}\{\$1+2=3\$\}\{text description\}\} +\end{sourcedisplay} +} + +\newcommand{\limitschemfig}{% +If using \cs{polymerdelim} to add delimiters to a \cs{chemfig}, +wrap both inside a single \env{lateximage}: +\begin{sourcedisplay} +\cs{begin}\{lateximage\}[(-chemfig-\textasciitilde\cs{packagediagramname})] \\ +\cs{chemfig}\{\dots\} \\ +\cs{polymerdelim}[\dots]\{\dots\} \\ +\cs{end}\{lateximage\} +\end{sourcedisplay} +} + +\newcommand{\limitschemformula}{% +\pkg{chemformula} works best without \brand{MathJax}. +\trouble[\pkg{chemformula} with \brand{MathJax}]{MathJax=\brand{MathJax}>chemformula=\pkg{chemformula}} +\trouble{chemformula=\pkg{chemformula}>MathJax=\brand{MathJax}} +If \brand{MathJax} is used, +\cs{displaymathother} must be used before \env{array}, and then +\cs{displaymathnormal} may be used after. +(The \pkg{chemformula} package adapts to \env{array}, +but does not know about \brand{Mathjax}, and +\brand{MathJax} does not know about \pkg{chemformula}.) + +While using \brand{Mathjax}, \cs{displaymathother} may also be used +for other forms of display and inline math which contain \pkg{chemformula} expressions. +} + +\newcommand{\limitsntheorem}{% +This conversion is not total. +\trouble[Font control]{ntheorem=\pkg{ntheorem}>font} +Font control is via \CSS, and the custom \LaTeX\ font settings +are ignored. + +\limitsntheoremnumbering +} + +\newcommand{\limitsntheoremnumbering}{% +\pkg{ntheorem} has a bug with equation numbering in \AmS\ environments% +\trouble[Equation numbering]{ntheorem=\pkg{ntheorem}>numbering} +\trouble{math>equation numbering>ntheorem=\pkg{ntheorem}} +\trouble{AMSmath>ntheorem=\pkg{ntheorem}>numbering} +when the option \optn{thref} is used. \pkg{lwarp} does not share +this bug, so equations with \cs{split}, etc, are numbered correctly +with \pkg{lwarp}'s \HTML\ output, but not with the print output. +It is recommended to use \pkg{cleveref} instead of \pkg{ntheorem}'s +\optn{thref} option. +} + +\newcommand{\limitsgraphics}{% +\limitsincludegraphicsscale + +For \cs{includegraphics} with \filenm{.pdf} or \filenm{.eps} files, +\gindex{graphics>formats} +\gindex{includegraphics=\cs{includegraphics}>using} +\gindex{PDF image>using} +\gindex{EPS image>using} +\gindex{image>PDF or EPS>using} +\margintag{\cs{includegraphics} file formats} +the user must provide a \filenm{.pdf} or \filenm{.eps} image file for use +in print mode, and also a \filenm{.svg}, \filenm{.png}, or \filenm{.jpg} version +of the same image for use in \HTML. +\begin{sourcedisplay} +\cs{includegraphics}\{filename\} \% print:.pdf/.eps HTML:.svg, etc. +\end{sourcedisplay} +For print output, \pkg{lwarp} will automatically choose the \filenm{.pdf} or \filenm{.eps} +format if available, or some other format otherwise. +For \HTML, one of the other formats is used instead. + +If a \filenm{.pdf} or \filenm{.eps} image is referred to with its file extension, +the extension will be changed to \filenm{.svg} for \HTML: +\begin{sourcedisplay} +\cs{includegraphics}\{filename.pdf\} \% uses .svg in \HTML \\ +\cs{includegraphics}\{filename.eps\} \% uses .svg in \HTML \\ +\end{sourcedisplay} + +\DescribeProgram{pdftocairo} +\margintag{PDF to SVG} +To convert a \PDF\ image to \SVG, use the utility \prog{pdftocairo}: +\userentry{pdftocairo -svg filename.pdf} +For a large number of images, use \prog{lwarpmk}: +\DescribeProgram{lwarpmk pdftosvg} +\userentry{lwarpmk pdftosvg *.pdf \qquad \textrm{(or a list of filenames)}} + +\DescribeProgram{lwarpmk epstopdf} +\DescribeProgram{epstopdf} +\margintag{\pkg{epstopdf} package} +For \EPS\ images converted to \PDF\ using the package \pkg{epstopdf}, +use \userentry{lwarpmk pdftosvg *.PDF} to convert to \SVG\ images. + +When using \DVI\ \prog{latex}, +\margintag{DVI latex} +it is necessary to convert \EPS\ to \PDF\ and then to \SVG: +\gindex{image>PDF or EPS>converting} +\userentry{lwarpmk epstopdf *.eps\qquad \textrm{(or a list of filenames)}} +\userentry{lwarpmk pdftosvg *.pdf\qquad \textrm{(or a list of filenames)}} + +For \PNG\ or \JPG +\margintag{PNG and JPG} +\gindex{image>PNG and JPG} +\gindex{PNG images} +\gindex{JPG images} +while using \prog{pdflatex}, \prog{lualatex}, or \prog{xelatex}, +the same file may be used in both print or \HTML\ versions, and may be used with a file extension, +but will also be used without the file extension if it is the only file of +its base name. + +GIF files may be used for \HTML, +\margintag{GIF} +\gindex{image>GIF} +\gindex{GIF images} +but another format must also be provided for print output. + +If a file extension is not used, +\margintag{file extension priorities} +\trouble{image>format priorities} +\trouble{graphics>image format priorities} +for \HTML\ the file extension priorities +are: \SVG, \GIF, \PNG, then \JPG. + +If using the older \pkg{graphics} syntax, use both optional arguments +\trouble[\pkg{graphics} vs. \pkg{graphicx}]{graphics>optional arguments} +\trouble{includegraphics=\cs{includegraphics}>optional arguments} +for \cs{includegraphics}. +A single optional parameter is interpreted as the newer \pkg{graphicx} syntax. +Note that viewports are not supported by \pkg{lwarp} \Dash +\trouble[viewport]{graphics>viewport} +\trouble[viewport]{image>viewport} +\trouble{viewport} +the entire image will be shown. + +For \cs{includegraphics}, avoid \texttt{px} and \% units for width and height, or +\margintag{units} +enclose them inside \env{warpHTML} environments. +For font-proportional image sizes, use \texttt{ex} or \texttt{em}. +For fixed-sized images, use +\texttt{cm}, \texttt{mm}, \texttt{in}, \texttt{pt}, or \texttt{pc}. +Use the keys \optn{width=.5\cs{linewidth}}, +or similar for \cs{textwidth} or \cs{textheight} +to give fixed-sized images proportional to a 6 by 9 inch text area. +Do not use the \optn{scale} option, since it is not well supported by \HTML\ browsers. + +\cs{includegraphics} accepts \optn{width} and \optn{height}, +\margintag{options} +\optn{origin}, \optn{rotate} and \optn{scale}, +plus new \optn{class} and \optn{alt} keys. + +With \HTML\ output, \cs{includegraphics} accepts an optional +\margintag{\HTML\ class} +\optn{class=xyz} keyval combination, and if this is given then +the \HTML\ output will include that class for the image. +The class is ignored for print output. + +Likewise, the \cs{includegraphics} \optn{alt} key adds an \HTML\ \attribute{alt} tag to +\margintag{\HTML\ \attribute{alt} tags} +an image, and is ignored for print output. If not assigned, each +image is given an \attribute{alt} tag of ``\optn{(image)}''. + +\cs{rotatebox} accepts the optional \optn{origin} key. +\margintag{\cs{rotatebox}} + +\cs{rotatebox}, \cs{scalebox}, and \cs{reflectbox} depend +\trouble[browser support]{graphics>\cs{rotatebox}, \cs{scalebox}, \cs{reflectbox}} +on modern browser support. +The \CSSthree\ standard declares that when an object is transformed +the whitespace which they occupied is preserved, +unlike \LaTeX{}, so expect some +ugly results for scaling and rotating. +} + +\newcommand*{\limitsincludegraphicsscale}{ +Avoid using the \cs{includegraphics} \optn{scale} option. Change: +\trouble[\optn{scale}]{scale=\optn{scale} (\cs{includegraphics} option)} +\trouble{includegraphics=\cs{includegraphics}>scale=\optn{scale}} +\trouble{graphics>scale=\optn{scale} option} +\begin{sourcedisplay} +\cs{includegraphics}[scale=]\{\,\dots\} +\end{sourcedisplay} to: +\begin{sourcedisplay} +\cs{includegraphics}[width=\textbackslash{linewidth}]\{\,\dots\} +\end{sourcedisplay} +} + +\newcommand{\limitssvgimages}{% +When a math expression, \env{picture}, or \tikz\ environment is added or +\trouble[adding/removing]{SVG image>out of order} +\trouble{graphics>images out of order} +removed, the \SVG\ images must be re-created by entering \cmds{lwarpmk limages} +to maintain the proper image-file associations. +Inline \SVG\ math may be hashed and thus not need to be recreated, but +display math and objects such as \tikz\ may move to new image numbers when +the document is changed. + +Before attempting to create the \SVG\ image files, +\margintag{recompile first} +\prog{lwarpmk} verifies that the \HTML\ version of the document exists and +has correct internal image references.\footnote{This becomes important +when dealing with a document containing thousands of images.} +If it is necessary to recompile the document's \HTML\ version one more time, +\prog{lwarpmk} usually will inform the user with an error message, +but there are some conditions which cannot be detected, so the user +should watch for the \LaTeX\ recompile warnings. + +If \HTML\ appears where an \SVG\ image should be, % +\trouble[\HTML\ instead of images]{image>appears as \HTML\ code}% +\trouble{math>appears as \HTML\ code}% +\trouble{SVG image>appears as \HTML\ code}% +\trouble{image>appears as \HTML\ code}% +\trouble{HTML>image appear as \HTML\ code} + recompile the document one more +time to get the page numbers back in sync, then remake the images one more time. + +Incorrect \SVG\ images will also occur if the document +changes the \progcode{page} counter: +\trouble[page counter]{page counter>SVG images} +\trouble{SVG image>incorrect} +\trouble{math>incorrect} +\trouble{image>incorrect} +\begin{sourcedisplay} +\cs{setcounter}\{page\}\{\} +\end{sourcedisplay} +The \texttt{page} counter must \emph{not} be adjusted by the user. + +Expressing math as \SVG\ images has the advantage of representing +the math exactly as \LaTeX\ would, but has the disadvantage of requiring +an individual file for each math expression. +\watchout[Lots of files!] +For inline math, and some other objects, \pkg{lwarp} uses an MD5 hash +on its \LaTeX\ source to combine multiple instances of identical inline expressions +into a single image file, +but display math and other environments such as \env{picture} and \tikz\ require +one image file each. +For a document with a large amount of math, +see \cref{sec:tutorialmathjax} to use \brand{MathJax} instead. +} + +\newcommand{\limitstikz}{% +If using display math with \env{tikzpicture} or \cs{tikz}, along +\trouble[displaymath and matrices]{tikz>matrices, \&} +with matrices with the \texttt{\&} character, the document must be modified as follows: +\begin{sourcedisplay} +\cs{usepackage}\{tikz\} \\ +\cs{tikzset}\{every picture/.style=\{ampersand replacement=\textbackslash\&\}\} \\ +\end{sourcedisplay} +and each instance of \texttt{\&} in the \pkg{tikz} expression must be +replaced with \texttt{\textbackslash\&}.\ +} + +\newcommand{\limitsgrffile}{% +\pkg{grffile} is supported as-is. +File types known to the browser are displayed, and unknown file types are given a link. +Each \PDF\ image for print mode should be accompanied +\trouble[matching \PDF\ and \SVG]{grffile=\pkg{grffile}} +by an \SVG, \PNG, or \JPG\ version for \HTML. +} + +\newcommand{\limitscolor}{% +\pkg{color} is superceded by \pkg{xcolor}, and +\pkg{lwarp} requires several of the features of \pkg{xcolor}. +When \pkg{color} is requested, \pkg{xcolor} is loaded as well. +} + +\newcommand{\limitsxcolor}{% +\cs{colorboxBlock} and \cs{fcolorboxBlock} are provided for +\margintag{\cs{colorboxBlock} and \cs{fcolorboxBlock}} +increased \HTML\ compatibility, and they are identical to +\cs{colorbox} and \cs{fcolorbox} in print mode. In \HTML\ mode +they place their contents into a \element{div} instead of a \element{span}. +These \element{div}s are set to \attribute{display:~inline-block} so +adjacent \cs{colorboxBlock}s appear side-by-side in \HTML, although +text is placed before or after each. + +Print-mode definitions for \cs{colorboxBlock} and \cs{fcolorboxBlock} +are created by \pkg{lwarp}'s core if \pkg{xcolor} is loaded. + +\cs{fcolorbox} and \cs{fcolorboxBlock} allow a background color of \optn{none}, +\margintag{background: \optn{none}} +in which case only the frame is drawn, which can be useful for \HTML. + +Color definitions, models, and mixing are fully supported +\margintag{color support} +without any changes required. + +\cs{rowcolors} is supported, except that the optional argument is ignored so far. +\margintag{colored tables} + +\cs{textcolor}, \cs{colorbox}, and \cs{fcolorbox} are supported. +\margintag{colored text and boxes} + +\cs{color} and \cs{pagecolor} are ignored. +Use \CSS\ or \cs{textcolor} where possible. +\margintag{\cs{color} and \cs{pagecolor}} +} + +\newcommand{\limitsepstopdf}{% +Images with an \filenm{.eps} extension will be converted to \filenm{.pdf}. +The \HTML\ output uses the \filenm{.svg} version, so +\trouble[convert to \filenm{.svg}]{epstopdf=\pkg{epstopdf}} +use \userentry{lwarpmk pdftosvg } to generate \filenm{.svg} versions. +} + +\newcommand{\limitspstricks}{% +All \pkg{pstricks} content should be +\trouble[use \env{pspicture}]{pstricks=\pkg{pstricks}} +contained inside a \env{pspicture} environment. +} + +\newcommand{\limitspdftricks}{% +The \pkg{pdftricks} image files \filenm{-fig*.pdf} must be converted +\trouble[convert image files]{pdftricks=\pkg{pdftricks}} +to \filenm{.svg}, or else a missing file error will occur. +The image files must also be converted again whenever they change. +To convert the images:\userentry{lwarpmk pdftosvg -fig*.pdf} +} + +\newcommand{\limitspsfrag}{% +The \env{psfrags} environment is modified to use \env{lateximage} to encapsulate +\watchout[use \env{psfrags}] +the image. +Always use a \env{psfrags} environment to contain any local \cs{psfrag} macros and +the associated \cs{includegraphics} or \cs{epsfig} calls. +Outside of a \env{psfrags} environment, \pkg{psfrags} adjustments will not be seen +by \pkg{lwarp}. + +Tip: Use a mono-spaced font for the tags in the \EPS\ file. +\watchout +} + +\newcommand{\limitspstool}{% +\cs{graphicspath} is ignored, and the file directory must be stated. + +The filename must not have a file extension. +\trouble[path and filename]{pstool=\pkg{pstool}} + +Use \userentry{lwarpmk html} followed by \userentry{lwarpmk limages}. +} + +\newcommand{\limitsasymptote}{% +To compile: +\begin{sourcedisplay} +pdflatex project.tex \\ +asy project-*.asy \\ +pdflatex project.tex \\ [\baselineskip] +lwarpmk print \\ +asy project-*.asy \\ +lwarpmk print1 \\ +lwarpmk print1 \\[\baselineskip] +lwarpmk html \\ +asy project\textred{\_html}-*.asy \\ +lwarpmk html1 \\ +lwarpmk html1 \\ +\textred{lwarpmk limages} \\ +\end{sourcedisplay} +} + +\newcommand{\limitsoverpic}{% +The macros \cs{overpicfontsize} and \cs{overpicfontskip} are used during +\trouble[scaling]{overpic=\pkg{overpic}} +\HTML\ generation. These are sent to \cs{fontsize} to adjust the font +size for scaling differences between the print and \HTML\ versions of the +document. Renew these macros before using the \env{overpic} and \env{Overpic} +environments. +} + +\newcommand*{\limitsmultimedia}{% +The packages \pkg{multimedia}, \pkg{movie15}, and \pkg{media9} are supported. + +\HTMLfive\ \element{audio} and \element{video} objects are created for +\filenm{.mp3} and \filenm{.mp4} files. + +\HTMLfive\ \element{embed} objects are created for \filenm{http} and \filenm{ftp} links. + +\cs{href} links are created for other media types. +(Unfortunately, there is not much overlap between the file types supported for print +output and the file types supported by \HTMLfive.) + +For \pkg{media9}, a multimedia object is inserted for each \optn{addresource=}, +as well as each \optn{flashvars} \optn{source=} and \optn{src=}. +This may result in duplicate objects. + +Undesired objects may be nullified by placing them inside \cs{warpprintonly} +or the \env{warpprint} environment. + +Each \HTML\ multimedia object includes the poster text, except for \element{embed} objects. +For \pkg{movie15}, the \optn{text} option is supported to specify the poster text. + +The \optn{width}, \optn{height}, and \optn{totalheight} options are supported. +The \HTML\ object is scaled according to the display width, correctly compensating +for either tall or wide viewports. + +Other options are ignored. + +\pkg{media9} \cs{addmediapath} is supported. It is assumed that the same path +structure will exist for the \HTML\ document. + +\HTMLfive\ media controls are always specified for each \element{audio} +and \element{video} object. + +\pkg{media9} slideshows are not supported. + +\cs{hyperlinkmovie}, \cs{movieref}, and \cs{mediabutton} are not supported. + +3D objects are not supported. + +If using a \brand{YouTube}\texttrademark\ video, use an ``embedded'' \URL\ with \dots\texttt{/embed/}\dots\ +instead of \dots\texttt{/v/}\dots +} + +\newcommand{\limitstabbing}{% +The \env{tabbing} environment works, except that \SVG\ math and \env{lateximage}s +do not yet work inside the environment. + +If math is used inside \env{tabbing}, +\trouble[math in \env{tabbing}]{tabbing=\env{tabbing}>math} +\trouble{math>tabbing=\env{tabbing}} +place \env{tabbing} inside +a \env{lateximage} environment, which will render the entire environment as +a single \SVG\ image. +} + +\newcommand{\limitstabular}{% +Tabular mostly works as expected, but pay special attention to the +following, especially if working with environments, macros inside tabulars, +multirows, \pkg{siunitx} \texttt{S} columns, +or the packages \pkg{multirow}, \pkg{longtable}, \pkg{supertabular}, or \pkg{xtab}. +\begin{description} +\item [Defining macros and environments:] \ + \begin{itemize} + \item When defining environments or macros which include \env{tabular} and + \trouble[Misplaced alignment tab character \&]% + {Misplaced alignment tab character \&>tabular>macros} + \trouble{tabular>Misplaced alignment tab character \&>macros} + instances of the \texttt{\&} character, it may be + necessary to make \texttt{\&} active before the environment or macro is defined, + then restore \texttt{\&} to its default catcode after, using the following commands. + These are are ignored in print mode. + \begin{sourcedisplay} + \textred{\cs{StartDefiningTabulars}} \\ + \\ + \textred{\cs{StopDefiningTabulars}} + \end{sourcedisplay} + This includes before and after defining any macro + \trouble[floatrow]{floatrow=\pkg{floatrow}>ttabbox=\cs{ttabbox}} + which used \cs{ttabbox} from \pkg{floatrow}. + \item \limitsresumetabular + \end{itemize} + +\item [Cell contents:] \ + \begin{itemize} + \item Using a custom macro inside a tabular data cell + \trouble[macro in a table]{tabular>macro inside} + \trouble{tabular>row corruption} + \gindex{tabular>macros inside} + may result in an extra \HTML\ data cell tag, corrupting the \HTML\ table. + To avoid this, use \cs{TabularMacro} just before the macro. + This is ignored in print mode. + \begin{sourcedisplay} + \textred{\cs{TabularMacro}}\cs{somemacro} \& + more row contents \textbackslash\textbackslash + \end{sourcedisplay} + \end {itemize} + +\item [Column specifiers:] \ + \begin{itemize} + \item Only one each of \texttt{@} and \texttt{!} + \margintag{\texttt{@} and \texttt{!}} + is used at each column, and they are used in that order. + + \item In \cs{multirow} cells, the print version may have extra + \margintag{\cs{multirow}} + instances of \texttt{\textless}, \texttt{\textgreater}, \texttt{@}, + and \texttt{!} cells on the second and later rows in the \cs{multirow} + which do not appear in the \HTML\ version. + + \item \cs{newcolumntype} is ignored; unknown column types are set to \texttt{l}. + \trouble[\cs{newcolumntype}]{tabular>newcolumntype=\cs{newcolumntype}} + \end{itemize} + +\item [Rules:] \ + \begin{itemize} + \item Doubled \cs{hline}s, \cs{midrule}s, and vertical rules are supported. + + \item Vertical rules next to either side of an \texttt{@} or \texttt{!} column + \margintag{vertical rules} + are displayed on both sides of the column. + + \item Width options are honored. Trim options are converted to + \margintag{width and trim} + rounded top corners. + Trim corners are not rounded with \texttt{@} or \texttt{!} columns, + and full-width rules ignore trim. + + \item \cs{toprule}, \cs{midrule}, \cs{bottomrule}, and \cs{hline} + \margintag{full-width rules} + ignore trim. When given an optional width, each cell is styled + to create the custom border. Without an optional width, the entire + row is given a class to assign the standard border. + + \item If you wish to use \cs{cmidrule} followed by \cs{bottomrule}, + \margintag{combined rules} + it may be necessary to use: + \begin{sourcedisplay} + \cs{cmidrule}\{2-3\} \textbackslash\textbackslash[-2ex] \\ + \cs{bottomrule} + \end{sourcedisplay} + The optional \texttt{-2ex} is ignored in \HTML, but improves the + visual formatting in the print output. + + \item For \cs{toprule} and \cs{bottomrule}, + \trouble[\cs{warpprintonly}]{Misplaced \cs{noalign}>tabular>rules} + \trouble{tabular>rules} + when combined with a \env{warpprint} or \env{warpHTML} environment, + \trouble[Misplaced \cs{noalign}]{tabular>Misplaced \protect\cs{noalign}}% + if a ``Misplaced \cs{noalign}'' error occurs, + change + \begin{sourcedisplay} + This \& That \cs{endhead} + \end{sourcedisplay} + to + \begin{sourcedisplay} + \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. + \end{itemize} + +\needspace{3\baselineskip} +\item[Other:] \ + \begin{itemize} + \item \pkg{tabularx} ignores the width, but \texttt{X} columns do produce paragraph + columns or multicolumns. + \item For \pkg{longtable}, place headings and footings which + \margintag{\env{longtable} headings} + do not apply to \HTML\ inside \cs{warpprintonly\{\}}. + \item For S columns (from the \pkg{siunitx} package), + \trouble[S columns]{siunitx=\pkg{siunitx}>S column} + \trouble{tabular>S column} + while producing print output, + anything non-numeric must be placed + inside \{ \} braces, including commands such as \cs{multirow}. + While producing \HTML\ output, though, anything placed inside + braces is not seen by \pkg{lwarp}'s tabular handling algorithm. + 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 \& \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\}} + \item In \LaTeX, a \env{tabular} may be placed inside a \env{minipage}, + \watchout[\env{tabular} inside a \element{span}] + but in \HTML\ a \element{table} may not be inside a \element{span}. + If this situation is detected, a warning is printed instructing the user + to isolate the \element{span} using \cs{warpprintonly} or the \env{warpprint} + environment. + \end{itemize} +\end{description} +} + +\newcommand*{\limitsmultirow}{% +\begin{itemize} + \item Note that recent versions of \pkg{multirow} include a new optional + \margintag{\optn{vposn}} + \optn{vposn} argument. + \item For \pkg{multirow}, insert \cs{mrowcell} into any empty multi-row cells. + \margintag{multirow cells} + This will be a null function for the print output, and is a placeholder for + parsing the table for \HTML\ output. An error is generated if this is missed. + \begin{sourcedisplay} + \small + \begin{tabular}{lll} + \dots\ \& & \cs{multirow}\{2\}\{.5in\}\{text\} & \&\ \dots \\ + \dots\ \& & \textred{\cs{mrowcell}} & \&\ \dots \\ + \end{tabular} + \end{sourcedisplay} + \item The \pkg{multirow} documentation regarding colored cells recommends using + \margintag{colored cells} + a negative number of rows. This will not work with \pkg{lwarp}, so + \cs{warpprintonly} and \cs{warpHTMLonly} must be used to make versions for + print and \HTML. + \item + See \cref{sec:multicolumnmultirow} for \cs{multicolumrow}. + \margintag{with \cs{multicolumn}} + + \pkg{lwarp} does not support + \trouble[\cs{multicolumn} \& \cs{multirow}]{multirow=\cs{multirow} and \cs{multicolumn}} + directly combining \cs{multicolumn} and \cs{multirow}. + Use \cs{multicolumnrow} instead. + To create a 2 column, 3 row cell: + \begin{sourcedisplay} + \cs{multicolumnrow}% + \textcolor{blue}{\{2\}\{c\}}% + \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, + followed by the contents. + + As per \cs{multirow}, + \watchout[skipped cells] + skipped cells to the right of the \cs{multicolumnrow} + statement are not included in the source code on the same line. + On the following lines, \cs{mcolrowcell} must be used for each cell + \watchout[empty cells] + of each column and each row to be skipped. + An error is generated if this is missed. + \begin{sourcedisplay} + \small + \begin{tabular}{lll} + \dots\ \& & \cs{multicolumnrow}\{2\}\{c\}[c]\{3\}[0]\{1in\}[0pt]\{Text\} & \&\ \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} +\end{itemize} +} + + +\newcommand{\limitsresumetabular}{% +When creating a new environment +\trouble[\env{tabular} inside another environment]{tabular>inside an environment} +\trouble{tabular>corrupt rows} +which contains a \env{tabular} environment, +\pkg{lwarp}'s emulation of the tabular does not automatically resume +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} +\textred{\cs{StartDefiningTabulars}} \% because \& is used in a definition \\ +\cs{newenvironment}\{outerenvironment\} \\ +\{ \\ +\cs{tabular}\{cc\} \\ +left \& right \textbackslash\textbackslash \\ +\} \\ +\{ \\ +\textred{\cs{TabularMacro}\cs{ResumeTabular}} \\ +left \& right \textbackslash\textbackslash \\ +\cs{endtabular} \\ +\} \\ +\textred{\cs{StopDefiningTabulars}} \\ +\end{sourcedisplay} +} + +\newcommand{\limitslongtable}{% +Use one of either \cs{endhead} or \cs{endfirsthead} for both print and \HTML, +and use a \cs{warpprintonly} macro to disable the other head phrase, +and also the \cs{endfoot} and \cs{endfirstfoot} phrases. +(See \cref{sec:limitsthreeparttablex} if using \pkg{threeparttablex}.) +\trouble{tabular>endhead=\cs{endhead}, \cs{endfoot}, \cs{endlastfoot}} +\begin{sourcedisplay} +\cs{begin}\{longtable\}\{ [column specifiers] \} \\ +{[} \dots ] \cs{endfirsthead} \quad \textgreen{\% or \cs{endhead}, for print and HTML} \\ +\textred{\cs{warpprintonly}\{} \qquad\qquad \textgreen{\% not used in HTML} \\ +\fquad [ \dots ] \cs{endhead} \qquad \textgreen{\% or \cs{endfirsthead}} \\ +\fquad [ \dots ] \cs{endfoot} \\ +\fquad [ ] \cs{endlastfoot} \\ +\textred{\}} \\ +\dots\ \textblue{table contents} \dots \\ +\textred{\cs{warpHTMLonly}\{} \\ +\fquad {[} ] \quad \textgreen{\% HTML last footer, without \cs{endfoot} \\ +\hspace*{\fill} \% or \cs{endlastfoot}.} \\ +\textred{\}} \\ +\cs{end}\{longtable\} +\end{sourcedisplay} + +Use the \cs{warpprintonly} macro instead of the \env{warpprint} environment. +\trouble[Misplaced \cs{noalign}]{Misplaced \cs{noalign}} +Doing so helps avoid ``Misplaced \cs{noalign}.'' when using \cs{begin}\{warpprint\}. + +\cs{kill} is ignored, place a \cs{kill} line inside +\trouble[\cs{kill}]{tabular>kill=\cs{kill}} + \begin{sourcedisplay} + \cs{begin}\{warpprint\} \ldots\ \cs{end}\{warpprint\} + \end{sourcedisplay} +or place it inside \cs{warpprintonly}. + +\pkg{longtable} is not supported inside a \env{lateximage}.% +\watchout[lateximage] +} + +\newcommand{\limitsthreeparttablex}{% +\pkg{threeparttablex} is used with \pkg{longtable} and \pkg{booktabs} as follows: +\begin{sourcedisplay} +\cs{begin}\{longtable\}\{ [column specifiers] \} \\ +{[} \dots ] \cs{endfirsthead} \quad \textgreen{\% or \cs{endhead}, for print and HTML} \\ +\textred{\cs{warpprintonly}\{} \qquad\qquad \textgreen{\% not used in HTML} \\ +\fquad [ \dots ] \cs{endhead} \qquad \textgreen{\% or \cs{endfirsthead}} \\ +\fquad [ \dots ] \cs{endfoot} \\ +\fquad \textblue{\cs{bottomrule} \cs{insertTableNotes} \cs{endlastfoot}} \\ +\textred{\}} \\ +\dots\ \textblue{table contents} \dots \\ +\textred{\cs{warpHTMLonly}\{} \quad \textgreen{\% HTML last footer} \\ +\fquad \textblue{\cs{bottomrule}} \\ +\fquad \textblue{\cs{UseMinipageWidths}} \qquad \textgreen{\% optional} \\ +\fquad \textblue{\cs{insertTableNotes}} \\ +\fquad \textblue{\cs{endlastfoot}} \\ +\textred{\}} \\ +\cs{end}\{longtable\} +\end{sourcedisplay} + +The table notes are created using a \cs{multicolumn}. +\margintag{table width} +By default the width is not specified to the browser, so long table notes +can cause the table to be spread out horizontally. +For \HTML\ output, \pkg{lwarp} guesses the width of the table depending on +the number of columns, then restricts its guess to a min/max range. +To use this guess for the width of the table notes, use \cs{UseMinipageWidths} before +\cs{insertTableNotes}. The width is then specified, and in many cases the result is +an improvement in overall table layout. +} + +\newcommand{\limitssupertabular}{% +For \cs{tablefirsthead}, etc., enclose them as follows: +\trouble[Misplaced alignment tab character \&]% + {Misplaced alignment tab character \&>supertabular=\pkg{supertabular}} +\begin{sourcedisplay} +\textred{\cs{StartDefiningTabulars}} \\ +\cs{tablefirsthead} \\ +\dots \\ +\textred{\cs{StopDefiningTabulars}} +\end{sourcedisplay} +See \cref{sec:limitstabular}. + +\pkg{supertabular} and \pkg{xtab} are not supported +inside a \env{lateximage}.\watchout[lateximage] +} + +\newcommand{\limitsbigdelim}{% +\cs{ldelim} and \cs{rdelim} use \cs{multirow}, so +\trouble[use \cs{mrowcell}]{bigdelim=\pkg{bigdelim}} +\cs{mrowcell} must be used in the proper number of empty cells in the +same column below \cs{ldelim} or \cs{rdelim}, but not in cells which +are above or below the delimiter: +\begin{sourcedisplay} +\hrule\smallskip +\cs{begin}\{tabular\}\{lll\} \\ +\textgreen{} \& a \& b \textbackslash\textbackslash \\ +\cs{ldelim}\{\textbackslash\{\}\{3\}\{.25in\}[left ] \& c \& d \textbackslash\textbackslash \\ +\textred{\cs{mrowcell}} \& e \& f \textbackslash\textbackslash \\ +\textred{\cs{mrowcell}} \& g \& h \textbackslash\textbackslash \\ +\textgreen{} \& i \& j \textbackslash\textbackslash \\ +\cs{end}\{tabular\} +\smallskip\hrule +\begin{tabular}{lll} +\textgreen{<->} & a & b \\ +\ldelim{\{}{3}{.25in}[left ] & c & d \\ +\mrowcell & e & f \\ +\mrowcell & g & h \\ +\textgreen{<->} & i & j \\ +\end{tabular} +\hrule +\end{sourcedisplay} +} + +\newcommand{\limitscolortbl}{% +Only use \cs{rowcolor} and \cs{cellcolor} at the start of a row, +in that order. +\trouble[row/cell color]{colortbl=\pkg{colortbl}} + +\pkg{colortbl} ignores the overhang arguments. +} + +\newcommand{\limitsctable}{% +Use \cs{StartDefiningTabulars} before one or more \cs{ctable}s, +\trouble[Misplaced alignment tab character \&]% + {Misplaced alignment tab character \&>ctable=\pkg{ctable}} +and \cs{StopDefiningTabulars} after. These change the meaning of the +ampersand \texttt{\&} character. +} + + +\newcommand{\limitsmakelabel}{% +While inside a list environment, \pkg{lwarp} nullifies a number of +\TeX\ horizontal skip and fill commands, allowing the user to define +\cs{makelabel} for print mode while \HTML\ mode ignores those commands. + +When defining \cs{makelabel} in a \env{list} environment, use +\trouble[label font]{lists>label formatting} +\trouble{makelabel=\cs{makelabel}} +\cs{textbf} etc. instead of \cs{bfseries}. +} + +\newcommand{\limitslists}{% +} + +\newcommand{\limitsmarginpars}{% +\DescribeMacro{\marginpar} \oarg{left} \marg{right} +\qquad +\trouble{marginpar=\cs{marginpar}} +\cs{marginpar} may contains paragraphs, but in order to remain inline with +the surrounding text \pkg{lwarp} nullifies block-related macros inside the +\cs{marginpar}. Paragraph breaks are converted to \element{br /} tags. + +\DescribeMacro{\marginparBlock} \oarg{left} \marg{right} +\qquad +To include block-related macros, use \cs{marginparBlock}, which takes the +same arguments but creates a \element{div} instead of a \element{span}. +A line break will occur in the text where the \cs{marginBlock} occurs. +} + +\newcommand{\limitssaveboxes}{% +\trouble{boxes} +\trouble{HTML>corrupted} +\trouble{savebox=\cs{savebox}} +\trouble{sbox=\cs{sbox}} +\trouble{lrbox=\env{lrbox}} +\trouble{usebox=\cs{usebox}} +\TeX\ boxes are placed inline and do not allow line breaks, so boxes +\watchout[boxes] +with long contents may overflow the line during \HTML\ conversion. +\pkg{lwarp} uses methods which help avoid this problem. + +\cs{savebox} and related do not (yet) support \env{minipage} or \cs{parbox}. +\watchout[\env{minipage}, \cs{parbox}] +} + +\newcommand{\limitsminipage}{% +A line of text with an inline \env{minipage} +\trouble[inline]{minipage>inline} +or \cs{parbox} will have the \env{minipage} or \cs{parbox} placed onto its own line, +because a paragraph is a block element and cannot be made \attribute{inline-block}. + +\env{minipage}s and \cs{parbox}es will be placed side-by-side in \HTML\ +\margintag{placement} +unless you place a \cs{newline} between them. + +Side-by-side \env{minipage}s may be separated by \cs{quad}, \cs{qquad}, \cs{enskip}, +\margintag{side-by-side} +\cs{hspace}, \cs{hfill}, or a \cs{rule}. +When inside a \env{center} environment, the result is +similar in print and \HTML. Paragraph tags are suppressed between +side-by-side \env{minipage}s and these spacing commands, but not at the start or end +of the paragraph. + +There is limited support for \env{minipage}s inside an \HTML\ \element{span}. +\trouble[minipage in a span]{minipage>in a span} +An \HTML\ \element{div} cannot appear inside a \element{span}. +While in a \element{span}, \env{minipage}s, and \cs{parbox}es, and any enclosed lists +have limited \HTML\ tags, resulting in an ``inline'' format, without markup +except for \HTML\ breaks. +Use \cs{newline} or \cs{par} for an \HTML\ break. + +When using \cs{linewidth}, \cs{textwidth}, and \cs{textheight}, +\trouble[minipage size]{minipage>size} +widths and heights in \HTML\ are scaled proportionally to a 6\texttimes{}9 inch text area, +and inside a \env{multicols} \cs{linewidth} is divided by the specified number +of columns. + +If a \env{minipage} or \cs{parbox} is assigned a width of exactly \cs{linewidth}, +\margintag{if width is \cs{linewidth}} +in \HTML\ it is automatically given no \HTML\ width, +thus allowed to fill the line as needed, similar to how it appears in print output. + +A new macro \cs{minipagefullwidth} requests +\margintag{full-width if \HTML} +that, during \HTML\ output, the next single \env{minipage} or \cs{parbox} be generated +without an \HTML\ \attribute{width} attribute, allowing it to be the full width of +the display rather than the declared print-output width. This may be useful where +the printed version's width makes no sense in \HTML. + +Inside a \env{tabular} or \env{multicols} environment, +\trouble[\env{tabular}, \env{multicols}]{minipage>tabular=\env{tabular}, width in} +\trouble{minipage>multicols=\env{multicols}, width in} +where the width depends on the browser window, +\cs{minipagefullwidth} is effectively used by default for +every \env{minipage} or \cs{parbox} inside the environment. +\DescribeMacro{\UseMinipageWidths} +\DescribeMacro{\IgnoreMinipageWidths} +\cs{UseMinipageWidths} may be used to tell \pkg{lwarp} to honor the specified +widths of all following \env{minipage}s and \cs{parboxes} until the end +of the local scope, and \cs{IgnoreMinipageWidths} may be used to tell \pkg{lwarp} to +ignore the specified widths. + +Nested \env{minipage}s adopt their parent's text alignment in \HTML, +\trouble[text alignment]{minipage>alignment} +whereas in regular \LaTeX{} \PDF\ output they do not. +Use a \env{flushleft} or similar environment in the child \env{minipage} +to force a text alignment. +} + +\newcommand{\limitsfancybox}{% +\pkg{fancybox}'s documentation has an example \env{FramedEqn} environment +\margintag{framed equation example} +which combines math, \cs{Sbox}, a \env{minipage}, and an \cs{fbox}. +This combination requires that the entire +environment be enclosed inside a \env{lateximage}, which is done by +adding \cs{lateximage} at the very start of \env{FramedEqn}'s beginning code, and +\cs{endlateximage} at the very end of the ending code. +Unfortunately, the \HTML\ \attribute{alt} attribute is not used here. +\begin{sourcedisplay} +\cs{newenvironment}{FramedEqn} \\ +\{ \\ +\cs{lateximage}\% NEW \\ +\cs{setlength}\{\cs{fboxsep}\}\{15pt\} \\ +\dots\}\{\dots\\ +\cs{[}\cs{fbox}\{\cs{TheSbox}\}\cs{]} \\ +\cs{endlateximage}\% NEW \\ +\} +\end{sourcedisplay} + +\cs{fbox} works with \pkg{fancybox}. +\margintag{framing alternatives} +Also see \pkg{lwarp}'s \cs{fboxBlock} macro and \env{fminipage} environment for +alternatives to \cs{fbox} for framing environments. + +The \pkg{fancybox} documentation's example framed table +\margintag{framed table example} +using an \cs{fbox} containing a \env{tabular} +does not work with \pkg{lwarp}, but the \env{FramedTable} environment does work if +\cs{fbox} is replaced by \cs{fboxBlock}. This method loses \HTML\ formatting. +A better method is to enclose the table's contents inside a \env{fminipage} environment. +The caption may be placed either inside or outside the \env{fminipage}: +\begin{sourcedisplay} +\cs{begin}\{table\}\\ +\cs{begin}\{fminipage\}\{\cs{linewidth}\}\\ +\cs{begin}\{tabular\}\{lr\}\\ +\dots \\ +\cs{end}\{tabular\}\\ +\cs{end}\{fminipage\}\\ +\cs{end}\{table\}\\ +\end{sourcedisplay} + +\pkg{lwarp} does not support the \env{verbatim} environment inside a span, box, +\trouble[framed verbatim]{verbatim>framed} +or \pkg{fancybox}'s \cs{Sbox}, but a \env{verbatim} may be placed inside +a \env{fminipage}. The \pkg{fancybox} documentation's example \env{FramedVerb} +may be defined as: +\begin{sourcedisplay} +\cs{newenvironment}\{FramedVerb\}[1] \% width\\ +\{\\ +\fquad\cs{VerbatimEnvironment}\\ +\fquad\cs{fminipage}\{\#1\}\\ +\fquad\cs{begin}{Verbatim}\\ +\}\{\\ +\fquad\cs{end}{Verbatim}\\ +\fquad\cs{endfminipage}\\ +\} +\end{sourcedisplay} + + +\pkg{fancybox}'s \cs{VerbBox} may be used inside \cs{fbox}. +\margintag{framed \cs{VerbBox}} + +\env{LVerbatim}, \cs{LVerbatimInput}, and \cs{LUseVerbatim} indent with horizontal +\margintag{indented alignment} +space which may not line up exactly with what \prog{pdftotext} detects. +Some lines may be off slightly in their left edge. +} + +\newcommand{\limitsmdframed}{% +Most basic functionality is supported, including +\margintag{support} +frame background colors and single-border colors and thickness, +title and subtitle background colors and borders and thickness, +border radius, and shadow. +CSS classes are created for \pkg{mdframed} environments and frame titles. + +When used, \pkg{lwarp} loads \pkg{mdframed} in \HTML\ with \optn{framemethod=none}. +\watchout[loading] + +For title font, use +\margintag{font}% +\begin{sourcedisplay} +frametitlefont=\cs{textbf}, +\end{sourcedisplay} +instead of +\begin{sourcedisplay} +frametitlefont=\cs{bfseries}, +\end{sourcedisplay} +where \cs{textbf} must appear just before the comma and will receive the +following text as its argument (since the text happens to be between braces +in the \pkg{mdframed} source). +Since \pkg{lwarp} does not support \cs{bfseries} and friends, +only one font selection may be made at a time. + +\optn{theoremtitlefont} is not supported, since the following text is not +\margintag{theoremtitlefont} +in braces in the \pkg{mdframed} source. + +\optn{userdefinedwidth} and \optn{align} are currently ignored. +\margintag{ignored options} + +Environments created or encapsulated by \pkg{mdframed} are enclosed in a +\margintag{\CSS\ classes} +\element{div} of class \attribute{mdframed}, and also +class \attribute{md} for new environments. + +Frame titles are placed in a \element{div} of class |mdframedtitle|. +Subtitles are in a \element{div} of class |mdframedsubtitle|, +and likewise for subsubtitles. +} + +\newcommand{\limitscaption}{% +To pass options to caption, select the options before loading \pkg{lwarp}: +\trouble[options]{caption=\pkg{caption}>options} +\begin{sourcedisplay} +\cs{documentclass}\{article\} \\ +\dots \\ +\cs{PassOptionsToPackage}\{options\_list\}\{caption\} \\ +\dots \\ +\cs{usepackage\{lwarp\}} \\ +\dots \\ +\cs{usepackage\{caption\}} +\end{sourcedisplay} + +To ensure proper float numbering, set caption positions +such as: +\trouble[numbering]{caption=\pkg{caption}>numbering} +\trouble{subcaption=\pkg{subcaption}>numbering} +\begin{sourcedisplay} +\cs{captionsetup}[figure]\{position=bottom\} \\ +\cs{captionsetup}[subfigure]\{position=bottom\} \\ +\cs{captionsetup}[table]\{position=top\} \\ +\cs{captionsetup}[subtable]\{position=top\} +\end{sourcedisplay} +Similarly for \pkg{longtable}. +These positions depend on where the user places the \cs{caption} command +inside each float. +} + +\newcommand{\limitscombiningfloats}{% +If using \cs{newfloat}, \pkg{trivfloat}, and/or +\pkg{algorithmicx} together, see \cref{sec:combiningfloats}. +\watchout[package conflicts] +} + +\newcommand{\limitssubfig}{% +% At present, subfigures before the enclosing figure/table's \cs{caption} +% \margintag{LOF/LOT} +% would appear in the List of Figures/Tables before the enclosing figure/table, +% therefore \pkg{lwarp} does not place subfigures in the LOF/LOT. + +At present, the package options for \optn{lofdepth} and \optn{lotdepth} +\trouble[\optn{lof/lotdepth}]{subfig=\pkg{subfig}>options} +are not working. These counters must be set separately after the +package has been loaded. + +In the document source, use \cs{hfill} and \cs{hspace*} +\trouble{horizontal spacing}{subfig>inline} +between subfigures to spread them +apart horizontally. The use of other forms of whitespace may +cause paragraph tags to be generated, resulting in subfigures +appearing on the following lines instead of all on a single line. +} + +\newcommand{\limitsfloatalignment}{% +\cs{centering}, etc. are honored in a \env{figure} or \env{table} if +\trouble[\env{figure} \& \env{table} alignment]{float>alignment} +they are the first command inside the float: +\begin{sourcedisplay} +\cs{begin}\{table*\} \\ +\cs{centering} \\ +\cs{caption}\{A Table\} \\ +\dots +\end{sourcedisplay} +} + +\newcommand{\limitsfloatrow}{% +Use \cs{StartDefiningTabulars} and \cs{StopDefiningTabulars} before and after +\trouble[Misplaced alignment tab character \&]% + {Misplaced alignment tab character \&>floatrow=\pkg{floatrow}} +defining macros using \cs{ttabbox} with a tabular inside. +See \cref{sec:limitstabular}. + +When combined with the \pkg{subfig} package, +\trouble[\pkg{subfig} package]{floatrow>with \pkg{subfig}} +\trouble{subfig=\pkg{subfig}>with \pkg{floatrow}} +while inside a \env{subfloatrow} \cs{ffigbox} and \cs{ttabbox} +must have the caption in the first of the two of the mandatory arguments. + +The emulation of \pkg{floatrow} does not support \cs{FBwidth} or \cs{FBheight}. +These values are pre-set to \texttt{.3\cs{linewidth}} and \texttt{2in}. +\trouble[\cs{FBwidth}, \cs{FBheight}]{floatrow>\cs{FBwidth} and \cs{FBheight}} +Possible solutions include: +\begin{itemize} +\item Use fixed lengths. \pkg{lwarp} will scale the \HTML\ lengths appropriately. +\item Use \env{warpprint} and \env{warpHTML} environments to select appropriate + values for each case. +\item Inside a \env{warpHTML} environment, manually change + \cs{FBwidth} or \cs{FBheight} before the \cs{ffigbox} or \cs{ttabbox}. + Use \cs{FBwidth} or \cs{FBheight} normally afterwards; it will be used as + expected in print output, and will use your custom-selected value in \HTML\ + output. This custom value will be used repeatedly, + until it is manually changed to a new value. +\end{itemize} +} + +\newcommand{\limitskeyfloat}{% +\trouble{keyfloat=\pkg{keyfloat}} +If placing a \cs{keyfig}\optn{[H]} inside a \env{keywrap}, +\watchout[\env{keywrap}] +use an absolute width for +\cs{keyfig}, instead of \optn{lw}-proportional widths. +(The \optn{[H]} option forces the use of a minipage, which internally adjusts for +a virtual 6-inch wide minipage, which then corrupts the \optn{lw} option.) +} + +\newcommand{\limitssiunitx}{% +Due to \prog{pdftotext} limitations, fraction output is replaced by symbol +\margintag{fractions} +output for \optn{per-mode} and \optn{quotient-mode}. + +Some units will require that the expression be placed inside math mode. +\trouble[math mode required]{siunitx=\pkg{siunitx}} + +\trouble{siunitx>MathJax=\brand{MathJax}} +\trouble{MathJax=\brand{MathJax}>siunitx=\pkg{siunitx}} +\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. +See \cs{MathJaxFilename} to select a custom MathJax script.} + +Tabular \texttt{S} columns are rendered as simple \texttt{c} columns, +\trouble[\env{tabular}]{siunitx=\pkg{siunitx}>tabular S and s columns} +and tabular \texttt{s} columns are not supported. +These may be replaced by \texttt{c} columns with each cell contained in +\cs{num} or \cs{si}. +} + +\newcommand{\limitsnicefrac}{% +\trouble{nicefrac=\pkg{nicefrac}} +\trouble{units=\pkg{units}} +\pkg{units} and \pkg{nicefrac} work with \pkg{lwarp}, but +\brand{MathJax} does not have an extension for \pkg{units} or \pkg{nicefrac}. +These packages do work with \pkg{lwarp}'s option \optn{svgmath}. +} + + +% \newcommand{\limitsbabelone}{% +% If using \pkg{babel} with French, use +% \watchout[French]% +% \begin{sourcedisplay} +% \cs{frenchbsetup\{StandardLists=true\}} +% \end{sourcedisplay} +% to preserve the special \HTML\ and list handling. +% } + +\newcommand{\limitsbabeltwo}{% +When French is used, the caption separator is +\trouble[\cs{CaptionSeparator}]{babel=\pkg{babel}>French} +changed to a dash. The following may be used to restore it to a colon: +\begin{sourcedisplay} +\cs{renewcommand}*\{\cs{CaptionSeparator}\}\{:\textasciitilde\} +\end{sourcedisplay} + +Also when French is used, +\margintag{punctuation spaces} +\pkg{lwarp} creates fixed-width space around punctuation by patching +\cs{FBcolonspace}, \cs{FBthinspace}, +\cs{FBguillspace}, \cs{FBmedkern}, \cs{FBthickkern}, \cs{FBtextellipsis}, +and the tilde. +If the user's document also changes these parameters, +\watchout[customized spacing] +the user's changes +should be placed inside a \env{warpprint} environment so that the user's +changes do not affect the \HTML\ output. +} + +\newcommand{\limitspolyglossia}{% +\trouble{Undefined control sequence>polyglossia=\pkg{polyglossia}} +\trouble{polyglossia=\pkg{polyglossia}>Undefined control sequence} +\pkg{lwarp} uses \pkg{cleveref}, which has some limitations when using +\pkg{polyglossia}, possibly resulting in the error +\begin{sourcedisplay} +!~Undefined control sequence. \dots\ \cs{@begindocumenthook} +\end{sourcedisplay} + +To test compatibility, add +\begin{sourcedisplay} +\cs{usepackage}\{cleveref\} +\end{sourcedisplay} +near the end of the preamble (as the last package to be loaded), +and try to compile the print version. +It may be necessary to set +\begin{sourcedisplay} +\cs{setdefaultlanguage}\{english\} +\end{sourcedisplay} +or some other language supported by \pkg{cleveref}, then select +other languages using \cs{setotherlanguages}. + +Once the print version works with \pkg{cleveref} and \pkg{polyglossia}, +the \HTML\ version should work as well using \pkg{lwarp}. +} + +\newcommand{\limitsnewclude}{% +\pkg{newclude} modifies \cs{label} in a non-adaptive way, so +\pkg{newclude} must be loaded before \pkg{lwarp} is loaded: +\trouble[loading]{newclude=\pkg{newclude}} +\begin{sourcedisplay} +\raggedright +\cs{documentclass\{article\}} \\ +\ldots \\ +\cs{usepackage\{newclude\}} \\ +\cs{usepackage[warpHTML]\{lwarp\}} \\ +\ldots +\end{sourcedisplay} +} + +\newcommand{\limitstodonotes}{% +\trouble{todonotes=\pkg{todonotes}} +The documentation for \pkg{todonotes} and \pkg{luatodonotes} have an +example with a todo inside a caption. If this example does not work +it will be necessary to move the todo outside of the caption. +} + +\newcommand{\limitsfixme}{% +External layouts (\cs{fxloadlayouts}) are not supported. +\trouble[external layouts]{fixme=\pkg{fixme}} + +User control is provided for setting the \HTML\ styling of the ``faces''. +The defaults are as follows, and may be changed in the preamble after +\pkg{fixme} is loaded: +\begin{sourcedisplay} +\cs{def}\cs{FXFaceInlineHTMLStyle}\{font-weight:bold\} \\ +\cs{def}\cs{FXFaceEnvHTMLStyle}\{font-weight:bold\} \\ +\cs{def}\cs{FXFaceSignatureHTMLStyle}\{font-style:italic\} \\ +\cs{def}\cs{FXFaceTargetHTMLStyle}\{font-style:italic\} +\end{sourcedisplay} +\bigskip +} + +\newcommand{\limitsxparse}{% +\trouble{xparse=\pkg{xparse}} +To remove from the log any warnings about redeclaring objects, +place the following before \pkg{lwarp} is loaded: +\begin{sourcedisplay} +\cs{usepackage}[log-declarations=false]\{xparse\} +\end{sourcedisplay} +} + +\newcommand{\limitsnewtxmath}{% +The proper load order is: +\trouble[loading sequence]{newtxmath=\pkg{newtxmath}} +\begin{sourcedisplay} +\textrm{\dots} \\ +\cs{usepackage}\{lwarp\} \\ +\textrm{\dots} \\ +\cs{usepackage}\{amsthm\} \\ +\cs{usepackage}\{newtxmath\} \\ +\textrm{\dots} \\ +\end{sourcedisplay} +} + + +% For use in the documentation update section: +\newcommand*{\newlwarpmkconf}{ +Due to changes in \prog{lwarpmk}, +\watchout[Reset the configuration] +\textred{recompile any existing project a single time} +using \cmds{pdflatex filename.tex} or similar, after which +\prog{lwarpmk} may then be used with the new configuration files. +} + + +\newcommand*{\describehashing}{% +If starred, a hashed filename is used.\margintag{image filename hashing} +\gindex{hash>SVG image filename} +\gindex{filename>hashed} +\gindex{image>hashed filename} +\gindex{MD5 hash>SVG image filename} +If so, the hash is based on the \attribute{alt} tag and also the additional hashing argument. + +This may be used to provide an expression with a simple \attribute{alt} tag +but also enough additional information to provide a unique hash. + +An example is when the expression is a complicated \TeX\ expression, which would not +copy/paste well. A simplified tag may be used, while the complicated expression is +duplicated in the additional hashing argument. + +Another example is when the expression is simple, but the image depends +on options. These options may be decoded into text form and +included in the additional hashing argument in order to make the hash +unique according to the set of options, even if the simple \attribute{alt} tag +is still the same. +} + + +\newcommand{\osportabilityusage}{% +\trouble{operating system} +\trouble{Mac OS=\brand{Mac OS}} +\trouble{Linux=\brand{Linux}} +\trouble{Unix=\brand{Unix}} +\pkg{lwarp} tries to detect which operating system is being used. +\DescribeProgram{Unix}\DescribeProgram{Mac OS}\DescribeProgram{Linux} +\brand{Unix}~/ \brand{Mac~OS}~/ \brand{Linux} is the default +(collectively referred to as ``\brand{Unix}'' in the configuration files), +and \brand{MS-Windows} is supported as well. + +\trouble{MS-Windows=\brand{MS-Windows}} +\trouble{Windows=\brand{Windows}} +If \brand{MS-Windows} is not correctly detected, +\DescribeProgram{MS-Windows} \DescribeProgram{Windows} +use the \pkg{lwarp} option \optn{OSWindows}. +\DescribeOption{OSWindows} + +When detected or specified, the operating-system path separator used by \pkg{lwarp} +is modified, and the boolean \texttt{usingOSWindows} is set \texttt{true}. +This boolean may be tested by the user for later use. +} + + +\setlength{\marginparsep}{1em} +\setlength{\marginparpush}{.7ex} +\setlength{\IndexMin}{40ex} + +\setcounter{IndexColumns}{2} + +\DisableCrossrefs +\CodelineIndex +\RecordChanges +\begin{document} + \DocInput{lwarp.dtx} +\end{document} +% +% +% \fi +% +% +% \iffalse +%<*package> +% \fi +% +% \CheckSum{33109} +% +% \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 +% Lower-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 +% Digits \0\1\2\3\4\5\6\7\8\9 +% Exclamation \! Double quote \" Hash (number) \# +% Dollar \$ Percent \% Ampersand \& +% Acute accent \' Left paren \( Right paren \) +% Asterisk \* Plus \+ Comma \, +% Minus \- Point \. Solidus \/ +% Colon \: Semicolon \; Less than \< +% Equals \= Greater than \> Question mark \? +% Commercial at \@ Left bracket \[ Backslash \\ +% Right bracket \] Circumflex \^ Underscore \_ +% Grave accent \` Left brace \{ Vertical bar \| +% Right brace \} Tilde \~} + +% +% \changes{v0.10}{2016/03/08}{\ 2016/03/08 Initial version} +% \changes{v0.11}{2016/03/11}{\ 2016/03/11} +% \changes{v0.11}{2016/03/10}{Test Suite: limages and index in README.txt} +% \changes{v0.11}{2016/03/11}{Test Suite: \brand{MS-Windows} in README.txt} +% \changes{v0.12}{2016/03/14}{\ 2016/03/14} +% \changes{v0.12}{2016/03/14}{Global: Uses \textbackslash{}p@(type) in float captions.} +% \changes{v0.12}{2016/03/14}{Test Suite: Sub-figures} +% \changes{v0.13}{2016/03/24}{\ 2016/03/24} +% \changes{v0.13}{2016/03/23}{Test Suite: Ordinals, Subcaption} +% \changes{v0.13}{2016/03/24}{Removed package: subfig} +% \changes{v0.14}{2016/03/31}{\ 2016/03/31} +% \changes{v0.14}{2016/03/29}{Test Suite: Assigned cleveref name for Test Float.} +% \changes{v0.14}{2016/03/31}{Test Suite: Floatrow} +% \changes{v0.15}{2016/04/06}{\ 2016/04/06} +% \changes{v0.15}{2016/03/31}{Files: lwarp\_formal.css added.} +% \changes{v0.15}{2016/03/31}{Test Suite: test\_suite\_formal.css file added.} +% \changes{v0.16}{2016/04/11}{\ 2016/04/11} +% \changes{v0.16}{2016/04/07}{Test Suite: Supports XeLaTeX, LuaLaTeX.} +% \changes{v0.16}{2016/04/08}{Test Suite: Lwarp no longer selects fonts.} +% \changes{v0.16}{2016/04/08}{Removed package: suffix} +% \changes{v0.17}{2016/04/14}{\ 2016/04/14} +% \changes{v0.17}{2016/04/14}{Test Suite: Mdframed} +% \changes{v0.17}{2016/04/14}{Test Suite: Fix: Print-version front-matter page numbers.} +% \changes{v0.18}{2016/05/19}{\ 2016/05/19} +% \changes{v0.18}{2016/04/23}{Files: lwarp.css and lwarp\_formal.css: Improved responsive design.} +% \changes{v0.18}{2016/04/23}{File: lwarp.css: Improved \TOC\ outline display.} +% \changes{v0.18}{2016/05/13}{Test Suite: Verse package} +% \changes{v0.19}{2016/06/08}{\ 2016/06/08} +% \changes{v0.19}{2016/05/25}{File: \filenm{lwarp_mathjax.txt} added.} +% \changes{v0.19}{2016/06/01}{File: \filenm{lwarp.css}: \attribute{tnoteitemheader} added.} +% \changes{v0.20}{2017/02/09}{\ 2017/02/09} +% \changes{v0.20}{2016/06/27}{Test Suite: \HTML\ meta descriptions.} +% \changes{v0.20}{2016/09/19}{File: lwarp.css: Minor fixes for validation.} +% \changes{v0.20}{2016/12/08}{Docs: Improved index.} +% \changes{v0.20}{2016/12/17}{File: lwarpmk used to compile print, \HTML, indexes, and lateximages.} +% \changes{v0.20}{2016/12/17}{Removed reliance on make, grep, gawk.} +% \changes{v0.20}{2016/12/17}{Parallel versions of aux files for print/HTML.} +% \changes{v0.20}{2017/01/03}{Moved sidebar and example code to test suite.} +% \changes{v0.20}{2017/01/25}{\pkg{caption} and \pkg{subcaption} supported.} +% \changes{v0.21}{2017/02/23}{\ 2017/02/23} +% \changes{v0.22}{2017/03/02}{\ 2017/03/02} +% \changes{v0.23}{2017/03/02}{\ 2017/03/02} +% \changes{v0.24}{2017/03/15}{\ 2017/03/15} +% \changes{v0.25}{2017/03/22}{\ 2016/03/22} +% \changes{v0.25}{2017/03/16}{Docs: Adds credits for patched code.} +% \changes{v0.26}{2017/03/31}{\ 2017/03/31} +% \changes{v0.27}{2017/04/04}{\ 2017/04/04} +% \changes{v0.28}{2017/04/14}{\ 2017/04/14} +% \changes{v0.29}{2017/04/15}{\ 2017/04/15} +% \changes{v0.30}{2017/04/29}{\ 2017/04/29} +% \changes{v0.31}{2017/05/15}{\ 2017/05/15} +% \changes{v0.32}{2017/06/09}{\ 2016/06/09} +% \changes{v0.33}{2017/07/10}{\ 2017/07/10} +% \changes{v0.34}{2017/08/08}{\ 2017/08/08} +% \changes{v0.34}{2017/07/25}{File: \filenm{README.txt}: updated.} +% \changes{v0.34}{2017/07/25}{Docs: Horizontal space limitations.} +% \changes{v0.35}{2017/08/08}{\ 2017/08/08} +% \changes{v0.36}{2017/08/15}{Source: Improved formatting.} +% \changes{v0.36}{2017/08/17}{\ 2017/08/17} +% \changes{v0.37}{2017/08/19}{\ 2017/08/19} +% \changes{v0.38}{2017/08/27}{\ 2017/08/27} +% \changes{v0.39}{2017/09/05}{\ 2017/09/05} +% \changes{v0.40}{2017/09/25}{\ 2017/09/25} +% \changes{v0.41}{2017/10/07}{\ 2017/10/07} +% \changes{v0.42}{2017/10/30}{\ 2017/10/30} +% \changes{v0.43}{2017/11/08}{\ 2017/11/08} +% \changes{v0.44}{2017/11/22}{\ 2017/11/22} +% \changes{v0.45}{2018/01/14}{\ 2018/01/14} +% \changes{v0.46}{2018/01/23}{\ 2018/01/23} +% \changes{v0.47}{2018/01/30}{\ 2018/01/30} +% \changes{v0.48}{2018/02/14}{\ 2018/02/14} +% \changes{v0.49}{2018/02/19}{\ 2018/02/19} +% \changes{v0.50}{2018/03/03}{\ 2018/03/03} +% \changes{v0.51}{2018/03/24}{\ 2018/03/24} +% \changes{v0.52}{2018/04/01}{\ 2018/04/01} +% \changes{v0.53}{2018/04/01}{\ 2018/04/01} +% \changes{v0.54}{2018/04/22}{\ 2018/04/22} +% \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.} +% \changes{v0.59}{2018/09/07}{\ 2018/09/07} +% \changes{v0.60}{2018/09/19}{\ 2018/09/19} +% \changes{v0.61}{2018/10/13}{\ 2018/10/13} +% \changes{v0.62}{2018/11/19}{\ 2018/11/19} +% \changes{v0.63}{2018/12/03}{\ 2018/12/03} +% \changes{v0.64}{2018/12/08}{\ 2018/12/08} +% \changes{v0.65}{2018/12/22}{\ 2018/12/22} +% \changes{v0.66}{2019/02/08}{\ 2019/02/08} +% \changes{v0.67}{2019/02/23}{\ 2019/02/23} +% \changes{v0.68}{2019/03/05}{\ 2019/03/05} +% \changes{v0.69}{2019/03/21}{\ 2019/03/21} +% \changes{v0.70}{2019/04/03}{\ 2019/04/03} +% \changes{v0.71}{2019/04/29}{\ 2019/04/29} +% \changes{v0.72}{2019/06/08}{\ 2019/06/08} +% \changes{v0.73}{2019/07/11}{\ 2019/07/11} + + + +% \GetFileInfo{lwarp.sty} +% +% \DoNotIndex{\newcommand,\renewcommand,\addtocounter,\begin,\end,\begingroup,\endgroup} +% \DoNotIndex{\global,\ifbool,\ifthenelse,\isequivalentto,\let} +% \DoNotIndex{\booltrue,\boolfalse} +% \expandafter\DoNotIndex\expandafter{\detokenize{\(,\),\,,\\,\#,\$,\%,\^,\_,\~,\ ,\&,\{,\}}} +% +% +% \thispagestyle{empty} +% \newgeometry{margin=1in} +% +% \begin{center} +% \includegraphics[width=.3\linewidth]{lwarp_logo.pdf} +% +% {\Huge The \pkg{lwarp} package} +% +% {\Large \LaTeX\ to \HTML} +% +% \fileversion{} \Dash \filedate +% +% {\small\textcopyright{} 2016--2019} Brian Dunn\\ \small \texttt{bd@BDTechConcepts.com} +% +% \end{center} +% +% \begin{abstract} +% \noindent +% The \pkg{lwarp} package converts \LaTeX\ to \HTML\ by using \LaTeX\ to process the +% user's document and directly generate \HTML\ tags. External utility programs are only +% used for the final conversion of text and images. Math may be represented +% by \SVG\ images or MathJax. Hundreds of \LaTeX\ packages are supported. +% +% Documents may be produced by \DVI\ or \PDF\ \LaTeX, Lua\LaTeX, \XeLaTeX; +% by several CJK engines, classes, and packages; +% or by customized systems such as \pkg{perltex} and \pkg{pythontex}. +% A \prog{texlua} script automates compilation, index, +% glossary, and batch image processing, and also supports \prog{latexmk}. +% Configuration is semi-automatic at the first manual compile. Support files +% are self-generated. Print and \HTML\ versions of each document may coexist. +% +% Assistance is provided for \HTML\ import into \EPUB\ conversion software and +% word processors. +% +% Requirements include the commonly-available \brand{Poppler} utilities +% (included with \brand{MiKTeX}) and \brand{Perl}. +% Detailed installation instructions are included for each of the +% major operating systems and \TeX\ distributions. +% +% A quick-start tutorial is provided, as well as extensive documentation +% for special cases, a general index, and a troubleshooting index. +% Automatic error testing is provided for configuration files, package load order, +% and image generation. +% +% \SVG\ math and many other generated images +% include \LaTeX\ expressions in the \attribute{alt} tags. +% \brand{MathJax} may be used with advanced equation numbering +% under the direct control of \pkg{lwarp}. +% +% Complicated tables are supported, which copy/paste well into \brand{LibreOffice Writer}. +% +% Supported classes and packages include \pkg{memoir} and \pkg{koma-script}, +% \pkg{cleveref}, \pkg{caption}, \pkg{mdframed}, \pkg{siunitx}, +% and many popular packages for tabulars, floats, graphics, theorems, the title page, +% bibliography, indexing, footnotes, and editorial work. +% +% \TeX\ is a self-modifying tokenized macro-expansion language. +% Since \pkg{lwarp} is written directly in \LaTeX, it is able to interpret the document's +% meaning at a deeper level than external conversions which merely approximate \TeX. +% \HTML5 and \CSS3 are leveraged to provide advanced features such as +% \pkg{booktabs} trim, multicolumns, side-by-side minipages, and +% \brand{JavaScript}-free navigation. +% +% ^^A The \pkg{lwarp} package allows \LaTeX\ to directly produce \HTMLfive\ output, +% ^^A using external utility programs only for the final conversion of text and images. +% ^^A Math may be represented by \SVG\ files or \brand{MathJax}. +% +% ^^A Documents may be produced by pdf\LaTeX, \LuaLaTeX, or \XeLaTeX. +% ^^A A \prog{texlua} script removes the need for system utilities such as \prog{make} and \prog{gawk}, +% ^^A and also supports \prog{xindy} and \prog{latexmk}. Configuration is automatic at the +% ^^A first manual compile. +% +% ^^A Print and \HTML\ versions of each document may coexist, each with its own +% ^^A set of auxiliary files. Support files are self-generated on request. +% ^^A Assistance is provided for import into \EPUB\ conversion software and word processors. +% +% ^^A A modular package-loading system uses the \pkg{lwarp} version of a package for +% ^^A \HTML\ when available. +% ^^A More than 300 \LaTeX\ packages are supported with these +% ^^A high-level source-compatibility replacements, and many others work as-is. +% +% ^^A A tutorial is provided to quickly introduce the user to the major components +% ^^A of the package. +% +% \end{abstract} +% +% \begin{center} +% \setlength{\parskip}{1ex} +% \color{blue} +% For a list of supported features, see \cref{tab:supported}: \nameref{tab:supported}. +% +% To update existing projects, see \cref{sec:updates}: \nameref{sec:updates}. +% +% \color{red!30!black}\bfseries +% \pkg{Lwarp} is still in development. Changes are likely. +% +% \end{center} +% +% \begin{description} +% \footnotesize +% \item[License:] \ +% +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2005/12/01 or later. +% \end{description} +% +% +% +% \clearpage +% \phantomsection +% +% \restoregeometry +% +% \section*{Support \protect\TeX\ development} +% \addcontentsline{toc}{section}{Support \protect\TeX\ development} + +% \label{sec:supportinglatex} +% \changes{v0.42}{2017/10/30}{Docs: Added support page.} +% +% \begingroup +% \setlength{\parindent}{0em} +% \setlength{\parskip}{2ex} +% +% \TeX\ and related projects: +% \begin{itemize}[nosep] +% \item are mostly open-sourced and a volunteer effort; +% \item benefit students, academics, scientists, engineers, and businesses; +% \item help drive education, public and private research, and commercial activity; +% \item are used in the fields of mathematics, science, engineering, and humanities; +% \item are international in reach; +% \item span decades of development; +% \item are enduring \Dash many older packages are still actively used and maintained; +% \item are largely backwards compatible; +% \item are portable across all the major computing platforms; +% \item are usable even on older computers and away from internet access; +% \item are continuing to maintain relevance with modern improvements; +% \item require no yearly subscription fees; +% \item and are supported by an active community of knowledgeable volunteers. +% \end{itemize} +% +% Please consider helping by joining and/or contributing to the \TeX\ Users Group, +% a United States 501(c)(3) tax-exempt charitable organization. +% Contributions are accepted by credit card, check, or Pay Pal, via the United Way, +% or by USA or European bank transfer. +% Membership in TUG supports the development of \TeX{}Live, the major \TeX\ distribution. +% +% Donations may be directed towards individual projects: +% \begin{description}[nosep] +% \item[TUG Bursary Fund:] Assistance for attending annual TUG meetings. +% \item[CTAN:] The Comprehensive \TeX\ Archive Network \Dash Central storage for \TeX. +% \item[TeX Development Fund:] Support for specific projects. +% \item[EduTeX:] Teaching and using \TeX\ in schools and universities. +% \item[GUST e-foundry fonts:] Enhanced for math and additional language groups. +% \item[LaTeX Project:] Modernizing the \LaTeX\ core. +% \item[Libre Font Fund:] Fonts, tools (FontForge), and distribution (the Open Font Library). +% \item[LuaTeX:] Combining the pdf\TeX\ engine and the Lua language. +% \item[MetaPost:] Postscript graphics. +% \item[MacTeX:] \TeX\ for Mac. +% \item[PDF Accessibility:] Modern \PDF\ standards. +% \item[Other:] Additional projects may be specified. +% \end{description} +% +% 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}} +% +% \endgroup +% +% \clearpage +% +% +% \tableofcontents +% +% \clearpage +% \phantomsection +% +% +% \listoffigures +% \listoftables +% +% +% \thispagestyle{pageheadfoot} +% +% \clearpage +% +% \section{Updates} +% \label{sec:updates} +% +% ^^A *updates +% +% The following is a summary of updates to \pkg{lwarp}, +% highlighting new features and any special changes which must be made due +% to improvements or modifications in \pkg{lwarp} itself. +% +% For a detailed list of the most recent changes, +% see the end of the Change History on page \pageref{sec:changesend}. +% +% \begin{description} +% \needspace{2\baselineskip} +% \item[v0.73:] \cs{include}, \pkg{memoir}, \pkg{koma-script}, \pkg{caption}, +% \pkg{xy}, \pkg{datatool}, music scores. +% \begin{itemize} +% \item Fix for \cs{include}. +% \item Warning for a \env{tabular} inside a \element{span}. +% \item \cs{color}: Added \HTML\ support for rules and frames, +% but not inline text. Use \cs{textcolor} if possible. +% \item Improved many \HTML\ tags, reducing \prog{tidy} warnings. See Change History. +% \item \pkg{memoir}: Fixes for \cs{frontmatter*} and \cs{mainmatter*}. +% Added \cs{book}. +% \margintag{packages} +% \item \pkg{koma-script}: Fix for starred captions in the \TOC. +% \item \pkg{caption}: Fix for starred captions. +% \item \pkg{datatool}: Added pie, bar, and plot charts. +% \item \pkg{threeparttable}: Added \env{measuredfigure}. +% \item \pkg{intopdf}: Updated to v0.2.1. +% \item \pkg{tocdata}: Updated to v2.03. +% \item \pkg{quotchap}: Updated to v1.2. +% \item \pkg{versonotes}: Updated to v0.4. +% \item \pkg{backnaur}: Now uses \SVG\ images. Updated to v3.1. +% \item \pkg{xy}: Fix for \cs{xybox}, improved \env{xy}, also now compatible with \pkg{qcircuit}. +% \item \pkg{fancyvrb}: Fix for label \HTML\ tags. +% \item Added \pkg{stackengine}. +% \item Added \pkg{lyluatex}. (Music scores.) +% \margintag{music} +% \item \pkg{musicography}: Updated to 2019/05/28. +% Added support for \env{lateximage}s. +% \end{itemize} +% \needspace{2\baselineskip} +% \item[v0.72:] Font control, \cs{multicolumn}, \pkg{xr} and \pkg{xr-hyper}. +% \begin{itemize} +% \item Due to internal changes, images for inline \SVG\ math and \env{lateximage}s +% \watchout[images] +% will have new hash values, and will have to be regenerated using +% \userentry{lwarpmk cleanlimages} and +% \userentry{lwarpmk limages} +% \item Docs: Color-codes package names in the table of supported packages +% and features, \cref{tab:supported}, according to each package's level +% of support by \pkg{lwarp}. +% \item \cs{multicolumn}: Fix for paragraph columns. +% \item \pkg{xr}, \pkg{xr-hyper}: Fixes for references, \cs{externaldocument}. +% \margintag{packages} +% \item \pkg{soulutf8}: Fix: Loads \pkg{soul} for emulation. +% \item \pkg{boxedminipage2e}: Added support for \env{lateximage}s. +% \item \pkg{zhlineskip}: Updated to v1.0e. +% \item Added \pkg{fontaxes}, \pkg{slantsc}, \pkg{tabfigures}. +% \item Added \pkg{nfssext-cfr}, thus supporting \pkg{cfr-lm} and +% several other font packages. +% \item Added \pkg{backnaur}, \pkg{hypbmsec}, \pkg{minibox}, \pkg{pdfcrypt}, +% \pkg{shapepar}. +% \end{itemize} +% \needspace{2\baselineskip} +% \item[v0.71:] Error handling, multimedia, \env{tabular}. +% \begin{itemize} +% \item \env{tabular}: Added support for `\texttt{*}' columns. +% Fix for paragraph tags. +% \item \env{quotation}: Fix for \HTML\ tag. +% \item Docs: Added a section about error conditions tested by \pkg{lwarp}. +% See \cref{sec:errortestingmessages}. +% \item \prog{lwarpmk}: If file \filenm{lwarpmk.conf} is an older version, +% or the incorrect operating system, +% displays the print command to use to recompile. +% \item \pkg{chemfig}: Updated for v1.4. +% \margintag{packages} +% \item \pkg{endfloat}: Updated for v2.7. +% \item \pkg{textpos}: Updated for v1.9.1. +% \item Added \pkg{media9}, \pkg{movie15}, \pkg{multimedia}. +% \margintag{multimedia} +% \end{itemize} +% \needspace{2\baselineskip} +% \item[v0.70:] Error handling, \brand{MathJax}, \pkg{mathtools}. +% \begin{itemize} +% \item Error handling for ``Label(s) changed.'' +% Refuses to \cmds{lwarpmk limages} until recompile first. +% \item Fix: If Computer Modern font is used, ensures \pkg{cm-super} or \pkg{lmodern} +% is used. +% \item Fixes for \cs{makebox}. +% \item Fixes for \cs{parbox} inside a \element{span}. +% \item MathJax: Updated to v2.7.5. Loads the \filenm{autoload-all.js} extension. +% Added \cs{MathJaxFilename} to select custom scripts. +% \item \pkg{textcomp}, \pkg{xunicode}: Fix for \cs{textinterrobang}. +% \margintag{packages} +% \item \pkg{mhchem}: Works with \brand{MathJax}. See \cref{sec:mhchem}. +% \item \pkg{changes}: Updated to v3.1.2. +% \item Added \pkg{autonum}, \pkg{changelayout}, \pkg{inputtrc}, \pkg{mathtools}, \pkg{metalogox}. +% \end{itemize} +% \needspace{2\baselineskip} +% \item[v0.69:] Error handling, many fixes, improved \pkg{keyfloat} \Slash \pkg{tocdata}. +% \begin{itemize} +% \item Fix for \HTML\ corruption of \env{lateximage} displays. +% \item \cs{makebox}, \cs{framebox}: Fix for \parg{width,height} arguments. +% \item \env{fminipage}: Honors \cs{minipagefullwidth}. +% \item \pkg{array}, \pkg{longtable}: Fix for \cs{tabularnewline}. +% \margintag{packages} +% \item \pkg{tabularx}, \pkg{tabulary}: Fix to require the \pkg{array} package. +% \item \pkg{supertabular}, \pkg{xtab}: Fix to clear caption after use. +% \item \pkg{graphics}: Added a warning if used the \cs{includegraphics} +% \optn{scale} option. +% \item \pkg{multirow}: Added an error if didn't use +% \cs{mrowcell} or \cs{mcolrowcell} when using \cs{multirow} or +% \cs{multicolumnrow}. +% \item \pkg{keyfloat}: Updated for v2.00, additional improvements. +% \item Added \pkg{ctable}, \pkg{eqlist}, \pkg{eqparbox}, \pkg{ftcap}, +% \pkg{listliketab}, \pkg{minitoc}, \pkg{tocdata}, \pkg{topcapt}. +% \end{itemize} +% \needspace{2\baselineskip} +% \item[v0.68:] Error handling, tabulars, footnotes. +% \begin{itemize} +% \item \prog{lwarpmk}: Improved error handling for image generation if +% \margintag{\prog{lwarpmk}} +% compile was incomplete. +% \item \env{tabular}: Fix for \cs{warpprintonly}. +% \item \pkg{longtable}: Improved flexibility for \cs{endhead}, etc. +% \margintag{packages} +% Improved error reporting if \cs{endhead}, etc. incorrect for \pkg{lwarp}. +% \item \pkg{threeparttable}: Fix for caption type. +% \item \pkg{hyperref}: Fix for options with braces. +% \item \pkg{morefloats}: Fix to be loaded early for print output. +% \item \pkg{listings}: Updated for v1.7. +% \item Added \pkg{bigfoot}, \pkg{fnpara}, \pkg{footnotebackref}, \pkg{manyfoot}, +% \pkg{tablefootnote}, \pkg{threeparttablex}. +% \item Added \pkg{layouts}, \pkg{niceframe}, +% \pkg{perpage}, \pkg{showtags}. +% \item Prevented \pkg{alg}, \pkg{algorithmic}, \pkg{pdfcprot}, \pkg{fncylab}. +% \end{itemize} +% \needspace{2\baselineskip} +% \item[v0.67:] Filename generation, symbol fonts. +% \begin{itemize} +% \item Documentation fix for \filenm{-images}, \filenm{-images.txt}. +% \margintag{docs} +% \item Added discussion regarding section names. See \cref{sec:limitssectionnames}. +% \item Added \cs{FilenameNullify} and \cs{FilenameSimplify} for filename +% \margintag{filenames} +% generation. See \cref{sec:limitssectionnames}. +% \item Core, \pkg{textcomp}, \pkg{xunicode}: Nullified additional +% symbols during filename generation. +% \item \pkg{color}: Fix for version number warnings. +% \margintag{packages} +% \item Added \pkg{academicons}, \pkg{bbding}, \pkg{dingbat}, \pkg{eurosym}, +% \pkg{fontawesome}, \pkg{fontawesome5}, \pkg{marvosym}, \pkg{pifont}, +% \pkg{typicons}. +% \item Added \pkg{changes}, +% \pkg{easyReview}, \pkg{fitbox}, \pkg{foreign}, \pkg{gloss}, +% \pkg{karnaugh-map}, \pkg{multicap}, \pkg{nomencl}, \pkg{notes}, +% \pkg{struktex}, \pkg{umoline}, \pkg{xfakebold}. +% \item Tested to work as-is with \pkg{askmaps}, \pkg{curves}, \pkg{euro}, +% \pkg{karnaughmap}, \pkg{tikz-karnaugh}. +% \end{itemize} +% \needspace{2\baselineskip} +% \item[v0.66:] \pkg{xr}, multiple projects, image names/directory, \HTML\ formatting +% \begin{itemize} +% \item \newlwarpmkconf +% \item Adds options \optn{ImagesDirectory} and \optn{ImagesName} +% \margintag{\env{lateximage}} +% to assign directory and name prefixes for \env{lateximage} images. +% The new defaults include the jobname, allowing the image directories for +% multiple projects to coexist. +% \item To reuse existing \filenm{lateximage} directories, add \pkg{lwarp} options +% \watchout[existing projects] +% \begin{sourceverb} +% \usepackage[ +% ImagesDirectory={lateximages}, +% ImagesName={lateximage-} +% ]{lwarp} +% \end{sourceverb} +% If not reused, the existing \filenm{lateximages} directory and +% \filenm{lateximages.txt} file may be removed. +% \item Added \cs{FilenameLimit} to control the maximum length of the +% \margintag{filenames} +% filenames generated by \pkg{lwarp}. +% \item Improved filename generation +% \watchout[Possible filename changes] +% when special characters or macros are used in section names. +% \item Fix for \cmds{lwarpmk cleanlimages} with \brand{Windows}. +% \margintag{\brand{Windows}} +% \item Fixes for floats in the home page. +% \margintag{floats} +% \item Improved \CSS\ for definition lists, table notes. +% \margintag{lists, table notes} +% \item \env{tabular}: Fixes for \cs{par} in column specifier, +% minipage inside \env{tabular}. +% \margintag{\env{tabular}} +% \item Indexing: Fix for a long line of multiple entries. +% \margintag{indexing} +% \item \cs{minipagefullwidth}: Fix for global changes. +% \margintag{\env{minipage}} +% \item Added \cs{UseMinipageWidths} and \cs{IgnoreMinipageWidths}. +% See \cref{sec:minipages}. +% \item Improved \cs{fbox}, \cs{fboxBlock}, \cs{fminipage} to use current text color. +% \margintag{colors} +% \item Improved \HTML\ output formatting. +% \margintag{\HTML} +% \item Added discussion regarding invalid \HTML. See \cref{sec:invalidhtml}. +% \margintag{docs} +% \item Added discussion regarding math in section names, +% \cs{imagegraphics} \optn{scale} option. See \cref{sec:convertexisting}. +% \item Added discussion regarding international languages in section names. +% See \cref{sec:international}. +% \item \pkg{caption}: Fix for options clash. +% \margintag{packages} +% \item \pkg{xr}, \pkg{xr-hyper}: Now compatible. +% \item \pkg{subcaption}: Improved horizontal spacing. +% \item \pkg{multicol}: Fix for minipage inside \env{multicols}. +% \item \pkg{multicolrule}: Updated for v1.2. +% \item \pkg{tocbasic}: Minor update. +% \item \pkg{acronym}: Fix for acronym in float caption. +% \item \pkg{kotexutf}: Patch with \prog{pdflatex} and new +% \pkg{lwarp} labels. +% \item \pkg{extramarks}, \pkg{fancyhdr}: Updated for v3.10. +% \item \pkg{memoir}: Added docs regarding version numbers. See \cref{sec:limitsmemoir}. +% \item \pkg{zref}: No longer required. +% \item Added \pkg{ar}, \pkg{ed}, \pkg{indentfirst}, \pkg{nameauth}, \pkg{truncate}. +% \item Verified to work as-is with \pkg{changelog}. +% \item Prevented \pkg{colortab}, \pkg{epsf}, \pkg{hyper}, +% \pkg{picinpar}, \pkg{picins}, +% \pkg{sistyle}, \pkg{ucs}. +% \end{itemize} +% \needspace{2\baselineskip} +% \item[v0.65:] \CSS\ layout, \attribute{alt} tags, Japanese. +% \begin{itemize} +% \item Moved the side\TOC\ to the left side, +% \margintag{page layout} +% allowing improved \CSS\ for margin notes. +% \item Improved page layout \CSS. +% \item \pkg{graphicx} \cs{includegraphics}: Added the \optn{alt} key +% \margintag{image \attribute{alt} tags} +% to assign an \attribute{alt} tag to an image. Default is ``\optn{(image)}'', +% assigned to pass validation. +% \item Detects and causes an error +% \margintag{duplicate \HTML\ files} +% if duplicate \HTML\ file names are generated, +% caused by identical or similar sectioning names. +% \item Fix for \env{tabular*}. +% \margintag{fixes} +% \item Fix for tabular border colors. +% \item Fixes \cs{quad}, \cs{enskip}, and figure captions to pass validation. +% \item Added \pkg{ltj*} classes, +% \margintag{Japanese} +% \pkg{bounddvi}, \pkg{gentombow}, \pkg{lltjext}, \pkg{plarydshln}, +% \pkg{plext}, \pkg{plextarydshln}, +% \pkg{plextcolortbl}, \pkg{pxatbegshi}, +% \pkg{pxeveryshi}, \pkg{pxftnright}, \pkg{pxjahyper}, \pkg{tascmac}. +% \item Verified to work with \pkg{plarray}, \pkg{plautopatch}, +% \pkg{plextarray}, \pkg{plextdelarray}, \pkg{pxgentombow}, +% \pkg{plsiunitx}, \pkg{pxpdfpages}, \pkg{pxpgfrcs}, \pkg{pxpgfmark}. +% \item Added support for \pkg{fontspec} \cs{textsi} and \cs{sishape}. +% \margintag{packages} +% \item Added \pkg{multicol}'s \cs{docolaction}. +% \item Added \pkg{embrac}, \pkg{footnoterange}, \pkg{multicolrule}, \pkg{versonotes}. +% \end{itemize} +% \needspace{2\baselineskip} +% \item[v0.64:] Koma-Script, Japanese, Chinese. +% \begin{itemize} +% \item Added \pkg{utarticle} and related classes. +% \margintag{Japanese} +% \item Improved \pkg{ujarticle} and related classes. +% \item Fix for \pkg{biblatex} with C\TeX\ and other classes. +% \margintag{Chinese} +% \item Fixes for \pkg{scrlayer}, \pkg{scrlayer-scrpage}. +% \margintag{Koma-Script} +% \item \pkg{addlines}: Updated to v0.3. +% \margintag{packages} +% \item Added \pkg{bsheaders}, +% \pkg{gmeometric}, \pkg{marginal}, +% \pkg{rmpage}, \pkg{scrpage2}. +% \end{itemize} +% \needspace{2\baselineskip} +% \item[v0.63:] \pkg{mdframed}, Chinese, Japanese, Korean +% \begin{itemize} +% \item Added \cs{linkhomename}: A user-definable name for the \UI{Home} link. +% \margintag{localization} +% \item Documented \cs{sidetocname}: A user-definable name for the side\TOC. +% \item Fix: \cs{LinkHome} for print output. +% \margintag{fixes} +% \item Moved package load checks to the \pkg{lwarp} core +% \margintag{optimizations} +% to reduce the number of \filenm{lwarp-*} files. +% \item \pkg{mdframed}: Fix with \pkg{amsthm}, improved titles and font control. +% \margintag{packages} +% Improved rule widths. +% \item Fixes for \pkg{xeCJK}. +% \margintag{Chinese} +% \item Added \pkg{xpinyin}, \pkg{zhlineskip}. +% \item Verified to work with \pkg{cjkpunct}, \pkg{upzhkinsoku}, \pkg{zhspacing}. +% \item Verified to work with \pkg{zxjatype}, \pkg{luatexja}, \pkg{luatexja-fontspec}. +% \margintag{Japanese} +% \item Added \pkg{bxjsarticle} and related classes. +% \item Added \pkg{ltjsarticle} and related classes. +% \item Added p\LaTeX, up\LaTeX, \pkg{ujarticle} and related classes. +% \item Prevented \pkg{utarticle} and related classes. +% \item Prevented \pkg{bxcjkatype}. +% \item Verified to work with \pkg{kotex}, \pkg{xetexko}, \pkg{luatexko}. +% \margintag{Korean} +% \end{itemize} +% +% \needspace{2\baselineskip} +% \item[v0.62:] MiK\TeX\ docs, \HTML\ title, C\TeX, \pkg{xeCJK}, \pkg{bitpattern}. +% \begin{itemize} +% \item Docs: Setting a \UTF-8 locale. See \cref{sec:utf8locale}. +% \margintag{docs} +% \item MiK\TeX: Docs for \prog{MiKTeX Console} and \pkg{miktex-poppler-bin}. +% \margintag{MiK\TeX} +% \item \HTML\ subpage titles: Added \cs{HTMLTitleBeforeSection} and +% \margintag{\HTML\ \element{title}} +% \cs{HTMLTitleAfterSection} to select whether +% the \HTML\ \element{title} displays the website name before or +% after the section name. +% See \cref{sec:htmlsettings}. +% \item Fix for package options handling. +% \margintag{fixes} +% \item Fixes for horizontal white space between \env{fminipage}, \env{fcolorminipage}, +% \env{colorboxBlock}, \env{fcolorboxBlock}. +% \item Logos: Fix for \XeTeX\ logo, improved \CSS, made robust, +% improved search-engine optimization. +% \item |\\[$1]|: Additional \HTML\ \element{br} if $\$1 > 0\,\textrm{pt}$. +% \item Fixes for \cs{includgraphics} filename, and with \bool{FormatWP}. +% \item Fix: \CSS\ for \cs{textup}. +% \item Fix: Added \cs{slshape}. +% \item Added \pkg{ctex} package and related classes, \pkg{xeCJK}. +% \margintag{Chinese} +% \item Prevented \pkg{CJK}, \pkg{CJKutf8} unless \pkg{xeCJK}, \pkg{ctex} are used. +% \item \pkg{chemfig}: Docs for new macro \cs{polymerdelim}. +% \margintag{packages} +% \item \pkg{asymptote}: Docs for compilation. +% \item \pkg{chngpage}: Fix to load \pkg{lwarp-changepage}. +% \item \pkg{algorithm2e}: Fix with non-\pkg{book} classes. +% \item \pkg{register}: Updated to v1.8. +% \item \pkg{nicefrac}: Improved font control and \CSS, honors \optn{nice} and \optn{ugly}. +% \item \pkg{units}: Improved font control and \CSS, honors \optn{tight} and \optn{loose}. +% \item \pkg{xfrac}: Improved \CSS. +% \item \pkg{textcomp} and \pkg{xunicode}: Fix conflicts with \cs{textcircled}. +% \item \pkg{ulem}: Improved compatibility with \pkg{CJKulem}, \env{lateximage}. +% \item MathJax and \pkg{siunitx}: Removed inoperable extension. +% \item Added \pkg{bitpattern}, \pkg{pdfcomment}, +% \pkg{pdfmarginpar}, \pkg{tram}, \pkg{unitsdef}, \pkg{xechangebar}. +% \item Added \pkg{musicography}, \pkg{octave}, \pkg{semantic-markup}. +% \item Added \pkg{2in1}, \pkg{flippdf}, \pkg{notespages}, \pkg{rviewport}, \pkg{twoup}. +% \end{itemize} +% \needspace{2\baselineskip} +% \item[v0.61:] Custom compilation, \EPS-related packages, documentation, indexes. +% \begin{itemize} +% \item Split index into multiple indexes. See \cpageref{sec:indexmeta}. +% \margintag{docs} +% \item Improved documentation regarding font selection. See \cref{sec:fonts}. +% \item Added documentation regarding debugging options. +% See \cref{sec:debuggingmessages}. +% \item Added documentation regarding \HTML\ entities inside program listings. +% See \cref{sec:avoidtextformatting}. +% \item Added options to specify the shell commands to execute for +% \margintag{custom compiling} +% \cmds{lwarpmk print} and \cmds{lwarpmk html}, allowing +% the use of \pkg{lwarp} with \pkg{perltex}, \pkg{pythontex}, etc. +% If not specified, these are set automatically depending on the \LaTeX\ engine, +% \optn{-\/-shell-escape}, and \pkg{lwarp} options. +% See \cref{sec:customcompiling}. +% \item Changed macro names to match +% \watchout[changed names] +% \cs{displaymathother}, \cs{displaymathnormal}: \\ +% \begin{tabular}{cc} +% \toprule +% Old & New \\ +% \midrule +% \cs{StartDynamicMath} & \cs{inlinemathother} \\ +% \cs{StopDynamicMath} & \cs{inlinemathnormal} \\ +% \bottomrule +% \end{tabular} +% \item Fix: Paragraph tags in a \env{tabular}. +% \margintag{fixes} +% \item Fix: \pkg{supertabular} and \pkg{xtab} captions. +% \item Fix: \DVI\ \LaTeX\ \cs{includegraphics} \EPS\ images. +% \item Fix: \pkg{newfloat} lists. +% \item Fix: \CSS\ footnotes text align, minipage tabular and footnote margins. +% \item Added \pkg{epsfig}, \pkg{psfrag}, \pkg{psfragx}, \pkg{pstool}. +% \margintag{packages} +% \item Added \pkg{copyrightbox}, \pkg{pdfprivacy}, \pkg{thinsp}, +% \pkg{threadcol}, \pkg{uspace}. +% \item Added \pkg{chkfloat}, \pkg{cmdtrack}, \pkg{dprogress}, +% \pkg{lua-visual-debug}, \pkg{refcheck}, +% \pkg{srcltx}, \pkg{srctex}, \pkg{vpe}, \pkg{xbmks}. +% \end{itemize} +% \item[v0.60:] Fixes for \pkg{longtable}, \pkg{listings}. +% \begin{itemize} +% \item \pkg{longtable}, etc.: Fixes for slowdown and memory management for very long tables. +% \margintag{fixes} +% \item \pkg{listings}: Fix for \HTML\ entities, and also when used inside a list. +% \item \pkg{diagbox}: Fix for incorrect \HTML\ par tags. +% \item Added \pkg{2up}, \pkg{booklet}. +% \margintag{packages} +% \item Added \pkg{bophook}, \pkg{draftfigure}, \pkg{fullminipage}, +% \pkg{grid-system}, \pkg{layaureo}. +% \item Added \pkg{leading}, \pkg{widows-and-orphans}. +% \item Added \pkg{fancytabs}, \pkg{thumb}, \pkg{thumbs}. +% \end{itemize} +% \needspace{2\baselineskip} +% \item[v0.59:] \DVI\ \prog{latex}, \brand{MathJax}, \pkg{asymptote}, +% \pkg{pdftricks} and \pkg{pstricks}, \pkg{epstopdf}, \pkg{brqen}. +% \begin{itemize} +% \item \newlwarpmkconf +% \item Added an error if \filenm{lwarpmk.conf}'s format has changed and +% \margintag{\prog{lwarpmk}} +% the document must be recompiled. +% \item Added a warning if the \filenm{lwarpmk.conf} configuration file appears +% to be for the wrong operating system, in case files are transferred between +% systems. +% \item Added +% \begin{sourcedisplay} +% lwarpmk epstopdf +% \end{sourcedisplay} +% to quickly convert a document's \EPS\ images to \PDF\ or \SVG. +% See \cref{sec:limitsgraphics}. +% \item Added support for \DVI\ \prog{latex}. See \cref{sec:loading}. +% \margintag{\DVI\ \prog{latex}} +% \item Fix for \optn{-\/-shell-escape} with \prog{latexmk}. +% \margintag{\prog{latexmk}} +% \item Updated MathJax script to v2.7.4. +% \margintag{math} +% \item Fix: Mathjax chapter number removed from non-numeric tagged equations. +% \item Added MathJax support for \pkg{nicefrac}, \pkg{units}. +% \item Fix for \cs{[} and \cs{]} with \cs{displaymathnormal}. +% \item Fix for \cs{includegraphics} filename expansion. +% \margintag{images} +% \item \cs{includegraphics} now works with +% \filenm{.pdf} and \filenm{.eps} filename extensions. +% \item Moved \pkg{amsmath} out of the \pkg{lwarp} core. +% \margintag{packages} +% \item Fix for \pkg{chemformula} \cs{NMR}. +% \item Added \pkg{asymptote}, \pkg{pdftricks}, \pkg{pstricks}, \pkg{pst-eps}. +% \item Added \pkg{breqn}, \pkg{SIunits}. +% \item Added \pkg{bxpapersize}, \pkg{canoniclayout}, \pkg{draftcopy}, +% \pkg{fnbreak}, \pkg{nccfancyhdr}. +% \item Added \pkg{accsupp}, \pkg{axessibility}. +% \item Added \pkg{xunicode}. +% \item Improved and now supports \pkg{epstopdf}. +% \item Tested to work as-is: \pkg{eepic}, \pkg{sepfootnotes}. +% \item Added information about setting up a development version of \pkg{lwarp}. +% \margintag{docs} +% \end{itemize} +% \needspace{2\baselineskip} +% \item[v0.58:] Extensive improvements in indexing, glossaries. +% Adds \PDF-inclusion packages. +% \begin{itemize} +% \item \newlwarpmkconf +% \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} +% \item Added \cs{StartDefiningMath} and \cs{StopDefiningMath} for +% \margintag{math macros} +% use when defining macros in the preamble which contain \$. +% See \cref{sec:mathcatcode}. +% \item Added \cs{inlinemathother} and \cs{inlinemathnormal} to +% \margintag{dynamic math} +% delimit math expressions which depend on a variable condition +% such as a counter. Such expressions will not be hashed for reuse, +% and will be converted to \SVG\ math images even when MathJax is enabled. +% See \cref{sec:mathdynamic}. +% \item Renamed \cs{EndDefiningTabulars} to \cs{StopDefiningTabulars}. +% \watchout[new name] +% \item Improved localization for \env{lateximage} \HTML\ \attribute{alt} tags. +% \margintag{\env{lateximage} \attribute{alt} tags} +% For \SVG\ math images, the \attribute{alt} tag under some conditions +% will be set to \cs{mathimagename}, which defaults to ``math image''. +% For packages, the \attribute{alt} tag is set using the package name followed by +% \cs{packagediagramname}, which defaults to ``diagram''. Ex: +% \begin{sourcedisplay} +% (-xy- diagram) +% \end{sourcedisplay} +% See \cref{sec:packagediagramname}. +% \item Fix: Improved print/\HTML\ macro selection. +% \item Fix: \cs{href} text catcodes. +% \margintag{misc. fixes} +% \item Fix: \cs{subref} text. +% \item Fixes: Colored \cs{rule} and \cs{boxframe}. +% \item \pkg{float}, \pkg{rotfloat}: Adds support for float styles |ruled| and |boxed|. +% \margintag{packages} +% \item \pkg{float}: Fix: Do not create \cs{l@} until \cs{listof} is used. +% \item \pkg{marginnote}: Fix: Long optional argument. +% \item \pkg{ellipsis}: Adds \cs{midwordellipsis}. +% \item \pkg{breakurl}: Fix for text catcodes. +% \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 Tested to work as-is with \pkg{gauss}, \pkg{phonrule}, \pkg{piano}, +% \pkg{SIunits}, \pkg{tikzcodeblocks}. +% \end{itemize} +% \needspace{2\baselineskip} +% \item[v0.56:] Shell escape, tabular packages. +% \begin{itemize} +% \item Added +% \margintag{\prog{lwarpmk}} +% \begin{sourcedisplay} +% lwarpmk pdftosvg +% \end{sourcedisplay} +% to quickly convert a document's \PDF\ images to \SVG, for use with \HTML. +% See \cref{sec:limitsgraphics}. +% \item Added support for \optn{-\/-shell-escape}. See \cref{sec:shellescape}. +% \item Added support for \pkg{array} |w| and |W| columns. +% \margintag{\env{tabular}} +% \item Fix: \cs{multicolumn} parameter handling. +% \item Added support for double \cs{hline}s, \cs{midrule}s, and vertical rules. +% \item Added support for \pkg{arydshln} dashed lines +% with \HTML\ \env{tabular}, but +% reverts to plain rules for \env{lateximage} +% and \SVG\ math \env{array}. +% \item Fix: \cs{thinspace}. +% \margintag{misc. fixes} +% \item Fix: \pkg{paralist} compact environments. +% \item Added \pkg{parnotes}, \pkg{quoting}, \pkg{lua-check-hyphen}, +% \pkg{tocenter}, \pkg{underscore}. +% \margintag{packages} +% \item Added \pkg{bibunits}. +% \item Tested to work as-is with \pkg{babelbib}, \pkg{bodegraph}, +% \pkg{fast-diagram}, \pkg{nicematrix}, \pkg{structmech}. +% \end{itemize} +% \needspace{2\baselineskip} +% \item[v0.55:] Various fixes. +% \begin{itemize} +% \item Fix: Extraneous space in file links, which also +% \margintag{misc fixes} +% prevented \prog{Calibre} \EPUB\ conversions. +% \item Fix: Float optional argument regression. +% \item Fix: \cs{ForceHTMLTOC} with \cs{phantomsection}. +% \item Fix: Overfull boxes in \env{lateximage}s. +% \item Fix: QED symbols in \env{lateximage}. +% \item \pkg{koma-script}: Fix: Figure with \cs{centering}, etc. +% \margintag{packages} +% \item Added \pkg{clrdblpg}. +% \end{itemize} +% \needspace{2\baselineskip} +% \item[v0.54:] Float \cs{centering}, improved image checks. +% \begin{itemize} +% \item \newlwarpmkconf +% \item \progcode{lwarpmk limages} checks for the presence of the \HTML\ version +% \margintag{\prog{lwarpmk}} +% of the document and valid image references before attempting +% to create the \env{lateximage}s. +% \item \prog{lwarpmk}: Improved error message if configuration file +% does not exist. +% \item Added documentation for avoiding error with BibTeX and \cs{etalchar}. +% \margintag{\BibTeX} +% See \cref{sec:limitsbibtex}. +% \item Added documentation regarding \pkg{polyglossia}. +% \margintag{\pkg{polyglossia}} +% See \cref{sec:limitspolyglossia}. +% \item Added documentation regarding the use of macros in section names. +% \margintag{macros in section names} +% See \cref{sec:thingstoavoid}. +% \item Renamed and added package options: +% \margintag{document encoding} +% \watchout[New and revised encoding options] +% \begin{center} +% \begin{tabular}{>{\ttfamily}c>{\ttfamily}c} +% \toprule +% \textrm{Old Package Option} & \textrm{New Package Option} \\ +% \midrule +% xdyFilename & xindyStyle \\ +% IndexLanguage & xindyLanguage \\ +% \midrule +% --- & xindyCodepage \\ +% --- & pdftotextEnc \\ +% \bottomrule +% \end{tabular} +% \end{center} +% Use these options along with \pkg{inputenc} or \pkg{inputenx} +% to process documents in an encoding other than UTF-8. +% See \cref{sec:fonts}. +% +% \item Floats now honor \cs{centering}, \cs{raggedright}, \cs{raggedleft}, +% \margintag{floats with \cs{centering}, etc.} +% and their \pkg{ragged2e} equivalents, +% when placed directly after: +% \begin{sourceverb} +% \begin{floattype} +% \centering +% \end{sourceverb} +% \item \pkg{tikz}: \cs{pgfpicture}, fit, align, font. +% \margintag{misc. fixes} +% \item \pkg{ragged2e}: \cs{centering} etc. +% \item \pkg{hyperref}: \cs{hypertarget} was creating duplicate of \cs{label}. +% \item \pkg{hyperref}: Active chars inside \cs{hyperref}, \cs{hyperlink}. +% \item \pkg{hyperref}: \cs{ref} inside \cs{hyperlink} caused a nested \HTML\ link. +% \item \pkg{glossaries}: Fix when not using \pkg{babel} or \pkg{polyglossia}. +% \item \pkg{textcomp}: \cs{textperthousand}. +% \item \LaTeX\ core \env{verse} environment: line spacing. +% \item Removed \cs{citetitle}, adjusted \cs{attribution}. \watchout +% \item \pkg{memoir}: Minor update for v3.7g. +% \margintag{packages} +% \item Added \pkg{inputenx}, \pkg{bibunits}, \pkg{chngpage}, +% \pkg{forest}, \pkg{magaz}, \pkg{gridset}. +% \item Prevents loading \pkg{ae}, \pkg{aecc}, \pkg{t1enc}, and \pkg{wasysym}. +% \end{itemize} +% \needspace{2\baselineskip} +% \item[v0.53:] Improved image checks. +% \begin{itemize} +% \item \prog{lwarpmk}: Added a warning about corrupted images due to the +% \margintag{\prog{lwarpmk}} +% need to recompile the document one more time. +% \item \prog{lwarpmk}: Added the \cmds{lwarpmk cleanlimages} command. +% \item Added documentation for \cmds{lwarpmk cleanlimages} and +% \cmds{lwarpmk pdftohtml}. +% \end{itemize} +% \needspace{2\baselineskip} +% \item[v0.52:] Improved footnotes, \SVG\ math. +% \begin{itemize} +% \item Improved install instructions regarding \filenm{lwarp_baseline_marker.png}. +% \margintag{documentation} +% \item Added documentation regarding footnotes in section headings, +% and footnotes with \cs{VerbatimFootnotes} +% from \pkg{fancybox}, \pkg{fancyvrb}. See \cref{sec:limitsfootnotes}. +% \item Added documentation regarding font selection when using +% \XeLaTeX\ or \LuaLaTeX\ with \pkg{fontspec} and traditional font packages. +% See \cref{sec:fonts}. +% \item Fix: Limit the number of background tasks +% \margintag{SVG math} +% when generating \env{lateximage}s. +% \item Added user-adjustable \SVG\ math font scaling. See \cref{sec:mathfontscale}. +% \item Added warnings if \filenm{lwarp_baseline_marker.png} is not present, or +% if \pkg{graphicx} or \pkg{graphics} is not loaded. +% \item Improved \cs{ensuremath} hashing expansion. +% \item Fix: \env{equation*} with \env{split}. +% \item \env{tabbing} now works inside a \env{lateximage}. Use for math in \env{tabbing}. +% \item Fix: MathJax script was not executing in some conditions. +% \margintag{MathJax} +% \item Added \cs{CustomizeMathJax} to add custom functions. +% See \cref{sec:limitsmath}. +% \item Fix: Footnote numbering when using \progcode{HTMLDebugComments}. +% \margintag{footnotes} +% \item Fix: Footnote paragraph tags. +% \item Fix: \progcode{FootnoteDepth} defaults to \cs{subsubsection}. +% \item Fix: \cs{kill} in a \env{lateximage}. \margintag{misc. fixes} +% \item Fix: \cs{FileDepth}, misc. others, when input encoding is not \optn{utf8}. +% \item Fix: \cs{texorpdfstring} in a section name. +% \item \pkg{hyperref} emulation: Fix for \progcode{\#}, \progcode{\%}, \margintag{packages} +% \progcode{\&}, \progcode{\~}, \progcode{\_} characters in \URL{}s. +% \item \pkg{fancybox}, \pkg{fancyvrb}: Initial support for \cs{VerbatimFootnotes}. +% \item \pkg{nicefrac}: Added with fix for \cs{ensuremath}. +% \item \pkg{graphicx}: Fix for option defaults. Added v1.1a/b options. +% \item \pkg{endfloat}: Updated for v2.6. +% \item \pkg{url}: Fixes for active characters. +% \end{itemize} +% \needspace{2\baselineskip} +% \item[v0.51:] Improved \SVG\ math, added numerous chemistry packages. +% \begin{itemize} +% \item Docs: Added \nameref{sec:thingstoavoid}. +% \margintag{documentation} +% \item Docs: Added to \nameref{sec:convertexisting}. +% \item Docs: Multiple authors and affiliations with custom classes. +% See \cref{sec:authorsaffils}. +% \item Docs: \pkg{tikz} with matrices. See \cref{sec:limitstikz}. +% \item Improved \SVG\ math baseline.\margintag{SVG math} +% \item Improved \SVG\ math font and color. +% \item Faster \SVG\ math rendering. +% \item Improved support for display math containing complicated math objects, +% such as \pkg{tikz-cd}. See \cref{sec:displaymathother}. +% \item Fix: \cs{addcontentsline} inside \SVG\ math. +% \item Fix: SVG math containing an embedded \env{lateximage}. +% \item MathJax now handles \cs{ensuremath} in expressions.\margintag{MathJax} +% \item Fix: Added \env{alignat} environment. \margintag{misc. fixes} +% \item Fix: \pkg{afterpackage} no longer required, which conflicted with \pkg{scrlfile}. +% \item Fix: \pkg{titling} \cs{thanks} mark. +% \item Fix: \pkg{fancybox} improvements. +% \item Fix: \pkg{tikz} \cs{tikz} macro. (Previously only the \env{tikzpicture} environment worked.) +% \item Fix: \pkg{tikz} with optional argument. +% \item Added \pkg{mhchem}, \margintag{packages} +% \pkg{chemfig}, \pkg{chemformula}, \pkg{chemmacros}, \pkg{chemnum}, \pkg{chemgreek}, +% \pkg{epstopdf-base}, \pkg{grid}, \pkg{ltxgrid}. +% \end{itemize} +% \needspace{2\baselineskip} +% \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} +% parallel background tasks, utilizing all available \acro{CPU} cores. +% \item Inline \SVG\ math image file names now are MD5 hashes made from +% their source \LaTeX\ code. +% Identical inline math expressions, such as multiple instance of \$x\$, +% now share a single image file. +% This reduces the number of images to store, transmit, process, and display. +% Each image file is only converted to \SVG\ a single time, and reused if it +% already exists. +% Display math and other forms of \SVG\ image such as \env{picture} and +% \tikz\ still use individual image files which are recreated each time +% \cmds{lwarpmk limages} is run. +% \item Fixes: SVG math and/or \cs{underline} in a sectioning file name. +% \item Improved \SVG\ display math and tags. +% \item Improved \SVG\ math and \pkg{siunitx} \attribute{alt} tags. +% \item Improved \pkg{siunitx} units. +% \item Fix: \cs{ensuremath} with MathJax now creates a \env{lateximage}. +% \item Fix: \cs{centering}, etc. in \SVG\ math, \env{lateximage}, \tikz. +% \item Fix: Made various macros robust, +% additionally fixing \pkg{authblk}.\margintag{misc. fixes} +% \item Fix: \pkg{ntheorem} if neither \optn{standard} nor \optn{amsthm} selected. +% \item Fix: \pkg{listings}: Improved column alignment. +% \item Fix: Load \pkg{fontspec} if necessary. +% \item Added \pkg{xy}, \pkg{epstopdf}, \pkg{diagbox}, \pkg{pbox}, \margintag{packages} +% \pkg{bytefield}, \pkg{axodraw2}, \pkg{phfqit}, +% \pkg{schemata}, +% \pkg{dblfloatfix}, \pkg{nonfloat}, \pkg{morefloats}. +% \end{itemize} +% \needspace{2\baselineskip} +% \item[v0.49:] \ +% \begin{itemize} +% \item Added \pkg{xcolor} \cs{rowcolors}.\margintag{tabular} +% \item Fix: \cs{noalign} inside a \env{tabular}. +% \item Fix: \cs{eqref} in a caption.\margintag{math} +% \item Fix: Incorrect \PDF\ font size changes +% caused occasional \HTML\ corruption.\margintag{misc fixes} +% \item Fix: \pkg{printlen} changes are now grouped for \HTML\ output. +% \item Added \pkg{vwcol}, \pkg{vertbars}, \pkg{hyphenat}, \margintag{packages} +% \pkg{lineno}, \pkg{fnlineno}, \pkg{figsize}, \pkg{hypdestopt}, \pkg{pagegrid}, +% \pkg{pdfrender}, \pkg{luacolor}, \pkg{resizegather}. +% \end{itemize} +% \needspace{2\baselineskip} +% \item[v0.48:] \ +% \begin{itemize} +% \item Added some documentation +% \margintag{documentation} +% regarding converting an existing document. See \cref{sec:convertexisting}. +% \item Updated compatibility for new \pkg{cleveref} v0.21.\margintag{\pkg{cleveref}} +% \item Fix: Ignores optional tabular column arguments.\margintag{tabular} +% \item Added \cs{leftline}, \cs{centerline}, +% \cs{rightline}.\margintag{minor updates} +% \item Lists have improved font control via \cs{makelabel}. +% \item Print-mode \env{lateximage} now boxed to the natural width of its +% multiline contents. +% \item \env{abstract} now allows an optional name, as required by some classes. +% \item Fix: Improved spacing, \cs{mbox}, and font sizes +% with \SVG\ math, \tikz.\margintag{math} +% \item \pkg{siunitx}: Improved \SVG\ math, fraction compatibility, color output. +% \item Fix: LOF/LOT links.\margintag{misc. fixes} +% \item Fix: Virtual page size grouping caused excessive \PDF\ page breaks. +% \item Fix: Parsing similar package names in a +% single \cs{usepackage}. +% \item Fix: Adapts to classes without \cs{part}. +% \item Fix: \cs{newline} in \cs{title} was causing |
| in window title. +% \item Fix: \cs{maketitle} with \cs{cr}, \cs{crcr}, \cs{noalign}, +% for \pkg{IEEEtran} class. +% \item Fix: \pkg{xfrac} neutralized \env{BlockClass} and others. +% \item Fix: \pkg{todonotes} and \pkg{luatodonotes}: Improved \cs{todototoc}. +% \item Added \pkg{colortbl}, \margintag{packages} +% \pkg{chapterbib}, \pkg{acro}, \pkg{acronym}, +% \pkg{hypernat}, \pkg{hypcap}, \pkg{stfloats}, +% \pkg{vmargin}, \pkg{fancyheadings}. +% \item \pkg{fancyref}: Now directly supported. +% \end{itemize} +% \needspace{2\baselineskip} +% \item[v0.47:] \ +% \begin{itemize} +% \item Improved \SVG\ math baseline and sizing.\margintag{math} +% \item Fixes: \SVG math in captions, subcaptions, \cs{nameref}. +% \item Fixes: Line wrap at hyphen in \HTML\ output. +% \item Added \pkg{endheads}, \pkg{multitoc}, \pkg{sectionbreak}, +% \pkg{blowup}, \pkg{xurl}.\margintag{packages} +% \end{itemize} +% \needspace{2\baselineskip} +% \item[v0.46:] \ +% \begin{itemize} +% \item \cs{PrintStack} changed to \cs{LWRPrintStack}.\watchout[name change] +% \item Fix: Empty lines between \env{tabular} rows.\margintag{misc. fixes} +% \item Fix: Stack unnesting. +% \item Fix: SVG math and \env{lateximage}s in numerous situations. +% \item Fix: Spaces in \cs{usepackage}. +% \item Fix: Now allows \brand{MathJax} inside \env{verse}. +% \end{itemize} +% \needspace{2\baselineskip} +% \item[v0.45:] \ +% \begin{itemize} +% \item Improved \prog{MiKTeX} install instructions. +% \margintag{documentation} +% \item Improved graphics and \pkg{epstopdf} instructions. +% \item Updates to the \nameref{sec:introduction}. +% \item Added \pkg{memoir}, \pkg{memhfixc}. +% See \cref{sec:limitsmemoir}.\margintag{memoir} +% \item Fix: Now allows underscores in labels.\margintag{cross-references} +% \item Fix: \cs{\_} and |\| in section/file names. +% \item Fix: Now allows \brand{MathJax} inside \env{tabbing}.\margintag{math} +% \item Fix: Bibliography \cs{em} names.\margintag{bibliography} +% \item Added \pkg{cite}, \pkg{natbib}, \pkg{backref}. +% (Also works as-is with \pkg{biblatex}.) +% \item Fix: Empty lines between \env{tabular} rows.\margintag{misc. fixes} +% \item Fix: ``Improper \cs{prevdepth}'' with minipages, lists. +% \item Fix: Incorrect \SVG\ math and |lateximage|s with \pkg{subfig}. +% \item Fix: Lateximages from incorrect pages with Mathjax. +% \item Fix: Missing sidetoc if using \pkg{listings}. +% \item Fix: Added an \pkg{array} emulation package. +% \item Added +% \pkg{subfigure}, \pkg{prettyref}, \margintag{packages} +% \pkg{hanging}, \pkg{midpage}, +% \pkg{flafter}, \pkg{fltrace}, \pkg{changebar}, \pkg{endfloat}, +% \pkg{continue}, \pkg{fwlw}, \pkg{turnthepage}, \pkg{footnpag}, +% \pkg{pagesel}, \pkg{textfit}, \pkg{titleref}. +% \end{itemize} +% \needspace{2\baselineskip} +% \item[v0.44:] \ +% \begin{itemize} +% \item Added \pkg{koma-script} classes (except \pkg{scrlttr2}, \pkg{scrjura}). +% \margintag{\pkg{koma-script}} +% \item Added \pkg{scrextend}, +% \pkg{scrlayer}, \pkg{scrlayer-notecolumn}, \pkg{scrlayer-scrpage}, +% \pkg{scrhack}, \pkg{tocstyle}, \pkg{tocbasic}. +% \item Added \cs{HTMLTitle}. +% \margintag{\HTML\ title and author} +% Fixed web page title if \cs{HTMLTitle} empty and no \cs{title} given and +% not using \pkg{titling} package. +% \item Fixed web page author if \cs{HTMLauthor} is empty and \cs{author} is not given. +% \item If using \prog{pdflatex}, automatically loads T1 and \UTF-8 encodings. +% \margintag{encodings} +% (Additional \pkg{fontenc} encodings may be loaded after \pkg{lwarp}.) +% \item Added \env{list} and \env{trivlist} environments, \pkg{hang}.\margintag{lists} +% \item Fix: \cs{multicolumn} alignment if formatting for a word processor. +% \margintag{tabular} +% \item Added \pkg{ltxtable}. +% \item Fix: \brand{MathJax} combined with \env{lateximage}s.\margintag{math} +% \item \pkg{algorithmicx}: Improved comment symbol and floating. +% \item Completed \pkg{todonotes} and \pkg{luatodonotes}. +% \margintag{\pkg{packages}} +% \item Added \pkg{todo}, \pkg{easy-todo}, \pkg{fixmetodonotes}, \pkg{fixme}. +% \item Added \pkg{soulutf8}, \pkg{soulpos}, \pkg{cancel}. +% \item Added \pkg{section}, \pkg{fancyref}, \pkg{ifoddpage}. +% \item Added \pkg{preview}, \pkg{atbegshi}, \pkg{watermark}. +% \item Improved \pkg{tocloft} \cs{newlistof} and \cs{newlistentry}. +% \end{itemize} +% \needspace{2\baselineskip} +% \item[v0.43:] \ +% \begin{itemize} +% \item Docs: Reorganized \HTML\ customization, added an \HTML\ settings table. +% See \cref{sec:htmlsettings}. +% \item Added \progcode{FootnoteDepth} to control the placement +% \margintag{footnotes} +% of pending footnotes before section breaks. +% By default, pending footnotes are printed before +% each \cs{subparagraph} or higher. +% \item Fix: Expansion in section name. \margintag{sectioning} +% \item Fix: Ignore spaces in tabular column specification. +% \margintag{\env{tabular}} +% \item Fix: Tabular rules at bottom or when finishing incomplete rows. +% \item Fix: \cs{multicolumn} at/bang/before/after specifications, trim, +% and vertical rules. +% \item Fix: \pkg{supertabular} and \pkg{xtab} column misalignment. +% \item Fix: \env{equation*}. +% \margintag{math} +% \item Fix: \SVG\ math in a section name. +% \item Fix: \cs{ref} and \cs{eqref} in \SVG\ math. +% \item Added \pkg{todonotes} and \pkg{luatodonotes} (but only |disabled|). +% \margintag{packages} +% \item Added \pkg{breakurl}. +% \item \pkg{hyperref}: Fix: Several macros were made robust, \cs{Gauge} added. +% \end{itemize} +% \needspace{2\baselineskip} +% \item[v0.42:] \ +% \begin{itemize} +% \item Added \TeX\ development support page. +% (See page \pageref{sec:supportinglatex}.) +% \margintag{Support \TeX!} +% \item Improved assitance for word-processor conversions when +% \margintag{word-processor conversion} +% boolean |FormatWP| is set |true|. +% See \cref{sec:wordprocessorconversion}. +% \begin{itemize} +% \item \textred{The} \watchout[name change] +% \textred{boolean |FormatWordProcessor| has +% been renamed |FormatWP|.} +% \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, +% at the \LOF\ and \LOT, and whether to +% print math as \LaTeX\ source for copy/paste into the +% \prog{LibreOffice Writer TeXMaths} extension. +% \item Improved formatting for numerous objects. +% See \cref{sec:wordprocessorconversion}. +% \end{itemize} +% \item Add: \env{tabbing} environment. +% \margintag{\env{tabbing}} +% \item Add: \pkg{overpic} package. See \cref{sec:overpic}. +% \margintag{\pkg{overpic}} +% \item Fix: Text copy/paste of \AmS\ math environment numbers and names. +% \margintag{math} +% \item Improved \cs{ensuremath}. +% \item \brand{MathJax} with \pkg{siunitx}: Updated script and documentation. +% \item \pkg{textcomp}: Improved \cs{textinterrobangdown}. +% \margintag{symbols} +% \item \pkg{realscripts}: Fix for subscripts in a \env{lateximage}. +% \item \pkg{morewrites}: Enforces loading before \pkg{lwarp}. +% \margintag{load order} +% \end{itemize} +% \needspace{2\baselineskip} +% \item[v0.41:] \ +% \begin{itemize} +% \item Added tabular vertical rules, subject to some limitations. +% \margintag{\env{tabular}} +% See the rules section of \cref{sec:limitstabular}. +% \item Improved \pkg{booktabs}: Width and trim are honored. +% \item Added \cs{mcolrowcell} for empty cells inside a \cs{multicolumnrow}. +% \watchout[new syntax] +% \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}. +% \item Fix: Unfinished tabular rows are automatically filled. +% \item Fix for tabular column specifiers while using \pkg{babel-french}. +% (\cs{NoAutoSpacing} is activated then nullified inside the tabular, +% due to a conflict with the tabular column parsing code.) +% \end{itemize} +% \item[v0.40:] \ +% \begin{itemize} +% \item \pkg{graphics} and \pkg{graphicx} have been moved from the +% \margintag{\pkg{graphics}, \pkg{graphicx}} +% \pkg{lwarp} core, and are only loaded if requested with \cs{usepackage}. +% \item Improved \pkg{graphics} \cs{graphicspath} support. +% \margintag{\cs{includegraphics} path} +% Multiple image directories may now be used. +% \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. +% See \cref{sec:limitsgraphics}. +% \item \pkg{grffile} is now directly supported instead of emulated. +% \item Fix for \pkg{bigdelim}, and improved documentation. +% \margintag{\pkg{bigdelim}} +% See \cref{sec:bigdelim}. +% \item Improved \LaTeX\ and \pkg{textcomp} symbols.\margintag{\pkg{symbols}} +% \item Fix for \LaTeX\ logos and \cs{InlineClass}, etc. inside a \env{lateximage}. +% \margintag{\pkg{fixes}} +% \item Fix for \pkg{xltxtra} with \XeLaTeX. +% \item Fixes for \pkg{tocbibind} with \cs{simplechapter}, etc. +% \item Fixes for \cs{multicolumnrow} and \cs{nullfonts} with older versions +% of \pkg{multirow} and \pkg{xparse}. +% \item Added \cs{underline}. +% \item Added \pkg{adjmulticol}.\margintag{margins} +% \item Added \pkg{cuted}, \pkg{midfloat}.\margintag{columns} +% \item Added \pkg{pfnote}, \pkg{fnpos}, \pkg{dblfnote}.\margintag{footnotes} +% \item Added \pkg{stabular}, \pkg{tabls}.\margintag{tabular} +% \item Added \pkg{sectsty}, \pkg{anonchap}, \pkg{quotchap}.\margintag{sectioning} +% \end{itemize} +% \needspace{2\baselineskip} +% \item[v0.39:] \ +% \begin{itemize} +% \item Improved the titlepage \HTML\ code, \cs{thanks} notes, +% \margintag{title pages} +% and \cs{maketitle}. +% \pkg{titling} is no longer required, but is still supported. +% The \cs{published} and \cs{subtitle} fields are no longer provided, +% \watchout[\cs{published} and \cs{subtitle}] +% but \cs{AddSubtitlePublished} replicates them using \pkg{titling}. +% See \cref{sec:publishedsubtitle}. +% \pkg{authblk} is added, and should be loaded before \pkg{titling}. +% \watchout[load order] +% See \cref{sec:titles}. +% \item \cs{multirow} now supports the new optional |vpos| argument. +% \margintag{tabular} +% \item Added \cs{multicolumnrow} for combined +% \margintag{multi column/row cell} +% \cs{multicolumn} and \cs{multirow}. +% See \cref{sec:multicolumnmultirow}. +% \item Tabular special cases: +% \begin{itemize} +% \item Added \cs{TabularMacro} to mark custom macros +% \watchout[macros inside tabular] +% inside tabular data cells, avoiding row corruption. +% See \cref{sec:limitstabular}. +% \item Added \cs{ResumeTabular} for use when a \env{tabular} environment +% \watchout[tabular defined inside another environment] +% is defined inside another environment. +% See \cref{sec:limitstabular}. +% \end{itemize} +% \item Added \pkg{supertabular}, \pkg{xtab}, \pkg{bigstrut}, \pkg{bigdelim}. +% \margintag{tabular} +% \item Added \pkg{fullwidth}.\margintag{margins} +% \item Added \pkg{addlines}, \pkg{anysize}, \pkg{a4}, \pkg{a4wide}, \pkg{a5comb}, +% \margintag{page layout} +% \pkg{textarea}, \pkg{zwpagelayout}, \pkg{typearea}, \pkg{ebook}. +% \end{itemize} +% \item[v0.38:] \ +% \begin{itemize} +% \item Added \cmds{lwarpmk print1} and \cmds{lwarpmk html1} actions to +% \margintag{forced single-pass compile} +% force a compile of the project a single time. +% Useful when multiple passes are not needed, +% or changes were not detected. +% \item Added \cs{ForceHTMLPage} and \cs{ForceHTMLTOC} to force +% \margintag{starred sections} +% a starred sectional unit onto its own \HTML\ page +% and with its own \TOC\ entry. +% See \cref{sec:forcesectionstar}. +% \item Modified the tutorial to use the new \cs{ForceHTMLPage} +% \margintag{updated tutorial} +% and \cs{ForceHTMLTOC} macros. +% \item Added \pkg{appendix}, \pkg{tocbibind}, \pkg{fncychap}, \pkg{fix2col}. +% \margintag{packages} +% \item Added \pkg{relsize}, \pkg{scalefnt}.\margintag{font size} +% \item Added \pkg{realscripts}, \pkg{metalogo}, \pkg{xltxtra}. +% \item Added \pkg{grffile}, \pkg{romanbar}. +% \item Added \pkg{arabicfront}, \pkg{chappg}, \pkg{nonumonpart}, \pkg{nopageno}, +% \margintag{page numbering} +% \pkg{romanbarpagenumber}. +% \item Docs: Improved description of the use of front/back matter. +% \margintag{front \& back matter} +% See \cref{sec:frontbackmatter}. +% \item Fix: \pkg{color} requests \pkg{xcolor}. +% \item Fix: \cs{part} for \pkg{article} class. +% \end{itemize} +% \needspace{2\baselineskip} +% \item[v0.37:] \ +% \begin{itemize} +% \item \cs{include} now maintains independent |.aux| files +% \margintag{\cs{include} for \HTML} +% for \HTML\ versions. +% \item \pkg{comment}, used by \pkg{lwarp}, now maintains +% \margintag{\prog{latexmk}} +% independent cut files for print and \HTML\ versions, helping \prog{latexmk} to +% better know whether to recompile. +% \item Improved support for \LaTeX\ accents, +% \margintag{accents and symbols} +% \pkg{textcomp}, \pkg{siunitx} symbols. +% \item Improved \pkg{babel-french} handling for +% \margintag{\pkg{babel-french}} +% load order and \textasciitilde\ tilde. +% \end{itemize} +% \item[v0.36:] \ +% \begin{itemize} +% \item Recorganized the documentation section regarding special cases and limitations. +% (\Cref{sec:limitations}) +% \item Improved source formatting. +% \item \cs{fbox} and related now use \cs{fboxsep} and \cs{fboxrule}. +% \margintag{boxes and frames} +% \item \cs{makebox} and \cs{framebox} now use width and position. +% \item \cs{fcolorbox} and related now work inside a \env{lateximage}. +% \item \pkg{babel-french}: Improvements for French variants, load order, +% \margintag{\pkg{babel-french}} +% footnotes, ellipses. +% \item Improved footnote numbering. +% \margintag{footnotes} +% \env{lateximage} footnotes now appear as regular footnotes to match +% the numbering of the print version. +% Also fixed a regression with \brand{MathJax}. +% \item Improved \pkg{siunitx} units. +% \margintag{\pkg{siunitx}} +% \item Fix for filenames while using \brand{MathJax}. +% \item Fix for \cs{rule} when \pkg{xcolor} is not loaded. +% \item Added \pkg{transparent}, \pkg{upref}. +% \end{itemize} +% \item[v0.35:] Fix: \cs{textbf} and related. +% \item[v0.34:] \ +% \begin{itemize} +% \item \env{BlockClass}'s optional argument has been moved +% \watchout[Optional arguments] +% in front of the mandatory argument: +% \begin{sourcedisplay} +% |BlockClass[style]{class}| \quad \textrm{(NEW)} +% \end{sourcedisplay} +% instead of: +% \begin{sourcedisplay} +% |BlockClass{class}[style]| \quad \textrm{(OLD)} +% \end{sourcedisplay} +% This change makes it more consistent with \LaTeX\ standards, +% and avoids problems with space between arguments. +% \item Likewise, \cs{InlineClass}'s optional argument now +% \watchout[Optional arguments] +% comes before the mandatory arguments: +% \begin{sourcedisplay} +% |\InlineClass[style]{class}{text}| +% \end{sourcedisplay} +% \item Improved compatibility between spans, minipages, lists, +% \margintag{spans with minipages} +% frames, and math. +% Handles minipages and lists inside an \HTML\ span, +% such as an \cs{fbox} containing a minipage, +% although with minimal \HTML\ fomatting. +% See \cref{sec:minipages}. +% \cs{fboxBlock} is added to frame minipages, tables, +% \margintag{framing minipages} +% and lists with full \HTML\ formatting +% but no longer inline, and behaves as \cs{fbox} for print output. +% The \env{fminipage} environment is added for framed minipages, +% as an environment with full \HTML\ formatting, +% and draws a framed minipage in print output. +% See \cref{sec:framedminipages}. +% \cs{fbox} and minipages now often work in \SVG\ math and \env{lateximage}s. +% \brand{MathJax} supports \cs{fbox}, but not \cs{fboxBlock} nor \env{fminipage}. +% \item Improved compatibility between \env{lateximage} and +% \margintag{\env{lateximage}, \SVG\ math, \env{tabular}} +% \env{minipage}, \cs{parbox}, \cs{makebox}, \cs{fbox}, \cs{framebox}, +% \cs{raisebox}, \cs{scalebox}, \cs{reflectbox}, \env{tabular}, \pkg{booktabs}. +% \item Improved font control for \env{lateximage}es and \SVG\ math. +% \item Added the \env{eqnarray} environments.\margintag{\env{eqnarray}} +% \item \pkg{fancyvrb} is no longer required (preloaded), +% \margintag{verbatim packages} +% but is still supported. +% \item Added \pkg{verbatim} and \pkg{moreverb}. +% \item Added \pkg{fancybox}, \pkg{boxedminipage2e} and \pkg{shadow}. +% \margintag{framing packages} +% \item \pkg{enumitem} is no longer required, but is still supported. +% \margintag{list packages} +% \item Added \pkg{enumerate} and \pkg{paralist}. +% \item \pkg{titleps} is no longer required, but is still supported. +% \item Added \pkg{crop}. +% \item Added \pkg{rotfloat}, \pkg{marginfit}, +% and several minor packages; see the change log. +% \item Adds fixed-width \HTML\ spaces around punctuation +% \margintag{\pkg{babel-french}} +% when using \pkg{babel-french}. +% \LuaTeX\ does not yet use the extra punctuation spacing. +% \end{itemize} +% \needspace{2\baselineskip} +% \item[v0.33:] \ +% \begin{itemize} +% \item Tabular |@| and |!| columns now havetheir own \HTML\ columns. +% \item |&| catcode changes are localized, perhaps causing errors +% about the tab alignment character |&|, +% so any definitions of macros or environments +% which themselves contain \env{tabular} and |&| must be enclosed within \cs{StartDefiningTabulars} +% and \cs{StopDefiningTabulars} (previously called \cs{EndDefiningTabulars}. +% See \cref{sec:localizingcatcodes}. +% This change is not required for the routine use of tables, +% but only when a table is defined inside another macro or environment, +% and while also using the |&| character inside the definition. +% This may include the use inside conditional expressions. +% \item Several math environments were incorrectly placed inline. +% Also, for \pkg{amsmath} with \SVG\ math, the \optn{fleqn} option has been removed, +% resulting in improved spacing for aligned equations. +% \item Bug fixes; see the changelog. +% \end{itemize} +% \item[v0.32:] Bug fixes; no source changes needed: +% \begin{itemize} +% \item \prog{lwarpmk} has been adjusted to work with the latest \prog{luatex}. +% \item Spaces in the \cs{usepackage} and \cs{RequirePackage} package lists are now accepted and ignored. +% \item Fix for the \pkg{glossaries} package and \cs{glo@name}. +% \end{itemize} +% \item[v0.31:] Bug fix; no source changes needed: +% \begin{itemize} +% \item Improved compatibility with \pkg{keyfloat}, +% including the new \env{keywrap} environment. +% \end{itemize} +% \needspace{2\baselineskip} +% \item[v0.30:] \ +% \begin{itemize} +% \item \pkg{lwarp-newproject} has been removed, and its functions +% \watchout[\pkg{lwarp-newproject}] +% have been combined with \pkg{lwarp}. +% +% To modify existing documents, remove from the document source: +% \begin{sourceverb} +% \usepackage{lwarp-newproject} +% \end{sourceverb} +% +% The \pkg{lwarp} package now produces the configuration files during +% print output, and also accepts the option \optn{lwarpmk} if desired. +% +% \item A number of macros +% \watchout[HTML setup changes.] +% related to \HTML\ settings have been converted to options, and +% other macros and options have been renamed to create a consistent syntax: +% \begin{center} +% \begin{tabular}{cc} +% \toprule +% Old Macro & New Package Option \\ \midrule +% \cs{HomeHTMLFileName} & |HomeHTMLFilename| \\ +% \cs{HTMLFileName} & |HTMLFilename| \\ +% \cs{useLatexmk} & |latexmk| \\ +% \cs{warpOSwindows} & |OSWindows| \\[2.5ex] \toprule +% Old Package Option & New Package Option \\ \midrule +% \optn{lwarpmklang} & \optn{xindyLanguage} \\ +% (new) & \optn{xindyStyle} \\[2.5ex] \toprule +% Old Macro & New Macro \\ \midrule +% \cs{MetaLanguage} & \cs{HTMLLanguage} \\ +% \cs{HTMLauthor} & \cs{HTMLAuthor} \\ +% \cs{NewHTMLdescription} & \cs{HTMLDescription} \\ +% \cs{SetFirstPageTop} & \cs{HTMLFirstPageTop} \\ +% \cs{SetPageTop} & \cs{HTMLPageTop} \\ +% \cs{SetPageBottom} & \cs{HTMLPageBottom} \\ +% \cs{NewCSS} & \cs{CSSFilename} \\ +% \bottomrule +% \end{tabular} +% \end{center} +% +% \needspace{2\baselineskip} +% \item Per the above changes, in existing documents, +% modify the package load of \pkg{lwarp}, such as: +% \begin{sourceverb} +% \usepackage[ +% HomeHTMLFilename=index, +% HTMLFilename={}, +% xindyLanguage=english +% ]{lwarp} +% \end{sourceverb} +% +% \item The file |lwarp_html.xdy| has been renamed |lwarp.xdy|. +% To update each document's project: +% \begin{enumerate} +% \item Make the changes shown above. +% \item Recompile the document in print mode. +% This updates the project's configuration files, and also generates the +% new file |lwarp.xdy|. +% \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 +% \prog{lwarpmk} to use a custom |.xdy| file instead of |lwarp.xdy|. +% See \cref{sec:modifyxindy}. +% +% \item Improvements in index processing: +% \begin{itemize} +% \item \prog{xindy}'s language is now used for index processing +% as well as glossary. +% \item Print mode without \prog{latexmk} now uses \prog{xindy} instead of \prog{makeindex}. +% \item \prog{texindy}/\prog{xindy} usage depends on \prog{pdflatex} vs \prog{xelatex}, \prog{lualatex}. +% \item For \prog{pdflatex} and \prog{texindy}, the \optn{-C utf8} option is used. This is +% supported in modern distributions, but a customized \filenm{lwarpmk.lua} may +% need to be created for use with older distributions. +% \end{itemize} +% +% \end{itemize} +% +% \needspace{2\baselineskip} +% +% \item[v0.29:] \ +% \begin{itemize} +% \item Add: \optn{lwarpmklang} option for \pkg{lwarp-newproject} and \pkg{lwarp}. +% Sets the language to use while processing the glossary. +% (As of v0.30, this has been changed to the \optn{IndexLanguage} option.) +% (As of v0.54, this has been changed to the \optn{xindyLanguage} option.) +% \item Fix: \cs{includegraphics} when no optional arguments. +% \end{itemize} +% \item[v0.28:] \ +% \begin{itemize} +% \item \cs{HTMLAuthor} \marg{name} assigns \HTML\ meta author if non-empty. +% Defaults to \cs{theauthor}. +% \item Booean |HTMLDebugComments| controls whether \HTML\ comments are +% added for closing \element{div}s, opening and closing sections, etc. +% \item Boolean |FormatEPUB| changes \HTML\ output for easy \EPUB\ conversion +% via an external program. +% Removes per-file headers, footers, and nav. Adds footnotes per chapter/section. +% \item Boolean |FormatWordProcessor| changes \HTML\ output for easier conversion +% by a word processor. Removes headers and nav, prints footnotes per section, +% and also forces single-file output and turns off \HTML\ debug comments. +% Name changed to |FormatWP| as of v0.42. +% \item Boolean |HTMLMarkFloats| adds text marks around floats only if the boolean +% |FormatWordProcessor| is |true|. +% These make it easier to identify float boundaries, +% which are to be manually converted to word-processor frames. +% Name changed to |WPMarkFloats| as of v0.42. +% \item Updated for the new \brand{MathJax} \acro{CDN} repository. +% \item Adds \pkg{tabulary}. +% \item Supports the options syntax for \pkg{graphics}. +% \item Improved index references, now pointing exactly to their target. +% \item Adds \pkg{glossaries}. +% \prog{lwarpmk} is modified to add |printglosssary| and |htmlglossary| actions. +% \end{itemize} +% +% ^^A \needspace{2\baselineskip} +% ^^A \item[v0.27:] \ +% ^^A \begin{itemize} +% ^^A \item Improved documentation for \brand{MacOS} install. +% ^^A \item Fix for \pkg{microtype} with \XeLaTeX\ and \LuaLaTeX. +% ^^A \item Fix for table footnote paragraph tags. +% ^^A \item Adds \pkg{lettrine}, \pkg{ulem}, and \pkg{soul}. +% ^^A \end{itemize} +% ^^A \needspace{2\baselineskip} +% ^^A \item[v0.26:] \ +% ^^A \begin{itemize} +% ^^A \item Improved installation instructions for MiK\TeX\ regarding generating +% ^^A the \prog{lwarpmk} executable. +% ^^A \item Footnotes are now supported by \LaTeX\ boxes instead of pagenotes. +% ^^A \pkg{pagenote} now works as per the print version. +% ^^A \pkg{footnote}, \pkg{footnotehyper}, \pkg{footmisc}, \pkg{endnotes}, +% ^^A \pkg{marginnote}, and \pkg{sidenotes} are also supported. +% ^^A \item \LaTeX\ labels now are used to track the page numbers of |lateximage|s. +% ^^A This allows the correct inclusion of |lateximage|s in footnotes, pagenotes, and endnotes. +% ^^A \item \pkg{cutwin} and \pkg{floatflt} are also supported. +% ^^A \end{itemize} +% ^^A \needspace{2\baselineskip} +% ^^A \item[v0.25:] \ +% ^^A \begin{itemize} +% ^^A \item Fix: Allows \pkg{graphicx} and \pkg{graphicx} before \pkg{lwarp} because +% ^^A \XeLaTeX\ and \LuaLaTeX\ use \pkg{xunicode} which uses \pkg{graphics}. +% ^^A \item Package support for \pkg{framed}, several theorem packages, and ellipses. +% ^^A \end{itemize} +% ^^A \needspace{2\baselineskip} +% ^^A \item[v0.24:] \ +% ^^A \begin{itemize} +% ^^A \item \pkg{tikz}'s |babel| library is load automatically as needed. +% ^^A \item \pkg{subfig} has been added, along with |lofdepth| and |lotdepth|. +% ^^A \item \env{picture} and \env{tikzpicture} now may be inline. +% ^^A \end{itemize} +% ^^A \needspace{2\baselineskip} +% ^^A \item[v0.22:] \ +% ^^A \begin{itemize} +% ^^A \item Support has been added for tabular column types |D|, |!|, and |X|. +% ^^A Unknown column types are converted to |l|. +% ^^A \item Additional packages are supported, including \pkg{abstract}, +% ^^A \pkg{dcolumn}, \pkg{tabularx}, and \pkg{varioref}. +% ^^A \end{itemize} +% ^^A \item[v0.21:] \ +% ^^A \begin{itemize} +% ^^A \item Documentation for installing on \brand{Windows} has been updated and improved. +% ^^A \item For \brand{Windows} compatibility, the |lateximages| shell script +% ^^A has been replaced with a |lateximages.txt| file, which is parsed +% ^^A by \prog{lwarpmk} to generate lateximages. +% ^^A This does not require any changes in the user's code. +% ^^A \item \brand{Windows} \cmds{lwarpmk again} now functions. +% ^^A \item For improved error handling, \pkg{lwarp} now verifies the +% ^^A order in which packages are loaded, and signals an error for misplaced packages. +% ^^A \pkg{inputenc}, \pkg{fontenc}, \pkg{newunicode}, and \pkg{fontspec} +% ^^A must be loaded before \pkg{lwarp}, and the other packages which +% ^^A \pkg{lwarp} knows about must be loaded after. +% ^^A \item \pkg{lwarp} no longer requires a \cs{title} be assigned. +% ^^A \end{itemize} +% ^^A \item[v0.20:] \ +% ^^A \begin{itemize} +% ^^A \item The |makefile| and related infrastructure +% ^^A has been replaced by the \prog{lwarpmk} utility. +% ^^A This provides increased portability, reduced dependencies, +% ^^A and much simpler installation and setup. +% ^^A \item The |lwarp-newproject| package is now used to locally create +% ^^A support files. +% ^^A \item The print and \HTML\ versions of a document may co-exist with their +% ^^A own sets of auxiliary files. +% ^^A \item Package handling is now controlled by a modular system which +% ^^A looks for and loads an |lwarp-| version if available. +% ^^A \item High-level source compatibility is provided for all supported +% ^^A packages, almost totally eliminating the need +% ^^A for |warpprint| and |warpHTML| environments. +% ^^A \item A large number of additional packages are supported. +% ^^A \item A new tutorial is included in the documentation, and +% ^^A many obsolete sections have been removed. +% ^^A \item \cs{NewHTMLdescription} sets the \HTML\ meta description tag for each file. +% ^^A See \cref{sec:htmldescription}. (v0.30 changes this to \cs{HTMLDescription}.) +% ^^A \item \cs{HTMLFilename} may now be empty, allowing filenames without a prefix. +% ^^A Lwarp no longer automatically appends a |-| character. +% ^^A \watchout +% ^^A For existing projects, add a |-| to the end of \cs{HTMLFilename}. +% ^^A \item \cs{HomeHTMLFilename} and \cs{HTMLFilename} no longer use +% ^^A escaped underscore\watchout\ +% ^^A characters. Underscores may be used in filenames as-is. +% ^^A (Version 0.30 changes these to package options |HomeHTMLFilename| and +% ^^A |HTMLFilename|.) +% ^^A \item \pkg{lwarp} now tries to auto-detect the operating system, +% ^^A and \cs{warpOSwindows} is only needed if the auto-detection +% ^^A fails to detect \brand{Windows}. (As of v0.30, \cs{warpOSwindows} has been converted to +% ^^A the \optn{OSWindows} option.) +% ^^A \item Tabular column types |@|, |>|, and |<| are now supported. +% ^^A \item |BlockClass| and \cs{InlineClass} add an optional style. +% ^^A \item The |sidebar| and |example| environments have been moved to the +% ^^A test suite, and are no longer included in \pkg{lwarp}. +% ^^A \end{itemize} +% ^^A \needspace{2\baselineskip} +% ^^A \item[v0.19:] \ +% ^^A \begin{itemize} +% ^^A \item \brand{MathJax} now may be used to display math via the \optn{mathjax} option. +% ^^A See \cref{sec:loading,sec:limitsmath}. +% ^^A To use \brand{MathJax} with a pre-existing project, +% ^^A \watchout +% ^^A copy or link the file |lwarp_mathjax.txt| to the project's directory. +% ^^A \item \cs{rule} added, supporting width, height, raise, \cs{textcolor}. +% ^^A \item \cs{LateximageFontSizeName} provides user-adjustable font size for math +% ^^A and \env{lateximage}s. +% ^^A \item \cs{minipagefullwidth} requests that the next minipage be +% ^^A full-width in \HTML, but still the assigned width in print. +% ^^A \item \env{minipage} improved side-by-side rendering. +% ^^A \item \CSS\ class |tablenotes| is provided for table note items. +% ^^A \item \cs{warpprintonly} replaces \cs{rowprintedonly}, +% ^^A and \cs{warpHTMLonly} is added. These behave like the \env{warpprint} +% ^^A \watchout +% ^^A and \env{warpHTML} environments, and are generally useful, so they replace +% ^^A the previously table-specific syntax. +% ^^A \item \pkg{cleveref} is loaded \cs{AtEndPreamble} for improved reliability. +% ^^A See \cref{sec:cleveref}. +% ^^A \item \cs{xfracHTMLfontsize} controls \pkg{xfrac} font size in \HTML. +% ^^A \item \tikz\ improved catcode handling. +% ^^A \end{itemize} +% ^^A \item[v0.18:] \ +% ^^A \begin{itemize} +% ^^A \item The \pkg{verse} package and the verse-related commands from +% ^^A the \pkg{memoir} package are now supported. +% ^^A \item Responsive web design has been improved for the side\TOC. +% ^^A \item \cs{includegraphics} now maintains relative sized for em, ex, and \%. +% ^^A \end{itemize} +% ^^A \item[v0.17:] \ +% ^^A \begin{itemize} +% ^^A \item \pkg{mdframed} package is supported. +% ^^A \end{itemize} +% ^^A \item[v0.16:] \ +% ^^A \begin{itemize} +% ^^A \item Font and input encoding are now controlled by the user, and +% ^^A \pkg{lwarp} is loaded after fonts have been selected. +% ^^A \item Support for \XeLaTeX{} and \LuaLaTeX. See \cref{sec:fonts}. +% ^^A \end{itemize} +% \end{description} +% +% \clearpage +% +% \section{Introduction} +% \label{sec:introduction} +% \changes{v0.19}{2016/05/25}{Introduction: \brand{MathJax} support mentioned.} +% +% The \pkg{lwarp} project aims to allow a rich \LaTeX{} document +% to be converted to a reasonable \HTMLfive\ +% interpretation, with only minor intervention on the user's part. +% No attempt has been made to force \LaTeX{} to provide for every +% \HTML-related possibility, and \HTML\ cannot exactly render every possible \LaTeX{} concept. +% Where compromise is necessary, it is desirable to allow the print output to remain +% typographically rich, and compromise only in the \HTML\ conversion. +% +% Several ``modern'' features of \HTMLfive, \CSSthree, and \SVG\ +% are employed to allow a fairly feature-rich document +% without relying on the use of \brand{Javascript}. +% Limited testing on older browsers shows that these new features +% degrade gracefully. +% +% \rulebreak +% +% \pkg{lwarp} is a native \LaTeX\ package, and operates by either patching or +% emulating various functions. Source-level compatibility is a major goal, but +% occasional user intervention is required in certain cases. +% +% As a package running directly in \LaTeX, \pkg{lwarp} has some advantages over +% other methods of \HTML\ conversion. \TeX\ itself is still used, allowing a +% wider range of \TeX\ trickery to be understood. +% Lua expressions are still available with \LuaTeX. +% Entire categories of +% \LaTeX\ packages work as-is when used with \pkg{lwarp}: +% definitions, file handling, utilities, internal data structures and calculations, +% specialized math-mode typesetting for various fields of science and engineering, +% and anything generating plain-text output. +% Blocks of \PDF\ output may be automatically converted to \SVG\ images +% while using the same font and spacing as the original print document, +% directly supporting \tikz\ and \env{picture}. +% Numerous packages are easily adapted for \HTML\ versions, either +% by loading and patching the originals, or by creating nullified or emulated +% replacements, and all without resorting to external programming. +% As a result, several hundred packages have already been adapted (\cref{tab:supported}), and +% an uncounted number more work as-is. +% +% Packages have been selected according to several criteria: perceived importance, +% popularity lists, recent CTAN updates, CTAN topics, mention in other packages, +% support by other \HTML\ conversion methods, +% and from sample documents taken from public archives. +% These include some ``obsolete'' packages as well.\footnote{An amazing number of +% decades-old packages are still in use today.} +% +% \rulebreak +% +% Assistance is also provided for modifying the \HTML\ output to suit the creation +% of \EPUB\ documents, and for modifying the \HTML\ output to ease import into +% a word processor. +% +% \rulebreak +% +% \prog{pdflatex}, \prog{xelatex}, or \prog{lualatex} may be used, +% allowing \pkg{lwarp} to process the usual image formats. +% While generating \HTML\ output, \SVG\ files are used in place of \PDF. +% Other formats such as \PNG\ and \JPG\ are used as-is. +% +% SVG images may be used for math, +% and are also used for \env{picture}, \tikz, and similar environments. +% The \SVG\ format has better browser and e-book support +% than \MathML\ (as of this writing), +% while still allowing for high-quality display and printing of images +% (again, subject to potentially +% bug-ridden\footnote{\brand{Firefox} has had an on-again/off-again bug +% for quite some time regareding printing \SVG{}s at high resolution.} browser +% support). +% +% Furthermore, \SVG\ images allow math to be presented with +% the same precise formatting as in the print version. +% Math is accompanied by \element{alt} tags holding the \LaTeX{} source for the expression, allowing it to be +% copy/pasted into other documents.\footnote{There seems to be some debate as to whether +% \MathML\ is actually an improvement over \LaTeX{} for sharing math. The author has no +% particular opinion on the matter, except to say that in this case \LaTeX{} is much easier to implement!} +% Custom \LaTeX{} macros may be used as-is in math expressions, since the math is evaluated +% entirely inside \LaTeX. +% An MD5 hash is used to combine multiple instances of the same inline math expression +% into a single image file, which then needs to be converted to \SVG\ only a single time. +% +% The \brand{MathJax} JavaScript display engine may be selected +% for math display instead of using \SVG\ images. +% Subject to browser support and Internet access, +% \brand{MathJax} allows an \HTML\ page to display +% math without relying on a large number of +% external image files.\footnote{One \SVG\ image +% file per math expression, except that duplicate inline math expressions are combined +% into a single file according to the MD5 hash function of its contents. +% A common scientific paper can easily include several thousand files, +% and in one case the MD5 hash cut the number of files in half and the rendering +% time by 30\%.} +% \pkg{lwarp} maintains \LaTeX\ control for cross-referencing +% and equation numbering, and attempts to force \brand{MathJax} to tag equations accordingly. +% +% \rulebreak +% +% A \prog{texlua} program called \prog{lwarpmk} is used to process either the print or \HTML\ +% version of the document. A few external utility programs are used to finish +% the conversion from a \LaTeX{}-generated \PDF\ file which happens to have \HTMLfive\ tags, +% to a number of \HTMLfive\ plain-text files and accompanying images. +% +% \pkg{lwarp} automatically generates the extra files necessary for +% the \HTML\ conversion, such as \CSS\ and |.xdy| files, and configuration files +% for the utility \prog{lwarpmk}. +% Also included is a parallel version of the user's source document, +% |-html.tex|, which selects \HTML\ output and then inputs the user's own source. +% This process allows both the printed and \HTML\ versions to co-exist side-by-side, +% each with their own auxiliary files. +% +% When requesting packages during \HTML\ conversion, +% \pkg{lwarp} first looks to see if it has its own modified version +% to use instead of the standard \LaTeX\ version. +% These |lwarp-packagename.sty| files contain +% code used to emulate or replace functions for \HTML\ output. +% +% +% \clearpage +% +% \subsection{Typesetting conventions} +% +% Font weight, family, and style are used to indicate various objects: +% +% \begin{table}[hbp] +% \caption{Typesetting conventions} +% \centering +% \begin{tabular}{lp{3in}} +% \toprule +% \pkg{package} & \LaTeX\ package. \\ +% \prog{program} & Program's executable name. \\ +% \optn{option} & Program or package option. \\ +% \midrule +% \filenm{filename} & File name in the operating system. \\ +% \brand{Brand Name} & Proper name for a program, operating system, etc. \\ +% \midrule +% \cmds{commands} & Commands to be entered by the user. \\ +% \progcode{code} & Program code. \\ +% \cs{macroname} & \LaTeX\ macro. \\ +% \env{environment} & \LaTeX\ environment. \\ +% \ctr{counter} & \LaTeX\ counter. \\ +% \bool{boolean} & \LaTeX\ boolean. \\ +% \midrule +% \element{element} & \HTML\ element. \\ +% \attribute{attribute} & \HTML\ attribute. \\ +% \midrule +% \UI{User Interface} & A user-interface item. \\ +% \acro{ACRO} & Acronym. \\ +% \bottomrule +% \end{tabular} +% \end{table} +% +% \clearpage +% +% \subsection{Supported packages and features} +% +% \changes{v0.15}{2016/04/05}{Docs: Moved the supported features table to the introduction.} +% \changes{v0.38}{2017/08/22}{Docs: Enhanced \protect\textit{Supported Features} table.} +% +% \Cref{tab:supported} lists some of the various \LaTeX{} features and packages +% which may be used. +% +% Package names are colored according to their support level: +% \begin{description} +% \item[\spkg{name}:] Supported as-is. +% \item[\mpkg{name}:] Modifed to work with \HTML\ output, and also +% as print output in \SVG\ math or \env{lateximage} environments. +% \item[\epkg{name}:] Emulated for \HTML\ output. +% \item[\ipkg{name}:] Ignored for \HTML\ output, but provides source-level compatibility. +% \end{description} +% +% \renewcommand{\arraystretch}{1.5} +% +% \begingroup +% \setlength{\parindent}{0em} +% \setlength{\parskip}{2ex} +% +% ^^A *supported features +% +% \begin{longtable}{>{\raggedright}p{.3\linewidth}p{.6\linewidth}} +% \caption{\LaTeX\ \pkg{lwarp} package --- Supported features\label{tab:supported}} \endfirsthead +% \warpprintonly{\multicolumn{2}{c}{\pkg{lwarp} Supported Functions --- continued} \\ +% Category & Status \\ \toprule \endhead} +% +% \toprule +% +% Category & Status and supported features. \\ +% +% \midrule +% +% Engines: & \DVI\ \LaTeX, pdf\LaTeX, \XeLaTeX, \LuaLaTeX, up\LaTeX \\ +% +% Compiling: & \prog{latexmk}, \prog{perltex}, \prog{pythontex}, \prog{make}, etc. \\ +% +% \midrule +% +% Classes: & \pkg{article}, \pkg{book}, \pkg{report}, +% \pkg{scrartcl}, \pkg{scrbook}, \pkg{scrreprt}, \pkg{memoir}, +% CJK-related as listed below. \\ +% +% Koma-script: & \epkg{scrextend}, \ipkg{scrhack}, \epkg{scrlayer}. +% Others as listed below. \\ +% +% Memoir: & \ipkg{memhfixc} \\ +% +% \midrule +% +% Languages: & \spkg{babel}, \spkg{polyglossia}. +% \spkg{cjkpunct}, \spkg{xeCJK}.\\ +% +% Chinese: & C\TeX, \spkg{ctex}, +% \spkg{upzhkinsoku}, +% \mpkg{xpinyin}, \ipkg{zhlineskip}, \spkg{zhspacing}. \\ +% +% Japanese: & up\LaTeX, Lua\TeX-ja, \ipkg{gentombow}, \mpkg{lltjext}, +% \spkg{plarray}, \epkg{plarydshln}, \spkg{plautopatch}, +% \mpkg{plext}, \spkg{plextarray}, \epkg{plextarydshln}, +% \epkg{plextcolortbl}, \spkg{plextdelarray}, \ipkg{pxatbegshi}, +% \ipkg{pxeveryshi}, \ipkg{pxftnright}, \spkg{pxgentombow}, +% \ipkg{pxjahyper}, \spkg{pxpdfpages}, \spkg{pxpgfrcs}, \spkg{pxpgfmark}, +% \epkg{tascmac}, \spkg{zxjatype}. +% \spkg{bxjsarticle} and related, +% \spkg{ltjsarticle} and related, +% \spkg{luatexja}, \spkg{luatexja-fontspec}, +% \spkg{ujarticle} and related, +% \spkg{utarticle} and related. \\ +% +% Korean: & \spkg{kotex}, \spkg{luatexko}, \spkg{xetexko}. \\ +% +% \midrule +% +% Page layout: & \ipkg{2in1}, \ipkg{2up}, \ipkg{a4}, \ipkg{a4wide}, \ipkg{a5comb}, +% \ipkg{addlines}, \ipkg{anysize}, \mpkg{atbegshi}, +% \ipkg{blowup}, \ipkg{booklet}, \ipkg{bophook}, \ipkg{bounddvi}, \ipkg{bxpapersize}, +% \ipkg{canoniclayout}, \mpkg{changelayout}, +% \epkg{changepage}, \ipkg{chngpage}, \ipkg{clrdblpg}, +% \ipkg{continue}, \ipkg{draftcopy}, \ipkg{draftfigure}, \ipkg{draftwatermark}, +% \ipkg{ebook}, \ipkg{everyshi}, +% \mpkg{fancyhdr}, \ipkg{fancytabs}, \ipkg{flippdf}, +% \ipkg{fullminipage}, \ipkg{fullpage}, +% \ipkg{fwlw}, \ipkg{geometry}, \ipkg{gmeometric}, +% \ipkg{grid}, \mpkg{grid-system}, \ipkg{gridset}, +% \ipkg{layaureo}, \ipkg{layout}, \ipkg{layouts}, \ipkg{leading}, +% \ipkg{ltxgrid}, \ipkg{nccfancyhdr}, \ipkg{notespages}, \ipkg{nowidow}, +% \ipkg{pagegrid}, \ipkg{pagesel}, \ipkg{pdfcrypt}, \ipkg{pdfprivacy}, +% \ipkg{preview}, \epkg{ragged2e}, \ipkg{rmpage}, +% \epkg{scrlayer-scrpage}, \epkg{scrpage2}, \epkg{setspace}, +% \ipkg{textarea}, \ipkg{threadcol}, +% \ipkg{thumb}, \ipkg{thumbs}, \ipkg{titleps}, \ipkg{tocenter}, +% \ipkg{turnthepage}, \ipkg{twoup}, \ipkg{typearea}, +% \ipkg{underlin}, \ipkg{vmargin}, +% \ipkg{watermark}, \ipkg{widows-and-orphans}, \ipkg{zwpagelayout}. +% \\ +% +% \midrule +% +% Sectioning: & Adds \progcode{FileDepth} for splitting the \HTML\ output. +% Files may be numbered sequentially or named according to section name. +% Common short words and punctuation are removed from the filenames. +% \epkg{anonchap}, \ipkg{bsheaders}, \ipkg{fncychap}, \epkg{hypbmsec}, +% \epkg{indentfirst}, \epkg{quotchap}, +% \ipkg{section}, \mpkg{sectionbreak}, \spkg{secdot}, \ipkg{sectsty}, \ipkg{titlesec}. +% \\ +% +% Table of contents, figures, tables: & Supported, with hyperlinks. +% \ipkg{minitoc}, \ipkg{multitoc}, \spkg{shorttoc}, \ipkg{titletoc}, +% \ipkg{tocbasic}, \mpkg{tocbibind}, \mpkg{tocdata}, +% \ipkg{tocloft}, \ipkg{tocstyle}. \\ +% +% Title page: & \cs{maketitle}, \env{titlepage}, \mpkg{authblk}, \mpkg{titling}. \\ +% +% Front \&\ back matter: & \mpkg{abstract}, \mpkg{appendix}. \\ +% +% Indexing: & \prog{makeindex} and \prog{xindy} are supported, with hyperlinks. +% +% \spkg{hvindex}, \epkg{idxlayout}, \mpkg{imakeidx}, \epkg{index}, \mpkg{makeidx}, +% \epkg{repeatindex}, \mpkg{splitidx}. +% \\ +% +% Glossary: & \mpkg{gloss}, \mpkg{glossaries} and \prog{xindy}, \mpkg{nomencl}.\\ +% +% Bibliography: & \spkg{babelbib}, \mpkg{backref}, \mpkg{biblatex}, \mpkg{bibunits}, +% \mpkg{chapterbib}, \mpkg{cite}, \ipkg{hypernat}, \mpkg{natbib}, +% \spkg{notes2bib}, \ipkg{showtags}. +% +% \\ +% +% \midrule +% +% Cross-references: & +% \ipkg{bookmark}, \epkg{breakurl}, \spkg{cleveref}, \epkg{fancyref}, +% \ipkg{hypdestopt}, \epkg{hyperref}, \epkg{perpage}, \mpkg{prettyref}, +% \epkg{titleref}, \mpkg{url}, \spkg{varioref}, \mpkg{xr}, \mpkg{xr-hyper}, +% \ipkg{xurl}. \\ +% +% \midrule +% +% Margin notes: & \ipkg{marginal}, \ipkg{marginfit}, \ipkg{marginfix}, +% \epkg{scrlayer-notecolumn}, \epkg{versonotes}. \\ +% +% Footnotes: & Adds \progcode{FootnoteDepth} to print footnotes at section breaks. +% \epkg{bigfoot}, \ipkg{dblfnote}, +% \ipkg{endheads}, \mpkg{endnotes}, \spkg{fixfoot}, +% \ipkg{fnbreak}, \ipkg{fnpara}, \ipkg{fnpos}, +% \epkg{footmisc}, \mpkg{footnote}, \ipkg{footnotebackref}, +% \mpkg{footnoterange}, \ipkg{footnpag}, \epkg{manyfoot}, +% \epkg{marginnote}, \spkg{nccfoots}, \spkg{pagenote}, +% \mpkg{parnotes}, \ipkg{pfnote}, \spkg{sepfootnotes}, +% \mpkg{sidenotes}, \ipkg{tablefootnote}. +% \\ +% +% \midrule +% +% Math: & Converted to \SVG\ images with \HTML\ \element{alt} tags containing the +% \LaTeX\ source for the math expression. +% \brand{MathJax} supported as an alternative. +% \mpkg{amsmath}: \AmS\ environments are supported. +% User-defined macros are available during converson, +% due to native \LaTeX\ processing.\\ +% +% Theorems: & Native \LaTeX\ theorems, +% \mpkg{amsthm}, \mpkg{ntheorem}, \mpkg{theorem}. \\ +% +% Additional math: & Math fonts via \SVG\ images, +% \spkg{amscd}, \ipkg{autonum}, \mpkg{backnaur}, \spkg{bm}, \spkg{braket}, +% \mpkg{breqn}, \mpkg{cases}, \spkg{delarray}, \spkg{guass}, \spkg{jkmath}, +% \mpkg{mathtools}, \spkg{nicematrix}, \spkg{pb-diagram}, \ipkg{resizegather}, +% \mpkg{xfakebold}, \mpkg{xy}. +% Many others work as-is. \\ +% +% Display math with \cs{displaymathother}: & % +% Complicated math objects in display math, such as \spkg{tikz-cd}, etc. \\ +% +% \midrule +% +% Units and fractions: & +% \mpkg{nicefrac}, \mpkg{SIunits}, \mpkg{siunitx}, +% \mpkg{units}, \mpkg{unitsdef}, \mpkg{xfrac}. \\ +% +% \midrule +% +% Floats: & Appear where declared. +% \spkg{capt-of}, \mpkg{caption}, \epkg{cutwin}, +% \ipkg{dblfloatfix}, \ipkg{endfloat}, \ipkg{fix2col}, \ipkg{flafter}, +% \epkg{float}, \epkg{floatflt}, \epkg{floatrow}, \ipkg{fltrace}, \ipkg{ftcap}, +% \ipkg{hypcap}, \mpkg{keyfloat}, \ipkg{morefloats}, \ipkg{multicap}, \spkg{newfloat}, +% \epkg{nonfloat}, \ipkg{placeins}, \epkg{rotfloat}, \ipkg{stfloats}, +% \mpkg{subcaption}, \mpkg{subfig}, \epkg{subfigure}, \spkg{subfloat}, +% \epkg{topcapt}, \epkg{trivfloat}, \epkg{wrapfig}. \\ +% +% \midrule +% +% Tabular: & +% \env{tabular} environment, \mpkg{array}, \epkg{arydshln}, +% \mpkg{bigdelim}, \mpkg{booktabs}, +% \mpkg{colortbl}, \mpkg{ctable}, \mpkg{diagbox}, \epkg{longtable}, +% \epkg{ltablex}, \epkg{ltxtable}, +% \mpkg{multirow}, \epkg{supertabular}, \epkg{tabularx}, \epkg{tabulary}, +% \epkg{threeparttable}, \mpkg{threeparttablex}, \epkg{xltabular}, \epkg{xtab}. \\ +% +% \midrule +% +% Graphics: & \mpkg{graphics} and \epkg{graphicx}. +% \cs{includegraphics} supports \optn{width}, \optn{height}, +% \optn{origin}, \optn{angle}, and \optn{scale} tags, and adds \optn{class}. +% References to \PDF\ files are changed to \SVG, other image types +% are accepted as well. +% \cs{rotatebox} and \cs{scalebox} are supported as well as \HTML\ can handle. +% \epkg{rotating} is emulated but all objects are unrotated. +% \env{picture}, \mpkg{tikz}, and \mpkg{xy} are converted to an \SVG\ image. +% +% \mpkg{asymptote}, \spkg{curves}, \spkg{datatool}, +% \spkg{eepic}, \epkg{epsfig}, \spkg{epstopdf}, +% \epkg{figsize}, \ipkg{fitbox}, +% \spkg{grffile}, \epkg{media9}, \epkg{movie15}, \epkg{multimedia}, \mpkg{overpic}, +% \mpkg{psfrag}, \mpkg{psfragx}, \mpkg{pst-eps}, \mpkg{pstool}, \mpkg{pstricks}, +% \spkg{rviewport}, \spkg{tikz-3dplot}. \\ +% +% \midrule +% +% \mpkg{xcolor}: & \textcolor{DarkGreen}{Full package color names}, any color models, +% and \textcolor{Goldenrod}{mixing}. +% \textcolor{Maroon}{\cs{textcolor}}, +% \colorbox{LightSteelBlue}{\cs{colorbox}}, +% \fcolorbox{red}{NavajoWhite}{\cs{fcolorbox}}. +% Enhanced for \HTML\ compatibility. \\ +% +% \midrule +% +% Lists: & Standard \LaTeX\ environments, +% \spkg{enumerate}, \mpkg{enumitem}, \epkg{eqlist}, \epkg{hang}, +% \ipkg{listliketab}, \mpkg{paralist}.\\ +% +% \midrule +% +% Environments: & Standard \LaTeX{} environments. \\ +% +% \env{minipage}, \cs{parbox}: & Some \HTMLfive-imposed limitations. +% Nested minipages are supported. \mpkg{eqparbox}, \mpkg{minibox}, \epkg{pbox}, +% \ipkg{shapepar}. \\ +% +% Quotations: & \epkg{copyrightbox}, \spkg{csquotes}, \epkg{epigraph}, +% \mpkg{quoting}, \mpkg{verse}. \\ +% +% Verbatim: & +% \mpkg{fancyvrb}, \mpkg{moreverb}, \spkg{shortvrb}, \mpkg{verbatim}. \\ +% +% Frames: & \mpkg{boxedminipage2e}, \mpkg{fancybox}, \mpkg{framed}, \mpkg{mdframed}, +% \epkg{niceframe}, \epkg{shadow}, \epkg{vertbars}. \\ +% +% Multi-columns: & \epkg{adjmulticol}, \epkg{multicol}, +% \ipkg{multicolrule}, \mpkg{vwcol}. \\ +% +% Margins: & \epkg{fullwidth}, \epkg{hanging}, \epkg{midpage}. \\ +% +% Line numbering: & \ipkg{fnlineno}, \ipkg{lineno}. \\ +% +% \midrule +% +% Direct formatting: & \cs{emph}, \cs{textsuperscript}, +% \cs{textbf}, etc are supported. +% \cs{bfseries}, etc.\ are only supported in some cases. +% \mpkg{cancel}, \epkg{ellipsis}, \mpkg{embrac}, \spkg{enparen}, +% \ipkg{hyphenat}, \epkg{lettrine}, \epkg{lips}, +% \ipkg{lua-check-hyphen}, \ipkg{luacolor}, +% \epkg{magaz}, \ipkg{pdfrender}, \epkg{realscripts}, \mpkg{relsize}, +% \ipkg{scalefnt}, \epkg{soul}, \epkg{soulpos}, \epkg{soulutf8}, \mpkg{stackengine}, +% \epkg{textfit}, \epkg{thinsp}, \ipkg{trimclip}, \ipkg{truncate}, +% \mpkg{ulem}, \mpkg{umoline}, \ipkg{underscore}, \ipkg{uspace}, +% \mpkg{xellipsis}. \\ +% +% Acronyms: & \mpkg{acro}, \mpkg{acronym}. \\ +% +% Ordinals: & \spkg{engord}, \spkg{fmtcount}, \spkg{nth}. \\ +% +% Text ligatures: & Ligatures for symbols are supported. +% Ligatures for f, q, t are intentionally turned off +% because many simpler browsers do not display them correctly. +% Modern full-featured browsers re-create these ligatures on-the-fly.\\ +% +% Horizontal space: & +% \HTML\ output for thin-unbreakable, unbreakable, +% \cs{enskip}, \cs{quad}, \cs{qquad}, \cs{hspace}. \\ +% +% Rules: & \cs{rule} with width, height, raise, text color. \\ +% +% \HTML\ reserved characters: & \cs{\&}, \cs{textless}, and +% \cs{textgreater} are converted to \HTML\ entities. \\ +% +% \midrule +% +% Fonts: & Used as-is. +% Appear in \SVG\ math expressions or embedded image environments. +% \mpkg{fontaxes}, \mpkg{nfssext-cfr}, \mpkg{slantsc}, \ipkg{tabfigures}. +% +% Tested to work as-is: Special font macros in \spkg{cfr-lm} and others +% which use \spkg{nfssext-cfr}. \\ +% +% Symbols: & Native \LaTeX\ diacriticals, \mpkg{academicons}, \mpkg{bbding}, +% \mpkg{chemgreek}, \mpkg{dingbat}, \spkg{euro}, \mpkg{eurosym}, +% \mpkg{fontawesome}, \mpkg{fontawesome5}, \spkg{gensymb}, \mpkg{marvosym}, +% \mpkg{metalogo}, \mpkg{metalogox}, +% \mpkg{pifont}, \spkg{textalpha}, +% \mpkg{textcomp}, \spkg{textgreek}, \mpkg{typicons}, \mpkg{xunicode}. +% \\ +% +% \midrule +% +% Files: & +% \mpkg{attachfile}, \mpkg{attachfile2}, \ipkg{hyperxmp}, +% \mpkg{inputtrc}, \epkg{intopdf}, +% \mpkg{pdfpages}, \ipkg{pdfx}, \ipkg{xmpincl}. \\ +% +% \midrule +% +% Science and engineering: & +% \mpkg{algorithm2e}, \mpkg{algorithmicx}, \mpkg{ar}, \spkg{askmaps}, +% \mpkg{axodraw2}, \mpkg{bitpattern}, \spkg{blochsphere}, \spkg{bodegraph}, +% \spkg{bohr}, \mpkg{bytefield}, +% \mpkg{chemfig}, \mpkg{chemformula}, \mpkg{chemgreek}, +% \mpkg{chemmacros}, \mpkg{chemnum}, +% \spkg{circuitikz}, \spkg{elements}, \spkg{engtlc}, \spkg{fast-diagram}, +% \spkg{hepnicenames}, \spkg{heppennames}, \spkg{karnaughmap}, \mpkg{karnaugh-map}, +% \mpkg{listings}, \spkg{linop}, \mpkg{mhchem}, \spkg{pgfgantt}, +% \mpkg{phfqit}, \spkg{physics}, \spkg{qcircuit}, \mpkg{register}, \spkg{simpler-wick}, +% \spkg{slashed}, \spkg{structmech}, \mpkg{struktex}. +% \spkg{tikz-karnaugh}, \spkg{tikzcodeblocks} \\ +% +% \midrule +% +% Arts and humanities: & \mpkg{foreign}, \mpkg{forest}, +% \mpkg{lyluatex}, \mpkg{musicography}, +% \mpkg{nameauth}, \mpkg{octave}, \spkg{phonrule}, \spkg{piano}, +% \mpkg{schemata}, \mpkg{semantic-markup}, \spkg{tikz-dependency}, +% \mpkg{vowel}, \mpkg{xpiano} \\ +% +% \midrule +% +% Admonitions: & \epkg{notes}. \\ +% +% Editorial: & \ipkg{changebar}, \spkg{changelog}, \mpkg{changes}, +% \mpkg{easy-todo}, \spkg{easyReview}, \mpkg{ed}, \mpkg{errata}, \mpkg{fixme}, +% \mpkg{fixmetodonotes}, +% \ipkg{pdfcomment}, \ipkg{pdfmarginpar}, +% \mpkg{todo}, \mpkg{todonotes}, \epkg{tram}, \ipkg{xechangebar}. +% \\ +% +% \midrule +% +% Accessibility: & \ipkg{accsupp}, \ipkg{axessibility}. \\ +% +% \midrule +% +% Debug: & \ipkg{chkfloat}, \ipkg{cmdtrack}, \ipkg{dprogress}, +% \ipkg{lua-visual-debug}, \ipkg{refcheck}, +% \ipkg{srcltx}, \ipkg{srctex}, \ipkg{vpe}, \ipkg{xbmks}. \\ +% +% \midrule +% +% Working as-is: & +% Various utility, calculation, file, and text-only packages, such as +% \spkg{calc}, +% \spkg{fileerr}, +% \spkg{somedefs}, +% \spkg{trace}, +% \spkg{xspace}. +% Also, most math-only packages, including specialized typesetting for +% various fields of science and engineering. \\ +% +% \bottomrule +% +% \end{longtable} +% +% \endgroup +% +% +% +% \clearpage +% +% \section{Alternatives} +% +% Summarized below are several other ways to convert a \LaTeX{} or other document to \HTML. +% Where an existing \LaTeX{} document is to be converted to \HTML, \pkg{lwarp} may be +% a good choice. For new projects with a large number of documents, it may be worth +% investigating the alternatives before decided which path to take. +% +% \subsection{\pkg{internet} class} +% +% \changes{v0.21}{2017/02/15}{Docs: Added \pkg{internet} class.} +% +% The closest to \pkg{lwarp} in design principle is the +% \DescribeClass{internet} +% \verb+internet+ class by Andrew Stacey \Dash +% an interesting project which directly produces several versions +% of markdown, and also \HTML\ and \EPUB. +% \url{https://github.com/loopspace/latex-to-internet} +% +% +% +% \subsection{\brand{TeX4ht}} +% +% \url{http://tug.org/tex4ht/}\DescribeProgram{TeX4ht}\DescribeProgram{htlatex} +% +% \bigskip\noindent +% This system uses native \LaTeX{} processing to produce a \DVI\ file containing special commands, +% and then uses additional post-processing for the \HTML\ conversion by way of numerous configuration +% files. +% In some cases \pkg{lwarp} provides a better \HTML\ conversion, and it supports +% a different set of packages. +% TeX4ht produces several other forms of output beyond \HTML, including \ODT\ and +% a direct path to \EPUB, and is still being developed. +% +% \subsection{Translators} +% +% \changes{v0.21}{2017/02/14}{Docs: Added TeX2page, GladTeX.} +% +% These systems use external programs to translate a subset of \LaTeX{} syntax into \HTML. +% Search for each on \CTAN\ (\url{http:\\ctan.org}). +% \begin{description} +% \item [H\textsuperscript{E}v\textsuperscript{E}a:] \url{http://hevea.inria.fr/} +% \DescribeProgram{Hevea} {\footnotesize(not on \CTAN)} +% \item [T\textsubscript{T}H:] \url{http://hutchinson.belmont.ma.us/tth/} +% \DescribeProgram{TtH} +% \item [GELLMU:] \url{http://www.albany.edu/~hammond/gellmu/} +% \DescribeProgram{GELLMU} +% \item [\LaTeX{}ML:] \url{http://dlmf.nist.gov/LaTeXML/} +% \DescribeProgram{LaTeXML} +% \item [PlasTeX:] \url{https://github.com/tiarno/plastex} +% \DescribeProgram{Plastex} +% \item [\LaTeX2HTML:] \url{http://www.latex2html.org/} +% \DescribeProgram{LaTeX2HTML} \\ +% and \url{http://ctan.org/pkg/latex2html}. +% \item [\TeX2page:] \url{http://ds26gte.github.io/tex2page/index.html} \DescribeProgram{TeX2page} +% \end{description} +% Finally, Glad\TeX\ may used to directly insert \LaTeX\ math into \HTML: +% \begin{description} +% \item [Glad\TeX:] \url{http://humenda.github.io/GladTeX/} \DescribeProgram{GladTeX} +% \end{description} +% +% \subsection{\brand{AsciiDoc} and \brand{Asciidoctor}} +% +% AsciiDoc is one of the most capable markup languages, providing enough features to produce +% the typical technical-writing document with cross-references, +% and it writes \LaTeX{} and \HTML. +% \begin{description} +% \item [Asciidoctor:] \url{http://asciidoctor.org/} (More active.)\DescribeProgram{AsciiDoc} +% \item [AsciiDoc:] \url{http://asciidoc.org/} (The original project.)\DescribeProgram{AsciiDoctor} +% \end{description} +% +% \subsubsection{\brand{Asciidoctor-\LaTeX}} +% The Asciidoctor-LaTeX project is developing additional \LaTeX{}-related features. +% \begin{description} +% \item [Asciidoctor-LateX:] ~ \\ +% \url{http://www.noteshare.io/book/asciidoctor-latex-manual} \\ +% \url{https://github.com/asciidoctor/asciidoctor-latex} +% \DescribeProgram{Asciidoctor-LaTeX} +% \end{description} +% +% \subsection{\brand{Pandoc}} +% \DescribeProgram{Pandoc} +% A markup system which also reads and writes \LaTeX{} and \HTML. +% \begin{description} +% \item [Pandoc:] \url{http://pandoc.org/} +% \end{description} +% +% (Watch for improvements in cross-references to figures and tables.) +% +% \subsection{Word processors} +% +% It should be noted that the popular word processors +% \DescribeProgram{Word}\DescribeProgram{LibreOffice}\DescribeProgram{OpenOffice} +% have advanced through the years in their abilities +% to represent math with a \LaTeX-ish input syntax, unicode math fonts, +% and high-quality output, and also generate \HTML\ with varying success. +% See recent developments in \brand{Microsoft}\,\supregistered\ \prog{Word}\,\supregistered{} +% and \brand{LibreOffice}\,\texttrademark\ \prog{Writer}. +% +% \subsection{Commercial systems} +% +% Likewise, several professional systems exist whose +% \DescribeProgram{Adobe} \DescribeProgram{FrameMaker} +% \DescribeProgram{InDesign} \DescribeProgram{Flare} \DescribeProgram{Madcap} +% abilities have been advancing in the areas of typesetting, cross-referencing, and \HTML\ generation. +% See \brand{Adobe}\,\supregistered{} \prog{FrameMaker}\,\supregistered{}, +% \brand{Adobe} \prog{InDesign}\,\supregistered, +% and \brand{Madcap} \prog{Flare}\,\texttrademark. +% +% \subsection{Comparisons} +% \gindex{markup languages} +% +% AsciiDoc, Pandoc, and various other markup languages typically have a syntax which tries to be +% natural and human-readable, but the use of advanced features tends to require +% many combinations of special characters, resulting in a complicated mess of syntax. +% By contrast, \LaTeX{} spells things out in readable words but takes longer to type, although +% integrated editors exist which can provide faster entry and a graphic user interface. +% For those functions which are covered by the typical markup language +% it is arguable that \LaTeX{} is comparably easy to learn, while \LaTeX{} provides many more advanced +% features where needed, along with a large number of pre-existing packages which provide solutions +% to numerous common tasks. +% +% Text-based document-markup systems share some of the advantages of \LaTeX{} vs.\ a typical word +% processor. Documents formats are stable. The documents themselves are portable, +% work well with revision control, +% do not crash or become corrupted, and are easily generated under program control. +% Formatting commands are visible, +% cross-referencing is automatic, and editing is responsive. +% Search/replace with regular expressions provides a powerful tool for +% the manipulation of both document contents and structure. +% Markup systems and some commercial systems allow printed output +% through a \LaTeX{} back end, yielding high-quality results especially when the \LaTeX{} +% template is adjusted, but they lose the ability to use \LaTeX{} macros and +% other \LaTeX{} source-document features. +% +% The effort required to customize the output of each markup system varies. +% For print output, \LaTeX{} configuration +% files are usually used. For \HTML\ output, a \CSS\ file will be available, but additional +% configuration may require editing some form of control file with a different syntax, such as XML. +% In the case of \pkg{lwarp}, \CSS\ is used, and much \HTML\ output is adjusted +% through the usual \LaTeX\ optional macro parameters, +% but further customization may require patching \LaTeX{} code. +% +% The popular word processors and professional document systems each has a large +% base of after-market support including pre-designed styles and templates, and often include +% content-management systems for topic reuse. +% +% +% +% +% \clearpage +% +% \setlength{\parindent}{0em} +% \setlength{\parskip}{2ex} +% +% \section{Installation} +% +% \Cref{tab:utility} shows the tools which are used for +% the \LaTeX\ to \HTML\ conversion. +% In most cases, these will be available via the +% standard package-installation tools. +% +% Detailed installation instructions follow. +% +% \gindex{utility>programs} +% \gindex{programs>utility} +% +% \begin{table}[hbp] +% \changes{v0.45}{2017/11/30}{Docs: Moved table so doesn't interfere with install docs.} +% \caption{Required software programs\label{tab:utility}} +% \hrule +% \begin{description} +% +% \item[Provided by your \LaTeX\ distribution:] \ +% +% From \TeX{}Live: \url{http://tug.org/texlive/}. +% +% \begin{description} +% +% \item[\LaTeX:] \prog{pdflatex}, \prog{xelatex}, or \prog{lualatex}. +% \DescribeProgram[requirement]{pdfLaTeX} +% \DescribeProgram[requirement]{XeLaTeX} +% \DescribeProgram[requirement]{LuaLaTeX} +% +% \item[The \pkg{lwarp} package:] This package. +% +% \item[The \prog{lwarpmk} utility:] Provided along with this package. This +% should be an operating-system executable in the same way that +% \prog{pdflatex} or \prog{latexmk} is. It is possible to have the +% \pkg{lwarp} package generate a local copy of \prog{lwarpmk} +% called \filenm{lwarpmk.lua}. +% See \cref{sec:genlatexmk}. +% +% \item[\prog{luatex}:] Used by the \prog{lwarpmk} program to simplify and automate document generation. +% +% \item [\prog{xindy}:] The \prog{xindy} program is used by \pkg{lwarp} to create +% indexes. On a MiK\TeX\ system this may have to be acquired separately, +% but it is part of the regular installer as of mid 2015. +% +% \item[\prog{latexmk}:] Optionally used by \prog{lwarpmk} to compile \LaTeX\ code. +% On a MiK\TeX\ system, \prog{Perl} may need to be installed first. +% +% \item[\prog{pdfcrop}:] Used to pull images out of the \LaTeX{} \PDF. +% \DescribeProgram[requirement]{pdfcrop} +% +% \end{description} +% +% \item[\brand{Poppler} \PDF\ utilities:] \ +% +% \begin{description} +% +% \item[\prog{pdftotext}:] Used to convert \PDF\ to text. +% \DescribeProgram[requirement]{pdftotext}\gindex{Poppler=\brand{Poppler}} +% +% \item[\prog{pdfseparate}:] Used to pull images out of the \LaTeX{} \PDF. +% \DescribeProgram[requirement]{pdfseparate} +% +% \item[\prog{pdftocairo}:] Used to convert images to \SVG. +% \DescribeProgram[requirement]{pdftocairo} +% +% \end{description} +% +% These might be provided by your operating-system package manager, +% and MiK\TeX\ provides \pkg{miktex-poppler-bin-*} packages. +% +% From \brand{Poppler}: \url{poppler.freedesktop.org}. +% +% For \brand{MacOS}\supregistered, see +% \url{https://brew.sh/}, install \prog{Homebrew}, then +% \userentry{brew install poppler} +% +% For \brand{Windows}, see Mik\TeX\ \pkg{miktex-poppler-bin-*}, or: \\ +% \url{https://sourceforge.net/projects/poppler-win32/} \quad and: \\ +% \url{http://blog.alivate.com.au/poppler-windows/} +% +% \item[\prog{Perl}:] \ +% +% This may be provided by your operating-system package manager, and may be +% required for some of the \brand{Poppler} \PDF\ utilities. +% +% \url{strawberryperl.com} (recommended), \url{perl.org} +% +% \item[Automatically downloaded from the internet as required:] \ +% \begin{description} +% +% \item[\brand{MathJax}:] Optionally used to display math. +% From: \url{mathjax.org} +% \DescribeProgram[requirement]{MathJax} +% +% \end{description} +% \end{description} +% +% \hrule +% \end{table} +% \clearpage +% +% \subsection{Installing the \pkg{lwarp} package} +% +% There are several ways to install \pkg{lwarp}. These are listed here +% with the preferred methods listed first: +% +% \begin{description} +% \raggedright +% +% \item [Pre-installed:] Try entering into a command line: +% \userentry{kpsewhich lwarp.sty} +% +% If a path to |lwarp.sty| is shown, then \pkg{lwarp} is already installed and +% you may skip to the next section. +% +% \item [\TeX\ Live:] If using a \TeX\ Live distribution, +% try installing via \prog{tlmgr}: +% \userentry{tlmgr install lwarp} +% +% \item [MiK\TeX:] \ +% \begin{enumerate} +% \item For newer versions of MiK\TeX, install or update \pkg{lwarp} +% using the \prog{MiKTeX Console} program. +% \changes{v0.62}{2018/11/03}{Docs: \prog{MiKTeX Console}} +% \item For older versions of MiK\TeX, +% to install \pkg{lwarp} the first time, +% use the \prog{MiKTeX Package Manager (Admin)}. +% To update \pkg{lwarp}, use \prog{MiKTeX Update (Admin)}. +% \item Either way, also update the package \pkg{miktex-misc}, which will install and +% update the \prog{lwarpmk} executable. +% \end{enumerate} +% \changes{v0.26}{2017/03/23}{Docs: Improved MiK\TeX\ install instructions.} +% \changes{v0.45}{2017/11/30}{Docs: Improved MiK\TeX\ install instructions.} +% \changes{v0.62}{2018/11/03}{Docs: Improved MiK\TeX\ install instructions.} +% +% \item [Operating-system package:] The operating-system package manager may +% already have \pkg{lwarp}, perhaps as part of a set of \TeX-related packages. +% +% \item [CTAN TDS archive:] \pkg{lwarp} may be downloaded from the Comprehensive \TeX\ Archive: +% \begin{enumerate} +% \item See \url{http://ctan.org/pkg/lwarp} for the \pkg{lwarp} package. +% \item Download the \TDS\ archive: |lwarp.tds.zip| +% \item Find the \TeX\ |local| directory: +% \begin{description} +% \item[\TeX\ Live:] \ +% +% \userentry{kpsewhich -var-value TEXMFLOCAL} +% \item[MiK\TeX:] \ +% +% In the \UI{Settings} window, \UI{Roots} tab, look for a local \TDS\ root. +% \end{description} +% This should be something like: +% \begin{sourceverb} +% /usr/local/texlive/texmf-local/ +% \end{sourceverb} +% \item Unpack the archive in the \TDS\ local directory. +% \item Renew the cache: +% \userentry{mktexlsr} \quad —\,or\,— +% \userentry{texhash} +% +% Or, for \brand{Windows} MiK\TeX, start the program called \prog{MiKTeX Settings (Admin)} +% and click on the button called \UI{Refresh FNDB}. +% \end{enumerate} +% +% \item[CTAN \filenm{.dtx} and \filenm{.ins} files:] Another form of \TeX\ package +% is |.dtx| and |.ins| source files. These files are used to create +% the documentation and |.sty| files. +% +% \begin{enumerate} +% \item See \url{http://ctan.org/pkg/lwarp} for the \pkg{lwarp} package. +% \item Download the zip archive \filenm{lwarp.zip} into your own \filenm{lwarp} directory. +% \item Unpack \filenm{lwarp.zip}. +% \item Locate the contents \filenm{lwarp.dtx} and \filenm{lwarp.ins} +% \item Create the |.sty| files: \userentry{pdflatex lwarp.ins} +% \item Create the documentation: +% \begin{Verbatim}[gobble=2,obeytabs,tabsize=4,frame=lines] +% pdflatex lwarp.dtx (several times) +% makeindex -s gglo.ist -o lwarp.gls lwarp.glo +% makeindex -s gind.ist lwarp.idx +% pdflatex lwarp.dtx (several times) +% \end{Verbatim} +% \item Copy the |.sty| files somewhere such as the \TeX\ Live local tree +% found in the previous \CTAN\ \TDS\ section, under the subdirectory: +% \begin{sourceverb} +% /tex/latex/local/lwarp +% \end{sourceverb} +% \item Copy \filenm{lwarp_baseline_marker.png} and \filenm{lwarp_baseline_marker.eps} +% to the same place as the \filenm{.sty} files. +% \changes{v0.52}{2018/03/24}{Docs: Improved install instructions.} +% \item Copy the documentation \filenm{lwarp.pdf} to a \filenm{source} directory in the local tree, +% such as: +% \begin{sourceverb} +% /doc/local/lwarp +% \end{sourceverb} +% \item Renew the cache: +% \userentry{mktexlsr} \quad —\,or\,— +% \userentry{texhash} +% +% Or, for \brand{Windows} MiK\TeX, start the program called \prog{MiKTeX Settings (Admin)} +% and click on the button called \UI{Refresh FNDB}. +% +% \item See \cref{sec:locallwarpmk} to generate your local copy of \prog{lwarpmk}. +% \item Once the local version of \filenm{lwarpmk.lua} is installed, it may be made +% available system-wide as per \cref{sec:installlwarpmk}. +% \end{enumerate} +% \item[Project-local \CTAN\ \filenm{.dtx} and \filenm{.ins} files:] The +% |.dtx| and |.ins| files may be downloaded to a project +% directory, then compiled right there, alongside the +% document source files. The resultant |*.sty| and \filenm{lwarpmk.lua} files +% may be used as-is, so long as they are in the same directory +% as the document source. +% The files \filenm{lwarp_baseline_marker.png} and +% \filenm{lwarp_baseline_marker.eps} must also be copied as well. +% \changes{v0.52}{2018/03/24}{Docs: Improved install instructions.} +% This approach is especially useful if +% you would like to temporarily test\margintag{Just testing!}\ +% \pkg{lwarp} before deciding whether to permanently install it. +% \end{description} +% +% \subsection{Installing the \prog{lwarpmk} utility} +% \label{sec:installlwarpmk} +% +% \changes{v0.21}{2017/02/22}{Docs: Installing on \brand{Windows}.} +% +% {\small +% (Note: If \prog{lwarpmk} is not already installed, +% it is easiest to use a local copy instead of installing it system-wide. +% See \cref{sec:locallwarpmk}.) +% } +% +% After the \pkg{lwarp} package is installed, +% you may need to setup the \prog{lwarpmk} utility: +% \begin{enumerate} +% \item At a command line, try executing \cmds{lwarpmk}. +% If the \prog{lwarpmk} help message appears, then \prog{lwarpmk} is already set up. +% If not, it is easiest to generate and use a local copy. +% See \cref{sec:locallwarpmk}. +% +% \item For MiK\TeX, try updating the \pkg{miktex-misc} package. This may install +% the \prog{lwarpmk} executable for you. +% \changes{v0.26}{2017/03/23}{Docs: Improved MiK\TeX\ install instructions.} +% +% Otherwise, continue with the following: +% +% \item Locate the file \filenm{lwarpmk.lua}, which should be in the |scripts| directory +% of the \TDS\ tree. On a \TeX\ Live or MiK\TeX\ system you may use +% \userentry{kpsewhich lwarpmk.lua} +% +% (If the file is not found, you may also generate a local copy and use it instead. +% See \cref{sec:locallwarpmk}.) +% +% \item Create \prog{lwarpmk}: +% \begin{description} +% \item [Unix:] Create a symbolic link and make it executable: +% \begin{enumerate} +% \item Locate the \TeX\ Live binaries: +% \userentry{kpsewhich -var-value TEXMFROOT} +% This will be something like: +% \begin{sourceverb} +% /usr/local/texlive/ +% \end{sourceverb} +% The binaries are then located in the |bin/| directory +% under the root: +% \begin{sourceverb} +% /usr/local/texlive//bin// +% \end{sourceverb} +% In this directory you will find programs +% such as \prog{pdflatex} and \prog{makeindex}. +% \item In the binaries directory, +% create a new symbolic link from the binaries directory to \filenm{lwarpmk.lua}: +% \userentry{ln -s lwarpmk} +% \item Make the link executable: +% \userentry{chmod 0755 lwarpmk} +% \end{enumerate} +% \item [\brand{Windows} \TeX\ Live:] Create a new |lwarpmk.exe| file: +% \begin{enumerate} +% \item Locate the \TeX\ Live binaries as shown above for \brand{Unix}. +% \item In the binaries directory, make a \emph{copy} of |runscript.exe| +% and call it |lwarpmk.exe| +% This will call the copy of \filenm{lwarpmk.lua} +% which is in the |scripts| directory of the distribution. +% \end{enumerate} +% \item [\brand{Windows} MiK\TeX:] Create a new |lwarpmk.bat| file: +% \begin{enumerate} +% \item Locate the MiK\TeX\ binaries. These will be in a directory such as: +% \begin{sourceverb} +% C:\Program Files\MiKTeX 2.9\miktex\bin\x64 +% \end{sourceverb} +% In this directory you will find programs +% such as |pdflatex.exe| and |makeindex.exe|. +% \item Create a new file named |lwarpmk.bat| containing: +% \begin{sourceverb} +% texlua "C:\Program Files\MiKTeX 2.9\scripts\lwarp\lwarp.texlua" %* +% \end{sourceverb} +% This will call the copy of \filenm{lwarpmk.lua} +% which is in the |scripts| directory of the distribution. +% \end{enumerate} +% \end{description} +% \end{enumerate} +% +% \subsubsection{Using a local copy of \prog{lwarpmk}} +% \label{sec:locallwarpmk} +% It is also possible to use a local version of \prog{lwarpmk}: +% \begin{enumerate} +% \item When compiling the tutorial in \cref{sec:tutorial}, +% use the \optn{lwarpmk} option for the \pkg{lwarp} package: +% \begin{sourceverb} +% \usepackage[lwarpmk]{lwarp} +% \end{sourceverb} +% \item When the tutorial is compiled with \prog{pdflatex}, the file \filenm{lwarpmk.lua} +% will be generated along with the other configuration files. +% \item \filenm{lwarpmk.lua} may be used for this project: +% \begin{description} +% \item[Unix:] \ +% \begin{enumerate} +% \item Make \filenm{lwarpmk.lua} executable: \userentry{chmod 0755 lwarpmk.lua} +% \item Compile documents with +% \userentry{./lwarpmk.lua html} +% \userentry{./lwarpmk.lua print} \quad etc. +% \item It may be useful to rename or link to a version without the |.lua| suffix. +% \end{enumerate} +% \item[\brand{Windows}:] \ +% +% Compile documents with either of the following, depending +% on which command shell is being used: +% \userentry{texlua lwarpmk.lua html} +% \userentry{texlua lwarpmk.lua print} \quad etc. +% +% Or: +% +% \userentry{lwarpmk html} +% \userentry{lwarpmk print} \quad etc. +% \end{description} +% \end{enumerate} +% +% +% \subsection{Installing additional utilities} +% +% \changes{v0.27}{2017/04/02}{Docs: Installing utilities for \brand{MacOS}.} +% +% \begin{description} +% \item [To test for the existence of the additional utilities:] \ +% +% Enter the following in a command line. If each programs' version is +% displayed, then that utility is already installed. +% See \cref{tab:utility} on page \pageref{tab:utility}. +% +% \userentry{luatex -{}-version} +% \userentry{xindy -{}-version} +% \userentry{latexmk -{}-version} +% \userentry{perl -{}-version} +% \userentry{pdfcrop -{}-version} +% \userentry{pdftotext -v} +% \userentry{pdfseparate -{}-version} +% \userentry{pdftocairo -v} +% \changes{v0.45}{2017/11/30}{Docs: Fix for double hyphens.} +% +% \item [To install \prog{xindy}, \prog{latexmk}, and \prog{pdfcrop}:] \ +% +% The \TeX\ utilities \prog{xindy}, \prog{latexmk}, and \prog{pdfcrop} may be installed +% in \prog{TexLive} with \prog{tlmgr}, installed by \prog{MiKTeX}, provided by +% your operating system's package manager, or downloaded from the \prog{CTAN} archive: +% \changes{v0.45}{2017/11/30}{Docs: Improved install instructions.} +% \begin{sourcedisplay} +% \url{http://ctan.org/pkg/xindy} \\ +% \url{http://ctan.org/pkg/latexmk} \\ +% \url{http://ctan.org/pkg/pdfcrop} +% \end{sourcedisplay} +% +% +% \item [To install the \brand{Poppler} utilities to a \brand{Unix}/\brand{Linux} system:] \ +% \DescribeProgram[requirement]{pdftotext}\gindex{Poppler=\brand{Poppler}} +% \DescribeProgram[requirement]{pdfseparate} +% \DescribeProgram[requirement]{pdftocairo} +% +% The tools from the \brand{Poppler} project should be provided by your +% operating system's package manager. +% +% +% \item [To install the \brand{Poppler} utilities to a \brand{MacOS} machine:] \ +% \begin{enumerate} +% \item Install \prog{Homebrew} from \url{https://brew.sh/}: +% \userentry{\small~ \\ \hspace*{-2in}/usr/bin/ruby -e "\$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"} +% \item Install the \brand{Poppler} utilities: +% \userentry{brew install poppler} +% \end{enumerate} +% +% +% \item [To install the \brand{Poppler} utilities to a \brand{Windows} machine:] \ +% +% If using Mik\TeX, install a \pkg{miktex-poppler-bin-*} package. +% \changes{v0.62}{2018/11/03}{Docs: \pkg{miktex-poppler-bin-*}} +% Otherwise: +% \begin{enumerate} +% \item See \cref{tab:utility} on \cpageref{tab:utility}. +% \item Download and extract the \brand{Poppler} utilities \prog{pdftotext}, \prog{pdfseparate}, +% and \prog{pdfseparate} to a directory, such as |Poppler|. +% \item In the \UI{Start} window, type "Path" to search for results +% related to Path. Or, open the control panel and search for "Path". +% \item Choose \UI{Edit the system environment variables} in the control panel. +% \item Choose the \UI{Environment Variables} button. +% \item Choose the \UI{Path} variable, then the \UI{Edit} button. +% \item Choose the \UI{New} button to make an additional entry. +% \item Enter the |bin| directory of the \brand{Poppler} utilities, such as: +% \begin{sourcedisplay} +% |C:\Users\\Desktop\Poppler\poppler-0.5_x86\poppler-0.5\bin| +% \end{sourcedisplay} +% +% Be sure to include |\bin|. +% \item Click \UI{Ok} when done. +% \end{enumerate} +% +% \needspace{2\baselineskip} +% \item [To install \brand{Perl} to a \brand{Windows} machine:] \ +% \DescribeProgram[requirement]{perl}\gindex{Perl=\brand{Perl}} +% \begin{enumerate} +% \item Download and install a version of \brand{Perl}, such as \brand{Straweberry Perl}, +% to a directory without a space in its name, such as |C:\Strawberry|. +% \item Edit the \UI{Path} as seen above for the \brand{Poppler} utilities. +% \item Enter the |bin| directory of the \prog{perl} utility, such as: +% \begin{sourcedisplay} +% |C:\Strawberry\perl\bin| +% \end{sourcedisplay} +% +% Be sure to include |\bin|. +% \item Click \UI{Ok} when done. +% \end{enumerate} +% +% \end{description} +% +% \vfill +% \textred{\textbf{Any utilities installed by hand must be added to the |PATH|.}} +% \vfill +% +% +% +% \clearpage +% +% \section{Tutorial} +% \label{sec:tutorial} +% +% This section shows an example of how to create an \pkg{lwarp} document. +% +% \needhelp +% +% \subsection{Starting a new project} +% +% \changes{v0.21}{2017/02/23}{File: \filenm{lwarp_tutorial.txt} added.} +% +% \begin{enumerate} +% +% \item Create a new project directory called |tutorial|. +% +% \item Inside the |tutorial| directory, +% \DescribeFile{tutorial.tex} +% create a new file called |tutorial.tex|. +% This may be done several ways: +% \begin{description} +% \item [Copy from the documentation PDF:] \ +% +% A listing is in \cref{fig:tutorial}, +% which may be copied/pasted from the figure directly into your own editor, +% depending on the quality of the \PDF\ viewer and editor, or: +% +% \item [Copy from the \pkg{lwarp} documentation directory:] \ +% +% Another copy may be found by entering into a command line: +% \DescribeFile{lwarp_tutorial.txt} +% \watchout[Note: |.txt| suffix!] +% \userentry{texdoc -l lwarp\_tutorial.txt} +% +% This should be in the |doc/latex/lwarp/| directory along +% with this \PDF\ documentation. +% Copy |lwarp_tutorial.txt| directly into your |tutorial| directory, +% renamed as |tutorial.tex|. +% \end{description} +% +% \emph{When using \brand{Windows}, use an editor other than \brand{Notepad}, +% \watchout[Bad formatting!] +% since \brand{Notepad} does not accept the end-of-line from a \brand{Unix} text file.} +% +% \item Compile the project: \userentry{pdflatex tutorial.tex} +% \quad (several times) +% +% (\prog{xelatex} or \prog{lualatex} may be used as well. +% \pkg{lwarp} also supports \DVI\ \prog{latex} for use with \filenm{.eps} images.) +% +% \item View the resulting |tutorial.pdf| with a \PDF\ viewer. +% +% \end{enumerate} +% +% +% A number of new files are created when |tutorial.tex| is compiled, as +% shown in \cref{fig:newprojectfiles}. These files are created by +% the |lwarp| package. +% +% (Two of the new files are configuration files for the helper program \prog{lwarpmk}. +% Whenever a print version of the document is created, +% the configuration files for \prog{lwarpmk} are updated to +% record the operating system, \LaTeX\ engine (\prog{latex}, \prog{pdflatex}, \prog{xelatex}, or \prog{lualatex}), +% the filenames of the source code and \HTML\ output, and whether +% the additional helper program \prog{latexmk} will be used to compile the document.) +% +% +% \clearpage +% +% \begingroup +% \captionof{figure}{tutorial.tex listing} +% \label{fig:tutorial} +% +% \begin{center} +% \footnotesize +% \textred{Note: There are two pages!} +% \end{center} +% +% \small +% +% \VerbatimInput{lwarp_tutorial.txt} +% +% ^^A so they don't copy/paste the header: +% \thispagestyle{empty} +% +% ^^A ************************************************************************** +% ^^A NOTE: lwarp_tutorial.txt is located in the TDS doc directory! +% ^^A Copy it to the source directory if you wish to recompile lwarp.dtx! +% ^^A (It is stored in the doc directory so that texdoc can find it and +% ^^A the user can copy it.) +% ^^A ************************************************************************** +% +% \endgroup +% +% +% \begin{table} +% \caption{Configuration files created by print version\label{fig:newprojectfiles}} +% \begin{description} +% +% \item [|tutorial.pdf|:] The \PDF\ output from \LaTeX. +% The print version of the document. +% +% \item [|tutorial\_html.tex|:] A small |.tex| file used to create +% a parallel \HTML\ version of the document, which co-exists with usual +% the \PDF\ version, and which will have its +% own auxiliary files. In this way, both \PDF\ and \HTML\ +% documents may co-exist side-by-side. +% +% \item [Auxiliary files:] The usual \LaTeX\ files |.aux|, |.log|, |.out|, |.toc|, |.lof|, |.idx|. +% When an \HTML\ version of the document is created, |_html| versions +% of the auxiliary files will also be generated. +% +% \item [|lwarpmk.conf|:] A configuration file for \prog{lwarpmk}, +% which is used to automate the compilation of \PDF\ or \HTML\ +% versions of the document. +% +% \item [|tutorial.lwarpmkconf|:] Another configuration file used by \prog{lwarpmk}, +% which is only useful if you wish to have several projects +% residing in the same directory. +% +% \item [|.css files|:] |lwarp.css|, |lwarp_formal.css|, |lwarp_sagebrush.css| +% These files are standard for \pkg{lwarp}, and are not meant to be modified +% by the user. +% +% \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.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. +% +% \item [|lwarp\_one\_limage.txt|:] For \brand{Windows} only. +% Used to process \SVG\ images in the background. Copied to +% |lwarp_one_limage.cmd| when images are generated. +% +% \item [|lwarp\_mathjax.txt|:] Inserted into the \HTML\ files when +% \brand{MathJax} is used to display math. +% This file should not be modified by the user. +% +% \item [|comment.cut|:] A temporary file used by \pkg{lwarp} to +% conditionally process blocks of text. This file may be ignored. +% \end{description} +% +% \hrule \medskip +% \label{sec:genlatexmk} +% When the \optn{lwarpmk} option is given to the \pkg{lwarp} package: +% \begin{description} +% \item [\filenm{lwarpmk.lua}:] A local copy of the \prog{lwarpmk} utility. +% +% On \brand{Unix}-related operating systems this file must be made executable: +% \begin{sourcedisplay} +% |chmod u+x lwarpmk.lua| +% \end{sourcedisplay} +% +% This may be useful to have to archive with a project for future use. +% \end{description} +% \end{table} +% +% +% +% \clearpage +% +% \subsection{Compiling the print version with \prog{lwarpmk}} +% +% The \prog{lwarpmk} utility program is used to compile either the printed or +% the \HTML\ version of the document. +% +% |lwarpmk print| is used to recompile a printed version of the document. +% +% \begin{enumerate} +% +% \item Re-compile the print version: \userentry{lwarpmk print} +% +% \prog{lwarpmk} prints an introduction then checks to see if the document +% must be recompiled. If it seems that the files are up-to-date, then +% \prog{lwarpmk} informs you of that fact and then exits. +% +% \item Make a small change in the original document, +% such as adding a space character. +% +% \item Recompile again. \userentry{lwarpmk print} +% +% The document is recompiled when a change is seen in the source. +% Several compilations may be necessary to resolve cross-references. +% +% \item Force a recompile to occur. +% \userentry{lwarpmk again} +% \userentry{lwarpmk print} +% +% |lwarpmk again| updates the date code for the file, +% triggering a recompile the next time the document is made.\footnote{ +% 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.\gindex{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. +% \userentry{lwarpmk print} +% +% \item To force a single recompile when needed, even if no changes were detected: +% \userentry{lwarpmk print1} +% +% \end{enumerate} +% +% Note that the \HTML\ customization commands are ignored while making the +% print version. +% +% +% \clearpage +% +% \subsection{Compiling the \HTML\ version with \prog{lwarpmk}} +% +% |lwarpmk html| is used to recompile an \HTML\ version of the document. +% +% \begin{enumerate} +% \item Compile the \HTML\ version: +% \userentry{lwarpmk html} +% +% \begin{enumerate} +% \item \prog{lwarpmk} uses \LaTeX\ to process |tutorial_html.tex| +% to create \\ +% |tutorial_html.pdf|. +% \item \prog{pdftotext} is then used to convert to the file |tutorial_html.html|. +% This file is a plain-text file containing \HTML\ tags and +% content for the entire document. +% \item \prog{lwarpmk} manually splits |tutorial_html.html| into +% individual \HTML\ files according to the \HTML\ settings. +% For this tutorial, the result is |tutorial.html| (the home page), +% along with |First-chapter.html|\footnote{ +% \texttt{First-chapter.html} +% also contains the first section, even though the second +% section is its own \HTML\ page. This behavior is +% controlled by the boolean \texttt{CombineHigherDepths}.}, +% |Some-math.html|, and the document's +% index in |_Index.html|.\footnote{\texttt{index.html} is commonly +% used as a homepage, so the document index is in \texttt{\_Index.html}.} +% \end{enumerate} +% +% \item View the \HTML\ page in a web browser. +% +% \qquad Open the file |tutorial.html| in a web browser. +% +% Note that math is still displayed as its \attribute{alt} tag, which is +% \margintag{math} +% the plain-text \LaTeX\ source, +% until the +% images of the math expressions have been generated. Math may be +% displayed as \SVG\ images or by a \brand{MathJax} script, as seen in +% \cref{sec:tutorialsvgmath,sec:tutorialmathjax}. +% +% \item Force a recompile: +% \userentry{lwarpmk again} +% \userentry{lwarpmk html} +% \userentry{lwarpmk print} +% +% \item Process the \HTML\ index and recompile:\gindex{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:indexsetup} for index options.} +% \userentry{lwarpmk htmlindex} +% \userentry{lwarpmk html} +% +% |_Index.html| is updated for the new \LaTeX\ index. +% +% \item Reload the web page to see the added index. +% +% \item To force a single recompile when needed, even if no changes were detected: +% \userentry{lwarpmk html1} +% +% \end{enumerate} +% +% +% +% \clearpage +% +% \subsection{Generating the \SVG\ images} +% \label{sec:tutorialsvgmath} +% +% By default \pkg{lwarp} represents math as \SVG\ images, with +% \margintag{math as \SVG\ images} +% the \LaTeX\ source included in \attribute{alt} attributes. In this way, +% the math is displayed as it was drawn by \LaTeX, and the \LaTeX\ source +% may be copied and pasted into other documents. +% +% \pkg{lwarp} uses the same mechanism for \env{picture} and \tikz\ environments. +% \margintag{\env{picture} and \tikz} +% +% \begin{enumerate} +% \item Create the \SVG\ images: +% \userentry{lwarpmk limages} +% \userentry{lwarpmk html} +% +% \item Move to the tutorial's \HTML\ math page and reload the document in the browser. +% +% \item The math images are displayed using the same font and formatting +% as the printed version. +% +% \item Copy/paste a math expression into a text editor to see the \LaTeX\ source. +% \end{enumerate} +% +% \limitssvgimages +% +% \clearpage +% +% \subsection{Using \brand{MathJax} for math} +% \label{sec:tutorialmathjax} +% +% Math may also be represented using the \brand{MathJax} \brand{Javascript} project. +% \margintag{math with \brand{MathJax}} +% +% \begin{enumerate} +% \item In the tutorial's source code, uncomment the \optn{mathjax} package option for \pkg{lwarp}: +% \begin{sourcedisplay} +% mathjax, \% Use MathJax to display math. +% \end{sourcedisplay} +% +% \item Recompile \userentry{lwarpmk html} +% +% \item Reload the math page. +% \end{enumerate} +% +% \brand{MathJax} requires web access unless a local copy of \brand{MathJax} is available, +% \watchout[\brand{MathJax} requirements] +% and it also requires that \brand{Javascript} is enabled for the web page. +% The math is rendered by \brand{MathJax}. Right-click on math to see several +% options for rendering, and for copying the \LaTeX\ source. +% +% While using \brand{MathJax} has many advantages, it may not be able to represent +% complex expressions or spacing adjustments as well as \LaTeX, and it +% may not support some math-related packages. +% +% +% \clearpage +% \subsection{Changing the \CSS\ style} +% +% For a formal \CSS\ style, add to the preamble: +% \begin{sourcedisplay} +% \cs{usepackage}\{lwarp\} \\ +% \dots \\ +% \textred{\cs{CSSFilename}\{lwarp\_formal.css\}} \\ +% \dots \\ +% \cs{begin}\{document\} \\ +% \end{sourcedisplay} +% +% For a modern \CSS\ style, |lwarp_sagebrush.css| is also provided: +% \begin{sourcedisplay} +% \cs{CSSFilename}\{lwarp\_sagebrush.css\} +% \end{sourcedisplay} +% +% See \cref{sec:csscustomization} for more information about modifying the \CSS\ styling +% of the document. +% +% +% +% \subsection{Customizing the \HTML\ output} +% +% A number of settings may be made to control the \HTML\ output, including +% filename generation, automatic compilation, math output, document splitting, +% meta data, and page headers and footers. +% +% See \cref{sec:htmlsettings} for more information. +% +% +% \clearpage +% +% \subsection{Using \prog{latexmk}} +% +% \prog{latexmk} is a \LaTeX\ utility used to monitor changes in source files +% and recompile as needed. +% +% \begin{enumerate} +% \item In the tutorial's source code uncomment the \optn{latexmk} option for the +% \pkg{lwarp} package: +% \begin{sourcedisplay} +% latexmk, \% Use latexmk to compile. +% \end{sourcedisplay} +% +% \item Recompile the printed version of the document. +% \userentry{lwarpmk print} +% +% \begin{sloppy} +% \pkg{lwarp} updates its own configuration files (|lwarpmk.conf| and \newline +% |tutorial.lwarpmkconf|) whenever the printed version of the document +% is compiled. These configuration files remember that \prog{lwarpmk} should +% use \prog{latexmk} to compile the document. +% \end{sloppy} +% +% \item Recompile the document. +% \userentry{lwarpmk print} \quad and/or +% \userentry{lwarpmk html} +% \end{enumerate} +% +% Changes are detected by comparing checksums +% rather than modification times, so |lwarpmk again| will not trigger a +% recompile, but \prog{latexmk} has a much better awareness of changes than +% the \prog{lwarpmk} utility does and it is likely to correctly know when to +% recompile. A recompile may be forced by making a small change to the source, +% and a single recompile may be forced with: +% \margintag{forced single-pass recompile} +% \userentry{lwarpmk print1} \quad and/or +% \userentry{lwarpmk html1} +% +% +% \clearpage +% +% \subsection{Using \XeLaTeX\ or \LuaLaTeX} +% +% \XeLaTeX\ or \LuaLaTeX\ may be used instead of \LaTeX. +% +% \begin{enumerate} +% +% \item Remove the auxiliary files for the project: +% \userentry{lwarpmk cleanall} +% +% \item Use \prog{xelatex} or \prog{lualatex} to compile the printed version +% a single time. +% \userentry{xelatex tutorial.tex} \quad -or- +% \userentry{lualatex tutorial.tex} +% +% When the compile occurs, +% the configuration files for \prog{lwarpmk} are modified to remember +% which \TeX\ engine was used. \XeLaTeX\ or \LuaLaTeX\ will be used for +% future runs of \prog{lwarpmk}. +% +% \item To recompile the document: +% \userentry{lwarpmk print} \quad -and- +% \userentry{lwarpmk html} +% +% \item Also remember to update the indexes and recompile again: +% \userentry{lwarpmk htmlindex} +% \userentry{lwarpmk html} +% \userentry{lwarpmk printindex} +% \userentry{lwarpmk print} +% \end{enumerate} +% +% +% \subsection{Using \DVI\ \LaTeX} +% +% \gindex{DVI \LaTeX} +% +% Traditional \DVI\ LaTeX may also be used along with \filenm{.eps} image files. +% An \SVG\ version of each image must also be provided. +% \prog{lwarpmk} may be used to convert image formats. +% +% To convert \EPS\ files to \PDF: +% \userentry{lwarpmk epstopdf *.eps \qquad \textrm{(or a list of files)}} +% +% To convert \PDF\ files to \SVG: +% \userentry{lwarpmk pdftosvg *.pdf \qquad \textrm{(or a list of files)}} +% +% See \cref{sec:fonts} regarding font selection +% \watchout[bitmapped fonts] +% to avoid the use of bitmapped fonts. +% +% +% \clearpage +% +% \subsection{Using a glossary} +% +% \changes{v0.29}{2017/04/15}{Docs: Using a glossary} +% +% \pkg{lwarp} supports the \pkg{gloss} and \pkg{glossaries} packages, +% although this tutorial does not supply an example. +% +% \subsubsection{\pkg{gloss} package} +% +% See \cref{sec:gloss}. +% +% \subsubsection{\pkg{glossaries} package} +% \gindex{glossaries=\pkg{glossaries}>processing} +% To process the glossary for the print version: +% \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} +% +% In each case, the document will have to be recompiled afterwards: +% \userentry{lwarpmk html1} +% \userentry{lwarpmk html} +% \userentry{lwarpmk print1} +% \userentry{lwarpmk print} +% +% See \cref{sec:glossaries} to set options for processing glossaries. +% +% +% \clearpage +% +% \subsection{Cleaning auxiliary files} +% +% To remove the auxiliary files |.aux|, |.toc|, |.lof|, |.lot|, |.idx|, |.ind|, |.log|, +% and |.gl*|: +% \userentry{lwarpmk clean} +% +% +% \subsection{Cleaning auxiliary and output files} +% +% To remove the auxiliary files, and also remove the |.pdf| and |.html| files: +% \userentry{lwarpmk cleanall} +% +% +% \subsection{Cleaning the images from the \filenm{-images} directory} +% \changes{v0.53}{2018/04/01}{Docs: \cmds{lwarpmk cleanlimages}.} +% +% The \filenm{-images} directory contains \SVG\ images +% automatically generated for inline and display math, \pkg{tikz}, etc. +% To remove all the images from the \filenm{lateximages} directory: +% \userentry{lwarpmk cleanlimages} +% +% +% \subsection{Converting \PDF\ or \EPS\ images to \SVG} +% \changes{v0.56}{2018/04/29}{Docs: \cmds{lwarpmk pdftosvg}.} +% \changes{v0.59}{2018/09/05}{Docs: \cmds{lwarpmk epstopdf}.} +% +% \HTML\ cannot display \PDF\ or \EPS\ images, so any external \PDF\ graphics images must +% be converted to \SVG\ format. +% \gindex{SVG>converting from \PDF\ or \EPS} +% \gindex{PDF image>converting} +% \gindex{EPS image>converting} +% \gindex{image>PDF or EPS>converting} +% \prog{pdftocairo} and \prog{epstopdf} may be used one image at a time, +% but \prog{lwarpmk} also provides a way to convert \PDF\ or \EPS\ images in bulk: +% \userentry{lwarpmk epstopdf *.eps \qquad \textrm{(or a list of files)}} +% \userentry{lwarpmk pdftosvg *.pdf \qquad \textrm{(or a list of files)}} +% Be sure to always provide \SVG\ files for \HTML\ output. +% +% +% \subsection{Creating \HTML\ from an incomplete compile} +% \changes{v0.53}{2018/04/01}{Docs: \cmds{lwarpmk pdftohtml}.} +% +% 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 [-p project]} +% +% +% \subsection{Processing multiple projects in the same directory} +% +% It is possible to have several projects in the same directory. +% \prog{lwarpmk} has an optional parameter which is the document to compile. +% +% To create each project: +% \userentry{pdflatex project\_a} +% \userentry{pdflatex project\_b} +% +% Each project is given its own configuration file: +% \begin{sourcedisplay} +% |project_a.lwarpmkconf|, |project_b.lwarpmkconf| +% \end{sourcedisplay} +% +% To compile each project with |lwarkmk|: +% \userentry{lwarpmk print -p project\_a} +% \userentry{lwarpmk html -p project\_b} +% +% +% \subsection{Using the \prog{make} utility} +% +% \prog{lwarpmk} has an action which may be useful for integration with the +% common \prog{make} utility: +% \begin{sourcedisplay} +% |lwarpmk pdftohtml [-p project]| +% \end{sourcedisplay} +% +% \prog{make} may be used to compile the code to \PDF\ with \HTML\ +% tags (|project_html.pdf|), then \prog{lwarpmk} may be used to +% convert each target to \HTML\ files. +% +% +% \clearpage +% +% \section{Converting an existing document} +% \label{sec:convertexisting} +% +% \gindex{modifying>document} +% \gindex{adapting>document} +% \gindex{converting>document} +% \gindex{document>convert existing} +% +% \changes{v0.48}{2018/02/05}{Docs: Converting an existing document.} +% \changes{v0.51}{2018/03/04}{Docs: Updated Converting an existing document.} +% \changes{v0.66}{2019/02/07}{Docs: Updated Converting an existing document.} +% +% To convert an existing document for use with \pkg{lwarp}: +% \begin{enumerate} +% \item Arrange the document in the following order: +% \begin{enumerate} +% \item Declare the \cs{documentclass}. +% \item Load text fonts. +% \item Load \pkg{inputenc} or \pkg{inputenx}, \pkg{fontenc}, and/or \pkg{fontspec}. +% \item Load \pkg{lwarp}. +% \item Load remaining packages. +% \end{enumerate} +% \item Modify the document: +% \begin{enumerate} +% ^^A \item Remove \filenm{.pdf} file extensions. Change: +% ^^A \begin{sourcedisplay} +% ^^A \cs{includegraphics}\{filename.pdf\} +% ^^A \end{sourcedisplay} to: +% ^^A \begin{sourcedisplay} +% ^^A \cs{includegraphics}\{filename\} +% ^^A \end{sourcedisplay} +% ^^A Other image formats may have a file extension. +% \item \limitsmathinsectionnames +% \item \limitsincludegraphicsscale +% \item Possible changes to \env{tabular} environments include: +% |*| 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}. +% \item Manually compile the print version with \prog{latex}, \prog{pdflatex}, +% \prog{lualatex}, or \prog{xelatex}. +% \item |lwarpmk print| to finish the print version. +% \item |lwarpmk html| to create the \HTML\ version. +% \item |lwarpmk limages| to create the \SVG\ images of any \SVG\ math, \env{lateximage}, \tikz, etc. +% \end{enumerate} +% +% \needhelp +% +% \clearpage +% +% \section{Additional details} +% +% +% \subsection{Shell escape} +% \label{sec:shellescape} +% \gindex{shell escape} +% +% \DescribeOption{-\/-shell-escape} +% Some documents require the use of an external program, +% which is allowed when using the \optn{-\/-shell-escape} command-line option. +% When the document is first compiled manually, +% and also whenever the print version is recompiled, +% \pkg{lwarp} detects and remembers +% whether shell escape is enabled. If so, it will also be enabled when +% the document is recompiled with \prog{lwarpmk}. +% +% +% \subsection{Font and \UTF-8 support} +% \label{sec:fonts} +% \trouble{font>UTF-8} +% \trouble{text>corrupted} +% \trouble{font>selection} +% \trouble{Unicode>fonts} +% \gindex{font>selection} +% \gindex{font>type 3 bitmapped} +% \gindex{font>type 1 vector} +% \gindex{type 1 vector fonts} +% \gindex{type 3 bitmapped fonts} +% \gindex{vector fonts} +% \gindex{bitmapped fonts} +% \gindex{Unicode>selection} +% \gindex{UTF-8>selection} +% \gindex{Computer Modern} +% \gindex{Latin Modern font} +% \gindex{DVI \LaTeX} +% \changes{v0.16}{2016/04/08}{Docs: Font and UTF-8 support.} +% \changes{v0.16}{2016/04/08}{Lwarp no longer selects fonts.} +% \changes{v0.61}{2018/09/25}{Docs: Fonts.} +% +% \pkg{lwarp} uses \prog{pdftotext} to convert \PDF\ output into UTF-8-encoded +% \watchout[type 3 bitmapped fonts] +% text. This process requires that UTF-8 information be embedded in the \PDF\ +% file, which may prevent the use of older ``type 3'' bit-mapped fonts, +% and of older packages such as \pkg{ae}. +% The \pkg{lwarp} option \optn{pdftotextEnc} may be useful in some situations. +% See \cref{sec:loading}. +% +% While using \DVI\ \prog{latex} or \PDF\ \prog{pdflatex}, +% \margintag{vector fonts} +% if no font-related package is specified then the default +% Computer Modern font is used, which may be a ``type 3'' bit-mapped font which may not +% convert well to plain text. A ``type 1'' vector font is required. +% \margintag{Computer Modern}% +% \gindex{font>Computer Modern}\gindex{Computer Modern}% +% \watchout[\prog{pdflatex}]% +% \watchout[DVI \prog{latex}]% +% +% \DescribePackage{cm-super} +% To use the updated \pkg{cm-super}'s type 1 fonts instead of Computer Modern, +% install the \pkg{cm-super} font package. +% +% \DescribePackage{lmodern} +% To use Latin Modern instead, add +% \begin{sourcedisplay} +% |usepackage{lmodern}| +% \end{sourcedisplay} +% to the preamble. +% +% \DescribePackage{dejavu} +% Another useful option is the Deja Vu series of fonts, which have +% an increased coverage of language and glyphs: +% \begin{sourcedisplay} +% |\usepackage{dejavu}| +% \end{sourcedisplay} +% \gindex{Deja Vu}% +% \gindex{font>Deja Vu}% +% \gindex{Unicode>enhanced coverage}% +% \gindex{UTF-8>enhanced coverage}% +% +% While using \DVI\ \prog{latex} or \PDF\ \prog{pdflatex}, +% \margintag{\prog{latex}, \prog{pdflatex}, T1, UTF8} +% \pkg{lwarp} automatically loads \pkg{fontenc} with T1 encoding. +% \pkg{fontenc} may be loaded with an additional encoding after \pkg{lwarp}. +% \pkg{inputenc} is automatically loaded with UTF8 encoding if if has not yet been loaded, +% but may also be specified with another encoding such as |latin1|. +% See the next section regarding index encoding. +% +% \XeLaTeX{} and \LuaLaTeX{} users must use the \pkg{fontspec} package. +% \trouble[\prog{xelatex} and \prog{lualatex}]{xelatex=xe\LaTeX} +% \trouble{lualatex=lua\LaTeX} +% \trouble{fontspec=\pkg{fontspec}} +% Do NOT use \pkg{fontenc}! +% +% Place \pkg{fontspec} or \pkg{fontenc}, \pkg{xunicode}, and other font and UTF-8 related commands +% after the \cs{documentclass} command and before |\usepackage{lwarp}|. +% +% In some cases, \trouble[package conflicts]{font>package conflicts} +% a package conflict may require that a font package be loaded +% after \pkg{lwarp}, which should work as well: +% \begin{enumerate} +% \item |documentclass{article/book/report}| comes first, followed by any of: +% \item Font and UTF-8 related commands: +% \begin{itemize} +% \item For \XeLaTeX{} or \LuaLaTeX: +% \begin{itemize} +% \item \pkg{fontspec} and font choices +% \DescribePackage{fontspec} +% +% \medskip +% \pkg{lwarp} sets the following to turn off \TeX{} ligatures during +% \margintag{ligatures} +% the generation of \HTML\ tags, and turn off common ligatures +% in regular text, since older browsers may not display them correctly +% and newer browsers can automatically re-create them. +% \gindex{ligatures} +% \gindex{font>ligatures} +% \trouble{font>ligatures} +% \vspace{-1ex} +% \begin{Verbatim}[gobble=2,obeytabs,tabsize=4,frame=lines] +% \defaultfontfeatures[\rmfamily]{Ligatures={NoCommon,TeX}} +% \defaultfontfeatures[\sffamily]{Ligatures={NoCommon,TeX}} +% \defaultfontfeatures[\ttfamily]{Ligatures=NoCommon} +% \end{Verbatim} +% \end{itemize} +% \item For \prog{pdflatex}: +% \begin{enumerate} +% \item |\usepackage{lmodern}|, or other font-related packages +% \DescribePackage{lmodern} +% \gindex{font>packages} +% \item |\usepackage[T1]{fontenc}| +% \DescribePackage{fontenc} +% \item |\usepackage[utf8]{inputenc}|, or |latin1|, etc. Or use \pkg{inputenx}. +% \DescribePackage{inputenc}\DescribePackage{inputenx} +% \item |\usepackage{newunicodechar}| along with related definitions. +% \DescribePackage{newunicodechar} +% \item To assist with the \PDF-\HTML\ conversion: +% \begin{enumerate} +% \item |\input glyphtounicode.tex| +% \DescribeFile{glyphtounicode.tex} +% \item |\input glyphtounicode-cmr.tex% from the pdfx package| +% \item |\pdfgentounicode=1| +% \end{enumerate} +% \item Another option to assist with the \PDF-\HTML\ conversion: +% \begin{itemize} +% \item |\usepackage{cmap}| +% \DescribePackage{cmap} +% \end{itemize} +% \item |\usepackage{textcomp}| +% \DescribePackage{textcomp} +% ^^A \item \pkg{microtype} is automatically used by \pkg{lwarp} +% ^^A \DescribePackage{microtype} +% ^^A to turn off f,q,t,T,Q ligatures for the same +% ^^A \margintag{ligatures} +% ^^A browser-related reasons shown above. Also, the monospaced font is used +% ^^A during \HTML\ tag generation to turn off \TeX{} ligatures. +% ^^A \gindex{ligatures}\gindex{font>ligatures} +% \end{enumerate} +% \end{itemize} +% \item |\usepackage{lwarp}| (\cref{sec:loading}) goes after any of the above, followed by: +% \item |\usepackage{newtxmath}| or other math-related font packages. +% Many of these load \pkg{amsmath}, which must be loaded after \pkg{lwarp}, +% so they must also be loaded after \pkg{lwarp}. +% \item |\setmonofont{TeX Gyre Cursor}| or similar may be required if using +% \trouble[\pkg{fontspec} with traditional font packages]{font>monospace} +% \trouble{font>ligatures} +% \trouble{ligatures} +% \XeLaTeX\ or \LuaLaTeX\ and \pkg{fontspec} along with +% traditional font packages such as \pkg{txfonts}, \pkg{newtxtext}, etc. +% This is required to turn off the monospaced font's ligatures +% with \pkg{fontspec} after loading the traditional font packages. +% Monospaced output ligatures must be turned off +% to produce the correct \HTML\ characters. +% \item \ldots{} the rest of the preamble and the main document. +% \end{enumerate} +% +% In some cases, an external program may require a \UTF-8 ``locale''. +% \watchout[UTF-8 locale] +% See \cref{sec:utf8locale}. +% +% +% \subsubsection{Indexes, glossaries, and encoding} +% \gindex{UTF-8>index} +% \gindex{index>UTF-8} +% +% \pkg{lwarp} uses the \prog{xindy} program to processes indexes. +% \prog{xelatex} and \prog{lualatex} use \prog{xindy} and +% \prog{pdflatex} uses \prog{texindy}. +% +% 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 +% ^^A both +% index +% ^^A and glossary +% generation. +% +% +% \clearpage +% +% \subsection{\pkg{lwarp} package loading and options} +% \label{sec:loading} +% \gindex{settings>lwarp=\pkg{lwarp} package options} +% +% \begin{table} +% \caption{\pkg{lwarp} package options\label{tab:options}} +% \centering +% \renewcommand{\arraystretch}{1.2} +% \begin{tabular}{>{\ttfamily}lp{3.25in}} +% Option & Description \\ \midrule +% mathsvg & Show math using \SVG\ images. \\ +% mathjax & Show math using \brand{MathJax}. \\ +% latexmk & Use \prog{latexmk} for compiling documents. \\ +% dvips & Use \prog{dvips} and \prog{ps2pdf} to convert \DVI\ documents. \\ +% dvipdfm & Use \prog{dvipdfm} to convert \DVI\ documents. \\ +% dvipdfmx & Use \prog{dvipdfmx} to convert \DVI\ documents. \\ +% HomeHTMLFilename & The filename of the home page. \\ +% HTMLFilename & A prefix for the filenames of the remaining web pages. \\ +% PrintLatexCmd & The shell commands for \cmds{lwarpmk print}. \\ +% HTMLLatexCmd & The shell commands for \cmds{lwarpmk html}. \\ +% \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} +% +% +% \pkg{lwarp} supports \pkg{book}, \pkg{report}, and \pkg{article} classes, +% as well as the equivalent Koma-script classes and \pkg{memoir}, and +% various CJK-related classes and packages. +% +% Load the \pkg{lwarp} package immediately after the font and UTF-8 setup commands. +% +% Package options may be set while loading \pkg{lwarp}, or later with +% \begin{sourcedisplay} +% \cs{lwarpsetup}\{\meta{key=value, \dots}\} +% \end{sourcedisplay} +% +% \changes{v0.16}{2016/04/08}{Docs: Moved location of \cs{usepackage\{lwarp\}}.} +% \changes{v0.19}{2016/05/25}{Docs: Math options.} +% \DescribePackage{lwarp} +% \gindex{lwarp=\pkg{lwarp}>loading} +% \gindex{lwarp=\pkg{lwarp}>options} +% \pkg{lwarp} package options are as follows: +% +% \begin{description} +% +% \item[\optn{mathsvg}, \optn{mathjax}:] +% \DescribeOption{mathsvg} +% \DescribeOption{mathjax} +% ^^A \DescribeOption{mathKaTeX} +% ^^A For math display, select \optn{mathsvg} (default), \optn{mathjax}, +% ^^A or \optn{mathKaTeX}. +% For math display, select \optn{mathsvg} (default) or \optn{mathjax}. +% For more information about the math options, see \cref{sec:limitsmath}. +% +% +% \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}. +% +% \item[\optn{dvips}:] +% \DescribeOption{dvips} +% \DescribeDefault{false} Tells \prog{lwarpmk} to use \prog{dvips} and \prog{ps2pdf} to convert +% \DVI\ output to \PDF. +% +% \item[\optn{dvipdfm}:] +% \DescribeOption{dvipdfm} +% \DescribeDefault{false} Tells \prog{lwarpmk} to use \prog{dvipdfm} to convert +% \DVI\ output to \PDF. +% +% \item[\optn{dvipdfmx}:] +% \DescribeOption{dvipdfmx} +% \DescribeDefault{false} Tells \prog{lwarpmk} to use \prog{dvipdfmx} to convert +% \DVI\ output to \PDF. +% +% +% \item[\optn{HomeHTMLFilename}:] +% \DescribeOption{HomeHTMLFilename} +% \DescribeDefault{\{\}} +% See \cref{sec:htmlsettings}. +% +% +% \item[\optn{HTMLFilename}:] +% \DescribeOption{HTMLFilename} +% \DescribeDefault{\{\}} +% See \cref{sec:htmlsettings}. +% +% +% \item[\optn{PrintLatexCmd}:] +% \DescribeOption{PrintLatexCmd} +% \DescribeDefault{} Sets the shell commands executed by \cmds{lwarpmk print}. +% If not specified, will automatically be set according to the detected \LaTeX\ engine +% and the use of \optn{-\/-shell-escape}. +% +% +% \item[\optn{HTMLLatexCmd}:] +% \DescribeOption{HTMLLatexCmd} +% \DescribeDefault{} Sets the shell commands executed by \cmds{lwarpmk html}. +% If not specified, will automatically be set according to the detected \LaTeX\ engine +% and the use of \optn{-\/-shell-escape}. +% +% +% \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. +% +% +% \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}. +% +% +% \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{} 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, +% \trouble{PrintIndexCmd} +% \trouble[xindy]{xindy=\pkg{xindy}>options>PrintIndexCmd=\optn{PrintIndexCmd}} +% be sure to assign an \prog{xindy} +% language and codepage with the |-L| and |-C| \prog{xindy} options, as the +% \pkg{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{} 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}, +% \trouble[filenames]{HTMLIndexCmd>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, +% \trouble[xindy]{xindy=\pkg{xindy}>options>HTMLIndexCmd=\optn{HTMLIndexCmd}} +% be sure to assign an \prog{xindy} +% language and codepage with the |-L| and |-C| \prog{xindy} options, as the +% \pkg{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{} 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, +% \trouble[xindy]{xindy=\pkg{xindy}>options>LatexmkIndexCmd=\optn{LatexmkIndexCmd}} +% be sure to assign an \prog{xindy} +% language and codepage with the |-L| and |-C| \prog{xindy} options, as the +% \pkg{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 +% |_html.tex|, which sets the \optn{warpHTML} option before calling +% the user's source code |.tex|. In this way, |.tex| +% can |\usepackage{lwarp}| without any options to create a printed version, +% while |_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} +% \label{sec:htmlsettings} +% \gindex{settings>HTML conversion} +% \gindex{HTML>conversion settings} +% +% \changes{v0.43}{2017/11/04}{Docs: \HTML\ settings table.} +% \changes{v0.43}{2017/11/06}{Docs: Reorganized \HTML\ customization.} +% \changes{v0.61}{2018/09/25}{Docs: HTMLDebugComments} +% \begin{table}[p] +% \caption{\HTML\ settings} +% \label{tab:htmlsettings} +% \begin{tabular}{>{\ttfamily}lp{3in}} +% \toprule +% Macro \Slash Cntr \Slash Bool & Description \\ \midrule +% \cs{linkhomename} & Name of the link to the homepage. \\ +% \midrule +% SideTOCDepth & Sectioning depth of the side\TOC. \\ +% \cs{sidetocname} & Name of the side\TOC. \\ +% \midrule +% FileDepth & Sectioning depth of the file splits. \\ +% CombineHigherDepths & Combine higher section levels. \\ +% FileSectionNames & Use section names for file names, else use numbers. \\ +% \cs{FilenameLimit} & Maximum length of the generated filenames. \\ +% \midrule +% FootnoteDepth & Sectioning depth of footnotes. \\ +% \midrule +% \cs{abstractname} & The name of the abstract. \\ +% \cs{mathimagename} & The \SVG\ math image \env{lateximage} \attribute{alt} tag. \\ +% \cs{packagediagramname} & The suffix for a package's \env{lateximage} \attribute{alt} tags. \\ +% \midrule +% \cs{CSSFilename} & The \CSS\ for the following files. \\ +% \cs{MathJaxFilename} & The MathJax script for the following files. \\ +% \midrule +% \cs{HTMLLanguage} & The \HTML\ \attribute{lang} tag. \\ +% \cs{HTMLTitle} & The homepage's \element{title}, overriding \cs{title}. \\ +% \cs{HTMLTitleBeforeSection} & Set subpage \element{title}s to \newline +% \fqquad \attribute{\cs{HTMLTitle} - sectionname} \\ +% \cs{HTMLTitleAfterSection} & Set subpage \element{title}s to \newline +% \fqquad \attribute{sectioname - \cs{HTMLTitle}}\\ +% \cs{HTMLAuthor} & The \HTML\ \attribute{author} meta tag, overriding \cs{author}. \\ +% \cs{HTMLDescription} & The \HTML\ \attribute{description} meta tag. \\ +% \midrule +% \cs{HTMLFirstPageTop} & Heading for the home page. \\ +% \cs{HTMLPageTop} & Heading for the other pages. \\ +% \cs{HTMLPageBottom} & Footing for all pages. \\ +% \midrule +% HTMLDebugComments & Boolean to generate \HTML\ comments. \\ +% \bottomrule +% \end{tabular} +% \end{table} +% +% \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, +% \watchout[Changes!] +% \trouble{HTML>settings>changed} +% it is best to first: +% \begin{enumerate} +% \item Clear all the \HTML, \PDF, and auxiliary files: \userentry{lwarpmk clearall} +% \item Recompile the print version in order to recreate +% the configuration files for \prog{lwarpmk}: \userentry{lwarpmk print} +% \item Finally, recompile the \HTML\ version with the new settings: \userentry{lwarpmk html} +% \end{enumerate} +% +% \begin{description}[style=unboxed] +% +% \item[Options for the \pkg{lwarp} package:] \ \newline +% Use the following as options for |\usepackage[]{lwarp}|: +% +% \begin{description} +% +% \ItemDescribeOption{HomeHTMLFilename} \DescribeDefault{\cs{BaseJobname}} +% Filename of the homepage, without +% the ``\filenm{.html}'' suffix. +% Defaults to the \cs{BaseJobname}. A common setting is: +% \begin{sourcedisplay} +% |HomeHTMLFilename=index| +% \end{sourcedisplay} +% causing the +% homepage to be the file |index.html|. Underscores are allowed in +% \margintag{filename underscores} +% \optn{HomeHTMLFilename} and \optn{HTMLFilename} options, but may need to be escaped +% elsewhere, such as when appearing in a list: +% \gindex{underscore>filename}\gindex{filename>underscore in} +% \changes{v0.24}{2017/03/13}{Docs: Filename underscore.} +% \begin{sourcedisplay} +% \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. +% +% \ItemDescribeOption{HTMLFilename} \DescribeDefault{} +% A filename prefix for the rest of the \HTML\ web pages. +% Useful for numbered web pages with a common prefix. May be empty. +% See \cref{sec:filenameexamples} for examples of naming and numbering \HTML\ files. +% +% \ItemDescribeOption{latexmk} \DescribeDefault{false} +% Controls whether \pkg{lwarp} uses \prog{latexmk} to +% compile the document. This setting is written to \prog{lwarpmk}'s configuration +% files. +% +% \ItemDescribeOption{mathsvg} \DescribeDefault{true} +% Selects \SVG\ display for math output. (The default.) +% +% \ItemDescribeOption{mathjax} \DescribeDefault{false} +% Selects \brand{MathJax} for math output. +% +% ^^A \ItemDescribeOption{mathKaTeX} \DescribeDefault{false} +% ^^A Selects Ka\TeX\ 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\}}:] \ +% +% \begin{description} +% +% \ItemDescribeMacro{\linkhomename} \DescribeDefault{Home} +% Name of the link to the home page. Paragraphs are allowed. +% Redefine with \cs{renewcommand}. +% \changes{v0.63}{2018/11/29}{Docs: \cs{linkhomename}.} +% +% \ItemDescribeCounter{tocdepth} Sectioning depth of the table of contents. +% See \cref{sec:stackdepths} for a list of \LaTeX{} stack depths. +% +% \ItemDescribeCounter{SideTOCDepth} \DescribeDefault{1} +% Sectioning depth of the side\TOC. +% Defaults to 1, causing the side\TOC\ to show sections but not subsections. +% +% Each subpage of the website has its own small table of contents +% \margintag{side\TOC} +% on the side (the ``side\TOC''). Its depth is set by |SideTOCDepth|. +% This side\TOC\ is only shown if the web page is wide enough. +% When using a narrow web browser window, +% ``responsive web design'' is used to show the side\TOC\ at the top of the +% page and a link back to \UI{Home} at the bottom. +% +% \label{sec:filedepth} +% It is recommended to set: +% \begin{sourcedisplay} +% |SideTOCDepth|\,=\,|FileDepth| +% \end{sourcedisplay} +% or +% \begin{sourcedisplay} +% |SideTOCDepth|\,=\,|FileDepth|+1 +% \end{sourcedisplay} +% +% If |SideTOCDepth|\,<\,|FileDepth|, +% \trouble[inaccessible pages]% +% {HTML>missing pages>Side=\optn{SideTOCDepth} and \optn{FileDepth}} +% web pages will be inaccessible via the side\TOC. +% \trouble{file>inaccessible} +% \trouble{page>inacessible} +% \trouble{HTML>inaccessible pages} +% \trouble{sectioning>missing} +% +% \ItemDescribeMacro{\sidetocname} \DescribeDefault{Contents} +% Name of the side\TOC. Paragraphs are allowed. +% Redefine with \cs{renewcommand}. +% \changes{v0.63}{2018/11/29}{Docs: \cs{sidetocname}.} +% +% \ItemDescribeCounter{FileDepth} \DescribeDefault{-5} +% Sectioning depth of file splits. +% Defaults to -5, causing the entire \HTML\ website to be one single file. +% \begin{itemize} +% \item To place the entire file into one \HTML\ page, use: +% \begin{sourcedisplay} +% \cs{setcounter}\{FileDepth\}\{-5\} +% \end{sourcedisplay} +% \item To split the \HTML\ file at \cs{section} depth, use: +% \begin{sourcedisplay} +% \cs{setcounter}\{FileDepth\}\{1\} +% \end{sourcedisplay} +% \item To ensure that the \HTML\ pages/files are accessible: +% \watchout\\ +% Place a \cs{tableofcontents} somewhere before the first section +% break (therefore in the ``home page''), and set +% \begin{sourcedisplay} +% tocdepth\,>=\,FileDepth +% \end{sourcedisplay} +% \trouble{file>inaccessible} +% \trouble{page>inacessible} +% \trouble{HTML>inaccessible pages} +% \trouble{sectioning>missing} +% \end{itemize} +% +% \ItemDescribeBoolean{CombineHigherDepths} \DescribeDefault{true} +% Combine a higher section with +% its first lower subsections, down to the |FileDepth|. +% Defaults to true. Set to false to simulate the concept of a chapter +% opening on its own page, for example. +% +% The file splits are controlled by the counter |FileDepth| and +% the boolean |CombineHigherDepths|. +% Setting |FileDepth| to 0 splits the file +% at chapters, 1 at sections, etc. |CombineHigherDepths| controls whether +% to combine pages at levels higher than the chosen |FileDepth|, such as +% in this tutorial where the page which opens the chapter also contains the +% first section. +% Be careful to set |tocdepth| and |SideTOCDepth| to allow +% \trouble[Inaccesible pages!]% +% {HTML>missing pages>Side=\optn{SideTOCDepth} and \optn{tocdepth}} +% access to each page of the website. Set |tocdepth| and |SideTOCDepth| to be +% greater than or equal to |FileDepth|. +% +% When making changes to the file structure, +% \trouble[Lost in an old page!]{HTML>page did not update} +% it is possible to end up +% with the web browser pointing to an old file which is no longer in use. +% When this occurs, changes to the web site will not appear in the browser, +% even if reloading the page, because that page is no longer in use. +% It is best to return to the home page, clean the files (|lwarpmk cleanall|), +% change |FileDepth| and/or |CombineHigherDepths|, then finally recompile and +% renavigate to the desired page using the new file structure. +% +% \ItemDescribeBoolean{FileSectionNames} \DescribeDefault{true} +% If true, web page filenames are derived from a sanitized version +% of the section names. If false, web pages are numbered. +% Either way, the \optn{HTMLFilename} option is used as a prefix. +% See \cref{sec:filenameexamples} for examples of naming and numbering \HTML\ files. +% The user must ensure that filenames are unique after begin sanitized. +% \trouble[Unique filename!]{HTML>missing pages>filename not unique} +% For example, math in the section name is removed before creating the filename, +% so the rest of the filename must be sufficiently unique to avoid name collisions. +% \gindex{filename>unique} +% +% \ItemDescribeMacro{\FilenameLimit} \DescribeDefault{80} +% \gindex{filename>length} +% The maximum length of the filenames generated by \pkg{lwarp}. +% ``\filenm{.html}'' is added to this length. +% Redefine with \cs{renewcommand}. +% +% \ItemDescribeCounter{FootnoteDepth} \DescribeDefault{3} +% Determines where to place pending footnotes. +% |3| places footnotes before each break down to the \cs{subsubsection} level. +% |1| places footnotes before each \cs{section} break. +% Any pending footnotes are also placed at the bottom of each page +% before each file break. +% +% \ItemDescribeBoolean{HTMLDebugComments} \DescribeDefault{false} +% Set |true| to generate \HTML\ comments, such as which section or \element{div} +% is being opened or closed. +% +% \ItemDescribeMacro{\abstractname} \DescribeDefault{Abstract} +% The name of the abstract. +% This may also be over-written +% by the \pkg{babel} package. Defaults to ``|Abstract|''. +% Redefine with \cs{renewcommand}. +% +% \end{description} +% +% \needspace{2\baselineskip} +% \item[Placed before \texttt{\cs{begin}\{document\}}, +% or before any sectioning command which causes a file break:] \ +% +% \begin{description} +% \ItemDescribeMacro{\CSSFilename} \marg{filename.css} \DescribeDefault{lwarp.css} \quad +% Sets the \CSS\ file to use for the following +% files. May be changed before each each sectioning command which would +% cause a file split. +% +% The \CSS\ styles of the web pages are set by the \cs{CSSFilename} command. +% If \cs{CSSFilename} is not used, a default plain style is used to mimic printed +% \LaTeX\ output. |lwarp_sagebrush.css| is a semi-fancy colored style as shown +% in this tutorial. Change it to |lwarp_formal.css| for a more formal look, +% or comment out the \cs{CSSFilename} command to see the default. +% \cs{CSSFilename} may be used before each file break to set the \CSS\ for +% individual pagess of the website. +% +% \ItemDescribeMacro{\MathJaxFilename} \marg{filename} +% \DescribeDefault{\filenm{lwarp_mathjax.txt}} \quad +% Sets the MathJax script file to use for the following +% files. May be changed before each each sectioning command which would +% cause a file split. +% +% The MathJax script file is copied into the head of each \HTML\ file. +% This may be used to point to a local repository, add extensions, or change +% the script somewhere in the middle of the document. +% \cs{MathJaxFilename} may be used before each file break to set the script file for +% individual pages of the website. +% +% \ItemDescribeMacro{\HTMLLanguage} \marg{langauge} \DescribeDefault{en-US} \quad +% The \HTML\ file's \HTML\ \attribute{lang} meta tag. +% Defaults to \attribute{en-US}. +% +% \ItemDescribeMacro{\HTMLTitle} \marg{title} \DescribeDefault{\cs{thetitle}} \quad +% \gindex{HTML>meta tag>title} +% Overrides \cs{title} for the \HTML\ header's meta title. +% Defaults to \cs{thetitle}, which is set by \cs{title}, or empty otherwise. +% Unlike the author, \cs{thetitle} is set by \cs{title} even if not using the \pkg{titling} package. +% +% \ItemDescribeMacro{\HTMLTitleBeforeSection} \DescribeDefault{\cs{HTMLTitleBeforeSection}} +% Sets subpage \element{title} tags to show the website title followed +% by the section name. +% +% \ItemDescribeMacro{\HTMLTitleAfterSection} +% Sets subpage \element{title} tags to show the section name +% followed by the website title. +% +% To customize subpage \element{title}s, redefine \cs{theHTMLTitleSection}, +% \margintag{custom \element{title}} +% which defaults to: +% \gindex{HTML>meta tag>title} +% \begin{sourcedisplay} +% \cs{def}\cs{theHTMLTitleSection}\{\% \\ +% \fquad\cs{theHTMLTitle}\cs{theHTMLTitleSeparator}\cs{theHTMLSection}\% \\ +% \} +% \end{sourcedisplay} +% +% +% \ItemDescribeMacro{\HTMLAuthor} \marg{author} \DescribeDefault{\cs{theauthor}} \quad +% The \HTML\ header's meta author. +% Defaults to \cs{theauthor}, +% which is set by \cs{author} if using the \pkg{titling} package, +% but is empty otherwise. +% There are several ways to represent the author and affiliations, +% especially if using the \pkg{authblk} package, most of which do not result in +% a sensible \cs{theauthor}, so \cs{HTMLAuthor} is useful to create a list of +% authors without their affiliations. +% +% \ItemDescribeMacro{\HTMLDescription} \marg{description} \DescribeDefault{} \quad +% Sets the \HTML\ \attribute{description} tag for +% the following files. May be changed before each each sectioning command which would +% cause a file split. +% +% \ItemDescribeMacro{\HTMLFirstPageTop} \marg{contents} \DescribeDefault{} \quad +% A user-definable custom action applied +% to the top of the home page. Useful for logos, etc. +% Defaults empty. +% Ignored in print output. +% +% \ItemDescribeMacro{\HTMLPageTop} \marg{contents} \DescribeDefault{} \quad +% A user-definable custom action applied to +% the top of pages other than the home page. Useful for logos, etc. +% Defaults empty. +% \cs{LinkHome} may be used to place a link back to the homepage. +% Ignored in print output. +% +% \ItemDescribeMacro{\HTMLPageBottom} \marg{contents} \DescribeDefault{} \quad +% A user-definable custom action applied to the +% bottom of each web page. +% Useful for authors, copyright notices, contact information, etc. +% Defaults empty. +% \cs{LinkHome} may be used to place a link back to the homepage. +% Ignored in print output. +% +% \end{description} +% +% +% \needspace{2\baselineskip} +% \item[Placed in the home page before the first sectioning command which causes a file break:] \ +% +% \begin{description} +% \ItemDescribeMacro{\tableofcontents} +% Used to place a table of contents on the home page. +% This command must be used before the first file split, +% \trouble[TOC on the homepage!]{Table of Contents>missing} +% \trouble{HTML>inaccessible pages} +% so that a way is available to navigate to other files from the homepage. +% +% Links to each chapter/section are provided, as selected by |tocdepth|. +% \end{description} +% +% +% \needspace{2\baselineskip} +% \item[Placed in the document wherever necessary:] \ +% +% \begin{description} +% +% \ItemDescribeMacro{\mathimagename} \DescribeDefault{math image} +% \label{sec:mathimagename} +% Redefine with \cs{renewcommand}. +% \describemathimagename +% +% \ItemDescribeMacro{\packagediagramname} \DescribeDefault{diagram} +% \label{sec:packagediagramname} +% Redefine with \cs{renewcommand}. +% \describepackagediagramname +% +% \ItemDescribeEnv{warpprint} An environment which is only used +% while generating print output. Place inside anything which does not +% apply to \HTML\ and which may cause problems with \pkg{lwarp}. +% If \pkg{lwarp} knows about and emulates or supports +% a package then its related macros, lengths, counters, etc. probably won't have +% to be placed inside a \env{warpprint} environment, but unknown packages +% may cause problems which may be isolated from \pkg{lwarp} using this environment. +% +% \emph{Do not place anything else on the same line as \texttt{\cs{end}\{warpprint\}}}. +% \watchout +% +% \ItemDescribeEnv{warpHTML} An environment which is only used +% while generating \HTML\ output. This is useful for website logos and +% other items which have no purpose in printed output. +% +% \emph{Do not place anything else on the same line as \texttt{\cs{end}\{warpHTML\}}}. +% \watchout +% +% \ItemDescribeMacro{\warpprintonly} \marg{contents} \quad +% A macro version of the \env{warpprint} environment. +% +% \ItemDescribeMacro{\warpHTMLonly} \marg{contents} \quad +% A macro version of the \env{warpHTML} environment. +% \end{description} +% +% \end{description} +% +% +% \subsubsection{Example \HTML\ file naming} +% \label{sec:filenameexamples} +% \gindex{HTML>filename generation} +% \changes{v0.20}{2016/09/11}{Docs: Examples for generating \HTML\ file names.} +% +% Examples of ways to name or number \HTML\ files: +% \begin{description} +% \item[Numbered \HTML\ nodes:] \ +% +% Example: Homepage |index.html|, and |node-1|, |node-2|. +% \footnote{See \cs{SetHTMLFileNumber} to number in groups by chapter, for example.} +% \begin{Verbatim}[gobble=2,frame=lines,obeytabs,tabsize=4] +% \usepackage[ +% HomeHTMLFilename=index, +% HTMLFilename={node-} +% ]{lwarp} +% \boolfalse{FileSectionNames} +% \end{Verbatim} +% +% \item[Named \HTML\ sections, no prefix:] \ +% +% Example: |index.html|, and |About.html|, |Products.html| +% \begin{Verbatim}[gobble=2,frame=lines,obeytabs,tabsize=4] +% \usepackage[ +% HomeHTMLFilename=index, +% HTMLFilename={} +% ]{lwarp} +% \booltrue{FileSectionNames} +% \end{Verbatim} +% +% \item[Named \HTML\ sections, with prefix:] \ +% +% Example: Homepage |mywebsite.html|, and additional pages such +% as \\ +% |mywebsite-About.html|, |mywebsite-Products|, etc. +% \begin{Verbatim}[gobble=2,frame=lines,obeytabs,tabsize=4] +% \usepackage[ +% HomeHTMLFilename=mywebsite, +% HTMLFilename={mywebsite-} +% ]{lwarp} +% \booltrue{FileSectionNames} +% \end{Verbatim} +% \end{description} +% +% +% \subsection{Customizing the \CSS} +% \label{sec:csscustomization} +% +% \DescribeMacro{\CSSFilename} \marg{filename} \DescribeDefault{lwarp.css} +% +% \cs{CSSFilename} may be used to choose which |.css| file is used to display +% each page of the web site. Use \cs{CSSFilename} before |\begin{document}| +% to assign the style of the home page. +% If different parts of the website should have different styles, +% call \cs{CSSFilename} again before each section heading which creates a new file. +% This may be changed numerous times throughout the file, resulting in +% different \HTML\ pages having different \CSS\ files assigned: +% \begin{Verbatim}[gobble=2,tabsize=4] +% ... +% \CSSFilename{myCSS.css} +% \chapter{Another Chapter} +% ... +% \end{Verbatim} +% \gindex{CSS>file selection} +% \gindex{CSS>per \HTML\ page} +% \gindex{settings>CSS selection} +% +% The styles provided by \pkg{lwarp} include: +% \begin{description} +% \item[|lwarp.css|:] A default style if \cs{CSSFilename} is not used. This +% style is comparable to a plain \LaTeX\ document. +% To set this style, you may use |\CSSFilename{lwarp.css}|, or no \cs{CSSFilename} call at all. +% \item[|lwarp\_formal.css|:] A formal style with a serif fonts and a traditional +% look. +% \item[|lwarp\_sagebrush.css|:] A style with muted colors, gradient backgrounds, +% additional borders, and rounded corners. +% \end{description} +% +% To see each style in use, change the \cs{CSSFilename} entry in the tutorial, +% |lwarpmk html| again, and then reload the tutorial webpage. +% +% A customized style may also be created. +% \margintag{Custom \CSS} +% For each new project a file +% called |sample_project.css| is generated. This may be renamed to +% |.css| then used by assigning |\CSSFilename{.css}|. +% +% Note that |sample_project.css| is overwritten whenever \pkg{lwarp} +% is loaded in print mode. +% It is therefore important to rename the file +% \trouble[Rename it!]{sample=\filenm{sample_projects.css}>overwritten} +% to something like |.css| before +% using it, so that your own changes are not overwritten. +% +% |.css| has an entry which loads |lwarp.css|, and this +% entry may be changed to load |lwarp_formal.css| or |lwarp_sagebrush.css| if +% desired. Additional changes to the \CSS\ may be made by making entries +% later in the |.css| file. +% +% \label{sec:projectcss} +% \DescribeFile{lwarp.css}\DescribeFile{project.css}\DescribeFile{sample_project.css}\label{sec:lwarpcss} +% It is best to make a local project-specific \CSS\ file such as |project.css|, containing only +% things which are different from |lwarp.css|. +% The file |project.css| should refer to |lwarp.css| as follows: +% \gindex{CSS>project-specific changes}\gindex{CSS>lwarp.css=\filenm{lwarp.css}} +% \gindex{settings>CSS project-specific} +% \vspace{-2ex} +% \VerbatimInput[frame=lines]{sample_project.css} +% +% Finally use |\CSSFilename{.css}| in the document to activate the custom \CSS. +% +% +% \subsection{Selecting the operating system} +% \label{sec:OSportabilityusage} +% \changes{v0.11}{2016/03/11}{Added section: Selecting the operating system.} +% +% \osportabilityusage +% +% +% \subsection{Selecting actions for print or \HTML\ output} +% \label{sec:selectingoutput} +% \gindex{settings>selecting output} +% \changes{v0.15}{2016/04/05}{Docs: Clarify print/\HTML\ output.} +% +% The following environments and macros are used to select actions which only apply +% to either traditional \LaTeX{} print-formatted \PDF\ generation, +% or to \HTML\ generation. +% +% For most of built-in \LaTeX\ and many additional packages +% there is user-level source code support or emulation, +% so no special handling will be required. +% For those cases which \pkg{lwarp} does not handle by itself, the +% following environments and macros may be used to isolate sections +% of code for print-only or \HTML-only. +% +% These environments are also useful for creating a special version of +% the titlepage for print and another for \HTML. + +% \DescribeEnv{warpHTML} +% Anything which is to be done only for \HTMLfive{} output +% is surrounded by a |warpHTML| environment: +% \begin{Verbatim}[gobble=2,frame=lines,obeytabs,tabsize=4] +% \begin{warpHTML} +% ... something to be done only during \HTML\ generation +% \end{warpHTML} +% \end{Verbatim} +% Do \emph{not} place anything else on the same line as |\end{warpHTML}|. +% \trouble[\texttt{\cs{end}\{warpHTML\}}]{warpHTML} +% The exact phrase is used to mark the end of the environment. +% +% \DescribeEnv{warpprint} +% Anything which is to be done only for print output +% is surrounded by a |warpprint| environment: +% \begin{Verbatim}[gobble=2,frame=lines,obeytabs,tabsize=4] +% \begin{warpprint} +% ... something to be done only during traditional \PDF\ generation +% \end{warpprint} +% \end{Verbatim} +% As above, do not place anything else on the line with |\end{warpprint}|. +% \trouble[\texttt{\cs{end}\{warpprint\}}]{warpprint} +% +% \DescribeEnv{warpall} +% Anything which is to be done for any output +% may be surrounded by a |warpall| environment. Doing so is optional. +% \begin{Verbatim}[gobble=2,frame=lines,obeytabs,tabsize=4] +% \begin{warpall} +% ... something to be done during print \PDF\ or \HTML\ output +% \end{warpall} +% \end{Verbatim} +% As above, do not place anything else on the line with |\end{warpall}|. +% +% +% Macros are also provided for print-only or \HTML-only code: +% +% \DescribeMacro{\warpprintonly} \marg{actions} +% +% Performs the given actions only when print output is being generated. +% +% \DescribeMacro{\warpHTMLonly} \marg{actions} +% +% Performs the given actions only when \HTML\ output is being generated. +% +% +% +% \subsection{Commands to be placed into the \env{warpprint} environment} +% \label{sec:printcommands} +% +% \changes{v0.14}{2016/03/26}{Docs: Commands into a warpprint environment.} +% +% Certain print-related commands should always be placed +% inside a \env{warpprint} environment, or may need other special handling. +% These are unrelated to \HTML\ output, but are hard to isolate automatically. +% For example: +% +% \begin{itemize} +% \item Paragraph formatting: \cs{parindent} \cs{parskip} +% \item Manual page positions such as the \pkg{textpos} package, which is +% emulated but only in a limited way. +% \item Anything changing the |page| counter. \pkg{lwarp} requires that the +% |page| counter not be adjusted during \HTML\ output. +% \end{itemize} +% +% Some packages require additional setup commands. Where these packages are emulated +% for \HTML, setup commands may work for the emulated \HTML\ output as well as for print +% output. See the details for each package in this document for more information. +% +% Also see \cref{sec:troubleshooting}: \nameref{sec:troubleshooting}. +% +% +% +% +% +% +% \subsection{Title page} +% \label{sec:settitle} +% \gindex{settings>title page} +% +% In the preamble, place an additional block of code to set the following: +% \vspace{-2em} +% \begin{Verbatim}[gobble=2,frame=lines,obeytabs,tabsize=4] +% \title{Document Title} % One line only +% \author{Author One\affiliation{Affiliation One} \and +% Author Two\affiliation{Affiliation Two} } +% \date{Optional date} +% \end{Verbatim} +% +% The title is used in the meta tags in the \HTML\ files, +% unless overridden by \cs{HTMLTitle}, and the rest are used in \cs{maketitle}. +% To use a \cs{subtitle} or \cs{published} field, see \cref{sec:publishedsubtitle}. +% +% +% \DescribeMacro{\maketitle} +% Use \cs{maketitle} just after the |\begin{document}|, as this will establish +% the title of the homepage. Optionally, use a \env{titlepage} environment instead. +% +% \DescribeEnv{titlepage} +% The \env{titlepage} environment may be used to hold a custom title page. +% The titlepage will be set in a \element{div} class |titlepage|, and \cs{printtitle}, etc.\ may be used +% inside this environment. +% +% \DescribeEnv{titlingpage} +% Another form of custom title page, where \cs{maketitle} is allowed, and +% additional information may be included as well. +% +% \DescribeMacro{\title} \marg{title} +% +% Avoid newlines in the \cs{title}; these will interfere with the +% file break and \CSS\ detection. +% \trouble[newlines]{title>newlines} +% \trouble{HTML>corrupted} +% Use a \cs{subtitle} command instead (\cref{sec:publishedsubtitle}). +% The title will appear in the document \cs{maketitle} as a heading \element{h1}. +% The \HTML\ meta |title| tag will also have this title, unless \cs{HTMLTitle} +% is used to set the meta title to something else instead. +% +% \DescribeMacro{\author} \marg{author} +% +% In \cs{author}, \cs{protect} may be needed before some formatting commands. +% \trouble{author>formatting} +% In \HTML, the author will appear in a \element{div} of class |author| in the +% \cs{maketitle}. +% If the \pkg{titling} package is used, the author will also appear in a \HTML\ meta tag, but +% \cs{HTMLAuthor} may be necessary to create a plain list of names if +% \cs{author} had affiliations added. +% \cs{affiliation} is a new addition to \pkg{lwarp}. +% +% \DescribeMacro{\date} \marg{date} +% +% \cs{date} works as expected. +% In \HTML, this will appear in a \element{div} class |titledate|. +% +% +% \DescribeMacro{\thanks} \marg{text} +% +% \cs{thanks} are allowed in the titlepage fields, and will be rendered +% as \HTML\ notes at the bottom of the title page. +% +% +% \subsection{\HTML\ page meta descriptions} +% +% \label{sec:htmldescription} +% \gindex{HTML>meta tag>description} +% \gindex{description>HTML meta tag} +% \gindex{meta tag, HTML>description} +% \DescribeMacro{\HTMLDescription} \marg{A description of the web page.} +% \DescribeDefault{(none)} +% +% Each page of \HTML\ output should have its own \HTML\ meta description, +% which usually shows up in web search results, +% \margintag{limitations} +% is limited to around +% 150 characters in length, and should not include the \acro{ASCII} double quote character ("). +% +% Use \cs{HTMLDescription} +% \margintag{placement} +% just before |\begin{document}| to set the description of the home page, +% and also just before each sectioning command such as \cs{chapter} or \cs{section} +% where a new file will be generated, depending on |FileDepth|. For example, if |FileDepth| is 1, +% use \cs{HTMLDescription} just before each \cs{section} command, and that description will be +% placed inside the \HTML\ page for that \cs{section}. The same descrition will be used for +% all following \HTML\ files as well, until reset by a new \cs{HTMLDescription}. It is best +% to use a unique description for each \HTML\ file. +% +% To disable the generation of \HTML\ description meta tags, +% \margintag{disabling} +% use: +% \begin{sourcedisplay} +% \fqquad \cs{HTMLDescription}\{\} +% \end{sourcedisplay} +% +% +% \subsection{\HTML\ homepage meta title} +% +% \gindex{HTML>meta tag>title} +% \gindex{title>HTML meta tag} +% \gindex{meta tag, HTML>title} +% \DescribeMacro{\HTMLTitle} \marg{title} +% \DescribeDefault{\texttt{\cs{HTMLtitle}\{\cs{thetitle}\}}} +% +% Sets the contents of the web page \element{meta name="title"} element. +% May be set empty to cancel the meta title tag. +% +% See \cref{sec:htmlsettings} for \cs{HTMLTitleBeforeSection} and +% \cs{HTMLTitleAfterSection}, used to set the title for \HTML\ subpages. +% +% +% \subsection{\HTML\ page meta author} +% +% \gindex{HTML>meta tag>author} +% \gindex{author>HTML meta tag} +% \gindex{meta tag, HTML>author} +% \DescribeMacro{\HTMLAuthor} \marg{author} +% \DescribeDefault{\texttt{\cs{HTMLAuthor}\{\cs{theauthor}\}}} +% +% Sets the contents of the web page \element{meta name="author"} element. +% May be set empty to cancel the meta author tag. +% +% \cs{author} may be used to create a list of authors and their affiliations, +% in several formats if using \pkg{authblk}, and these may not successfully parse +% properly into a sensible list for \cs{theauthor}. +% \cs{HTMLAuthor} may be used to set the meta tag to a simple list of names. +% +% +% +% \section{Special cases and limitations} +% \label{sec:limitations} +% +% \label{sec:successfulcommands} +% \gindex{HTML>conversion suggestions} +% +% \changes{v0.14}{2016/03/26}{Docs: Commands for a successful \HTML\ conversion.} +% \changes{v0.36}{2017/08/11}{Docs: Reorganized: Special cases and limitations.} +% +% Some commonly-used \LaTeX{} expressions should be modified as follows to allow +% for a smooth conversion to both \HTML\ and print-formatted outputs. +% +% \needhelp +% +% \subsection{Things to avoid} +% \label{sec:thingstoavoid} +% \changes{v0.51}{2018/03/04}{Docs: Things to avoid.} +% +% In the document, avoid the following: +% +% \begin{description} +% \item [\texttt{page} counter:] Do not adjust the \texttt{page} counter. +% If doing so is required for the print version, place the +% adjustment inside a \env{warpprint} environment. +% \item [Custom math environment macros:] Do not use expressions such as +% \cs{beq} as a replacement for \texttt{\cs{begin}\{equation\}}. +% \item [Custom macros in section, figure, table names:] Custom macros which appear in +% sectioning commands or float captions then appear in the +% \filenm{.toc}, \filenm{.lof}, and \filenm{.lot} lists, and should be made robust +% using \cs{newrobustcmd} or \cs{robustify} from \pkg{etoolbox}, \pkg{xparse}, etc. +% +% \changes{v0.54}{2018/04/21}{Docs: Macros in sectioning names.} +% When setting |FileSectionNames| to |true| to name the \HTML\ files from the +% section names, the file names are created from sanitized versions of the chapter +% or section names, but the section names must be plain text or something +% which expands into plain text. Robust macros will not work at the sectioning +% level which is used for file names, but a robust macro or other complicated +% name may be used for the manditory argument of \cs{chapter}, \cs{section}, etc., +% if a plain-text version is also included in the optional argument: +% \begin{sourcedisplay} +% \cs{chapter}[Plain Name]\{\cs{ARobustMacro\{Fancy Name\}}\} +% \end{sourcedisplay} +% \end{description} +% +% +% \subsubsection{Invalid \HTML} +% \label{sec:invalidhtml} +% +% \trouble{HTML>invalid} +% \trouble{HTML>validation} +% Additionally, some objects are valid \LaTeX, but invalid \HTML. +% An example is a tabular inside \cs{textbf}, since \HTML\ does not allow a table +% inside a span. \pkg{lwarp} will create the table, and the browser may support it, +% but the result is technically invalid. +% +% +% +% \subsection{Formatting} +% +% \subsubsection{Text formatting} +% \label{sec:avoidtextformatting} +% \gindex{code listings} +% \gindex{program listings} +% \gindex{listings, program code} +% \gindex{HTML>entities, conversion} +% \gindex{HTML>verbatim, in} +% \gindex{verbatim>code and \HTML\ tags} +% +% \changes{v0.61}{2018/09/25}{Docs: \HTML\ entities.} +% +% \limitstext +% +% \subsubsection{Horizontal space} +% +% \limitshspace +% +% +% \subsubsection{Text alignment} +% +% Use the environments \env{center}, \env{flushright}, \env{flushleft} instead +% of the macros \cs{centering}, \cs{raggedright}, \cs{raggedleft}. +% +% \limitsfloatalignment +% +% +% \subsubsection{Accents} +% +% \limitsaccents +% +% +% \subsubsection{\pkg{textcomp} package} +% +% \DescribePackage{textcomp} +% \limitstextcomp +% +% \subsubsection{Superscripts and other non-math uses of math mode} +% +% Use \cs{textsuperscript\{x\}} instead of |$^{x}$| +% +% \subsubsection{Empty \cs{item} followed by a new line of text or a nested list:} +% +% Use a trailing backslash: |\item[label] \| +% \margintag{lists} +% \trouble{list>empty item} +% +% +% \subsubsection{Filenames and \URL{}s in lists or footnotes} +% +% \gindex{underscore>filename}\gindex{filename>underscore in} +% \gindex{list>filename} +% \changes{v0.24}{2017/03/13}{Docs: Filename underscore.} +% Escape underscores in +% \margintag{filename underscore} +% the filenames: +% \begin{sourcedisplay} +% |\item[\href{file\_name.pdf}{text}]| +% \end{sourcedisplay} +% +% +% \subsubsection{\pkg{relsize} package} +% +% \DescribePackage{relsize} +% \limitsrelsize +% +% +% \subsection{Boxes and minipages} +% +% \subsubsection{Marginpars} +% +% \limitsmarginpars +% +% \subsubsection{Save Boxes} +% +% \changes{v0.27}{2017/04/04}{Docs: Limitations of saveboxes.} +% +% \limitssaveboxes +% +% +% \subsubsection{Minipages} +% \label{sec:minipages} +% +% \limitsminipage +% +% +% \subsubsection{Side-by-side minipages} +% +% Place side-by-side minipages inside a |center| environment, +% with horizontal space between them, such as \cs{quad}, \cs{qquad}, +% \cs{hspace}, or \cs{hfill}. The result is similar in print and +% \HTML. Do not use space commands at the start or end of the line. +% +% \subsubsection{Framed minipages and other environments} +% \label{sec:framedminipages} +% +% \cs{fbox} can only be used around inline \element{span} items during +% \HTML\ output, but \HTML\ cannot place a block element such as a \element{div} for a minipage +% or a list inside of a \element{span}. Several options are provided for framing an object, +% depending on which kind of object and which packages are loaded: +% +% For a framed object, options include: +% \DescribeMacro{\fbox} +% \DescribeMacro{\fboxBlock} +% \DescribeEnv{fminipage} +% \gindex{minipage>framed} +% \gindex{framed objects} +% \trouble{frames} +% \begin{description}[style=unboxed] +% \item [To remove the frame in \HTML\ output:] Place the \cs{fbox} command and +% its closing brace inside \env{warpprint} environments. +% This will nullify the frame for \HTML\ output. +% \item [To frame the contents inline with some formatting losses in HTML:] +% This is the default action of \cs{fbox} when enclosing a minipage. +% \margintag{For inline text:} +% During \HTML\ output, \cs{fbox} nullifies the \HTML\ tags +% for \env{minipage}, \cs{parbox}, +% and lists. The contents are included as inline text inside the +% \cs{fbox}'s \element{span} of class |framebox|. +% For lists, line breaks are converted to \HTML\ breaks. +% The result is a plain-text inline version of the contents, framed inline +% with the surrounding text, but lacking any extra \HTML\ markup. +% \item [To frame the contents on their own line with improved formatting in HTML:] A new +% command \cs{fboxBlock} is included, +% \margintag{For inline \env{minipage} and lists:} +% intended to be a direct replacement +% for \cs{fbox} for cases where the \cs{fbox} surrounds a minipage, table, or list. +% For print output, this behaves as \cs{fbox}. +% For \HTML\ output, the contents are placed +% inside an \HTML\ \element{div} with the class |framed|, resulting in the contents +% being placed on their own line with a frame surrounding them. +% The contents preserve their \HTML\ formatting, so lists and minipages look nicer, +% and valid \HTML\ is created for a \env{tabular}. +% While an \cs{fbox} containing a \env{tabular} is valid \LaTeX\ code, the result +% in \HTML\ is problematic since a table is a \element{div} not a \element{span}, +% so use \cs{fboxBlock} around a \env{tabular}, or else place the \env{tabular} +% inside a \env{minipage}, or use \env{fminipage}, described next. +% Also see below regarding the ``Misplaced alignment tab character \&.'' error. +% \item [To create a framed minipage in both print and HTML:] A new environment \env{fminipage} +% \margintag{For display \env{tabular}, minipages, and lists:} +% is included. For print output, this is identical to \env{minipage}, except that +% it is also framed. +% For \HTML\ output, this forms a \element{div} of class |framed|, the contents +% preserve their \HTML\ formatting, and valid \HTML\ is created for a \env{tabular}. +% Also see \cref{sec:xcolorpatches} for a new environment \env{fcolorminipage}. +% Also see below regarding the ``Misplaced alignment tab character \&.'' error. +% \item [To create colored frames and boxes:] See \cref{sec:xcolor} for \pkg{xcolor}'s +% \margintag{colored boxes and frames:} +% \cs{colorbox} and \cs{fcolorbox}, +% and \pkg{lwarp}'s additional \cs{colorboxBlock} and \cs{fcolorboxBlock}. +% \item [To frame tables or verbatim environments:] Place the contents +% inside a \env{fminipage}, or perhaps a \cs{fboxBlock} for a \env{tabular}. +% Also, if using \cs{fboxblock} with \env{tabular}, +% \trouble[Misplaced alignment tab character \&] +% {Misplaced alignment tab character \&>frames} +% you will have to use \cs{StartDefiningTabulars} +% before the start of the macro which uses \cs{fboxBlock} and the \env{tabular}, +% and \cs{StopDefiningTabulars} afterwards. +% Also see the \pkg{lwarp} documentation for the \pkg{fancybox} package. +% \item [To frame equations:] See \cref{sec:fancybox} for the \pkg{fancybox} package. +% \item [For fancy framed minipages:] See packages \pkg{boxedminipage2e}, +% \pkg{shadow}, \pkg{fancybox}, \pkg{framed}, \pkg{mdframed}. +% \item [Custom environments:] Use a custom environment to create a sidebar, +% containing a \env{BlockClass} environment +% with custom \CSS\ formatting, +% and |\warpprintonly{\hrule}| command: +% \begin{Verbatim}[gobble=2,frame=lines] +% \begin{BlockClass}{frameminipage}% ignored in print output +% % use \CSS\ to format div class ``framedminipage'' +% \warpprintonly{\hrule} % only appears in print output +% Contents +% \warpprintonly{\hrule} % only appears in print output +% \end{BlockClass} +% \end{Verbatim} +% \end{description} +% +% +% \subsubsection{\pkg{fancybox} package} +% +% \DescribePackage{fancybox} +% \limitsfancybox +% +% +% \subsubsection{\pkg{mdframed} package} +% +% \DescribePackage{mdframed} +% \limitsmdframed +% +% +% \subsection{Section names} +% \label{sec:limitssectionnames} +% +% If using named \HTML\ files, by selecting |\booltrue{FileSectionNames}|, +% the generated filenames may be simplified by using \cs{FilenameSimplify} +% and \cs{FilenameNullify}: +% +% \DescribeMacro{\FilenameSimplify} \marg{text} +% \gindex{filename>simplify} +% \gindex{section>file names} +% +% To remove common short words from the automatically-generated filenames, +% replacing each with a single hyphen ``|-|'', +% use \cs{FilenameSimplify}: +% \begin{sourceverb} +% \FilenameSimplify*{-in-} +% \FilenameSimplify*{A-} +% \end{sourceverb} +% The first example removes the word ''in'' in the middle of a filename, +% and the second example removes ``A'' at the start of the filename. +% The star forces the arguments to be detokenized, which is required for +% a plain-text comparison. +% (The unstarred form is used for a token-sensitive comparison, which is +% seldom required by the user.) +% After simplfication, repeated hyphen characters will be further simplified +% to a single hyphen ``|-|''. +% Finally, single hyphens at the start or end of the filename are removed. +% +% \DescribeMacro{\FilenameNullify} \marg{macros} +% +% Macro names may appear in the automatically-generated file names. +% \trouble[macros in section names]{sectioning>macro in name} +% \trouble{filename>corrupted} +% \trouble{filename>macro in name} +% To remove these, create \emph{non-robust} nullified versions +% of the macros, +% ensuring that each line ends with a percent character |%| as shown below. +% These are placed inside \cs{FilenameNullify}, which adds them to the +% list of macros which are nullfiied during filename generation. +% Low-level macros such as \cs{begingroup} will cause problems when +% nullfied. Many macros such as \cs{textbf} are already nullfied. +% \pkg{lwarp} also already nullifies built-in symbol and \pkg{textcomp} macros, +% including if defined by \pkg{xunicode}, but not all \pkg{xunicode} macros. +% See the definition of \cs{LWR@nullfonts} for a complete list. +% \begin{sourcedisplay} +% \cs{FilenameNullify}\{\textred{\%}\\ +% \fquad\cs{renewcommand*}\{\cs{macroname}\}[1]\{\#1\}\textred{\%}\\ +% \fquad\cs{renewcommand*}\{\cs{anothermacro}\}\{\}\textred{\%}\\ +% \} +% \end{sourcedisplay} +% +% Avoid duplicate file names. +% \trouble[duplicate filename]{filename>duplicate} +% \trouble{duplcate filename} +% \trouble{sectioning>duplicate name} +% Section names at levels which result in \HTML\ file splits must +% be unique. \pkg{lwarp} will generate an error if a duplicate +% \HTML\ filename is generated. +% Use the optional \TOC\ caption entry parameter for formatting. +% Remember to \cs{protect} \LaTeX\ commands which appear in +% section names and \TOC\ captions. +% +% \limitsmathinsectionnames +% +% +% \subsection{Cross-references} +% +% \limitsreferences +% +% \subsubsection{Page references} The printed page does not translate +% to the \HTML\ +% \trouble[\LaTeX\ page numbers]{page counter>references} +% page, so \cs{pageref} references are converted to parentheses containing +% \cs{pagerefPageFor}, which defaults to ``see~'', +% followed by a hyperlink to the appropriate +% object. +% +% Ex: +% \begin{sourcedisplay} +% \cs{ref}\{sec:name\} on page \cs{pageref}\{sec:name\} \\ +% \rmfamily +% \hspace*{-2em} in \HTML\ becomes: \\ +% ``Sec.~\textred{1.23} +% on page (\textbf{see} +% sec.~\textred{1.23})''. +% \end{sourcedisplay} +% \cs{pagerefPageFor} may be redefined to ``page for '', empty, etc. +% See \cpageref{sec:pagerefpagefor}. +% +% +% \subsubsection{\pkg{cleveref} and \pkg{varioref} packages} +% +% \changes{v0.22}{2017/03/01}{\pkg{varioref}: Supported.} +% +% \DescribePackage{cleveref} +% \DescribePackage{varioref} +% \limitscpageref +% +% \subsubsection{Hyperlinks, \pkg{hyperref}, and \pkg{url}} +% +% \DescribePackage{hyperref} +% \DescribePackage{url} +% \limitshyperlinks +% +% +% \subsubsection{Footnotes and page notes} +% \label{sec:limitsfootnotes} +% +% \trouble{footnote>numbering} +% \gindex{footnotes>numbering} +% \trouble{footnote>in sectioning command} +% +% \limitsfootnotes +% +% \trouble{footnote>verbatim} +% \trouble{verbatim>footnote} +% \trouble{footnote>in math} +% \trouble{math>footnote} +% \limitsverbatimfootnotes +% +% \limitspfnote +% +% \limitsmanyfootbigfoot +% +% +% \subsection{Front and back matter} +% \label{sec:frontbackmatter} +% +% \subsubsection{Custom classes with multiple authors and affiliations} +% \label{sec:authorsaffils} +% \changes{v0.51}{2018/03/04}{Docs: Multiple authors and affiliations.} +% +% Some classes allow multiple authors and affiliations. +% \gindex{author>multiple}\gindex{affiliation>multiple authors} +% Often it is possible to emulate these using a standard class +% along with \pkg{authblk}: +% \begin{sourcedisplay} +% \%\cs{documentclass}\{customclass\}~\% for print document \\ +% \cs{documentclass}\{article\}~\% for \HTML\ document \\ +% \\ +% \cs{usepackage}\{lwarp\} \\ +% \cs{begin}\{warpHTML\} \\ +% \cs{usepackage}\{authblk\} \\ +% \cs{let}\cs{affiliation}\cs{affil}~\% maybe required \\ +% \cs{end}\{warpHTML\} +% \end{sourcedisplay} +% +% \subsubsection{Starred chapters and sections} +% \label{sec:forcesectionstar} +% +% \changes{v0.38}{2017/08/24}{Docs: Starred sections.} +% +% The following describes \cs{ForceHTMLPage} and \cs{ForceHTMLTOC}, +% which may be used for \pkg{endnotes}, \pkg{glossaries}, \pkg{tocbibind}, +% bibliographies, and the index. +% See the following sections where applicable. +% Continue here if interested in the reason for adding these commands to \pkg{lwarp}. +% \trouble{endnotes>HTML=\HTML\ page and \TOC} +% \trouble{glossaries=\pkg{glossaries}>HTML=\HTML\ page and \TOC} +% \trouble{bibliography>HTML=\HTML\ page and \TOC} +% \trouble{index>HTML=\HTML\ page and \TOC} +% \gindex{endnotes>HTML=\HTML\ page and \TOC} +% \gindex{glossaries=\pkg{glossaries}>HTML=\HTML\ page and \TOC} +% \gindex{bibliography>HTML=\HTML\ page and \TOC} +% \gindex{index>HTML=\HTML\ page and \TOC} +% +% Some packages use \cs{chapter*} or \cs{section*} to introduce reference +% material such as notes or lists, often to be placed in the back matter of a book. +% These starred sections are placed inline instead of on their own \HTML\ pages, +% and they are not given \TOC\ entries. +% +% \pkg{lwarp} provides a method to cause a starred section to be on its own \HTML\ page, +% subject to \texttt{FileDepth}, and also a method to cause the starred section +% to have its own \TOC\ entry during \HTML\ output. +% +% \DescribeMacro{\ForceHTMLPage} +% To place a starred section on its own \HTML\ page, use \cs{ForceHTMLPage} just before +% the \cs{chapter*} or \cs{section*}. \pkg{lwarp} will create a new page for the +% starred sectional unit. +% +% A starred sectional unit does not have a \TOC\ entry unless one is placed +% manually. The typical method using \cs{phantomsection} and \cs{addcontentsline} +% works for inline text but fails when the new starred section is given its own +% webpage after the \TOC\ entry is created, or when creating an \EPUB\ where +% the \TOC\ entry will point to the page before the starred section. +% If the starred section has its own \HTML\ page but no correct \TOC\ entry +% \trouble[inaccessible \HTML\ page]{HTML>inaccessible pages>starred section} +% \trouble{sectioning>starred section} +% pointing to that page, the page will be inaccessible unless some other link is created. +% +% \DescribeMacro{\ForceHTMLTOC} +% To automatically force the \HTML\ version of the document to have a \TOC\ entry +% for a starred section, use \cs{ForceHTMLTOC} just before +% the \cs{chapter*} or \cs{section*}, +% and place \cs{phantomsection} and \cs{addcontentsline} inside a \env{warpprint} +% environment. +% +% For print output, \cs{ForceHTMLTOC} and \cs{ForceHTMLPage} have no effect. +% +% +% +% \subsubsection{\pkg{abstract} package} +% +% \DescribePackage{abstract} +% \limitsabstract +% +% +% \subsubsection{\pkg{titling} and \pkg{authblk}} +% +% \DescribePackage{titling} +% \DescribePackage{authblk} +% \limitstitlepage +% +% +% \subsubsection{\pkg{tocloft} package} +% +% \DescribeOption[tocloft]{titles} +% \DescribePackage{tocloft} +% \limitstocloft +% +% +% \subsubsection{\pkg{appendix} package} +% +% \DescribePackage{appendix} +% \limitsappendix +% +% +% \subsubsection{\pkg{pagenote} package} +% +% \DescribePackage{pagenote} +% \limitspagenote +% +% +% \subsubsection{\pkg{endnotes} package} +% +% \DescribePackage{endnotes} +% \limitsendnotes +% +% +% \subsubsection{\brand{BibTeX}} +% \label{sec:limitsbibtex} +% \DescribeMacro{\etalchar} Displays a superscript ``+'' to indicate ``and others''. +% \changes{v0.54}{2018/03/09}{Docs: BibTeX.} +% +% \limitsbibtex +% +% +% \needspace{6\baselineskip} +% \subsubsection{\pkg{gloss} package} +% \label{sec:gloss} +% +% \DescribePackage{gloss} +% \gindex{gloss=\pkg{gloss}} +% \trouble[compiling]{gloss=\pkg{gloss}} +% \limitsgloss +% +% \needspace{10\baselineskip} +% \subsubsection{\pkg{glossaries} package} +% \label{sec:glossaries} +% +% \DescribePackage{glossaries} +% \gindex{glossaries=\pkg{glossaries}>options} +% \gindex{language>glossaries=\pkg{glossaries}} +% \gindex{glossaries=\pkg{glossaries}>language} +% \limitsglossaries +% +% +% \subsubsection{\pkg{nomencl} package} +% \label{sec:nomencl} +% +% \DescribePackage{nomencl} +% \gindex{nomencl=\pkg{nomencl}} +% \trouble{nomencl=\pkg{nomencl}} +% \limitsnomencl +% +% +% \subsubsection{Indexing overview} +% \label{sec:indexingoverview} +% +% 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. +% +% 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, +% \margintag{source code} +% \gindex{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}.} +% +% \gindex{xindy=\pkg{xindy}>and \pkg{hyperref}} +% \gindex{hyperref=\pkg{hyperref}>and \pkg{xindy}} +% \gindex{index>xindy=\pkg{xindy} and \pkg{hyperref}} +% \trouble{index>missing entries} +% \gindex{index>see, seealso, ranges} +% \gindex{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, ``\filenm{_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{} \\ +% \fqquad \textgreen{xindyCodepage=utf8,} \hfill \textrm{} \\ +% \fqquad \textgreen{latexmk} \hfill \textrm{}\\ +% ]\{\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 .idx \textred{;} \\ +% \fqquad makeindex -s lwarp.ist \\ +% \fqqquad -o \textred{.sind} \textred{.sidx} \\ +% \fquad\}, \\ +% \fquad\textred{HTMLIndexCmd}=\{ \\ +% \fqquad makeindex -s lwarp.ist \textred{\_html}.idx \textred{;} \\ +% \fqquad makeindex -s lwarp.ist \\ +% \fqqquad -o \textred{\_html.sind} \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, ``\filenm{_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 \textred{-\/- -s lwarp.ist} \\ +% \fquad\}, \\ +% \fquad\textred{HTMLIndexCmd}=\{ \\ +% \fqquad splitindex \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, ``\filenm{_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} \textred{-\/- -M lwarp.xdy} \\ +% \fqqquad \textgreen{-L english -C utf8} \hfill{} \\ +% \fquad\}, \\ +% \fquad\textred{HTMLIndexCmd}=\{ \\ +% \fqquad splitindex \textred{-m xindy} \textred{\_html} \textred{-\/- -M lwarp.xdy} \\ +% \fqqquad \textgreen{-L english -C utf8} \hfill{} \\ +% \fquad\} \\ +% ]\{\textblue{lwarp}\} \\ +% \cs{usepackage}\{\textblue{splitidx}\} \\ +% \dots \\ +% \cs{makeindex} \\ +% \cs{newindex}[Second Index]\{secondname\} \\ +% \end{sourcedisplay} +% When creating the \HTML\ index, ``\filenm{_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}. +% \pkg{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}. +% \pkg{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{} \\ +% \fquad \textgreen{xindyCodepage=utf8,} \hfill \textrm{} \\ +% \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 .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 \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{} 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} .idx \textred{;} \\ +% \fqquad makeindex \textred{-s lwarp.ist} secondname.idx \\ +% \fquad\}, \\ +% \fquad\textred{HTMLIndexCmd}=\{ \\ +% \fqquad makeindex \textred{-s lwarp.ist} \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{} 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{} \\ +% \fqquad \textgreen{xindyCodepage=utf8,} \hfill \textrm{} \\ +% \fqquad \textgreen{latexmk} \hfill \textrm{}\\ +% ]\{\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{} \\ +% \fqquad \textgreen{xindyCodepage=utf8,} \hfill \textrm{} \\ +% \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 .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 \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{} 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. +% \gindex{lwarp.ist=\filenm{lwarp.ist}>customizing} +% \gindex{makeindex>customizing} +% \gindex{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. +% \gindex{lwarp.xdy=\filenm{lwarp.xdy}>customizing} +% \gindex{xindy=\pkg{xindy}>customizing} +% \gindex{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 +% \trouble[\pkg{xindy} with \pkg{hyperref}]{xindy=\pkg{xindy}>hyperref=\pkg{hyperref}} +% \trouble{index>xindy=\pkg{xindy} and \pkg{hyperref}} +% \trouble{index>see and seealso} +% \trouble{index>reference ranges} +% \trouble{index>styling references} +% 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 +% \trouble[empty index]{index>empty} +% \trouble{morewrites=\pkg{morewrites}} +% before \pkg{lwarp} is loaded: +% \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: +% \gindex{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, \TOC, \pkg{tocbibind}} +% \limitstocbibind +% +% \limitstocloft +% +% +% +% \subsection{Math} +% +% \changes{v0.42}{2017/10/30}{Docs: Reorganized math limitations} +% \label{sec:limitsmath} +% +% \limitsmath +% +% \subsubsection{Catcode changes} +% \label{sec:mathcatcode} +% \limitsmathcatcode +% +% \subsubsection{Complicated inline math objects} +% \label{sec:mathdynamic} +% \gindex{inline math>complicated objects} +% \gindex{math>inline with complicated objects} +% \gindex{math>dynamic} +% \gindex{dynamic math} +% \limitsmathinline +% +% \subsubsection{Complicated display math objects} +% \label{sec:displaymathother} +% \gindex{display math>complicated objects} +% \gindex{math>display with complicated objects} +% \gindex{math>dynamic} +% \gindex{dynamic math} +% \trouble{math>tikz=\tikz} +% \trouble{tikz>in math} +% \trouble{MathJax=\brand{MathJax}>errors} +% \trouble{HTML>alt tags} +% \trouble{alt tags} +% +% \limitsmathdisplay +% +% \subsubsection{\pkg{ntheorem} package} +% +% \DescribePackage{ntheorem} +% \limitsntheorem +% +% +% \subsubsection{\pkg{siunitx} package} +% \label{sec:limitssiunitx} +% +% \DescribePackage{siunitx} +% \limitssiunitx +% +% +% \subsubsection{\pkg{units} and \pkg{nicefrac} packages} +% +% \DescribePackage{units} +% \DescribePackage{nicefrac} +% \limitsnicefrac +% +% +% \subsubsection{\pkg{newtxmath} package} +% +% \DescribePackage{newtxmath} +% \limitsnewtxmath +% +% +% \subsection{Graphics} +% \label{sec:limitsgraphics} +% +% \DescribePackage{graphics}% +% \DescribePackage{graphicx}% +% \limitsgraphics +% +% +% \subsubsection{\pkg{tikz} package} +% \label{sec:limitstikz} +% +% \DescribePackage{tikz} +% \limitstikz +% \changes{v0.51}{2018/03/18}{Docs: \pkg{tikz} limitations.} +% +% +% \subsubsection{\pkg{grffile} package} +% +% \DescribePackage{grffile} +% \limitsgrffile +% +% +% \subsubsection{\pkg{color} package} +% +% \DescribePackage{color} +% \limitscolor +% +% +% \subsubsection{\pkg{xcolor} package} +% +% \DescribePackage{xcolor} +% \limitsxcolor +% +% +% \subsubsection{\pkg{epstopdf} package} +% +% \DescribePackage{epstopdf} +% \limitsepstopdf +% +% +% \subsubsection{\pkg{pstricks} package} +% +% \DescribePackage{pstricks} +% \limitspstricks +% +% +% \subsubsection{\pkg{pdftricks} package} +% +% \DescribePackage{pdftricks} +% \limitspdftricks +% +% +% \subsubsection{\pkg{psfrag} package} +% +% \DescribePackage{psfrag} +% \trouble{psfrag=\pkg{psfrag}} +% \limitspsfrag +% +% +% \subsubsection{\pkg{pstool} package} +% +% \DescribePackage{pstool} +% \trouble{pstool=\pkg{pstool}} +% \limitspstool +% +% +% \needspace{15\baselineskip} +% \subsubsection{\pkg{asymptote} package} +% \changes{v0.62}{2018/10/16}{Docs: \pkg{asymptote}.} +% +% \DescribePackage{asymptote} +% \limitsasymptote +% +% +% \subsubsection{\pkg{overpic} package} +% +% \DescribePackage{overpic} +% \limitsoverpic +% +% +% \subsubsection{Multimedia packages} +% +% \DescribePackage{multimedia} +% \DescribePackage{movie15} +% \DescribePackage{media9} +% \trouble{multimedia=\pkg{multimedia}} +% \trouble{media9=\pkg{media9}} +% \trouble{movie15=\pkg{movie15}} +% \trouble{graphics>multimedia} +% \trouble{video} +% \trouble{audio} +% \gindex{video} +% \gindex{audio} +% \gindex{multimedia} +% \limitsmultimedia +% +% +% +% \subsection{Tabbing} +% \limitstabbing +% +% +% \subsection{Tabular} +% +% \subsubsection{\env{tabular} environment} +% \label{sec:limitstabular} +% \changes{v0.39}{2017/08/30}{Docs: Reorganized tabular discussion.} +% \limitstabular +% +% \subsubsection{\pkg{multirow} package} +% \gindex{multirow=\pkg{multirow}>mrowcell=\cs{mrowcell} and \cs{mcolrowcell}} +% \gindex{tabular>multirow=\pkg{multirow} \cs{mrowcell} and \cs{mcolrowcell}} +% \gindex{mrowcell=\cs{mrowcell}} +% \gindex{mcolrowcell=\cs{mcolrowcell}} +% \trouble{multirow=\pkg{multirow}>mrowcell=\cs{mrowcell} and \cs{mcolrowcell}} +% \trouble{tabular>multirow=\pkg{multirow} \cs{mrowcell} and \cs{mcolrowcell}} +% \trouble{mrowcell=\cs{mrowcell}} +% \trouble{mcolrowcell=\cs{mcolrowcell}} +% \gindex{multicolumn=\cs{multicolumn}>with \cs{multirow}} +% \gindex{multirow=\cs{multirow}>with \cs{multicolumn}} +% \gindex{tabular>multicolumn=\cs{multicolumn} with \cs{multirow}} +% \trouble{tabular>multicolumn=\cs{multicolumn} with \cs{multirow}} +% \limitsmultirow +% +% \subsubsection{\pkg{longtable} package} +% +% \DescribePackage{longtable} +% \trouble{longtable=\pkg{longtable}>endhead=\cs{endhead}, etc.} +% \trouble{endhead=\cs{endhead}, etc.} +% \limitslongtable +% +% +% \subsubsection{\pkg{threeparttablex} package} +% \label{sec:limitsthreeparttablex} +% \DescribePackage{threeparttablex} +% \trouble{threeparttablex=\pkg{threeparttablex}} +% \limitsthreeparttablex +% +% +% \subsubsection{\pkg{supertabular} and \pkg{xtab} packages} +% +% \DescribePackage{supertabular} +% \DescribePackage{xtab} +% \limitssupertabular +% +% \subsubsection{\pkg{colortbl} package} +% +% \DescribePackage{colortbl} +% \limitscolortbl +% +% \subsubsection{\pkg{ctable} package} +% \trouble{ctable=\pkg{ctable}} +% \gindex{ctable=\pkg{ctable}} +% \limitsctable +% +% \subsubsection{\pkg{bigdelim} package} +% +% \DescribePackage{bigdelim} +% \limitsbigdelim +% +% +% \subsection{Floats} +% +% \subsubsection{Float contents alignment} +% +% \limitsfloatalignment +% +% +% \subsubsection{\pkg{float}, \pkg{trivfloat}, and/or \pkg{algorithmicx} together} +% +% \DescribePackage{float} +% \DescribePackage{trivfloat} +% \DescribePackage{algorithmicx} +% \limitscombiningfloats +% +% +% \subsubsection{\pkg{caption} and \pkg{subcaption} packages} +% +% \DescribePackage{caption} +% \DescribePackage{subcaption} +% \limitscaption +% +% +% +% +% \subsubsection{\pkg{subfig} package} +% +% \DescribePackage{subfig} +% \limitssubfig +% +% +% \subsubsection{\pkg{floatrow} package} +% +% \DescribePackage{floatrow} +% \limitsfloatrow +% +% +% \subsubsection{\pkg{keyfloat} package} +% +% \DescribePackage{keyfloat} +% \limitskeyfloat +% +% +% \subsection{\brand{Koma-Script} classes} +% +% \DescribeClass{komascript} +% \limitskomascript +% +% +% \subsection{\brand{Memoir} class} +% \label{sec:limitsmemoir} +% +% \changes{v0.66}{2019/02/06}{\pkg{memoir}: Docs re: version numbers.} +% +% \DescribeClass{memoir} +% \limitsmemoir +% +% +% \subsection{International languages} +% \label{sec:international} +% +% If using \prog{pdflatex} with the setting |\booltrue{FileSectionNames}|, +% \trouble[section and file names]{sectioning>international language} +% \trouble{filename>corrupted} +% \trouble{filename>international, \UTF-8} +% \gindex{international>section names} +% \gindex{foreign>section names} +% \gindex{section>international languages} +% \gindex{filename>international languages} +% non-\acro{ASCII} text in section names can result in corrupted \HTML\ file names. +% \prog{pdflatex} may be used if setting |\boolfalse{FileSectionNames}|, in which case +% \HTML\ file numbers will be generated. +% +% For correct \HTML\ file names, use \prog{xelatex}, \prog{lualatex}, +% or dedicated document classes \Slash engines. +% +% (As of this writing, this warning is only relevent to the \pkg{kotex} package.) +% +% +% \subsection{Miscellaneous packages} +% +% \subsubsection{\pkg{verse} and \pkg{memoir}} +% +% \DescribePackage{verse} +% \DescribeClass{memoir} +% \limitsverse +% +% +% \subsubsection{\pkg{newclude} package} +% +% \changes{v0.14}{2016/03/29}{Docs: Newclude limitations.} +% +% \DescribePackage{newclude} +% \limitsnewclude +% +% +% +% \subsubsection{\pkg{babel} package} +% +% \DescribePackage{babel} +% ^^A \limitsbabelone +% \limitsbabeltwo +% +% +% \subsubsection{\pkg{polyglossia} package} +% \label{sec:limitspolyglossia} +% +% \DescribePackage{polyglossia} +% \limitspolyglossia +% +% +% \subsubsection{\pkg{todonotes} and \pkg{luatodonotes} packages} +% +% \DescribePackage{todonotes} +% \DescribePackage{luatodonotes} +% \limitstodonotes +% +% +% \subsubsection{\pkg{fixme}} +% +% \DescribePackage{fixme} +% \limitsfixme +% +% +% \subsubsection{\pkg{chemfig} package} +% +% \limitschemfig +% \trouble{chemfig=\pkg{chemfig}} +% +% +% \subsubsection{\pkg{chemformula} package} +% \limitschemformula +% \trouble{array>chemformula=\pkg{chemformula}} +% \trouble{math>chemformula=\pkg{chemformula}} +% +% +% \subsubsection{\pkg{mhchem} package} +% +% See \cref{sec:mhchem}. +% +% +% \subsubsection{\pkg{xparse} package} +% +% \changes{v0.45}{2017/12/09}{Docs: \pkg{xparse} warnings.} +% \DescribePackage{xparse} +% \limitsxparse +% \gindex{xparse=\pkg{xparse}>warnings} +% +% +% \subsubsection{\pkg{kotex} package} +% +% \DescribePackage{kotex} +% See \cref{sec:international} regarding \prog{pdflatex} and +% Korean section names. +% \trouble[Korean section names]{filename>Korean} +% +% +% \clearpage +% +% \section{Compiling using custom shell commands} +% \label{sec:customcompiling} +% \gindex{compiling>custom} +% +% \changes{v0.61}{2018/09/21}{Docs: Compiling using custom shell commands.} +% +% \pkg{lwarp} and \prog{lwarpmk} try to make it easy to process +% print and \HTML\ compilation tasks in most situations. +% Depending on the operating system, command-line options, \TeX\ engine, +% and \pkg{lwarp} options, the commands \cmds{lwarpmk print} and +% \cmds{lwarpmk html} are automatically set up to correctly recompile the project. +% These actions may be overridden using \pkg{lwarp} options, thus allowing the use +% of packages such as \pkg{perltex} and \pkg{pythontex}. +% +% \subsection{Command options} +% +% \DescribeOption{PrintLatexCmd} +% \DescribeOption{HTMLLatexCmd} +% The \pkg{lwarp} options \optn{PrintLatexCmd} and \optn{HTMLLatexCmd} +% are used to set customized commands to be executed by +% \cmds{lwarpmk print} and \cmds{lwarpmk html}. +% \begin{description} +% \item [\optn{PrintLatexCmd}] should be set to shell commands which take \filenm{project.tex} +% and generate \filenm{project.pdf}. +% \item[\optn{HTMLLatexCmd}] should be set to take \filenm{project_html.tex} and +% generate \filenm{project_html.pdf}. +% \prog{lwarpmk} will then take \filenm{project_html.pdf} and +% automatically convert it and generate \filenm{project.html}. +% \end{description} +% +% \subsection{Literal character macros} +% The \pkg{lwarp} package options are parsed by \TeX, and so some characters +% require the use of a special macro to represent them. See \cref{tab:literalchars}. +% \cs{LWRopquote} and \cs{LWRopseq} may be used to increase operating-system portability. +% \cs{jobname} must have |_html| appended for processing \HTML. +% \cs{space} may be necessary between other macros. +% +% To use these macros, either \pkg{kvoptions-patch} must be loaded before \pkg{lwarp}: +% \trouble[macro not found]{LWRopseq=\cs{LWRopseq}} +% \trouble{LWRpercent=\cs{LWRpercent}} +% \trouble{LWRdollar=\cs{LWRdollar}} +% \trouble{LWRhash=\cs{LWRhash}} +% \trouble{LWRbackslash=\cs{LWRbackslash}} +% \trouble{LWRopquote=\cs{LWRopquote}} +% \begin{Verbatim}[gobble=2,obeytabs,tabsize=4,frame=lines] +% \usepackage{kvoptions-patch} +% \usepackage[ +% PrintLatexCmd={ ... } , +% HTMLLatexCmd={ ... } +% ]{lwarp} +% \end{Verbatim} +% \needspace{18\baselineskip} +% or \cs{lwarpsetup} must be used to set \optn{PrintLatexCmd} and \optn{HTMLLatexCmd}: +% \begin{Verbatim}[gobble=2,obeytabs,tabsize=4,frame=lines] +% \usepackage[...]{lwarp} +% \lwarpsetup{ +% PrintLatexCmd= +% { +% latex tm \LWRopseq +% dvips -o tm-pics.ps tm.dvi \LWRopseq +% ps2pdf tm-pics.ps \LWRopseq +% pdflatex tm.tex +% } , +% HTMLLatexCmd= +% { +% latex tm_html \LWRopseq +% dvips -o tm_html-pics.ps tm_html.dvi \LWRopseq +% ps2pdf tm_html-pics.ps \LWRopseq +% pdflatex tm_html.tex +% } +% } +% \end{Verbatim} +% +% \begin{table} +% \centering +% \caption{Literal character macros} +% \label{tab:literalchars} +% \begin{tabular}{cll} +% Character & Macro & Comment \\ +% |%| & \cs{LWRpercent} & \\ +% |$| & \cs{LWRdollar} & \\ +% |&| & \cs{LWRamp} & \\ +% |%| & \cs{LWRhash} & \\ +% |\| & \cs{LWRbackslash} & \\ +% \texttt{\textquotesingle} or |"| & \cs{LWRopquote} & Depends on the operating system. \\ +% |&| or |&&| & \cs{LWRopseq} & Depends on the operating system. \\ +% (space) & \cs{space} & Forces an extra space. \\ +% (jobname) & \cs{jobname} & Without file extension. \\ +% \end{tabular} +% \hrule +% \end{table} +% +% +% \needspace{6\baselineskip} +% +% \subsection{\prog{latexmk}} +% +% \DescribeProgram{latexmk} +% If \prog{latexmk} is used for a project, it may be easiest to continue +% using it. +% \begin{description} +% \item[\cmds{latexmk project.tex}] would create \filenm{project.pdf} as normal. +% \item[\cmds{latexmk project\_html.tex}] would create \filenm{project_html.pdf}, +% then +% \item [\cmds{lwarpmk pdftohtml project\_html.pdf}] would take +% \filenm{project_html.pdf} and convert it to \filenm{project.html}. +% \end{description} +% +% \prog{latexmk} may simplify the use of packages such as \pkg{sagetex}. +% \DescribePackage{sagetex} +% +% +% \subsection{\pkg{perltex} package} +% +% The \pkg{lwarp} package option settings to use \pkg{perltex} would be similar to: +% \DescribePackage{perltex} +% \begin{sourcedisplay} +% \cs{usepackage}[ \\ +% \fquad \dots \\ +% \fquad PrintLatexCmd=\{perltex -latex=pdflatex project.tex\} , \\ +% \fquad HTMLLatexCmd=\{perltex -latex=pdflatex project\textgreen{\_html}.tex\} , \\ +% \fquad \dots \\ +% ]\{lwarp\} +% \end{sourcedisplay} +% +% Place \pkg{perltex} math expressions between +% \trouble[``impure'' math]{perltex=\pkg{perltex}} +% \cs{displaymathother} and \cs{displaymathnormal}, or +% \cs{inlinemathother} and \cs{inlinemathnormal}. +% See \cref{sec:displaymathother}. +% +% +% \subsection{\pkg{pythontex} package} +% +% \DescribePackage{pythontex} +% An example using \pkg{pythontex}: +% \begin{sourcedisplay} +% \cs{usepackage}[ \\ +% \fquad \dots \\ +% \fquad PrintLatexCmd=\{ \\ +% \fqquad pdflatex project.tex \cs{LWRopseq} \\ +% \fqquad pythontex project \cs{LWRopseq} \\ +% \fqquad pdflatex project.tex \\ +% \fquad \} , \\ +% \fquad HTMLLatexCmd=\{ \\ +% \fqquad pdflatex project\textgreen{\_html}.tex \cs{LWRopseq} \\ +% \fqquad pythontex project\textgreen{\_html} \cs{LWRopseq} \\ +% \fqquad pdflatex project\textgreen{\_html}.tex \\ +% \fquad \} , \\ +% \fquad \dots \\ +% ]\{lwarp\} +% \end{sourcedisplay} +% +% Another possibility is to use \prog{latexmk}, placing the +% \cmds{latexmk \dots} commands in the \optn{PrintLatexCmd} and \optn{HTMLLatexCmd} +% options. +% While using these options, the \pkg{lwarp} option \optn{latexmk} would not be used. +% +% No attempt has yet been made to make \pkg{pythontex} robust with \HTML\ output. +% Some math objects must be surrounded by +% \trouble[``impure'' math]{pythontex=\pkg{pythontex}} +% \cs{displaymathother} \dots \cs{displaymathnormal}, +% or \cs{inlinemathother} \dots \cs{inlinemathnormal}. +% Displays of code may have to be +% enclosed inside a \env{lateximage} environment +% \watchout[HTML look-alike] +% to prevent |<|, |>| and similar from being interpreted by the browser +% as \HTML\ entities. +% +% +% \subsection{Other packages} +% +% \DescribePackage{sympytex} +% \DescribePackage{rterface} +% Other packages such as \pkg{sympytex} and \pkg{rterface} would be set up +% similar to \pkg{pythontex}, and the same warnings would apply. +% \trouble{sympytex=\pkg{sympytex}} +% \trouble{rterface=\pkg{rterface}} +% +% +% \subsection{\prog{make} program} +% \gindex{make utility} +% +% \DescribeProgram{make} +% To use \pkg{lwarp} with the \prog{make} program, +% have the \filenm{makefile} take \filenm{project.tex} and +% generate the print version \filenm{project.pdf}, as normal. +% |\usepackage{lwarp}| must be used, and it generates \filenm{lwarpmk.conf} +% when the print version is created. +% +% To generate \HTML, first have \filenm{project_html.tex} be compiled to +% generate \filenm{project_html.pdf}. +% This must be in \PDF\ format. +% Finally, have \filenm{project_html.pdf} be converted to \HTML\ using +% \cmds{lwarpmk pdftohtml project\_html.pdf}, +% and convert \SVG\ math with \cmds{lwarpmk limages}. +% +% +% \subsection{\UTF-8 locale} +% \label{sec:utf8locale} +% \gindex{locale} +% \gindex{UTF-8>locale} +% +% \changes{v0.62}{2018/10/20}{Docs: UTF-8 locale.} +% +% \prog{lwarpmk} uses the \prog{texlua} program, which sets the ``locale'' to ``|C|'', +% \trouble[UTF-8 locale]{UTF-8>locale} +% \trouble{Unicode>UTF-8 locale} +% \trouble{locale} +% including for external operating-system calls such as when executing \cmds{lwarpmk html}. +% In some cases, an external program called from the user's document +% may require the use of a \UTF-8 ``locale''. +% For \brand{Unix}-related operating systems, it may be required to use \pkg{lwarp}'s +% custom compilation options to add a locale change: +% \begin{sourcedisplay} +% \cs{usepackage}\{lwarp\}[\\ +% \fquad PrintLatexCmd=\{\\ +% \fqquad \textred{env LC\_CTYPE=en\_US.UTF-8} \\ +% \fqqquad xelatex --shell-escape project.tex \\ +% \fquad \} \\ +% \fquad HTMLLatexCmd=\{\\ +% \fqquad \textred{env LC\_CTYPE=en\_US.UTF-8} \\ +% \fqqquad xelatex --shell-escape project\textgreen{\_html}.tex \\ +% \fquad \} \\ +% ] \\ +% \end{sourcedisplay} +% +% \DescribePackage{ditaa} +% The only example seen so far where this is required is the \pkg{ditaa} package, +% \trouble{ditaa=\pkg{ditaa}} +% where the locale change allows the use of UTF-8 with Xe\LaTeX\ and \pkg{ditaa}. +% To use Lua\LaTeX\ instead, the locale change would have to be made inside the +% \pkg{ditaa} package where its calls the \prog{ditaa} program. +% +% +% \clearpage +% +% \section{EPUB conversion} +% \label{sec:epub} +% +% \pkg{lwarp} does not produce \EPUB\ documents, +% but it may be told to modify its \HTML\ output +% to greatly assist in the conversion. +% An external program may then be used to finish the conversion +% to \EPUB. +% +% To assign the author's name for regular \pkg{lwarp} \HTML\ +% \margintag{\element{meta} author} +% files, and also for the \EPUB, +% use \cs{HTMLAuthor} \marg{name}. This assigns the name to the +% \element{meta} author element. It may be set empty, and it defaults to +% \cs{theauthor}. +% +% A special boolean is provided to simplify the process of +% converting \pkg{lwarp} \HTML\ output to \EPUB: +% +% \begin{docsidebar}[\bool{FormatEPUB}] +% \DescribeBoolean{FormatEPUB} \DescribeDefault{false} +% \raggedright +% |FormatEPUB| changes \HTML\ output for easy \EPUB\ conversion +% via an external program. Removes per-file headers, footers, and nav. +% Adds footnotes per chapter/section. +% \end{docsidebar} +% \gindex{EPUB>HTML conversion settings} +% \gindex{HTML>conversion settings>EPUB} +% +% To help convert \pkg{lwarp} \HTML\ output to \EPUB, add +% \begin{sourcedisplay} +% |\booltrue{FormatEPUB}| +% \end{sourcedisplay} +% to the project's source preamble after |\usepackage{lwarp}|. +% The \EPUB\ version of the document cannot co-exist with the +% regular \HTML\ version, so +% \userentry{lwarpmk cleanall} +% \userentry{lwarpmk html} +% \userentry{lwarpmk limages} +% to recompile with the |FormatEPUB| boolean turned on. +% Several changes are then made to the \HTML\ output: +% \begin{itemize} +% \item Headers, footers, and navigation are removed at file splits. +% \item Any accumulated footnotes are printed at the bottom of each section. +% \end{itemize} +% +% The resulting files will be ready to be loaded into an \EPUB\ conversion +% program, such as the open-source program \prog{Calibre} (\url{https://calibre-ebook.com/}). +% \gindex{Calibre=\prog{Calibre}} +% \gindex{EPUB>conversion software}\margintag{\prog{Calibre}} +% +% The \EPUB\ conversion program must know what order the files are included. +% For \pkg{lwarp} projects, set the \EPUB\ conversion software to +% \trouble[search order]{EPUB>search order} +% \trouble{EPUB>page order} +% \trouble{Calibre=\prog{Calibre}>EPUB conversion} +% do a breadth-first search of the files. +% For \prog{Calibre}, this option is found in +% \begin{UIdisplay} +% Preferences $\to$ Plugins $\to$ File type plugins $\to$ \HTML\ to Zip +% \end{UIdisplay} +% Check the box \textsf{Add linked files in breadth first order.} +% Set the document encoding as |utf-8|\trouble[encoding]{EPUB>encoding}, +% which is what \pkg{lwarp} generates for \HTML, +% even if the original printed document uses some other encoding. +% +% The \EPUB-conversion program must also know where the section breaks are located. +% \trouble[section breaks]{EPUB>section breaks} +% For a list of \pkg{lwarp}'s section headings, +% see \cref{tab:depthsheadings}. +% For example, an |article| +% class document would break at \cs{section}, which is mapped to \HTML\ +% heading level \element{h4}, whereas a |book| class document would break at \cs{chapter}, +% which is \HTML\ heading level \element{h3}. +% For \prog{Calibre}, this option is found in +% \begin{UIdisplay} +% Preferences $\to$ Conversion (Common Options) $\to$ +% Structure Detection $\to$ Detect chapters at (XPath expression) +% \end{UIdisplay} +% Select the ``magic wand'' to the right of this entry box, and set +% the first entry +% \begin{UIdisplay} +% Match \HTML\ tags with tag name: +% \end{UIdisplay} +% to ``h4''. (Or ``h3'' for document classes with \cs{chapter}s.) +% The \textsf{Detect chapters at} field should then show +% \begin{UIdisplay} +% //h:h4 \qquad \textmd{\textrm{---\,or\,---}} \qquad //h:h3 +% \end{UIdisplay} +% +% This option is also available on the main tool bar at the \textsf{Convert books} +% button. +% +% Once these settings have been made, the \pkg{lwarp}-generated \HTML\ files +% may be loaded by \prog{Calibre}, and then converted to an \EPUB. +% +% \begin{docsidebar}[\brand{MathJax} support] +% \brand{MathJax} may be used in \EPUB\ documents. +% Some e-readers include \brand{MathJax}, but any given reader +% may or may not have a recent version, and may or may not include +% extensions such as support for \pkg{siunitx}. +% +% \pkg{lwarp} adds some modifications to \MathML\ to support equations numbered +% by chapter. These modifications may not be compatible with the e-reader's +% version of \brand{MathJax}, so \pkg{lwarp} requests that a known version be loaded +% instead. In some cases chapter numbering of equations still doesn't work. +% +% Until math support in \EPUB\ documents is improved, it is recommended to use +% \SVG\ images instead of \brand{MathJax}, especially for equations numbered by chapter, +% or where \pkg{siunitx} support is important. +% \end{docsidebar} +% +% +% +% +% \clearpage +% +% \section{Word-processor conversion} +% \label{sec:wordprocessorconversion} +% \gindex{word processor>HTML conversion settings} +% \gindex{HTML>conversion settings>word processor} +% \gindex{LibreOffice=\brand{LibreOffice}>import into} +% \gindex{export>to word processor} +% \trouble{word processor>import} +% \trouble{LibreOffice=\prog{LibreOffice}>import} +% +% \pkg{lwarp} may be told to modify its \HTML\ output to make it +% easier to import the \HTML\ document into a word processor. +% At the time of this writing, it seems that \brand{LibreOffice} works best at +% preserving table layout, but it still has some limitations, such as +% an inability to automatically assign figure and table +% frames and captions according to user-selected \HTML\ classes. +% \pkg{lwarp} provides some assistance in locating these frame boundaries, +% as shown below. +% +% +% \subsection{Activating word-processor conversion} +% +% A special boolean is provided to simplify the process of +% converting \pkg{lwarp} \HTML\ output to \EPUB: +% \begin{docsidebar}[\bool{FormatWP}] +% \DescribeBoolean{FormatWP} \DescribeDefault{false} +% \raggedright +% Changes \HTML\ output for easier conversion +% by a word processor. +% Removes headers and nav, prints footnotes per section, +% and also forces single-file output and turns off \HTML\ debug +% comments. +% Additionally, honors the booleans |WPMarkFloats|, |WPMarkMinipages|, +% |WPMarkTOC|, and |WPMarkLOFT|. +% \end{docsidebar} +% +% To help modify \pkg{lwarp} \HTML\ output for easier +% import to a word processor, add +% \begin{sourcedisplay} +% |\booltrue{FormatWP}| +% \end{sourcedisplay} +% to the project's source preamble after \pkg{lwarp} is loaded. +% The following changes are then made to the \HTML\ output: +% \margintag{formatting adjustments} +% \begin{itemize} +% \item If using a class without chapters, \cs{section} and lower are +% shifted up in level for the \HTML\ heading tags. The \CSS\ has +% not been changed, so the section heading formats will not match the normal +% \HTML\ output, but when imported to \prog{LibreOffice Writer} the higher +% section headings will import as \UI{Heading~1} for the title, \UI{Heading~2} +% for \cs{section}, etc. +% \item Headers, footers, and navigation are removed at file splits. +% \item Any accumulated footnotes are printed at the bottom of each section. +% \item Forces single-file output. +% \item Turns off \HTML\ debugging comments. +% These are comments appearing inside the \HTML\ code, +% marking the opening/closing of sections and \element{div}s, +% but they are no longer useful when the document has been +% imported into a word processor. +% \item An additional \element{div} with an \attribute{id} encapsulates +% each float and minipage, which on import into \prog{LibreOffice Writer} +% causes a thin frame to appear around the text block for each. +% \item Float captions are given an explicit italic formatting. +% \item Tabular rule borders are made explicit for \prog{LibreOffice Writer}. +% \brand{LibreOffice} displays a light border around each cell while editing, +% even those which have no border when printed, +% and \pkg{lwarp} also uses a light border for thin rules, +% so it will be best to judge the results using +% the print preview instead of while editing in \brand{LibreOffice}. +% \item \cs{includegraphics} and \SVG\ math width and height +% are made explicit for \brand{LibreOffice}. +% \item \cs{hspace} is approximated by a number of \cs{quad}s, +% and rules are approximated by a number of underscores. +% \item Explicit \HTML\ styles are given to: +% \begin{itemize} +% \item \cs{textsc}, etc. +% \item \cs{underline}, \pkg{soul} and \pkg{ulem} markup. +% \item \env{center}, \env{flushleft}, \env{flushright}. +% \item \cs{marginpar}, \pkg{keyfloat}, \pkg{sidenotes}, \pkg{floatflt}, +% and \pkg{wrapfig}. +% \item \pkg{fancybox} \cs{shadowbox}, etc. +% \item The \LaTeX\ and \TeX\ logos. +% \end{itemize} +% \item Honors several booleans: +% \begin{description} +% \item[\texttt{WPMarkFloats}:] Marks the begin and end of floats. +% \item[\texttt{WPMarkMinipages}:] Marks the begin and end of minipages. +% \item[\texttt{WPMarkTOC}:] Marks the location of the Table of Contents. +% \item[\texttt{WPMarkLOFT}:] Marks the locations of the List of Figures/Tables. +% \item[\texttt{WPMarkMath}:] Prints \LaTeX\ math instead of using images. +% \item[\texttt{WPTitleHeading}:] Adjusts title and section headings. +% \end{description} +% Several of these may be used to add markers to the \HTML\ text +% which help determine where to adjust the word processor document after +% import. + +% \end{itemize} +% +% +% \subsection{Additional modifications} +% +% \newcommand{\describeWPMarkFloats}{ +% Adds +% \begin{sourcedisplay} +% === begin table === \\ +% \dots \\ +% === end === +% \end{sourcedisplay} +% or +% \begin{sourcedisplay} +% === begin figure === \\ +% \dots \\ +% === end === +% \end{sourcedisplay} +% around floats while formatting for word processors. +% This helps identify boundaries of floats to be manually converted +% to word-processor frames and captions. +% } +% +% \begin{docsidebar}[\bool{WPMarkFloats}] +% \DescribeBoolean{WPMarkFloats} \DescribeDefault{false} +% \raggedright +% \describeWPMarkFloats +% \end{docsidebar} +% +% +% \newcommand{\describeWPMarkMinipages}{ +% Adds +% \begin{sourcedisplay} +% === begin minipage === \\ +% \dots \\ +% === end minipage === +% \end{sourcedisplay} +% around minipages while formatting for word processors. +% This helps identify boundaries of minipages to be manually converted +% to word-processor frames. +% } +% +% \begin{docsidebar}[\bool{WPMarkMinipages}] +% \DescribeBoolean{WPMarkMinipages} \DescribeDefault{false} +% \raggedright +% \describeWPMarkMinipages +% \end{docsidebar} +% +% +% \newcommand{\describeWPMarkTOC}{ +% While formatting for word processors, adds +% \begin{sourcedisplay} +% === table of contents === \\ +% \end{sourcedisplay} +% where the Table of Contents would have been. +% This helps identify where to insert the actual \TOC. +% +% \emph{If set |false|, the actual \TOC\ is printed instead.} +% } +% +% \begin{docsidebar}[\bool{WPMarkTOC}] +% \DescribeBoolean{WPMarkTOC} \DescribeDefault{true} +% \raggedright +% \describeWPMarkTOC +% \end{docsidebar} +% +% +% \newcommand{\describeWPMarkLOFT}{ +% While formatting for word processors, adds +% \begin{sourcedisplay} +% === list of figures === \quad \textrm{\textit{and\,/\,or}} \\ +% === list of tables === \\ +% \end{sourcedisplay} +% where each of these lists would have been. +% This helps identify where to insert the actual lists. +% +% \emph{If set |false|, the actual lists are printed instead.} +% } +% +% \begin{docsidebar}[\bool{WPMarkLOFT}] +% \DescribeBoolean{WPMarkLOFT} \DescribeDefault{false} +% \raggedright +% \describeWPMarkLOFT +% \end{docsidebar} +% +% +% \newcommand{\describeWPMarkMath}{ +% While formatting for word processors, +% prints math as \LaTeX\ code instead of creating \SVG\ images or \brand{MathJax}. +% This is useful for cut/paste into the \prog{LibreOffice Writer TeXMaths} extension. +% } +% +% \begin{docsidebar}[\bool{WPMarkMath}] +% \trouble{TeXMaths} +% \trouble{siunitx>with TeXMaths} +% \margintag{siunitx} +% \DescribeBoolean{WPMarkMath} \DescribeDefault{false} +% \DescribeProgram{TeXMaths} +% \raggedright +% \describeWPMarkMath +% +% When using the \pkg{siunitx} package, enter +% \begin{sourcedisplay} +% \cs{usepackage}\{siunitx\} +% \end{sourcedisplay} +% in the \prog{TeXMaths} preamble. +% Equation numbering is problematic for \AmS\ math environments. +% \end{docsidebar} +% \gindex{siunitx>with \prog{TeXMaths}} +% \gindex{math>word processor conversion} +% +% +% \newcommand*{\describeWPTitleHeading}{ +% While formatting for word processors, +% |true| sets the document title to \element{h1}, which is expected for \HTML\ documents, +% but also causes the lower-level section headings to start at \UI{Heading 2} when +% imported into \brand{LibreOffice}. +% Set to |false| to cause the title to be plain text, and the section headings +% to begin at \UI{Heading 1}. +% +% See \cref{tab:WPsectionheadings} on \cpageref{tab:WPsectionheadings}. +% } +% +% \begin{docsidebar}[\bool{WPTitleHeading}] +% \DescribeBoolean{WPTitleHeading} \DescribeDefault{false} +% \margintag{section headings} +% \raggedright +% \describeWPTitleHeading +% \end{docsidebar} +% \gindex{section>heading, word processor} +% \gindex{heading, word processor} +% \gindex{word processor>section headings} +% \gindex{LibreOffice=\brand{LibreOffice}>section headings} +% \trouble{sectioning>word processor import} +% \trouble{word processor>sectioning headings} +% +% \begin{table} +% \centering +% \begin{threeparttable} +% \caption{Section \HTML\ headings for word-processor conversion} +% \label{tab:WPsectionheadings} +% \begin{tabular}{lcccc} +% \toprule +% ~ & \multicolumn{4}{c}{\HTML\ headings\tnote{\textasteriskcentered}} \\ +% \cmidrule{2-5} +% ~ & \multicolumn{2}{c}{With \cs{chapter}} & \multicolumn{2}{c}{Without \cs{chapter}} \\ +% \cmidrule(r){2-3} \cmidrule(l){4-5} +% ~ & \multicolumn{2}{c}{|WPTitleHeading|} & \multicolumn{2}{c}{|WPTitleHeading|} \\ +% Section & |true| & |false| & |true| & |false| \\ +% \midrule +% Title & \element{h1} & plain & \element{h1} & plain \\ +% \cs{book} & \element{div} & \element{div} & \element{div} & \element{div} \\ +% \cs{part} & \element{h2} & \element{h1} & \element{h2} & \element{h1} \\ +% \cs{chapter} & \element{h3} & \element{h2} & --- & --- \\ +% \cs{section} & \element{h4} & \element{h3} & \element{h3} & \element{h2} \\ +% \cs{subsection} & \element{h5} & \element{h4} & \element{h4} & \element{h3} \\ +% \cs{paragraph} & \element{h6} & \element{h5} & \element{h5} & \element{h4} \\ +% \cs{subparagraph} & \element{span} & \element{h6} & \element{h6} & \element{h5} \\ +% \bottomrule +% \end{tabular} +% \begin{tablenotes} +% \footnotesize +% \item[\textasteriskcentered] For default depths when not |FormatWP|, +% see \cref{tab:depthsheadings} on \cpageref{tab:depthsheadings}. +% \end{tablenotes} +% \end{threeparttable} +% \smallskip\hrule +% \end{table} +% +% \subsection{Recommendations} +% \gindex{word processor>conversion recommendations} +% \gindex{LibreOffice=\brand{LibreOffice}>conversion recommendations} +% +% For use with \prog{LibreOffice Writer}, it is recommended to: +% \margintag{TOC, LOF, LOT} +% \begin{enumerate}[nosep] +% \item Set |\booltrue{FormatWP}| +% \item Set |\booltrue{WPMarkTOC}| and |\boolfalse{WPMarkLOFT}| +% \item Use \pkg{lwarp} to generate the \HTML\ document. +% \item Copy/paste from the \HTML\ document into an empty \prog{LibreOffice Writer} document. +% \item Manually insert a \brand{LibreOffice} \TOC\ in the \brand{LibreOffice} document. +% \item Manually add frames around each float, adding a caption which is cut/pasted from +% each float's simulated caption. +% \item Manually create cross references. +% \end{enumerate} +% This process yields a document with an actual \brand{LibreOffice} Table of Contents, +% but a simulated List of Figures and List of Tables. +% +% For \pkg{siunitx}, remember to adjust the preamble as mentioned above. +% \margintag{siunitx} +% +% \brand{LibreOffice} has options in the \UI{View} menu to turn on/off the display of +% \margintag{LO view border options} +% thin borders around table cells and text objects. +% +% +% \subsection{Limitations} +% +% Floats and captions are not explicitly converted to \brand{LibreOffice} floats with their +% own captions. Floats are surrounded by a thin frame in the \brand{LibreOffice} editor, +% and may be marked with |WPMarkFloats|, but are not given a proper \brand{LibreOffice} +% object frame. +% Captions are given an explicit italic formatting, +% but not a proper \brand{LibreOffice} paragraph style. +% +% Cross references are not actual \brand{LibreOffice} linked cross references. +% +% The List of Figures and List of Tables are not linked. +% The pasted pseudo \LOF\ and \LOT\ match the numbering +% of the \LaTeX\ and \HTML\ versions. +% +% Equation numbering is not automatic, but the equation numbers in \SVG\ math +% will match the \LaTeX\ and \HTML\ output. +% SVG math is recommended when using the \AmS\ environments, which may have +% multiple numbered equations per object. +% +% As of when last checked, \brand{LibreOffice} ignores the following: +% \begin{itemize} +% \item Minipage alignment. +% \item Tabular cell vertical alignment. +% \item Image rotation and scaling. +% \item Rounded border corners, which are also used by: +% \begin{itemize} +% \item \cs{textcircled} +% \item \pkg{booktabs} trim +% \end{itemize} +% \item \cs{hspace} and rules, also used by \pkg{algorithmic}. +% \item Coloring of text decorations, used by \pkg{soul} and \pkg{ulem}. +% \item Overline text decoration, used by \pkg{romanbar}. +% \end{itemize} +% +% \brand{LibreOffice} also has limitations with frames and backgrounds: +% \begin{itemize} +% \item Multiple lines in an object are framed individually instead of as a whole. +% \item Nested frames are not handled correctly. +% \item Images inside boxes are not framed correctly. +% \item Spans with background colors and frames are not displayed correctly. +% \end{itemize} +% +% +% +% +% +% +% \clearpage +% +% \section{Modifying \pkg{lwarp}} +% \pagestyle{pageheadfoot} +% +% To quickly find the source for a package in |lwarp.dtx|, +% \margintag{locating something} +% search for |*packagename|, +% such as |*siunitx|. +% +% Likewise, to quickly find the source for a file in |lwarp.dtx|, +% search for |*filename|, such as |*lwarp.css|. +% +% Purely text-based packages probably will work as-is when generating +% \HTML. +% +% Look to existing code for ideas on how to expand into new code. +% +% An environment may be converted to a |lateximage| then displayed +% \margintag{image of \TeX\ output} +% with an image of the resulting \LaTeX{} output. +% See \cref{sec:picture} for an example of the |picture| environment. +% +% To create a custom \HTML\ block or inline \CSS\ class, +% \margintag{\CSS\ classes} +% see \cref{sec:highlevelclasses}. +% +% To create print and \HTML\ versions of the same macro or environment, +% \margintag{print/HTML macros} +% see \cref{sec:definingprinthtml}. +% +% Any \TeX\ boxes must be undone, as \SVG\ math or \env{lateximage}s +% \watchout[\TeX\ boxes] +% require \cs{newpage}, which will not work in a \TeX\ box. +% +% \changes{v0.57}{2018/05/28}{Docs: Recreating the index for \pkg{lwarp} source.} +% To recreate the index for the \pkg{lwarp} documentation: +% \margintag{index recreation} +% \begin{Verbatim}[gobble=2,obeytabs,tabsize=4,frame=lines] +% makeindex -s gglo.ist -o lwarp.gls lwarp.glo +% splitindex lwarp.idx -- -s gind.ist +% \end{Verbatim} +% +% +% \subsection{Creating a development system} +% +% The following creates a local development system for \pkg{lwarp} on a TeXLive system +% in a \brand{Unix}-like environment. +% Doing so allows anything requesting \pkg{lwarp} to use the development version +% instead of whichever version is installed in TeXLive. +% +% \begin{description} +% \item [Create a development directory:] \ +% +% Place into this directory \filenm{lwarp.dtx} and \filenm{lwarp.ins}. +% +% To create \filenm{lwarp.sty}, +% execute \userentry{pdflatex lwarp.ins} which creates \filenm{lwarp.sty} and several +% hundred additional \filenm{lwarp-*.sty} files for the various packages which are +% supported. +% +% To create the documentation \filenm{lwarp.pdf}, +% execute \userentry{pdflatex lwarp.dtx} +% +% \item[To make the development files visible to other projects:] \ +% +% Create the directory +% \begin{quote} +% \filenm{/usr/local/texlive/texmf-local/tex/latex/local/lwarp} +% \end{quote} +% +% Inside this directory, create the file \filenm{update}, containing: +% \begin{Verbatim}[gobble=2,obeytabs,tabsize=4,frame=lines] +% ln -s /path_to_dev_directory/lwarp*.sty . +% ln -s /path_to_dev_directory/lwarp_baseline_marker.png . +% ln -s /path_to_dev_directory/lwarp_baseline_marker.eps . +% mktexlsr +% \end{Verbatim} +% Run ./update now, and whenever a new lwarp-* package is added. + +% \item[To make the development version of \prog{lwarpmk} visible to other projects:] \ +% +% \begin{Verbatim}[gobble=2,obeytabs,tabsize=4,frame=lines] +% cd /opt +% ln -s /usr/local/texlive/texmf-local/bin/x86_64-linux texbin_local +% cd texbin_local +% ln -s ../../scripts/lwarp/lwarpmk.lua lwarpmk +% cd /usr/local/texlive/texmf-local/scripts/ +% mkdir lwarp +% cd lwarp +% ln -s /path_to_dev_directory/lwarpmk.lua lwarpmk +% \end{Verbatim} +% Verify that the correct version is found with \userentry{which lwarpmk} +% +% \item [To make the local versions visible to the shell:] \ +% +% Paths must be set by the shell startup, such as in \filenm{.bashrc} and \filenm{.cshrc}: +% +% In \filenm{.bashrc}: +% \begin{Verbatim}[gobble=2,obeytabs,tabsize=4,frame=lines] +% PATH=/opt/texbin_local:/opt/texbin:$PATH +% \end{Verbatim} +% +% In \filenm{.cshrc}: +% \begin{Verbatim}[gobble=2,obeytabs,tabsize=4,frame=lines] +% setenv PATH ${HOME}/bin:/opt/texbin_local:/opt/texbin:${PATH} +% \end{Verbatim} +% +% \end{description} +% +% +% +% \subsection{Modifying a package for \pkg{lwarp}} +% +% \gindex{package>modifying for \pkg{lwarp}} +% \gindex{modifying>package} +% \gindex{adapting>package} +% \gindex{converting>package} +% +% If a class loads additional packages, it will be required to modify the +% class for \pkg{lwarp}, since \pkg{lwarp} must be loaded before most other packages. +% +% To work with \pkg{lwarp}, a class must first set up anything which replicates +% the functions of the basic \LaTeX\ classes, load any required fonts, +% then load \pkg{lwarp}, then finally load and adjust any other required packages. +% +% When creating \HTML, +% \pkg{lwarp} redefines the \cs{usepackage} and \cs{RequirePackage} +% macros such that it first looks to see if a |lwarp-.sty| +% version exists. If so, the \pkg{lwarp} version is used instead. +% This modular system allows users to create their own +% versions of packages for \pkg{lwarp} to use for \HTML, simply by creating +% a new package with a |lwarp-| prefix. If placed in the local +% directory along with the source code, it will be seen by that project +% alone. If placed alongside the other |lwarp-| packages where \TeX\ +% can see it, then the user's new package will be seen by any documents +% using \pkg{lwarp}. (Remember |mktexlsr| or |texhash|.) +% +% An |lwarp-.sty| package is only used during \HTML\ +% generation. Its purpose is to pretend to be the original package, +% while modify anything necessary to create a successful \HTML\ conversion. +% For many packages it is sufficient to simply provide nullified macros, +% lengths, counters, etc. for anything which the original package does, +% while passing the raw text on to be typeset. See the pre-existing +% |lwarp-| packages for examples. +% +% Anything the user might expect of the original package +% must be replaced or emulated by the new |lwarp-| package, including +% package options, user-adjustable counters, lengths, and booleans, and +% conditional behaviors. +% In many of these packages, most of the new definitions have a ``local'' prefix +% according to the package name, and |@| characters inside the name, +% which hides these names from the user. In most cases these macros +% will not need to be emulated for \HTML\ output. Only the ``user-facing'' +% macros need to be nullified or emulated. +% +% Each |lwarp-*| package should first call either of: +% \begin{sourcedisplay} +% \cs{LWR@ProvidesPackage\textblue{Drop}} \\ +% \fquad \textrm{-or-} \\ +% \cs{LWR@ProvidesPackage\textblue{Pass}} +% \end{sourcedisplay} +% If ``|Drop|''ped, the original print-version +% package is ignored, and only the |lwarp-| version is used. +% Use this where the original print version is useless for \HTML. +% If ``|Pass|''ed, the original package is loaded first, with the user-supplied options, +% then the |lwarp-| version continues loading as well. +% See \cref{sec:ntheorem} (\nameref{sec:ntheorem}) +% for an example of selectively disabling user options for a package. +% Use this when \HTML\ +% output only requires some modifications of the original package. +% For a case where the original package is usable without changes, there is no +% need to create a |lwarp-| version. +% +% +% \subsubsection{Adding a package to the \pkg{lwarp.dtx} file} +% +% When adding a package to |lwarp.dtx| for permanent inclusing in \pkg{lwarp}, +% provide the |lwarp-| code in |lwarp.dtx|, +% add its entry into |lwarp.ins|, and also remember to add +% \begin{sourcedisplay} +% \cs{LWR@loadafter}\{\textless{}packagename\textgreater\} +% \end{sourcedisplay} +% to |lwarp.dtx| in \cref{sec:loadafter}. This causes \pkg{lwarp} to stop with +% an error if \pkg{packagename} is loaded before \pkg{lwarp}. +% Finally, add an entry in \cref{tab:supported}, \nameref{tab:supported}, +% and also the Updates section. +% +% +% \subsection{Modifying a class for \pkg{lwarp}} +% +% \gindex{class>modifying for \pkg{lwarp}} +% \gindex{modifying>class} +% \gindex{adapting>class} +% \gindex{converting>class} +% +% If a class loads additional packages, it will be required to modify the +% class for \pkg{lwarp}, since \pkg{lwarp} must be loaded before most other packages. +% +% To work with \pkg{lwarp}, a class must first set up anything which replicates +% the functions of the basic \LaTeX\ classes, load any required fonts, +% then load \pkg{lwarp}, then finally load and adjust any other required packages. +% +% +% \subsection{Testing \pkg{lwarp}} +% +% \changes{v0.25}{2017/03/22}{Docs: Testing \pkg{lwarp}.} +% +% When changes have been made, test the print output before testing the +% \HTML. The print output compiles faster, and any errors in the printed +% version will be easier to figure out than the \HTML\ version. +% +% Remember that the configuration files are only rewritten when compiling the +% printed version of the document. +% +% \changes{v0.57}{2018/05/28}{Docs: Recompiling \prog{lwarpmk} or \CSS\ files.} +% When changing the source to \prog{lwarpmk} or a \CSS\ file in \filenm{lwarp.dtx}: +% \begin{enumerate} +% \item Change the source in \filenm{lwarp.dtx}. +% \item |pdflatex lwarp.ins| +% \item |pdflatex lwarp.dtx| +% \item If modifying \prog{lwarpmk} the new version should now be active. +% \item If modifying \CSS\ files: +% \begin{enumerate} +% \item For the document, |lwarpmk print| to update the \CSS\ files +% in the project. +% \item Reload the \HTML\ document to see the effect of the new \CSS\ files. +% \end{enumerate} +% \end{enumerate} +% +% Sometimes it is worth checking the |_html.pdf| file, which is the +% \PDF\ containing \HTML\ tags. Also, |_html.html| has +% the text conversion of these tags, before the file is split into individual +% \HTML\ files. +% +% It is also worth checking the browser's tools for verifying the correctness +% of \HTML\ and \CSS\ code. +% +% +% \subsection{Modifying \prog{lwarpmk}} +% \label{sec:modifylwarpmk} +% +% \changes{v0.28}{2017/04/14}{Docs: Modfying lwarpmk and index processing.} +% +% \DescribeProgram{lwarpmk} +% \DescribeFile{lwarpmk.lua} +% In most installations, \filenm{lwarpmk.lua} is an executable file located somewhere +% \gindex{lwarpmk=\prog{lwarpmk}>customizing} +% the operating system knows about, and it is called by typing \cmds{lwarpmk} into +% a terminal. +% +% A project-local copy of \filenm{lwarpmk.lua} may be generated, modified, and then used to +% compile documents: +% \begin{enumerate} +% \item Add the \optn{lwarpmk} option to the \pkg{lwarp} package. +% \item Recompile the printed version of the document. +% The \optn{lwarpmk} option causes \pkg{lwarp} to create a local copy of \filenm{lwarpmk.lua} +% \item The \optn{lwarpmk} option may now be removed from the \pkg{lwarp} package. +% \item Copy and rename \filenm{lwarpmk.lua} to a new file such as \filenm{mymake.lua}. +% \item Modify \filenm{mymake.lua} as desired. +% \item If necessary, make \filenm{mymake.lua} executable. +% \item Use \filenm{mymake.lua} instead of \filenm{lwarpmk.lua}. +% \end{enumerate} +% +% +% +% \clearpage +% +% ^^A *troubleshooting +% \section{Troubleshooting} +% \label{sec:troubleshooting} +% \gindex{FAQ}\gindex{Frequently Asked Questions}\gindex{bugs} +% \gindex{troubleshooting}\gindex{problems}\gindex{error messages} +% \gindex{debugging} +% \trouble{error messages} +% \trouble{warning messages} +% +% +% \subsection{\pkg{lwarp} package error conditions and warnings} +% \label{sec:errortestingmessages} +% \changes{v0.71}{2019/04/11}{Docs: Error testing.} +% +% \pkg{lwarp} tests for a number of error conditions and prints appropriate +% warnings. The following is a summary of these conditions. +% +% \subsubsection{Configuration file \filenm{lwarpmk.conf}} +% +% \begin{description} +% \item[File does not exist:] The configuration file must exist for \pkg{lwarpmk}. +% \item[Incorrect \optn{Unix} \slash \optn{Windows} selection:] The operating +% system which was detected by \pkg{lwarp}. So far only \optn{Unix} and \optn{Windows} +% are supported. +% \item[Incorrect delimiter characters.] Older versions of \prog{lwarpmk} used +% a different delimiter. +% \item[Source name is set to \optn{lwarp}:] +% \pkg{lwarp} has recently been recompiled in this directory, +% which overwrote the project's configuration files. +% This also occurs if \prog{lwarpmk} is executed in \pkg{lwarp}'s source directory. +% \item[Incorrect operating system:] The configuratio file was set for a +% different operating system, perhaps due to sharing in a collaborative project. +% \item[Outdated configuration files:] \pkg{lwarp} has +% been updated since this projects was last compiled. +% If there appears to be a valid print command in the file, \pkg{lwarpmk} displays +% this to instruct the user how to recompile the print version, which then +% updates the configuration files. +% \item[The designated source file does not exist:] For whatever reason\dots +% \item[Unknown engine:] \pkg{lwarp} cannot determing which engine is being used. +% Supported are \DVI\ \LaTeX, \PDF\ \LaTeX, \XeLaTeX, \LuaLaTeX, and up\LaTeX. +% \end{description} +% +% \subsubsection{Image generation with \cmds{lwarpmk limages}} +% +% \begin{description} +% \item[``Wait a moment for the images to complete before reloading page.'':] \ +% +% Images +% are generated by background tasks. If the document is reloaded before these +% tasks are complete, some images may not yet be generated. +% \prog{lwarpmk} tries to wait for background tasks to complete before exiting. +% \item[\HTML\ version does not exist:] Images are extracted from the \HTML\ version, +% which must be compiled before images are generated. +% \item[\filenm{*-images.txt} does not exist:] This file tells which images to +% extract from the \HTML\ file. If the file does not exist, it may be that +% no \SVG\ math or \env{lateximage}s were used. +% If so, \cmds{lwarpmk limages} is not necessary. +% \item[Cross references are not correct:] The document must have up-to-date +% cross references to locate the images to extract. +% A number of conditions may cause incorrect cross references. +% \item[``WARNING: Images will be incorrect.'':] An image reference was not found. +% Recompile. +% \item[\cmds{lwarpmk epstopdf *} or \cmds{lwarpmk pdftosvg *}:] Errors if +% filenames are not found. +% \end{description} +% +% \subsubsection{Default bitmapped font} +% +% \pkg{lwarp} requires the use of a vector font. +% If \pkg{lwarp} detects that the document uses the default +% \brand{Computer Modern} font, and the \pkg{cm-super} package is not installed, +% it is assumed that the font is bitmapped. +% An error is generated, along with the recommendation to install \pkg{cm-super} +% or use \pkg{lmodern}. +% +% \subsubsection{Packages} +% +% \begin{description} +% \item[Loaded before \pkg{lwarp}:] Some packages and classes must be loaded +% before \pkg{lwarp}. These include input and font encoding, +% \pkg{morewrites} and \pkg{newclude}, +% and a number of CJK-related packages and classes. +% \item[Loaded after \pkg{lwarp}:] Most packages which are modified by +% \pkg{lwarp} must be loaded after \pkg{lwarp}. +% \item[Loaded never:] Some packages do not work with \pkg{lwarp}. +% An error is generated, along with a list of alternatives to consider. +% \item[Specific packages:] Some packages enforce a specific load order vs. +% certain other packages. +% \item[Patching error:] \pkg{lwarp} tries to patch some packages using +% \pkg{xpatch}. If the original package has been updated more recently than +% \pkg{lwarp}, a patch may not work. It may be necessary to use an older version +% of the package until \pkg{lwarp} is updated. +% \item[\pkg{longtable}:] \pkg{lwarp}'s \pkg{longtable} package issues +% detailed error messages regarding the use of the table headers and footers. +% \end{description} +% +% \subsubsection{Compiling} +% +% \begin{description} +% \item[Duplicate filenames:] \pkg{lwarp} may generate file names from section names. +% While doing so, the filenames are simplified and special characters are removed. +% If this process generates a duplicate filename, and error is generated, +% describing the filename and which section name generated it. +% \item[Multirow:] When \cs{multirow} or \cs{multicolrow} are used, +% \cs{mrowcell} or \cs{mcolrowcell} must be placed in the appropriate cells to +% avoid corrupted \HTML\ output. +% \item[(width,height) missing a comma:] \cs{makebox} and \cs{framebox} can accept +% a parenthesis-delimited width and height, which must be separated by a comma. +% \item[``Load graphicx or graphics for improved SVG math baselines.'':] \SVG\ math +% baselines are improved if either of these packages are used. +% \item[``Load graphicx or graphics for improved XeTeX logo.'':] If these packages +% are loaded, the \XeLaTeX\ logo can use the reversed ``E''. +% \item[``It is recommended to use \texttt{[width=xx\cs{linewidth}]} +% instead of +% \texttt{[scale=yy]} +% '':] Browser support of \optn{scale} is not +% the same effect as \LaTeX. +% \end{description} +% +% +% \subsection{Using the \pkg{lwarp} package} +% +% The following address problems which may occur, and possible solutions to each. +% +% Also see: \\ +% \Cref{sec:printcommands}: \nameref{sec:printcommands} \\ +% \Cref{sec:limitations}: \nameref{sec:limitations} +% +% \changes{v0.14}{2016/03/26}{Docs: Troubleshooting cross-references.} +% \changes{v0.16}{2016/04/08}{Docs: Text not converting.} +% \changes{v0.34}{2017/08/08}{Docs: Misplaced alignment character.} +% \changes{v0.42}{2017/10/13}{Docs: Improper \cs{prevdepth}.} +% \changes{v0.58}{2018/06/07}{Docs: Misplaced \cs{omit}.} +% +% \begin{description} +% +% \item [Text is not converting correctly / corrupted \HTML\ tags:] ~ +% \trouble{HTML>corrupted} +% \begin{itemize} +% \item Font-related UTF-8 information must be embedded in the \PDF\ file. +% See \cref{sec:fonts} regarding bitmapped vs. vector fonts. +% \item See \cref{sec:avoidtextformatting} regarding \HTML\ entities and +% the characters |&|, |<|, and |>|. +% \end{itemize} +% +% \item [Undefined \HTML\ settings:] \ +% \trouble{HTML>settings>undefined} +% \begin{itemize} +% \item See the warning regarding the placement of the \HTML\ settings +% at \cref{sec:htmlsettings}. +% \end{itemize} +% +% \item [Tabular problems:] See \cref{sec:limitstabular}. +% +% \item [Obscure error messages:] ~ +% \begin{description} +% \setlength{\parskip}{1ex} +% \item [Print first:] Be sure that a print version of the document compiles and +% that your document's \LaTeX{} code is correct, before attempting +% to generate an \HTML\ version. +% +% \item [\texttt{\cs{end}\{warpHTML\}, \cs{end}\{warpprint\}, \cs{end}\{warpall\}}:] +% \trouble{warpHTML}\trouble{warpprint}\trouble{warpall} +% Each of these must be without any other characters on the same line. +% +% \item [Options clash:] If using \pkg{memoir}, see \cref{sec:limitsmemoir}. +% +% \item [``No room for a new \cs{write}.'':] Before |\usepackage{lwarp}|, add: +% \trouble{No room for a new \cs{write}} +% \trouble{morewrites} +% \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{\_}. +% \trouble{Missing \$ inserted>filename or URL} +% \trouble{URL>Missing \$ inserted} +% \trouble{filename>Missing \$ inserted} +% +% \item [``Label(s) may have changed. Rerun to get cross-references right.'':] \ +% +% This warning may repeat endlessly if a math expression is used in a caption. +% Simple math expressions such as \$X=1\$ may be replaced with +% \begin{sourcedisplay} +% \cs{textit}\{X\}\cs{,}=\cs{,}1 +% \end{sourcedisplay} +% \trouble{Label(s) may have changed} +% +% \item [``Leaders not followed by proper glue'':] This can be caused by +% a missing |l@| or |l@| definition. +% See \pkg{lwarp}'s definitions for examples. +% \trouble{Leaders not followed by proper glue} +% +% \item [``Improper \cs{prevdepth}'':] +% \trouble{Improper \cs{prevdepth}>boxes} +% \env{lateximage}s and \SVG\ math require \cs{newpage}, which +% cannot work inside \TeX\ boxes or \cs{ensuremath}. +% Anything using \cs{newsavebox}, \cs{newbox}, \env{lrbox}, +% \cs{savebox}, \cs{hbox}, \cs{vbox}, \cs{usebox}, \cs{sbox}, +% etc., must be modified to work without box commands. +% +% \trouble{ensuremath=\cs{ensuremath}} +% If you find something using \cs{ensuremath}, have it temporarily set: +% \begin{sourcedisplay} +% \cs{LetLtxMacro}\cs{@ensuredmath}\cs{LWR@origensuredmath} +% \end{sourcedisplay} +% inside a group first. +% +% Also, custom macros which appear inside a section, +% \trouble[macros in section,table,figure names]{sectioning>macro in name} +% \trouble{table>macro in name} +% \trouble{figure>macro in name} +% figure, or table name should be +% made robust since they appear inside the \filenm{.toc}, \filenm{.lof}, or +% \filenm{.lot} files. +% Use \cs{newrobustcmd} or \cs{robustify} from \pkg{etoolbox}, \pkg{xparse}, etc. +% +% If using BibTeX, see \cref{sec:limitsbibtex}.\watchout[BibTeX] +% +% \item[``\texttt{!~Undefined control sequence. \dots\ \cs{@begindocumenthook}''}:] ~ +% \watchout[\pkg{polyglossia}] +% See \cref{sec:limitspolyglossia} +% if using \pkg{polyglossia}. +% +% \item[``\texttt{\cs{begin}\{equation\} ended by \cs{end}\{document\}}'':] Do not +% \trouble[custom macros for environments]{math>custom macros} +% use custom macros such as \cs{beq} and \cs{eeq} to replace +% \begin{sourcedisplay} +% \cs{begin}\{equation\} \\ +% \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 math:] Some objects, such as \tikz, +% \trouble[``impure'' math objects]{math>non-math contents} +% may not compile in \pkg{lwarp}'s normal math emulation. +% Insert +% \begin{sourcedisplay} +% \cs{displaymathother} \textrm{-or-} \cs{inlinemathother} +% \end{sourcedisplay} +% before the math, and then +% \begin{sourcedisplay} +% \cs{displaymathnormal} \textrm{-or-} \cs{inlinemathnormal} +% \end{sourcedisplay} +% when displaying ``normal'' math. +% See \cref{sec:displaymathother}. +% \item[Slow compliation of math objects:] Complicated math objects +% \trouble{math>slow or failed compile} +% \trouble{math>alt tags} +% \trouble{alt tags} +% can also cause problems with \attribute{alt} tags, resulting in +% very slow compilation, large \attribute{alt} tags, and possible +% crashes. Use \cs{inlinemathother} \dots \cs{inlinemathnormal} or +% \cs{displaymathother} \dots \cs{displaymathnormal} around the +% math expression. +% \end{description} +% +% \needspace{3\baselineskip} +% \item [Incorrect \brand{MathJax}:] Some objects do not convert to \brand{Mathjax}. +% \trouble[\brand{MathJax}]{MathJax=\brand{MathJax}>errors} +% \trouble[\brand{MathJax}]{MathJax=\brand{MathJax}>unsupported packages} +% Use \cs{displaymathother} before these objects, then \cs{displaymathnormal} to return +% to ``normal'' display math. +% See \cref{sec:displaymathother}. +% +% \needspace{3\baselineskip} +% \item [Missing sections:] See \cref{sec:filedepth} regarding the +% |FileDepth| and |SideTOCDepth| counters, +% and the use of \cs{tableofcontents} in the home page. +% +% \item [Misnumbered footnotes from section headings:] See \cref{sec:limitsfootnotes}. +% +% \item [Missing \HTML\ files:] \ +% \begin{itemize} +% \item See the warning regarding changes to the \HTML\ settings +% at \cref{sec:htmlsettings}. +% \item Ensure that the filenames are unique after math and short words are removed. +% See \optn{FileSectionNames} at \cref{sec:htmlsettings}. +% \end{itemize} +% +% \item [Missing / incorrect cross-references:] ~ +% \trouble{reference>missing or incorrect} +% \trouble{cross reference>missing} +% \begin{itemize} +% \item Use |lwarpmk again| followed +% by |lwarpmk html| or |lwarpmk print| to compile the document one more time. +% \item \limitsreferences +% \item \limitscpageref +% \end{itemize} +% +% \item [BibTeX errors with \cs{etalchar}:] See \cref{sec:limitsbibtex}. +% +% \item [Malformed URLs:] Do not use the \texttt{\%} character between +% \trouble{hyperref=\pkg{hyperref}>incorrect link} +% \trouble{reference>incorrect link} +% \trouble{cross reference>incorrect link} +% \trouble{reference>\% character between arguments} +% arguments of \cs{hyperref}, etc., as this character is among those which +% is neutralized for inclusion in \HTML\ \URL{}s. +% +% \item [Em-dashes or En-dashes in listing captions and titles:] \ +% +% Use \XeLaTeX\ or \LuaLaTeX. +% \trouble{listings=\pkg{listings}} +% +% \item [Floats out of sequence:] ~ +% \trouble{float>out of sequence} +% \begin{description} +% \item [Mixed ``Here'' and floating:] Floats [H]ere and regular floats may +% become out of order. \cs{clearpage} if necessary. +% \item [Caption setup:] With \cs{captionsetup} set the positions for +% the captions |above| or |below| to match their use in the source code. +% \end{description} +% +% \item [Images are appearing in strange places:] ~ +% \trouble{image>incorrect} +% \trouble{SVG image>incorrect} +% \begin{itemize} +% \item Enter \cmds{lwarpmk limages} to refresh the \env{lateximage} images. +% \end{itemize} +% +% \item[SVG images:] \ +% +% \limitssvgimages +% +% \needspace{3\baselineskip} +% \item [Plain-looking document:] \ +% \trouble{CSS} +% \begin{itemize} +% \item The document's \CSS\ stylesheet may not be available, or may be +% linked incorrectly. Verify any \cs{CSSFilename} statements point to +% a valid \CSS\ file. +% \end{itemize} +% +% \item [Broken fragments of HTML:] ~ +% \trouble{HTML>corrupted} +% \begin{itemize} +% \item Check the \PDF\ file used to create \HTML\ +% to see if the tags overflowed the margin. +% (This is why such large page size and margins are used.) +% \end{itemize} +% +% \item [Changes do not seem to be taking effect:] ~ +% \trouble{HTML>page did not update} +% \trouble{HTML>missing pages>recompile} +% \begin{itemize} +% \item Be sure to |lwarpmk clean|, recompile, then start by reloading the home page. +% You may have been looking at an older version of the document. +% If you changed a section name, you may have been looking at +% the file for the old name. +% \item See the warning regarding changes to the \HTML\ settings +% at \cref{sec:htmlsettings}. +% \item Verify that the proper \CSS\ is actually being used. +% \item The browser may compensate for some subtle changes, such as +% automatically generating ligatures, reflowing text, etc. +% \end{itemize} +% +% \item [Un-matched conditional compiles:] ~ +% \begin{itemize} +% \item Verify the proper |begin|/|end| of |warpprint|, |warpHTML|, and |warpall| environments. +% \end{itemize} +% +% \end{description} +% +% +% \subsubsection{Debug tracing output} +% +% \DescribeMacro{\tracinglwarp} +% \trouble{tracing lwarp} +% When \cs{tracinglwarp} is used, \pkg{lwarp} will add extra +% tracing messages to the |.log| file. The last several messages +% may help track down errors. +% +% Place \cs{tracinglwarp} just after |\usepackage{lwarp}| to +% activate tracing. +% +% +% +% +% \subsection{Compiling the \filenm{lwarp.dtx} file} +% +% \begin{description} +% \item [\filenm{lwarp_tutorial.tex}:] Copy or link \filenm{lwarp_tutorial.txt} +% from the \TDS\ |doc| directory to the |source| directory, +% or wherever you wish to compile the documentation. +% This file is included verbatim in the documentation, but is in the \filenm{doc} +% directory so that it may be found by \prog{texdoc} and copied by the user. +% \item [Illogical error messages caused by an out-of-sync \filenm{lwarp.sty} file:] ~ +% \begin{enumerate} +% \item Delete the \filenm{lwarp.sty} file. +% \item Enter \cmds{pdflatex lwarp.ins} to generate a new \filenm{lwarp.sty} file. +% \item Enter \cmds{pdflatex lwarp.dtx} to recompile the \filenm{lwarp.pdf} documentation. +% \end{enumerate} +% +% \item [Un-nested environments:]~ +% +% Be sure to properly nest: +% \begin{itemize} +% \item |\begin{macrocode}| and |\end{macrocode}| +% \item |\begin{macro}| and |\end{macro}| +% \item |\begin{environment}| and |\end{environment}| +% \end{itemize} +% \end{description} +% +% +% +% \clearpage +% \section{Trademarks} +% +% \changes{v0.14}{2016/03/29}{Docs: Trademarks section.} +% +% \begin{itemize} +% \item \TeX\ is a trademark of American Mathematical Society. +% \item \brand{Adobe}® and \brand{Adobe} \prog{Framemaker}® are either registered trademarks or +% trademarks of \brand{Adobe Systems Incorporated} in the United States and/or other countries. +% \item \brand{Linux}® is the registered trademark of Linus Torvalds in the U.S.\ and other countries. +% \item \brand{Mac\,OS}® is a trademark of \brand{Apple Inc.} +% \item \brand{MadCap Flare}™ is the property of \brand{MadCap Software, Inc.} +% \item \brand{MathJax} is copyright 2009 and later. +% The \brand{MathJax Consortium} is a joint venture of the \brand{American Mathematical Society} (AMS) +% and the \brand{Society for Industrial and Applied Mathematics} (SIAM) +% to advance mathematical and scientific content on the web. +% \item \brand{Microsoft}®, \brand{Encarta}, \brand{MSN}, and \brand{Windows}® are either registered trademarks or +% trademarks of \brand{Microsoft Corporation} in the United States and/or other countries. +% \item \brand{UNIX}® is a registered trademark of \brand{The Open Group}. +% \item \brand{YouTube}™ is trademark of \brand{Google LLC}. +% \end{itemize} +% +% +% +% \changes{v0.61}{2018/09/27}{Docs: Multiple indexes.} +% +% \makeatletter +% +% \StopEventually{ +% ^^A \part{Change History and Index} +% ^^A \part{Change History} +% +% +% \pagestyle{plain} +% +% ^^A Each index has a prologue which creates its own \part, label, +% ^^A and meta index entry. +% \GlossaryPrologue{ +% \part{Change History} +% \section{Chg Hist} +% \label{sec:changehistory} +% \sindex[meta]{Change History} +% \markboth{{Change History}}{{Change History}} +% +% For the most recent changes, see page \pageref{sec:changesend}. +% +% } +% \PrintChanges +% \phantomsection +% \label{sec:changesend} +% +% +% ^^A The instructions for the Index of Objects: +% \IndexPrologue{ +% \clearpage +% \expandafter\part\expandafter{\indexname} +% \label{sec:index\indexshortcut} +% \sindex[meta]{\indexname} +% \markboth{Index of Objects}{Index of Objects}% +% +% This is an index of macros, environments, booleans, counters, lengths, +% packages, classes, options, keys, files, and various other programming objects. +% Each is listed by itself, and also by category. +% In some cases, they are further subdivided by [class]. +% +% Numbers written in italic refer to the page +% where the corresponding entry is described; +% numbers underlined refer to the +% \ifcodeline@index +% code line of the +% \fi +% definition. +% ^^A ; numbers in roman refer to the +% ^^A \ifcodeline@index +% ^^A code lines +% ^^A \else +% ^^A pages +% ^^A \fi +% ^^A where the entry is used. +% } +% +% \printindex[idx][Index of Objects] +% +% +% ^^A The instructions for the General Index: +% \IndexPrologue{ +% \clearpage +% \expandafter\part\expandafter{\indexname} +% \label{sec:index\indexshortcut} +% \sindex[meta]{\indexname} +% +% This is an index of instructions and concepts. +% Look here when wondering how to do something, and +% check the Troubleshooting Index when something goes wrong. +% } +% +% \printindex[gen][General Index] +% +% +% ^^A The instructions for the Troubleshooting Index: +% \IndexPrologue{ +% \clearpage +% \expandafter\part\expandafter{\indexname} +% \label{sec:index\indexshortcut} +% \sindex[meta]{\indexname} +% +% This index is a sorted reference of problems and solutions. +% In order to make it easier to locate a solution, +% the same issue may be addressed by more than one entry. +% +% Entries with higher page numbers are often duplicates of entries with +% lower page numbers, as the same warning may occur within the user manual +% and again within the source code for a given package. +% } +% +% \printindex[trb][Troubleshooting Index] +% +% +% ^^A The meta index does not get a meta index entry pointing to itself: +% \IndexPrologue{ + +% \clearpage +% \expandafter\part\expandafter{\indexname} +% \label{sec:index\indexshortcut} +% } +% +% \printindex[meta][Index of Indexes] +% } +% +% \makeatother +% +% +% \clearpage +% +% \part{lwarp.sty} +% +% +% \section{Implementation} +% +% +% This package is perhaps best described as a large collection of smaller +% individual technical challenges, +% in many cases solved through a number of \sout{crude hacks} clever tricks. +% Reference sources are +% given for many of the solutions, and a quick internet search will provide +% additional possibilities. +% +% Judgement calls were made, and are often commented. Improvements are possible. +% The author is open to ideas and suggestions. +% +% Packages were patched for re-use where they provided significant functionality. +% Examples include \pkg{xcolor} with its color models and conversion to \HTML\ +% color output, and \pkg{siunitx} which provides many number and unit-formatting +% options, almost all of which are available in pure-text form, and thus +% easily used by \prog{pdftotext}. +% +% Packages were emulated where their primary purpose was visual formatting which is not +% relevent to \HTML\ output. For example, packages related to sectioning +% are already patched by numerous other packages, creating a difficult number of +% combinations to try to support, and yet in \HTML\ output all of the +% formatting is thrown away, so these packages are merely emulated. +% +% Packages with graphical output are allowed as-is, but must be nested inside a +% \env{lateximage} environment to preserve the graphics. +% +% +% +% Testing has primarily been done with the Iceweasel/Firefox browser. +% +% +% \clearpage +% +% \section{Section depths and \HTML\ headings} +% \label{sec:stackdepths} +% \gindex{HTML>headings} +% \gindex{section>depths}\gindex{stack depths} +% +% Stacks are created to track depth inside the \LaTeX{} document structure. +% This depth is translated to \HTML\ headings as shown +% in \cref{tab:depthsheadings}. +% ``Depth'' here is not +% depth in the traditional computer-science stack-usage sense, but rather a +% representation of the nesting depth inside the \LaTeX{} document structure. +% +% When starting a new section, the program first must close out any existing +% sections and lists of a deeper level to keep the \HTML\ tags nested correctly. +% +% \begin{table} +% \centering +% \begin{threeparttable} +% \caption{Section depths and \HTML\ headings\label{tab:depthsheadings}} +% \begin{tabular}{lcl} +% \toprule +% Section & \parbox[b]{.35in}{\centering\LaTeX\ depth} & +% \HTML\ headings \tnote{\textasteriskcentered} \\ +% \midrule +% Title of the entire website & & \element{h1} \\ +% (none) & -5 & new for this package \\ +% book & -2 & \element{div class = "book"} \\ +% part & -1 & \element{h2} \\ +% chapter & 0 & \element{h3} \\ +% section & 1 & \element{h4} \\ +% subsection & 2 & \element{h5} \\ +% subsubsection & 3 & \element{h6} \\ +% paragraph & 4 & \element{span class = "paragraph"} \\ +% subparagraph & 5 & \element{span class = "subparagraph"} \\ +% listitem & 7 & new for this package, used for list items \\ +% \bottomrule +% \end{tabular} +% \begin{tablenotes} +% \footnotesize +% \item{\textasteriskcentered} If |FormatWP| is true, +% section headings may be adjusted, depending on |WPTitleHeading|. +% See \cref{tab:WPsectionheadings} on \cpageref{tab:WPsectionheadings}. +% \end{tablenotes} +% \end{threeparttable} +% \smallskip +% \hrule +% \end{table} +% +% Support for the \pkg{memoir} package will require the addition of a |book| +% level, which may push the \HTML\ headings down a step, and also cause +% |subsubsection| to become a \element{div} due to a limit of six \HTML\ headings. +% +% It is possible to use \HTMLfive{} \element{section} and \element{h1} for all levels, +% but this may not be well-recognized by older browsers. +% +% Fixed levels for parts and chapters allow the \CSS\ to remain fixed as well. +% +% +% \clearpage +% +% +% +% \section{Source code} +% +% ^^A *source +% +% This is where the documented source code for \pkg{lwarp} begins, +% continuing through the following sections all the way to the +% change log and index at the end of this document. +% +% \gindex{numbers>left margin}\gindex{line numbers} +% \gindex{margin>numbers}\gindex{margin>tags} +% \documentationnotes +% \gindex{warning icon}\gindex{danger icon}\gindex{icon>warning} +% \changes{v0.15}{2016/04/05}{Docs: Added warning icons for items needing +% special attention.} +% +% \vfill +% +% \begin{center} +% --- \pkg{lwarp} source code begins on the following page --- +% \end{center} +% +% +% +% \clearpage +% +% \section{Detecting the \TeX\ engine — \prog{pdflatex}, \prog{lualatex}, \prog{xelatex}} +% +% \changes{v0.16}{2016/04/07}{Added XeLaTeX, LuaLaTeX support.} +% See: \url{http://tex.stackexchange.com/a/47579}. +% +% Detects \XeTeX{} and \LuaLaTeX: +% \gindex{Xe\LaTeX>detection}\gindex{Lua\LaTeX>detection} +% +% \begin{macrocode} +\RequirePackage{iftex} +\newif\ifxetexorluatex +\ifXeTeX + \xetexorluatextrue +\else + \ifLuaTeX + \xetexorluatextrue + \else + \xetexorluatexfalse + \fi +\fi + +\ifLuaTeX +\RequirePackage{luatex85}% until the geometry package is updated +\fi + +\RequirePackage{ifpdf} +% \end{macrocode} +% +% \changes{v0.63}{2018/11/25}{Added p\TeX support.} +% +% \begin{macrocode} +\RequirePackage{ifptex} +% \end{macrocode} +% +% +% +% \section{Early package requirements} +% +% \DescribePackage{etoolbox} +% Provides \cs{ifbool} and other functions. +% +% \DescribePackage{xpatch} +% Patches macros with optional arguments. +% \begin{macrocode} +\RequirePackage{etoolbox}[2011/01/03]% v2.6 for \BeforeBeginEnvironment, etc. +\RequirePackage{xpatch} +% \end{macrocode} + + +% \DescribePackage{ifplatform} +% Provides \cs{ifwindows} to try to automatically detect +% \brand{Windows} OS. +% +% \begin{macrocode} +\RequirePackage{ifplatform}% sense op-system platform +% \end{macrocode} +% +% +% +% +% \DescribePackage{letltxmacro} +% +% \begin{macrocode} +\RequirePackage{letltxmacro} +% \end{macrocode} +% +% +% +% \section{Package load order} +% +% \changes{v0.21}{2017/02/22}{Add: Errors for misplaced packages.} +% +% +% Several packages must never be used with \pkg{lwarp}, +% others should only be loaded before \pkg{lwarp}, +% and others should only be loaded after. +% The \pkg{lwarp} core checks most of these cases. +% In some \filenm{lwarp-*} packages, \cs{LWR@loadbefore} is used to trigger an error +% if they are loaded after \pkg{lwarp}, while additional code provides necessary +% patches for when they are loaded before. +% +% Packages which must be loaded after \pkg{lwarp} are enfoced by +% a large number of \cs{LWR@loadafter} statements, below. +% Some packages are emulated by \pkg{memoir}, and so these are tested by +% \cs{LWR@notmemoirloadafter}, which does not cause an error if \pkg{memoir} is used. +% +% \cs{LWR@checkloadfilename} is used to check each filename to see if +% it must never be loaded, or must always be loaded before \pkg{lwarp}. +% +% +% \subsection{Tests of package load order} +% +% \begin{macro}{\LWR@loadafter} \marg{packagename} \quad +% Error if this package was loaded before \pkg{lwarp}. +% +% \label{sec:loadafter} +% +% \begin{macrocode} +\newcommand*{\LWR@loadafter}[1]{% +\@ifpackageloaded{#1} +{ + \PackageError{lwarp} + {% + Package #1,\MessageBreak + or one which uses #1,\MessageBreak + must be loaded after lwarp + } + {Move \detokenize{\usepackage}{#1} after + \detokenize{\usepackage}{lwarp}.\MessageBreak + Package #1 may also be loaded by something else,\MessageBreak + which must also be moved after lwarp.} +} +{} +} +% \end{macrocode} +% \end{macro} + + +% \begin{macro}{\LWR@notmemoirloadafter} \marg{packagename} \quad +% Error if not \pkg{memoir} class and this package was loaded before \pkg{lwarp}. +% +% \pkg{memoir} emulates many packages, and pretends that they have already been loaded. +% +% \changes{v0.45}{2017/12/03}{Added.} +% \begin{macrocode} +\@ifclassloaded{memoir} +{\newcommand*{\LWR@notmemoirloadafter}[1]{}} +{\LetLtxMacro\LWR@notmemoirloadafter\LWR@loadafter} +% \end{macrocode} +% \end{macro} + + +% \begin{macro}{\LWR@notltjloadafter} \marg{packagename} \quad +% Error if not a \pkg{ltjs*} class and this package was loaded before \pkg{lwarp}. +% +% \changes{v0.63}{2018/11/24}{Added.} +% \changes{v0.63}{2018/12/20}{Added more classes.} +% \begin{macrocode} +\LetLtxMacro\LWR@notltjloadafter\LWR@loadafter + +\@ifclassloaded{ltjarticle}{\renewcommand*{\LWR@notltjloadafter}[1]{}}{} +\@ifclassloaded{ltjbook}{\renewcommand*{\LWR@notltjloadafter}[1]{}}{} +\@ifclassloaded{ltjreport}{\renewcommand*{\LWR@notltjloadafter}[1]{}}{} +\@ifclassloaded{ltjsarticle}{\renewcommand*{\LWR@notltjloadafter}[1]{}}{} +\@ifclassloaded{ltjsbook}{\renewcommand*{\LWR@notltjloadafter}[1]{}}{} +\@ifclassloaded{ltjsreport}{\renewcommand*{\LWR@notltjloadafter}[1]{}}{} +\@ifclassloaded{ltjspf}{\renewcommand*{\LWR@notltjloadafter}[1]{}}{} +\@ifclassloaded{ltjskiyou}{\renewcommand*{\LWR@notltjloadafter}[1]{}}{} +\@ifclassloaded{ltjtarticle}{\renewcommand*{\LWR@notltjloadafter}[1]{}}{} +\@ifclassloaded{ltjtbook}{\renewcommand*{\LWR@notltjloadafter}[1]{}}{} +\@ifclassloaded{ltjtreport}{\renewcommand*{\LWR@notltjloadafter}[1]{}}{} +% \end{macrocode} +% \end{macro} + + +% \begin{macro}{\LWR@loadbefore} \marg{packagename} \quad +% Error if this package is loaded after \pkg{lwarp}. +% +% \changes{v0.33}{2017/07/06}{Fix: No \cs{PackageError} if already loaded.} +% +% \begin{macrocode} +\newcommand*{\LWR@loadbefore}[1]{% +\@ifpackageloaded{#1} +{} +{ +\PackageError{lwarp} +{Package #1 must be loaded before lwarp} +{Move \detokenize{\usepackage}{#1} before \detokenize{\usepackage}{lwarp}.} +} +} +% \end{macrocode} +% \end{macro} + + +% \begin{macro}{\LWR@checkloadbefore} +% \marg{thispackagename} \marg{packagename} +% +% If package names match, error if it is loaded after \pkg{lwarp}. +% +% \changes{v0.63}{2018/12/02}{Added.} +% +% \begin{macrocode} +\newcommand*{\LWR@checkloadbefore}[2]{% + \edef\LWR@tempone{#1}% + \ifdefstring{\LWR@tempone}{#2}{% + \LWR@loadbefore{#1}% + }{}% +} +% \end{macrocode} +% \end{macro} + + +% \begin{macro}{\LWR@loadnever} \marg{badpackagename} \marg{replacementpkgnames} +% +% The first packages is not supported, so tell the user to use the second instead. +% +% \changes{v0.25}{2017/03/16}{Added the ability to prevent conflicting packages.} +% +% \begin{macrocode} +\newcommand*{\LWR@loadnever}[2]{% +\PackageError{lwarp} +{% + Package #1 is not supported\MessageBreak + by lwarp's HTML conversion.\MessageBreak + Package(s) #2 may be useful instead +} +{% + Package #1 might conflict with lwarp in some way,\MessageBreak + or is superceded by another package.\MessageBreak + For a possible alternative, see package(s) #2. +} +} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\LWR@checkloadnever} +% \marg{thispackagename} \marg{badpackagename} \marg{replacementpkgnames} +% +% If this package name is the bad packagename, suggest the replacements instead. +% +% \changes{v0.63}{2018/12/01}{Added.} +% +% \begin{macrocode} +\newcommand*{\LWR@checkloadnever}[3]{% + \edef\LWR@tempone{#1}% + \ifdefstring{\LWR@tempone}{#2}{% + \LWR@loadnever{#2}{#3}% + }{}% +} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\LWR@earlyloadnever} \marg{badpackagename} \marg{replacementpkgname} +% +% The first package is not supported, so tell the user to use the second instead. +% This version checks immediately for packages which may have been loaded before \pkg{lwarp}. +% +% \changes{v0.54}{2018/04/06}{Added.} +% +% \begin{macrocode} +\newcommand*{\LWR@earlyloadnever}[2]{% +\@ifpackageloaded{#1}{% +\PackageError{lwarp} +{% + Package #1 is not supported\MessageBreak + by lwarp's HTML conversion.\MessageBreak + Package(s) #2 may be useful instead +} +{% + Package #1 might conflict with lwarp in some way,\MessageBreak + or is superceded by another package.\MessageBreak + For a possible alternative, see package(s) #2. +} +}{}% +} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\LWR@earlyclassloadnever} \marg{badclassname} \marg{replacementclassname} +% +% The first class is not supported, so tell the user to use the second instead. +% This version checks immediately for classes which may have been loaded before \pkg{lwarp}. +% +% \changes{v0.63}{2018/11/25}{Added.} +% +% \begin{macrocode} +\newcommand*{\LWR@earlyclassloadnever}[2]{% +\@ifclassloaded{#1}{% +\PackageError{lwarp} +{% + Class #1 is not supported\MessageBreak + by lwarp's HTML conversion.\MessageBreak + Class(es) #2 may be useful instead +} +{% + Class #1 might conflict with lwarp in some way,\MessageBreak + or is superceded by another class.\MessageBreak + For a possible alternative, see class(es) #2. +} +}{}% +} +% \end{macrocode} +% \end{macro} +% +% +% \subsection{Error for disallowed packages and classes loaded before lwarp} +% \changes{v0.54}{2018/04/06}{Added early check for disallowed packages.} +% \changes{v0.54}{2018/09/26}{Never load \pkg{aecompl}.} +% \changes{v0.62}{2018/11/18}{Added early checks for \pkg{CJK}, \pkg{CJKutf8}.} +% \changes{v0.65}{2018/12/15}{Added early checks for \pkg{jarticle}, \pkg{tarticle}, and related.} +% \changes{v0.66}{2019/01/04}{Added early checks for \pkg{colortab}, \pkg{epsf}, \pkg{hyper}, +% \pkg{picinpar}, \pkg{picins}, \pkg{sistyle}, \pkg{ucs}.} +% \changes{v0.68}{2019/02/26}{Prevented \pkg{alg}, \pkg{algorithmic}, \pkg{fncylab}, \pkg{pdfcprot}.} +% +% \begin{macrocode} +\LWR@earlyclassloadnever{jarticle}{ujarticle} +\LWR@earlyclassloadnever{jbook}{ujbook} +\LWR@earlyclassloadnever{jreport}{ujreport} +\LWR@earlyclassloadnever{tarticle}{utarticle} +\LWR@earlyclassloadnever{tbook}{utbook} +\LWR@earlyclassloadnever{treport}{utreport} +\LWR@earlyloadnever{ae}{cm-super, lmodern} +\LWR@earlyloadnever{aecompl}{cm-super, lmodern} +\LWR@earlyloadnever{aecc}{cm-super, lmodern} +\LWR@earlyloadnever{alg}{algorithm2e, algorithmicx} +\LWR@earlyloadnever{algorithmic}{algorithm2e, algorithmicx} +\LWR@earlyloadnever{boxedminipage}{boxedminipage2e} +\LWR@earlyloadnever{caption2}{caption} +% \LWR@earlyloadnever{ccaption}{caption}% might be preloaded by memoir +% \end{macrocode} +% The older \pkg{CJK} and \pkg{CJKutf8} only work with \pkg{xeCJK}: +% \begin{macrocode} +\@ifpackageloaded{xeCJK}{}{ + \LWR@earlyloadnever{CJK}{ctex, xeCJK} + \LWR@earlyloadnever{CJKutf8}{ctex, xeCJK} +} +% \end{macrocode} +% \pkg{bxcjkatype} is based on \pkg{CJK}: +% \begin{macrocode} +\LWR@earlyloadnever{bxcjkjatype}{upLaTeX, bxjsarticle, ujarticle, utarticle} +% \end{macrocode} +% \pkg{hangul} is not in TeXLive, and is not tested: +% \begin{macrocode} +\LWR@earlyloadnever{hangul}{kotex, xetexko, luatexko} +% \end{macrocode} +% Others: +% \begin{macrocode} +\LWR@earlyloadnever{colortab}{colortbl} +\LWR@earlyloadnever{epsf}{graphicx} +\LWR@earlyloadnever{fancyheadings}{fancyhdr} +\LWR@earlyloadnever{fncylab}{cleveref} +\LWR@earlyloadnever{glossary}{glossaries} +\LWR@earlyloadnever{hyper}{hyperref} +\LWR@earlyloadnever{pdfcprot}{microtype} +\LWR@earlyloadnever{picinpar}{floatflt, wrapfig} +\LWR@earlyloadnever{picins}{floatflt, wrapfig} +\LWR@earlyloadnever{sistyle}{siunitx} +\LWR@earlyloadnever{t1enc}{fontenc, inputenc, inputenx} +\LWR@earlyloadnever{ucs}{inputenc, inputencx} +\LWR@earlyloadnever{wasysym}{textcomp, amssymb, amsfonts, mnsymbol, fdsymbol} +% \end{macrocode} +% +% +% \subsection{Enforcing package loading after \pkg{lwarp}} +% +% Packages which should only be loaded after \pkg{lwarp} are tested +% here to trip an error of they have already been loaded. +% +% \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 +% \begin{macrocode} +\LWR@loadafter{2in1} +\LWR@loadafter{2up} +\LWR@loadafter{a4} +\LWR@loadafter{a4wide} +\LWR@loadafter{a5comb} +\LWR@notmemoirloadafter{abstract} +\LWR@loadafter{academicons} +\LWR@loadafter{accsupp} +\LWR@loadafter{acro} +\LWR@loadafter{acronym} +\LWR@loadafter{adjmulticol} +\LWR@loadafter{addlines} +\LWR@loadafter{ae} +\LWR@loadafter{aecc} +\LWR@loadafter{afterpage} +\LWR@loadafter{algorithm2e} +\LWR@loadafter{algorithmicx} +\LWR@loadafter{alltt} +\LWR@loadafter{amsmath} +\LWR@loadafter{amsthm} +\LWR@loadafter{anonchap} +\LWR@loadafter{anysize} +\LWR@notmemoirloadafter{appendix} +\LWR@loadafter{ar} +\LWR@loadafter{arabicfront} +\LWR@notmemoirloadafter{array} +\LWR@loadafter{arydshln} +\LWR@loadafter{asymptote} +% \LWR@loadafter{atbegshi}% used by morewrites +\LWR@loadafter{attachfile} +\LWR@loadafter{attachfile2} +\LWR@loadafter{authblk} +\LWR@loadafter{autonum} +\LWR@loadafter{axessibility} +\LWR@loadafter{axodraw2} +\LWR@loadafter{backnaur} +\LWR@loadafter{backref} +\LWR@loadafter{balance} +\LWR@loadafter{bbding} +\LWR@loadafter{bigdelim} +\LWR@loadafter{bigfoot} +\LWR@loadafter{bigstrut} +\LWR@loadafter{bitpattern} +\LWR@loadafter{blowup} +\LWR@loadafter{booklet} +\LWR@loadafter{bookmark} +\LWR@notmemoirloadafter{booktabs} +\LWR@loadafter{bophook} +\LWR@loadafter{bounddvi} +\LWR@loadafter{boxedminipage} +\LWR@loadafter{boxedminipage2e} +\LWR@loadafter{breakurl} +\LWR@loadafter{breqn} +\LWR@loadafter{bsheaders} +\LWR@loadafter{bxpapersize} +\LWR@loadafter{bytefield} +\LWR@loadafter{cancel} +\LWR@loadafter{canoniclayout} +\LWR@loadafter{caption} +\LWR@loadafter{caption2} +\LWR@loadafter{cases} +% \LWR@loadafter{ccaption}% may be preloaded by memoir +\LWR@loadafter{changebar} +\LWR@loadafter{changelayout} +\LWR@notmemoirloadafter{changepage} +\LWR@loadafter{changes} +\LWR@loadafter{chappg} +\LWR@loadafter{chapterbib} +\LWR@loadafter{chemfig} +\LWR@loadafter{chemformula} +\LWR@loadafter{chemgreek} +\LWR@loadafter{chemmacros} +\LWR@loadafter{chemnum} +\LWR@loadafter{chkfloat} +\LWR@notmemoirloadafter{chngpage} +\LWR@loadafter{cite} +\LWR@loadafter{cmdtrack} +\LWR@loadafter{color} +\LWR@loadafter{colortbl} +\LWR@loadafter{continue} +\LWR@loadafter{copyrightbox} +\LWR@notmemoirloadafter{crop} +% ctex must be loaded before lwarp +\LWR@loadafter{ctable} +\LWR@loadafter{cuted} +\LWR@loadafter{cutwin} +\LWR@loadafter{dblfloatfix} +\LWR@loadafter{dblfnote} +\LWR@notmemoirloadafter{dcolumn} +\LWR@loadafter{diagbox} +\LWR@loadafter{dingbat} +\LWR@loadafter{dprogress} +\LWR@loadafter{draftcopy} +\LWR@loadafter{draftfigure} +\LWR@loadafter{draftwatermark} +\LWR@loadafter{easy-todo} +\LWR@loadafter{ebook} +\LWR@loadafter{ed} +\LWR@loadafter{ellipsis} +\LWR@loadafter{embrac} +\LWR@loadafter{emptypage} +\LWR@loadafter{endfloat} +\LWR@loadafter{endheads} +\LWR@loadafter{endnotes} +\LWR@notmemoirloadafter{enumerate} +\LWR@loadafter{enumitem} +\LWR@notmemoirloadafter{epigraph} +\LWR@loadafter{epsfig} +\LWR@loadafter{epstopdf} +\LWR@loadafter{epstopdf-base} +\LWR@loadafter{eqlist} +\LWR@loadafter{eqparbox} +\LWR@loadafter{errata} +\LWR@loadafter{eso-pic} +\LWR@loadafter{eurosym} +\LWR@loadafter{everypage} +\LWR@loadafter{everyshi} +\LWR@loadafter{extramarks} +\LWR@loadafter{fancybox} +\LWR@loadafter{fancyhdr} +\LWR@loadafter{fancyheadings} +\LWR@loadafter{fancyref} +\LWR@loadafter{fancytabs} +\LWR@loadafter{fancyvrb} +\LWR@loadafter{figcaps} +\LWR@loadafter{figsize} +\LWR@loadafter{fitbox} +\LWR@loadafter{fix2col} +\LWR@loadafter{fixme} +\LWR@loadafter{fixmetodonotes} +\LWR@loadafter{flafter} +\LWR@loadafter{flippdf} +\LWR@loadafter{float} +\LWR@loadafter{floatflt} +\LWR@loadafter{floatpag} +\LWR@loadafter{floatrow} +\LWR@loadafter{fltrace} +\LWR@loadafter{flushend} +\LWR@loadafter{fnbreak} +\LWR@loadafter{fncychap} +\LWR@loadafter{fnlineno} +\LWR@loadafter{fnpara} +\LWR@loadafter{fnpos} +\LWR@loadafter{fontawesome} +\LWR@loadafter{fontawesome5} +% fontenc must be loaded before lwarp +% fontspec must be loaded before lwarp +\LWR@loadafter{footmisc} +\LWR@loadafter{footnote} +\LWR@loadafter{footnotebackref} +\LWR@loadafter{footnotehyper} +\LWR@loadafter{footnoterange} +\LWR@loadafter{footnpag} +\LWR@loadafter{foreign} +\LWR@loadafter{forest} +\LWR@loadafter{framed} +\LWR@loadafter{ftcap} +\LWR@loadafter{ftnright} +\LWR@loadafter{fullminipage} +\LWR@loadafter{fullpage} +\LWR@loadafter{fullwidth} +\LWR@loadafter{fwlw} +\LWR@loadafter{gentombow} +% geometry is always loaded by lwarp, and lwarp-geometry is AtBeginDocument +\LWR@loadafter{gmeometric} +\LWR@loadafter{glossaries} +% \LWR@loadafter{graphics}% pre-loaded by xunicode +% \LWR@loadafter{graphicx}% pre-loaded by xunicode +\LWR@loadafter{gloss} +\LWR@loadafter{glossary} +\LWR@loadafter{grffile} +\LWR@loadafter{grid} +\LWR@loadafter{grid-system} +\LWR@loadafter{gridset} +\LWR@loadafter{hang} +\LWR@loadafter{hanging} +\LWR@loadafter{hypbmsec} +\LWR@loadafter{hypcap} +\LWR@loadafter{hypdestopt} +\LWR@loadafter{hypernat} +\LWR@loadafter{hyperref} +\LWR@loadafter{hyperxmp} +\LWR@loadafter{hyphenat} +\LWR@loadafter{idxlayout} +\LWR@loadafter{ifoddpage} +\LWR@loadafter{imakeidx} +\LWR@notmemoirloadafter{index} +% inputenc must be loaded before lwarp +% inputenx must be loaded before lwarp +% inputtrc may be loaded before lwarp +\LWR@loadafter{intopdf} +\LWR@loadafter{karnaugh-map} +\LWR@loadafter{keyfloat} +\LWR@loadafter{layaureo} +\LWR@loadafter{layout} +\LWR@loadafter{layouts} +\LWR@loadafter{leading} +\LWR@loadafter{letterspace} +\LWR@loadafter{lettrine} +\LWR@loadafter{lineno} +\LWR@loadafter{lips} +\LWR@loadafter{listings} +\LWR@loadafter{listliketab} +\LWR@loadafter{longtable} +\LWR@loadafter{lscape} +\LWR@loadafter{ltablex} +\LWR@loadafter{ltcaption} +\LWR@loadafter{ltxgrid} +\LWR@loadafter{ltxtable} +\LWR@loadafter{lua-check-hyphen} +\LWR@loadafter{lua-visual-debug} +\LWR@loadafter{luacolor} +\LWR@loadafter{luatodonotes} +\LWR@loadafter{lyluatex} +\LWR@loadafter{magaz} +\LWR@notmemoirloadafter{makeidx} +\LWR@loadafter{manyfoot} +\LWR@loadafter{marginfit} +\LWR@loadafter{marginfix} +\LWR@loadafter{marginnote} +\LWR@loadafter{marvosym} +\LWR@loadafter{mathtools} +\LWR@loadafter{mcaption} +\LWR@loadafter{mdframed} +\LWR@loadafter{media9} +\LWR@loadafter{memhfixc} +\LWR@loadafter{metalogo} +\LWR@loadafter{metalogox} +\LWR@loadafter{mhchem} +\LWR@loadafter{microtype} +\LWR@loadafter{midfloat} +\LWR@loadafter{midpage} +\LWR@loadafter{minibox} +\LWR@loadafter{minitoc} +% morefloats must be allowed early for print mode +\LWR@notmemoirloadafter{moreverb} +% morewrites must be loaded before lwarp +\LWR@notmemoirloadafter{movie15} +\LWR@notmemoirloadafter{mparhack} +\LWR@loadafter{multicap} +%\LWR@loadafter{multicol}% loaded by ltxdoc +\LWR@loadafter{multicolrule} +\LWR@loadafter{multimedia} +\LWR@loadafter{multirow} +\LWR@loadafter{multitoc} +\LWR@loadafter{musicography} +\LWR@loadafter{nameauth} +\LWR@loadafter{nameref} +\LWR@loadafter{natbib} +\LWR@notmemoirloadafter{nccfancyhdr} +\LWR@notmemoirloadafter{needspace} +% newclude must be loaded before lwarp +\LWR@loadafter{newtxmath} +% newunicodechar must be loaded before lwarp +\LWR@notmemoirloadafter{nextpage} +\LWR@loadafter{nicefrac} +\LWR@loadafter{niceframe} +\LWR@loadafter{nomencl} +\LWR@loadafter{nonfloat} +\LWR@loadafter{nonumonpart} +\LWR@loadafter{nopageno} +\LWR@loadafter{notes} +\LWR@loadafter{notespages} +\LWR@loadafter{nowidow} +\LWR@loadafter{ntheorem} +\LWR@loadafter{octave} +\LWR@loadafter{overpic} +\LWR@loadafter{pagegrid} +\LWR@notmemoirloadafter{pagenote} +\LWR@loadafter{pagesel} +\LWR@loadafter{paralist} +\LWR@loadafter{parnotes} +\LWR@notmemoirloadafter{parskip} +\LWR@loadafter{pbox} +\LWR@loadafter{pdfcomment} +\LWR@loadafter{pdfcrypt} +\LWR@loadafter{pdflscape} +\LWR@loadafter{pdfmarginpar} +\LWR@loadafter{pdfpages} +\LWR@loadafter{pdfprivacy} +\LWR@loadafter{pdfrender} +\LWR@loadafter{pdfsync} +\LWR@loadafter{pdftricks} +\LWR@loadafter{pdfx} +\LWR@loadafter{perpage} +\LWR@loadafter{pfnote} +\LWR@loadafter{phfqit} +\LWR@loadafter{pifont} +\LWR@loadafter{placeins} +\LWR@loadafter{plarray} +\LWR@loadafter{plarydshln} +\LWR@loadafter{plextarray} +\LWR@loadafter{plextarydshln} +\LWR@loadafter{plcolortbl} +\LWR@loadafter{plextdelarray} +\LWR@loadafter{prelim2e} +\LWR@loadafter{prettyref} +\LWR@loadafter{preview} +\LWR@loadafter{psfrag} +\LWR@loadafter{psfragx} +\LWR@loadafter{pst-eps} +\LWR@loadafter{pstool} +\LWR@loadafter{pstricks} +% \LWR@loadafter{pxatbegshi}% may be used by morewrites +\LWR@loadafter{pxeveryshi} +\LWR@loadafter{pxftnright} +\LWR@loadafter{pxjahyper} +\LWR@loadafter{quotchap} +\LWR@loadafter{quoting} +\LWR@loadafter{ragged2e} +\LWR@loadafter{realscripts} +\LWR@loadafter{refcheck} +\LWR@loadafter{register} +\LWR@loadafter{relsize} +\LWR@loadafter{repeatindex} +\LWR@loadafter{resizegather} +\LWR@loadafter{rmpage} +\LWR@loadafter{romanbar} +\LWR@loadafter{romanbarpagenumber} +\LWR@loadafter{rotating} +\LWR@loadafter{rotfloat} +\LWR@loadafter{rviewport} +\LWR@loadafter{savetrees} +% scalefnt is loaded by babel-french +\LWR@loadafter{schemata} +\LWR@loadafter{scrextend} +\LWR@loadafter{scrhack} +\LWR@loadafter{scrlayer} +\LWR@loadafter{scrlayer-notecolumn} +\LWR@loadafter{scrlayer-scrpage} +\LWR@loadafter{scrpage2} +\LWR@loadafter{section} +\LWR@loadafter{sectionbreak} +\LWR@loadafter{sectsty} +\LWR@loadafter{semantic-markup} +\LWR@notmemoirloadafter{setspace} +\LWR@loadafter{shadow} +\LWR@loadafter{shapepar} +\LWR@notmemoirloadafter{showidx} +\LWR@loadafter{showkeys} +\LWR@loadafter{showtags} +\LWR@loadafter{sidecap} +\LWR@loadafter{sidenotes} +\LWR@loadafter{SIunits} +\LWR@loadafter{siunitx} +\LWR@loadafter{slantsc} +\LWR@loadafter{soul} +\LWR@loadafter{soulpos} +\LWR@loadafter{soulutf8} +\LWR@loadafter{splitidx} +\LWR@loadafter{srcltx} +\LWR@loadafter{srctex} +\LWR@loadafter{stabular} +\LWR@loadafter{stackengine} +\LWR@notltjloadafter{stfloats} +\LWR@loadafter{struktex} +\LWR@loadafter{subcaption} +\LWR@loadafter{subfig} +\LWR@loadafter{subfigure} +\LWR@loadafter{supertabular} +\LWR@loadafter{t1inc} +\LWR@loadafter{tabfigures} +\LWR@loadafter{tabls} +\LWR@loadafter{tablefootnote} +\LWR@notmemoirloadafter{tabularx} +\LWR@loadafter{tabulary} +\LWR@loadafter{tascmac} +\LWR@loadafter{textarea} +% \LWR@loadafter{textcomp}% maybe before lwarp with font packages +\LWR@loadafter{textfit} +\LWR@loadafter{textpos} +\LWR@loadafter{theorem} +\LWR@loadafter{thinsp} +\LWR@loadafter{threadcol} +\LWR@loadafter{threeparttable} +\LWR@loadafter{threeparttablex} +\LWR@loadafter{thumb} +\LWR@loadafter{thumbs} +\LWR@loadafter{tikz} +\LWR@loadafter{titleps} +\LWR@loadafter{titlesec} +\LWR@loadafter{titletoc} +\LWR@notmemoirloadafter{titling} +% \LWR@loadafter{tocbasic}% preloaded by koma-script classes +\LWR@notmemoirloadafter{tocbibind} +\LWR@loadafter{tocdata} +\LWR@loadafter{tocenter} +\LWR@notmemoirloadafter{tocloft} +\LWR@loadafter{tocstyle} +\LWR@loadafter{todo} +\LWR@loadafter{todonotes} +\LWR@loadafter{topcapt} +\LWR@loadafter{tram} +\LWR@loadafter{transparent} +\LWR@loadafter{trimclip} +\LWR@loadafter{trivfloat} +\LWR@loadafter{truncate} +\LWR@loadafter{turnthepage} +\LWR@loadafter{twoup} +% \end{macrocode} +% \changes{v0.44}{2017/11/19}{Adjustment for \pkg{koma-script}.} +% \begin{macrocode} +% \LWR@loadafter{typearea}% preloaded by koma-script classes +\LWR@loadafter{typicons} +% \LWR@loadafter{ulem}% preloaded by ctexart and related classes +\LWR@loadafter{umoline} +\LWR@loadafter{underscore} +\LWR@loadafter{units} +\LWR@loadafter{unitsdef} +\LWR@loadafter{upref} +\LWR@loadafter{url} +\LWR@loadafter{uspace} +\LWR@loadafter{varioref}% no lwarp package provided +\LWR@notmemoirloadafter{verse} +\LWR@loadafter{versonotes} +\LWR@loadafter{vertbars} +\LWR@loadafter{vmargin} +\LWR@loadafter{vowel} +\LWR@loadafter{vpe} +\LWR@loadafter{vwcol} +\LWR@loadafter{wallpaper} +\LWR@loadafter{watermark} +\LWR@loadafter{widows-and-orphans} +\LWR@loadafter{wrapfig} +\LWR@loadafter{xbmks} +\LWR@loadafter{xcolor} +\LWR@loadafter{xechangebar} +\LWR@loadafter{xellipsis} +% xetexko-vertical must be loaded before lwarp +\LWR@loadafter{xfakebold} +\LWR@loadafter{xfrac} +\LWR@loadafter{xltabular} +\LWR@loadafter{xltxtra} +\LWR@loadafter{xmpincl} +\LWR@loadafter{xpiano} +\LWR@loadafter{xpinyin} +\LWR@loadafter{xr} +\LWR@loadafter{xr-hyper} +\LWR@loadafter{xtab} +% xunicode must be loaded before lwarp +\LWR@loadafter{xurl} +\LWR@loadafter{xy} +\LWR@loadafter{zwpagelayout} +% \end{macrocode} +% +% +% +% +% +% \section{MD5 hashing} +% +% The MD5 hash is used for \env{lateximage} filenames for \SVG\ math. +% +% \begin{macrocode} +\newcommand{\LWR@mdfive}[1]{% +\PackageError{lwarp} +{No MD5 macro was found} +{Lwarp must find the macros pdfmdfivesum or mdfivesum.} +} +% \end{macrocode} +% +% The default for pdf\LaTeX, \DVI\LaTeX, up\LaTeX, etc: +% \changes{v0.63}{2018/11/30}{Fix: Default \cs{LWR@mdfive}.} +% \begin{macrocode} +\let\LWR@mdfive\pdfmdfivesum +% \end{macrocode} +% +% For \LuaLaTeX: +% \begin{macrocode} +\ifLuaTeX +\RequirePackage{pdftexcmds} +\let\LWR@mdfive\pdf@mdfivesum +\fi +% \end{macrocode} +% +% For \XeLaTeX: +% \begin{macrocode} +\ifXeTeX +\@ifundefined{pdffivesum}{} + {\let\LWR@mdfive\pdfmdfivesum} +\@ifundefined{mdfivesum}{} + {\let\LWR@mdfive\mdfivesum} +\fi +% \end{macrocode} +% +% +% \section{pdf\LaTeX\ T1 and \UTF-8 encoding} +% +% When using pdf\LaTeX, \pkg{lwarp} requires T1 encoding, and recommends \UTF-8 encoding. +% +% If some other input encoding is already defined, \pkg{lwarp} will +% try to use it instead, and hope for the best. +% +% \XeLaTeX\ and Lua\LaTeX\ are both \UTF-8 by nature. +% +% \changes{v0.44}{2017/11/16}{If pdfLaTeX, require T1 and \UTF-8 encoding.} +% \changes{v0.52}{2018/03/26}{If pdfLaTeX, allow other input encoding.} +% \changes{v0.63}{2018/11/25}{p\TeX: Encoding.} +% +% \begin{macro}{\LWR@pdfencoding} +% Sets \optn{T1}, and also \optn{utf8} if not already set. +% \begin{macrocode} +\newcommand*{\LWR@pdfencoding}{% + \RequirePackage[T1]{fontenc} + + \@ifpackageloaded{inputenc}{}{ + \@ifpackageloaded{inputenx}{}{ + \RequirePackage[utf8]{inputenc} + } + } +} +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +\ifPDFTeX% pdflatex or dvi latex + \LWR@pdfencoding +\fi + +\ifpTeX + \LWR@pdfencoding +\fi +% \end{macrocode} +% +% +% +% \section{Unicode input characters} +% \changes{v0.18}{2016/05/17}{PDF Unicode input characters.} +% \gindex{Unicode>input characters} +% +% \codeall +% +% If using \prog{pdflatex}, convert a minimal set of Unicode characters. +% Additional characters may be defined by the user, as needed. +% +% A commonly-used multiply symbol is declared to be \cs{texttimes}. +% +% The first arguments of \cs{newunicodechar} below are text ligatures in +% the source code, even though they are not printed in the following +% listing. +% +% \changes{v0.63}{2018/11/25}{p\TeX: No \pkg{newunicodechar}.} +% \begin{macrocode} +\ifpTeX +\else +\RequirePackage{newunicodechar} + +\newunicodechar{⨯}{\texttimes} + +\ifPDFTeX% pdflatex or dvi latex +\newunicodechar{ff}{ff}% the first arguments are ligatures +\newunicodechar{fi}{fi} +\newunicodechar{fl}{fl} +\newunicodechar{ffi}{ffi} +\newunicodechar{ffl}{ffl} +\newunicodechar{—}{---} +\newunicodechar{–}{--} +\fi + +\fi +% \end{macrocode} +% +% +% \section{Avoid a bitmapped font} +% +% If \DVI\ or \PDF\ \LaTeX, +% and if the default Computer Modern is the selected font family, +% ensure that \pkg{cm-super} or \pkg{lmodern} is used to provide a vector font. +% +% \changes{v0.70}{2019/03/25}{Ensure vector font.} +% \begin{macrocode} +\ifxetexorluatex +\else + \ifdefstring{\f@family}{cmr}{ + \IfFileExists{type1ec.sty}% found in cm-super + {} + {% cm-super not installed + \IfFileExists{lmodern.sty}{ + \PackageInfo{lwarp}{cm-super not installed, loading lmodern} + \RequirePackage{lmodern} + }{ + \PackageError{lwarp} + {% + Lwarp requires a vector font.\MessageBreak + Install and load cm-super, lmodern, or another\MessageBreak + Type-1 vector font before loading lwarp% + } + {% + Install cm-super or lmodern.\MessageBreak + If lmodern, load it before lwarp:\MessageBreak + \space\space\protect\usepackage{lmodern}\MessageBreak + \space\space\protect\usepackage{lwarp}% + } + } + }% cm-super not installed + }{}% f@family +\fi +% \end{macrocode} +% +% +% \section{Upright quotes} +% +% In PDF\TeX, preserve upright quotes in verbatim text. +% \pkg{upquote} also loads \pkg{textcomp}. +% +% \changes{v0.63}{2018/11/25}{p\TeX: Load \pkg{upquote}.} +% \begin{macrocode} +\ifPDFTeX +\RequirePackage{upquote} +\fi + +\ifpTeX + \RequirePackage{upquote} +\fi +% \end{macrocode} +% +% +% +% \section{Miscellaneous tools} +% +% \subsection{Lengths and units} +% +% \begin{macro}{\LWR@providelength} \marg{\cs{lengthname}} +% Provides the length if it isn't defined yet. +% +% Used to provide source compatibility for lengths which will be ignored, +% but might or might not be already provided by other packages. +% +% \changes{v0.46}{2018/01/23}{Added.} +% \begin{macrocode} +\newcommand*\LWR@providelength[1]{% + \ifdeflength{#1}{}{\newlength{#1}}% +} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\LWR@convertto} \marg{dest unit} \marg{length} +% +% Prints a length in the given units, without printing the unit itself. +% \begin{macrocode} +\newcommand*{\LWR@convertto}[2]{\strip@pt\dimexpr #2*65536/\number\dimexpr 1#1} +% \end{macrocode} +% \end{macro} + + +% \begin{macro}{\LWR@printpercentlength} \marg{smaller} \marg{larger} +% +% Prints a percent ratio of the two lengths. +% \begin{macrocode} +\newcommand*{\LWR@printpercentlength}[2]{% + \setcounter{LWR@tempcountone}{100*\ratio{#1}{#2}}% + \arabic{LWR@tempcountone}% +} +% \end{macrocode} +% \end{macro} + + +% \subsection{Patching} + +% \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} +% +% +% \subsection{Chinese text isolation} +% +% \begin{macro}{\LWR@isolate} \marg{text} +% Isolates Chinese characters from the surrounding text. +% This is required to avoid extra spaces on either side of the Chinese +% characters, especially when written to a file. +% +% \changes{v0.62}{2018/11/17}{Added.} +% \changes{v0.63}{2018/11/24}{Fix for \pkg{xeCJK}.} +% +% \begin{macrocode} +\newcommand{\LWR@isolate}[1]{#1}% + +\@ifpackageloaded{ctexpatch}{ + \renewcommand{\LWR@isolate}[1]{\null#1\null}% +}{} + +\@ifpackageloaded{xeCJK}{ + \renewcommand{\LWR@isolate}[1]{\null#1\null}% +}{} +% \end{macrocode} +% \end{macro} +% +% +% \subsection{Inserting vertical space} +% +% \begin{macro}{\LWR@forceemptyline} Extra vertical space in the \HTML\ output. +% Use after \cs{LWR@stoppars}. +% \changes{v0.73}{2019/06/26}{Added.} +% \begin{macrocode} +\newcommand*{\LWR@forceemptyline}{% + \LWR@origrule{0pt}{1\baselineskip}% + \LWR@orignewline% +} +% \end{macrocode} +% \end{macro} +% +% +% \subsection{Argument selection} +% +% \begin{macro}{\LWR@firstoffour} \marg{first} \marg{second} \marg{third} \marg{fourth} +% \changes{v0.63}{2019/01/25}{Added.} +% \begin{macro}{\LWR@secondoffour} \marg{first} \marg{second} \marg{third} \marg{fourth} +% \begin{macro}{\LWR@thirdoffour} \marg{first} \marg{second} \marg{third} \marg{fourth} +% \begin{macro}{\LWR@fourthoffour} \marg{first} \marg{second} \marg{third} \marg{fourth} +% +% Expands to the nth of the four arguments. +% Used for extra cross referencing. +% +% \begin{macrocode} +\long\def\LWR@firstoffour#1#2#3#4{#1} +\long\def\LWR@secondoffour#1#2#3#4{#2} +\long\def\LWR@thirdoffour#1#2#3#4{#3} +\long\def\LWR@fourthoffour#1#2#3#4{#4} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% +% +% \subsection{Global boxes} +% +% \begin{macro}{\LWR@gsavebox} \marg{macroname} \marg{contents} +% +% From +% \href{https://tex.stackexchange.com/questions/288702/savebox-forgets-its-content-across-columns-inside-align} +% {https://tex.stackexchange.com/questions/288702/ \\ \fqquad\ savebox-forgets-its-content-across-columns-inside-align} +% +% \changes{v0.73}{2019/06/11}{Added global save boxes.} +% +% \begin{macrocode} +\DeclareRobustCommand\LWR@gsavebox[1]{% + \@ifnextchar(%) + {\LWR@@gsavepicbox#1}{\@ifnextchar[{\LWR@@gsavebox#1}{\LWR@gsbox#1}}}% +\long\def\LWR@gsbox#1#2{\global\setbox#1\hbox{% + \color@setgroup#2\color@endgroup}} +\def\LWR@@gsavebox#1[#2]{% + \@ifnextchar [{\LWR@@igsavebox#1[#2]}{\LWR@@igsavebox#1[#2][c]}} +\long\def\LWR@@igsavebox#1[#2][#3]#4{% + \LWR@gsbox#1{\@imakebox[#2][#3]{#4}}} +\def\LWR@@gsavepicbox#1(#2,#3){% + \@ifnextchar[%] + {\LWR@@igsavepicbox#1(#2,#3)}{\LWR@@igsavepicbox#1(#2,#3)[]}} +\long\def\LWR@@igsavepicbox#1(#2,#3)[#4]#5{% + \LWR@gsbox#1{\@imakepicbox(#2,#3)[#4]{#5}}} +% \end{macrocode} +% \end{macro} + +% \begin{environment}{LWR@glrbox} \marg{macroname} +% \begin{macrocode} +\def\LWR@glrbox#1{% + \edef\reserved@a{% + \endgroup + \global\setbox#1\hbox{% + \begingroup\aftergroup}% + \def\noexpand\@currenvir{\@currenvir}% + \def\noexpand\@currenvline{\on@line}}% + \reserved@a + \@endpefalse + \color@setgroup + \ignorespaces} +\let\LWR@endglrbox\LWR@endlrbox +% \end{macrocode} +% \end{environment} +% +% +% +% \section{Operating-System portability} +% \label{sec:OSportability} +% \changes{v0.11}{2016/03/11}{Added section: Operating-System portability.} +% +% \osportabilityusage +% +% +% +% \subsection{Literal characters} +% +% Literal characters to be used in \optn{PrintLatexCmd} and \optn{HTMLLatexCmd}. +% These are defined without |@| to easily allow their inclusion in the user's document. +% +% The literal |%| character: +% \begin{macrocode} +\let\LWRpercent\@percentchar +% \end{macrocode} +% +% +% The literal |$| character: +% \begin{macrocode} +\catcode`\$=12 +\def\LWRdollar{$} +\catcode`\$=3 +% \end{macrocode} +% +% +% The literal |&| character: +% \begin{macrocode} +\catcode`\&=12 +\def\LWRamp{&} +\catcode`\&=4 +% \end{macrocode} +% +% +% The literal |\| character. +% The ampersand is temporarily set to the escape character during the +% definition of the backslash macro. +% \begin{macrocode} +\catcode`\&=0 +&catcode`&\=12 +&def&LWRbackslash{\} +&catcode`&\=0 +\catcode`\&=4 +% \end{macrocode} +% +% +% The literal |{| character. +% The ampersand is temporarily set to the begin group character during the +% definition of the leftbrace macro. +% \begin{macrocode} +\catcode`\&=1 +\catcode`\{=12 +\def\LWRleftbrace&{} +\catcode`\{=1 +\catcode`\&=4 +% \end{macrocode} +% +% +% The literal |}| character. +% The ampersand is temporarily set to the end group character during the +% definition of the leftbrace macro. +% \begin{macrocode} +\catcode`\&=2 +\catcode`\}=12 +\def\LWRrightbrace{}& +\catcode`\}=2 +\catcode`\&=4 +% \end{macrocode} +% +% +% The literal |#| character: +% \begin{macrocode} +\catcode`\#=12 +\def\LWRhash{#} +\catcode`\#=6 +% \end{macrocode} +% +% +% \begin{macro}{\LWRopquote} +% The operating system's quote mark, \brand{Unix} default. +% For \brand{Windows}, see \cs{LWR@setOSWindows}, below. +% \begin{macrocode} +\def\LWRopquote{'} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\LWRopseq} +% The operating system's sequential execution command, \brand{Unix} default. +% For \brand{Windows}, see \cs{LWR@setOSWindows}, below. +% \changes{v0.61}{2018/10/06}{Added spaces.} +% \begin{macrocode} +\def\LWRopseq{\space\LWRamp\LWRamp\space\space} +% \end{macrocode} +% \end{macro} +% +% +% \subsection{Common portability code} +% +% \DescribeBoolean{usingOSWindows} Set if the \optn{OSWindows} option is used, +% or if \brand{Windows} is automatically detected. +% \begin{macrocode} +\newbool{usingOSWindows} +\boolfalse{usingOSWindows} +% \end{macrocode} + + +% \subsection{\brand{Unix}, \brand{Linux}, and \brand{Mac\,OS}} + +% \begin{macro}{\OSPathSymbol} +% Symbol used to separate directories in a path. +% \begin{macrocode} +\newcommand*{\OSPathSymbol}{/} +% \end{macrocode} +% \end{macro} + + +% \subsection{\brand{MS-Windows}} + +% For \brand{MS-Windows}: +% +% \begin{macro}{\LWR@setOSWindows} +% Set defaults for the \brand{MS-Windows} operating system. +% \pkg{lwarp} attempts to auto-detect the operatings system, +% and the \optn{OSWindows} option may also be used to force +% \brand{MS-Windows} compatibility. +% +% \changes{v0.20}{2016/12/19}{Auto-detects operating system.} +% +% \begin{macrocode} +\newcommand*{\LWR@setOSWindows} +{ +\booltrue{usingOSWindows} +\renewcommand*{\OSPathSymbol}{\@backslashchar} +\def\LWRopquote{"} +\def\LWRopseq{\space\LWRamp\space\space} +} +% \end{macrocode} +% \end{macro} +% +% Test for windows during compile. The user may also specify +% \optn{OSWindows} package option in case this test fails. +% \begin{macrocode} +\ifwindows +\LWR@setOSWindows +\fi +% \end{macrocode} + + + + + +% +% \section{Package options} +% \label{sec:handlingpackageoptions} +% +% + + +% \DescribePackage{kvoptions} +% Allows key/value package options. +% \begin{macrocode} +\RequirePackage{kvoptions} +\SetupKeyvalOptions{family=LWR,prefix=LWR@} +% \end{macrocode} + + +% \begin{macro}{\lwarpsetup} +% A user interface to set the keys: +% \changes{v0.61}{2018/09/21}{Added.} +% \begin{macrocode} +\newcommand{\lwarpsetup}[1]{\setkeys{LWR}{#1}} +% \end{macrocode} +% \end{macro} + + +% \DescribeBoolean{warpingprint} +% \DescribeBoolean{warpingHTML} +% \DescribeBoolean{mathjax} +% \DescribeBoolean{LWR@origmathjax} +% ^^A \DescribeBoolean{mathKaTeX} +% +% Set to true/false depending on the package option selections for +% print/\HTML/\EPUB\ output and mathsvg/mathjax. +% +% \optn{LWR@origmathjax} remembers the original setting to be restored +% by \cs{displaymathnormal}. +% \begin{macrocode} +\newbool{warpingprint} +\newbool{warpingHTML} +\newbool{mathjax} +\newbool{LWR@origmathjax} +% \end{macrocode} +% ^^A % \begin{macrocode} +% ^^A \newbool{mathKaTeX} +% ^^A % \end{macrocode} +% +% +% The default is print output, +% \margintag{defaults} +% and \SVG\ math if the user chose \HTML\ output. +% \begin{macrocode} +\booltrue{warpingprint}% +\boolfalse{warpingHTML}% +\boolfalse{mathjax}% +% \end{macrocode} +% +% +% +% \DescribeOption{warpprint} +% If the \optn{warpprint} option is given, +% boolean |warpingprint| is true and boolean |warpingHTML| is false, +% and may be used for \cs{ifbool} tests. +% +% +% \begin{macrocode} +\DeclareVoidOption{warpprint}{% +\PackageInfo{lwarp}{Using option 'warpprint'} +\booltrue{warpingprint}% +\boolfalse{warpingHTML}% +} +% \end{macrocode} + +% \DescribeOption{warpHTML} +% Anything in the |warpHTML| environment will be generated for \HTML\ output only. +% +% \DescribeOption{warpHTML} +% If the \optn{warpHTML} option is given, +% boolean |warpingHTML| is true and boolean |warpingprint| is false, +% and may be used for \cs{ifbool} tests. +% +% \begin{macrocode} +\DeclareVoidOption{warpHTML}{% +\PackageInfo{lwarp}{Using option 'warpHTML'}% +\booltrue{warpingHTML}% +\boolfalse{warpingprint}% +} +% \end{macrocode} +% +% +% + + +% +% \changes{v0.19}{2016/05/25}{Options: mathsvg and mathjax} +% \DescribeOption{mathsvg} +% Option \optn{mathsvg} selects \SVG\ math display: +% \gindex{math>mathsvg=\optn{mathsvg} option} +% \gindex{SVG>mathsvg=\optn{mathsvg} option} +% If the \optn{mathsvg} option is given, boolean |mathjax| is false, +% and may be used for \cs{ifbool} tests. +% \begin{macrocode} +\DeclareVoidOption{mathsvg}{% +\PackageInfo{lwarp}{Using option 'mathsvg'} +\boolfalse{mathjax}% +\boolfalse{LWR@origmathjax}% +% \end{macrocode} +% ^^A % \begin{macrocode} +% ^^A \boolfalse{mathKaTeX}% +% ^^A % \end{macrocode} +% \begin{macrocode} +} +% \end{macrocode} +% +% \DescribeOption{mathjax} +% Option \optn{mathjax} selects \brand{MathJax} math display: +% \gindex{math>mathjax=\optn{mathjax} option} +% \gindex{MathJax=\brand{MathJax}>mathjax=\optn{mathjax} option} +% If the \optn{mathjax} option is given, boolean |mathjax| is true, may be used for \cs{ifbool} tests. +% \begin{macrocode} +\DeclareVoidOption{mathjax}{% +\PackageInfo{lwarp}{Using option 'mathjax'} +\booltrue{mathjax}% +\booltrue{LWR@origmathjax}% +% \end{macrocode} +% ^^A % \begin{macrocode} +% ^^A \boolfalse{mathKaTeX}% +% ^^A % \end{macrocode} +% \begin{macrocode} +} +% \end{macrocode} + +% ^^A \DescribeOption{mathKaTeX} +% ^^A Option \optn{mathKaTeX} selects Ka\TeX\ math display: +% ^^A \gindex{math>mathKaTeX=\optn{mathKaTeX} option} +% ^^A \gindex{KaTeX=Ka\TeX>mathKaTeX=\optn{mathKaTeX} option} +% ^^A If the \optn{mathKaTeX} option is given, boolean |mathKaTeX| is true, +% ^^A may be used for \cs{ifbool} tests. +% ^^A Boolean |mathjax| is also set true, as most code is shared with +% ^^A \brand{MathJax} functions. +% ^^A \begin{macrocode} +% ^^A \DeclareVoidOption{mathKaTeX}{% +% ^^A \PackageInfo{lwarp}{Using option 'mathKaTeX'} +% ^^A \booltrue{mathjax}% +% ^^A \booltrue{LWR@origmathjax}% +% ^^A \booltrue{mathKaTeX}% +% ^^A } +% ^^A \end{macrocode} + + + +% \DescribeOption{BaseJobname} +% \DescribeDefault{\cs{jobname}} +% Option \optn{BaseJobname} sets the \cs{BaseJobname} for this document. +% +% This is the \cs{jobname} of the printed version, even if currently +% compiling the \HTML\ version. +% I.e. this is the \cs{jobname} without |_html| appended. +% This is used to set \cs{HomeHTMLFilename} if the user did not provide one. +% \begin{macrocode} +\DeclareStringOption[\jobname]{BaseJobname} +% \end{macrocode} + + +% \DescribeOption{ImagesDirectory} +% \DescribeDefault{\cs{jobname}-images} +% Option \optn{ImagesDirectory} sets the name of the directory +% to use for the \env{lateximage} images. +% +% \changes{v0.66}{2019/01/27}{Added option \optn{ImagesDirectory}.} +% \begin{macrocode} +\DeclareStringOption[\BaseJobname-images]{ImagesDirectory} +% \end{macrocode} + + +% \DescribeOption{ImagesName} +% \DescribeDefault{image-} +% Option \optn{ImagesName} sets the prefix +% to use for the \env{lateximage} images. +% +% \changes{v0.66}{2019/01/27}{Added option \optn{ImagesName}.} +% \begin{macrocode} +\DeclareStringOption[image-]{ImagesName} +% \end{macrocode} + + +% \DescribeOption{makeindexStyle} Selects a custom |.ist| file. +% \DescribeDefault{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. +% \DescribeDefault{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 +% \DescribeDefault{english} +% in \prog{lwarpmk}'s configuration files. This is then used by \prog{lwarpmk} while +% processing the index and glossary. +% +% \changes{v0.29}{2017/04/15}{Add: \optn{lwarpmklang} option for \pkg{lwarp}.} +% \changes{v0.30}{2017/04/28}{Option \optn{lwarpmklang} changed to \optn{IndexLanguage}.} +% \changes{v0.54}{2018/04/06}{Option \optn{IndexLanguage} changed to \optn{xindyLanguage}.} +% +% \begin{macrocode} +\DeclareStringOption[english]{xindyLanguage} +% \end{macrocode} + + +% \DescribeOption{xindyCodepage} Sets the \pkg{xindy} codepage to be assigned +% \DescribeDefault{utf8} +% in \prog{lwarpmk}'s configuration files. This is then used by \prog{lwarpmk} while +% processing the index. +% ^^A and glossary. +% +% \changes{v0.54}{2018/04/06}{Add: \optn{xindyCodepage}.} +% +% \begin{macrocode} +\DeclareStringOption[utf8]{xindyCodepage} +% \end{macrocode} + + + +% \limitspdftotextenc +% +% \changes{v0.54}{2018/04/06}{Add: \optn{pdftotextEnc}.} +% +% \begin{macrocode} +\DeclareStringOption[UTF-8]{pdftotextEnc} +% \end{macrocode} + + + +% \DescribeOption{lwarpmk} Tells \pkg{lwarp} to +% generate a local copy of \prog{lwarpmk} called \filenm{lwarpmk.lua}. +% Useful for archiving for future use. +% This file may be made executable and acts just like \prog{lwarpmk}. +% +% If \optn{lwarpmk} option, creates a local copy of \filenm{lwarpmk.lua}: +% \begin{macrocode} +\newbool{LWR@creatinglwarpmk} +\boolfalse{LWR@creatinglwarpmk} + +\DeclareVoidOption{lwarpmk}{ +\PackageInfo{lwarp}{Using option 'lwarpmk'} +\booltrue{LWR@creatinglwarpmk} +} +% \end{macrocode} + + + +% \DescribeOption{OSWindows} Tells \pkg{lwarp} to use \brand{MS-Windows} compatibility. +% Auto-detection of the operating system is attempted, and this option is only +% necessary if the auto-detection fails. +% See the automatically-generated |lwarpmk.conf| file to find out +% whether the operating system was detected correctly. +% +% \changes{v0.30}{2017/04/27}{Option \optn{OSWindows} replaces macro \cs{warpOSwindows}.} +% +% \begin{macrocode} +\DeclareVoidOption{OSWindows}{ +\PackageInfo{lwarp}{Using option 'OSWindows'} +\LWR@setOSWindows +} +% \end{macrocode} + + + +% \DescribeOption{HomeHTMLFilename} \DescribeDefault{\cs{BaseJobname}} +% The filename of the homepage. +% The default is the jobname. +% This option is stored into \cs{LWR@HomeHTMLFilename}, +% and later transferred into \cs{HomeHTMLFilename} for internal use. +% +% \changes{v0.30}{2017/04/27}{Options \optn{HomeHTMLFilename} and \optn{HTMLFilename} +% replace macros \cs{HomeHTMLFilename} and \cs{HTMLFilename}.} +% +% \begin{macrocode} +\DeclareStringOption[]{HomeHTMLFilename} +% \end{macrocode} + + +% \DescribeOption{HTMLFilename} \DescribeDefault{} +% The filename prefix of web pages after the homepage. +% The default is empty, no prefix. +% This option is stored into \cs{LWR@HTMLFilename}, +% and later transferred into \cs{HTMLFilename} for internal use. +% +% \begin{macrocode} +\DeclareStringOption[]{HTMLFilename} +% \end{macrocode} + +% \DescribeOption{PrintLatexCmd} \DescribeDefault{} +% The shell commands to use to compile the print document. +% +% \changes{v0.61}{2018/09/20}{Added \optn{PrintLatexCmd} option.} +% \begin{macrocode} +\DeclareStringOption[]{PrintLatexCmd} +% \end{macrocode} + +% \DescribeOption{HTMLLatexCmd} \DescribeDefault{} +% The shell commands to use to compile the \HTML\ document. +% +% \changes{v0.61}{2018/09/20}{Added \optn{HTMLLatexCmd} option.} +% \begin{macrocode} +\DeclareStringOption[]{HTMLLatexCmd} +% \end{macrocode} + +% \DescribeOption{PrintIndexCmd} \DescribeDefault{} +% The shell commands to use to compile the print indexes. +% +% \begin{macrocode} +\DeclareStringOption[]{PrintIndexCmd} +% \end{macrocode} + +% \DescribeOption{HTMLIndexCmd} \DescribeDefault{} +% The shell commands to use to compile the \HTML\ indexes. +% +% \begin{macrocode} +\DeclareStringOption[]{HTMLIndexCmd} +% \end{macrocode} + + +% \DescribeOption{LatexmkIndexCmd} \DescribeDefault{} +% 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. +% +% \changes{v0.30}{2017/04/29}{Option \prog{latexmk} replaces macro \cs{UseLatexmk}.} +% +% \begin{macrocode} +\DeclareBoolOption[false]{latexmk} +% \end{macrocode} + + +% \DescribeOption{dvips} +% Option \optn{dvips} tells \prog{lwarpmk} to use \prog{dvips} +% when compiling \DVI\ \prog{latex} documents. +% +% \changes{v0.59}{2018/09/02}{Added option \optn{dvips}.} +% +% \begin{macrocode} +\DeclareBoolOption[false]{dvips} +% \end{macrocode} + + +% \DescribeOption{dvipdfm} +% Option \optn{dvipdfm} tells \prog{lwarpmk} to use \prog{dvipdfm} +% when compiling \DVI\ \prog{latex} documents. +% +% \changes{v0.59}{2018/09/02}{Added option \optn{dvipdfm}.} +% +% \begin{macrocode} +\DeclareBoolOption[false]{dvipdfm} +% \end{macrocode} + + +% \DescribeOption{dvipdfmx} +% Option \optn{dvipdfmx} tells \prog{lwarpmk} to use \prog{dvipdfmx} +% when compiling \DVI\ \prog{latex} documents. +% +% \changes{v0.59}{2018/09/02}{Added option \optn{dvipdfmx}.} +% +% \begin{macrocode} +\DeclareBoolOption[false]{dvipdfmx} +% \end{macrocode} + + + + +% Execute the package options, with the defaults which have been set just above: +% \margintag{Execute options} +% \begin{macrocode} +\ProcessKeyvalOptions*\relax +% \end{macrocode} + + + + +% \subsection{Additional options support} + + +% Assign the \cs{BaseJobname} if the user hasn't provided one: +% \begin{macrocode} +\providecommand*{\BaseJobname}{\LWR@BaseJobname} +% \end{macrocode} + + +% Defaults unless already over-ridden by the user: +% \begin{macrocode} +\ifcsempty{LWR@HomeHTMLFilename}{ + \newcommand*{\HomeHTMLFilename}{\BaseJobname} +}{ + \csedef{HomeHTMLFilename}{\LWR@HomeHTMLFilename} +} + +\csedef{HTMLFilename}{\LWR@HTMLFilename} +% \end{macrocode} +% +% +% Special handling for underscores in labels and filenames. +% +% \begin{macro}{\LWR@sanitized} The sanitized version of what was given +% to \cs{LWR@sanitize}. +% Characters are set to their detokenized versions. +% Required for underscores in labels and filenames. +% \begin{macrocode} +\newcommand*{\LWR@sanitized}{} +% \end{macrocode} +% \end{macro} + +% \begin{macro}{\LWR@sanitize} \marg{text} +% +% Sanitizes the text and returns the result in \cs{LWR@sanitized}. +% \begin{macrocode} +\newcommand*{\LWR@sanitize}[1]{% +\edef\LWR@sanitized{#1}% +\edef\LWR@sanitized{\detokenize\expandafter{\LWR@sanitized}}% +} +% \end{macrocode} +% \end{macro} + + +% Sanitize some string options to neutralize underscores. +% \changes{v0.66}{2019/01/28}{Sanitize filenames.} +% \begin{macrocode} +\LWR@sanitize{\LWR@BaseJobname} +\edef\LWR@BaseJobname{\LWR@sanitized} + +\LWR@sanitize{\LWR@ImagesDirectory} +\edef\LWR@ImagesDirectory{\LWR@sanitized} + +\LWR@sanitize{\LWR@ImagesName} +\edef\LWR@ImagesName{\LWR@sanitized} +% \end{macrocode} +% +% +% +% \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. +% \changes{v0.19}{2016/06/06}{Replaces \cs{rowprintedonly}.} +% \begin{macrocode} +\newcommand{\warpprintonly}[1]{\ifbool{warpingprint}{#1}{}} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\warpHTMLonly} \marg{contents} +% +% Only process the contents if producing \HTML\ output. +% \changes{v0.19}{2016/06/06}{Added.} +% \begin{macrocode} +\newcommand{\warpHTMLonly}[1]{\ifbool{warpingHTML}{#1}{}} +% \end{macrocode} +% \end{macro} +% +% +% \DescribePackage{comment} Provides conditional code blocks. +% +% Attempts to use \pkg{versions} or \pkg{verbatim} fail in some cases, and do not +% provide much of a speed benefit even when they do work. +% +% \begin{macrocode} +\RequirePackage{comment} +% \end{macrocode} + + +% Use |comment_print.cut| for print mode, and +% |comment_html.cut| for \HTML\ mode. +% This helps \prog{latexmk} to more reliably know whether to recompile. +% +% \changes{v0.37}{2017/08/19}{\pkg{comment}: Maintains independent +% cutfiles for print, \HTML.} +% +% \begin{macrocode} +\ifbool{warpingHTML}{ +\def\DefaultCutFileName{\def\CommentCutFile{comment_html.cut}} +}{} + +\ifbool{warpingprint}{ +\def\DefaultCutFileName{\def\CommentCutFile{comment_print.cut}} +}{} +% \end{macrocode} + + +% \begin{environment}{warpall} +% Anything in the |warpall| environment will be generated for print or \HTML\ outputs. +% \begin{macrocode} +\includecomment{warpall} +% \end{macrocode} +% \end{environment} + + +% \begin{environment}{warpprint} +% \begin{environment}{warpHTML} +% Anything in the |warpprint| environment will be generated for print output only. +% +% For \HTML\ output: +% \begin{macrocode} +\ifbool{warpingHTML} +{\includecomment{warpHTML}} +{\excludecomment{warpHTML}}% +% \end{macrocode} + +% \begin{macrocode} +\ifbool{warpingprint} +{\includecomment{warpprint}} +{\excludecomment{warpprint}} +% \end{macrocode} + +% \end{environment} +% \end{environment} + + +% Optionally generate a local copy of \prog{lwarpmk}. +% Default to no. +% \begin{macrocode} +\ifbool{LWR@creatinglwarpmk} +{\includecomment{LWR@createlwarpmk}} +{\excludecomment{LWR@createlwarpmk}} +% \end{macrocode} +% +% +% +% +% + + + +% ^^A *required +% \section{Required packages} +% \label{sec:requiredpackages} +% \gindex{package>required} +% \changes{v0.16}{2016/04/08}{Lwarp no longer selects fonts.} + +% These packages are automatically loaded by \pkg{lwarp} when generating +% \HTML\ output. Some of them are also automatically loaded when +% generating print output, but some are not. +% +% \codehtml +% \begin{macrocode} +\begin{warpHTML} +% \end{macrocode} +% ^^A +% ^^A +% ^^A % For \XeTeX{} or \LuaLaTeX, use \pkg{fontspec}. +% ^^A % \marginpar{\textcolor{blue}{\XeTeX{} or \LuaLaTeX{} only:}} +% ^^A % +% ^^A % See:\\ +% ^^A % \href +% ^^A % {http://tex.stackexchange.com/questions/2984/frequently-loaded-packages-differences-between-pdflatex-and-xelatex} +% ^^A % {http://tex.stackexchange.com/questions/2984/\\ +% ^^A % \hspace*{.25in}frequently-loaded-packages-differences-between-pdflatex-and-xelatex} +% ^^A % +% ^^A % \gindex{font>during conversion} +% ^^A % For \XeLaTeX{} and \LuaLaTeX, uses DejaVu Serif for enhanced Cyrillic and Greek coverage. +% ^^A % \gindex{Unicode>XeLaTeX \& LuaLaTeX} +% ^^A +% ^^A +% +% Load \pkg{fontspec} if necessary: +% \changes{v0.50}{2018/02/24}{Fix: Load \pkg{fontspec} if necessary.} +% \begin{macrocode} +\ifxetexorluatex +\@ifpackageloaded{fontspec}{}{ + \usepackage[no-math]{fontspec} +} +% \end{macrocode} +% ^^A \defaultfontfeatures{Ligatures=Common} +% ^^A \setmainfont{DejaVu Serif} +% ^^A \setsansfont{DejaVu Sans} +% ^^A \setmonofont{DejaVu Sans Mono} +% The monospaced font is used for \HTML\ tags, +% so turn off its TeX ligatures and common ligatures: +% \begin{macrocode} +\defaultfontfeatures[\rmfamily]{Ligatures={NoCommon,TeX}} +\defaultfontfeatures[\sffamily]{Ligatures={NoCommon,TeX}} +\defaultfontfeatures[\ttfamily]{Ligatures=NoCommon} +\else +% \end{macrocode} +% ^^A % For \prog{pdflatex}, use \pkg{fontenc} and \pkg{lmodern}: +% ^^A % \marginpar{\textcolor{blue}{\prog{pdflatex} only:}} +% ^^A % \gindex{Unicode>pdfLaTeX} +% ^^A % \gindex{pdfLaTeX>Unicode support} +% ^^A % \begin{macrocode} +% ^^A \RequirePDFTeX % error if not pdflatex +% ^^A +% ^^A \input glyphtounicode.tex +% ^^A \input glyphtounicode-cmr.tex% from the pdfx package +% ^^A \pdfgentounicode=1 +% ^^A +% ^^A \usepackage{cmap}% help map Russian to unicode +% ^^A \defaulthyphenchar=127% +% ^^A % \end{macrocode} +% ^^A +% ^^A % \DescribePackage{lmodern} +% ^^A % +% ^^A % \pdflatexonly +% ^^A % +% ^^A % \prog{pdftotext} works better with a vector font. +% ^^A % This font choice does not control the \HTML\ file, but it does appear in the +% ^^A % images generated from math expressions. +% ^^A % \begin{macrocode} +% ^^A \RequirePackage{lmodern} +% ^^A % \end{macrocode} +% ^^A +% ^^A +% ^^A % \DescribePackage{fontenc} +% ^^A % +% ^^A % \pdflatexonly +% ^^A % +% ^^A % \begin{macrocode} +% ^^A \RequirePackage[T1]{fontenc} +% ^^A % \end{macrocode} +% ^^A +% ^^A +% ^^A % \DescribePackage{inputenc} +% ^^A % +% ^^A % \pdflatexonly +% ^^A % +% ^^A % \begin{macrocode} +% ^^A \RequirePackage[utf8]{inputenc} +% ^^A % \end{macrocode} +% ^^A + +% \pdflatexonly +% + +% \DescribePackage{microtype} +% \changes{v0.18}{2016/05/18}{Microtype disabled during \HTML\ generation} +% +% Older browsers don't +% \gindex{ligatures} +% display ligatures. +% \margintag{ligatures} +% Turn off letter ligatures, keeping +% \LaTeX{} dash and quote ligatures, which may fail on older browers +% but at least won't corrupt written words. +% \begin{macrocode} +\RequirePackage {microtype} + +\microtypesetup{ + protrusion=false, + expansion=false, + tracking=false, + kerning=false, + spacing=false} + +\DisableLigatures[f,q,t,T,Q]{encoding = *,family = *} +% \end{macrocode} +% ^^A +% ^^A +% ^^A % \DescribePackage{newunicodechar} +% ^^A % +% ^^A % +% ^^A % \pdflatexonly +% ^^A % +% ^^A % Note that the font used by the source code listing may not correctly display the +% ^^A % \watchout +% ^^A % actual Unicode character contained in the \cs{newunicode\{\}} expression. +% ^^A % The listing printout may not display ligatures or the dashes correctly. +% ^^A % \begin{macrocode} +% ^^A \RequirePackage{newunicodechar} +% ^^A \newunicodechar{Í}{\IeC {\'I}} +% ^^A \newunicodechar{ff}{ff}% ligatures +% ^^A \newunicodechar{fi}{fi} +% ^^A \newunicodechar{fl}{fl} +% ^^A \newunicodechar{ffi}{ffi} +% ^^A \newunicodechar{ffl}{ffl} +% ^^A %% \newunicodechar{°}{\degree} +% ^^A \newunicodechar{ρ}{\ensuremath{\rho}} +% ^^A \newunicodechar{⨯}{\texttimes} +% ^^A %% \newunicodechar{®}{\textregistered} +% ^^A %% \newunicodechar{©}{\textcopyright} +% ^^A \newunicodechar{—}{---}% emdash +% ^^A \newunicodechar{–}{--}% endash +% ^^A %% \newunicodechar{”}{''}% closing quote +% ^^A %% \newunicodechar{“}{``}% opening quote +% ^^A %% \newunicodechar{§}{\S} +% ^^A %% \newunicodechar{¶}{\P} +% ^^A %% \newunicodechar{†}{\dag} +% ^^A %% \newunicodechar{‡}{\ddag} +% ^^A % \end{macrocode} +% ^^A +% ^^A +% ^^A % \DescribePackage{textcomp} +% ^^A % +% ^^A % +% ^^A % \pdflatexonly +% ^^A % +% ^^A % Provides \cs{degree}, \cs{textquotesingle}, \cs{textmu}. +% ^^A % \begin{macrocode} +% ^^A \RequirePackage{textcomp} +% ^^A % \end{macrocode} +% ^^A +% \begin{macrocode} +\fi +% \end{macrocode} +% ^^A % \marginpar{\textcolor{blue}{End of \XeLaTeX, \LuaLaTeX, \pdfLaTeX\ choices.}} +% ^^A +% \begin{macrocode} +\end{warpHTML} +% \end{macrocode} + + +% \DescribePackage{geometry} +% Tactics to avoid unwanted page breaks and margin overflow: +% \begin{itemize} +% \item Uses a very long and wide page to minimize page breaks and margin overflow. +% \item Uses a scriptsize font. +% \item Uses extra space at the margin to avoid \HTML\ tag overflow off the page. +% \item Forces a new \PDF\ page before some environments. +% \item Forces line break between major pieces of long tags. +% \end{itemize} +% +% \changes{v0.20}{2017/01/12}{Page geometry set to 6in wide with large margins.} +% \changes{v0.27}{2017/04/04}{Page geometry modified to reduce line overflow.} +% \changes{v0.28}{2017/04/13}{Forced oneside to maintain large right margin.} +% \changes{v0.52}{2018/03/31}{Fix: MathJax script line wraps. Reduced right margin.} +% +% \codehtml +% \begin{macrocode} +\begin{warpHTML} +% \end{macrocode} +% +% \begin{macrocode} +\RequirePackage{geometry} +% \end{macrocode} +% +% Avoid class and option conflict by changing settings after package load: +% \changes{v0.63}{2018/11/24}{\pkg{geometry}: Fix for \pkg{bxjs*} classes.} +% \changes{v0.65}{2018/12/21}{\pkg{geometry}: Fix for \pkg{bxjs*} classes.} +% \begin{macrocode} +\geometry{ + paperheight=190in,% + paperwidth=20in,% + left=2in,right=6in,% + top=1in,bottom=1in,% +} +% \end{macrocode} +% +% \pkg{ltjtarticle} and other classes may require these to be reset by \pkg{lwarp}: +% \begin{macrocode} +\setlength{\textheight}{0.8\paperheight} +\setlength{\textwidth}{0.7\paperwidth} + +\@twosidefalse +\@mparswitchfalse + +\end{warpHTML} +% \end{macrocode} + + +% \codeall +% \begin{macrocode} +\begin{warpall} +% \end{macrocode} + +% \DescribePackage{xparse} +% +% \LaTeX{}3 command argument parsing +% ^^A \RequirePackage[log-declarations=false]{xparse} +% \begin{macrocode} +\RequirePackage{xparse} +% \end{macrocode} + +% \changes{v0.51}{2018/03/06}{\pkg{afterpackage}: No longer required.} + +% \DescribePackage{calc} +% \changes{v0.62}{2018/11/10}{\pkg{calc}: Fix: Required for print version.} +% \begin{macrocode} +\RequirePackage{calc} +% \end{macrocode} + +% \begin{macrocode} +\end{warpall} +% \end{macrocode} + + + +% \codehtml +% \begin{macrocode} +\begin{warpHTML} +% \end{macrocode} + +% \DescribePackage{expl3} +% +% \LaTeX{}3 programming +% \begin{macrocode} +\RequirePackage{expl3} +% \end{macrocode} + +% ^^A % \DescribePackage{l3regex} +% ^^A % +% ^^A % \LaTeX{}3 regular expression handling +% ^^A % \begin{macrocode} +% ^^A \RequirePackage{l3regex} +% ^^A % \end{macrocode} + + + +% ^^A % \begin{macro}{\EmulatesPackage} \marg{pkg name} \oarg{yyyy/mm/dd and comments} +% ^^A % +% ^^A % Similar to \cs{ProvidesPackage}. Used where the \pkg{lwarp} package emulates +% ^^A % other packages. +% ^^A % For example, \pkg{trivfloat} wants to load \pkg{float}, which is emulated by \pkg{lwarp}. +% ^^A % Since |\EmulatesPackage{float}| is declared by \pkg{lwarp}, +% ^^A % \pkg{trivfloat} will not load \pkg{float} on its own. +% ^^A % Doing so would have over-written the \pkg{lwarp} emulation. +% ^^A % +% ^^A % Do not use \cs{EmulatesPackage} for packages which are patched by other +% ^^A % \watchout +% ^^A % packages. The emulated code cannot be patched correctly. +% ^^A % +% ^^A % \begin{macrocode} +% ^^A \NewDocumentCommand{\EmulatesPackage}{m O{}}{% +% ^^A \expandafter\xdef\csname ver@#1.sty\endcsname{#2 --- +% ^^A Emulated by package \@currname.} +% ^^A } +% ^^A \@onlypreamble\EmulatesPackage +% ^^A % \end{macrocode} +% ^^A % \end{macro} +% ^^A + + +% \DescribePackage{gettitlestring} +% +% Used to emulate \cs{nameref}. +% \begin{macrocode} +\RequirePackage{gettitlestring} +% \end{macrocode} + + +% \DescribePackage{everyhook} +% +% \pkg{everyhook} is used to patch paragraph handling. +% +% \changes{v0.63}{2018/11/29}{\pkg{everyhook}: Fix for \pkg{bxjs*} classes.} +% \begin{macrocode} +\@ifundefined{bxjs@everypar}{}{\let\everypar\bxjs@everypar} + +\RequirePackage{everyhook} +\end{warpHTML} +% \end{macrocode} + + +% \codeall +% \begin{macrocode} +\begin{warpall} +% \end{macrocode} + +% \DescribePackage{filecontents} +% +% Used to write helper files, done in print mode. +% +% Patched to work with \pkg{morewrites}, per +% \href +% {https://tex.stackexchange.com/questions/312830/does-morewrites-not-support-filecontents-and-can-i-write-body-of-environment-us/312910} +% {\texttt{https://tex.stackexchange.com/questions/312830/\\ +% does-morewrites-not-support-filecontents-and-can-i-write-body-of-environment-us/\\ +% 312910}} +% +% \changes{v0.34}{2017/08/02}{\pkg{filecontents}: Required. Patched for \pkg{morewrites}.} +% +% \begin{macrocode} +\RequirePackage{filecontents} + +\@ifpackagelater{filecontents}{2011/10/09}% +{} +{ +\newwrite\fcwrite +\let\LWR@origfilec@ntents\filec@ntents +\def\filec@ntents{\def\chardef##1\write{\let\reserved@c\fcwrite}\LWR@origfilec@ntents} +} +% \end{macrocode} + +% \begin{macrocode} +\end{warpall} +% \end{macrocode} + + +% \codehtml +% \begin{macrocode} +\begin{warpHTML} +% \end{macrocode} + + +% \DescribePackage{xifthen} +% \begin{macrocode} +\RequirePackage{xifthen} +% \end{macrocode} + + +% \DescribePackage{verbatim} +% \begin{macrocode} +\RequirePackage{verbatim} +% \end{macrocode} + + +% \DescribePackage{refcount} +% +% Provides \cs{setcounterref}, \cs{setcounterpageref}, etc. +% \begin{macrocode} +\RequirePackage{refcount} +% \end{macrocode} + + +% \DescribePackage{newfloat} +% \begin{macrocode} +\RequirePackage{newfloat} +% \end{macrocode} + +% \changes{v0.24}{2017/03/06}{No longer preloads \pkg{subcaption}; +% conflicted with \pkg{subfig}.} + +% \begin{macrocode} +\end{warpHTML} +% \end{macrocode} + + +% \codeall +% \begin{macrocode} +\begin{warpall} +% \end{macrocode} + + +% \DescribePackage{xstring} +% There was a short-term bug in \pkg{xstring} regarding \cs{IfInteger} which affected +% \pkg{lwarp}'s index generation. The updated version is requested here. +% \trouble[index]{index>xstring=\pkg{xstring} bug} +% \trouble{index>numbers, not links} +% \trouble{xstring=\pkg{xstring}} +% \begin{macrocode} +\RequirePackage{xstring}[2019/02/01] +% \end{macrocode} + + +% \DescribePackage{environ} +% Used to encapsulate math environments for re-use in \HTML\ \element{alt} text. +% +% \begin{macrocode} +\RequirePackage{environ} +% \end{macrocode} + +% \begin{macrocode} +\end{warpall} +% \end{macrocode} + + +% \codehtml +% \begin{macrocode} +\begin{warpHTML} +% \end{macrocode} + + +% \changes{v0.40}{2017/09/07}{\pkg{xfrac}: No longer preloaded.} +% \changes{v0.66}{2019/01/27}{\pkg{zref}: No longer used.} + + +% \DescribePackage{printlen} +% Used to convert lengths for image width/height options. +% +% \begin{macrocode} +\RequirePackage{printlen} +% \end{macrocode} + +% \begin{macro}{\LWR@printlength} \marg{length} +% +% Prints a length using a locally-controlled unit and space. +% Rounding is used unless the length is small. +% +% \changes{v0.49}{2018/02/19}{Fix: Group \pkg{printlen} changes.} +% \begin{macrocode} +\newrobustcmd*{\LWR@printlength}[1]{% +\begingroup% +\uselengthunit{PT}% +\renewcommand*{\unitspace}{}% +\ifdimless{#1}{10pt}{% + \printlength{#1}% +}{% + \rndprintlength{#1}% +}% +\endgroup% +} +% \end{macrocode} +% \end{macro} + + +% \begin{macrocode} +\end{warpHTML} +% \end{macrocode} + + + +% \codeprint +% \begin{macrocode} +\begin{warpprint} +% \end{macrocode} + +% \DescribePackage{varwidth} +% Used for print-mode \env{lateximage}. +% \begin{macrocode} +\RequirePackage{varwidth} +% \end{macrocode} + +% \begin{macrocode} +\end{warpprint} +% \end{macrocode} + + + +% \section{Loading packages} +% +% +% \codeall +% \begin{macrocode} +\begin{warpall} +% \end{macrocode} + +% Remember the original \cs{RequirePackage}: +% \begin{macrocode} +\LetLtxMacro\LWR@origRequirePackage\RequirePackage +% \end{macrocode} + +% \begin{macro}{\LWR@requirepackagenames} +% Stores the list of required package names. +% \begin{macrocode} +\newcommand*{\LWR@requirepackagenames}{} +% \end{macrocode} +% \end{macro} + +% \begin{macro}{\LWR@parsedrequirepackagenames} +% Stores the parsed list of required package names +% after spaces are removed and |lwarp-| is prepended. +% \changes{v0.48}{2018/02/03}{Fix: Parsing similar package names.} +% \begin{macrocode} +\newcommand*{\LWR@parsedrequirepackagenames}{} +% \end{macrocode} +% \end{macro} + +% \begin{macro}{\LWR@nullifycomment} +% +% Remove the preexisting \env{comment} environment. +% Certain packages define it for their own use. +% +% \begin{macrocode} +\newcommand*{\LWR@nullifycomment}{% + \PackageInfo{lwarp}% + {Nullifying the comment environment before loading \LWR@strresulttwo,}% + \let\comment\relax% + \let\endcomment\relax% +} +% \end{macrocode} +% \end{macro} + +% \begin{macro}{\LWR@findword} \oarg{1: separator} \marg{2: list} +% \marg{3: index} \oarg{4: destination} +% +% Note that argument 4 is passed directly to \cs{StrBetween}. +% \begin{macrocode} +\newcommand*\LWR@findword[3][,]{% + \StrBetween[#3,\numexpr#3+1]{#1#2#1}{#1}{#1}% +} +% \end{macrocode} +% \end{macro} +% + + + +% ^^A *checkload +% \begin{macro}{\LWR@checkloadfilename} \marg{filename} +% Checks if this filename should be loaded after \pkg{lwarp}, +% or never at all. +% +% \changes{v0.63}{2018/12/02}{Added to reduce number of \filenm{lwarp-*} files.} +% \changes{v0.64}{2018/12/07}{Prevented \pkg{bitfield}, \pkg{doublespace}, +% \pkg{newthm}, \pkg{rplain}, \pkg{si}.} +% \changes{v0.66}{2019/01/04}{Prevented \pkg{colortab}, \pkg{epsf}, \pkg{hyper}, \pkg{picinpar}, +% \pkg{picins}, \pkg{sistyle}, \pkg{ucs}.} +% \changes{v0.68}{2019/02/26}{Prevented \pkg{alg}, \pkg{algorithmic}, \pkg{fncylab}, \pkg{pdfcprot}.} +% +% The following should never be loaded: +% \begin{macrocode} +\newcommand*{\LWR@checkloadfilename}[1]{% +\LWR@checkloadnever{#1}{ae}{latinmodern} +\LWR@checkloadnever{#1}{aecc}{latinmodern} +\LWR@checkloadnever{#1}{alg}{algorithm2e, algorithmicx} +\LWR@checkloadnever{#1}{algorithmic}{algorithm2e, algorithmicx} +\LWR@checkloadnever{#1}{bitfield}{bytefield} +\LWR@checkloadnever{#1}{boxedminipage}{boxedminipage2e} +\LWR@checkloadnever{#1}{caption2}{caption} +\LWR@checkloadnever{#1}{ccaption}{caption} +\LWR@checkloadnever{#1}{colortab}{colortbl} +\LWR@checkloadnever{#1}{doublespace}{setspace} +\LWR@checkloadnever{#1}{epsf}{graphicx} +\LWR@checkloadnever{#1}{fancyheadings}{fancyhdr} +\LWR@checkloadnever{#1}{fncylab}{cleveref} +\LWR@checkloadnever{#1}{glossary}{glossaries} +\LWR@checkloadnever{#1}{hyper}{hyperref} +\LWR@checkloadnever{#1}{newthm}{ntheorem} +\LWR@checkloadnever{#1}{pdfcprot}{microtype} +\LWR@checkloadnever{#1}{picinpar}{floatflt, wrapfig} +\LWR@checkloadnever{#1}{picins}{floatflt, wrapfig} +\LWR@checkloadnever{#1}{rplain}{fancyhdr} +\LWR@checkloadnever{#1}{si}{siunitx} +\LWR@checkloadnever{#1}{sistyle}{siunitx} +\LWR@checkloadnever{#1}{t1enc}{fontenc, inputenc, inputenx} +\LWR@checkloadnever{#1}{ucs}{inputenc, inputencx} +\LWR@checkloadnever{#1}{wasysym}{textcomp, amssymb, amsfonts, mnsymbol, fdsymbol} +% \end{macrocode} +% +% ^^A *loadbefore +% The following should only be loaded before \pkg{lwarp}: +% \begin{macrocode} +\LWR@checkloadbefore{#1}{ctex} +\LWR@checkloadbefore{#1}{fontspec} +\LWR@checkloadbefore{#1}{inputenc} +\LWR@checkloadbefore{#1}{inputenx} +\LWR@checkloadbefore{#1}{nfssext-cfr} +\LWR@checkloadbefore{#1}{fontaxes} +\LWR@checkloadbefore{#1}{kotex} +\LWR@checkloadbefore{#1}{luatexja} +\LWR@checkloadbefore{#1}{luatexja-fontspec} +\LWR@checkloadbefore{#1}{luatexko} +\LWR@checkloadbefore{#1}{morewrites} +\LWR@checkloadbefore{#1}{newclude} +\LWR@checkloadbefore{#1}{newunicodechar} +\LWR@checkloadbefore{#1}{plext} +\LWR@checkloadbefore{#1}{xeCJK} +\LWR@checkloadbefore{#1}{xetexko} +\LWR@checkloadbefore{#1}{zxjatype} +} +% \end{macrocode} +% \end{macro} + +% \begin{macro}{\LWR@lookforpackagename} \marg{index} +% +% If \HTML, and if this is an \pkg{lwarp}-supported package name, +% re-direct it to the \pkg{lwarp} version +% by renaming it |lwarp-| followed by the original name. +% +% Looks |index| deep into the list of package names, \cs{LWR@requirepackagenames}, and +% builds \cs{LWR@parsedrequirepackagenames} which is the modified list of names. +% \changes{v0.48}{2018/02/03}{Fix: Parsing similar package names.} +% \begin{macrocode} +\newcommand*{\LWR@lookforpackagename}[1]{% +% \end{macrocode} +% Find the |index|'th package name from the list: +% \begin{macrocode} +\LWR@findword{\LWR@requirepackagenames}{#1}[\LWR@strresult]% +% \end{macrocode} +% Remove blanks. +% The original name with blanks is in |LWR@strresult| and +% the final name with no blanks goes into |LWR@strresulttwo|. +% \begin{macrocode} +\StrSubstitute[100]{\LWR@strresult}{ }{}[\LWR@strresulttwo]% +% \end{macrocode} +% See if the package name was found: +% \begin{macrocode} +\IfStrEq{\LWR@strresulttwo}{}% +{}% no filename +{% yes filename was found +% \end{macrocode} +% Possible adjustments before loading the package. +% Maybe nullify the \env{comment} environment if the new package +% will be redefining it for a new purpose. +% \changes{v0.67}{2019/02/15}{\pkg{easyReview}: Supported.} +% \changes{v0.70}{2019/03/23}{\pkg{changes}: Updated to v3.1.2.} +% \begin{macrocode} + \ifdefstring{\LWR@strresulttwo}{easyReview}{\LWR@nullifycomment}{}% + \ifdefstring{\LWR@strresulttwo}{changes}{\LWR@nullifycomment}{}% +% \end{macrocode} +% If \HTML, check if the package should be loaded before \pkg{lwarp}, +% or never at all: +% \begin{macrocode} + \ifbool{warpingHTML}{\LWR@checkloadfilename{\LWR@strresulttwo}}{}% +% \end{macrocode} +% If \HTML, and if found, and if an \pkg{lwarp}-equivalent name exists, +% use |lwarp-|* instead. +% \begin{macrocode} + \ifboolexpr{ + bool{warpingHTML} and + test{\IfFileExists{lwarp-\LWR@strresulttwo.sty}} + }% + {% lwarp-* file found + \ifdefvoid{\LWR@parsedrequirepackagenames}{% + \edef\LWR@parsedrequirepackagenames{lwarp-\LWR@strresulttwo}% + }{% + \edef\LWR@parsedrequirepackagenames{% + \LWR@parsedrequirepackagenames,lwarp-\LWR@strresulttwo% + }% + }% + }% + {% +% \end{macrocode} +% Otherwise, use the current package name. +% \changes{v0.46}{2018/01/23}{Fix: Spaces in \cs{usepackage}.} +% \begin{macrocode} + \ifdefvoid{\LWR@parsedrequirepackagenames}{% + \edef\LWR@parsedrequirepackagenames{\LWR@strresulttwo}% + }{% + \edef\LWR@parsedrequirepackagenames{% + \LWR@parsedrequirepackagenames,\LWR@strresulttwo% + }% + }% + }% no lwarp-* file +}% yes filename +} +% \end{macrocode} +% \end{macro} + +% +% \begin{macro}{\RequirePackage} \oarg{1: options} \marg{2: package names} \oarg{3: version} +% +% For each of many package names in a comma-separated list, +% if an \pkg{lwarp} version of a package exists, +% select it instead of the \LaTeX\ version. +% +% \changes{v0.32}{2017/06/09}{Fix: Ignores blanks in package list.} +% +% \begin{macrocode} +\RenewDocumentCommand{\RequirePackage}{o m o}{% +% \end{macrocode} +% Redirect up to twenty names:\footnote{This was originally nine names, but +% then I came across a package which used twelve...} +% \changes{v0.61}{2018/10/02}{Support up to 20 packages.} +% \begin{macrocode} +\renewcommand*{\LWR@requirepackagenames}{#2}% +\renewcommand*{\LWR@parsedrequirepackagenames}{}% +\LWR@lookforpackagename{1}% +\LWR@lookforpackagename{2}% +\LWR@lookforpackagename{3}% +\LWR@lookforpackagename{4}% +\LWR@lookforpackagename{5}% +\LWR@lookforpackagename{6}% +\LWR@lookforpackagename{7}% +\LWR@lookforpackagename{8}% +\LWR@lookforpackagename{9}% +\LWR@lookforpackagename{10}% +\LWR@lookforpackagename{11}% +\LWR@lookforpackagename{12}% +\LWR@lookforpackagename{13}% +\LWR@lookforpackagename{14}% +\LWR@lookforpackagename{15}% +\LWR@lookforpackagename{16}% +\LWR@lookforpackagename{17}% +\LWR@lookforpackagename{18}% +\LWR@lookforpackagename{19}% +\LWR@lookforpackagename{20}% +% \end{macrocode} +% \cs{RequirePackage} depending on the options and version: +% \begin{macrocode} +\IfValueTF{#1}% +{% options given + \IfValueTF{#3}% version given? + {\LWR@origRequirePackage[#1]{\LWR@parsedrequirepackagenames}[#3]}% + {\LWR@origRequirePackage[#1]{\LWR@parsedrequirepackagenames}}% +}% +{% no options given + \IfValueTF{#3}% version given? + {\LWR@origRequirePackage{\LWR@parsedrequirepackagenames}[#3]}% + {\LWR@origRequirePackage{\LWR@parsedrequirepackagenames}}% +}% +} +\LetLtxMacro\usepackage\RequirePackage +% \end{macrocode} +% \end{macro} + +% \begin{macrocode} +\end{warpall} +% \end{macrocode} + + +% \codehtml +% \begin{macrocode} +\begin{warpHTML} +% \end{macrocode} + +% \begin{macro}{\LWR@ProvidesPackagePass} \marg{pkgname} \oarg{version} +% +% Uses the original package, including options. +% \begin{macrocode} +\NewDocumentCommand{\LWR@ProvidesPackagePass}{m o}{ +\PackageInfo{lwarp}{% + Using package `#1' and adding lwarp modifications,\MessageBreak + including options,}% +\IfValueTF{#2} +{\ProvidesPackage{lwarp-#1}[#2]} +{\ProvidesPackage{lwarp-#1}} +\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{#1}} +\ProcessOptions\relax +\IfValueTF{#2} +{\LWR@origRequirePackage{#1}[#2]} +{\LWR@origRequirePackage{#1}} +% \end{macrocode} +% In some cases, the following seems to be required +% to avoid an ``unknown option'' error, such +% as when loading \pkg{xcolor} with options. +% \changes{v0.62}{2018/11/11}{Fix: Unknown option error.} +% \begin{macrocode} +\DeclareOption*{}% +\ProcessOptions\relax +} +% \end{macrocode} +% \end{macro} + + +% \begin{macro}{\LWR@ProvidesPackageDrop} \marg{pkgname} \oarg{version} +% +% Ignores the original package and uses lwarp's version instead. +% Drops/discards all options. +% \begin{macrocode} +\NewDocumentCommand{\LWR@ProvidesPackageDrop}{m o}{ +\PackageInfo{lwarp}{% + Replacing package `#1' with the lwarp version,\MessageBreak + and discarding options,% +}% +\IfValueTF{#2} +{\ProvidesPackage{lwarp-#1}[#2]} +{\ProvidesPackage{lwarp-#1}} +% \end{macrocode} +% Ignore all options. +% \begin{macrocode} +\DeclareOption*{} +% \end{macrocode} +% Nullifies then processes the options. +% Seems to be required when options contain curly braces, which were causing +% ``|Missing \begin{document}|''. +% \changes{v0.48}{2018/02/04}{Fix: Options with braces.} +% \begin{macrocode} +% \ProcessOptions\relax% original LaTeX code +\let\ds@\@empty% from the original \ProcessOptions +\edef\@curroptions{}% lwarp modification to \ProcessOptions +\@process@ptions\relax% from the original \ProcessOptions +} +% \end{macrocode} +% \end{macro} + +% \begin{macrocode} +\end{warpHTML} +% \end{macrocode} + + + +% \section{Additional required packages} + +% \codehtml +% \begin{macrocode} +\begin{warpHTML} +% \end{macrocode} + +% \DescribePackage{caption} +% \changes{v0.47}{2018/01/29}{\pkg{caption}: Also loads \pkg{lwarp-caption}.} +% \changes{v0.66}{2018/12/29}{\pkg{caption}: Fix for options clash.} +% \begin{macrocode} +\LWR@origRequirePackage{caption} +\AtBeginDocument{\RequirePackage{lwarp-caption}}% +% \end{macrocode} + +% \begin{macrocode} +\end{warpHTML} +% \end{macrocode} + + + + +% \section{File handles} + +% Defines file handles for writes. + +% \changes{v0.37}{2017/08/19}{File handles reorganized.} + +% \codeall +% \begin{macrocode} +\begin{warpall} +% \end{macrocode} + +% \begin{macro}{\LWR@quickfile} +% For quick temporary use only. +% This is reused in several places. +% \begin{macrocode} +\newwrite\LWR@quickfile% +% \end{macrocode} +% \end{macro} + +% \begin{macrocode} +\end{warpall} +% \end{macrocode} + + +% \codehtml +% \begin{macrocode} +\begin{warpHTML} +% \end{macrocode} + +% \begin{macro}{\LWR@lateximagesfile} +% For \filenm{-images.txt}: +% \begin{macrocode} +\newwrite\LWR@lateximagesfile +% \end{macrocode} +% \end{macro} + +% \begin{macrocode} +\end{warpHTML} +% \end{macrocode} + + +% \section{Include a file} +% +% During \HTML\ output, |\include{}| causes the following to occur: +% +% \begin{enumerate} +% \item \pkg{lwarp} creates |_html_inc.tex| whose contents are: +% \begin{sourcedisplay} +% \cs{input} \textless{}filename\textgreater.tex +% \end{sourcedisplay} +% \item |_html_inc.tex| is then \cs{include}d instead of |.tex|. +% \item |_html_inc.aux| is automatically generated and used by \LaTeX. +% \end{enumerate} +% +% \codehtml +% \begin{macrocode} +\begin{warpHTML} +% \end{macrocode} + +% \begin{macro}{\@include} \marg{filename} Modified to load |_html_inc| files. +% +% (Below, \cs{clearpage} caused missing text, and was changed to \cs{newpage}.) +% +% \changes{v0.37}{2017/08/19}{Maintains independent \filenm{aux} files for \protect\HTML.} +% \changes{v0.73}{2019/06/20}{Fix: \cs{newpage} instead of \cs{clearpage}.} +% \begin{macrocode} +\def\@include#1 {% +\immediate\openout\LWR@quickfile #1_html_inc.tex% lwarp +\immediate\write\LWR@quickfile{\string\input{#1.tex}}% lwarp +\immediate\closeout\LWR@quickfile% lwarp +\LWR@orignewpage% changed from clearpage +\if@filesw + \immediate\write\@mainaux{\string\@input{#1_html_inc.aux}}% changed +\fi +\@tempswatrue +\if@partsw + \@tempswafalse + \edef\reserved@b{#1}% + \@for\reserved@a:=\@partlist\do + {\ifx\reserved@a\reserved@b\@tempswatrue\fi}% +\fi +\if@tempswa + \let\@auxout\@partaux + \if@filesw + \immediate\openout\@partaux #1_html_inc.aux % changed + \immediate\write\@partaux{\relax}% + \fi + \@input@{#1_html_inc.tex}% changed + \LWR@orignewpage% changed from clearpage + \@writeckpt{#1}% + \if@filesw + \immediate\closeout\@partaux + \fi +\else + \deadcycles\z@ + \@nameuse{cp@#1}% +\fi +\let\@auxout\@mainaux% +} +% \end{macrocode} +% \end{macro} + +% \begin{macrocode} +\end{warpHTML} +% \end{macrocode} + + + +% \section{Copying a file} + +% \codehtml +% \begin{macrocode} +\begin{warpHTML} +% \end{macrocode} + +% \begin{macro}{\LWR@copyfile} \marg{source filename} \marg{destination filename} +% +% Used to copy the |.toc| file to |.sidetoc| to re-print the \TOC\ in +% the side\TOC\ navigation pane. +% \begin{macrocode} +\newwrite\LWR@copyoutfile % open the file to write to +\newread\LWR@copyinfile % open the file to read from + +\newcommand*{\LWR@copyfile}[2]{% +\LWR@traceinfo{LWR@copyfile: copying #1 to #2} + +\immediate\openout\LWR@copyoutfile=#2 +\openin\LWR@copyinfile=#1 +\begingroup\endlinechar=-1 +\makeatletter + +\LWR@traceinfo{LWR@copyfile: about to loop} + +\loop\unless\ifeof\LWR@copyinfile + \LWR@traceinfo{LWR@copyfile: one line} + \read\LWR@copyinfile to\LWR@fileline % Read one line and store it into \LWR@fileline +% \LWR@fileline\par % print the content into the pdf +% print the content: + \immediate\write\LWR@copyoutfile{\unexpanded\expandafter{\LWR@fileline}}% +\repeat +\immediate\closeout\LWR@copyoutfile +\LWR@traceinfo{LWR@copyfile: done} +\endgroup +} +% \end{macrocode} +% \end{macro} + +% \begin{macrocode} +\end{warpHTML} +% \end{macrocode} + + +% \section{Debugging messages} +% \label{sec:debuggingmessages} +% +% \gindex{HTML>conversion settings>debug comments} +% \gindex{tracing log} +% \gindex{debugging>HTML debug comments} +% \gindex{debugging>tracing log} +% \gindex{troubleshooting>HTML debug comments} +% \gindex{troubleshooting>tracing log} +% +% \changes{v0.61}{2018/09/25}{Docs: HTMLDebugComments} +% +% To have the \HTML\ output include additional \HTML\ comments, such as +% \margintag{\HTML\ comments} +% which \element{div} is closing, use +% \begin{sourcedisplay} +% \cs{booltrue\{HTMLDebugComments\}} +% \end{sourcedisplay} +% +% \changes{v0.61}{2018/09/25}{Docs: \cs{tracinglwarp}} +% +% To have debug information written to the log, +% \margintag{debugging information} +% use +% \begin{sourcedisplay} +% \cs{tracinglwarp} +% \end{sourcedisplay} +% +% \codeall +% \begin{macrocode} +\begin{warpall} +% \end{macrocode} + +% \DescribeBoolean{LWR@tracinglwarp} True if tracing is turned on. +% \begin{macrocode} +\newbool{LWR@tracinglwarp} +% \end{macrocode} +% +% \begin{macro}{\tracinglwarp} Turns on the debug tracing messages. +% \changes{v0.20}{2017/02/07}{Added.} +% \begin{macrocode} +\newcommand{\tracinglwarp}{\booltrue{LWR@tracinglwarp}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\LWR@traceinfo} \marg{text} \quad If tracing is turned on, writes +% the text to the |.log| file. +% \begin{macrocode} +\newcommand{\LWR@traceinfo}[1]{% +\ifbool{LWR@tracinglwarp}% +{% + \typeout{*** lwarp: #1}% +}% +{}% +} +% \end{macrocode} +% \end{macro} + + +% \DescribeBoolean{HTMLDebugComments} \DescribeDefault{false} +% Add comments in \HTML\ +% about closing \element{div}s, sections, etc. +% +% \changes{v0.28}{2017/04/09}{Added boolean \progcode{HTMLDebugComments}.} +% +% \begin{macrocode} +\newbool{HTMLDebugComments} +\boolfalse{HTMLDebugComments} +% \end{macrocode} + + + +% If \cs{tracinglwarp}, show where preamble hooks occur: +% \begin{macrocode} +\AfterEndPreamble{ +\LWR@traceinfo{AfterEndPreamble} +} + +\AtBeginDocument{ +\LWR@traceinfo{AtBeginDocument} +} +% \end{macrocode} + +% \begin{macrocode} +\end{warpall} +% \end{macrocode} + + + +% \section{Defining print and \HTML\ versions of macros and environments} +% \label{sec:definingprinthtml} +% \gindex{print>selecting print/HTML definitions} +% \gindex{HTML>selecting print/HTML definitions} +% +% The following refers to defining objects inside \pkg{lwarp}, and is not +% for the user's document. +% +% Many macros and environments must be provided as both print and \HTML\ versions. +% +% While generating the print version of a document, the original macros +% as defined by \LaTeX\ and its packages are used as-is. +% +% While generating the \HTML\ version of a document, +% the original macro or environment is redefined to call a new \HTML\ version +% or a copy of the original print version. +% The new \HTML\ versions of macros and environments are used most of the time. +% Copies of the print versions are used inside a \env{lateximage} environment, +% which draws and remembers an image of the printed output, and also several +% other places. The copies of the print versions may also be used by the \HTML\ +% versions, such as when the \HTML\ version merely encloses the print version +% inside \HTML\ tags. +% +% The general structure for providing print and \HTML\ versions of a macro or +% environment is as follows: +% +% \begin{description} +% +% \item[For a preexisting macro, not defined with \pkg{xparse}:] An \HTML\ version +% is provided with a special name, inside a \env{warpHTML} environment, +% then \cs{LWR@formatted} is used to redefine and patch various macros: +% \begin{Verbatim}[gobble=2,obeytabs,tabsize=4,frame=lines] +% \begin{warpHTML} +% \newcommand{\LWR@HTML@name}{...}% may also use xparse +% +% \LWR@formatted{name} +% \end{warpHTML} +% \end{Verbatim} +% |\LWR@formatted{name}| copies the original print version, +% then redefines \cs{name} to use either the print or \HTML\ version depending +% on which mode \pkg{lwarp} is using. \pkg{xparse} may be used to +% define the new \HTML\ version, even if the original did not use \pkg{xparse}. + +% \item[For a preexisiting environment, not defined with \pkg{xparse}:] The process +% is similar. Note the use of \cs{LWR@formattedenv} instead of \cs{LWR@formatted}. +% \begin{Verbatim}[gobble=2,obeytabs,tabsize=4,frame=lines] +% \begin{warpHTML} +% \newenvironment{LWR@HTML@name}{...}% may also use xparse +% +% \LWR@formattedenv{name} +% \end{warpHTML} +% \end{Verbatim} + +% \item[If the original used \pkg{xparse}:] A copy must be made using a new name: +% \begin{Verbatim}[gobble=2,obeytabs,tabsize=4,frame=lines] +% \begin{warpHTML} +% \NewDocumentCommand{\LWR@print@name}{..}{..}% copy the original +% +% \NewDocumentCommand{\LWR@HTML@name}{..}{..}% or use \newcommand +% +% \LWR@formatted{name} +% \end{warpHTML} +% \end{Verbatim} +% Similar for an environment, using \cs{LWR@formattedenv}. +% (\cs{LWR@formatted} and \cs{LWR@formattedenv} use \cs{LetLtxMacro} to +% copy the original print definiton, +% which may not work with macros and environments created by \pkg{xparse}, +% so the print version must be manually recreated in the \pkg{lwarp} source.) + +% \item[For a new macro or environment, not using \pkg{xparse} for the print version:] \ +% \begin{Verbatim}[gobble=2,obeytabs,tabsize=4,frame=lines] +% \begin{warpall} +% \newcommand{\name}{...}% NOT xparse! +% \end{warpall} +% +% \begin{warpHTML} +% \newcommand{\LWR@HTML@name}{...}% may use xparse for HTML +% +% \LWR@formatted{name} +% \end{warpHTML} +% \end{Verbatim} +% Similar for an environment. +% The plain \cs{name} or environment \env{name} is used for the printed +% version, and is placed inside \env{warpall}. +% \pkg{xparse} may be used for the \cs{LWR@HTML@} version. +% +% \item [For a new macro or environment, using \pkg{xparse}:] +% It is possible to use \pkg{xparse} for an entirely new macro or environment +% by defining the \cs{LWR@print@} version with \pkg{xparse}, along with +% \cs{name} defined without \pkg{xparse} to refer directly to the \cs{LWR@print} +% version: +% \begin{Verbatim}[gobble=2,obeytabs,tabsize=4,frame=lines] +% \begin{warpall} +% \NewDocumentCommand{\LWR@print@name}{...} {...}% -or- +% \NewDocumentEnvironment{\LWR@print@name}{...} {...} {...} +% +% % Simply a call to \LWR@print@name: +% \newcommand{\name}{\LWR@print@name}% -or- +% \newenvironment{name}{\LWR@print@name}{\endLWR@print@name} +% \end{warpall} +% +% \begin{warpHTML} +% \NewDocumentCommand{\LWR@HTML@name}{...} {...}% -or- +% \NewDocumentEnvironment{\LWR@HTML@name}{...} {...} {...} +% +% \LWR@formatted{name}% -or- +% \LWR@formattedenv{name} +% \end{warpHTML} +% \end{Verbatim} +% +% \end{description} +% +% In general, \cs{LWR@formatted} or \cs{LWR@formattedenv} are placed inside +% a \env{warpHTML} environment, and while producing an \HTML\ document +% they do the following: +% \begin{itemize} +% \item Macros are modified: +% \begin{enumerate} +% \item The pre-existing print version \cs{name} is saved as \cs{LWR@print@}, +% unless \cs{LWR@print@} is already defined. +% \item The original \cs{name} is redefined to call either the print or \HTML\ version +% depending on which format is in use at the moment, as set by \cs{LWR@formatting}, +% which is defined as either ``|print|'' or ``|HTML|''. +% \end{enumerate} +% \item When \pkg{lwarp} is producing a print document, the original definitions are +% used, as well as any new definitions defined in \env{warpall} above. +% \item When \pkg{lwarp} is generating \HTML\ output, \cs{LWR@formatting} is +% set to ``|HTML|'', and \cs{name} is directed to \cs{LWR@HTML@}. +% \item When \pkg{lwarp} is generating \HTML\ output +% but enters a \env{lateximage} environment, +% or for some other reason needs to draw images using the original print +% defintions, \cs{LWR@formatting} is changed to ``|print|'' and \cs{name} is +% then redirected to \cs{LWR@print@}, which was the original \cs{name}. +% \end{itemize} +% +% Since arguments are not handled by the new \cs{name}, any star and other arguments +% are processed by the print or \HTML\ version. +% +% Expandable versions are also provided as well. +% These usually are necessary for anything which could appear inside a \env{tabular}, +% without which a ``|Misplaced \omit|'' error may occur. +% \trouble[Misplaced \cs{omit} error]{Misplaced \cs{omit}>tabular} +% \begin{sourcedisplay} +% \cs{LWR@expandableformatted} \\ +% \cs{LWR@expandableformattedenv} +% \end{sourcedisplay} +% +% (Older versions of \pkg{lwarp} used \cs{LetLtxMacro} for everything, +% but this could fail when using macros defined by \pkg{xparse}. +% This older system is still in use for many definitions.) +% ^^A *8* Modify the above when all old \lets are removed. +% +% \changes{v0.57}{2018/05/28}{New system for switching print and \HTML\ outputs.} +% +% \codehtml +% \begin{macrocode} +\begin{warpHTML} +% \end{macrocode} +% +% +% \begin{macro}{\LWR@formatting} Remembers if selected print/\HTML\ formatting. +% +% Used while \cs{LWR@restoreorigformatting}, such as in an \env{lateximage}. +% May be set to either ``|print|'' or ``|HTML|''. +% +% \begin{macrocode} +\newcommand*{\LWR@formatting}{HTML} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\LWR@formatted} \marg{macroname} \qquad No backslash in the macro name. +% +% If not yet defined, defines \cs{LWR@print@} as +% the original print-mode \cs{}. +% Also redefines \cs{} to use \cs{LWR@@}, +% where is set by \cs{LWR@formatting}, and is |print| or |HTML|. +% +% \begin{macrocode} +\newcommand*{\LWR@formatted}[1]{% + \ifcsundef{LWR@print@#1}{% + \expandafter\LetLtxMacro\csname LWR@print@#1\expandafter\endcsname% + \csname#1\endcsname% + }{}% + \ifcsundef{#1}{% + \expandafter\newrobustcmd\csname #1\endcsname{% + \@nameuse{LWR@\LWR@formatting @#1}% + }% + }{% + \expandafter\renewrobustcmd\csname #1\endcsname{% + \@nameuse{LWR@\LWR@formatting @#1}% + }% + }% +} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\LWR@expandableformatted} \marg{macroname} \qquad No backslash +% in the macro name. +% +% An expandable version of \cs{LWR@formatted}. +% +% \begin{macrocode} +\newcommand*{\LWR@expandableformatted}[1]{% + \ifcsundef{LWR@print@#1}{% + \expandafter\LetLtxMacro\csname LWR@print@#1\expandafter\endcsname% + \csname#1\endcsname% + }{}% + \ifcsundef{#1}{% + \expandafter\newcommand\csname #1\endcsname{% + \@nameuse{LWR@\LWR@formatting @#1}% + }% + }{% + \expandafter\renewcommand\csname #1\endcsname{% + \@nameuse{LWR@\LWR@formatting @#1}% + }% + }% +} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\LWR@formattedenv} \marg{environmentname} +% +% If not yet defined, defines the environment \env{LWR@print@} as +% the original print-mode \env{}. +% Also redefines the environment || to use environment |LWR@@|, +% where is set by \cs{LWR@formatting}, and is |print| or |HTML|. +% +% \begin{macrocode} +\newcommand*{\LWR@formattedenv}[1]{% + \ifcsundef{LWR@print@#1}{% + \expandafter\LetLtxMacro\csname LWR@print@#1\expandafter\endcsname% + \csname#1\endcsname% + \csletcs{endLWR@print@#1}{end#1}% + }{}% + \DeclareDocumentEnvironment{#1}{}% + {% + \@nameuse{LWR@\LWR@formatting @#1}% + }% + {% + \@nameuse{endLWR@\LWR@formatting @#1}% + }% +} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\LWR@expandableformattedenv} \marg{environmentname} +% +% An expandable version of \env{LWR@formattedenv}. +% +% \begin{macrocode} +\newcommand*{\LWR@expandableformattedenv}[1]{% + \ifcsundef{LWR@print@#1}{% + \expandafter\LetLtxMacro\csname LWR@print@#1\expandafter\endcsname% + \csname#1\endcsname% + \csletcs{endLWR@print@#1}{end#1}% + }{}% + \DeclareExpandableDocumentEnvironment{#1}{}% + {% + \@nameuse{LWR@\LWR@formatting @#1}% + }% + {% + \@nameuse{endLWR@\LWR@formatting @#1}% + }% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +\end{warpHTML} +% \end{macrocode} + + + + +% \section{\HTML-conversion output modifications} +% +% These booleans modify the \HTML\ output in various ways +% to improve conversion to \EPUB\ or word processor imports. +% +% \codeall +% \begin{macrocode} +\begin{warpall} +% \end{macrocode} +% +% \subsection{User-level controls} +% +% \DescribeBoolean{FormatEPUB} \DescribeDefault{false} +% Changes \HTML\ output for easy \EPUB\ conversion +% via an external program. Removes per-file headers, footers, and nav. +% Adds footnotes per chapter/section. +% \gindex{EPUB>HTML conversion settings} +% \gindex{HTML>conversion settings>EPUB} +% +% \changes{v0.28}{2017/04/09}{Added boolean \progcode{FormatEPUB}.} +% +% \begin{macrocode} +\newbool{FormatEPUB} +\boolfalse{FormatEPUB} +% \end{macrocode} +% +% +% \DescribeBoolean{FormatWP} \DescribeDefault{false} +% Changes \HTML\ output for easier conversion +% by a word processor. +% Removes headers and nav, prints footnotes per section, +% and also forces single-file output and turns off \HTML\ debug +% comments. +% \gindex{word processor>HTML conversion settings} +% \gindex{HTML>conversion settings>word processor} +% +% \changes{v0.28}{2017/04/09}{Added boolean \progcode{FormatWP}.} +% +% \begin{macrocode} +\newbool{FormatWP} +\boolfalse{FormatWP} +% \end{macrocode} +% +% +% \DescribeBoolean{WPMarkFloats} \DescribeDefault{false} +% \describeWPMarkFloats +% \footnote{Perhaps some day word processors will have \HTML\ import options +% for identifying \element{figure} and caption tags +% for figures and tables.} +% \gindex{word processor>HTML conversion settings} +% \gindex{HTML>conversion settings>word processor} +% +% \changes{v0.28}{2017/04/09}{Added boolean \progcode{HTMLMarkFloats}, changed +% to \progcode{WPMarkFloats} as of v0.42.} +% +% \begin{macrocode} +\newbool{WPMarkFloats} +\boolfalse{WPMarkFloats} +% \end{macrocode} + +% \DescribeBoolean{WPMarkMinipages} \DescribeDefault{false} +% \changes{v0.42}{2017/10/18}{Added boolean \progcode{WPMarkMinipages}.} +% \describeWPMarkMinipages +% \begin{macrocode} +\newbool{WPMarkMinipages} +\boolfalse{WPMarkMinipages} +% \end{macrocode} + +% \DescribeBoolean{WPMarkTOC} \DescribeDefault{true} +% \changes{v0.42}{2017/10/18}{Added boolean \progcode{WPMarkTOC}.} +% \describeWPMarkTOC +% \begin{macrocode} +\newbool{WPMarkTOC} +\booltrue{WPMarkTOC} +% \end{macrocode} + + +% \DescribeBoolean{WPMarkLOFT} \DescribeDefault{false} +% \changes{v0.42}{2017/10/19}{Added boolean \progcode{WPMarkLOFT}.} +% \describeWPMarkLOFT +% \begin{macrocode} +\newbool{WPMarkLOFT} +\boolfalse{WPMarkLOFT} +% \end{macrocode} + + +% \DescribeBoolean{WPMarkMath} \DescribeDefault{false} +% \changes{v0.42}{2017/10/19}{Added boolean \progcode{WPMarkMath}.} +% \describeWPMarkMath +% \begin{macrocode} +\newbool{WPMarkMath} +\boolfalse{WPMarkMath} +% \end{macrocode} + + +% \DescribeBoolean{WPTitleHeading} \DescribeDefault{false} +% \changes{v0.42}{2017/10/19}{Added boolean \progcode{WPTitleHeading}.} +% \describeWPTitleHeading +% \begin{macrocode} +\newbool{WPTitleHeading} +\boolfalse{WPTitleHeading} +% \end{macrocode} + +% \begin{macrocode} +\end{warpall} +% \end{macrocode} + +% +% \subsection{Heading adjustments} +% +% \changes{v0.42}{2017/10/19}{If \progcode{FormatWP}, +% shift section headings.} +% If formatting the \HTML\ for a word processor, adjust heading levels. +% +% If |WPTitleHeading| is true, adjust so that |part| is \UI{Heading~1}. +% +% If |WPTitleHeading| is false, use \element{h1} for the title, +% and set |part| to \UI{Heading~2}. +% +% +% \codehtml +% \begin{macrocode} +\begin{warpHTML} +% \end{macrocode} +% +% \begin{macrocode} +\AtBeginDocument{ +\ifbool{FormatWP}{ +\@ifundefined{chapter}{ +\ifbool{WPTitleHeading}{% part and section starting at h2 +\renewcommand*{\LWR@tagtitle}{h1} +\renewcommand*{\LWR@tagtitleend}{/h1} +\renewcommand*{\LWR@tagpart}{h2} +\renewcommand*{\LWR@tagpartend}{/h2} +\renewcommand*{\LWR@tagsection}{h3} +\renewcommand*{\LWR@tagsectionend}{/h3} +\renewcommand*{\LWR@tagsubsection}{h4} +\renewcommand*{\LWR@tagsubsectionend}{/h4} +\renewcommand*{\LWR@tagsubsubsection}{h5} +\renewcommand*{\LWR@tagsubsubsectionend}{/h5} +\renewcommand*{\LWR@tagparagraph}{h6} +\renewcommand*{\LWR@tagparagraphend}{/h6} +\renewcommand*{\LWR@tagsubparagraph}{span class="subparagraph"} +\renewcommand*{\LWR@tagsubparagraphend}{/span} +}% WPTitleHeading +{% not WPTitleHeading, part and section starting at h1 +\renewcommand*{\LWR@tagtitle}{div class="title"} +\renewcommand*{\LWR@tagtitleend}{/div} +\renewcommand*{\LWR@tagpart}{h1} +\renewcommand*{\LWR@tagpartend}{/h1} +\renewcommand*{\LWR@tagsection}{h2} +\renewcommand*{\LWR@tagsectionend}{/h2} +\renewcommand*{\LWR@tagsubsection}{h3} +\renewcommand*{\LWR@tagsubsectionend}{/h3} +\renewcommand*{\LWR@tagsubsubsection}{h4} +\renewcommand*{\LWR@tagsubsubsectionend}{/h4} +\renewcommand*{\LWR@tagparagraph}{h5} +\renewcommand*{\LWR@tagparagraphend}{/h5} +\renewcommand*{\LWR@tagsubparagraph}{h6} +\renewcommand*{\LWR@tagsubparagraphend}{/h6} +}% not WPTitleHeading +}% chapter undefined +{% chapter defined +\ifbool{WPTitleHeading}{} +{% not WPTitleHeading, part and chapter starting at h1 +\renewcommand*{\LWR@tagtitle}{div class="title"} +\renewcommand*{\LWR@tagtitleend}{/div} +\renewcommand*{\LWR@tagpart}{h1} +\renewcommand*{\LWR@tagpartend}{/h1} +\renewcommand*{\LWR@tagchapter}{h2} +\renewcommand*{\LWR@tagchapterend}{/h2} +\renewcommand*{\LWR@tagsection}{h3} +\renewcommand*{\LWR@tagsectionend}{/h3} +\renewcommand*{\LWR@tagsubsection}{h4} +\renewcommand*{\LWR@tagsubsectionend}{/h4} +\renewcommand*{\LWR@tagsubsubsection}{h5} +\renewcommand*{\LWR@tagsubsubsectionend}{/h5} +\renewcommand*{\LWR@tagparagraph}{h6} +\renewcommand*{\LWR@tagparagraphend}{/h6} +\renewcommand*{\LWR@tagsubparagraph}{span class="subparagraph"} +\renewcommand*{\LWR@tagsubparagraphend}{/span} +}% not WPTitleHeading +}% chapter defined +}{}% FormatWP +}% AtBeginDocument +% \end{macrocode} + +% \begin{macrocode} +\end{warpHTML} +% \end{macrocode} + + +% \section{Remembering original formatting macros} + +% \codehtml +% \begin{macrocode} +\begin{warpHTML} +% \end{macrocode} + + +% Remember original definitions of formatting commands. +% Will be changed to \HTML\ commands for most uses. +% Will be temporarily restored to original meaning inside any lateximage environment. +% Also nullify unused commands. +% +% Some packages redefine \cs{\#}, which is used to generate \HTML, so the original must +% be remembered here. +% \changes{v0.51}{2018/03/12}{Fix: Remember original \cs{\#} in case is redefined.} +% \changes{v0.72}{2019/05/24}{Use \cs{LWR@formatted} for \cs{bfseries}, etc.} +% \begin{macrocode} +\chardef\LWR@origpound=`\# +% \end{macrocode} +% \begin{macrocode} +\let\LWR@origcomma\, +\let\LWR@origthinspace\thinspace +\let\LWR@orignegthinspace\negthinspace +\let\LWR@origtilde~ +\let\LWR@origenskip\enskip +\let\LWR@origquad\quad +\let\LWR@origqquad\qquad +\let\LWR@orighfil\hfil +\let\LWR@orighss\hss +\let\LWR@origllap\llap +\let\LWR@origrlap\rlap +\let\LWR@orighfilneg\hfilneg +\let\LWR@orighspace\hspace + +\let\LWR@origrule\rule + +\let\LWR@origmedskip\medskip +\let\LWR@origbigskip\bigskip + +\let\LWR@origtextellipsis\textellipsis +\let\LWR@orig@textquotedbl\textquotedbl + +\LetLtxMacro\LWR@origttfamily\ttfamily + +\LetLtxMacro\LWR@origem\em +\LetLtxMacro\LWR@orignormalfont\normalfont + +\let\LWR@origonecolumn\onecolumn + +\let\LWR@origsp\sp +\let\LWR@origsb\sb +\LetLtxMacro\LWR@origtextsuperscript\textsuperscript +\LetLtxMacro\LWR@orig@textsuperscript\@textsuperscript + +\AtBeginDocument{ +\LetLtxMacro\LWR@origtextsubscript\textsubscript +\LetLtxMacro\LWR@orig@textsubscript\@textsubscript +} + +\LetLtxMacro\LWR@origunderline\underline +% \end{macrocode} +% +% \begin{macrocode} +\let\LWR@orignewpage\newpage + +\let\LWR@origpagestyle\pagestyle +\let\LWR@origthispagestyle\thispagestyle +\LetLtxMacro\LWR@origpagenumbering\pagenumbering + +\let\LWR@orignewline\newline + + +\AtBeginDocument{% in case packages change definition +\let\LWR@orig@trivlist\@trivlist +\let\LWR@origtrivlist\trivlist +\let\LWR@origendtrivlist\endtrivlist +\LetLtxMacro\LWR@origitem\item +\LetLtxMacro\LWR@origitemize\itemize +\LetLtxMacro\LWR@endorigitemize\enditemize +\LetLtxMacro\LWR@origenumerate\enumerate +\LetLtxMacro\LWR@endorigenumerate\endenumerate +\LetLtxMacro\LWR@origdescription\description +\LetLtxMacro\LWR@endorigdescription\enddescription +\let\LWR@orig@mklab\@mklab +\let\LWR@origmakelabel\makelabel +\let\LWR@orig@donoparitem\@donoparitem +\LetLtxMacro\LWR@orig@item\@item +\let\LWR@orig@nbitem\@nbitem +} + +\let\LWR@origpar\par + +\LetLtxMacro\LWR@origfootnote\footnote +\let\LWR@orig@mpfootnotetext\@mpfootnotetext + + +\AtBeginDocument{% in case packages change definition +\LetLtxMacro\LWR@orighline\hline% +\LetLtxMacro\LWR@origcline\cline% +} +% \end{macrocode} + +% \begin{macrocode} +\end{warpHTML} +% \end{macrocode} + + + +% \section{Accents} +% +% \limitsaccents +% +% \changes{v0.37}{2017/08/18}{\protect\LaTeX\ accents: Added.} +% +% \codehtml +% \begin{macrocode} +\begin{warpHTML} +% \end{macrocode} +% +% +% Without \cs{AtBeginDocument}, \cs{t} was being re-defined somewhere. +% \begin{macrocode} +\AtBeginDocument{ +% \end{macrocode} +% The following are restored for print when inside a \env{lateximage}. +% +% For Unicode engines, only \cs{t} needs to be redefined: +% \begin{macrocode} +\LetLtxMacro\LWR@origt\t +% \end{macrocode} +% For pdf\LaTeX, additional work is required: +% \begin{macrocode} +\ifPDFTeX% pdflatex or dvi latex +\LetLtxMacro\LWR@origequalaccent\= +\LetLtxMacro\LWR@origdotaccent\. +\LetLtxMacro\LWR@origu\u +\LetLtxMacro\LWR@origv\v +\LetLtxMacro\LWR@origc\c +\LetLtxMacro\LWR@origd\d +\LetLtxMacro\LWR@origb\b +% \end{macrocode} +% The \HTML\ redefinitions follow. +% +% For pdf\LaTeX, Unicode diacritical marks are used: +% \begin{macrocode} +\renewcommand*{\=}[1]{#1\HTMLunicode{0305}} +\renewcommand*{\.}[1]{#1\HTMLunicode{0307}} +\renewcommand*{\u}[1]{#1\HTMLunicode{0306}} +\renewcommand*{\v}[1]{#1\HTMLunicode{030C}} +\renewcommand*{\c}[1]{#1\HTMLunicode{0327}} +\renewcommand*{\d}[1]{#1\HTMLunicode{0323}} +\renewcommand*{\b}[1]{#1\HTMLunicode{0331}} +\fi +% \end{macrocode} +% For all engines, a Unicode diacritical tie is used: +% \begin{macrocode} +\def\LWR@t#1#2{#1\HTMLunicode{0361}#2} +\renewcommand*{\t}[1]{\LWR@t#1} +% \end{macrocode} +% +% \begin{macro}{\LWR@restoreorigaccents} +% Called from \cs{restoreoriginalformatting} when a \env{lateximage} is begun. +% \begin{macrocode} +\ifPDFTeX% pdflatex or dvi latex +\newcommand*{\LWR@restoreorigaccents}{% +\LetLtxMacro\=\LWR@origequalaccent% +\LetLtxMacro\.\LWR@origdotaccent% +\LetLtxMacro\u\LWR@origu% +\LetLtxMacro\v\LWR@origu% +\LetLtxMacro\t\LWR@origt% +\LetLtxMacro\c\LWR@origc% +\LetLtxMacro\d\LWR@origd% +\LetLtxMacro\b\LWR@origb% +}% +\else% XeLaTeX, LuaLaTeX: +\newcommand*{\LWR@restoreorigaccents}{% +\LetLtxMacro\t\LWR@origt% +}% +\fi% +}% AtBeginDocument +% \end{macrocode} +% \end{macro} +% +% +% +% \begin{macrocode} +\end{warpHTML} +% \end{macrocode} + + + + + +% \section{Configuration files} + +% \changes{v0.20}{2016/12/20}{\pkg{lwarp-newproject}: Added.} +% \changes{v0.30}{2017/04/27}{\pkg{lwarp-newproject} removed, and combined with \pkg{lwarp}.} + + + +% \subsection{Decide whether to generate configuration files} + +% Configuration files are only written if processing the print version of the document, +% and not processing a \pkg{pstool} image. +% \pkg{pstool} uses an additional compile for each image using the original +% document's preamble, which includes \pkg{lwarp}, so the \pkg{lwarp} +% configuration files are turned off if \filenm{-pstool} is part of the \cs{jobname}. +% +% Default to no configuration files: +% \changes{v0.61}{2018/10/02}{Don't write configuration files if processing \pkg{pstool} image.} +% \begin{macrocode} +\excludecomment{LWRwriteconf} +% \end{macrocode} +% +% Generate configuration files if print mode and not \filenm{-pstool}: +% +% \codeprint +% \begin{macrocode} +\begin{warpprint} +\fullexpandarg% +\IfSubStr*{\jobname}{-pstool} + { + \PackageInfo{lwarp}{% + Jobname with -pstool is found.\MessageBreak + Not generating lwarp configuration files,% + } + } + { + \PackageInfo{lwarp}{Generating lwarp configuration files,}% + \includecomment{LWRwriteconf} + } +\end{warpprint} +% \end{macrocode} + + +% \subsection{\filenm{_html.tex}} +% +% \DescribeFile{*_html.tex} Used to allow an \HTML\ version of the +% document to exist alongside the print version. +% +% \codeconfig +% \begin{macrocode} +\begin{LWRwriteconf} +\immediate\openout\LWR@quickfile=\jobname_html.tex +\immediate\write\LWR@quickfile{% +\detokenize{\PassOptionsToPackage}% +{warpHTML,BaseJobname=\jobname}{lwarp}% +} +\immediate\write\LWR@quickfile{% +\detokenize{\input}\string{\jobname.tex\string }% +} +\immediate\closeout\LWR@quickfile +\end{LWRwriteconf} +% \end{macrocode} + + +% \subsection{\prog{lwarpmk} configuration files} +% ^^A *lwarpmk.conf + +% \codeconfig +% \begin{macrocode} +\begin{LWRwriteconf} +% \end{macrocode} + + +% \begin{macro}{\LWR@lwarpconfversion} +% The version number of the configuration file, allowing \prog{lwarpmk} to detect +% an obsolete configuration file format. +% Incremented by one each time the configuration file format changes. +% (This is NOT the same as the \pkg{lwarp} version number.) +% \begin{macrocode} +\newcommand*{\LWR@lwarpconfversion}{2}% also in lwarpmk.lua +% \end{macrocode} +% \end{macro} +% +% +% +% \subsubsection{Helper macros} +% +% \begin{macro}{\LWR@shellescapecmd} +% The LaTeX compile option for shell escape, if used. +% \begin{macrocode} +\ifshellescape + \def\LWR@shellescapecmd{--shell-escape } +\else + \def\LWR@shellescapecmd{} +\fi +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\LWR@compilecmd} \marg{engine} \marg{suffix} +% +% Used to form the basic compilation command for a document, adding +% the optional shell escape. +% +% Engine is \prog{pdflatex}, etc. Suffix is empty or \filenm{_html} +% \begin{macrocode} +\newcommand*{\LWR@compilecmd}[2]{% + #1 \LWR@shellescapecmd \jobname#2% +} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\LWR@addcompilecmd} \marg{cmd} \marg{suffix} +% +% Adds to the compilation command. +% +% Cmd is \prog{dvipdfmx}, etc. Suffix is empty or \filenm{_html} +% \changes{v0.61}{2018/10/06}{Removed spaces.} +% \begin{macrocode} +\newcommand*{\LWR@addcompilecmd}[2]{% + \LWRopseq + #1 \jobname#2% +} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\LWR@unknownengine} +% Error message if not sure which \LaTeX\ engine is being used. +% \begin{macrocode} +\newcommand*{\LWR@unknownengine}{% + \PackageError{lwarp} + {Unknown LaTeX engine.} + {Lwarp only knows about pdflatex, dvi latex, xelatex, lualatex, and upLateX.} +} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\LWR@latexmkvar} \marg{varname} \marg{value} +% +% Adds a \prog{latexmk} variable assignment. +% \begin{macrocode} +\newcommand*{\LWR@latexmkvar}[2]{% + -e + \LWRopquote% + \LWRdollar #1=q/#2/% + \LWRopquote +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\LWR@latexmkcmd} \marg{\prog{latexmk} options} +% +% Sets a call to \prog{latexmk} with the given options, possibly adding +% \optn{-\/-shell-escape}, and also adding the indexing program. +% \changes{v0.59}{2018/09/05}{Fix: \optn{-\/-shell-escape} with \prog{latexmk}.} +% \begin{macrocode} +\newcommand*{\LWR@latexmkcmd}[1]{% + latexmk \space \LWR@shellescapecmd \space #1 \space + -recorder \space + \LWR@latexmkvar{makeindex}{\LWR@LatexmkIndexCmd} +} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\LWR@latexmkdvipdfm} \marg{\prog{dvipdfm} or \prog{dvipdfmx}} +% +% Adds the options settings for \prog{dvipdfm} or \prog{dvipdfmx}. +% \begin{macrocode} +\newcommand*{\LWR@latexmkdvipdfm}[1]{% + -pdfdvi \space + \LWR@latexmkvar{dvipdf}{% + #1 + \@percentchar O + -o \@percentchar D + \@percentchar S% + } +} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\LWR@compileuplatex} +% Sets compile options for up\LaTeX\ with \pkg{ujarticle} or related classes. +% \changes{v0.63}{2018/11/25}{Added.} +% \begin{macrocode} +\newcommand*{\LWR@compileuplatex}{ + \def\LWR@tempprintlatexcmd{% + \LWR@compilecmd{uplatex}{} + \LWR@addcompilecmd{dvipdfmx}{} + } + \def\LWR@tempHTMLlatexcmd{% + \LWR@compilecmd{uplatex}{_html} + \LWR@addcompilecmd{dvipdfmx}{_html} + } +} +% \end{macrocode} +% \end{macro} +% +% +% +% \begin{macro}{\LWR@PrintLatexCmd} +% \begin{macro}{\LWR@HTMLLatexCmd} +% +% If not set by the user, +% the following sets the command to use to compile the source to \PDF\ form. +% +% If using \prog{latexmk}, a complicated string is created, +% eventually resulting in something such as: +% +% For \prog{xelatex} with \optn{-\/-shell-escape}: +% \begin{Verbatim}[tabsize=4,gobble=2,frame=lines] +% [[latexmk -xelatex --shell-escape -recorder +% -e '$makeindex = q/makeindex -s lwarp.ist/' _html]] +% \end{Verbatim} +% +% For \prog{dvipdfmx}: +% \begin{Verbatim}[tabsize=4,gobble=2,frame=lines] +% [[latexmk -pdfdvi -e '$dvipdf=q/dvipdfmx %O -o %D %S/' +% -recorder +% -e '$makeindex=q/makeindex -s lwarp.ist/' _html]] +% \end{Verbatim} +% +% For the following, temporary values are computed, but the permanent +% values are only set if the originals were not assigned by the user. +% \begin{macrocode} +\ifbool{LWR@latexmk}{ +% \end{macrocode} +% For \prog{latexmk} with \prog{pdflatex} or \prog{lualatex}: +% \begin{macrocode} + \ifpdf +% \end{macrocode} +% For \prog{latexmk} with \prog{pdflatex}: +% \begin{macrocode} + \ifPDFTeX + \def\LWR@latexcmd{\LWR@latexmkcmd{-pdf -dvi- -ps-}} + \else +% \end{macrocode} +% For \prog{latexmk} with \prog{lualatex}: +% \begin{macrocode} + \ifLuaTeX + \def\LWR@latexcmd{\LWR@latexmkcmd{-lualatex}} + \else + \LWR@unknownengine + \fi + \fi + \else% \ifpdf +% \end{macrocode} +% For \prog{latexmk} with \prog{xelatex} or \DVI\ \prog{latex}: +% \begin{macrocode} + \ifXeTeX +% \end{macrocode} +% For \prog{latexmk} with \prog{xelatex}: +% \begin{macrocode} + \def\LWR@latexcmd{\LWR@latexmkcmd{-xelatex}} + \else% \ifXeTeX +% \end{macrocode} +% For \prog{latexmk} with \DVI\ \prog{latex}: +% \begin{macrocode} + \ifbool{LWR@dvipdfm}{ + \def\LWR@latexcmd{% + \LWR@latexmkcmd{% + \LWR@latexmkdvipdfm{dvipdfm}% + } + } + }{ + \ifbool{LWR@dvipdfmx}{ + \def\LWR@latexcmd{% + \LWR@latexmkcmd{% + \LWR@latexmkdvipdfm{dvipdfmx}% + } + } + }{ + \def\LWR@latexcmd{\LWR@latexmkcmd{-pdfps}} + } + } + \fi + \fi% \ifpdf +% \end{macrocode} +% The final assignment if \prog{latexmk}: +% \begin{macrocode} + \def\LWR@tempprintlatexcmd{\LWR@latexcmd \space \jobname} + \def\LWR@tempHTMLlatexcmd{\LWR@latexcmd \space \jobname_html} +}% latexmk +% \end{macrocode} +% Without \prog{latexmk}, the compiling command is simply the compiler name +% and the optional shell escape: +% \begin{macrocode} +{% not latexmk + \ifpdf +% \end{macrocode} +% For \prog{pdflatex} or \prog{lualatex}: +% \begin{macrocode} + \ifPDFTeX +% \end{macrocode} +% For \prog{pdflatex}: +% \begin{macrocode} + \def\LWR@tempprintlatexcmd{\LWR@compilecmd{pdflatex}{}} + \def\LWR@tempHTMLlatexcmd{\LWR@compilecmd{pdflatex}{_html}} + \else + \ifLuaTeX +% \end{macrocode} +% For \prog{lualatex}: +% \begin{macrocode} + \def\LWR@tempprintlatexcmd{\LWR@compilecmd{lualatex}{}} + \def\LWR@tempHTMLlatexcmd{\LWR@compilecmd{lualatex}{_html}} + \else + \LWR@unknownengine + \fi + \fi + \else% \ifpdf +% \end{macrocode} +% For \DVI\ \prog{latex} or \prog{xelatex}: +% \begin{macrocode} + \ifXeTeX +% \end{macrocode} +% For \prog{xelatex}: +% \begin{macrocode} + \def\LWR@tempprintlatexcmd{\LWR@compilecmd{xelatex}{}} + \def\LWR@tempHTMLlatexcmd{\LWR@compilecmd{xelatex}{_html}} + \else +% \end{macrocode} +% For \DVI\ \prog{latex}. Default to \prog{dvips}, unless +% told to use \prog{dvipdfm} or \prog{dvipdfmx}: +% \begin{macrocode} + \ifbool{LWR@dvipdfm}{ +% \end{macrocode} +% For \DVI\ \prog{latex} with \prog{dvipdfm}: +% \begin{macrocode} + \def\LWR@tempprintlatexcmd{% + \LWR@compilecmd{latex}{} + \LWR@addcompilecmd{dvipdfm}{} + } + \def\LWR@tempHTMLlatexcmd{% + \LWR@compilecmd{latex}{_html} + \LWR@addcompilecmd{dvipdfm}{_html} + } + }{ + \ifbool{LWR@dvipdfmx}{ +% \end{macrocode} +% For \DVI\ \prog{latex} with \prog{dvipdfmx}: +% \begin{macrocode} + \def\LWR@tempprintlatexcmd{% + \LWR@compilecmd{latex}{} + \LWR@addcompilecmd{dvipdfmx}{} + } + \def\LWR@tempHTMLlatexcmd{% + \LWR@compilecmd{latex}{_html} + \LWR@addcompilecmd{dvipdfmx}{_html} + } + }{% dvips +% \end{macrocode} +% For \DVI\ \prog{latex} with \prog{dvips} and \prog{ps2pdf}: +% \begin{macrocode} + \def\LWR@tempprintlatexcmd{% + \LWR@compilecmd{latex}{} + \LWR@addcompilecmd{dvips}{} + \LWR@addcompilecmd{ps2pdf}{}.ps + } + \def\LWR@tempHTMLlatexcmd{% + \LWR@compilecmd{latex}{_html} + \LWR@addcompilecmd{dvips}{_html} + \LWR@addcompilecmd{ps2pdf}{_html}.ps + } + } + } + \fi% \ifXeTeX + \fi% \ifpdf +}% latexmk +% \end{macrocode} +% For \pkg{ujarticle}, \pkg{utarticle}, and related, using up\LaTeX\ and \prog{dvipdfmx}: +% \changes{v0.63}{2018/11/25}{\pkg{ujarticle} and related: Compile options.} +% \changes{v0.64}{2018/12/07}{\pkg{utarticle} and related: Added.} +% \begin{macrocode} +\@ifclassloaded{ujarticle}{\LWR@compileuplatex}{} +\@ifclassloaded{ujbook}{\LWR@compileuplatex}{} +\@ifclassloaded{ujreport}{\LWR@compileuplatex}{} +\@ifclassloaded{utarticle}{\LWR@compileuplatex}{} +\@ifclassloaded{utbook}{\LWR@compileuplatex}{} +\@ifclassloaded{utreport}{\LWR@compileuplatex}{} +% \end{macrocode} +% Only make the setting permanent if the original was empty: +% \changes{v0.61}{2018/09/20}{Added \optn{PrintLatexCmd} option.} +% \changes{v0.61}{2018/09/20}{Added \optn{HTMLLatexCmd} option.} +% \begin{macrocode} +\ifdefempty{\LWR@PrintLatexCmd}{ + \def\LWR@PrintLatexCmd{\LWR@tempprintlatexcmd} +}{} +\ifdefempty{\LWR@HTMLLatexCmd}{ + \def\LWR@HTMLLatexCmd{\LWR@tempHTMLlatexcmd} +}{} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\LWR@writeconf} \marg{filename} +% +% Common code for each of \filenm{lwarpmk.conf} and \filenm{.lwarpmkconf}. +% Each entry is a variable name, the equal sign, and a quoted string +% inside |[[| and |]]|, which are \prog{lua}'s long quote characters, allowing the +% use of single and double quotes inside. +% +% \changes{v0.59}{2018/08/21}{Compilation commands now preassigned by \pkg{lwarp} instead +% of being computed by \prog{lwarpmk}.} +% \changes{v0.66}{2019/01/27}{Added \optn{ImagesDirectory} and \optn{ImagesName}.} +% \begin{macrocode} +\newcommand{\LWR@writeconf}[1]{ +\ifcsdef{LWR@quickfile}{}{\newwrite{\LWR@quickfile}} +\immediate\openout\LWR@quickfile=#1 +\immediate\write\LWR@quickfile{confversion = [[\LWR@lwarpconfversion]]} +\ifbool{usingOSWindows}{ + \immediate\write\LWR@quickfile{opsystem = [[Windows]]} +}{ + \immediate\write\LWR@quickfile{opsystem = [[Unix]]} +} +\immediate\write\LWR@quickfile{sourcename = [[\jobname]]} +\immediate\write\LWR@quickfile{homehtmlfilename = [[\HomeHTMLFilename]]} +\immediate\write\LWR@quickfile{htmlfilename = [[\HTMLFilename]]} +\immediate\write\LWR@quickfile{imagesdirectory = [[\LWR@ImagesDirectory]]} +\immediate\write\LWR@quickfile{imagesname = [[\LWR@ImagesName]]} +\immediate\write\LWR@quickfile{latexmk = [[\ifbool{LWR@latexmk}{true}{false}]]} +\immediate\write\LWR@quickfile{printlatexcmd = [[\LWR@PrintLatexCmd]]} +\immediate\write\LWR@quickfile{HTMLlatexcmd = [[\LWR@HTMLLatexCmd]]} +\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]]} +\immediate\write\LWR@quickfile{pdftotextenc = [[\LWR@pdftotextEnc]]} +\immediate\closeout\LWR@quickfile +} + +% \end{macrocode} +% \end{macro} + +% \begin{macrocode} +\end{LWRwriteconf} +% \end{macrocode} + + + +% \subsubsection{\filenm{lwarpmk.conf}} +% +% \DescribeFile{lwarpmk.conf} +% |lwarpmk.conf| is automatically (re-)created by the \pkg{lwarp} package when +% executing\\ +% \hspace*{2ex} |pdflatex |,\\ +% or similar for \prog{xelatex} or \prog{lualatex}, in print-document generation mode, +% which is the default unless the \optn{warpHTML} option is given. +% |lwarpmk.conf| is then used by the utility \prog{lwarpmk}. +% +% \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}.} +% \changes{v0.54}{2018/04/06}{\filenm{lwarpmk.conf}: Option \optn{IndexLanguage} changed to \optn{xindyLanguage}.} +% \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}.} +% +% \codeconfig +% \begin{macrocode} +\begin{LWRwriteconf} + +\AtBeginDocument{\LWR@writeconf{lwarpmk.conf}} + +\end{LWRwriteconf} +% \end{macrocode} + + + +% \subsubsection{\filenm{.lwarpmkconf}} +% +% \DescribeFile{project.lwarpmkconf} A project-specific configuration file for \prog{lwarpmk}. +% +% \changes{v0.29}{2017/04/15}{\filenm{*.lwarpmkconf}: Add: \optn{language} +% option for config files.} +% \changes{v0.54}{2018/04/06}{\filenm{*.lwarpmkconf}: Option \optn{xdyFilename} changed to \optn{xindyStyle}.} +% \changes{v0.54}{2018/04/06}{\filenm{*.lwarpmkconf}: Option \optn{IndexLanguage} changed to \optn{xindyLanguage}.} +% \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 been handled +% for \filenm{lwarp.conf}. +% +% \codeconfig +% \begin{macrocode} +\begin{LWRwriteconf} + +\AtBeginDocument{\LWR@writeconf{\jobname.lwarpmkconf}} + +\end{LWRwriteconf} +% \end{macrocode} + + + + + + +% \subsection{\filenm{lwarp.css}} + +% \DescribeFile{lwarp.css} +% This is the base \CSS\ layer used by \pkg{lwarp}. +% +% This must be present both when compiling the project +% and also when distributing the \HTML\ files. +% +% \changes{v0.26}{2017/03/30}{\filenm{lwarp.css}: Improved responsive +% \attribute{marginpar} and \attribute{marginblock}.} +% \changes{v0.30}{2017/04/26}{Fix: \filenm{*.css} files only written in print mode.} +% \changes{v0.50}{2018/03/02}{\filenm{lwarp.css}: Improved \SVG\ display math centering.} +% \changes{v0.54}{2018/04/24}{\filenm{lwarp.css}: Fix: Text-decoration-skip: auto.} +% \changes{v0.56}{2018/04/27}{\filenm{lwarp.css}: Added \attribute{span.textbf}, etc.} +% \changes{v0.56}{2018/05/09}{\filenm{lwarp.css}: Added \attribute{div.textbf}, etc.} +% \changes{v0.57}{2018/05/21}{\filenm{lwarp.css}: Added ruled, boxed, boxruled floats.} +% \changes{v0.57}{2018/05/21}{\filenm{lwarp.css}: Increased float vertical margins.} +% \changes{v0.61}{2018/10/05}{\filenm{lwarp.css}: Footnotes text align left.} +% \changes{v0.61}{2018/10/05}{\filenm{lwarp.css}: Minipage table and footnotes: tighter margin.} +% \changes{v0.62}{2018/11/02}{\filenm{lwarp.css}: Reduced margins in titlepage.} +% \changes{v0.62}{2018/11/02}{\filenm{lwarp.css}: Fixed \CSS\ for \cs{textup}.} +% \changes{v0.62}{2018/11/02}{\filenm{lwarp.css}: Added \CSS\ for \pkg{xfrac}, \pkg{nicefrac}.} +% \changes{v0.63}{2018/11/30}{\filenm{lwarp.css}: Added \CSS\ for vertical writing.} +% \changes{v0.63}{2018/12/01}{\filenm{lwarp.css}: Improved \CSS\ for \pkg{mdframed}.} +% \changes{v0.65}{2018/12/09}{\filenm{lwarp.css}: Improved \CSS\ for quotations.} +% \changes{v0.65}{2018/12/09}{\filenm{lwarp.css}: Side\TOC to left for improved \cs{marginpar}s.} +% \changes{v0.65}{2018/12/09}{\filenm{lwarp.css}: Added \cs{sishape}, \cs{textsi}.} +% \changes{v0.65}{2018/12/18}{\filenm{lwarp.css}: Improved \CSS\ for page layout.} +% \changes{v0.66}{2019/01/02}{\filenm{lwarp.css}: Improved \CSS\ for definition lists.} +% \changes{v0.66}{2019/02/28}{\filenm{lwarp.css}: Added \pkg{niceframe}.} +% \changes{v0.72}{2019/05/24}{\filenm{lwarp.css}: Added \pkg{backnaur}.} +% \changes{v0.72}{2019/05/26}{\filenm{lwarp.css}: Removed unneeded support for \cs{sishape}, \cs{textsi}.} +% \changes{v0.73}{2019/06/21}{\filenm{lwarp.css}: Added \cs{book} for \pkg{memoir}.} +% \changes{v0.73}{2019/06/30}{\filenm{lwarp_.css}: Improved pkg{tocdata} formatting.} +% +% ^^A *lwarp.css +% +% \codeconfig +% \begin{macrocode} +\begin{LWRwriteconf} +\begin{filecontents*}{lwarp.css} +/* + CSS stylesheet for the LaTeX lwarp package + Copyright 2016-2019 Brian Dunn — BD Tech Concepts LLC +*/ + + +/* a fix for older browsers: */ +header, section, footer, aside, nav, main, + article, figure { display: block; } + + +A:link {color:#000080 ; text-decoration: none ; } +A:visited {color:#800000 ; } +A:hover {color:#000080 ; text-decoration: underline ;} +A:active {color:#800000 ; } + +a.tocbook {display: inline-block ; margin-left: 0em ; + font-weight: bold ; margin-top: 1ex ; margin-bottom: 1ex ; } +a.tocpart {display: inline-block ; margin-left: 0em ; + font-weight: bold ;} +a.tocchapter {display: inline-block ; margin-left: 0em ; + font-weight: bold ;} +a.tocsection {display: inline-block ; margin-left: 1em ; + text-indent: -.5em ; font-weight: bold ; } +a.tocsubsection {display: inline-block ; margin-left: 2em ; + text-indent: -.5em ; } +a.tocsubsubsection {display: inline-block ; margin-left: 3em ; + text-indent: -.5em ; } +a.tocparagraph {display: inline-block ; margin-left: 4em ; + text-indent: -.5em ; } +a.tocsubparagraph {display: inline-block ; margin-left: 5em ; + text-indent: -.5em ; } +a.tocfigure {margin-left: 0em} +a.tocsubfigure {margin-left: 2em} +a.toctable {margin-left: 0em} +a.tocsubtable {margin-left: 2em} +a.toctheorem {margin-left: 0em} +a.toclstlisting {margin-left: 0em} + +body { + font-family: "DejaVu Serif", "Bitstream Vera Serif", + "Lucida Bright", Georgia, serif; + background: #FAF7F4 ; + color: black ; + margin:0em ; + padding:0em ; + font-size: 100% ; + line-height: 1.2 ; +} + +p {margin: 1.5ex 0em 1.5ex 0em ;} +table p {margin: .5ex 0em .5ex 0em ;} + +/* Holds a section number */ +span.sectionnumber { margin-right: 0em } + +/* Inserted in front of index lines */ +span.indexitem {margin-left: 0em} +span.indexsubitem {margin-left: 2em} +span.indexsubsubitem {margin-left: 4em} + +div.hidden, span.hidden { display: none ; } + +kbd, span.texttt { + font-family: "DejaVu Mono", "Bitstream Vera Mono", "Lucida Console", + "Nimbus Mono L", "Liberation Mono", "FreeMono", "Andale Mono", + "Courier New", monospace; + font-size: 100% ; +} + +pre { padding: 3pt ; } + +span.strong, span.textbf, div.strong, div.textbf { font-weight: bold; } + +span.textit, div.textit { font-style: italic; } + +span.textmd, div.textmd { font-weight: normal; } + +span.texteb { font-weight: bolder; } + +span.textlg { font-weight: lighter; } + +span.textsc, div.textsc { + font-variant: small-caps; + font-variant-numeric: oldstyle-nums ; +} + +span.textulc, div.textulc { + font-variant: normal ; + font-variant-numeric: normal ; +} + +span.textsl, div.textsl { font-style: oblique; } + +span.textup, div.textup { + font-style: normal; + font-variant: normal; + font-variant-numeric: normal ; +} + +span.textrm, div.textrm { + font-family: "DejaVu Serif", "Bitstream Vera Serif", + "Lucida Bright", Georgia, serif; +} + +span.textsf, div.textsf { + font-family: "DejaVu Sans", "Bitstream Vera Sans", + Geneva, Verdana, sans-serif ; +} + +span.textcircled { border: 1px solid black ; border-radius: 1ex ; } + +span.underline { + text-decoration: underline ; + text-decoration-skip: auto ; +} + +span.overline { + text-decoration: overline ; + text-decoration-skip: auto ; +} + + +/* for vertical text: */ +div.verticalrl { writing-mode: vertical-rl } +div.horizontaltb { writing-mode: horizontal-tb } + + +/* for diagbox */ +div.diagboxtitleN { border-bottom: 1px solid gray } +div.diagboxtitleS { border-top: 1px solid gray } + +div.diagboxE { + padding-left: 2em ; + text-align: right ; +} + +div.diagboxW { + padding-right: 2em ; + text-align: left ; +} + + + +/* For realscripts */ +.supsubscript { + display: inline-block; + text-align:left ; +} + +.supsubscript sup, +.supsubscript sub { + position: relative; + display: block; + font-size: .5em; + line-height: 1; +} + +.supsubscript sup { + top: .5em; +} + +.supsubscript sub { + top: .5em; +} + +div.attribution p { + text-align: right ; + font-size: 80% +} + +span.poemtitle { + font-size: 120% ; font-weight: bold; +} + +pre.tabbing { + font-family: "Linux Libertine Mono O", "Lucida Console", + "Droid Sans Mono", "DejaVu Mono", "Bitstream Vera Mono", + "Liberation Mono", "FreeMono", "Andale Mono", + "Nimbus Mono L", "Courier New", monospace; +} + +blockquote { + display: block ; + margin-left: 2em ; + margin-right: 2em ; +} + +/* quotchap is for the quotchap package */ +div.quotchap { + display: block ; + font-style: oblique ; + overflow-x: auto ; + margin-left: 2em ; + margin-right: 2em ; +} + +blockquote p, div.quotchap p { + line-height: 1.5; + text-align: left ; + font-size: .85em ; +} + +/* qauthor is for the quotchap package */ +div.qauthor { + display: block ; + text-align: right ; + margin-left: auto ; + margin-right: 2em ; + font-size: 80% ; + font-variant: small-caps; +} + +div.qauthor p { + text-align: right ; +} + +div.epigraph, div.dictum { + line-height: 1.2; + text-align: left ; + padding: 3ex 1em 0ex 1em ; +/* margin: 3ex auto 3ex auto ; */ /* Epigraph centered */ + margin: 3ex 1em 3ex auto ; /* Epigraph to the right */ +/* margin: 3ex 1em 3ex 1em ; */ /* Epigraph to the left */ + font-size: .85em ; + max-width: 27em ; +} + +div.epigraphsource, div.dictumauthor { + text-align:right ; + margin-left:auto ; +/* max-width: 50% ; */ + border-top: 1px solid #A0A0A0 ; + padding-bottom: 3ex ; + line-height: 1.2; +} + +div.epigraph p, div.dictum p { padding: .5ex ; margin: 0ex ;} +div.epigraphsource p, div.dictumauthor p { padding: .5ex 0ex 0ex 0ex ; margin: 0ex ;} +div.dictumauthor { font-style:italic } + + +/* copyrightbox package */ +div.copyrightbox { margin: .5ex .5em } +div.copyrightbox p {margin: 0px .5em ; padding: 0px} +div.copyrightboxnote {text-align: left ; font-size: 60%} + + +/* lettrine package: */ +span.lettrine { font-size: 4ex ; float: left ; } +span.lettrinetext { font-variant: small-caps ; } + +/* ulem, soul, umoline packages: */ +span.uline { + text-decoration: underline ; + text-decoration-skip: auto ; +} + +span.uuline { + text-decoration: underline ; + text-decoration-skip: auto ; + text-decoration-style: double ; +} + +span.uwave { + text-decoration: underline ; + text-decoration-skip: auto ; + text-decoration-style: wavy ; +} + +span.sout { + text-decoration: line-through ; +} + +span.oline { + text-decoration: overline ; + text-decoration-skip: auto ; +} + +span.xout { + text-decoration: line-through ; +} + +span.dashuline { + text-decoration: underline ; + text-decoration-skip: auto ; + text-decoration-style: dashed ; +} + +span.dotuline { + text-decoration: underline ; + text-decoration-skip: auto ; + text-decoration-style: dotted ; +} + +span.letterspacing { letter-spacing: .2ex ; } + +span.capsspacing { + font-variant: small-caps ; + letter-spacing: .1ex ; +} + +span.highlight { background: #F8E800 ; } + + + + +html body { + margin: 0 ; + line-height: 1.2; +} + + +body div { + margin: 0ex; +} + + +div.book, h1, h2, h3, h4, h5, h6, span.paragraph, span.subparagraph +{ + font-family: "Linux Libertine O", "Hoefler Text", "Garamond", + "Bembo", "Janson", "TeX Gyre Pagella", "Palatino", + "Liberation Serif", "Nimbus Roman No 9 L", "FreeSerif", Times, + "Times New Roman", serif; + font-style: normal ; + font-weight: bold ; + text-align: left ; +} + +h1 { /* title of the entire website, used on each page */ + text-align: center ; + font-size: 2.5em ; + padding: .4ex 0em 0ex 0em ; +} + +div.book { + text-align: center ; + font-size: 2.325em ; + padding: .4ex 0em 0ex 0em ; +} + +h2 { font-size: 2.25em } +h3 { font-size: 2em } +h4 { font-size: 1.75em } +h5 { font-size: 1.5em } +h6 { font-size: 1.25em } +span.paragraph {font-size: 1em ; font-variant: normal ; + margin-right: 1em ; } +span.subparagraph {font-size: 1em ; font-variant: normal ; + margin-right: 1em ; } + +div.minisec { + font-family: "DejaVu Sans", "Bitstream Vera Sans", + Geneva, Verdana, sans-serif ; + font-style: normal ; + font-weight: bold ; + text-align: left ; +} + +h1 { + margin: 0ex 0em 0ex 0em ; + line-height: 1.3; + text-align: center ; +} + +h2 { + margin: 1ex 0em 1ex 0em ; + line-height: 1.3; + text-align: center ; +} + +h3 { + margin: 3ex 0em 1ex 0em ; + line-height: 1.3; +} + +h4 { + margin: 3ex 0em 1ex 0em ; + line-height: 1.3; +} + +h5 { + margin: 3ex 0em 1ex 0em ; + line-height: 1.3; +} + +h6 { + margin: 3ex 0em 1ex 0em ; + line-height: 1.3; +} + + +div.titlepage { + text-align: center ; +} + +.footnotes { + text-align: left ; + font-size: .85em ; + margin: 3ex 2em 0ex 2em ; + border-top: 1px solid silver ; +} + +.marginpar, .marginparblock { + max-width: 50%; + float: right ; + clear: both ; + text-align: left ; + margin: 1ex 0.5em 1ex 1em ; + padding: 1ex 0.5em 1ex 0.5em ; + font-size: 85% ; + border-top: 1px solid silver ; + border-bottom: 1px solid silver ; + overflow-x: auto ; +} + +.marginpar br { margin-bottom: 2ex ; } + +div.marginblock, div.marginparblock { + max-width:50%; + min-width: 10em; /* room for caption */ + float:right; + text-align:left; + margin: 1ex 0.5em 1ex 1em ; + padding: 1ex 0.5em 1ex 0.5em ; + overflow-x: auto; +} + +div.marginblock div.minipage, +div.marginparblock div.minipage { + display: block ; + margin: 0pt auto 0pt auto ; +} + +div.marginblock div.minipage p , +div.marginparblock div.minipage p + { font-size: 85%} + +div.marginblock br , +div.marginparblock br + { margin-bottom: 2ex ; } + +div.bodycontainer { + float: left ; + width: 80% ; +} + +div.bodywithoutsidetoc div.bodycontainer { + float: none ; + width: 100% ; +} + +section.textbody div.footnotes{ + margin: 3ex 2em 0ex 2em ; + border-bottom: 2px solid silver ; +} + +.footnoteheader { + border-top: 2px solid silver ; + margin-top: 3ex ; + padding-top: 1ex ; + font-weight: bold ; +} + +.mpfootnotes { + text-align: left ; + font-size: .85em ; + margin-left: 1em ; + border-top: 1px solid silver ; +} + +/* Remove footnote top border in the title page. */ +div.titlepage div.mpfootnotes { + border-top: none ; +} + + + +ul, ol { + margin: 1ex 1em 1ex 0em; + line-height: 1.2; +} + +body dir, body menu { + margin: 3ex 1em 3ex 0em; + line-height: 1.2; +} + +li { margin: 0ex 0em 1ex 0em; } + +html { + margin: 0; + padding: 0; +} + +.programlisting { + font-family: "DejaVu Mono", "Bitstream Vera Mono", "Lucida Console", + "Nimbus Mono L", "Liberation Mono", "FreeMono", "Andale Mono", + "Courier New", monospace; + margin: 1ex 0ex 1ex 0ex ; + padding: .5ex 0pt .5ex 0pt ; + overflow-x: auto; +} + +section.textbody>pre.programlisting { +border-top: 1px solid silver ; +border-bottom: 1px solid silver ; +} + + +div.displaymath { + text-align: center ; +} + +div.displaymathnumbered { + text-align: right ; + margin-left: 5% ; + margin-right: 5% ; + min-width: 2.5in ; +} + +@media all and (min-width: 400px) { + div.displaymathnumbered { + margin-left: 10% ; + margin-right: 10% ; + } +} + +@media all and (min-width: 800px) { + div.displaymathnumbered { + margin-right: 20% ; + } +} + +@media all and (min-width: 1200px) { + div.displaymathnumbered { + margin-right: 30% ; + } +} + + +.inlineprogramlisting { + font-family: "DejaVu Mono", "Bitstream Vera Mono", "Lucida Console", + "Nimbus Mono L", "Liberation Mono", "FreeMono", "Andale Mono", + "Courier New", monospace; + overflow-x: auto; +} + +span.listinglabel { + display: inline-block ; + font-size: 70% ; + width: 4em ; + text-align: right ; + margin-right: 2em ; +} + +div.abstract { + margin: 2em 5% 2em 5% ; + padding: 1ex 1em 1ex 1em ; +/* font-weight: bold ; */ + font-size: 90% ; + text-align: left ; +} + +div.abstract dl {line-height:1.5;} +div.abstract dt {color:#304070;} + +div.abstracttitle{ + font-family: "URW Classico", Optima, "Linux Biolinum O", + "Linux Libertine O", "Liberation Serif", "Nimbus Roman No 9 L", + "FreeSerif", "Hoefler Text", Times, "Times New Roman", serif; + font-weight:bold; + font-size:1.25em; + text-align: center ; +} + +span.abstractrunintitle{ + font-family: "URW Classico", Optima, "Linux Biolinum O", + "Linux Libertine O", "Liberation Serif", "Nimbus Roman No 9 L", + "FreeSerif", "Hoefler Text", Times, "Times New Roman", serif; + font-weight:bold; +} + + +.verbatim { + overflow-x: auto ; +} + +.alltt { + overflow-x: auto ; +} + + +.bverbatim { + margin: 1ex 0pt 1ex 0pt ; + padding: .5ex 0pt .5ex 0pt ; + overflow-x: auto ; +} + +.lverbatim { + margin: 1ex 0pt 1ex 0pt ; + padding: .5ex 0pt .5ex 0pt ; + overflow-x: auto ; +} + +.fancyvrb { + font-size:.85em ; + margin: 3ex 0pt 3ex 0pt +} + +.fancyvrblabel { + font-size: .85em ; + text-align: center ; + font-weight: bold ; + margin-top: 1ex ; + margin-bottom: 1ex ; +} + + +.verse { + font-family: "Linux Libertine Mono O", "Lucida Console", + "Droid Sans Mono", "DejaVu Mono", "Bitstream Vera Mono", + "Liberation Mono", "FreeMono", "Andale Mono", + "Nimbus Mono L", "Courier New", monospace; + margin-left: 1em ; +} + + +div.singlespace { line-height: 1.2 ; } +div.onehalfspace { line-height: 1.5 ; } +div.doublespace { line-height: 2 ; } + + +/* Word processor format output: */ +div.wpfigure { border: 1px solid red ; margin: .5ex ; padding: .5ex ; } +div.wptable { border: 1px solid blue ; margin: .5ex ; padding: .5ex ; } +div.wpminipage { border: 1px solid green ; margin: .5ex ; padding: .5ex ;} + + + + +/* Minipage environments, vertically aligned to top, center, bottom: */ +.minipage, .fminipage, .fcolorminipage { + /* display: inline-block ; */ + /* Mini pages which follow each other will be tiled. */ + margin: .25em .25em .25em .25em; + padding: .25em .25em .25em .25em; + display: inline-flex; + flex-direction: column ; + overflow: auto; +} + +.inlineminipage { + display: inline-block ; + text-align: left +} + +/* Paragraphs in the flexbox did not collapse their margins. */ +/* Have not yet researched this. */ +.minipage p {margin: .75ex 0em .75ex 0em ;} + +.fboxBlock .minipage, .colorbox .minipage, .colorboxBlock .minipage, +.fcolorbox .minipage, .fcolorboxBlock .minipage + {border: none ; background: none;} + +.fbox, .fboxBlock { border: 1px solid black ; } + +.fbox, .fboxBlock, .fcolorbox, .fcolorboxBlock, .colorbox, .colorboxBlock, +.fminipage, .fcolorminipage + {display: inline-block} + +.shadowbox, .shabox { + border: 1px solid black; + box-shadow: 3px 3px 3px #808080 ; + border-radius: 0px ; + padding: .4ex .3em .4ex .3em ; + margin: 0pt .3ex 0pt .3ex ; + display: inline-block ; +} + +.doublebox { + border: 3px double black; + border-radius: 0px ; + padding: .4ex .3em .4ex .3em ; + margin: 0pt .3ex 0pt .3ex ; + display: inline-block ; +} + +.ovalbox, .Ovalbox { + border: 1px solid black; + border-radius: 1ex ; + padding: .4ex .3em .4ex .3em ; + margin: 0pt .3ex 0pt .3ex ; + display: inline-block ; +} + +.Ovalbox { border-width: 2px ; } + +.framebox { + border: 1px solid black; + border-radius: 0px ; + padding: .3ex .2em 0ex .2em ; + margin: 0pt .1ex 0pt .1ex ; + display: inline-block ; +} + + +.mdframed { + padding: 0ex ; + margin: 2ex 0em 2ex 0em ; +} + +.mdframed p { padding: 0ex .5em 0ex .5em ; } + +.mdframed dl { padding: 1ex .5em 0ex .5em ; } + +.mdframedtitle { + padding: .5ex 0pt 0pt 0pt ; + border-radius: 10pt 10pt 0pt 0pt ; + display: block ; + margin-bottom: 1ex ; +} + +.mdframedsubtitle { + display: block ; +} + +.mdframedsubsubtitle { + display: block ; +} + +.mdtheorem { + padding: 0ex .5em 0ex .5em ; + margin: 3ex 5% 3ex 5% ; +} + + +/* framed package */ +.framed, pre.boxedverbatim, fcolorbox { + margin: 3ex 0em 3ex 0em ; + border: 1px solid black; + border-radius: 0px ; + padding: .3ex 1em 0ex 1em ; + display: block ; +} + +.shaded { + margin: 3ex 0em 3ex 0em ; + padding: .3ex 1em .3ex 1em ; + display: block ; +} + +.snugframed { + margin: 3ex 0em 3ex 0em ; + border: 1px solid black; + border-radius: 0px ; + display: block ; +} + +.framedleftbar { + margin: 3ex 0em 3ex 0em ; + border-left: 3pt solid black; + border-radius: 0px ; + padding: .3ex .2em .3ex 1em ; + display: block ; +} + +.framedtitle { + margin: 0em ; + padding: 0em ; + font-size: 130% +} + +.framedtitle p { padding: .3em } + + +/* For the niceframe package: */ + +div.niceframe, div.curlyframe, div.artdecoframe, div.generalframe { + padding: 1ex ; + margin: 2ex auto ; + border-radius: 2ex ; +} + +div.niceframe { + border: 6px groove black ; +} + +div.curlyframe { + border-left: 3px dotted black ; + border-right: 3px dotted black ; + border-radius: 6ex ; +} + +div.artdecoframe { + border-left: 10px double black ; + border-right: 10px double black ; + border-radius: 6ex ; +} + +div.generalframe { + border: 6px groove black ; +} + + + +dl { + margin: 1ex 2em 1ex 0em; + line-height: 1.3; +} + +dl dt { + display: block ; + float:left ; + font-weight: bold; + padding-right: 1em ; +} + +dl dd { display: block ; } + +dl dd:after { content: "" ; display: block ; clear: both } + +dl dd p { margin-top: 0em; } + +dd ul, dd ol, dd dl { clear: both ; padding-top: 1ex } + + +nav { + font-family: "URW Classico", Optima, "Linux Biolinum O", + "DejaVu Sans", "Bitstream Vera Sans", + Geneva, Verdana, sans-serif ; + margin-bottom: 4ex ; +} + +nav p { + line-height: 1.2 ; + margin-top:.5ex ; + margin-bottom:.5ex; + font-size: .9em ; +} + + + +img, img.hyperimage, img.borderimage { + max-width: 600px; + border: 1px solid silver; + box-shadow: 3px 3px 3px #808080 ; + padding: .5% ; + margin: .5% ; + background: none ; +} + +img.inlineimage{ + padding: 0px ; + box-shadow: none ; + border: none ; + background: none ; + margin: 0px ; + display: inline-block ; + border-radius: 0px ; +} + +img.logoimage{ + max-width: 300px ; + box-shadow: 3px 3px 3px #808080 ; + border: 1px solid black ; + background:none ; + padding:0 ; + margin:.5ex ; + border-radius: 10px ; +} + + +.section { +/* + To have each section float relative to each other: +*/ +/* + display: block ; + float: left ; + position: relative ; + background: white ; + border: 1px solid silver ; + padding: .5em ; +*/ + margin: 0ex .5em 0ex .5em ; + padding: 0 ; +} + + +figure { + margin: 5ex auto 5ex auto ; + padding: 1ex 1em 1ex 1em ; + overflow-x: auto ; +} + + +/* To automatically center images in figures: */ +/* +figure img.inlineimage { + margin: 0ex auto 0ex auto ; + display: block ; +} +*/ + +/* To automatically center minipages in figures: */ +/* +figure div.minipage, figure div.minipage div.minipage { + margin: 1ex auto 1ex auto ; + display: block ; +} +*/ + +figure figure { margin: 0pt } + +figure div.minipage p { font-size: 85% ; } + +figure.subfigure, figure.subtable { + display: inline-block ; margin: 3ex 1em 3ex 1em ; +} + +div.figurecaption .minipage { margin:0 ; padding: 0 } + +div.minipage figure { border: none ; box-shadow: none ; } +div.minipage figure.table { margin: 0ex } +div.minipage div.footnotes { margin: 1ex 2em 0ex 2em } + +div.floatrow { text-align: center; } + +div.floatrow figure { display: inline-block ; margin: 1ex 2% ; } + +div.floatfoot { font-size: .85em ; + border-top: 1px solid silver ; line-height: 1.2 ; } + +div.figurecaption , .lstlistingtitle { + font-size: .85em ; + text-align: center ; + font-weight: bold ; + margin-top: 1ex ; + margin-bottom: 1ex ; +} + +figure.subfigure div.figurecaption, figure.subtable div.figurecaption { + border-bottom: none ; background: none ; +} + +div.nonfloatcaption { + margin: 1ex auto 1ex auto ; + font-size: .85em ; + text-align: center ; + font-weight: bold ; +} + +/* For a \RawCaption inside a minipage inside a figure's floatrow: */ +figure div.floatrow div.minipage div.figurecaption { + border: none ; + background: none ; +} + + +/* For packages such as float, rotfloat, and algorithm2e: */ + +figure.boxed, figure.boxruled { + border: 1px solid black ; +} + +figure.ruled { + border-top: 1px solid black ; + border-bottom: 1px solid black ; + border-left: 0px ; + border-right: 0px ; + border-radius: 0px ; + background: none ; + box-shadow: none ; +} + +figure.ruled div.figurecaption, figure.boxruled div.figurecaption { + border-top: 1px solid silver ; + border-bottom: 1px solid silver ; +} + + +table { + margin: 1ex auto 1ex auto ; + border-collapse: separate ; + border-spacing: 0px ; + line-height: 1.3 ; + } + +tr.hline td {border-top: 1px solid #808080 ; margin-top: 0ex ; + margin-bottom: 0ex ; } /* for \hline */ + +tr.tbrule td {border-top: 1px solid black ; margin-top: 0ex ; + margin-bottom: 0ex ; } /* for \toprule, \bottomrule */ + +td {padding: .5ex .5em .5ex .5em ;} + +table td.tdl { text-align: left ; vertical-align: middle ; } +table td.tdc { text-align: center ; vertical-align: middle ; } +table td.tdat { text-align: center ; vertical-align: middle ; padding: 0px ; margin: 0px ; } +table td.tdbang { text-align: center ; vertical-align: middle ; } +table td.tdr { text-align: right ; vertical-align: middle ; } +table td.tdp { text-align: left ; vertical-align: bottom ; } +table td.tdm { text-align: left ; vertical-align: middle ; } +table td.tdb { text-align: left ; vertical-align: top ; } +table td.tdP { text-align: center ; vertical-align: bottom ; } +table td.tdM { text-align: center ; vertical-align: middle ; } +table td.tdB { text-align: center ; vertical-align: top ; } + +table td.tvertbarl { border-left: 1px solid black } +table td.tvertbarldouble { border-left: 4px double black } +table td.tvertbarr { border-right: 1px solid black } +table td.tvertbarrdouble { border-right: 4px double black } + +table td.tvertbarldash { border-left: 1px dashed black } +table td.tvertbarldoubledash { border-left: 2px dashed black } +table td.tvertbarrdash { border-right: 1px dashed black } +table td.tvertbarrdoubledash { border-right: 2px dashed black } + + +/* for cmidrules: */ +table td.tdrule { + border-top: 1px solid #A0A0A0 ; +} + +table td.tdrulel { + border-top-left-radius:.5em ; + border-top: 1px solid #A0A0A0 ; +} + +table td.tdruler { + border-top-right-radius:.5em ; + border-top: 1px solid #A0A0A0 ; +} + +table td.tdrulelr { + border-top-left-radius:.5em ; + border-top-right-radius:.5em ; + border-top: 1px solid #A0A0A0 ; +} + + +/* Margins of paragraphs inside table cells: */ +td.tdp p , td.tdprule p , td.tdP p , td.tdPrule p { padding-top: 1ex ; + padding-bottom: 1ex ; margin: 0ex ; } +td.tdm p , td.tmbrule p , td.tdM p , td.tdMrule p { padding-top: 1ex ; + padding-bottom: 1ex ; margin: 0ex ; } +td.tdb p , td.tdbrule p , td.tdB p , td.tdBrule p { padding-top: 1ex ; + padding-bottom: 1ex ; margin: 0ex ; } + +td.tdp , td.tdprule , td.tdP , td.tdPrule + { padding: 0ex .5em 0ex .5em ; } +td.tdm , td.tdmrule , td.tdM , td.tdMrule + { padding: 0ex .5em 0ex .5em ; } +td.tdb , td.tdbrule , td.tdB , td.tdBrule + { padding: 0ex .5em 0ex .5em ; } + + +/* table notes: */ +.tnotes { + margin: 0ex 5% 1ex 5% ; + padding: 0.5ex 1em 0.5ex 1em; + font-size:.80em; + text-align: left ; +} + +.minipage .tnotes { + margin: 0pt ; + padding: 0pt ; +} + +.tnotes dl dt p {margin-bottom:0px;} + +.tnoteitemheader {margin-right: 1em;} + + +/* for colortbl and cell color */ +div.cellcolor { + width: 100% ; + padding: .5ex .5em .5ex .5em ; + margin: -.5ex -.5em -.5ex -.5em ; +} + + +/* for bigdelim */ +.ldelim, .rdelim { font-size: 200% } + + +/* center, flushleft, flushright environments */ +div.center{text-align:center;} +div.center table {margin-left:auto;margin-right:auto;} +div.flushleft{text-align:left;} +div.flushleft table {margin-left:0em ; margin-right:auto;} +div.flushright{text-align:right;} +div.flushright table {margin-left:auto ; margin-right: 0em ;} + + +/* Fancybox */ +div.Btrivlist table tr td { + padding: .2ex 0em ; +} + + +/* program listing callouts: */ +span.callout { + font-family: "DejaVu Sans", "Bitstream Vera Sans", + Geneva, Verdana, sans-serif ; + border-radius: .5em; + background-color:black; + color:white; + padding:0px .25em 0px .25em; + margin: 0 ; + font-weight: bold; + font-size:.72em ; +} + +div.programlisting pre.verbatim span.callout{ + font-size: .85em ; +} + +span.verbatim { + font-family: "DejaVu Mono", "Bitstream Vera Mono", "Lucida Console", + "Nimbus Mono L", "Liberation Mono", "FreeMono", "Andale Mono", + "Courier New", monospace; +} + + + +div.published +{ + text-align: center ; + font-variant: normal ; + font-style: italic ; + font-size: 1em ; + margin: 1ex 0em 1ex 0em ; +} + +div.subtitle +{ + text-align: center ; + font-variant: normal ; + font-style: italic ; + font-size: 1.25em ; + margin: 1ex 0em 1ex 0em ; +} + +div.subtitle p { margin: 1ex ; } + +div.author +{ + font-variant: normal ; + font-style: normal ; + font-size: 1em ; + margin: 1ex 0em 1ex 0em ; +} + +div.oneauthor { + display: inline-block ; + margin: 0ex 1em 0ex 1em ; +} + +/* +div.author table { + margin: 1ex auto 0ex auto ; + background: none ; +} + +div.author table tbody tr td { padding: .25ex ; } +*/ + +span.affiliation {font-size: .85em ; font-variant: small-caps; } + +div.titledate { + text-align: center ; + font-size: .85em ; + font-style: italic; + margin: 1ex 0em 1ex 0em ; +} + + +nav.topnavigation{ + text-align: left ; + padding: 0.5ex 1em 0.5ex 1em ; +/* margin: 2ex 0em 3ex 0em ; */ + margin: 0 ; + border-bottom: 1px solid silver ; + border-top: 1px solid silver ; + clear:both ; +} + +nav.botnavigation{ + text-align: left ; + padding: 0.5ex 1em 0.5ex 1em ; +/* margin: 3ex 0em 2ex 0em ; */ + margin: 0 ; + border-top: 1px solid silver ; + border-bottom: 1px solid silver ; + clear:both ; +} + + +header { + line-height: 1.2 ; + font-size: 1em ; + border-bottom: 1px solid silver ; + margin: 0px ; + padding: 2ex 1em 2ex 1em ; + text-align:left ; +} + + +footer { + font-size: .85em ; + line-height: 1.2 ; + margin-top: 1ex ; + border-top: 1px solid silver ; + padding: 2ex 1em 2ex 1em ; + clear:both ; + text-align:left ; +} + + +a.linkhome { font-weight:bold ; font-size: 1em ;} + + +div.lateximagesource { padding: 0px ; margin: 0px ; display: none; } + +img.lateximage{ + padding: 0pt ; + margin: 0pt ; + box-shadow: none ; + border: none ; + background: none ; + max-width: 100% ; + border-radius: 0ex ; + border: none ; +} + + +/* The -1px right margin compensates for the 1px right border. */ +/* Without this -1px margin, the body container appears below instead */ +/* of floating to the side. */ +div.sidetoccontainer { + font-family: "DejaVu Serif", "Bitstream Vera Serif", + "Lucida Bright", Georgia, serif; + float: left ; + width: 20%; + margin: 0pt -1px 3ex 0pt ; + border-right: 1px solid silver; + border-bottom: 1px solid silver; + background: #FAF7F4 ; + font-size:.9em ; + border-radius: 0px 0px 20px 0px ; +} + +div.sidetoccontents { + overflow-y: auto ; + width: 100% ; + text-align: left ; +} + + +nav.sidetoc p {line-height:1.2 ; margin: 1ex .5em 1ex .5em ; + text-indent: 0 ; } + +nav.sidetoc p a {color:black ; font-size: .7em ;} + +div.sidetoctitle {font-size: 1.2em; font-weight:bold; text-align:center; + border-bottom: 1px solid silver ; } + +nav.sidetoc a:hover {text-decoration: underline ; } + + + +section.textbody { margin: 0ex 1em 0ex 1em ;} + + +div.multicolsheading { -webkit-column-span: all; + -moz-column-span: all; column-span: all; } +div.multicols { -webkit-columns: 3 380px ; + -moz-columns: 3 380px ; columns: 3 380px ; } +div.multicols p {margin-top: 0ex} + + +/* Used for xfrac and nicefrac: */ +span.numerator { + font-size: 60% ; + vertical-align: .4em ; +} + +span.denominator { + font-size: 60% +} + + +/* Used for algorithm2e: */ +div.alg2evline{ + margin-left: 1em ; + padding-left: 1em ; + border-left: 1px solid black ; + border-radius: 0px 0px 0px 1ex ; +} + +div.alg2evsline{ + margin-left: 1em ; + padding-left: 1em ; + border-left: 1px solid black ; +} + +div.alg2enoline{ + margin-left: 1em ; + padding-left: 1em ; +} + +span.alg2elinenumber{ + margin-right: .5em ; + font-size: 50% ; + color: red ; +} + + +/* Used for algorithmicx: */ +span.floatright { float: right ; } + + +/* keyfloat and tocdata: */ +.floatnotes { + margin: 0ex 5% 0ex 5% ; + padding: 0ex 1em 0ex 1em ; + font-size:.80em ; + text-align: left ; +} + +.authorartist{ + display:block ; + font-size:.70em ; + font-style: italic; +} + +nav .authorartist{ display:inline; } + + + +/* Native LaTeX theorems: */ + +.theoremcontents { font-style: italic; margin-top: 3ex ; margin-bottom: 3ex ; } +.theoremlabel { font-style: normal; font-weight: bold ; margin-right: .5em ; } + + +/* theorem, amsthm, and ntheorem packages */ + +span.theoremheader, +span.theoremheaderplain, +span.theoremheaderdefinition, +span.theoremheaderbreak, +span.theoremheadermarginbreak, +span.theoremheaderchangebreak, +span.theoremheaderchange, +span.theoremheadermargin +{ + font-style:normal ; font-weight: bold ; margin-right: 1em ; +} + +span.amsthmnameplain, +span.amsthmnamedefinition, +span.amsthmnumberplain, +span.amsthmnumberdefinition +{ + font-style:normal ; font-weight: bold ; +} + + +span.amsthmnameremark, +span.amsthmnumberremark +{font-style:italic ; font-weight: normal ; } + + +span.amsthmnoteplain, +span.amsthmnotedefinition +{font-style:normal ;} + + +span.theoremheaderremark, +span.theoremheaderproof, +span.amsthmproofname +{font-style:italic ; font-weight: normal ; margin-right: 1em ; } + +span.theoremheadersc +{ + font-style:normal ; + font-variant: small-caps ; + font-weight: normal ; + margin-right: 1em ; +} + +.theoremendmark {float:right} + +div.amsthmbodyplain, div.theorembodyplain, div.theorembodynonumberplain, +div.theorembodybreak, div.theorembodynonumberbreak, +div.theorembodymarginbreak, +div.theorembodychangebreak, +div.theorembodychange, +div.theorembodymargin +{ + font-style:italic; + margin-top: 3ex ; margin-bottom: 3ex ; +} + +div.theorembodydefinition, div.theorembodyremark, div.theorembodyproof, +div.theorembodyplainupright, nonumberplainuprightsc, +div.amsthmbodydefinition, div.amsthmbodyremark, +div.amsthmproof +{ + font-style: normal ; + margin-top: 3ex ; margin-bottom: 3ex ; +} + +span.amsthmnoteremark {} + + +/* For the backnaur package: */ +div.backnaur { + display: block ; + margin: 2ex 2em 2ex 2em ; +} + +div.backnaur p { + margin: .25ex 0ex .25ex 0ex ; +} + +div.backnaurprod { + display: inline-block ; + min-width: 8em ; + text-align:right ; +} + +div.backnaurdesc { + display: inline-block ; +} + + +/* For the notes package: */ +div.notesimportantnote, div.noteswarningnote, div.notesinformationnote { + clear: both ; + margin: 2ex 2em 2ex 2em ; + border: 1px solid silver ; +} + +div.notesicon { + float:left ; + display: inline-block ; + background: gold ; + padding: 0ex 1em 0ex 1em ; + margin-right: 1em ; + font-weight: bold ; +} + +div.notescontents { font-style: italic } + + +/* +For CSS LaTeX and related logos: +Based on spacing demonstrated by the metafont package. +*/ + +.latexlogofont { + font-family: "Linux Libertine O", "Nimbus Roman No 9 L", + "FreeSerif", "Hoefler Text", Times, "Times New Roman", serif; + font-variant: normal ; +} + +.latexlogo { + font-family: "Linux Libertine O", "Nimbus Roman No 9 L", + "FreeSerif", "Hoefler Text", Times, "Times New Roman", serif; + font-size: 1.1em; +} + +.latexlogosup { + text-transform: uppercase; + letter-spacing: .03em ; + font-size: 0.7em; + vertical-align: 0.25em; + margin-left: -0.4em; + margin-right: -0.15em; +} + +.latexlogosub { + text-transform: uppercase; + vertical-align: -0.27ex; + margin-left: -0.08em; + margin-right: -0.07em; + font-size: 1em; +} + +.latexlogotwoe { + text-transform: none ; + font-variant-numeric: oldstyle-nums ; +} + +.latexlogotwoesub { + font-style:italic ; + vertical-align: -0.27ex; + margin-left: -0.11em; + margin-right: -0.1em; + font-size: 1em; +} + +.xelatexlogo { + font-family: "Linux Libertine O", "Nimbus Roman No 9 L", + "FreeSerif", "Hoefler Text", Times, "Times New Roman", serif; + letter-spacing: .03em ; + font-size: 1.1em; +} + +.xelatexlogosub { + vertical-align: -0.27ex; + margin-left: -0.0667em; + margin-right: -.05em; + font-size: 1em; + letter-spacing: .03em ; +} + +.amslogo { + font-family: "TeXGyreChorus","URW Chancery L", + "Apple Chancery","ITC Zapf Chancery","Monotype Corsiva", + "Linux Libertine O", "Nimbus Roman No 9 L", "FreeSerif", + "Hoefler Text", Times, "Times New Roman", serif ; + font-style: italic ; +} + +.lyxlogo { + font-family: "URW Classico", Optima, "Linux Biolinum O", + "DejaVu Sans", "Bitstream Vera Sans", Geneva, + Verdana, sans-serif ; +} + + +/* Only display top and bottom navigation if a small screen: */ +/* Hide the sidetoc if a small screen: */ +nav.topnavigation { display:none; } +nav.botnavigation { display:none; } + +/* Only display the sidetoc's webpage title if a small screen */ +span.sidetocthetitle { display: none } + +@media screen and (max-width: 50em) { + div.sidetoccontainer { + float: none ; + width: 100% ; + padding: 0 ; + border-radius: 0 ; + border-bottom: 1px solid black ; + border-top: 1px solid black ; + box-shadow: none ; + } + span.sidetocthetitle { display: inline } + nav.botnavigation { display:block } + div.bodycontainer { width: 100% } + .marginpar { + max-width: 100%; + float: none; + display:block ; + margin: 1ex 1em 1ex 1em ; + } +} + +@media print { + body { + font-family: "Linux Libertine O", + "DejaVu Serif", "Bitstream Vera Serif", + "Liberation Serif", "Nimbus Roman No 9 L", + "FreeSerif", "Hoefler Text", Times, "Times New Roman", serif; + } + div.sidetoccontainer { display:none; } + nav.topnavigation { display: none; } + nav.botnavigation { display: none; } + div.bodycontainer { width: 100% } +} + +@media handheld { + div.sidetoccontainer { display:none; } + nav.topnavigation { display:block } + nav.botnavigation { display:block } + div.bodycontainer { width: 100% } +} + +@media projection { + div.sidetoccontainer { display:none; } + nav.topnavigation { display:block } + nav.botnavigation { display:block } + div.bodycontainer { width: 100% } +} +\end{filecontents*} +% \end{Verbatim}% for syntax highlighting +\end{LWRwriteconf} +% \end{macrocode} + + + + +% \subsection{\filenm{lwarp_sagebrush.css}} + +% \DescribeFile{lwarp_sagebrush.css} +% An optional \CSS\ which may be used for +% a semi-modern appearance. +% +% If used, this must be present both when compiling the project +% and also when distributing the \HTML\ files. +% +% \changes{v0.65}{2018/12/09}{\filenm{lwarp_sagebrush.css}: Side\TOC to left for improved \cs{marginpar}s.} +% \changes{v0.73}{2019/06/21}{\filenm{lwarp_formal.css}: Added \cs{book} for \pkg{memoir}.} +% +% ^^A *lwarp_sagebrush.css +% +% \codeconfig +% \begin{macrocode} +\begin{LWRwriteconf} +\begin{filecontents*}{lwarp_sagebrush.css} +@import url("lwarp.css") ; + + +A:link {color:#105030 ; text-decoration: none ; } +A:visited {color:#705030 ; text-shadow:1px 1px 2px #a0a0a0;} +A:hover {color:#006000 ; text-decoration: underline ; text-shadow:0px 0px 2px #a0a0a0;} +A:active {color:#00C000 ; text-shadow:1px 1px 2px #a0a0a0;} + + + +div.book, h1, h2, h3, h4, h5, h6, span.paragraph, span.subparagraph +{ + font-family: "URW Classico", Optima, "Linux Biolinum O", + "Linux Libertine O", "Liberation Serif", + "Nimbus Roman No 9 L", "FreeSerif", + "Hoefler Text", Times, "Times New Roman", serif; + font-variant: small-caps ; + font-weight: normal ; + color: #304070 ; + text-shadow: 2px 2px 3px #808080; +} + +h1 { /* title of the entire website, used on each page */ + font-variant: small-caps ; + color: #304070 ; + text-shadow: 2px 2px 3px #808080; + background-color: #F7F7F0 ; + background-image: linear-gradient(to bottom, #F7F7F0, #C0C0C4); +} + +h1 { + border-bottom: 1px solid #304070; +/* border-top: 2px solid #304070; */ +} + +h2 { + border-bottom: 1px solid #304070; +/* border-top: 2px solid #304070; */ + background-color: #F7F7F0 ; + background-image: linear-gradient(to bottom, #F7F7F0, #DAD0C0); +} + + + +div.abstract { + background: #f5f5eb ; + background-image: linear-gradient(to bottom, #f5f5eb, #C8C8B8); + + border: 1px solid silver; + border-radius: 1em ; +} + +div.abstract dl {line-height:1.5;} +div.abstract dt {color:#304070;} + +div.abstracttitle{ + font-family: "URW Classico", Optima, "Linux Biolinum O", + "Linux Libertine O", "Liberation Serif", "Nimbus Roman No 9 L", + "FreeSerif", "Hoefler Text", Times, "Times New Roman", serif; + font-weight:bold; + font-variant: small-caps ; + font-size:1.5em; + border-bottom: 1px solid silver ; + color: #304070 ; + text-align: center ; + text-shadow: 1px 1px 2px #808080; +} + +span.abstractrunintitle{ + font-family: "URW Classico", Optima, "Linux Biolinum O", + "Linux Libertine O", "Liberation Serif", "Nimbus Roman No 9 L", + "FreeSerif", "Hoefler Text", Times, "Times New Roman", serif; + font-weight:bold; +} + + +div.epigraph, div.dictum { + background: #f5f5eb ; + background-image: linear-gradient(to bottom, #f5f5eb, #C8C8B8); + + border: 1px solid silver ; + border-radius: 1ex ; + box-shadow: 3px 3px 3px #808080 ; +} + + +.example { + background-color: #f5f5eb ; + background-image: linear-gradient(to bottom, #f5f5eb, #C8C8B8); + +} + +div.exampletitle{ + font-family: "URW Classico", Optima, "Linux Biolinum O", + "Linux Libertine O", "Liberation Serif", "Nimbus Roman No 9 L", + "FreeSerif", "Hoefler Text", Times, "Times New Roman", serif; + font-weight:bold; + font-variant: small-caps ; + border-bottom: 1px solid silver ; + color: #304070 ; + text-align: center ; + text-shadow: 1px 1px 2px #808080; +} + + +.sidebar { + background-color: #f5f5eb ; + background-image: linear-gradient(to bottom, #f5f5eb, #C8C8B8); + +} + +div.sidebartitle{ + font-family: "URW Classico", Optima, "Linux Biolinum O", + "Linux Libertine O", "Liberation Serif", "Nimbus Roman No 9 L", + "FreeSerif", "Hoefler Text", Times, "Times New Roman", serif; + font-weight:bold; + font-variant: small-caps ; + border-bottom: 1px solid silver ; + color: #304070 ; + text-align: center ; + text-shadow: 1px 1px 2px #808080; +} + + +.fancyvrblabel { + font-family: "URW Classico", Optima, "Linux Biolinum O", + "Linux Libertine O", "Liberation Serif", "Nimbus Roman No 9 L", + "FreeSerif", "Hoefler Text", Times, "Times New Roman", serif; + font-weight:bold; + font-variant: small-caps ; + font-size: 1.5em ; + color: #304070 ; + text-align: center ; + text-shadow: 1px 1px 2px #808080; +} + +div.minipage { + background-color: #eeeee7 ; + border: 1px solid silver ; + border-radius: 1ex ; +} + +table div.minipage { background: none ; border: none ; } + +div.framebox div.minipage {border:none ; background:none} + +section.textbody > div.minipage { + box-shadow: 3px 3px 3px #808080 ; +} + +div.fboxBlock div.minipage { box-shadow: none ; } + +.framed .minipage , .framedleftbar .minipage { + border: none ; + background: none ; + padding: 0ex ; + margin: 0ex ; +} + +figure.figure .minipage, div.figurecaption .minipage { border: none; } + +div.marginblock div.minipage , +div.marginparblock div.minipage + { border: none; } + +figure , div.marginblock { + background-color: #eeeee7 ; + border: 1px solid silver ; + border-radius: 1ex ; + box-shadow: 3px 3px 3px #808080 ; +} + +figure figure { + border: 1px solid silver ; + margin: 0em ; + box-shadow: none ; +} + +/* +div.figurecaption { + border-top: 1px solid silver ; + border-bottom: 1px solid silver ; + background-color: #e8e8e8 ; +} +*/ + + +div.table { + box-shadow: 3px 3px 3px #808080 ; +} + +/* +.tnotes { + background: #e8e8e8; + border: 1px solid silver; +} +*/ + + +nav.topnavigation{ + background-color: #b0b8b0 ; + background-image: linear-gradient(to bottom,#e0e0e0,#b0b8b0) ; +} + +nav.botnavigation{ + background-color: #b0b8b0 ; + background-image: linear-gradient(to top,#e0e0e0,#b0b8b0) ; +} + + + +header{ + background-color: #F7F7F0 ; + background-image: linear-gradient(to top, #F7F7F0, #b0b8b0); +} + +footer{ + background-color: #F7F7F0 ; + background-image: linear-gradient(to bottom, #F7F7F0, #b0b8b0); +} + + + +div.sidetoccontainer { + background-color: #F7F7F0 ; + background-image: linear-gradient(to bottom, #F7F7F0, #C0C0C0); + box-shadow: 3px 3px 3px #808080 ; + } + +div.sidetoctitle {color: #304070 ; } + +nav.sidetoc a:hover { + color:#006000 ; + text-decoration: none ; + text-shadow:0px 0px 2px #a0a0a0; +} + + +@media screen and (max-width: 45em) { + div.sidetoccontainer { border-radius: 0 ; } +} + + +\end{filecontents*} +% \end{Verbatim}% for syntax highlighting +\end{LWRwriteconf} +% \end{macrocode} + + + + +% \subsection{\filenm{lwarp_formal.css}} + +% \DescribeFile{lwarp_formal.css} +% An optional \CSS\ which may be used for +% a more formal appearance. +% +% If used, this must be present both when compiling the project +% and also when distributing the \HTML\ files. +% +% \changes{v0.62}{2018/11/10}{\filenm{lwarp_formal.css}: Fix: Font for verse.} +% \changes{v0.65}{2018/12/09}{\filenm{lwarp_formal.css}: Side\TOC to left for improved \cs{marginpar}s.} +% \changes{v0.66}{2019/01/02}{\filenm{lwarp_formal.css}: Improved \CSS\ for table notes.} +% \changes{v0.73}{2019/06/21}{\filenm{lwarp_formal.css}: Added \cs{book} for \pkg{memoir}.} +% +% ^^A *lwarp_formal.css +% +% \codeconfig +% \begin{macrocode} +\begin{LWRwriteconf} +\begin{filecontents*}{lwarp_formal.css} +@import url("lwarp.css") ; + + + +A:link {color:#802020 ; text-decoration:none; } +A:visited {color:#802020 ; text-shadow:none ;} +A:hover {color:#400000 ; text-shadow:none ;} +A:active {color:#C00000 ; text-shadow:none ;} + + +body { + font-family: "Linux Libertine O", "Hoefler Text", "Garamond", + "Bembo", "Janson", "TeX Gyre Pagella", "Palatino", + "Liberation Serif", "Nimbus Roman No 9 L", "FreeSerif", Times, + "Times New Roman", serif; + background: #fffcf5; +} + +span.textrm { + font-family: "Linux Libertine O", "Hoefler Text", "Garamond", + "Bembo", "Janson", "TeX Gyre Pagella", "Palatino", + "Liberation Serif", "Nimbus Roman No 9 L", "FreeSerif", Times, + "Times New Roman", serif; +} + +span.textsf { + font-family: "DejaVu Sans", "Bitstream Vera Sans", + Geneva, Verdana, sans-serif ; +} + + + +div.book, h1, h2, h3, h4, h5, h6, span.paragraph, span.subparagraph +{ + font-family: "Linux Libertine O", "Hoefler Text", "Garamond", + "Bembo", "Janson", "TeX Gyre Pagella", "Palatino", + "Liberation Serif", "Nimbus Roman No 9 L", "FreeSerif", Times, + "Times New Roman", serif; + color: #800000 ; + text-shadow: none ; +} + +h1, h2 { + background-color: #fffcf5 ; + background-image: none ; + border-bottom: 1px solid #808080; +/* border-top: 2px solid #808080; */ +} + +div.abstracttitle { + font-family: "Linux Libertine O", "Hoefler Text", "Garamond", + "Bembo", "Janson", "TeX Gyre Pagella", "Palatino", + "Liberation Serif", "Nimbus Roman No 9 L", "FreeSerif", Times, + "Times New Roman", serif; + color: black ; + text-shadow: none ; +} + +span.abstractrunintitle { + font-family: "Linux Libertine O", "Hoefler Text", "Garamond", + "Bembo", "Janson", "TeX Gyre Pagella", "Palatino", + "Liberation Serif", "Nimbus Roman No 9 L", "FreeSerif", Times, + "Times New Roman", serif; + color: black ; + text-shadow: none ; +} + +div.abstract { font-size: 100% } + +.sidebar { + background: #fffcf5; + background-image: none ; + margin: 2em 5% 2em 5%; + padding: 0.5em 1em; + border: none ; + border-top : 1px solid silver; + border-bottom : 1px solid silver; + font-size: 90% ; +} + +div.sidebartitle{ + font-family: "Linux Libertine O", "Hoefler Text", "Garamond", + "Bembo", "Janson", "TeX Gyre Pagella", "Palatino", + "Liberation Serif", "Nimbus Roman No 9 L", "FreeSerif", Times, + "Times New Roman", serif; + color: #800000 ; + text-shadow: none ; + border: none ; +} + +.example { + background: #fffcf5; + background-image: none ; + margin: 2em 5% 2em 5%; + padding: 0.5em 1em; + border: none ; + border-top : 1px solid silver; + border-bottom : 1px solid silver; +} + +div.exampletitle{ + font-family: "Linux Libertine O", "Hoefler Text", "Garamond", + "Bembo", "Janson", "TeX Gyre Pagella", "Palatino", + "Liberation Serif", "Nimbus Roman No 9 L", "FreeSerif", Times, + "Times New Roman", serif; + color: #800000 ; + text-shadow: none ; + border: none ; +} + +div.fancyvrblabel{ + font-family: "Linux Libertine O", "Hoefler Text", "Garamond", + "Bembo", "Janson", "TeX Gyre Pagella", "Palatino", + "Liberation Serif", "Nimbus Roman No 9 L", "FreeSerif", Times, + "Times New Roman", serif; + color: #800000 ; + text-shadow: none ; + border: none ; +} + + + +figure { + margin: 5ex 5% 5ex 5% ; + padding: 1ex 1em 1ex 1em ; + background-color: #fffcf5 ; + overflow-x: auto ; + border: none ; +/* border-top: 1px solid silver; */ +/* border-bottom: 1px solid silver; */ +} + + +div.figurecaption , .lstlisting { + border: none ; +/* border-top: 1px solid silver ; */ +/* border-bottom: 1px solid silver ; */ + background-color: #fffcf5 ; +} + +.tnotes { + background: #fffcf5 ; + border-top: 1px solid silver ; + border-bottom: 1px solid silver ; +} + +.theorem { + background: none ; +} + +.minipage { + background-color: #fffcf5 ; + border: none ; +} + +div.floatrow figure { border: none ; } + +figure figure { border: none ; } + + +nav.toc, nav.lof, nav.lot, nav.lol { + font-family: "Linux Libertine O", "Hoefler Text", "Garamond", + "Bembo", "Janson", "TeX Gyre Pagella", "Palatino", + "Liberation Serif", "Nimbus Roman No 9 L", "FreeSerif", Times, + "Times New Roman", serif; +} + +div.sidetoccontainer { + font-family: "Linux Libertine O", "Hoefler Text", "Garamond", + "Bembo", "Janson", "TeX Gyre Pagella", "Palatino", + "Liberation Serif", "Nimbus Roman No 9 L", "FreeSerif", Times, + "Times New Roman", serif; + background-image: linear-gradient(to bottom, #fffcf5, #C0C0C0); +} + +div.sidetoctitle{ + color: #800000 ; +} + +header{ + background-color: #e0e0e0 ; + background-image: linear-gradient(to top, #fffcf5, #b0b0b0); + text-align:center ; +} + +footer{ + background-color: #e0e0e0 ; + background-image: linear-gradient(to bottom, #fffcf5, #b0b0b0); + padding: 2ex 1em 2ex 1em ; + text-align:left ; +} + +nav.botnavigation { + background: #dedcd5 ; + border-top: 1px solid black ; +} +\end{filecontents*} +% \end{Verbatim}% for syntax highlighting +\end{LWRwriteconf} +% \end{macrocode} + + + +% \subsection{\filenm{sample_project.css}} + +% \DescribeFile{sample_project.css} +% The project-specific \CSS\ file. Use with \cs{CSSFilename}. +% +% If used, this must be present both when compiling the project +% and also when distributing the \HTML\ files. +% +% ^^A *sample_project.css +% +% \codeconfig +% \begin{macrocode} +\begin{LWRwriteconf} +\begin{filecontents*}{sample_project.css} +/* ( --- Start of project.css --- ) */ +/* ( --- A sample project-specific CSS file for lwarp --- ) */ + +/* Uncomment one of the following: */ +@import url("lwarp.css") ; +/* @import url("lwarp_formal.css") ; */ +/* @import url("lwarp_sagebrush.css") ; */ + +/* Project-specific CSS setting follow here. */ +/* . . . */ + +/* ( --- End of project.css --- ) */ +\end{filecontents*} +% \end{Verbatim}% for syntax highlighting +\end{LWRwriteconf} +% \end{macrocode} + + +% \subsection{\filenm{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 +% +% \codeconfig +% \begin{macrocode} +\begin{LWRwriteconf} +\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{LWRwriteconf} +% \end{macrocode} + + + +% \subsection{\filenm{lwarp.xdy}} + +% \DescribeFile{lwarp.xdy} +% 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. +% +% 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 +% +% \codeconfig +% \begin{macrocode} +\begin{LWRwriteconf} +\begin{filecontents*}{lwarp.xdy} +(require "tex/inputenc/latin.xdy") +(merge-rule "\\PS *" "Postscript") +(require "texindy.xdy") +(require "page-ranges.xdy") +(require "book-order.xdy") +(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" + "Roman-page-numbers" + "Alpha-page-numbers" + "see" + "seealso")) +\end{filecontents*} +% \end{Verbatim}% for syntax highlighting +\end{LWRwriteconf} +% \end{macrocode} + + +% \subsection{\filenm{lwarp_one_limage.cmd}} +% +% \DescribeFile{lwarp_one_limage.cmd} +% Used by \pkg{lwarp} to help make \env{lateximage}s when using \brand{Windows}. +% +% This must be present when compiling the project, +% but does not need to be present when distributing +% the resulting \HTML\ files. +% +% The arguments are each of the three fields from \filenm{-images.txt}, +% and also the base name of the source file. +% +% \prog{MiKTeX} does not allow file \filenm{lwarp_one_limage.cmd} to be +% created directly by \prog{lwarpmk}, so \filenm{lwarp_one_limage.txt} is created instead, +% then copied to \filenm{lwarp_one_limage.cmd} by \prog{lwarpmk}. +% This occurs each time \prog{lwarpmk} used to create \env{lateximage}s. +% +% \changes{v0.50}{2018/02/27}{\filenm{lwarp_one_limage.txt}: Added.} +% \changes{v0.51}{2018/03/16}{\filenm{lwarp_one_limage.txt}: \prog{pdftocairo} \optn{-noshrink} added.} +% \changes{v0.66}{2019/01/30}{\filenm{lwarp_one_limage.txt}: Image directory and prefix.} +% +% ^^A *lwarp_one_limage.txt +% +% \codeconfig +% \begin{macrocode} +\begin{LWRwriteconf} +\immediate\openout\LWR@quickfile=lwarp_one_limage.txt +\immediate\write\LWR@quickfile{% + pdfseparate -f \LWRpercent 1 -l \LWRpercent 1 \LWRpercent 4_html.pdf % + \LWR@ImagesDirectory\OSPathSymbol lateximagetemp-\LWRpercent\LWRpercent d.pdf% +} +\immediate\write\LWR@quickfile{% + pdfcrop --hires \LWR@ImagesDirectory\OSPathSymbol lateximagetemp-\LWRpercent 1.pdf % + \LWR@ImagesDirectory\OSPathSymbol\LWRpercent 3.pdf% +} +\immediate\write\LWR@quickfile{% + pdftocairo -svg -noshrink \LWR@ImagesDirectory\OSPathSymbol\LWRpercent 3.pdf % + \LWR@ImagesDirectory\OSPathSymbol\LWRpercent 3.svg% +} +\immediate\write\LWR@quickfile{% + del \LWR@ImagesDirectory\OSPathSymbol\LWRpercent 3.pdf% +} +\immediate\write\LWR@quickfile{% + del \LWR@ImagesDirectory\OSPathSymbol lateximagetemp-\LWRpercent 1.pdf% +} +\immediate\write\LWR@quickfile{exit} +\immediate\closeout\LWR@quickfile +\end{LWRwriteconf} +% \end{macrocode} + + + +% \subsection{\filenm{lwarp_mathjax.txt}} + +% \DescribeFile{lwarp_mathjax.txt} +% The default MathJax script used by \pkg{lwarp} when using \brand{MathJax}. +% A recent version of MathJax is used, as served by the recommended repository. +% Adjustments are made to allow \LaTeX\ to control the equation tags. +% +% \cs{MathJaxFilename} determines which script file is copied into the \HTML\ pages, +% and defaults to \filenm{lwarp_mathjax.txt}. +% The script files must be present when compiling the project, +% but do not need to be present when distributing +% the resulting \HTML\ files. +% +% \gindex{MathJax=\brand{MathJax}>custom script} +% \trouble{MathJax=\brand{MathJax}>custom script} +% To generate a custom script, such as to use a local repository, +% \margintag{custom script} +% copy \filenm{lwarp_mathjax.txt} to a new file, +% make changes while keeping \pkg{lwarp}'s adjustments for equation numbering, +% and use \cs{MathJaxFilename} to select new filename. +% +% \changes{v0.28}{2017/04/11}{File: \filenm{lwarp_mathjax.txt}: Updated \protect\acro{CDN} repository.} +% \changes{v0.30}{2017/04/26}{Fix: \filenm{lwarp_mathjax.txt}: Only written in print mode.} +% \changes{v0.34}{2017/07/27}{File: \filenm{lwarp_mathjax.txt}: Version change.} +% \changes{v0.42}{2017/10/16}{File: \filenm{lwarp_mathjax.txt}: Updated \pkg{siunitx} script.} +% \changes{v0.45}{2017/12/21}{File: \filenm{lwarp_mathjax.txt}: Allow \brand{MathJax} inside \env{tabbing}.} +% \changes{v0.45}{2018/01/23}{File: \filenm{lwarp_mathjax.txt}: Allow \brand{MathJax} inside \env{verse}.} +% \changes{v0.59}{2018/07/13}{File: \filenm{lwarp_mathjax.txt}: Updated to MathJax v2.7.4.} +% \changes{v0.59}{2018/07/16}{File: \filenm{lwarp_mathjax.txt}: Fix: Removed chapter number from tagged non-numeric MathJax equations.} +% \changes{v0.62}{2018/11/05}{File: \filenm{lwarp_mathjax.txt}: Removed inoperable \pkg{siunitx} extension.} +% \changes{v0.70}{2019/03/24}{File: \filenm{lwarp_mathjax.txt}: Updated to MathJax v2.7.5.} +% \changes{v0.70}{2019/03/24}{File: \filenm{lwarp_mathjax.txt}: Loads \filenm{autoload-all.js} extension.} +% +% ^^A *lwarp_mathjax.txt +% +% \codeconfig +% \begin{macrocode} +\begin{LWRwriteconf} +\begin{filecontents*}{lwarp_mathjax.txt} + + + + + + + + + + + + + + +\end{filecontents*} +% \end{Verbatim}% for syntax highlighting +\end{LWRwriteconf} +% \end{macrocode} + +% ^^A A possible addition for siuntix: +% ^^A +% ^^A +% ^^A + + + +% ^^A \subsection{\filenm{lwarp_KaTeX.txt}} + +% ^^A \DescribeFile{lwarp_KaTeX.txt} +% ^^A Used by \pkg{lwarp} when using Ka\TeX. +% +% ^^A This must be present when compiling the project, +% ^^A but does not need to be present when distributing +% ^^A the resulting \HTML\ files. +% +% ^^A \changes{v0.59}{2018/11/03}{File: \filenm{lwarp_KaTeX.txt}: Added.} +% +% +% ^^A ^^A *lwarp_KaTeX.txt +% +% ^^A \codeconfig +% ^^A \begin{macrocode} +% ^^A \begin{LWRwriteconf} +% ^^A \begin{filecontents*}{lwarp_KaTeX.txt} +% ^^A +% ^^A +% ^^A +% ^^A \end{filecontents*} +% ^^A % \end{Verbatim}% for syntax highlighting +% ^^A \end{LWRwriteconf} +% ^^A \end{macrocode} + + + +% \subsection{\filenm{lwarpmk.lua} — \optn{lwarpmk} option} + +% \DescribeOption{lwarpmk} Creates a local copy of \prog{lwarpmk}. +% +% \DescribeProgram{lwarpmk} Command-line utility to process \pkg{lwarp} files and images. +% +% \env{lateximage}s and \SVG\ math images are generated using +% \margintag{parallel processing} +% \gindex{image>processing} +% \gindex{lateximage>processing} +% \gindex{SVG>image processing} +% multiple processes in parallel. +% For \brand{Unix} and \brand{Linux}, every 32 images the |wait| command is +% issued to wait for the previous batch of images to finish processing before +% starting a new batch. +% For \brand{Windows}, every 32 images one task is dispatched with +% \begin{sourcedisplay} +% START /B /WAIT /BELOWNORMAL +% \end{sourcedisplay} +% which causes the operating system to wait until this lesser-priority tasks finishes, +% hopefully also waiting for the normal priority tasks which were already in +% progress to also complete. Afterwards, the next batch of images is started. +% +% \changes{v0.21}{2017/02/11}{\prog{lwarpmk}: Fix: \cmds{lwarpmk again} for \brand{Windows}.} +% \changes{v0.21}{2017/02/22}{\prog{lwarpmk}: Fix: \cmds{lwarpmk limages} for \brand{Windows}.} +% \changes{v0.21}{2017/02/22}{\prog{lwarpmk}: Fix: \prog{lwarpmk} uses \filenm{lateximages} text file instead of shell script.} +% \changes{v0.28}{2017/04/14}{\prog{lwarpmk}: Add: \cmds{printglossary} and \cmds{htmlglossary} commands.} +% \changes{v0.29}{2017/04/15}{\prog{lwarpmk}: Add: \optn{language} option for config files.} +% \changes{v0.30}{2017/04/22}{\prog{lwarpmk}: \optn{language} now used for both index and glossary generation.} +% \changes{v0.30}{2017/04/22}{\prog{lwarpmk}: Fix: \prog{xindy} now used for print index generation with \prog{latexmk}.} +% \changes{v0.30}{2017/04/28}{\prog{lwarpmk}: Fix: \prog{xindy} and \prog{texindy} +% adjusted for \prog{pdflatex}, \prog{xelatex} and \prog{lualatex}.} +% \changes{v0.30}{2017/04/28}{\prog{lwarpmk}: Add: \optn{xdyfile} configuration option.} +% \changes{v0.32}{2017/06/08}{\prog{lwarpmk}: Fix: \cmds{io.lines()} changed to \cmds{file:lines()} +% due to \prog{luatex} changes.} +% \changes{v0.37}{2017/08/19}{\prog{lwarpmk}: Removes additional \HTML\ \filenm{aux} files.} +% \changes{v0.38}{2017/08/24}{\prog{lwarpmk}: Added \cmds{print1} and \cmds{html1} actions.} +% \changes{v0.47}{2018/01/24}{\prog{lwarpmk}: \prog{pdfcrop}: Removed \optn{hires} option for improved crop accuracy.} +% \changes{v0.50}{2018/02/22}{\prog{lwarpmk}: MD5 hash avoids duplicate \SVG\ math.} +% \changes{v0.50}{2018/02/27}{\prog{lwarpmk}: Multiprocess support making lateximages.} +% \changes{v0.50}{2018/02/28}{\prog{lwarpmk}: Error if \filenm{lateximages.txt} does not exist.} +% \changes{v0.50}{2018/02/28}{\prog{lwarpmk}: Error if \filenm{lwarpmk.conf} points to \pkg{lwarp}.} +% \changes{v0.50}{2018/02/28}{\prog{lwarpmk}: Improved error messages.} +% \changes{v0.51}{2018/03/14}{\prog{lwarpmk}: \prog{pdfcrop}: Restored \optn{hires} option.} +% \changes{v0.51}{2018/03/16}{\prog{lwarpmk}: \prog{pdftocairo} \optn{-noshrink} added.} +% \changes{v0.52}{2018/03/31}{\prog{lwarpmk}: Fix: Memory overflow when spawning tasks.} +% \changes{v0.52}{2018/04/01}{\prog{lwarpmk}: Fix: Skip image generation if from page 0.} +% \changes{v0.53}{2018/04/01}{\prog{lwarpmk}: Added warning for corrupted images.} +% \changes{v0.53}{2018/04/01}{\prog{lwarpmk}: Added \cmds{lwarpmk cleanlimages}.} +% \changes{v0.54}{2018/04/06}{\prog{lwarpmk}: Changed \optn{xdyfile} to \optn{xindystyle}.} +% \changes{v0.54}{2018/04/06}{\prog{lwarpmk}: Changed \optn{language} to \optn{xindylanguage}.} +% \changes{v0.54}{2018/04/06}{\prog{lwarpmk}: Added \optn{xindycodepage}.} +% \changes{v0.54}{2018/04/06}{\prog{lwarpmk}: Added \optn{pdftotextenc}.} +% \changes{v0.54}{2018/04/09}{\prog{lwarpmk}: Increased prominence for error for an unknown command.} +% \changes{v0.54}{2018/04/11}{\prog{lwarpmk}: Verifies image references before \progcode{lwarpmk limages}.} +% \changes{v0.54}{2018/04/11}{\prog{lwarpmk}: Verifies \HTML\ version exists before \progcode{lwarpmk limages}.} +% \changes{v0.54}{2018/04/19}{\prog{lwarpmk}: Improved error if configuration file does not exist.} +% \changes{v0.56}{2018/04/29}{\prog{lwarpmk}: Added \progcode{lwarpmk pdftosvg}.} +% \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.} +% \changes{v0.59}{2018/07/29}{\prog{lwarpmk}: Warning if operating system changed.} +% \changes{v0.59}{2018/07/29}{\prog{lwarpmk}: Error if \filenm{lwarpmk.conf} format changed.} +% \changes{v0.59}{2018/08/05}{\prog{lwarpmk}: Double insead of single-dashed \optn{-\/-shell-escape} option.} +% \changes{v0.59}{2018/08/21}{\prog{lwarpmk}: Consolidated compiling options into \optn{printlatexcmd} and \optn{HTMLlatexcmd}.} +% \changes{v0.59}{2018/09/06}{\prog{lwarpmk}: Added \cmds{lwarpmk epstopdf}.} +% \changes{v0.66}{2019/01/27}{\prog{lwarpmk}: Added \optn{ImagesDirectory} and \optn{ImagesName}.} +% \changes{v0.66}{2019/01/30}{\prog{lwarpmk}: Fix for \cmds{cleanlimages}.}% +% \changes{v0.68}{2019/03/02}{\prog{lwarpmk}: Improved error handling if incomplete compile.}% +% \changes{v0.71}{2019/04/11}{\prog{lwarpmk}: If wrong \filenm{lwarpmk.conf} version, +% or wrong OS, +% displays the print command to recompile.}% +% +% The following is only generated if the \optn{lwarpmk} option +% was given to \pkg{lwarp}. +% \begin{macrocode} +\begin{LWR@createlwarpmk} +% \end{macrocode} +% +% ^^A *lwarpmk.lua +% \begin{macrocode} +\begin{filecontents*}{lwarpmk.lua} +#!/usr/bin/env texlua + +-- Copyright 2016-2019 Brian Dunn + + +printversion = "v0.73" +requiredconfversion = "2" -- also at *lwarpmk.conf + +function printhelp () +print ("lwarpmk: Use lwarpmk -h or lwarpmk --help for help.") ; +end + + +function printusage () +-- +-- Print the usage of the lwarpmk command: +-- +print ( [[ + +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 : Converts each PDF file to SVG. +lwarpmk epstopdf : Converts each EPS file to PDF. +lwarpmk clean [-p project]: Remove *.aux, *.toc, *.lof/t, + *.idx, *.ind, *.log, *_html_inc.*, .gl* +lwarpmk cleanall [-p project]: Remove auxiliary files, 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 () +end + + +function splitfile (destfile,sourcefile) +-- +-- Split one large sourcefile into a number of files, +-- starting with destfile. +-- The file is split at each occurance of