% % \iffalse meta-comment % % Copyright 2016-2017 Brian Dunn % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either version 1.3 % of this license or (at your option) any later version. % The latest version of this license is in % http://www.latex-project.org/lppl.txt % and version 1.3 or later is part of all distributions of LaTeX % version 2005/12/01 or later. % % \fi % % \iffalse %\NeedsTeXFormat{LaTeX2e}[1999/12/01] %\ProvidesPackage{lwarp} % [2017/04/15 v0.29 Allows LaTeX to directly produce HTML5 output.] % %<*driver> \documentclass{ltxdoc} \usepackage{lmodern} % \usepackage{libertine} \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}} \usepackage[log-declarations=false]{xparse} \usepackage[lwarpmk]{lwarp-newproject} \usepackage{lwarp} \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{graphicx} \graphicspath{{images/}} \usepackage{enumitem} \usepackage{array} \usepackage{longtable} \usepackage{booktabs} \usepackage[normalem]{ulem} \usepackage{fancyvrb} \usepackage{capt-of} \usepackage{comment} \excludecomment{testing} % \usepackage{morefloats} % \usepackage{marginfix} \usepackage{tocloft} \renewcommand{\cftpartfont}{\Large\bfseries} \setlength{\cftsecnumwidth}{2.5em} \setlength{\cftsubsecnumwidth}{3em} \setlength{\cftsubsubsecindent}{2.8em} \setlength{\cftsubsubsecnumwidth}{4em} \usepackage{titleps} \newpagestyle{pageheadfoot}{ \headrule \sethead{\pkg{lwarp}}{}{\thepage} % \renewcommand{\makefootrule}{\rule[2.5ex]{\linewidth}{.4pt}} \setfoot{}{}{} } \pagestyle{pageheadfoot} \usepackage{dtxdescribe} \newcommand{\ItemDescribeMacro}[1]{% \item[\cmd{#1}:]% \setlength{\parskip}{1.5ex}% \DescribeMacro{#1}% } \newcommand{\ItemDescribeEnv}[1]{% \item[\env{#1}:]% \setlength{\parskip}{1.5ex}% \DescribeEnv{#1}% } \newcommand{\ItemDescribeCounter}[1]{% \item[\texttt{#1}:]% \setlength{\parskip}{1.5ex}% \DescribeCounter{#1}% } \newcommand{\ItemDescribeBoolean}[1]{% \item[\texttt{#1}:]% \setlength{\parskip}{1.5ex}% \DescribeBoolean{#1}% } \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}} \newcommand{\lmacro}[1]{\textbackslash#1} \newcommand{\cmds}[1]{\texttt{#1}} \newcommand{\env}[1]{\texttt{#1}} \newcommand{\pkg}[1]{\textsf{#1}} \newcommand{\acro}[1]{\textsc{\lowercase{#1}}} \newcommand{\tag}[1]{\texttt{<#1>}} \newcommand{\TOC}{\acro{TOC}} \newcommand{\LOF}{\acro{LOF}} \newcommand{\LOT}{\acro{LOT}} \newcommand{\HTML}{\acro{HTML}} \newcommand{\HTMLfive}{\HTML\oldstylenums{5}} \newcommand{\CSS}{\acro{CSS}} \newcommand{\CSSthree}{\CSS\oldstylenums{3}} \newcommand{\EPUB}{\acro{EPUB}} \newcommand{\SVG}{\acro{SVG}} \newcommand{\PNG}{\acro{PNG}} \newcommand{\JPG}{\acro{JPG}} \newcommand{\PDF}{\acro{PDF}} \newcommand{\tikz}{Ti\textit{k}z} \newcommand{\MathML}{Math\acro{ML}} \newcommand{\CTAN}{\acro{CTAN}} \newcommand{\TDS}{\acro{TDS}} \newcommand{\goesto}{$\Rightarrow$} \newcommand{\credits}[1]{{\footnotesize(\textit{Based on original 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{\userentry}[1]{% \leavevmode\smallskip\newline \hspace*{2em}\begin{minipage}{\linewidth-2em} {\footnotesize Enter~$\Rightarrow$}\quad\texttt{#1} \end{minipage} \unskip\smallskip } \newenvironment{sourcedisplay} { \leavevmode\smallskip\newline \hspace*{2em}\minipage{\linewidth-2em} \ttfamily } { \endminipage \unskip\smallskip } \newenvironment{UIdisplay} { \leavevmode\smallskip\newline \hspace*{2em}\minipage{\linewidth-2em} \sffamily } { \endminipage \unskip\smallskip } \newenvironment{docsidebar}[1][] {% \ifthenelse{\isempty{#1}}{}{\medskip}% \hfill\minipage{.9\linewidth}% \setlength{\parskip}{1.5ex}% \ifthenelse{\isempty{#1}}{}{\textit{#1}}% \leavevmode\smallskip\hrule% } {\smallskip\hrule\endminipage\hspace*{\fill}\bigskip} % \makeatletter % \newcommand{\watchout}[1][]{% % \@bsphack% % \marginpar{\raggedleft\textcolor{blue!70!black}{#1} \quad \includegraphics[height=3ex]{symbol_warning.pdf}} % \@esphack% % } % \makeatother \newcommand{\pdflatexonly}{ \textcolor{red}{Only pre-loaded if \texttt{pdflatex} is being used.} \marginpar{\raggedleft\textcolor{blue!70!black}{\texttt{pdflatex} only:}} } % \newcommand{\margintag}[1]{% % \marginpar{\raggedleft\textcolor{blue!70!black}{#1}}% % } % The following text is used in multiple places in the documentation: \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{\limitspageref}{\pkg{cleveref} and \pkg{varioref} are supported, but printed page numbers do not map to \HTML. See \cref{sec:successfulcommands} to redefine the message which is printed for page number references. } \newcommand{\limitsabstract}{% \pkg{abstract} is supported. If using the \texttt{number} option with file splits, be sure to place the table of contents before the abstract. The 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{\limitstext}{\cs{textbf}, etc.\ are supported, but \cs{bfseries}, etc.\ are not yet supported.} \newcommand{\limitsfootnotes}{ \pkg{lwarp} uses native \LaTeX\ footnote code, although with its own \cs{box} to avoid the \LaTeX\ output routine. The usual functions work as-is. } \newcommand{\limitsverse}{% \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{docsidebar} \raggedright \ttfamily \cs{begin}\{warpHTML\} \cs{let}\cs{attrib}\cs{attribution} \cs{end}\{warpHTML\} \end{docsidebar} \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 \texttt{pdftotext}'s ability to discern the layout (\texttt{-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}{% The size of the math and text used \margintag{SVG image font size} in the \SVG\ image may be adjusted \index{font>size --- lateximage}% \index{font>size --- math, SVG}% \index{math>font size --- SVG}% \index{lateximages>font size}% by setting \cs{LateximageFontSizeName} to a font size name --- \emph{without the backslash}, for ex: \\ \hspace*{.5in}\texttt{\cs{renewcommand}\{\cs{LateximageFontSizeName}\}\{\textcolor{red}{large}\}} } \newcommand{\limitsmath}{% Math may be rendered as \SVG\ graphics or using the \textsc{MathJax} JavaScript display engine. \index{JavaScript>MathJax} For \SVG\ math, \margintag{SVG math option} math is rendered as usual by \LaTeX{} into the initial \PDF\ file using the \index{math>SVG summary}% \index{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\ \texttt{ALT} tag carries the \LaTeX{} code which generated the math, allowing copy/paste of the \LaTeX{} math expression into other documents. \limitslateximagefontsize As currently implemented, \margintag{SVG files} each instance of math creates a new \SVG\ file. In text with many references to math variables, this can result in a large number of files with duplicate content. In the future, some method of content-based naming and checksumming may be used to remove the need for duplicate files. Another approach would be \margintag{SVG inline} to in-line the \SVG\ files directly into the \HTML. This avoids having a large number of files and potentially speeds loading the images, but dis-allows the possibility of sharing one file among many instances without user intervention. Others 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 also larger as well. 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 MathJax. The popular MathJax alternative (\url{mathjax.org}) may be used to display math. \margintag{MathJax math option} \DescribeProgram{MathJax} \index{math>MathJax summary} \index{MathJax>summary} When 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 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 MathJax cross-referencing system is ignored in favor of the \LaTeX\ internal system, seamlessly integrating with the rest of the \LaTeX\ code. \end{enumerate} Limitations when using MathJax include: \margintag{MathJax limitations} \DescribeProgram{MathJax} \begin{itemize} \item In document classes which have chapters, \margintag{chapter numbers}% \index{MathJax>tagged equations}% \index{tagged equations>Mathjax}% \cs{tag}ged equations have the chapter number prepended in \HTML\ output, unlike \LaTeX. \cs{tag*} equations (correctly) do not. This may be improved with future versions of the MathJax support script. \href{https://groups.google.com/forum/\#!topic/mathjax-users/jUtewUcE2bY} {\texttt{https://groups.google.com/forum/\#!topic/\\ \hspace*{2em}mathjax-users/jUtewUcE2bY}} \item MathJax itself does not support subequations. \margintag{subequations} \index{MathJax>subequations}% \index{subequations>MathJax}% 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 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 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 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. \watchout[siunitx inside an equation] \href{https://github.com/mathjax/MathJax-third-party-extensions/tree/master/siunitx} {\texttt{https://github.com/mathjax/MathJax-third-party-extensions/\\ \hspace*{2em}tree/master/siunitx}} \item MathJax does not automatically support custom \LaTeX{} macros, \margintag{\LaTeX{} macros} but they may be set up by the user. \end{itemize} } \newcommand{\limitsntheorem}{% This conversion is not total. \watchout[Font control] Font control is via \CSS, and the custom \LaTeX\ font settings are ignored. \pkg{ntheorem} has a bug with equation numbering in AMS environments \watchout[Equation numbering] when the option \texttt{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 \texttt{thref} option. } \newcommand{\limitsgraphics}{% If using the older \pkg{graphics} syntax, use both optional arguments \watchout[\pkg{graphics} vs. \pkg{graphicx}] for \cs{includegraphics}. A single optional parameter is interpreted as the newer \pkg{graphicx} syntax. Note that viewports are not supported by \pkg{warp}; \watchout[viewports] the entire image will be shown. \cs{graphicspath} only works for a single directory; \watchout[\cs{graphicspath}] all graphics must be in this directory. 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}. Using the keys \cmds{width=.5\lmacro{linewidth}}, or similar for \cmds{\lmacro{textwidth}} or \cmds{\lmacro{textheight}} to give fixed-sized images proportional to a 6 by 9 inch text area. \cs{includegraphics} accepts \texttt{width} and \texttt{height}, \margintag{options} \texttt{origin}, \texttt{rotate} and \texttt{scale}, plus a new \texttt{class} key. With \HTML\ output, \cs{includegraphics} accepts an optional \margintag{\HTML\ class} \texttt{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. For \cs{includegraphics} the user should provide both \texttt{.pdf} and \texttt{.svg} images, but always refer to \watchout[image file types] \texttt{.pdf} images in the document source. All \cs{includegraphics} references to \texttt{.pdf} will automatically be changed to \texttt{.svg} for \HTML\ output, and will be left as \texttt{.pdf} for print output. Images may also be \texttt{.jpg} and \texttt{.png}, and will be used as-is for either output. \cs{rotatebox} accepts the optional \texttt{origin} key. \margintag{\cs{rotatebox}} \cs{rotatebox}, \cs{scalebox}, and \cs{reflectbox} depend on modern browser support. \watchout[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{\limitsxcolor}{% Color definitions, models, and mixing are fully supported \margintag{support} without any changes required. Colored tables are ignored so far. Use \CSS\ to style tables. \margintag{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{\limitstabular}{% \begin{itemize} \item Vertical rules are not yet supported. \margintag{column types} \item \texttt{*} in a column specification is not used (so far). Repeat the column type the correct number of times. \item Only one each of \texttt{@}, \texttt{!}, \texttt{>}, and \texttt{<} may be used at each column, and they are used in that order. \item \cs{newcolumntype} is ignored; unknown column types are set to \texttt{l}. \item \pkg{tabularx} ignores the width, but \texttt{X} columns do produce paragraph columns or multicolumns. \item Multirow and multicolumn cannot be used at the same time. \watchout[\cs{multirow} \& \cs{multicolumn}] (No rectangular holes wider than one column or taller than one row.) \item For multirow, insert \cs{mrowcell} into any empty multi-row cells. This will be a null function for the print output, and is a placeholder for \watchout[\cs{multirow}] parsing the table for \HTML\ output. \item If a multirow reaches to the bottom of a table, and \cs{bottomrule} does not go over to that edge, \margintag{\cs{multirow} with rules} try adding a line of empty cells below the \cs{bottomrule}. This may be a browser bug. \changes{v0.19}{2016/05/28}{Docs: \env{multirow} browser bug workaround.} \item If a \cs{midrule} is desired after the last row, \margintag{rule at last row} an additional row of blank cells must be used. \item Multiple paragraphs in one cell of a p, b, m column must have \cs{newline} between paragraphs. \watchout[paragraphs] \item \cs{cmidrule} does not support width or trim options due to \CSS\ limitations. \margintag{\cs{cmidrule} width, trim} \item For \pkg{longtable}, place headings and footings which \margintag{\env{longtable} headings} do not apply to \HTML\ inside \cs{warpprintonly\{\}}. \item For \cs{toprule} and \cs{bottomrule}, when combined with a \env{warpprint} or \env{warpHTML} environment, \watchout[\cs{warpprintonly}] if a ``misplaced \cs{noalign}'' error occurs, change \\ \hspace*{.375in}\cmds{This \& That \cs{endhead}} \\ to \\ \hspace*{.375in}\cmds{\cs{warpprintonly}\{This \& That \cs{endhead}\}} \\ and likewise with the other \cs{end} headings. Keep the \cs{endfirsthead} row unchanged, as it is still relevent to \HTML\ output. \item For S columns (from the \pkg{siunitx} package), \watchout[S columns] 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 \& \textcolor{red}{\{}\cs{multirow}\{2\}\{2cm\}\{Text\}\textcolor{red}{\}} \& 3 \textbackslash\textbackslash\}} \\ \hspace*{.375in} \cs{warpHTMLonly}\{\texttt{1 \& 2 \& \cs{multirow}\{2\}\{2cm\}\{Text\} \& 3 \textbackslash\textbackslash\}} \end{itemize} } \newcommand{\limitslongtable}{% Longtable \cs{endhead}, \cs{endfoot}, and \cs{endlastfoot} rows are not used for \HTML, and these rows should be disabled. \watchout Use \begin{sourcedisplay} \cs{warpprintonly}\{row contents\} \end{sourcedisplay} instead of \begin{sourcedisplay} \cs{begin}\{warpprint\} \ldots\ \cs{end}\{warpprint\} \end{sourcedisplay} Doing so helps avoid ``Misplaced \cs{noalign}.'' when using \cs{begin}\{warpprint\}. Keep the \cs{endfirsthead} row, which is still relevent to \HTML\ output. \cs{kill} is ignored, place a \cs{kill} line inside \watchout \begin{sourcedisplay} \cs{begin}\{warpprint\} \ldots\ \cs{end}\{warpprint\} \end{sourcedisplay} or place it inside \cs{warpingprintonly}. } \newcommand{\limitssaveboxes}{% \LaTeX\ boxes are placed inline and do not allow line breaks, so boxes with long contents may overflow the line during \HTML\ conversion. This is mostly a problem when the boxes contain objects which themselves hold large \HTML\ tags, such as rotation commands with long contents. When this object overflows the line, some \HTML\ code will be lost and the page will be corrupted. } \newcommand{\limitsminipage}{% Minipages and parboxes will be placed side-by-side in \HTML unless you place a \cs{newline} between them. \margintag{placement} A line of text with an inline minipage \watchout[inline] or parbox will have the minipage or parbox placed onto its own line, because a paragraph is a block element and cannot be made \texttt{inline-block}. Side-by-side minipages 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 \texttt{center} environment, the result is similar in print and \HTML. Paragraph tags are surpressed between side-by-side minipages and these spacing commands, but not at the start or end of the paragraph. There is limited support for minipages inside an \HTML\ \tag{span}. \margintag{in a span} An \HTML\ \tag{div} cannot appear inside a \tag{span}. While in a \tag{span}, minipages and parboxes are ignored. Use \cs{newline} or \cs{par} for an \HTML\ break. When using \cs{linewidth}, \cs{textwidth}, and \cs{textheight}, \margintag{size} widths and heights are scaled proportionally to a 6\texttimes{}9 inch text area. A minipage of width exactly \cs{linewidth} is automatically given no \HTML\ width. \margintag{no-width minipages} A new macro \cs{minipagefullwidth} requests \margintag{full-width minipages} that the next minipage be generated without an \HTML\ \texttt{width} tag, allowing it to be the full width of the display rather than the fixed width given. Nested minipages adopt their parent's text alignment in \HTML, whereas in regular \LaTeX{} \PDF\ output they do not. \watchout[text alignment] Use a \env{flushleft} or similar environment in the child minipage to force a text alignment. } \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 \texttt{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. \texttt{theoremtitlefont} is not supported, since the following text is not \margintag{theoremtitlefont} in braces in the \pkg{mdframed} source. Footnotes are currently placed at the bottom of the \HTML\ page. \margintag{footnotes} \texttt{userdefinedwidth} and \texttt{align} are currently ignored. \margintag{ignored options} } \newcommand{\limitscaption}{% To ensure proper float numbering, set caption positions such as: \begin{sourcedisplay} \cs{captionsetup}[table]\{position=top\} \\ \cs{captionsetup}[figure]\{position=bottom\} \end{sourcedisplay} Similarly for \texttt{subtable}, \texttt{subfigure}, and \texttt{longtable}. } \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 \texttt{lofdepth} and \texttt{lotdepth} \watchout[\texttt{lof/lotdepth}] 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*} \margintag{horizontal spacing} 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{\limitsfloatrow}{% When combined with the \pkg{subfig} package, \watchout[\pkg{subfig} package] 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}. \watchout[\cs{FBwidth}, \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{\limitssiunitx}{% Do not use \cmds{per-mode=fraction}, which cannot be seen by the final \cmds{pdftotext} conversion. \watchout[per-mode] } \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 \pkg{enumitem} list handling. } \newcommand{\limitsbabeltwo}{% Also, when French is used, the caption separator is \margintag{\cs{CaptionSeparator}} changed to a dash. The following may be used to restore it to a colon: \begin{sourcedisplay} \texttt{\cs{renewcommand}*\{\cs{CaptionSeparator}\}\{:\textasciitilde\}} \end{sourcedisplay} } \newcommand{\limitsnewclude}{% \pkg{newclude} modifies \cs{label} in a non-adaptive way, so \pkg{newclude} must be loaded before \pkg{lwarp} is loaded. \watchout[loading] \begin{docsidebar}[Ex:] \raggedright \cs{documentclass\{article\}} \\ \ldots \\ \cs{usepackage\{newclude\}} \\ \cs{usepackage[warpHTML]\{lwarp\}} \\ \ldots \end{docsidebar} } \newcommand{\limitsnewtxmath}{% The proper load order is: \watchout[loading sequence] \begin{enumerate} \item \dots \item \texttt{\cs{usepackage}\{lwarp\}} \item \dots \item \texttt{\cs{usepackage}\{amsthm\}} \item \texttt{\cs{usepackage}\{newtxmath\}} \item \dots \end{enumerate} } \newcommand{\limitsenumitem}{% \pkg{enumitem} is pre-loaded during \HTML\ output. \margintag{enumitem} Many of the spacing options are rendered irrelevant by \cmds{pdftotext} and \HTML. Numbering, labels, and \cs{newlist} function correctly. } \newcommand{\limitsenumerate}{% \pkg{enumerate} conflicts with \pkg{enumitem} if both are loaded at the same time, but \pkg{lwarp} does not actually load \pkg{enumerate}. While generating \HTML, \pkg{lwarp} only loads \pkg{enumitem}, and \pkg{enumerate} is simulated by \pkg{enumitem} using the functionality of the \texttt{shortlabels} option. A problem may occur during print output if \pkg{enumitem} is loaded, either manually or by some other package such as \pkg{siunitx}. If these are used, \pkg{enumerate} will conflict with \pkg{enumitem} during print output. } \newcommand{\limitsglossaries}{% \texttt{xindy} is required for \pkg{glossaries}. The default \texttt{style=item} option for \pkg{glossaries} conflicts 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, which could become a very long string if many items are referenced. For now, the number list is simply turned off. \texttt{lwarpmk} has the commands \texttt{printglossary} and \texttt{htmlglossary} to process the glossaries created by \pkg{glossaries} using \texttt{xindy}. The packages \pkg{lwarp-newproject} and \pkg{lwarp} each take an option \DescribeOption[lwarp-newproject]{lwarpmklang} \DescribeOption[lwarp]{lwarpmklang} \texttt{lwarpmklang=english} to set the language used by \texttt{xindy}. Set the same option for both packages. This is passed to \texttt{xindy} using its \texttt{-L} option. } \newcommand{\osportabilityusage}{% \pkg{lwarp} tries to detect which operating system is being used. If \textsc{MS-Windows} is not correctly detected, \DescribeProgram{MS-Windows} \DescribeProgram{Windows} use the command \cs{warpOSwindows} in the document \DescribeMacro{\warpOSwindows} preamble after \pkg{lwarp} is loaded. This modifies the operating-system path separator used by \pkg{lwarp}. } \setlength{\marginparsep}{1em} \setlength{\marginparpush}{.7ex} \setlength{\parindent}{0em} \setlength{\parskip}{2ex} \setlength{\IndexMin}{40ex} \setcounter{IndexColumns}{2} \DisableCrossrefs \CodelineIndex \RecordChanges \begin{document} \DocInput{lwarp.dtx} \end{document} % % % \fi % % % \iffalse %<*package> % \fi % % \CheckSum{10986} % % \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: 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: \texttt{lwarp\_mathjax.txt} added.} % \changes{v0.19}{2016/06/01}{File: lwarp.css: \texttt{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} % \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} % % \begin{center} % \includegraphics[width=.3\linewidth]{lwarp_logo.pdf} % % \bigskip % % {\Huge The \textbf{lwarp} package} % % {\Large \textup{\LaTeX{} to \HTMLfive}} % % \bigskip % % \fileversion{} --- \filedate % % \bigskip % % {\small\copyright{} 2016--2017} Brian Dunn\\ \small \texttt{bd@BDTechConcepts.com} % % % ^^A % \title{The \pkg{lwarp} package\thanks{This document % ^^A % corresponds to \pkg{lwarp}~\fileversion, % ^^A % dated \filedate.}} % ^^A % \author{{\small\copyright{} 2016--2017} Brian Dunn\\ \small \texttt{bd@BDTechConcepts.com}} % ^^A % \published{} % ^^A % \subtitle{\textup{\LaTeX{} to HTML5}} % ^^A % % ^^A % \maketitle % % \vfill % % \begin{abstract} % \noindent % The \pkg{lwarp} package allows \LaTeX\ to directly produce \HTMLfive\ output, % using external utility programs only for the final conversion of text and images. % Math may be represented by \SVG\ files or MathJax. % % Documents may be produced by \LaTeX, \LuaLaTeX, or \XeLaTeX. % A |texlua| script removes the need for system utilities such as |make| and |gawk|, % and also supports |xindy| and |latexmk|. Configuration is automatic at the % first manual compile. % % Print and \HTML\ versions of each document may coexist, each with its own % set of auxiliary files. Support files are self-generated on request. % Assistance is provided for import into \EPUB\ conversion software and word processors. % % A modular package-loading system uses the \pkg{lwarp} version of a package for % \HTML\ when available. % Several dozen \LaTeX\ packages are supported with these high-level source % compatibility replacements. % % A tutorial is provided to quickly introduce the user to the major components % of the package. % % % \bigskip % % \begin{center} % \textcolor{blue}{To update existing projects, see \cref{sec:updates}, % \nameref{sec:updates}.} % \end{center} % % \bigskip % % \noindent % \textcolor{red!30!black}{\bfseries % Note that this is still a ``beta'' version of \pkg{lwarp}, % and some things may change in response to user feedback and % further project development. % } % % \bigskip % % \footnotesize % \begin{description} % \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} % % % \end{abstract} % % \vspace*{\fill} % \vspace*{\fill} % \vspace*{\fill} % % \end{center} % % \clearpage % % % \tableofcontents % % \clearpage % \listoffigures % \listoftables % % % \thispagestyle{pageheadfoot} % % \clearpage % % \part{lwarp.sty} % % \section{Updates} % \label{sec:updates} % % The following is intended for those updating existing projects which use % \pkg{lwarp}, highlighting any special changes which must be made due % to improvements or modifications in \pkg{lwarp} itself. % % For a detailed list of changes, see the Change History on page \pageref{sec:changehistory}. % % \begin{description} % \item[v0.29:] \ % \begin{itemize} % \item Add: |lwarpmklang| option for \pkg{lwarp-newproject} and \pkg{lwarp}. % Sets the language to use while processing the glossary. % \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 \tag{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. % \item Boolean |HTMLMarkFloats| adds text marks around floats only if % |FormatWordProcessor|. These make it easier to identify float boundaries, % which are to be manually converted to word-processor frames. % \item Updated for the new 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}. % |lwarpmk| is modified to add |printglosssary| and |htmlglossary| actions. % \end{itemize} % % \item[v0.27:] \ % \begin{itemize} % \item Improved documentation for MacOS install. % \item Fix for \pkg{microtype} with \XeLaTeX\ and \LuaLaTeX. % \item Fix for table footnote paragraph tags. % \item Adds \pkg{lettrine}, \pkg{ulem}, and \pkg{soul}. % \end{itemize} % \needspace{2\baselineskip} % \item[v0.26:] \ % \begin{itemize} % \item Improved installation instructions for MiK\TeX\ regarding generating % the |lwarpmk| executable. % \item Footnotes are now supported by \LaTeX\ boxes instead of pagenotes. % \pkg{pagenote} now works as per the print version. % \pkg{footnote}, \pkg{footnotehyper}, \pkg{footmisc}, \pkg{endnotes}, % \pkg{marginnote}, and \pkg{sidenotes} are also supported. % \item \LaTeX\ labels now are used to track the page numbers of |latexiamge|s. % This allows the correct inclusion of |lateximage|s in footnotes, pagenotes, and endnotes. % \item \pkg{cutwin} and \pkg{floatflt} are also supported. % \end{itemize} % \needspace{2\baselineskip} % \item[v0.25:] \ % \begin{itemize} % \item Fix: Allows \pkg{graphicx} and \pkg{graphicsx} before \pkg{lwarp} because % \XeLaTeX\ and \LuaLaTeX\ use \pkg{xunicode} which uses \pkg{graphics}. % \item Package support for \pkg{framed}, several theorem packages, and ellipses. % \end{itemize} % \needspace{2\baselineskip} % \item[v0.24:] \ % \begin{itemize} % \item \pkg{tikz}'s |babel| library is load automatically as needed. % \item \pkg{subfig} has been added, along with |lofdepth| and |lotdepth|. % \item \env{picture} and \env{tikzpicture} now may be inline. % \end{itemize} % \needspace{2\baselineskip} % \item[v0.22:] \ % \begin{itemize} % \item Support has been added for tabular column types |D|, |!|, and |X|. % Unknown column types are converted to |l|. % \item Additional packages are supported, including \pkg{abstract}, % \pkg{dcolumn}, \pkg{tabularx}, and \pkg{varioref}. % \end{itemize} % \item[v0.21:] \ % \begin{itemize} % \item Documentation for installing on Windows has been updated and improved. % \item For Windows compatibility, the |lateximages| shell script % has been replaced with a |lateximages.txt| file, which is parsed % by |lwarpmk| to generate lateximages. % This does not require any changes in the user's code. % \item Windows |lwarpmk again| now functions. % \item For improved error handling, \pkg{lwarp} now verifies the % order in which packages are loaded, and signals an error for misplaced packages. % \pkg{inputenc}, \pkg{fontenc}, \pkg{newunicode}, and \pkg{fontspec} % must be loaded before \pkg{lwarp}, and the other packages which % \pkg{lwarp} knows about must be loaded after. % \item \pkg{lwarp} no longer requires a \cs{title} be assigned. % \end{itemize} % \item[v0.20:] \ % \begin{itemize} % \item The |makefile| and related infrastructure % has been replaced by the |lwarpmk| utility. % This provides increased portability, reduced dependencies, % and much simpler installation and setup. % \item The |lwarp-newproject| package is now used to locally create % support files. % \item The print and \HTML\ versions of a document may co-exist with their % own sets of auxiliary files. % \item Package handling is now controlled by a modular system which % looks for and loads an |lwarp-| version if available. % \item High-level source compatibility is provided for all supported % packages, almost totally eliminating the need % for |warpprint| and |warpHTML| environments. % \item A large number of additional packages are supported. % \item A new tutorial is included in the documentation, and % many obsolete sections have been removed. % \item \cs{NewHTMLdescription} sets the \HTML\ meta description tag for each file. % See \cref{sec:htmldescription}. % \item \cs{HTMLFileName} may now be empty, allowing filenames without a prefix. % Lwarp no longer automatically appends a |-| character. % \watchout % For existing projects, add a |-| to the end of \cs{HTMLFileName}. % \item \cs{HomeHTMLFileName} and \cs{HTMLFileName} no longer use % escaped underscore\watchout\ % characters. Underscores may be used in filenames as-is. % \item \pkg{lwarp} now tries to auto-detect the operating system, % and \cs{warpOSwindows} is only needed if the auto-detection % fails to detect Windows. % \item Tabular column types |@|, |>|, and |<| are now supported. % \item |BlockClass| and \cs{InlineClass} add an optional style. % \item The |sidebar| and |example| environments have been moved to the % test suite, and are no longer included in \pkg{lwarp}. % \end{itemize} % \item[v0.19:] \ % \begin{itemize} % \item \textsc{MathJax} now may be used to display math via the |mathjax| option. % See \cref{sec:loading,sec:limitsmath}. % To use MathJax with a pre-existing project, % \watchout % copy or link the file |lwarp_mathjax.txt| to the project's directory. % \item \cs{rule} added, supporting width, height, raise, \cs{textcolor}. % \item \cs{LateximageFontSizeName} provides user-adjustable font size for math % and \env{lateximage}s. % \item \cs{minipagefullwidth} requests that the next minipage be % full-width in \HTML, but still the assigned width in print. % \item \env{minipage} improved side-by-side rendering. % \item CSS class |tablenotes| is provided for table note items. % \item \cs{warpprintonly} replaces \cs{rowprintedonly}, % and \cs{warpHTMLonly} is added. These behave like the \env{warpprint} % \watchout % and \env{warpHTML} environments, and are generally useful, so they replace % the previously table-specific syntax. % \item \pkg{cleveref} is loaded \cs{AtEndPreamble} for improved reliability. % See \cref{sec:cleveref}. % \item \cs{xfracHTMLfontsize} controls \pkg{xfrac} font size in \HTML. % \item \tikz\ improved catcode handling. % \end{itemize} % \item[v0.18:] \ % \begin{itemize} % \item The \pkg{verse} package and the verse-related commands from % the \pkg{memoir} package are now supported. % \item Responsive web design has been improved for the side\TOC. % \item \cs{includegraphics} now maintains relative sized for em, ex, and \%. % \end{itemize} % \item[v0.17:] \ % \begin{itemize} % \item \pkg{mdframed} package is supported. % \end{itemize} % \item[v0.16:] \ % \begin{itemize} % \item Font and input encoding are now controlled by the user, and % \pkg{lwarp} is loaded after fonts have been selected. % \item Support for \XeLaTeX{} and \LuaLaTeX. See \cref{sec:fonts}. % \end{itemize} % \end{description} % % \clearpage % % \section{Introduction} % \changes{v0.19}{2016/05/25}{Introduction: MathJax support mentioned.} % % The \pkg{lwarp} project aims to allow a rich \LaTeX{} document % to be converted to a reasonable \HTML\ % interpretation. 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 Javascript. % Limited testing on older browsers show that these new features % degrade gracefully, although the \SVG\ format % for math may not be available on small cell phones. % % |pdflatex|, |xelatex|, or |lualatex| is used, allowing \pkg{lwarp} to process the usual image formats. % While generating \HTML\ output, \SVG\ files are used in placed of \PDF. % Other formats such as \JPG\ are used as-is. % % \SVG\ images may be used for math, % and are also used for \env{picture}, and \tikz{} environments, % as this format has % better browser and e-book support than \MathML\ (as of this writing), % while still allowing for the high-quality display and printing of images (again, subject to potentially % bug-ridden\footnote{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 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. % % The \textsc{MathJax} JavaScript display engine may be selected % for math display instead of using \SVG\ images. % Subject to browser support and Internet access, % MathJax allows an \HTML\ page to display % math without relying on a large number of external image files, % one per math expression. \pkg{lwarp} maintains \LaTeX\ control for cross-referencing % and equation numbering\,/\,formatting. % % \hfill\rule[.7ex]{.3\linewidth}{.4pt}\hspace*{\fill} % % The \pkg{lwarp} package allows \LaTeX{} to directly generate \HTMLfive\ tags from a \LaTeX{} % source document, with only minor intervention on the user's part. % A |texlua| program called |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. % % A special |lwarp-newproject| package is used to set up the auxiliary files necessary for % the \HTML\ conversion. 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, % |lwarp| first looks to see if it has its own modified version % to use instead of the usual \LaTeX\ version. These |lwarp-packagename.sty| files contain % code used to emulate or replace functions for \HTML\ output. % % Enough functionality is provided to convert a typical article containing technical content. % Not every package has been tested, but many of the most useful ones are known to work, % either as-is or through emulation with replacement code. (See \cref{tab:supported} on % page \pageref{tab:supported}.) % % Assistance is provide for modifying the \HTML\ output to suite the creation % of \EPUB\ documents, and for modifying the \HTML\ output to ease import into % a word processor. % % % \subsection{Supported packages and features} % % \changes{v0.15}{2016/04/05}{Docs: Moved the supported functions table to the introduction.} % % Supported classes include \pkg{book}, \pkg{report}, and \pkg{article}. % \pkg{memoir} is planned, but in the meantime many of the packages % used by \pkg{memoir} are already supported. % % % \Cref{tab:supported} lists some of the various \LaTeX{} features which may be used. % \emph{Supported} means that the package or macro may be used as-is, % perhaps with minor limitations. % \emph{Emulated} means that the original package or macro is not used, but similar % functionality is provided in a way which is intended to be compatible with the % user's \LaTeX{} code. % % \renewcommand{\arraystretch}{1.5} % % \begin{longtable}{>{\raggedright}m{.3\linewidth}m{.6\linewidth}} % \caption{\protect\LaTeX--HTML generation --- % \protect\pkg{lwarp} package --- % Supported functions\label{tab:supported}} \endfirsthead % \warpprintonly{\multicolumn{2}{c}{\pkg{lwarp} Supported Functions --- continued} \\ % Category & Status \\ \toprule \endhead} % \toprule % Category & Status \\ % \midrule % Engines: & pdf\LaTeX, \XeLaTeX, \LuaLaTeX \\ % \midrule % Classes: & \pkg{book}, \pkg{report}, or \pkg{article}. \pkg{memoir} is planned. \\ % \midrule % Sectioning: & Supported, with hyperlinks. % Honors \cmds{tocdepth} and \cmds{secnumdepth}. % Adds \cmds{filedepth} for splitting the \HTML\ output. % Files may be numbered sequentially or named according to section name. % Common short words and punctuation is removed from the filenames. \\ % Table of Contents, Figures, Tables: & Supported, with hyperlinks. \\ % Title page: & \cs{maketitle}, \env{titlepage}, \pkg{titling}. Optional % \pkg{titling}-based commands for published and subtitle. \\ % \env{abstract}: & Supported \\ % \midrule % Cross-references: & Emulated, with hyperlinks. \\ % \pkg{hyperref}: & Emulated. % \HTML\ hyperlinks are generated for \TOC, \LOF, \LOT, % \cs{nameref}, \cs{ref}, % the \pkg{cleveref} commands, and index entries.\\ % \midrule % Footnotes: & \pkg{footnote}, \pkg{footmisc}, % \pkg{marginnote}, \pkg{sidenote}, \pkg{pagenote}, \pkg{endnotes}. \\ % Indexing: & \cmds{texindy} is used, with hyperlinks. \\ % Glossary: & \pkg{glossaries} and \cmds{xindy} are used. \\ % Bibliography: & Supported, without hyperlinks so far. \\ % \midrule % Math: & Supported. Converted to \SVG\ images with \HTML\ \cmds{ALT} tags containing the % \LaTeX{} source for the math expression. % MathJax supported as an alternative. % \AmS{} environments are supported. % User-defined macros are available during converson, % due to native \LaTeX{} processing.\\ % Theorems: & Support for native \LaTeX\ theorems, plus % \pkg{theorem}, \pkg{amsthm}, \pkg{ntheorem}. \\ % \midrule % Floats: & Appear where declared. % \pkg{float}, \pkg{newfloat}, \pkg{caption} and \pkg{subcaption}, % \pkg{subfig}, \pkg{capt-of}, \pkg{placeins}, \pkg{trivfloat}, \pkg{floatrow}, % \pkg{keyfloat}, \pkg{wrapfig}, \pkg{cutwin}, \pkg{floatflt}. \\ % \midrule % \env{tabular}: & Emulated. % \cs{multirow} and \cs{multicolumn} are available, but cannot % be used at the same time. % Nested tables are not supported. \\ % \pkg{array}: & Supported inside math environments, emulated elsewhere. \\ % \pkg{tabularx}, \pkg{tabulary}, \pkg{threeparttable}, \pkg{multirow}: & Emulated. \\ % \pkg{longtable}: & Emulated. Converted to a tabular. Captions supported. % Extra headings and \cs{kill} lines must be enclosed in % \cs{warpprintonly\{\}} \\ % \cmidrule{2-2} % \pkg{booktabs}: & Emulated. \cs{toprule} and \cs{bottomrule} % form black rules, \cs{midrule} forms silver rules, as demonstrated on % this table. % \cs{cmidrule}, demonstrated at this line, does not use width or trim options. \\ % \midrule % \pkg{graphics}, \pkg{graphicx}: & Emulated. % \cs{includegraphics} supports \cmds{width}, \cmds{height}, % \cmds{origin}, \cmds{angle}, and \cmds{scale} tags, and adds \cmds{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. \\ % \pkg{rotating}: & Emulated. All objects are displayed unrotated. \\ % \midrule % Lists: & Supported \\ % \pkg{enumitem}: & Supported, although spacing is still controlled by \CSS. \\ % \midrule % Environments: & Standard \LaTeX{} environments are supported. \\ % \pkg{picture} and \pkg{tikz}: & Converted to an \SVG\ image. \\ % \env{minipage}: & Supported with some \HTMLfive-imposed limitations. % Nested minipages are supported. % Footnotes appear at the bottom of the \HTML\ page. \\ % \pkg{fancyvrb}: & Supported except for verbatim footnotes. \\ % \pkg{framed}, \pkg{mdframed}: & Supported \\ % \pkg{multicol}: & Emulated, with \CSSthree. % Converted to up to three columns with an optional heading, % per browser support. Single-column if unsupported.\\ % \midrule % \pkg{siunitx}: & Supported except for \cmds{per-mode=fraction}. \\ % \pkg{xfrac}: & Supported \\ % \midrule % Direct formatting: & \cs{emph}, \cs{textsuperscript}, % \cs{textbf}, etc are supported. % \cs{bfseries}, etc.\ are not yet supported. % \pkg{lettrine}, \pkg{ulem}, and \pkg{soul} are supported. \\ % Ordinals: & \pkg{nth}, \pkg{fmtcount}, and \pkg{engord} are supported. \\ % 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 % \pkg{xcolor}: & \textcolor{DarkGreen}{Supported}. % Full package color names, any color models, % and \textcolor{Goldenrod}{mixing} is % converted to hex web colors via \cs{convertcolorspec}. % Patched commands are % \textcolor{Maroon}{\cs{textcolor}}, % \colorbox{LightSteelBlue}{\cs{colorbox}}, % and \fcolorbox{red}{NavajoWhite}{\cs{fcolorbox}}. % \cs{pagecolor} is not supported. \\ % \midrule % Where: & \\ % \textbf{Supported:} & The existing \LaTeX{} package is used. \\ % \textbf{Emulated:} & The \LaTeX{} package is not used, but some/all of its % functions are emulated. Null functions, lengths, and counters are provided % for source compatibility. \\ % \bottomrule % \end{longtable} % % % Supported packages include everything listed in the table of contents, % plus each of the following in \cref{tab:additionalsupported}, % and probably others which have not yet been tested. % Many are simply nullfied during \HTML\ output. % Others are not affected by the output mode and thus work as-is. % % % \begin{table} % \caption{Additional supported packages} % \label{tab:additionalsupported} % \sffamily % babel, bm, % calc, cleveref, csquotes, % enumitem, % fancyvrb, fileerr, % newtxmath, % siunitx, somedefs, % tikz, trace, % varioref, % xspace % \end{table} % % % These packages and features probably works with little or no change to the % user's source code. % Special environments are provided to mark blocks of code which are for % print only, \HTML\ only, or both, should it be necessary. % % % % % \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{Internet class} % % \changes{v0.21}{2017/02/15}{Docs: Added \protect\texttt{internet} class.} % % The closest to \pkg{lwarp} in design principle is the % \DescribeClass{internet} % \verb+internet+ class by Andrew Stacey % (\url{https://github.com/loopspace/latex-to-internet}), % an interesting project which directly produces several versions % of markdown, and also \HTML\ and \EPUB. % % % % \subsection{TeX4ht} % % \url{http://tug.org/tex4ht/}\DescribeProgram{TeX4ht} % % 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. % % \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{AsciiDoc} % % 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 version.)\DescribeProgram{AsciiDoctor} % \end{description} % % The Asciidoctor-LaTeX project is adding 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{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 Microsoft\,\textregistered{} Word\,\textregistered{} % and LibreOffice\,\texttrademark{} 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 Adobe\,\textregistered{} FrameMaker\,\textregistered{}, % Adobe\,\textregistered{} InDesign\,\textregistered{}, % and Madcap Flare\,\texttrademark{}. % % \subsection{Comparisons} % \index{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 % % \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. % % \index{utility>programs} % \index{programs>utility} % % \begin{table} % \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:] |pdflatex|, |xelatex|, or |lualatex|. % \DescribeProgram[requirement]{pdfLaTeX} % \DescribeProgram[requirement]{XeLaTeX} % \DescribeProgram[requirement]{LuaLaTeX} % % \item[The \pkg{lwarp} package:] This package. % % \item[The \pkg{lwarp-newproject} package:] Accompanies \pkg{lwarp}, and used % to create configuration files. % % \item[The |lwarpmk| utility:] Provided along with this package. This % should be an operating-system executable in the same way that % |pdflatex| or |latexmk| is. It is possible to have the % \pkg{lwarp-newproject} package generate a local copy of |lwarpmk| % called |lwarpmk.lua|. % See \cref{sec:genlatexmk}. % % \item[luatex:] Used by the |lwarpmk| program to simplify and automate document generation. % % \item [xindy:] The \pkg{xindy} package 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[latexmk:] Optionally used by |lwarpmk| to compile \LaTeX\ code. % On a MiK\TeX\ system, Perl may need to be installed first. % % \item[pdfcrop:] Used to pull images out of the \LaTeX{} \PDF. % \DescribeProgram[requirement]{pdfcrop} % % \end{description} % % \item[Poppler PDF utilities:] \ % % \begin{description} % % \item[pdftotext:] Used to convert \PDF\ to text. % \DescribeProgram[requirement]{pdftotext}\index{Poppler} % % \item[pdfseparate:] Used to pull images out of the \LaTeX{} \PDF. % \DescribeProgram[requirement]{pdfseparate} % % \item[pdftocairo:] Used to convert images to \SVG. % \DescribeProgram[requirement]{pdftocairo} % % \end{description} % % These might be provided by your operating-system package manager. % % From Poppler: \url{poppler.freedesktop.org}. % % For MacOS\textregistered, see % \url{https://brew.sh/}, install Homebrew, then % \userentry{brew install poppler} % % For Windows, see: \\ % \url{https://sourceforge.net/projects/poppler-win32/} \quad and: \\ % \url{http://blog.alivate.com.au/poppler-windows/} % % \item[Perl:] \ % % This may be provided by your operating-system package manager, and is % required for some of the Poppler \PDF\ utilities. % % \url{perl.org}, \url{strawberryperl.com} % % \item[Automatically downloaded from the internet as required:] \ % \begin{description} % % \item[MathJax:] Optionally used to display math. % Automatically loaded from the MathJax website when needed. \\ % From: \url{mathjax.org} % \DescribeProgram[requirement]{MathJax} % % \end{description} % \end{description} % % \hrule % \end{table} % % \subsection{Installing the \protect\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. % % \item [\TeX\ Live:]If using a \TeX\ Live distribution, % try installing via |tlmgr|: % \userentry{tlmgr install lwarp} % % \item [MiK\TeX:] If using MiK\TeX, try using the package installer to % install the package |lwarp|. % Also update the package |miktex-misc|, which will install the % |lwarpmk| executable. % \changes{v0.26}{2017/03/23}{Docs: Improved MiK\TeX\ install instructions.} % % \item [Operating-system package:] The operating-system package manager may % already have |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 ``Settings'' window, ``Roots'' tab, look for a local \TDS\ root. % \end{description} % This should be something like: % \begin{sourcedisplay} % |/usr/local/texlive/texmf-local/| % \end{sourcedisplay} % \item Unpack the archive in the \TDS\ local directory. % \item Renew the cache: % \userentry{mktexlsr} \quad —\,or\,— % \userentry{texhash} % % Or, for Windows MiK\TeX, start the program called |MiKTeX Settings (Admin)| % and click on the button called \textsf{Refresh FNDB}. % \end{enumerate} % % \item[CTAN \texttt{.dtx} and \texttt{.ins} files:] Another form of \TeX\ package % is the |.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 |lwarp.zip| into your own |lwarp| directory. % \item Unpack |lwarp.zip|. % \item Locate the contents |lwarp.dtx| and |lwarp.ins| % \item Create the documentation: \userentry{pdflatex lwarp.dtx} (several times) % \item Create the |.sty| files: \userentry{pdflatex lwarp.ins} % \item Copy the |.sty| files somewhere such as the \TeX\ Live local tree % found in the previous \CTAN\ \TDS\ section, under the subdirectory: % \begin{sourcedisplay} % |/tex/latex/local/lwarp| % \end{sourcedisplay} % \item Copy the documentation |lwarp.pdf| to a |source| directory in the local tree, % such as: % \begin{sourcedisplay} % |/doc/local/lwarp| % \end{sourcedisplay} % \item Renew the cache: % \userentry{mktexlsr} \quad —\,or\,— % \userentry{texhash} % % Or, for Windows MiK\TeX, start the program called |MiKTeX Settings (Admin)| % and click on the button called \textsf{Refresh FNDB}. % % \item See \cref{sec:locallwarpmk} to generate your local copy of |lwarpmk|. % \item Once the local version of |lwarpmk.lua| is installed, it may be made % available system-wide as per \cref{sec:installlwarpmk}. % \end{enumerate} % \item[Project-local \CTAN\ \texttt{.dtx} and \texttt{.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 |lwarpmk.lua| files % may be used as-is, so long as they are in the same directory % as the document source. 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 \protect\texttt{lwarpmk} utility} % \label{sec:installlwarpmk} % % \changes{v0.21}{2017/02/22}{Docs: Installing on Windows.} % % {\small % (Note: If |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 |lwarpmk| utility: % \begin{enumerate} % \item At a command line, try executing |lwarpmk|. If the |lwarpmk| help message % appears, then |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 |miktex-misc| package. This may install % the |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 |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 |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{sourcedisplay} % |/usr/local/texlive/| % \end{sourcedisplay} % The binaries are then located in the |bin/| directory % under the root: % \begin{sourcedisplay} % |/usr/local/texlive//bin//| % \end{sourcedisplay} % In this directory you will find programs % such as |pdflatex| and |makeindex|. % \item In the binaries directory, % create a new symbolic link from the binaries directory to |lwarpmk.lua|: % \userentry{ln -s lwarpmk} % \item Make the link executable: % \userentry{chmod 0755 lwarpmk} % \end{enumerate} % \item [Windows \TeX\ Live:] Create a new |lwarpmk.exe| file: % \begin{enumerate} % \item Locate the \TeX\ Live binaries as shown above for Unix. % \item In the binaries directory, make a \emph{copy} of |runscript.exe| % and call it |lwarpmk.exe| % This will call the copy of |lwarpmk.lua| % which is in the |scripts| directory of the distribution. % \end{enumerate} % \item [Windows MiK\TeX:] Create a new |lwarpmk.bat| file: % \begin{enumerate} % \item Locate the binaries. These will be in a directory such as: % \begin{sourcedisplay} % |C:\Program Files\MiKTeX 2.9\miktex\bin\x64| % \end{sourcedisplay} % In this directory you will find programs % such as |pdflatex.exe| and |makeindex.exe|. % \item Create a new file named |lwarpmk.bat| containing: % \begin{sourcedisplay} % {\footnotesize % |texlua "C:\Program Files\MiKTeX 2.9\scripts\lwarp\lwarp.texlua" %*|} % \end{sourcedisplay} % This will call the copy of |lwarpmk.lua| % which is in the |scripts| directory of the distribution. % \end{enumerate} % \end{description} % \end{enumerate} % % \subsubsection{Using a local copy of \protect\pkg{lwarpmk}} % \label{sec:locallwarpmk} % It is also possible to use a local version of |lwarpmk|: % \begin{enumerate} % \item When compiling the tutorial in \cref{sec:tutorial}, % use the |lwarpmk| option for the \pkg{lwarp-newproject} package: % \begin{sourcedisplay} % |\usepackage[lwarpmk]{lwarp-newproject}| % \end{sourcedisplay} % \item When the tutorial is compiled with |pdflatex|, the file |lwarpmk.lua| % will be generated along with the other configuration files. % \item |lwarpmk.lua| may be used for this project: % \begin{description} % \item[Unix:] \ % \begin{enumerate} % \item Make |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[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 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} % % \item [To install |xindy|, |latexmk|, and |pdfcrop|:] \ % % The \TeX\ utilities |xindy|, |latexmk|, and |pdfcrop| may be provided by % your operating system's package manager, and are also provided by % the \CTAN\ archive: % \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 Poppler utilities to a Unix/Linux system:] \ % \DescribeProgram[requirement]{pdftotext}\index{Poppler} % \DescribeProgram[requirement]{pdfseparate} % \DescribeProgram[requirement]{pdftocairo} % % The tools from the \textsc{Poppler} project should be provided by your % operating system's package manager. % % % \item [To install the Poppler utilities to a MacOS machine:] \ % \begin{enumerate} % \item Install 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 Poppler utilities: % \userentry{brew install poppler} % \end{enumerate} % % % \item [To install the Poppler utilities to a Windows machine:] \ % % \begin{enumerate} % \item See \cref{tab:utility} on \cpageref{tab:utility}. % \item Download and extract the Poppler utilities |pdftotext|, |pdfseparate|, % and |pdftocairo| to a directory, such as |Poppler|. % \item In the Start window, type "Path" to search for results % related to Path. Or, open the control panel and search for "Path". % \item Choose "Edit the system environment variables" in the control panel. % \item Choose the "Environment Variables" button. % \item Choose the "Path" variable, then the "Edit" button. % \item Choose the "New" button to make an additional entry. % \item Enter the |bin| directory of the 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 "Ok" when done. % \end{enumerate} % % \item [To install Perl to a Windows machine:] \ % \DescribeProgram[requirement]{perl}\index{Perl} % \begin{enumerate} % \item Download and install a version of Perl, such as Straweberry Perl, % to a directory without a space in its name, such as |C:\Strawberry|. % \item Edit the Path as seen above for the Poppler utilities. % \item Enter the |bin| directory of the Perl utility, such as: % \begin{sourcedisplay} % |C:\Strawberry\perl\bin| % \end{sourcedisplay} % % Be sure to include |\bin|. % \item Click "Ok" when done. % \end{enumerate} % % \end{description} % % \vfill % \textcolor{red}{\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. % % % \subsection{Starting a new project} % % \changes{v0.21}{2017/02/23}{File \texttt{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} % \userentry{texdoc -l lwarp\_tutorial.txt} % \watchout[Note: |.txt| suffix!] % % 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 Windows, use an editor other than Notepad, % \watchout[Bad Formatting!] % since Notepad does not accept the end-of-line from a Unix text file.} % % \item Compile the project: \userentry{pdflatex tutorial.tex} % \quad (several times) % % (|xelatex| or |lualatex| may be used as well.) % % \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-newproject| package. % % (Two of the new files are configuration files for the helper program |lwarpmk|. % Whenever a print version of the document is created while the |lwarp-newproject| % package is used, the configuration files for |lwarpmk| are updated to % record the operating system, \LaTeX\ program (|pdflatex|, |xelatex|, or |lualatex|), % the filenames of the source code and \HTML\ output, and whether % the additional helper program |latexmk| will be used to compile the document.) % % % % \clearpage % % \begingroup % \captionof{figure}{tutorial.tex listing} % \label{fig:tutorial} % % \begin{center} % \footnotesize % \textcolor{red}{Note: There are two pages!} % \end{center} % % \small % % \begin{Verbatim}[gobble=2] % % % Save this as tutorial.tex for the lwarp package tutorial. % % \documentclass{book} % % \usepackage{iftex} % % % --- LOAD FONT SELECTION AND ENCODING BEFORE LOADING LWARP --- % \ifPDFTeX % \usepackage{lmodern} % pdflatex % \usepackage[T1]{fontenc} % \usepackage[utf8]{inputenc} % \else % \usepackage{fontspec} % XeLaTeX or LuaLaTeX % \fi % % % --- HTML FILENAME AND LATEXMK SETTINGS --- % % \newcommand{\HomeHTMLFilename}{index} % Filename of the homepage. % % \newcommand{\HTMLfiveName}{node-} % Filename prefix of other pages. % % \newcommand{\UseLatexmk}{true}% Uncomment to use latexmk % % % --- LWARP IS LOADED NEXT --- % \usepackage{lwarp-newproject} % Possibly with the [lwarpmk] option. % \usepackage{lwarp} % % \boolfalse{FileSectionNames} % If false, numbers the files. % % % --- OTHER PACKAGES ARE LOADED AFTER LWARP --- % \usepackage{makeidx} \makeindex % \usepackage{xcolor} % % \usepackage{hyperref,cleveref} % LOAD THESE LAST! % % % --- LATEX AND HTML CUSTOMIZATION --- % \title{The Lwarp Tutorial} % \author{Some Author} % \setcounter{tocdepth}{2} % Include subsections in the \TOC. % \setcounter{secnumdepth}{2} % Number down to subsections. % \setcounter{FileDepth}{1} % Split \HTML\ files at sections % \booltrue{CombineHigherDepths} % Combine parts/chapters/sections % \setcounter{SideTOCDepth}{1} % Include subsections in the side\TOC % \SetFirstPageTop{Name and \fbox{HOMEPAGE LOGO}} % \SetPageTop{\fbox{LOGO}} % \SetPageBottom{Contact Information and Copyright} % \NewCSS{lwarp_sagebrush.css} % % \begin{document} % \maketitle % (or a titlepage environment) % % % --- An abstract may be placed here. --- % % \tableofcontents \listoffigures % --- MUST BE BEFORE THE FIRST SECTION. % % \chapter{First chapter} % % \section{A section} % % This is some text which is indexed.\index{Some text.} % % \subsection{A subsection} % % See \cref{fig:withtext}. % % \begin{figure}\begin{center} % \fbox{\textcolor{blue!50!green}{Text in a figure.}} % \caption{A figure with text\label{fig:withtext}} % \end{center}\end{figure} % % \section{Some math} % % Inline math: $r = r_0 + vt - \frac{1}{2}at^2$ % \begin{equation} % a^2 + b^2 = c^2 % \end{equation} % % \printindex % % \end{document} % \end{Verbatim} % \endgroup % % % \begin{table} % \caption{Files created in a new project\label{fig:newprojectfiles}} % \begin{description} % % \item [|tutorial.pdf|:] The \PDF\ output from \LaTeX. % % \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 |tutorial.aux|, |tutorial.log|. % 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 |lwarpmk|, % which is used to automate the compilation of \PDF\ or \HTML\ % versions of the document. % % \item [|tutorial.lwarpmkconf|:] Another configuration file used by |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\_html.xdy|:] Used by \pkg{lwarp} while creating an index. % This file should not need to be modified by the user. % % \item [|lwarp\_mathjax.txt|:] Inserted into the \HTML\ files when % |MathJax| is used to display math. % This file should not need to 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 |lwarpmk| option is given to the \pkg{lwarp-newproject} package: % \begin{description} % \item [|lwarpmk.lua|:] A local copy of the |lwarpmk| utility. % % On 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 \texttt{lwarpmk}} % % The |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} % % |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 % |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 |latexmk| (introduced later), the changed date is % ignored and an actual change in contents must occur to cause a recompile.} % % \item Process the index.\footnote{A \texttt{lwarpmk printglossary} command is also % available to process a glossary produced with the \textsf{glossaries} package. % Set its language using the \texttt{lwarpmklang} option for \pkg{lwarp-newproject} % and \pkg{lwarp}.} % \userentry{lwarpmk printindex} % % \item Recompile again to include the index. % \userentry{lwarpmk print} % % \end{enumerate} % % Note that the \HTML\ customization commands are ignored while making the % print version. % % % \clearpage % % \subsection{Compiling the HTML version with \texttt{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 |lwarpmk| uses \LaTeX\ to process |tutorial_html.tex| % to create \\ % |tutorial_html.pdf|. % \item |pdftotext| is then used to convert into the file |tutorial_html.html|. % This file is a plain-text file containing \HTML\ tags and % content for the entire document. % \item |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 homepage in a web browser. % % \qquad Open the file |tutorial.html| in a web browser. % % Note that math is still displayed as its plain-text \LaTeX\ source % \margintag{math} % until the % images of the math expressions have not yet been generated. Math may be % displayed as \SVG\ images or by a 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:\footnote{A \texttt{lwarpmk htmlglossary} command is also % available to process a glossary produced with the \textsf{glossaries} package. % Set its language using the \texttt{lwarpmklang} option for \pkg{lwarp-newproject} % and \pkg{lwarp}.} % \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. % \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 |alt| tags. In this way, % the math displays as it was drawn by \LaTeX, and the \LaTeX\ source % may be copied and pasted into some other document. % % \pkg{lwarp} uses the same mechanism for |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 math page and reload. % % \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} % % When a math expression, |picture|, or \tikz\ environment is added or % \watchout[Adding/removing] % removed, the \SVG\ images must be re-created with |lwarpmk limages| % to maintain the proper image file sequence numbers. % % 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!] % There is no attempt at % reusing the same file each time the same expression occurs, so each % time \$x\$ is used, for example, yet another file is created. % For a document with a large amount of math, % see \cref{sec:tutorialmathjax} to use MathJax instead. % % \clearpage % % \subsection{Using MathJax for math} % \label{sec:tutorialmathjax} % % Math may also be represented using the MathJax Javascript project. % \margintag{math with MathJax} % % \begin{enumerate} % \item In the tutorial's source code, change % \begin{sourcedisplay} % |\usepackage{lwarp}| % \end{sourcedisplay} % to % \begin{sourcedisplay} % |\usepackage[mathjax]{lwarp}| % \end{sourcedisplay} % % \item Recompile \userentry{lwarpmk html} % % \item Reload the math page. % \end{enumerate} % % MathJax requires web access unless a local copy of MathJax is available, % \watchout[MathJax requirements] % and it also requires that Javascript is enabled for the web page. % The math is rendered by MathJax. Right-click on math to see several % options for rendering, and for copying the \LaTeX\ source. % % While using MathJax has many advantages, it may not be able to represent % complex expressions or spacing adjustments as well as \LaTeX. % % % % \clearpage % \subsection{Changing the CSS style} % % \DescribeMacro{\NewCSS} % \cs{NewCSS} may be used to choose which |.css| file is used to display % each section of the web page. Use \cs{NewCSS} before |\begin{document}| % to assign the style of the home page. % If different parts of the website should have different styles, % call \cs{NewCSS} again before each section heading which creates a new file. % % The styles provided by \pkg{lwarp} include: % \begin{description} % \item[|lwarp.css|:] A default style if \cs{NewCSS} is not used. This % style is comparable to a plain \LaTeX\ document. % To set this style, you may use |\NewCSS{lwarp.css}|, or no \cs{NewCSS} 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{NewCSS} entry in the tutorial % |lwarpmk html|, and then reload the webpage. % % A customized style may also be created. % \margintag{Custom \CSS} % For each new project a file % called |sample_project.css| is generated. This may be renamed to % |.css| then used by assigning |\NewCSS{.css|. % % Note that |sample_project.css| is overwritten whenever \pkg{lwarp-newproject} % is loaded in print mode. % It is therefore important to rename the file \watchout[Rename it!] % to something like |.css| before % using it, so that your own changes are not overwritten. % % |.css| has an entry which loads |lwarp.css|, and this % entry may be changed to load |lwarp_formal.css| or |lwarp_sagebrush.css| if % desired. Additional changes to the \CSS\ may be made by making entries % later in the |.css| file. % % \clearpage % % \subsection{Customizing the HTML output} % \label{sec:htmlsettings} % \index{settings>HTML conversion} % \index{HTML>conversion settings} % % Several settings may be used to customize the \HTML\ output. % Watch for the correct placement of each!\watchout[Placement!] % % Note that if changes are made, % \watchout[Changes!] % it is best to first use |lwarpmk clearall| to % clear all the \HTML, \PDF, and auxiliary files. % Also, if \cs{HomeHTMLFilename}, \cs{HTMLFileName}, or \cs{UseLatexmk} are % changed, it is necessary to reenable the |lwarp-newproject| package and % then recompile the print version in order to recreate the configuration % files for |lwarpmk|. % % \begin{description} % % \item[Placed in the preamble just before \pkg{lwarp} is loaded:] \ % % \begin{description} % % \ItemDescribeMacro{\HomeHTMLFilename} Filename of the homepage, without % the ``|.html|'' suffix. % Defaults to the \cs{BaseJobname}. A common setting is: % \begin{sourcedisplay} % |\newcommand{HomeHTMLFilename}{index}| % \end{sourcedisplay} % causing the % homepage to be the file |index.html|. Underscores are allowed in % \margintag{filename underscore} % \cs{HomeHTMLFilename} and \cs{HTMLFilename}, but usually must be escaped % elsewhere, such as |\item [\href{file\_name.pdf}{text}] \| % \index{underscore>filename}\index{file>underscore} % \changes{v0.24}{2017/03/13}{Docs: Filename underscore.} % % \ItemDescribeMacro{\HTMLfiveName} A filename prefix for the rest of the \HTML\ web pages. % Useful for numbered web pages with a common prefix. May be empty. % % \ItemDescribeMacro{\UseLatexmk} A macro which controls whether % \pkg{lwarp} uses |latexmk| to % compile the document. This setting is written to |lwarpmk|'s configuration % files. Defaults to false. Set to true with: % \begin{sourcedisplay} % |\newcommand*{\UseLatexmk}{true}| % \end{sourcedisplay} % % \end{description} % % \item[Placed in the preamble before \texttt{\cs{begin}\{document\}}:] \ % % \begin{description} % % \ItemDescribeCounter{tocdepth} Sectioning depth of the table of contents. % See \cref{sec:stackdepths} for a list of \LaTeX{} stack depths. % % \ItemDescribeCounter{SideTOCDepth} Sectioning depth of the side\TOC. % Defaults to 1, causing the side\TOC\ to show sections but not subsections. % % Each subpage of the website has its own small table of contents % \margintag{side\TOC} % on the side (the ``side\TOC''). Its depth is set by |SideTOCDepth|. % This side\TOC\ is only shown if the web page is wide enough. % When using a narrow web browser window, % ``responsive web design'' is used to show the side\TOC\ at the top of the % page and a link back to ``Home'' at the bottom. % % \label{sec:filedepth} % It is recommended to set: % \begin{sourcedisplay} % |SideTOCDepth|\,=\,|FileDepth| % \end{sourcedisplay} % or % \begin{sourcedisplay} % |SideTOCDepth|\,=\,|FileDepth|+1 % \end{sourcedisplay} % % If |SideTOCDepth|\,<\,|FileDepth|, web pages will be inaccessible via the % side\TOC. \watchout % \index{file>inaccessible} % \index{page>inacessible} % \index{missing sections} % \index{section>missing} % % \ItemDescribeCounter{FileDepth} Sectioning depth of file splits. % Defaults to -5, causing the entire \HTML\ website to be one single file. % \begin{itemize} % \item To place the entire file into one \HTML\ page, use: % \begin{sourcedisplay} % |\setcounter{FileDepth}{-5}}| % \end{sourcedisplay} % \item To split the \HTML\ file at \cs{section} depth, use: % \begin{sourcedisplay} % |\setcounter{FileDepth}{1}}| % \end{sourcedisplay} % \item To ensure that the \HTML\ pages/files are accessible: % \watchout\\ % Place a \cs{tableofcontents} somewhere before the first section % break (therefore in the ``home page''), and set % \begin{sourcedisplay} % |tocdepth|\,>=\,|FileDepth| % \end{sourcedisplay} % \index{file>inaccessible} % \index{page>inacessible} % \index{missing sections} % \index{section>missing} % \end{itemize} % % \ItemDescribeBoolean{CombineHigherDepths} Combine a higher section with % its first lower subsections, down to the |FileDepth|. % Defaults to true. Set to false to simulate the concept of a chapter % opening on its own page, for example. % % The file splits are controlled by the counter |FileDepth| and % the boolean |CombineHigherDepths|. % Setting |FileDepth| to 0 splits the file % at chapters, 1 at sections, etc. |CombineHigherDepths| controls whether % to combine pages at levels higher than the chosen |FileDepth|, such as % in this tutorial where the page which opens the chapter also contains the % first section. % Be careful to set |tocdepth| and |SideTOCDepth| to allow % \watchout[Inaccesible pages!] % access to each page of the website. Set |tocdepth| and |SideTOCDepth| to be % greater than or equal to |FileDepth|. % % When making changes to the file structure, % \watchout[Lost in an old page!] % it is possible to end up % with the web browser pointing to an old file which is no longer in use. % When this occurs, changes to the web site will not appear in the browser, % even if reloading the page, because that page is no longer in use. % It is best to return to the home page, clean the files (|lwarpmk cleanall|), % change |FileDepth| and/or |CombineHigherDepths|, then finally recompile and % renavigate to the desired page using the new file structure. % % \ItemDescribeBoolean{FileSectionNames} If true, web page filenames are % derived from a sanitized version of the section names. If false, web pages % are numbered. Either way, the \cs{HTMLFileName} is prefixed. % % Example \HTML\ filenames: % \changes{v0.20}{2016/09/11}{Docs: Examples for generating \HTML\ file names.} % \label{sec:filenameexamples} % \margintag{HTML filenames} % \index{HTML>filename generation} % \begin{description} % \item[Numbered \HTML\ nodes:] \ % % Example: Homepage |index.html|, and |node-1|, |node-2|. % (See \cs{SetHTMLFileNumber} to number grouped by chapter, for example.) % \begin{Verbatim}[gobble=2,frame=lines,obeytabs,tabsize=4] % \newcommand{\HomeHTMLFileName}{index} % \newcommand{\HTMLfiveName}{node-} % \usepackage{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] % \newcommand{\HomeHTMLFileName}{index} % \newcommand{\HTMLfiveName}{} % \usepackage{lwarp} % \booltrue{FileSectionNames} % \end{Verbatim} % % \item[Named \HTML\ sections, with prefix:] \ % % Example: Homepage |mywebsite.html|, and additional pages such % as |mywebsite-About.html|, etc. % \begin{Verbatim}[gobble=2,frame=lines,obeytabs,tabsize=4] % \newcommand{\HomeHTMLFileName}{mywebsite} % \newcommand{\HTMLfiveName}{mywebsite-} % \usepackage{lwarp} % \booltrue{FileSectionNames} % \end{Verbatim} % \end{description} % % \ItemDescribeMacro{\abstractname} The name of the abstract. % This may also be over-written % by the \pkg{babel} package. Defaults to ``Abstract''. % % \ItemDescribeMacro{\MetaLanguage} The \HTML\ language meta header. % Defaults to {en-US}. % % \ItemDescribeMacro{\SetFirstPageTop} \marg{contents} \quad % A user-definable custom action applied % to the top of the home page. Useful for logos, etc. % Defaults empty. % Ignored in print output. % % \ItemDescribeMacro{\SetPageTop} \marg{contents} \quad % A user-definable custom action applied to % the top of pages other than the home page. Useful for logos, etc. % Defaults empty. % |\LinkHome| may be used to place a link back to the homepage. % Ignored in print output. % % \ItemDescribeMacro{\SetPageBottom} \marg{contents} \quad % A user-definable custom action applied to the % bottom of each web page. % Useful for authors, copyright notices, contact information, etc. % Defaults empty. % |\LinkHome| may be used to place a link back to the homepage. % Ignored in print output. % % \end{description} % % \item[Placed in the home page before the first section 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, 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} % % % \item[Placed before any sectioning command which causes a file break:] \ % % \begin{description} % \ItemDescribeMacro{\NewCSS} \marg{filename.css} \quad % Sets the \CSS\ file to use for the following % files. May be changed before each each sectioning command which would % cause a file split. % % The \CSS\ styles of the web pages are set by the \cs{NewCSS} command. % If \cs{NewCSS} 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{NewCSS} command to see the default. % \cs{NewCSS} may be used before each file break to set the \CSS\ for % individual pagess of the website. % % \ItemDescribeMacro{\NewHTMLdescription} \marg{description} \quad % Sets the \HTML\ description tag for % the following files. May be changed before each each sectioning command which would % cause a file split. % \end{description} % % \needspace{2\baselineskip} % \item[Placed in the document wherever necessary:] \ % % \begin{description} % \ItemDescribeEnv{warpprint} An environment which is only used % while generating print output. Place here anything which does not % apply to \HTML\ and which may cause problems with \pkg{lwarp}. % If \pkg{lwarp} knows about and emulates or supports % a package then its related macros, lengths, counters, etc. probably won't have % to be placed inside a \env{warpprint} environment, but unknown packages % may cause problems which may be isolated from \pkg{lwarp} using this environment. % % \ItemDescribeEnv{warpHTML} An environment which is only used % while generating \HTML\ output. This is useful for website logos and % other items which have no purpose in printed output. % % \ItemDescribeMacro{\warpprintonly} \marg{contents} \quad % A macro version of the \env{warpprint} environment. % % \ItemDescribeMacro{\warpHTMLonly} \marg{contents} \quad % A macro version of the \env{warpHTML} environment. % \end{description} % % \end{description} % % % \clearpage % % \subsection{Using \texttt{latexmk}} % % |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, at ``HTML FILENAME AND LATEXMK SETTINGS'', % insert the line: % \begin{sourcedisplay} % |\newcommand{\UseLatexmk}{true}| % \end{sourcedisplay} % % \item Directly recompile the printed version of the document. % \userentry{pdflatex tutorial.tex} \watchout[NOT \texttt{lwarpmk}!] % (Or |xelatex| or |lualatex|) % % \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 |lwarpmk| should % use |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 |latexmk| has a much better awareness of changes than % the |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. % % % \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 Be sure that % \begin{sourcedisplay} % |\usepackage{lwarp-newproject}| % \end{sourcedisplay} % is still enabled in |tutorial.tex|. % % \item Use |xelatex| or |lualatex| to recompile the printed version. % \userentry{xelatex tutorial.tex} \quad -or- % \userentry{lualatex tutorial.tex} % % When the recompile occurs and \pkg{lwarp-newproject} is loaded, % the configuration files for |lwarpmk| are modified to remember % which \TeX\ engine was used. \XeLaTeX\ or \LuaLaTeX\ will be used for % future runs of |lwarpmk|. % % \item To recompile the document: % \userentry{lwarpmk print} \quad -and- % \userentry{lwarpmk html} % % \item Also rememeber to update the indexes and recompile again. % \end{enumerate} % % % % \clearpage % % \subsection{Using a glossary} % % \changes{v0.29}{2017/04/15}{Docs: Using a glossary} % % \pkg{lwarp} supports the \pkg{glossaries} package. % % \DescribeOption[lwarp-newproject]{lwarpmklang} % \DescribeOption[lwarp]{lwarpmklang} % To assign a language to be used while processing the glossary, % use the |lwarpmklang| option: % \index{language>glossary} % \index{glossary>language} % % \begin{Verbatim}[gobble=2,frame=lines] % \usepackage[lwarpmklang=english]{lwarp-newproject} % \usepackage[lwarpmklang=english]{lwarp} % \end{Verbatim} % % \index{glossary>processing} % To process the glossary for the print version: % \userentry{lwarpmk printglossary} % % To process the glossary for the \HTML\ version: % \userentry{lwarpmk htmlglossary} % % In each case, the document will have to be recompiled afterwards. % % % % % \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{Processing multiple projects in the same directory} % % It is possible to have several projects in the same directory. % |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 project\_a} % \userentry{lwarpmk html project\_b} % % % \subsection{Using the \texttt{make} utility} % % |lwarpmk| has an action which may be useful for integration with the % common |make| utility: % \begin{sourcedisplay} % |lwarpmk pdftohtml [project]| % \end{sourcedisplay} % % |make| may be used to compile the code to \PDF\ with \HTML\ % tags (|project_html.pdf|), then |lwarpmk| may be used to % convert each target to \HTML\ files. % % % \clearpage % % \section{Additional details} % % \label{sec:usage} % % % % \subsection{Font and UTF-8 support} % \label{sec:fonts} % \index{font>selection} % \index{Unicode>selection} % \index{UTF-8>selection} % \changes{v0.16}{2016/04/08}{Docs: Font and UTF-8 support.} % \changes{v0.16}{2016/04/08}{Lwarp no longer selects fonts.} % % \pkg{lwarp} uses |pdftotext| to convert \PDF\ output into UTF-8-encoded % text. This process requires that UTF-8 information be embedded in the \PDF\ % file, which usually prevents the use of bit-mapped fonts. % \index{font>bitmapped} % % While using |pdflatex|, if no font-related package is specified, the default % \margintag{vector fonts} % bit-mapped Computer Modern font is used, % \margintag{Computer Modern}% % \index{font>Computer Modern}\index{Computer Modern}% % \watchout% % so simply add % \begin{sourcedisplay} % |usepackage{lmodern}| % \end{sourcedisplay} % to the preamble to enable the related vector font instead, or use % \begin{sourcedisplay} % |\usepackage{dejavu}| % \end{sourcedisplay} % % \index{Deja Vu}% % \index{font>Deja Vu}% % \index{Unicode>enhanced coverage}% % \index{UTF-8>enhanced coverage}% % or other other font packages, which may provide an increased coverage of Unicode mappings. % Avoid bit-mapped fonts. % % \XeLaTeX{} and \LuaLaTeX{} users must use the \pkg{fontspec} package. % \watchout % Do NOT use \pkg{fontenc}! % % Place \pkg{fontspec} or \pkg{fontenc} and other font and UTF-8 related commands % after the |\documentclass| command and before |\usepackage{lwarp}|: % % \begin{enumerate} % \item |documentclass{article/book/report}| goes here, 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. % \index{ligatures}\index{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 |pdflatex|: % \begin{itemize} % \item \pkg{lmodern} or other font-related packages % \DescribePackage{lmodern} % \index{font>packages} % \item \pkg{fontenc} % \DescribePackage{fontenc} % \item \pkg{inputenc} % \DescribePackage{inputenc} % \item \pkg{newunicodechar} % \DescribePackage{newunicodechar} % \item |\input glyphtounicode.tex| % \DescribeFile{glyphtounicode} % \item |\input glyphtounicode-cmr.tex% from the pdfx package| % \item |\pdfgentounicode=1| % \item \pkg{cmap} % \DescribePackage{cmap} % \item \pkg{textcomp} % \DescribePackage{textcomp} % \item \pkg{microtype} is automatically used by \pkg{lwarp} % \DescribePackage{microtype} % to turn off f,q,t,T,Q ligatures for the same % \margintag{ligatures} % browser-related reasons shown above. Also, the monospaced font is used % during \HTML\ tag generation to turn off \TeX{} ligatures. % \index{ligatures}\index{font>ligatures} % \end{itemize} % \end{itemize} % \item |\usepackage{lwarp}| (\cref{sec:loading}) goes after any of the above, followed by: % \item \ldots{} the rest of the preamble and the main document. % \end{enumerate} % % \subsection{\protect\pkg{lwarp} package loading and options} % \label{sec:loading} % \index{settings>lwarp package options} % % \pkg{lwarp} supports |book|, |report|, and |article| classes. % % Load the \pkg{lwarp} package immediately after the font and UTF-8 setup commands. % \changes{v0.16}{2016/04/08}{Docs: Moved location of \cs{usepackage\{lwarp\}}.} % \changes{v0.19}{2016/05/25}{Docs: Math options.} % \DescribePackage{lwarp} % \index{lwarp>loading}\index{lwarp>options} % % \DescribeOption[lwarp]{warpprint} % \DescribeOption[lwarp]{warpHTML} % Select the |warpprint| option to generate print output (default), % or the |warpHTML| option to generate \HTMLfive{} output. % The default is print output, so the print version may be % compiled with the usual |pdflatex|, etc. % When \pkg{lwarp-newproject} is loaded in print mode, it creates % |_html.tex|, which sets the |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. % % \DescribeOption[lwarp]{mathsvg} % \DescribeOption[lwarp]{mathjax} % For math display, select |mathsvg| (default), or |mathjax|. % For more information about the math options, see \cref{sec:limitsmath}. % % % \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} % \index{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} % % \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} % % \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} % % % 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 Variable spaces such as \cs{vspace}. \cs{hfill} is turned into a \cs{quad}. % Fixed spaces such as \cs{quad} are emulated correctly. % \item Manual page positions such as the \pkg{textpos} package, which is % emulated but only in a limited way. % \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{Commands for a successful HTML conversion} % \label{sec:successfulcommands} % \index{HTML>commands for a successful conversion} % % \changes{v0.14}{2016/03/26}{Docs: Commands for a successful \HTML\ conversion.} % % Some commonly-used \LaTeX{} expressions should be modified to allow % for a smooth conversion to both \HTML\ and print-formatted outputs: % % \begin{description} % % \item [Page references:] The printed page does not translate to the \HTML\ % page, so references to page numbers are converted to parentheses containing % \cs{pagerefPageFor}, which defaults to ``see '', % followed by a hyperlink to the appropriate % object. Ex: ``Sec.~\textcolor{red}{1.23} % on page (see sec.~\textcolor{red}{1.23})''. % \cs{pagerefPageFor} may be redefined to ``page for '', empty, etc. % % \item [\cs{bfseries}, etc:] Use \cs{textbf} instead. % \item [\cs{centering}, \cs{raggedright}, \cs{raggedleft}:] ~ % % Use the environments \env{center}, \env{flushright}, \env{flushleft} instead. % % \item [Superscripts and other non-math uses of math mode:] ~ % % Use \cs{textsuperscript\{x\}} instead of |$^{x}$| % % \item [Empty \cs{item} followed by a new line of text or a nested list:] \ % % Use a trailing backslash: |\item[label] \| % \index{item, list, empty}\index{list item, empty} % % \item [Filenames in lists:] \ % % Escape underscores in % \margintag{filename underscore} % the filenames: % \begin{sourcedisplay} % |\item[\href{file\_name.pdf}{text}]| % \end{sourcedisplay} % \index{underscore>filename}\index{file>underscore} % \changes{v0.24}{2017/03/13}{Docs: Filename underscore.} % % \item [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. % % \item [\cs{fbox} around a minipage:] ~ % % \cs{fbox} can only be used around inline items during % \HTML\ output. % % For an \cs{fbox} around a minipage, you may: % \index{fbox>around a minipage} % \index{minipage>in an \cs{fbox}} % \begin{itemize} % \item Place the \cs{fbox} command and % its closing brace inside \env{warpprint} environments. % \item Use \cs{mdframed} instead. % ^^A \item Use the \env{example} or \env{sidebar} environments. % \item 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{itemize} % \end{description} % % Also see \cref{sec:troubleshooting}: \nameref{sec:troubleshooting}. % % % % % \subsection{Title page} % \label{sec:settitle} % \index{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 % \subtitle{Optional Document Subtitle \\ with optional multiple lines} % \author{Author One\affiliation{Affiliation One} \and % Author Two\affiliation{Affiliation Two} } % \date{Optional date} % \published{Optional Journal Name \\ Optional multiple lines} % \end{Verbatim} % % The title is used in the meta tags in the \HTML\ files, and the rest are used % in |\maketitle|. % % % \DescribeMacro{\maketitle} % Use |\maketitle| just after the |\begin{document}|, as this will establish % the title of the homepage. Optionally, use a |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 \tag{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 |\title|; these will interfere with the % file break and \CSS\ detection. % \watchout % Use the |\subtitle| command instead. % In \HTML, the title will appear in a heading |h1|. % % \DescribeMacro{\author} \marg{author} % % In |\author|, use |\protect| before formatting commands such as |\textsc|. % \watchout % In \HTML, the author will appear in a \tag{div} class |author|. % \cs{affiliation} is a new addition to \pkg{lwarp}. % % \DescribeMacro{\date} \marg{date} % % |\date| works as expected. % In \HTML, this will appear in a \tag{div} class |titledate|. % % \DescribeMacro{\subtitle} \marg{subtitle} % % A new command which sets a subtitle. Newlines are allowed. % The default is empty. % In \HTML, this will appear in a \tag{div} class |subtitle|. % % \DescribeMacro{\published} \marg{published} % % A new command which sets a publisher. % The default is empty. % In \HTML, this will appear in a \tag{div} class |published|. % % % \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} % \index{HTML>meta tag>description} % \index{description>HTML meta tag} % \index{meta tag, HTML>description} % \DescribeMacro{\NewHTMLdescription} \marg{A description of the web page.} % \quad The default is no description. % % 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{NewHTMLdescription} % \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{NewHTMLdescription} 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{NewHTMLdescription}. It is best % to use a unique description for each \HTML\ file. % % To disable the generation of \HTML\ description meta tags, % \margintag{disabling} % use:\\ % \hspace*{1em} |\NewCSSdescription{}| % % % \subsection{HTML page meta author} % % \index{HTML>meta tag>author} % \index{author>HTML meta tag} % \index{meta tag, HTML>author} % \DescribeMacro{\HTMLauthor} \marg{author} \quad Sets the contents % of the web page \tag{meta name="author"} tag. % Defaults to |\HTMLauthor{\theauthor}|. % May be set empty to cancel the meta author tag. % % % \subsection{CSS} % % \label{sec:projectcss} % \DescribeFile{lwarp.css}\DescribeFile{project.css}\DescribeFile{sample_project.css}\label{sec:lwarpcss}It is best % to make a local project-specific \CSS\ file such as |project.css|, containing only % things which are different from |lwarp.css|. % |project.css| should refer to |lwarp.css| as follows: % \index{CSS>project-specific changes}\index{CSS>lwarp.css} % \index{settings>\CSS\ project-specific} % \vspace{-2ex} % \VerbatimInput[frame=lines]{sample_project.css} % % An example file called |sample_project.css| is provided, and may be renamed |project.css|. % % \label{sec:setcss} % % \DescribeMacro{\NewCSS} % For each section at which \HTML\ files are split, % |\NewCSS| may be used before the sectioning command to select a \CSS\ file for that and all % following sections. This may be changed numerous times throughout the file, resulting in % different \HTML\ pages having different \CSS\ files assigned. % \index{CSS>file selection} % \index{CSS>per HTML page} % \index{settings>CSS selection} % % % % \subsection{Special cases and limitations} % \label{sec:limitations} % % \subsubsection{Text formatting} % % \limitstext % % \subsubsection{Footnotes and page notes} % % \limitsfootnotes % % % \subsubsection{Math} % \label{sec:limitsmath} % % \limitsmath % % For an example of using custom \LaTeX\ macros with MathJax, % \margintag{custom MathJax macros} % see page \pageref{ex:mathjaxmacros}. % % \subsubsection{Ntheorem} % % \limitsntheorem % % % \subsubsection{Graphics} % % \limitsgraphics % % % \subsubsection{Xcolor} % % \limitsxcolor % % % \subsubsection{Tabular} % % \limitstabular % % % \subsubsection{Longtable} % % \limitslongtable % % % \subsubsection{Save Boxes} % % \changes{v0.27}{2017/04/04}{Docs: Limitations of saveboxes.} % % \limitssaveboxes % % % \subsubsection{Minipages} % % \limitsminipage % % % \subsubsection{Mdframed} % % \limitsmdframed % % % \subsubsection{\pkg{float}, \pkg{trivfloat}, and/or \pkg{algorithmicx} together} % % \limitscombiningfloats % % % \subsubsection{\pkg{caption} and \pkg{subcaption} packages} % % \limitscaption % % % \subsubsection{\pkg{subfig} package} % % \limitssubfig % % % \subsubsection{\pkg{floatrow} package} % % \limitsfloatrow % % % \subsubsection{\pkg{abstract} package} % % \limitsabstract % % % \subsubsection{\pkg{cleveref} and \pkg{varioref} packages} % % \changes{v0.22}{2017/03/01}{\pkg{varioref}: Supported.} % % \limitspageref % % % \subsubsection{\pkg{verse} and \pkg{memoir}} % % \limitsverse % % % \subsubsection{\pkg{siunitx} package} % % \DescribePackage{siunitx} % \limitssiunitx % % % \subsubsection{\pkg{newclude} package} % % \changes{v0.14}{2016/03/29}{Docs: Newclude limitations.} % % \DescribePackage{newclude} % \limitsnewclude % % % \subsubsection{\pkg{newtxmath} package} % % \DescribePackage{newtxmath} % \limitsnewtxmath % % % \subsubsection{\pkg{babel} package} % % \DescribePackage{babel} % \limitsbabelone % % \limitsbabeltwo % % % \subsubsection{\pkg{glossaries} package} % % \DescribePackage{glossaries} % \limitsglossaries % % % \subsubsection{\pkg{enumitem} package} % % \DescribePackage{enumitem} % \limitsenumitem % % % \subsubsection{\pkg{enumerate} package} % % \DescribePackage{enumerate} % \limitsenumerate % % % % % % \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{\tag{meta} author} % files, and also for the \EPUB, % use \cs{HTMLauthor} \marg{name}. This assigns the name to the % \tag{meta} author tag. 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: % % \DescribeBoolean{FormatEPUB} % \begin{docsidebar} % \raggedright % Default false. % |FormatEPUB| changes \HTML\ output for easy \EPUB\ conversion % via an external program. Removes per-file headers, footers, and nav. % Adds footnotes per chapter/section. % \end{docsidebar} % \index{EPUB>HTML conversion settings} % \index{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} then % \userentry{lwarpmk html} % 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 file split. % \end{itemize} % % The resulting files will be ready to be loaded into an \EPUB\ conversion % program, such as the open-source program Calibre (\url{https://calibre-ebook.com/}). % \index{Calibre}\index{EPUB>conversion software}\margintag{Calibre} % % The \EPUB\ conversion program must know what order the files are included. % For \pkg{lwarp} projects, set the \EPUB\ conversion software to % \watchout[search order] % do a breadth-first search of the files. % For Calibre, this option is found in % \begin{UIdisplay} % \textsf{Preferences $\to$ Plugins $\to$ File type plugins $\to$ HTML to Zip} % \end{UIdisplay} % Check the box \textsf{Add linked files in breadth first order.} % % The \EPUB-conversion program must also know where the section breaks are located. % \watchout[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 \tag{h4}, whereas a |book| class document would break at \cs{chapter}, % which is \HTML\ heading level \tag{h3}. % For Calibre, this option is found in % \begin{UIdisplay} % \textsf{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} % Math HTML tags with tag name: % \end{UIdisplay} % to \tag{h4}. (Or \tag{h3} for document classes with \cs{chapter}s.) % The \textsf{Detect chapters at} field should then show % \begin{UIdisplay} % //h:h4 \qquad \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 Calibre, and then converted to an \EPUB. % % \begin{docsidebar}[MathJax support] % MathJax may be used in \EPUB\ documents. % Some e-readers include 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 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 MathJax, especially for equations numbered by chapter, % or where \pkg{siunitx} support is important. % \end{docsidebar} % % % % % \clearpage % % \section{Word-processor conversion} % % \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 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. % % % A special boolean is provided to simplify the process of % converting \pkg{lwarp} \HTML\ output to \EPUB: % % \DescribeBoolean{FormatWordProcessor} % \begin{docsidebar} % \raggedright % Default 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. % \end{docsidebar} % \index{word processor>HTML conversion settings} % \index{HTML>conversion settings>word processor} % % To help modify \pkg{lwarp} \HTML\ output for easier % import to a word processor, add % \begin{sourcedisplay} % |\booltrue{FormatWordProcessor}| % \end{sourcedisplay} % to the project's source preamble after \pkg{lwarp} is loaded. % Several changes are then made to the \HTML\ output: % \begin{itemize} % \item Headers, footers, and navigation are removed at file splits. % \item Any accumulated footnotes are printed at the bottom of each file split. % These will have to be manually moved to their proper place in % the document. \pkg{lwarp} does not know where the page breaks % will be in the word processor's document, so the footnotes are % simply moved to the end of each sectional break. % \item 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 \tag{div}s, % but they are no longer useful when the document has been % imported into a word processor. % \end{itemize} % % An additional boolean may be set to help mark float boundaries: % % \DescribeBoolean{HTMLMarkFloats} % \begin{docsidebar} % \raggedright % Default true. % Adds |=== table begin| or |=== figure begin|, and |=== end| % around floats while formatting for word processors. % This helps identify boundaries of floats to be manually converted % to word-processor frames. % \end{docsidebar} % \index{word processor>HTML conversion settings} % \index{HTML>conversion settings>word processor} % % When enabled, markers are placed around each float, helping the % user to identify float boundaries for further conversion to % word processor frames and captions. % % % \clearpage % % \section{Modifying \protect\pkg{lwarp}} % \pagestyle{pageheadfoot} % % 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 % 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, % see \cref{sec:highlevelclasses}. % % \subsection{Creating an \protect\pkg{lwarp} version of a package} % % 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 \cs{LWR@ProvidesPackageDrop} % or \cs{LWR@ProvidesPackagePass}. 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. % % % \subsection{Testing \protect\pkg{lwarp}} % % \changes{v0.25}{2017/03/22}{Docs: Testing \protect\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. % % The package \pkg{lwarp-newproject} must be loaded to set up the configuration % files, but may be commented out from then on unless the configuration changes. % A small amount of time is taken each time \pkg{lwarp-newproject} is run. % % Remember that the configuration files are only rewritten when compiling the % printed version of the document, and when \pkg{lwarp-newproject} is enabled. % % 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 \protect\texttt{lwarpmk}} % % \changes{v0.28}{2017/04/14}{Docs: Modfying lwarpmk and index processing.} % % \DescribeProgram{lwarpmk} % \DescribeFile{lwarpmk.lua} % In most installations, |lwarpmk.lua| is an executable file located somewhere % \index{lwarpmk>customizing} % the operating system knows about, and it is called by typing ``|lwarpmk|'' into % a terminal. % % A project-local copy of |lwarpmk.lua| may be generated, modified, and then used to % compile documents: % \begin{enumerate} % \item Add the |lwarpmk| option to the \pkg{lwarp-newproject} package. % \item Recompile the printed version of the document. % The |lwarpmk| option causes \pkg{lwarp-newproject} to create a local % copy of |lwarpmk.lua| % \item The |lwarpmk| option may now be removed from the \pkg{lwarp-newproject} package. % \item Copy and rename |lwarpmk.lua| to a new file such as |mymake.lua|. % \item Modify |mymake.lua| as desired. % \item If necessary, make |mymake.lua| executable. % \item Use |mymake.lua| instead of |lwarpmk.lua|. % \end{enumerate} % % To adjust the command-line arguments for compiling the document, % look in |mymake.lua| for ``|latexname|''. % % To adjust the command-line arguments for processing the index, % look for ``|xindy|''. % % % \subsection{Modifying \protect\texttt{xindy} index processing} % % \DescribeProgram{xindy} % \DescribeFile{lwarp_html.xdy} % \index{lwarp\_html.xdy>customizing} % \index{xindy>customizing} % \pkg{lwarpmk} uses the file |lwarp_html.xdy| to process the index. % This file is over-written by \pkg{lwarp-newproject} whenever a print version of % the document is processed. % % To customize index processing: % \begin{enumerate} % \item Copy |lwarp_html.xdy| to a new filename such as |projectname.xdy| % \item Make changes to |projectname.xdy| % \item Make a new version of |lwarpmk|, as previously described, % which uses |xindy| with |projectname.xdy| instead of |lwarp_html.xdy|. % \end{enumerate} % % % % \clearpage % % \section{Troubleshooting} % \label{sec:troubleshooting} % \index{FAQ}\index{Frequently Asked Questions}\index{bugs} % \index{troubleshooting}\index{problems}\index{error messages} % \index{debugging} % % \subsection{Using the \protect\texttt{lwarp.sty} package} % % Also see: \\ % \Cref{sec:printcommands}: \nameref{sec:printcommands} \\ % \Cref{sec:successfulcommands}: \nameref{sec:successfulcommands} \\ % \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.} % % \begin{description} % % \item [Text is not converting:] ~ % \begin{itemize} % \item Font-related UTF-8 information must be embedded in the \PDF\ file. % See \cref{sec:fonts} regarding vector fonts. % \end{itemize} % % \item [Undefined \HTML\ settings:] \ % \item See the warning regarding the placement of the \HTML\ settings % at \cref{sec:htmlsettings}. % % \item [Obscure error messages:] ~ % \begin{itemize} % \item 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. % \end{itemize} % % \item [Missing sections:] ~ % \begin{itemize} % \item See \cref{sec:filedepth} regarding the % |FileDepth| and |SideTOCDepth| counters, % and the use of \cs{tableofcontents} in the home page. % \end{itemize} % % \item [Missing \HTML\ files:] \ % \item See the warning regarding changes to the \HTML\ settings % at \cref{sec:htmlsettings}. % % \item [Missing / incorrect cross-references:] ~ % \index{cross-references>missing or incorrect} % \begin{itemize} % \item Use |lwarpmk again| followed % by |lwarpmk html| or |lwarpmk print| to compile the document one more time. % \end{itemize} % % \item [Em-dashes or En-dashes in listing captions and titles:] \ % % Use \XeLaTeX\ or \LuaLaTeX. % % \item [Floats 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 [Print document contains \HTML\ tags:] ~ % \begin{itemize} % \item Be sure that the document % selects |\usepackage[warpprint]{lwarp}| instead of |[warpHTML]|. % \end{itemize} % \item [HTML document contains a single unformatted print % document:] ~ % \begin{itemize} % \item Be sure that the document % selects |\usepackage[warpHTML]{lwarp}| instead of |[warpprint]|. % \end{itemize} % % \item [Images are appearing in strange places:] ~ % \index{images>in strange places} % \begin{itemize} % \item |lwarpmk limages| to refresh the |lateximage| images. % \end{itemize} % % \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. % % \item [Plain-looking document:] ~ % \begin{itemize} % \item The document's \CSS\ stylesheet may not be available, or may be % linked incorrectly. Verify any \cs{NewCSS} statements point to % a valid \CSS\ file. % \end{itemize} % % \item [Broken fragments of HTML:] ~ % \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:] ~ % \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} % 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 \protect\texttt{lwarp.dtx} file} % % \begin{description} % \item [Illogical error messages caused by an out-of-sync |lwarp.sty| file:] ~ % \begin{enumerate} % \item Delete the |lwarp.sty| file. % \item |pdflatex lwarp.ins| to generate a new |lwarp.sty| file. % \item |pdflatex lwarp.dtx| to recompile the |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} % % % % % \StopEventually{\PrintChanges\PrintIndex} % % % % % \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 \cmds{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. % % There is still room to improve the factoring of the code, and doing so will become % important if support for other output formats is added. Rather than wait until the % code is pristine, the author felt it best to publish early and accept input before % pushing on towards a perhaps less-than-ideal solution. % % % Testing has primarily been done with the Iceweasel/Firefox browser. % % % \section{Stack depths} % \label{sec:stackdepths} % \index{HTML>headings} % \index{section>depths}\index{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} % \caption{Section depths and HTML headings\label{tab:depthsheadings}} % \begin{tabular}{lcl} % \toprule % Section & \parbox[c]{.35in}{\LaTeX{} depth} & \HTML\ headings \\ % \midrule % title of the entire website & & h1 \\ % none & -5 & new for this package \\ % book & -2 & \textbf{not yet used} \\ % part & -1 & h2 \\ % chapter & 0 & h3 \\ % section & 1 & h4 \\ % subsection & 2 & h5 \\ % subsubsection & 3 & h6 \\ % paragraph & 4 & span class = "paragraph" \\ % subparagraph & 5 & span class = "subparagraph" \\ % listitem & 7 & new for this package, used for list items \\ % \bottomrule % \end{tabular} % \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 \tag{div} due to a limit of six \HTML\ headings. % % It is possible to use \HTMLfive{} \cmds{section} and \cmds{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} % 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. % % \index{numbers>left margin}\index{line numbers} % \index{margin>numbers}\index{margin>tags} % \documentationnotes % \index{warning icon}\index{danger icon}\index{icon>warning} % \index{for>HTML output}\index{for>PRINT output}\index{for>HTML \& PRINT} % \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 — pdflatex, lualatex, xelatex} % % \begin{macrocode} \RequirePackage{iftex} \ifLuaTeX \RequirePackage{luatex85}% until the geometry package is updated \fi % \end{macrocode} % % % % \section{Unicode Input Characters} % \changes{v0.18}{2016/05/17}{PDF Unicode input characters.} % \index{Unicode>input characters} % % \codeall % % If using |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. % \begin{macrocode} \RequirePackage{newunicodechar} \newunicodechar{⨯}{\texttimes} \ifPDFTeX \newunicodechar{ff}{ff}% the first arguments are ligatures \newunicodechar{fi}{fi} \newunicodechar{fl}{fl} \newunicodechar{ffi}{ffi} \newunicodechar{ffl}{ffl} \newunicodechar{—}{---} \newunicodechar{–}{--} % \end{macrocode} % In PDF\TeX, preserve upright quotes in verbatim text: % \begin{macrocode} \RequirePackage{upquote} \else \fi % \end{macrocode} % % % % \section{Handling package options} % \label{sec:handlingpackageoptions} % % % \DescribePackage{etoolbox} % Provides |\ifbool| and other functions. % % \begin{macrocode} \RequirePackage{etoolbox}[2011/01/03] % requires v2.6 for \BeforeBeginEnvironment, etc. % \end{macrocode} % \DescribePackage{ifplatform} % Provides \cs{ifwindows} to try to automatically detect % Windows OS. % % \begin{macrocode} \RequirePackage{ifplatform}% sense op-system platform % \end{macrocode} % % % \DescribePackage{comment} % Provides conditional code blocks. % % \begin{macrocode} \RequirePackage{comment} \excludecomment{testing} % \end{macrocode} % \DescribePackage{kvoptions} % Allows key/value package options. % \begin{macrocode} \RequirePackage{kvoptions} \SetupKeyvalOptions{family=LWR,prefix=LWR@} % \end{macrocode} % \DescribeBoolean{warpingprint} % \DescribeBoolean{warpingHTML} % \DescribeBoolean{mathjax} % % Set to true/false depending on the package option selections for % print/\HTML/\EPUB\ output and mathsvg/mathjax: % \begin{macrocode} \newbool{warpingprint} \newbool{warpingHTML} \newbool{mathjax} % \end{macrocode} % % % % % \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} % \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} % Anything in the |warpprint| environment will be generated for print output only. % % \DescribeOption[lwarp]{warpprint} % If the |warpprint| option is given, boolean |warpingprint| is true and boolean |warpingHTML| is false, % and may be used for |\ifbool| tests. % % \begin{macrocode} \DeclareVoidOption{warpprint}{% \PackageInfo{lwarp}{Using option 'warpprint'} \includecomment{warpprint}% \excludecomment{warpHTML}% \booltrue{warpingprint}% \boolfalse{warpingHTML}% } % \end{macrocode} % \end{environment} % \begin{environment}{warpHTML} % Anything in the |warpHTML| environment will be generated for \HTML\ output only. % % \DescribeOption[lwarp]{warpHTML} % If the |warpHTML| option is given, boolean |warpingHTML| is true and boolean |warpingprint| is false, % and may be used for |\ifbool| tests. % % \begin{macrocode} \DeclareVoidOption{warpHTML}{% \PackageInfo{lwarp}{Using option 'warpHTML'} \excludecomment{warpprint}% \includecomment{warpHTML}% \booltrue{warpingHTML}% \boolfalse{warpingprint}% } % \end{macrocode} % \end{environment} % % % % % \changes{v0.19}{2016/05/25}{Options: mathsvg and mathjax} % \DescribeOption[lwarp]{mathsvg} % Option |mathsvg| selects \SVG\ math display: % \index{math>mathsvg option} % \index{SVG>mathsvg option} % If the |mathsvg| option is given, boolean |mathjax| is false, and may be used for |\ifbool| tests. % \begin{macrocode} \DeclareVoidOption{mathsvg}{% \PackageInfo{lwarp}{Using option 'mathsvg'} \boolfalse{mathjax}% } % \end{macrocode} % % \DescribeOption[lwarp]{mathjax} % Option |mathjax| selects MathJax math display: % \index{math>mathjax option} % \index{MathJax>mathjax option} % If the |mathjax| option is given, boolean |mathjax| is true, may be used for |\ifbool| tests. % \begin{macrocode} \DeclareVoidOption{mathjax}{% \PackageInfo{lwarp}{Using option 'mathjax'} \booltrue{mathjax}% } % \end{macrocode} % \DescribeOption[lwarp]{BaseJobname} % Option |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[lwarp]{lwarpmklang} Sets the language to be assigned % in |lwarpmk|'s configuration files. This is then used by |lwarpmk| while % processing the glossary. % % \changes{v0.29}{2017/04/15}{Add: \protect\texttt{lwarpmklang} option for \pkg{lwarp}.} % % \begin{macrocode} \DeclareStringOption[english]{lwarpmklang} % \end{macrocode} % The default is print output, % and \SVG\ math if the user chose \HTML\ output. % \begin{macrocode} \includecomment{warpprint}% \excludecomment{warpHTML}% \booltrue{warpingprint}% \boolfalse{warpingHTML}% \boolfalse{mathjax}% % \ExecuteOptions{warpprint,mathsvg} \ProcessKeyvalOptions*\relax % \end{macrocode} % Assign the \cs{BaseJobname} if the user hasn't provided one: % \begin{macrocode} \providecommand*{\BaseJobname}{\LWR@BaseJobname} % \end{macrocode} % \begin{macro}{\@nameedef} \marg{name} \marg{defn} % % Expands || before assigning to || % \begin{macrocode} \def\@nameedef#1{\expandafter\edef\csname #1\endcsname} % \end{macrocode} % \end{macro} % \section{Misplaced packages} % % \changes{v0.21}{2017/02/22}{Add: Errors for misplaced packages.} % Several packages should only be loaded before \pkg{lwarp}, and % others should only be loaded after. % % Packages which should only be loaded before \pkg{lwarp} have their own % \begin{sourcedisplay} % |lwarp-.sty| % \end{sourcedisplay} % which will trigger an error if they are loaded after % \pkg{lwarp}. % Examples include \pkg{fontspec}, \pkg{inputenc}, \pkg{fontenc}, % and \pkg{newunicodechar}. % % % \begin{macro}{\LWR@loadafter} \marg{packagename} \quad % Error if this package was loaded before \pkg{lwarp}. % % \begin{macrocode} \newcommand*{\LWR@loadafter}[1]{% \@ifpackageloaded{#1} { \PackageError{lwarp} {Package #1, or one which uses #1, must be loaded after lwarp} {Move \detokenize{\usepackage}{#1} after \detokenize{\usepackage}{lwarp}. Package #1 may also be loaded by something else, which must also be moved after lwarp.} } {} } % \end{macrocode} % \end{macro} % \begin{macro}{\LWR@loadbefore} \marg{packagename} \quad % Error if this package is after \pkg{lwarp}. % % \begin{macrocode} \newcommand*{\LWR@loadbefore}[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@loadnever} \marg{badpackagename} \marg{replacementpkgname} % % 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 does not work with lwarp's HTML conversion. Please use the #2 package instead} {Package #1 conflicts with lwarp in some way, but package #2 probably will work instead.} } % \end{macrocode} % \end{macro} % 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.} % % The following packages must be loaded after \pkg{lwarp}: % \begin{macrocode} \LWR@loadafter{abstract} \LWR@loadafter{afterpage} \LWR@loadafter{algorithmicx} \LWR@loadafter{alltt} \LWR@loadafter{amsthm} \LWR@loadafter{bookmark} \LWR@loadafter{booktabs} \LWR@loadafter{ccaption} \LWR@loadafter{changepage} \LWR@loadafter{cutwin} \LWR@loadafter{dcolumn} \LWR@loadafter{draftwatermark} \LWR@loadafter{ellipsis} \LWR@loadafter{emptypage} \LWR@loadafter{enumerate} \LWR@loadafter{epigraph} \LWR@loadafter{eso-pic} \LWR@loadafter{everypage} \LWR@loadafter{extramarks} \LWR@loadafter{fancyhdr} \LWR@loadafter{floatrow} \LWR@loadafter{float} \LWR@loadafter{floatflt} \LWR@loadafter{ftnright} \LWR@loadafter{geometry} \LWR@loadafter{glossaries} % \LWR@loadafter{graphics}% pre-loaded by xunicode % \LWR@loadafter{graphicx}% pre-loaded by xunicode \LWR@loadafter{hyperref} \LWR@loadafter{indentfirst} \LWR@loadafter{keyfloat} \LWR@loadafter{layout} \LWR@loadafter{letterspace} \LWR@loadafter{lettrine} \LWR@loadafter{lips} \LWR@loadafter{listings} \LWR@loadafter{longtable} \LWR@loadafter{lscape} \LWR@loadafter{ltcaption} \LWR@loadafter{marginfix} \LWR@loadafter{marginnote} \LWR@loadafter{mcaption} \LWR@loadafter{mdframed} \LWR@loadafter{microtype} \LWR@loadafter{mparhack} %\LWR@loadafter{multicol}% loaded by ltxdoc \LWR@loadafter{multirow} \LWR@loadafter{nameref} \LWR@loadafter{needspace} \LWR@loadafter{newtxmath} \LWR@loadafter{nextpage} \LWR@loadafter{nowidow} \LWR@loadafter{ntheorem} \LWR@loadafter{pagenote} \LWR@loadafter{parskip} \LWR@loadafter{placeins} \LWR@loadafter{ragged2e} \LWR@loadafter{rotating} \LWR@loadafter{setspace} \LWR@loadafter{showidx} \LWR@loadafter{showkeys} \LWR@loadafter{sidecap} \LWR@loadafter{sidenotes} \LWR@loadafter{soul} \LWR@loadafter{subfig} \LWR@loadafter{tabularx} \LWR@loadafter{tabulary} \LWR@loadafter{textpos} \LWR@loadafter{theorem} \LWR@loadafter{threeparttable} \LWR@loadafter{tikz} \LWR@loadafter{titleps} \LWR@loadafter{titlesec} \LWR@loadafter{titletoc} \LWR@loadafter{tocloft} \LWR@loadafter{trivfloat} \LWR@loadafter{ulem} \LWR@loadafter{varioref} \LWR@loadafter{verse} \LWR@loadafter{wallpaper} \LWR@loadafter{wrapfig} \LWR@loadafter{xcolor} \LWR@loadafter{xfrac} % \end{macrocode} % \section{Required packages} % \label{sec:requiredpackages} % \index{packages>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. % % In the document preamble, create a \env{warpprint} environment, and place % inside it any of the following packages which are required and which % are labeled as ``Print: OK to Load in a \env{warpprint} environment''. % Those packages which are labeled as ``Print: Pre-Loaded'' % need not be placed into the document preamble. % \codeall % \begin{macrocode} \begin{warpall} % \end{macrocode} % \changes{v0.16}{2016/04/07}{Added XeLaTeX, LuaLaTeX support.} % See: \url{http://tex.stackexchange.com/a/47579}. % Detects \XeTeX{} and \LuaLaTeX: % \index{XeLaTeX>detection}\index{LuaLaTeX>detection} % \begin{macrocode} \RequirePackage{iftex} \newif\ifxetexorluatex \ifXeTeX \xetexorluatextrue \else \ifLuaTeX \xetexorluatextrue \else \xetexorluatexfalse \fi \fi % \end{macrocode} % \begin{macrocode} \end{warpall} % \end{macrocode} % \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 % \index{font>during conversion} % ^^A % For \XeLaTeX{} and \LuaLaTeX, uses DejaVu Serif for enhanced Cyrillic and Greek coverage. % ^^A % \index{Unicode>XeLaTeX \& LuaLaTeX} % \begin{macrocode} \ifxetexorluatex % ^^A \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 |pdflatex|, use \pkg{fontenc} and \pkg{lmodern}: % ^^A % \marginpar{\textcolor{blue}{|pdflatex| only:}} % ^^A % \index{Unicode>pdfLaTeX} % ^^A % \index{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 % |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 % \index{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.} % % \codehtml % \begin{macrocode} \begin{warpHTML} \RequirePackage[paperheight=190in,paperwidth=20in,% left=2in,right=12in,% top=1in,bottom=1in,% ]{geometry} \@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} % \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. % \begin{macrocode} \RequirePackage{everyhook} \end{warpHTML} % \end{macrocode} % \codeall % \begin{macrocode} \begin{warpall} % \end{macrocode} % \DescribePackage{fancyvrb} % % Used for Verbatim, verse. % \begin{macrocode} \RequirePackage{fancyvrb} % \end{macrocode} % \begin{macrocode} \end{warpall} % \end{macrocode} % \codehtml % \begin{macrocode} \begin{warpHTML} % \end{macrocode} % \DescribePackage{xifthen} % \begin{macrocode} \RequirePackage{xifthen} % \end{macrocode} % \DescribePackage{xstring} % \begin{macrocode} \RequirePackage{xstring} % \end{macrocode} % \DescribePackage{makeidx} % \begin{macrocode} \RequirePackage{makeidx} \makeindex % \end{macrocode} % \DescribePackage{calc} % \begin{macrocode} \RequirePackage{calc} % \end{macrocode} % \DescribePackage{refcount} % \begin{macrocode} \RequirePackage{refcount} % \end{macrocode} % \DescribePackage{newfloat} % \begin{macrocode} \RequirePackage{newfloat} % \end{macrocode} % \DescribePackage{caption} % \begin{macrocode} \RequirePackage{caption} % \end{macrocode} % \changes{v0.24}{2017/03/06}{No longer preloads \pkg{subcaption}; % conflicted with \pkg{subfig}.} % \DescribePackage{enumitem} % % \pkg{enumitem} is patched to support |\newlist| with \HTML. % \begin{macrocode} \RequirePackage{enumitem} \setlist[itemize]{leftmargin=0em} \setlist[enumerate]{leftmargin=0em} \setlist[description]{leftmargin=0em} % \end{macrocode} % \begin{macrocode} \end{warpHTML} % \end{macrocode} % \codeall % \begin{macrocode} \begin{warpall} % \end{macrocode} % \DescribePackage{titling} % % Used for |\maketitle| and the title page. See \cref{sec:titles}. % \begin{macrocode} \RequirePackage{titling} % \end{macrocode} % \begin{macrocode} \end{warpall} % \end{macrocode} % \codehtml % \begin{macrocode} \begin{warpHTML} % \end{macrocode} % \DescribePackage{zref} % % Used for cross-references. % \begin{macrocode} \RequirePackage{zref} % \end{macrocode} % \DescribePackage{amsmath} % \changes{v0.16}{2016/04/09}{Fix: amsmath options clash} % % Equation numbers are placed to the left for \HTML. % % \pkg{newtxmath} automatically loads \pkg{amsmath}, % so the options |leqno| and |fleqn| are passed beforehand to be % picked up both here and by \pkg{newtxmath} if it is used. % \changes{v0.16}{2016/04/11}{Fix: newtxmath compatibility.} % % \begin{macrocode} \PassOptionsToPackage{leqno,fleqn}{amsmath} \RequirePackage{amsmath} % \end{macrocode} % \DescribePackage{environ} % % Used to encapsulate math environments for re-use in \HTML\ ALT text. % % \begin{macrocode} \RequirePackage{environ} % \end{macrocode} % \DescribePackage{titleps} % \changes{v0.19}{2016/05/27}{titleps: null \cs{pagestyle} and \cs{thispagestyle} for HTML.} % % Used to place an \HTML\ comment into the footer of a page below the footnotes. % This comment is used for |lateximage| environments, including math. % % The |nopatches| option prevents titleps from trying to patch sectioning commands. % % \cs{pagestyle} and \cs{thispagestyle} are nullified for \HTML\ output. % % \begin{macrocode} \RequirePackage[nopatches]{titleps} % \end{macrocode} % % \begin{macro}{\pagestyle} \marg{style} % \begin{macrocode} \let\LWR@origpagestyle\pagestyle \renewcommand*{\pagestyle}[1]{} % \end{macrocode} % \end{macro} % % \begin{macro}{\thispagestyle} \marg{style} % \begin{macrocode} \let\LWR@origthispagestyle\thispagestyle \renewcommand*{\thispagestyle}[1]{} % \end{macrocode} % \end{macro} % % \begin{macro}{\pagenumbering} \marg{commands} % \begin{macrocode} \let\LWR@origpagenumbering\pagenumbering \renewcommand*{\pagenumbering}[1]{} % \end{macrocode} % \end{macro} % % \DescribePackage{xfrac} % % Patched for \HTML\ use. % See \cref{sec:xfrac}. % \begin{macrocode} \RequirePackage{xfrac} % \end{macrocode} % % Used to convert lengths for image width/height options. % % \begin{macrocode} \RequirePackage{printlen} % \end{macrocode} % \begin{macrocode} \end{warpHTML} % \end{macrocode} % \section{Loading packages} % % % \codehtml % \begin{macrocode} \begin{warpHTML} % \end{macrocode} % Remember the original \cs{RequirePackage}: % \begin{macrocode} \let\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@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} % % \begin{macro}{\LWR@lookforpackagename} \marg{index} % If this is a package name, re-direct it to the \pkg{lwarp} version % by renaming it |lwarp-| followed by the original name. % \begin{macrocode} \newcommand*{\LWR@lookforpackagename}[1]{ % \end{macrocode} % Find the n'th package name from the list: % \begin{macrocode} \LWR@findword{\LWR@requirepackagenames}{#1}[\LWR@strresult] % \end{macrocode} % See if the package name was found: % \begin{macrocode} \IfStrEq{\LWR@strresult}{} {}% no filename {% yes filename % \end{macrocode} % If found, and if an \pkg{lwarp}-equivalent name exists, use |lwarp-|* instead. % \begin{macrocode} \IfFileExists{lwarp-\LWR@strresult.sty} {% latex_html_ file found \StrSubstitute {\LWR@requirepackagenames} {\LWR@strresult} {lwarp-\LWR@strresult}[\LWR@requirepackagenames] } {}% no latex_html_* 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. % % \begin{macrocode} \RenewDocumentCommand{\RequirePackage}{o m o}{% % \end{macrocode} % Redirect up to nine names: % \begin{macrocode} \renewcommand*{\LWR@requirepackagenames}{#2} \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} % \end{macrocode} % \cs{RequirePackage} depending on the options and version: % \begin{macrocode} \IfValueTF{#1} {% options given \IfValueTF{#3}% version given? {\LWR@origRequirePackage[#1]{\LWR@requirepackagenames}[#3]} {\LWR@origRequirePackage[#1]{\LWR@requirepackagenames}} } {% no options given \IfValueTF{#3}% version given? {\LWR@origRequirePackage{\LWR@requirepackagenames}[#3]} {\LWR@origRequirePackage{\LWR@requirepackagenames}} } } \let\usepackage\RequirePackage % \end{macrocode} % \end{macro} % \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, 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} % \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, discarding options,}% \IfValueTF{#2} {\ProvidesPackage{lwarp-#1}[#2]} {\ProvidesPackage{lwarp-#1}} \DeclareOption*{} \ProcessOptions\relax } % \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} \newcommand*{\LWR@copyfile}[2]{% \newwrite\copyfile % open the file to write to \immediate\openout\copyfile=#2 \newread\file % open the file to read from \openin\file=#1 \begingroup\endlinechar=-1 \makeatletter \loop\unless\ifeof\file \read\file to\fileline % Read one line and store it into \fileline % \fileline\par % print the content into the pdf % print the content: \immediate\write\copyfile{\unexpanded\expandafter{\fileline}}% \repeat \closeout\copyfile \endgroup } % \end{macrocode} % \end{macro} % \begin{macrocode} \end{warpHTML} % \end{macrocode} % \section{Debugging messages} % \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}% % \PackageInfo{lwarp}{#1 : }% }% {}% } % \end{macrocode} % \end{macro} % \DescribeBoolean{HTMLDebugComments} Default false. % Add comments in \HTML\ % about closing \tag{div}s, sections, etc. % \index{HTML>conversion settings>debug comments} % \index{debugging>HTML debug comments} % \index{troubleshooting>HTML debug comments} % % \changes{v0.28}{2017/04/09}{Added boolean \texttt{HTMLDebugComments.}} % % \begin{macrocode} \newbool{HTMLDebugComments} \boolfalse{HTMLDebugComments} % \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. % % % \DescribeBoolean{FormatEPUB} Default false. % Changes \HTML\ output for easy \EPUB\ conversion % via an external program. Removes per-file headers, footers, and nav. % Adds footnotes per chapter/section. % \index{EPUB>HTML conversion settings} % \index{HTML>conversion settings>EPUB} % % \changes{v0.28}{2017/04/09}{Added boolean \texttt{FormatEPUB}.} % % \begin{macrocode} \newbool{FormatEPUB} \boolfalse{FormatEPUB} % \end{macrocode} % % % \DescribeBoolean{FormatWordProcessor} Default 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. % \index{word processor>HTML conversion settings} % \index{HTML>conversion settings>word processor} % % \changes{v0.28}{2017/04/09}{Added boolean \texttt{FormatWordProcessor}.} % % \begin{macrocode} \newbool{FormatWordProcessor} \boolfalse{FormatWordProcessor} % \end{macrocode} % % % \DescribeBoolean{HTMLMarkFloats} Default true. % Adds |=== table begin| or |=== figure begin|, and |=== end| % around floats while formatting for word processors. % This helps identify boundaries of floats to be manually converted % to word-processor frames. % (Perhaps some day word processors will have \HTML\ import options % for identifying \tag{div} classes for figures and tables.) % \index{word processor>HTML conversion settings} % \index{HTML>conversion settings>word processor} % % \changes{v0.28}{2017/04/09}{Added boolean \texttt{HTMLMarkFloats}} % % \begin{macrocode} \newbool{HTMLMarkFloats} \booltrue{HTMLMarkFloats} % \end{macrocode} % \begin{macrocode} \end{warpall} % \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. % \begin{macrocode} \let\LWR@origtextit\textit \let\LWR@origtextbf\textbf \let\LWR@origtexttt\texttt \let\LWR@origtextsc\textsc \let\LWR@origtextsf\textsf \let\LWR@origtextrm\textrm \let\LWR@origbfseries\bfseries \let\LWR@origrmfamily\rmfamily \let\LWR@origttfamily\ttfamily \let\LWR@orignormalfont\normalfont \let\LWR@origraggedright\raggedright \let\LWR@origonecolumn\onecolumn \let\LWR@origtextsuperscript\textsuperscript \let\LWR@origtextsubscript\textsubscript \let\LWR@origscriptsize\scriptsize \let\LWR@orignewpage\newpage \let\LWR@origminipage\minipage \let\LWR@origendminipage\endminipage \let\LWR@orignewline\newline \let\LWR@origitem\item \let\LWR@origpar\par \let\LWR@origfootnote\footnote \let\LWR@orig@mpfootnotetext\@mpfootnotetext \let\LWR@origclearpage\clearpage \let\clearpage\relax \let\cleardoublepage\relax % \end{macrocode} % \begin{macrocode} \end{warpHTML} % \end{macrocode} % \section{Operating-System portability} % \label{sec:OSportability} % \changes{v0.11}{2016/03/11}{Added section: Operating-System portability.} % % \osportabilityusage % % \codeall % \begin{macrocode} \begin{warpall} % \end{macrocode} % % % \subsection{Common portability code} % % \DescribeBoolean{usingOSwindows}Set if \cs{warpOSwindows}. % \begin{macrocode} \newbool{usingOSwindows} \boolfalse{usingOSwindows} % \end{macrocode} % % \subsection{Unix, Linux, and Mac\,OS} % \begin{macro}{\OSPathSymbol} % Symbol used to separate directories in a path. % \begin{macrocode} \newcommand*{\OSPathSymbol}{/} % \end{macrocode} % \end{macro} % \subsection{MS-Windows} % For MS-Windows: % % \begin{macro}{\warpOSwindows} % Set defaults for the MS-Windows operating system. % \pkg{lwarp} attempts to auto-detect the operatings system, % so \cs{warpOSwindows} may not be necessary. % % \changes{v0.20}{2016/12/19}{Auto-detects operating system.} % % \begin{macrocode} \newcommand*{\warpOSwindows} { \booltrue{usingOSwindows} \renewcommand*{\OSPathSymbol}{\@backslashchar} } % \end{macrocode} % Test for windows during compile. The user may also specify % \cs{warpOSwindows} later in case this test fails. % \begin{macrocode} \ifwindows \warpOSwindows \fi % \end{macrocode} % \end{macro} % \begin{macrocode} \end{warpall} % \end{macrocode} % \section{Stacks} % \codehtml % \begin{macrocode} \begin{warpHTML} % \end{macrocode} % Stacks are used to remember how to close sections and list items. % Before a new section is started, previously nested sections and items must % be closed out (un-nested) in proper order. % Note that starting a new section may close several levels of previously % \watchout % nested items at the same time. % For example, starting a new |\section| would close any currently open % subsection, subsubsection, and paragraph. % General environments are not nested on the stack since they have their own close % mechanism. List environments are nested, and items inside those environments % are nested one level deeper still. % List environments may be nested inside other list environments, and list items % are nested inside list environments as well. Thus, the stack may have items % which are not necessarily in order, since a description may contain an enumerate, % for example. % Depths to be recorded in |\LWR@closedepthone|, etc. % \subsection{Assigning depths} % initial depths for empty stack entries: % \begin{macrocode} \newcommand*{\LWR@depthnone}{-5} % \end{macrocode} % all sectioning depths are deeper than |LWR@depthfinished|: % \begin{macrocode} \newcommand*{\LWR@depthfinished}{-4} \newcommand*{\LWR@depthpart}{-1} \newcommand*{\LWR@depthchapter}{0} \newcommand*{\LWR@depthsection}{1} \newcommand*{\LWR@depthsubsection}{2} \newcommand*{\LWR@depthsubsubsection}{3} \newcommand*{\LWR@depthparagraph}{4} \newcommand*{\LWR@depthsubparagraph}{5} % \end{macrocode} % used by |\itemize|, |\enumerate|, |\description|: % \begin{macrocode} \newcommand*{\LWR@depthlist}{6} % \end{macrocode} % used by |\item|: % \begin{macrocode} \newcommand*{\LWR@depthlistitem}{7} % \end{macrocode} % \subsection{Closing actions} % A stack to record the action to take to close each nesting level: % Add more levels of stack if necessary for a very deeply nested document, % adding to |\pushclose| and |\popclose| as well. % \begin{macrocode} \newcommand*{\LWR@closeone}{}% top of the stack \newcommand*{\LWR@closetwo}{} \newcommand*{\LWR@closethree}{} \newcommand*{\LWR@closefour}{} \newcommand*{\LWR@closefive}{} \newcommand*{\LWR@closesix}{} \newcommand*{\LWR@closeseven}{} \newcommand*{\LWR@closeeight}{} \newcommand*{\LWR@closenine}{} \newcommand*{\LWR@closeten}{} \newcommand*{\LWR@closeeleven}{} \newcommand*{\LWR@closetwelve}{} % \end{macrocode} % \subsection{Closing depths} % A stack to record the depth of each level: % % Note that nested LaTeX structures may push depths which are non-sequential. % \watchout % \begin{docsidebar}[Ex:] % \begin{Verbatim}[gobble=2,obeytabs,tabsize=4] % \begin{itemize} % \item{A} % \begin{description} % \item{B} % \end{description} % \end{itemize} % \end{Verbatim} % \end{docsidebar} % \begin{macrocode} \newcommand*{\LWR@closedepthone}{\LWR@depthnone}% top of the stack \newcommand*{\LWR@closedepthtwo}{\LWR@depthnone} \newcommand*{\LWR@closedepththree}{\LWR@depthnone} \newcommand*{\LWR@closedepthfour}{\LWR@depthnone} \newcommand*{\LWR@closedepthfive}{\LWR@depthnone} \newcommand*{\LWR@closedepthsix}{\LWR@depthnone} \newcommand*{\LWR@closedepthseven}{\LWR@depthnone} \newcommand*{\LWR@closedeptheight}{\LWR@depthnone} \newcommand*{\LWR@closedepthnine}{\LWR@depthnone} \newcommand*{\LWR@closedepthten}{\LWR@depthnone} \newcommand*{\LWR@closedeptheleven}{\LWR@depthnone} \newcommand*{\LWR@closedepthtwelve}{\LWR@depthnone} % \end{macrocode} % \subsection{Pushing and popping the stack} % \begin{macro}{\pushclose} \marg{action} \marg{depth} % Pushes one return action and its LaTeX depth onto the stacks. % \begin{macrocode} \NewDocumentCommand{\pushclose}{m m} { \let\LWR@closetwelve\LWR@closeeleven \let\LWR@closeeleven\LWR@closeten \let\LWR@closeten\LWR@closenine \let\LWR@closenine\LWR@closeeight \let\LWR@closeeight\LWR@closeseven \let\LWR@closeseven\LWR@closesix \let\LWR@closesix\LWR@closefive \let\LWR@closefive\LWR@closefour \let\LWR@closefour\LWR@closethree \let\LWR@closethree\LWR@closetwo \let\LWR@closetwo\LWR@closeone \let\LWR@closeone#1 \let\LWR@closedepthtwelve\LWR@closedeptheleven \let\LWR@closedepthelevel\LWR@closedepthten \let\LWR@closedepthten\LWR@closedepthnine \let\LWR@closedepthnine\LWR@closedeptheight \let\LWR@closedeptheight\LWR@closedepthseven \let\LWR@closedepthseven\LWR@closedepthsix \let\LWR@closedepthsix\LWR@closedepthfive \let\LWR@closedepthfive\LWR@closedepthfour \let\LWR@closedepthfour\LWR@closedepththree \let\LWR@closedepththree\LWR@closedepthtwo \let\LWR@closedepthtwo\LWR@closedepthone \let\LWR@closedepthone#2 } % \end{macrocode} % \end{macro} % \begin{macro}{\popclose} % Pops one action and its depth off the stacks. % \begin{macrocode} \newcommand*{\popclose} { \let\LWR@closeone\LWR@closetwo \let\LWR@closetwo\LWR@closethree \let\LWR@closethree\LWR@closefour \let\LWR@closefour\LWR@closefive \let\LWR@closefive\LWR@closesix \let\LWR@closesix\LWR@closeseven \let\LWR@closeseven\LWR@closeeight \let\LWR@closeeight\LWR@closenine \let\LWR@closenine\LWR@closeten \let\LWR@closeten\LWR@closeeleven \let\LWR@closeeleven\LWR@closetwelve \let\LWR@closedepthone\LWR@closedepthtwo \let\LWR@closedepthtwo\LWR@closedepththree \let\LWR@closedepththree\LWR@closedepthfour \let\LWR@closedepthfour\LWR@closedepthfive \let\LWR@closedepthfive\LWR@closedepthsix \let\LWR@closedepthsix\LWR@closedepthseven \let\LWR@closedepthseven\LWR@closedeptheight \let\LWR@closedeptheight\LWR@closedepthnine \let\LWR@closedepthnine\LWR@closedepthten \let\LWR@closedepthten\LWR@closedeptheleven \let\LWR@closedeptheleven\LWR@closedepthtwelve } % \end{macrocode} % \end{macro} % \begin{macrocode} \end{warpHTML} % \end{macrocode} % \section{Data arrays} % \label{sec:dataarray} % % These macros are similar to the \pkg{arrayjobx} package, except % that \cs{LWR@setexparray}'s argument is expanded only once when assigned. % % |name| has no backslash, |index| can be a number or a text name, % and an empty |value| must be |\relax| instead of empty. % % To assign an empty value: % \begin{sourcedisplay} % |\LWR@setexparray{name}{index}{\relax}| % \end{sourcedisplay} % % \changes{v0.20}{2017/01/07}{Added single-expansion data arrays.} % % % \codehtml % \begin{macrocode} \begin{warpHTML} % \end{macrocode} % % \begin{macro}{\LWR@setexparray} \marg{name} \marg{index} \marg{contents} % \begin{macrocode} \NewDocumentCommand{\LWR@setexparray}{m m m}{% \expandafter\edef\csname #1#2\endcsname{\expandonce#3}% } % \end{macrocode} % \end{macro} % % \begin{macro}{\LWR@getexparray} \marg{name} \marg{index} % \begin{macrocode} \newcommand*{\LWR@getexparray}[2]{\csuse{#1#2}} % \end{macrocode} % \end{macro} % \begin{macrocode} \end{warpHTML} % \end{macrocode} % \section{HTML entities} % \codehtml % \begin{macrocode} \begin{warpHTML} % \end{macrocode} % \HTML\ entites and \HTML\ Unicode entities: % \begin{macrocode} \let\LWR@origampersand\& % \end{macrocode} % \begin{macro}{\HTMLentity} \marg{entitytag} % \begin{macrocode} \newcommand*{\HTMLentity}[1]{\LWR@origampersand#1;} % \end{macrocode} % \end{macro} % \begin{macro}{\HTMLunicode} \marg{hex\_unicode} % \begin{macrocode} \newcommand*{\HTMLunicode}[1]{\HTMLentity{\#x#1}} % \end{macrocode} % \end{macro} % \DescribeMacro{\&} % \begin{macrocode} \renewcommand*{\&}{\HTMLentity{amp}} % \end{macrocode} % \begin{macro}{\textless} % \begin{macro}{\textgreater} % \begin{macrocode} \let\LWR@origtextless\textless \renewcommand*{\textless}{\HTMLentity{lt}} \let\LWR@origtextgreater\textgreater \renewcommand*{\textgreater}{\HTMLentity{gt}} % \end{macrocode} % \end{macro} % \end{macro} % \begin{macrocode} \end{warpHTML} % \end{macrocode} % \section{HTML filename generation} % % The filename of the homepage is set to |\HomeHTMLFileName.html|. % The filenames of additional sections start with |\HTMLfiveName|, to which is % appended a section number or a simplified section name, depending on |FileSectionNames|. % % \codeall % \begin{macrocode} \begin{warpall} % \end{macrocode} % \begin{macro}{\BaseJobname} % 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} \providecommand*{\BaseJobname}{\jobname} % \end{macrocode} % \end{macro} % \begin{macro}{\HTMLfiveName} % \changes{v0.19}{2016/05/28}{Docs: Escape filename underscores.} % \changes{v0.20}{2016/12/18}{No longer escape underscores.} % The prefix for all generated \HTML\ files other than the home page, % defaulting to empty. See \cref{sec:filenameexamples}. % % \begin{macrocode} \providecommand*{\HTMLfiveName}{} % \end{macrocode} % \end{macro} % % \begin{macro}{\HomeHTMLFileName} % \changes{v0.19}{2016/05/28}{Docs: Escape filename underscores.} % \changes{v0.20}{2016/12/18}{No longer escape underscores.} % The filename of the home page, defaulting to the \cs{BaseJobname}. % See \cref{sec:filenameexamples}. % % \begin{macrocode} \providecommand*{\HomeHTMLFileName}{\BaseJobname} % \end{macrocode} % \end{macro} % % \begin{macro}{\SetHTMLFileNumber} \marg{number} % % \changes{v0.20}{2016/09/11}{Add: Control file numbers.} % Sets the file number for the next % file to be generated. 0 is the home page. % Use just before the next sectioning command, and set it to one less than the % desired number of the next section. % May be used to generate numbered groups of nodes % such as 100+ for one chapter, 200+ for another chapter, etc. % \begin{macrocode} \newcommand*{\SetHTMLFileNumber}[1]{% \setcounter{LWR@htmlfilenumber}{#1}% } % \end{macrocode} % \end{macro} % \DescribeBoolean{FileSectionNames} % Selects how to create \HTML\ file names. % % Defaults to use section names in the filenames. % \begin{macrocode} \newbool{FileSectionNames} \booltrue{FileSectionNames} % \end{macrocode} % \begin{macrocode} \end{warpall} % \end{macrocode} % \codehtml % \begin{macrocode} \begin{warpHTML} % \end{macrocode} % \DescribeCounter{LWR@htmlfilenumber} % Records the number of each \HTML\ file as it is being created. % Number 0 is the home page. % \begin{macrocode} \newcounter{LWR@htmlfilenumber} \setcounter{LWR@htmlfilenumber}{0} % \end{macrocode} % \begin{macro}{\LWR@htmlsectionfilename} \marg{htmlfilenumber or name} % % \changes{v0.14}{2016/03/28}{Fix: Links to home page.} % \changes{v0.17}{2016/04/11}{Fix: Links when entire doc is one \HTML\ page.} % \changes{v0.20}{2016/09/11}{HTMLFileName: removed additional trailing '-', and may be empty.} % \changes{v0.20}{2016/09/11}{Sections called ``Index'' or ``index'' have an underscore % prepended to their filenames if no prefix.} % % Prints the filename for a given section: |\HTMLfiveName{}filenumber/name.html| % \begin{macrocode} \newcommand*{\LWR@htmlsectionfilename}[1]{% \LWR@traceinfo{LWR@htmlsectionfilename A}% % \end{macrocode} % Section 0 or empty is given the home filename. % The filename must be detokenized for underscores. % \begin{macrocode} \LWR@traceinfo{about to assign temp}% \edef\LWR@tempone{#1}% \LWR@traceinfo{about to compare with ??}% \ifthenelse{\equal{\LWR@tempone}{??}}% {% \LWR@traceinfo{found ??}% }{% \LWR@traceinfo{not found ??}% }% \LWR@traceinfo{about to compare with zero or empty}% \ifthenelse{% \equal{\LWR@tempone}{0}% \OR \equal{\LWR@tempone}{}% \OR \equal{\LWR@tempone}{??}% }% {% \LWR@traceinfo{LWR@htmlsectionfilename B \HomeHTMLFileName.html}% \HomeHTMLFileName.html% }% % \end{macrocode} % For a \LaTeX\ section named ``Index'' or ``index'' without a prefix, create a filename % with a leading underscore to avoid colliding with the \HTML\ filename |index.html|: % \begin{macrocode} {% \LWR@traceinfo{LWR@htmlsectionfilename C \LWR@tempone}% \ifthenelse{% \equal{\HTMLfiveName}{} \AND \equal{\LWR@tempone}{Index} \OR \equal{\LWR@tempone}{index}% }% {% \LWR@traceinfo{prefixing the index name with an underscore.}% \_#1.html}% % \end{macrocode} % Otherwise, create a filename with the chosen prefix: % \begin{macrocode} {\HTMLfiveName#1.html}% }% \LWR@traceinfo{LWR@htmlsectionfilename Z}% } % \end{macrocode} % \end{macro} % \begin{macro}{\LWR@htmlrefsectionfilename} \marg{label} % % Prints the filename for the given label % \begin{macrocode} \newcommand*{\LWR@htmlrefsectionfilename}[1]{% \LWR@traceinfo{LWR@htmlrefsectionfilename A: !#1!}% \LWR@htmlsectionfilename{\LWR@htmlfileref{#1}}% \LWR@traceinfo{LWR@htmlrefsectionfilename B}% } % \end{macrocode} % \end{macro} % \begin{macrocode} \end{warpHTML} % \end{macrocode} % \section{Homepage link} % \codehtml % \begin{macrocode} \begin{warpHTML} % \end{macrocode} % \begin{macro}{\LinkHome} % |\LinkHome| may be used wherever you wish to place a link back to the homepage. % The filename must be detokenized for underscores. % \begin{macrocode} \newcommand*{\LinkHome}{% \LWR@subhyperrefclass{% \HomeHTMLFileName.html}% {Home}{linkhome}% } % \end{macrocode} % \end{macro} % \begin{macro}{\LWR@topnavigation} % % Creates a link to the homepage at the top of the page for use when the window is too % narrow for the side\TOC. % \begin{macrocode} \newcommand*{\LWR@topnavigation}{ \LWR@htmlelementclassline{nav}{topnavigation}{\LinkHome} } % \end{macrocode} % \end{macro} % \begin{macro}{\LWR@botnavigation} % % Creates a link to the homepage at the bottom of the page for use when the window is too % narrow for the side\TOC. % \begin{macrocode} \newcommand*{\LWR@botnavigation}{ \LWR@htmlelementclassline{nav}{botnavigation}{\LinkHome} } % \end{macrocode} % \end{macro} % \begin{macrocode} \end{warpHTML} % \end{macrocode} % \section{\textbackslash{}PrintStack diagnostic tool} % Diagnostics tool: % Prints the LaTeX nesting depth values for the stack levels. % Must have |\LWR@startpars| active while printing the stack, so |\PrintStack| may % \watchout % be called from anywhere in the normal text flow. % \codehtml % \begin{macrocode} \begin{warpHTML} % \end{macrocode} % \begin{macro}{\PrintStack} Prints the closedepth stack. % \begin{macrocode} \newcommand*{\PrintStack}{ \LWR@startpars \LWR@closedepthone{} \LWR@closedepthtwo{} \LWR@closedepththree{} \LWR@closedepthfour{} \LWR@closedepthfive{} \LWR@closedepthsix{} \LWR@closedepthseven{} \LWR@closedeptheight{} \LWR@closedepthnine{} \LWR@closedepthten{} \LWR@closedeptheleven{} \LWR@closedepthtwelve{} } % \end{macrocode} % \end{macro} % \begin{macrocode} \end{warpHTML} % \end{macrocode} % \section{Closing stack levels} % \codehtml % \begin{macrocode} \begin{warpHTML} % \end{macrocode} % Close one nested level: % \begin{macrocode} \newcommand*{\LWR@closeoneprevious}{% \LWR@closeone{} \popclose{} } % \end{macrocode} % \begin{macro}{\LWR@closeprevious} \marg{depth} % Close everything up to the given depth: % \begin{macrocode} \newcommand*{\LWR@closeprevious}[1]{ % \end{macrocode} % Close any pending paragraph: % \begin{macrocode} \LWR@stoppars % \end{macrocode} % Close anything nested deeper than the desired depth: % \begin{macrocode} \whiledo{\not\(\LWR@closedepthone<#1\)}{\LWR@closeoneprevious} } % \end{macrocode} % \end{macro} % \begin{macrocode} \end{warpHTML} % \end{macrocode} % \section{Forcing a new PDF page} % \codehtml % \begin{macrocode} \begin{warpHTML} % \end{macrocode} % \begin{macro}{\LWR@forcenewpage} New \PDF\ page a before major environment. % % This is used just before major environments, such as \env{verse}. % Reduces the chance of an environment overflowing the \HTML\ \PDF\ output page. % % \changes{v0.28}{2017/04/13}{Forces new PDF page before major environments.} % \begin{macrocode} \newcommand{\LWR@forcenewpage}{% \LWR@stoppars\LWR@orignewpage\LWR@startpars% } % \end{macrocode} % \begin{macrocode} \end{warpHTML} % \end{macrocode} % \end{macro} % \section{HTML tags, spans, divs, elements} % \codehtml % \begin{macrocode} \begin{warpHTML} % \end{macrocode} % \subsection{Mapping \LaTeX{} Sections to HTML Sections} % \begin{macrocode} \newcommand*{\LWR@tagpart}{h2} \newcommand*{\LWR@tagpartend}{/h2} \newcommand*{\LWR@tagchapter}{h3} \newcommand*{\LWR@tagchapterend}{/h3} \newcommand*{\LWR@tagsection}{h4} \newcommand*{\LWR@tagsectionend}{/h4} \newcommand*{\LWR@tagsubsection}{h5} \newcommand*{\LWR@tagsubsectionend}{/h5} \newcommand*{\LWR@tagsubsubsection}{h6} \newcommand*{\LWR@tagsubsubsectionend}{/h6} \newcommand*{\LWR@tagparagraph}{span class="paragraph"{}} \newcommand*{\LWR@tagparagraphend}{/span} \newcommand*{\LWR@tagsubparagraph}{span class="subparagraph"{}} \newcommand*{\LWR@tagsubparagraphend}{/span} \newcommand*{\LWR@tagregularparagraph}{p} % \end{macrocode} % \subsection{HTML tags} % \begin{macro}{\LWR@htmltagc} \marg{tag} % Break ligatures and use upright apostrophes in \HTML\ tags. % %|\protect| is in case the tag appears in TOC, LOF, LOT. % \begin{macrocode} \newcommand*{\LWR@htmltagc}[1]{% {% \protect\LWR@origttfamily% \protect\LWR@origtextless#1\protect\LWR@origtextgreater% }% } % \end{macrocode} % \end{macro} % % \begin{environment}{LWR@nestspan} Disable \env{minipage}, \cs{parbox} inside a \tag{span}. % % |\begin{LWR@nestspan}| must follow the opening || tag to allow % \watchout % a paragraph to start if the span is at the beginning of a new paragraph. % % |\end{LWR@nestspan}| must follow the |/span| or an extra |

| may appear. % \watchout % % \changes{v0.20}{2016/12/24}{Fix: Minipages inside a span.} % % \begin{macrocode} \newenvironment*{LWR@nestspan} {% \addtocounter{LWR@spandepth}{1}% \RenewDocumentEnvironment{minipage}{O{t} o O{t} m}{}{}% }% {\addtocounter{LWR@spandepth}{-1}} % \end{macrocode} % \end{environment} % \begin{macro}{\LWR@htmlspan} \marg{tag} \marg{text} % % \cs{LWR@spandepth} is used to ensure that paragraph tags are not % generated inside a span. The exact sequence of when to add and subtract % \watchout % the counter is important to correctly handle the paragraph tags before % and after the span. % % \begin{macrocode} \NewDocumentCommand{\LWR@htmlspan}{m +m}{% \LWR@ensuredoingapar% \LWR@htmltagc{#1}% \begin{LWR@nestspan}% #2% \LWR@htmltagc{/#1}% \end{LWR@nestspan}% } % \end{macrocode} % \end{macro} % \begin{macro}{\LWR@htmlspanclass} \marg{class} \oarg{style} \marg{text} % \begin{macrocode} \NewDocumentCommand{\LWR@htmlspanclass}{m o +m}{% \LWR@ensuredoingapar% \LWR@subhtmlelementclass{span}{#1}[#2]% \begin{LWR@nestspan}% #3% \LWR@htmltagc{/span}% \end{LWR@nestspan}% } % \end{macrocode} % \end{macro} % \begin{macro}{\LWR@htmltag} \marg{tag} % Print an \HTML\ tag: \textless{}tag\textgreater{} % \begin{macrocode} \newcommand*{\LWR@htmltagb}[1]{% \LWR@htmltagc{#1}% \endgroup% } \newcommand*{\LWR@htmltag}{% \begingroup\catcode`\_=12 \LWR@htmltagb% } % \end{macrocode} % \end{macro} % \subsection{Block tags and comments} % In the following, |\origttfamily| breaks ligatures, which may not be used for \HTML\ codes: % % \begin{macro}{\LWR@htmlopencomment} % \begin{macro}{\LWR@htmlclosecomment} % \begin{macrocode} \newcommand*{\LWR@htmlopencomment}{% {\LWR@origttfamily\LWR@origtextless{}!{-}{-}}% } \newcommand*{\LWR@htmlclosecomment}{% {\LWR@origttfamily{-}{-}\LWR@origtextgreater{}}% } % \end{macrocode} % \end{macro} % \end{macro} % \begin{macro}{\LWR@htmlcomment} \marg{comment} % % \changes{v0.28}{2017/04/13}{Breaks ligatures in \HTML\ comments.} % % \begin{macrocode} \newcommand{\LWR@htmlcomment}[1]{% \LWR@htmlopencomment{}% {% \LWR@origttfamily% break ligatures #1% }% \LWR@htmlclosecomment{}} % \end{macrocode} % \end{macro} % \begin{macro}{\LWR@htmlblockcomment} \marg{comment} % \begin{macrocode} \newcommand{\LWR@htmlblockcommentb}[1] {\LWR@stoppars\LWR@htmlcomment{#1}\LWR@startpars\endgroup} \newcommand{\LWR@htmlblockcomment} {% \begingroup\catcode`\_=12% \LWR@htmlblockcommentb% } % \end{macrocode} % \end{macro} % \begin{macro}{\LWR@htmlblocktag} \marg{tag} print a stand-alone \HTML\ tag % \begin{macrocode} \newcommand*{\LWR@htmlblocktag}[1]{% \LWR@stoppars% \LWR@htmltag{#1}% \LWR@startpars% } % \end{macrocode} % \end{macro} % \subsection{Div class and element class} % \begin{macro}{\LWR@subhtmlelementclass} \marg{element} \marg{class} \oarg{style} % % Factored and reused in several places. % % \changes{v0.20}{2017/01/17}{Factored code.} % % \begin{macrocode} \NewDocumentCommand{\LWR@subhtmlelementclass}{m m o}{% \IfValueTF{#3}% {% option \ifthenelse{\equal{#3}{}}% {\LWR@htmltag{#1 class="#2"}}% empty option {\LWR@htmltag{#1 class="#2" style="#3"}}% non-empty option }% option {\LWR@htmltag{#1 class="#2"}}% no option } % \end{macrocode} % \end{macro} % \begin{macro}{\LWR@htmlelementclass} \marg{element} \marg{class} \oarg{style} % % \changes{v0.20}{2017/01/17}{Added optional style.} % % \begin{macrocode} \NewDocumentCommand{\LWR@htmlelementclass}{m m o}{% \LWR@stoppars% \LWR@subhtmlelementclass{#1}{#2}[#3]% \LWR@startpars% } % \end{macrocode} % \end{macro} % \begin{macro}{\LWR@htmlelementclassend} \marg{element} \marg{class} % \begin{macrocode} \newcommand*{\LWR@htmlelementclassend}[2]{% \LWR@stoppars% \LWR@htmltag{/#1}% \ifbool{HTMLDebugComments}{% \LWR@htmlcomment{End of #1 ``#2''}% }{}% \LWR@startpars% } % \end{macrocode} % \end{macro} % \begin{macro}{\LWR@htmldivclass} \marg{class} \oarg{style} % % \changes{v0.20}{2017/01/17}{Added optional style.} % % \begin{macrocode} \NewDocumentCommand{\LWR@htmldivclass}{m o}{% \LWR@htmlelementclass{div}{#1}[#2]% } % \end{macrocode} % \end{macro} % \begin{macro}{\LWR@htmldivclassend} \marg{class} % \begin{macrocode} \newcommand*{\LWR@htmldivclassend}[1]{% \LWR@htmlelementclassend{div}{#1}% } % \end{macrocode} % \end{macro} % \subsection{Single-line elements} % A single-line element, without a paragraph tag for the line of text: % \begin{macro}{\LWR@htmlelementclassline} % \marg{element} \marg{class} \oarg{style} \marg{text} % \begin{macrocode} \NewDocumentCommand{\LWR@htmlelementclassline}{m m o +m}{% \LWR@stoppars \LWR@subhtmlelementclass{#1}{#2}[#3]% #4% \LWR@htmltag{/#1} \LWR@startpars } % \end{macrocode} % \end{macro} % % % \subsection{HTML5 semantic elements} % \begin{macro}{\LWR@htmlelement} \marg{element} % \begin{macrocode} \newcommand*{\LWR@htmlelement}[1]{% \LWR@htmlblocktag{#1} } % \end{macrocode} % \end{macro} % \begin{macro}{\LWR@htmlelementend} \marg{element} % \begin{macrocode} \newcommand*{\LWR@htmlelementend}[1]{% \LWR@stoppars \LWR@htmltag{/#1} \LWR@startpars } \end{warpHTML} % \end{macrocode} % \end{macro} % \subsection{High-level block and inline classes} % \label{sec:highlevelclasses} % % These are high-level commands which allow the creation of % arbitrary block or inline % sections which may be formatted with \CSS. % For other direct-formatting commands, see \cref{sec:directformatting}. % \begin{environment}{BlockClass} \marg{class} \oarg{style} \quad % High-level interface for div classes. % % \qquad Ex: |\begin{BlockClass}{class}| text |\end{BlockClass}| % % \changes{v0.20}{2017/01/03}{Renamed from "blockclass".} % \changes{v0.20}{2017/01/17}{Added optional style.} % % \codehtml % \begin{macrocode} \begin{warpHTML} \NewDocumentEnvironment{BlockClass}{m o} { \LWR@htmldivclass{#1}[#2] } { \LWR@htmldivclassend{#1} } \end{warpHTML} % \end{macrocode} % % \codeprint % \begin{macrocode} \begin{warpprint} \NewDocumentEnvironment{BlockClass}{m o}{}{} \end{warpprint} % \end{macrocode} % \end{environment} % % % \begin{macro}{\BlockClassSingle} \marg{class} \marg{text} \quad % A single-line \tag{div}, without a paragraph tag for the line of text. % % \changes{v0.20}{2017/01/03}{Renamed from "LWR@htmldivclassline".} % % \codehtml % \begin{macrocode} \begin{warpHTML} \newcommand{\BlockClassSingle}[2]{% \LWR@htmlelementclassline{div}{#1}{#2}% } \end{warpHTML} % \end{macrocode} % % \codeprint % \begin{macrocode} \begin{warpprint} \newcommand{\BlockClassSingle}[2]{#2} \end{warpprint} % \end{macrocode} % % \end{macro} % \begin{macro}{\InlineClass} \marg{class} \oarg{style} \marg{text} \quad % High-level interface for inline span classes. % % \changes{v0.20}{2017/01/03}{Renamed from "inlineclass".} % % \codehtml % \begin{macrocode} \begin{warpHTML} \NewDocumentCommand{\InlineClass}{m o +m}{% \LWR@htmlspanclass{#1}[#2]{#3}% } \end{warpHTML} % \end{macrocode} % \codeprint % \begin{macrocode} \begin{warpprint} \NewDocumentCommand{\InlineClass}{m o +m}{#3} \end{warpprint} % \end{macrocode} % \end{macro} % \subsection{Closing HTML tags} % \codehtml % \begin{macrocode} \begin{warpHTML} % \end{macrocode} % Sections H1, H2, etc.\ do not need a closing \HTML\ tag, but we add a comment for readability: % \begin{macrocode} \newcommand*{\LWR@printclosepart} {\ifbool{HTMLDebugComments}{\LWR@htmlcomment{Closing part}}{}} \newcommand*{\LWR@printclosechapter} {\ifbool{HTMLDebugComments}{\LWR@htmlcomment{Closing chapter}}{}} \newcommand*{\LWR@printclosesection} {\ifbool{HTMLDebugComments}{\LWR@htmlcomment{Closing section}}{}} \newcommand*{\LWR@printclosesubsection} {\ifbool{HTMLDebugComments}{\LWR@htmlcomment{Closing subsection}}{}} \newcommand*{\LWR@printclosesubsubsection} {\ifbool{HTMLDebugComments}{\LWR@htmlcomment{Closing subsubsection}}{}} \newcommand*{\LWR@printcloseparagraph} {\ifbool{HTMLDebugComments}{\LWR@htmlcomment{Closing paragraph}}{}} \newcommand*{\LWR@printclosesubparagraph} {\ifbool{HTMLDebugComments}{\LWR@htmlcomment{Closing subparagraph}}{}} % \end{macrocode} % Lists require closing \HTML\ tags: % \begin{macrocode} \newcommand*{\LWR@printcloselistitem} {\LWR@htmltag{/li}} \newcommand*{\LWR@printclosedescitem} {\LWR@htmltag{/dd}} \newcommand*{\LWR@printcloseitemize} {\LWR@htmltag{/ul}} \newcommand*{\LWR@printcloseenumerate} {\LWR@htmltag{/ol}} \newcommand*{\LWR@printclosedescription} {\LWR@htmltag{/dl}} % \end{macrocode} % \begin{macrocode} \end{warpHTML} % \end{macrocode} % \section{Paragraph handling} % \label{sec:parhanding} % % These commands generate the \HTML\ paragraph tags when allowed and % required. % % Paragraph tags are or are not allowed depending on many conditions. % \Cref{sec:parstartstop} has high-level commands which allow % paragraph-tag generation to start/stop. % Even when allowed (\cs{LWR@doingstartpars}), % tags are not generated until a \LaTeX{} paragraph % is being used (\cs{LWR@doingapar}). % |LWR@lateximagedepth| is used to prevent nesting tags inside % a |lateximage|. % |LWR@spandepth| is used to prevent nesting paragraph tags inside % a paragraph, which became important inside \cs{fbox} commands and other spans. % \codehtml % \begin{macrocode} \begin{warpHTML} % \end{macrocode} % \DescribeCounter{LWR@spandepth} % Do not create paragraph tags inside of an \HTML\ span. % \begin{macrocode} \newcounter{LWR@spandepth} \setcounter{LWR@spandepth}{0} % \end{macrocode} % \DescribeBoolean{LWR@doingstartpars} % Tells whether paragraphs may be generated. % \begin{macrocode} \newbool{LWR@doingstartpars} \boolfalse{LWR@doingstartpars} % \end{macrocode} % \DescribeBoolean{LWR@doingapar} % Tells whether have actually generated and are currently processing paragraph text. % \begin{macrocode} \newbool{LWR@doingapar} \global\boolfalse{LWR@doingapar} % \end{macrocode} % \begin{macro}{\LWR@ensuredoingapar} % If are about to print something visible, and % if allowed to start a new paragraph, % ensure that are |LWR@doingapar|, so that paragraph tags are placed: % \begin{macrocode} \newcommand*{\LWR@ensuredoingapar}{% \ifbool{LWR@doingstartpars}% {\global\booltrue{LWR@doingapar}}% {}% } % \end{macrocode} % \end{macro} % \begin{macro}{\LWR@openparagraph} % \begin{macrocode} \newcommand*{\LWR@openparagraph} {% % \end{macrocode} % See if paragraph handling is enabled: % \begin{macrocode} \ifbool{LWR@doingstartpars}% {% handling pars % \end{macrocode} % See if have already started a \env{lateximage} or a \tag{span}. % If so, do not generate nested paragraph tags. % \begin{macrocode} \ifthenelse{% \cnttest{\value{LWR@lateximagedepth}}{>}{0} \OR% \cnttest{\value{LWR@spandepth}}{>}{0}% }% nested par tags? % \end{macrocode} % If so: Do nothing if already started a \env{lateximage} page. Cannot nest a \env{lateximage}. % Also do nothing if already inside a \tag{span}. Do not nest paragraph tags % inside a \tag{span}. % \begin{macrocode} {}% no nested par tags % \end{macrocode} % Else: No \env{lateximage} or \tag{span} has been started yet, % so it's OK to generate paragraph tags. % \begin{macrocode} {% yes nest par tags \LWR@htmltagc{\LWR@tagregularparagraph}% % \end{macrocode} % Manually indent item list labels to avoid left margin intrustion: % % \LaTeX{} default list environments use |\@itemdepth| and |\@enumdepth|, but % \pkg{lwarp} uses the \pkg{enumitem} package, which uses |\@listdepth|. % % See if are nested inside an item list: % \begin{macrocode} \ifnumcomp{\@listdepth}{>}{0}% {% % \end{macrocode} % If so, leave some horizontal room in the \LaTeX{} \PDF\ output for list labels: % \begin{macrocode} \LWR@orighspace{1in}% }{}% % \end{macrocode} % Now have started a paragraph. % \begin{macrocode} \global\booltrue{LWR@doingapar}% % \end{macrocode} % At the endof each paragraph, % generate closing tag and do regular |/par| stuff. % (Attempting to use the \pkg{everyhook} |cr| hook % for \cs{LWR@closeparagraph} does not work well.) % \begin{macrocode} \let\par\LWR@closeparagraph% }% end of yes nest par tags }% end of handling pars {}% not handling pars } % \end{macrocode} % \end{macro} % \begin{macro}{\LWR@closeparagraph} % \changes{v0.20}{2017/01/17}{No break tags in the start/end of a tabular.} % \changes{v0.20}{2017/01/17}{\cs{unskip} extra spaces.} % \begin{macrocode} \newcommand*{\LWR@closeparagraph} {% % \end{macrocode} % See if paragraph handling is enabled: % \begin{macrocode} \ifbool{LWR@doingapar}% % \end{macrocode} % If currently in paragraph mode: % \begin{macrocode} {% handling pars % \end{macrocode} % See if already started a \env{lateximage} or a \tag{span}: % \begin{macrocode} \ifthenelse{% \cnttest{\value{LWR@lateximagedepth}}{>}{0} \OR% \cnttest{\value{LWR@spandepth}}{>}{0}% }% % \end{macrocode} % Do nothing if already started a \env{lateximage} or a \tag{span}, % but add a parbreak if in a span but not a \env{lateximage}. % \begin{macrocode} {% no nested par tags \ifthenelse{% \cnttest{\value{LWR@spandepth}}{>}{0}% \AND% \cnttest{\value{LWR@lateximagedepth}}{=}{0}% }% {% \ifbool{LWR@intabularmetadata}{}{\unskip\LWR@htmltagc{br /}}% }% {}% }% no nested par tags % \end{macrocode} % If have not already started a \env{lateximage} or a \tag{span}: % \begin{macrocode} {% yes nest par tags % \end{macrocode} % Print a closing tag: % \begin{macrocode} \unskip% \LWR@htmltagc{/\LWR@tagregularparagraph}% % \end{macrocode} % No longer doing a paragraph: % \begin{macrocode} \global\boolfalse{LWR@doingapar}% % Disable the special \env{minipage} \& \cs{hspace} interaction % until a new minipage is found: % \begin{macrocode} \global\boolfalse{LWR@minipagethispar}% }% end of yes nest par tags }% end of handling pars % \end{macrocode} % Add a parbreak if in a span, % but not in a table outside a row: % \begin{macrocode} {% not handling pars \ifthenelse{\cnttest{\value{LWR@spandepth}}{>}{0}}% {\ifbool{LWR@intabularmetadata}{}{\unskip\LWR@htmltagc{br /}}}% {}% }% not handling pars % \end{macrocode} % Finish with regular paragraph processing % \begin{macrocode} \LWR@origpar% } % \end{macrocode} % \end{macro} % \begin{macrocode} \end{warpHTML} % \end{macrocode} % \section{Paragraph start/stop handling} % \label{sec:parstartstop} % These commands allow/disallow the generation of \HTML\ % paragraph tags. % % \Cref{sec:parhanding} has the commands which actually generate % the tags. % % The |everyhook| package is used to generate the opening % paragraph tags. The closing tags are generated by |\par|. % \codehtml % \begin{macrocode} \begin{warpHTML} % \end{macrocode} % \begin{macro}{\LWR@startpars} % Begin handling \HTML\ paragraphs. % This allows an \HTML\ paragraph to start, but one has not yet begun. % \begin{macrocode} \newcommand*{\LWR@startpars}% {% % \end{macrocode} % See if currently handling \HTML\ paragraphs: % \begin{macrocode} \ifbool{LWR@doingstartpars}% % \end{macrocode} % If already in paragraph mode, do nothing. % \begin{macrocode} {}% % \end{macrocode} % If not currently in paragraph mode: % \begin{macrocode} {% % \end{macrocode} % At the start of each paragraph, generate an opening tag: % \begin{macrocode} \PushPreHook{par}{\LWR@openparagraph}% % \end{macrocode} % At the end of each paragraph, generate closing tag and do regular |/par| actions: % \begin{macrocode} \let\par\LWR@closeparagraph }% an intentionally blank line % \end{macrocode} % Are now handling paragraphs, but have not yet actually started one: % \begin{macrocode} \global\setbool{LWR@doingstartpars}{true}% % \end{macrocode} % No tag yet to undo: % \begin{macrocode} \global\boolfalse{LWR@doingapar}% } % \end{macrocode} % \end{macro} % \begin{macro}{\LWR@stoppars} % Stop handling \HTML\ paragraphs. % Any currently open \HTML\ paragraph is closed, and no more will be opened. % \begin{macrocode} \newcommand*{\LWR@stoppars}% {% % \end{macrocode} % See if currently handling \HTML\ paragraphs: % \begin{macrocode} \ifbool{LWR@doingapar}% % \end{macrocode} % if currently in an \HTML\ paragraph: % \begin{macrocode} {% % \end{macrocode} % Print a closing tag: % \begin{macrocode} \unskip% \LWR@htmltagc{/\LWR@tagregularparagraph}% % \end{macrocode} % No longer have an open \HTML\ paragraph: % \begin{macrocode} \global\boolfalse{LWR@doingapar}% % \end{macrocode} % Disable the special \env{minipage} \& \cs{hspace} interaction % until a new minipage is found: % \begin{macrocode} \global\boolfalse{LWR@minipagethispar} }% an intentionally blank line % \end{macrocode} % If was not in an \HTML\ paragraph: % \begin{macrocode} {}% % \end{macrocode} % See if currently allowing \HTML\ paragraphs: % \begin{macrocode} \ifbool{LWR@doingstartpars}% % \end{macrocode} % If so: clear the |par| hook to no longer catch paragraphs: % \begin{macrocode} {% \ClearPreHook{par}% }% % \end{macrocode} % Else: do nothing % \begin{macrocode} {}% % \end{macrocode} % no longer in paragraph mode % \begin{macrocode} \global\setbool{LWR@doingstartpars}{false}% % \end{macrocode} % no |

| tag to undo: % \begin{macrocode} \global\boolfalse{LWR@doingapar}% } % \end{macrocode} % \end{macro} % \begin{macrocode} \end{warpHTML} % \end{macrocode} % \section{Page headers and footers} % \codeall % \begin{macrocode} \begin{warpall} % \end{macrocode} % In the following, catcode is manually changes back and forth % without groups, since new macros are being defined which must % not be contained within the groups. % \begin{macrocode} \newcommand{\LWR@firstpagetop}{} % for the home page alone \newcommand{\LWR@pagetop}{} % for all other pages \newcommand{\LWR@pagebottom}{} \newcommand{\LWR@setfirstpagetopb}[1]{% \renewcommand{\LWR@firstpagetop}{#1} \catcode`\_=8 } % \end{macrocode} % \begin{macro}{\SetFirstPageTop} \marg{text and logos} % \begin{macrocode} \newcommand{\SetFirstPageTop}{% \catcode`\_=12 \LWR@setfirstpagetopb } % \end{macrocode} % \end{macro} % \begin{macrocode} \newcommand{\LWR@setpagetopb}[1]{% \renewcommand{\LWR@pagetop}{#1} \catcode`\_=8 } % \end{macrocode} % \begin{macro}{\SetPageTop} \marg{text and logos} % \begin{macrocode} \newcommand{\SetPageTop}{% \catcode`\_=12 \LWR@setpagetopb } % \end{macrocode} % \end{macro} % \begin{macrocode} \newcommand{\LWR@setpagebottomb}[1]{% \renewcommand{\LWR@pagebottom}{#1} \catcode`\_=8 } % \end{macrocode} % \begin{macro}{\SetPageBottom} \marg{text and logos} % \begin{macrocode} \newcommand{\SetPageBottom}{% \catcode`\_=12 \LWR@setpagebottomb } % \end{macrocode} % \end{macro} % \begin{macrocode} \end{warpall} % \end{macrocode} % \section{CSS} % \codehtml % \begin{macrocode} \begin{warpHTML} % \end{macrocode} % \begin{macro}{\LWR@currentcss} The \CSS\ filename to use. % This may be changed mid-document using \cs{NewCSS}, % allowing different \CSS\ files to be used % for different sections of the document. % \begin{macrocode} \newcommand*{\LWR@currentcss}{lwarp.css} % \end{macrocode} % \end{macro} % \begin{macro}{\NewCSS} \marg{new-css-filename.css} % % Assigns the \CSS\ file to be used by the following \HTML\ pages. % \begin{macrocode} \newcommand*{\LWR@newcssb}[1]{% \renewcommand*{\LWR@currentcss}{#1} \catcode`\_=8 } \newcommand*{\NewCSS}{ \catcode`\_=12 \LWR@newcssb } \end{warpHTML} % \end{macrocode} % % \codeprint % \begin{macrocode} \begin{warpprint} \newcommand*{\NewCSS}[1]{} \end{warpprint} % \end{macrocode} % \end{macro} % \section{HTML meta description and author} % % \changes{v0.20}{2016/06/27}{Added \cs{NewHTMLdescription}.} % \changes{v0.28}{2017/04/06}{Added \cs{HTMLauthor}.} % \codeall % \begin{macrocode} \begin{warpall} % \end{macrocode} % \begin{macro}{\HTMLauthor} \marg{authorname} \qquad The author to place into an \HTML\ meta tag. % % \index{HTML>meta tag>author} % \index{author>HTML meta tag} % \index{meta tag, HTML>author} % % \begin{macrocode} \newcommand{\theHTMLauthor}{\theauthor} \newcommand{\HTMLauthor}[1]{\renewcommand{\theHTMLauthor}{#1}} % \end{macrocode} % \end{macro} % \begin{macrocode} \end{warpall} % \end{macrocode} % \codeall % \begin{macrocode} \begin{warpall} % \end{macrocode} % This is placed inside an \HTML\ meta tag at the start of each file. % This may be changed mid-document using \cs{NewHTMLdescription}, % allowing different \HTML\ descriptions to be used % for different sections of the document. % % Do not use double quotes, and do not exceed 150 characters.\watchout % \begin{macro}{\NewHTMLdescription} \marg{New \HTML\ meta description.} \qquad % Assigns the \HTML\ file's description meta tag. % % \index{HTML>meta tag>description} % \index{description>HTML meta tag} % \index{meta tag, HTML>description} % % \begin{macrocode} \newcommand{\LWR@currentHTMLdescription}{} \newcommand{\NewHTMLdescription}[1]{% \renewcommand{\LWR@currentHTMLdescription}{#1} } \end{warpall} % \end{macrocode} % \end{macro} % \section{Footnotes} % \label{sec:footnotes} % % \index{footnotes} % % \limitsfootnotes % % \changes{v0.26}{2017/03/28}{Footnotes now are \LaTeX\ boxes instead of pagenotes.} % % Several kinds of footnotes are used: in a regular page, in a minipage, or % as thanks in the titlepage. Each of these is handle differently. % % \subsection{Regular page footnotes} % In \HTML\ documents, footnotes are placed at the % bottom of the web page using the \LaTeX\ box \cs{LWR@footnotes}. % Using this instead of the original \cs{footins} box % avoids having footnotes be printed by the output routine, % since footnotes should be printed per \HTML\ page % instead of per \PDF\ page. % % See \cref{sec:footnotesregular} for the implementation. % % \subsection{Minipage footnotes} % See \cref{sec:footnotesminipage} for minipage footnotes. % % \subsection{Titlepage thanks} % See \cref{sec:titlehtml} for titlepage footnotes. % % \subsection{Regular page footnote implementation} % \label{sec:footnotesregular} % % \codehtml % \begin{macrocode} \begin{warpHTML} % \end{macrocode} % Patch \LaTeX\ footnotes to use a new \cs{box} for \pkg{lwarp} footnotes. % \begin{macrocode} \newbox\LWR@footnotes % \end{macrocode} % % Much of the following has unneeded print-mode formatting removed. % \begin{macrocode} \long\def\@makefntext#1{\textsuperscript{\@thefnmark} #1} \def\@makefnmark{\hbox{\textsuperscript{\@thefnmark}}} % \end{macrocode} % % Footnotes may be in regular text, in which case paragraphs are tagged, % or in a table data cell, in which case paragraph tags must be added manually. % % \changes{v0.27}{2017/04/04}{Fix for table footnote par tags.} % % \begin{macrocode} \long\def\@footnotetext#1{% \global\setbox\LWR@footnotes=\vbox{\unvbox\LWR@footnotes% \protected@edef\@currentlabel{% \csname p@footnote\endcsname\@thefnmark% }% @currentlabel \color@begingroup% \ifbool{LWR@doingstartpars}{}{\LWR@htmltagc{\LWR@tagregularparagraph}}% \@makefntext{#1}% \ifbool{LWR@doingstartpars}{\par}{\LWR@htmltagc{/\LWR@tagregularparagraph}}% \color@endgroup% }% vbox }% \long\def\@mpfootnotetext#1{% \global\setbox\@mpfootins\vbox{% \unvbox\@mpfootins \reset@font\footnotesize \hsize\columnwidth \@parboxrestore \protected@edef\@currentlabel {\csname p@mpfootnote\endcsname\@thefnmark}% \color@begingroup \@makefntext{% \ignorespaces#1% }% % \end{macrocode} % % Don't add the closing paragraph tag if are inside a \env{lateximage}: % \begin{macrocode} \ifthenelse{\cnttest{\value{LWR@lateximagedepth}}{>}{0}}% {}% {\LWR@htmltagc{/\LWR@tagregularparagraph}}% % \end{macrocode} % % \begin{macrocode} \color@endgroup}% } % \end{macrocode} % % Enclose the footnotes in a class, print, then clear: % \begin{macrocode} \newcommand*{\LWR@printpendingfootnotes}{% \ifvoid\LWR@footnotes\else \LWR@forcenewpage \begin{BlockClass}{footnotes} \LWR@origmedskip \unvbox\LWR@footnotes \setbox\LWR@footnotes=\vbox{} \end{BlockClass} \fi } % \end{macrocode} % % Used to print footnotes before sections only if formatting for an \EPUB\ or word processor: % \begin{macrocode} \newcommand*{\LWR@epubprintpendingfootnotes}{% \ifthenelse{\boolean{FormatEPUB}\OR\boolean{FormatWordProcessor}}% {\LWR@printpendingfootnotes}% {}% } % \end{macrocode} % \begin{macrocode} \end{warpHTML} % \end{macrocode} % \section{Marginpars} % % \codehtml % \begin{macrocode} \begin{warpHTML} % \end{macrocode} % \begin{macro}{\marginpar} \oarg{left} \marg{right} % % \changes{v0.21}{2017/02/11}{Fixed source listing.} % % \begin{macrocode} \renewcommand{\marginpar}[2][]{% \LWR@htmlspanclass{marginpar}{#2}% } % \end{macrocode} % \end{macro} % % \begin{macrocode} \end{warpHTML} % \end{macrocode} % \section{Splitting HTML files} % % \begin{itemize} % \item Files are split according to |FileDepth| and |CombineHigherDepths|. % \item Filenames are sanitized by |\LWR@filenamenoblanks|. % \item |\LWR@newhtmlfile| finishes an \HTML\ page, % adds a comment to tell where and how to split the file, % then starts a new \HTML\ page. % \end{itemize} % \codeall % \begin{macrocode} \begin{warpall} % \end{macrocode} % \DescribeCounter{FileDepth} \marg{section depth} determines how deeply % to break into new \HTML\ files, similar to |tocdepth|. % The default of -5 produces one large \HTML\ file. % \begin{macrocode} \newcounter{FileDepth} \setcounter{FileDepth}{-5} % \end{macrocode} % \DescribeBoolean{CombineHigherDepths} Combile higher-level sections % together into one file? % \begin{macrocode} \newbool{CombineHigherDepths} \booltrue{CombineHigherDepths} % \end{macrocode} % \begin{macrocode} \end{warpall} % \end{macrocode} % \codehtml % \begin{macrocode} \begin{warpHTML} % \end{macrocode} % \begin{macro}{\LWR@thisfilename} % The currently-active filename or number. % \begin{macrocode} \newcommand*{\LWR@thisfilename}{} % \end{macrocode} % \end{macro} % \begin{macro}{\LWR@thisnewfilename} % The filename being sanitized. % \begin{macrocode} \newcommand*{\LWR@thisnewfilename}{} % \end{macrocode} % \end{macro} % \begin{macro}{\LWR@filenamenoblanks} \marg{filename} % % Convert blanks into dashes, removes short words, % store result in \\ |\LWR@thisfilename|. % % Be sure that this does not result in filename collisions! % \watchout % Use the optional TOC caption entry parameter for formatting. % Remember to |\protect| \LaTeX{} commands which appear in % section names and TOC captions. % \begin{macrocode} \newcommand*{\LWR@filenamenoblanks}[1]{% \begingroup % \end{macrocode} % Locally temporarily disable direct-formatting commands, % not used in filenames: % \begin{macrocode} \renewcommand*{\HTMLunicode}[1]{} \renewcommand*{\HTMLentity}[1]{##1} \renewcommand*{\LWR@htmltagc}[1]{} \DeclareExpandableDocumentCommand{\InlineClass}{m o m}{##3} % \end{macrocode} % Ampersand becomes ``and'', which is a short word and is then removed from the filename. % \begin{macrocode} \renewcommand*{\&}{and} \renewcommand{\textit}[1]{##1} \renewcommand{\textsc}[1]{##1} \renewcommand{\textsl}[1]{##1} \renewcommand{\textbf}[1]{##1} \renewcommand{\texttt}[1]{##1} \renewcommand{\textsf}[1]{##1} \renewcommand{\textrm}[1]{##1} \renewcommand{\textsuperscript}[1]{##1} \renewcommand{\textsubscript}[1]{##1} % \end{macrocode} % Replaces common symbols and short words with hyphens: % % \begin{macrocode} \edef\LWR@thisnewfilename{#1} \fullexpandarg % \end{macrocode} % Convert spaces into hyphens: % \begin{macrocode} \StrSubstitute{\LWR@thisnewfilename}{ }{-}[\LWR@thisnewfilename] % \end{macrocode} % Convert punctutation into hyphens: % ^^A \StrSubstitute{\LWR@thisnewfilename}{é}{e}[\LWR@thisnewfilename] % \begin{macrocode} \StrSubstitute{\LWR@thisnewfilename}{,}{-}[\LWR@thisnewfilename] \StrSubstitute{\LWR@thisnewfilename}{'}{-}[\LWR@thisnewfilename] \StrSubstitute{\LWR@thisnewfilename}% {\LWR@origampersand}{-}[\LWR@thisnewfilename] \StrSubstitute{\LWR@thisnewfilename}{+}{-}[\LWR@thisnewfilename] \StrSubstitute{\LWR@thisnewfilename}{,}{-}[\LWR@thisnewfilename] \StrSubstitute{\LWR@thisnewfilename}{/}{-}[\LWR@thisnewfilename] \StrSubstitute{\LWR@thisnewfilename}{:}{-}[\LWR@thisnewfilename] \StrSubstitute{\LWR@thisnewfilename}{;}{-}[\LWR@thisnewfilename] \StrSubstitute{\LWR@thisnewfilename}{=}{-}[\LWR@thisnewfilename] \StrSubstitute{\LWR@thisnewfilename}{?}{-}[\LWR@thisnewfilename] \StrSubstitute{\LWR@thisnewfilename}{@}{-}[\LWR@thisnewfilename] \StrSubstitute{\LWR@thisnewfilename}{"}{-}[\LWR@thisnewfilename] \StrSubstitute{\LWR@thisnewfilename}% {\textless}{-}[\LWR@thisnewfilename] \StrSubstitute{\LWR@thisnewfilename}% {\textgreater}{-}[\LWR@thisnewfilename] \StrSubstitute{\LWR@thisnewfilename}{\#}{-}[\LWR@thisnewfilename] \StrSubstitute{\LWR@thisnewfilename}{\%}{-}[\LWR@thisnewfilename] \StrSubstitute{\LWR@thisnewfilename}{\{}{-}[\LWR@thisnewfilename] \StrSubstitute{\LWR@thisnewfilename}{\}}{-}[\LWR@thisnewfilename] \StrSubstitute{\LWR@thisnewfilename}{|}{-}[\LWR@thisnewfilename] \StrSubstitute{\LWR@thisnewfilename}% {\textbackslash}{-}[\LWR@thisnewfilename] \StrSubstitute{\LWR@thisnewfilename}{^}{-}[\LWR@thisnewfilename] \StrSubstitute{\LWR@thisnewfilename}{~{}}{-}[\LWR@thisnewfilename] % "~{}" for babel \StrSubstitute{\LWR@thisnewfilename}{[}{-}[\LWR@thisnewfilename] \StrSubstitute{\LWR@thisnewfilename}{]}{-}[\LWR@thisnewfilename] \StrSubstitute{\LWR@thisnewfilename}{`}{-}[\LWR@thisnewfilename] % \end{macrocode} % Convert short words: % \begin{macrocode} \StrSubstitute{\LWR@thisnewfilename}{-s-}{-}[\LWR@thisnewfilename] \StrSubstitute{\LWR@thisnewfilename}{-S-}{-}[\LWR@thisnewfilename] \StrSubstitute{\LWR@thisnewfilename}{-a-}{-}[\LWR@thisnewfilename] \StrSubstitute{\LWR@thisnewfilename}{-A-}{-}[\LWR@thisnewfilename] \StrSubstitute{\LWR@thisnewfilename}{-an-}{-}[\LWR@thisnewfilename] \StrSubstitute{\LWR@thisnewfilename}{-AN-}{-}[\LWR@thisnewfilename] \StrSubstitute{\LWR@thisnewfilename}{-to-}{-}[\LWR@thisnewfilename] \StrSubstitute{\LWR@thisnewfilename}{-TO-}{-}[\LWR@thisnewfilename] \StrSubstitute{\LWR@thisnewfilename}{-by-}{-}[\LWR@thisnewfilename] \StrSubstitute{\LWR@thisnewfilename}{-BY-}{-}[\LWR@thisnewfilename] \StrSubstitute{\LWR@thisnewfilename}{-of-}{-}[\LWR@thisnewfilename] \StrSubstitute{\LWR@thisnewfilename}{-OF-}{-}[\LWR@thisnewfilename] \StrSubstitute{\LWR@thisnewfilename}{-and-}{-}[\LWR@thisnewfilename] \StrSubstitute{\LWR@thisnewfilename}{-AND-}{-}[\LWR@thisnewfilename] \StrSubstitute{\LWR@thisnewfilename}{-for-}{-}[\LWR@thisnewfilename] \StrSubstitute{\LWR@thisnewfilename}{-FOR-}{-}[\LWR@thisnewfilename] \StrSubstitute{\LWR@thisnewfilename}{-the-}{-}[\LWR@thisnewfilename] \StrSubstitute{\LWR@thisnewfilename}{-THE-}{-}[\LWR@thisnewfilename] % \end{macrocode} % Convert multiple hyphens: % \begin{macrocode} \StrSubstitute{\LWR@thisnewfilename}{-----}{-}[\LWR@thisnewfilename] \StrSubstitute{\LWR@thisnewfilename}{----}{-}[\LWR@thisnewfilename] \StrSubstitute{\LWR@thisnewfilename}{---}{-}[\LWR@thisnewfilename] \StrSubstitute{\LWR@thisnewfilename}{--}{-}[\LWR@thisnewfilename] \StrSubstitute{\LWR@thisnewfilename}{—}{-}[\LWR@thisnewfilename] % emdash \StrSubstitute{\LWR@thisnewfilename}{–}{-}[\LWR@thisnewfilename] % endash \global\let\LWR@thisfilename\LWR@thisnewfilename% return a global result \endgroup } % \end{macrocode} % \end{macro} % \begin{macro}{\LWR@newhtmlfile} \marg{section name} % \changes{v0.18}{2016/04/23}{side\TOC\ after title, improving responsive design.} % \changes{v0.21}{2017/02/22}{Skip title if not given.} % \changes{v0.28}{2017/04/06}{If \texttt{FormatEPUB} or \texttt{FormatWordProcessor}: skips headers, footers, nav.} % % Finishes the current \HTML\ page with footnotes, footer, navigation, % then starts a new \HTML\ page with an \HTML\ comment telling where to % split the page and what the new filename and \CSS\ are, then adds % navigation, side TOC, header, and starts the text body. % \begin{macrocode} \newcommand*{\LWR@newhtmlfile}[1]{ % \end{macrocode} % At the bottom of the ending file: % \begin{macrocode} \LWR@htmlelementclassend{section}{textbody} \LWR@printpendingfootnotes % \end{macrocode} % % No footer between files if \EPUB: % % \begin{macrocode} \ifbool{FormatEPUB} {} { \LWR@htmlelement{footer} \LWR@pagebottom \LWR@htmlelementend{footer} } % \end{macrocode} % % No bottom navigation if are finishing the home page or % formatting for \EPUB\ or a word-processor. % \begin{macrocode} \ifthenelse{\boolean{FormatEPUB}\OR\boolean{FormatWordProcessor}} {} {\ifnumcomp{\value{LWR@htmlfilenumber}}{>}{0}{\LWR@botnavigation}{}} % \end{macrocode} % End of this \HTML\ file: % \begin{macrocode} \LWR@stoppars \LWR@htmltag{/body}\LWR@orignewline \LWR@htmltag{/html}\LWR@orignewline \LWR@orignewpage \addtocounter{LWR@htmlfilenumber}{1}% % \end{macrocode} % If using a filename, create a version without blanks. % The filename without blanks will be placed into \cs{LWR@thisfilename}. % If not using a filename, the file number will be used instead. % \changes{v0.12}{2016/03/13}{Bugfix: TOC with numbered files.} % \begin{macrocode} \ifbool{FileSectionNames}% {\LWR@filenamenoblanks{#1}} {\renewcommand*{\LWR@thisfilename}{\theLWR@htmlfilenumber}} % \end{macrocode} % Include an \HTML\ comment to instruct lwarpmk % where to split the files apart. % Uses pipe-separated fields for |split_html.gawk|. % Uses monospaced font with ligatures disabled for everything except the title. % \begin{macrocode} \LWR@htmlblockcomment{% |Start file|% \LWR@htmlsectionfilename{\LWR@thisfilename}|% } % \end{macrocode} % At the top of the starting file: % \begin{macrocode} \LWR@stoppars % \end{macrocode} % % % \begin{macrocode} \LWR@filestart{ — #1}% there is an EMdash in front of the #1 % \end{macrocode} % % No navigation between files if formatting for an \EPUB\ or word processor: % \begin{macrocode} \ifthenelse{\boolean{FormatEPUB}\OR\boolean{FormatWordProcessor}} {} {\LWR@topnavigation} % \end{macrocode} % % No header if between files if formatting for an \EPUB\ or word processor: % \begin{macrocode} \ifthenelse{\boolean{FormatEPUB}\OR\boolean{FormatWordProcessor}} {} { \LWR@htmlelement{header} \LWR@pagetop \LWR@htmlelementend{header} } % \end{macrocode} % % Print title only if there is one. % Skip if formatting for an \EPUB\ or word processor: % \begin{macrocode} \ifthenelse{\boolean{FormatEPUB}\OR\boolean{FormatWordProcessor}} {} {\ifcsvoid{thetitle}{}{\LWR@printthetitle}} % \end{macrocode} % % No side\TOC\ if formatting for an \EPUB\ or word processor: % \begin{macrocode} \ifthenelse{\boolean{FormatEPUB}\OR\boolean{FormatWordProcessor}} {} {\LWR@sidetoc} % \end{macrocode} % % Start of the \tag{textbody}: % \begin{macrocode} \LWR@htmlelementclass{section}{textbody} % \end{macrocode} % % Keep paragraph tags disabled for now: % \begin{macrocode} \LWR@stoppars % \end{macrocode} % % Track the page numbers: % \begin{macrocode} \setcounter{LWR@latestautopage}{\value{page}} } % \end{macrocode} % \end{macro} % \begin{macrocode} \end{warpHTML} % \end{macrocode} % \section{Sectioning} % % Sectioning and cross-references have been emulated from scratch, rather % than try to patch several layers of existing \LaTeX{} code and packages. % Formatting is handled by \CSS, so the emulated code has much less % work to do than the print versions. % % Section names and the resulting filenames with accented characters % \margintag{Unicode} % are partially supported, depending on the ability of % |pdflatex| to generate characters and |pdftotext| to read them. % If extra symbols appear in the text, % \watchout % it may be that |pdflatex| is actually producing a symbol over or under a % character, resulting in |pdftotext| picking up the accent symbol separately. % % \XeLaTeX{} and \LuaLaTeX{} directly support accented section and file names. % \index{accents}\index{Unicode>file \& section names}\index{UTF-8>file \& section names} % \index{XeLaTeX>file \& section names} % \index{LuaLaTeX>file \& section names} % % % \codehtml % \begin{macrocode} \begin{warpHTML} % \end{macrocode} % % % \subsection{Book class commands} % % % \begin{macro}{\mainmatter} % % Declare the main matter section of the document. Does not reset the page number, % \watchout % which must be consecutive arabic numbers for the \HTML\ conversion. % \begin{macrocode} \newbool{LWR@mainmatter} \DeclareDocumentCommand{\mainmatter}{}{% \booltrue{LWR@mainmatter}% } % \end{macrocode} % \end{macro} % \begin{macro}{\frontmatter} % % Declare the front matter section of the document, % using arabic numbering for the internal numbering. Does not reset the page number. % \begin{macrocode} \DeclareDocumentCommand{\frontmatter}{}{% \boolfalse{LWR@mainmatter}% } % \end{macrocode} % \end{macro} % \begin{macro}{\backmatter} % % Declare the back matter section of the document. Does not reset the page number. % \begin{macrocode} \DeclareDocumentCommand{\backmatter}{}{% \boolfalse{LWR@mainmatter} } % \end{macrocode} % \end{macro} % % % \subsection{Sectioning support macros} % % \begin{macro}{\LWR@sectionumber} \marg{section type} % % Typeset a section number and its trailing space with CSS formatting: % \begin{macrocode} \newcommand*{\LWR@sectionnumber}[1]{% \InlineClass{sectionnumber}{#1} % } % \end{macrocode} % \end{macro} % \DescribeObject{autosec} A tag used by the TOC and index. % % \begin{macro}{\LWR@createautosec} \marg{section type} % % Create an autosection tag. % \begin{macrocode} \newcommand*{\LWR@createautosec}[1]{% \LWR@htmltag{#1 id="autosec-\thepage"{}}% } % \end{macrocode} % \end{macro} % \begin{macro}{\LWR@pushoneclose} \marg{depth} \marg{printclose} % Stacks the new sectioning level's closing tag, % to be used when this section is closed some time later. % % |\LWR@stoppars| must be executed first. % \watchout % \begin{macrocode} \NewDocumentCommand{\LWR@pushoneclose}{m m}{\pushclose{#2}{#1}} % \end{macrocode} % \end{macro} % \begin{macro}{\LWR@startnewdepth} \marg{depth} \marg{printclose} % % Closes currently stacked tags of a lesser level, % then opens the new nesting level by saving this new sectioning % level's closing tag for later use. % % |\LWR@stoppars| must be executed first. % \watchout % \begin{macrocode} \NewDocumentCommand{\LWR@startnewdepth}{m m}{% % \end{macrocode} % Close any stacked sections up to this new one. % \begin{macrocode} \LWR@closeprevious{#1}% % \end{macrocode} % Push a new section depth: % \begin{macrocode} \LWR@pushoneclose{#1}{#2}% } % \end{macrocode} % \end{macro} % % % % \DescribeCounter{LWR@prevFileDepth} Remembers the previous |LWR@FileDepth|. % % Initialized to a deep level so that any section will trigger a new \HTML\ % page after the home page. % \begin{macrocode} \newcounter{LWR@prevFileDepth} \setcounter{LWR@prevFileDepth}{\LWR@depthsubparagraph} % \end{macrocode} % % % % \begin{macro}{\LWR@section} * \oarg{TOC name} \marg{name} \marg{sectiontype} % % \changes{v0.20}{2017/01/09}{Combined higher-level sections together into files.} % % The common actions for the high-level sectioning commands. % \begin{macrocode} \DeclareDocumentCommand{\LWR@section}{m m m m}{% \LWR@traceinfo{LWR@section}% \LWR@stoppars% % \end{macrocode} % Cancel special \env{minipage} horizontal space interaction: % \begin{macrocode} \global\boolfalse{LWR@minipagethispar}% % \end{macrocode} % Start a new \HTML\ file if not starred, and is a shallow sectioning depth: % \begin{macrocode} \LWR@traceinfo{LWR@section: testing whether to start a new HTML file}% \IfBooleanTF{#1}{% starred % \end{macrocode} % Generate a new LaTeX page so that \TOC\ and index page number points to the section: % \begin{macrocode} \LWR@orignewpage% }{% not starred \ifthenelse{% \cnttest{\csuse{LWR@depth#4}}{<=}{\value{FileDepth}}% \AND% \(% \NOT\boolean{CombineHigherDepths}\OR% \cnttest{\csuse{LWR@depth#4}}{<=}{\value{LWR@prevFileDepth}}% \)% }% % \end{macrocode} % If so: start a new \HTML\ file: % \begin{macrocode} {% new file \LWR@traceinfo{LWR@section: new HTML file}% % \end{macrocode} % See if there was an optional TOC name entry: % \begin{macrocode} \IfNoValueTF{#2}% % \end{macrocode} % If no optional entry % \begin{macrocode} {\LWR@newhtmlfile{#3}}% % \end{macrocode} % If yes an optional entry % \begin{macrocode} {\LWR@newhtmlfile{#2}}% }% new file % \end{macrocode} % Else: No new \HTML\ file: % \begin{macrocode} {% not new file % \end{macrocode} % Generate a new LaTeX page so that \TOC\ and index page number points to the section: % \begin{macrocode} \LWR@orignewpage% }% not new file }% not starred % \end{macrocode} % Remember this section's name for \cs{nameref}: % \begin{macrocode} \LWR@traceinfo{LWR@section: about to LWR@setlatestname}% \IfValueTF{#2}{\LWR@setlatestname{#2}}{\LWR@setlatestname{#3}}% % \end{macrocode} % Print an opening comment with the level and the name; % ex: ``section'' ``Introduction'' % \begin{macrocode} \ifbool{HTMLDebugComments}{% \LWR@htmlcomment{Opening #4 ``#3''{}} }{} % \end{macrocode} % For inline sections paragraph and subparagraph, start a new paragraph now: % \begin{macrocode} \ifthenelse{% \cnttest{\csuse{LWR@depth#4}}{>=}{\LWR@depthparagraph}% }% {\LWR@startpars} {} % \end{macrocode} % Create the opening tag with an autosec: % \begin{macrocode} \LWR@createautosec{\csuse{LWR@tag#4}}% % \end{macrocode} % If not starred, step counter and add to TOC: % \begin{macrocode} \IfBooleanTF{#1}% {}% starred {% not starred % \end{macrocode} % Only add a numbered TOC entry if section number is not too deep: % \begin{macrocode} \ifthenelse{% \cnttest{\csuse{LWR@depth#4}}{<=}{\value{secnumdepth}}% }% {% if secnumdepth % \end{macrocode} % If in the main matter, step the counter and add the TOC entry. % For |article| class, \pkg{lwarp} assumes that all is mainmatter. % \begin{macrocode} \LWR@traceinfo{LWR@section: about to test main matter}% \ifbool{LWR@mainmatter}% {% \LWR@traceinfo{LWR@section: yes mainmatter}% \refstepcounter{#4}% % \end{macrocode} % Add main matter numbered TOC entry with the TOC name or the regular name: % \begin{macrocode} \LWR@traceinfo{LWR@section: about to addcontentsline}% \addcontentsline{toc}{#4}% {\protect\LWR@sectionnumber{\csuse{the#4}}% \IfValueTF{#2}{#2}{#3}}% \LWR@traceinfo{LWR@section: finished addcontentsline}% }% end of if main matter % \end{macrocode} % If not main matter, add unnumbered TOC name or regular name: % \begin{macrocode} {% not main matter \LWR@traceinfo{LWR@section: no main matter}% \addcontentsline{toc}{#4}{\IfValueTF{#2}{#2}{#3}}% }% end of not main matter }% end of secnumdepth % \end{macrocode} % Deeper than secnumdepth, so add an unnumbered TOC entry: % \begin{macrocode} {% \addcontentsline{toc}{#4}{\IfValueTF{#2}{#2}{#3}}% }% % \end{macrocode} % For part, print the section type: % \begin{macrocode} \ifbool{LWR@mainmatter}% {% \ifthenelse{% \(\cnttest{\csuse{LWR@depth#4}}{<=}% {\value{secnumdepth}}\) \AND \(\cnttest{\csuse{LWR@depth#4}}{<=}{\LWR@depthpart}\) }% {\csuse{#4name}~{}}% {}% % \end{macrocode} % Print the section number: % \begin{macrocode} \LWR@traceinfo{LWR@section: about to print section number}% \ifthenelse{% \cnttest{\csuse{LWR@depth#4}}{<=}{\value{secnumdepth}}% }% {\protect\LWR@sectionnumber{\csuse{the#4}}}% {}% \LWR@traceinfo{LWR@section: finished print section number}% }{}% }% end of not starred % \end{macrocode} % Print the section name: % \begin{macrocode} #3 % \end{macrocode} % close the heading tag, such as /H2 % \begin{macrocode} \LWR@htmltag{\csuse{LWR@tag#4end}}% % \end{macrocode} % Generate a \LaTeX{} label: % \begin{macrocode} \label{autopage-\thepage}% % \end{macrocode} % Start paragraph handing unless is an inline paragraph or subparagraph: % \begin{macrocode} \ifthenelse{% \cnttest{\csuse{LWR@depth#4}}{<}{\LWR@depthparagraph}}% {\LWR@startpars}% {}% % \end{macrocode} % If not starred, remember the previous depth to % possibly trigger a new \HTML\ page. % % A starred section does not trigger a new \HTML\ page at the beginning % of this macro, so it should not affect it here at the end either. % This became an issue when a \cs{listoftables} was tested in the middle of % the document. The \cs{chapter*} for the list was not allowing % a new \HTML\ page for the section following it % while |CombineHigherDepths| was true. % \begin{macrocode} \IfBooleanTF{#1}{}{% not starred \setcounter{LWR@prevFileDepth}{\csuse{LWR@depth#4}}% }% not starred \LWR@traceinfo{LWR@section: done}% } % \end{macrocode} % \end{macro} % \subsection{\textbackslash{}section and friends} % \begin{macro}{\part} * \oarg{TOC name} \marg{name} % \begin{macrocode} \@ifundefined{chapter} {} {% \DeclareDocumentCommand{\part}{s o m}{% \LWR@epubprintpendingfootnotes% \LWR@stoppars% \LWR@startnewdepth{\LWR@depthpart}{\LWR@printclosepart}% \LWR@section{#1}{#2}{#3}{part}% } } % \end{macrocode} % \end{macro} % \begin{macro}{\chapter} * \oarg{TOC name} \marg{name} % % \changes{v0.28}{2017/04/06}{If \EPUB, prints footnotes before each section.} % \begin{macrocode} \@ifundefined{chapter} {} {% \DeclareDocumentCommand{\chapter}{s o m}{% \LWR@traceinfo{chapter #3}% \LWR@epubprintpendingfootnotes% \LWR@stoppars% \LWR@startnewdepth{\LWR@depthchapter}{\LWR@printclosechapter}% \LWR@traceinfo{chapter: about to LWR@section}% \LWR@section{#1}{#2}{#3}{chapter}% \LWR@traceinfo{chapter: done}% } } % \end{macrocode} % \end{macro} % \begin{macro}{\section} * \oarg{TOC name} \marg{name} % \begin{macrocode} \DeclareDocumentCommand{\section}{s o m}{% \LWR@epubprintpendingfootnotes% \LWR@stoppars% \LWR@startnewdepth{\LWR@depthsection}{\LWR@printclosesection}% \LWR@section{#1}{#2}{#3}{section}% } % \end{macrocode} % \end{macro} % \begin{macro}{\subsection} * \oarg{TOC name} \marg{name} % \begin{macrocode} \DeclareDocumentCommand{\subsection}{s o m}{% \LWR@epubprintpendingfootnotes% \LWR@stoppars% \LWR@startnewdepth{\LWR@depthsubsection}{\LWR@printclosesubsection}% \LWR@section{#1}{#2}{#3}{subsection}% } % \end{macrocode} % \end{macro} % \begin{macro}{\subsubsection} * \oarg{TOC name} \marg{name} % \begin{macrocode} \DeclareDocumentCommand{\subsubsection}{s o m}{% \LWR@epubprintpendingfootnotes% \LWR@stoppars% \LWR@startnewdepth{\LWR@depthsubsubsection}% {\LWR@printclosesubsubsection}% \LWR@section{#1}{#2}{#3}{subsubsection}% } % \end{macrocode} % \end{macro} % \begin{macro}{\paragraph} * \oarg{TOC name} \marg{name} % \begin{macrocode} \DeclareDocumentCommand{\paragraph}{s o m}{% \LWR@epubprintpendingfootnotes% \LWR@stoppars% \LWR@startnewdepth{\LWR@depthparagraph}{\LWR@printcloseparagraph}% \LWR@section{#1}{#2}{#3}{paragraph}% } % \end{macrocode} % \end{macro} % \begin{macro}{\subparagraph} * \oarg{TOC name} \marg{name} % \begin{macrocode} \DeclareDocumentCommand{\subparagraph}{s o m}{% \LWR@epubprintpendingfootnotes% \LWR@stoppars% \LWR@startnewdepth{\LWR@depthsubparagraph}{\LWR@printclosesubparagraph}% \LWR@section{#1}{#2}{#3}{subparagraph}% } % \end{macrocode} % \end{macro} % \begin{macrocode} \end{warpHTML} % \end{macrocode} % \section{Starting a new file} % \label{sec:startingfile} % \codehtml % \begin{macrocode} \begin{warpHTML} % \end{macrocode} % \begin{macro}{\MetaLanguage} Default language for the \HTML\ |lang| tag. % \index{language HTML metadata} % \begin{macrocode} \newcommand*{\MetaLanguage}{en-US} % \end{macrocode} % \end{macro} % \begin{macro}{\LWR@filestart} \marg{title\_suffix} % Creates the opening \HTML\ tags. % \changes{v0.19}{2016/05/25}{lwarp\_mathjax.txt loaded.} % \changes{v0.20}{2016/06/27}{Adds meta description.} % \changes{v0.21}{2017/02/22}{Skip title if not given.} % \changes{v0.28}{2017/04/06}{Adds \HTML\ meta author.} % % \begin{macrocode} \newcommand*{\LWR@filestart}[1]{ % \end{macrocode} % Locally temporarily disable direct-formatting commands: % \begin{macrocode} \begingroup \renewcommand{\textit}[1]{##1}% not used in filenames \renewcommand{\textsc}[1]{##1} \renewcommand{\textsl}[1]{##1} \renewcommand{\textbf}[1]{##1} \renewcommand{\texttt}[1]{##1} \renewcommand{\textsf}[1]{##1} \renewcommand{\textrm}[1]{##1} \renewcommand{\textsuperscript}[1]{##1} \renewcommand{\textsubscript}[1]{##1} \renewcommand*{\HTMLunicode}[1]{} \renewcommand*{\HTMLentity}[1]{} \RenewDocumentCommand{\LWR@htmlspanclass}{m o +m}{##3} \DeclareExpandableDocumentCommand{\InlineClass}{m o m}{##3} % \end{macrocode} % Create the page's \HTML\ header: % \begin{macrocode} \LWR@htmltag{!DOCTYPE html}\LWR@orignewline % \end{macrocode} % The language is user-adjustable: % \begin{macrocode} \LWR@htmltag{html lang="\MetaLanguage"{}}\LWR@orignewline % \end{macrocode} % Start of the meta data: % \begin{macrocode} \LWR@htmltag{head}\LWR@orignewline % \end{macrocode} % Charset is fixed at UTF-8: % \begin{macrocode} \LWR@htmltag{meta charset="UTF-8" /}\LWR@orignewline % \end{macrocode} % % Author: % \begin{macrocode} \ifcsempty{theHTMLauthor}{}{ \LWR@htmltag{meta name="author" content="\theHTMLauthor" /}\LWR@orignewline } % \end{macrocode} % % \pkg{lwarp} is the generator: % \index{HTML>meta tag>generator} % \index{generator>HTML meta tag} % \index{meta tag, HTML>generator} % \begin{macrocode} \LWR@htmltag{meta name="generator" content="LaTeX lwarp package" /}% \LWR@orignewline % \end{macrocode} % If there is a description, add it now: % \begin{macrocode} \ifdefempty{\LWR@currentHTMLdescription}{}{% \LWR@htmltag{% meta name="description" content="\LWR@currentHTMLdescription" /}% \LWR@orignewline }% % \end{macrocode} % Mobile-friendly viewport: % \index{HTML>meta tag>viewport} % \index{viewport>HTML meta tag} % \index{meta tag, HTML>viewport} % \begin{macrocode} \LWR@htmltag{meta name="viewport" % content="width=device-width, initial-scale=1.0" /}% \LWR@orignewline % \end{macrocode} % IE patch: % \begin{macrocode} \LWR@htmltag{!{-}{-}[if lt IE 9]}\LWR@orignewline \LWR@htmltag{% script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"{}}% \LWR@htmltag{/script}\LWR@orignewline \LWR@htmltag{![endif]{-}{-}}\LWR@orignewline % \end{macrocode} % The page's title: % \begin{macrocode} \ifcsvoid{thetitle}{}{% \LWR@htmltag{title}\thetitle#1\LWR@htmltag{/title}\LWR@orignewline% }% % \end{macrocode} % The page's stylesheet: % \begin{macrocode} \LWR@htmltag{% link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% \LWR@orignewline % \end{macrocode} % Optional MathJax support. The \HTML\ tags must be turned off % during the verbatim input, and the paragraph handling which was % turned on at the end of verbatim input must be immediately turned off % again. % \begin{macrocode} \ifbool{mathjax}% {% \boolfalse{LWR@verbtags} \VerbatimInput{lwarp_mathjax.txt}% \booltrue{LWR@verbtags} \LWR@stoppars }% end of mathjax {}% % \end{macrocode} % End of the header: % \begin{macrocode} \LWR@htmltag{/head}\LWR@orignewline % \end{macrocode} % Start of the body: % \begin{macrocode} \LWR@htmltag{body}\LWR@orignewline \endgroup } % \end{macrocode} % \end{macro} % \begin{macrocode} \end{warpHTML} % \end{macrocode} % \section{Starting HTML output} % \codehtml % \begin{macrocode} \begin{warpHTML} % \end{macrocode} % \begin{macro}{\LWR@LwarpStart} % \changes{v0.19}{2016/06/01}{Enabled \textbackslash\textbackslash{} equal to \cs{newline}.} % \changes{v0.21}{2017/02/22}{Changed \texttt{lateximages} to a \texttt{.txt} file.} % \changes{v0.28}{2017/04/09}{\texttt{FormatWordProcessor} forces single-file output.} % Executed at the beginning of the entire document. % \begin{macrocode} \newcommand*{\LWR@LwarpStart} {% % \end{macrocode} % % If formatting for a word processor, % force filedepth to single-file only, % force \HTML\ debug comments off. % \begin{macrocode} \ifbool{FormatWordProcessor}{% \setcounter{FileDepth}{-5}% \boolfalse{HTMLDebugComments}% }{} % \end{macrocode} % % Expand and detokenize \cs{HomeHTMLFileName} and \cs{HTMLFileName}: % \begin{macrocode} \edef\LWR@strresult{\HomeHTMLFileName} \edef\HomeHTMLFileName{\detokenize\expandafter{\LWR@strresult}} \edef\LWR@strresult{\HTMLfiveName} \edef\HTMLfiveName{\detokenize\expandafter{\LWR@strresult}} % \end{macrocode} % Force onecolumn: % \begin{macrocode} \LWR@origonecolumn% % \end{macrocode} % Reduce chance of line overflow in verbatim environments: % \begin{macrocode} \LWR@origscriptsize% % \end{macrocode} % In \PDF\ output, don't allow line breaks to interfere with \HTML\ tags: % \begin{macrocode} \LWR@origraggedright% \let\\\LWR@endofline% % \end{macrocode} % Spread the lines for |pdftotext| to read them well: % \begin{macrocode} \linespread{1.3}% % \end{macrocode} % For |pdftotext| to reliably identify paragraph splits: % \begin{macrocode} \setlength{\parindent}{0pt} \setlength{\parskip}{2ex} % \end{macrocode} % % For the |lateximages| record file: % \begin{macrocode} \immediate\openout\LWR@file=lateximages.txt % \end{macrocode} % % Removes space after the caption in the \HTML: % \begin{macrocode} \setlength{\belowcaptionskip}{-3ex} % \end{macrocode} % Redefine the plain page style to be empty when used by index pages: % \begin{macrocode} \renewcommand{\ps@plain}{} % \end{macrocode} % Not used in the \HTML\ environment: % \DescribeMacro{\centering} % \DescribeMacro{\raggedleft} % \DescribeMacro{\raggedright} % \begin{macrocode} \renewcommand*{\centering}{} \renewcommand*{\raggedleft}{} \renewcommand*{\raggedright}{} % \end{macrocode} % Plug in some new actions. % This is done just before the document start % so that they won't be over-written by some other package. % \changes{v0.13}{2016/03/23}{\cs{up} and \cs{fup}} % % Tabular: % \begin{macrocode} \let\LWR@origtabular\tabular \let\LWR@origendtabular\endtabular \let\tabular\LWR@tabular \let\endtabular\endLWR@tabular % \end{macrocode} % Float captions: % \begin{macrocode} \let\LWR@origcaption\caption % \end{macrocode} % % Labels: % \cs{ltx@label} is used in \pkg{amsmath} environments and is also % patched by \pkg{cleveref}. % \index{label>in HTML} % \margintag{Label in \HTML} % \changes{v0.20}{2017/01/30}{Fix: math cross references.} % \begin{macrocode} \let\LWR@origltx@label\ltx@label \let\ltx@label\LWR@htmlmathlabel % \end{macrocode} % Logos: % \begin{macrocode} \let\TeX\LWR@TeX \let\LaTeX\LWR@LaTeX \let\LuaTeX\LWR@LuaTeX \let\LuaLaTeX\LWR@LuaLaTeX \let\XeTeX\LWR@XeTeX \let\XeLaTeX\LWR@XeLaTeX \let\ConTeXt\LWR@ConTeXt % \end{macrocode} % Graphics: % \begin{macrocode} \let\rotatebox\LWR@rotatebox \let\scalebox\LWR@scalebox \let\reflectbox\LWR@reflectbox % \end{macrocode} % Not yet started any paragraph handling: % \begin{macrocode} \global\boolfalse{LWR@doingapar} \global\boolfalse{LWR@doingstartpars} % \end{macrocode} % Start a new \HTML\ file and a header: % \begin{macrocode} \LWR@filestart{} \LWR@htmltag{header}\LWR@orignewline \LWR@startpars \LWR@firstpagetop \LWR@stoppars \LWR@htmltag{/header}\LWR@orignewline \LWR@htmltag{section class="textbody"{}} \LWR@origpagestyle{empty} % \end{macrocode} % Document and page settings: % \begin{macrocode} \mainmatter \LWR@origpagenumbering{arabic} % \end{macrocode} % Set default titlepage thanks footnote marks. See \cref{sec:titlehtml}. % \begin{macrocode} \if@titlepage \thanksmarkseries{arabic} \else \thanksmarkseries{fnsymbol} \fi % \end{macrocode} % % Initial default patch for fancyvrb: % \begin{macrocode} \fvset{frame=none}% % \end{macrocode} % % The ampersand is redefined active, and acts depending % on whether it is inside a tabular. % \begin{macrocode} \catcode`\&=\active % \end{macrocode} % Allow \HTML\ paragraphs to begin: % \begin{macrocode} \LWR@startpars } % \end{macrocode} % \end{macro} % \begin{macrocode} \end{warpHTML} % \end{macrocode} % \section{Ending HTML output} % \codehtml % \begin{macrocode} \begin{warpHTML} % \end{macrocode} % \begin{macro}{\LWR@requesttoc} \marg{boolean} \marg{suffix} % \changes{v0.18}{2016/05/19}{Reorganize \cs{HomeHTMLFilename} logic.} % Requests that a toc, lof, or lot be generated. % \begin{macrocode} \newcommand*{\LWR@requesttoc}[2]{% \ifbool{#1} { \expandafter\newwrite\csuse{tf@#2} \immediate\openout \csuse{tf@#2} \jobname.#2\relax }{} } % \end{macrocode} % \end{macro} % \begin{macro}{\LWR@LwarpEnd} % Final stop of all \HTML\ output: % % \changes{v0.28}{2017/04/06}{If \texttt{FormatEPUB} or \texttt{FormatWordProcessor}, no bottom nav.} % \begin{macrocode} \newcommand*{\LWR@LwarpEnd} { \LWR@stoppars \LWR@closeprevious{\LWR@depthfinished} % \end{macrocode} % At the bottom of the ending file: % Close the textbody: % \begin{macrocode} \LWR@htmlelementclassend{section}{textbody} % \end{macrocode} % Print any pending footnotes: % \begin{macrocode} \LWR@printpendingfootnotes % \end{macrocode} % Create the footer: % \begin{macrocode} \LWR@htmlelement{footer} \LWR@pagebottom \LWR@htmlelementend{footer} % \end{macrocode} % No bottom navigation if are finishing the home page, % or if formatting for an \EPUB\ or word processor. % % Presumably has a table-of-contents. % \begin{macrocode} \ifthenelse{\boolean{FormatEPUB}\OR\boolean{FormatWordProcessor}} {} { \ifnumcomp{\value{LWR@htmlfilenumber}}{>}{0}{\LWR@botnavigation}{} } % \end{macrocode} % \begin{macrocode} \LWR@stoppars% final stop of all paragraphs % \end{macrocode} % Finish the \HTML\ file: % \begin{macrocode} \LWR@htmltag{/body}\LWR@orignewline \LWR@htmltag{/html}\LWR@orignewline % \end{macrocode} % Seems to be required sometimes: % \begin{macrocode} \LWR@orignewpage % \end{macrocode} % For \env{lateximage} commands: % \begin{macrocode} \immediate\closeout\LWR@file } % \end{macrocode} % \end{macro} % \begin{macrocode} \end{warpHTML} % \end{macrocode} % \section{Titles and the \protect\pkg{titling} package} % \label{sec:titles} % Supports and extends the \pkg{titling} package. % % Additional functions include \cs{published} and \cs{subtitle}, and the % \cs{author} command has an additional \cs{affiliation} command to provide % an affiliation and other additional information for each author in the % title page. The affiliation information is removed when using \cs{theauthor} % in the main text. % % The \pkg{titling} package maintains the definitions of \cs{thetitle}, % \cs{theauthor}, etc., after the title has been typeset. % These commands are to be used to refer to the document's title % and author, etc., in the main text. % These definitions % have the \cs{thanks} and \cs{affiliation} removed, and for author the % \cs{and} is replaced to generate a simple inline list of authors separated % by commas. % % \cs{printtitle}, \cs{printauthor}, etc., are provided for use inside % the \env{titlepage} or \env{titlingpage} environments, and these retain % the \cs{thanks} and \cs{affiliation}. % % Several additional hooks are provided in addition to \pkg{titling}: % \begin{description} % \ItemDescribeMacro{\maketitlehookaa} Between ``published'' and the title. % \ItemDescribeMacro{\maketitlehookaaa} Between the title and the subtitle. % \ItemDescribeMacro{\prepublished} Before the ``published'' field. % \ItemDescribeMacro{\postpublished} After the ``published'' field. % \ItemDescribeMacro{\presubtitle} Before the subtitle. % \ItemDescribeMacro{\postsubtitle} After the subtitle. % \end{description} % % \DescribeMacro{\printthanks} % \cs{printthanks} has been added to force the printing of thanks inside % a \env{titlingpage} environment when \cs{maketitle} is not used. % % Inside a \cs{titlepage} or \cs{titlingpage} environment, use % \cs{thanks} for footnotes, do not use \cs{footnote}. % \watchout[No footnotes!] % % At the end of the \env{titlingpage} environment, footnote marks are forced to % reset to zero. % % Inside a \env{titlingpage} environment with the |article| document class, % thanks marks will be |fnsymbol| instead of |arabic|. |arabic| is usually % used when inside \env{titlepage} environments where the title page is % on its own page, but is not automatically used % inside a \env{titlingpage} environment. % % To force the thanks marks to % be |arabic|: % \begin{Verbatim}[gobble=2,frame=lines,obeytabs,tabsize=4] % \begin{titlingpage} % \thanksmarkseries{arabic} % ... % \end{Verbatim} % % % % \subsection{Setting the title, etc.} % % The following provide setting commands for both \HTML\ and print outputs. % % \DescribeMacro{@published} % \DescribeMacro{@title} % \DescribeMacro{@subtitle} % \DescribeMacro{@author} % \DescribeMacro{@date} % \cs{@title}, \cs{@subtitle}, \cs{@author}, etc.\ store the values % as originally assigned, including any \cs{thanks}, \cs{and}, or \cs{affiliation}. % These are low-level macros intended to be used by other macros % only inside a \env{titlepage} or \env{titlingpage}, % and are used by \cs{maketitle}. % The author is printed inside a single-column table, % which becomes multiple single-column tables if multiples authors are included. % % \DescribeMacro{\printpublished} % \DescribeMacro{\printtitle} % \DescribeMacro{\printsubtitle} % \DescribeMacro{\printauthor} % \DescribeMacro{\printdate} % \cs{printtitle}, \cs{printsubtitle}, etc.\ are user-level macros intended to % be used in \env{titlepage} and \env{titlingpage} environments in cases where % \cs{maketitle} is not desired. These commands preserve the \cs{thanks}, etc., % and should not be used in the main text. % The author is printed inside a single-column table, % which becomes multiple single-column tables if multiples authors are included. % % \DescribeMacro{\thepublished} % \DescribeMacro{\thetitle} % \DescribeMacro{\thesubtitle} % \DescribeMacro{\theauthor} % \DescribeMacro{\thedate} % \cs{thetitle}, \cs{thesubtitle}, \cs{theauthor}, etc.\ are user-level % sanitized versions which have removed the \cs{thanks} and \cs{affiliation}, % and \cs{and} is changed for inline text usage. % The author is printed inline without \cs{affiliation} or \cs{thanks}, % with \cs{and} placing commas between multiple authors. % Thus, these commands are to be used in the main text whenever the user % wishes to refer to the document's title and such. One practical use for this % is to place the authors at the bottom of each \HTML\ page, such as: % % \DescribeMacro{\SetPageBottom} \marg{text} % \begin{Verbatim}[gobble=2,frame=lines,obeytabs,tabsize=4] % \SetPageBottom{ % \begin{center}\textcopyright~2016 \theauthor\end{center} % } % \end{Verbatim} % % \DescribeMacro{\author} \marg{author} % \DescribeMacro{\and} % While using \cs{maketitle}, the author is treated as a single-column table % and the \cs{and} feature finishes the current table then starts a new one for % the next author. Each author thus is placed into its own table, and an % affiliation may be placed on its own line such as % % |\author{Name \\ Affiliation \and Second Name \\ Second Affiliation}| % % After \cs{maketitle} has completed, \cs{theauthor} retains the definition of % the author, but \cs{and} is changed to become a comma and a space, intending to % print the authors names separated by spaces. This fails when affiliations are % included on their own table rows. % % A solution, provide here, is to define a macro \cs{affiliation} which % during \cs{maketitle} starts a new table row and adds the affiliation, % but after \cs{maketitle} is finished \cs{affiliation} is re-defined % to throw away its argument, thus printing only the author names % when \cs{author} is later used inline. % % % \begin{macro}{\affiliation} \marg{text} % % Adds the affiliation to the author for use in \cs{maketitle}. % Nullified when later used for inline use of \cs{theauthor}. % % \codehtml % \begin{macrocode} \begin{warpHTML} \newrobustcmd{\affiliation}[1]{\\ \InlineClass{affiliation}{#1}} \end{warpHTML} % \end{macrocode} % \codeprint % \begin{macrocode} \begin{warpprint} \newrobustcmd{\affiliation}[1]{\\ \textsc{\small#1}} \end{warpprint} % \end{macrocode} % \end{macro} % % % % The following are based on the original \pkg{titling} code: % % % % \codeall % \begin{macrocode} \begin{warpall} % \end{macrocode} % % \begin{macro}{\author} \marg{text} % % Redefined to nullify \cs{affiliation}, etc.\ before printing the authors inline. % % \cs{@author} retains the entire author with its \cs{thanks}, while % \cs{theauthor} will have \cs{thanks} removed and \cs{and} simplified. % \begin{macrocode} \renewcommand{\author}[1]{% \gdef\@author{#1} \begingroup \renewcommand{\thanks}[1]{} \renewcommand{\and}{\unskip, } \renewcommand{\thanksmark}[1]{} \renewcommand{\thanksgap}[1]{} \renewcommand{\affiliation}[1]{} \protected@xdef\theauthor{#1} \endgroup} % \end{macrocode} % \end{macro} % % % \begin{macro}{\published} \marg{text} % \changes{v0.13}{2016/03/23}{Default to empty published.} % \begin{macrocode} \newcommand{\published}[1]{% \gdef\@published{#1} \begingroup \renewcommand{\thanks}[1]{} \renewcommand{\thanksmark}[1]{} \renewcommand{\thanksgap}[1]{} \protected@xdef\thepublished{#1} \endgroup } \newcommand{\@published}{} \newcommand{\thepublished}{} % \end{macrocode} % \end{macro} % % \begin{macro}{\subtitle} \marg{text} % \changes{v0.13}{2016/03/23}{Default to empty subtitle.} % \begin{macrocode} \newcommand{\subtitle}[1]{% \gdef\@subtitle{#1} \begingroup \renewcommand{\thanks}[1]{} \renewcommand{\thanksmark}[1]{} \renewcommand{\thanksgap}[1]{} \protected@xdef\thesubtitle{#1} \endgroup } \newcommand{\@subtitle}{} \newcommand{\thesubtitle}{} % \end{macrocode} % \end{macro} % % % \begin{macrocode} \end{warpall} % \end{macrocode} % % % \subsection{Changes to HTML titlepage and titlingpage} % % \codehtml % \begin{macrocode} \begin{warpHTML} % \end{macrocode} % % % \begin{environment}{titlepage} % Sets up a titlepage div with a \LaTeX{} \PDF\ minipage inside. % \begin{macrocode} \renewenvironment*{titlepage} { \LWR@forcenewpage \BlockClass{titlepage}\LWR@subminipage } {\LWR@endsubminipage\endBlockClass} % \end{macrocode} % \end{environment} % % \begin{environment}{titlingpage} % \begin{macrocode} \renewenvironment*{titlingpage} {% % \end{macrocode} % Start an \HTML\ titlepage div: % \begin{macrocode} \begin{titlepage} % \end{macrocode} % Prepare for a custom version of \cs{maketitle} inside the \env{titlingpage}: % \begin{macrocode} \LWR@maketitlesetup \let\maketitle\LWR@titlingmaketitle } { % \end{macrocode} % At the end of the environment, % end the \HTML\ titlepage div: % \begin{macrocode} \end{titlepage} % \end{macrocode} % Reset the footnote counter: % \begin{macrocode} \@bscontmark } % \end{macrocode} % \end{environment} % % \begin{macrocode} \end{warpHTML} % \end{macrocode} % \codeall % \begin{macrocode} \begin{warpall} % \end{macrocode} % \DescribeMacro{\printthanks} Forces the \cs{thanks} to be printed. % % This is necessary in a \env{titlingpage} environment % when \cs{maketitle} was not used. % \begin{macrocode} \newcommand*{\printthanks}{\@thanks} % \end{macrocode} % % \begin{environment}{titlingpage} % At the end of the titlingpage for both print and HTML, % reset footnote markers to zero. % \begin{macrocode} \AtEndEnvironment{titlingpage}{\@bscontmark} % \end{macrocode} % \end{environment} % % \begin{macrocode} \end{warpall} % \end{macrocode} % \subsection{Printing the title, etc.\ in HTML} % % \changes{v0.20}{2017/01/21}{Enhanced \pkg{titling} support.} % % The following are for printing the title, etc. % in a \env{titlepage} or a \env{titlingpage} % in \HTML: % % \codehtml % \begin{macrocode} \begin{warpHTML} % \end{macrocode} % % % % Patch the pre/post title/author/date to add \HTML\ tags, % then initilize: % \begin{macrocode} \newcommand{\prepublished}[1]{% \def\@bsprepublished{\BlockClass{published}#1}% } \newcommand{\postpublished}[1]{% \def\@bspostpublished{#1\endBlockClass}% } \renewcommand{\pretitle}[1]{% \def\@bspretitle{#1\LWR@stoppars\LWR@htmltag{h1}}% } \renewcommand{\posttitle}[1]{% \def\@bsposttitle{\LWR@htmltag{/h1}\LWR@startpars#1}% } \newcommand{\presubtitle}[1]{% \def\@bspresubtitle{\BlockClass{subtitle}#1}% } \newcommand{\postsubtitle}[1]{% \def\@bspostsubtitle{#1\endBlockClass}% } \renewcommand{\preauthor}[1]{% \def\@bspreauthor{\BlockClass{author}#1}% } \renewcommand{\postauthor}[1]{% \def\@bspostauthor{#1\endBlockClass}% } \renewcommand{\predate}[1]{% \def\@bspredate{#1\BlockClass{titledate}}% } \renewcommand{\postdate}[1]{% \def\@bspostdate{\endBlockClass#1}% } \prepublished{\begin{center}} \postpublished{\par\end{center}} \pretitle{\begin{center}} \posttitle{\par\end{center}} \presubtitle{\begin{center}} \postsubtitle{\par\end{center}} \preauthor{\begin{center}% \begin{tabular}[t]{c}% } \postauthor{\end{tabular}\par\end{center}} \predate{\begin{center}} \postdate{\par\end{center}} % \end{macrocode} % % % \begin{macro}{\printpublished} % \changes{v0.15}{2015/04/05}{No div if empty.} % \begin{macrocode} \newcommand*{\printpublished}{ \ifthenelse{\equal{\thepublished}{}} {} { \begin{BlockClass}{published} \@published \end{BlockClass} } } % \end{macrocode} % \end{macro} % \begin{macro}{\printtitle} % \begin{macrocode} \newcommand*{\printtitle} { \LWR@stoppars \LWR@htmltag{h1}% \@title% \LWR@htmltag{/h1} \LWR@startpars } % \end{macrocode} % \end{macro} % \begin{macro}{\LWR@printthetitle} % % A private version which prints the title without footnotes, % used to title each \HTML\ page. % \begin{macrocode} \newcommand*{\LWR@printthetitle} { \LWR@stoppars \LWR@htmltag{h1}% \thetitle% \LWR@htmltag{/h1} \LWR@startpars } % \end{macrocode} % \end{macro} % \begin{macro}{\printsubtitle} % \changes{v0.15}{2015/04/05}{No div if empty.} % \begin{macrocode} \newcommand*{\printsubtitle}{ \ifthenelse{\equal{\thesubtitle}{}} {} { \begin{BlockClass}{subtitle} \@subtitle \end{BlockClass} } } % \end{macrocode} % \end{macro} % \begin{macro}{\printauthor} % \begin{macrocode} \newcommand*{\printauthor}{ \begin{BlockClass}{author} \begin{tabular}{c}\@author\end{tabular} \end{BlockClass} } % \end{macrocode} % \end{macro} % \begin{macro}{\printdate} % \begin{macrocode} \newcommand*{\printdate}{% \begin{BlockClass}{titledate} \@date \end{BlockClass} } % \end{macrocode} % \end{macro} % \begin{macrocode} \end{warpHTML} % \end{macrocode} % \subsection{Printing the title, etc.\ in print form} % % The following are for printing the title, etc. % in a \env{titlepage} or a \env{titlingpage} % in print form: % % \codeprint % \begin{macrocode} \begin{warpprint} % \end{macrocode} % \changes{v0.16}{2016/04/07}{\cs{titlingpage}: Improved print-output spacing.} % \changes{v0.16}{2016/04/07}{Test Suite: Improved titlingpage.} % \begin{macro}{\printpublished} % \begin{macrocode} \newcommand*{\printpublished}{{\Large\scshape\@published}} % \end{macrocode} % \end{macro} % \begin{macro}{\printtitle} % \begin{macrocode} \newcommand*{\printtitle}{{\Huge\@title}} % \end{macrocode} % \end{macro} % \begin{macro}{\printsubtitle} % \begin{macrocode} \newcommand*{\printsubtitle}{{\Large\itshape\@subtitle\bigskip}} % \end{macrocode} % \end{macro} % \begin{macro}{\printauthor} % \begin{macrocode} \newcommand*{\printauthor} {{\large\begin{tabular}[t]{c}\@author\end{tabular}}} % \end{macrocode} % \end{macro} % \begin{macro}{\printdate} % \begin{macrocode} \newcommand*{\printdate}{{\small\textit{\@date}}} % \end{macrocode} % \end{macro} % % % \subsection{\cs{maketitle} for print output} % % % \DescribeMacro{\maketitle} % From the \pkg{titling} package, patched to add the publisher and subtitle. % % \begin{macrocode} \providecommand{\maketitle}{} \if@titlepage \renewcommand{\maketitle}{\begin{titlepage}% \let\footnotesize\small \let\footnoterule\relax \let \footnote \thanks \@bsmarkseries \def\@makefnmark{\rlap{\@textsuperscript{% \normalfont\@bsthanksheadpre \tamark \@bsthanksheadpost}}}% \long\def\@makefntext##1{\makethanksmark ##1} \null\vfil \vskip 60\p@ \vspace*{\droptitle} \maketitlehooka \ifcsempty{@published} {} {{\@bsprepublished \@published \@bspostpublished}\maketitlehookaa} {\@bspretitle \@title \@bsposttitle} \ifcsempty{@subtitle} {} {\maketitlehookaaa{\@bspresubtitle \@subtitle \@bspostsubtitle}} \maketitlehookb {\@bspreauthor \@author \@bspostauthor} \maketitlehookc {\@bspredate \@date \@bspostdate} \maketitlehookd \par \@thanks \vfil\null \end{titlepage}% \@bscontmark % \setcounter{footnote}{0}% %%% \@bsmtitlempty } % end titlepage defs \else \renewcommand{\maketitle}{\par \begingroup \@bsmarkseries \def\@makefnmark{\rlap{\@textsuperscript{% \normalfont\@bsthanksheadpre \tamark \@bsthanksheadpost}}}% \long\def\@makefntext##1{\makethanksmark ##1} \if@twocolumn \ifnum \col@number=\@ne \@maketitle \else \twocolumn[\@maketitle]% \fi \else \newpage \global\@topnum\z@ \@maketitle \fi \thispagestyle{plain}\@thanks \endgroup \@bscontmark % \setcounter{footnote}{0}% %%% \@bsmtitlempty } % end non-titlepage \def\@maketitle{% \newpage \null \vskip 2em% \vspace*{\droptitle} \maketitlehooka \ifcsempty{@published} {} {{\@bsprepublished \@published \@bspostpublished}\maketitlehookaa} {\@bspretitle \@title \@bsposttitle} \ifcsempty{@subtitle} {} {\maketitlehookaaa{\@bspresubtitle \@subtitle \@bspostsubtitle}} \maketitlehookb {\@bspreauthor \@author \@bspostauthor} \maketitlehookc {\@bspredate \@date \@bspostdate} \maketitlehookd \par \vskip 1.5em} \fi \providecommand{\maketitlehookaa}{} \providecommand{\maketitlehookaaa}{} \newcommand{\prepublished}[1]{% \def\@bsprepublished{#1}% } \newcommand{\postpublished}[1]{% \def\@bspostpublished{#1}% } \newcommand{\presubtitle}[1]{% \def\@bspresubtitle{#1}% } % \end{macrocode} % % \DescribeMacro{\presubtitle} Hook after printing the subtitle. % \begin{macrocode} \newcommand{\postsubtitle}[1]{% \def\@bspostsubtitle{#1}% } % \end{macrocode} % % Initial settings: % % \begin{macrocode} \if@titlepage \prepublished{ \vspace*{-\baselineskip}\vspace*{-\medskipamount}\vspace*{-2em} \begin{center}} \postpublished{\par\end{center}\vskip 2em} \presubtitle{\unskip\begin{center}\unskip} \postsubtitle{\par\end{center}\vskip 2em} \else \prepublished{\begin{center}} \postpublished{\par\end{center}\vskip 0.5em} \presubtitle{\begin{center}\unskip} \postsubtitle{\par\end{center}\vskip 0.5em} \fi % \end{macrocode} % % \begin{macrocode} \end{warpprint} % \end{macrocode} % % % \subsection{\protect\textbackslash{}maketitle for HTML output} % \label{sec:titlehtml} % % An \HTML\ div of class |titlepage| is created, inside of which % a \LaTeX{} \PDF\ minipage is generated (without \HTML\ tags), % allowing the |\thanks| footnotes to be generated immediately at the end % of the title page during \HTML\ output. This is desirable when % a large table of contents immediately follows the title. % % |\thanks| are a form of footnotes used in the title page. % See \cref{sec:footnotes} for other kinds of footnotes. % % See |\thanksmarkseries{series}|, below, to set the style of the footnote marks. % % \codehtml % \begin{macrocode} \begin{warpHTML} % \end{macrocode} % %\begin{macro}{\LWR@maketitlesetup} Patches \cs{thanks} macros to % use \LaTeX{} minipage footnotes. % % \begin{macrocode} \newcommand*{\LWR@maketitlesetup}{% % \end{macrocode} % Select which kind of footnote marks to use: % \begin{macrocode} \@bsmarkseries \@mpbsmarkseries % \end{macrocode} % % Redefine the footnote mark: % % \begin{macrocode} \def\@makefnmark{\textsuperscript{\thefootnote}} % \end{macrocode} % \begin{center} % \begin{minipage}{.7\linewidth} % \cs{thefootnote} \goesto\ \cs{nameuse}\{arabic\}\{footnote\}, or % % \cs{thefootnote} \goesto\ \cs{nameuse}\{fnsymbol\}\{footnote\} % \end{minipage} % \end{center} % % Redefine the footnote text: % % \begin{macrocode} \long\def\@makefntext##1{% % \end{macrocode} % Make the footnote mark and some extra horizontal space for the tags: % \begin{macrocode} \makethanksmark \LWR@orighspace{1in} % \end{macrocode} % \begin{center} % \begin{minipage}{.7\linewidth} % \cs{makethanksmark} \goesto\ \cs{thanksfootmark} \goesto\ \cs{tamark} \goesto\ % % \hfill \cs{@thefnmark} \goesto\ \cs{itshape} a (or similar) % \end{minipage} % \end{center} % % Print the text: % \begin{macrocode} ##1% }% } % \end{macrocode} % \end{macro} % \begin{macro}{\@fnsymbol} \marg{counter} % % Re-defined to use an \HTML\ entity for the double vertical bar symbol. % The original definition used \cs{\textbar} which was not being found by \cmds{pdftotext}. % \begin{macrocode} \def\@fnsymbol#1{\ensuremath{\ifcase#1\or *\or \dagger\or \ddagger\or \mathsection\or \mathparagraph\or \text{\HTMLunicode{2016}}\or **\or \dagger\dagger \or \ddagger\ddagger \else\@ctrerr\fi}} % \end{macrocode} % \end{macro} % %\begin{macro}{\maketitle} Creates an \HTML\ titlepage div % and typesets the title, etc. % % Code from the \pkg{titling} package is adapted, simplified, and % modified for \HTML\ output. % % \begin{macrocode} \renewcommand*{\maketitle}{% % \end{macrocode} % An \HTML\ titlepage div is used for all classes. % \begin{macrocode} \begin{titlepage} % \end{macrocode} % Set up special patches: % \begin{macrocode} \LWR@maketitlesetup % \end{macrocode} % Typeset the title, etc: % \begin{macrocode} \@maketitle % \end{macrocode} % Immediately generate any |\thanks| footnotes: % \begin{macrocode} \@thanks % \end{macrocode} % Close the \HTML\ titlepage div: % \begin{macrocode} \end{titlepage} % \end{macrocode} % Reset the footnote counter: % \begin{macrocode} \@bscontmark } % \end{macrocode} % \end{macro} % \begin{macro}{\@maketitle} Typesets the title, etc. for \HTML: % \begin{macrocode} \DeclareDocumentCommand{\@maketitle}{}{% \maketitlehooka \ifcsempty{@published} {} {{\@bsprepublished \@published \@bspostpublished}\maketitlehookaa} {\@bspretitle \@title \@bsposttitle} \ifcsempty{@subtitle} {} {\maketitlehookaaa{\@bspresubtitle \@subtitle \@bspostsubtitle}} \maketitlehookb {\@bspreauthor \@author \@bspostauthor} \maketitlehookc {\@bspredate \@date \@bspostdate} \maketitlehookd } % \end{macrocode} % \end{macro} % \begin{macrocode} \providecommand{\maketitlehookaa}{} \providecommand{\maketitlehookaaa}{} % \end{macrocode} % \begin{macro}{\LWR@titlingmaketitle} % \cs{maketitle} for use inside an \HTML\ \env{titlingpage} environment. % \begin{macrocode} \newcommand*{\LWR@titlingmaketitle}{% % \end{macrocode} % Typeset the title, etc: % \begin{macrocode} \@maketitle % \end{macrocode} % Immediately generate any |\thanks| footnotes: % \begin{macrocode} \@thanks } % \end{macrocode} % \end{macro} % % \begin{macro}{\thanksmarkseries} \marg{series} % % Sets the type of footnote marks used by |\thanks|, % where type is `arabic', `roman', `fnsymbol', etc. Modified to % use the \LaTeX{} \PDF\ minipage which is included with the title page. % \begin{macrocode} \renewcommand{\thanksmarkseries}[1]{% \def\@mpbsmarkseries{% \renewcommand*{\thempfootnote}{\@nameuse{#1}{mpfootnote}}}% \def\@bsmarkseries{\renewcommand{\thefootnote}{\@nameuse{#1}{footnote}}}% } % \end{macrocode} % \end{macro} % % \begin{macrocode} \end{warpHTML} % \end{macrocode} % \section{Abstract} % % The following code replaces the \LaTeX\ default, % and will itself be replaced later if the \pkg{abstract} % package is loaded. % % % \codehtml % \begin{macrocode} \begin{warpHTML} % \end{macrocode} % \begin{macro}{\abstractname} % User-redefinable title for the abstract. % % Also over-written by the \pkg{babel} package. % \begin{macrocode} \providecommand*{\abstractname}{Abstract} % \end{macrocode} % \end{macro} % % \begin{environment}{abstract} % \begin{macrocode} \DeclareDocumentEnvironment{abstract}{} { \LWR@forcenewpage \BlockClass{abstract} \BlockClassSingle{abstracttitle}{\abstractname} } { \endBlockClass } % \end{macrocode} % \end{environment} % \begin{macrocode} \end{warpHTML} % \end{macrocode} % \section{Quote and verse} % \subsection{Citations and attributions} % \begin{macro}{\attribution} % for use inside quote, quotation, verse: % ex: |\attribution{author name} --- \citetitle{book name}| % \codehtml % \begin{macrocode} \begin{warpHTML} \newcommand{\attribution}[1]{% \InlineClass{attribution}{—\,#1}}% emdash \end{warpHTML} % \end{macrocode} % \codeprint % \begin{macrocode} \begin{warpprint} \newcommand{\attribution}[1]{\textsc{---\,#1}} \end{warpprint} % \end{macrocode} % \end{macro} % \begin{macro}{\citetitle} % for use inside quote, quotation, verse: % % \codehtml % \begin{macrocode} \begin{warpHTML} \newcommand{\citetitle}[1]{% \InlineClass{citetitle}{—\,#1}}% emdash \end{warpHTML} % \end{macrocode} % % \codeprint % \begin{macrocode} \begin{warpprint} \newcommand{\citetitle}[1]{\textsl{---\,#1}} \end{warpprint} % \end{macrocode} % \end{macro} % \subsection{Quotes, quotations} % \codehtml % \begin{macrocode} \begin{warpHTML} % \end{macrocode} % % \begin{environment}{quote} % \begin{macrocode} \renewenvironment*{quote} { \LWR@forcenewpage \LWR@htmlblocktag{blockquote} } {\LWR@htmlblocktag{/blockquote}} \renewenvironment*{quotation} { \LWR@forcenewpage \LWR@htmlblocktag{blockquotation} } {\LWR@htmlblocktag{/blockquotation}} % \end{macrocode} % \end{environment} % \begin{macrocode} \end{warpHTML} % \end{macrocode} % \subsection{Verse} % % \limitsverse % % \codeall % \begin{macrocode} \begin{warpall} % \end{macrocode} % % The following lengths may be set in either print or \HTML\ output, % but are only used in \HTML. % This allows the user to set \cs{vleftskip} and \cs{leftmargini} for % print output, and optionally select different values for \HTML. % % \DescribeLength{HTMLvleftskip} % Sets \cs{vleftskip} inside a \env{verse} environment in \HTML. % \begin{macrocode} \newlength{\HTMLvleftskip} \setlength{\HTMLvleftskip}{1em} % \end{macrocode} % \DescribeLength{HTMLleftmargini} % Sets \cs{leftmargini} inside a \env{verse} environment in \HTML. % \begin{macrocode} \newlength{\HTMLleftmargini} \setlength{\HTMLleftmargini}{4.5em} % \end{macrocode} % \begin{macrocode} \end{warpall} % \end{macrocode} % \section{Verbatim} % \codehtml % \begin{macrocode} \begin{warpHTML} % \end{macrocode} % \begin{environment}{verbatim} % % \changes{v0.20}{2016/12/24}{Added.} % % \begin{macrocode} \AfterEndPreamble{ \AtBeginEnvironment{verbatim}{% \LWR@forcenewpage \LWR@atbeginverbatim{verbatim}\unskip\vspace*{-\baselineskip}% } \AfterEndEnvironment{verbatim}{\unskip\vspace*{-\baselineskip}\LWR@afterendverbatim} } % \end{macrocode} % \end{environment} % \begin{macrocode} \end{warpHTML} % \end{macrocode} % \section{Fancyvrb} % \codeall % \begin{macrocode} \begin{warpall} % \end{macrocode} % % % \DescribeLength{\VerbatimHTMLWidth} Width to use in \HTML\ |Verbatim| environment. % % This width is used when placing line numbers to the right. % Ignored during print output. % \begin{macrocode} \newlength{\VerbatimHTMLWidth} \setlength{\VerbatimHTMLWidth}{4in} \end{warpall} % \end{macrocode} % \codehtml % \begin{macrocode} \begin{warpHTML} % \end{macrocode} % % \DescribeBoolean{LWR@verbtags} Used to temporarily turn off verbatim tags % while doing \env{VerbatimInput} in the \HTML\ head. % \begin{macrocode} \newbool{LWR@verbtags} \booltrue{LWR@verbtags} % \end{macrocode} % For \cs{VerbatimFootnotes}: % \begin{macrocode} \renewcommand{\VerbatimFootnotes}{ \PackageError{lwarp} {Verbatim footnotes are not yet supported by lwarp.} {This may be improved some day.} } % \end{macrocode} % \begin{macro}{\LWR@atbeginverbatim} \marg{class} % % Encloses a verbatim environment with the given \CSS\ class. % \begin{macrocode} \newcommand*{\LWR@atbeginverbatim}[1] {% % \end{macrocode} % Avoid excessive space between lines: % \begin{macrocode} \setlength{\parskip}{0ex}% % \end{macrocode} % Stop generating \HTML\ paragraph tags: % \begin{macrocode} \LWR@stoppars% % \end{macrocode} % Create a new |pre| of the given class: % \begin{macrocode} \ifbool{LWR@verbtags}{\LWR@htmltag{pre class="#1"{}}}{}% % \end{macrocode} % Use a mono-spaced font to preserve horizontal positioning. % If horizontal alignment is important for the user, use a mono-spaced font % in the \CSS\ for the |verse| class. % \begin{macrocode} \LWR@origttfamily% % \end{macrocode} % Do not produce \HTML\ tags for \cs{hspace} inside a verse |par|. % Restore plain \LaTeX{} \cs{hspace} functionality: % \begin{macrocode} \let\hspace\LWR@orighspace% } % \end{macrocode} % \end{macro} % \begin{macro}{\LWR@afterendverbatim} Finishes enclosing a verbatim environment. % \begin{macrocode} \newcommand*{\LWR@afterendverbatim}{% % \end{macrocode} % Remove excess vertical space at the end of the |pre|: % \begin{macrocode} \unskip% % \end{macrocode} % At the end of the environment, close the |pre|: % \begin{macrocode} \ifbool{LWR@verbtags}{\noindent\LWR@htmltag{/pre} }{}% % \end{macrocode} % Resume regular paragraph handling: % \begin{macrocode} \LWR@startpars% } % \end{macrocode} % \end{macro} % % % \begin{macro}{\LWR@Verbatimclass} Holds the class of the following verbatim. % % \begin{macrocode} \newcommand*{\LWR@Verbatimclass}{fancyvrb} % \end{macrocode} % \end{macro} % % \begin{environment}{VerbatimClass} \marg{class} \oarg{Verbatim options} % % Creates a \env{Verbatim} enclosed in a \tag{div} of the given class. % \begin{macrocode} \NewDocumentEnvironment{VerbatimClass}{m O{}} {% \renewcommand*{\LWR@Verbatimclass}{#1}% \LWR@origVerbatim[#2]% } {\endVerbatim} % \end{macrocode} % \end{environment} % % After the preamble is loaded, after any patches to \env{Verbatim}: % \begin{macrocode} \AfterEndPreamble{ % \end{macrocode} % % Remember the original defintion of \env{Verbatim}: % \begin{macrocode} \let\LWR@origVerbatim\Verbatim % \end{macrocode} % % % \begin{environment}{Verbatim} % % Patched to place the environment in a |fancyvrb| div, % and the label in a |fancyvrblabel| div. % Also corrects the left margin for line numbers. % Also uses |VerbatimHTMLWidth| to control placement of line numbers on the right. % Aligning the right margin requires knowing the width. % % \changes{v0.20}{2016/12/24}{Added.} % % \begin{macrocode} \renewcommand*{\Verbatim}{% \LWR@forcenewpage \renewcommand*{\LWR@Verbatimclass}{fancyvrb}% \LWR@origVerbatim% } % \end{macrocode} % \end{environment} % % % The following patches to \env{Verbatim} are executed at the % start and end of the environment, depending on the choice of |frame|. % Original code is from the \pkg{fancyvrb} package. % \begin{macrocode} \newcommand*{\LWR@fvstartnone}{% \LWR@traceinfo{fvstartnone}% \ifbool{LWR@verbtags}{\hbox to\z@{\LWR@htmltagc{div class="\LWR@Verbatimclass"}}}{}% \hbox to\z@{\LWR@atbeginverbatim{verbatim}}% } \newcommand*{\LWR@fvendnone}{% \LWR@traceinfo{fvendnone}% \hbox to\z@{\LWR@afterendverbatim}% \ifbool{LWR@verbtags}{\hbox to\z@{\LWR@htmltagc{/div}}}{}% } \newcommand*{\LWR@fvstartsingle}{% \LWR@traceinfo{fvstartsingle}% \LWR@fvstartnone% \FV@BeginListFrame@Single% } \newcommand*{\LWR@fvendsingle}{% \LWR@traceinfo{fvendsingle}% \FV@EndListFrame@Single% \LWR@fvendnone% } \newcommand*{\LWR@fvstartline}{% \LWR@traceinfo{fvstartline}% \LWR@fvstartnone% \FV@BeginListFrame@Lines% } \newcommand*{\LWR@fvendline}{% \LWR@traceinfo{fvendline}% \FV@EndListFrame@Lines% \LWR@fvendnone% } % \end{macrocode} % % The following patches select the start/left/right/end % behaviors depending on |frame|. % Original code is from the \pkg{fancyvrb} package. % \begin{macrocode} \def\FV@Frame@none{% \let\FV@BeginListFrame\LWR@fvstartnone% \let\FV@LeftListFrame\relax% \let\FV@RightListFrame\relax% \let\FV@EndListFrame\LWR@fvendnone} \def\FV@Frame@single{% \let\FV@BeginListFrame\LWR@fvstartsingle% \let\FV@LeftListFrame\FV@LeftListFrame@Single% \let\FV@RightListFrame\FV@RightListFrame@Single% \let\FV@EndListFrame\LWR@fvendsingle} \def\FV@Frame@lines{% \let\FV@BeginListFrame\LWR@fvstartline% \let\FV@LeftListFrame\relax% \let\FV@RightListFrame\relax% \let\FV@EndListFrame\LWR@fvendline} \def\FV@Frame@topline{% \let\FV@BeginListFrame\LWR@fvstartline% \let\FV@LeftListFrame\relax% \let\FV@RightListFrame\relax% \let\FV@EndListFrame\LWR@fvendnone} \def\FV@Frame@bottomline{% \let\FV@BeginListFrame\LWR@fvstartnone% \let\FV@LeftListFrame\relax% \let\FV@RightListFrame\relax% \let\FV@EndListFrame\LWR@fvendline} \def\FV@Frame@leftline{% % To define the \FV@FrameFillLine macro (from \FV@BeginListFrame) \ifx\FancyVerbFillColor\relax% \let\FV@FrameFillLine\relax% \else% \@tempdima\FV@FrameRule\relax% \multiply\@tempdima-\tw@% \edef\FV@FrameFillLine{% {\noexpand\FancyVerbFillColor{\vrule\@width\number\@tempdima sp}% \kern-\number\@tempdima sp}}% \fi% \let\FV@BeginListFrame\LWR@fvstartnone% \let\FV@LeftListFrame\FV@LeftListFrame@Single% \let\FV@RightListFrame\relax% \let\FV@EndListFrame\LWR@fvendnone} % \end{macrocode} % % Adds the optional label to the top and bottom edges. % Original code is from the \pkg{fancyvrb} package. % \begin{macrocode} \def\FV@SingleFrameLine#1{% \hbox to\z@{% % \kern\leftmargin \ifnum#1=\z@\relax \let\FV@Label\FV@LabelBegin \else \let\FV@Label\FV@LabelEnd \fi \ifx\FV@Label\relax % \FancyVerbRuleColor{\vrule \@width\linewidth \@height\FV@FrameRule}% \else \ifnum#1=\z@ % \setbox\z@\hbox{\strut\enspace\FV@LabelBegin\enspace\strut}% \ifx\FV@LabelPositionTopLine\relax \else \LWR@htmltagc{div class="fancyvrblabel"} \LWR@origtextrm{\FV@LabelBegin}% \textrm preserves emdash \LWR@htmltagc{/div} \fi \else % \setbox\z@\hbox{\strut\enspace\FV@LabelEnd\enspace\strut}% \ifx\FV@LabelPositionBottomLine\relax \else \LWR@htmltagc{div class="fancyvrblabel"} \LWR@origtextrm{\FV@LabelEnd} \LWR@htmltagc{/div} \fi \fi \fi \hss } } % \end{macrocode} % % Processes each line, adding optional line numbers. % Original code is from the \pkg{fancyvrb} package. % \begin{macrocode} \def\FV@ListProcessLine#1{% \hbox to \hsize{% % \kern\leftmargin \hbox to \VerbatimHTMLWidth {% \ifcsvoid{FV@LeftListNumber}{}{\kern 2.5em}% \FV@LeftListNumber% % \FV@LeftListFrame \FancyVerbFormatLine{#1}% \hss% % \FV@RightListFrame \FV@RightListNumber% }% \hss% required to avoid underfull hboxes } } % \end{macrocode} % \begin{environment}{BVerbatim} % \begin{macrocode} \AtBeginEnvironment{BVerbatim} { \LWR@forcenewpage \LWR@atbeginverbatim{bverbatim} } \AfterEndEnvironment{BVerbatim} { \leavevmode\par\vspace{-\baselineskip} \LWR@afterendverbatim } % \end{macrocode} % \end{environment} % \begin{environment}{LVerbatim} No changes required. % ^^A \begin{macrocode} % ^^A \AtBeginEnvironment{LVerbatim} % ^^A { % ^^A \LWR@atbeginverbatim{lverbatim} % ^^A \unskip\vspace{-\baselineskip} % ^^A } % ^^A \AfterEndEnvironment{LVerbatim} % ^^A { % ^^A \unskip\vspace{-\baselineskip} % ^^A \LWR@afterendverbatim % ^^A } % ^^A \end{macrocode} % \end{environment} % End of the modifications to make at the end of the preamble: % \begin{macrocode} } % \AfterEndPreamble % \end{macrocode} % % \begin{macro}{\UseVerbatim} \marg{text} % % No changes required. % ^^A \begin{macrocode} % ^^A \let\LWR@origUseVerbatim\UseVerbatim % ^^A % ^^A \renewcommand*{\UseVerbatim}[1]{% % ^^A \LWR@atbeginverbatim{bverbatim}% % ^^A \unskip\vspace{-\baselineskip}% % ^^A \LWR@origUseVerbatim{#1}% % ^^A \unskip% % ^^A \LWR@afterendverbatim% % ^^A } % ^^A \end{macrocode} % \end{macro} % \begin{macrocode} \end{warpHTML} % \end{macrocode} % \section{Theorems} % % \changes{v0.25}{2017/03/17}{Basic \LaTeX\ theorems: improved \CSS.} % % % \DescribeMacro{\newtheorem} \marg{text} \oarg{counter} -or- \oarg{oldname} \marg{text} % % A few minor changes are made to supply \HTML\ tags. % % \begin{itemize} % \item The entire theorem is placed into a div of class |theoremcontents|. % \item The label for each theorem is placed inside a span of class |theoremlabel|. % \item The contents are placed inside a div of class |theoremcontents|. % \end{itemize} % \codehtml % \begin{macrocode} \begin{warpHTML} % \end{macrocode} % \begin{macro}{\@begintheorem} \marg{name} \marg{number} % \begin{macrocode} \renewcommand{\@begintheorem}[2]{% \LWR@forcenewpage \BlockClass{theoremcontents} \InlineClass{theoremlabel}{#1\ #2\ } } % \end{macrocode} % \end{macro} % \begin{macro}{\@opargbegintheorem} \marg{name} \marg{number} \marg{oparg} % \begin{macrocode} \renewcommand{\@opargbegintheorem}[3]{% \LWR@forcenewpage \BlockClass{theoremcontents} \InlineClass{theoremlabel}{#1\ #2\ (#3)\ } } % \end{macrocode} % \end{macro} % \begin{macro}{\@endtheorem} % \begin{macrocode} \renewcommand*{\@endtheorem}{% \endBlockClass% theoremcontents } % \end{macrocode} % \end{macro} % \begin{macrocode} \end{warpHTML} % \end{macrocode} % \section{Lists} % % \limitsbabelone % % \limitsenumitem % % \subsection{Itemize} % \codehtml % \begin{macrocode} \begin{warpHTML} % \end{macrocode} % \begin{macrocode} \let\LWR@origitem\item % \end{macrocode} % \begin{macro}{\LWR@itemizeitem} \oarg{label} % % Handles |\item| inside an itemize or enumerate. % % See |\LWR@openparagraph| where extra |\hspace| is used to % leave room for the label while inside a list during paragraph construction. % \begin{macrocode} \newcommand*{\LWR@itemizeitem}{% \LWR@stoppars% \LWR@startnewdepth{\LWR@depthlistitem}{\LWR@printcloselistitem{}}% \LWR@htmltag{li}% \LWR@startpars% \LWR@origitem% } % \end{macrocode} % \end{macro} % To have a blank item, use |\mbox{}|. % This forces a new line in print output, matching the new line which % will appear in \HTML\ output. % Ex: %\begin{Verbatim}[gobble=2,frame=lines,obeytabs,tabsize=4] %\begin{itemize} %\item \mbox{} % \begin{itemize} % ... %\end{Verbatim} % \begin{environment}{itemize} \oarg{enumitem options} % \begin{macrocode} \AtBeginEnvironment{itemize}{\LWR@itemizestart} \newcommand*{\LWR@itemizestart}{% \LWR@stoppars% \LWR@pushoneclose{\LWR@depthlist}{\LWR@printcloseitemize{}}% \LWR@htmltag{ul style="list-style-type:none"{}}% \LWR@startpars% \let\item\LWR@itemizeitem% } \AtEndEnvironment{itemize}{\LWR@itemizeend} \newcommand*{\LWR@itemizeend}{% \LWR@stoppars% \LWR@closeprevious{\LWR@depthlistitem}% \LWR@closeoneprevious{}% \LWR@startpars% } % \end{macrocode} % \end{environment} % \subsection{Enumerate} % An \HTML\ unordered list is used with customized \LaTeX-generated labels. % \begin{environment}{enumerate} \oarg{enumitem options} % \begin{macrocode} \AtBeginEnvironment{enumerate}{\LWR@enumeratestart} \newcommand*{\LWR@enumeratestart}{% \LWR@stoppars% \LWR@pushoneclose{\LWR@depthlist}{\LWR@printcloseitemize{}}% \LWR@htmltag{ul style="list-style-type:none"{}}% \LWR@startpars% \let\item\LWR@itemizeitem% } \AtEndEnvironment{enumerate}{\LWR@enumerateend} \newcommand*{\LWR@enumerateend}{% \LWR@stoppars% \LWR@closeprevious{\LWR@depthlistitem}% \LWR@closeoneprevious{}% \LWR@startpars% } % \end{macrocode} % \end{environment} % \subsection{Description} % \begin{macro}{\LWR@descitem} \oarg{label} % Handles an |\item| inside a description. % \begin{macrocode} \newcommand*{\LWR@descitem}[1][]% {% \LWR@stoppars% \LWR@setlatestname{#1}% \LWR@startnewdepth{\LWR@depthlistitem}{\LWR@printclosedescitem{}}% \LWR@origitem[]% % \end{macrocode} % Be sure the label doesn't print to the left of the rest of the file: % \begin{macrocode} \LWR@orighspace{1in} \LWR@htmltag{dt}#1\LWR@htmltag{/dt}% \LWR@orignewline% \LWR@htmltag{dd}% \LWR@startpars% } % \end{macrocode} % \end{macro} % \begin{environment}{description} \oarg{enumitem options} % \begin{macrocode} \AtBeginEnvironment{description}{\LWR@descriptionstart} \newcommand*{\LWR@descriptionstart}{% \LWR@stoppars% \LWR@pushoneclose{\LWR@depthlist}{\LWR@printclosedescription{}}% \LWR@htmltag{dl}% \LWR@startpars% \let\item\LWR@descitem% } \AtEndEnvironment{description}{\LWR@descriptionend} \newcommand*{\LWR@descriptionend}{% \LWR@stoppars% \LWR@closeprevious{\LWR@depthlistitem}% \LWR@closeoneprevious{}% \LWR@startpars% } % \end{macrocode} % \end{environment} % \begin{macro}{\newlist} \marg{name} \marg{type} \marg{maxdepth} % \begin{macro}{\renewlist} \marg{name} \marg{type} \marg{maxdepth} % % For \pkg{enumitem} lists, new lists must have the start and end actions assigned to % the new environment. Renewed lists already have their actions assigned, and % thus need no changes. % \begin{macrocode} \let\LWR@orignewlist\newlist \renewcommand*{\newlist}[3]{% \LWR@orignewlist{#1}{#2}{#3}% \AtBeginEnvironment{#1}{\csuse{LWR@#2start}}% \AtEndEnvironment{#1}{\csuse{LWR@#2end}}% } % \end{macrocode} % \end{macro} % \end{macro} % \begin{macrocode} \end{warpHTML} % \end{macrocode} % \section{Tabular} % % This is arguably the most complicated part of the entire package. % Numerous tricks are employed to handle the syntax which is involved. % % Limitations: % \limitstabular % % \changes{v0.20}{2017/01/07}{Added @, \protect\textless, \protect\textgreater\ columns.} % \changes{v0.20}{2017/01/17}{Tabular: \cs{unskip} extra spaces.} % % \subsection{Token lookahead} % Used by |\LWR@futurenonspacelet| to look at the next token. % \codehtml % \begin{macrocode} \begin{warpHTML} % \end{macrocode} % \begin{macro}{\LWR@mynexttoken} % \begin{macrocode} \newcommand\LWR@mynexttoken\relax % \end{macrocode} % \end{macro} % |\futurelet| copies the next token then executes a function to analyze % |\LWR@futurenonspacelet| does the same, but ignores intervening white space % Based on the \pkg{booktabs} style: % \begin{macro}{\LWR@futurenonspacelet} % \begin{macrocode} \def\LWR@futurenonspacelet#1{\def\LWR@cs{#1}% \afterassignment\LWR@fnslone\let\nexttoken= } \def\LWR@fnslone{\expandafter\futurelet\LWR@cs\LWR@fnsltwo} \def\LWR@fnsltwo{% \expandafter\ifx\LWR@cs\@sptoken\let\next=\@BTfnslthree% \else\let\next=\nexttoken\fi\next} \def\@BTfnslthree{\afterassignment\LWR@fnslone\let\next= } % \end{macrocode} % \end{macro} % \begin{macro}{\LWR@getmynexttoken} % Looks ahead and copies the next token into |\LWR@mynexttoken|. % \begin{macrocode} \newcommand*{\LWR@getmynexttoken}{% % nothing must follow this next line \LWR@futurenonspacelet\LWR@mynexttoken\LWR@tabledatacolumntag } % \end{macrocode} % \end{macro} % \subsection{Booleans} % \DescribeBoolean{LWR@startedrow} % True if should print a row tag before this column. % \begin{macrocode} \newbool{LWR@startedrow} \boolfalse{LWR@startedrow} % \end{macrocode} % \DescribeBoolean{LWR@doinghline} % True if the next row will have an hline above it. % \begin{macrocode} \newbool{LWR@doinghline} \boolfalse{LWR@doinghline} % \end{macrocode} % \DescribeBoolean{LWR@doingtbrule} % True if the next row will have a top/bottom rule above it. % \begin{macrocode} \newbool{LWR@doingtbrule} \boolfalse{LWR@doingtbrule} % \end{macrocode} % \DescribeBoolean{LWR@tableparcell} % True if are handling a paragraph inside a table cell, % so must close the paragraph tag before moving on. % \begin{macrocode} \newbool{LWR@tableparcell} % \end{macrocode} % \DescribeBoolean{LWR@skippingmrowcell} % True if are doing an empty multi-row cell, % and thus there is no data tag to close. % \begin{macrocode} \newbool{LWR@skippingmrowcell} % \end{macrocode} % \DescribeBoolean{LWR@intabularmetadata} % True if are in a tabular but not in a data cell. % Used to prevent extra \HTML\ breaks if not inside table data. % \begin{macrocode} \newbool{LWR@intabularmetadata} \boolfalse{LWR@intabularmetadata} % \end{macrocode} % \subsection{Handling \& and !} % % \begin{minipage}{\linewidth} % For technical discussion regarding problems redefining |\&|, See: \\ % \href{http://tex.stackexchange.com/questions/11638/where-do-i-find-futurelets-nasty-behaviour-documented/11860#11860} % {http://tex.stackexchange.com/questions/11638/ \\ \hspace*{.25in} where-do-i-find-futurelets-nasty-behaviour-documented/11860\#11860} % \end{minipage} % % \begin{macro}{\LWR@closetabledatacell} % If |LWR@skippingmrowcell| then there is no data tag to close. % Otherwise, close any paragraphs, then close the data tag. % \begin{macrocode} \newcommand*{\LWR@closetabledatacell}{% \global\booltrue{LWR@intabularmetadata}% \ifbool{LWR@exitingtabular}{}% {% not exiting tabular \ifbool{LWR@skippingmrowcell}{}% {% not skippingmrowcell % \end{macrocode} % Insert any |<| then any |@| and |!| column contents: % \begin{macrocode} \unskip% \LWR@getexparray{LWR@colafterspec}{\theLWR@tablecolspos}% \LWR@getexparray{LWR@colatspec}{\theLWR@tablecolspos}% \LWR@getexparray{LWR@colbangspec}{\theLWR@tablecolspos}% % \end{macrocode} % Close paragraphs: % \begin{macrocode} \ifbool{LWR@tableparcell}{\LWR@stoppars}{}% \global\boolfalse{LWR@tableparcell}% % \end{macrocode} % Close the table data cell: % \begin{macrocode} \unskip\LWR@htmltag{/td}\LWR@orignewline% }% not skipping mrowcell }% not exiting tabular \global\boolfalse{LWR@skippingmrowcell}% } % \end{macrocode} % \end{macro} % |LWR@tabulardepth| tracks whether |&| is being used inside a \env{tabular}. % \begin{macrocode} \newcounter{LWR@tabulardepth} \setcounter{LWR@tabulardepth}{0} % \end{macrocode} % When not used inside a \env{tabular}, |&| performs its original % function as recorded here ( with catcode 4 ). % \begin{macrocode} \def\LWR@origampmacro{&} % \end{macrocode} % See below for why the group is used. % \begin{macrocode} \begingroup % \end{macrocode} % % \changes{v0.15}{2016/03/31}{Ampersand (\&): Fixed handling when passed as an argument.} % % \begin{macro}{&} Will behave depending on whether it is being used inside \env{tabular}. % % |&| is redefined to test whether it is inside a tabular environment, % in which case it performs special processing for \HTML\ conversion. % If not, it behaves normally. % % The |\catcode| allows the |&| character to be redefined. % \begin{macrocode} \catcode`\&=\active \gdef&{% \ifthenelse{\cnttest{\value{LWR@tabulardepth}}{>}{0}}% {% % \end{macrocode} % If not skipping a multirow cell, close the current data cell. % \begin{macrocode} \unskip% \LWR@closetabledatacell% % \end{macrocode} % Move to the next column. % \begin{macrocode} \addtocounter{LWR@tablecolspos}{1}% % \end{macrocode} % Look at the next token to decide multi or single column data tag. % \begin{macrocode} \LWR@getmynexttoken% }% % \end{macrocode} % If not inside a tabular, performs the original action: % \begin{macrocode} {\LWR@origampmacro}% } \endgroup % \end{macrocode} % Outside the group, |&| is left its original catcode for now. % % \pkg{tikz} package seems to require |&| be left alone until after % \pkg{tikz} has been loaded. % % \cs{LWR@lwarpStart} finally makes |&| active at the beginning of the % \HTML\ conversion. % \end{macro} % % \subsection{Handling \protect\textbackslash\protect\textbackslash} % Inside tabular, |\\| is redefined to |\LWR@tabularendofline| % % Throws away options |\\[dim]| or |\\*| % % \begin{macro}{\LWR@tabularendofline} % \begin{macrocode} \NewDocumentCommand{\LWR@tabularendofline}{s o} {% \LWR@closetabledatacell% % \end{macrocode} % Finish the previous row: % \begin{macrocode} \LWR@htmltag{/tr}\LWR@orignewline \global\booltrue{LWR@intabularmetadata} % \end{macrocode} % Not yet started a table row: % \begin{macrocode} \global\boolfalse{LWR@startedrow} % \end{macrocode} % Additional setup: % \begin{macrocode} \global\boolfalse{LWR@doinghline}% \global\boolfalse{LWR@doingtbrule}% \LWR@clearmidrules% % \end{macrocode} % Start at first column: % \begin{macrocode} \setcounter{LWR@tablecolspos}{1} % \end{macrocode} % Look at the next token to decide between single column data tag % or a special case: % \begin{macrocode} \LWR@getmynexttoken% } % \end{macrocode} % \end{macro} % \subsection{Variables} % \begin{macrocode} \newcommand*{\LWR@colsresult}{}%temp storage for column format results \newcommand*{\LWR@pposition}{} \newcommand*{\LWR@pleft}{} \newcommand*{\LWR@pright}{} % \end{macrocode} % \begin{macro}{\LWR@tablecolspec} Holds the parsed column specification, % of total width |LWR@tabletotalcols|. % % Will contain a string such as |llrrccpc|, exactly one letter per column, % without |@|, |>|, |<|, or the vertical pipe. % \begin{macrocode} \newcommand*{\LWR@tablecolspec}{} % \end{macrocode} % \end{macro} % \begin{macro}{\LWR@strresult} Holds the result of |Str| functions. % \begin{macrocode} \newcommand*{\LWR@strresult}{} % \end{macrocode} % \end{macro} % \begin{macro}{\LWR@origcolspec} Holds the original column specs given to \env{tabular}. % \begin{macrocode} \newcommand*{\LWR@origcolspec}{} % \end{macrocode} % \end{macro} % \DescribeCounter{LWR@tablecolswidth} % Holds the width of the table specification. % % (This is not the total \# columns.) % \begin{macrocode} \newcounter{LWR@tablecolswidth} % \end{macrocode} % \DescribeCounter{LWR@tablecolspos} % Where are currently looking into the table column specification. % \begin{macrocode} \newcounter{LWR@tablecolspos} % \end{macrocode} % \DescribeCounter{LWR@tabletotalcols} % Holds the final number of table columns. % \begin{macrocode} \newcounter{LWR@tabletotalcols} % \end{macrocode} % \DescribeCounter{LWR@tabletotalcolsnext} % Holds the next column while parsing. % Is one more than |LWR@tabletotalcols|. % \begin{macrocode} \newcounter{LWR@tabletotalcolsnext} % \end{macrocode} % \DescribeObject{LWR@colatspec}A data array of specifications for |@| columns. % The leftmost's index is |leftedge|, the others are counter values. % See \cref{sec:dataarray}. % % \DescribeObject{LWR@colbangspec}A data array of specifications for |!| columns. % The leftmost's index is |leftedge|, the others are counter values. % See \cref{sec:dataarray}. % % \DescribeObject{LWR@colbeforespec}A data array of specifications for |>| columns. % % \DescribeObject{LWR@colafterspec}A data array of specifications for |<| columns. % \subsection{Parsing @, >, <, ! columns} % % \begin{macro}{\LWR@parseatcolumn} % % Handles |@{text}| columns. % % \begin{macrocode} \newcommand*{\LWR@parseatcolumn}{% % \end{macrocode} % Move to the next token after the '@': % \begin{macrocode} \LWR@traceinfo{at column}% \addtocounter{LWR@tablecolspos}{1}% % \end{macrocode} % Read the next token into \cs{LWR@strresult}, expanding once: % \begin{macrocode} \LWR@traceinfo{about to read the next token:}% \expandarg% \StrChar{\LWR@origcolspec}{\theLWR@tablecolspos}[\LWR@strresult] \fullexpandarg% % \end{macrocode} % Store the result into a data array, expanding once out of \cs{LWR@strresult}: % \begin{macrocode} \LWR@traceinfo{have now read the next token}% \ifthenelse{\cnttest{\value{LWR@tabletotalcols}}=0} {% left edge of the table: \LWR@traceinfo{at the left edge}% \LWR@setexparray{LWR@colatspec}{leftedge}{\LWR@strresult}% }% {% not at the left edge: \LWR@traceinfo{not at the left edge}% \LWR@setexparray{LWR@colatspec}{\theLWR@tabletotalcols}{\LWR@strresult}% \LWR@traceinfo{at \theLWR@tabletotalcols: % \LWR@getexparray{LWR@colatspec}{\theLWR@tabletotalcols})!}% \let\LWR@strresult\relax% \booltrue{LWR@validtablecol}% }% } % \end{macrocode} % \end{macro} % % % \begin{macro}{\LWR@parsebangcolumn} % % \changes{v0.22}{2017/02/28}{Added tabular \texttt{!!} column.} % % \begin{macrocode} \newcommand*{\LWR@parsebangcolumn}{% % \end{macrocode} % Move to the next token after the '!': % \begin{macrocode} \LWR@traceinfo{bang column}% \addtocounter{LWR@tablecolspos}{1}% % \end{macrocode} % Read the next token into \cs{LWR@strresult}, expanding once: % \begin{macrocode} \LWR@traceinfo{about to read the next token:}% \expandarg% \StrChar{\LWR@origcolspec}{\theLWR@tablecolspos}[\LWR@strresult] \fullexpandarg% % \end{macrocode} % Store the result into a data array, expanding once out of \cs{LWR@strresult}: % \begin{macrocode} \LWR@traceinfo{have now read the next token}% \ifthenelse{\cnttest{\value{LWR@tabletotalcols}}=0} {% left edge of the table: \LWR@traceinfo{at the left edge}% \LWR@setexparray{LWR@colbangspec}{leftedge}{\LWR@strresult}% }% {% not at the left edge: \LWR@traceinfo{not at the left edge}% \LWR@setexparray{LWR@colbangspec}{\theLWR@tabletotalcols}{\LWR@strresult}% \LWR@traceinfo{bang \theLWR@tabletotalcols: \LWR@colbangspec(\theLWR@tabletotalcols)!}% }% \let\LWR@strresult\relax% \booltrue{LWR@validtablecol}% } % \end{macrocode} % \end{macro} % % % % \begin{macro}{\LWR@parsebeforecolumn} % % Handles |>{text}| columns. % % \begin{macrocode} \newcommand*{\LWR@parsebeforecolumn}{% % \end{macrocode} % Move to the next token after the '>': % \begin{macrocode} \addtocounter{LWR@tablecolspos}{1}% % \end{macrocode} % Read the next token, expanding once into \cs{LWR@strresult}: % \begin{macrocode} \expandarg% \StrChar{\LWR@origcolspec}{\theLWR@tablecolspos}[\LWR@strresult]% \fullexpandarg% % \end{macrocode} % Store the result into a data array, expanding once out of \cs{LWR@strresult}: % \begin{macrocode} \LWR@setexparray{LWR@colbeforespec}{\theLWR@tabletotalcolsnext}{\LWR@strresult}% \let\LWR@strresult\relax% \booltrue{LWR@validtablecol}% } % \end{macrocode} % \end{macro} % % \begin{macro}{\LWR@parseaftercolumn} % % Handles |<{text}| columns. % % \begin{macrocode} \newcommand*{\LWR@parseaftercolumn}{% % \end{macrocode} % Move to the next token after the '<': % \begin{macrocode} \addtocounter{LWR@tablecolspos}{1}% % \end{macrocode} % Read the next token, expanding once into \cs{LWR@strresult}: % \begin{macrocode} % \StrChar{#1}{\theLWR@tablecolspos}[\LWR@strresult] \expandarg% \StrChar{\LWR@origcolspec}{\theLWR@tablecolspos}[\LWR@strresult]% \fullexpandarg% % \end{macrocode} % Store the result into a data array, expanding once out of \cs{LWR@strresult}: % \begin{macrocode} \LWR@setexparray{LWR@colafterspec}{\theLWR@tabletotalcols}{\LWR@strresult}% \let\LWR@strresult\relax% \booltrue{LWR@validtablecol}% } % \end{macrocode} % \end{macro} % % \begin{macro}{\LWR@parseskipcolumn} % % Handles columns to skip, such as the vertical bar. % % \begin{macrocode} \newcommand*{\LWR@parseskipcolumn}{% \booltrue{LWR@validtablecol}% } % \end{macrocode} % \end{macro} % % % \subsection{Parsing `l', `c', or `r' columns} % % \begin{macro}{\LWR@parsenormalcolumn} \marg{thiscolumn} % % Add to the accumulated column specs, advance counters, % and pre-clear another column of at, before, and after specs. % \begin{macrocode} \newcommand*{\LWR@parsenormalcolumn}[1]{% \appto\LWR@tablecolspec{#1}% \addtocounter{LWR@tabletotalcols}{1}% \addtocounter{LWR@tabletotalcolsnext}{1}% \LWR@setexparray{LWR@colatspec}{\theLWR@tabletotalcolsnext}{\relax}% \LWR@setexparray{LWR@colbangspec}{\theLWR@tabletotalcolsnext}{\relax}% \LWR@setexparray{LWR@colbeforespec}{\theLWR@tabletotalcolsnext}{\relax}% \LWR@setexparray{LWR@colafterspec}{\theLWR@tabletotalcolsnext}{\relax}% \booltrue{LWR@validtablecol}% } % \end{macrocode} % \end{macro} % \subsection{Parsing `p', `m', or `b' columns} % % \begin{macro}{\LWR@parsepcolumn} \marg{thiscolumn} % The width will be ignored. % \begin{macrocode} \newcommand*{\LWR@parsepcolumn}[1]{% % \end{macrocode} % Converts to the given column type. % \begin{macrocode} \LWR@parsenormalcolumn{#1}% % \end{macrocode} % skips the following width % \begin{macrocode} \addtocounter{LWR@tablecolspos}{1}% } % \end{macrocode} % \end{macro} % \subsection{Parsing `D' columns} % % From the \pkg{dcolumn} package. % % \begin{macro}{\LWR@parseDcolumn} \marg{thiscolumn} % The three parameters will be ignored. % % \changes{v0.22}{2017/02/24}{Added tabular \texttt{D} column.} % % \begin{macrocode} \newcommand*{\LWR@parseDcolumn}[1]{% % \end{macrocode} % Converts to the given column type. % \begin{macrocode} \LWR@parsenormalcolumn{#1}% % \end{macrocode} % Skips the following three parameters. % \begin{macrocode} \addtocounter{LWR@tablecolspos}{3}% } % \end{macrocode} % \end{macro} % \subsection{Parsing the column specifications} % \HTML\ \CSS\ cannot exactly match the \LaTeX{} concept of a baseline for % a table row. % \watchout % \Cref{tab:baseline} shows the \LaTeX{} results for various % vertical-alignment choices, with the baseline of the first column drawn across % all the columns for comparison. % See the |p| column specification in \cref{tab:columnconversions} for details. % % \begin{table} % \caption{Tabular baseline\label{tab:baseline}} % \index{tabular>baseline}\index{baseline>tabular} % \centering % \smallskip % \begin{tabular}{lp{.25in}m{.25in}b{.25in}r} % \toprule % l & p & m & b & r \\ % \midrule % l \rule{1.65in}{.4pt} \hspace{-1.4in} & % par \newline par \newline par & % mid \newline mid \newline mid & % bot \newline bot \newline bot & % r \\ % \bottomrule % \end{tabular} % \end{table} % % \Cref{tab:columnconversions} describes how each kind of column is % converted to \HTML. % % \begin{table} % \caption{Tabular \HTML\ column conversions\label{tab:columnconversions}} % \index{tabular>HTML colummn conversion} % \index{HTML>tabular column conversion} % % \medskip % % \hrule % \begin{description}[parsep=.5ex] % \item [l, r, c:] Converted to table cells without paragraph tags. \\ % Uses \CSS\ |vertical-align:middle| so that top or bottom-aligned cells may go above or below this cell. % \item [p:] Converted to table cells with paragraph tags. % Ref: \Cref{tab:baseline}, % \LaTeX{} places the top line of a parbox % aligned with the rest of the text line, so \CSS\ |vertical-align:bottom| is used to % have the \HTML\ result appear with the paragraph extending below the L, R, C cells at the middle, if possible. % This may be confusing as a P cell may not top-align with an L,R,C cell in the \HTML\ % conversion, especially in the presence of a B cell, and two P cells side-by-side will % be aligned at the bottom instead of the top. % Some adjustment of the \CSS\ may be desired, changing % |td.tdp|, |td.tdP|, |td.tdprule|, and |td.tdPrule| to |vertical-align: middle|. % Another possibility is to change L,R,C, and P to |vertical-align: top| and not worry % about the alignment of B and M cells or trying to approximate \LaTeX{} baselines. % \item [m:] With paragraph tags, \CSS\ |vertical-align:middle|. % \item [b:] With paragraph tags, \CSS\ |vertical-align:top| so that the bottom of the % text is closest to the middle of the text line. % \item [P, M, B:] Horizontally-centered versions. % \item [S:] Converted to 'r'. From the \pkg{siunitx} package. % \item [D:] Converted to 'c'. From the \pkg{dcolumn} package. % \item [@, !, \textgreater{}, \textless{}:] One each, in that order. % \item [Unknown:] Converted to 'l'. % \item [\cs{newcolumn}:] Currently treated as unknown. % \end{description} % \hrule % \end{table} % % % \DescribeBoolean{LWR@validtablecol} True if found a valid table column type. % \begin{macrocode} \newbool{LWR@validtablecol} % \end{macrocode} % % % % \begin{macro}{\LWR@parsetablecols} \marg{colspecs} % % Scans the column specification left to right. % % Builds \cs{LWR@tablecolspec} with the final specification, % one column per entry. The number of final columns is % stored in |LWR@tabletotalcols|. % % \changes{v0.22}{2017/02/28}{Unknown table column types become \texttt{l}. % Added tabular \texttt{D}, \texttt{!!}, \texttt{X} columns.} % % \changes{v0.23}{2017/03/02}{Fix for vert bar column type.} % \changes{v0.28}{2017/04/11}{Added L, C, R, J column types.} % % \begin{macrocode} \newcommand*{\LWR@parsetablecols}[1]{% \LWR@traceinfo{LWR@parsetablecols started}% % \end{macrocode} % Remember the original supplied column spec: % \begin{macrocode} \renewcommand*{\LWR@origcolspec}{#1}% % \end{macrocode} % Clear the parsed resulting column spec: % \begin{macrocode} \renewcommand*{\LWR@tablecolspec}{}% % \end{macrocode} % Total number of columns found so far. % Also pre-initialize the first several columns of specs: % \begin{macrocode} \setcounter{LWR@tabletotalcols}{0}% \setcounter{LWR@tabletotalcolsnext}{1}% \LWR@setexparray{LWR@colatspec}{leftedge}{\relax}% \LWR@setexparray{LWR@colatspec}{1}{\relax}% \LWR@setexparray{LWR@colatspec}{2}{\relax}% \LWR@setexparray{LWR@colatspec}{3}{\relax}% \LWR@setexparray{LWR@colbangspec}{leftedge}{\relax}% \LWR@setexparray{LWR@colbangspec}{1}{\relax}% \LWR@setexparray{LWR@colbangspec}{2}{\relax}% \LWR@setexparray{LWR@colbangspec}{3}{\relax}% \LWR@setexparray{LWR@colbeforespec}{1}{\relax}% \LWR@setexparray{LWR@colbeforespec}{2}{\relax}% \LWR@setexparray{LWR@colbeforespec}{3}{\relax}% \LWR@setexparray{LWR@colafterspec}{1}{\relax}% \LWR@setexparray{LWR@colafterspec}{2}{\relax}% \LWR@setexparray{LWR@colafterspec}{3}{\relax}% % \end{macrocode} % Starting at the first column specification: % \begin{macrocode} \setcounter{LWR@tablecolspos}{1}% % \end{macrocode} % Place the colspecs string length into \cs{LWR@strresult}, % and remember the number of characters in the column specification: % \begin{macrocode} \LWR@traceinfo{about to StrLen}% \noexpandarg% \StrLen{#1}[\LWR@strresult]% \fullexpandarg% \LWR@traceinfo{finished StrLen}% \setcounter{LWR@tablecolswidth}{\LWR@strresult}% % \end{macrocode} % Scan through the column specifications: % \begin{macrocode} \whiledo{\not\value{LWR@tablecolspos}>\value{LWR@tablecolswidth}}{% % \end{macrocode} % Place the next single-character column type into \cs{LWR@strresult}: % \begin{macrocode} \noexpandarg% \StrChar{#1}{\theLWR@tablecolspos}[\LWR@strresult]% \fullexpandarg% % \end{macrocode} % Not yet found a valid column type % \begin{macrocode} \boolfalse{LWR@validtablecol}% % \end{macrocode} % Note that the parameter for a |p{spec}| column is a token list which will NOT match l,c,r,p. % \watchout % \begin{macrocode} \IfStrEq{\LWR@strresult}{l}{\LWR@parsenormalcolumn{l}}{}% \IfStrEq{\LWR@strresult}{c}{\LWR@parsenormalcolumn{c}}{}% \IfStrEq{\LWR@strresult}{r}{\LWR@parsenormalcolumn{r}}{}% \IfStrEq{\LWR@strresult}{L}{\LWR@parsenormalcolumn{l}}{}% \IfStrEq{\LWR@strresult}{C}{\LWR@parsenormalcolumn{c}}{}% \IfStrEq{\LWR@strresult}{R}{\LWR@parsenormalcolumn{r}}{}% \IfStrEq{\LWR@strresult}{J}{\LWR@parsenormalcolumn{l}}{}% \IfStrEq{\LWR@strresult}{S}{\LWR@parsenormalcolumn{r}}{}% \IfStrEq{\LWR@strresult}{\detokenize{@}}{\LWR@parseatcolumn}{}% \IfStrEq{\LWR@strresult}{!}{\LWR@parsebangcolumn}{}% \IfStrEq{\LWR@strresult}{>}{\LWR@parsebeforecolumn}{}% \IfStrEq{\LWR@strresult}{<}{\LWR@parseaftercolumn}{}% \IfStrEq{\LWR@strresult}{|}{\LWR@parseskipcolumn}{}% \IfStrEq{\LWR@strresult}{p}{\LWR@parsepcolumn{p}}{}% \IfStrEq{\LWR@strresult}{m}{\LWR@parsepcolumn{m}}{}% \IfStrEq{\LWR@strresult}{b}{\LWR@parsepcolumn{b}}{}% % \end{macrocode} % From the \pkg{dcolumn} package: % \begin{macrocode} \IfStrEq{\LWR@strresult}{D}{\LWR@parseDcolumn{c}}{}% % \end{macrocode} % From the \pkg{tabularx} package. % X column has no parameter, but will be given paragraph tags. % \begin{macrocode} \IfStrEq{\LWR@strresult}{X}{\LWR@parsenormalcolumn{X}}{}% % \end{macrocode} % \begin{docsidebar} % \raggedright % Many people define centered versions ``|P|'', ``|M|'', and ``|B|'': \\ % \hspace*{1em}|\newcolumntype{P}[1]{>{\centering\arraybackslash}p{#1}}| % \end{docsidebar} % \begin{macrocode} \IfStrEq{\LWR@strresult}{P}{\LWR@parsepcolumn{P}}{}% \IfStrEq{\LWR@strresult}{M}{\LWR@parsepcolumn{M}}{}% \IfStrEq{\LWR@strresult}{B}{\LWR@parsepcolumn{B}}{}% % \end{macrocode} % If this column was an invalid column type, convert it to a |p| column: % \begin{macrocode} \ifbool{LWR@validtablecol}{}{% \LWR@parsenormalcolumn{l}% }% \addtocounter{LWR@tablecolspos}{1}% }% }% % \end{macrocode} % \end{macro} % \subsection{Starting a new row} % \begin{macro}{\LWR@maybenewtablerow} % % If have not yet started a new table row, begin one now. % Creates a new row tag, adding a class for |hline| or |tbrule| if % necessary. % \begin{macrocode} \newcommand*{\LWR@maybenewtablerow} {% \ifbool{LWR@startedrow}% {}% started the row {% not started the row % \end{macrocode} % Remember that now have started the row: % \begin{macrocode} \global\booltrue{LWR@startedrow}% % \end{macrocode} % Create the row tag, with a class if necessary. % \begin{macrocode} \global\booltrue{LWR@intabularmetadata}% \ifbool{LWR@doinghline}% {\LWR@htmltag{tr class="hline"{}}\LWR@orignewline}% {% not doing hline \ifbool{LWR@doingtbrule}% {\LWR@htmltag{tr class="tbrule"{}}\LWR@orignewline}% {\LWR@htmltag{tr}\LWR@orignewline}% }% end of not doing hline }% end of not started the row } % \end{macrocode} % \end{macro} % \subsection{Data opening tag} % \begin{macro}{\LWR@tabledatasinglecolumntag} % Print a table data opening tag with style for alignment % \begin{macrocode} \newcommand*{\LWR@tabledatasinglecolumntag}% {% \LWR@maybenewtablerow% % \end{macrocode} % If have found the end of tabular command, do not create the next data cell: % \begin{macrocode} \ifbool{LWR@exitingtabular}{}% {% not exiting tabular % \end{macrocode} % Fetch the current column's alignment character into |\LWR@strresult|: % \begin{macrocode} \StrChar{\LWR@tablecolspec}{\theLWR@tablecolspos}[\LWR@strresult]% % \end{macrocode} % print the start of a new table data cell: % \begin{macrocode} \LWR@htmltag{td class="td% % \end{macrocode} % append this column's spec: % \begin{macrocode} \LWR@strresult% % \end{macrocode} % If this column has a cmidrule, add ``rule'' to the end of the \HTML\ class tag: % \begin{macrocode} \ifthenelse{\equal{\LWR@getexparray{LWR@midrules}{\theLWR@tablecolspos}}{Y}}{rule}{}% "{}}% % \end{macrocode} % If this is a p, m, b, or X column, allow paragraphs: % \begin{macrocode} \ifthenelse{% \equal{\LWR@strresult}{p}\OR% \equal{\LWR@strresult}{m}\OR% \equal{\LWR@strresult}{b}\OR% \equal{\LWR@strresult}{P}\OR% \equal{\LWR@strresult}{M}\OR% \equal{\LWR@strresult}{B}\OR% \equal{\LWR@strresult}{X}% }% {% allow pars \LWR@startpars% \global\booltrue{LWR@tableparcell}% }% allow pars {}% no pars % \end{macrocode} % Print the |@| and |!| contents before first column, % and then the |>| contents: % \begin{macrocode} \ifthenelse{\cnttest{\value{LWR@tablecolspos}}=1}% {% \LWR@getexparray{LWR@colatspec}{leftedge}% \LWR@getexparray{LWR@colbangspec}{leftedge}% }% left edge {}% not left edge \LWR@getexparray{LWR@colbeforespec}{\theLWR@tablecolspos}% \global\boolfalse{LWR@intabularmetadata}% }% not exiting tabular }% % \end{macrocode} % \end{macro} % \subsection{Midrules} % % \DescribeObject{LWR@midrules}|LWR@midrules| is a data array % (\cref{sec:dataarray}) of columns containing % |Y| if a midrule should be created for each column. % \DescribeCounter{LWR@midrulecounter} % Indexes across the |LWR@midrules| data array. % \begin{macrocode} \newcounter{LWR@midrulecounter} % \end{macrocode} % \begin{macro}{\LWR@clearmidrules} % Start new midrules. Called at beginning of tabular and also at |\\|. % % Clears all |LWR@midrules| markers for this line. % \begin{macrocode} \newcommand*{\LWR@clearmidrules} {% \setcounter{LWR@midrulecounter}{1}% \whiledo{% \cnttest{\value{LWR@midrulecounter}}{<=}{\value{LWR@tablecolswidth}}% }% {% \LWR@setexparray{LWR@midrules}{\theLWR@midrulecounter}{\relax}% \addtocounter{LWR@midrulecounter}{1}% }% } % \end{macrocode} % \end{macro} % \begin{macro}{\LWR@subcmidrule} \oarg{width} \marg{trim} \marg{leftcolumn} \marg{rightcolumn} % % Marks |LWR@midrules| data array elements to be ``Y'' from left to right columns. % \begin{macrocode} \newcommand*{\LWR@subcmidrule}[4]{% \setcounter{LWR@midrulecounter}{#3}% \whiledo{\cnttest{\value{LWR@midrulecounter}}{<=}{#4}}% {% \LWR@setexparray{LWR@midrules}{\theLWR@midrulecounter}{Y}% \addtocounter{LWR@midrulecounter}{1}% }% end of the whiledo } % \end{macrocode} % \end{macro} % \begin{macro}{\LWR@docmidrule} \oarg{width} \marg{trim} \marg{leftcolumn-rightcolumn} % % Marks |LWR@midrules| array elements to be ``Y'' from left to right columns. % % \begin{macrocode} \NewDocumentCommand{\LWR@docmidrule}{o d() >{\SplitArgument{1}{-}}m}% {\LWR@subcmidrule{#1}{#2}#3} % \end{macrocode} % \end{macro} % \subsection{Multicolumns} % \subsubsection{Parsing multicolumns} % \begin{macrocode} \newcounter{LWR@tablemulticolswidth} \newcounter{LWR@tablemulticolspos} % \end{macrocode} % \begin{macro}{\LWR@printmccoltype} \marg{colspec} % Print any valid column type found. Does not print |@|, |>|, or |<| columns % or their associated tokens. % % This is printed as part of the table data tag's |class|. % \begin{macrocode} \newcommand*{\LWR@printmccoltype}[1]{% \LWR@traceinfo{lwr@printmccoltype -#1-}% % \end{macrocode} % Get one token of the column spec: % \begin{macrocode} \StrChar{#1}{\theLWR@tablemulticolspos}[\LWR@strresult]% % \end{macrocode} % Add to the \HTML\ tag depending on which column type is found: % \begin{macrocode} \IfStrEq{\LWR@strresult}{l}{l}{}% \IfStrEq{\LWR@strresult}{c}{c}{}% \IfStrEq{\LWR@strresult}{r}{r}{}% \IfStrEq{\LWR@strresult}{p}{p}{}% \IfStrEq{\LWR@strresult}{m}{m}{}% \IfStrEq{\LWR@strresult}{b}{b}{}% \IfStrEq{\LWR@strresult}{P}{P}{}% \IfStrEq{\LWR@strresult}{M}{M}{}% \IfStrEq{\LWR@strresult}{B}{B}{}% \IfStrEq{\LWR@strresult}{S}{r}{}% \IfStrEq{\LWR@strresult}{X}{p}{}% \LWR@traceinfo{lwr@printmccoltype done}% } % \end{macrocode} % \end{macro} % \begin{macro}{\LWR@multicolpartext} % Print the data with paragraph tags: % \begin{macrocode} \newcommand*{\LWR@multicolpartext}{% \LWR@startpars% \LWR@multicoltext% \LWR@stoppars% } % \end{macrocode} % \end{macro} % \begin{macro}{\LWR@multicolother} \marg{colspec} % For |@|, |>|, |<|, print the next token without paragraph tags: % \begin{macrocode} \newcommand*{\LWR@multicolother}[1]{% \addtocounter{LWR@tablemulticolspos}{1}% \StrChar{#1}{\theLWR@tablemulticolspos}[\LWR@strresult]% \LWR@strresult% % \end{macrocode} % A valid column data type was found: % \begin{macrocode} \booltrue{LWR@validtablecol}% } % \end{macrocode} % \end{macro} % \begin{macro}{\LWR@multicolskip} % Nothing to print for this column type. % \begin{macrocode} \newcommand*{\LWR@multicolskip}{% % \end{macrocode} % A valid column data type was found: % \begin{macrocode} \booltrue{LWR@validtablecol}% } % \end{macrocode} % \end{macro} % \begin{macro}{\LWR@printmccoldata} \marg{colspec} % Print the data for any valid column type found. % % \changes{v0.22}{2017/02/28}{Added tabular \texttt{D}, \texttt{!!}, % and \texttt{X} columns.} % % \changes{v0.23}{2017/03/02}{Fix for vert bar column type.} % % \begin{macrocode} \newcommand*{\LWR@printmccoldata}[1]{% \LWR@traceinfo{lwr@printmccoldata -#1}% % \end{macrocode} % Not yet found a valid column type: % \begin{macrocode} \boolfalse{LWR@validtablecol}% % \end{macrocode} % Get one token of the column spec: % \begin{macrocode} \StrChar{#1}{\theLWR@tablemulticolspos}[\LWR@strresult]% % \end{macrocode} % Print the text depending on which column type is found. % Also handles |@|, |>|, |<| as it comes to them. % \begin{macrocode} \IfStrEq{\LWR@strresult}{l}{\LWR@multicoltext}{}% \IfStrEq{\LWR@strresult}{c}{\LWR@multicoltext}{}% \IfStrEq{\LWR@strresult}{r}{\LWR@multicoltext}{}% \IfStrEq{\LWR@strresult}{D}{% \addtocounter{LWR@tablemulticolspos}{3}% skip parameters \LWR@multicoltext% }{}% \IfStrEq{\LWR@strresult}{p}{\LWR@multicolpartext}{}% \IfStrEq{\LWR@strresult}{m}{\LWR@multicolpartext}{}% \IfStrEq{\LWR@strresult}{b}{\LWR@multicolpartext}{}% \IfStrEq{\LWR@strresult}{P}{\LWR@multicolpartext}{}% \IfStrEq{\LWR@strresult}{M}{\LWR@multicolpartext}{}% \IfStrEq{\LWR@strresult}{B}{\LWR@multicolpartext}{}% \IfStrEq{\LWR@strresult}{S}{\LWR@multicolpartext}{}% \IfStrEq{\LWR@strresult}{X}{\LWR@multicolpartext}{}% \IfStrEq{\LWR@strresult}{|}{\LWR@multicolskip}{}% \IfStrEq{\LWR@strresult}{\detokenize{@}}{\LWR@multicolother{#1}}{}% \IfStrEq{\LWR@strresult}{\detokenize{!}}{\LWR@multicolother{#1}}{}% \IfStrEq{\LWR@strresult}{\detokenize{>}}{\LWR@multicolother{#1}}{}% \IfStrEq{\LWR@strresult}{\detokenize{<}}{\LWR@multicolother{#1}}{}% % \end{macrocode} % If an invalid column type: % \begin{macrocode} \ifbool{LWR@validtablecol}{}{\LWR@multicoltext}% % \end{macrocode} % Tracing: % \begin{macrocode} \LWR@traceinfo{lwr@printmccoldata done}% } % \end{macrocode} % \end{macro} % \begin{macro}{\parsemulticolumnalignment} % \marg{1: colspec} \marg{2: printresults} % % Scan the multicolumn specification and execute the printfunction % for each entry. % % Note that the spec for a |p{spec}| column, or |@|, |>|, |<|, is a token list % which will NOT match |l|, |c|, |r|, or |p|. % \begin{macrocode} \newcommand*{\LWR@parsemulticolumnalignment}[2]{% \setcounter{LWR@tablemulticolspos}{1}% \StrLen{#1}[\LWR@strresult]% \setcounter{LWR@tablemulticolswidth}{\LWR@strresult}% % \end{macrocode} % Scan across the tokens in the column spec: % \begin{macrocode} \whiledo{% \not\value{LWR@tablemulticolspos}>\value{LWR@tablemulticolswidth}% }% {% % \end{macrocode} % Execute the assigned print function for each token in the column spec: % \begin{macrocode} #2{#1}% % \end{macrocode} % Move to the next token in the column spec: % \begin{macrocode} \addtocounter{LWR@tablemulticolspos}{1}% }% } % \end{macrocode} % \end{macro} % \subsubsection{High-level multicolumn interface} % \begin{macro}{\LWR@domulticolumn} \marg{1: numcols} \marg{2: colspec} \marg{3: text} % % \begin{macrocode} \newcommand{\LWR@multicoltext}{} \NewDocumentCommand{\LWR@domulticolumn}{m m +m}{% \LWR@traceinfo{lwr@domulticolumn -#1- -#2-}% % \end{macrocode} % Remember the text to be inserted, and % remember that a valid column type was found: % \begin{macrocode} \renewcommand{\LWR@multicoltext}{% #3% \booltrue{LWR@validtablecol}% }% % \end{macrocode} % Row processing: % \begin{macrocode} \LWR@maybenewtablerow% % \end{macrocode} % Begin the opening table data tag: % \begin{macrocode} \LWR@htmltag{td colspan="#1" class="td% % \end{macrocode} % Print the column type: % \begin{macrocode} \LWR@parsemulticolumnalignment{#2}{\LWR@printmccoltype}% % \end{macrocode} % If this column has a cmidrule, add ``rule'' to the end of the \HTML\ class tag. % % If this position had a ``Y'' then add ``rule''. % \begin{macrocode} \ifthenelse{\equal{\LWR@getexparray{LWR@midrules}{\theLWR@tablecolspos}}{Y}}{rule}{}% % \end{macrocode} % Close the class tag's opening quote: % \begin{macrocode} "% }% end of the opening table data tag \global\boolfalse{LWR@intabularmetadata}% \LWR@parsemulticolumnalignment{#2}{\LWR@printmccoldata}% } % \end{macrocode} % \end{macro} % \subsubsection{Longtable captions} % \DescribeBoolean{LWR@starredlongtable} % Per the \pkg{caption} pacakge, step the counter if |longtable*|. % % \begin{macrocode} \newbool{LWR@starredlongtable} \boolfalse{LWR@starredlongtable} % \end{macrocode} % % % Per the \pkg{caption} package. User-redefinable float type. % \begin{macrocode} \providecommand*{\LTcaptype}{table} % \end{macrocode} % % % \begin{macro}{\LWR@longtabledatacaptiontag} * \oarg{toc entry} \marg{caption} % % \changes{v0.20}{2017/01/08}{Fix: Pars in captions.} % % \begin{macrocode} \NewDocumentCommand{\LWR@longtabledatacaptiontag}{s o +m} {% % \end{macrocode} % Remember the latest name for \cs{nameref}: % \begin{macrocode} \IfValueTF{#2}{% optional given? \ifthenelse{\equal{#2}{}}% optional empty? {\LWR@setlatestname{#3}}% empty {\LWR@setlatestname{#2}}% given and non-empty }% optional given {\LWR@setlatestname{#3}}% no optional % \end{macrocode} % create a multicolumn across all the columns % \begin{macrocode} \LWR@domulticolumn{\theLWR@tabletotalcols}{P}{% \LWR@domulticolumn % \IfBooleanTF{#1}% star? % {\IfValueTF{#2}{\LWR@origcaption*[#2]{#3}}{\LWR@origcaption*{#3}}} % {\IfValueTF{#2}{\LWR@origcaption[#2]{#3}}{\LWR@origcaption{#3}}} \IfBooleanTF{#1}% star? % \end{macrocode} % Star version, show a caption but do not make a LOT entry: % \begin{macrocode} {% yes star \LWR@htmlblocktag{figcaption}% #3% \LWR@htmlblocktag{/figcaption}% }% {% No star: % \end{macrocode} % Not the star version: % % Don't step the counter if |\caption[]{A caption.}| % \begin{macrocode} \ifbool{LWR@starredlongtable}% {% \ifthenelse{\equal{#2}{}}% TOC entry {}% {% \refstepcounter{\LTcaptype}% \protected@edef\@currentlabel{% \csuse{p@\LTcaptype}\csuse{the\LTcaptype}}% }% }{}% % \end{macrocode} % Create an \HTML\ caption. Afterwards, maybe make a LOT entry. % \begin{macrocode} \LWR@htmlblocktag{figcaption}% \csuse{fnum@\LTcaptype}\CaptionSeparator#3% \LWR@htmlblocktag{/figcaption}% % \end{macrocode} % See if an optional caption was given: % \begin{macrocode} \ifthenelse{\equal{#2}{}}% TOC entry empty % \end{macrocode} % if the optional caption was given, but empty, do not form a TOC entry % \begin{macrocode} {}% % \end{macrocode} % If the optional caption was given, but might only be |[]|: % \begin{macrocode} {% TOC entry not empty \IfNoValueTF{#2}% No TOC entry? % \end{macrocode} % The optional caption is |[]|: % \begin{macrocode} {% No TOC entry \addcontentsline% {\csuse{ext@\LTcaptype}}% {\LTcaptype}% {% \protect\numberline% {\csuse{p@\LTcaptype}\csuse{the\LTcaptype}}% {\ignorespaces #3\protect\relax}% }% }% end of No TOC entry % \end{macrocode} % The optional caption has text enclosed: % \begin{macrocode} {% yes TOC entry \addcontentsline% {\csuse{ext@\LTcaptype}}% {\LTcaptype}% {% \protect\numberline% {\csuse{p@\LTcaptype}\csuse{the\LTcaptype}}% {\ignorespaces #2\protect\relax}% }% }% end of yes TOC entry }% end of TOC entry not empty }% end of no star }% end of \LWR@domulticolumn \addtocounter{LWR@tablecolspos}{\theLWR@tabletotalcols} \addtocounter{LWR@tablecolspos}{-1} } % \end{macrocode} % \end{macro} % \subsubsection{\textbackslash{}tabledatamulticolumntag} % \begin{macro}{\LWR@tabledatamulticolumntag} \marg{numcols} \marg{alignment} \marg{text} % \begin{macrocode} \NewDocumentCommand{\LWR@tabledatamulticolumntag}{m m +m}% {% \LWR@domulticolumn{#1}{#2}{#3}% \addtocounter{LWR@tablecolspos}{#1}% \addtocounter{LWR@tablecolspos}{-1}% } % \end{macrocode} % \end{macro} % \subsection{Multirow} % \DescribePackage{multirow} % \begin{macro}{\LWR@tabledatamultirowtag} % \marg{numrows} \oarg{bigstruts} \marg{width} \oarg{fixup} \marg{text} % \changes{v0.19}{2015/05/28}{Added optional args.} % \begin{macrocode} \NewDocumentCommand{\LWR@tabledatamultirowtag}{m o m o m}% {% \LWR@maybenewtablerow% % \end{macrocode} % Print the start of a new table data cell: % \begin{macrocode} \LWR@htmltag{td rowspan="#1" class="td% % \end{macrocode} % Append this column's spec: % \begin{macrocode} \StrChar{\LWR@tablecolspec}{\theLWR@tablecolspos}% % \end{macrocode} % If this column has a cmidrule, add ``rule'' to the end of the \HTML\ class tag: % \begin{macrocode} \ifthenelse{\equal{\LWR@getexparray{LWR@midrules}{\theLWR@tablecolspos}}{Y}}{rule}{}% "{}} % \end{macrocode} % While printing the text, redefine |\\| to generate a new line % \begin{macrocode} \begingroup \let\\\LWR@endofline #5 \endgroup \LWR@stoppars% \global\boolfalse{LWR@intabularmetadata}% }% % \end{macrocode} % \end{macro} % \subsection{Utility macros inside a table} % \begin{macrocode} \newcommand*{\LWR@donothing}{} \newcommand*{\LWR@domidrule}{\booltrue{LWR@doinghline}} \newcommand*{\LWR@dotbrule}{\booltrue{LWR@doingtbrule}} % \end{macrocode} % \subsection{Checking for a new table cell} % \begin{macro}{\LWR@tabledatacolumntag} % Open a new \HTML\ table cell unless the next token is for a macro % which does not create data, such as |\hline|, |\toprule|, etc: % \begin{macrocode} \newbool{LWR@exitingtabular} \newcommand*{\LWR@tabledatacolumntag}% {% % \end{macrocode} % \hspace*{.5in} |\show\LWR@mynexttoken| to see what tokens to look for % \begin{macrocode} % \end{macrocode} % If not any of the below, start a new table cell: % \begin{macrocode} \let\mynext\LWR@tabledatasinglecolumntag% % \end{macrocode} % If exiting the tabular: % \begin{macrocode} \ifthenelse{\isequivalentto{\LWR@mynexttoken}{\end}}% {\booltrue{LWR@exitingtabular}}{}% % \end{macrocode} % \env{longtable} can have a caption in a cell % \begin{macrocode} \ifthenelse{\isequivalentto{\LWR@mynexttoken}{\caption}}% {\let\mynext\LWR@donothing}{}% % \end{macrocode} % Look for other things which would not start a table cell: % \begin{macrocode} \ifthenelse{\isequivalentto{\LWR@mynexttoken}{\multicolumn}}% {\let\mynext\LWR@donothing}{}% \ifthenelse{\isequivalentto{\LWR@mynexttoken}{\multirow}}% {\let\mynext\LWR@donothing}{}% % \end{macrocode} % if come to an |\mrowcell|, this is a cell to be skipped over % \begin{macrocode} \ifthenelse{\isequivalentto{\LWR@mynexttoken}{\mrowcell}}% {\let\mynext\LWR@donothing}{}% % \ifthenelse{\isequivalentto{\LWR@mynexttoken}{\hline}}% {\let\mynext\LWR@donothing}{}% % \ifthenelse{\isequivalentto{\LWR@mynexttoken}{\toprule}}% {% \let\mynext\LWR@donothing}{}% % \ifthenelse{\isequivalentto{\LWR@mynexttoken}{\midrule}}% {\let\mynext\LWR@donothing}{}% % \ifthenelse{\isequivalentto{\LWR@mynexttoken}{\cmidrule}}% {\let\mynext\LWR@donothing}{}% % \ifthenelse{\isequivalentto{\LWR@mynexttoken}{\cline}}% {\let\mynext\LWR@donothing}{}% % \ifthenelse{\isequivalentto{\LWR@mynexttoken}{\bottomrule}}% {\let\mynext\LWR@donothing}{}% % \ifthenelse{\isequivalentto{\LWR@mynexttoken}{\warpprintonly}} {\let\mynext\LWR@donothing}{}% % \ifthenelse{\isequivalentto{\LWR@mynexttoken}{\warpHTMLonly}} {\let\mynext\LWR@donothing}{}% % \end{macrocode} % no action for an |\end| token % % Add similar to the above for any other non-data tokens % which might appear in the table. % % Start the new table cell if was not any of the above: % \begin{macrocode} \mynext% } % \end{macrocode} % \end{macro} % \begin{macrocode} \end{warpHTML} % \end{macrocode} % \subsection{\textbackslash{}mrowcell} % \begin{macro}{\mrowcell} % The user must insert |\mrowcell| into any multirow cells which must be skipped. % This command has no action during print output. % \watchout % \codeall % \begin{macrocode} \begin{warpall} \newcommand*{\mrowcell}{} \end{warpall} % \end{macrocode} % \end{macro} % \subsection{New \textbackslash{}tabular definition} % \codehtml % \begin{macrocode} \begin{warpHTML} % \end{macrocode} % \begin{environment}{LWR@tabular} \oarg{vertposition} \marg{colspecs} % % The new tabular environment will be |\let| in |\LWR@LwarpStart|, % since \pkg{siunitx} might redefine tabular in the user's document. % \begin{macrocode} \newenvironment*{LWR@tabular}[2][] {% \LWR@traceinfo{tabular started}% \begingroup% \addtocounter{LWR@tabulardepth}{1}% % \end{macrocode} % Not yet started a table row: % \begin{macrocode} \global\boolfalse{LWR@startedrow}% % \end{macrocode} % Not yet doing an hline: % \begin{macrocode} \global\boolfalse{LWR@doinghline}% % \end{macrocode} % Not yet doing a top/bottom rule: % \begin{macrocode} \global\boolfalse{LWR@doingtbrule}% % \end{macrocode} % Have not yet found the end of tabular command: % \begin{macrocode} \boolfalse{LWR@exitingtabular}% % \end{macrocode} % Create the |table| tag: % \begin{macrocode} \global\booltrue{LWR@intabularmetadata}% \LWR@forcenewpage \LWR@htmlblocktag{table}% % \end{macrocode} % Parse the table columns: % \begin{macrocode} \LWR@parsetablecols{#2}% % \end{macrocode} % Table col spec is: \cs{LWR@tablecolspec} which is a string of |llccrr|, etc. % % Do not place the table inside a paragraph: % \begin{macrocode} \LWR@stoppars% % \end{macrocode} % Track column \# for setting text-align: % \begin{macrocode} \setcounter{LWR@tablecolspos}{1}% % \end{macrocode} % Start looking for midrules: % \begin{macrocode} \LWR@clearmidrules% % \end{macrocode} % |\\| becomes a macro to end the table row: % \begin{macrocode} \let\\\LWR@tabularendofline% % \end{macrocode} % The following may appear before a data cell is created, % so after doing their actions, we look ahead with |\LWR@getmynextoken| % to see if the next token might create a new data cell: % \begin{macrocode} \renewcommand*{\hline}{\LWR@domidrule\LWR@getmynexttoken}% \newcommand*{\midrule}{\LWR@domidrule\LWR@getmynexttoken}% \NewDocumentCommand{\cmidrule}{o d() m}% {\LWR@docmidrule[##1](##2){##3}\LWR@getmynexttoken}% \RenewDocumentCommand{\cline}{m}% {\LWR@docmidrule{##1}\LWR@getmynexttoken}% \newcommand*{\toprule}{\LWR@dotbrule\LWR@getmynexttoken}% \newcommand*{\bottomrule}{\LWR@dotbrule\LWR@getmynexttoken}% % \end{macrocode} % The following create data cells and will have no more data in this cell, % so we do not want to look ahead for a possible data cell, % so do not want to use |\LWR@getmynexttoken|. % \begin{macrocode} \let\multicolumn\LWR@tabledatamulticolumntag% \let\multirow\LWR@tabledatamultirowtag% \renewcommand*{\mrowcell}{\global\booltrue{LWR@skippingmrowcell}}% \let\caption\LWR@longtabledatacaptiontag% % \end{macrocode} % Reset for new processing: % \begin{macrocode} \global\boolfalse{LWR@tableparcell}% \global\boolfalse{LWR@skippingmrowcell}% % \end{macrocode} % Look ahead for a possible table data cell: % \begin{macrocode} \LWR@getmynexttoken% }% % \end{macrocode} % Ending the environment: % \begin{macrocode} {% \LWR@closetabledatacell% \LWR@htmlblocktag{/tr}% \LWR@htmlblocktag{/table}% \global\boolfalse{LWR@intabularmetadata}% % \end{macrocode} % \begin{macrocode} \addtocounter{LWR@tabulardepth}{-1}% \endgroup% } % \end{macrocode} % \end{environment} % \begin{macrocode} \end{warpHTML} % \end{macrocode} % \subsection{Array} % \label{sec:array} % \DescribePackage{array} % % \pkg{array} is also automatically loaded by siunitx. % \section{Cross-references} % % Sectioning commands have been emulated from scratch, so the cross-referencing % commands are custom-written for them. % Emulating both avoids several layers of patches. % % The \pkg{zref} package is used to remember section name, file, and % lateximage depth and number for each label. % % \Cref{tab:crossrefdata} shows the data structures related to cross-referencing. % % \changes{v0.14}{2016/03/29}{Docs: Table: Cross-referencing data structures.} % \changes{v0.19}{2016/05/25}{Docs: Table: Cross-referencing data structures, updated.} % \begin{table} % \small % \caption{Cross-referencing data structures\label{tab:crossrefdata}} % \medskip % \hrule % \smallskip % \begin{description}[nosep] % \raggedright % \item [Original \LaTeX:] \hfill (print and \HTML) % \begin{description} % \item [\cs{refstepcounter}:] Steps the couunter and sets \cs{@currentlabel}. % \item [\cs{@currentlabel}:] \cs{p@}\cs{the} Updated by \cs{refstepcounter}. % \item [\cs{label}:] Writes to the |.aux| file: % \qquad |\newlabel{

| tag with optional alignment style: % \begin{macrocode} \LWR@traceinfo{minipage: creating div class}% \LWR@orignewpage% \LWR@htmltag{div class="minipage" style="% \ifthenelse{\equal{#1}{t}}{vertical-align: bottom ; }{}% \ifthenelse{\equal{#1}{c}}{vertical-align: middle ; }{}% \ifthenelse{\equal{#1}{b}}{vertical-align: top ; }{}% \ifthenelse{\equal{#3}{t}}{justify-content: flex-start ; }{}% \ifthenelse{\equal{#3}{c}}{justify-content: center ; }{}% \ifthenelse{\equal{#3}{b}}{justify-content: flex-end ; }{}% \ifthenelse{\equal{#3}{s}}{justify-content: space-between ; }{}% % \end{macrocode} % Print the width and optional height styles: % \begin{macrocode} \LWR@traceinfo{minipage: about to print the width of \rndprintlength{\LWR@minipagewidth}}% \uselengthunit{PT}% \ifbool{LWR@minipagefullwidth}% {\boolfalse{LWR@minipagefullwidth}}% {% \ifthenelse{\lengthtest{#4}=\linewidth}% {}% {width:\rndprintlength{\LWR@minipagewidth} ; }% }% \LWR@traceinfo{minipage: about to print the height}% \IfValueTF{#2}{height:\rndprintlength{\LWR@minipageheight} ; }{}% "{}}% % \end{macrocode} % Finish with an empty line to start \LaTeX{} minipage processing on a new line. % Use a large minipage area to avoid the unnecessary wrapping of tags. % \begin{macrocode} \LWR@origminipage{6in}% The preceding empty line is required. % \end{macrocode} % Set the user-accessible minipage and text width and height values inside the minipage. % These do not affect the actual size of the large minipage created by % \cs{LWR@origminipage} above, but are used by any reference to \cs{linewidth}, etc. % inside the \PDF\ minipage being created here. % \begin{macrocode} \setlength{\linewidth}{#4}% the original width \setlength{\textwidth}{6in}% \setlength{\textheight}{9in}% % \end{macrocode} % |\raggedright| cancels hyphenation, which will be done by \HTML\ instead. % \begin{macrocode} \LWR@origraggedright% % \end{macrocode} % Resume paragraph tag handling for the contents of the minipage: % \begin{macrocode} \LWR@startpars% \LWR@traceinfo{minipage: finished starting the minipage}% } % \end{macrocode} % End the environment with \LaTeX{} processing and closing tag: % \begin{macrocode} {% \LWR@stoppars% \LWR@endminipage% The following empty line is required: \LWR@htmldivclassend{minipage}% \vspace{1\baselineskip}% required for subcaption \addtocounter{LWR@minipagedepth}{-1}% \LWR@startpars% % \end{macrocode} % Prevent paragraph tags around horizontal white space % until the start of the next paragraph: % \begin{macrocode} \global\booltrue{LWR@minipagethispar}% } % \end{macrocode} % \end{environment} % % % \subsection{Parbox, makebox, framebox, fbox, raisebox} % % % \begin{macro}{\parbox} \oarg{pos} \oarg{height} \oarg{inner-pos} \marg{width} \marg{text} % % A parbox uses the minipage code: % \begin{macrocode} \RenewDocumentCommand{\parbox}{O{t} o O{t} m +m} { \LWR@traceinfo{parbox of width #4}% \begin{minipage}[#1][#2][#3]{#4} #5 \end{minipage} } % \end{macrocode} % \end{macro} % % % \begin{macro}{\makebox} \oarg{width} \oarg{pos} \marg{text} % % Width and position are ignored. % \begin{macrocode} \let\LWR@origmakebox\makebox \RenewDocumentCommand{\makebox}{o o m}{% \mbox{#3} } % \end{macrocode} % \end{macro} % % % \begin{macro}{\framebox} \oarg{width} \oarg{pos} \marg{text} % % Width and position are ignored. % \begin{macrocode} \RenewDocumentCommand{\framebox}{o o m}{% \fbox{#3} } % \end{macrocode} % \end{macro} % % % \begin{macro}{\fbox} \marg{text} % \begin{macrocode} \let\LWR@origfbox\fbox % \renewcommand*{\fbox}[1]{% \InlineClass{framebox}{#1}% } % \end{macrocode} % \end{macro} % % % \begin{macro}{\raisebox} \marg{raiselen} \oarg{height} \oarg{depth} \marg{text} % \begin{macrocode} \RenewDocumentCommand{\raisebox}{m o o m}{% #4% } % \end{macrocode} % \end{macro} % \begin{macrocode} \end{warpHTML} % \end{macrocode} % \section{Direct formatting} % \label{sec:directformatting} % % \limitstext % % For high-level block and inline custom CSS classes, % see \cref{sec:highlevelclasses}. % \codehtml % \begin{macrocode} \begin{warpHTML} % \end{macrocode} % \begin{macro}{\emph} \marg{text} % \begin{macrocode} \renewcommand{\emph}[1]{\LWR@htmlspan{em}{#1}} % \end{macrocode} % \end{macro} % \begin{macro}{\textmd} \marg{text} % \begin{macrocode} \renewcommand{\textmd}[1]{\LWR@htmlspan{textmd}{#1}} % \end{macrocode} % \end{macro} % \begin{macro}{\textbf} \marg{text} % \begin{macrocode} \renewcommand{\textbf}[1]{\LWR@htmlspan{b}{#1}} % \end{macrocode} % \end{macro} % \begin{macro}{\textrm} \marg{text} % \begin{macrocode} \renewcommand{\textrm}[1]{\InlineClass{textrm}{#1}} % \end{macrocode} % \end{macro} % \begin{macro}{\textsf} \marg{text} % \begin{macrocode} \renewcommand{\textsf}[1]{\InlineClass{textsf}{#1}} % \end{macrocode} % \end{macro} % \begin{macro}{\texttt} \marg{text} % \begin{macrocode} \renewcommand{\texttt}[1]{\LWR@htmlspan{kbd}{#1}} % \end{macrocode} % \end{macro} % \begin{macro}{\textup} \marg{text} % \changes{v0.28}{2017/04/13}{Fixed span class.} % \begin{macrocode} \renewcommand{\textup}[1]{\InlineClass{textup}{#1}} % \end{macrocode} % \end{macro} % \begin{macro}{\textit} \marg{text} % \begin{macrocode} \renewcommand{\textit}[1]{\LWR@htmlspan{i}{#1}} % \end{macrocode} % \end{macro} % \begin{macro}{\textsc} \marg{text} % \begin{macrocode} \renewcommand{\textsc}[1]{\InlineClass{textsc}{#1}} % \end{macrocode} % \end{macro} % \begin{macro}{\textnormal} \marg{text} % \begin{macrocode} \renewcommand{\textnormal}[1]{\textmd{\textrm{\textup{#1}}}} % \end{macrocode} % \end{macro} % \begin{macro}{\mdseries} % \begin{macrocode} \renewcommand*{\mdseries}{} % \end{macrocode} % \end{macro} % \begin{macro}{\bfseries} % \begin{macrocode} \renewcommand*{\bfseries}{} % \end{macrocode} % \end{macro} % \begin{macro}{\rmfamily} % \begin{macrocode} \renewcommand*{\rmfamily}{} % \end{macrocode} % \end{macro} % \begin{macro}{\sffamily} % \begin{macrocode} \renewcommand*{\sffamily}{} % \end{macrocode} % \end{macro} % \begin{macro}{\ttfamily} % \begin{macrocode} \renewcommand*{\ttfamily}{} % \end{macrocode} % \end{macro} % \begin{macro}{\upshape} % \begin{macrocode} \renewcommand*{\upshape}{} % \end{macrocode} % \end{macro} % \begin{macro}{\itshape} % \begin{macrocode} \renewcommand*{\itshape}{} % \end{macrocode} % \end{macro} % \begin{macro}{\scshape} % \begin{macrocode} \renewcommand*{\scshape}{} % \end{macrocode} % \end{macro} % \begin{macro}{\scshape} % \begin{macrocode} \renewcommand*{\normalfont}{} % \end{macrocode} % \end{macro} % \begin{macro}{\sp} \marg{text} % For \pkg{siunitx}. Must work in math mode. % \begin{macrocode} \renewcommand{\sp}[1]{\text{#1}{}} % \end{macrocode} % \end{macro} % \begin{macro}{\sb} \marg{text} % For \pkg{siunitx}. Must work in math mode. % \begin{macrocode} \renewcommand{\sb}[1]{\text{#1}{}} % \end{macrocode} % \end{macro} % \begin{macro}{\textsuperscript} \marg{text} % \begin{macrocode} \renewcommand{\textsuperscript}[1]{\LWR@htmlspan{sup}{#1}} % \end{macrocode} % \end{macro} % \begin{macro}{\textsubscript} \marg{text} % \begin{macrocode} \renewcommand{\textsubscript}[1]{\LWR@htmlspan{sub}{#1}} % \end{macrocode} % \end{macro} % \begin{macro}{\up} \marg{text} Prints superscript. % % This is \cs{let} at the beginning of the document in case some other package % has changed the definition. % \begin{macrocode} \AtBeginDocument{\let\up\textsuperscript} % \end{macrocode} % \end{macro} % \begin{macro}{\fup} \marg{text} Prints superscript. % % Supports \pkg{fmtcount} package. % % This is \cs{let} at the beginning of the document in case some other package % has changed the definition. % \begin{macrocode} \AtBeginDocument{\let\fup\textsuperscript} % \end{macrocode} % \end{macro} % \begin{macro}{\hfill} % \changes{v0.20}{2016/12/12}{Inserts a \cs{qquad}.} % \begin{macrocode} \renewcommand*{\hfill}{\qquad} % \end{macrocode} % \end{macro} % \begin{macro}{\hrulefill} % \changes{v0.20}{2017/01/19}{Inserts a short rule.} % \begin{macrocode} \renewcommand*{\hrulefill}{\rule{1in}{1pt}} % \end{macrocode} % \end{macro} % \begin{macro}{\dotfill} % \changes{v0.20}{2017/01/19}{Inserts an ellipsis.} % \begin{macrocode} \renewcommand*{\dotfill}{\dots} % \end{macrocode} % \end{macro} % \begin{macrocode} \end{warpHTML} % \end{macrocode} % \section{Skips, spaces, font sizes} % \codehtml % \begin{macrocode} \begin{warpHTML} % \end{macrocode} % |\,| must be redefined after |\RequirePackage{printlen}| % \begin{macrocode} \let\LWR@origcomma\, \let\LWR@origtilde~ \let\LWR@origenskip\enskip \let\LWR@origquad\quad \let\LWR@origqquad\qquad \let\LWR@orighspace\hspace \let\LWR@origrule\rule \let\LWR@origmedskip\medskip % \end{macrocode} % Direct-formatting space commands become \HTML\ entities: % \begin{macrocode} \renewcommand*{\,}{\HTMLunicode{202f}} % HTML thin non-breakable space % \end{macrocode} % ^^A \renewcommand*{\,}{\HTMLunicode{2009}} % HTML thin wrappable space % ^^A \renewcommand*{\,}{\HTMLentity{nbsp}} % regular-width non-breakable space % \begin{macrocode} \renewcommand*{~}{\HTMLentity{nbsp}} \renewcommand*{\textellipsis}{\HTMLunicode{2026}} % \end{macrocode} % Direct-formatting font sizes are ignored: % \begin{macrocode} \let\LWR@orignormalsize\normalsize \let\LWR@origsmall\small \let\LWR@origfootnotesize\footnotesize \let\LWR@origscriptsize\scriptsize \let\LWR@origtiny\tiny \let\LWR@origlarge\large \let\LWR@origLarge\Large \let\LWR@origLARGE\LARGE \let\LWR@orighuge\huge \let\LWR@origHuge\Huge \renewcommand*{\normalsize}{} \renewcommand*{\small}{} \renewcommand*{\footnotesize}{} \renewcommand*{\scriptsize}{} \renewcommand*{\tiny}{} \renewcommand*{\large}{} \renewcommand*{\Large}{} \renewcommand*{\LARGE}{} \renewcommand*{\huge}{} \renewcommand*{\Huge}{} \renewcommand*{\onecolumn}{} \renewcommand{\twocolumn}[1][]{ #1 } % \end{macrocode} % \begin{macro}{\newline} % Uses \HTML\ |
| tag % \begin{macrocode} \newcommand*{\LWR@newlinebr}{\unskip\LWR@htmltag{br /}\LWR@orignewline}% \let\newline\LWR@newlinebr % \end{macrocode} % \end{macro} % \DescribeMacro{\\} Redefined to \cs{LWR@endofline} or \cs{LWR@tabularendofline}. % % \begin{macro}{\LWR@endofline} * \oarg{len} % \changes{v0.20}{2016/08/20}{Fix: \protect\textbackslash\protect\textbackslash} % % |\\| is assigned to \cs{LWR@endofline} at \cs{LWR@LwarpStart}. % % Inside |tabular|, |\\| is temporarily changed to \cs{LWR@tabularendofline}. % \begin{macrocode} \let\LWR@origendofline\\ \NewDocumentCommand{\LWR@endofline}{s o} {% \newline% } % \end{macrocode} % \end{macro} % \begin{macro}{\LWR@minipagestartpars} % \changes{v0.19}{2016/05/31}{Surpresses paragraph tags between minipages.} % \index{minipage>horizontal space between} % \index{space>horizontal between minipages} % \index{horizontal space>between minipages} % Minipages are often placed side-by-side inside figures, with a bit of % horizontal space to separate them. Since \HTML\ does not allow % a \tag{div} to be inside a |p|, paragraphs must be turned off during the % generation of the minipage, then turned on after the minipage is complete. % When this occurs between side-by-side minipages, |lwarp| correctly % surpresses the paragraph tags between the minipages, unless some other % text is between the minipages. Such text forms its own paragraph, resulting % in text after a minipage to be on its own line. Since people often place % \DescribeMacro{\hspace} % \DescribeMacro{\enskip} % \DescribeMacro{\quad} % \DescribeMacro{\qquad} % small horizontal space between minipages, it is desirable to maintain this % space if possible. |lwarp| tries to do this by remembering that a minipage % has been seen, in which case paragraph tags are surpressed around % \cs{hspace}, \cs{enskip}, \cs{quad}, and \cs{qquad} until the end of the paragraph, when % the closing |p| tag is created. % % When a minipage is seen, the boolean % |LWR@minipagethispar| is set, telling the following horizontal % whitespace commands to try to surpress their surrounding paragraph % tags. |LWR@minipagethispar| is cleared at the next % end of paragraph, when the \HTML\ paragraph closing tag is % generated. % % Placed just before \cs{hspace}, \cs{quad}, or \cs{qquad}'s \HTML\ output. % \begin{macrocode} \newcommand*{\LWR@minipagestartpars}{% \ifbool{LWR@minipagethispar}% {% \LWR@startpars% }{}% } % \end{macrocode} % \end{macro} % \begin{macro}{\LWR@minipagestoppars} % Placed just after \cs{hspace}, \cs{quad}, or \cs{qquad}'s \HTML\ output. % \begin{macrocode} \newcommand*{\LWR@minipagestoppars}{% \ifbool{LWR@minipagethispar}% {% \LWR@stoppars% }{}% } % \end{macrocode} % \end{macro} % \begin{macro}{\quad} % Handles special minipage \& horizontal space interactions. % \begin{macrocode} \renewcommand*{\quad}{% \LWR@minipagestoppars% \HTMLunicode{2001}% \LWR@minipagestartpars% } % \end{macrocode} % \end{macro} % \begin{macro}{\qquad} % Handles special minipage \& horizontal space interactions. % \begin{macrocode} \renewcommand*{\qquad}{\quad\quad} % \end{macrocode} % \end{macro} % \begin{macro}{\enskip} % Handles special minipage \& horizontal space interactions. % \begin{macrocode} \renewcommand*{\enskip}{% \LWR@minipagestoppars% \HTMLunicode{2000}% \LWR@minipagestartpars% } % \end{macrocode} % \end{macro} % \DescribeLength{LWR@tempwidth} % \DescribeLength{LWR@tempheight} % \DescribeLength{LWR@tempraise} % Used to compute span width, height, raise for \cs{hspace} and \cs{rule}: % \begin{macrocode} \newlength{\LWR@tempwidth} \newlength{\LWR@tempheight} \newlength{\LWR@tempraise} % \end{macrocode} % % \begin{macro}{\LWR@hspace} * \marg{length} % % Handles special minipage \& horizontal space interactions. % \changes{v0.18}{2016/05/13}{\cs{hspace} supported.} % \changes{v0.19}{2016/05/29}{Fix: \cs{hspace} length computations.} % \changes{v0.20}{2016/08/22}{Add: Supports \HTML\ thin breakable space.} % \changes{v0.24}{2017/03/14}{Add: \cs{hspace} \cs{fill} converts to 2em} % % Prints a span of a given width. Ignores the optional star. % % |\hspace{\fill}| is converted to |\hspace{2em}|, equal to \cs{qquad}. % \begin{macrocode} \NewDocumentCommand{\LWR@hspace}{s m}{% \setlength{\LWR@tempwidth}{#2}% % \end{macrocode} % If \cs{fill}, change to \cs{qquad}: % \begin{macrocode} \ifnum\gluestretchorder\LWR@tempwidth>0% \setlength{\LWR@tempwidth}{2em}% \fi% % \end{macrocode} % Only if the width is not zero: % \begin{macrocode} \ifthenelse{\dimtest{\LWR@tempwidth}{=}{0pt}}{}{% % \end{macrocode} % If had a minipage this paragraph, try to inline the % white space without generating paragraph tags: % \begin{macrocode} \LWR@minipagestoppars% % \end{macrocode} % Support the \HTML\ thin wrappable space: % \begin{macrocode} \ifthenelse{\dimtest{\LWR@tempwidth}{=}{.16667em}} {% \HTMLunicode{2009}% thin breakable space }% % \end{macrocode} % Print the span with the converted width. Not rounded. % \begin{macrocode} {% \uselengthunit{PT}% \LWR@htmltagc{% span style="width:\printlength{\LWR@tempwidth}; display:inline-block;"% }% \LWR@htmltagc{/span}% }% % \end{macrocode} % If had a minipage this paragraph, try to inline the % white space without generating paragraph tags: % \begin{macrocode} \LWR@minipagestartpars% }% } % \end{macrocode} % \end{macro} % % % \begin{macro}{\hspace} * \marg{length} % % Handles special minipage \& horizontal space interactions. % \begin{macrocode} \let\hspace\LWR@hspace % \end{macrocode} % \end{macro} % \begin{macro}{\linebreak} \oarg{num} \qquad % Inserts an \HTML\ |br| tag. % \begin{macrocode} \renewcommand*{\linebreak}[1][]{\newline} % \end{macrocode} % \end{macro} % \begin{macro}{\nolinebreak} \oarg{num} % \begin{macrocode} \renewcommand*{\nolinebreak}[1][]{} % \end{macrocode} % \end{macro} % \begin{macro}{\pagebreak} \oarg{num} \qquad % Starts a new paragraph. % \begin{macrocode} \renewcommand*{\pagebreak}[1][]{ } % \end{macrocode} % \end{macro} % \begin{macro}{\nopagebreak} \oarg{num} % \begin{macrocode} \renewcommand*{\nopagebreak}[1][]{} % \end{macrocode} % \end{macro} % \begin{macro}{\enlargethispage} * \marg{len} % \begin{macrocode} \RenewDocumentCommand{\enlargethispage}{s m}{} % \end{macrocode} % \end{macro} % \begin{macro}{\LWR@rule} \oarg{raise} \marg{width} \marg{height} % % Handles special minipage \& horizontal space interactions. % % Creates a span of a given width and height. Ignores the optional star. % % \cs{fill} is zero-width, so |\hspace{\fill}| is ignored. % \begin{macrocode} \NewDocumentCommand{\LWR@rule}{o m m}{% % \end{macrocode} % The width is copied into a temporary \LaTeX\ length, from which % comparisons and conversions may be made: % \begin{macrocode} \setlength{\LWR@tempwidth}{#2}% % \end{macrocode} % If it's zero-width then skip the entire rule: % \begin{macrocode} \ifthenelse{\lengthtest{\LWR@tempwidth=0pt}} {}% zero- width {% non-zero width % \end{macrocode} % If it's non-zero width, set a minimal thickness so that it % more reliably shows in the browser: % \begin{macrocode} \ifthenelse{\lengthtest{\LWR@tempwidth>0pt}\AND% \lengthtest{\LWR@tempwidth<1pt}}% {\setlength{\LWR@tempwidth}{1pt}}{}% % \end{macrocode} % Likewise with height: % \begin{macrocode} \setlength{\LWR@tempheight}{#3}% \ifthenelse{\lengthtest{\LWR@tempheight>0pt}\AND% \lengthtest{\LWR@tempheight<1pt}}% {\setlength{\LWR@tempheight}{1pt}}{}% % \end{macrocode} % If had a minipage this paragraph, try to inline the % rule without generating paragraph tags: % \begin{macrocode} \LWR@minipagestoppars% % \end{macrocode} % Print the span with the converted width and height. % The width and height are NOT rounded, since a height of % less than 1pt is quite common in \LaTeX\ code. % \begin{macrocode} \uselengthunit{PT}% \LWR@htmltagc{% span style=" % % \end{macrocode} % The background color is used to draw the filled rule. % The color may be changed by \cs{textcolor}. % \begin{macrocode} background:\LWR@currenttextcolor; % % \end{macrocode} % The width and height are printed, converted to PT: % \begin{macrocode} width:\printlength{\LWR@tempwidth}; % height:\printlength{\LWR@tempheight}; % % \end{macrocode} % The raise height is converted to a \CSS\ transform. % The |*2| raise multiplier is to approximately match \HTML\ output's X height. % Conversion to a \LaTeX\ length allows a typical \LaTeX\ expression to be % used as an argument for the raise, whereas printing the raise argument % directly to \HTML\ output without conversion to a \LaTeX\ length % limits the allowable syntax. To do:\ A superior method would compute a % ratio of \LaTeX\ ex height, then print that to \HTML\ with an ex unit. % \begin{macrocode} \IfValueTF{#1}% {% \setlength{\LWR@tempraise}{0pt-#1}% \setlength{\LWR@tempraise}{\LWR@tempraise*2}% \LWR@orignewline% -ms-transform: translate(0pt,\printlength{\LWR@tempraise}); % \LWR@orignewline% -webkit-transform: translate(0pt,\printlength{\LWR@tempraise}); % \LWR@orignewline% transform: translate(0pt,\printlength{\LWR@tempraise}); % \LWR@orignewline% }{}% % \end{macrocode} % Display inline-block to place the span inline with the text: % \begin{macrocode} display:inline-block;"% }% \LWR@htmltagc{/span}% % \end{macrocode} % If had a minipage this paragraph, try to inline the % white space without generating paragraph tags: % \begin{macrocode} \LWR@minipagestartpars% }% non-zero width } % \end{macrocode} % \end{macro} % % % \begin{macro}{\rule} \oarg{raise} \marg{width} \marg{height} % \changes{v0.19}{2016/06/01}{Added} % % Handles special minipage \& horizontal space interactions. % \begin{macrocode} \let\rule\LWR@rule % \end{macrocode} % \end{macro} % \begin{macrocode} \end{warpHTML} % \end{macrocode} % \section{\textbackslash{}phantomsection} % \codehtml % \begin{macrocode} \begin{warpHTML} % \end{macrocode} % \begin{macro}{\phantomsection} % Emulate the hyperref |\phantomsection| command, % often used to insert the bibliography into table of contents: % \begin{macrocode} \newcommand*{\phantomsection}{\section*{}} % \end{macrocode} % \end{macro} % \begin{macrocode} \end{warpHTML} % \end{macrocode} % \section{\textbackslash{}LaTeX and other logos} % Logos for \HTML\ and print modes: % % Some of these logos may be redefined in a later package, % so after loading other packages, and at the beginning of the document, their definitions % are finally |\let| in |\LWR@LwarpStart|. % % For \CSS\ conversions, see: \\ % \url{http://edward.oconnor.cx/2007/08/tex-poshlet} \\ % \url{http://nitens.org/taraborelli/texlogo} % % % % \subsection{HTML logos} % % \codehtml % \begin{macrocode} \begin{warpHTML} % \end{macrocode} % \begin{macro}{\TeX} \TeX % \nopagebreak % % |latexlogo| is a \CSS\ class used to properly typeset the E and A in \LaTeX{} and friends. % % |latexlogofont| is a \CSS\ class used to select the font for the rest of the logo in % \LaTeX, \LuaTeX, \ConTeXt, etc. % \begin{macrocode} \newcommand*{\LWR@TeX} {\InlineClass{latexlogofont}% {\InlineClass{latexlogo}{T\textsubscript{e}X}}} % \end{macrocode} % \end{macro} % % \begin{macro}{\LaTeX} % \begin{macro}{\LaTeXe} \LaTeX, \LaTeXe % \begin{macrocode} \newcommand*{\LWR@LaTeX} {\InlineClass{latexlogofont}% {\InlineClass{latexlogo}% {L\textsuperscript{a}T\textsubscript{e}X}}} \renewcommand*{\LaTeXe} {\LaTeX\InlineClass{latexlogofont}% {\,2\textsubscript{\textit{\HTMLunicode{3B5}}}}} % \end{macrocode} % \end{macro} % \end{macro} % \begin{macro}{\LuaTeX} % \begin{macro}{\LuaLaTeX} \LuaTeX, \LuaLaTeX % \begin{macrocode} \newcommand*{\LWR@LuaTeX}{\InlineClass{latexlogofont}{Lua}\TeX} \newcommand*{\LWR@LuaLaTeX}{\InlineClass{latexlogofont}{Lua}\LaTeX} % \end{macrocode} % \end{macro} % \end{macro} % \begin{macro}{\XeTeX} % \begin{macro}{\XeLaTeX} \XeTeX, \XeLaTeX % \nopagebreak % % |xetexlogo| is a \CSS\ class which aligns the backwards E in \XeTeX{} and spaces \TeX{} % appropriately. % % |xelatexlogo| is a \CSS\ class which aligns the backwards E in \XeLaTeX{} and spaces % \LaTeX{} appropriately. % \begin{macrocode} \newcommand*{\Xe} {X\textsubscript{\HTMLunicode{18e}}} \newcommand*{\LWR@XeTeX}{\InlineClass{xetexlogo}{\Xe}\TeX} \newcommand*{\LWR@XeLaTeX}{\InlineClass{xelatexlogo}{\Xe}\LaTeX} % \end{macrocode} % \end{macro} % \end{macro} % \begin{macro}{\ConTeXt} \ConTeXt % \begin{macrocode} \newcommand*{\LWR@ConTeXt} {\InlineClass{latexlogofont}{Con}\TeX{}% \InlineClass{latexlogofont}{t}} % \end{macrocode} % \end{macro} % \begin{macro}{\BibTeX} % \begin{macro}{\MakeIndex} \BibTeX, \MakeIndex % \begin{macrocode} \providecommand*{\BibTeX} {\InlineClass{latexlogofont}{B\textsc{ib}}\TeX} \newcommand*{\MakeIndex} {\InlineClass{latexlogofont}{\textit{MakeIndex}}} % \end{macrocode} % \end{macro} % \end{macro} % \begin{macro}{\AmS} \AmS % \nopagebreak % % |amslogo| is a \CSS\ class used for the \AmS logo. % \begin{macrocode} \AtBeginDocument{\DeclareDocumentCommand{\AmS}{} {\InlineClass{amslogo}{\textit{A\textsubscript{M}S}}}} % \end{macrocode} % \end{macro} % \begin{macro}{\MiKTeX} \MiKTeX % \begin{macrocode} \newcommand*{\MiKTeX}{\InlineClass{latexlogofont}{MiK}\TeX} % \end{macrocode} % \end{macro} % \begin{macro}{\LyX} \LyX % \nopagebreak % % |lyxlogo| is a \CSS\ class used for the \LyX logo. % \begin{macrocode} \newcommand*{\LyX}{\InlineClass{lyxlogo}{LyX}} % \end{macrocode} % \end{macro} % \begin{macrocode} \end{warpHTML} % \end{macrocode} % % \subsection{Print logos} % % \codeprint % \begin{macrocode} \begin{warpprint} \newcommand*{\XeTeXrevE} {\hspace{-.1667em}\raisebox{-.5ex}{\reflectbox{E}}\hspace{-.125em}} \providecommand*{\XeTeX}{\mbox{X\XeTeXrevE\TeX}} \providecommand*{\XeLaTeX}{\mbox{X\XeTeXrevE\LaTeX}} \providecommand*{\AmS}{% \leavevmode\hbox{$\mathcal A\kern-.2em\lower.376ex% \hbox{$\mathcal M$}\kern-.2em\mathcal S$}} \newcommand*{\LyX}{\textsf{LyX}} \providecommand*{\LuaTeX}{\mbox{Lua\TeX}} \providecommand*{\LuaLaTeX}{\mbox{Lua\LaTeX}} \providecommand*{\BibTeX}{\mbox{B\textsc{ib}\TeX}} \providecommand*{\MakeIndex}{\mbox{\textit{MakeIndex}}} \providecommand*{\ConTeXt}{\mbox{Con\TeX{}t}} \providecommand*{\MiKTeX}{\mbox{MiK\TeX}} \end{warpprint} % \end{macrocode} % \section{\textbackslash{}AtBeginDocument, \textbackslash{}AtEndDocument} % \codehtml % \begin{macrocode} \begin{warpHTML} % \end{macrocode} % \begin{macro}{\LWR@LwarpStart} % \begin{macro}{\LWR@LwarpEnd} % Automatically sets up the \HTML-related actions for the start and end of the % document. % \begin{macrocode} \AfterEndPreamble{\LWR@LwarpStart} \AtEndDocument{\LWR@LwarpEnd} % \end{macrocode} % \end{macro} % \end{macro} % \begin{macrocode} \end{warpHTML} % \end{macrocode} % \clearpage % \section{lwarpmk.conf} % \DescribeFile{lwarpmk.conf} % |lwarpmk.conf| is automatically (re-)created by the \pkg{lwarp} package when % executing\\ % \hspace*{2ex} |pdflatex |,\\ % or similar for |xelatex| or |lualatex|, in print-document generation mode, % which is the default unless the |warpHTML| option is given. % |lwarpmk.conf| is then used by the utility |lwarpmk|. % % An example |lwarpmk.conf|: % \begin{Verbatim}[gobble=2,frame=lines,obeytabs,tabsize=4,formatcom={\unskip}] % opsystem = "Unix" -- or "Windows" % latexname = "pdflatex" -- or "lualatex" or "xelatex" % sourcename = "projectname" -- your .tex source % homehtmlfilename = "index" -- or "projectname" % htmlfilename = "" -- or "projectname" if numbered HTML files % \end{Verbatim} % % \changes{v0.29}{2017/04/15}{File \protect\texttt{lwarpmk.conf}: Add: \protect\texttt{language} option for config files.} % % Defaults unless already over-ridden by the user: % \begin{macrocode} \providecommand*{\HomeHTMLFileName}{\BaseJobname} \providecommand*{\HTMLfiveName}{} \providecommand*{\UseLatexmk}{false} % \end{macrocode} % \codeprint % \begin{macrocode} \begin{warpprint} \ifcsdef{LWR@file}{}{\newwrite{\LWR@file}} \immediate\openout\LWR@file=lwarpmk.conf \ifwindows \immediate\write\LWR@file{opsystem = "Windows"} \else \immediate\write\LWR@file{opsystem = "Unix"} \fi \ifPDFTeX \immediate\write\LWR@file{latexname = "pdflatex"} \fi \ifXeTeX \immediate\write\LWR@file{latexname = "xelatex"} \fi \ifLuaTeX \immediate\write\LWR@file{latexname = "lualatex"} \fi \immediate\write\LWR@file{sourcename = "\jobname"} \immediate\write\LWR@file{% homehtmlfilename = "\HomeHTMLFileName"% } \immediate\write\LWR@file{htmlfilename = "\HTMLfiveName"} \immediate\write\LWR@file{uselatexmk = "\UseLatexmk"} \immediate\write\LWR@file{language = "\LWR@lwarpmklang"} \immediate\closeout\LWR@file \end{warpprint} % \end{macrocode} % \clearpage % \section{Trademarks} % % \changes{v0.14}{2016/03/29}{Docs: Trademarks section.} % % \begin{itemize} % \item \TeX\ is a trademark of American Mathematical Society. % \item Adobe® and Adobe Framemaker® are either registered trademarks or % trademarks of Adobe Systems Incorporated in the United States and/or other countries. % \item Linux® is the registered trademark of Linus Torvalds in the U.S.\ and other countries. % \item Mac\,OS® is a trademark of Apple Inc. % \item MadCap Flare™ is the property of MadCap Software, Inc. % \item MathJax is copyright 2009 and later. % The MathJax Consortium is a joint venture of the American Mathematical Society (AMS) % and the Society for Industrial and Applied Mathematics (SIAM) % to advance mathematical and scientific content on the web. % \item Microsoft®, Encarta, MSN, and Windows® are either registered trademarks or % trademarks of Microsoft Corporation in the United States and/or other countries. % \item UNIX® is a registered trademark of The Open Group. % \end{itemize} % \iffalse % % \fi % % % % \clearpage % % % \iffalse %<*lwarp-newproject> % \fi % % \part{lwarp-newproject.sty} % % \changes{v0.20}{2016/12/20}{\pkg{lwarp-newproject}: Added.} % % \section{lwarp-newproject} % % \DescribePackage{lwarp-newproject} % \pkg{lwarp-newproject} is used to create lwarp-specific % system files in a new project. % % \DescribeOption[lwarp-newproject]{warpprint} Configuration files are only % created if the |warpprint| option was used. When this is the case, % \pkg{lwarp-newproject} knows that \cs{jobname} is the source code's filename % (as opposed to the |_html.tex| filename). % % \DescribeOption[lwarp-newproject]{warpHTML} Does not create configuration files. % |warpprint| or |warpHTML| are passed to both \pkg{lwarp} and % \pkg{lwarp-newproject} by |lwarpmk|, depending on whether |lwarpmk print| % or |lwarpmk html| was used. % % \DescribeOption[lwarp-newproject]{BaseJobName} |BaseJobname=somename| sets % \cs{BaseJobname} to |somename|, which is used to set \cs{HomeHTMLFileName}, % which is then written to the |lwarpmk.conf| and |.lwarpmkconf| % configuration files. % % \cs{BaseJobname} is also written to |_html.tex| as an option % given for the \pkg{lwarp} and \pkg{lwarp-newproject} packages during the % creation of \HTML\ output. % % \cs{BaseJobname} is the \cs{jobname} of the printed version, even while compiling % the \HTML\ version, where \cs{jobname} has |_html| appended. % % \DescribeOption[lwarp-newproject]{lwarpmk} Tells |lwarp-newproject| to % generate a local copy of |lwarpmk| called |lwarpmk.lua|. % Useful for archiving for future use. % This file may be made executable and acts just like |lwarpmk|. % % \DescribeOption[lwarp-newproject]{lwarpmklang} Sets the language to be assigned % in |lwarpmk|'s configuration files. This is then used by |lwarpmk| while % processing the glossary. % % In the document source: % \begin{Verbatim}[gobble=2,frame=lines,obeytabs,tabsize=4,formatcom={\unskip}] % \documentclass{article} % or book, report % ... % (font selection, input encoding) % ... % \newcommand*{\HomeHTMLFileName}{index}, or {projectname} % \newcommand*{\HTMLfiveName}{} % \usepackage{lwarp-newproject} % \usepackage{lwarp} % ... % (load other packages, the rest of the preamble) % ... % \NewCSS{project.css} % \NewHTMLdescription{Summarize this webpage.} % ... % \begin{document} % ... % \end{document} % \end{Verbatim} % % Place |\usepackage{lwarp-newproject}| just before |\usepackage{lwarp}| in the % document source. The operating system and \TeX\ engine will be auto-detected, % and a customized |lwarpmk.conf| file will be generated, along with % the other support files (|*.css|, |lwarp_html.xdy|, |lwarp_mathjax.txt|). % Rename |sample_project.css| to your own custom |projectname.css| and % edit it if desired. % % After the first compile, |\usepackage{lwarp-newproject}| % may be commented out unless the configuration changes. % For example, it may be re-enabled % to switch between |pdflatex|, |xelatex|, and |lualatex|, in which case % a new manual compile (without using |lwarpmk|) will auto-configure and % regenerate the files. It may also be left enabled at all times, in which case % the configuration files will be regenerated each time. Note that your own % |projectname.css| file will not be over-written by the newly regenerated % |sample_project.css|. % % Discard all options for \pkg{lwarp-newproject}: % \begin{macrocode} \ProvidesPackage{lwarp-newproject} \RequirePackage{etoolbox} \RequirePackage{comment} \RequirePackage{fancyvrb} \RequirePackage{ifplatform}% sense op-system platform \RequirePackage{iftex}% sense pdflatex/lualatex/xelatex \RequirePackage{kvoptions} \SetupKeyvalOptions{family=LWRNP,prefix=LWRNP@} % \end{macrocode} % Generate config files? % \begin{macrocode} \newbool{LWRNP@genconf} \boolfalse{LWRNP@genconf} % \end{macrocode} % Optionally generate a local copy of |lwarpmk|. Default to no: % \begin{macrocode} \excludecomment{LWR@createlwarpmk} % \end{macrocode} % Process options: % % \changes{v0.29}{2017/04/15}{Add: \protect\texttt{lwarpmklang} option for \pkg{lwarp-newproject}.} % % \begin{macrocode} \DeclareVoidOption{warpprint}{\booltrue{LWRNP@genconf}} \DeclareVoidOption{warpHTML}{\boolfalse{LWRNP@genconf}} \DeclareVoidOption{lwarpmk}{\includecomment{LWR@createlwarpmk}} \DeclareStringOption[\jobname]{BaseJobname} \DeclareStringOption[english]{lwarpmklang} \booltrue{LWRNP@genconf}% warpprint \ProcessKeyvalOptions*\relax % \end{macrocode} % Assign the \cs{BaseJobname} if the user hasn't provided one: % \begin{macrocode} \providecommand*{\BaseJobname}{\LWRNP@BaseJobname} % \end{macrocode} % Defaults unless already over-ridden by the user: % \begin{macrocode} % \ifbool{LWRNP@genconf}{ \providecommand*{\HomeHTMLFileName}{\BaseJobname} % }{} \providecommand*{\HTMLfiveName}{} \providecommand*{\UseLatexmk}{false} % \end{macrocode} % % \ifbool{LWRNP@genconf}{\typeout{lwarp-newproject: generating configuration files}}{} % \subsection{project\_html.tex} % % \DescribeFile{project_html.tex} Used to allow an \HTML\ version of the % document to exist alongside the print version. % % Only write |\jobname_html.tex| if generating the print version. % \begin{macrocode} \ifbool{LWRNP@genconf}{ \ifcsdef{LWR@file}{}{\newwrite{\LWR@file}} \immediate\openout\LWR@file=\jobname_html.tex \immediate\write\LWR@file{% \detokenize{\PassOptionsToPackage}% {warpHTML,BaseJobname=\jobname}{lwarp}% } \immediate\write\LWR@file{% \detokenize{\PassOptionsToPackage}% {warpHTML,BaseJobname=\jobname}{lwarp-newproject}% } \immediate\write\LWR@file{% \detokenize{\input}\string{\jobname.tex\string }% } \immediate\closeout\LWR@file }{} % \end{macrocode} % \subsection{project.lwarpmkconf} % % \DescribeFile{project.lwarpmkconf} The configuration file for |lwarpmk|. % % \changes{v0.29}{2017/04/15}{File \protect\texttt{*.lwarpmkconf}: Add: \protect\texttt{language} option for config files.} % % \begin{macrocode} \ifbool{LWRNP@genconf}{ \ifcsdef{LWR@file}{}{\newwrite{\LWR@file}} \immediate\openout\LWR@file=\jobname.lwarpmkconf \ifwindows \immediate\write\LWR@file{opsystem = "Windows"} \else \immediate\write\LWR@file{opsystem = "Unix"} \fi \ifPDFTeX \immediate\write\LWR@file{latexname = "pdflatex"} \fi \ifXeTeX \immediate\write\LWR@file{latexname = "xelatex"} \fi \ifLuaTeX \immediate\write\LWR@file{latexname = "lualatex"} \fi \immediate\write\LWR@file{sourcename = "\jobname"} \immediate\write\LWR@file{% homehtmlfilename = "\HomeHTMLFileName"% } \immediate\write\LWR@file{htmlfilename = "\HTMLfiveName"} \immediate\write\LWR@file{uselatexmk = "\UseLatexmk"} \immediate\write\LWR@file{language = "\LWRNP@lwarpmklang"} \immediate\closeout\LWR@file }{} % \end{macrocode} % \subsection{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}{\texttt{lwarp.css}: Improved responsive % \texttt{marginpar} and \texttt{marginblock}.} % % \begin{macrocode} \begin{VerbatimOut}{lwarp.css} /* CSS stylesheet for the LaTeX lwarp package Copyright 2016-2017 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.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 ;} /* Holds a section number to add space between it and the name */ span.sectionnumber { margin-right: .6em } /* Inserted in front of index lines */ span.indexitem {margin-left: 0em} span.indexsubitem {margin-left: 2em} span.indexsubsubitem {margin-left: 4em} div.hidden { display: none ; } kbd { font-family: "DejaVu Mono", "Bitstream Vera Mono", "Lucida Console", "Nimbus Mono L", "Liberation Mono", "FreeMono", "Andale Mono", "Courier New", monospace; font-size: 100% ; } span.strong { font-weight: bold; } span.textmd { font-weight: normal; } span.textsc { font-variant: small-caps; } span.textup { font-variant: normal; } span.textrm { font-family: "DejaVu Serif", "Bitstream Vera Serif", "Lucida Bright", Georgia, serif; } span.textsf { font-family: "DejaVu Sans", "Bitstream Vera Sans", Geneva, Verdana, sans-serif ; } span.attribution { margin-left: 1em ; font-size: 80% ; font-variant: small-caps; } span.citetitle { margin-left: 1em ; font-size: 80% ; font-style: oblique; } span.poemtitle { font-size: 120% ; font-weight: bold; } blockquote { margin-left: 0px ; margin-right: 0px ; } blockquote p { line-height: 1.5; text-align: left ; font-size: .85em ; margin-left: 3em ; margin-right: 3em ; } blockquotation { margin-left: 0px ; margin-right: 0px ; } blockquotation p { line-height: 1.5; text-align: left ; font-size: .85em ; margin-left: 3em ; margin-right: 3em ; } div.epigraph { 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{ text-align:right ; margin-left:auto ; /* max-width: 50% ; */ border-top: 1px solid #A0A0A0 ; padding-bottom: 3ex ; line-height: 1.2; } div.epigraph p { padding: .5ex ; margin: 0ex ;} div.epigraphsource p { padding: .5ex 0ex 0ex 0ex ; margin: 0ex ;} /* lettrine package: */ span.lettrine { font-size: 3ex ; float: left ; } span.lettrinetext { font-variant: small-caps ; } /* ulem and soul packages: */ span.uline { text-decoration: underline ; text-decoration-skip ; } span.uuline { text-decoration: underline ; text-decoration-skip ; text-decoration-style: double ; } span.uwave { text-decoration: underline ; text-decoration-skip ; text-decoration-style: wavy ; } span.sout { text-decoration: line-through ; } span.xout { text-decoration: line-through ; } span.dashuline { text-decoration: underline ; text-decoration-skip ; text-decoration-style: dashed ; } span.dotuline { text-decoration: underline ; text-decoration-skip ; 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; } 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 ; } 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 ; } /* Title of the file */ h1 { margin: 0ex 0em 0ex 0em ; line-height: 1.3; text-align: center ; } /* Part */ h2 { margin: 1ex 0em 1ex 0em ; line-height: 1.3; text-align: center ; } /* Chapter */ h3 { margin: 3ex 0em 1ex 0em ; line-height: 1.3; } /* Section */ h4 { margin: 3ex 0em 1ex 0em ; line-height: 1.3; } /* Sub-Section */ h5 { margin: 3ex 0em 1ex 0em ; line-height: 1.3; } /* Sub-Sub-Section */ h6 { margin: 3ex 0em 1ex 0em ; line-height: 1.3; } div.titlepage { text-align: center ; } .footnotes { font-size: .85em ; margin: 3ex 1em 0ex 1em ; padding-bottom: 1ex ; border-top: 1px solid silver ; } .marginpar { max-width:50%; float:right; 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 { max-width:50%; 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 { display: block ; margin: 0pt auto 0pt auto ; } div.marginblock div.minipage p { font-size: 85%} div.marginblock br { margin-bottom: 2ex ; } section.textbody div.footnotes{ margin: 3ex 0em 0ex 0em ; 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 ; } ol { margin: 1ex 1em 1ex 0em; line-height: 1.2; } ul, body dir, body menu { margin: 1ex 1em 1ex 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 ; } .inlineprogramlisting { font-family: "DejaVu Mono", "Bitstream Vera Mono", "Lucida Console", "Nimbus Mono L", "Liberation Mono", "FreeMono", "Andale Mono", "Courier New", monospace; overflow-x: auto; } div.abstract { margin: 2em 5% 2em 5% ; padding: 1ex 1em 1ex 1em ; /* font-weight: bold ; */ font-size: 90% ; } 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-weight:bold; text-align: center ; } .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 ; } /* Minipage environments, vertically aligned to top, center, bottom: */ .minipage { /* 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; } /* Paragraphs in the flexbox did not collapse their margins. */ /* Have not yet researched this. */ .minipage p {margin: .75ex 0em .75ex 0em ;} .framebox { margin: 0ex ; padding: 0ex ; border: 1px solid black; border-radius: 0px ; padding: .3ex .2em 0ex .2em ; margin: .1ex ; display: inline-block ; } .mdframed { /* padding: 0ex ; */ /* border: 1px solid blafck; */ /* border-radius: 0px ; */ padding: 0ex ; margin: 3ex 5% 3ex 5% ; /* display: inline-block ; */ } .mdframed p { padding: 0ex .5em 0ex .5em ; } .mdframed dl { padding: 0ex .5em 0ex .5em ; } .mdframedtitle { padding: .5em ; display: block ; font-size: 130% } .mdframedsubtitle { padding: 0ex .5em 0ex .5em ; display: block ; font-size: 115% ; } .mdframedsubsubtitle { padding: 0ex .5em 0ex .5em ; display: block ; } .mdtheorem { padding: 0ex .5em 0ex .5em ; margin: 3ex 5% 3ex 5% ; /* display: inline-block ; */ } /* framed package */ .framed { margin: 3ex 0em 3ex 0em ; border: 1px solid black; border-radius: 0px ; padding: .3ex 1em 0ex 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 } dl { margin: 1ex 2em 1ex 0em; line-height: 1.3; } dl dt { margin-top: 1ex; font-weight: bold; } dl dd p { margin-top: 0em; } nav.toc, nav.lof, nav.lot, nav.lol, nav.lothm { font-family: "URW Classico", Optima, "Linux Biolinum O", "DejaVu Sans", "Bitstream Vera Sans", Geneva, Verdana, sans-serif ; margin-bottom: 4ex ; } nav.toc p, nav.lof p, nav.lot p, nav.lol p, nav.lothm 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: 3ex auto 3ex 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 div.minipage p { font-size: 85% ; } figure.subfigure, figure.subtable { display: inline-block ; margin: 3ex 1em 3ex 1em ; } figcaption .minipage { margin:0 ; padding: 0 } 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 ; } figcaption , .lstlistingtitle { font-size: .85em ; text-align: center ; font-weight: bold ; margin-top: 1ex ; margin-bottom: 1ex ; } figure.subfigure figcaption, figure.subtable figcaption { 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 figcaption { border: none ; background: none ; } table { margin: 1ex auto 1ex auto ; border-collapse: collapse ; border-spacing: 0px ; line-height: 1.3 ; } tr.hline {border-top: 1px solid silver ; margin-top: 0ex ; margin-bottom: 0ex ; } /* for \hline */ tr.tbrule {border-top: 1px solid black ; margin-top: 0ex ; margin-bottom: 0ex ; } /* for \toprule, \bottomrule */ td {padding: 1ex .5em 1ex .5em ;} table td.tdl { text-align: left ; vertical-align: middle ; } table td.tdc { 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.tdlrule { text-align: left ; border-top: 1px solid silver ; vertical-align: middle ; } /* for cmidrule */ table td.tdcrule { text-align: center ; border-top: 1px solid silver ; vertical-align: middle ; } table td.tdrrule { text-align: right ; border-top: 1px solid silver ; vertical-align: middle ; } table td.tdprule { text-align: left ; border-top: 1px solid silver ; vertical-align: bottom ; } table td.tdmrule { text-align: left ; border-top: 1px solid silver ; vertical-align: middle ; } table td.tdbrule { text-align: left ; border-top: 1px solid silver ; vertical-align: top ; } table td.tdPrule { text-align: center ; border-top: 1px solid silver ; vertical-align: bottom ; } table td.tdMrule { text-align: center ; border-top: 1px solid silver ; vertical-align: middle ; } table td.tdBrule { text-align: center ; border-top: 1px solid silver ; vertical-align: top ; } /* 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:.85em; text-align: left ; } .tnotes dl dt p {margin-bottom:0px;} .tnoteitemheader {margin-right: 1em;} /* 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 ;} /* 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 ; } div.published { text-align: center ; font-variant: normal ; font-style: italic ; font-size: 1em ; margin: 3ex 0em 3ex 0em ; } div.subtitle { text-align: center ; font-variant: normal ; font-style: italic ; font-size: 1.25em ; margin: 3ex 0em 3ex 0em ; } div.subtitle p { margin: 1ex ; } div.author { font-variant: normal ; font-style: normal ; font-size: 1em ; margin: 3ex 0em 3ex 0em ; } div.author table { margin: 3ex 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: 6ex 0em 6ex 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:right ; } 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:right ; } header{ line-height: 1.2 ; font-size: 1em ; /* border-bottom: 2px solid silver ; */ margin: 0px ; padding: 0ex 1em 0ex 1em ; text-align:center ; } header p {margin:0ex;padding:4ex 0em 2ex 0em ;text-align:center;} footer{ font-size: .85em ; line-height: 1.2 ; margin-top: 1ex ; border-top: 2px solid silver ; padding: 2ex 1em 2ex 1em ; clear:right ; text-align:left ; } a.linkhome { font-weight:bold ; font-size: 1em ;} div.lateximagesource { padding: 0px ; margin: 0px ; display: none; } img.lateximage{ padding: 0px 0px 0px 0px ; box-shadow: none ; border: none ; background: none ; margin: 0px 0px -.15ex 0px ; /* pdfcrop leaves a slight margin, adjust to baseline */ max-width: 100% ; border-radius: 0ex ; border: none ; } nav.sidetoc { font-family: "DejaVu Serif", "Bitstream Vera Serif", "Lucida Bright", Georgia, serif; float:right ; width: 20%; border-left: 1px solid silver; border-top: 1px solid silver; border-bottom: 1px solid silver; /* border-top: 2px solid #808080 ; */ background: #FAF7F4 ; padding: 2ex 0em 2ex 1em ; margin: 0ex 0em 2ex 1em ; font-size:.9em ; border-radius: 20px 0px 0px 20px ; } div.sidetoccontents { /* border-top: 1px solid silver ; */ 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 to support algorithmicx: */ span.floatright { float: right ; } /* 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 CSS LaTeX and related logos: Based on: http://edward.oconnor.cx/2007/08/tex-poshlet http://nitens.org/taraborelli/texlogo */ .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; letter-spacing: .03em ; font-size: 1.1em; } .latexlogo sup { text-transform: uppercase; letter-spacing: .03em ; font-size: 0.85em; vertical-align: 0.15em; margin-left: -0.36em; margin-right: -0.15em; } .latexlogo sub { text-transform: uppercase; vertical-align: -0.5ex; margin-left: -0.1667em; margin-right: -0.125em; font-size: 1em; } .xetexlogo { 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; } /* A smaller gap between Xe and Tex v.s. LaTeX: */ .xetexlogo sub { text-transform: uppercase; vertical-align: -0.5ex; margin-left: -0.0667em; margin-right: -0.2em; font-size: 1em; letter-spacing: .03em ; } /* A large gap between Xe and LaTeX v.s. TeX: */ .xelatexlogo sub { text-transform: uppercase; vertical-align: -0.5ex; 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; } @media screen and (max-width: 45em) { /* nav.sidetoc {display:none;} */ nav.sidetoc { float: none ; width: 100% ; margin: 5ex 0px 5ex 0px ; padding: 0 ; border-radius: 0 ; border-bottom: 1px solid black ; border-top: 1px solid black ; box-shadow: none ; } /* nav.topnavigation { display:block } */ nav.botnavigation { display:block } .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; } nav.sidetoc { display:none; } nav.topnavigation { display: none; } nav.botnavigation { display: none; } } @media handheld { nav.sidetoc { display:none; } nav.topnavigation { display:block } nav.botnavigation { display:block } } @media projection { nav.sidetoc { display:none; } nav.topnavigation { display:block } nav.botnavigation { display:block } } \end{VerbatimOut} % \end{Verbatim}% for syntax highlighting % \end{macrocode} % \subsection{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. % % \begin{macrocode} \begin{VerbatimOut}{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;} 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 { 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; } .minipage { background-color: #eeeee7 ; border: 1px solid silver ; border-radius: 1ex ; } .framed .minipage , .framedleftbar .minipage { border: none ; background: none ; padding: 0ex ; margin: 0ex ; } figure.figure .minipage, figcaption .minipage { border: none; } div.marginblock 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 ; } /* figcaption { 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); } nav.sidetoc { background-color: #F7F7F0 ; background-image: linear-gradient(to bottom, #F7F7F0, #C0C0C0); box-shadow: 3px 3px 3px #808080 ; border-radius: 0px 0px 0px 20px ; } 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) { nav.sidetoc { border-radius: 0 ; } } \end{VerbatimOut} % \end{Verbatim}% for syntax highlighting % \end{macrocode} % \subsection{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. % % \begin{macrocode} \begin{VerbatimOut}{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 ; } 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 ; } .verse { 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; } figure { margin: 3ex 5% 3ex 5% ; padding: 1ex 1em 1ex 1em ; background-color: #fffcf5 ; overflow-x: auto ; border: none ; /* border-top: 1px solid silver; */ /* border-bottom: 1px solid silver; */ } figcaption , .lstlisting { border: none ; /* border-top: 1px solid silver ; */ /* border-bottom: 1px solid silver ; */ background-color: #fffcf5 ; } .tnotes { background: #fffcf5 ; } .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; } nav.sidetoc { 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); border-radius: 0px 0px 0px 20px ; } 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 ; clear:right ; text-align:left ; } nav.botnavigation { background: #dedcd5 ; border-top: 1px solid black ; } \end{VerbatimOut} % \end{Verbatim}% for syntax highlighting % \end{macrocode} % \subsection{sample\_project.css} % \DescribeFile{sample_project.css} % The project-specific \CSS\ file. Use with \cs{NewCSS}. % % If used, this must be present both when compiling the project % and also when distributing the \HTML\ files. % % \begin{macrocode} \begin{VerbatimOut}{sample_project.css} /* ( --- Start of project.css --- ) */ /* A sample project-specific CSS file for lwarp --- ) */ /* Load default lwarp settings: */ @import url("lwarp.css") ; /* or lwarp_formal.css, lwarp_sagebrush.css */ /* Project-specific CSS setting follow here. */ /* . . . */ /* ( --- End of project.css --- ) */ \end{VerbatimOut} % \end{Verbatim}% for syntax highlighting % \end{macrocode} % \subsection{lwarp\_html.xdy} % \DescribeFile{lwarp_html.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. % % \begin{macrocode} \begin{VerbatimOut}{lwarp_html.xdy} (require "tex/inputenc/latin.xdy") (merge-rule "\\PS *" "Postscript") (require "texindy.xdy") (require "page-ranges.xdy") (require "book-order.xdy") (markup-locref :open "\hyperindexref{" :close "}") \end{VerbatimOut} % \end{Verbatim}% for syntax highlighting % \end{macrocode} % \subsection{lwarp\_mathjax.txt} % \DescribeFile{lwarp_mathjax.txt} % Used by \pkg{lwarp} when using MathJax. % % This must be present when compiling the project, % but does not need to be present when distributing % the resulting \HTML\ files. % % \changes{v0.28}{2017/04/11}{File lwarp\_mathjax.txt: Updated CDN repository.} % % % \begin{macrocode} \begin{VerbatimOut}{lwarp_mathjax.txt} \end{VerbatimOut} % \end{Verbatim}% for syntax highlighting % \end{macrocode} % \subsection{Lwarpmk option} % The following is only generated if the |lwarpmk| option % was given to \pkg{lwarp-newproject}. % \begin{macrocode} \begin{LWR@createlwarpmk} % \end{macrocode} % \DescribeProgram{lwarpmk} Creates a local copy of |lwarpmk|: % % \changes{v0.21}{2017/02/11}{lwarpmk: Fix: \protect\texttt{lwarpmk again} for Windows.} % \changes{v0.21}{2017/02/22}{lwarpmk: Fix: \protect\texttt{lwarpmk limages} for Windows.} % \changes{v0.21}{2017/02/22}{lwarpmk: Fix: \protect\texttt{lwarpmk} uses \texttt{lateximages} text file instead of shell script.} % \changes{v0.28}{2017/04/14}{lwarpmk: Add: \protect\texttt{printglossary} and \protect\texttt{htmlglossary} commands.} % \changes{v0.29}{2017/04/15}{lwarpmk: Add: \protect\texttt{language} option for config files.} % % \begin{macrocode} \begin{VerbatimOut}{lwarpmk.lua} #!/usr/bin/env texlua -- Copyright 2016-2017 Brian Dunn -- Print the usage of the lwarpmk command: printversion = "v0.29" function printhelp () print ("lwarpmk: Use lwarpmk -h or lwarpmk --help for help.") ; end function printusage () print ( [[ lwarpmk print [project]: Compile a print version. lwarpmk printindex [project]: Process the index for the print version. lwarpmk printglossary [project]: Process the glossary for the print version. lwarpmk html [project]: Compile an HTML version. lwarpmk htmlindex [project]: Process the index for the html version. lwarpmk htmlglossary [project]: Process the glossary for the html version. lwarpmk again [project]: Touch the source code to trigger recompiles. lwarpmk limages [project]: Process the "lateximages" created by lwarp.sty. lwarpmk pdftohtml [project]: For use with latexmk or a Makefile: Convert project_html.pdf to project_html.html and individual HTML files. lwarpmk clean [project]: Remove project.aux, .toc, .lof/t, .idx, .ind, .log, .gl* lwarpmk cleanall [project]: Remove auxiliary files and also project.pdf, *.html lwarpmk -h: Print this help message. lwarpmk --help: Print this help message. ]] ) printconf () end -- Print the format of the configuration file lwarpmk.conf: function printconf () print ( [[ An example lwarpmk.conf or .lwarpmkconf project file: -- opsystem = "Unix" (or "Windows") latexname = "pdflatex" (or "lualatex", or "xelatex") sourcename = "projectname" (the source-code filename w/o .tex) homehtmlfilename = "index" (or perhaps the project name) htmlfilename = "" (or "projectname" - filename prefix) uselatexmk = "false" (or "true" to use latexmk to build PDFs) languge = "english" (use a language supported by xindy) -- Filenames must contain only letters, numbers, underscore, or dash. Values must be in "quotes". ]] ) ; end -- Split one large sourcefile into a number of files, -- starting with destfile. -- The file is split at each occurance of